/*! 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.stackConnectors_bundle_jsonpfunction=window.stackConnectors_bundle_jsonpfunction||[]).push([[45],{86:function(e,t,a){"use strict";a.r(t),a.d(t,"default",(function(){return u}));var s=a(1),n=a.n(s),l=a(25),i=a(0),r=a(10),o=a(2),c=a(9);const u=({actionParams:e,editAction:t,index:a,messageVariables:s,errors:u})=>{var p;const{eventAction:d,dedupKey:m,summary:g,source:x,severity:b,timestamp:j,component:y,group:v}=e,k=[{value:"critical",text:i.i18n.translate("xpack.stackConnectors.components.pagerDuty.severitySelectCriticalOptionLabel",{defaultMessage:"Critical"})},{value:"error",text:i.i18n.translate("xpack.stackConnectors.components.pagerDuty.severitySelectErrorOptionLabel",{defaultMessage:"Error"})},{value:"warning",text:i.i18n.translate("xpack.stackConnectors.components.pagerDuty.severitySelectWarningOptionLabel",{defaultMessage:"Warning"})},{value:"info",text:i.i18n.translate("xpack.stackConnectors.components.pagerDuty.severitySelectInfoOptionLabel",{defaultMessage:"Info"})}],O=[{value:"trigger",text:i.i18n.translate("xpack.stackConnectors.components.pagerDuty.eventSelectTriggerOptionLabel",{defaultMessage:"Trigger"})},{value:"resolve",text:i.i18n.translate("xpack.stackConnectors.components.pagerDuty.eventSelectResolveOptionLabel",{defaultMessage:"Resolve"})},{value:"acknowledge",text:i.i18n.translate("xpack.stackConnectors.components.pagerDuty.eventSelectAcknowledgeOptionLabel",{defaultMessage:"Acknowledge"})}],f="trigger"!==d,F="trigger"===d,h=void 0!==u.dedupKey&&u.dedupKey.length>0,C=void 0!==u.summary&&u.summary.length>0&&void 0!==g,E=void 0!==u.timestamp&&u.timestamp.length>0&&void 0!==j;return Object(c.jsx)(n.a.Fragment,null,Object(c.jsx)(l.EuiFlexGroup,null,Object(c.jsx)(l.EuiFlexItem,null,Object(c.jsx)(l.EuiFormRow,{fullWidth:!0,label:i.i18n.translate("xpack.stackConnectors.components.pagerDuty.eventActionSelectFieldLabel",{defaultMessage:"Event action"})},Object(c.jsx)(l.EuiSelect,{fullWidth:!0,"data-test-subj":"eventActionSelect",options:O,hasNoInitialSelection:Object(r.isUndefined)(d),value:d,onChange:e=>{t("eventAction",e.target.value,a)}})))),Object(c.jsx)(l.EuiFlexGroup,null,Object(c.jsx)(l.EuiFlexItem,null,Object(c.jsx)(l.EuiFormRow,{fullWidth:!0,error:u.dedupKey,isInvalid:h,label:f?i.i18n.translate("xpack.stackConnectors.components.pagerDuty.dedupKeyTextRequiredFieldLabel",{defaultMessage:"DedupKey"}):i.i18n.translate("xpack.stackConnectors.components.pagerDuty.dedupKeyTextFieldLabel",{defaultMessage:"DedupKey (optional)"})},Object(c.jsx)(o.TextFieldWithMessageVariables,{index:a,editAction:t,messageVariables:s,paramsProperty:"dedupKey",inputTargetValue:m})))),F?Object(c.jsx)(n.a.Fragment,null,Object(c.jsx)(l.EuiSpacer,{size:"m"}),Object(c.jsx)(l.EuiFormRow,{id:"pagerDutySummary",fullWidth:!0,error:u.summary,isInvalid:C,label:i.i18n.translate("xpack.stackConnectors.components.pagerDuty.summaryFieldLabel",{defaultMessage:"Summary"})},Object(c.jsx)(o.TextFieldWithMessageVariables,{index:a,editAction:t,messageVariables:s,paramsProperty:"summary",inputTargetValue:g,errors:null!==(p=u.summary)&&void 0!==p?p:[]})),Object(c.jsx)(l.EuiSpacer,{size:"m"}),Object(c.jsx)(l.EuiFlexGroup,null,Object(c.jsx)(l.EuiFlexItem,null,Object(c.jsx)(l.EuiFormRow,{fullWidth:!0,label:i.i18n.translate("xpack.stackConnectors.components.pagerDuty.severitySelectFieldLabel",{defaultMessage:"Severity (optional)"})},Object(c.jsx)(l.EuiSelect,{fullWidth:!0,"data-test-subj":"severitySelect",options:k,hasNoInitialSelection:Object(r.isUndefined)(b),value:b,onChange:e=>{t("severity",e.target.value,a)}}))),Object(c.jsx)(l.EuiFlexItem,null,Object(c.jsx)(l.EuiFormRow,{fullWidth:!0,error:u.timestamp,isInvalid:E,label:i.i18n.translate("xpack.stackConnectors.components.pagerDuty.timestampTextFieldLabel",{defaultMessage:"Timestamp (optional)"})},Object(c.jsx)(o.TextFieldWithMessageVariables,{index:a,editAction:t,messageVariables:s,paramsProperty:"timestamp",inputTargetValue:j,errors:u.timestamp})))),Object(c.jsx)(l.EuiSpacer,{size:"m"}),Object(c.jsx)(l.EuiFormRow,{fullWidth:!0,label:i.i18n.translate("xpack.stackConnectors.components.pagerDuty.componentTextFieldLabel",{defaultMessage:"Component (optional)"})},Object(c.jsx)(o.TextFieldWithMessageVariables,{index:a,editAction:t,messageVariables:s,paramsProperty:"component",inputTargetValue:y})),Object(c.jsx)(l.EuiFormRow,{fullWidth:!0,label:i.i18n.translate("xpack.stackConnectors.components.pagerDuty.groupTextFieldLabel",{defaultMessage:"Group (optional)"})},Object(c.jsx)(o.TextFieldWithMessageVariables,{index:a,editAction:t,messageVariables:s,paramsProperty:"group",inputTargetValue:v})),Object(c.jsx)(l.EuiFormRow,{fullWidth:!0,label:i.i18n.translate("xpack.stackConnectors.components.pagerDuty.sourceTextFieldLabel",{defaultMessage:"Source (optional)"})},Object(c.jsx)(o.TextFieldWithMessageVariables,{index:a,editAction:t,messageVariables:s,paramsProperty:"source",inputTargetValue:x})),Object(c.jsx)(l.EuiFormRow,{id:"pagerDutyClass",fullWidth:!0,label:i.i18n.translate("xpack.stackConnectors.components.pagerDuty.classFieldLabel",{defaultMessage:"Class (optional)"})},Object(c.jsx)(o.TextFieldWithMessageVariables,{index:a,editAction:t,messageVariables:s,paramsProperty:"class",inputTargetValue:e.class}))):null)}}}]);