!function(){"use strict";var e={};(function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e);var t=window.wp.element,n=window.lodash,r=window.nisje.core,a=window.nisje.settings,o=window.nisje.router,i=window.nisje.components,l=window.nisje.app.components,s=window.nisje.app.router,c=window.nisje.app.constants,d=window.nisje.views,w=window.nisje.data,m=window.nisje.icons,p=function(e){let{match:n}=e;const{id:r}=n.params,[a,o]=(0,w.useApiFetch)(`/wp/v2/nisje-alert/${r}`);return a?o?(0,t.createElement)(d.Message,{icon:m.warning},o.data.status,": ",o.message):(0,t.createElement)(i.EntryContainer,null,(0,t.createElement)(i.EntryHeader,{title:a.title.rendered}),(0,t.createElement)(i.EntryContent,null,a.content.rendered)):(0,t.createElement)(i.PostLoader,null)};const u=(0,c.getConstant)("alerts");(0,a.registerPlugin)("alerts",{render:()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(o.PluginRoutes,null,(0,t.createElement)(s.Route,{path:"/alerts/:id",component:p,exact:!0})),!(0,n.isEmpty)(u)&&(0,t.createElement)(r.BeforeFrontpageControls,null,u.map((e=>(0,t.createElement)("div",{key:e.id,className:`frontpage-alert is-color-${e.color}`},(0,t.createElement)(i.TextDeprecated,{as:"h2",variant:"title-large",mb:1},(0,t.createElement)(l.Link,{to:`/alerts/${e.id}/`},e.title)),(0,t.createElement)(i.TextDeprecated,{className:"frontpage-alert__excerpt"},e.excerpt))))))}),(window.nisje=window.nisje||{}).pluginAlerts=e}();