@expofp/floorplan
Version:
Interactive floor plan library for expos and events
59 lines (58 loc) • 1.77 kB
JavaScript
(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.20.0" };
var t = new e.Error().stack;
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "823e90f8-9a4d-4234-b143-31010c7b656d", e._sentryDebugIdIdentifier = "sentry-dbid-823e90f8-9a4d-4234-b143-31010c7b656d");
} catch {}
})();
import { r as e } from "./rolldown-runtime-7-Wh3Cc7.js";
import { l as t } from "./i18n-B6dEf7vu.js";
import { s as n } from "./efp-debug-init-CHsd9_cw.js";
//#region src/tools/logger.ts
var r = /* @__PURE__ */ e(n(), 1), i = class {
constructor() {
this.messages = [];
}
log(...e) {
this.push("DEBUG", e), (0, r.default)("efp:floorplan:debug")(...e);
}
error(...e) {
this.push("ERROR", e), a(console.error, e);
}
warn(...e) {
this.push("WARN", e), a(console.warn, e);
}
info(...e) {
this.push("INFO", e), (0, r.default)("efp:floorplan:info")(...e);
}
push(e, t) {
let n = t.map((e) => {
if (typeof e == "object") try {
return JSON.stringify(e);
} catch (e) {
return e.message;
}
return e;
}), r = e + " " + (/* @__PURE__ */ new Date()).toISOString() + " " + n.join("; ");
this.messages.push(r);
let i = 1e3;
this.messages.length > i && this.messages.splice(0, i / 2);
}
};
function a(e, t) {
try {
e.apply(e, t);
} catch {}
}
var o = new i(), s = t && localStorage.getItem("efp-debugMode") === "true";
//#endregion
//#region src/utils/loadImage.ts
function c(e) {
return new Promise((t) => {
var n = new Image();
n.onerror = () => t(null), n.onload = () => t(n), n.crossOrigin = "anonymous", n.src = e;
});
}
//#endregion
export { s as n, o as r, c as t };