"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[3865],{83865:(u,o,t)=>{t.r(o),t.d(o,{default:()=>g});var a=t(74848),i=t(39558),l=t(42418),e=t(7392),n=t(53270),r=t(70383),p=t(79944),P=t(78742),M=t(5586),O=t(33594),m=t(33302);const f=(0,a.jsx)(e.L,{entity:"Notification template"}),g=({match:c})=>{const{selectedAlertmanager:_}=(0,r.VI)(),D=c?.params.name?decodeURIComponent(c?.params.name):void 0,{currentData:s,isLoading:C,error:E}=(0,m.J2)({alertmanager:_??"",uid:D??""}),{currentData:d,isLoading:L,error:T}=(0,m.cC)({alertmanager:_??""});if(!_)return(0,a.jsx)(e.L,{entity:"Alertmanager"});if(!D)return(0,a.jsx)(e.L,{entity:"Notification template"});if(C||L)return(0,a.jsx)(i._,{text:"Loading notification template"});if(E||T||!s||!d)return(0,n.E)(E)?f:(0,a.jsx)(l.F,{title:"Error loading notification template",severity:"error",children:(0,P.JZ)(E)});const A=(0,p.V)(s.title,d?.map(v=>v.title)??[]);return(0,a.jsx)(O.By,{alertmanager:_,prefill:{title:A,content:(0,M.a)(s.content)}})}},79944:(u,o,t)=>{t.d(o,{V:()=>a});function a(i,l){const e=i.replace(/\(copy( [0-9]+)?\)$/,"").trim();let n=`${e} (copy)`;for(let r=2;l.includes(n);r++)n=`${e} (copy ${r})`;return n}}}]);

//# sourceMappingURL=3865.f9b0cdf4244f8a62805d.js.map