+ function clearPersistedLevel() {
+ if (typeof window === undefinedType || !storageKey) return;
+
+ // Use localStorage if available
+ try {
+ window.localStorage.removeItem(storageKey);
+ return;
+ } catch (ignore) {}
+
+ // Use session cookie as fallback
+ try {
+ window.document.cookie =
+ encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
+ } catch (ignore) {}
+ }
+