{"version":3,"file":"9739.5a801055fcf72bf4d06f.js","mappings":"oOAiBO,MAAMA,EAAmB,CAAC,CAAE,OAAAC,EAAQ,aAAAC,EAAc,uBAAAC,CAAuB,IAAa,CAC3F,KAAM,CAACC,EAAeC,CAAW,KAAI,MAAuB,KAAmB,kBAAkB,EAE3FC,EAAWL,EAAO,oBAAoB,WAAW,KAAK,CAAC,CAAE,KAAAM,CAAK,IAAMA,IAASL,CAAY,EAC/F,GAAI,CAACI,EACH,OACE,gBAACE,EAAA,EAAK,CAAC,SAAS,QAAQ,MAAM,sBAAqB,8CAEnD,EAIJ,MAAMC,EAAW,CAACL,GAAiB,CAACC,EAEpC,OAAIF,IAA2B,KAE3B,gBAACO,EAAA,GACC,OAAAT,EACA,uBAAAE,EACA,SAAUG,EACV,SAAAG,CAAA,CACF,EAIA,gBAACE,EAAA,GACC,OAAAV,EACA,uBAAAE,EACA,SAAUG,EACV,SAAAG,CAAA,CACF,CAGN,ECJA,EAlCyB,CAAC,CAAE,MAAAG,CAAM,IAAa,CAC7C,KAAM,CAAE,qBAAAC,CAAqB,KAAI,MAAgB,EAC3C,CAAE,KAAAC,EAAM,UAAAC,EAAW,MAAAC,CAAM,KAAIC,EAAA,GAAsBJ,CAAoB,EAEvEK,EAAmBN,GAAO,OAAO,KACvC,OAAKM,EAIDH,GAAa,CAACD,EACT,aAGLE,EAEA,gBAACR,EAAA,EAAK,CAAC,SAAS,QAAQ,MAAM,iCAC3B,OAAOQ,CAAK,CACf,EAICF,EAKH,gBAACd,EAAA,CACC,uBAAwBa,EACxB,OAAQC,EACR,aAAc,mBAAmBI,CAAgB,EACnD,EARO,KAhBA,gBAACC,EAAA,EAAc,CAAC,OAAO,eAAgB,EA0BlD,C","sources":["webpack://grafana/./public/app/features/alerting/unified/components/receivers/EditReceiverView.tsx","webpack://grafana/./public/app/features/alerting/unified/components/contact-points/EditContactPoint.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Alert } from '@grafana/ui';\nimport { AlertManagerCortexConfig } from 'app/plugins/datasource/alertmanager/types';\n\nimport { AlertmanagerAction, useAlertmanagerAbility } from '../../hooks/useAbilities';\nimport { GRAFANA_RULES_SOURCE_NAME } from '../../utils/datasource';\n\nimport { CloudReceiverForm } from './form/CloudReceiverForm';\nimport { GrafanaReceiverForm } from './form/GrafanaReceiverForm';\n\ninterface Props {\n receiverName: string;\n config: AlertManagerCortexConfig;\n alertManagerSourceName: string;\n}\n\nexport const EditReceiverView = ({ config, receiverName, alertManagerSourceName }: Props) => {\n const [editSupported, editAllowed] = useAlertmanagerAbility(AlertmanagerAction.UpdateContactPoint);\n\n const receiver = config.alertmanager_config.receivers?.find(({ name }) => name === receiverName);\n if (!receiver) {\n return (\n \n Sorry, this receiver does not seem to exist.\n \n );\n }\n\n const readOnly = !editSupported || !editAllowed;\n\n if (alertManagerSourceName === GRAFANA_RULES_SOURCE_NAME) {\n return (\n \n );\n } else {\n return (\n \n );\n }\n};\n","import React from 'react';\nimport { RouteChildrenProps } from 'react-router-dom';\n\nimport { Alert } from '@grafana/ui';\nimport { EntityNotFound } from 'app/core/components/PageNotFound/EntityNotFound';\n\nimport { useAlertmanagerConfig } from '../../hooks/useAlertmanagerConfig';\nimport { useAlertmanager } from '../../state/AlertmanagerContext';\nimport { EditReceiverView } from '../receivers/EditReceiverView';\n\ntype Props = RouteChildrenProps<{ name: string }>;\n\nconst EditContactPoint = ({ match }: Props) => {\n const { selectedAlertmanager } = useAlertmanager();\n const { data, isLoading, error } = useAlertmanagerConfig(selectedAlertmanager);\n\n const contactPointName = match?.params.name;\n if (!contactPointName) {\n return ;\n }\n\n if (isLoading && !data) {\n return 'loading...';\n }\n\n if (error) {\n return (\n \n {String(error)}\n \n );\n }\n\n if (!data) {\n return null;\n }\n\n return (\n \n );\n};\n\nexport default EditContactPoint;\n"],"names":["EditReceiverView","config","receiverName","alertManagerSourceName","editSupported","editAllowed","receiver","name","Alert","readOnly","GrafanaReceiverForm","CloudReceiverForm","match","selectedAlertmanager","data","isLoading","error","useAlertmanagerConfig","contactPointName","EntityNotFound"],"sourceRoot":""}