function w() { class n extends React.Component { constructor(t) { super(t); } render() { var d = { emergency: /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", className: "quur-emergency-icon" }, /* @__PURE__ */ React.createElement("path", { d: "M256 32a224 224 0 1 1 0 448 224 224 0 1 1 0-448zm0 480A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c-8.8 0-16 7.2-16 16V272c0 8.8 7.2 16 16 16s16-7.2 16-16V144c0-8.8-7.2-16-16-16zm24 224a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z" })), warning: /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", className: "quur-emergency-icon" }, /* @__PURE__ */ React.createElement("path", { d: "M208 16c0-8.8 7.2-16 16-16s16 7.2 16 16V32.8c80.9 8 144 76.2 144 159.2v29.1c0 43.7 17.4 85.6 48.3 116.6l2.8 2.8c8.3 8.3 13 19.6 13 31.3c0 24.5-19.8 44.3-44.3 44.3H44.3C19.8 416 0 396.2 0 371.7c0-11.7 4.7-23 13-31.3l2.8-2.8C46.6 306.7 64 264.8 64 221.1V192c0-83 63.1-151.2 144-159.2V16zm16 48C153.3 64 96 121.3 96 192v29.1c0 52.2-20.7 102.3-57.7 139.2L35.6 363c-2.3 2.3-3.6 5.4-3.6 8.7c0 6.8 5.5 12.3 12.3 12.3H403.7c6.8 0 12.3-5.5 12.3-12.3c0-3.3-1.3-6.4-3.6-8.7l-2.8-2.8c-36.9-36.9-57.7-87-57.7-139.2V192c0-70.7-57.3-128-128-128zM193.8 458.7c4.4 12.4 16.3 21.3 30.2 21.3s25.8-8.9 30.2-21.3c2.9-8.3 12.1-12.7 20.4-9.8s12.7 12.1 9.8 20.4C275.6 494.2 251.9 512 224 512s-51.6-17.8-60.4-42.7c-2.9-8.3 1.4-17.5 9.8-20.4s17.5 1.4 20.4 9.8z" })), notice: /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 576 512", className: "quur-emergency-icon" }, /* @__PURE__ */ React.createElement("path", { d: "M560 32c-8.8 0-16 7.2-16 16V59.5L32 187.5V176c0-8.8-7.2-16-16-16s-16 7.2-16 16v19.5V208v96 12.5V336c0 8.8 7.2 16 16 16s16-7.2 16-16V324.5l131.7 32.9c-2.4 8.4-3.7 17.4-3.7 26.6c0 53 43 96 96 96c46.2 0 84.7-32.6 93.9-76L544 452.5V464c0 8.8 7.2 16 16 16s16-7.2 16-16V440 72 48c0-8.8-7.2-16-16-16zM544 419.5L32 291.5v-71l512-128v327zM192 384c0-6.5 1-12.9 2.8-18.8l124 31C313.1 425.7 287.2 448 256 448c-35.3 0-64-28.7-64-64z" })) }, g = this.props.data.map((c, s) => { var v = { __html: c.attributes.body.value }, a = new Date(c.attributes.field_notification_date); return /* @__PURE__ */ React.createElement("div", { key: "quur-block-emergency-emergency-alert-" + s, id: "quur-block-emergency-emergency-alert-" + s, className: "quur-emergency-alert-level-" + c.attributes.field_level.toLowerCase() + " quur-block-emergency-emergency-alert" }, /* @__PURE__ */ React.createElement("div", { className: "container" }, /* @__PURE__ */ React.createElement("div", { className: "row d-flex align-items-center" }, /* @__PURE__ */ React.createElement("div", { id: "quur-emergency-message-content-area-" + s, className: "col-sm-8" }, d[c.attributes.field_level.toLowerCase()], /* @__PURE__ */ React.createElement("h2", null, c.attributes.title, ":"), /* @__PURE__ */ React.createElement("div", { className: "content", dangerouslySetInnerHTML: v })), /* @__PURE__ */ React.createElement("div", { className: "col-sm-4" }, /* @__PURE__ */ React.createElement("div", { className: "quur-emergency-timestamp" }, /* @__PURE__ */ React.createElement("span", { id: "quur-emergency-message-timestamp-value", className: "quur-emergency-timestamp-value" }, /* @__PURE__ */ React.createElement("nobr", null, a.toLocaleString("en-CA", { month: "short" }), " ", a.toLocaleString("en-CA", { day: "numeric" }), ", ", a.toLocaleString("en-CA", { year: "numeric" })), " ", /* @__PURE__ */ React.createElement("nobr", null, a.toLocaleString("en-CA", { hour: "numeric", hour12: !0, minute: "2-digit" }).replaceAll(".", "")))))))); }); return [g]; } } function r(e) { const t = document.querySelector("#quur-emergency-alerts"); ReactDOM.createRoot(t, { identifierPrefix: "quurEmergencyAlertIds" }).render( /* @__PURE__ */ React.createElement(n, { data: e }) ); } const m = window.location.search, u = new URLSearchParams(m); var o = !1; if (u.get("testemergencyalerts") != null && (o = !0), o == !0) var i = "https://live.wp3-dev.its.queensu.ca/ur/contentwww/jsonapi/node/notifications?sort=field_notification_date"; else var i = "/contentapi/jsonapi/node/notifications?sort=field_notification_date"; fetch(i).then((e) => { e.json().then((t) => { var l = t.data; r(l); }); }).catch((e) => { console.log(e); }); } function y() { function n() { typeof React < "u" && typeof ReactDOM < "u" && (clearInterval(r), w()); } const r = setInterval(n, 5); } function p() { document.addEventListener("DOMContentLoaded", y); } const f = p(); export { f as default };