UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

57 lines (56 loc) • 2.11 kB
//#region src/utils/event-head.ts (function() { try { var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}; e.SENTRY_RELEASE = { id: "3.39.1" }; var t = new e.Error().stack; t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "e5b4ca73-9d40-49a8-8bf7-269bc26c0d23", e._sentryDebugIdIdentifier = "sentry-dbid-e5b4ca73-9d40-49a8-8bf7-269bc26c0d23"); } catch {} })(); function e(e, t) { if (e.length <= t) return e; let n = e.slice(0, t - 1), r = n.lastIndexOf(" "); return (r > 0 ? n.slice(0, r) : n).replace(/[\s,.:;–—|-]+$/u, "") + "…"; } var t = /^[a-z]{2,3}(?:-[a-z0-9]{2,8})*$/iu; function n(n) { let r = n.title.trim(), i = n.subtitle.trim(), a = r ? `${r} interactive floor plan` : "Interactive event floor plan", o = n.hideExhibitors ? 0 : n.exhibitors.length, s = o > 0 ? `Browse ${o} exhibitors, find booths and get directions.` : "Find booths and get directions.", c = e(`${a}${i ? `: ${i}` : ""}. ${s}`, 160), l = n.locale.trim(); return { description: c, heading: r || i || void 0, lang: t.test(l) ? l : void 0 }; } var r = [ "position: absolute", "width: 1px", "height: 1px", "margin: -1px", "padding: 0", "overflow: hidden", "clip: rect(0, 0, 0, 0)", "white-space: nowrap", "border: 0" ].join("; "); function i(e, t, n) { if (!e.querySelector("meta[name=\"description\"]")) { let n = e.createElement("meta"); n.name = "description", n.content = t.description, e.head.appendChild(n); } if (!e.querySelector("link[rel=\"canonical\"]")) { let t = e.createElement("link"); t.rel = "canonical", t.href = n, e.head.appendChild(t); } if (t.heading && !e.querySelector("h1")) { let n = e.createElement("h1"); n.textContent = t.heading, n.style.cssText = r, e.body.prepend(n); } t.lang && (e.documentElement.lang = t.lang); } function a(e) { if (e.querySelector("meta[name=\"robots\"]")) return; let t = e.createElement("meta"); t.name = "robots", t.content = "noindex", e.head.appendChild(t); } //#endregion export { n, a as r, i as t };