@moq/watch 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ui/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../node_modules/.bun/solid-js@1.9.11/node_modules/solid-js/dist/solid.js","../../../../node_modules/.bun/solid-js@1.9.11/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.bun/component-register@0.8.8/node_modules/component-register/dist/component-register.js","../../../../node_modules/.bun/solid-element@1.9.1+2e1854f049906f04/node_modules/solid-element/dist/index.js","../../../signals/src/solid.ts","../../src/ui/context.tsx","../../src/ui/hooks/use-watch-ui.ts","../../src/ui/components/BufferingIndicator.tsx","../../src/ui/components/BufferControl.tsx","../../src/ui/components/FullscreenButton.tsx","../../src/ui/components/PlayPauseButton.tsx","../../src/ui/components/QualitySelector.tsx","../../src/ui/components/StatsButton.tsx","../../src/ui/components/VolumeSlider.tsx","../../src/ui/components/WatchStatusIndicator.tsx","../../src/ui/components/WatchControls.tsx","../../src/ui/element.tsx","../../src/ui/index.tsx"],"sourcesContent":["let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n maxDeadline = 0,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n maxDeadline = currentTime + maxYieldInterval;\n try {\n const hasMoreWork = scheduledCallback(currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxDeadline;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = n + m >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;else if (cmp < 0) n = k - 1;else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && shouldYieldToHost()) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined,\n effects: undefined,\n done: false,\n getContextId() {\n return getContextId(this.context.count);\n },\n getNextContextId() {\n return getContextId(this.context.count++);\n }\n};\nfunction getContextId(count) {\n const num = String(count),\n len = num.length - 1;\n return sharedConfig.context.id + (len ? String.fromCharCode(96 + len) : \"\") + num;\n}\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: sharedConfig.getNextContextId(),\n count: 0\n };\n}\n\nconst IS_DEV = false;\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst SUPPORTS_PROXY = typeof Proxy === \"function\";\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(() => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n }, undefined, false, 0),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if (typeof pFetcher === \"function\") {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n } else {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = sharedConfig.getNextContextId();\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;else if (sharedConfig.load && sharedConfig.has(id)) initP = sharedConfig.load(id);\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, {\n value: v\n }));\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n let error;\n const p = initP !== NO_INIT ? initP : untrack(() => {\n try {\n return fetcher(lookup, {\n value: value(),\n refetching\n });\n } catch (fetcherError) {\n error = fetcherError;\n }\n });\n if (error !== undefined) {\n loadEnd(pr, undefined, castError(error), lookup);\n return;\n } else if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"v\" in p) {\n if (p.s === 1) loadEnd(pr, p.v, undefined, lookup);else loadEnd(pr, undefined, castError(p.v), lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => scheduled = false);\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e), lookup));\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n let owner = Owner;\n if (dynamic) createComputed(() => (owner = Owner, load(false)));else load(false);\n return [read, {\n refetch: info => runWithOwner(owner, () => load(info)),\n mutate: setValue\n }];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(() => {\n if (!t || !t.fn) t = requestCallback(() => setDeferred(() => node.value), timeout !== undefined ? {\n timeout\n } : undefined);\n return source();\n }, undefined, true);\n const [deferred, setDeferred] = createSignal(Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, options);\n updateComputation(node);\n setDeferred(() => Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(p => {\n const v = source();\n for (const [key, val] of subs.entries()) if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);else Effects.push(c);\n }\n }\n return v;\n }, undefined, true, STALE);\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null) ;else if (Owner.cleanups === null) Owner.cleanups = [fn];else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t = Transition || (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => t.resolve = res));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n let value;\n return Owner && Owner.context && (value = Owner.context[context.id]) !== undefined ? value : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const {\n factory: oldFactory,\n untrack: oldUntrack\n } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || !isComp && Transition.sources.has(node)) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (IS_DEV) ;\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null) ;else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n }\n setHydrateContext();\n }\n if (sharedConfig.effects && (sharedConfig.done || !sharedConfig.count)) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;else o.state = PENDING;\n if (o.pure) Updates.push(o);else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n if (Transition && Transition.running && node.pure) {\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, owner && owner.owner || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects) Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(() => res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n }), undefined);\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null) ;else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler = typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer, initalValue = undefined) {\n const [s, set] = createSignal(initalValue, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => \"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub());\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n newLen = newItems.length,\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n }\n else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++);\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, len = newLen);\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [],\n newLen = newItems.length;\n newItems[$TRACK];\n return untrack(() => {\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newLen; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newLen;\n items = newItems.slice(0);\n return mapped = mapped.slice(0, len);\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || !!s && $PROXY in s;\n sources[i] = typeof s === \"function\" ? (proxy = true, createMemo(s)) : s;\n }\n if (SUPPORTS_PROXY && proxy) {\n return new Proxy({\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++) keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n }, propTraps);\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])\n } : desc.value !== undefined ? desc : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n const len = keys.length;\n if (SUPPORTS_PROXY && $PROXY in props) {\n const blocked = len > 1 ? keys.flat() : keys[0];\n const res = keys.map(k => {\n return new Proxy({\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n }, propTraps);\n });\n res.push(new Proxy({\n get(property) {\n return blocked.includes(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.includes(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.includes(k));\n }\n }, propTraps));\n return res;\n }\n const objects = [];\n for (let i = 0; i <= len; i++) {\n objects[i] = {};\n }\n for (const propName of Object.getOwnPropertyNames(props)) {\n let keyIndex = len;\n for (let i = 0; i < keys.length; i++) {\n if (keys[i].includes(propName)) {\n keyIndex = i;\n break;\n }\n }\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n isDefaultDesc ? objects[keyIndex][propName] = desc.value : Object.defineProperty(objects[keyIndex], propName, desc);\n }\n return objects;\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n !sharedConfig.done && setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(() => (Comp = comp()) ? untrack(() => {\n if (IS_DEV) ;\n if (!ctx || sharedConfig.done) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n }) : \"\");\n };\n wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? sharedConfig.getNextContextId() : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const conditionValue = createMemo(() => props.when, undefined, undefined);\n const condition = keyed ? conditionValue : createMemo(conditionValue, undefined, {\n equals: (a, b) => !a === !b\n });\n return createMemo(() => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn ? untrack(() => child(keyed ? c : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return conditionValue();\n })) : child;\n }\n return props.fallback;\n }, undefined, undefined);\n}\nfunction Switch(props) {\n const chs = children(() => props.children);\n const switchFunc = createMemo(() => {\n const ch = chs();\n const mps = Array.isArray(ch) ? ch : [ch];\n let func = () => undefined;\n for (let i = 0; i < mps.length; i++) {\n const index = i;\n const mp = mps[i];\n const prevFunc = func;\n const conditionValue = createMemo(() => prevFunc() ? undefined : mp.when, undefined, undefined);\n const condition = mp.keyed ? conditionValue : createMemo(conditionValue, undefined, {\n equals: (a, b) => !a === !b\n });\n func = () => prevFunc() || (condition() ? [index, conditionValue, mp] : undefined);\n }\n return func;\n });\n return createMemo(() => {\n const sel = switchFunc()();\n if (!sel) return props.fallback;\n const [index, conditionValue, mp] = sel;\n const child = mp.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn ? untrack(() => child(mp.keyed ? conditionValue() : () => {\n if (untrack(switchFunc)()?.[0] !== index) throw narrowedError(\"Match\");\n return conditionValue();\n })) : child;\n }, undefined, undefined);\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load) err = sharedConfig.load(sharedConfig.getContextId());\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(() => {\n let e;\n if (e = errored()) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n }, undefined, undefined);\n}\n\nconst suspenseListEquals = (a, b) => a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = /* #__PURE__ */createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n {\n showContent = true,\n showFallback = true\n } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || next && tail === \"collapsed\" ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n }, {\n inFallback: false\n });\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.getContextId();\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.s !== 1) p = ref;else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(() => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n }, err => {\n error = err;\n set();\n });\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return flicker = undefined;\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n {\n showContent = true,\n showFallback = true\n } = show ? show() : {};\n if ((!inFallback || p && p !== \"$$f\") && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"F\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport { $DEVCOMP, $PROXY, $TRACK, DEV, ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, batch, cancelCallback, catchError, children, createComponent, createComputed, createContext, createDeferred, createEffect, createMemo, createReaction, createRenderEffect, createResource, createRoot, createSelector, createSignal, createUniqueId, enableExternalSource, enableHydration, enableScheduling, equalFn, from, getListener, getOwner, indexArray, lazy, mapArray, mergeProps, observable, on, onCleanup, onError, onMount, requestCallback, resetErrorBoundaries, runWithOwner, sharedConfig, splitProps, startTransition, untrack, useContext, useTransition };\n","import { createMemo, createRoot, createRenderEffect, untrack, sharedConfig, enableHydration, getOwner, createEffect, runWithOwner, createSignal, onCleanup, splitProps } from 'solid-js';\nexport { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps, untrack } from 'solid-js';\n\nconst booleans = [\"allowfullscreen\", \"async\", \"alpha\",\n\"autofocus\",\n\"autoplay\", \"checked\", \"controls\", \"default\", \"disabled\", \"formnovalidate\", \"hidden\",\n\"indeterminate\", \"inert\",\n\"ismap\", \"loop\", \"multiple\", \"muted\", \"nomodule\", \"novalidate\", \"open\", \"playsinline\", \"readonly\", \"required\", \"reversed\", \"seamless\",\n\"selected\", \"adauctionheaders\",\n\"browsingtopics\",\n\"credentialless\",\n\"defaultchecked\", \"defaultmuted\", \"defaultselected\", \"defer\", \"disablepictureinpicture\", \"disableremoteplayback\", \"preservespitch\",\n\"shadowrootclonable\", \"shadowrootcustomelementregistry\",\n\"shadowrootdelegatesfocus\", \"shadowrootserializable\",\n\"sharedstoragewritable\"\n];\nconst Properties = /*#__PURE__*/new Set([\n\"className\", \"value\",\n\"readOnly\", \"noValidate\", \"formNoValidate\", \"isMap\", \"noModule\", \"playsInline\", \"adAuctionHeaders\",\n\"allowFullscreen\", \"browsingTopics\",\n\"defaultChecked\", \"defaultMuted\", \"defaultSelected\", \"disablePictureInPicture\", \"disableRemotePlayback\", \"preservesPitch\", \"shadowRootClonable\", \"shadowRootCustomElementRegistry\",\n\"shadowRootDelegatesFocus\", \"shadowRootSerializable\",\n\"sharedStorageWritable\",\n...booleans]);\nconst ChildProperties = /*#__PURE__*/new Set([\"innerHTML\", \"textContent\", \"innerText\", \"children\"]);\nconst Aliases = /*#__PURE__*/Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/Object.assign(Object.create(null), {\n class: \"className\",\n novalidate: {\n $: \"noValidate\",\n FORM: 1\n },\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n },\n adauctionheaders: {\n $: \"adAuctionHeaders\",\n IFRAME: 1\n },\n allowfullscreen: {\n $: \"allowFullscreen\",\n IFRAME: 1\n },\n browsingtopics: {\n $: \"browsingTopics\",\n IMG: 1\n },\n defaultchecked: {\n $: \"defaultChecked\",\n INPUT: 1\n },\n defaultmuted: {\n $: \"defaultMuted\",\n AUDIO: 1,\n VIDEO: 1\n },\n defaultselected: {\n $: \"defaultSelected\",\n OPTION: 1\n },\n disablepictureinpicture: {\n $: \"disablePictureInPicture\",\n VIDEO: 1\n },\n disableremoteplayback: {\n $: \"disableRemotePlayback\",\n AUDIO: 1,\n VIDEO: 1\n },\n preservespitch: {\n $: \"preservesPitch\",\n AUDIO: 1,\n VIDEO: 1\n },\n shadowrootclonable: {\n $: \"shadowRootClonable\",\n TEMPLATE: 1\n },\n shadowrootdelegatesfocus: {\n $: \"shadowRootDelegatesFocus\",\n TEMPLATE: 1\n },\n shadowrootserializable: {\n $: \"shadowRootSerializable\",\n TEMPLATE: 1\n },\n sharedstoragewritable: {\n $: \"sharedStorageWritable\",\n IFRAME: 1,\n IMG: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? a[tagName] ? a[\"$\"] : undefined : a;\n}\nconst DelegatedEvents = /*#__PURE__*/new Set([\"beforeinput\", \"click\", \"dblclick\", \"contextmenu\", \"focusin\", \"focusout\", \"input\", \"keydown\", \"keyup\", \"mousedown\", \"mousemove\", \"mouseout\", \"mouseover\", \"mouseup\", \"pointerdown\", \"pointermove\", \"pointerout\", \"pointerover\", \"pointerup\", \"touchend\", \"touchmove\", \"touchstart\"]);\nconst SVGElements = /*#__PURE__*/new Set([\n\"altGlyph\", \"altGlyphDef\", \"altGlyphItem\", \"animate\", \"animateColor\", \"animateMotion\", \"animateTransform\", \"circle\", \"clipPath\", \"color-profile\", \"cursor\", \"defs\", \"desc\", \"ellipse\", \"feBlend\", \"feColorMatrix\", \"feComponentTransfer\", \"feComposite\", \"feConvolveMatrix\", \"feDiffuseLighting\", \"feDisplacementMap\", \"feDistantLight\", \"feDropShadow\", \"feFlood\", \"feFuncA\", \"feFuncB\", \"feFuncG\", \"feFuncR\", \"feGaussianBlur\", \"feImage\", \"feMerge\", \"feMergeNode\", \"feMorphology\", \"feOffset\", \"fePointLight\", \"feSpecularLighting\", \"feSpotLight\", \"feTile\", \"feTurbulence\", \"filter\", \"font\", \"font-face\", \"font-face-format\", \"font-face-name\", \"font-face-src\", \"font-face-uri\", \"foreignObject\", \"g\", \"glyph\", \"glyphRef\", \"hkern\", \"image\", \"line\", \"linearGradient\", \"marker\", \"mask\", \"metadata\", \"missing-glyph\", \"mpath\", \"path\", \"pattern\", \"polygon\", \"polyline\", \"radialGradient\", \"rect\",\n\"set\", \"stop\",\n\"svg\", \"switch\", \"symbol\", \"text\", \"textPath\",\n\"tref\", \"tspan\", \"use\", \"view\", \"vkern\"]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/new Set([\"html\", \"base\", \"head\", \"link\", \"meta\", \"style\", \"title\", \"body\", \"address\", \"article\", \"aside\", \"footer\", \"header\", \"main\", \"nav\", \"section\", \"body\", \"blockquote\", \"dd\", \"div\", \"dl\", \"dt\", \"figcaption\", \"figure\", \"hr\", \"li\", \"ol\", \"p\", \"pre\", \"ul\", \"a\", \"abbr\", \"b\", \"bdi\", \"bdo\", \"br\", \"cite\", \"code\", \"data\", \"dfn\", \"em\", \"i\", \"kbd\", \"mark\", \"q\", \"rp\", \"rt\", \"ruby\", \"s\", \"samp\", \"small\", \"span\", \"strong\", \"sub\", \"sup\", \"time\", \"u\", \"var\", \"wbr\", \"area\", \"audio\", \"img\", \"map\", \"track\", \"video\", \"embed\", \"iframe\", \"object\", \"param\", \"picture\", \"portal\", \"source\", \"svg\", \"math\", \"canvas\", \"noscript\", \"script\", \"del\", \"ins\", \"caption\", \"col\", \"colgroup\", \"table\", \"tbody\", \"td\", \"tfoot\", \"th\", \"thead\", \"tr\", \"button\", \"datalist\", \"fieldset\", \"form\", \"input\", \"label\", \"legend\", \"meter\", \"optgroup\", \"option\", \"output\", \"progress\", \"select\", \"textarea\", \"details\", \"dialog\", \"menu\", \"summary\", \"details\", \"slot\", \"template\", \"acronym\", \"applet\", \"basefont\", \"bgsound\", \"big\", \"blink\", \"center\", \"content\", \"dir\", \"font\", \"frame\", \"frameset\", \"hgroup\", \"image\", \"keygen\", \"marquee\", \"menuitem\", \"nobr\", \"noembed\", \"noframes\", \"plaintext\", \"rb\", \"rtc\", \"shadow\", \"spacer\", \"strike\", \"tt\", \"xmp\", \"a\", \"abbr\", \"acronym\", \"address\", \"applet\", \"area\", \"article\", \"aside\", \"audio\", \"b\", \"base\", \"basefont\", \"bdi\", \"bdo\", \"bgsound\", \"big\", \"blink\", \"blockquote\", \"body\", \"br\", \"button\", \"canvas\", \"caption\", \"center\", \"cite\", \"code\", \"col\", \"colgroup\", \"content\", \"data\", \"datalist\", \"dd\", \"del\", \"details\", \"dfn\", \"dialog\", \"dir\", \"div\", \"dl\", \"dt\", \"em\", \"embed\", \"fieldset\", \"figcaption\", \"figure\", \"font\", \"footer\", \"form\", \"frame\", \"frameset\", \"head\", \"header\", \"hgroup\", \"hr\", \"html\", \"i\", \"iframe\", \"image\", \"img\", \"input\", \"ins\", \"kbd\", \"keygen\", \"label\", \"legend\", \"li\", \"link\", \"main\", \"map\", \"mark\", \"marquee\", \"menu\", \"menuitem\", \"meta\", \"meter\", \"nav\", \"nobr\", \"noembed\", \"noframes\", \"noscript\", \"object\", \"ol\", \"optgroup\", \"option\", \"output\", \"p\", \"param\", \"picture\", \"plaintext\", \"portal\", \"pre\", \"progress\", \"q\", \"rb\", \"rp\", \"rt\", \"rtc\", \"ruby\", \"s\", \"samp\", \"script\", \"section\", \"select\", \"shadow\", \"slot\", \"small\", \"source\", \"spacer\", \"span\", \"strike\", \"strong\", \"style\", \"sub\", \"summary\", \"sup\", \"table\", \"tbody\", \"td\", \"template\", \"textarea\", \"tfoot\", \"th\", \"thead\", \"time\", \"title\", \"tr\", \"track\", \"tt\", \"u\", \"ul\", \"var\", \"video\", \"wbr\", \"xmp\", \"input\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\",\n\"webview\",\n\"isindex\", \"listing\", \"multicol\", \"nextid\", \"noindex\", \"search\"]);\n\nconst memo = fn => createMemo(() => fn());\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document ? code() : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isImportNode, isSVG, isMathML) {\n let node;\n const create = () => {\n const t = isMathML ? document.createElementNS(\"http://www.w3.org/1998/Math/MathML\", \"template\") : document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;\n };\n const fn = isImportNode ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (isHydrating(node)) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (isHydrating(node)) return;\n if (value == null) node.removeAttribute(name);else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (isHydrating(node)) return;\n if (value == null) node.removeAttributeNS(namespace, name);else node.setAttributeNS(namespace, name, value);\n}\nfunction setBoolAttribute(node, name, value) {\n if (isHydrating(node)) return;\n value ? node.setAttribute(name, \"\") : node.removeAttribute(name);\n}\nfunction className(node, value) {\n if (isHydrating(node)) return;\n if (value == null) node.removeAttribute(\"class\");else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));\n } else node.addEventListener(name, handler, typeof handler !== \"function\" && handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return nodeStyle.cssText = value;\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction setStyleProperty(node, name, value) {\n value != null ? node.style.setProperty(name, value) : node.style.removeProperty(name);\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));\n }\n createRenderEffect(() => typeof props.ref === \"function\" && use(props.ref, node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef, props);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef, props);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n if (globalThis._$HY.done) return render(code, element, [...element.childNodes], options);\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n try {\n gatherHydratable(element, options.renderId);\n return render(code, element, [...element.childNodes], options);\n } finally {\n sharedConfig.context = null;\n }\n}\nfunction getNextElement(template) {\n let node,\n key,\n hydrating = isHydrating();\n if (!hydrating || !(node = sharedConfig.registry.get(key = getHydrationKey()))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (isHydrating(start)) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const {\n completed,\n events\n } = sharedConfig;\n if (!events) return;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n events.shift();\n eventHandler(e);\n }\n if (sharedConfig.done) {\n sharedConfig.events = _$HY.events = null;\n sharedConfig.completed = _$HY.completed = null;\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction isHydrating(node) {\n return !!sharedConfig.context && !sharedConfig.done && (!node || node.isConnected);\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef, props) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev, typeof prev !== \"function\" && prev);\n value && node.addEventListener(e, value, typeof value !== \"function\" && value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (prop.slice(0, 5) === \"bool:\") {\n setBoolAttribute(node, prop.slice(5), value);\n } else if ((forceProp = prop.slice(0, 5) === \"prop:\") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes(\"-\") || \"is\" in props)) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (isHydrating(node)) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n if (sharedConfig.registry && sharedConfig.events) {\n if (sharedConfig.events.find(([el, ev]) => ev === e)) return;\n }\n let node = e.target;\n const key = `$$${e.type}`;\n const oriTarget = e.target;\n const oriCurrentTarget = e.currentTarget;\n const retarget = value => Object.defineProperty(e, \"target\", {\n configurable: true,\n value\n });\n const handleNode = () => {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node.host && typeof node.host !== \"string\" && !node.host._$host && node.contains(e.target) && retarget(node.host);\n return true;\n };\n const walkUpTree = () => {\n while (handleNode() && (node = node._$host || node.parentNode || node.host));\n };\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n if (e.composedPath) {\n const path = e.composedPath();\n retarget(path[0]);\n for (let i = 0; i < path.length - 2; i++) {\n node = path[i];\n if (!handleNode()) break;\n if (node._$host) {\n node = node._$host;\n walkUpTree();\n break;\n }\n if (node.parentNode === oriCurrentTarget) {\n break;\n }\n }\n }\n else walkUpTree();\n retarget(oriTarget);\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = isHydrating(parent);\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = multi && current[0] && current[0].parentNode || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") {\n value = value.toString();\n if (value === current) return current;\n }\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return current = [...parent.childNodes];\n let node = array[0];\n if (node.parentNode !== parent) return current;\n const nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return current = nodes;\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return current = multi ? [value] : value;\n if (Array.isArray(current)) {\n if (multi) return current = cleanChildren(parent, current, marker, value);\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else ;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false) ; else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return parent.textContent = \"\";\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key)) sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n return sharedConfig.getNextContextId();\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false, is = undefined) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName, {\n is\n });\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const {\n useShadow\n } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(() => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => !clean() ? content() : dispose(), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot = useShadow && container.attachShadow ? container.attachShadow({\n mode: \"open\"\n }) : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n }, undefined, {\n render: !hydrating\n });\n return marker;\n}\nfunction createDynamic(component, props) {\n const cached = createMemo(component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(props));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg, untrack(() => props.is));\n spread(el, props, isSvg);\n return el;\n }\n });\n}\nfunction Dynamic(props) {\n const [, others] = splitProps(props, [\"component\"]);\n return createDynamic(() => props.component, others);\n}\n\nexport { Aliases, voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Hydration, voidFn as HydrationScript, NoHydration, Portal, Properties, RequestContext, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, createDynamic, delegateEvents, dynamicProperty, escape, voidFn as generateHydrationScript, voidFn as getAssets, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getPropAlias, voidFn as getRequestEvent, hydrate, innerHTML, insert, isDev, isServer, memo, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, setBoolAttribute, setProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, style, template, use, voidFn as useAssets };\n","function cloneProps(props) {\n const propKeys = Object.keys(props);\n return propKeys.reduce((memo, k) => {\n const prop = props[k];\n memo[k] = Object.assign({}, prop);\n if (isObject(prop.value) && !isFunction(prop.value) && !Array.isArray(prop.value)) memo[k].value = Object.assign({}, prop.value);\n if (Array.isArray(prop.value)) memo[k].value = prop.value.slice(0);\n return memo;\n }, {});\n}\nfunction normalizePropDefs(props) {\n if (!props) return {};\n const propKeys = Object.keys(props);\n return propKeys.reduce((memo, k) => {\n const v = props[k];\n memo[k] = !(isObject(v) && \"value\" in v) ? {\n value: v\n } : v;\n memo[k].attribute || (memo[k].attribute = toAttribute(k));\n memo[k].parse = \"parse\" in memo[k] ? memo[k].parse : typeof memo[k].value !== \"string\";\n return memo;\n }, {});\n}\nfunction propValues(props) {\n const propKeys = Object.keys(props);\n return propKeys.reduce((memo, k) => {\n memo[k] = props[k].value;\n return memo;\n }, {});\n}\nfunction initializeProps(element, propDefinition) {\n const props = cloneProps(propDefinition),\n propKeys = Object.keys(propDefinition);\n propKeys.forEach(key => {\n const prop = props[key],\n attr = element.getAttribute(prop.attribute),\n value = element[key];\n if (attr != null) prop.value = prop.parse ? parseAttributeValue(attr) : attr;\n if (value != null) prop.value = Array.isArray(value) ? value.slice(0) : value;\n prop.reflect && reflect(element, prop.attribute, prop.value, !!prop.parse);\n Object.defineProperty(element, key, {\n get() {\n return prop.value;\n },\n set(val) {\n const oldValue = prop.value;\n prop.value = val;\n prop.reflect && reflect(this, prop.attribute, prop.value, !!prop.parse);\n for (let i = 0, l = this.__propertyChangedCallbacks.length; i < l; i++) {\n this.__propertyChangedCallbacks[i](key, val, oldValue);\n }\n },\n enumerable: true,\n configurable: true\n });\n });\n return props;\n}\nfunction parseAttributeValue(value) {\n if (!value) return;\n try {\n return JSON.parse(value);\n } catch (err) {\n return value;\n }\n}\nfunction reflect(node, attribute, value, parse) {\n if (value == null || value === false) return node.removeAttribute(attribute);\n let reflect = parse ? JSON.stringify(value) : value;\n node.__updating[attribute] = true;\n if (reflect === \"true\") reflect = \"\";\n node.setAttribute(attribute, reflect);\n Promise.resolve().then(() => delete node.__updating[attribute]);\n}\nfunction toAttribute(propName) {\n return propName.replace(/\\.?([A-Z]+)/g, (x, y) => \"-\" + y.toLowerCase()).replace(\"_\", \"-\").replace(/^-/, \"\");\n}\nfunction toProperty(attr) {\n return attr.toLowerCase().replace(/(-)([a-z])/g, test => test.toUpperCase().replace(\"-\", \"\"));\n}\nfunction isObject(obj) {\n return obj != null && (typeof obj === \"object\" || typeof obj === \"function\");\n}\nfunction isFunction(val) {\n return Object.prototype.toString.call(val) === \"[object Function]\";\n}\nfunction isConstructor(f) {\n return typeof f === \"function\" && f.toString().indexOf(\"class\") === 0;\n}\nfunction reloadElement(node) {\n let callback = null;\n while (callback = node.__releaseCallbacks.pop()) callback(node);\n delete node.__initialized;\n node.renderRoot.textContent = \"\";\n node.connectedCallback();\n}\n\nlet currentElement;\nfunction getCurrentElement() {\n return currentElement;\n}\nfunction noShadowDOM() {\n Object.defineProperty(currentElement, \"renderRoot\", {\n value: currentElement\n });\n}\nfunction createElementType(BaseElement, propDefinition) {\n const propKeys = Object.keys(propDefinition);\n return class CustomElement extends BaseElement {\n static get observedAttributes() {\n return propKeys.map(k => propDefinition[k].attribute);\n }\n constructor() {\n super();\n this.__initialized = false;\n this.__released = false;\n this.__releaseCallbacks = [];\n this.__propertyChangedCallbacks = [];\n this.__updating = {};\n this.props = {};\n for (let propKey of propKeys) {\n this[propKey] = undefined;\n }\n }\n connectedCallback() {\n if (this.__initialized) return;\n this.__releaseCallbacks = [];\n this.__propertyChangedCallbacks = [];\n this.__updating = {};\n this.props = initializeProps(this, propDefinition);\n const props = propValues(this.props),\n ComponentType = this.Component,\n outerElement = currentElement;\n try {\n currentElement = this;\n this.__initialized = true;\n if (isConstructor(ComponentType)) new ComponentType(props, {\n element: this\n });else ComponentType(props, {\n element: this\n });\n } finally {\n currentElement = outerElement;\n }\n }\n async disconnectedCallback() {\n // prevent premature releasing when element is only temporarely removed from DOM\n await Promise.resolve();\n if (this.isConnected) return;\n this.__propertyChangedCallbacks.length = 0;\n let callback = null;\n while (callback = this.__releaseCallbacks.pop()) callback(this);\n delete this.__initialized;\n this.__released = true;\n }\n attributeChangedCallback(name, oldVal, newVal) {\n if (!this.__initialized) return;\n if (this.__updating[name]) return;\n name = this.lookupProp(name);\n if (name in propDefinition) {\n if (newVal == null && !this[name]) return;\n this[name] = propDefinition[name].parse ? parseAttributeValue(newVal) : newVal;\n }\n }\n lookupProp(attrName) {\n if (!propDefinition) return;\n return propKeys.find(k => attrName === k || attrName === propDefinition[k].attribute);\n }\n get renderRoot() {\n return this.shadowRoot || this.attachShadow({\n mode: \"open\"\n });\n }\n addReleaseCallback(fn) {\n this.__releaseCallbacks.push(fn);\n }\n addPropertyChangedCallback(fn) {\n this.__propertyChangedCallbacks.push(fn);\n }\n };\n}\n\nfunction createMixin(mixinFn) {\n return ComponentType => (props, options) => {\n options = mixinFn(options);\n if (isConstructor(ComponentType)) return new ComponentType(props, options);\n return ComponentType(props, options);\n };\n}\nfunction compose(...fns) {\n if (fns.length === 0) return i => i;\n if (fns.length === 1) return fns[0];\n return fns.reduce((a, b) => (...args) => a(b(...args)));\n}\n\nconst EC = Symbol('element-context');\nfunction lookupContext(element, context) {\n return element[EC] && element[EC][context.id] || (element.host || element.parentNode) && lookupContext(element.host || element.parentNode, context);\n}\nfunction createContext(initFn) {\n return {\n id: Symbol('context'),\n initFn\n };\n}\n\n// Direct\nfunction provide(context, value, element = getCurrentElement()) {\n element[EC] || (element[EC] = {});\n return element[EC][context.id] = context.initFn ? context.initFn(value) : value;\n}\nfunction consume(context, element = getCurrentElement()) {\n return lookupContext(element, context);\n}\n\n// HOCs\nfunction withProvider(context, value) {\n return createMixin(options => {\n const {\n element\n } = options;\n provide(context, value, element);\n return options;\n });\n}\nfunction withConsumer(context, key) {\n return createMixin(options => {\n const {\n element\n } = options;\n options = Object.assign({}, options, {\n [key]: lookupContext(element, context)\n });\n return options;\n });\n}\n\nfunction walk(root, call) {\n call(root);\n if (root.shadowRoot) walk(root.shadowRoot, call);\n let child = root.firstChild;\n while (child) {\n child.nodeType === 1 && walk(child, call);\n child = child.nextSibling;\n }\n}\nfunction hot(module, tagName) {\n if (module.hot) {\n function update(possibleError) {\n if (possibleError && possibleError instanceof Error) {\n console.error(possibleError);\n return;\n }\n walk(document.body, node => node.localName === tagName && setTimeout(() => reloadElement(node), 0));\n }\n\n // handle both Parcel and Webpack style\n module.hot.accept(update);\n if (module.hot.status && module.hot.status() === 'apply') {\n update();\n }\n }\n}\n\nfunction register(tag, props = {}, options = {}) {\n const {\n BaseElement = HTMLElement,\n extension,\n customElements = window.customElements\n } = options;\n return ComponentType => {\n if (!tag) throw new Error(\"tag is required to register a Component\");\n let ElementType = customElements.get(tag);\n if (ElementType) {\n // Consider disabling this in a production mode\n ElementType.prototype.Component = ComponentType;\n return ElementType;\n }\n ElementType = createElementType(BaseElement, normalizePropDefs(props));\n ElementType.prototype.Component = ComponentType;\n ElementType.prototype.registeredTag = tag;\n customElements.define(tag, ElementType, extension);\n return ElementType;\n };\n}\n\nexport { compose, consume, createContext, createMixin, getCurrentElement, hot, isConstructor, isFunction, isObject, noShadowDOM, provide, register, reloadElement, toAttribute, toProperty, withConsumer, withProvider };\n","import { register } from \"component-register\";\nexport { hot, getCurrentElement, noShadowDOM } from \"component-register\";\nimport { createRoot, createSignal } from \"solid-js\";\nimport { insert } from \"solid-js/web\";\nfunction createProps(raw) {\n const keys = Object.keys(raw);\n const props = {};\n for (let i = 0; i < keys.length; i++) {\n const [get, set] = createSignal(raw[keys[i]]);\n Object.defineProperty(props, keys[i], {\n get,\n set(v) {\n set(() => v);\n }\n });\n }\n return props;\n}\nfunction lookupContext(el) {\n if (el.assignedSlot && el.assignedSlot._$owner) return el.assignedSlot._$owner;\n let next = el.parentNode;\n while (next && !next._$owner && !(next.assignedSlot && next.assignedSlot._$owner))\n next = next.parentNode;\n return next && next.assignedSlot ? next.assignedSlot._$owner : el._$owner;\n}\nfunction withSolid(ComponentType) {\n return (rawProps, options) => {\n const { element } = options;\n return createRoot(dispose => {\n const props = createProps(rawProps);\n element.addPropertyChangedCallback((key, val) => (props[key] = val));\n element.addReleaseCallback(() => {\n element.renderRoot.textContent = \"\";\n dispose();\n });\n const comp = ComponentType(props, options);\n return insert(element.renderRoot, comp);\n }, lookupContext(element));\n };\n}\nfunction customElement(tag, props, ComponentType) {\n if (arguments.length === 2) {\n ComponentType = props;\n props = {};\n }\n return register(tag, props)(withSolid(ComponentType));\n}\nexport { withSolid, customElement };\n","import { createSignal, onCleanup, type Accessor as SolidAccessor } from \"solid-js\";\nimport type { Getter } from \"./index\";\n\n// A helper to create a solid-js signal.\nexport default function solid<T>(signal: Getter<T>): SolidAccessor<T> {\n\t// Disable the equals check because we do it ourselves.\n\tconst [get, set] = createSignal(signal.peek(), { equals: false });\n\tconst dispose = signal.subscribe((value) => set(() => value));\n\tonCleanup(() => dispose());\n\treturn get;\n}\n","import { type Moq, Signals } from \"@moq/hang\";\nimport solid from \"@moq/signals/solid\";\nimport type { JSX } from \"solid-js\";\nimport { createContext, createSignal, onCleanup } from \"solid-js\";\nimport type { BufferedRanges } from \"..\";\nimport type MoqWatch from \"../element\";\n\ntype WatchUIContextProviderProps = {\n\tmoqWatch: MoqWatch;\n\tchildren: JSX.Element;\n};\n\ntype WatchStatus = \"no-url\" | \"disconnected\" | \"connecting\" | \"offline\" | \"loading\" | \"live\" | \"connected\";\n\nexport type Rendition = {\n\tname: string;\n\twidth?: number;\n\theight?: number;\n};\n\nexport type WatchUIContextValues = {\n\tmoqWatch: MoqWatch;\n\twatchStatus: () => WatchStatus;\n\tisPlaying: () => boolean;\n\tisMuted: () => boolean;\n\tsetVolume: (vol: number) => void;\n\tcurrentVolume: () => number;\n\ttogglePlayback: () => void;\n\ttoggleMuted: () => void;\n\tbuffering: () => boolean;\n\tjitter: () => Moq.Time.Milli;\n\tsetJitter: (value: Moq.Time.Milli) => void;\n\tavailableRenditions: () => Rendition[];\n\tactiveRendition: () => string | undefined;\n\tsetActiveRendition: (name: string | undefined) => void;\n\tisStatsPanelVisible: () => boolean;\n\tsetIsStatsPanelVisible: (visible: boolean) => void;\n\tisFullscreen: () => boolean;\n\ttoggleFullscreen: () => void;\n\ttimestamp: () => Moq.Time.Milli | undefined;\n\tvideoBuffered: () => BufferedRanges;\n\taudioBuffered: () => BufferedRanges;\n};\n\nexport const WatchUIContext = createContext<WatchUIContextValues>();\n\nexport default function WatchUIContextProvider(props: WatchUIContextProviderProps) {\n\tconst [watchStatus, setWatchStatus] = createSignal<WatchStatus>(\"no-url\");\n\tconst [isPlaying, setIsPlaying] = createSignal<boolean>(false);\n\tconst [isMuted, setIsMuted] = createSignal<boolean>(false);\n\tconst [currentVolume, setCurrentVolume] = createSignal<number>(0);\n\tconst [buffering, setBuffering] = createSignal<boolean>(false);\n\tconst jitter = solid(props.moqWatch.jitter);\n\tconst [availableRenditions, setAvailableRenditions] = createSignal<Rendition[]>([]);\n\tconst [activeRendition, setActiveRendition] = createSignal<string | undefined>(undefined);\n\tconst [isStatsPanelVisible, setIsStatsPanelVisible] = createSignal<boolean>(false);\n\tconst [isFullscreen, setIsFullscreen] = createSignal<boolean>(!!document.fullscreenElement);\n\n\tconst togglePlayback = () => {\n\t\tprops.moqWatch.paused.set(!props.moqWatch.paused.get());\n\t};\n\n\tconst toggleFullscreen = () => {\n\t\tif (document.fullscreenElement) {\n\t\t\tdocument.exitFullscreen();\n\t\t} else {\n\t\t\tprops.moqWatch.requestFullscreen();\n\t\t}\n\t};\n\n\tconst setVolume = (volume: number) => {\n\t\tprops.moqWatch.audio.volume.set(volume / 100);\n\t};\n\n\tconst toggleMuted = () => {\n\t\tprops.moqWatch.audio.muted.update((muted) => !muted);\n\t};\n\n\tconst setJitter = (latency: Moq.Time.Milli) => {\n\t\tprops.moqWatch.jitter.set(latency);\n\t};\n\n\tconst setActiveRenditionValue = (name: string | undefined) => {\n\t\tprops.moqWatch.video.source.target.update((prev) => ({\n\t\t\t...prev,\n\t\t\tname: name,\n\t\t}));\n\t};\n\n\t// Use solid helper for the new signals\n\tconst timestamp = solid(props.moqWatch.video.timestamp);\n\tconst videoBuffered = solid(props.moqWatch.video.buffered);\n\tconst audioBuffered = solid(props.moqWatch.audio.buffered);\n\n\tconst value: WatchUIContextValues = {\n\t\tmoqWatch: props.moqWatch,\n\t\twatchStatus,\n\t\ttogglePlayback,\n\t\tisPlaying,\n\t\tsetVolume,\n\t\tisMuted,\n\t\tcurrentVolume,\n\t\ttoggleMuted,\n\t\tbuffering,\n\t\tjitter,\n\t\tsetJitter,\n\t\tavailableRenditions,\n\t\tactiveRendition,\n\t\tsetActiveRendition: setActiveRenditionValue,\n\t\tisStatsPanelVisible,\n\t\tsetIsStatsPanelVisible,\n\t\tisFullscreen,\n\t\ttoggleFullscreen,\n\t\ttimestamp,\n\t\tvideoBuffered,\n\t\taudioBuffered,\n\t};\n\n\tconst watch = props.moqWatch;\n\tconst signals = new Signals.Effect();\n\n\tsignals.effect((effect) => {\n\t\tconst url = effect.get(watch.connection.url);\n\t\tconst connection = effect.get(watch.connection.status);\n\t\tconst broadcast = effect.get(watch.broadcast.status);\n\n\t\tif (!url) {\n\t\t\tsetWatchStatus(\"no-url\");\n\t\t} else if (connection === \"disconnected\") {\n\t\t\tsetWatchStatus(\"disconnected\");\n\t\t} else if (connection === \"connecting\") {\n\t\t\tsetWatchStatus(\"connecting\");\n\t\t} else if (broadcast === \"offline\") {\n\t\t\tsetWatchStatus(\"offline\");\n\t\t} else if (broadcast === \"loading\") {\n\t\t\tsetWatchStatus(\"loading\");\n\t\t} else if (broadcast === \"live\") {\n\t\t\tsetWatchStatus(\"live\");\n\t\t} else if (connection === \"connected\") {\n\t\t\tsetWatchStatus(\"connected\");\n\t\t}\n\t});\n\n\tsignals.effect((effect) => {\n\t\tconst paused = effect.get(watch.paused);\n\t\tsetIsPlaying(!paused);\n\t});\n\n\tsignals.effect((effect) => {\n\t\tconst volume = effect.get(watch.audio.volume);\n\t\tsetCurrentVolume(volume * 100);\n\t});\n\n\tsignals.effect((effect) => {\n\t\tconst muted = effect.get(watch.audio.muted);\n\t\tsetIsMuted(muted);\n\t});\n\n\tsignals.effect((effect) => {\n\t\tconst stalled = effect.get(watch.video.stalled);\n\t\tsetBuffering(stalled);\n\t});\n\n\tsignals.effect((effect) => {\n\t\tconst jitter = effect.get(watch.jitter);\n\t\tsetJitter(jitter);\n\t});\n\n\tsignals.effect((effect) => {\n\t\tconst videoCatalog = effect.get(watch.video.source.catalog);\n\t\tconst renditions = videoCatalog?.renditions ?? {};\n\n\t\tconst renditionsList: Rendition[] = Object.entries(renditions).map(([name, config]) => ({\n\t\t\tname,\n\t\t\twidth: config.codedWidth,\n\t\t\theight: config.codedHeight,\n\t\t}));\n\n\t\tsetAvailableRenditions(renditionsList);\n\t});\n\n\tsignals.effect((effect) => {\n\t\tconst selected = effect.get(watch.video.source.track);\n\t\tsetActiveRendition(selected);\n\t});\n\n\tconst handleFullscreenChange = () => {\n\t\tsetIsFullscreen(!!document.fullscreenElement);\n\t};\n\n\tsignals.event(document, \"fullscreenchange\", handleFullscreenChange);\n\tonCleanup(() => signals.close());\n\n\treturn <WatchUIContext.Provider value={value}>{props.children}</WatchUIContext.Provider>;\n}\n","import { useContext } from \"solid-js\";\nimport { WatchUIContext, type WatchUIContextValues } from \"../context\";\n\nexport default function useWatchUIContext(): WatchUIContextValues {\n\tconst context = useContext(WatchUIContext);\n\n\tif (!context) {\n\t\tthrow new Error(\"useWatchUIContext must be used within a WatchUIContextProvider\");\n\t}\n\n\treturn context;\n}\n","import { Show } from \"solid-js\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\nexport default function BufferingIndicator() {\n\tconst context = useWatchUIContext();\n\n\treturn (\n\t\t<Show when={context.buffering()}>\n\t\t\t<div class=\"bufferingContainer\">\n\t\t\t\t<div class=\"bufferingSpinner\" />\n\t\t\t</div>\n\t\t</Show>\n\t);\n}\n","import { Moq } from \"@moq/hang\";\nimport { createMemo, createSignal, For, onCleanup, Show } from \"solid-js\";\nimport type { BufferedRange } from \"../..\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\nconst MIN_RANGE = 0 as Moq.Time.Milli;\nconst RANGE_STEP = 100 as Moq.Time.Milli;\n\ntype BufferControlProps = {\n\t/** Maximum buffer range in milliseconds (default: 5000ms = 5s) */\n\tmax?: Moq.Time.Milli;\n};\n\nexport default function BufferControl(props: BufferControlProps) {\n\tconst context = useWatchUIContext();\n\tconst maxRange = (): Moq.Time.Milli => props.max ?? (5000 as Moq.Time.Milli);\n\tconst [isDragging, setIsDragging] = createSignal(false);\n\n\t// Compute range style and overflow info relative to current timestamp\n\tconst computeRange = (range: BufferedRange, timestamp: Moq.Time.Milli, color: string) => {\n\t\tconst startMs = (range.start - timestamp) as Moq.Time.Milli;\n\t\tconst endMs = (range.end - timestamp) as Moq.Time.Milli;\n\t\tconst visibleStartMs = Math.max(0, startMs) as Moq.Time.Milli;\n\t\tconst visibleEndMs = Math.min(endMs, maxRange()) as Moq.Time.Milli;\n\t\tconst leftPct = (visibleStartMs / maxRange()) * 100;\n\t\tconst widthPct = Math.max(0.5, ((visibleEndMs - visibleStartMs) / maxRange()) * 100);\n\t\tconst isOverflow = endMs > maxRange();\n\t\tconst overflowSec = isOverflow\n\t\t\t? Moq.Time.Milli.toSecond((endMs - visibleStartMs) as Moq.Time.Milli).toFixed(1)\n\t\t\t: null;\n\t\treturn {\n\t\t\tstyle: `left: ${leftPct}%; width: ${widthPct}%; background: ${color};`,\n\t\t\tisOverflow,\n\t\t\toverflowSec,\n\t\t};\n\t};\n\n\t// Determine color based on gap detection and buffering state\n\tconst rangeColor = (index: number, isBuffering: boolean) => {\n\t\tif (isBuffering) return \"#f87171\"; // red\n\t\tif (index > 0) return \"#facc15\"; // yellow\n\t\treturn \"#4ade80\"; // green\n\t};\n\n\tconst bufferTargetPct = createMemo(() => (context.jitter() / maxRange()) * 100);\n\n\t// Handle mouse interaction to set buffer via clicking/dragging on the visualization\n\tlet containerRef: HTMLDivElement | undefined;\n\n\tconst LABEL_WIDTH = 48; // px reserved for track labels\n\n\tconst updateBufferFromMouseX = (clientX: number) => {\n\t\tif (!containerRef) return;\n\t\tconst rect = containerRef.getBoundingClientRect();\n\t\tconst trackWidth = rect.width - LABEL_WIDTH;\n\t\tconst x = Math.max(0, Math.min(clientX - rect.left - LABEL_WIDTH, trackWidth));\n\t\tconst ms = (x / trackWidth) * maxRange();\n\t\tconst snapped = (Math.round(ms / RANGE_STEP) * RANGE_STEP) as Moq.Time.Milli;\n\t\tconst clamped = Math.max(MIN_RANGE, Math.min(maxRange(), snapped)) as Moq.Time.Milli;\n\t\tcontext.setJitter(clamped);\n\t};\n\n\tconst onMouseDown = (e: MouseEvent) => {\n\t\tsetIsDragging(true);\n\t\tupdateBufferFromMouseX(e.clientX);\n\t\tdocument.addEventListener(\"mousemove\", onMouseMove);\n\t\tdocument.addEventListener(\"mouseup\", onMouseUp);\n\t};\n\n\tconst onMouseMove = (e: MouseEvent) => {\n\t\tif (isDragging()) {\n\t\t\tupdateBufferFromMouseX(e.clientX);\n\t\t}\n\t};\n\n\tconst onMouseUp = () => {\n\t\tsetIsDragging(false);\n\t\tdocument.removeEventListener(\"mousemove\", onMouseMove);\n\t\tdocument.removeEventListener(\"mouseup\", onMouseUp);\n\t};\n\n\t// Cleanup listeners on unmount\n\tonCleanup(() => {\n\t\tdocument.removeEventListener(\"mousemove\", onMouseMove);\n\t\tdocument.removeEventListener(\"mouseup\", onMouseUp);\n\t});\n\n\treturn (\n\t\t<div class=\"buffer__container\">\n\t\t\t{/* Buffer Visualization - interactive, click/drag to set buffer */}\n\t\t\t<div\n\t\t\t\tclass={`buffer__visualization ${isDragging() ? \"buffer__visualization--dragging\" : \"\"}`}\n\t\t\t\tref={containerRef}\n\t\t\t\tonMouseDown={onMouseDown}\n\t\t\t\trole=\"slider\"\n\t\t\t\ttabIndex={0}\n\t\t\t\taria-valuenow={context.jitter()}\n\t\t\t\taria-valuemin={MIN_RANGE}\n\t\t\t\taria-valuemax={maxRange()}\n\t\t\t\taria-label=\"Buffer jitter\"\n\t\t\t>\n\t\t\t\t{/* Playhead (left edge = current time) */}\n\t\t\t\t<div class=\"buffer__playhead\" />\n\n\t\t\t\t{/* Video buffer track */}\n\t\t\t\t<div class=\"buffer__track buffer__track--video\">\n\t\t\t\t\t<span class=\"buffer__track-label\">Video</span>\n\t\t\t\t\t<For each={context.videoBuffered()}>\n\t\t\t\t\t\t{(range, i) => {\n\t\t\t\t\t\t\tconst info = () => {\n\t\t\t\t\t\t\t\tconst timestamp = context.timestamp();\n\t\t\t\t\t\t\t\tif (timestamp === undefined) return null;\n\t\t\t\t\t\t\t\treturn computeRange(range, timestamp, rangeColor(i(), context.buffering()));\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Show when={info()}>\n\t\t\t\t\t\t\t\t\t{(rangeInfo) => (\n\t\t\t\t\t\t\t\t\t\t<div class=\"buffer__range\" style={rangeInfo().style}>\n\t\t\t\t\t\t\t\t\t\t\t<Show when={rangeInfo().isOverflow}>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"buffer__overflow-label\">{rangeInfo().overflowSec}s</span>\n\t\t\t\t\t\t\t\t\t\t\t</Show>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Show>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}}\n\t\t\t\t\t</For>\n\t\t\t\t</div>\n\n\t\t\t\t{/* Audio buffer track */}\n\t\t\t\t<div class=\"buffer__track buffer__track--audio\">\n\t\t\t\t\t<span class=\"buffer__track-label\">Audio</span>\n\t\t\t\t\t<For each={context.audioBuffered()}>\n\t\t\t\t\t\t{(range, i) => {\n\t\t\t\t\t\t\tconst info = () => {\n\t\t\t\t\t\t\t\tconst timestamp = context.timestamp();\n\t\t\t\t\t\t\t\tif (timestamp === undefined) return null;\n\t\t\t\t\t\t\t\treturn computeRange(range, timestamp, rangeColor(i(), context.buffering()));\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Show when={info()}>\n\t\t\t\t\t\t\t\t\t{(rangeInfo) => (\n\t\t\t\t\t\t\t\t\t\t<div class=\"buffer__range\" style={rangeInfo().style}>\n\t\t\t\t\t\t\t\t\t\t\t<Show when={rangeInfo().isOverflow}>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"buffer__overflow-label\">{rangeInfo().overflowSec}s</span>\n\t\t\t\t\t\t\t\t\t\t\t</Show>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Show>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}}\n\t\t\t\t\t</For>\n\t\t\t\t</div>\n\n\t\t\t\t{/* Buffer target line (draggable) - wrapped in track-area container */}\n\t\t\t\t<div class=\"buffer__target-area\">\n\t\t\t\t\t<div class=\"buffer__target-line\" style={{ left: `${bufferTargetPct()}%` }}>\n\t\t\t\t\t\t<span class=\"buffer__target-label\">{`${Math.round(context.jitter())}ms`}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n","import { Button, Icon } from \"@moq/ui-core\";\nimport { Show } from \"solid-js\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\nexport default function FullscreenButton() {\n\tconst context = useWatchUIContext();\n\n\tconst onClick = () => {\n\t\tcontext.toggleFullscreen();\n\t};\n\n\treturn (\n\t\t<Button title=\"Fullscreen\" onClick={onClick}>\n\t\t\t<Show when={context.isFullscreen()} fallback={<Icon.FullscreenEnter />}>\n\t\t\t\t<Icon.FullscreenExit />\n\t\t\t</Show>\n\t\t</Button>\n\t);\n}\n","import { Button, Icon } from \"@moq/ui-core\";\nimport { Show } from \"solid-js\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\nexport default function PlayPauseButton() {\n\tconst context = useWatchUIContext();\n\tconst onClick = () => {\n\t\tcontext.togglePlayback();\n\t};\n\n\treturn (\n\t\t<Button title={context.isPlaying() ? \"Pause\" : \"Play\"} class=\"button--playback\" onClick={onClick}>\n\t\t\t<Show when={context.isPlaying()} fallback={<Icon.Play />}>\n\t\t\t\t<Icon.Pause />\n\t\t\t</Show>\n\t\t</Button>\n\t);\n}\n","import { For, type JSX } from \"solid-js\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\nexport default function QualitySelector() {\n\tconst context = useWatchUIContext();\n\n\tconst handleQualityChange: JSX.EventHandler<HTMLSelectElement, Event> = (event) => {\n\t\tconst selectedValue = event.currentTarget.value || undefined;\n\t\tcontext.setActiveRendition(selectedValue);\n\t};\n\n\treturn (\n\t\t<div class=\"qualitySelectorContainer\">\n\t\t\t<label for=\"quality-select\" class=\"qualityLabel\">\n\t\t\t\tQuality:{\" \"}\n\t\t\t</label>\n\t\t\t<select\n\t\t\t\tid=\"quality-select\"\n\t\t\t\tonChange={handleQualityChange}\n\t\t\t\tclass=\"qualitySelect\"\n\t\t\t\tvalue={context.activeRendition() ?? \"\"}\n\t\t\t>\n\t\t\t\t<option value=\"\">Auto</option>\n\t\t\t\t<For each={context.availableRenditions() ?? []}>\n\t\t\t\t\t{(rendition) => (\n\t\t\t\t\t\t<option value={rendition.name}>\n\t\t\t\t\t\t\t{rendition.name}\n\t\t\t\t\t\t\t{rendition.width && rendition.height ? ` (${rendition.width}x${rendition.height})` : \"\"}\n\t\t\t\t\t\t</option>\n\t\t\t\t\t)}\n\t\t\t\t</For>\n\t\t\t</select>\n\t\t</div>\n\t);\n}\n","import { Button, Icon } from \"@moq/ui-core\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\n/**\n * Toggle button for showing/hiding stats panel\n */\nexport default function StatsButton() {\n\tconst context = useWatchUIContext();\n\n\tconst onClick = () => {\n\t\tcontext.setIsStatsPanelVisible(!context.isStatsPanelVisible());\n\t};\n\n\treturn (\n\t\t<Button title={context.isStatsPanelVisible() ? \"Hide stats\" : \"Show stats\"} onClick={onClick}>\n\t\t\t<Icon.Stats />\n\t\t</Button>\n\t);\n}\n","import { Button, Icon } from \"@moq/ui-core\";\nimport { createEffect, createSignal } from \"solid-js\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\nconst getVolumeIcon = (volume: number, isMuted: boolean) => {\n\tif (isMuted || volume === 0) {\n\t\treturn <Icon.Mute />;\n\t} else if (volume > 0 && volume <= 33) {\n\t\treturn <Icon.VolumeLow />;\n\t} else if (volume > 33 && volume <= 66) {\n\t\treturn <Icon.VolumeMedium />;\n\t} else {\n\t\treturn <Icon.VolumeHigh />;\n\t}\n};\n\nexport default function VolumeSlider() {\n\tconst [volumeLabel, setVolumeLabel] = createSignal<number>(0);\n\tconst context = useWatchUIContext();\n\n\tconst onInputChange = (event: Event) => {\n\t\tconst el = event.currentTarget as HTMLInputElement;\n\t\tconst volume = parseFloat(el.value);\n\t\tcontext.setVolume(volume);\n\t};\n\n\tcreateEffect(() => {\n\t\tconst currentVolume = context.currentVolume() || 0;\n\t\tsetVolumeLabel(Math.round(currentVolume));\n\t});\n\n\treturn (\n\t\t<div class=\"volumeSliderContainer\">\n\t\t\t<Button title={context.isMuted() ? \"Unmute\" : \"Mute\"} onClick={() => context.toggleMuted()}>\n\t\t\t\t{getVolumeIcon(context.currentVolume(), context.isMuted())}\n\t\t\t</Button>\n\t\t\t<input type=\"range\" onChange={onInputChange} min=\"0\" max=\"100\" value={context.currentVolume()} />\n\t\t\t<span class=\"volumeLabel\">{volumeLabel()}</span>\n\t\t</div>\n\t);\n}\n","import { Match, Switch } from \"solid-js\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\nexport default function WatchStatusIndicator() {\n\tconst context = useWatchUIContext();\n\n\treturn (\n\t\t<output>\n\t\t\t<Switch>\n\t\t\t\t<Match when={context.watchStatus() === \"no-url\"}>🔴 No URL</Match>\n\t\t\t\t<Match when={context.watchStatus() === \"disconnected\"}>🔴 Disconnected</Match>\n\t\t\t\t<Match when={context.watchStatus() === \"connecting\"}>🟡 Connecting...</Match>\n\t\t\t\t<Match when={context.watchStatus() === \"offline\"}>🔴 Offline</Match>\n\t\t\t\t<Match when={context.watchStatus() === \"loading\"}>🟡 Loading...</Match>\n\t\t\t\t<Match when={context.watchStatus() === \"live\"}>🟢 Live</Match>\n\t\t\t\t<Match when={context.watchStatus() === \"connected\"}>🟢 Connected</Match>\n\t\t\t</Switch>\n\t\t</output>\n\t);\n}\n","import BufferControl from \"./BufferControl\";\nimport FullscreenButton from \"./FullscreenButton\";\nimport PlayPauseButton from \"./PlayPauseButton\";\nimport QualitySelector from \"./QualitySelector\";\nimport StatsButton from \"./StatsButton\";\nimport VolumeSlider from \"./VolumeSlider\";\nimport WatchStatusIndicator from \"./WatchStatusIndicator\";\n\nexport default function WatchControls() {\n\treturn (\n\t\t<div class=\"watchControlsContainer\">\n\t\t\t<div class=\"playbackControlsRow flex--align-center\">\n\t\t\t\t<PlayPauseButton />\n\t\t\t\t<VolumeSlider />\n\t\t\t\t<WatchStatusIndicator />\n\t\t\t\t<StatsButton />\n\t\t\t\t<FullscreenButton />\n\t\t\t</div>\n\t\t\t<div class=\"latencyControlsRow\">\n\t\t\t\t<BufferControl />\n\t\t\t\t<QualitySelector />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n","import { Stats } from \"@moq/ui-core\";\nimport { useContext } from \"solid-js\";\nimport { Show } from \"solid-js/web\";\nimport type MoqWatch from \"../element\";\n\nimport BufferingIndicator from \"./components/BufferingIndicator\";\nimport WatchControls from \"./components/WatchControls\";\nimport WatchUIContextProvider, { WatchUIContext } from \"./context\";\nimport styles from \"./styles/index.css?inline\";\n\nexport function WatchUI(props: { watch: MoqWatch }) {\n\treturn (\n\t\t<WatchUIContextProvider moqWatch={props.watch}>\n\t\t\t<style>{styles}</style>\n\t\t\t<div class=\"watchVideoContainer\">\n\t\t\t\t<slot />\n\t\t\t\t{(() => {\n\t\t\t\t\tconst context = useContext(WatchUIContext);\n\t\t\t\t\tif (!context) return null;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Show when={context.isStatsPanelVisible()}>\n\t\t\t\t\t\t\t<Stats\n\t\t\t\t\t\t\t\tcontext={WatchUIContext}\n\t\t\t\t\t\t\t\tgetElement={(ctx): MoqWatch | undefined => {\n\t\t\t\t\t\t\t\t\treturn ctx?.moqWatch;\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Show>\n\t\t\t\t\t);\n\t\t\t\t})()}\n\t\t\t\t<BufferingIndicator />\n\t\t\t</div>\n\t\t\t<WatchControls />\n\t\t</WatchUIContextProvider>\n\t);\n}\n","import { customElement } from \"solid-element\";\nimport { createSignal, onMount, Show } from \"solid-js\";\nimport type MoqWatch from \"../element\";\nimport { WatchUI } from \"./element.tsx\";\n\ncustomElement(\"moq-watch-ui\", (_, { element }) => {\n\tconst [nested, setNested] = createSignal<MoqWatch | undefined>();\n\n\tonMount(async () => {\n\t\tawait customElements.whenDefined(\"moq-watch\");\n\t\tconst watchEl = element.querySelector(\"moq-watch\");\n\t\tsetNested(watchEl ? (watchEl as MoqWatch) : undefined);\n\t});\n\n\treturn (\n\t\t<Show when={nested()} keyed>\n\t\t\t{(watch: MoqWatch) => <WatchUI watch={watch} />}\n\t\t</Show>\n\t);\n});\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"moq-watch-ui\": HTMLElement;\n\t}\n}\n"],"names":["IS_DEV","equalFn","a","b","$TRACK","signalOptions","runEffects","runQueue","STALE","PENDING","UNOWNED","Owner","Transition","ExternalSourceConfig","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","owner","unowned","current","root","updateFn","untrack","cleanNode","runUpdates","createSignal","value","options","s","setter","writeSignal","readSignal","createRenderEffect","c","createComputation","updateComputation","createEffect","runUserEffects","createMemo","onMount","onCleanup","getOwner","createContext","defaultValue","id","createProvider","useContext","context","children","memo","resolveChildren","updates","lookUpstream","sSlot","node","isComp","i","o","TransitionRunning","markDownstream","time","runComputation","nextValue","err","handleError","init","pure","state","runTop","ancestors","wait","res","completeUpdates","e","queue","userLength","ignore","source","index","obs","n","castError","results","result","props","FALLBACK","dispose","d","mapArray","list","mapFn","items","mapped","disposers","len","indexes","newItems","newLen","j","newIndices","newIndicesNext","temp","tempdisposers","tempIndexes","start","end","newEnd","item","disposer","mapper","set","createComponent","Comp","narrowedError","name","For","fallback","Show","keyed","conditionValue","condition","child","Switch","chs","switchFunc","ch","mps","func","mp","prevFunc","sel","Match","reconcileArrays","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","map","sequence","t","$$EVENTS","template","html","isImportNode","isSVG","isMathML","create","delegateEvents","eventNames","document","l","eventHandler","setAttribute","className","style","prev","nodeStyle","v","setStyleProperty","use","element","arg","insert","parent","accessor","marker","initial","insertExpression","key","oriTarget","oriCurrentTarget","retarget","handleNode","handler","data","walkUpTree","path","unwrapArray","multi","cleanChildren","array","currentArray","normalizeIncomingArray","appendNodes","normalized","unwrap","dynamic","replacement","inserted","el","isParent","cloneProps","k","prop","isObject","isFunction","normalizePropDefs","toAttribute","propValues","initializeProps","propDefinition","attr","parseAttributeValue","reflect","val","oldValue","attribute","parse","propName","x","y","obj","isConstructor","f","currentElement","createElementType","BaseElement","propKeys","propKey","ComponentType","outerElement","callback","oldVal","newVal","attrName","register","tag","extension","customElements","ElementType","createProps","raw","keys","get","lookupContext","next","withSolid","rawProps","comp","customElement","solid","signal","WatchUIContext","WatchUIContextProvider","watchStatus","setWatchStatus","isPlaying","setIsPlaying","isMuted","setIsMuted","currentVolume","setCurrentVolume","buffering","setBuffering","jitter","moqWatch","availableRenditions","setAvailableRenditions","activeRendition","setActiveRendition","undefined","isStatsPanelVisible","setIsStatsPanelVisible","isFullscreen","setIsFullscreen","fullscreenElement","togglePlayback","paused","toggleFullscreen","exitFullscreen","requestFullscreen","setVolume","volume","audio","toggleMuted","muted","update","setJitter","latency","setActiveRenditionValue","video","target","timestamp","videoBuffered","buffered","audioBuffered","watch","signals","Signals","Effect","effect","url","connection","status","broadcast","stalled","renditions","catalog","renditionsList","Object","entries","config","width","codedWidth","height","codedHeight","selected","track","handleFullscreenChange","event","close","_$createComponent","Provider","useWatchUIContext","BufferingIndicator","when","_tmpl$","MIN_RANGE","RANGE_STEP","BufferControl","maxRange","max","isDragging","setIsDragging","computeRange","range","color","startMs","endMs","visibleStartMs","Math","visibleEndMs","min","leftPct","widthPct","isOverflow","overflowSec","Moq","Time","Milli","toSecond","toFixed","rangeColor","isBuffering","bufferTargetPct","containerRef","LABEL_WIDTH","updateBufferFromMouseX","clientX","rect","getBoundingClientRect","trackWidth","ms","left","snapped","round","clamped","onMouseDown","addEventListener","onMouseMove","onMouseUp","removeEventListener","_el$","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$6","_el$8","_el$9","_el$0","$$mousedown","_ref$","_$use","_$setAttribute","_$insert","each","info","rangeInfo","_el$1","_tmpl$3","_el$10","_tmpl$2","_el$11","_$effect","_$p","_$style","_el$12","_el$13","_el$14","_p$","_v$","_v$2","_v$3","_v$4","_$className","_$setStyleProperty","_$delegateEvents","FullscreenButton","Button","title","onClick","Icon","FullscreenEnter","FullscreenExit","PlayPauseButton","Play","Pause","QualitySelector","handleQualityChange","selectedValue","currentTarget","rendition","_el$5","_c$","_$memo","StatsButton","Stats","getVolumeIcon","Mute","VolumeLow","VolumeMedium","VolumeHigh","VolumeSlider","volumeLabel","setVolumeLabel","onInputChange","parseFloat","WatchStatusIndicator","WatchControls","WatchUI","styles","_$owner","_$getOwner","getElement","ctx","_","nested","setNested","whenDefined","watchEl","querySelector"],"mappings":";;AAiJA,MAAMA,KAAS,IACTC,KAAU,CAACC,GAAGC,MAAMD,MAAMC,GAG1BC,KAAS,uBAAO,aAAa,GA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MAAM;AACjD,QAAM,CAACsR,GAAQC,CAAS,IAAIja,EAAAA;AAE5Bc,SAAAA,GAAQ,YAAY;AACnB,UAAMgM,eAAeoN,YAAY,WAAW;AAC5C,UAAMC,IAAUzR,EAAQ0R,cAAc,WAAW;AACjDH,IAAAA,EAAUE,KAAkCrL,MAAS;AAAA,EACtD,CAAC,GAEDmD,EACErM,GAAI;AAAA,IAAA,IAACyM,OAAI;AAAA,aAAE2H,EAAAA;AAAAA,IAAQ;AAAA,IAAEnU,OAAK;AAAA,IAAAtE,UACzBA,CAACiP,MAAeyB,EAAMwH,IAAO;AAAA,MAACjJ,OAAAA;AAAAA,IAAAA,CAAY;AAAA,EAAA,CAAI;AAGlD,CAAC;","x_google_ignoreList":[0,1,2,3]}
1
+ {"version":3,"file":"index.js","sources":["../../../../node_modules/.bun/solid-js@1.9.11/node_modules/solid-js/dist/solid.js","../../../../node_modules/.bun/solid-js@1.9.11/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.bun/component-register@0.8.8/node_modules/component-register/dist/component-register.js","../../../../node_modules/.bun/solid-element@1.9.1+2e1854f049906f04/node_modules/solid-element/dist/index.js","../../../signals/src/solid.ts","../../src/ui/context.tsx","../../src/ui/hooks/use-watch-ui.ts","../../src/ui/components/BufferingIndicator.tsx","../../src/ui/components/BufferControl.tsx","../../src/ui/components/FullscreenButton.tsx","../../src/ui/components/PlayPauseButton.tsx","../../src/ui/components/QualitySelector.tsx","../../src/ui/components/StatsButton.tsx","../../src/ui/components/VolumeSlider.tsx","../../src/ui/components/WatchStatusIndicator.tsx","../../src/ui/components/WatchControls.tsx","../../src/ui/element.tsx","../../src/ui/index.tsx"],"sourcesContent":["let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n maxDeadline = 0,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n maxDeadline = currentTime + maxYieldInterval;\n try {\n const hasMoreWork = scheduledCallback(currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxDeadline;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = n + m >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;else if (cmp < 0) n = k - 1;else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && shouldYieldToHost()) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined,\n effects: undefined,\n done: false,\n getContextId() {\n return getContextId(this.context.count);\n },\n getNextContextId() {\n return getContextId(this.context.count++);\n }\n};\nfunction getContextId(count) {\n const num = String(count),\n len = num.length - 1;\n return sharedConfig.context.id + (len ? String.fromCharCode(96 + len) : \"\") + num;\n}\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: sharedConfig.getNextContextId(),\n count: 0\n };\n}\n\nconst IS_DEV = false;\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst SUPPORTS_PROXY = typeof Proxy === \"function\";\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(() => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n }, undefined, false, 0),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if (typeof pFetcher === \"function\") {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n } else {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = sharedConfig.getNextContextId();\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;else if (sharedConfig.load && sharedConfig.has(id)) initP = sharedConfig.load(id);\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, {\n value: v\n }));\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n let error;\n const p = initP !== NO_INIT ? initP : untrack(() => {\n try {\n return fetcher(lookup, {\n value: value(),\n refetching\n });\n } catch (fetcherError) {\n error = fetcherError;\n }\n });\n if (error !== undefined) {\n loadEnd(pr, undefined, castError(error), lookup);\n return;\n } else if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"v\" in p) {\n if (p.s === 1) loadEnd(pr, p.v, undefined, lookup);else loadEnd(pr, undefined, castError(p.v), lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => scheduled = false);\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e), lookup));\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n let owner = Owner;\n if (dynamic) createComputed(() => (owner = Owner, load(false)));else load(false);\n return [read, {\n refetch: info => runWithOwner(owner, () => load(info)),\n mutate: setValue\n }];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(() => {\n if (!t || !t.fn) t = requestCallback(() => setDeferred(() => node.value), timeout !== undefined ? {\n timeout\n } : undefined);\n return source();\n }, undefined, true);\n const [deferred, setDeferred] = createSignal(Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, options);\n updateComputation(node);\n setDeferred(() => Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(p => {\n const v = source();\n for (const [key, val] of subs.entries()) if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);else Effects.push(c);\n }\n }\n return v;\n }, undefined, true, STALE);\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null) ;else if (Owner.cleanups === null) Owner.cleanups = [fn];else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t = Transition || (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => t.resolve = res));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n let value;\n return Owner && Owner.context && (value = Owner.context[context.id]) !== undefined ? value : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const {\n factory: oldFactory,\n untrack: oldUntrack\n } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || !isComp && Transition.sources.has(node)) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (IS_DEV) ;\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null) ;else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n }\n setHydrateContext();\n }\n if (sharedConfig.effects && (sharedConfig.done || !sharedConfig.count)) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;else o.state = PENDING;\n if (o.pure) Updates.push(o);else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n if (Transition && Transition.running && node.pure) {\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, owner && owner.owner || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects) Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(() => res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n }), undefined);\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null) ;else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler = typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer, initalValue = undefined) {\n const [s, set] = createSignal(initalValue, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => \"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub());\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n newLen = newItems.length,\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n }\n else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++);\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, len = newLen);\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [],\n newLen = newItems.length;\n newItems[$TRACK];\n return untrack(() => {\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newLen; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newLen;\n items = newItems.slice(0);\n return mapped = mapped.slice(0, len);\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || !!s && $PROXY in s;\n sources[i] = typeof s === \"function\" ? (proxy = true, createMemo(s)) : s;\n }\n if (SUPPORTS_PROXY && proxy) {\n return new Proxy({\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++) keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n }, propTraps);\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])\n } : desc.value !== undefined ? desc : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n const len = keys.length;\n if (SUPPORTS_PROXY && $PROXY in props) {\n const blocked = len > 1 ? keys.flat() : keys[0];\n const res = keys.map(k => {\n return new Proxy({\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n }, propTraps);\n });\n res.push(new Proxy({\n get(property) {\n return blocked.includes(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.includes(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.includes(k));\n }\n }, propTraps));\n return res;\n }\n const objects = [];\n for (let i = 0; i <= len; i++) {\n objects[i] = {};\n }\n for (const propName of Object.getOwnPropertyNames(props)) {\n let keyIndex = len;\n for (let i = 0; i < keys.length; i++) {\n if (keys[i].includes(propName)) {\n keyIndex = i;\n break;\n }\n }\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n isDefaultDesc ? objects[keyIndex][propName] = desc.value : Object.defineProperty(objects[keyIndex], propName, desc);\n }\n return objects;\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n !sharedConfig.done && setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(() => (Comp = comp()) ? untrack(() => {\n if (IS_DEV) ;\n if (!ctx || sharedConfig.done) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n }) : \"\");\n };\n wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? sharedConfig.getNextContextId() : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const conditionValue = createMemo(() => props.when, undefined, undefined);\n const condition = keyed ? conditionValue : createMemo(conditionValue, undefined, {\n equals: (a, b) => !a === !b\n });\n return createMemo(() => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn ? untrack(() => child(keyed ? c : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return conditionValue();\n })) : child;\n }\n return props.fallback;\n }, undefined, undefined);\n}\nfunction Switch(props) {\n const chs = children(() => props.children);\n const switchFunc = createMemo(() => {\n const ch = chs();\n const mps = Array.isArray(ch) ? ch : [ch];\n let func = () => undefined;\n for (let i = 0; i < mps.length; i++) {\n const index = i;\n const mp = mps[i];\n const prevFunc = func;\n const conditionValue = createMemo(() => prevFunc() ? undefined : mp.when, undefined, undefined);\n const condition = mp.keyed ? conditionValue : createMemo(conditionValue, undefined, {\n equals: (a, b) => !a === !b\n });\n func = () => prevFunc() || (condition() ? [index, conditionValue, mp] : undefined);\n }\n return func;\n });\n return createMemo(() => {\n const sel = switchFunc()();\n if (!sel) return props.fallback;\n const [index, conditionValue, mp] = sel;\n const child = mp.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn ? untrack(() => child(mp.keyed ? conditionValue() : () => {\n if (untrack(switchFunc)()?.[0] !== index) throw narrowedError(\"Match\");\n return conditionValue();\n })) : child;\n }, undefined, undefined);\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load) err = sharedConfig.load(sharedConfig.getContextId());\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(() => {\n let e;\n if (e = errored()) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n }, undefined, undefined);\n}\n\nconst suspenseListEquals = (a, b) => a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = /* #__PURE__ */createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n {\n showContent = true,\n showFallback = true\n } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || next && tail === \"collapsed\" ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n }, {\n inFallback: false\n });\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.getContextId();\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.s !== 1) p = ref;else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(() => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n }, err => {\n error = err;\n set();\n });\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return flicker = undefined;\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n {\n showContent = true,\n showFallback = true\n } = show ? show() : {};\n if ((!inFallback || p && p !== \"$$f\") && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"F\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport { $DEVCOMP, $PROXY, $TRACK, DEV, ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, batch, cancelCallback, catchError, children, createComponent, createComputed, createContext, createDeferred, createEffect, createMemo, createReaction, createRenderEffect, createResource, createRoot, createSelector, createSignal, createUniqueId, enableExternalSource, enableHydration, enableScheduling, equalFn, from, getListener, getOwner, indexArray, lazy, mapArray, mergeProps, observable, on, onCleanup, onError, onMount, requestCallback, resetErrorBoundaries, runWithOwner, sharedConfig, splitProps, startTransition, untrack, useContext, useTransition };\n","import { createMemo, createRoot, createRenderEffect, untrack, sharedConfig, enableHydration, getOwner, createEffect, runWithOwner, createSignal, onCleanup, splitProps } from 'solid-js';\nexport { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps, untrack } from 'solid-js';\n\nconst booleans = [\"allowfullscreen\", \"async\", \"alpha\",\n\"autofocus\",\n\"autoplay\", \"checked\", \"controls\", \"default\", \"disabled\", \"formnovalidate\", \"hidden\",\n\"indeterminate\", \"inert\",\n\"ismap\", \"loop\", \"multiple\", \"muted\", \"nomodule\", \"novalidate\", \"open\", \"playsinline\", \"readonly\", \"required\", \"reversed\", \"seamless\",\n\"selected\", \"adauctionheaders\",\n\"browsingtopics\",\n\"credentialless\",\n\"defaultchecked\", \"defaultmuted\", \"defaultselected\", \"defer\", \"disablepictureinpicture\", \"disableremoteplayback\", \"preservespitch\",\n\"shadowrootclonable\", \"shadowrootcustomelementregistry\",\n\"shadowrootdelegatesfocus\", \"shadowrootserializable\",\n\"sharedstoragewritable\"\n];\nconst Properties = /*#__PURE__*/new Set([\n\"className\", \"value\",\n\"readOnly\", \"noValidate\", \"formNoValidate\", \"isMap\", \"noModule\", \"playsInline\", \"adAuctionHeaders\",\n\"allowFullscreen\", \"browsingTopics\",\n\"defaultChecked\", \"defaultMuted\", \"defaultSelected\", \"disablePictureInPicture\", \"disableRemotePlayback\", \"preservesPitch\", \"shadowRootClonable\", \"shadowRootCustomElementRegistry\",\n\"shadowRootDelegatesFocus\", \"shadowRootSerializable\",\n\"sharedStorageWritable\",\n...booleans]);\nconst ChildProperties = /*#__PURE__*/new Set([\"innerHTML\", \"textContent\", \"innerText\", \"children\"]);\nconst Aliases = /*#__PURE__*/Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/Object.assign(Object.create(null), {\n class: \"className\",\n novalidate: {\n $: \"noValidate\",\n FORM: 1\n },\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n },\n adauctionheaders: {\n $: \"adAuctionHeaders\",\n IFRAME: 1\n },\n allowfullscreen: {\n $: \"allowFullscreen\",\n IFRAME: 1\n },\n browsingtopics: {\n $: \"browsingTopics\",\n IMG: 1\n },\n defaultchecked: {\n $: \"defaultChecked\",\n INPUT: 1\n },\n defaultmuted: {\n $: \"defaultMuted\",\n AUDIO: 1,\n VIDEO: 1\n },\n defaultselected: {\n $: \"defaultSelected\",\n OPTION: 1\n },\n disablepictureinpicture: {\n $: \"disablePictureInPicture\",\n VIDEO: 1\n },\n disableremoteplayback: {\n $: \"disableRemotePlayback\",\n AUDIO: 1,\n VIDEO: 1\n },\n preservespitch: {\n $: \"preservesPitch\",\n AUDIO: 1,\n VIDEO: 1\n },\n shadowrootclonable: {\n $: \"shadowRootClonable\",\n TEMPLATE: 1\n },\n shadowrootdelegatesfocus: {\n $: \"shadowRootDelegatesFocus\",\n TEMPLATE: 1\n },\n shadowrootserializable: {\n $: \"shadowRootSerializable\",\n TEMPLATE: 1\n },\n sharedstoragewritable: {\n $: \"sharedStorageWritable\",\n IFRAME: 1,\n IMG: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? a[tagName] ? a[\"$\"] : undefined : a;\n}\nconst DelegatedEvents = /*#__PURE__*/new Set([\"beforeinput\", \"click\", \"dblclick\", \"contextmenu\", \"focusin\", \"focusout\", \"input\", \"keydown\", \"keyup\", \"mousedown\", \"mousemove\", \"mouseout\", \"mouseover\", \"mouseup\", \"pointerdown\", \"pointermove\", \"pointerout\", \"pointerover\", \"pointerup\", \"touchend\", \"touchmove\", \"touchstart\"]);\nconst SVGElements = /*#__PURE__*/new Set([\n\"altGlyph\", \"altGlyphDef\", \"altGlyphItem\", \"animate\", \"animateColor\", \"animateMotion\", \"animateTransform\", \"circle\", \"clipPath\", \"color-profile\", \"cursor\", \"defs\", \"desc\", \"ellipse\", \"feBlend\", \"feColorMatrix\", \"feComponentTransfer\", \"feComposite\", \"feConvolveMatrix\", \"feDiffuseLighting\", \"feDisplacementMap\", \"feDistantLight\", \"feDropShadow\", \"feFlood\", \"feFuncA\", \"feFuncB\", \"feFuncG\", \"feFuncR\", \"feGaussianBlur\", \"feImage\", \"feMerge\", \"feMergeNode\", \"feMorphology\", \"feOffset\", \"fePointLight\", \"feSpecularLighting\", \"feSpotLight\", \"feTile\", \"feTurbulence\", \"filter\", \"font\", \"font-face\", \"font-face-format\", \"font-face-name\", \"font-face-src\", \"font-face-uri\", \"foreignObject\", \"g\", \"glyph\", \"glyphRef\", \"hkern\", \"image\", \"line\", \"linearGradient\", \"marker\", \"mask\", \"metadata\", \"missing-glyph\", \"mpath\", \"path\", \"pattern\", \"polygon\", \"polyline\", \"radialGradient\", \"rect\",\n\"set\", \"stop\",\n\"svg\", \"switch\", \"symbol\", \"text\", \"textPath\",\n\"tref\", \"tspan\", \"use\", \"view\", \"vkern\"]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/new Set([\"html\", \"base\", \"head\", \"link\", \"meta\", \"style\", \"title\", \"body\", \"address\", \"article\", \"aside\", \"footer\", \"header\", \"main\", \"nav\", \"section\", \"body\", \"blockquote\", \"dd\", \"div\", \"dl\", \"dt\", \"figcaption\", \"figure\", \"hr\", \"li\", \"ol\", \"p\", \"pre\", \"ul\", \"a\", \"abbr\", \"b\", \"bdi\", \"bdo\", \"br\", \"cite\", \"code\", \"data\", \"dfn\", \"em\", \"i\", \"kbd\", \"mark\", \"q\", \"rp\", \"rt\", \"ruby\", \"s\", \"samp\", \"small\", \"span\", \"strong\", \"sub\", \"sup\", \"time\", \"u\", \"var\", \"wbr\", \"area\", \"audio\", \"img\", \"map\", \"track\", \"video\", \"embed\", \"iframe\", \"object\", \"param\", \"picture\", \"portal\", \"source\", \"svg\", \"math\", \"canvas\", \"noscript\", \"script\", \"del\", \"ins\", \"caption\", \"col\", \"colgroup\", \"table\", \"tbody\", \"td\", \"tfoot\", \"th\", \"thead\", \"tr\", \"button\", \"datalist\", \"fieldset\", \"form\", \"input\", \"label\", \"legend\", \"meter\", \"optgroup\", \"option\", \"output\", \"progress\", \"select\", \"textarea\", \"details\", \"dialog\", \"menu\", \"summary\", \"details\", \"slot\", \"template\", \"acronym\", \"applet\", \"basefont\", \"bgsound\", \"big\", \"blink\", \"center\", \"content\", \"dir\", \"font\", \"frame\", \"frameset\", \"hgroup\", \"image\", \"keygen\", \"marquee\", \"menuitem\", \"nobr\", \"noembed\", \"noframes\", \"plaintext\", \"rb\", \"rtc\", \"shadow\", \"spacer\", \"strike\", \"tt\", \"xmp\", \"a\", \"abbr\", \"acronym\", \"address\", \"applet\", \"area\", \"article\", \"aside\", \"audio\", \"b\", \"base\", \"basefont\", \"bdi\", \"bdo\", \"bgsound\", \"big\", \"blink\", \"blockquote\", \"body\", \"br\", \"button\", \"canvas\", \"caption\", \"center\", \"cite\", \"code\", \"col\", \"colgroup\", \"content\", \"data\", \"datalist\", \"dd\", \"del\", \"details\", \"dfn\", \"dialog\", \"dir\", \"div\", \"dl\", \"dt\", \"em\", \"embed\", \"fieldset\", \"figcaption\", \"figure\", \"font\", \"footer\", \"form\", \"frame\", \"frameset\", \"head\", \"header\", \"hgroup\", \"hr\", \"html\", \"i\", \"iframe\", \"image\", \"img\", \"input\", \"ins\", \"kbd\", \"keygen\", \"label\", \"legend\", \"li\", \"link\", \"main\", \"map\", \"mark\", \"marquee\", \"menu\", \"menuitem\", \"meta\", \"meter\", \"nav\", \"nobr\", \"noembed\", \"noframes\", \"noscript\", \"object\", \"ol\", \"optgroup\", \"option\", \"output\", \"p\", \"param\", \"picture\", \"plaintext\", \"portal\", \"pre\", \"progress\", \"q\", \"rb\", \"rp\", \"rt\", \"rtc\", \"ruby\", \"s\", \"samp\", \"script\", \"section\", \"select\", \"shadow\", \"slot\", \"small\", \"source\", \"spacer\", \"span\", \"strike\", \"strong\", \"style\", \"sub\", \"summary\", \"sup\", \"table\", \"tbody\", \"td\", \"template\", \"textarea\", \"tfoot\", \"th\", \"thead\", \"time\", \"title\", \"tr\", \"track\", \"tt\", \"u\", \"ul\", \"var\", \"video\", \"wbr\", \"xmp\", \"input\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\",\n\"webview\",\n\"isindex\", \"listing\", \"multicol\", \"nextid\", \"noindex\", \"search\"]);\n\nconst memo = fn => createMemo(() => fn());\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document ? code() : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isImportNode, isSVG, isMathML) {\n let node;\n const create = () => {\n const t = isMathML ? document.createElementNS(\"http://www.w3.org/1998/Math/MathML\", \"template\") : document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;\n };\n const fn = isImportNode ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (isHydrating(node)) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (isHydrating(node)) return;\n if (value == null) node.removeAttribute(name);else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (isHydrating(node)) return;\n if (value == null) node.removeAttributeNS(namespace, name);else node.setAttributeNS(namespace, name, value);\n}\nfunction setBoolAttribute(node, name, value) {\n if (isHydrating(node)) return;\n value ? node.setAttribute(name, \"\") : node.removeAttribute(name);\n}\nfunction className(node, value) {\n if (isHydrating(node)) return;\n if (value == null) node.removeAttribute(\"class\");else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));\n } else node.addEventListener(name, handler, typeof handler !== \"function\" && handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return nodeStyle.cssText = value;\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction setStyleProperty(node, name, value) {\n value != null ? node.style.setProperty(name, value) : node.style.removeProperty(name);\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));\n }\n createRenderEffect(() => typeof props.ref === \"function\" && use(props.ref, node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef, props);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef, props);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n if (globalThis._$HY.done) return render(code, element, [...element.childNodes], options);\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n try {\n gatherHydratable(element, options.renderId);\n return render(code, element, [...element.childNodes], options);\n } finally {\n sharedConfig.context = null;\n }\n}\nfunction getNextElement(template) {\n let node,\n key,\n hydrating = isHydrating();\n if (!hydrating || !(node = sharedConfig.registry.get(key = getHydrationKey()))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (isHydrating(start)) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const {\n completed,\n events\n } = sharedConfig;\n if (!events) return;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n events.shift();\n eventHandler(e);\n }\n if (sharedConfig.done) {\n sharedConfig.events = _$HY.events = null;\n sharedConfig.completed = _$HY.completed = null;\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction isHydrating(node) {\n return !!sharedConfig.context && !sharedConfig.done && (!node || node.isConnected);\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef, props) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev, typeof prev !== \"function\" && prev);\n value && node.addEventListener(e, value, typeof value !== \"function\" && value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (prop.slice(0, 5) === \"bool:\") {\n setBoolAttribute(node, prop.slice(5), value);\n } else if ((forceProp = prop.slice(0, 5) === \"prop:\") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes(\"-\") || \"is\" in props)) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (isHydrating(node)) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n if (sharedConfig.registry && sharedConfig.events) {\n if (sharedConfig.events.find(([el, ev]) => ev === e)) return;\n }\n let node = e.target;\n const key = `$$${e.type}`;\n const oriTarget = e.target;\n const oriCurrentTarget = e.currentTarget;\n const retarget = value => Object.defineProperty(e, \"target\", {\n configurable: true,\n value\n });\n const handleNode = () => {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node.host && typeof node.host !== \"string\" && !node.host._$host && node.contains(e.target) && retarget(node.host);\n return true;\n };\n const walkUpTree = () => {\n while (handleNode() && (node = node._$host || node.parentNode || node.host));\n };\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n if (e.composedPath) {\n const path = e.composedPath();\n retarget(path[0]);\n for (let i = 0; i < path.length - 2; i++) {\n node = path[i];\n if (!handleNode()) break;\n if (node._$host) {\n node = node._$host;\n walkUpTree();\n break;\n }\n if (node.parentNode === oriCurrentTarget) {\n break;\n }\n }\n }\n else walkUpTree();\n retarget(oriTarget);\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = isHydrating(parent);\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = multi && current[0] && current[0].parentNode || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") {\n value = value.toString();\n if (value === current) return current;\n }\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return current = [...parent.childNodes];\n let node = array[0];\n if (node.parentNode !== parent) return current;\n const nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return current = nodes;\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return current = multi ? [value] : value;\n if (Array.isArray(current)) {\n if (multi) return current = cleanChildren(parent, current, marker, value);\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else ;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false) ; else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return parent.textContent = \"\";\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key)) sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n return sharedConfig.getNextContextId();\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false, is = undefined) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName, {\n is\n });\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const {\n useShadow\n } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(() => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => !clean() ? content() : dispose(), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot = useShadow && container.attachShadow ? container.attachShadow({\n mode: \"open\"\n }) : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n }, undefined, {\n render: !hydrating\n });\n return marker;\n}\nfunction createDynamic(component, props) {\n const cached = createMemo(component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(props));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg, untrack(() => props.is));\n spread(el, props, isSvg);\n return el;\n }\n });\n}\nfunction Dynamic(props) {\n const [, others] = splitProps(props, [\"component\"]);\n return createDynamic(() => props.component, others);\n}\n\nexport { Aliases, voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Hydration, voidFn as HydrationScript, NoHydration, Portal, Properties, RequestContext, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, createDynamic, delegateEvents, dynamicProperty, escape, voidFn as generateHydrationScript, voidFn as getAssets, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getPropAlias, voidFn as getRequestEvent, hydrate, innerHTML, insert, isDev, isServer, memo, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, setBoolAttribute, setProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, style, template, use, voidFn as useAssets };\n","function cloneProps(props) {\n const propKeys = Object.keys(props);\n return propKeys.reduce((memo, k) => {\n const prop = props[k];\n memo[k] = Object.assign({}, prop);\n if (isObject(prop.value) && !isFunction(prop.value) && !Array.isArray(prop.value)) memo[k].value = Object.assign({}, prop.value);\n if (Array.isArray(prop.value)) memo[k].value = prop.value.slice(0);\n return memo;\n }, {});\n}\nfunction normalizePropDefs(props) {\n if (!props) return {};\n const propKeys = Object.keys(props);\n return propKeys.reduce((memo, k) => {\n const v = props[k];\n memo[k] = !(isObject(v) && \"value\" in v) ? {\n value: v\n } : v;\n memo[k].attribute || (memo[k].attribute = toAttribute(k));\n memo[k].parse = \"parse\" in memo[k] ? memo[k].parse : typeof memo[k].value !== \"string\";\n return memo;\n }, {});\n}\nfunction propValues(props) {\n const propKeys = Object.keys(props);\n return propKeys.reduce((memo, k) => {\n memo[k] = props[k].value;\n return memo;\n }, {});\n}\nfunction initializeProps(element, propDefinition) {\n const props = cloneProps(propDefinition),\n propKeys = Object.keys(propDefinition);\n propKeys.forEach(key => {\n const prop = props[key],\n attr = element.getAttribute(prop.attribute),\n value = element[key];\n if (attr != null) prop.value = prop.parse ? parseAttributeValue(attr) : attr;\n if (value != null) prop.value = Array.isArray(value) ? value.slice(0) : value;\n prop.reflect && reflect(element, prop.attribute, prop.value, !!prop.parse);\n Object.defineProperty(element, key, {\n get() {\n return prop.value;\n },\n set(val) {\n const oldValue = prop.value;\n prop.value = val;\n prop.reflect && reflect(this, prop.attribute, prop.value, !!prop.parse);\n for (let i = 0, l = this.__propertyChangedCallbacks.length; i < l; i++) {\n this.__propertyChangedCallbacks[i](key, val, oldValue);\n }\n },\n enumerable: true,\n configurable: true\n });\n });\n return props;\n}\nfunction parseAttributeValue(value) {\n if (!value) return;\n try {\n return JSON.parse(value);\n } catch (err) {\n return value;\n }\n}\nfunction reflect(node, attribute, value, parse) {\n if (value == null || value === false) return node.removeAttribute(attribute);\n let reflect = parse ? JSON.stringify(value) : value;\n node.__updating[attribute] = true;\n if (reflect === \"true\") reflect = \"\";\n node.setAttribute(attribute, reflect);\n Promise.resolve().then(() => delete node.__updating[attribute]);\n}\nfunction toAttribute(propName) {\n return propName.replace(/\\.?([A-Z]+)/g, (x, y) => \"-\" + y.toLowerCase()).replace(\"_\", \"-\").replace(/^-/, \"\");\n}\nfunction toProperty(attr) {\n return attr.toLowerCase().replace(/(-)([a-z])/g, test => test.toUpperCase().replace(\"-\", \"\"));\n}\nfunction isObject(obj) {\n return obj != null && (typeof obj === \"object\" || typeof obj === \"function\");\n}\nfunction isFunction(val) {\n return Object.prototype.toString.call(val) === \"[object Function]\";\n}\nfunction isConstructor(f) {\n return typeof f === \"function\" && f.toString().indexOf(\"class\") === 0;\n}\nfunction reloadElement(node) {\n let callback = null;\n while (callback = node.__releaseCallbacks.pop()) callback(node);\n delete node.__initialized;\n node.renderRoot.textContent = \"\";\n node.connectedCallback();\n}\n\nlet currentElement;\nfunction getCurrentElement() {\n return currentElement;\n}\nfunction noShadowDOM() {\n Object.defineProperty(currentElement, \"renderRoot\", {\n value: currentElement\n });\n}\nfunction createElementType(BaseElement, propDefinition) {\n const propKeys = Object.keys(propDefinition);\n return class CustomElement extends BaseElement {\n static get observedAttributes() {\n return propKeys.map(k => propDefinition[k].attribute);\n }\n constructor() {\n super();\n this.__initialized = false;\n this.__released = false;\n this.__releaseCallbacks = [];\n this.__propertyChangedCallbacks = [];\n this.__updating = {};\n this.props = {};\n for (let propKey of propKeys) {\n this[propKey] = undefined;\n }\n }\n connectedCallback() {\n if (this.__initialized) return;\n this.__releaseCallbacks = [];\n this.__propertyChangedCallbacks = [];\n this.__updating = {};\n this.props = initializeProps(this, propDefinition);\n const props = propValues(this.props),\n ComponentType = this.Component,\n outerElement = currentElement;\n try {\n currentElement = this;\n this.__initialized = true;\n if (isConstructor(ComponentType)) new ComponentType(props, {\n element: this\n });else ComponentType(props, {\n element: this\n });\n } finally {\n currentElement = outerElement;\n }\n }\n async disconnectedCallback() {\n // prevent premature releasing when element is only temporarely removed from DOM\n await Promise.resolve();\n if (this.isConnected) return;\n this.__propertyChangedCallbacks.length = 0;\n let callback = null;\n while (callback = this.__releaseCallbacks.pop()) callback(this);\n delete this.__initialized;\n this.__released = true;\n }\n attributeChangedCallback(name, oldVal, newVal) {\n if (!this.__initialized) return;\n if (this.__updating[name]) return;\n name = this.lookupProp(name);\n if (name in propDefinition) {\n if (newVal == null && !this[name]) return;\n this[name] = propDefinition[name].parse ? parseAttributeValue(newVal) : newVal;\n }\n }\n lookupProp(attrName) {\n if (!propDefinition) return;\n return propKeys.find(k => attrName === k || attrName === propDefinition[k].attribute);\n }\n get renderRoot() {\n return this.shadowRoot || this.attachShadow({\n mode: \"open\"\n });\n }\n addReleaseCallback(fn) {\n this.__releaseCallbacks.push(fn);\n }\n addPropertyChangedCallback(fn) {\n this.__propertyChangedCallbacks.push(fn);\n }\n };\n}\n\nfunction createMixin(mixinFn) {\n return ComponentType => (props, options) => {\n options = mixinFn(options);\n if (isConstructor(ComponentType)) return new ComponentType(props, options);\n return ComponentType(props, options);\n };\n}\nfunction compose(...fns) {\n if (fns.length === 0) return i => i;\n if (fns.length === 1) return fns[0];\n return fns.reduce((a, b) => (...args) => a(b(...args)));\n}\n\nconst EC = Symbol('element-context');\nfunction lookupContext(element, context) {\n return element[EC] && element[EC][context.id] || (element.host || element.parentNode) && lookupContext(element.host || element.parentNode, context);\n}\nfunction createContext(initFn) {\n return {\n id: Symbol('context'),\n initFn\n };\n}\n\n// Direct\nfunction provide(context, value, element = getCurrentElement()) {\n element[EC] || (element[EC] = {});\n return element[EC][context.id] = context.initFn ? context.initFn(value) : value;\n}\nfunction consume(context, element = getCurrentElement()) {\n return lookupContext(element, context);\n}\n\n// HOCs\nfunction withProvider(context, value) {\n return createMixin(options => {\n const {\n element\n } = options;\n provide(context, value, element);\n return options;\n });\n}\nfunction withConsumer(context, key) {\n return createMixin(options => {\n const {\n element\n } = options;\n options = Object.assign({}, options, {\n [key]: lookupContext(element, context)\n });\n return options;\n });\n}\n\nfunction walk(root, call) {\n call(root);\n if (root.shadowRoot) walk(root.shadowRoot, call);\n let child = root.firstChild;\n while (child) {\n child.nodeType === 1 && walk(child, call);\n child = child.nextSibling;\n }\n}\nfunction hot(module, tagName) {\n if (module.hot) {\n function update(possibleError) {\n if (possibleError && possibleError instanceof Error) {\n console.error(possibleError);\n return;\n }\n walk(document.body, node => node.localName === tagName && setTimeout(() => reloadElement(node), 0));\n }\n\n // handle both Parcel and Webpack style\n module.hot.accept(update);\n if (module.hot.status && module.hot.status() === 'apply') {\n update();\n }\n }\n}\n\nfunction register(tag, props = {}, options = {}) {\n const {\n BaseElement = HTMLElement,\n extension,\n customElements = window.customElements\n } = options;\n return ComponentType => {\n if (!tag) throw new Error(\"tag is required to register a Component\");\n let ElementType = customElements.get(tag);\n if (ElementType) {\n // Consider disabling this in a production mode\n ElementType.prototype.Component = ComponentType;\n return ElementType;\n }\n ElementType = createElementType(BaseElement, normalizePropDefs(props));\n ElementType.prototype.Component = ComponentType;\n ElementType.prototype.registeredTag = tag;\n customElements.define(tag, ElementType, extension);\n return ElementType;\n };\n}\n\nexport { compose, consume, createContext, createMixin, getCurrentElement, hot, isConstructor, isFunction, isObject, noShadowDOM, provide, register, reloadElement, toAttribute, toProperty, withConsumer, withProvider };\n","import { register } from \"component-register\";\nexport { hot, getCurrentElement, noShadowDOM } from \"component-register\";\nimport { createRoot, createSignal } from \"solid-js\";\nimport { insert } from \"solid-js/web\";\nfunction createProps(raw) {\n const keys = Object.keys(raw);\n const props = {};\n for (let i = 0; i < keys.length; i++) {\n const [get, set] = createSignal(raw[keys[i]]);\n Object.defineProperty(props, keys[i], {\n get,\n set(v) {\n set(() => v);\n }\n });\n }\n return props;\n}\nfunction lookupContext(el) {\n if (el.assignedSlot && el.assignedSlot._$owner) return el.assignedSlot._$owner;\n let next = el.parentNode;\n while (next && !next._$owner && !(next.assignedSlot && next.assignedSlot._$owner))\n next = next.parentNode;\n return next && next.assignedSlot ? next.assignedSlot._$owner : el._$owner;\n}\nfunction withSolid(ComponentType) {\n return (rawProps, options) => {\n const { element } = options;\n return createRoot(dispose => {\n const props = createProps(rawProps);\n element.addPropertyChangedCallback((key, val) => (props[key] = val));\n element.addReleaseCallback(() => {\n element.renderRoot.textContent = \"\";\n dispose();\n });\n const comp = ComponentType(props, options);\n return insert(element.renderRoot, comp);\n }, lookupContext(element));\n };\n}\nfunction customElement(tag, props, ComponentType) {\n if (arguments.length === 2) {\n ComponentType = props;\n props = {};\n }\n return register(tag, props)(withSolid(ComponentType));\n}\nexport { withSolid, customElement };\n","import {\n\tcreateSignal,\n\tonCleanup,\n\ttype Accessor as SolidAccessor,\n\ttype Setter as SolidSetter,\n\ttype Signal as SolidSignal,\n} from \"solid-js\";\nimport type { Getter, Signal } from \"./index\";\n\n// A helper to create a Solid accessor from a signal.\nexport function createAccessor<T>(signal: Getter<T>): SolidAccessor<T> {\n\t// Disable the equals check because we do it ourselves.\n\tconst [get, set] = createSignal(signal.peek(), { equals: false });\n\tconst dispose = signal.subscribe((value) => set(() => value));\n\tonCleanup(() => dispose());\n\treturn get;\n}\n\n// A helper to create a Solid setter that writes to a signal.\nexport function createSetter<T>(signal: Signal<T>): SolidSetter<T> {\n\tconst setter = (value: T | ((prev: T) => T)) => {\n\t\tif (typeof value === \"function\") {\n\t\t\tsignal.update(value as (prev: T) => T);\n\t\t} else {\n\t\t\tsignal.set(value);\n\t\t}\n\t\treturn signal.peek();\n\t};\n\treturn setter as SolidSetter<T>;\n}\n\n// A helper to create a Solid [get, set] pair from a signal.\nexport function createPair<T>(signal: Signal<T>): SolidSignal<T> {\n\treturn [createAccessor(signal), createSetter(signal)];\n}\n\n/** @deprecated Use `createAccessor` instead. */\nconst solid = createAccessor;\nexport default solid;\n","import { type Moq, Signals } from \"@moq/hang\";\nimport { createAccessor } from \"@moq/signals/solid\";\nimport type { JSX } from \"solid-js\";\nimport { createContext, createSignal, onCleanup } from \"solid-js\";\nimport type { BufferedRanges } from \"..\";\nimport type MoqWatch from \"../element\";\n\ntype WatchUIContextProviderProps = {\n\tmoqWatch: MoqWatch;\n\tchildren: JSX.Element;\n};\n\nexport type WatchStatus = \"no-url\" | \"disconnected\" | \"connecting\" | \"offline\" | \"loading\" | \"live\" | \"connected\";\n\nexport type Rendition = {\n\tname: string;\n\twidth?: number;\n\theight?: number;\n};\n\nexport type WatchUIContextValues = {\n\tmoqWatch: MoqWatch;\n\twatchStatus: () => WatchStatus;\n\tisPlaying: () => boolean;\n\tisMuted: () => boolean;\n\tsetVolume: (vol: number) => void;\n\tcurrentVolume: () => number;\n\ttogglePlayback: () => void;\n\ttoggleMuted: () => void;\n\tbuffering: () => boolean;\n\tjitter: () => Moq.Time.Milli;\n\tsetJitter: (value: Moq.Time.Milli) => void;\n\tavailableRenditions: () => Rendition[];\n\tactiveRendition: () => string | undefined;\n\tsetActiveRendition: (name: string | undefined) => void;\n\tisStatsPanelVisible: () => boolean;\n\tsetIsStatsPanelVisible: (visible: boolean) => void;\n\tisFullscreen: () => boolean;\n\ttoggleFullscreen: () => void;\n\ttimestamp: () => Moq.Time.Milli | undefined;\n\tvideoBuffered: () => BufferedRanges;\n\taudioBuffered: () => BufferedRanges;\n};\n\nexport const WatchUIContext = createContext<WatchUIContextValues>();\n\nexport default function WatchUIContextProvider(props: WatchUIContextProviderProps) {\n\tconst [watchStatus, setWatchStatus] = createSignal<WatchStatus>(\"no-url\");\n\tconst [isPlaying, setIsPlaying] = createSignal<boolean>(false);\n\tconst isMuted = createAccessor(props.moqWatch.backend.audio.muted);\n\tconst [currentVolume, setCurrentVolume] = createSignal<number>(0);\n\tconst buffering = createAccessor(props.moqWatch.backend.video.stalled);\n\tconst jitter = createAccessor(props.moqWatch.backend.jitter);\n\tconst [availableRenditions, setAvailableRenditions] = createSignal<Rendition[]>([]);\n\tconst activeRendition = createAccessor(props.moqWatch.backend.video.source.track);\n\tconst [isStatsPanelVisible, setIsStatsPanelVisible] = createSignal<boolean>(false);\n\tconst [isFullscreen, setIsFullscreen] = createSignal<boolean>(!!document.fullscreenElement);\n\n\tconst togglePlayback = () => {\n\t\tprops.moqWatch.paused = !props.moqWatch.paused;\n\t};\n\n\tconst toggleFullscreen = () => {\n\t\tif (document.fullscreenElement) {\n\t\t\tdocument.exitFullscreen();\n\t\t} else {\n\t\t\tprops.moqWatch.requestFullscreen();\n\t\t}\n\t};\n\n\tconst setVolume = (volume: number) => {\n\t\tprops.moqWatch.backend.audio.volume.set(volume / 100);\n\t};\n\n\tconst toggleMuted = () => {\n\t\tprops.moqWatch.backend.audio.muted.update((muted) => !muted);\n\t};\n\n\tconst setJitter = (latency: Moq.Time.Milli) => {\n\t\tprops.moqWatch.jitter = latency;\n\t};\n\n\tconst setActiveRenditionValue = (name: string | undefined) => {\n\t\tprops.moqWatch.backend.video.source.target.update((prev) => ({\n\t\t\t...prev,\n\t\t\tname: name,\n\t\t}));\n\t};\n\n\tconst timestamp = createAccessor(props.moqWatch.backend.video.timestamp);\n\tconst videoBuffered = createAccessor(props.moqWatch.backend.video.buffered);\n\tconst audioBuffered = createAccessor(props.moqWatch.backend.audio.buffered);\n\n\tconst value: WatchUIContextValues = {\n\t\tmoqWatch: props.moqWatch,\n\t\twatchStatus,\n\t\ttogglePlayback,\n\t\tisPlaying,\n\t\tsetVolume,\n\t\tisMuted,\n\t\tcurrentVolume,\n\t\ttoggleMuted,\n\t\tbuffering,\n\t\tjitter,\n\t\tsetJitter,\n\t\tavailableRenditions,\n\t\tactiveRendition,\n\t\tsetActiveRendition: setActiveRenditionValue,\n\t\tisStatsPanelVisible,\n\t\tsetIsStatsPanelVisible,\n\t\tisFullscreen,\n\t\ttoggleFullscreen,\n\t\ttimestamp,\n\t\tvideoBuffered,\n\t\taudioBuffered,\n\t};\n\n\tconst watch = props.moqWatch;\n\tconst signals = new Signals.Effect();\n\n\tsignals.run((effect) => {\n\t\tconst url = effect.get(watch.connection.url);\n\t\tconst connection = effect.get(watch.connection.status);\n\t\tconst broadcast = effect.get(watch.broadcast.status);\n\n\t\tif (!url) {\n\t\t\tsetWatchStatus(\"no-url\");\n\t\t} else if (connection === \"disconnected\") {\n\t\t\tsetWatchStatus(\"disconnected\");\n\t\t} else if (connection === \"connecting\") {\n\t\t\tsetWatchStatus(\"connecting\");\n\t\t} else if (broadcast === \"offline\") {\n\t\t\tsetWatchStatus(\"offline\");\n\t\t} else if (broadcast === \"loading\") {\n\t\t\tsetWatchStatus(\"loading\");\n\t\t} else if (broadcast === \"live\") {\n\t\t\tsetWatchStatus(\"live\");\n\t\t} else if (connection === \"connected\") {\n\t\t\tsetWatchStatus(\"connected\");\n\t\t}\n\t});\n\n\tsignals.run((effect) => {\n\t\tconst paused = effect.get(watch.backend.paused);\n\t\tsetIsPlaying(!paused);\n\t});\n\n\tsignals.run((effect) => {\n\t\tconst volume = effect.get(watch.backend.audio.volume);\n\t\tsetCurrentVolume(volume * 100);\n\t});\n\n\tsignals.run((effect) => {\n\t\tconst videoCatalog = effect.get(watch.backend.video.source.catalog);\n\t\tconst renditions = videoCatalog?.renditions ?? {};\n\n\t\tconst renditionsList: Rendition[] = Object.entries(renditions).map(([name, config]) => ({\n\t\t\tname,\n\t\t\twidth: config.codedWidth,\n\t\t\theight: config.codedHeight,\n\t\t}));\n\n\t\tsetAvailableRenditions(renditionsList);\n\t});\n\n\tconst handleFullscreenChange = () => {\n\t\tsetIsFullscreen(!!document.fullscreenElement);\n\t};\n\n\tsignals.event(document, \"fullscreenchange\", handleFullscreenChange);\n\tonCleanup(() => signals.close());\n\n\treturn <WatchUIContext.Provider value={value}>{props.children}</WatchUIContext.Provider>;\n}\n","import { useContext } from \"solid-js\";\nimport { WatchUIContext, type WatchUIContextValues } from \"../context\";\n\nexport default function useWatchUIContext(): WatchUIContextValues {\n\tconst context = useContext(WatchUIContext);\n\n\tif (!context) {\n\t\tthrow new Error(\"useWatchUIContext must be used within a WatchUIContextProvider\");\n\t}\n\n\treturn context;\n}\n","import { Show } from \"solid-js\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\nexport default function BufferingIndicator() {\n\tconst context = useWatchUIContext();\n\n\treturn (\n\t\t<Show when={context.buffering()}>\n\t\t\t<div class=\"watch-ui__buffering flex--center\">\n\t\t\t\t<div class=\"watch-ui__buffering-spinner\" />\n\t\t\t</div>\n\t\t</Show>\n\t);\n}\n","import { Moq } from \"@moq/hang\";\nimport { createMemo, createSignal, For, onCleanup, Show } from \"solid-js\";\nimport type { BufferedRange } from \"../..\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\nconst MIN_RANGE = 0 as Moq.Time.Milli;\nconst RANGE_STEP = 100 as Moq.Time.Milli;\n\ntype BufferControlProps = {\n\t/** Maximum buffer range in milliseconds (default: 5000ms = 5s) */\n\tmax?: Moq.Time.Milli;\n};\n\nexport default function BufferControl(props: BufferControlProps) {\n\tconst context = useWatchUIContext();\n\tconst maxRange = (): Moq.Time.Milli => props.max ?? (5000 as Moq.Time.Milli);\n\tconst [isDragging, setIsDragging] = createSignal(false);\n\n\t// Compute range style and overflow info relative to current timestamp\n\tconst computeRange = (range: BufferedRange, timestamp: Moq.Time.Milli, color: string) => {\n\t\tconst startMs = (range.start - timestamp) as Moq.Time.Milli;\n\t\tconst endMs = (range.end - timestamp) as Moq.Time.Milli;\n\t\tconst visibleStartMs = Math.max(0, startMs) as Moq.Time.Milli;\n\t\tconst visibleEndMs = Math.min(endMs, maxRange()) as Moq.Time.Milli;\n\t\tconst leftPct = (visibleStartMs / maxRange()) * 100;\n\t\tconst widthPct = Math.max(0.5, ((visibleEndMs - visibleStartMs) / maxRange()) * 100);\n\t\tconst isOverflow = endMs > maxRange();\n\t\tconst overflowSec = isOverflow\n\t\t\t? Moq.Time.Milli.toSecond((endMs - visibleStartMs) as Moq.Time.Milli).toFixed(1)\n\t\t\t: null;\n\t\treturn {\n\t\t\tstyle: `left: ${leftPct}%; width: ${widthPct}%; background: ${color};`,\n\t\t\tisOverflow,\n\t\t\toverflowSec,\n\t\t};\n\t};\n\n\t// Determine color based on gap detection and buffering state\n\tconst rangeColor = (index: number, isBuffering: boolean) => {\n\t\tif (isBuffering) return \"#f87171\"; // red\n\t\tif (index > 0) return \"#facc15\"; // yellow\n\t\treturn \"#4ade80\"; // green\n\t};\n\n\tconst bufferTargetPct = createMemo(() => (context.jitter() / maxRange()) * 100);\n\n\t// Handle mouse interaction to set buffer via clicking/dragging on the visualization\n\tlet containerRef: HTMLDivElement | undefined;\n\n\tconst LABEL_WIDTH = 48; // px reserved for track labels\n\n\tconst updateBufferFromMouseX = (clientX: number) => {\n\t\tif (!containerRef) return;\n\t\tconst rect = containerRef.getBoundingClientRect();\n\t\tconst trackWidth = rect.width - LABEL_WIDTH;\n\t\tconst x = Math.max(0, Math.min(clientX - rect.left - LABEL_WIDTH, trackWidth));\n\t\tconst ms = (x / trackWidth) * maxRange();\n\t\tconst snapped = (Math.round(ms / RANGE_STEP) * RANGE_STEP) as Moq.Time.Milli;\n\t\tconst clamped = Math.max(MIN_RANGE, Math.min(maxRange(), snapped)) as Moq.Time.Milli;\n\t\tcontext.setJitter(clamped);\n\t};\n\n\tconst onMouseDown = (e: MouseEvent) => {\n\t\tsetIsDragging(true);\n\t\tupdateBufferFromMouseX(e.clientX);\n\t\tdocument.addEventListener(\"mousemove\", onMouseMove);\n\t\tdocument.addEventListener(\"mouseup\", onMouseUp);\n\t};\n\n\tconst onMouseMove = (e: MouseEvent) => {\n\t\tif (isDragging()) {\n\t\t\tupdateBufferFromMouseX(e.clientX);\n\t\t}\n\t};\n\n\tconst onMouseUp = () => {\n\t\tsetIsDragging(false);\n\t\tdocument.removeEventListener(\"mousemove\", onMouseMove);\n\t\tdocument.removeEventListener(\"mouseup\", onMouseUp);\n\t};\n\n\t// Cleanup listeners on unmount\n\tonCleanup(() => {\n\t\tdocument.removeEventListener(\"mousemove\", onMouseMove);\n\t\tdocument.removeEventListener(\"mouseup\", onMouseUp);\n\t});\n\n\treturn (\n\t\t<div class=\"watch-ui__buffer\">\n\t\t\t{/* Buffer Visualization - interactive, click/drag to set buffer */}\n\t\t\t<div\n\t\t\t\tclass={`watch-ui__buffer-visualization ${isDragging() ? \"watch-ui__buffer-visualization--dragging\" : \"\"}`}\n\t\t\t\tref={containerRef}\n\t\t\t\tonMouseDown={onMouseDown}\n\t\t\t\trole=\"slider\"\n\t\t\t\ttabIndex={0}\n\t\t\t\taria-valuenow={context.jitter()}\n\t\t\t\taria-valuemin={MIN_RANGE}\n\t\t\t\taria-valuemax={maxRange()}\n\t\t\t\taria-label=\"Buffer jitter\"\n\t\t\t>\n\t\t\t\t{/* Playhead (left edge = current time) */}\n\t\t\t\t<div class=\"watch-ui__buffer-playhead\" />\n\n\t\t\t\t{/* Video buffer track */}\n\t\t\t\t<div class=\"watch-ui__buffer-track watch-ui__buffer-track--video\">\n\t\t\t\t\t<span class=\"watch-ui__buffer-track-label\">Video</span>\n\t\t\t\t\t<For each={context.videoBuffered()}>\n\t\t\t\t\t\t{(range, i) => {\n\t\t\t\t\t\t\tconst info = () => {\n\t\t\t\t\t\t\t\tconst timestamp = context.timestamp();\n\t\t\t\t\t\t\t\tif (timestamp === undefined) return null;\n\t\t\t\t\t\t\t\treturn computeRange(range, timestamp, rangeColor(i(), context.buffering()));\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Show when={info()}>\n\t\t\t\t\t\t\t\t\t{(rangeInfo) => (\n\t\t\t\t\t\t\t\t\t\t<div class=\"watch-ui__buffer-range\" style={rangeInfo().style}>\n\t\t\t\t\t\t\t\t\t\t\t<Show when={rangeInfo().isOverflow}>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"watch-ui__buffer-overflow-label\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{rangeInfo().overflowSec}s\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t</Show>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Show>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}}\n\t\t\t\t\t</For>\n\t\t\t\t</div>\n\n\t\t\t\t{/* Audio buffer track */}\n\t\t\t\t<div class=\"watch-ui__buffer-track watch-ui__buffer-track--audio\">\n\t\t\t\t\t<span class=\"watch-ui__buffer-track-label\">Audio</span>\n\t\t\t\t\t<For each={context.audioBuffered()}>\n\t\t\t\t\t\t{(range, i) => {\n\t\t\t\t\t\t\tconst info = () => {\n\t\t\t\t\t\t\t\tconst timestamp = context.timestamp();\n\t\t\t\t\t\t\t\tif (timestamp === undefined) return null;\n\t\t\t\t\t\t\t\treturn computeRange(range, timestamp, rangeColor(i(), context.buffering()));\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Show when={info()}>\n\t\t\t\t\t\t\t\t\t{(rangeInfo) => (\n\t\t\t\t\t\t\t\t\t\t<div class=\"watch-ui__buffer-range\" style={rangeInfo().style}>\n\t\t\t\t\t\t\t\t\t\t\t<Show when={rangeInfo().isOverflow}>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"watch-ui__buffer-overflow-label\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{rangeInfo().overflowSec}s\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t</Show>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Show>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}}\n\t\t\t\t\t</For>\n\t\t\t\t</div>\n\n\t\t\t\t{/* Buffer target line (draggable) - wrapped in track-area container */}\n\t\t\t\t<div class=\"watch-ui__buffer-target-area\">\n\t\t\t\t\t<div class=\"watch-ui__buffer-target-line\" style={{ left: `${bufferTargetPct()}%` }}>\n\t\t\t\t\t\t<span class=\"watch-ui__buffer-target-label\">{`${Math.round(context.jitter())}ms`}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n","import { Button, Icon } from \"@moq/ui-core\";\nimport { Show } from \"solid-js\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\nexport default function FullscreenButton() {\n\tconst context = useWatchUIContext();\n\n\tconst onClick = () => {\n\t\tcontext.toggleFullscreen();\n\t};\n\n\treturn (\n\t\t<Button title=\"Fullscreen\" onClick={onClick}>\n\t\t\t<Show when={context.isFullscreen()} fallback={<Icon.FullscreenEnter />}>\n\t\t\t\t<Icon.FullscreenExit />\n\t\t\t</Show>\n\t\t</Button>\n\t);\n}\n","import { Button, Icon } from \"@moq/ui-core\";\nimport { Show } from \"solid-js\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\nexport default function PlayPauseButton() {\n\tconst context = useWatchUIContext();\n\tconst onClick = () => {\n\t\tcontext.togglePlayback();\n\t};\n\n\treturn (\n\t\t<Button title={context.isPlaying() ? \"Pause\" : \"Play\"} class=\"button--playback\" onClick={onClick}>\n\t\t\t<Show when={context.isPlaying()} fallback={<Icon.Play />}>\n\t\t\t\t<Icon.Pause />\n\t\t\t</Show>\n\t\t</Button>\n\t);\n}\n","import { For, type JSX } from \"solid-js\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\nexport default function QualitySelector() {\n\tconst context = useWatchUIContext();\n\n\tconst handleQualityChange: JSX.EventHandler<HTMLSelectElement, Event> = (event) => {\n\t\tconst selectedValue = event.currentTarget.value || undefined;\n\t\tcontext.setActiveRendition(selectedValue);\n\t};\n\n\treturn (\n\t\t<div class=\"watch-ui__quality-selector\">\n\t\t\t<label for=\"quality-select\" class=\"watch-ui__quality-label\">\n\t\t\t\tQuality:{\" \"}\n\t\t\t</label>\n\t\t\t<select\n\t\t\t\tid=\"quality-select\"\n\t\t\t\tonChange={handleQualityChange}\n\t\t\t\tclass=\"watch-ui__quality-select\"\n\t\t\t\tvalue={context.activeRendition() ?? \"\"}\n\t\t\t>\n\t\t\t\t<option value=\"\">Auto</option>\n\t\t\t\t<For each={context.availableRenditions() ?? []}>\n\t\t\t\t\t{(rendition) => (\n\t\t\t\t\t\t<option value={rendition.name}>\n\t\t\t\t\t\t\t{rendition.name}\n\t\t\t\t\t\t\t{rendition.width && rendition.height ? ` (${rendition.width}x${rendition.height})` : \"\"}\n\t\t\t\t\t\t</option>\n\t\t\t\t\t)}\n\t\t\t\t</For>\n\t\t\t</select>\n\t\t</div>\n\t);\n}\n","import { Button, Icon } from \"@moq/ui-core\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\n/**\n * Toggle button for showing/hiding stats panel\n */\nexport default function StatsButton() {\n\tconst context = useWatchUIContext();\n\n\tconst onClick = () => {\n\t\tcontext.setIsStatsPanelVisible(!context.isStatsPanelVisible());\n\t};\n\n\treturn (\n\t\t<Button title={context.isStatsPanelVisible() ? \"Hide stats\" : \"Show stats\"} onClick={onClick}>\n\t\t\t<Icon.Stats />\n\t\t</Button>\n\t);\n}\n","import { Button, Icon } from \"@moq/ui-core\";\nimport { createEffect, createSignal } from \"solid-js\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\nconst getVolumeIcon = (volume: number, isMuted: boolean) => {\n\tif (isMuted || volume === 0) {\n\t\treturn <Icon.Mute />;\n\t} else if (volume > 0 && volume <= 33) {\n\t\treturn <Icon.VolumeLow />;\n\t} else if (volume > 33 && volume <= 66) {\n\t\treturn <Icon.VolumeMedium />;\n\t} else {\n\t\treturn <Icon.VolumeHigh />;\n\t}\n};\n\nexport default function VolumeSlider() {\n\tconst [volumeLabel, setVolumeLabel] = createSignal<number>(0);\n\tconst context = useWatchUIContext();\n\n\tconst onInputChange = (event: Event) => {\n\t\tconst el = event.currentTarget as HTMLInputElement;\n\t\tconst volume = parseFloat(el.value);\n\t\tcontext.setVolume(volume);\n\t};\n\n\tcreateEffect(() => {\n\t\tconst currentVolume = context.currentVolume() || 0;\n\t\tsetVolumeLabel(Math.round(currentVolume));\n\t});\n\n\treturn (\n\t\t<div class=\"watch-ui__volume-slider flex--center\">\n\t\t\t<Button title={context.isMuted() ? \"Unmute\" : \"Mute\"} onClick={() => context.toggleMuted()}>\n\t\t\t\t{getVolumeIcon(context.currentVolume(), context.isMuted())}\n\t\t\t</Button>\n\t\t\t<input type=\"range\" onChange={onInputChange} min=\"0\" max=\"100\" value={context.currentVolume()} />\n\t\t\t<span class=\"watch-ui__volume-label\">{volumeLabel()}</span>\n\t\t</div>\n\t);\n}\n","import type { WatchStatus } from \"../context\";\nimport useWatchUIContext from \"../hooks/use-watch-ui\";\n\ntype StatusIndicatorConfig = { variant: string; text: string };\n\nconst STATUS_MAP: Record<WatchStatus, StatusIndicatorConfig> = {\n\t\"no-url\": { variant: \"error\", text: \"No URL\" },\n\tdisconnected: { variant: \"error\", text: \"Disconnected\" },\n\tconnecting: { variant: \"connecting\", text: \"Connecting...\" },\n\toffline: { variant: \"error\", text: \"Offline\" },\n\tloading: { variant: \"loading\", text: \"Loading...\" },\n\tlive: { variant: \"live\", text: \"Live\" },\n\tconnected: { variant: \"connected\", text: \"Connected\" },\n};\n\nconst unknownStatus: StatusIndicatorConfig = { variant: \"error\", text: \"Unknown\" };\n\nexport default function WatchStatusIndicator() {\n\tconst context = useWatchUIContext();\n\n\tconst statusConfig = (): StatusIndicatorConfig => {\n\t\tconst status: WatchStatus = context.watchStatus();\n\t\treturn STATUS_MAP[status] || unknownStatus;\n\t};\n\n\treturn (\n\t\t<div class=\"watch-ui__status-indicator flex--center\">\n\t\t\t<span class={`watch-ui__status-indicator-dot watch-ui__status-indicator-dot--${statusConfig().variant}`} />\n\t\t\t<span class={`watch-ui__status-indicator-text watch-ui__status-indicator-text--${statusConfig().variant}`}>\n\t\t\t\t{statusConfig().text}\n\t\t\t</span>\n\t\t</div>\n\t);\n}\n","import BufferControl from \"./BufferControl\";\nimport FullscreenButton from \"./FullscreenButton\";\nimport PlayPauseButton from \"./PlayPauseButton\";\nimport QualitySelector from \"./QualitySelector\";\nimport StatsButton from \"./StatsButton\";\nimport VolumeSlider from \"./VolumeSlider\";\nimport WatchStatusIndicator from \"./WatchStatusIndicator\";\n\nexport default function WatchControls() {\n\treturn (\n\t\t<div class=\"watch-ui__controls\">\n\t\t\t<div class=\"watch-ui__playback-controls flex--align-center\">\n\t\t\t\t<PlayPauseButton />\n\t\t\t\t<VolumeSlider />\n\t\t\t\t<WatchStatusIndicator />\n\t\t\t\t<StatsButton />\n\t\t\t\t<FullscreenButton />\n\t\t\t</div>\n\t\t\t<div class=\"watch-ui__latency-controls\">\n\t\t\t\t<BufferControl />\n\t\t\t\t<QualitySelector />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n","import { Stats } from \"@moq/ui-core\";\nimport { useContext } from \"solid-js\";\nimport { Show } from \"solid-js/web\";\nimport type MoqWatch from \"../element\";\n\nimport BufferingIndicator from \"./components/BufferingIndicator\";\nimport WatchControls from \"./components/WatchControls\";\nimport WatchUIContextProvider, { WatchUIContext } from \"./context\";\nimport styles from \"./styles/index.css?inline\";\n\nexport function WatchUI(props: { watch: MoqWatch }) {\n\treturn (\n\t\t<WatchUIContextProvider moqWatch={props.watch}>\n\t\t\t<style>{styles}</style>\n\t\t\t<div class=\"watch-ui__video-container\">\n\t\t\t\t<slot />\n\t\t\t\t{(() => {\n\t\t\t\t\tconst context = useContext(WatchUIContext);\n\t\t\t\t\tif (!context) return null;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Show when={context.isStatsPanelVisible()}>\n\t\t\t\t\t\t\t<Stats\n\t\t\t\t\t\t\t\tcontext={WatchUIContext}\n\t\t\t\t\t\t\t\tgetElement={(ctx) => {\n\t\t\t\t\t\t\t\t\treturn ctx?.moqWatch.backend;\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Show>\n\t\t\t\t\t);\n\t\t\t\t})()}\n\t\t\t\t<BufferingIndicator />\n\t\t\t</div>\n\t\t\t<WatchControls />\n\t\t</WatchUIContextProvider>\n\t);\n}\n","import { customElement } from \"solid-element\";\nimport { createSignal, onMount, Show } from \"solid-js\";\nimport type MoqWatch from \"../element\";\nimport { WatchUI } from \"./element.tsx\";\n\ncustomElement(\"moq-watch-ui\", (_, { element }) => {\n\tconst [nested, setNested] = createSignal<MoqWatch | undefined>();\n\n\tonMount(async () => {\n\t\tawait customElements.whenDefined(\"moq-watch\");\n\t\tconst watchEl = element.querySelector(\"moq-watch\");\n\t\tsetNested(watchEl ? (watchEl as MoqWatch) : undefined);\n\t});\n\n\treturn (\n\t\t<Show when={nested()} keyed>\n\t\t\t{(watch: MoqWatch) => <WatchUI watch={watch} />}\n\t\t</Show>\n\t);\n});\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"moq-watch-ui\": HTMLElement;\n\t}\n}\n"],"names":["IS_DEV","equalFn","a","b","$TRACK","signalOptions","runEffects","runQueue","STALE","PENDING","UNOWNED","Owner","Transition","ExternalSourceConfig","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","owner","unowned","current","root","updateFn","untrack","cleanNode","runUpdates","createSignal","value","options","s","setter","writeSignal","readSignal","createRenderEffect","c","createComputation","updateComputation","createEffect","runUserEffects","createMemo","onMount","onCleanup","getOwner","createContext","defaultValue","id","createProvider","useContext","context","children","memo","resolveChildren","updates","lookUpstream","sSlot","node","isComp","i","TransitionRunning","markDownstream","time","runComputation","nextValue","err","handleError","init","pure","state","runTop","ancestors","wait","res","completeUpdates","queue","userLength","e","ignore","source","o","index","obs","n","castError","results","result","props","FALLBACK","dispose","d","mapArray","list","mapFn","items","mapped","disposers","len","indexes","newItems","newLen","j","newIndices","newIndicesNext","temp","tempdisposers","tempIndexes","start","end","newEnd","item","disposer","mapper","set","createComponent","Comp","narrowedError","name","For","fallback","Show","keyed","conditionValue","condition","child","reconcileArrays","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","map","sequence","t","$$EVENTS","template","html","isImportNode","isSVG","isMathML","create","delegateEvents","eventNames","document","l","eventHandler","setAttribute","className","style","prev","nodeStyle","v","setStyleProperty","use","element","arg","insert","parent","accessor","marker","initial","insertExpression","key","oriTarget","oriCurrentTarget","retarget","handleNode","handler","data","walkUpTree","path","unwrapArray","multi","cleanChildren","array","currentArray","normalizeIncomingArray","appendNodes","normalized","unwrap","dynamic","replacement","inserted","el","isParent","cloneProps","k","prop","isObject","isFunction","normalizePropDefs","toAttribute","propValues","initializeProps","propDefinition","attr","parseAttributeValue","reflect","val","oldValue","attribute","parse","propName","x","y","obj","isConstructor","f","currentElement","createElementType","BaseElement","propKeys","propKey","ComponentType","outerElement","callback","oldVal","newVal","attrName","register","tag","extension","customElements","ElementType","createProps","raw","keys","get","lookupContext","next","withSolid","rawProps","comp","customElement","createAccessor","signal","WatchUIContext","WatchUIContextProvider","watchStatus","setWatchStatus","isPlaying","setIsPlaying","isMuted","moqWatch","backend","audio","muted","currentVolume","setCurrentVolume","buffering","video","stalled","jitter","availableRenditions","setAvailableRenditions","activeRendition","track","isStatsPanelVisible","setIsStatsPanelVisible","isFullscreen","setIsFullscreen","fullscreenElement","togglePlayback","paused","toggleFullscreen","exitFullscreen","requestFullscreen","setVolume","volume","toggleMuted","update","setJitter","latency","setActiveRenditionValue","target","timestamp","videoBuffered","buffered","audioBuffered","setActiveRendition","watch","signals","Signals","Effect","run","effect","url","connection","status","broadcast","renditions","catalog","renditionsList","Object","entries","config","width","codedWidth","height","codedHeight","handleFullscreenChange","event","close","_$createComponent","Provider","useWatchUIContext","BufferingIndicator","when","_tmpl$","MIN_RANGE","RANGE_STEP","BufferControl","maxRange","max","isDragging","setIsDragging","computeRange","range","color","startMs","endMs","visibleStartMs","Math","visibleEndMs","min","leftPct","widthPct","isOverflow","overflowSec","Moq","Time","Milli","toSecond","toFixed","rangeColor","isBuffering","bufferTargetPct","containerRef","LABEL_WIDTH","updateBufferFromMouseX","clientX","rect","getBoundingClientRect","trackWidth","ms","left","snapped","round","clamped","onMouseDown","addEventListener","onMouseMove","onMouseUp","removeEventListener","_el$","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$6","_el$8","_el$9","_el$0","$$mousedown","_ref$","_$use","_$setAttribute","_$insert","each","info","undefined","rangeInfo","_el$1","_tmpl$3","_el$10","_tmpl$2","_el$11","_$effect","_$p","_$style","_el$12","_el$13","_el$14","_p$","_v$","_v$2","_v$3","_v$4","_$className","_$setStyleProperty","_$delegateEvents","FullscreenButton","Button","title","onClick","Icon","FullscreenEnter","FullscreenExit","PlayPauseButton","Play","Pause","QualitySelector","handleQualityChange","selectedValue","currentTarget","rendition","_el$5","_c$","_$memo","StatsButton","Stats","getVolumeIcon","Mute","VolumeLow","VolumeMedium","VolumeHigh","VolumeSlider","volumeLabel","setVolumeLabel","onInputChange","parseFloat","STATUS_MAP","variant","text","disconnected","connecting","offline","loading","live","connected","unknownStatus","WatchStatusIndicator","statusConfig","WatchControls","WatchUI","styles","_$owner","_$getOwner","getElement","ctx","_","nested","setNested","whenDefined","watchEl","querySelector"],"mappings":";;AAiJA,MAAMA,KAAS,IACTC,KAAU,CAACC,GAAGC,MAAMD,MAAMC,GAG1BC,KAAS,uBAAO,aAAa,GAE7BC,KAAgB;AAAA,EACpB,QAAQJ;AACV;AAEA,IAAIK,KAAaC;AACjB,MAAMC,IAAQ,GACRC,KAAU,GACVC,KAAU;AAAA,EACd,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAA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