globalThis.Wegwichtel ??= {}; (function (ns) { 'use strict'; const entries = Object.freeze([ ['๐Ÿชต', 'Holz'], ['๐Ÿชจ', 'Felsen'], ['๐Ÿฎ', 'Laterne'], ['๐ŸŒผ', 'Blume'], ['๐Ÿšฌ', 'Pfeife'], ['๐Ÿฆ', 'Vogel'], ['๐Ÿ„', 'Pilz'], ['๐Ÿ“', 'Erdbeere'], ['๐ŸŽƒ', 'Kรผrbis'] ].map(([unicode, label]) => Object.freeze({ unicode, label, imageUrl: `/images/group-symbols/${unicode}.png` }))); // Presentation selectors must not create different symbols for the same object. function normalizeUnicode(value) { if (typeof value !== 'string') return null; return value.normalize('NFC').replaceAll(/[\uFE0E\uFE0F]/g, ''); } const byUnicode = new Map(entries.map(entry => [normalizeUnicode(entry.unicode), entry])); /** * Read-only catalogue of the nine group-code motifs. * Loading this file only registers the class; it does not create UI or sessions. */ class GroupSymbols { static list() { return entries; } /** Returns the immutable motif descriptor, or null for an unknown symbol. */ static get(unicode) { return byUnicode.get(normalizeUnicode(unicode)) ?? null; } static has(unicode) { return this.get(unicode) !== null; } static imageUrl(unicode) { return this.get(unicode)?.imageUrl ?? null; } } ns.GroupSymbols = GroupSymbols; }(globalThis.Wegwichtel));