13 lines
611 B
JavaScript
13 lines
611 B
JavaScript
"use strict";
|
|
|
|
(function (global) {
|
|
class TarinaiRegistryBase {
|
|
constructor(defs = {}) { this.defs = new Map(Object.entries(defs || {})); }
|
|
key(id = "") { return String(id || ""); }
|
|
get(id = "") { return this.defs.get(this.key(id)) || null; }
|
|
entries() { return [...this.defs.entries()]; }
|
|
label(id = "", fallback = "") { return this.get(id)?.label || fallback || id || ""; }
|
|
color(id = "", fallback = "rgba(255,242,160,0.85)") { return this.get(id)?.color || fallback; }
|
|
}
|
|
global.TarinaiRegistryBase = TarinaiRegistryBase;
|
|
})(typeof window !== "undefined" ? window : globalThis);
|