!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,l=window.nisje.router,i=window.nisje.components,o=window.nisje.views,s=window.nisje.data,c=window.nisje.icons,d=function({match:e}){const{id:n}=e.params,[r,a]=(0,s.useApiFetch)(`/wp/v2/nisje-alert/${n}`);return r?a?(0,t.createElement)(o.Message,{icon:c.warning},a.data.status,": ",a.message):(0,t.createElement)(i.EntryContainer,null,(0,t.createElement)(i.EntryHeader,null,r.title.rendered),(0,t.createElement)(i.EntryContent,null,r.content.rendered)):(0,t.createElement)(i.PostLoader,null)};const m=(0,a.getOption)("alerts");(0,a.registerPlugin)("alerts",{render:()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(l.PluginRoutes,null,(0,t.createElement)(l.Route,{path:"/alerts/:id",component:d,exact:!0})),!(0,n.isEmpty)(m)&&(0,t.createElement)(r.BeforeFrontpageControls,null,m.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}();