-
Notifications
You must be signed in to change notification settings - Fork 1
/
neptune.js.map
1 lines (1 loc) · 347 KB
/
neptune.js.map
1
{"version":3,"file":"neptune.js","sources":["../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/methods/is_server.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/symbols.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/utils.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/objects/callable.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/constants.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/lazy.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/objects/owner.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/objects/superroot.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/context.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/batch.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/is_observable_boolean.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/is_observable_frozen.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/is_untracked.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/objects/scheduler.sync.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/objects/observable.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/objects/observables.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/objects/observer.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/objects/memo.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/memo.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/boolean.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/cleanup.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/objects/context.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/context.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/disposed.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/objects/scheduler.async.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/objects/effect.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/effect.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/resolve.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/objects/root.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/for.cache.keyed.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/is_observable.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/get.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/objects/suspense.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/suspense.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/for.cache.unkeyed.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/is_store.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/untrack.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/warmup.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/switch.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/ternary.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/is_batching.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/observable.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/is_observable_writable.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/target.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/readonly.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/root.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/selector.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/store.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/suspended.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/tick.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/try_catch.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/untracked.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/with.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/constants.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/methods/wrap_element.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/utils/creators.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/utils/lang.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_resolved.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_event_listener.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_abort_controller.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_abort_signal.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_scheduler.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_animation_frame.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_animation_loop.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/components/suspense.context.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/components/suspense.manager.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_render_effect.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_resource.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_fetch.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_idle_callback.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_idle_loop.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_interval.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_promise.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_timeout.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_cheap_disposed.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_microtask.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/utils/classlist.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/utils/diff.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/utils/fragment.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/utils/resolvers.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/utils/setters.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/methods/create_element.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/components/dynamic.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/components/error_boundary.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/components/for.js","../node_modules/.pnpm/oby@15.1.0/node_modules/oby/dist/methods/for.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/components/fragment.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_guarded.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/components/if.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/components/keep_alive.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/methods/render.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/components/portal.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/components/suspense.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/components/switch.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/components/ternary.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/jsx/runtime.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/methods/create_directive.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/methods/hmr.js","../node_modules/.pnpm/htm@3.1.1/node_modules/htm/dist/htm.module.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/methods/html.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/methods/lazy.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/components/suspense.collector.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/methods/render_to_string.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/methods/template.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/methods/create_context.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/methods/h.js","../node_modules/.pnpm/voby@0.57.3/node_modules/voby/dist/hooks/use_context.js","../src/ui/components.js","../node_modules/.pnpm/spitroast@2.1.4/node_modules/spitroast/dist/esm/shared.js","../node_modules/.pnpm/spitroast@2.1.4/node_modules/spitroast/dist/esm/unpatch.js","../node_modules/.pnpm/spitroast@2.1.4/node_modules/spitroast/dist/esm/getPatchFunc.js","../node_modules/.pnpm/spitroast@2.1.4/node_modules/spitroast/dist/esm/hook.js","../node_modules/.pnpm/spitroast@2.1.4/node_modules/spitroast/dist/esm/index.js","../node_modules/.pnpm/idb-keyval@6.2.1/node_modules/idb-keyval/dist/index.js","../src/api/utils.js","../node_modules/.pnpm/es-module-lexer@1.3.0/node_modules/es-module-lexer/dist/lexer.js","../node_modules/.pnpm/@uwu+quartz@1.3.7/node_modules/@uwu/quartz/index.js","../node_modules/.pnpm/quartz-plugin-url-import@1.0.1/node_modules/quartz-plugin-url-import/index.js","../src/api/intercept.js","../src/api/plugins.js","../src/api/themes.js","../src/api/observe.js","../src/api/registerRoute.js","../src/api/registerTab.js","../src/api/hookContextMenu.js","../src/api/showModal.js","../src/windowObject.js","../src/handleExfiltrations.js","../src/ui/pluginsTab.js","../src/ui/themesTab.js","../src/styles.js","../src/ui/settings.js","../src/index.js"],"sourcesContent":["/* HELPERS */\nconst IS_BROWSER = !!globalThis.CDATASection?.toString?.().match(/^\\s*function\\s+CDATASection\\s*\\(\\s*\\)\\s*\\{\\s*\\[native code\\]\\s*\\}\\s*$/);\n/* MAIN */\nconst isServer = () => {\n return !IS_BROWSER;\n};\n/* EXPORT */\nexport default isServer;\n","/* MAIN */\nconst SYMBOL_CACHED = Symbol('Cached');\nconst SYMBOL_OBSERVABLE = Symbol('Observable');\nconst SYMBOL_OBSERVABLE_BOOLEAN = Symbol('Observable.Boolean');\nconst SYMBOL_OBSERVABLE_FROZEN = Symbol('Observable.Frozen');\nconst SYMBOL_OBSERVABLE_READABLE = Symbol('Observable.Readable');\nconst SYMBOL_OBSERVABLE_WRITABLE = Symbol('Observable.Writable');\nconst SYMBOL_STORE = Symbol('Store');\nconst SYMBOL_STORE_KEYS = Symbol('Store.Keys');\nconst SYMBOL_STORE_OBSERVABLE = Symbol('Store.Observable');\nconst SYMBOL_STORE_TARGET = Symbol('Store.Target');\nconst SYMBOL_STORE_VALUES = Symbol('Store.Values');\nconst SYMBOL_STORE_UNTRACKED = Symbol('Store.Untracked');\nconst SYMBOL_SUSPENSE = Symbol('Suspense');\nconst SYMBOL_UNCACHED = Symbol('Uncached');\nconst SYMBOL_UNTRACKED = Symbol('Untracked');\nconst SYMBOL_UNTRACKED_UNWRAPPED = Symbol('Untracked.Unwrapped');\n/* EXPORT */\nexport { SYMBOL_CACHED, SYMBOL_OBSERVABLE, SYMBOL_OBSERVABLE_BOOLEAN, SYMBOL_OBSERVABLE_FROZEN, SYMBOL_OBSERVABLE_READABLE, SYMBOL_OBSERVABLE_WRITABLE, SYMBOL_STORE, SYMBOL_STORE_KEYS, SYMBOL_STORE_OBSERVABLE, SYMBOL_STORE_TARGET, SYMBOL_STORE_VALUES, SYMBOL_STORE_UNTRACKED, SYMBOL_SUSPENSE, SYMBOL_UNCACHED, SYMBOL_UNTRACKED, SYMBOL_UNTRACKED_UNWRAPPED };\n","/* MAIN */\nconst castArray = (value) => {\n return isArray(value) ? value : [value];\n};\nconst castError = (error) => {\n if (error instanceof Error)\n return error;\n if (typeof error === 'string')\n return new Error(error);\n return new Error('Unknown error');\n};\nconst { is } = Object;\nconst { isArray } = Array;\nconst isEqual = (a, b) => {\n if (a.length !== b.length)\n return false;\n for (let i = 0, l = a.length; i < l; i++) {\n const valueA = a[i];\n const valueB = b[i];\n if (!is(valueA, valueB))\n return false;\n }\n return true;\n};\nconst isFunction = (value) => {\n return typeof value === 'function';\n};\nconst isObject = (value) => {\n return (value !== null) && (typeof value === 'object');\n};\nconst isSymbol = (value) => {\n return typeof value === 'symbol';\n};\nconst noop = () => {\n return;\n};\nconst nope = () => {\n return false;\n};\n/* EXPORT */\nexport { castArray, castError, is, isArray, isEqual, isFunction, isObject, isSymbol, noop, nope };\n","/* IMPORT */\nimport { SYMBOL_OBSERVABLE, SYMBOL_OBSERVABLE_FROZEN, SYMBOL_OBSERVABLE_READABLE, SYMBOL_OBSERVABLE_WRITABLE } from '../symbols.js';\nimport { isFunction } from '../utils.js';\n/* MAIN - FUNCTIONS */\nfunction frozenFunction() {\n if (arguments.length) {\n throw new Error('A readonly Observable can not be updated');\n }\n else {\n return this;\n }\n}\nfunction readableFunction() {\n if (arguments.length) {\n throw new Error('A readonly Observable can not be updated');\n }\n else {\n return this.get();\n }\n}\nfunction writableFunction(fn) {\n if (arguments.length) {\n if (isFunction(fn)) {\n return this.C(fn);\n }\n else {\n return this.set(fn); //TSC\n }\n }\n else {\n return this.get();\n }\n}\n/* MAIN - GENERATORS */\nconst frozen = (value) => {\n const fn = frozenFunction.bind(value); //TSC\n fn[SYMBOL_OBSERVABLE] = true;\n fn[SYMBOL_OBSERVABLE_FROZEN] = true;\n return fn;\n};\nconst readable = (value) => {\n //TODO: Make a frozen one instead if disposed\n const fn = readableFunction.bind(value); //TSC\n fn[SYMBOL_OBSERVABLE] = true;\n fn[SYMBOL_OBSERVABLE_READABLE] = value;\n return fn;\n};\nconst writable = (value) => {\n const fn = writableFunction.bind(value); //TSC\n fn[SYMBOL_OBSERVABLE] = true;\n fn[SYMBOL_OBSERVABLE_WRITABLE] = value;\n return fn;\n};\n/* EXPORT */\nexport { frozen, readable, writable };\n","/* IMPORT */\nimport { frozen } from './objects/callable.js';\n/* MAIN */\nconst DIRTY_NO = 0; // The observer is not dirty, for sure\nconst DIRTY_MAYBE_NO = 1; // The observer is not dirty, possibly\nconst DIRTY_MAYBE_YES = 2; // The observer is dirty, possibly\nconst DIRTY_YES = 3; // The observer is dirty, for sure\nconst OBSERVABLE_FALSE = frozen(false);\nconst OBSERVABLE_TRUE = frozen(true);\nconst UNAVAILABLE = new Proxy({}, new Proxy({}, { get() { throw new Error('Unavailable value'); } })); //TSC\nconst UNINITIALIZED = function () { }; //TSC\n/* EXPORT */\nexport { DIRTY_NO, DIRTY_MAYBE_NO, DIRTY_MAYBE_YES, DIRTY_YES };\nexport { OBSERVABLE_FALSE, OBSERVABLE_TRUE };\nexport { UNAVAILABLE, UNINITIALIZED };\n","/* IMPORT */\n/* MAIN */\nconst lazyArrayEach = (arr, fn) => {\n if (arr instanceof Array) {\n for (let i = 0, l = arr.length; i < l; i++) {\n fn(arr[i]);\n }\n }\n else if (arr) {\n fn(arr);\n }\n};\nconst lazyArrayEachRight = (arr, fn) => {\n if (arr instanceof Array) {\n for (let i = arr.length - 1; i >= 0; i--) {\n fn(arr[i]);\n }\n }\n else if (arr) {\n fn(arr);\n }\n};\nconst lazyArrayPush = (obj, key, value) => {\n const arr = obj[key];\n if (arr instanceof Array) {\n arr.push(value);\n }\n else if (arr) {\n obj[key] = [arr, value];\n }\n else {\n obj[key] = value;\n }\n};\nconst lazySetAdd = (obj, key, value) => {\n const set = obj[key];\n if (set instanceof Set) {\n set.add(value);\n }\n else if (set) {\n if (value !== set) {\n const s = new Set();\n s.add(set);\n s.add(value);\n obj[key] = s;\n }\n }\n else {\n obj[key] = value;\n }\n};\nconst lazySetDelete = (obj, key, value) => {\n const set = obj[key];\n if (set instanceof Set) {\n set.delete(value);\n }\n else if (set === value) {\n obj[key] = undefined;\n }\n};\nconst lazySetEach = (set, fn) => {\n if (set instanceof Set) {\n for (const value of set) {\n fn(value);\n }\n }\n else if (set) {\n fn(set);\n }\n};\n/* EXPORT */\nexport { lazyArrayEach, lazyArrayEachRight, lazyArrayPush };\nexport { lazySetAdd, lazySetDelete, lazySetEach };\n","/* IMPORT */\nimport { UNAVAILABLE } from '../constants.js';\nimport { OBSERVER, OWNER, setObserver, setOwner } from '../context.js';\nimport { lazyArrayEachRight } from '../lazy.js';\nimport { castError } from '../utils.js';\n/* HELPERS */\nconst onCleanup = (cleanup) => cleanup.call(cleanup);\nconst onDispose = (owner) => owner.Q(true);\n/* MAIN */\n//TODO: Throw when registering stuff O disposing, maybe\nclass Owner {\n constructor() {\n /* VARIABLES */\n this.disposed = false;\n this.B = undefined;\n this.S = undefined;\n this.D = undefined;\n this.K = undefined;\n this.T = undefined;\n this.U = undefined;\n }\n /* API */\n catch(error, silent) {\n const { S } = this;\n if (S) {\n S(error); //TODO: This assumes that the error handler won't throw immediately, which we know, but Owner shouldn't know\n return true;\n }\n else {\n if (this.parent?.catch(error, true))\n return true;\n if (silent)\n return false;\n // console.error ( error.stack ); // <-- Log \"error.stack\" to better understand where the error happened\n throw error;\n }\n }\n Q(deep) {\n lazyArrayEachRight(this.D, onDispose);\n lazyArrayEachRight(this.K, onDispose);\n lazyArrayEachRight(this.U, onDispose);\n lazyArrayEachRight(this.B, onCleanup);\n this.B = undefined;\n this.disposed = deep;\n this.S = undefined;\n this.K = undefined;\n this.U = undefined;\n }\n get(symbol) {\n return this.context?.[symbol];\n }\n E(fn, owner, observer) {\n const ownerPrev = OWNER;\n const observerPrev = OBSERVER;\n setOwner(owner);\n setObserver(observer);\n try {\n return fn();\n }\n catch (error) {\n this.catch(castError(error), false); // Bubbling the error up\n return UNAVAILABLE; // Returning a value that is the least likely to cause bugs\n }\n finally {\n setOwner(ownerPrev);\n setObserver(observerPrev);\n }\n }\n}\n/* EXPORT */\nexport default Owner;\n","/* IMPORT */\nimport Owner from './owner.js';\n/* MAIN */\nclass SuperRoot extends Owner {\n constructor() {\n /* VARIABLES */\n super(...arguments);\n this.context = {};\n }\n}\n/* EXPORT */\nexport default SuperRoot;\n","/* IMPORT */\nimport SuperRoot from './objects/superroot.js';\n/* MAIN - READ */\n// This module relies on live-binding of exported variables to avoid a bunch of property accesses\nlet BATCH;\nlet SUPER_OWNER = new SuperRoot();\nlet OBSERVER;\nlet OWNER = SUPER_OWNER;\n/* MAIN - WRITE */\n// Unfortunately live-bounded exports can't just be overridden, so we need these functions\nconst setBatch = (value) => BATCH = value;\nconst setObserver = (value) => OBSERVER = value;\nconst setOwner = (value) => OWNER = value;\n/* EXPORT */\nexport { BATCH, OBSERVER, OWNER, SUPER_OWNER };\nexport { setBatch, setObserver, setOwner };\n","/* IMPORT */\nimport { setBatch } from '../context.js';\nimport { noop } from '../utils.js';\n/* HELPERS */\nlet M = 0;\nlet resolve = noop;\n/* MAIN */\nconst batch = async (fn) => {\n if (!M) {\n setBatch(new Promise(r => resolve = r));\n }\n try {\n M += 1;\n return await fn();\n }\n finally {\n M -= 1;\n if (!M) {\n setBatch(undefined);\n resolve();\n }\n }\n};\n/* MAIN */\nexport default batch;\n","/* IMPORT */\nimport { SYMBOL_OBSERVABLE_BOOLEAN } from '../symbols.js';\nimport { isFunction } from '../utils.js';\n/* MAIN */\nconst isObservableBoolean = (value) => {\n return isFunction(value) && (SYMBOL_OBSERVABLE_BOOLEAN in value);\n};\n/* EXPORT */\nexport default isObservableBoolean;\n","/* IMPORT */\nimport { SYMBOL_OBSERVABLE_FROZEN, SYMBOL_OBSERVABLE_READABLE } from '../symbols.js';\nimport { isFunction } from '../utils.js';\n/* MAIN */\nconst isObservableFrozen = (value) => {\n return isFunction(value) && ((SYMBOL_OBSERVABLE_FROZEN in value) || !!value[SYMBOL_OBSERVABLE_READABLE]?.parent?.disposed);\n};\n/* EXPORT */\nexport default isObservableFrozen;\n","/* IMPORT */\nimport { SYMBOL_UNTRACKED, SYMBOL_UNTRACKED_UNWRAPPED } from '../symbols.js';\nimport { isFunction } from '../utils.js';\n/* MAIN */\nconst isUntracked = (value) => {\n return isFunction(value) && ((SYMBOL_UNTRACKED in value) || (SYMBOL_UNTRACKED_UNWRAPPED in value));\n};\n/* EXPORT */\nexport default isUntracked;\n","/* IMPORT */\n/* MAIN */\n// This ensures that there's only one flushing of the queue happening at the same time\nclass Scheduler {\n constructor() {\n /* VARIABLES */\n this.A1 = [];\n this.M = 0;\n this.A2 = false;\n /* QUEING API */\n this.N = () => {\n if (this.A2)\n return;\n if (this.M)\n return;\n if (!this.A1.length)\n return;\n try {\n this.A2 = true;\n while (true) {\n const queue = this.A1;\n if (!queue.length)\n break;\n this.A1 = [];\n for (let i = 0, l = queue.length; i < l; i++) {\n queue[i].C();\n }\n }\n }\n finally {\n this.A2 = false;\n }\n };\n this.E = (fn) => {\n this.M += 1;\n fn();\n this.M -= 1;\n this.N();\n };\n /* SCHEDULING API */\n this.F = (observer) => {\n this.A1.push(observer);\n };\n }\n}\n/* EXPORT */\nexport default new Scheduler();\n","/* IMPORT */\nimport { DIRTY_MAYBE_NO, DIRTY_YES, UNINITIALIZED } from '../constants.js';\nimport { OBSERVER } from '../context.js';\nimport Scheduler from './scheduler.sync.js';\nimport { is, nope } from '../utils.js';\n/* MAIN */\nclass Observable {\n /* CONSTRUCTOR */\n constructor(value, options, parent) {\n this.K = new Set();\n this.value = value;\n if (parent) {\n this.parent = parent;\n }\n if (options?.equals !== undefined) {\n this.equals = options.equals || nope;\n }\n }\n /* API */\n get() {\n if (!this.parent?.disposed) {\n this.parent?.C();\n OBSERVER?.A.L(this);\n }\n return this.value;\n }\n set(value) {\n const equals = this.equals || is;\n const fresh = (this.value === UNINITIALIZED) || !equals(value, this.value);\n if (!fresh)\n return value;\n this.value = value;\n Scheduler.M += 1;\n this.I(DIRTY_YES);\n Scheduler.M -= 1;\n Scheduler.N();\n return value;\n }\n I(J) {\n for (const observer of this.K) {\n if (observer.J !== DIRTY_MAYBE_NO || observer.A.has(this)) { // Maybe this is a potential future dependency we haven't re-read yet\n if (observer.sync) {\n observer.J = Math.max(observer.J, J);\n Scheduler.F(observer);\n }\n else {\n observer.I(J);\n }\n }\n }\n }\n C(fn) {\n const value = fn(this.value);\n return this.set(value);\n }\n}\n/* EXPORT */\nexport default Observable;\n","/* IMPORT */\n/* MAIN */\n// Dedicated data structures for managing A efficiently\n// We use an array if the list is small enough, as that's faster than a Set, and only switch to Sets O that\nclass ObservablesArray {\n /* CONSTRUCTOR */\n constructor(observer) {\n this.observer = observer;\n this.A = [];\n this.P = 0;\n }\n /* API */\n Q(deep) {\n if (deep) {\n const { observer, A } = this;\n for (let i = 0; i < A.length; i++) {\n A[i].K.delete(observer);\n }\n }\n this.P = 0;\n }\n R() {\n const { observer, A, P } = this;\n const observablesLength = A.length;\n if (P < observablesLength) {\n for (let i = P; i < observablesLength; i++) {\n A[i].K.delete(observer);\n }\n A.length = P;\n }\n }\n empty() {\n return !this.A.length;\n }\n has(observable) {\n const index = this.A.indexOf(observable);\n return index >= 0 && index < this.P;\n }\n L(observable) {\n const { observer, A, P } = this;\n const observablesLength = A.length;\n if (observablesLength > 0) {\n if (A[P] === observable) {\n this.P += 1;\n return;\n }\n const index = A.indexOf(observable);\n if (index >= 0 && index < P) {\n return;\n }\n if (P < observablesLength - 1) {\n this.R();\n }\n else if (P === observablesLength - 1) {\n A[P].K.delete(observer);\n }\n }\n observable.K.add(observer);\n A[this.P++] = observable;\n if (P === 128) { // Switching to a Set, as indexOf checks may get artbirarily expensive otherwise\n observer.A = new ObservablesSet(observer, A);\n }\n }\n C() {\n const { A } = this;\n for (let i = 0, l = A.length; i < l; i++) {\n A[i].parent?.C();\n }\n }\n}\nclass ObservablesSet {\n /* CONSTRUCTOR */\n constructor(observer, A) {\n this.observer = observer;\n this.A = new Set(A);\n }\n /* API */\n Q(deep) {\n for (const observable of this.A) {\n observable.K.delete(this.observer);\n }\n }\n R() {\n return;\n }\n empty() {\n return !this.A.size;\n }\n has(observable) {\n return this.A.has(observable);\n }\n L(observable) {\n const { observer, A } = this;\n const sizePrev = A.size;\n observable.K.add(observer);\n const sizeNext = A.size;\n if (sizePrev === sizeNext)\n return; // Cheaper than Set.has+Set.add\n A.add(observable);\n }\n C() {\n for (const observable of this.A) {\n observable.parent?.C();\n }\n }\n}\n/* EXPORT */\nexport { ObservablesArray, ObservablesSet };\n","/* IMPORT */\nimport { DIRTY_NO, DIRTY_MAYBE_NO, DIRTY_MAYBE_YES, DIRTY_YES } from '../constants.js';\nimport { OWNER, SUPER_OWNER } from '../context.js';\nimport { lazyArrayPush } from '../lazy.js';\nimport { ObservablesArray, ObservablesSet } from './observables.js';\nimport Owner from './owner.js';\n/* MAIN */\nclass Observer extends Owner {\n /* CONSTRUCTOR */\n constructor() {\n super();\n /* VARIABLES */\n this.parent = OWNER;\n this.context = OWNER.context;\n this.J = DIRTY_YES;\n this.A = new ObservablesArray(this);\n if (OWNER !== SUPER_OWNER) {\n lazyArrayPush(this.parent, 'K', this);\n }\n }\n /* API */\n Q(deep) {\n this.A.Q(deep);\n super.Q(deep);\n }\n H(fn) {\n this.Q(false);\n this.J = DIRTY_MAYBE_NO; // Resetting the trip flag, we didn't re-execute just yet\n try {\n return this.E(fn, this, this);\n }\n finally {\n this.A.R();\n }\n }\n run() {\n throw new Error('Abstract method');\n }\n I(J) {\n throw new Error('Abstract method');\n }\n C() {\n if (this.disposed)\n return; // Disposed, it shouldn't be updated again\n if (this.J === DIRTY_MAYBE_YES) { // Maybe we are dirty, let's check with our A, to be sure\n this.A.C();\n }\n if (this.J === DIRTY_YES) { // We are dirty, let's H\n this.J = DIRTY_MAYBE_NO; // Trip flag, to be able to tell if we caused ourselves to be dirty again\n this.run();\n if (this.J === DIRTY_MAYBE_NO) { // Not dirty anymore\n this.J = DIRTY_NO;\n }\n else { // Maybe we are still dirty, let's check again\n this.C();\n }\n }\n else { // Not dirty\n this.J = DIRTY_NO;\n }\n }\n}\n/* EXPORT */\nexport default Observer;\n","/* IMPORT */\nimport { DIRTY_MAYBE_YES, UNAVAILABLE, UNINITIALIZED } from '../constants.js';\nimport Observable from './observable.js';\nimport Observer from './observer.js';\n/* MAIN */\nclass Memo extends Observer {\n /* CONSTRUCTOR */\n constructor(fn, options) {\n super();\n this.fn = fn;\n this.observable = new Observable(UNINITIALIZED, options, this);\n if (options?.sync === true) {\n this.sync = true;\n this.C();\n }\n }\n /* API */\n run() {\n const G = super.H(this.fn);\n if (!this.disposed && this.A.empty()) {\n this.disposed = true;\n }\n if (G !== UNAVAILABLE) {\n this.observable.set(G);\n }\n }\n I(J) {\n const statusPrev = this.J;\n if (statusPrev >= J)\n return;\n this.J = J;\n if (statusPrev === DIRTY_MAYBE_YES)\n return;\n this.observable.I(DIRTY_MAYBE_YES);\n }\n}\n/* EXPORT */\nexport default Memo;\n","/* IMPORT */\nimport isObservableFrozen from './is_observable_frozen.js';\nimport isUntracked from './is_untracked.js';\nimport { frozen, readable } from '../objects/callable.js';\nimport Memo from '../objects/memo.js';\n/* MAIN */\nconst memo = (fn, options) => {\n if (isObservableFrozen(fn)) {\n return fn;\n }\n else if (isUntracked(fn)) {\n return frozen(fn());\n }\n else {\n const memo = new Memo(fn, options);\n const observable = readable(memo.observable);\n return observable;\n }\n};\n/* EXPORT */\nexport default memo;\n","/* IMPORT */\nimport isObservableBoolean from './is_observable_boolean.js';\nimport isObservableFrozen from './is_observable_frozen.js';\nimport isUntracked from './is_untracked.js';\nimport memo from './memo.js';\nimport { SYMBOL_OBSERVABLE_BOOLEAN } from '../symbols.js';\nimport { isFunction } from '../utils.js';\n/* MAIN */\nconst boolean = (value) => {\n if (isFunction(value)) {\n if (isObservableFrozen(value) || isUntracked(value)) {\n return !!value();\n }\n else if (isObservableBoolean(value)) {\n return value;\n }\n else {\n const boolean = memo(() => !!value());\n boolean[SYMBOL_OBSERVABLE_BOOLEAN] = true;\n return boolean;\n }\n }\n else {\n return !!value;\n }\n};\n/* EXPORT */\nexport default boolean;\n","/* IMPORT */\nimport { OWNER } from '../context.js';\nimport { lazyArrayPush } from '../lazy.js';\n/* MAIN */\nconst cleanup = (fn) => {\n lazyArrayPush(OWNER, 'B', fn);\n};\n/* EXPORT */\nexport default cleanup;\n","/* IMPORT */\nimport { OWNER } from '../context.js';\nimport { lazyArrayPush } from '../lazy.js';\nimport Owner from './owner.js';\n/* MAIN */\nclass Context extends Owner {\n /* CONSTRUCTOR */\n constructor(context) {\n super();\n /* VARIABLES */\n this.parent = OWNER;\n this.context = { ...OWNER.context, ...context };\n lazyArrayPush(this.parent, 'D', this);\n }\n /* API */\n E(fn) {\n return super.E(fn, this, undefined);\n }\n}\n/* EXPORT */\nexport default Context;\n","/* IMPORT */\nimport { OWNER } from '../context.js';\nimport Context from '../objects/context.js';\nimport { isSymbol, noop } from '../utils.js';\nfunction context(symbolOrContext, fn) {\n if (isSymbol(symbolOrContext)) {\n return OWNER.context[symbolOrContext];\n }\n else {\n return new Context(symbolOrContext).E(fn || noop);\n }\n}\n/* EXPORT */\nexport default context;\n","/* IMPORT */\nimport cleanup from './cleanup.js';\nimport { readable } from '../objects/callable.js';\nimport Observable from '../objects/observable.js';\n/* MAIN */\nconst disposed = () => {\n const observable = new Observable(false);\n const A4 = () => observable.set(true);\n cleanup(A4);\n return readable(observable);\n};\n/* EXPORT */\nexport default disposed;\n","/* IMPORT */\nimport { BATCH } from '../context.js';\n/* MAIN */\n// Using 2 microtasks to give a chance to things using 1 microtask (like refs in Voby) to run first\nclass Scheduler {\n constructor() {\n /* VARIABLES */\n this.A1 = [];\n this.A2 = false;\n this.A3 = false;\n /* QUEUING API */\n this.N = () => {\n if (this.A2)\n return;\n if (!this.A1.length)\n return;\n try {\n this.A2 = true;\n while (true) {\n const queue = this.A1;\n if (!queue.length)\n break;\n this.A1 = [];\n for (let i = 0, l = queue.length; i < l; i++) {\n queue[i].C();\n }\n }\n }\n finally {\n this.A2 = false;\n }\n };\n this.queue = () => {\n if (this.A3)\n return;\n this.A3 = true;\n this.resolve();\n };\n this.resolve = () => {\n queueMicrotask(() => {\n queueMicrotask(() => {\n if (BATCH) {\n BATCH.finally(this.resolve);\n }\n else {\n this.A3 = false;\n this.N();\n }\n });\n });\n };\n /* SCHEDULING API */\n this.F = (effect) => {\n this.A1.push(effect);\n this.queue();\n };\n }\n}\n/* EXPORT */\nexport default new Scheduler();\n","/* IMPORT */\nimport { lazyArrayPush } from '../lazy.js';\nimport Observer from './observer.js';\nimport Scheduler from './scheduler.async.js';\nimport { SYMBOL_SUSPENSE } from '../symbols.js';\nimport { isFunction } from '../utils.js';\n/* MAIN */\nclass Effect extends Observer {\n /* CONSTRUCTOR */\n constructor(fn, options) {\n super();\n this.fn = fn;\n if (options?.suspense !== false) {\n const suspense = this.get(SYMBOL_SUSPENSE);\n if (suspense) {\n this.suspense = suspense;\n }\n }\n if (options?.sync === true) {\n this.sync = true;\n }\n if (options?.sync === 'init') {\n this.init = true;\n this.C();\n }\n else {\n this.F();\n }\n }\n /* API */\n run() {\n const G = super.H(this.fn);\n if (isFunction(G)) {\n lazyArrayPush(this, 'B', G);\n }\n }\n F() {\n if (this.suspense?.suspended)\n return;\n if (this.sync) {\n this.C();\n }\n else {\n Scheduler.F(this);\n }\n }\n I(J) {\n const statusPrev = this.J;\n if (statusPrev >= J)\n return;\n this.J = J;\n if (!this.sync || (statusPrev !== 2 && statusPrev !== 3)) { // It isn't currently executing, so let's F it\n this.F();\n }\n }\n C() {\n if (this.suspense?.suspended)\n return;\n super.C();\n }\n}\n/* EXPORT */\nexport default Effect;\n","/* IMPORT */\nimport Effect from '../objects/effect.js';\n/* MAIN */\nconst effect = (fn, options) => {\n const effect = new Effect(fn, options);\n const Q = () => effect.Q(true);\n return Q;\n};\n/* EXPORT */\nexport default effect;\n","/* IMPORT */\nimport memo from './memo.js';\nimport { frozen } from '../objects/callable.js';\nimport { SYMBOL_OBSERVABLE, SYMBOL_UNTRACKED, SYMBOL_UNTRACKED_UNWRAPPED } from '../symbols.js';\nimport { isFunction } from '../utils.js';\nfunction resolve(value) {\n if (isFunction(value)) {\n if (SYMBOL_UNTRACKED_UNWRAPPED in value) {\n return resolve(value());\n }\n else if (SYMBOL_UNTRACKED in value) {\n return frozen(resolve(value()));\n }\n else if (SYMBOL_OBSERVABLE in value) {\n return value;\n }\n else {\n return memo(() => resolve(value()));\n }\n }\n if (value instanceof Array) {\n const resolved = new Array(value.length);\n for (let i = 0, l = resolved.length; i < l; i++) {\n resolved[i] = resolve(value[i]);\n }\n return resolved;\n }\n else {\n return value;\n }\n}\n/* EXPORT */\nexport default resolve;\n","/* IMPORT */\nimport { OWNER } from '../context.js';\nimport { lazySetAdd, lazySetDelete } from '../lazy.js';\nimport Owner from './owner.js';\nimport { SYMBOL_SUSPENSE } from '../symbols.js';\n/* MAIN */\nclass Root extends Owner {\n /* CONSTRUCTOR */\n constructor(V) {\n super();\n /* VARIABLES */\n this.parent = OWNER;\n this.context = OWNER.context;\n if (V) {\n const suspense = this.get(SYMBOL_SUSPENSE);\n if (suspense) {\n this.A0 = true;\n lazySetAdd(this.parent, 'T', this);\n }\n }\n }\n /* API */\n Q(deep) {\n if (this.A0) {\n lazySetDelete(this.parent, 'T', this);\n }\n super.Q(deep);\n }\n E(fn) {\n const Q = () => this.Q(true);\n const fnWithDispose = () => fn(Q);\n return super.E(fnWithDispose, this, undefined);\n }\n}\n/* EXPORT */\nexport default Root;\n","/* IMPORT */\nimport { OWNER } from '../context.js';\nimport { lazySetAdd, lazySetDelete } from '../lazy.js';\nimport cleanup from './cleanup.js';\nimport resolve from './resolve.js';\nimport { frozen, readable } from '../objects/callable.js';\nimport Observable from '../objects/observable.js';\nimport Root from '../objects/root.js';\nimport { SYMBOL_CACHED, SYMBOL_SUSPENSE, SYMBOL_UNCACHED } from '../symbols.js';\n/* HELPERS */\nconst DUMMY_INDEX = frozen(-1);\nclass MappedRoot extends Root {\n}\n/* MAIN */\nclass CacheKeyed {\n /* CONSTRUCTOR */\n constructor(fn) {\n /* VARIABLES */\n this.parent = OWNER;\n this.suspense = OWNER.get(SYMBOL_SUSPENSE);\n this.A5 = new Map();\n this.A6 = false; // The A6 is flipped with each iteration, the T that don't have the updated one are disposed, it's like a cheap M basically\n this.A7 = 0; // Number of previous items\n this.A8 = 0; // Number of previous items that got reused\n this.A9 = 0; // Number of next items\n /* API */\n this.cleanup = () => {\n if (!this.A7)\n return; // There was nothing AA, no need to cleanup\n if (this.A7 === this.A8)\n return; // All the previous items were reused, no need to cleanup\n const { A5, A6 } = this;\n if (!A5.size)\n return; // Nothing to Q of\n if (this.A9) { // Regular cleanup\n A5.forEach((mapped, value) => {\n if (mapped.A6 === A6)\n return;\n mapped.Q(true);\n A5.delete(value);\n });\n }\n else { // There is nothing O, disposing quickly\n this.A5.forEach(mapped => {\n mapped.Q(true);\n });\n this.A5 = new Map();\n }\n };\n this.Q = () => {\n if (this.suspense) {\n lazySetDelete(this.parent, 'T', this.T);\n }\n this.A7 = this.A5.size;\n this.A8 = 0;\n this.A9 = 0;\n this.cleanup();\n };\n this.AA = () => {\n this.A6 = !this.A6;\n this.A8 = 0;\n this.A9 = 0;\n };\n this.O = (values) => {\n this.A9 = values.length;\n this.cleanup();\n this.A7 = this.A9;\n this.A8 = 0;\n };\n this.map = (values) => {\n this.AA();\n const { A5, A6, fn, AB } = this;\n const results = new Array(values.length);\n let resultsCached = true; // Whether all results are cached, if so this enables an optimization\n let resultsUncached = true; // Whether all results are anew, if so this enables an optimization in Voby\n let A8 = 0;\n for (let i = 0, l = values.length; i < l; i++) {\n const value = values[i];\n const cached = A5.get(value);\n if (cached && cached.A6 !== A6) {\n resultsUncached = false;\n A8 += 1;\n cached.A6 = A6;\n cached.index?.set(i);\n results[i] = cached.G; //TSC\n }\n else {\n resultsCached = false;\n const mapped = new MappedRoot(false);\n if (cached) {\n cleanup(() => mapped.Q(true));\n }\n mapped.E(() => {\n let index = DUMMY_INDEX;\n if (AB) {\n mapped.index = new Observable(i);\n index = readable(mapped.index);\n }\n const G = results[i] = resolve(fn(value, index));\n mapped.A6 = A6;\n mapped.G = G;\n if (!cached) {\n A5.set(value, mapped);\n }\n });\n }\n }\n this.A8 = A8;\n this.O(values);\n if (resultsCached) {\n results[SYMBOL_CACHED] = true;\n }\n if (resultsUncached) {\n results[SYMBOL_UNCACHED] = true;\n }\n return results;\n };\n this.T = () => {\n return Array.from(this.A5.values());\n };\n this.fn = fn;\n this.AB = (fn.length > 1);\n if (this.suspense) {\n lazySetAdd(this.parent, 'T', this.T);\n }\n }\n}\n/* EXPORT */\nexport default CacheKeyed;\n","/* IMPORT */\nimport { SYMBOL_OBSERVABLE } from '../symbols.js';\nimport { isFunction } from '../utils.js';\n/* MAIN */\nconst isObservable = (value) => {\n return isFunction(value) && (SYMBOL_OBSERVABLE in value);\n};\n/* EXPORT */\nexport default isObservable;\n","/* IMPORT */\nimport isObservable from './is_observable.js';\nimport { isFunction } from '../utils.js';\nfunction get(value, getFunction = true) {\n const is = getFunction ? isFunction : isObservable;\n if (is(value)) {\n return value();\n }\n else {\n return value;\n }\n}\n/* EXPORT */\nexport default get;\n","/* IMPORT */\nimport { DIRTY_MAYBE_YES, DIRTY_YES } from '../constants.js';\nimport { OWNER } from '../context.js';\nimport { lazyArrayEach, lazyArrayPush, lazySetEach } from '../lazy.js';\nimport Effect from './effect.js';\nimport Owner from './owner.js';\nimport { SYMBOL_SUSPENSE } from '../symbols.js';\nimport { isFunction } from '../utils.js';\n/* MAIN */\nclass Suspense extends Owner {\n /* CONSTRUCTOR */\n constructor() {\n super();\n /* VARIABLES */\n this.parent = OWNER;\n this.context = { ...OWNER.context, [SYMBOL_SUSPENSE]: this };\n lazyArrayPush(this.parent, 'U', this);\n this.suspended = (OWNER.get(SYMBOL_SUSPENSE)?.suspended || 0);\n }\n /* API */\n A4(force) {\n if (!this.suspended && !force)\n return; // Already suspended, this can happen at instantion time\n const suspendedPrev = this.suspended;\n const suspendedNext = suspendedPrev + (force ? 1 : -1);\n this.suspended = suspendedNext;\n if (!!suspendedPrev === !!suspendedNext)\n return; // Same state, nothing to pause or resume\n /* NOTIFYING OBSERVERS, ROOTS AND SUSPENSES */\n this.observable?.set(!!suspendedNext);\n const notifyOwner = (owner) => {\n lazyArrayEach(owner.D, notifyOwner);\n lazyArrayEach(owner.K, notifyObserver);\n lazyArrayEach(owner.U, notifySuspense);\n lazySetEach(owner.T, notifyRoot);\n };\n const notifyObserver = (observer) => {\n if (observer instanceof Effect) {\n if (observer.J === DIRTY_MAYBE_YES || observer.J === DIRTY_YES) {\n if (observer.init) {\n observer.C();\n }\n else {\n observer.F();\n }\n }\n }\n notifyOwner(observer);\n };\n const notifyRoot = (root) => {\n if (isFunction(root)) {\n root().forEach(notifyOwner);\n }\n else {\n notifyOwner(root);\n }\n };\n const notifySuspense = (suspense) => {\n suspense.A4(force);\n };\n notifyOwner(this);\n }\n E(fn) {\n return super.E(fn, this, undefined);\n }\n}\n/* EXPORT */\nexport default Suspense;\n","/* IMPORT */\nimport boolean from './boolean.js';\nimport effect from './effect.js';\nimport get from './get.js';\nimport Suspense from '../objects/suspense.js';\n/* MAIN */\nconst suspense = (when, fn) => {\n const suspense = new Suspense();\n const condition = boolean(when);\n const A4 = () => suspense.A4(get(condition));\n effect(A4, { sync: true });\n return suspense.E(fn);\n};\n/* EXPORT */\nexport default suspense;\n","/* IMPORT */\nimport { OWNER } from '../context.js';\nimport { lazySetAdd, lazySetDelete } from '../lazy.js';\nimport cleanup from './cleanup.js';\nimport get from './get.js';\nimport memo from './memo.js';\nimport resolve from './resolve.js';\nimport suspense from './suspense.js';\nimport { frozen, readable } from '../objects/callable.js';\nimport Observable from '../objects/observable.js';\nimport Root from '../objects/root.js';\nimport { SYMBOL_CACHED, SYMBOL_SUSPENSE, SYMBOL_UNCACHED } from '../symbols.js';\n/* HELPERS */\nconst DUMMY_INDEX = frozen(-1);\nclass MappedRoot extends Root {\n}\n/* MAIN */\n//TODO: Optimize this more\nclass CacheUnkeyed {\n /* CONSTRUCTOR */\n constructor(fn, pooled) {\n /* VARIABLES */\n this.parent = OWNER;\n this.suspense = OWNER.get(SYMBOL_SUSPENSE);\n this.A5 = new Map();\n this.AC = [];\n this.AD = 0;\n /* API */\n this.cleanup = () => {\n let pooled = 0;\n let poolable = Math.max(0, this.pooled ? this.AD - this.AC.length : 0);\n this.A5.forEach(mapped => {\n if (poolable > 0 && pooled++ < poolable) {\n mapped.suspended?.set(true);\n this.AC.push(mapped);\n }\n else {\n mapped.Q(true);\n }\n });\n };\n this.Q = () => {\n if (this.suspense) {\n lazySetDelete(this.parent, 'T', this.T);\n }\n this.A5.forEach(mapped => {\n mapped.Q(true);\n });\n this.AC.forEach(mapped => {\n mapped.Q(true);\n });\n };\n this.map = (values) => {\n const { A5, fn, AB } = this;\n const cacheNext = new Map();\n const results = new Array(values.length);\n const AC = this.AC;\n const pooled = this.pooled;\n let resultsCached = true; // Whether all results are cached, if so this enables an optimization\n let resultsUncached = true; // Whether all results are anew, if so this enables an optimization in Voby\n let leftovers = [];\n if (A5.size) {\n for (let i = 0, l = values.length; i < l; i++) {\n const value = values[i];\n const cached = A5.get(value);\n if (cached) {\n resultsUncached = false;\n A5.delete(value);\n cacheNext.set(value, cached);\n cached.index?.set(i);\n results[i] = cached.G; //TSC\n }\n else {\n leftovers.push(i);\n }\n }\n }\n else {\n leftovers = new Array(results.length);\n }\n outer: for (let i = 0, l = leftovers.length; i < l; i++) {\n const index = leftovers[i] || i;\n const value = values[index];\n const isDuplicate = cacheNext.has(value);\n if (!isDuplicate) {\n for (const [key, mapped] of A5.entries()) {\n A5.delete(key);\n cacheNext.set(value, mapped);\n mapped.index?.set(index);\n mapped.value?.set(value);\n results[index] = mapped.G; //TSC\n continue outer;\n }\n }\n resultsCached = false;\n let mapped;\n if (pooled && AC.length) {\n mapped = AC.pop(); //TSC\n mapped.index?.set(index);\n mapped.value?.set(value);\n mapped.suspended?.set(false);\n results[index] = mapped.G; //TSC\n }\n else {\n mapped = new MappedRoot(false);\n mapped.E(() => {\n let $index = DUMMY_INDEX;\n if (AB) {\n mapped.index = new Observable(index);\n $index = readable(mapped.index);\n }\n const observable = mapped.value = new Observable(value);\n const suspended = pooled ? new Observable(false) : undefined;\n const $value = memo(() => get(observable.get())); //TSC\n const G = results[index] = suspended ? suspense(() => suspended.get(), () => resolve(fn($value, $index))) : resolve(fn($value, $index));\n mapped.value = observable;\n mapped.G = G;\n mapped.suspended = suspended;\n });\n }\n if (isDuplicate) { // Expensive, not reusable\n cleanup(() => mapped.Q(true));\n }\n else { // Cheap, reusable\n cacheNext.set(value, mapped);\n }\n }\n this.AD = Math.max(this.AD, results.length);\n this.cleanup();\n this.A5 = cacheNext;\n if (resultsCached) {\n results[SYMBOL_CACHED] = true;\n }\n if (resultsUncached) {\n results[SYMBOL_UNCACHED] = true;\n }\n return results;\n };\n this.T = () => {\n return [...this.A5.values(), ...this.AC.values()];\n };\n this.fn = fn;\n this.AB = (fn.length > 1);\n this.pooled = pooled;\n if (this.suspense) {\n lazySetAdd(this.parent, 'T', this.T);\n }\n }\n}\n/* EXPORT */\nexport default CacheUnkeyed;\n","/* IMPORT */\nimport { SYMBOL_STORE } from '../symbols.js';\nimport { isObject } from '../utils.js';\n/* MAIN */\nconst isStore = (value) => {\n return isObject(value) && (SYMBOL_STORE in value);\n};\n/* EXPORT */\nexport default isStore;\n","/* IMPORT */\nimport { OBSERVER, setObserver } from '../context.js';\nimport { isFunction } from '../utils.js';\nfunction untrack(fn) {\n if (isFunction(fn)) {\n const observerPrev = OBSERVER;\n if (observerPrev) {\n try {\n setObserver(undefined);\n return fn();\n }\n finally {\n setObserver(observerPrev);\n }\n }\n else {\n return fn();\n }\n }\n else {\n return fn;\n }\n}\n/* EXPORT */\nexport default untrack;\n","/* IMPORT */\nimport untrack from './untrack.js';\n/* MAIN */\n// This function ensures an Observable contains a fresh value, mainly to try to push it into a frozen state, if possible\nconst warmup = (value) => {\n untrack(value);\n return value;\n};\n/* EXPORT */\nexport default warmup;\n","/* IMPORT */\nimport get from './get.js';\nimport isObservableBoolean from './is_observable_boolean.js';\nimport isObservableFrozen from './is_observable_frozen.js';\nimport isUntracked from './is_untracked.js';\nimport memo from './memo.js';\nimport resolve from './resolve.js';\nimport warmup from './warmup.js';\nimport { frozen } from '../objects/callable.js';\nimport { is, isFunction } from '../utils.js';\n/* HELPERS */\nconst match = (condition, values, fallback) => {\n for (let i = 0, l = values.length; i < l; i++) {\n const value = values[i];\n if (value.length === 1)\n return value[0];\n if (is(value[0], condition))\n return value[1];\n }\n return fallback;\n};\nfunction _switch(when, values, fallback) {\n const isDynamic = isFunction(when) && !isObservableFrozen(when) && !isUntracked(when);\n if (isDynamic) {\n if (isObservableBoolean(when)) {\n return memo(() => resolve(match(when(), values, fallback)));\n }\n const value = warmup(memo(() => match(when(), values, fallback)));\n if (isObservableFrozen(value)) {\n return frozen(resolve(value()));\n }\n else {\n return memo(() => resolve(get(value)));\n }\n }\n else {\n const value = match(get(when), values, fallback);\n return frozen(resolve(value));\n }\n}\n/* EXPORT */\nexport default _switch;\n","/* IMPORT */\nimport boolean from './boolean.js';\nimport _switch from './switch.js';\n/* MAIN */\nconst ternary = (when, valueTrue, valueFalse) => {\n const condition = boolean(when);\n return _switch(condition, [[true, valueTrue], [valueFalse]]);\n};\n/* EXPORT */\nexport default ternary;\n","/* IMPORT */\nimport { BATCH } from '../context.js';\nimport SchedulerAsync from '../objects/scheduler.async.js';\nimport SchedulerSync from '../objects/scheduler.sync.js';\n/* MAIN */\nconst isBatching = () => {\n return !!BATCH || SchedulerAsync.A3 || SchedulerAsync.A2 || SchedulerSync.A2;\n};\n/* EXPORT */\nexport default isBatching;\n","/* IMPORT */\nimport { writable } from '../objects/callable.js';\nimport ObservableClass from '../objects/observable.js';\nfunction observable(value, options) {\n return writable(new ObservableClass(value, options));\n}\n/* EXPORT */\nexport default observable;\n","/* IMPORT */\nimport { SYMBOL_OBSERVABLE_WRITABLE } from '../symbols.js';\nimport { isFunction } from '../utils.js';\n/* MAIN */\nconst isObservableWritable = (value) => {\n return isFunction(value) && (SYMBOL_OBSERVABLE_WRITABLE in value);\n};\n/* EXPORT */\nexport default isObservableWritable;\n","/* IMPORT */\nimport { UNAVAILABLE } from '../constants.js';\nimport { SYMBOL_OBSERVABLE_READABLE, SYMBOL_OBSERVABLE_WRITABLE } from '../symbols.js';\nimport { isFunction } from '../utils.js';\n/* MAIN */\nconst target = (observable) => {\n if (isFunction(observable)) {\n return observable[SYMBOL_OBSERVABLE_READABLE] || observable[SYMBOL_OBSERVABLE_WRITABLE] || UNAVAILABLE;\n }\n else {\n return observable;\n }\n};\n/* EXPORT */\nexport default target;\n","/* IMPORT */\nimport isObservableWritable from './is_observable_writable.js';\nimport target from './target.js';\nimport { readable } from '../objects/callable.js';\n/* MAIN */\nconst readonly = (observable) => {\n if (isObservableWritable(observable)) {\n return readable(target(observable));\n }\n else {\n return observable;\n }\n};\n/* EXPORT */\nexport default readonly;\n","/* IMPORT */\nimport Root from '../objects/root.js';\n/* MAIN */\nconst root = (fn) => {\n return new Root(true).E(fn);\n};\n/* EXPORT */\nexport default root;\n","/* IMPORT */\nimport { OBSERVABLE_FALSE, OBSERVABLE_TRUE } from '../constants.js';\nimport cleanup from './cleanup.js';\nimport effect from './effect.js';\nimport isObservableFrozen from './is_observable_frozen.js';\nimport memo from './memo.js';\nimport untrack from './untrack.js';\nimport warmup from './warmup.js';\nimport { readable } from '../objects/callable.js';\nimport Observable from '../objects/observable.js';\nimport { is } from '../utils.js';\n/* HELPERS */\nclass DisposableMap extends Map {\n constructor() {\n super(...arguments);\n this.disposed = false;\n }\n}\nclass SelectedObservable extends Observable {\n constructor() {\n super(...arguments);\n this.AE = 1;\n }\n /* API */\n call() {\n if (this.AF.disposed)\n return;\n this.AE -= 1;\n if (this.AE)\n return;\n this.AF.delete(this.AG);\n }\n}\n/* MAIN */\nconst selector = (AG) => {\n /* NORMALIZING SOURCE */\n AG = warmup(memo(AG));\n /* FROZEN SOURCE */\n if (isObservableFrozen(AG)) {\n const sourceValue = untrack(AG);\n return (value) => {\n return (value === sourceValue) ? OBSERVABLE_TRUE : OBSERVABLE_FALSE;\n };\n }\n /* SELECTEDS */\n let AF = new DisposableMap();\n let selectedValue = untrack(AG);\n effect(() => {\n const valuePrev = selectedValue;\n const valueNext = AG();\n if (is(valuePrev, valueNext))\n return;\n selectedValue = valueNext;\n AF.get(valuePrev)?.set(false);\n AF.get(valueNext)?.set(true);\n }, { suspense: false, sync: true });\n /* CLEANUP ALL */\n const cleanupAll = () => {\n AF.disposed = true;\n };\n cleanup(cleanupAll);\n /* SELECTOR */\n return (value) => {\n /* INIT */\n let selected = AF.get(value);\n if (selected) {\n selected.AE += 1;\n }\n else {\n selected = new SelectedObservable(value === selectedValue);\n selected.AF = AF;\n selected.AG = value;\n AF.set(value, selected);\n }\n /* CLEANUP */\n cleanup(selected);\n /* RETURN */\n return readable(selected);\n };\n};\n/* EXPORT */\nexport default selector;\n","/* IMPORT */\nimport { BATCH, OBSERVER } from '../context.js';\nimport { lazySetAdd, lazySetDelete, lazySetEach } from '../lazy.js';\nimport cleanup from './cleanup.js';\nimport effect from './effect.js';\nimport isBatching from './is_batching.js';\nimport isStore from './is_store.js';\nimport untrack from './untrack.js';\nimport { readable } from '../objects/callable.js';\nimport ObservableClass from '../objects/observable.js';\nimport { SYMBOL_STORE, SYMBOL_STORE_KEYS, SYMBOL_STORE_OBSERVABLE, SYMBOL_STORE_TARGET, SYMBOL_STORE_VALUES, SYMBOL_STORE_UNTRACKED } from '../symbols.js';\nimport { castArray, is, isArray, isFunction, isObject, noop, nope } from '../utils.js';\n/* CLASSES */\nclass StoreMap extends Map {\n AH(key, value) {\n super.set(key, value);\n return value;\n }\n}\nclass StoreCleanable {\n constructor() {\n this.AE = 0;\n }\n listen() {\n this.AE += 1;\n cleanup(this);\n }\n call() {\n this.AE -= 1;\n if (this.AE)\n return;\n this.Q();\n }\n Q() { }\n}\nclass StoreKeys extends StoreCleanable {\n constructor(parent, observable) {\n super();\n this.parent = parent;\n this.observable = observable;\n }\n Q() {\n this.parent.keys = undefined;\n }\n}\nclass StoreValues extends StoreCleanable {\n constructor(parent, observable) {\n super();\n this.parent = parent;\n this.observable = observable;\n }\n Q() {\n this.parent.values = undefined;\n }\n}\nclass StoreHas extends StoreCleanable {\n constructor(parent, key, observable) {\n super();\n this.parent = parent;\n this.key = key;\n this.observable = observable;\n }\n Q() {\n this.parent.has?.delete(this.key);\n }\n}\nclass StoreProperty extends StoreCleanable {\n constructor(parent, key, observable, AI) {\n super();\n this.parent = parent;\n this.key = key;\n this.observable = observable;\n this.AI = AI;\n }\n Q() {\n this.parent.AJ?.delete(this.key);\n }\n}\nconst StoreListenersRegular = {\n /* VARIABLES */\n AK: 0,\n AL: new Set(),\n AM: new Set(),\n /* API */\n AN: () => {\n const { AL, AM } = StoreListenersRegular;\n const traversed = new Set();\n const traverse = (AI) => {\n if (traversed.has(AI))\n return;\n traversed.add(AI);\n lazySetEach(AI.AO, traverse);\n lazySetEach(AI.AP, listener => {\n AL.add(listener);\n });\n };\n AM.forEach(traverse);\n return () => {\n AL.forEach(listener => {\n listener();\n });\n };\n },\n V: (AI) => {\n StoreListenersRegular.AM.add(AI);\n StoreScheduler.F();\n },\n reset: () => {\n StoreListenersRegular.AL = new Set();\n StoreListenersRegular.AM = new Set();\n }\n};\nconst StoreListenersRoots = {\n /* VARIABLES */\n AK: 0,\n AM: new Map(),\n /* API */\n AN: () => {\n const { AM } = StoreListenersRoots;\n return () => {\n AM.forEach((rootsSet, store) => {\n const T = Array.from(rootsSet);\n lazySetEach(store.AQ, listener => {\n listener(T);\n });\n });\n };\n },\n V: (store, root) => {\n const T = StoreListenersRoots.AM.get(store) || new Set();\n T.add(root);\n StoreListenersRoots.AM.set(store, T);\n StoreScheduler.F();\n },\n AR: (current, parent, key) => {\n if (!parent.AO) {\n const root = current?.store || untrack(() => parent.store[key]);\n StoreListenersRoots.V(parent, root);\n }\n else {\n const traversed = new Set();\n const traverse = (AI) => {\n if (traversed.has(AI))\n return;\n traversed.add(AI);\n lazySetEach(AI.AO, parent => {\n if (!parent.AO) {\n StoreListenersRoots.V(parent, AI.store);\n }\n traverse(parent);\n });\n };\n traverse(current || parent);\n }\n },\n reset: () => {\n StoreListenersRoots.AM = new Map();\n }\n};\nconst StoreScheduler = {\n /* VARIABLES */\n AK: false,\n /* API */\n N: () => {\n const flushRegular = StoreListenersRegular.AN();\n const flushRoots = StoreListenersRoots.AN();\n StoreScheduler.reset();\n flushRegular();\n flushRoots();\n },\n AS: () => {\n if (isBatching()) {\n if (BATCH) {\n BATCH.finally(StoreScheduler.AS);\n }\n else {\n setTimeout(StoreScheduler.AS, 0);\n }\n }\n else {\n StoreScheduler.N();\n }\n },\n reset: () => {\n StoreScheduler.AK = false;\n StoreListenersRegular.reset();\n StoreListenersRoots.reset();\n },\n F: () => {\n if (StoreScheduler.AK)\n return;\n StoreScheduler.AK = true;\n queueMicrotask(StoreScheduler.AS);\n }\n};\n/* CONSTANTS */\nconst NODES = new WeakMap();\nconst SPECIAL_SYMBOLS = new Set([SYMBOL_STORE, SYMBOL_STORE_KEYS, SYMBOL_STORE_OBSERVABLE, SYMBOL_STORE_TARGET, SYMBOL_STORE_VALUES]);\nconst UNREACTIVE_KEYS = new Set(['__proto__', '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'prototype', 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toSource', 'toString', 'valueOf']);\nconst STORE_TRAPS = {\n /* API */\n get: (target, key) => {\n if (SPECIAL_SYMBOLS.has(key)) {\n if (key === SYMBOL_STORE)\n return true;\n if (key === SYMBOL_STORE_TARGET)\n return target;\n if (key === SYMBOL_STORE_KEYS) {\n if (isListenable()) {\n const AI = getNodeExisting(target);\n AI.keys || (AI.keys = getNodeKeys(AI));\n AI.keys.listen();\n AI.keys.observable.get();\n }\n return;\n }\n if (key === SYMBOL_STORE_VALUES) {\n if (isListenable()) {\n const AI = getNodeExisting(target);\n AI.values || (AI.values = getNodeValues(AI));\n AI.values.listen();\n AI.values.observable.get();\n }\n return;\n }\n if (key === SYMBOL_STORE_OBSERVABLE) {\n return (key) => {\n key = (typeof key === 'number') ? String(key) : key;\n const AI = getNodeExisting(target);\n const getter = AI.AT?.get(key);\n if (getter)\n return getter.bind(AI.store);\n AI.AJ || (AI.AJ = new StoreMap());\n const value = target[key];\n const property = AI.AJ.get(key) || AI.AJ.AH(key, getNodeProperty(AI, key, value));\n const options = AI.equals ? { equals: AI.equals } : undefined;\n property.observable || (property.observable = getNodeObservable(AI, value, options));\n const observable = readable(property.observable);\n return observable;\n };\n }\n }\n if (UNREACTIVE_KEYS.has(key))\n return target[key];\n const AI = getNodeExisting(target);\n const getter = AI.AT?.get(key);\n const value = getter || target[key];\n AI.AJ || (AI.AJ = new StoreMap());\n const listenable = isListenable();\n const proxiable = isProxiable(value);\n const property = listenable || proxiable ? AI.AJ.get(key) || AI.AJ.AH(key, getNodeProperty(AI, key, value)) : undefined;\n if (property?.AI) {\n lazySetAdd(property.AI, 'AO', AI);\n }\n if (property && listenable) {\n const options = AI.equals ? { equals: AI.equals } : undefined;\n property.listen();\n property.observable || (property.observable = getNodeObservable(AI, value, options));\n property.observable.get();\n }\n if (getter) {\n return getter.call(AI.store);\n }\n else {\n if (typeof value === 'function' && value === Array.prototype[key]) {\n return function () {\n return value.apply(AI.store, arguments);\n };\n }\n return property?.AI?.store || value;\n }\n },\n set: (target, key, value) => {\n value = getTarget(value);\n const AI = getNodeExisting(target);\n const setter = AI.AU?.get(key);\n if (setter) {\n setter.call(AI.store, value);\n }\n else {\n const valuePrev = target[key];\n const hadProperty = !!valuePrev || (key in target);\n const equals = AI.equals || is;\n if (hadProperty && equals(value, valuePrev) && (key !== 'length' || !Array.isArray(target)))\n return true; // Array.prototype.length is special, it gets updated AA this trap is called, we need to special-case it...\n target[key] = value;\n AI.values?.observable.set(0);\n if (!hadProperty) {\n AI.keys?.observable.set(0);\n AI.has?.get(key)?.observable.set(true);\n }\n const property = AI.AJ?.get(key);\n if (property?.AI) {\n lazySetDelete(property.AI, 'AO', AI);\n }\n if (property) {\n property.observable?.set(value);\n property.AI = isProxiable(value) ? NODES.get(value) || getNode(value, AI) : undefined;\n }\n if (property?.AI) {\n lazySetAdd(property.AI, 'AO', AI);\n }\n if (StoreListenersRoots.AK) {\n StoreListenersRoots.AR(property?.AI, AI, key);\n }\n if (StoreListenersRegular.AK) {\n StoreListenersRegular.V(AI);\n }\n }\n return true;\n },\n deleteProperty: (target, key) => {\n const hasProperty = (key in target);\n if (!hasProperty)\n return true;\n const deleted = Reflect.deleteProperty(target, key);\n if (!deleted)\n return false;\n const AI = getNodeExisting(target);\n AI.keys?.observable.set(0);\n AI.values?.observable.set(0);\n AI.has?.get(key)?.observable.set(false);\n const property = AI.AJ?.get(key);\n if (StoreListenersRoots.AK) {\n StoreListenersRoots.AR(property?.AI, AI, key);\n }\n if (property?.AI) {\n lazySetDelete(property.AI, 'AO', AI);\n }\n if (property) {\n property.observable?.set(undefined);\n property.AI = undefined;\n }\n if (StoreListenersRegular.AK) {\n StoreListenersRegular.V(AI);\n }\n return true;\n },\n defineProperty: (target, key, descriptor) => {\n const AI = getNodeExisting(target);\n const equals = AI.equals || is;\n const hadProperty = (key in target);\n const descriptorPrev = Reflect.getOwnPropertyDescriptor(target, key);\n if ('value' in descriptor && isStore(descriptor.value)) {\n descriptor = { ...descriptor, value: getTarget(descriptor.value) };\n }\n if (descriptorPrev && isEqualDescriptor(descriptorPrev, descriptor, equals))\n return true;\n const defined = Reflect.defineProperty(target, key, descriptor);\n if (!defined)\n return false;\n if (!descriptor.get) {\n AI.AT?.delete(key);\n }\n else if (descriptor.get) {\n AI.AT || (AI.AT = new StoreMap());\n AI.AT.set(key, descriptor.get);\n }\n if (!descriptor.set) {\n AI.AU?.delete(key);\n }\n else if (descriptor.set) {\n AI.AU || (AI.AU = new StoreMap());\n AI.AU.set(key, descriptor.set);\n }\n if (hadProperty !== !!descriptor.enumerable) {\n AI.keys?.observable.set(0);\n }\n AI.has?.get(key)?.observable.set(true);\n const property = AI.AJ?.get(key);\n if (StoreListenersRoots.AK) {\n StoreListenersRoots.AR(property?.AI, AI, key);\n }\n if (property?.AI) {\n lazySetDelete(property.AI, 'AO', AI);\n }\n if (property) {\n if ('get' in descriptor) {\n property.observable?.set(descriptor.get);\n property.AI = undefined;\n }\n else {\n const value = descriptor.value;\n property.observable?.set(value);\n property.AI = isProxiable(value) ? NODES.get(value) || getNode(value, AI) : undefined;\n }\n }\n if (property?.AI) {\n lazySetAdd(property.AI, 'AO', AI);\n }\n if (StoreListenersRoots.AK) {\n StoreListenersRoots.AR(property?.AI, AI, key);\n }\n if (StoreListenersRegular.AK) {\n StoreListenersRegular.V(AI);\n }\n return true;\n },\n has: (target, key) => {\n if (key === SYMBOL_STORE)\n return true;\n if (key === SYMBOL_STORE_TARGET)\n return true;\n const value = (key in target);\n if (isListenable()) {\n const AI = getNodeExisting(target);\n AI.has || (AI.has = new StoreMap());\n const has = AI.has.get(key) || AI.has.AH(key, getNodeHas(AI, key, value));\n has.listen();\n has.observable.get();\n }\n return value;\n },\n ownKeys: (target) => {\n const keys = Reflect.ownKeys(target);\n if (isListenable()) {\n const AI = getNodeExisting(target);\n AI.keys || (AI.keys = getNodeKeys(AI));\n AI.keys.listen();\n AI.keys.observable.get();\n }\n return keys;\n }\n};\nconst STORE_UNTRACK_TRAPS = {\n /* API */\n has: (target, key) => {\n if (key === SYMBOL_STORE_UNTRACKED)\n return true;\n return (key in target);\n }\n};\n/* HELPERS */\nconst getNode = (value, parent, equals) => {\n const store = new Proxy(value, STORE_TRAPS);\n const gettersAndSetters = getGettersAndSetters(value);\n const AI = { AO: parent, store };\n if (gettersAndSetters) {\n const { AT, AU } = gettersAndSetters;\n if (AT)\n AI.AT = AT;\n if (AU)\n AI.AU = AU;\n }\n if (equals === false) {\n AI.equals = nope;\n }\n else if (equals) {\n AI.equals = equals;\n }\n else if (parent?.equals) {\n AI.equals = parent.equals;\n }\n NODES.set(value, AI);\n return AI;\n};\nconst getNodeExisting = (value) => {\n const AI = NODES.get(value);\n if (!AI)\n throw new Error('Impossible');\n return AI;\n};\nconst getNodeFromStore = (store) => {\n return getNodeExisting(getTarget(store));\n};\nconst getNodeKeys = (AI) => {\n const observable = getNodeObservable(AI, 0, { equals: false });\n const keys = new StoreKeys(AI, observable);\n return keys;\n};\nconst getNodeValues = (AI) => {\n const observable = getNodeObservable(AI, 0, { equals: false });\n const values = new StoreValues(AI, observable);\n return values;\n};\nconst getNodeHas = (AI, key, value) => {\n const observable = getNodeObservable(AI, value);\n const has = new StoreHas(AI, key, observable);\n return has;\n};\nconst getNodeObservable = (AI, value, options) => {\n return new ObservableClass(value, options);\n};\nconst getNodeProperty = (AI, key, value) => {\n const observable = undefined;\n const propertyNode = isProxiable(value) ? NODES.get(value) || getNode(value, AI) : undefined;\n const property = new StoreProperty(AI, key, observable, propertyNode);\n AI.AJ || (AI.AJ = new StoreMap());\n AI.AJ.set(key, property);\n return property;\n};\nconst getGettersAndSetters = (value) => {\n if (isArray(value))\n return;\n let AT;\n let AU;\n const keys = Object.keys(value);\n for (let i = 0, l = keys.length; i < l; i++) {\n const key = keys[i];\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (!descriptor)\n continue;\n const { get, set } = descriptor;\n if (get) {\n AT || (AT = new StoreMap());\n AT.set(key, get);\n }\n if (set) {\n AU || (AU = new StoreMap());\n AU.set(key, set);\n }\n }\n if (!AT && !AU)\n return;\n return { AT, AU };\n};\nconst getStore = (value, options) => {\n if (isStore(value))\n return value;\n const AI = NODES.get(value) || getNode(value, undefined, options?.equals);\n return AI.store;\n};\nconst getTarget = (value) => {\n if (isStore(value))\n return value[SYMBOL_STORE_TARGET];\n return value;\n};\nconst getUntracked = (value) => {\n if (!isObject(value))\n return value;\n if (isUntracked(value))\n return value;\n return new Proxy(value, STORE_UNTRACK_TRAPS);\n};\nconst isEqualDescriptor = (a, b, equals) => {\n return (!!a.configurable === !!b.configurable && !!a.enumerable === !!b.enumerable && !!a.writable === !!b.writable && equals(a.value, b.value) && a.get === b.get && a.set === b.set);\n};\nconst isListenable = () => {\n return !!OBSERVER;\n};\nconst isProxiable = (value) => {\n if (value === null || typeof value !== 'object')\n return false;\n if (SYMBOL_STORE in value)\n return true;\n if (SYMBOL_STORE_UNTRACKED in value)\n return false;\n if (isArray(value))\n return true;\n const prototype = Object.getPrototypeOf(value);\n if (prototype === null)\n return true;\n return (Object.getPrototypeOf(prototype) === null);\n};\nconst isUntracked = (value) => {\n if (value === null || typeof value !== 'object')\n return false;\n return (SYMBOL_STORE_UNTRACKED in value);\n};\n/* MAIN */\n//TODO: Maybe have the \"on\" method trigger immediately too like \"$.on\", or maybe the other way around, which seems more flexible\n//TODO: Explore converting target values back to numbers (the Proxy always receives strings) whenever possible, to save memory\n//TODO: Implement \"_onRoots\" better, perhaps provding string paths instead, which should be more powerful\nconst store = (value, options) => {\n if (!isObject(value))\n return value;\n if (isUntracked(value))\n return value;\n return getStore(value, options);\n};\n/* UTILITIES */\nstore.on = (target, listener) => {\n /* VARIABLES */\n const targets = isStore(target) ? [target] : castArray(target);\n const selectors = targets.filter(isFunction);\n const AM = targets.filter(isStore).map(getNodeFromStore);\n /* ON */\n StoreListenersRegular.AK += 1;\n const disposers = selectors.map(selector => {\n let inited = false;\n return effect(() => {\n if (inited) {\n StoreListenersRegular.AL.add(listener);\n StoreScheduler.F();\n }\n inited = true;\n selector();\n }, { suspense: false, sync: true });\n });\n AM.forEach(AI => {\n lazySetAdd(AI, 'AP', listener);\n });\n /* OFF */\n return () => {\n StoreListenersRegular.AK -= 1;\n disposers.forEach(disposer => {\n disposer();\n });\n AM.forEach(AI => {\n lazySetDelete(AI, 'AP', listener);\n });\n };\n};\nstore._onRoots = (target, listener) => {\n if (!isStore(target))\n return noop;\n const AI = getNodeFromStore(target);\n if (AI.AO)\n throw new Error('Only top-level stores are supported');\n /* ON */\n StoreListenersRoots.AK += 1;\n lazySetAdd(AI, 'AQ', listener);\n /* OFF */\n return () => {\n StoreListenersRoots.AK -= 1;\n lazySetDelete(AI, 'AQ', listener);\n };\n};\nstore.reconcile = (() => {\n //TODO: Support AT, AU and symbols (symbols could be supported with Reflect.ownKeys, but that's like 2x slower)\n const getType = (value) => {\n if (isArray(value))\n return 1;\n if (isProxiable(value))\n return 2;\n return 0;\n };\n const reconcileOuter = (prev, next) => {\n const uprev = getTarget(prev);\n const unext = getTarget(next);\n reconcileInner(prev, next);\n const prevType = getType(uprev);\n const nextType = getType(unext);\n if (prevType === 1 || nextType === 1) {\n prev.length = next.length;\n }\n return prev;\n };\n const reconcileInner = (prev, next) => {\n const uprev = getTarget(prev);\n const unext = getTarget(next);\n const prevKeys = Object.keys(uprev);\n const nextKeys = Object.keys(unext);\n for (let i = 0, l = nextKeys.length; i < l; i++) {\n const key = nextKeys[i];\n const prevValue = uprev[key];\n const nextValue = unext[key];\n if (!is(prevValue, nextValue)) {\n const prevType = getType(prevValue);\n const nextType = getType(nextValue);\n if (prevType && prevType === nextType) {\n reconcileInner(prev[key], nextValue);\n if (prevType === 1) {\n prev[key].length = nextValue.length;\n }\n }\n else {\n prev[key] = nextValue;\n }\n }\n else if (prevValue === undefined && !(key in uprev)) {\n prev[key] = undefined;\n }\n }\n for (let i = 0, l = prevKeys.length; i < l; i++) {\n const key = prevKeys[i];\n if (!(key in unext)) {\n delete prev[key];\n }\n }\n return prev;\n };\n const reconcile = (prev, next) => {\n return untrack(() => {\n return reconcileOuter(prev, next);\n });\n };\n return reconcile;\n})();\nstore.untrack = (value) => {\n return getUntracked(value);\n};\nstore.unwrap = (value) => {\n return getTarget(value);\n};\n/* EXPORT */\nexport default store;\n","/* IMPORT */\nimport { OBSERVABLE_FALSE } from '../constants.js';\nimport { OWNER } from '../context.js';\nimport { readable } from '../objects/callable.js';\nimport Observable from '../objects/observable.js';\nimport { SYMBOL_SUSPENSE } from '../symbols.js';\n/* MAIN */\nconst suspended = () => {\n const suspense = OWNER.get(SYMBOL_SUSPENSE);\n if (!suspense)\n return OBSERVABLE_FALSE;\n const observable = (suspense.observable || (suspense.observable = new Observable(!!suspense.suspended)));\n return readable(observable);\n};\n/* EXPORT */\nexport default suspended;\n","/* IMPORT */\nimport Scheduler from '../objects/scheduler.async.js';\n/* MAIN */\nconst tick = () => {\n Scheduler.N();\n};\n/* EXPORT */\nexport default tick;\n","/* IMPORT */\nimport { OWNER } from '../context.js';\nimport memo from './memo.js';\nimport $ from './observable.js';\nimport resolve from './resolve.js';\n/* MAIN */\nconst tryCatch = (value, fn) => {\n const observable = $();\n return memo(() => {\n const error = observable();\n if (error) {\n const reset = () => observable(undefined);\n const options = { error, reset };\n return resolve(fn(options));\n }\n else {\n OWNER.S = observable;\n return resolve(value);\n }\n });\n};\n/* EXPORT */\nexport default tryCatch;\n","/* IMPORT */\nimport untrack from './untrack.js';\nimport { SYMBOL_UNTRACKED } from '../symbols.js';\nimport { isFunction } from '../utils.js';\nfunction untracked(fn) {\n const untracked = isFunction(fn) ? (...args) => untrack(() => fn(...args)) : () => fn;\n untracked[SYMBOL_UNTRACKED] = true;\n return untracked;\n}\n/* EXPORT */\nexport default untracked;\n","/* IMPORT */\nimport { OBSERVER, OWNER } from '../context.js';\n/* MAIN */\nconst _with = () => {\n const owner = OWNER;\n const observer = OBSERVER;\n return (fn) => {\n return owner.E(() => fn(), owner, observer);\n };\n};\n/* EXPORT */\nexport default _with;\n","/* IMPORT */\nimport { SYMBOL_OBSERVABLE, SYMBOL_OBSERVABLE_FROZEN, SYMBOL_OBSERVABLE_READABLE, SYMBOL_UNCACHED, SYMBOL_UNTRACKED, SYMBOL_UNTRACKED_UNWRAPPED } from './oby.js';\n/* MAIN */\nconst CONTEXTS_DATA = new WeakMap();\nconst DIRECTIVES = {};\nconst SYMBOL_SUSPENSE = Symbol('Suspense');\nconst SYMBOL_SUSPENSE_COLLECTOR = Symbol('Suspense.Collector');\nconst SYMBOL_TEMPLATE_ACCESSOR = Symbol('Template.Accessor');\nconst SYMBOLS_DIRECTIVES = {};\n/* EXPORT */\nexport { SYMBOL_OBSERVABLE, SYMBOL_OBSERVABLE_FROZEN, SYMBOL_OBSERVABLE_READABLE, SYMBOL_UNCACHED, SYMBOL_UNTRACKED, SYMBOL_UNTRACKED_UNWRAPPED };\nexport { CONTEXTS_DATA, DIRECTIVES, SYMBOL_SUSPENSE, SYMBOL_SUSPENSE_COLLECTOR, SYMBOL_TEMPLATE_ACCESSOR, SYMBOLS_DIRECTIVES };\n","/* IMPORT */\nimport { SYMBOL_UNTRACKED_UNWRAPPED } from '../constants.js';\n/* MAIN */\nconst wrapElement = (element) => {\n element[SYMBOL_UNTRACKED_UNWRAPPED] = true;\n return element;\n};\n/* EXPORT */\nexport default wrapElement;\n","/* IMPORT */\n/* MAIN */\nconst createComment = document.createComment.bind(document, '');\nconst createHTMLNode = document.createElement.bind(document);\nconst createSVGNode = document.createElementNS.bind(document, 'http://www.w3.org/2000/svg');\nconst createText = document.createTextNode.bind(document);\n/* EXPORT */\nexport { createComment, createHTMLNode, createSVGNode, createText };\n","/* IMPORT */\nimport { SYMBOL_OBSERVABLE_FROZEN, SYMBOL_OBSERVABLE_READABLE, SYMBOL_TEMPLATE_ACCESSOR, SYMBOL_UNTRACKED, SYMBOL_UNTRACKED_UNWRAPPED } from '../constants.js';\n/* MAIN */\nconst { assign } = Object;\nconst castArray = (value) => {\n return isArray(value) ? value : [value];\n};\nconst castError = (exception) => {\n if (isError(exception))\n return exception;\n if (isString(exception))\n return new Error(exception);\n return new Error('Unknown error');\n};\nconst flatten = (arr) => {\n for (let i = 0, l = arr.length; i < l; i++) {\n if (!isArray(arr[i]))\n continue;\n return arr.flat(Infinity);\n }\n return arr;\n};\nconst indexOf = (() => {\n const _indexOf = Array.prototype.indexOf;\n return (arr, value) => {\n return _indexOf.call(arr, value);\n };\n})();\nconst { isArray } = Array;\nconst isBoolean = (value) => {\n return typeof value === 'boolean';\n};\nconst isComponent = (value) => {\n return isFunction(value) && (SYMBOL_UNTRACKED_UNWRAPPED in value);\n};\nconst isError = (value) => {\n return value instanceof Error;\n};\nconst isFalsy = (value) => {\n return !value;\n};\nconst isFunction = (value) => {\n return typeof value === 'function';\n};\nconst isFunctionReactive = (value) => {\n return !(SYMBOL_UNTRACKED in value || SYMBOL_UNTRACKED_UNWRAPPED in value || SYMBOL_OBSERVABLE_FROZEN in value || value[SYMBOL_OBSERVABLE_READABLE]?.parent?.disposed);\n};\nconst isNil = (value) => {\n return value === null || value === undefined;\n};\nconst isNode = (value) => {\n return value instanceof Node;\n};\nconst isObject = (value) => {\n return typeof value === 'object' && value !== null;\n};\nconst isPromise = (value) => {\n return value instanceof Promise;\n};\nconst isString = (value) => {\n return typeof value === 'string';\n};\nconst isSVG = (value) => {\n return !!value['isSVG'];\n};\nconst isSVGElement = (() => {\n const svgRe = /^(t(ext$|s)|s[vwy]|g)|^set|tad|ker|p(at|s)|s(to|c$|ca|k)|r(ec|cl)|ew|us|f($|e|s)|cu|n[ei]|l[ty]|[GOP]/; //URL: https://regex101.com/r/Ck4kFp/1\n const svgCache = {};\n return (element) => {\n const cached = svgCache[element];\n return (cached !== undefined) ? cached : (svgCache[element] = !element.includes('-') && svgRe.test(element));\n };\n})();\nconst isTemplateAccessor = (value) => {\n return isFunction(value) && (SYMBOL_TEMPLATE_ACCESSOR in value);\n};\nconst isTruthy = (value) => {\n return !!value;\n};\nconst isVoidChild = (value) => {\n return value === null || value === undefined || typeof value === 'boolean' || typeof value === 'symbol';\n};\nconst noop = () => {\n return;\n};\nconst once = (fn) => {\n let called = false;\n let result;\n return () => {\n if (!called) {\n called = true;\n result = fn();\n }\n return result;\n };\n};\n/* EXPORT */\nexport { assign, castArray, castError, flatten, indexOf, isArray, isBoolean, isComponent, isError, isFalsy, isFunction, isFunctionReactive, isNil, isNode, isObject, isPromise, isString, isSVG, isSVGElement, isTemplateAccessor, isTruthy, isVoidChild, noop, once };\n","/* IMPORT */\nimport isObservable from '../methods/is_observable.js';\nimport { isArray, isFunction } from '../utils/lang.js';\nfunction useResolved(values, callback, resolveFunction) {\n const isResolvable = (resolveFunction !== false && callback !== false) ? isFunction : isObservable;\n const resolve = (value) => isResolvable(value) ? value() : value;\n if (isArray(values)) {\n const resolved = values.map(resolve);\n if (isFunction(callback)) {\n return callback.apply(undefined, resolved);\n }\n else {\n return resolved;\n }\n }\n else {\n const resolved = resolve(values);\n if (isFunction(callback)) {\n return callback(resolved);\n }\n else {\n return resolved;\n }\n }\n}\n/* EXPORT */\nexport default useResolved;\n","/* IMPORT */\nimport useEffect from './use_effect.js';\nimport useResolved from './use_resolved.js';\nimport $$ from '../methods/SS.js';\nimport { castArray } from '../utils/lang.js';\nfunction useEventListener(target, event, handler, options) {\n return useEffect(() => {\n const fn = $$(handler, false);\n return useResolved([target, event, options], (target, event, options) => {\n const targets = castArray(target);\n targets.forEach(target => {\n target?.addEventListener(event, fn, options);\n });\n return () => {\n targets.forEach(target => {\n target?.removeEventListener(event, fn, options);\n });\n };\n });\n }, { sync: 'init' });\n}\n/* EXPORT */\nexport default useEventListener;\n","/* IMPORT */\nimport useCleanup from './use_cleanup.js';\nimport useEventListener from './use_event_listener.js';\nimport { castArray } from '../utils/lang.js';\n/* MAIN */\nconst useAbortController = (signals = []) => {\n signals = castArray(signals);\n const controller = new AbortController();\n const abort = controller.abort.bind(controller);\n const aborted = signals.some(signal => signal.aborted);\n if (aborted) {\n abort();\n }\n else {\n signals.forEach(signal => useEventListener(signal, 'abort', abort));\n useCleanup(abort);\n }\n return controller;\n};\n/* EXPORT */\nexport default useAbortController;\n","/* IMPORT */\nimport useAbortController from './use_abort_controller.js';\n/* MAIN */\nconst useAbortSignal = (signals = []) => {\n return useAbortController(signals).signal;\n};\n/* EXPORT */\nexport default useAbortSignal;\n","/* IMPORT */\nimport useEffect from './use_effect.js';\nimport useSuspended from './use_suspended.js';\nimport $$ from '../methods/SS.js';\nimport untrack from '../methods/untrack.js';\n/* MAIN */\nconst useScheduler = ({ loop, once, callback, cancel, schedule }) => {\n let executed = false;\n let suspended = useSuspended();\n let tickId;\n const work = (value) => {\n executed = true;\n if ($$(loop))\n tick();\n $$(callback, false)(value);\n };\n const tick = () => {\n tickId = untrack(() => schedule(work));\n };\n const dispose = () => {\n untrack(() => cancel(tickId));\n };\n useEffect(() => {\n if (once && executed)\n return;\n if (suspended())\n return;\n tick();\n return dispose;\n }, { suspense: false });\n return dispose;\n};\n/* EXPORT */\nexport default useScheduler;\n","/* IMPORT */\nimport useScheduler from './use_scheduler.js';\n/* MAIN */\nconst useAnimationFrame = (callback) => {\n return useScheduler({\n callback,\n once: true,\n cancel: cancelAnimationFrame,\n schedule: requestAnimationFrame\n });\n};\n/* EXPORT */\nexport default useAnimationFrame;\n","/* IMPORT */\nimport useScheduler from './use_scheduler.js';\n/* MAIN */\nconst useAnimationLoop = (callback) => {\n return useScheduler({\n callback,\n loop: true,\n cancel: cancelAnimationFrame,\n schedule: requestAnimationFrame\n });\n};\n/* EXPORT */\nexport default useAnimationLoop;\n","/* IMPORT */\nimport { SYMBOL_SUSPENSE, SYMBOL_SUSPENSE_COLLECTOR } from '../constants.js';\nimport useCleanup from '../hooks/use_cleanup.js';\nimport useMemo from '../hooks/use_memo.js';\nimport $ from '../methods/S.js';\nimport { context, resolve } from '../oby.js';\n/* MAIN */\nconst SuspenseContext = {\n create: () => {\n const count = $(0);\n const active = useMemo(() => !!count());\n const increment = (nr = 1) => count(prev => prev + nr);\n const decrement = (nr = -1) => queueMicrotask(() => count(prev => prev + nr));\n const data = { active, increment, decrement };\n const collector = context(SYMBOL_SUSPENSE_COLLECTOR);\n if (collector) {\n collector?.register(data);\n useCleanup(() => collector.unregister(data));\n }\n return data;\n },\n get: () => {\n return context(SYMBOL_SUSPENSE);\n },\n wrap: (fn) => {\n const data = SuspenseContext.create();\n return context({ [SYMBOL_SUSPENSE]: data }, () => {\n return resolve(() => fn(data));\n });\n }\n};\n/* EXPORT */\nexport default SuspenseContext;\n","/* IMPORT */\nimport SuspenseContext from './suspense.context.js';\nimport useCleanup from '../hooks/use_cleanup.js';\n/* MAIN */\nclass SuspenseManager {\n constructor() {\n /* VARIABLES */\n this.suspenses = new Map();\n /* API */\n this.change = (suspense, nr) => {\n const counter = this.suspenses.get(suspense) || 0;\n const counterNext = Math.max(0, counter + nr);\n if (counter === counterNext)\n return;\n if (counterNext) {\n this.suspenses.set(suspense, counterNext);\n }\n else {\n this.suspenses.delete(suspense);\n }\n if (nr > 0) {\n suspense.increment(nr);\n }\n else {\n suspense.decrement(nr);\n }\n };\n this.suspend = () => {\n const suspense = SuspenseContext.get();\n if (!suspense)\n return;\n this.change(suspense, 1);\n useCleanup(() => {\n this.change(suspense, -1);\n });\n };\n this.unsuspend = () => {\n this.suspenses.forEach((counter, suspense) => {\n this.change(suspense, -counter);\n });\n };\n }\n}\n;\n/* EXPORT */\nexport default SuspenseManager;\n","/* IMPORT */\nimport useEffect from './use_effect.js';\n/* HELPERS */\nconst options = {\n sync: 'init'\n};\n/* MAIN */\n// This function exists for convenience, and to avoid creating unnecessary options objects\nconst useRenderEffect = (fn) => {\n return useEffect(fn, options);\n};\n/* EXPORT */\nexport default useRenderEffect;\n","/* IMPORT */\nimport SuspenseManager from '../components/suspense.manager.js';\nimport useCheapDisposed from './use_cheap_disposed.js';\nimport useReadonly from './use_readonly.js';\nimport useRenderEffect from './use_render_effect.js';\nimport $ from '../methods/S.js';\nimport $$ from '../methods/SS.js';\nimport { assign, castError, isPromise } from '../utils/lang.js';\n/* MAIN */\n//TODO: Maybe port this to oby, as \"from\"\n//TODO: Option for returning the resource as a store, where also the returned value gets wrapped in a store\n//FIXME: SSR demo: toggling back and forth between /home and /loader is buggy, /loader gets loaded with no data, which is wrong\nconst useResource = (fetcher) => {\n const pending = $(true);\n const error = $();\n const value = $();\n const latest = $();\n const { suspend, unsuspend } = new SuspenseManager();\n const resourcePending = { pending: true, get value() { return void suspend(); }, get latest() { return latest() ?? void suspend(); } };\n const resourceRejected = { pending: false, get error() { return error(); }, get value() { throw error(); }, get latest() { throw error(); } };\n const resourceResolved = { pending: false, get value() { return value(); }, get latest() { return value(); } };\n const resourceFunction = { pending: () => pending(), error: () => error(), value: () => resource().value, latest: () => resource().latest };\n const resource = $(resourcePending);\n useRenderEffect(() => {\n const disposed = useCheapDisposed();\n const onPending = () => {\n pending(true);\n error(undefined);\n value(undefined);\n resource(resourcePending);\n };\n const onResolve = (result) => {\n if (disposed())\n return;\n pending(false);\n error(undefined);\n value(() => result);\n latest(() => result);\n resource(resourceResolved);\n };\n const onReject = (exception) => {\n if (disposed())\n return;\n pending(false);\n error(castError(exception));\n value(undefined);\n latest(undefined);\n resource(resourceRejected);\n };\n const onFinally = () => {\n if (disposed())\n return;\n unsuspend();\n };\n const fetch = () => {\n try {\n const value = $$(fetcher());\n if (isPromise(value)) {\n onPending();\n value.then(onResolve, onReject).finally(onFinally);\n }\n else {\n onResolve(value);\n onFinally();\n }\n }\n catch (error) {\n onReject(error);\n onFinally();\n }\n };\n fetch();\n });\n return assign(useReadonly(resource), resourceFunction);\n};\n/* EXPORT */\nexport default useResource;\n","/* IMPORT */\nimport useAbortSignal from './use_abort_signal.js';\nimport useResolved from './use_resolved.js';\nimport useResource from './use_resource.js';\n/* MAIN */\nconst useFetch = (request, init) => {\n return useResource(() => {\n return useResolved([request, init], (request, init = {}) => {\n const signal = useAbortSignal(init.signal || []);\n init.signal = signal;\n return fetch(request, init);\n });\n });\n};\n/* EXPORT */\nexport default useFetch;\n","/* IMPORT */\nimport useScheduler from './use_scheduler.js';\nimport $$ from '../methods/SS.js';\n/* MAIN */\nconst useIdleCallback = (callback, options) => {\n return useScheduler({\n callback,\n once: true,\n cancel: cancelIdleCallback,\n schedule: callback => requestIdleCallback(callback, $$(options))\n });\n};\n/* EXPORT */\nexport default useIdleCallback;\n","/* IMPORT */\nimport useScheduler from './use_scheduler.js';\nimport $$ from '../methods/SS.js';\n/* MAIN */\nconst useIdleLoop = (callback, options) => {\n return useScheduler({\n callback,\n loop: true,\n cancel: cancelIdleCallback,\n schedule: callback => requestIdleCallback(callback, $$(options))\n });\n};\n/* EXPORT */\nexport default useIdleLoop;\n","/* IMPORT */\nimport useScheduler from './use_scheduler.js';\nimport $$ from '../methods/SS.js';\n/* MAIN */\nconst useInterval = (callback, ms) => {\n return useScheduler({\n callback,\n cancel: clearInterval,\n schedule: callback => setInterval(callback, $$(ms))\n });\n};\n/* EXPORT */\nexport default useInterval;\n","/* IMPORT */\nimport useResource from './use_resource.js';\nimport $$ from '../methods/SS.js';\n/* MAIN */\nconst usePromise = (promise) => {\n return useResource(() => $$(promise));\n};\n/* EXPORT */\nexport default usePromise;\n","/* IMPORT */\nimport useScheduler from './use_scheduler.js';\nimport $$ from '../methods/SS.js';\n/* MAIN */\nconst useTimeout = (callback, ms) => {\n return useScheduler({\n callback,\n once: true,\n cancel: clearTimeout,\n schedule: callback => setTimeout(callback, $$(ms))\n });\n};\n/* EXPORT */\nexport default useTimeout;\n","/* IMPORT */\nimport { useCleanup } from './/index.js';\n/* MAIN */\nconst useCheapDisposed = () => {\n let disposed = false;\n const get = () => disposed;\n const set = () => disposed = true;\n useCleanup(set);\n return get;\n};\n/* EXPORT */\nexport default useCheapDisposed;\n","/* IMPORT */\nimport useCheapDisposed from './use_cheap_disposed.js';\nimport { with as _with } from '../oby.js';\n/* MAIN */\n//TODO: Maybe port this to oby\n//TODO: Maybe special-case this to use one shared mirotask per microtask\nconst useMicrotask = (fn) => {\n const disposed = useCheapDisposed();\n const runWithOwner = _with();\n queueMicrotask(() => {\n if (disposed())\n return;\n runWithOwner(fn);\n });\n};\n/* EXPORT */\nexport default useMicrotask;\n","/* IMPORT */\nimport { isString } from './lang.js';\n/* MAIN */\n// This function exists to optimize memory usage in some cases, where the classList API won't be touched without sacrificing performance\nconst classesToggle = (element, classes, force) => {\n const { className } = element;\n /* OPTIMIZED PATH */\n if (isString(className)) {\n if (!className) { // Optimized addition/deletion\n if (force) { // Optimized addition\n element.className = classes;\n return;\n }\n else { // Optimized deletion, nothing to do really\n return;\n }\n }\n else if (!force && className === classes) { // Optimized deletion\n element.className = '';\n return;\n }\n }\n /* REGULAR PATH */\n if (classes.includes(' ')) {\n classes.split(' ').forEach(cls => {\n if (!cls.length)\n return;\n element.classList.toggle(cls, !!force);\n });\n }\n else {\n element.classList.toggle(classes, !!force);\n }\n};\n/* EXPORT */\nexport { classesToggle };\n","/**\n * ISC License\n *\n * Copyright (c) 2020, Andrea Giammarchi, @WebReflection\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE\n * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n/* MAIN */\n// This is just a slightly customized version of udomdiff: with types, no accessor function and support for diffing unwrapped nodes\nconst dummyNode = document.createComment('');\nconst beforeDummyWrapper = [dummyNode];\nconst afterDummyWrapper = [dummyNode];\nconst diff = (parent, before, after, nextSibling) => {\n if (before === after)\n return;\n if (before instanceof Node) {\n if (after instanceof Node) {\n if (before.parentNode === parent) { // Safety check, since setChildStatic may trigger this\n parent.replaceChild(after, before);\n return;\n }\n else {\n //TODO: Optimize this branch too\n }\n }\n beforeDummyWrapper[0] = before;\n before = beforeDummyWrapper;\n }\n if (after instanceof Node) {\n afterDummyWrapper[0] = after;\n after = afterDummyWrapper;\n }\n const bLength = after.length;\n let aEnd = before.length;\n let bEnd = bLength;\n let aStart = 0;\n let bStart = 0;\n let map = null;\n let removable;\n while (aStart < aEnd || bStart < bEnd) {\n // append head, tail, or nodes in between: fast path\n if (aEnd === aStart) {\n // we could be in a situation where the rest of nodes that\n // need to be added are not at the end, and in such case\n // the node to `insertBefore`, if the index is more than 0\n // must be retrieved, otherwise it's gonna be the first item.\n const node = bEnd < bLength ?\n (bStart ?\n (after[bStart - 1].nextSibling) :\n after[bEnd - bStart]) :\n nextSibling;\n if (bStart < bEnd) {\n // parent.insertBefore(after[bStart++], node);\n if (node) {\n node.before.apply(node, after.slice(bStart, bEnd));\n }\n else {\n parent.append.apply(parent, after.slice(bStart, bEnd));\n }\n bStart = bEnd;\n }\n }\n // remove head or tail: fast path\n else if (bEnd === bStart) {\n while (aStart < aEnd) {\n // remove the node only if it's unknown or not live\n if (!map || !map.has(before[aStart])) {\n removable = before[aStart];\n if (removable.parentNode === parent) { // Safety check, since setChildStatic may trigger this\n parent.removeChild(removable);\n }\n }\n aStart++;\n }\n }\n // same node: fast path\n else if (before[aStart] === after[bStart]) {\n aStart++;\n bStart++;\n }\n // same tail: fast path\n else if (before[aEnd - 1] === after[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n // The once here single last swap \"fast path\" has been removed in v1.1.0\n // https://github.com/WebReflection/udomdiff/blob/single-final-swap/esm/index.js#L69-L85\n // reverse swap: also fast path\n else if (before[aStart] === after[bEnd - 1] &&\n after[bStart] === before[aEnd - 1]) {\n // this is a \"shrink\" operation that could happen in these cases:\n // [1, 2, 3, 4, 5]\n // [1, 4, 3, 2, 5]\n // or asymmetric too\n // [1, 2, 3, 4, 5]\n // [1, 2, 3, 5, 6, 4]\n const node = before[--aEnd].nextSibling;\n parent.insertBefore(after[bStart++], before[aStart++].nextSibling);\n parent.insertBefore(after[--bEnd], node);\n // mark the future index as identical (yeah, it's dirty, but cheap 👍)\n // The main reason to do this, is that when a[aEnd] will be reached,\n // the loop will likely be on the fast path, as identical to b[bEnd].\n // In the best case scenario, the next loop will skip the tail,\n // but in the worst one, this node will be considered as already\n // processed, bailing out pretty quickly from the map index check\n before[aEnd] = after[bEnd];\n }\n // map based fallback, \"slow\" path\n else {\n // the map requires an O(bEnd - bStart) operation once\n // to store all future nodes indexes for later purposes.\n // In the worst case scenario, this is a full O(N) cost,\n // and such scenario happens at least when all nodes are different,\n // but also if both first and last items of the lists are different\n if (!map) {\n map = new Map;\n let i = bStart;\n while (i < bEnd)\n map.set(after[i], i++);\n }\n // if it's a future node, hence it needs some handling\n if (map.has(before[aStart])) {\n // grab the index of such node, 'cause it might have been processed\n const index = map.get(before[aStart]);\n // if it's not already processed, look on demand for the next LCS\n if (bStart < index && index < bEnd) {\n let i = aStart;\n // counts the amount of nodes that are the same in the future\n let sequence = 1;\n while (++i < aEnd && i < bEnd && map.get(before[i]) === (index + sequence))\n sequence++;\n // effort decision here: if the sequence is longer than replaces\n // needed to reach such sequence, which would brings again this loop\n // to the fast path, prepend the difference before a sequence,\n // and move only the future list index forward, so that aStart\n // and bStart will be aligned again, hence on the fast path.\n // An example considering aStart and bStart are both 0:\n // a: [1, 2, 3, 4]\n // b: [7, 1, 2, 3, 6]\n // this would place 7 before 1 and, from that time on, 1, 2, and 3\n // will be processed at zero cost\n if (sequence > (index - bStart)) {\n const node = before[aStart];\n if (bStart < index) {\n // parent.insertBefore(after[bStart++], node);\n if (node) {\n node.before.apply(node, after.slice(bStart, index));\n }\n else {\n parent.append.apply(parent, after.slice(bStart, index));\n }\n bStart = index;\n }\n }\n // if the effort wasn't good enough, fallback to a replace,\n // moving both source and target indexes forward, hoping that some\n // similar node will be found later on, to go back to the fast path\n else {\n parent.replaceChild(after[bStart++], before[aStart++]);\n }\n }\n // otherwise move the source forward, 'cause there's nothing to do\n else\n aStart++;\n }\n // this node has no meaning in the future list, so it's more than safe\n // to remove it, and check the next live node out instead, meaning\n // that only the live list index should be forwarded\n else {\n removable = before[aStart++];\n if (removable.parentNode === parent) { // Safety check, since setChildStatic may trigger this\n parent.removeChild(removable);\n }\n }\n }\n }\n beforeDummyWrapper[0] = dummyNode;\n afterDummyWrapper[0] = dummyNode;\n};\n/* EXPORT */\nexport default diff;\n","/* IMPORT */\n/* HELPERS */\nconst NOOP_CHILDREN = [];\n/* MAIN */\nconst FragmentUtils = {\n make: () => {\n return {\n values: undefined,\n length: 0\n };\n },\n makeWithNode: (node) => {\n return {\n values: node,\n length: 1\n };\n },\n makeWithFragment: (fragment) => {\n return {\n values: fragment,\n fragmented: true,\n length: 1\n };\n },\n getChildrenFragmented: (thiz, children = []) => {\n const { values, length } = thiz;\n if (!length)\n return children;\n if (values instanceof Array) {\n for (let i = 0, l = values.length; i < l; i++) {\n const value = values[i];\n if (value instanceof Node) {\n children.push(value);\n }\n else {\n FragmentUtils.getChildrenFragmented(value, children);\n }\n }\n }\n else {\n if (values instanceof Node) {\n children.push(values);\n }\n else {\n FragmentUtils.getChildrenFragmented(values, children);\n }\n }\n return children;\n },\n getChildren: (thiz) => {\n if (!thiz.length)\n return NOOP_CHILDREN;\n if (!thiz.fragmented)\n return thiz.values;\n if (thiz.length === 1)\n return FragmentUtils.getChildren(thiz.values);\n return FragmentUtils.getChildrenFragmented(thiz);\n },\n pushFragment: (thiz, fragment) => {\n FragmentUtils.pushValue(thiz, fragment);\n thiz.fragmented = true;\n },\n pushNode: (thiz, node) => {\n FragmentUtils.pushValue(thiz, node);\n },\n pushValue: (thiz, value) => {\n const { values, length } = thiz; //TSC\n if (length === 0) {\n thiz.values = value;\n }\n else if (length === 1) {\n thiz.values = [values, value];\n }\n else {\n values.push(value);\n }\n thiz.length += 1;\n },\n replaceWithNode: (thiz, node) => {\n thiz.values = node;\n delete thiz.fragmented;\n thiz.length = 1;\n },\n replaceWithFragment: (thiz, fragment) => {\n thiz.values = fragment.values;\n thiz.fragmented = fragment.fragmented;\n thiz.length = fragment.length;\n }\n};\n/* EXPORT */\nexport default FragmentUtils;\n","/* IMPORT */\nimport { SYMBOL_UNCACHED } from '../constants.js';\nimport isObservable from '../methods/is_observable.js';\nimport useRenderEffect from '../hooks/use_render_effect.js';\nimport $$ from '../methods/SS.js';\nimport { createText } from './creators.js';\nimport { isArray, isFunction, isFunctionReactive, isString } from './lang.js';\n/* MAIN */\nconst resolveChild = (value, setter, _dynamic = false) => {\n if (isFunction(value)) {\n if (!isFunctionReactive(value)) {\n resolveChild(value(), setter, _dynamic);\n }\n else {\n useRenderEffect(() => {\n resolveChild(value(), setter, true);\n });\n }\n }\n else if (isArray(value)) {\n const [values, hasObservables] = resolveArraysAndStatics(value);\n values[SYMBOL_UNCACHED] = value[SYMBOL_UNCACHED]; // Preserving this special symbol\n setter(values, hasObservables || _dynamic);\n }\n else {\n setter(value, _dynamic);\n }\n};\nconst resolveClass = (classes, resolved = {}) => {\n if (isString(classes)) {\n classes.split(/\\s+/g).filter(Boolean).filter(cls => {\n resolved[cls] = true;\n });\n }\n else if (isFunction(classes)) {\n resolveClass(classes(), resolved);\n }\n else if (isArray(classes)) {\n classes.forEach(cls => {\n resolveClass(cls, resolved); //TSC\n });\n }\n else if (classes) {\n for (const key in classes) {\n const value = classes[key];\n const isActive = !!$$(value);\n if (!isActive)\n continue;\n resolved[key] = true;\n }\n }\n return resolved;\n};\nconst resolveStyle = (styles, resolved = {}) => {\n if (isString(styles)) { //TODO: split into the individual styles, to be able to merge them with other styles\n return styles;\n }\n else if (isFunction(styles)) {\n return resolveStyle(styles(), resolved);\n }\n else if (isArray(styles)) {\n styles.forEach(style => {\n resolveStyle(style, resolved); //TSC\n });\n }\n else if (styles) {\n for (const key in styles) {\n const value = styles[key];\n resolved[key] = $$(value);\n }\n }\n return resolved;\n};\nconst resolveArraysAndStatics = (() => {\n // This function does 3 things:\n // 1. It deeply flattens the array, only if actually needed though (!)\n // 2. It resolves statics, it's important to resolve them soon enough or they will be re-created multiple times (!)\n // 3. It checks if we found any Observables along the way, avoiding looping over the array another time in the future\n const DUMMY_RESOLVED = [];\n const resolveArraysAndStaticsInner = (values, resolved, hasObservables) => {\n for (let i = 0, l = values.length; i < l; i++) {\n const value = values[i];\n const type = typeof value;\n if (type === 'string' || type === 'number' || type === 'bigint') { // Static\n if (resolved === DUMMY_RESOLVED)\n resolved = values.slice(0, i);\n resolved.push(createText(value));\n }\n else if (type === 'object' && isArray(value)) { // Array\n if (resolved === DUMMY_RESOLVED)\n resolved = values.slice(0, i);\n hasObservables = resolveArraysAndStaticsInner(value, resolved, hasObservables)[1];\n }\n else if (type === 'function' && isObservable(value)) { // Observable\n if (resolved !== DUMMY_RESOLVED)\n resolved.push(value);\n hasObservables = true;\n }\n else { // Something else\n if (resolved !== DUMMY_RESOLVED)\n resolved.push(value);\n }\n }\n if (resolved === DUMMY_RESOLVED)\n resolved = values;\n return [resolved, hasObservables];\n };\n return (values) => {\n return resolveArraysAndStaticsInner(values, DUMMY_RESOLVED, false);\n };\n})();\n/* EXPORT */\nexport { resolveChild, resolveClass, resolveStyle, resolveArraysAndStatics };\n","/* IMPORT */\nimport { DIRECTIVES, SYMBOLS_DIRECTIVES, SYMBOL_UNCACHED } from '../constants.js';\nimport useMicrotask from '../hooks/use_microtask.js';\nimport useRenderEffect from '../hooks/use_render_effect.js';\nimport isStore from '../methods/is_store.js';\nimport $$ from '../methods/SS.js';\nimport store from '../methods/store.js';\nimport untrack from '../methods/untrack.js';\nimport { context, with as _with } from '../oby.js';\nimport { SYMBOL_STORE_OBSERVABLE } from '../oby.js';\nimport { classesToggle } from './classlist.js';\nimport { createText, createComment } from './creators.js';\nimport diff from './diff.js';\nimport FragmentUtils from './fragment.js';\nimport { castArray, flatten, isArray, isBoolean, isFunction, isFunctionReactive, isNil, isString, isSVG, isTemplateAccessor } from './lang.js';\nimport { resolveChild, resolveClass, resolveStyle } from './resolvers.js';\n/* MAIN */\nconst setAttributeStatic = (() => {\n const attributesBoolean = new Set(['allowfullscreen', 'async', 'autofocus', 'autoplay', 'checked', 'controls', 'default', 'disabled', 'formnovalidate', 'hidden', 'indeterminate', 'ismap', 'loop', 'multiple', 'muted', 'nomodule', 'novalidate', 'open', 'playsinline', 'readonly', 'required', 'reversed', 'seamless', 'selected']);\n const attributeCamelCasedRe = /e(r[HRWrv]|[Vawy])|Con|l(e[Tcs]|c)|s(eP|y)|a(t[rt]|u|v)|Of|Ex|f[XYa]|gt|hR|d[Pg]|t[TXYd]|[UZq]/; //URL: https://regex101.com/r/I8Wm4S/1\n const attributesCache = {};\n const uppercaseRe = /[A-Z]/g;\n const normalizeKeySvg = (key) => {\n return attributesCache[key] || (attributesCache[key] = attributeCamelCasedRe.test(key) ? key : key.replace(uppercaseRe, char => `-${char.toLowerCase()}`));\n };\n return (element, key, value) => {\n if (isSVG(element)) {\n key = (key === 'xlinkHref' || key === 'xlink:href') ? 'href' : normalizeKeySvg(key);\n if (isNil(value) || (value === false && attributesBoolean.has(key))) {\n element.removeAttribute(key);\n }\n else {\n element.setAttribute(key, String(value));\n }\n }\n else {\n if (isNil(value) || (value === false && attributesBoolean.has(key))) {\n element.removeAttribute(key);\n }\n else {\n value = (value === true) ? '' : String(value);\n element.setAttribute(key, value);\n }\n }\n };\n})();\nconst setAttribute = (element, key, value) => {\n if (isFunction(value) && isFunctionReactive(value)) {\n useRenderEffect(() => {\n setAttributeStatic(element, key, value());\n });\n }\n else {\n setAttributeStatic(element, key, $$(value));\n }\n};\nconst setChildReplacementFunction = (parent, fragment, child) => {\n useRenderEffect(() => {\n let valueNext = child();\n while (isFunction(valueNext)) {\n valueNext = valueNext();\n }\n setChildStatic(parent, fragment, false, valueNext, true);\n });\n};\nconst setChildReplacementText = (child, childPrev) => {\n if (childPrev.nodeType === 3) {\n childPrev.nodeValue = child;\n return childPrev;\n }\n else {\n const parent = childPrev.parentElement;\n if (!parent)\n throw new Error('Invalid child replacement');\n const textNode = createText(child);\n parent.replaceChild(textNode, childPrev);\n return textNode;\n }\n};\nconst setChildReplacement = (child, childPrev) => {\n const type = typeof child;\n if (type === 'string' || type === 'number' || type === 'bigint') {\n setChildReplacementText(String(child), childPrev);\n }\n else {\n const parent = childPrev.parentElement;\n if (!parent)\n throw new Error('Invalid child replacement');\n const fragment = FragmentUtils.makeWithNode(childPrev);\n if (type === 'function') {\n setChildReplacementFunction(parent, fragment, child); //TSC\n }\n else {\n setChild(parent, child, fragment);\n }\n }\n};\nconst setChildStatic = (parent, fragment, fragmentOnly, child, dynamic) => {\n if (!dynamic && child === undefined)\n return; // Ignoring static undefined children, avoiding inserting some useless placeholder nodes\n const prev = FragmentUtils.getChildren(fragment);\n const prevIsArray = (prev instanceof Array);\n const prevLength = prevIsArray ? prev.length : 1;\n const prevFirst = prevIsArray ? prev[0] : prev;\n const prevLast = prevIsArray ? prev[prevLength - 1] : prev;\n const prevSibling = prevLast?.nextSibling || null;\n if (prevLength === 0) { // Fast path for appending a node the first time\n const type = typeof child;\n if (type === 'string' || type === 'number' || type === 'bigint') {\n const textNode = createText(child);\n if (!fragmentOnly) {\n parent.appendChild(textNode);\n }\n FragmentUtils.replaceWithNode(fragment, textNode);\n return;\n }\n else if (type === 'object' && child !== null && typeof child.nodeType === 'number') { //TSC\n const node = child;\n if (!fragmentOnly) {\n parent.insertBefore(node, null);\n }\n FragmentUtils.replaceWithNode(fragment, node);\n return;\n }\n }\n if (prevLength === 1 && prevFirst.parentNode) { // Fast path for single text child replacing a mounted node\n const type = typeof child;\n if (type === 'string' || type === 'number' || type === 'bigint') {\n const node = setChildReplacementText(String(child), prevFirst); //TODO: maybe \"fragmentOnly\" should be passed on here, but it seems unnecessary\n FragmentUtils.replaceWithNode(fragment, node);\n return;\n }\n }\n const fragmentNext = FragmentUtils.make();\n const children = (Array.isArray(child) ? child : [child]); //TSC\n for (let i = 0, l = children.length; i < l; i++) {\n const child = children[i];\n const type = typeof child;\n if (type === 'string' || type === 'number' || type === 'bigint') {\n FragmentUtils.pushNode(fragmentNext, createText(child));\n }\n else if (type === 'object' && child !== null && typeof child.nodeType === 'number') {\n FragmentUtils.pushNode(fragmentNext, child);\n }\n else if (type === 'function') {\n const fragment = FragmentUtils.make();\n let childFragmentOnly = !fragmentOnly; // Avoiding mutating the DOM immediately, letting the parent handle it\n FragmentUtils.pushFragment(fragmentNext, fragment);\n resolveChild(child, (child, dynamic) => {\n const fragmentOnly = childFragmentOnly;\n childFragmentOnly = false;\n setChildStatic(parent, fragment, fragmentOnly, child, dynamic);\n });\n }\n }\n let next = FragmentUtils.getChildren(fragmentNext);\n let nextLength = fragmentNext.length;\n if (nextLength === 0 && prevLength === 1 && prevFirst.nodeType === 8) { // It's a placeholder already, no need to replace it\n return;\n }\n if (!fragmentOnly && (nextLength === 0 || (prevLength === 1 && prevFirst.nodeType === 8) || children[SYMBOL_UNCACHED])) { // Fast path for removing all children and/or replacing the placeholder\n const { childNodes } = parent;\n if (childNodes.length === prevLength) { // Maybe this fragment doesn't handle all children but only a range of them, checking for that here\n parent.textContent = '';\n if (nextLength === 0) { // Placeholder, to keep the right spot in the array of children\n const placeholder = (fragmentNext.placeholder || (fragmentNext.placeholder = fragment.placeholder || (fragment.placeholder = createComment())));\n FragmentUtils.pushNode(fragmentNext, placeholder);\n if (next !== fragmentNext.values) {\n next = placeholder;\n nextLength += 1;\n }\n }\n if (prevSibling) {\n if (next instanceof Array) {\n prevSibling.before.apply(prevSibling, next);\n }\n else {\n parent.insertBefore(next, prevSibling);\n }\n }\n else {\n if (next instanceof Array) {\n parent.append.apply(parent, next);\n }\n else {\n parent.append(next);\n }\n }\n FragmentUtils.replaceWithFragment(fragment, fragmentNext);\n return;\n }\n }\n if (nextLength === 0) { // Placeholder, to keep the right spot in the array of children\n const placeholder = (fragmentNext.placeholder || (fragmentNext.placeholder = fragment.placeholder || (fragment.placeholder = createComment())));\n FragmentUtils.pushNode(fragmentNext, placeholder);\n if (next !== fragmentNext.values) {\n next = placeholder;\n nextLength += 1;\n }\n }\n if (!fragmentOnly) {\n diff(parent, prev, next, prevSibling);\n }\n FragmentUtils.replaceWithFragment(fragment, fragmentNext);\n};\nconst setChild = (parent, child, fragment = FragmentUtils.make()) => {\n resolveChild(child, setChildStatic.bind(undefined, parent, fragment, false));\n};\nconst setClassStatic = classesToggle;\nconst setClass = (element, key, value) => {\n if (isFunction(value) && isFunctionReactive(value)) {\n useRenderEffect(() => {\n setClassStatic(element, key, value());\n });\n }\n else {\n setClassStatic(element, key, $$(value));\n }\n};\nconst setClassBooleanStatic = (element, value, key, keyPrev) => {\n if (keyPrev && keyPrev !== true) {\n setClassStatic(element, keyPrev, false);\n }\n if (key && key !== true) {\n setClassStatic(element, key, value);\n }\n};\nconst setClassBoolean = (element, value, key) => {\n if (isFunction(key) && isFunctionReactive(key)) {\n let keyPrev;\n useRenderEffect(() => {\n const keyNext = key();\n setClassBooleanStatic(element, value, keyNext, keyPrev);\n keyPrev = keyNext;\n });\n }\n else {\n setClassBooleanStatic(element, value, $$(key));\n }\n};\nconst setClassesStatic = (element, object, objectPrev) => {\n if (isString(object)) {\n if (isSVG(element)) {\n element.setAttribute('class', object);\n }\n else {\n element.className = object;\n }\n }\n else {\n if (objectPrev) {\n if (isString(objectPrev)) {\n if (objectPrev) {\n if (isSVG(element)) {\n element.setAttribute('class', '');\n }\n else {\n element.className = '';\n }\n }\n }\n else if (isArray(objectPrev)) {\n objectPrev = store.unwrap(objectPrev);\n for (let i = 0, l = objectPrev.length; i < l; i++) {\n if (!objectPrev[i])\n continue;\n setClassBoolean(element, false, objectPrev[i]);\n }\n }\n else {\n objectPrev = store.unwrap(objectPrev);\n for (const key in objectPrev) {\n if (object && key in object)\n continue;\n setClass(element, key, false);\n }\n }\n }\n if (isArray(object)) {\n if (isStore(object)) {\n for (let i = 0, l = object.length; i < l; i++) {\n const fn = untrack(() => isFunction(object[i]) ? object[i] : object[SYMBOL_STORE_OBSERVABLE](String(i))); //TSC\n setClassBoolean(element, true, fn);\n }\n }\n else {\n for (let i = 0, l = object.length; i < l; i++) {\n if (!object[i])\n continue;\n setClassBoolean(element, true, object[i]);\n }\n }\n }\n else {\n if (isStore(object)) {\n for (const key in object) {\n const fn = untrack(() => isFunction(object[key]) ? object[key] : object[SYMBOL_STORE_OBSERVABLE](key)); //TSC\n setClass(element, key, fn);\n }\n }\n else {\n for (const key in object) {\n setClass(element, key, object[key]);\n }\n }\n }\n }\n};\nconst setClasses = (element, object) => {\n if (isFunction(object) || isArray(object)) {\n let objectPrev;\n useRenderEffect(() => {\n const objectNext = resolveClass(object);\n setClassesStatic(element, objectNext, objectPrev);\n objectPrev = objectNext;\n });\n }\n else {\n setClassesStatic(element, object);\n }\n};\nconst setDirective = (element, directive, args) => {\n const symbol = SYMBOLS_DIRECTIVES[directive] || Symbol();\n const data = context(symbol) || DIRECTIVES[symbol];\n if (!data)\n throw new Error(`Directive \"${directive}\" not found`);\n const call = () => data.fn(element, ...castArray(args)); //TSC\n if (data.immediate) {\n call();\n }\n else {\n useMicrotask(call);\n }\n};\nconst setEventStatic = (() => {\n //TODO: Maybe delete event delegation\n //TODO: Maybe delegate more events: [onmousemove, onmouseout, onmouseover, onpointerdown, onpointermove, onpointerout, onpointerover, onpointerup, ontouchend, ontouchmove, ontouchstart]\n const delegatedEvents = {\n onauxclick: ['_onauxclick', false],\n onbeforeinput: ['_onbeforeinput', false],\n onclick: ['_onclick', false],\n ondblclick: ['_ondblclick', false],\n onfocusin: ['_onfocusin', false],\n onfocusout: ['_onfocusout', false],\n oninput: ['_oninput', false],\n onkeydown: ['_onkeydown', false],\n onkeyup: ['_onkeyup', false],\n onmousedown: ['_onmousedown', false],\n onmouseup: ['_onmouseup', false]\n };\n const delegate = (event) => {\n const key = `_${event}`;\n document.addEventListener(event.slice(2), event => {\n const targets = event.composedPath();\n let target = null;\n Object.defineProperty(event, 'currentTarget', {\n configurable: true,\n get() {\n return target;\n }\n });\n for (let i = 0, l = targets.length; i < l; i++) {\n target = targets[i];\n const handler = target[key];\n if (!handler)\n continue;\n handler(event);\n if (event.cancelBubble)\n break;\n }\n target = null;\n });\n };\n return (element, event, value) => {\n if (event.startsWith('onmiddleclick')) { // Special-cased synthetic event, somewhat ugly but very convenient\n const _value = value;\n event = `onauxclick${event.slice(13)}`;\n value = _value && ((event) => event['button'] === 1 && _value(event));\n }\n const delegated = delegatedEvents[event];\n if (delegated) {\n if (!delegated[1]) { // Not actually delegating yet\n delegated[1] = true;\n delegate(event);\n }\n element[delegated[0]] = value;\n }\n else if (event.endsWith('passive')) {\n const isCapture = event.endsWith('capturepassive');\n const type = event.slice(2, -7 - (isCapture ? 7 : 0));\n const key = `_${event}`;\n const valuePrev = element[key];\n if (valuePrev)\n element.removeEventListener(type, valuePrev, { capture: isCapture });\n if (value)\n element.addEventListener(type, value, { passive: true, capture: isCapture });\n element[key] = value;\n }\n else if (event.endsWith('capture')) {\n const type = event.slice(2, -7);\n const key = `_${event}`;\n const valuePrev = element[key];\n if (valuePrev)\n element.removeEventListener(type, valuePrev, { capture: true });\n if (value)\n element.addEventListener(type, value, { capture: true });\n element[key] = value;\n }\n else {\n element[event] = value;\n }\n };\n})();\nconst setEvent = (element, event, value) => {\n setEventStatic(element, event, value);\n};\nconst setHTMLStatic = (element, value) => {\n element.innerHTML = String(isNil(value) ? '' : value);\n};\nconst setHTML = (element, value) => {\n useRenderEffect(() => {\n setHTMLStatic(element, $$($$(value).__html));\n });\n};\nconst setPropertyStatic = (element, key, value) => {\n if (key === 'tabIndex' && isBoolean(value)) {\n value = value ? 0 : undefined;\n }\n if (key === 'value') {\n if (element.tagName === 'PROGRESS') {\n value ?? (value = null);\n }\n else if (element.tagName === 'SELECT' && !element['_$inited']) {\n element['_$inited'] = true;\n queueMicrotask(() => element[key] = value);\n }\n }\n try { // Trying setting the property\n element[key] = value;\n if (isNil(value)) {\n setAttributeStatic(element, key, null);\n }\n }\n catch { // If it fails, maybe because like HTMLInputElement.form there's only a getter, we try as an attribute instead //TODO: Figure out something better than this\n setAttributeStatic(element, key, value);\n }\n};\nconst setProperty = (element, key, value) => {\n if (isFunction(value) && isFunctionReactive(value)) {\n useRenderEffect(() => {\n setPropertyStatic(element, key, value());\n });\n }\n else {\n setPropertyStatic(element, key, $$(value));\n }\n};\nconst setRef = (element, value) => {\n if (isNil(value))\n return;\n const values = flatten(castArray(value)).filter(Boolean); //TODO: Maybe special-case this to be faster for non-array values, or 2-values arrays\n if (!values.length)\n return;\n useMicrotask(() => untrack(() => values.forEach(value => value?.(element))));\n};\nconst setStyleStatic = (() => {\n // From Preact: https://github.com/preactjs/preact/blob/e703a62b77c9de45e886d8a7f59bd0db658318f9/src/constants.js#L3\n // const propertyNonDimensionalRe = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n // From this Preact issue: https://github.com/preactjs/preact/issues/2607\n const propertyNonDimensionalRe = /^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini)/i;\n const propertyNonDimensionalCache = {};\n return (element, key, value) => {\n if (key.charCodeAt(0) === 45) { // /^-/\n if (isNil(value)) {\n element.style.removeProperty(key);\n }\n else {\n element.style.setProperty(key, String(value));\n }\n }\n else if (isNil(value)) {\n element.style[key] = null;\n }\n else {\n element.style[key] = (isString(value) || (propertyNonDimensionalCache[key] || (propertyNonDimensionalCache[key] = propertyNonDimensionalRe.test(key))) ? value : `${value}px`);\n }\n };\n})();\nconst setStyle = (element, key, value) => {\n if (isFunction(value) && isFunctionReactive(value)) {\n useRenderEffect(() => {\n setStyleStatic(element, key, value());\n });\n }\n else {\n setStyleStatic(element, key, $$(value));\n }\n};\nconst setStylesStatic = (element, object, objectPrev) => {\n if (isString(object)) {\n element.setAttribute('style', object);\n }\n else {\n if (objectPrev) {\n if (isString(objectPrev)) {\n if (objectPrev) {\n element.style.cssText = '';\n }\n }\n else {\n objectPrev = store.unwrap(objectPrev);\n for (const key in objectPrev) {\n if (object && key in object)\n continue;\n setStyleStatic(element, key, null);\n }\n }\n }\n if (isStore(object)) {\n for (const key in object) {\n const fn = untrack(() => isFunction(object[key]) ? object[key] : object[SYMBOL_STORE_OBSERVABLE](key)); //TSC\n setStyle(element, key, fn);\n }\n }\n else {\n for (const key in object) {\n setStyle(element, key, object[key]);\n }\n }\n }\n};\nconst setStyles = (element, object) => {\n if (isFunction(object) || isArray(object)) {\n let objectPrev;\n useRenderEffect(() => {\n const objectNext = resolveStyle(object);\n setStylesStatic(element, objectNext, objectPrev);\n objectPrev = objectNext;\n });\n }\n else {\n setStylesStatic(element, $$(object));\n }\n};\nconst setTemplateAccessor = (element, key, value) => {\n if (key === 'children') {\n const placeholder = createText(''); // Using a Text node rather than a Comment as the former may be what we actually want ultimately\n element.insertBefore(placeholder, null);\n value(element, 'setChildReplacement', undefined, placeholder);\n }\n else if (key === 'ref') {\n value(element, 'setRef');\n }\n else if (key === 'style') {\n value(element, 'setStyles');\n }\n else if (key === 'class') {\n if (!isSVG(element)) {\n element.className = ''; // Ensuring the attribute is present\n }\n value(element, 'setClasses');\n }\n else if (key === 'dangerouslySetInnerHTML') {\n value(element, 'setHTML');\n }\n else if (key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110) { // /^on/\n value(element, 'setEvent', key.toLowerCase());\n }\n else if (key.charCodeAt(0) === 117 && key.charCodeAt(3) === 58) { // /^u..:/\n value(element, 'setDirective', key.slice(4));\n }\n else if (key === 'innerHTML' || key === 'outerHTML' || key === 'textContent' || key === 'className') {\n // Forbidden props\n }\n else if (key in element && !isSVG(element)) {\n value(element, 'setProperty', key);\n }\n else {\n element.setAttribute(key, ''); // Ensuring the attribute is present\n value(element, 'setAttribute', key);\n }\n};\nconst setProp = (element, key, value) => {\n if (value === undefined)\n return; // Ignoring undefined props, for performance\n if (isTemplateAccessor(value)) {\n setTemplateAccessor(element, key, value);\n }\n else if (key === 'children') {\n setChild(element, value);\n }\n else if (key === 'ref') {\n setRef(element, value);\n }\n else if (key === 'style') {\n setStyles(element, value);\n }\n else if (key === 'class') {\n setClasses(element, value);\n }\n else if (key === 'dangerouslySetInnerHTML') {\n setHTML(element, value);\n }\n else if (key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110) { // /^on/\n setEvent(element, key.toLowerCase(), value);\n }\n else if (key.charCodeAt(0) === 117 && key.charCodeAt(3) === 58) { // /^u..:/\n setDirective(element, key.slice(4), value);\n }\n else if (key === 'innerHTML' || key === 'outerHTML' || key === 'textContent' || key === 'className') {\n // Forbidden props\n }\n else if (key in element && !isSVG(element)) {\n setProperty(element, key, value);\n }\n else {\n setAttribute(element, key, value);\n }\n};\nconst setProps = (element, object) => {\n for (const key in object) {\n setProp(element, key, object[key]);\n }\n};\n/* EXPORT */\nexport { setAttributeStatic, setAttribute, setChildReplacementFunction, setChildReplacementText, setChildReplacement, setChildStatic, setChild, setClassStatic, setClass, setClassBooleanStatic, setClassesStatic, setClasses, setEventStatic, setEvent, setHTMLStatic, setHTML, setPropertyStatic, setProperty, setRef, setStyleStatic, setStyle, setStylesStatic, setStyles, setTemplateAccessor, setProp, setProps };\n","/* IMPORT */\nimport untrack from './untrack.js';\nimport wrapElement from './wrap_element.js';\nimport { createHTMLNode, createSVGNode } from '../utils/creators.js';\nimport { isFunction, isNil, isNode, isString, isSVGElement, isVoidChild } from '../utils/lang.js';\nimport { setProps } from '../utils/setters.js';\n/* MAIN */\n// It's important to wrap components, so that they can be executed in the right order, from parent to child, rather than from child to parent in some cases\nconst createElement = (component, props, ..._children) => {\n const { children: __children, key, ref, ...rest } = (props || {}); //TSC\n const children = (_children.length === 1) ? _children[0] : (_children.length === 0) ? __children : _children;\n if (isFunction(component)) {\n const props = rest;\n if (!isNil(children))\n props.children = children;\n if (!isNil(ref))\n props.ref = ref;\n return wrapElement(() => {\n return untrack(() => component.call(component, props)); //TSC\n });\n }\n else if (isString(component)) {\n const props = rest;\n const isSVG = isSVGElement(component);\n const createNode = isSVG ? createSVGNode : createHTMLNode;\n if (!isVoidChild(children))\n props.children = children;\n if (!isNil(ref))\n props.ref = ref;\n return wrapElement(() => {\n const child = createNode(component); //TSC\n if (isSVG)\n child['isSVG'] = true;\n untrack(() => setProps(child, props));\n return child;\n });\n }\n else if (isNode(component)) {\n return wrapElement(() => component);\n }\n else {\n throw new Error('Invalid component');\n }\n};\n/* EXPORT */\nexport default createElement;\n","/* IMPORT */\nimport useMemo from '../hooks/use_memo.js';\nimport createElement from '../methods/create_element.js';\nimport resolve from '../methods/resolve.js';\nimport $$ from '../methods/SS.js';\n/* MAIN */\nconst Dynamic = ({ component, props, children }) => {\n return useMemo(() => {\n return resolve(createElement($$(component, false), $$(props), children));\n });\n};\n/* EXPORT */\nexport default Dynamic;\n","/* IMPORT */\nimport untrack from '../methods/untrack.js';\nimport { tryCatch } from '../oby.js';\nimport { isFunction } from '../utils/lang.js';\n/* MAIN */\nconst ErrorBoundary = ({ fallback, children }) => {\n return tryCatch(children, props => untrack(() => isFunction(fallback) ? fallback(props) : fallback));\n};\n/* EXPORT */\nexport default ErrorBoundary;\n","/* IMPORT */\nimport { for as _for } from '../oby.js';\nfunction For({ values, fallback, pooled, unkeyed, children }) {\n return _for(values, children, fallback, { pooled, unkeyed }); //TSC\n}\n/* EXPORT */\nexport default For;\n","/* IMPORT */\nimport cleanup from './cleanup.js';\nimport CacheKeyed from './for.cache.keyed.js';\nimport CacheUnkeyed from './for.cache.unkeyed.js';\nimport get from './get.js';\nimport isObservable from './is_observable.js';\nimport isStore from './is_store.js';\nimport memo from './memo.js';\nimport resolve from './resolve.js';\nimport untrack from './untrack.js';\nimport { frozen } from '../objects/callable.js';\nimport { SYMBOL_CACHED, SYMBOL_STORE_VALUES } from '../symbols.js';\nimport { isArray, isEqual } from '../utils.js';\nfunction _for(values, fn, fallback = [], options) {\n if (isArray(values) && !isStore(values)) { // Fast path for plain arrays\n const isUnkeyed = !!options?.unkeyed;\n return frozen(untrack(() => {\n if (values.length) {\n return values.map((value, index) => {\n return resolve(fn(isUnkeyed && !isObservable(value) ? frozen(value) : value, index));\n });\n }\n else {\n return resolve(fallback);\n }\n }));\n }\n else { // Regular path\n const { Q, map } = options?.unkeyed ? new CacheUnkeyed(fn, !!options.pooled) : new CacheKeyed(fn); //TSC\n cleanup(Q);\n const value = memo(() => {\n return get(values) ?? [];\n }, {\n equals: (next, prev) => {\n return !!next && !!prev && !next.length && !prev.length && !isStore(next) && !isStore(prev);\n }\n });\n return memo(() => {\n const array = value();\n if (isStore(array)) {\n array[SYMBOL_STORE_VALUES];\n }\n return untrack(() => {\n const results = map(array);\n return results?.length ? results : resolve(fallback);\n });\n }, {\n equals: (next, prev) => {\n return isArray(next) && !!next[SYMBOL_CACHED] && isArray(prev) && isEqual(next, prev);\n }\n });\n }\n}\n/* EXPORT */\nexport default _for;\n","/* IMPORT */\n/* MAIN */\nconst Fragment = ({ children }) => {\n return children;\n};\n/* EXPORT */\nexport default Fragment;\n","/* IMPORT */\nimport useMemo from './use_memo.js';\nimport $$ from '../methods/SS.js';\nimport { isNil } from '../utils/lang.js';\n/* MAIN */\n//TODO: Maybe port this to oby, as \"when\" or \"is\" or \"guarded\"\n//TODO: Optimize this, checking if the value is actually potentially reactive\nconst useGuarded = (value, guard) => {\n let valueLast;\n const guarded = useMemo(() => {\n const current = $$(value);\n if (!guard(current))\n return valueLast;\n return valueLast = current;\n });\n return () => {\n const current = guarded();\n if (isNil(current))\n throw new Error('The value never passed the type guard');\n return current;\n };\n};\n/* EXPORT */\nexport default useGuarded;\n","/* IMPORT */\nimport isObservable from '../methods/is_observable.js';\nimport useGuarded from '../hooks/use_guarded.js';\nimport useUntracked from '../hooks/use_untracked.js';\nimport { ternary } from '../oby.js';\nimport { isComponent, isFunction, isTruthy } from '../utils/lang.js';\n/* MAIN */\n//TODO: Support an is/guard prop, maybe\nconst If = ({ when, fallback, children }) => {\n if (isFunction(children) && !isObservable(children) && !isComponent(children)) { // Calling the children function with an (() => Truthy<T>)\n const truthy = useGuarded(when, isTruthy);\n return ternary(when, useUntracked(() => children(truthy)), fallback);\n }\n else { // Just passing the children along\n return ternary(when, children, fallback); //TSC\n }\n};\n/* EXPORT */\nexport default If;\n","/* IMPORT */\nimport useCleanup from '../hooks/use_cleanup.js';\nimport useMemo from '../hooks/use_memo.js';\nimport useResolved from '../hooks/use_resolved.js';\nimport useRoot from '../hooks/use_root.js';\nimport useSuspense from '../hooks/use_suspense.js';\nimport resolve from '../methods/resolve.js';\nimport $ from '../methods/S.js';\nimport { with as _with } from '../oby.js';\n/* HELPERS */\nconst cache = {};\nconst runWithSuperRoot = _with();\nlet lockId = 1;\n/* MAIN */\n//TODO: Support hot-swapping owner and context, to make the context JustWork™\nconst KeepAlive = ({ id, ttl, children }) => {\n return useMemo(() => {\n return useResolved([id, ttl], (id, ttl) => {\n const lock = lockId++;\n const item = cache[id] || (cache[id] = { id, lock });\n item.lock = lock;\n item.reset?.();\n item.suspended || (item.suspended = $(false));\n item.suspended(false);\n if (!item.dispose || !item.result) {\n runWithSuperRoot(() => {\n useRoot(dispose => {\n item.dispose = () => {\n delete cache[id];\n dispose();\n };\n useSuspense(item.suspended, () => {\n item.result = resolve(children);\n });\n });\n });\n }\n useCleanup(() => {\n const hasLock = () => lock === item.lock;\n if (!hasLock())\n return;\n item.suspended?.(true);\n if (!ttl || ttl <= 0 || ttl >= Infinity)\n return;\n const dispose = () => hasLock() && item.dispose?.();\n const timeoutId = setTimeout(dispose, ttl);\n const reset = () => clearTimeout(timeoutId);\n item.reset = reset;\n });\n return item.result;\n });\n });\n};\n/* EXPORT */\nexport default KeepAlive;\n","/* IMPORT */\nimport useRoot from '../hooks/use_root.js';\nimport { setChild } from '../utils/setters.js';\n/* MAIN */\nconst render = (child, parent) => {\n if (!parent || !(parent instanceof HTMLElement))\n throw new Error('Invalid parent node');\n parent.textContent = '';\n return useRoot(dispose => {\n setChild(parent, child);\n return () => {\n dispose();\n parent.textContent = '';\n };\n });\n};\n/* EXPORT */\nexport default render;\n","/* IMPORT */\nimport useBoolean from '../hooks/use_boolean.js';\nimport useRenderEffect from '../hooks/use_render_effect.js';\nimport render from '../methods/render.js';\nimport $$ from '../methods/SS.js';\nimport { createHTMLNode } from '../utils/creators.js';\nimport { assign } from '../utils/lang.js';\n/* MAIN */\nconst Portal = ({ when = true, mount, wrapper, children }) => {\n const portal = $$(wrapper) || createHTMLNode('div');\n if (!(portal instanceof HTMLElement))\n throw new Error('Invalid wrapper node');\n const condition = useBoolean(when);\n useRenderEffect(() => {\n if (!$$(condition))\n return;\n const parent = $$(mount) || document.body;\n if (!(parent instanceof Element))\n throw new Error('Invalid mount node');\n parent.insertBefore(portal, null);\n return () => {\n parent.removeChild(portal);\n };\n });\n useRenderEffect(() => {\n if (!$$(condition))\n return;\n return render(children, portal);\n });\n return assign(() => $$(condition) || children, { metadata: { portal } });\n};\n/* EXPORT */\nexport default Portal;\n","/* IMPORT */\nimport SuspenseContext from './suspense.context.js';\nimport useMemo from '../hooks/use_memo.js';\nimport useSuspense from '../hooks/use_suspense.js';\nimport resolve from '../methods/resolve.js';\nimport $$ from '../methods/SS.js';\nimport { suspense as _suspense, ternary } from '../oby.js';\n/* MAIN */\nconst Suspense = ({ when, fallback, children }) => {\n return SuspenseContext.wrap(suspense => {\n const condition = useMemo(() => !!$$(when) || suspense.active());\n const childrenSuspended = useSuspense(condition, () => resolve(children));\n return ternary(condition, fallback, childrenSuspended);\n });\n};\n/* EXPORT */\nexport default Suspense;\n","/* IMPORT */\nimport { switch as _switch } from '../oby.js';\nimport { assign, castArray } from '../utils/lang.js';\n/* MAIN */\n//TODO: Enforce children of Switch to be of type Switch.Case or Switch.Default\nconst Switch = ({ when, fallback, children }) => {\n const childrenWithValues = castArray(children); //TSC\n const values = childrenWithValues.map(child => child().metadata);\n return _switch(when, values, fallback); //TSC\n};\n/* UTILITIES */\nSwitch.Case = ({ when, children }) => {\n const metadata = { metadata: [when, children] };\n return assign(() => children, metadata);\n};\nSwitch.Default = ({ children }) => {\n const metadata = { metadata: [children] };\n return assign(() => children, metadata);\n};\n/* EXPORT */\nexport default Switch;\n","/* IMPORT */\nimport { ternary } from '../oby.js';\n/* MAIN */\nconst Ternary = ({ when, children }) => {\n return ternary(when, children[0], children[1]);\n};\n/* EXPORT */\nexport default Ternary;\n","/* IMPORT */\nimport './types.js';\nimport Fragment from '../components/fragment.js';\nimport createElement from '../methods/create_element.js';\n/* MAIN */\nconst jsx = (component, props) => {\n return createElement(component, props);\n};\n/* EXPORT */\nexport { jsx, jsx as jsxs, jsx as jsxDEV, Fragment };\n","/* IMPORT */\nimport { DIRECTIVES, SYMBOLS_DIRECTIVES } from '../constants.js';\nimport resolve from './resolve.js';\nimport { context } from '../oby.js';\n/* MAIN */\nconst createDirective = (name, fn, options) => {\n const immediate = !!options?.immediate;\n const data = { fn, immediate };\n const symbol = (SYMBOLS_DIRECTIVES[name] || (SYMBOLS_DIRECTIVES[name] = Symbol()));\n const Provider = ({ children }) => {\n return context({ [symbol]: data }, () => {\n return resolve(children);\n });\n };\n const ref = (...args) => {\n return (element) => {\n fn(element, ...args);\n };\n };\n const register = () => {\n if (symbol in DIRECTIVES)\n throw new Error('Directive \"name\" is already registered');\n DIRECTIVES[symbol] = data;\n };\n return { Provider, ref, register };\n};\n/* EXPORT */\nexport default createDirective;\n","/* IMPORT */\nimport useMemo from '../hooks/use_memo.js';\nimport $ from './S.js';\nimport resolve from './resolve.js';\nimport untrack from './untrack.js';\nimport { isFunction } from '../utils/lang.js';\n/* HELPERS */\nconst COMPONENT_RE = /^_?[A-Z][a-zA-Z0-9$_-]*$/;\nconst SYMBOL_AS = '__hmr_as__';\nconst SYMBOL_COLD_COMPONENT = Symbol('HMR.Cold');\nconst SYMBOL_HOT_COMPONENT = Symbol('HMR.Hot');\nconst SYMBOL_HOT_ID = Symbol('HMR.ID');\nconst SOURCES = new WeakMap();\n/* MAIN */\n//TODO: This seems excessively complicated, maybe it can be simplified somewhat?\n//TODO: Make this work better when a nested component is added/removed too\nconst hmr = (accept, component) => {\n if (accept) { // Making the component hot\n /* CHECK */\n const cached = component[SYMBOL_HOT_COMPONENT];\n if (cached)\n return cached; // Already hot\n const isProvider = !isFunction(component) && ('Provider' in component);\n if (isProvider)\n return component; // Context/Directive providers are not hot-reloadable\n /* HELPERS */\n const createHotComponent = (path) => {\n return (...args) => {\n return useMemo(() => {\n const component = path.reduce((component, key) => component[key], SOURCES.get(id())?.() || source());\n const result = resolve(untrack(() => component(...args)));\n return result;\n });\n };\n };\n const createHotComponentDeep = (component, path) => {\n const cached = component[SYMBOL_HOT_COMPONENT];\n if (cached)\n return cached;\n const hot = component[SYMBOL_HOT_COMPONENT] = createHotComponent(path);\n for (const key in component) {\n const value = component[key];\n if (isFunction(value) && COMPONENT_RE.test(key)) { // A component\n hot[key] = createHotComponentDeep(value, [...path, key]);\n }\n else { // Something else\n hot[key] = value;\n }\n }\n return hot;\n };\n const onAccept = (module) => {\n const hot = module[component[SYMBOL_AS]] || module[component.name] || module.default;\n if (!hot)\n return console.error(`[hmr] Failed to handle update for \"${component.name}\" component:\\n\\n`, component);\n const cold = hot[SYMBOL_COLD_COMPONENT] || hot;\n hot[SYMBOL_HOT_ID]?.(id());\n SOURCES.get(id())?.(() => cold);\n };\n /* MAIN */\n const id = $({});\n const source = $(component);\n SOURCES.set(id(), source);\n const cold = component[SYMBOL_COLD_COMPONENT] || component;\n const hot = createHotComponentDeep(component, []);\n cold[SYMBOL_HOT_COMPONENT] = hot;\n hot[SYMBOL_COLD_COMPONENT] = cold;\n hot[SYMBOL_HOT_COMPONENT] = hot;\n hot[SYMBOL_HOT_ID] = id;\n accept(onAccept);\n /* RETURN */\n return hot;\n }\n else { // Returning the component as is\n return component;\n }\n};\n/* EXPORT */\nexport default hmr;\n","var n=function(t,s,r,e){var u;s[0]=0;for(var h=1;h<s.length;h++){var p=s[h++],a=s[h]?(s[0]|=p?1:2,r[s[h++]]):s[++h];3===p?e[0]=a:4===p?e[1]=Object.assign(e[1]||{},a):5===p?(e[1]=e[1]||{})[s[++h]]=a:6===p?e[1][s[++h]]+=a+\"\":p?(u=t.apply(a,n(t,a,r,[\"\",null])),e.push(u),a[0]?s[0]|=2:(s[h-2]=0,s[h]=u)):e.push(a)}return e},t=new Map;export default function(s){var r=t.get(this);return r||(r=new Map,t.set(this,r)),(r=n(this,r.get(s)||(r.set(s,r=function(n){for(var t,s,r=1,e=\"\",u=\"\",h=[0],p=function(n){1===r&&(n||(e=e.replace(/^\\s*\\n\\s*|\\s*\\n\\s*$/g,\"\")))?h.push(0,n,e):3===r&&(n||e)?(h.push(3,n,e),r=2):2===r&&\"...\"===e&&n?h.push(4,n,0):2===r&&e&&!n?h.push(5,0,!0,e):r>=5&&((e||!n&&5===r)&&(h.push(r,0,e,s),r=6),n&&(h.push(r,n,0,s),r=6)),e=\"\"},a=0;a<n.length;a++){a&&(1===r&&p(),p(a));for(var l=0;l<n[a].length;l++)t=n[a][l],1===r?\"<\"===t?(p(),h=[h],r=3):e+=t:4===r?\"--\"===e&&\">\"===t?(r=1,e=\"\"):e=t+e[0]:u?t===u?u=\"\":e+=t:'\"'===t||\"'\"===t?u=t:\">\"===t?(p(),r=1):r&&(\"=\"===t?(r=5,s=e,e=\"\"):\"/\"===t&&(r<5||\">\"===n[a][l+1])?(p(),3===r&&(h=h[0]),r=h,(h=h[0]).push(2,0,r),r=0):\" \"===t||\"\\t\"===t||\"\\n\"===t||\"\\r\"===t?(p(),r=2):e+=t),3===r&&\"!--\"===e&&(r=4,h=h[0])}return p(),h}(s)),r),arguments,[])).length>1?r:r[0]}\n","/* IMPORT */\nimport htm from 'htm';\nimport createElement from './create_element.js';\nimport { assign } from '../utils/lang.js';\n/* HELPERS */\nconst registry = {};\nconst h = (type, props, ...children) => createElement(registry[type] || type, props, ...children);\nconst register = (components) => void assign(registry, components);\n/* MAIN */\nconst html = assign(htm.bind(h), { register });\n/* EXPORT */\nexport default html;\n","/* IMPORT */\nimport useMemo from '../hooks/use_memo.js';\nimport useResolved from '../hooks/use_resolved.js';\nimport useResource from '../hooks/use_resource.js';\nimport creatElement from './create_element.js';\nimport resolve from './resolve.js';\nimport { once } from '../utils/lang.js';\n/* MAIN */\nconst lazy = (fetcher) => {\n const fetcherOnce = once(fetcher);\n const component = (props) => {\n const resource = useResource(fetcherOnce);\n return useMemo(() => {\n return useResolved(resource, ({ pending, error, value }) => {\n if (pending)\n return;\n if (error)\n throw error;\n const component = ('default' in value) ? value.default : value;\n return resolve(creatElement(component, props));\n });\n });\n };\n component.preload = () => {\n return new Promise((resolve, reject) => {\n const resource = useResource(fetcherOnce);\n useResolved(resource, ({ pending, error }) => {\n if (pending)\n return;\n if (error)\n return reject(error);\n return resolve();\n });\n });\n };\n return component;\n};\n/* EXPORT */\nexport default lazy;\n","/* IMPORT */\nimport { SYMBOL_SUSPENSE_COLLECTOR } from '../constants.js';\nimport useMemo from '../hooks/use_memo.js';\nimport $ from '../methods/S.js';\nimport { context, resolve } from '../oby.js';\n/* MAIN */\n// Keeping track of all Suspense instances below it, needed in some cases\nconst SuspenseCollector = {\n create: () => {\n const parent = SuspenseCollector.get();\n const suspenses = $([]);\n const active = useMemo(() => suspenses().some(suspense => suspense.active()));\n const register = (suspense) => { parent?.register(suspense); suspenses(prev => [...prev, suspense]); };\n const unregister = (suspense) => { parent?.unregister(suspense); suspenses(prev => prev.filter(other => other !== suspense)); };\n const data = { suspenses, active, register, unregister };\n return data;\n },\n get: () => {\n return context(SYMBOL_SUSPENSE_COLLECTOR);\n },\n wrap: (fn) => {\n const data = SuspenseCollector.create();\n return context({ [SYMBOL_SUSPENSE_COLLECTOR]: data }, () => {\n return resolve(() => fn(data));\n });\n }\n};\n/* EXPORT */\nexport default SuspenseCollector;\n","/* IMPORT */\nimport Portal from '../components/portal.js';\nimport SuspenseCollector from '../components/suspense.collector.js';\nimport useEffect from '../hooks/use_effect.js';\nimport useRoot from '../hooks/use_root.js';\nimport $$ from './SS.js';\n/* MAIN */\n//TODO: Implement this properly, without relying on JSDOM or stuff like that\nconst renderToString = (child) => {\n return new Promise(resolve => {\n useRoot(dispose => {\n $$(SuspenseCollector.wrap(suspenses => {\n const { portal } = Portal({ children: child }).metadata;\n useEffect(() => {\n if (suspenses.active())\n return;\n resolve(portal.innerHTML);\n dispose();\n }, { suspense: false });\n }));\n });\n });\n};\n/* EXPORT */\nexport default renderToString;\n","/* IMPORT */\nimport { SYMBOL_TEMPLATE_ACCESSOR } from '../constants.js';\nimport wrapElement from './wrap_element.js';\nimport { assign, indexOf, isFunction, isString } from '../utils/lang.js';\nimport { setAttribute, setChildReplacement, setClasses, setEvent, setHTML, setProperty, setRef, setStyles } from '../utils/setters.js';\n/* MAIN */\n//TODO: Avoid using \"Function\" and \"eval\", while still keeping similar performance, if possible\n//TODO: Support complex children in the template function\n//TODO: Support argumentless calls on props, like props.foo.bar()\nconst template = (fn) => {\n const safePropertyRe = /^[a-z0-9-_]+$/i;\n const checkValidProperty = (property) => {\n if (isString(property) && safePropertyRe.test(property))\n return true;\n throw new Error(`Invalid property, only alphanumeric properties are allowed inside templates, received: \"${property}\"`);\n };\n const makeAccessor = (actionsWithNodes) => {\n return new Proxy({}, {\n get(target, prop) {\n checkValidProperty(prop);\n const accessor = (node, method, key, targetNode) => {\n if (key)\n checkValidProperty(key);\n actionsWithNodes.push([node, method, prop, key, targetNode]);\n };\n const metadata = { [SYMBOL_TEMPLATE_ACCESSOR]: true };\n return assign(accessor, metadata);\n }\n });\n };\n const makeActionsWithNodesAndTemplate = () => {\n const actionsWithNodes = [];\n const accessor = makeAccessor(actionsWithNodes);\n const component = fn(accessor);\n if (isFunction(component)) {\n const root = component();\n if (root instanceof Element) {\n return { actionsWithNodes, root };\n }\n }\n throw new Error('Invalid template, it must return a function that returns an Element');\n };\n const makeActionsWithPaths = (actionsWithNodes) => {\n const actionsWithPaths = [];\n for (let i = 0, l = actionsWithNodes.length; i < l; i++) {\n const [node, method, prop, key, targetNode] = actionsWithNodes[i];\n const nodePath = makeNodePath(node);\n const targetNodePath = targetNode ? makeNodePath(targetNode) : undefined;\n actionsWithPaths.push([nodePath, method, prop, key, targetNodePath]);\n }\n return actionsWithPaths;\n };\n const makeNodePath = (() => {\n let prevNode = null;\n let prevPath;\n return (node) => {\n if (node === prevNode)\n return prevPath; // Cache hit\n const path = [];\n let child = node;\n let parent = child.parentNode;\n while (parent) {\n const index = !child.previousSibling ? 0 : !child.nextSibling ? -0 : indexOf(parent.childNodes, child);\n path.push(index);\n child = parent;\n parent = parent.parentNode;\n }\n prevNode = node;\n prevPath = path;\n return path;\n };\n })();\n const makeNodePathProperties = (path) => {\n const properties = ['root'];\n const parts = path.slice().reverse();\n for (let i = 0, l = parts.length; i < l; i++) {\n const part = parts[i];\n if (Object.is(0, part)) {\n properties.push('firstChild');\n }\n else if (Object.is(-0, part)) {\n properties.push('lastChild');\n }\n else {\n properties.push('firstChild');\n for (let nsi = 0; nsi < part; nsi++) {\n properties.push('nextSibling');\n }\n }\n }\n return properties;\n };\n const makeReviverPaths = (actionsWithPaths) => {\n const paths = [];\n for (let i = 0, l = actionsWithPaths.length; i < l; i++) {\n const action = actionsWithPaths[i];\n const nodePath = action[0];\n const targetNodePath = action[4];\n paths.push(nodePath);\n if (targetNodePath) {\n paths.push(targetNodePath);\n }\n }\n return paths;\n };\n const makeReviverVariablesData = (paths, properties) => {\n const data = new Array(paths.length);\n for (let i = 0, l = paths.length; i < l; i++) {\n data[i] = {\n path: paths[i],\n properties: properties[i]\n };\n }\n return data;\n };\n const makeReviverVariables = (actionsWithPaths) => {\n const paths = makeReviverPaths(actionsWithPaths);\n const properties = paths.map(makeNodePathProperties);\n const data = makeReviverVariablesData(paths, properties);\n const assignments = [];\n const map = new Map();\n let variableId = 0;\n while (true) {\n const datum = data.find(datum => datum.properties.length > 1);\n if (!datum)\n break;\n const [current, next] = datum.properties;\n const variable = `$${variableId++}`;\n const assignment = `const ${variable} = ${current}.${next};`;\n assignments.push(assignment);\n for (let i = 0, l = data.length; i < l; i++) {\n const datum = data[i];\n const [otherCurrent, otherNext] = datum.properties;\n if (otherCurrent !== current || otherNext !== next)\n continue;\n datum.properties[0] = variable;\n datum.properties.splice(1, 1);\n }\n }\n for (let i = 0, l = data.length; i < l; i++) {\n const datum = data[i];\n map.set(datum.path, datum.properties[0]);\n }\n return { assignments, map };\n };\n const makeReviverActions = (actionsWithPaths, variables) => {\n const actions = [];\n for (let i = 0, l = actionsWithPaths.length; i < l; i++) { //TODO: Write this more cleanly, with a single case\n const [nodePath, method, prop, key, targetNodePath] = actionsWithPaths[i];\n if (targetNodePath) {\n actions.push(`this.${method} ( props[\"${prop}\"], ${variables.get(targetNodePath)} );`);\n }\n else if (key) {\n actions.push(`this.${method} ( ${variables.get(nodePath)}, \"${key}\", props[\"${prop}\"] );`);\n }\n else {\n actions.push(`this.${method} ( ${variables.get(nodePath)}, props[\"${prop}\"] );`);\n }\n }\n return actions;\n };\n const makeReviver = (actionsWithPaths) => {\n const { assignments, map } = makeReviverVariables(actionsWithPaths);\n const actions = makeReviverActions(actionsWithPaths, map);\n const fn = new Function('root', 'props', `${assignments.join('')}${actions.join('')}return root;`);\n const apis = { setAttribute, setChildReplacement, setClasses, setEvent, setHTML, setProperty, setRef, setStyles };\n const reviver = fn.bind(apis);\n return reviver;\n };\n const makeComponent = () => {\n const { actionsWithNodes, root } = makeActionsWithNodesAndTemplate();\n const actionsWithPaths = makeActionsWithPaths(actionsWithNodes);\n const reviver = makeReviver(actionsWithPaths);\n return (props) => {\n const clone = root.cloneNode(true);\n return wrapElement(reviver.bind(undefined, clone, props));\n };\n };\n return makeComponent();\n};\n/* EXPORT */\nexport default template;\n","/* IMPORT */\nimport { CONTEXTS_DATA } from '../constants.js';\nimport resolve from './resolve.js';\nimport { context } from '../oby.js';\nfunction createContext(defaultValue) {\n const symbol = Symbol();\n const Provider = ({ value, children }) => {\n return context({ [symbol]: value }, () => {\n return resolve(children);\n });\n };\n const Context = { Provider };\n CONTEXTS_DATA.set(Context, { symbol, defaultValue });\n return Context;\n}\n/* EXPORT */\nexport default createContext;\n","/* IMPORT */\nimport createElement from './create_element.js';\nimport { isArray, isObject } from '../utils/lang.js';\nfunction h(component, props, ...children) {\n if (children.length || (isObject(props) && !isArray(props))) {\n return createElement(component, props, ...children); //TSC\n }\n else {\n return createElement(component, null, props); //TSC\n }\n}\n/* EXPORT */\nexport default h;\n","/* IMPORT */\nimport { CONTEXTS_DATA } from '../constants.js';\nimport { context } from '../oby.js';\nimport { isNil } from '../utils/lang.js';\nfunction useContext(Context) {\n const { symbol, defaultValue } = CONTEXTS_DATA.get(Context) || { symbol: Symbol() };\n const valueContext = context(symbol);\n const value = isNil(valueContext) ? defaultValue : valueContext;\n return value;\n}\n/* EXPORT */\nexport default useContext;\n","import { html, render, $, isObservable } from \"voby\";\n\ncustomElements.define(\n \"neptune-reactive-root\",\n class extends HTMLElement {\n constructor() {\n super();\n this.c = () => {};\n }\n\n connectedCallback() {\n this.style.display = \"contents\";\n this.dispose?.();\n this.dispose = render(html`${this.c()}`, this);\n }\n\n disconnectedCallback() {\n this.dispose?.();\n }\n },\n);\n\nexport function ReactiveRoot({ children }) {\n const root = html`<neptune-reactive-root></neptune-reactive-root>`();\n root.c = () => children;\n\n return root;\n}\n\nexport function Switch(props) {\n let checked = props.checked ?? false;\n\n if (!props.onClick) {\n checked = $(!!checked);\n props.onClick = () => checked((c) => !c);\n }\n\n return html`\n <div>\n <input class=\"neptune-switch-checkbox\" type=\"checkbox\" checked=${checked} />\n <span onClick=${props.onClick} class=\"neptune-switch\"></span>\n </div>\n `;\n}\n\nexport function TextInput({ placeholder = \"\", type = \"text\", value = \"\", onEnter = () => {} }) {\n if (!isObservable(value)) value = $(value);\n\n return html`\n <input\n class=\"neptune-text-input\"\n value=${value}\n onKeyup=${(e) => {\n if (e.key != \"Enter\") return;\n onEnter(e);\n }}\n onInput=${(e) => value(e.target.value)}\n placeholder=${placeholder}\n type=${type} />\n `;\n}\n\nexport function Button({ onClick = () => {}, children }) {\n return html` <button class=\"neptune-button\" onClick=${onClick}>${children}</button> `;\n}\n\nexport function ReloadIcon() {\n return html`<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"22\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\">\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99\" />\n </svg>`;\n}\n\nexport function TrashIcon() {\n return html`<svg\n style=\"width: 22px;\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\">\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0\"></path>\n </svg>`;\n}\n","// we use this array multiple times\nexport const patchTypes = [\"a\", \"b\", \"i\"];\nexport const patchedObjects = new Map();\n","import { patchedObjects, patchTypes } from \"./shared.js\";\nexport function unpatch(funcParent, funcName, hookId, type) {\n const patchedObject = patchedObjects.get(funcParent);\n const patch = patchedObject?.[funcName];\n if (!patch?.[type].has(hookId))\n return false;\n patch[type].delete(hookId);\n // If there are no more hooks for every type, remove the patch\n if (patchTypes.every((t) => patch[t].size === 0)) {\n // reflect defineproperty is like object defineproperty\n // but instead of erroring it returns if it worked or not.\n // this is more easily minifiable, hence its use. -- sink\n const success = Reflect.defineProperty(funcParent, funcName, {\n value: patch.o,\n writable: true,\n configurable: true,\n });\n if (!success)\n funcParent[funcName] = patch.o;\n delete patchedObject[funcName];\n }\n if (Object.keys(patchedObject).length == 0)\n patchedObjects.delete(funcParent);\n return true;\n}\nexport function unpatchAll() {\n for (const [parentObject, patchedObject] of patchedObjects.entries())\n for (const funcName in patchedObject)\n for (const hookType of patchTypes)\n for (const hookId of patchedObject[funcName]?.[hookType].keys() ?? [])\n unpatch(parentObject, funcName, hookId, hookType);\n}\n","// curried - getPatchFunc(\"before\")(...)\n// allows us to apply an argument while leaving the rest open much cleaner.\n// functional programming strikes again! -- sink\nimport hook from \"./hook.js\";\nimport { patchedObjects } from \"./shared.js\";\nimport { unpatch } from \"./unpatch.js\";\n// creates a hook if needed, else just adds one to the patches array\nexport default (patchType) => (funcName, funcParent, callback, oneTime = false) => {\n if (typeof funcParent[funcName] !== \"function\")\n throw new Error(`${funcName} is not a function in ${funcParent.constructor.name}`);\n if (!patchedObjects.has(funcParent))\n patchedObjects.set(funcParent, Object.create(null));\n const parentInjections = patchedObjects.get(funcParent);\n if (!parentInjections[funcName]) {\n const origFunc = funcParent[funcName];\n // note to future me optimising for size: extracting new Map() to a func increases size --sink\n parentInjections[funcName] = {\n o: origFunc,\n b: new Map(),\n i: new Map(),\n a: new Map(),\n };\n const runHook = (ctxt, args, construct) => {\n const ret = hook(funcName, funcParent, args, ctxt, construct);\n if (oneTime)\n unpatchThisPatch();\n return ret;\n };\n const replaceProxy = new Proxy(origFunc, {\n apply: (_, ctxt, args) => runHook(ctxt, args, false),\n construct: (_, args) => runHook(origFunc, args, true),\n get: (target, prop, receiver) => prop == \"toString\"\n ? origFunc.toString.bind(origFunc)\n : Reflect.get(target, prop, receiver),\n });\n // this works around breaking some async find implementation which listens for assigns via proxy\n // see comment in unpatch.ts\n const success = Reflect.defineProperty(funcParent, funcName, {\n value: replaceProxy,\n configurable: true,\n writable: true,\n });\n if (!success)\n funcParent[funcName] = replaceProxy;\n }\n const hookId = Symbol();\n const unpatchThisPatch = () => unpatch(funcParent, funcName, hookId, patchType);\n parentInjections[funcName][patchType].set(hookId, callback);\n return unpatchThisPatch;\n};\n","// calls relevant patches and returns the final result\nimport { patchedObjects } from \"./shared.js\";\nexport default function (funcName, funcParent, funcArgs, \n// the value of `this` to apply\nctxt, \n// if true, the function is actually constructor\nisConstruct) {\n const patch = patchedObjects.get(funcParent)?.[funcName];\n // This is in the event that this function is being called after all patches are removed.\n if (!patch)\n return isConstruct\n ? Reflect.construct(funcParent[funcName], funcArgs, ctxt)\n : funcParent[funcName].apply(ctxt, funcArgs);\n // Before patches\n for (const hook of patch.b.values()) {\n const maybefuncArgs = hook.call(ctxt, funcArgs);\n if (Array.isArray(maybefuncArgs))\n funcArgs = maybefuncArgs;\n }\n // Instead patches\n let workingRetVal = [...patch.i.values()].reduce((prev, current) => (...args) => current.call(ctxt, args, prev), \n // This calls the original function\n (...args) => isConstruct\n ? Reflect.construct(patch.o, args, ctxt)\n : patch.o.apply(ctxt, args))(...funcArgs);\n // After patches\n for (const hook of patch.a.values())\n workingRetVal = hook.call(ctxt, funcArgs, workingRetVal) ?? workingRetVal;\n return workingRetVal;\n}\n","import getPatchFunc from \"./getPatchFunc.js\";\nimport { unpatchAll } from \"./unpatch.js\";\nconst before = getPatchFunc(\"b\");\nconst instead = getPatchFunc(\"i\");\nconst after = getPatchFunc(\"a\");\nexport { instead, before, after, unpatchAll };\n","function promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\nfunction createStore(dbName, storeName) {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\n return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));\n}\nlet defaultGetStoreFunc;\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction get(key, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => promisifyRequest(store.get(key)));\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction set(key, value, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction setMany(entries, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n entries.forEach((entry) => store.put(entry[1], entry[0]));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction getMany(keys, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => Promise.all(keys.map((key) => promisifyRequest(store.get(key)))));\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction update(key, updater, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => \n // Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise((resolve, reject) => {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n }\n catch (err) {\n reject(err);\n }\n };\n }));\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction del(key, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction delMany(keys, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n keys.forEach((key) => store.delete(key));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction clear(customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\nfunction eachCursor(store, callback) {\n store.openCursor().onsuccess = function () {\n if (!this.result)\n return;\n callback(this.result);\n this.result.continue();\n };\n return promisifyRequest(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction keys(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(store.getAllKeys());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.key)).then(() => items);\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction values(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.value)).then(() => items);\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction entries(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([\n promisifyRequest(store.getAllKeys()),\n promisifyRequest(store.getAll()),\n ]).then(([keys, values]) => keys.map((key, i) => [key, values[i]]));\n }\n const items = [];\n return customStore('readonly', (store) => eachCursor(store, (cursor) => items.push([cursor.key, cursor.value])).then(() => items));\n });\n}\n\nexport { clear, createStore, del, delMany, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\n","import { createStore as createIdbStore, set as idbSet, get as idbGet } from \"idb-keyval\";\nimport { store } from \"voby\";\n\nexport function appendStyle(style) {\n const styleTag = document.createElement(\"style\");\n styleTag.innerHTML = style;\n\n // Forgive me, for I have sinned.\n if (document.head) {\n document.head.appendChild(styleTag);\n } else {\n document.addEventListener(\"DOMContentLoaded\", () => {\n document.head.appendChild(styleTag);\n })\n }\n\n return (newStyle) => {\n if (newStyle == undefined) return document.head.removeChild(styleTag);\n\n styleTag.innerHTML = newStyle;\n };\n}\n\nexport const neptuneIdbStore = createIdbStore(\"__NEPTUNE_IDB_STORAGE\", \"__NEPTUNE_IDB_STORAGE\");\n\n// store.on appears to not work upon isArray being true. This makes me a very sad toonlink.\nexport function createPersistentObject(id, isArray = false) {\n // This is fucking moronic. But fine, we'll do this dumb shit just for you.\n const persistentObject = store(isArray ? { value: [] } : {});\n\n store.on(persistentObject, () => {\n idbSet(id, store.unwrap(persistentObject), neptuneIdbStore);\n });\n\n return [\n isArray ? persistentObject.value : persistentObject,\n new Promise((res) =>\n idbGet(id, neptuneIdbStore).then((obj) => {\n store.reconcile(persistentObject, obj ?? (isArray ? { value: [] } : {}));\n res();\n }),\n ),\n ];\n}\n\nexport const parseManifest = (manifest) => {\n try {\n if (typeof manifest == \"string\")\n manifest = JSON.parse(manifest.slice(manifest.indexOf(\"/*\") + 2, manifest.indexOf(\"*/\")));\n } catch {\n throw \"Failed to parse manifest!\";\n }\n\n if (![\"name\", \"author\", \"description\"].every((i) => typeof manifest[i] === \"string\"))\n throw \"Manifest doesn't contain required properties!\";\n\n return manifest;\n};\n\nexport const getMediaURLFromID = (id, path = \"/1280x1280.jpg\") =>\n \"https://resources.tidal.com/images/\" + id.split(\"-\").join(\"/\") + path;\n\n\nexport function convertHexToRGB(h) {\n let r = 0;\n let g = 0;\n let b = 0;\n\n // 3 digits\n if (h.length === 4) {\n r = Number('0x' + h[1] + h[1]);\n g = Number('0x' + h[2] + h[2]);\n b = Number('0x' + h[3] + h[3]);\n\n // 6 digits\n } else if (h.length === 7) {\n r = Number('0x' + h[1] + h[2]);\n g = Number('0x' + h[3] + h[4]);\n b = Number('0x' + h[5] + h[6]);\n }\n\n return `${r}, ${g}, ${b}`\n}\n","/* es-module-lexer 1.3.0 */\nconst A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];export function parse(E,g=\"@\"){if(!C)return init.then((()=>parse(E)));const I=E.length+1,o=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;o>0&&C.memory.grow(Math.ceil(o/65536));const D=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,D,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split(\"\\n\").length}:${C.e()-E.lastIndexOf(\"\\n\",C.e()-1)}`),{idx:C.e()});const K=[],k=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.ai(),g=C.id(),I=C.ss(),o=C.se();let D;C.ip()&&(D=J(E.slice(-1===g?A-1:A,-1===g?Q+1:Q))),K.push({n:D,s:A,e:Q,ss:I,se:o,d:g,a:B})}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),o=I[0],D=B<0?void 0:E.slice(B,g),K=D?D[0]:\"\";k.push({s:A,e:Q,ls:B,le:g,n:'\"'===o||\"'\"===o?J(I):I,ln:'\"'===K||\"'\"===K?J(D):D})}function J(A){try{return(0,eval)(A)}catch(A){}}return[K,k,!!C.f()]}function Q(A,Q){const B=A.length;let C=0;for(;C<B;){const B=A.charCodeAt(C);Q[C++]=(255&B)<<8|B>>>8}}function B(A,Q){const B=A.length;let C=0;for(;C<B;)Q[C]=A.charCodeAt(C++)}let C;export const init=WebAssembly.compile((E=\"AGFzbQEAAAABKghgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gAn9/AAMvLgABAQICAgICAgICAgICAgICAgIAAwMDBAQAAAADAAAAAAMDAA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ffer.from(E,\"base64\"):Uint8Array.from(atob(E),(A=>A.charCodeAt(0))))).then(WebAssembly.instantiate).then((({exports:A})=>{C=A}));var E;","import { parse } from \"es-module-lexer\";\n\n// This needs support for 3 things to be \"complete\":\n// 1. `import \"./module.js\"`\n// 2. `await import(\"module\")`\n// 3. `export * from \"module\"`\n// For now, it's fine.\n\nasync function betterParse(src) {\n let [imports] = await parse(src);\n let exports = [];\n\n imports = imports.filter((imp) => {\n imp.declaration = src\n .slice(imp.ss, imp.se)\n .replace(/\\/\\*[\\w\\W]*?\\*\\//g, \"\");\n imp.importClause = imp.declaration\n .slice(6, imp.declaration.lastIndexOf(\"from\"))\n .trim();\n\n const namedImportOpener = imp.importClause.indexOf(\"{\");\n const namedImportCloser = imp.importClause.indexOf(\"}\") + 1;\n\n imp.namedImport = imp.importClause.slice(\n namedImportOpener,\n namedImportCloser\n );\n\n if (imp.namedImport != \"\") {\n imp.importClause =\n imp.importClause.slice(0, namedImportOpener) +\n imp.importClause.slice(namedImportCloser);\n\n imp.namedImports = imp.namedImport\n .slice(1, -1)\n .trim()\n .split(\",\")\n .filter((i) => i.trim() != \"\")\n .map((i) => {\n const split = i.trim().split(\" as \");\n\n if (!split[1]) split[1] = split[0];\n return split;\n })\n .reduce((obj, c) => {\n obj[c[0]] = c[1];\n\n return obj;\n }, {});\n }\n\n const commaIndex = imp.importClause.indexOf(\",\");\n\n if (imp.namedImport == \"\") {\n const namespace =\n commaIndex == -1\n ? imp.importClause\n : imp.importClause.slice(commaIndex + 1).trim();\n\n if (namespace[0] == \"*\")\n imp.namespace = namespace.slice(namespace.indexOf(\"as\") + 2).trim();\n }\n\n // If there's no named imports and there's no namespaces, the default export *is* the importClause\n if (imp.namedImport == \"\" && !imp.namespace) {\n imp.default = imp.importClause;\n } else if (commaIndex != -1) {\n // Otherwise, the default export *must* come before the comma\n imp.default = imp.importClause.slice(0, commaIndex);\n }\n\n if (imp.declaration.slice(0, 6) == \"import\") return true;\n\n imp.isExport = true;\n exports.push(imp);\n });\n\n return [imports, exports];\n}\n\nconst destructurifyImp = (obj) =>\n Object.entries(obj)\n .map(([k, v]) => `${k}:${v}`)\n .join();\n\nconst removeFromString = (string, start, end) =>\n string.slice(0, start) + string.slice(end);\n\nconst insertIntoString = (string, start, newString) =>\n string.slice(0, start) + newString + string.slice(start);\n\nexport default async function quartz(\n code,\n config = { plugins: [] },\n moduleId = false\n) {\n let generatedImports = \"\";\n\n for (const plugin of config.plugins)\n if (plugin.transform) code = plugin.transform({ code });\n\n const [imports, exports] = await betterParse(code);\n\n // I don't want to have to parse any of this shit more than once.\n let offset = 0;\n\n for (const exp of exports) {\n imports.push(exp);\n\n const startIndex = exp.ss + offset;\n const endIndex = exp.se + offset;\n\n const namespace = exp.namespace;\n if (namespace != undefined) {\n // Because of how `export * from \"module\"` works, we can't dynamically export things.\n // My proposal is that we have a $$$QUARTZ_DYNAMIC_EXPORTS object passed through,\n // we add a randomly generated namespace, and then we convert the export into reassigning $$$QUARTZ_DYNAMIC_EXPORTS.\n // We then spread the exports and the dynamic exports together and return that as the exports.\n\n if (namespace != \"\") {\n code = removeFromString(code, startIndex, endIndex);\n const newExport = `export { ${namespace} };`;\n code = insertIntoString(code, startIndex, newExport);\n\n offset -= endIndex - startIndex + newExport.length;\n }\n\n continue;\n }\n\n const fromIndex =\n startIndex + code.slice(startIndex, endIndex).lastIndexOf(\"from\");\n code = removeFromString(code, fromIndex, endIndex);\n offset -= endIndex - fromIndex;\n }\n\n let quartzStore = {};\n\n for (const imp of imports) {\n if (!imp.isExport) {\n code = removeFromString(code, imp.ss + offset, imp.se + offset);\n\n offset -= imp.se + offset - (imp.ss + offset);\n }\n\n let id = (Math.random() + 1).toString(36).substring(7);\n\n let store = (quartzStore[id] = {});\n let accessor = `$$$QUARTZ_STORE[\"${id}\"]`;\n\n for (const plugin of config.plugins) {\n if (!plugin.resolve) continue;\n\n const generatedImport = await plugin.resolve({\n config,\n accessor,\n store,\n name: imp.n,\n moduleId,\n });\n\n if (!generatedImport) continue;\n\n const addImport = (name) =>\n (generatedImports += `const ${name} = ${generatedImport};`);\n\n if (imp.default) addImport(`{default:${imp.default}}`);\n if (imp.namespace) addImport(imp.namespace);\n if (imp.namedImports) {\n addImport(\"{\" + destructurifyImp(imp.namedImports) + \"}\");\n }\n\n break;\n }\n }\n\n // This appears to be the only way to share things between realms.\n const globalStoreID = (Math.random() + 1).toString(36).substring(7);\n globalThis[globalStoreID] = quartzStore;\n\n // console.log(generatedImports + code)\n\n const mod = await import(\n `data:text/javascript;base64,${btoa(\n `const $$$QUARTZ_STORE = globalThis[\"${globalStoreID}\"];` +\n generatedImports +\n code\n )}`\n );\n delete globalThis[globalStoreID];\n\n return mod;\n}\n","export default ({baseUrl = \"https://esm.sh/\", existingUrls = true} = {}) => {\n return {\n resolve({ name }) {\n if (name.startsWith(\".\") || name.startsWith(\"/\")) return; // local url\n\n // npm package\n if (!/^\\w+:/.test(name) && baseUrl) {\n name = baseUrl + name;\n }\n else if (!existingUrls) return;\n\n return `await import(\"${name}\")`;\n },\n };\n};\n","export const interceptors = {};\n\nexport default function intercept(types, cb, once = false) {\n if (typeof types == \"string\") types = [types];\n\n const uninterceptors = [];\n const unintercept = () => uninterceptors.forEach((u) => u());\n\n for (let type of types) {\n if (!interceptors[type]) interceptors[type] = [];\n\n const handleIntercept = once\n ? (...args) => {\n unintercept();\n\n return cb(...args);\n }\n : cb;\n interceptors[type].push(handleIntercept);\n\n uninterceptors.push(() =>\n interceptors[type].splice(interceptors[type].indexOf(handleIntercept), 1),\n );\n }\n\n return unintercept;\n}\n","import { store } from \"voby\";\nimport { createPersistentObject, neptuneIdbStore, parseManifest } from \"./utils.js\";\nimport { del } from \"idb-keyval\";\nimport quartz from \"@uwu/quartz\";\nimport urlImport from \"quartz-plugin-url-import\";\nimport { actions } from \"../handleExfiltrations.js\";\nimport intercept from \"./intercept.js\";\n\nexport const [pluginStore, pluginStoreReady] = createPersistentObject(\"NEW_NEPTUNE_PLUGINS\", true);\nexport const enabled = store({});\n\nexport const getPluginById = (id) => pluginStore.find((p) => p.id == id);\n\nexport async function disablePlugin(id) {\n getPluginById(id).enabled = false;\n const onUnload = enabled?.[id]?.onUnload;\n\n delete enabled[id];\n\n try {\n await onUnload?.();\n } catch (e) {\n console.error(\"Failed to completely clean up neptune plugin!\\n\", e);\n }\n}\n\nexport function togglePlugin(id) {\n return getPluginById(id).enabled ? disablePlugin(id) : enablePlugin(id);\n}\n\nexport async function enablePlugin(id) {\n const plugin = getPluginById(id);\n plugin.enabled = true;\n\n await runPlugin(plugin);\n}\n\nasync function runPlugin(plugin) {\n try {\n const [persistentStorage, persistentStorageReady] = createPersistentObject(\n plugin.id + \"_PERSISTENT_STORAGE\",\n );\n\n await persistentStorageReady;\n\n const unloadables = [];\n const pluginData = {\n id: plugin.id,\n manifest: plugin.manifest,\n storage: persistentStorage,\n addUnloadable(callback) {\n unloadables.push(callback);\n },\n };\n\n const { onUnload, Settings } = await quartz(plugin.code, {\n plugins: [\n {\n resolve({ name }) {\n if (!name.startsWith(\"@neptune\")) return;\n\n return `window${name\n .slice(1)\n .split(\"/\")\n .map((i) => `[${JSON.stringify(i)}]`)\n .join(\"\")}`;\n },\n },\n {\n resolve({ name, store, accessor }) {\n if (!name.startsWith(\"@plugin\")) return;\n\n if (!store.plugin) store.plugin = { ...pluginData, default: pluginData };\n\n return `${accessor}${name\n .slice(1)\n .split(\"/\")\n .map((i) => `[${JSON.stringify(i)}]`)\n .join(\"\")}`;\n },\n },\n urlImport(),\n ],\n });\n\n enabled[plugin.id] = {\n onUnload: () => {\n onUnload?.();\n for (const ul of unloadables) {\n ul();\n }\n },\n };\n if (Settings) enabled[plugin.id].Settings = Settings;\n } catch (e) {\n await disablePlugin(plugin.id);\n\n console.error(\"Failed to load neptune plugin!\\n\", e);\n }\n}\n\nexport async function installPlugin(id, code, manifest, enabled = true) {\n const plugin = {\n id,\n code,\n manifest,\n enabled,\n };\n\n pluginStore.unshift(plugin);\n\n if (enabled) await runPlugin(plugin);\n}\n\nexport async function removePlugin(id) {\n try {\n if (enabled[id]) await enabled[id].onUnload();\n } catch {\n console.log(\"[neptune] failed to unload plugin upon removal\");\n }\n\n pluginStore.splice(\n pluginStore.findIndex((p) => p.id == id),\n 1,\n );\n\n await del(id + \"_PERSISTENT_STORAGE\", neptuneIdbStore);\n}\n\n// This handles caching too!\nexport async function fetchPluginFromURL(url) {\n let parsedURL = url;\n\n if (!parsedURL.endsWith(\"/\")) parsedURL += \"/\";\n\n const manifest = parseManifest(\n await (await fetch(parsedURL + \"manifest.json\", { cache: \"no-store\" })).json(),\n );\n\n const plugin = getPluginById(url);\n let code = plugin?.code;\n\n if (plugin?.manifest?.hash != manifest.hash)\n code = await (\n await fetch(parsedURL + (manifest.main ?? \"index.js\"), { cache: \"no-store\" })\n ).text();\n\n return [\n code,\n {\n name: manifest.name,\n author: manifest.author,\n description: manifest.description,\n hash: manifest.hash,\n },\n ];\n}\n\nexport async function reloadPlugin(plugin) {\n let pluginWasEnabled = plugin.enabled;\n\n if (pluginWasEnabled) disablePlugin(plugin.id);\n\n if (plugin.hasOwnProperty(\"update\")) {\n try {\n const [code, manifest] = await fetchPluginFromURL(plugin.id);\n\n plugin.manifest = manifest;\n plugin.code = code;\n } catch {}\n }\n\n if (pluginWasEnabled) enablePlugin(plugin.id);\n}\n\nexport async function installPluginFromURL(url, enabled = true) {\n if (getPluginById(url))\n return actions.message.messageError({ message: \"Plugin is already imported!\" });\n\n try {\n const [code, manifest] = await fetchPluginFromURL(url);\n\n const plugin = {\n id: url,\n code,\n manifest,\n enabled,\n update: true,\n };\n\n pluginStore.unshift(plugin);\n\n if (enabled) runPlugin(plugin);\n } catch {\n actions.message.messageError({ message: \"Failed to import neptune plugin!\" });\n }\n}\n\n// Cleanup plugins on reload\naddEventListener(\"beforeunload\", () => {\n Object.values(enabled).forEach(p => p.onUnload());\n});\n\n// Load as early as we possibly can.\nintercept(\n \"session/RECEIVED_COUNTRY_CODE\",\n async () => {\n // We don't attempt to load plugins if CSP exists because loading every plugin will fail and automatically disable the plugin.\n if (document.querySelector(`[http-equiv=\"Content-Security-Policy\"]`) || window.require) return;\n\n for (const plugin of pluginStore) {\n if (plugin.update) {\n try {\n const [code, manifest] = await fetchPluginFromURL(plugin.id);\n\n plugin.manifest = manifest;\n plugin.code = code;\n } catch {\n console.log(\"[neptune] failed to update plugin\");\n }\n }\n\n // We do not currently account for plugin updates, but this will be handled once\n // remote plugin installation is handled.\n if (plugin.enabled) runPlugin(plugin);\n }\n },\n true,\n);\n","import { store } from \"voby\";\nimport { appendStyle, createPersistentObject, parseManifest } from \"./utils.js\";\n\nexport const [themesStore, themesStoreReady] = createPersistentObject(\"NEPTUNE_THEMES\", true);\n\nlet updateThemeStyle = appendStyle(\"\");\n\n// Not sure why this didn't work previously?\nstore.on(themesStore, reloadThemes)\n\nfunction reloadThemes() {\n updateThemeStyle(themesStore.filter(t => t.enabled).map((t) => `@import url(\"${t.url}\")`).join(\";\"));\n}\n\nexport function removeTheme(url) {\n themesStore.splice(\n themesStore.findIndex((t) => t.url == url),\n 1,\n );\n}\n\nexport function toggleTheme(url) {\n const theme = themesStore.find((t) => t.url == url);\n theme.enabled = !theme.enabled;\n}\n\nexport async function importTheme(url, enabled = true) {\n let manifest;\n let text;\n\n try {\n\ttext = await (await fetch(url)).text();\n } catch {\n\tthrow \"Failed to fetch theme!\";\n }\n\n try {\n manifest = parseManifest(text);\n } catch (e) {\n manifest = {\n\t\tname: url.split(\"/\").pop(),\n\t\tauthor: \"Unknown\",\n\t\tdescription: \"No description provided.\",\n\t}\n }\n\n themesStore.unshift({\n name: manifest.name,\n author: manifest.author,\n description: manifest.description,\n enabled,\n url,\n });\n}\n","// code source: https://github.com/KaiHax/kaihax/blob/master/src/patcher.ts\n\nconst observations = new Set();\nconst observer = new MutationObserver((records) => {\n // de-dupe to be sure\n const changedElems = new Set();\n\n for (const record of records) {\n changedElems.add(record.target);\n\n for (const e of record.removedNodes)\n if (e instanceof HTMLElement || e instanceof SVGElement) changedElems.add(e);\n }\n\n for (const elem of changedElems)\n for (const obs of observations) {\n if (elem.matches(obs[0])) obs[1](elem);\n\n elem\n .querySelectorAll(obs[0])\n .forEach(\n (e) => !obs[2] && (e instanceof HTMLElement || e instanceof SVGElement) && obs[1](e),\n );\n }\n});\n\nconst startObserving = () =>\n observer.observe(document.body, {\n subtree: true,\n childList: true,\n attributes: true,\n });\n\nconst stopObserving = () => observer.disconnect();\n\nexport function observe(sel, cb) {\n if (observations.size === 0) startObserving();\n const entry = [sel, cb, false];\n observations.add(entry);\n\n const unobs = () => {\n observations.delete(entry);\n if (observations.size === 0) stopObserving();\n };\n\n unobs.now = () => {\n entry[2] = true;\n unobs();\n };\n\n return unobs;\n}\nexport function unobserve() {\n observations.clear();\n stopObserving();\n}\n","import { ReactiveRoot } from \"../ui/components.js\";\nimport intercept from \"./intercept.js\";\nimport { observe } from \"./observe.js\";\n\nconst pageNotFoundSelector = `[class^=\"pageNotFoundError--\"]`;\n\nconst replacePage = (page, component) => {\n page.style.display = \"none\";\n\n const neptunePage = document.createElement(\"div\");\n neptunePage.className = \"__NEPTUNE_PAGE\";\n\n page.insertAdjacentElement(\"afterend\", neptunePage);\n neptunePage.appendChild(ReactiveRoot({ children: component }));\n};\n\nintercept(\"ROUTER_LOCATION_CHANGED\", () => {\n for (const page of document.getElementsByClassName(\"__NEPTUNE_PAGE\"))\n page.parentElement.removeChild(page);\n});\n\nexport default function registerRoute(path, component) {\n return intercept(\"ROUTER_LOCATION_CHANGED\", ([payload]) => {\n if (payload.pathname != `/neptune/${path}`) return;\n\n const pageNotFound = document.querySelector(pageNotFoundSelector);\n if (pageNotFound) return replacePage(pageNotFound, component);\n\n const unob = observe(pageNotFoundSelector, (page) => {\n unob.now();\n replacePage(page, component);\n });\n });\n}\n","import registerRoute from \"./registerRoute.js\";\nimport intercept from \"./intercept.js\";\nimport { actions } from \"../handleExfiltrations.js\";\nfunction makeInactive(tab) {\n tab.classList.remove(Array.from(tab.classList).find((c) => c.startsWith(\"activeItem--\")));\n}\n\nconst getTabs = () => document.querySelector(`.sidebarWrapper section[class^=\"section--\"]`);\n\n// Automatically set tab to unchecked.\nintercept(\"ROUTER_LOCATION_CHANGED\", () => {\n for (const tab of document.getElementsByClassName(\"__NEPTUNE_TAB\")) tab.style.color = \"\";\n});\n\n/*\n This entire function abuses their router's 404 handling to insert our own tabs.\n Because 404s count towards router history, our tabs function perfectly fine even when using the back arrows!\n*/\nexport default function registerTab(name, path, component = () => {}) {\n const unobservers = [];\n\n const addTab = (tabs) => {\n const tab = tabs.children[0].cloneNode(true);\n makeInactive(tab);\n\n tab.querySelector(`[class^=\"responsiveText--\"]`).textContent = name;\n\n tab.classList.add(\"__NEPTUNE_TAB\");\n\n tab.addEventListener(\"click\", (e) => {\n e.preventDefault();\n\n actions.router.push({\n pathname: `/neptune/${path}`,\n replace: true,\n });\n });\n\n const removeRouteHandler = registerRoute(path, () => {\n tab.style.color = \"var(--wave-color-solid-accent-fill)\";\n\n return component;\n });\n\n tabs.appendChild(tab);\n unobservers.push(removeRouteHandler, () => tabs.removeChild(tab));\n };\n\n const tabs = getTabs();\n\n if (!tabs) {\n // Instead of DOM observing we just intercept the first action that gets called after the UI shows. Maybe we can DOM observe later?\n unobservers.push(\n intercept(\n \"favorites/SET_FAVORITE_IDS\",\n () => {\n addTab(getTabs());\n },\n true,\n ),\n );\n } else addTab(tabs);\n\n return () => unobservers.forEach((u) => u());\n}\n","import intercept from \"./intercept.js\";\nimport { observe } from \"./observe.js\";\n\nexport default function hookContextMenu(menuType, name, handler) {\n return intercept(\"contextMenu/OPEN\", ([payload]) => {\n // TODO: Change this to a switch statement.\n\n if (payload?.type != menuType) return;\n\n const unob = observe(`[data-type=\"contextmenu-item\"]`, (elem) => {\n unob.now();\n\n const contextMenuItem = elem.cloneNode(true);\n const contextMenuLabel = contextMenuItem.querySelector(`[class^=\"actionTextInner--\"]`);\n contextMenuLabel.innerText = name;\n\n const parentClasses = contextMenuLabel.parentElement.classList;\n\n contextMenuItem.innerHTML = \"\";\n\n const contextMenuWrapper = document.createElement(\"div\");\n contextMenuWrapper.setAttribute(\"tabindex\", \"0\");\n contextMenuWrapper.classList.add(...parentClasses);\n contextMenuWrapper.appendChild(contextMenuLabel);\n\n contextMenuItem.addEventListener(\"keyup\", (event) => {\n if (event.keyCode != 13) return;\n\n event.target.click();\n });\n\n contextMenuItem.appendChild(contextMenuWrapper);\n\n contextMenuItem.addEventListener(\"click\", (event) => {\n handler(event);\n });\n\n elem.parentElement.appendChild(contextMenuItem);\n });\n });\n}\n","import { ReactiveRoot } from \"../ui/components.js\";\nimport { actions } from \"../handleExfiltrations.js\";\nimport { observe } from \"./observe.js\";\n\nexport default function showModal(name, component) {\n actions.modal.showReleaseNotes();\n const unob = observe(`[class^=\"modalHeader--\"]`, (header) => {\n unob.now();\n\n header.getElementsByTagName(\"h4\")[0].innerText = name;\n\n header.nextSibling.replaceChildren(\n ReactiveRoot({\n children: component,\n }),\n );\n });\n}\n","import * as voby from \"voby\";\nimport * as patcher from \"spitroast\";\nimport * as utils from \"./api/utils.js\";\nimport * as plugins from \"./api/plugins.js\";\nimport * as themes from \"./api/themes.js\";\nimport * as components from \"./ui/components.js\";\nimport intercept from \"./api/intercept.js\";\nimport { observe } from \"./api/observe.js\";\nimport registerTab from \"./api/registerTab.js\";\nimport registerRoute from \"./api/registerRoute.js\";\nimport hookContextMenu from \"./api/hookContextMenu.js\";\nimport showModal from \"./api/showModal.js\";\n// TODO: AWFUL VOMIT VOMIT KILL MURDER DIE KILL KILL DIE MURDER VOMIT\nimport { store } from \"./handleExfiltrations.js\";\n\nlet currentMediaItem = {};\n\ntry {\n const vibrantColorStyle = utils.appendStyle(\"\");\n\n intercept(\"playbackControls/MEDIA_PRODUCT_TRANSITION\", ([{ mediaProduct }]) => {\n Object.assign(\n currentMediaItem,\n store.getState().content.mediaItems[mediaProduct.productId],\n );\n const vibrantColor = currentMediaItem?.item?.album?.vibrantColor;\n\n if (!vibrantColor) return;\n\n vibrantColorStyle(`:root{--track-vibrant-color:${vibrantColor};--track-vibrant-color-rgb:${utils.convertHexToRGB(vibrantColor)}}`);\n });\n} catch {}\n\nexport default {\n patcher,\n utils,\n intercept,\n observe,\n registerTab,\n registerRoute,\n hookContextMenu,\n showModal,\n voby,\n plugins,\n themes,\n components,\n currentMediaItem,\n};\n","import windowObject from \"./windowObject.js\";\nimport * as patcher from \"spitroast\";\nimport { interceptors } from \"./api/intercept.js\";\nimport loadStyles from \"./styles.js\";\n\n// abandon all hope, ye who enter here\n\n/*\n This code runs before webpackChunk_tidal_web is defined.\n Upon it being assigned to, we patch push to intercept webpackRequire and exfiltrate modules.\n The upcoming comments will explain each step of the process.\n*/\n\n// Variables used for hooking into webpack.\nlet webpackObject;\n\n// Exfiltrations gained from hooking into webpack.\nlet patchedPrepareAction = false;\nlet exfiltratedStore;\n\n// Main store exfiltration\nexport let store;\n\n// Built action handlers\nexport const actions = {};\nwindowObject.actions = actions;\n\nconst getModulesFromWpRequire = (wpRequire) =>\n Object.fromEntries(\n Object.entries(wpRequire.m).map(([k]) => [k, { id: k, loaded: true, exports: wpRequire(k) }]),\n );\n\nObject.defineProperty(window, \"webpackChunk_tidal_web\", {\n get: () => webpackObject,\n set(val) {\n if (webpackObject) return true;\n\n loadStyles();\n\n webpackObject = val;\n\n const originalPush = webpackObject.push;\n let newPush;\n Object.defineProperty(webpackObject, \"push\", {\n set(v) {\n if (!newPush) newPush = v;\n },\n get: () =>\n newPush\n ? function () {\n try {\n for (const chunk of arguments) {\n const [, modules] = chunk;\n if (!modules) continue;\n\n for (const moduleId in modules) {\n const originalModule = modules[moduleId];\n\n modules[moduleId] = function () {\n const wpRequire = arguments[2];\n\n if (!windowObject.hasOwnProperty(\"modules\"))\n Object.defineProperty(windowObject, \"modules\", {\n get: () => Object.values(getModulesFromWpRequire(wpRequire)),\n });\n\n // thinking i'll add a try { } catch { } finally { } to this.\n arguments[2] = new Proxy(wpRequire, {\n apply(target, thisArg, args) {\n const originalResponse = target.apply(thisArg, args);\n if (typeof originalResponse != \"object\") return originalResponse;\n\n // neptune.store exfiltration code\n try {\n if (!exfiltratedStore) {\n const [key] = Object.entries(originalResponse).find(([, e]) =>\n e?.toString?.().includes?.('Error(\"No global store set\"'),\n );\n\n if (key) exfiltratedStore = true;\n\n const unpatch = patcher.after(key, originalResponse, (_, resp) => {\n if (!typeof resp == \"object\" && windowObject.store) return;\n\n store = resp;\n // Hate.\n windowObject.store = store;\n unpatch();\n });\n }\n } catch {}\n\n // neptune.intercept setup code\n try {\n if (patchedPrepareAction) return originalResponse;\n\n let found = Object.entries(originalResponse).find(\n ([, possiblyPrepareAction]) =>\n possiblyPrepareAction\n ?.toString?.()\n ?.includes?.(\n `.payload,...\"meta\"in `,\n ),\n );\n\n if (!found) return originalResponse;\n\n patchedPrepareAction = true;\n\n patcher.after(found[0], originalResponse, ([type], resp) => {\n if (!interceptors[type]) interceptors[type] = [];\n\n const [parent, child] = type\n .split(\"/\")\n .map((n) =>\n n.toUpperCase() == n\n ? n\n .toLowerCase()\n .replace(/_([a-z])/g, (_, i) => i.toUpperCase())\n : n,\n );\n\n const builtAction = (...args) => {\n const act = resp(...args);\n\n if (!(act.__proto__.toString() == \"[object Promise]\"))\n return windowObject.store.dispatch(act);\n\n return new Promise(async (res, rej) => {\n try {\n res(windowObject.store.dispatch(await act));\n } catch (e) {\n rej(e);\n }\n });\n };\n\n if (child) {\n if (!actions[parent]) actions[parent] = {};\n\n actions[parent][child] = builtAction;\n } else {\n actions[parent] = builtAction;\n }\n\n return new Proxy(resp, {\n apply(orig, ctxt, [payload]) {\n try {\n let shouldDispatch = true;\n\n const interceptorData = [payload, type];\n\n for (let interceptor of interceptors[type]) {\n try {\n const resp = interceptor(interceptorData);\n\n if (resp === true) shouldDispatch = false;\n } catch (e) {\n console.error(\"Failed to run interceptor!\\n\", e);\n }\n }\n\n return shouldDispatch\n ? orig.apply(ctxt, [interceptorData[0]])\n : { type: \"NOOP\" };\n } catch (e) {\n console.log(e);\n }\n },\n });\n });\n } catch {}\n\n return originalResponse;\n },\n });\n\n return originalModule.apply(this, arguments);\n };\n }\n }\n } catch (e) {\n console.error(\"[neptune] failed to hook properly\", e);\n }\n\n return newPush.apply(this, arguments);\n }\n : originalPush,\n });\n },\n});\n","import { Switch, TextInput, ReloadIcon, TrashIcon } from \"./components.js\";\nimport { actions } from \"../handleExfiltrations.js\";\nimport {\n pluginStore,\n togglePlugin,\n removePlugin,\n installPluginFromURL,\n installPlugin,\n reloadPlugin,\n enabled as enabledPlugins,\n} from \"../api/plugins.js\";\nimport showModal from \"../api/showModal.js\";\nimport { parseManifest } from \"../api/utils.js\";\nimport { $, For, If, html } from \"voby\";\n\nasync function importLocalPlugin() {\n const [fileHandle] = await showOpenFilePicker({\n types: [{ description: \"A neptune plugin file\", accept: { \"text/javascript\": [\".js\"] } }],\n });\n\n const file = await fileHandle.getFile();\n const content = await file.text();\n\n let manifest;\n try {\n manifest = parseManifest(content);\n\n if (![\"name\", \"author\", \"description\"].every((m) => typeof manifest[m] === \"string\"))\n throw \"invalid manifest\";\n } catch (e) {\n return actions.message.messageError({ message: e });\n }\n\n try {\n await installPlugin(\n manifest.name + \"-\" + (Math.random() + 1).toString(36).substring(7),\n content,\n {\n name: manifest.name,\n author: manifest.author,\n description: manifest.description,\n },\n );\n } catch {\n actions.message.messageError({ message: \"Failed to install plugin!\" });\n }\n}\n\nexport function PluginTab() {\n const pluginToImport = $(\"\");\n\n return html`\n <div style=\"display: flex; gap: 10px; flex-direction: column\">\n <div style=\"padding-top: 10px; display: flex; gap:10px\">\n <!-- This text input *needs* to be able to have an onEnter event. -->\n <${TextInput} value=${pluginToImport} onEnter=${() => {\n installPluginFromURL(pluginToImport());\n pluginToImport(\"\");\n }} placeholder=\"Import plugin from URL\" />\n <!-- This button will be used for importing from local files. -->\n <button onClick=${importLocalPlugin} class=\"neptune-round-button\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"></path><polyline points=\"17 8 12 3 7 8\"></polyline><line x1=\"12\" y1=\"3\" x2=\"12\" y2=\"15\"></line></svg>\n </button>\n </div>\n <${For} values=${() => pluginStore}>\n ${(plugin) => html`<${PluginCard} plugin=${plugin} />`}\n </${For}>\n </div>`;\n}\n\nfunction PluginCard({ plugin }) {\n return html`<div class=\"neptune-card\">\n <div class=\"neptune-card-content\">\n <div>\n <div style=\"display: flex; gap: 15px; align-items: center\">\n <button class=\"neptune-round-button\" onClick=${() => reloadPlugin(plugin)}>\n <${ReloadIcon} />\n </button>\n <div style=\"padding-top: 10px;padding-bottom: 10px\">\n <div>\n <span class=\"neptune-card-title\">${plugin.manifest.name}</span>\n <span> by </span>\n <span class=\"neptune-card-title\">${plugin.manifest.author}</span>\n </div>\n <div style=\"font-size: medium\">${plugin.manifest.description}</div>\n </div>\n </div>\n </div>\n <div style=\"margin-top: auto; margin-bottom: auto; display: flex\">\n <div style=\"display: flex; justify-content: center; align-items: center; gap: 6px\">\n <${If} when=${() => enabledPlugins?.[plugin.id]?.Settings}>\n <button style=\"display: grid; place-items: center; padding: 0px\" onClick=${() =>\n showModal(plugin.manifest.name, enabledPlugins[plugin.id].Settings)}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" style=\"width: 22px\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z\"></path>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15 12a3 3 0 11-6 0 3 3 0 016 0z\"></path>\n </svg>\n </button>\n </${If}>\n <button style=\"display: grid; place-items: center; padding: 0px\" onClick=${() =>\n removePlugin(plugin.id)}>\n <${TrashIcon} />\n </button>\n </div>\n <${Switch}\n checked=${() => plugin.enabled}\n onClick=${() => {\n togglePlugin(plugin.id);\n }} />\n </div>\n </div>\n </div>`;\n}\n","import { $, For, html, useCleanup } from \"voby\";\nimport { TextInput, Switch, TrashIcon } from \"./components\";\nimport { themesStore, toggleTheme, removeTheme, importTheme } from \"../api/themes\";\nimport { actions } from \"../handleExfiltrations.js\";\nimport { appendStyle } from \"../api/utils.js\";\n\nexport function ThemesTab() {\n const themeToImport = $(\"\");\n\n return html`\n <div style=\"margin-top: 10px; display: flex; gap: 10px; flex-direction: column\">\n <${TextInput} onEnter=${() => {\n importTheme(themeToImport(), false).catch((e) => actions.message.messageError({ message: e }));\n themeToImport(\"\");\n }} value=${themeToImport} placeholder=\"Import theme from URL\" />\n <${For} values=${() => themesStore}>\n ${(theme) => html`<${ThemeCard} theme=${theme} />`}\n </${For}>\n </div>`;\n}\n\nfunction ThemeCard({ theme}) {\n // TODO: i have no fucking clue why this needs a try catch to not implode in on itself lmfao\n useCleanup(() => { try { removeStyle() } catch {} });\n\n let removeStyle = () => {};\n\n return html`<div class=\"neptune-card\">\n <div class=\"neptune-card-content\">\n <div style=\"padding-top: 10px; padding-bottom: 10px\">\n <div>\n <span class=\"neptune-card-title\">${theme.name}</span>\n <span> by </span>\n <span class=\"neptune-card-title\">${theme.author}</span>\n </div>\n <div style=\"font-size: medium\">${theme.description}</div>\n </div>\n <div style=\"margin-top: auto; margin-bottom: auto; display: flex\">\n <button onClick=${() => removeTheme(theme.url)}>\n <${TrashIcon} />\n </button>\n <div onmouseover=${() => {\n try {\n removeStyle();\n } catch {}\n removeStyle = appendStyle(`@import url(\"${theme.url}\");`)\n }}\n \n onmouseout=${() => removeStyle()}\n >\n <${Switch} checked=${() => theme.enabled} onClick=${() => toggleTheme(theme.url)} />\n </div>\n </div>\n </div>\n </div>`\n}","import { appendStyle } from \"./api/utils.js\";\n\nexport default function loadStyles() {\n appendStyle(`\n .__NEPTUNE_PAGE {\n margin: 0px auto;\n max-width: 870px;\n width: calc(100% - var(--defaultPadding)*2);\n }\n\n .neptune-card {\n background-color: var(--wave-color-solid-base-brighter, var(--wave-color-opacity-contrast-fill-ultra-thick));\n border: 1px solid var(--wave-color-opacity-contrast-fill-ultra-thin);\n border-radius: 12px;\n min-height: 70px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n\n .neptune-card-content {\n display: flex;\n justify-content: space-between;\n padding: 0 15px 0px 15px;\n }\n \n .neptune-active-tab {\n color: var(--wave-color-solid-accent-fill);\n box-shadow: 0px 2px var(--wave-color-solid-accent-fill);\n }\n \n .neptune-card-title {\n font-weight: 600;\n font-size: medium;\n }\n\n .neptune-switch-checkbox {\n cursor: pointer;\n margin-left: 0.8rem;\n opacity: 0;\n position: absolute;\n z-index: 1;\n }\n\n .neptune-switch {\n cursor: pointer;\n background-color: var(--wave-color-opacity-contrast-fill-ultra-thin);\n border-radius: 28px;\n display: block;\n height: 28px;\n margin-left: 0.8rem;\n min-width: 48px;\n position: relative;\n transition: background-color .25s ease,border-color .25s ease;\n -webkit-user-select: none;\n user-select: none;\n }\n\n .neptune-switch:after {\n background-color: var(--wave-color-solid-contrast-fill);\n border-radius: 50%;\n box-shadow: 0 1px 2px rgb(0 0 0 / 30%);\n content: \"\";\n display: block;\n height: 24px;\n left: 2px;\n position: absolute;\n top: 2px;\n transition: all .25s ease;\n width: 24px;\n }\n\n .neptune-switch-checkbox:checked + .neptune-switch:after {\n left: calc(100% - 0.1em);\n transform: translateX(-100%);\n }\n\n .neptune-switch-checkbox:checked + .neptune-switch {\n background-color: var(--wave-color-solid-accent-fill);\n border-color: var(--wave-color-solid-accent-fill);\n }\n\n .neptune-text-input {\n background: transparent;\n border: 0;\n border-bottom: 1px solid var(--wave-color-opacity-contrast-fill-ultra-thin);\n color: var(--wave-color-opacity-contrast-fill-thick);\n display: block;\n width: 100%;\n height: 40px;\n box-sizing: border-box;\n }\n\n .neptune-text-input:not([readonly]):focus {\n border-bottom-color: var(--wave-color-solid-accent-fill);\n color: var(--wave-color-solid-contrast-fill);\n }\n\n .neptune-button {\n align-items: center;\n background-color: var(--wave-color-solid-contrast-fill);\n border-radius: 12px;\n display: inline-flex;\n height: 48px;\n justify-content: center;\n line-height: 49px;\n min-height: 48px;\n min-width: 0;\n overflow: hidden;\n padding: 0 24px;\n text-align: center;\n text-overflow: ellipsis;\n transition: background .35s ease;\n white-space: nowrap;\n }\n\n .neptune-round-button {\n color: var(--wave-color-opacity-contrast-fill-thick);\n background-color: var(--wave-color-solid-base-brighter);\n border: 1px solid var(--wave-color-opacity-contrast-fill-ultra-thin);\n transition: background-color 0.35s ease 0s;\n transition-property: background-color;\n transition-duration: 0.35s;\n transition-timing-function: ease;\n transition-delay: 0s;\n position: relative;\n border-radius: 100%;\n min-height: 40px;\n min-width: 40px;\n display: grid;\n place-items: center;\n }\n\n .neptune-round-button:active {\n background-color: rgba(255, 255, 255, 0.2);\n }\n`);\n}\n","import { $, html } from \"voby\";\nimport { PluginTab } from \"./pluginsTab.js\";\nimport { ThemesTab } from \"./themesTab.js\";\nimport registerRoute from \"../api/registerRoute.js\";\nimport hookContextMenu from \"../api/hookContextMenu.js\";\n\nlet selectedTab = $(0);\nconst tabs = [\n {\n name: \"Plugins\",\n component: PluginTab,\n },\n {\n name: \"Themes\",\n component: ThemesTab,\n },\n {\n name: \"Addon Store\",\n component: () => html`[WIP]`,\n },\n];\n\nfunction TabButton({ className = \"\", onClick = () => {}, children }) {\n return html`<button\n onClick=${onClick}\n style=\"font-weight: 500; font-size: 1.14286rem; padding-bottom: 6px\"\n class=\"${className}\">\n ${children}\n </button>`;\n}\n\nregisterRoute(\n \"settings\",\n html`<div style=\"width: 675px\">\n <div>\n <div style=\"display: flex; gap: 25px; padding-bottom: 10px\">\n ${tabs.map(\n (tab, idx) =>\n html`<${TabButton} onClick=${() => selectedTab(idx)} className=${() =>\n idx == selectedTab() ? \"neptune-active-tab\" : \"\"}>${tab.name}</${TabButton}>`,\n )}\n </div>\n <div>${() => tabs[selectedTab()].component}</div>\n </div>\n </div>`,\n);\n\nhookContextMenu(\"USER_PROFILE\", \"neptune settings\", () =>\n neptune.actions.router.push({ pathname: \"/neptune/settings\", replace: true }),\n);\n","import \"./ui/settings.js\";\nimport \"./handleExfiltrations.js\";\nimport windowObject from \"./windowObject.js\";\n\n// TODO: Remove this in a future update.\nif (window.require) {\n (async () => {\n const fs = require(\"fs\");\n const path = require(\"path\");\n\n const indexFetch = await fetch(\n \"https://raw.githubusercontent.com/uwu/neptune/master/injector/index.js\",\n );\n const preloadFetch = await fetch(\n \"https://raw.githubusercontent.com/uwu/neptune/master/injector/preload.js\",\n );\n if (!(indexFetch.ok || preloadFetch.ok)) return;\n\n fs.writeFileSync(path.join(process.resourcesPath, \"app\", \"index.js\"), await indexFetch.text());\n fs.writeFileSync(\n path.join(process.resourcesPath, \"app\", \"preload.js\"),\n await preloadFetch.text(),\n );\n\n alert(\"neptune has been updated. Please restart TIDAL.\");\n })();\n}\n\n// Updater 2 (LAST ONE, I SWEAR!)\n// I will implement an actual updater after this.\nif (!window.require && !window.NeptuneNative.startDebugging) {\n (async () => {\n const fsScope = NeptuneNative.createEvalScope(`\n const fs = require(\"fs\");\n const path = require(\"path\");\n \n var neptuneExports = {\n updateFile(name, contents) {\n fs.writeFileSync(path.join(process.resourcesPath, \"app\", name), contents);\n }\n }\n `);\n \n const updateFile = NeptuneNative.getNativeValue(fsScope, \"updateFile\");\n \n const indexFetch = await fetch(\n \"https://raw.githubusercontent.com/uwu/neptune/master/injector/index.js\",\n );\n const preloadFetch = await fetch(\n \"https://raw.githubusercontent.com/uwu/neptune/master/injector/preload.js\",\n );\n\n if (!(indexFetch.ok || preloadFetch.ok)) return;\n\n updateFile(\"index.js\", await indexFetch.text())\n updateFile(\"preload.js\", await preloadFetch.text())\n\n alert(\"neptune has been updated. Please restart TIDAL.\");\n })()\n}\n\n// Restore the console\nfor (let key in console) {\n const orig = console[key];\n\n Object.defineProperty(console, key, {\n set() {\n return true;\n },\n get() {\n return orig;\n },\n });\n}\n\n// Force properties to be writable for patching\nconst originalDefineProperty = Object.defineProperty;\n\nObject.defineProperty = function (...args) {\n args[2].configurable = true;\n\n try {\n return originalDefineProperty.apply(this, args);\n } catch {}\n};\n\nObject.freeze = (arg) => arg;\n\n// If the app fails to load for any reason we simply reload the page.\nsetTimeout(() => {\n if (!windowObject.store) window.location.reload();\n}, 7000);\n\nwindow.neptune = windowObject;\n"],"names":["IS_BROWSER","globalThis","CDATASection","toString","match","isServer$1","SYMBOL_CACHED","Symbol","SYMBOL_OBSERVABLE","SYMBOL_OBSERVABLE_BOOLEAN","SYMBOL_OBSERVABLE_FROZEN","SYMBOL_OBSERVABLE_READABLE","SYMBOL_OBSERVABLE_WRITABLE","SYMBOL_STORE","SYMBOL_STORE_KEYS","SYMBOL_STORE_OBSERVABLE","SYMBOL_STORE_TARGET","SYMBOL_STORE_VALUES","SYMBOL_STORE_UNTRACKED","SYMBOL_SUSPENSE","SYMBOL_UNCACHED","SYMBOL_UNTRACKED","SYMBOL_UNTRACKED_UNWRAPPED","is","Object","isArray","Array","isEqual","a","b","length","i","l","valueA","valueB","isFunction","value","isObject","isSymbol","noop","nope","frozenFunction","arguments","Error","this","readableFunction","get","writableFunction","fn","C","set","frozen","bind","readable","writable","OBSERVABLE_FALSE","OBSERVABLE_TRUE","UNAVAILABLE","Proxy","UNINITIALIZED","lazyArrayEach","arr","lazyArrayEachRight","lazyArrayPush","obj","key","push","lazySetAdd","Set","add","s","lazySetDelete","delete","undefined","lazySetEach","onCleanup","cleanup","call","onDispose","owner","Q","Owner$1","constructor","disposed","B","S","D","K","T","U","catch","error","silent","parent","deep","symbol","context","E","observer","ownerPrev","OWNER","observerPrev","OBSERVER","setOwner","setObserver","castError","SuperRoot$1","Owner","super","BATCH","SUPER_OWNER","SuperRoot","setBatch","M","resolve","batch$1","async","Promise","r","isObservableBoolean$1","isObservableFrozen$1","isUntracked$2","SchedulerSync","A1","A2","N","queue","F","ObservableClass","options","equals","A","L","Scheduler","I","J","has","sync","Math","max","ObservablesArray","P","R","observablesLength","empty","observable","index","indexOf","ObservablesSet","size","sizePrev","Observer$1","H","run","Memo$1","Observer","Observable","G","statusPrev","memo$1","isObservableFrozen","isUntracked","memo","Memo","boolean$1","isObservableBoolean","boolean","cleanup$1","Context$1","symbolOrContext","Context","disposed$1","Scheduler$1","A3","queueMicrotask","finally","effect","Effect$1","suspense","init","suspended","effect$1","Effect","resolved","Root$1","V","A0","DUMMY_INDEX","Root","CacheKeyed$1","A5","Map","A6","A7","A8","A9","forEach","mapped","AA","O","values","map","AB","results","resultsCached","resultsUncached","cached","MappedRoot","from","isObservable$1","getFunction","isObservable","Suspense$3","SYMBOL_SUSPENSE$1","A4","force","suspendedPrev","suspendedNext","notifyOwner","notifyObserver","notifySuspense","notifyRoot","root","suspense$1","when","Suspense","condition","CacheUnkeyed$1","pooled","AC","AD","poolable","cacheNext","leftovers","outer","isDuplicate","entries","pop","$index","$value","isStore$1","untrack","warmup$1","fallback","_switch","warmup","ternary$1","valueTrue","valueFalse","isBatching$1","SchedulerAsync","isObservableWritable$1","target$1","readonly$1","isObservableWritable","target","root$1","DisposableMap","SelectedObservable","AE","AF","AG","selector$1","sourceValue","selectedValue","valuePrev","valueNext","selected","StoreMap","AH","StoreCleanable","listen","StoreKeys","keys","StoreValues","StoreHas","StoreProperty","AI","AJ","StoreListenersRegular","AK","AL","AM","AN","traversed","traverse","AO","AP","listener","StoreScheduler","reset","StoreListenersRoots","rootsSet","store","AQ","AR","current","flushRegular","flushRoots","AS","isBatching","setTimeout","NODES","WeakMap","SPECIAL_SYMBOLS","UNREACTIVE_KEYS","STORE_TRAPS","isListenable","getNodeExisting","getNodeKeys","getNodeValues","String","getter","AT","property","getNodeProperty","getNodeObservable","listenable","proxiable","isProxiable","prototype","apply","getTarget","setter","AU","hadProperty","getNode","deleteProperty","Reflect","defineProperty","descriptor","descriptorPrev","getOwnPropertyDescriptor","isStore","isEqualDescriptor","enumerable","getNodeHas","ownKeys","STORE_UNTRACK_TRAPS","gettersAndSetters","getGettersAndSetters","getNodeFromStore","propertyNode","configurable","getPrototypeOf","getStore","on","targets","selectors","filter","disposers","selector","inited","disposer","_onRoots","reconcile","getType","reconcileInner","prev","next","uprev","unext","prevKeys","nextKeys","prevValue","nextValue","prevType","nextType","reconcileOuter","getUntracked","unwrap","store$2","suspended$1","tick$1","tryCatch$1","$","untracked","args","_with$1","CONTEXTS_DATA","DIRECTIVES","SYMBOL_SUSPENSE_COLLECTOR","SYMBOL_TEMPLATE_ACCESSOR","SYMBOLS_DIRECTIVES","wrapElement$1","element","createComment","document","createHTMLNode","createElement","createSVGNode","createElementNS","createText","createTextNode","assign","castArray","_indexOf","isError","isFunctionReactive","isNil","isString","isSVG","isSVGElement","svgRe","svgCache","includes","test","isTruthy","useResolved","callback","resolveFunction","isResolvable","useEventListener","event","handler","useEffect","$$","addEventListener","removeEventListener","useAbortController$1","signals","controller","AbortController","abort","some","signal","aborted","useCleanup","useAbortSignal$1","useAbortController","useScheduler$1","loop","once","cancel","schedule","tickId","executed","useSuspended","work","tick","dispose","useAnimationFrame$1","useScheduler","cancelAnimationFrame","requestAnimationFrame","useAnimationLoop$1","SuspenseContext","create","count","data","active","useMemo","increment","nr","decrement","collector","register","unregister","wrap","SuspenseContext$1","SuspenseManager$1","suspenses","change","counter","counterNext","suspend","unsuspend","useRenderEffect$1","useResource$1","fetcher","pending","latest","SuspenseManager","resourcePending","resourceRejected","resourceResolved","resourceFunction","resource","useRenderEffect","useCheapDisposed","onPending","onResolve","result","onReject","exception","onFinally","isPromise","then","fetch","useReadonly","useFetch$1","request","useResource","useAbortSignal","useIdleCallback$1","cancelIdleCallback","requestIdleCallback","useIdleLoop$1","useInterval$1","ms","clearInterval","setInterval","usePromise$1","promise","useTimeout$1","clearTimeout","useCheapDisposed$1","useMicrotask$1","runWithOwner","_with","dummyNode","beforeDummyWrapper","afterDummyWrapper","diff$1","before","after","nextSibling","Node","parentNode","replaceChild","bLength","removable","aEnd","bEnd","aStart","bStart","node","slice","append","removeChild","insertBefore","sequence","NOOP_CHILDREN","FragmentUtils","make","makeWithNode","makeWithFragment","fragment","fragmented","getChildrenFragmented","thiz","children","getChildren","pushFragment","pushValue","pushNode","replaceWithNode","replaceWithFragment","FragmentUtils$1","resolveChild","_dynamic","hasObservables","resolveArraysAndStatics","resolveClass","classes","split","Boolean","cls","resolveStyle","styles","style","DUMMY_RESOLVED","resolveArraysAndStaticsInner","type","setAttributeStatic","attributesBoolean","attributeCamelCasedRe","attributesCache","uppercaseRe","replace","char","toLowerCase","normalizeKeySvg","removeAttribute","setAttribute","setChildReplacementText","child","childPrev","nodeType","nodeValue","parentElement","textNode","setChildReplacement","setChildStatic","setChildReplacementFunction","setChild","fragmentOnly","dynamic","prevIsArray","prevLength","prevFirst","prevLast","prevSibling","appendChild","fragmentNext","childFragmentOnly","nextLength","childNodes","textContent","placeholder","diff","setClassStatic","className","classList","toggle","setClass","setClassBooleanStatic","keyPrev","setClassBoolean","keyNext","setClassesStatic","object","objectPrev","setClasses","objectNext","setEventStatic","delegatedEvents","onauxclick","onbeforeinput","onclick","ondblclick","onfocusin","onfocusout","oninput","onkeydown","onkeyup","onmousedown","onmouseup","startsWith","_value","delegated","composedPath","cancelBubble","delegate","endsWith","isCapture","capture","passive","setEvent","setHTML","innerHTML","setHTMLStatic","__html","setPropertyStatic","isBoolean","tagName","setProperty","setRef","flat","Infinity","flatten","useMicrotask","setStyleStatic","propertyNonDimensionalRe","propertyNonDimensionalCache","charCodeAt","removeProperty","setStyle","setStylesStatic","cssText","setStyles","setProp","isTemplateAccessor","setTemplateAccessor","directive","immediate","setDirective","creatElement","component","props","_children","__children","ref","rest","wrapElement","createNode","setProps","isNode","Dynamic$1","ErrorBoundary$1","tryCatch","For","unkeyed","isUnkeyed","CacheUnkeyed","CacheKeyed","array","_for","Fragment$1","useGuarded$1","guard","valueLast","guarded","If$1","ternary","truthy","useGuarded","useUntracked","cache","runWithSuperRoot","lockId","KeepAlive$1","id","ttl","lock","item","useRoot","useSuspense","hasLock","timeoutId","render$1","HTMLElement","Portal$1","mount","wrapper","portal","useBoolean","body","Element","render","metadata","Suspense$1","childrenSuspended","Switch","Switch$1","Case","Default","Switch$2","Ternary$1","jsx","createDirective$1","name","Provider","COMPONENT_RE","SYMBOL_COLD_COMPONENT","SYMBOL_HOT_COMPONENT","SYMBOL_HOT_ID","SOURCES","hmr$1","accept","createHotComponent","path","reduce","source","createHotComponentDeep","hot","onAccept","module","default","console","cold","n","t","e","u","h","p","registry","html","components","html$1","lazy$1","fetcherOnce","called","preload","reject","SuspenseCollector","other","SuspenseCollector$1","renderToString$1","Portal","template$1","safePropertyRe","checkValidProperty","makeActionsWithNodesAndTemplate","actionsWithNodes","accessor","prop","method","targetNode","makeAccessor","makeNodePath","prevPath","prevNode","previousSibling","makeNodePathProperties","properties","parts","reverse","part","nsi","makeReviverVariables","actionsWithPaths","paths","action","nodePath","targetNodePath","makeReviverPaths","makeReviverVariablesData","assignments","variableId","datum","find","variable","assignment","otherCurrent","otherNext","splice","makeActionsWithPaths","reviver","actions","variables","makeReviverActions","Function","join","apis","makeReviver","clone","cloneNode","makeComponent","defaultValue","valueContext","ReactiveRoot","c","checked","onClick","TextInput","onEnter","ReloadIcon","TrashIcon","customElements","define","connectedCallback","display","disconnectedCallback","patchTypes","patchedObjects","unpatch","funcParent","funcName","hookId","patchedObject","patch","every","o","getPatchFunc","patchType","oneTime","parentInjections","origFunc","runHook","ctxt","construct","ret","funcArgs","isConstruct","hook","maybefuncArgs","workingRetVal","unpatchThisPatch","replaceProxy","_","receiver","instead","parentObject","hookType","promisifyRequest","oncomplete","onsuccess","onabort","onerror","createStore","dbName","storeName","indexedDB","open","onupgradeneeded","createObjectStore","dbp","txMode","db","transaction","objectStore","defaultGetStoreFunc","defaultGetStore","appendStyle","styleTag","head","newStyle","neptuneIdbStore","createIdbStore","createPersistentObject","persistentObject","customStore","put","idbSet","res","idbGet","parseManifest","manifest","JSON","parse","convertHexToRGB","g","Number","Uint8Array","Uint16Array","buffer","__heap_base","memory","byteLength","grow","ceil","sa","lastIndexOf","idx","k","ri","ie","ai","ss","se","ip","d","re","es","ee","els","ele","ls","le","ln","eval","f","WebAssembly","compile","Buffer","atob","instantiate","exports","betterParse","src","imports","imp","declaration","importClause","trim","namedImportOpener","namedImportCloser","namedImport","namedImports","commaIndex","namespace","isExport","destructurifyImp","v","removeFromString","string","start","end","insertIntoString","newString","urlImport","baseUrl","existingUrls","interceptors","intercept","types","cb","uninterceptors","unintercept","handleIntercept","pluginStore","pluginStoreReady","enabled","getPluginById","disablePlugin","onUnload","togglePlugin","enablePlugin","plugin","runPlugin","persistentStorage","persistentStorageReady","unloadables","pluginData","storage","addUnloadable","Settings","code","config","plugins","moduleId","generatedImports","transform","offset","exp","startIndex","endIndex","newExport","fromIndex","quartzStore","random","substring","generatedImport","addImport","globalStoreID","mod","import","btoa","quartz","stringify","ul","installPlugin","unshift","removePlugin","log","findIndex","del","fetchPluginFromURL","url","parsedURL","json","hash","main","text","author","description","reloadPlugin","pluginWasEnabled","hasOwnProperty","installPluginFromURL","message","messageError","update","querySelector","window","require","themesStore","themesStoreReady","updateThemeStyle","removeTheme","toggleTheme","theme","importTheme","observations","MutationObserver","records","changedElems","record","removedNodes","SVGElement","elem","obs","matches","querySelectorAll","startObserving","observe","subtree","childList","attributes","stopObserving","disconnect","sel","entry","unobs","now","pageNotFoundSelector","replacePage","page","neptunePage","insertAdjacentElement","registerRoute","payload","pathname","pageNotFound","unob","getElementsByClassName","getTabs","hookContextMenu","menuType","contextMenuItem","contextMenuLabel","innerText","parentClasses","contextMenuWrapper","keyCode","click","showModal","modal","showReleaseNotes","header","getElementsByTagName","replaceChildren","tab","color","currentMediaItem","vibrantColorStyle","utils.appendStyle","mediaProduct","getState","content","mediaItems","productId","vibrantColor","album","utils.convertHexToRGB","windowObject","patcher","utils","registerTab","unobservers","addTab","tabs","remove","makeInactive","preventDefault","router","removeRouteHandler","voby","themes","webpackObject","exfiltratedStore","patchedPrepareAction","getModulesFromWpRequire","wpRequire","fromEntries","m","loaded","importLocalPlugin","fileHandle","showOpenFilePicker","file","getFile","PluginCard","If","enabledPlugins","ThemeCard","removeStyle","val","originalPush","newPush","chunk","modules","originalModule","thisArg","originalResponse","patcher.after","resp","found","possiblyPrepareAction","toUpperCase","builtAction","act","__proto__","dispatch","rej","orig","shouldDispatch","interceptorData","interceptor","selectedTab","pluginToImport","themeToImport","TabButton","neptune","fs","indexFetch","preloadFetch","ok","writeFileSync","process","resourcesPath","alert","NeptuneNative","startDebugging","fsScope","createEvalScope","updateFile","getNativeValue","originalDefineProperty","freeze","arg","location","reload"],"mappings":"yBACA,MAAMA,IAAeC,WAAWC,cAAcC,aAAaC,MAAM,yEAMjE,IAAAC,EAJi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AEIuqB,EAAWE,IAAMD,EAAaC,MAEpCH,EAAGI,cAAc7a,EAAKyE,KAAKqW,QAAQC,cAAe,MAAO,kBAAmBL,EAAW9I,QACvF6I,EAAGI,cACD7a,EAAKyE,KAAKqW,QAAQC,cAAe,MAAO,oBAClCJ,EAAa/I,QAGrBoJ,MAAM,mDACP,EAnBD,GAwBGzI,OAAOC,SAAYD,OAAO0I,cAAcC,gBAC3C,WACE,MAAMC,EAAUF,cAAcG,gBAAgB,sQAWxCC,EAAaJ,cAAcK,eAAeH,EAAS,cAEnDT,QAAmBvqB,MACvB,0EAEIwqB,QAAqBxqB,MACzB,6EAGIuqB,EAAWE,IAAMD,EAAaC,MAEpCS,EAAW,iBAAkBX,EAAW9I,QACxCyJ,EAAW,mBAAoBV,EAAa/I,QAE5CoJ,MAAM,mDACP,EA3BD,GA+BF,IAAK,IAAIplC,KAAO4qB,QAAS,CACvB,MAAMwZ,EAAOxZ,QAAQ5qB,GAErBzC,OAAOiT,eAAeoa,QAAS5qB,EAAK,CAClCf,IAAG,KACM,EAETJ,IAAG,IACMulC,GAGb,CAGA,MAAMuB,GAAyBpoC,OAAOiT,eAEtCjT,OAAOiT,eAAiB,YAAagD,GACnCA,EAAK,GAAGlC,cAAe,EAEvB,IACE,OAAOq0B,GAAuB31B,MAAMrR,KAAM6U,EAC3C,CAAC,MAAQ,CACZ,EAEAjW,OAAOqoC,OAAUC,GAAQA,EAGzBj3B,YAAW,KACJsyB,GAAa9yB,OAAOuuB,OAAOmJ,SAASC,QAAQ,GAChD,KAEHpJ,OAAOiI,QAAU1D","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,108,109,110,111,112,113,115,116,117]}