// ==UserScript== // @name bilibili 页面净化大师 // @namespace http://tampermonkey.net/ // @version 4.5.1 // @author festoney8 // @description 净化 B站/哔哩哔哩 页面,支持「精简功能、播放器净化、过滤视频、过滤评论、全站黑白名单」,提供 300+ 功能,定制自己的 B 站 // @license MIT // @icon https://www.bilibili.com/favicon.ico // @homepage https://github.com/festoney8/bilibili-cleaner // @supportURL https://github.com/festoney8/bilibili-cleaner // @match *://*.bilibili.com/* // @exclude *://message.bilibili.com/pages/nav/header_sync // @exclude *://message.bilibili.com/pages/nav/index_new_pc_sync // @exclude *://data.bilibili.com/* // @exclude *://cm.bilibili.com/* // @exclude *://shop.bilibili.com/* // @exclude *://link.bilibili.com/* // @exclude *://passport.bilibili.com/* // @exclude *://api.bilibili.com/* // @exclude *://api.*.bilibili.com/* // @exclude *://*.chat.bilibili.com/* // @exclude *://member.bilibili.com/* // @exclude *://www.bilibili.com/tensou/* // @exclude *://www.bilibili.com/correspond/* // @exclude *://live.bilibili.com/p/html/* // @exclude *://live.bilibili.com/live-room-play-game-together // @exclude *://www.bilibili.com/blackboard/comment-detail.html* // @exclude *://www.bilibili.com/blackboard/newplayer.html* // @exclude *://www.bilibili.com/appeal/* // @require https://registry.npmmirror.com/vue/3.5.34/files/dist/vue.global.prod.js // @grant GM_addValueChangeListener // @grant GM_deleteValue // @grant GM_getValue // @grant GM_listValues // @grant GM_registerMenuCommand // @grant GM_removeValueChangeListener // @grant GM_setValue // @grant unsafeWindow // @run-at document-start // ==/UserScript== (async function(vue) { 'use strict'; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { key = keys[i]; if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: ((k) => from[k]).bind(null, key), enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); vue = __toESM(vue); var _GM_addValueChangeListener = typeof GM_addValueChangeListener != "undefined" ? GM_addValueChangeListener : void 0; var _GM_deleteValue = typeof GM_deleteValue != "undefined" ? GM_deleteValue : void 0; var _GM_getValue = typeof GM_getValue != "undefined" ? GM_getValue : void 0; var _GM_listValues = typeof GM_listValues != "undefined" ? GM_listValues : void 0; var _GM_registerMenuCommand = typeof GM_registerMenuCommand != "undefined" ? GM_registerMenuCommand : void 0; var _GM_removeValueChangeListener = typeof GM_removeValueChangeListener != "undefined" ? GM_removeValueChangeListener : void 0; var _GM_setValue = typeof GM_setValue != "undefined" ? GM_setValue : void 0; var _unsafeWindow = typeof unsafeWindow != "undefined" ? unsafeWindow : void 0; var IS_CLIENT = typeof window !== "undefined"; var activePinia; var setActivePinia = (pinia) => activePinia = pinia; var piniaSymbol = Symbol(); function isPlainObject(o) { return o && typeof o === "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON !== "function"; } var MutationType; (function(MutationType) { MutationType["direct"] = "direct"; MutationType["patchObject"] = "patch object"; MutationType["patchFunction"] = "patch function"; })(MutationType || (MutationType = {})); var _global$1 = typeof window === "object" && window.window === window ? window : typeof self === "object" && self.self === self ? self : typeof global === "object" && global.global === global ? global : typeof globalThis === "object" ? globalThis : { HTMLElement: null }; function bom(blob, { autoBom = false } = {}) { if (autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) return new Blob([String.fromCharCode(65279), blob], { type: blob.type }); return blob; } function download(url, name, opts) { const xhr = new XMLHttpRequest(); xhr.open("GET", url); xhr.responseType = "blob"; xhr.onload = function() { saveAs(xhr.response, name, opts); }; xhr.onerror = function() { console.error("could not download file"); }; xhr.send(); } function corsEnabled(url) { const xhr = new XMLHttpRequest(); xhr.open("HEAD", url, false); try { xhr.send(); } catch (e) {} return xhr.status >= 200 && xhr.status <= 299; } function click(node) { try { node.dispatchEvent(new MouseEvent("click")); } catch (e) { const evt = new MouseEvent("click", { bubbles: true, cancelable: true, view: window, detail: 0, screenX: 80, screenY: 20, clientX: 80, clientY: 20, ctrlKey: false, altKey: false, shiftKey: false, metaKey: false, button: 0, relatedTarget: null }); node.dispatchEvent(evt); } } var _navigator = typeof navigator === "object" ? navigator : { userAgent: "" }; var isMacOSWebView = /Macintosh/.test(_navigator.userAgent) && /AppleWebKit/.test(_navigator.userAgent) && !/Safari/.test(_navigator.userAgent); var saveAs = !IS_CLIENT ? () => {} : typeof HTMLAnchorElement !== "undefined" && "download" in HTMLAnchorElement.prototype && !isMacOSWebView ? downloadSaveAs : "msSaveOrOpenBlob" in _navigator ? msSaveAs : fileSaverSaveAs; function downloadSaveAs(blob, name = "download", opts) { const a = document.createElement("a"); a.download = name; a.rel = "noopener"; if (typeof blob === "string") { a.href = blob; if (a.origin !== location.origin) if (corsEnabled(a.href)) download(blob, name, opts); else { a.target = "_blank"; click(a); } else click(a); } else { a.href = URL.createObjectURL(blob); setTimeout(function() { URL.revokeObjectURL(a.href); }, 4e4); setTimeout(function() { click(a); }, 0); } } function msSaveAs(blob, name = "download", opts) { if (typeof blob === "string") if (corsEnabled(blob)) download(blob, name, opts); else { const a = document.createElement("a"); a.href = blob; a.target = "_blank"; setTimeout(function() { click(a); }); } else navigator.msSaveOrOpenBlob(bom(blob, opts), name); } function fileSaverSaveAs(blob, name, opts, popup) { popup = popup || open("", "_blank"); if (popup) popup.document.title = popup.document.body.innerText = "downloading..."; if (typeof blob === "string") return download(blob, name, opts); const force = blob.type === "application/octet-stream"; const isSafari = /constructor/i.test(String(_global$1.HTMLElement)) || "safari" in _global$1; const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent); if ((isChromeIOS || force && isSafari || isMacOSWebView) && typeof FileReader !== "undefined") { const reader = new FileReader(); reader.onloadend = function() { let url = reader.result; if (typeof url !== "string") { popup = null; throw new Error("Wrong reader.result type"); } url = isChromeIOS ? url : url.replace(/^data:[^;]*;/, "data:attachment/file;"); if (popup) popup.location.href = url; else location.assign(url); popup = null; }; reader.readAsDataURL(blob); } else { const url = URL.createObjectURL(blob); if (popup) popup.location.assign(url); else location.href = url; popup = null; setTimeout(function() { URL.revokeObjectURL(url); }, 4e4); } } var { assign: assign$1 } = Object; function createPinia() { const scope = (0, vue.effectScope)(true); const state = scope.run(() => (0, vue.ref)({})); let _p = []; let toBeInstalled = []; const pinia = (0, vue.markRaw)({ install(app) { setActivePinia(pinia); pinia._a = app; app.provide(piniaSymbol, pinia); app.config.globalProperties.$pinia = pinia; toBeInstalled.forEach((plugin) => _p.push(plugin)); toBeInstalled = []; }, use(plugin) { if (!this._a) toBeInstalled.push(plugin); else _p.push(plugin); return this; }, _p, _a: null, _e: scope, _s: new Map(), state }); return pinia; } var noop$1 = () => {}; function addSubscription(subscriptions, callback, detached, onCleanup = noop$1) { subscriptions.add(callback); const removeSubscription = () => { subscriptions.delete(callback) && onCleanup(); }; if (!detached && (0, vue.getCurrentScope)()) (0, vue.onScopeDispose)(removeSubscription); return removeSubscription; } function triggerSubscriptions(subscriptions, ...args) { subscriptions.forEach((callback) => { callback(...args); }); } var fallbackRunWithContext = (fn) => fn(); var ACTION_MARKER = Symbol(); var ACTION_NAME = Symbol(); function mergeReactiveObjects(target, patchToApply) { if (target instanceof Map && patchToApply instanceof Map) patchToApply.forEach((value, key) => target.set(key, value)); else if (target instanceof Set && patchToApply instanceof Set) patchToApply.forEach(target.add, target); for (const key in patchToApply) { if (!patchToApply.hasOwnProperty(key)) continue; const subPatch = patchToApply[key]; const targetValue = target[key]; if (isPlainObject(targetValue) && isPlainObject(subPatch) && target.hasOwnProperty(key) && !(0, vue.isRef)(subPatch) && !(0, vue.isReactive)(subPatch)) target[key] = mergeReactiveObjects(targetValue, subPatch); else target[key] = subPatch; } return target; } var skipHydrateSymbol = Symbol(); function shouldHydrate(obj) { return !isPlainObject(obj) || !Object.prototype.hasOwnProperty.call(obj, skipHydrateSymbol); } var { assign } = Object; function isComputed(o) { return !!((0, vue.isRef)(o) && o.effect); } function createOptionsStore(id, options, pinia, hot) { const { state, actions, getters } = options; const initialState = pinia.state.value[id]; let store; function setup() { if (!initialState && true) pinia.state.value[id] = state ? state() : {}; return assign((0, vue.toRefs)(pinia.state.value[id]), actions, Object.keys(getters || {}).reduce((computedGetters, name) => { computedGetters[name] = (0, vue.markRaw)((0, vue.computed)(() => { setActivePinia(pinia); const store = pinia._s.get(id); return getters[name].call(store, store); })); return computedGetters; }, {})); } store = createSetupStore(id, setup, options, pinia, hot, true); return store; } function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) { let scope; const optionsForPlugin = assign({ actions: {} }, options); const $subscribeOptions = { deep: true }; let isListening; let isSyncListening; let subscriptions = new Set(); let actionSubscriptions = new Set(); let debuggerEvents; const initialState = pinia.state.value[$id]; if (!isOptionsStore && !initialState && true) pinia.state.value[$id] = {}; (0, vue.ref)({}); let activeListener; function $patch(partialStateOrMutator) { let subscriptionMutation; isListening = isSyncListening = false; if (typeof partialStateOrMutator === "function") { partialStateOrMutator(pinia.state.value[$id]); subscriptionMutation = { type: MutationType.patchFunction, storeId: $id, events: debuggerEvents }; } else { mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator); subscriptionMutation = { type: MutationType.patchObject, payload: partialStateOrMutator, storeId: $id, events: debuggerEvents }; } const myListenerId = activeListener = Symbol(); (0, vue.nextTick)().then(() => { if (activeListener === myListenerId) isListening = true; }); isSyncListening = true; triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]); } const $reset = isOptionsStore ? function $reset() { const { state } = options; const newState = state ? state() : {}; this.$patch(($state) => { assign($state, newState); }); } : noop$1; function $dispose() { scope.stop(); subscriptions.clear(); actionSubscriptions.clear(); pinia._s.delete($id); } const action = (fn, name = "") => { if (ACTION_MARKER in fn) { fn[ACTION_NAME] = name; return fn; } const wrappedAction = function() { setActivePinia(pinia); const args = Array.from(arguments); const afterCallbackSet = new Set(); const onErrorCallbackSet = new Set(); function after(callback) { afterCallbackSet.add(callback); } function onError(callback) { onErrorCallbackSet.add(callback); } triggerSubscriptions(actionSubscriptions, { args, name: wrappedAction[ACTION_NAME], store, after, onError }); let ret; try { ret = fn.apply(this && this.$id === $id ? this : store, args); } catch (error) { triggerSubscriptions(onErrorCallbackSet, error); throw error; } if (ret instanceof Promise) return ret.then((value) => { triggerSubscriptions(afterCallbackSet, value); return value; }).catch((error) => { triggerSubscriptions(onErrorCallbackSet, error); return Promise.reject(error); }); triggerSubscriptions(afterCallbackSet, ret); return ret; }; wrappedAction[ACTION_MARKER] = true; wrappedAction[ACTION_NAME] = name; return wrappedAction; }; const store = (0, vue.reactive)({ _p: pinia, $id, $onAction: addSubscription.bind(null, actionSubscriptions), $patch, $reset, $subscribe(callback, options = {}) { const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher()); const stopWatcher = scope.run(() => (0, vue.watch)(() => pinia.state.value[$id], (state) => { if (options.flush === "sync" ? isSyncListening : isListening) callback({ storeId: $id, type: MutationType.direct, events: debuggerEvents }, state); }, assign({}, $subscribeOptions, options))); return removeSubscription; }, $dispose }); pinia._s.set($id, store); const setupStore = (pinia._a && pinia._a.runWithContext || fallbackRunWithContext)(() => pinia._e.run(() => (scope = (0, vue.effectScope)()).run(() => setup({ action })))); for (const key in setupStore) { const prop = setupStore[key]; if ((0, vue.isRef)(prop) && !isComputed(prop) || (0, vue.isReactive)(prop)) { if (!isOptionsStore) { if (initialState && shouldHydrate(prop)) if ((0, vue.isRef)(prop)) prop.value = initialState[key]; else mergeReactiveObjects(prop, initialState[key]); pinia.state.value[$id][key] = prop; } } else if (typeof prop === "function") { setupStore[key] = action(prop, key); optionsForPlugin.actions[key] = prop; } } assign(store, setupStore); assign((0, vue.toRaw)(store), setupStore); Object.defineProperty(store, "$state", { get: () => pinia.state.value[$id], set: (state) => { $patch(($state) => { assign($state, state); }); } }); pinia._p.forEach((extender) => { assign(store, scope.run(() => extender({ store, app: pinia._a, pinia, options: optionsForPlugin }))); }); if (initialState && isOptionsStore && options.hydrate) options.hydrate(store.$state, initialState); isListening = true; isSyncListening = true; return store; } function defineStore(id, setup, setupOptions) { let options; const isSetupStore = typeof setup === "function"; options = isSetupStore ? setupOptions : setup; function useStore(pinia, hot) { const hasContext = (0, vue.hasInjectionContext)(); pinia = pinia || (hasContext ? (0, vue.inject)(piniaSymbol, null) : null); if (pinia) setActivePinia(pinia); pinia = activePinia; if (!pinia._s.has(id)) if (isSetupStore) createSetupStore(id, setup, options, pinia); else createOptionsStore(id, options, pinia); return pinia._s.get(id); } useStore.$id = id; return useStore; } function d$2(u, e, r) { let i = (0, vue.ref)(r == null ? void 0 : r.value), f = (0, vue.computed)(() => u.value !== void 0); return [(0, vue.computed)(() => f.value ? u.value : i.value), function(t) { return f.value || (i.value = t), e == null ? void 0 : e(t); }]; } var r$3; var n$3 = Symbol("headlessui.useid"), o$4 = 0; var i$4 = (r$3 = vue.useId) != null ? r$3 : function() { return vue.inject(n$3, () => `${++o$4}`)(); }; function o$3(e) { var l; if (e == null || e.value == null) return null; let n = (l = e.value.$el) != null ? l : e.value; return n instanceof Node ? n : null; } function u$5(r, n, ...a) { if (r in n) { let e = n[r]; return typeof e == "function" ? e(...a) : e; } let t = new Error(`Tried to handle "${r}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map((e) => `"${e}"`).join(", ")}.`); throw Error.captureStackTrace && Error.captureStackTrace(t, u$5), t; } var i$3 = Object.defineProperty; var d$1 = (t, e, r) => e in t ? i$3(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r; var n$2 = (t, e, r) => (d$1(t, typeof e != "symbol" ? e + "" : e, r), r); var s$1 = class { constructor() { n$2(this, "current", this.detect()); n$2(this, "currentId", 0); } set(e) { this.current !== e && (this.currentId = 0, this.current = e); } reset() { this.set(this.detect()); } nextId() { return ++this.currentId; } get isServer() { return this.current === "server"; } get isClient() { return this.current === "client"; } detect() { return typeof window == "undefined" || typeof document == "undefined" ? "server" : "client"; } }; var c$2 = new s$1(); function i$2(r) { if (c$2.isServer) return null; if (r instanceof Node) return r.ownerDocument; if (r != null && r.hasOwnProperty("value")) { let n = o$3(r); if (n) return n.ownerDocument; } return document; } var c$1 = [ "[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])" ].map((e) => `${e}:not([tabindex='-1'])`).join(","); var N$2 = ((n) => (n[n.First = 1] = "First", n[n.Previous = 2] = "Previous", n[n.Next = 4] = "Next", n[n.Last = 8] = "Last", n[n.WrapAround = 16] = "WrapAround", n[n.NoScroll = 32] = "NoScroll", n))(N$2 || {}), T$2 = ((o) => (o[o.Error = 0] = "Error", o[o.Overflow = 1] = "Overflow", o[o.Success = 2] = "Success", o[o.Underflow = 3] = "Underflow", o))(T$2 || {}), F = ((t) => (t[t.Previous = -1] = "Previous", t[t.Next = 1] = "Next", t))(F || {}); var h$1 = ((t) => (t[t.Strict = 0] = "Strict", t[t.Loose = 1] = "Loose", t))(h$1 || {}); function w$3(e, r = 0) { var t; return e === ((t = i$2(e)) == null ? void 0 : t.body) ? !1 : u$5(r, { [0]() { return e.matches(c$1); }, [1]() { let l = e; for (; l !== null;) { if (l.matches(c$1)) return !0; l = l.parentElement; } return !1; } }); } var y$1 = ((t) => (t[t.Keyboard = 0] = "Keyboard", t[t.Mouse = 1] = "Mouse", t))(y$1 || {}); typeof window != "undefined" && typeof document != "undefined" && (document.addEventListener("keydown", (e) => { e.metaKey || e.altKey || e.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = ""); }, !0), document.addEventListener("click", (e) => { e.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = ""); }, !0)); ["textarea", "input"].join(","); function O$1(e, r = (t) => t) { return e.slice().sort((t, l) => { let o = r(t), i = r(l); if (o === null || i === null) return 0; let n = o.compareDocumentPosition(i); return n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0; }); } function t$1() { return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0; } function i$1() { return /Android/gi.test(window.navigator.userAgent); } function n$1() { return t$1() || i$1(); } function u$4(e, t, n) { c$2.isServer || (0, vue.watchEffect)((o) => { document.addEventListener(e, t, n), o(() => document.removeEventListener(e, t, n)); }); } function w$2(e, n, t) { c$2.isServer || (0, vue.watchEffect)((o) => { window.addEventListener(e, n, t), o(() => window.removeEventListener(e, n, t)); }); } function w$1(f, m, l = (0, vue.computed)(() => !0)) { function a(e, r) { if (!l.value || e.defaultPrevented) return; let t = r(e); if (t === null || !t.getRootNode().contains(t)) return; let c = function o(n) { return typeof n == "function" ? o(n()) : Array.isArray(n) || n instanceof Set ? n : [n]; }(f); for (let o of c) { if (o === null) continue; let n = o instanceof HTMLElement ? o : o$3(o); if (n != null && n.contains(t) || e.composed && e.composedPath().includes(n)) return; } return !w$3(t, h$1.Loose) && t.tabIndex !== -1 && e.preventDefault(), m(e, t); } let u = (0, vue.ref)(null); u$4("pointerdown", (e) => { var r, t; l.value && (u.value = ((t = (r = e.composedPath) == null ? void 0 : r.call(e)) == null ? void 0 : t[0]) || e.target); }, !0), u$4("mousedown", (e) => { var r, t; l.value && (u.value = ((t = (r = e.composedPath) == null ? void 0 : r.call(e)) == null ? void 0 : t[0]) || e.target); }, !0), u$4("click", (e) => { n$1() || u.value && (a(e, () => u.value), u.value = null); }, !0), u$4("touchend", (e) => a(e, () => e.target instanceof HTMLElement ? e.target : null), !0), w$2("blur", (e) => a(e, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0); } function r$2(t, e) { if (t) return t; let n = e != null ? e : "button"; if (typeof n == "string" && n.toLowerCase() === "button") return "button"; } function s(t, e) { let n = (0, vue.ref)(r$2(t.value.type, t.value.as)); return (0, vue.onMounted)(() => { n.value = r$2(t.value.type, t.value.as); }), (0, vue.watchEffect)(() => { var u; n.value || o$3(e) && o$3(e) instanceof HTMLButtonElement && !((u = o$3(e)) != null && u.hasAttribute("type")) && (n.value = "button"); }), n; } function r$1(e) { return [e.screenX, e.screenY]; } function u$3() { let e = (0, vue.ref)([-1, -1]); return { wasMoved(n) { let t = r$1(n); return e.value[0] === t[0] && e.value[1] === t[1] ? !1 : (e.value = t, !0); }, update(n) { e.value = r$1(n); } }; } var N$1 = ((o) => (o[o.None = 0] = "None", o[o.RenderStrategy = 1] = "RenderStrategy", o[o.Static = 2] = "Static", o))(N$1 || {}), S = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(S || {}); function A$1({ visible: r = !0, features: t = 0, ourProps: e, theirProps: o, ...i }) { var a; let n = j(o, e), l = Object.assign(i, { props: n }); if (r || t & 2 && n.static) return y(l); if (t & 1) return u$5((a = n.unmount) == null || a ? 0 : 1, { [0]() { return null; }, [1]() { return y({ ...i, props: { ...n, hidden: !0, style: { display: "none" } } }); } }); return y(l); } function y({ props: r, attrs: t, slots: e, slot: o, name: i }) { var m, h$4; let { as: n, ...l } = T$1(r, ["unmount", "static"]), a = (m = e.default) == null ? void 0 : m.call(e, o), d = {}; if (o) { let u = !1, c = []; for (let [p, f] of Object.entries(o)) typeof f == "boolean" && (u = !0), f === !0 && c.push(p); u && (d["data-headlessui-state"] = c.join(" ")); } if (n === "template") { if (a = b(a != null ? a : []), Object.keys(l).length > 0 || Object.keys(t).length > 0) { let [u, ...c] = a != null ? a : []; if (!v(u) || c.length > 0) throw new Error([ "Passing props on \"template\"!", "", `The current component <${i} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(l).concat(Object.keys(t)).map((s) => s.trim()).filter((s, g, R) => R.indexOf(s) === g).sort((s, g) => s.localeCompare(g)).map((s) => ` - ${s}`).join(` `), "", "You can apply a few solutions:", ["Add an `as=\"...\"` prop, to ensure that we render an actual element instead of a \"template\".", "Render a single element as the child so that we can forward the props onto that element."].map((s) => ` - ${s}`).join(` `) ].join(` `)); let p = j((h$4 = u.props) != null ? h$4 : {}, l, d), f = (0, vue.cloneVNode)(u, p, !0); for (let s in p) s.startsWith("on") && (f.props || (f.props = {}), f.props[s] = p[s]); return f; } return Array.isArray(a) && a.length === 1 ? a[0] : a; } return (0, vue.h)(n, Object.assign({}, l, d), { default: () => a }); } function b(r) { return r.flatMap((t) => t.type === vue.Fragment ? b(t.children) : [t]); } function j(...r) { if (r.length === 0) return {}; if (r.length === 1) return r[0]; let t = {}, e = {}; for (let i of r) for (let n in i) n.startsWith("on") && typeof i[n] == "function" ? (e[n] ?? (e[n] = []), e[n].push(i[n])) : t[n] = i[n]; if (t.disabled || t["aria-disabled"]) return Object.assign(t, Object.fromEntries(Object.keys(e).map((i) => [i, void 0]))); for (let i in e) Object.assign(t, { [i](n, ...l) { let a = e[i]; for (let d of a) { if (n instanceof Event && n.defaultPrevented) return; d(n, ...l); } } }); return t; } function E$1(r) { let t = Object.assign({}, r); for (let e in t) t[e] === void 0 && delete t[e]; return t; } function T$1(r, t = []) { let e = Object.assign({}, r); for (let o of t) o in e && delete e[o]; return e; } function v(r) { return r == null ? !1 : typeof r.type == "string" || typeof r.type == "object" || typeof r.type == "function"; } var u$2 = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(u$2 || {}); var f$2 = (0, vue.defineComponent)({ name: "Hidden", props: { as: { type: [Object, String], default: "div" }, features: { type: Number, default: 1 } }, setup(t, { slots: n, attrs: i }) { return () => { var r; let { features: e, ...d } = t; return A$1({ ourProps: { "aria-hidden": (e & 2) === 2 ? !0 : (r = d["aria-hidden"]) != null ? r : void 0, hidden: (e & 4) === 4 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(e & 4) === 4 && (e & 2) !== 2 && { display: "none" } } }, theirProps: d, slot: {}, attrs: i, slots: n, name: "Hidden" }); }; } }); var n = Symbol("Context"); var i = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(i || {}); function l() { return (0, vue.inject)(n, null); } function t(o) { (0, vue.provide)(n, o); } var o$2 = ((r) => (r.Space = " ", r.Enter = "Enter", r.Escape = "Escape", r.Backspace = "Backspace", r.Delete = "Delete", r.ArrowLeft = "ArrowLeft", r.ArrowUp = "ArrowUp", r.ArrowRight = "ArrowRight", r.ArrowDown = "ArrowDown", r.Home = "Home", r.End = "End", r.PageUp = "PageUp", r.PageDown = "PageDown", r.Tab = "Tab", r))(o$2 || {}); function u$1(l) { throw new Error("Unexpected object: " + l); } var c = ((i) => (i[i.First = 0] = "First", i[i.Previous = 1] = "Previous", i[i.Next = 2] = "Next", i[i.Last = 3] = "Last", i[i.Specific = 4] = "Specific", i[i.Nothing = 5] = "Nothing", i))(c || {}); function f$1(l, n) { let t = n.resolveItems(); if (t.length <= 0) return null; let r = n.resolveActiveIndex(), s = r != null ? r : -1; switch (l.focus) { case 0: for (let e = 0; e < t.length; ++e) if (!n.resolveDisabled(t[e], e, t)) return e; return r; case 1: s === -1 && (s = t.length); for (let e = s - 1; e >= 0; --e) if (!n.resolveDisabled(t[e], e, t)) return e; return r; case 2: for (let e = s + 1; e < t.length; ++e) if (!n.resolveDisabled(t[e], e, t)) return e; return r; case 3: for (let e = t.length - 1; e >= 0; --e) if (!n.resolveDisabled(t[e], e, t)) return e; return r; case 4: for (let e = 0; e < t.length; ++e) if (n.resolveId(t[e], e, t) === l.id) return e; return r; case 5: return null; default: u$1(l); } } function e$1(i = {}, s = null, t = []) { for (let [r, n] of Object.entries(i)) o$1(t, f(s, r), n); return t; } function f(i, s) { return i ? i + "[" + s + "]" : s; } function o$1(i, s, t) { if (Array.isArray(t)) for (let [r, n] of t.entries()) o$1(i, f(s, r.toString()), n); else t instanceof Date ? i.push([s, t.toISOString()]) : typeof t == "boolean" ? i.push([s, t ? "1" : "0"]) : typeof t == "string" ? i.push([s, t]) : typeof t == "number" ? i.push([s, `${t}`]) : t == null ? i.push([s, ""]) : e$1(t, s, i); } function p$1(i) { var t, r; let s = (t = i == null ? void 0 : i.form) != null ? t : i.closest("form"); if (s) { for (let n of s.elements) if (n !== i && (n.tagName === "INPUT" && n.type === "submit" || n.tagName === "BUTTON" && n.type === "submit" || n.nodeName === "INPUT" && n.type === "image")) { n.click(); return; } (r = s.requestSubmit) == null || r.call(s); } } var u = Symbol("DescriptionContext"); function w() { let t = (0, vue.inject)(u, null); if (t === null) throw new Error("Missing parent"); return t; } function k$1({ slot: t = (0, vue.ref)({}), name: o = "Description", props: s = {} } = {}) { let e = (0, vue.ref)([]); function r(n) { return e.value.push(n), () => { let i = e.value.indexOf(n); i !== -1 && e.value.splice(i, 1); }; } return (0, vue.provide)(u, { register: r, slot: t, name: o, props: s }), (0, vue.computed)(() => e.value.length > 0 ? e.value.join(" ") : void 0); } (0, vue.defineComponent)({ name: "Description", props: { as: { type: [Object, String], default: "p" }, id: { type: String, default: null } }, setup(t, { attrs: o, slots: s }) { var n; let e = (n = t.id) != null ? n : `headlessui-description-${i$4()}`, r = w(); return (0, vue.onMounted)(() => (0, vue.onUnmounted)(r.register(e))), () => { let { name: i = "Description", slot: l = (0, vue.ref)({}), props: d = {} } = r, { ...c } = t; return A$1({ ourProps: { ...Object.entries(d).reduce((a, [g, m]) => Object.assign(a, { [g]: (0, vue.unref)(m) }), {}), id: e }, theirProps: c, slot: l.value, attrs: o, slots: s, name: i }); }; } }); var $$1 = ((o) => (o[o.Open = 0] = "Open", o[o.Closed = 1] = "Closed", o))($$1 || {}); var T = Symbol("DisclosureContext"); function O(t) { let r = (0, vue.inject)(T, null); if (r === null) { let o = new Error(`<${t} /> is missing a parent component.`); throw Error.captureStackTrace && Error.captureStackTrace(o, O), o; } return r; } var k = Symbol("DisclosurePanelContext"); function U() { return (0, vue.inject)(k, null); } var N = (0, vue.defineComponent)({ name: "Disclosure", props: { as: { type: [Object, String], default: "template" }, defaultOpen: { type: [Boolean], default: !1 } }, setup(t$2, { slots: r, attrs: o }) { let s = (0, vue.ref)(t$2.defaultOpen ? 0 : 1), e = (0, vue.ref)(null), i$5 = (0, vue.ref)(null), n = { buttonId: (0, vue.ref)(`headlessui-disclosure-button-${i$4()}`), panelId: (0, vue.ref)(`headlessui-disclosure-panel-${i$4()}`), disclosureState: s, panel: e, button: i$5, toggleDisclosure() { s.value = u$5(s.value, { [0]: 1, [1]: 0 }); }, closeDisclosure() { s.value !== 1 && (s.value = 1); }, close(l) { n.closeDisclosure(); (l ? l instanceof HTMLElement ? l : l.value instanceof HTMLElement ? o$3(l) : o$3(n.button) : o$3(n.button))?.focus(); } }; return (0, vue.provide)(T, n), t((0, vue.computed)(() => u$5(s.value, { [0]: i.Open, [1]: i.Closed }))), () => { let { defaultOpen: l, ...a } = t$2; return A$1({ theirProps: a, ourProps: {}, slot: { open: s.value === 0, close: n.close }, slots: r, attrs: o, name: "Disclosure" }); }; } }), Q = (0, vue.defineComponent)({ name: "DisclosureButton", props: { as: { type: [Object, String], default: "button" }, disabled: { type: [Boolean], default: !1 }, id: { type: String, default: null } }, setup(t, { attrs: r, slots: o, expose: s$4 }) { let e = O("DisclosureButton"), i = U(), n = (0, vue.computed)(() => i === null ? !1 : i.value === e.panelId.value); (0, vue.onMounted)(() => { n.value || t.id !== null && (e.buttonId.value = t.id); }), (0, vue.onUnmounted)(() => { n.value || (e.buttonId.value = null); }); let l = (0, vue.ref)(null); s$4({ el: l, $el: l }), n.value || (0, vue.watchEffect)(() => { e.button.value = l.value; }); let a = s((0, vue.computed)(() => ({ as: t.as, type: r.type })), l); function c() { var u; t.disabled || (n.value ? (e.toggleDisclosure(), (u = o$3(e.button)) == null || u.focus()) : e.toggleDisclosure()); } function D(u) { var S; if (!t.disabled) if (n.value) switch (u.key) { case o$2.Space: case o$2.Enter: u.preventDefault(), u.stopPropagation(), e.toggleDisclosure(), (S = o$3(e.button)) == null || S.focus(); break; } else switch (u.key) { case o$2.Space: case o$2.Enter: u.preventDefault(), u.stopPropagation(), e.toggleDisclosure(); break; } } function v(u) { switch (u.key) { case o$2.Space: u.preventDefault(); break; } } return () => { var C; let u = { open: e.disclosureState.value === 0 }, { id: S, ...K } = t; return A$1({ ourProps: n.value ? { ref: l, type: a.value, onClick: c, onKeydown: D } : { id: (C = e.buttonId.value) != null ? C : S, ref: l, type: a.value, "aria-expanded": e.disclosureState.value === 0, "aria-controls": e.disclosureState.value === 0 || o$3(e.panel) ? e.panelId.value : void 0, disabled: t.disabled ? !0 : void 0, onClick: c, onKeydown: D, onKeyup: v }, theirProps: K, slot: u, attrs: r, slots: o, name: "DisclosureButton" }); }; } }), V = (0, vue.defineComponent)({ name: "DisclosurePanel", props: { as: { type: [Object, String], default: "div" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, id: { type: String, default: null } }, setup(t, { attrs: r, slots: o, expose: s }) { let e = O("DisclosurePanel"); (0, vue.onMounted)(() => { t.id !== null && (e.panelId.value = t.id); }), (0, vue.onUnmounted)(() => { e.panelId.value = null; }), s({ el: e.panel, $el: e.panel }), (0, vue.provide)(k, e.panelId); let i$6 = l(), n = (0, vue.computed)(() => i$6 !== null ? (i$6.value & i.Open) === i.Open : e.disclosureState.value === 0); return () => { var v; let l = { open: e.disclosureState.value === 0, close: e.close }, { id: a, ...c } = t; return A$1({ ourProps: { id: (v = e.panelId.value) != null ? v : a, ref: e.panel }, theirProps: c, slot: l, attrs: r, slots: o, features: N$1.RenderStrategy | N$1.Static, visible: n.value, name: "DisclosurePanel" }); }; } }); var a$1 = /([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g; function o(e) { var r, i; let n = (r = e.innerText) != null ? r : "", t = e.cloneNode(!0); if (!(t instanceof HTMLElement)) return n; let u = !1; for (let f of t.querySelectorAll("[hidden],[aria-hidden],[role=\"img\"]")) f.remove(), u = !0; let l = u ? (i = t.innerText) != null ? i : "" : n; return a$1.test(l) && (l = l.replace(a$1, "")), l; } function g(e) { let n = e.getAttribute("aria-label"); if (typeof n == "string") return n.trim(); let t = e.getAttribute("aria-labelledby"); if (t) { let u = t.split(" ").map((l) => { let r = document.getElementById(l); if (r) { let i = r.getAttribute("aria-label"); return typeof i == "string" ? i.trim() : o(r).trim(); } return null; }).filter(Boolean); if (u.length > 0) return u.join(", "); } return o(e).trim(); } function p(a) { let t = (0, vue.ref)(""), r = (0, vue.ref)(""); return () => { let e = o$3(a); if (!e) return ""; let l = e.innerText; if (t.value === l) return r.value; let u = g(e).trim().toLowerCase(); return t.value = l, r.value = u, u; }; } function pe(o, b) { return o === b; } var ce$1 = ((r) => (r[r.Open = 0] = "Open", r[r.Closed = 1] = "Closed", r))(ce$1 || {}), ve = ((r) => (r[r.Single = 0] = "Single", r[r.Multi = 1] = "Multi", r))(ve || {}), be = ((r) => (r[r.Pointer = 0] = "Pointer", r[r.Other = 1] = "Other", r))(be || {}); function me(o) { requestAnimationFrame(() => requestAnimationFrame(o)); } var $ = Symbol("ListboxContext"); function A(o) { let b = (0, vue.inject)($, null); if (b === null) { let r = new Error(`<${o} /> is missing a parent component.`); throw Error.captureStackTrace && Error.captureStackTrace(r, A), r; } return b; } var Ie = (0, vue.defineComponent)({ name: "Listbox", emits: { "update:modelValue": (o) => !0 }, props: { as: { type: [Object, String], default: "template" }, disabled: { type: [Boolean], default: !1 }, by: { type: [String, Function], default: () => pe }, horizontal: { type: [Boolean], default: !1 }, modelValue: { type: [ Object, String, Number, Boolean ], default: void 0 }, defaultValue: { type: [ Object, String, Number, Boolean ], default: void 0 }, form: { type: String, optional: !0 }, name: { type: String, optional: !0 }, multiple: { type: [Boolean], default: !1 } }, inheritAttrs: !1, setup(o, { slots: b, attrs: r, emit: w }) { let n = (0, vue.ref)(1), e = (0, vue.ref)(null), f = (0, vue.ref)(null), v = (0, vue.ref)(null), s = (0, vue.ref)([]), m = (0, vue.ref)(""), p = (0, vue.ref)(null), a = (0, vue.ref)(1); function u(t = (i) => i) { let i = p.value !== null ? s.value[p.value] : null, l = O$1(t(s.value.slice()), (O) => o$3(O.dataRef.domRef)), d = i ? l.indexOf(i) : null; return d === -1 && (d = null), { options: l, activeOptionIndex: d }; } let D = (0, vue.computed)(() => o.multiple ? 1 : 0), [y, L] = d$2((0, vue.computed)(() => o.modelValue), (t) => w("update:modelValue", t), (0, vue.computed)(() => o.defaultValue)), M = (0, vue.computed)(() => y.value === void 0 ? u$5(D.value, { [1]: [], [0]: void 0 }) : y.value), k = { listboxState: n, value: M, mode: D, compare(t, i) { if (typeof o.by == "string") { let l = o.by; return (t == null ? void 0 : t[l]) === (i == null ? void 0 : i[l]); } return o.by(t, i); }, orientation: (0, vue.computed)(() => o.horizontal ? "horizontal" : "vertical"), labelRef: e, buttonRef: f, optionsRef: v, disabled: (0, vue.computed)(() => o.disabled), options: s, searchQuery: m, activeOptionIndex: p, activationTrigger: a, closeListbox() { o.disabled || n.value !== 1 && (n.value = 1, p.value = null); }, openListbox() { o.disabled || n.value !== 0 && (n.value = 0); }, goToOption(t, i, l) { if (o.disabled || n.value === 1) return; let d = u(), O = f$1(t === c.Specific ? { focus: c.Specific, id: i } : { focus: t }, { resolveItems: () => d.options, resolveActiveIndex: () => d.activeOptionIndex, resolveId: (h) => h.id, resolveDisabled: (h) => h.dataRef.disabled }); m.value = "", p.value = O, a.value = l != null ? l : 1, s.value = d.options; }, search(t) { if (o.disabled || n.value === 1) return; let l = m.value !== "" ? 0 : 1; m.value += t.toLowerCase(); let O = (p.value !== null ? s.value.slice(p.value + l).concat(s.value.slice(0, p.value + l)) : s.value).find((I) => I.dataRef.textValue.startsWith(m.value) && !I.dataRef.disabled), h = O ? s.value.indexOf(O) : -1; h === -1 || h === p.value || (p.value = h, a.value = 1); }, clearSearch() { o.disabled || n.value !== 1 && m.value !== "" && (m.value = ""); }, registerOption(t, i) { let l = u((d) => [...d, { id: t, dataRef: i }]); s.value = l.options, p.value = l.activeOptionIndex; }, unregisterOption(t) { let i = u((l) => { let d = l.findIndex((O) => O.id === t); return d !== -1 && l.splice(d, 1), l; }); s.value = i.options, p.value = i.activeOptionIndex, a.value = 1; }, theirOnChange(t) { o.disabled || L(t); }, select(t) { o.disabled || L(u$5(D.value, { [0]: () => t, [1]: () => { let i = (0, vue.toRaw)(k.value.value).slice(), l = (0, vue.toRaw)(t), d = i.findIndex((O) => k.compare(l, (0, vue.toRaw)(O))); return d === -1 ? i.push(l) : i.splice(d, 1), i; } })); } }; w$1([f, v], (t, i) => { var l; k.closeListbox(), w$3(i, h$1.Loose) || (t.preventDefault(), (l = o$3(f)) == null || l.focus()); }, (0, vue.computed)(() => n.value === 0)), (0, vue.provide)($, k), t((0, vue.computed)(() => u$5(n.value, { [0]: i.Open, [1]: i.Closed }))); let C = (0, vue.computed)(() => { var t; return (t = o$3(f)) == null ? void 0 : t.closest("form"); }); return (0, vue.onMounted)(() => { (0, vue.watch)([C], () => { if (!C.value || o.defaultValue === void 0) return; function t() { k.theirOnChange(o.defaultValue); } return C.value.addEventListener("reset", t), () => { var i; (i = C.value) == null || i.removeEventListener("reset", t); }; }, { immediate: !0 }); }), () => { let { name: t, modelValue: i, disabled: l, form: d, ...O } = o, h$3 = { open: n.value === 0, disabled: l, value: M.value }; return (0, vue.h)(vue.Fragment, [...t != null && M.value != null ? e$1({ [t]: M.value }).map(([I, Q]) => (0, vue.h)(f$2, E$1({ features: u$2.Hidden, key: I, as: "input", type: "hidden", hidden: !0, readOnly: !0, form: d, disabled: l, name: I, value: Q }))) : [], A$1({ ourProps: {}, theirProps: { ...r, ...T$1(O, [ "defaultValue", "onUpdate:modelValue", "horizontal", "multiple", "by" ]) }, slot: h$3, slots: b, attrs: r, name: "Listbox" })]); }; } }); (0, vue.defineComponent)({ name: "ListboxLabel", props: { as: { type: [Object, String], default: "label" }, id: { type: String, default: null } }, setup(o, { attrs: b, slots: r }) { var f; let w = (f = o.id) != null ? f : `headlessui-listbox-label-${i$4()}`, n = A("ListboxLabel"); function e() { var v; (v = o$3(n.buttonRef)) == null || v.focus({ preventScroll: !0 }); } return () => { let v = { open: n.listboxState.value === 0, disabled: n.disabled.value }, { ...s } = o; return A$1({ ourProps: { id: w, ref: n.labelRef, onClick: e }, theirProps: s, slot: v, attrs: b, slots: r, name: "ListboxLabel" }); }; } }); var je = (0, vue.defineComponent)({ name: "ListboxButton", props: { as: { type: [Object, String], default: "button" }, id: { type: String, default: null } }, setup(o, { attrs: b, slots: r, expose: w }) { var p; let n = (p = o.id) != null ? p : `headlessui-listbox-button-${i$4()}`, e = A("ListboxButton"); w({ el: e.buttonRef, $el: e.buttonRef }); function f(a) { switch (a.key) { case o$2.Space: case o$2.Enter: case o$2.ArrowDown: a.preventDefault(), e.openListbox(), (0, vue.nextTick)(() => { var u; (u = o$3(e.optionsRef)) == null || u.focus({ preventScroll: !0 }), e.value.value || e.goToOption(c.First); }); break; case o$2.ArrowUp: a.preventDefault(), e.openListbox(), (0, vue.nextTick)(() => { var u; (u = o$3(e.optionsRef)) == null || u.focus({ preventScroll: !0 }), e.value.value || e.goToOption(c.Last); }); break; } } function v(a) { switch (a.key) { case o$2.Space: a.preventDefault(); break; } } function s$3(a) { e.disabled.value || (e.listboxState.value === 0 ? (e.closeListbox(), (0, vue.nextTick)(() => { var u; return (u = o$3(e.buttonRef)) == null ? void 0 : u.focus({ preventScroll: !0 }); })) : (a.preventDefault(), e.openListbox(), me(() => { var u; return (u = o$3(e.optionsRef)) == null ? void 0 : u.focus({ preventScroll: !0 }); }))); } let m = s((0, vue.computed)(() => ({ as: o.as, type: b.type })), e.buttonRef); return () => { var y, L; let a = { open: e.listboxState.value === 0, disabled: e.disabled.value, value: e.value.value }, { ...u } = o; return A$1({ ourProps: { ref: e.buttonRef, id: n, type: m.value, "aria-haspopup": "listbox", "aria-controls": (y = o$3(e.optionsRef)) == null ? void 0 : y.id, "aria-expanded": e.listboxState.value === 0, "aria-labelledby": e.labelRef.value ? [(L = o$3(e.labelRef)) == null ? void 0 : L.id, n].join(" ") : void 0, disabled: e.disabled.value === !0 ? !0 : void 0, onKeydown: f, onKeyup: v, onClick: s$3 }, theirProps: u, slot: a, attrs: b, slots: r, name: "ListboxButton" }); }; } }), Ae = (0, vue.defineComponent)({ name: "ListboxOptions", props: { as: { type: [Object, String], default: "ul" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, id: { type: String, default: null } }, setup(o, { attrs: b, slots: r, expose: w }) { var p; let n = (p = o.id) != null ? p : `headlessui-listbox-options-${i$4()}`, e = A("ListboxOptions"), f = (0, vue.ref)(null); w({ el: e.optionsRef, $el: e.optionsRef }); function v(a) { switch (f.value && clearTimeout(f.value), a.key) { case o$2.Space: if (e.searchQuery.value !== "") return a.preventDefault(), a.stopPropagation(), e.search(a.key); case o$2.Enter: if (a.preventDefault(), a.stopPropagation(), e.activeOptionIndex.value !== null) { let u = e.options.value[e.activeOptionIndex.value]; e.select(u.dataRef.value); } e.mode.value === 0 && (e.closeListbox(), (0, vue.nextTick)(() => { var u; return (u = o$3(e.buttonRef)) == null ? void 0 : u.focus({ preventScroll: !0 }); })); break; case u$5(e.orientation.value, { vertical: o$2.ArrowDown, horizontal: o$2.ArrowRight }): return a.preventDefault(), a.stopPropagation(), e.goToOption(c.Next); case u$5(e.orientation.value, { vertical: o$2.ArrowUp, horizontal: o$2.ArrowLeft }): return a.preventDefault(), a.stopPropagation(), e.goToOption(c.Previous); case o$2.Home: case o$2.PageUp: return a.preventDefault(), a.stopPropagation(), e.goToOption(c.First); case o$2.End: case o$2.PageDown: return a.preventDefault(), a.stopPropagation(), e.goToOption(c.Last); case o$2.Escape: a.preventDefault(), a.stopPropagation(), e.closeListbox(), (0, vue.nextTick)(() => { var u; return (u = o$3(e.buttonRef)) == null ? void 0 : u.focus({ preventScroll: !0 }); }); break; case o$2.Tab: a.preventDefault(), a.stopPropagation(); break; default: a.key.length === 1 && (e.search(a.key), f.value = setTimeout(() => e.clearSearch(), 350)); break; } } let s = l(), m = (0, vue.computed)(() => s !== null ? (s.value & i.Open) === i.Open : e.listboxState.value === 0); return () => { var y, L; let a = { open: e.listboxState.value === 0 }, { ...u } = o; return A$1({ ourProps: { "aria-activedescendant": e.activeOptionIndex.value === null || (y = e.options.value[e.activeOptionIndex.value]) == null ? void 0 : y.id, "aria-multiselectable": e.mode.value === 1 ? !0 : void 0, "aria-labelledby": (L = o$3(e.buttonRef)) == null ? void 0 : L.id, "aria-orientation": e.orientation.value, id: n, onKeydown: v, role: "listbox", tabIndex: 0, ref: e.optionsRef }, theirProps: u, slot: a, attrs: b, slots: r, features: N$1.RenderStrategy | N$1.Static, visible: m.value, name: "ListboxOptions" }); }; } }), Fe = (0, vue.defineComponent)({ name: "ListboxOption", props: { as: { type: [Object, String], default: "li" }, value: { type: [ Object, String, Number, Boolean ] }, disabled: { type: Boolean, default: !1 }, id: { type: String, default: null } }, setup(o, { slots: b, attrs: r, expose: w }) { var C; let n = (C = o.id) != null ? C : `headlessui-listbox-option-${i$4()}`, e = A("ListboxOption"), f = (0, vue.ref)(null); w({ el: f, $el: f }); let v = (0, vue.computed)(() => e.activeOptionIndex.value !== null ? e.options.value[e.activeOptionIndex.value].id === n : !1), s = (0, vue.computed)(() => u$5(e.mode.value, { [0]: () => e.compare((0, vue.toRaw)(e.value.value), (0, vue.toRaw)(o.value)), [1]: () => (0, vue.toRaw)(e.value.value).some((t) => e.compare((0, vue.toRaw)(t), (0, vue.toRaw)(o.value))) })), m = (0, vue.computed)(() => u$5(e.mode.value, { [1]: () => { var i; let t = (0, vue.toRaw)(e.value.value); return ((i = e.options.value.find((l) => t.some((d) => e.compare((0, vue.toRaw)(d), (0, vue.toRaw)(l.dataRef.value))))) == null ? void 0 : i.id) === n; }, [0]: () => s.value })), p$2 = p(f), a = (0, vue.computed)(() => ({ disabled: o.disabled, value: o.value, get textValue() { return p$2(); }, domRef: f })); (0, vue.onMounted)(() => e.registerOption(n, a)), (0, vue.onUnmounted)(() => e.unregisterOption(n)), (0, vue.onMounted)(() => { (0, vue.watch)([e.listboxState, s], () => { e.listboxState.value === 0 && s.value && u$5(e.mode.value, { [1]: () => { m.value && e.goToOption(c.Specific, n); }, [0]: () => { e.goToOption(c.Specific, n); } }); }, { immediate: !0 }); }), (0, vue.watchEffect)(() => { e.listboxState.value === 0 && v.value && e.activationTrigger.value !== 0 && (0, vue.nextTick)(() => { var t, i; return (i = (t = o$3(f)) == null ? void 0 : t.scrollIntoView) == null ? void 0 : i.call(t, { block: "nearest" }); }); }); function u(t) { if (o.disabled) return t.preventDefault(); e.select(o.value), e.mode.value === 0 && (e.closeListbox(), (0, vue.nextTick)(() => { var i; return (i = o$3(e.buttonRef)) == null ? void 0 : i.focus({ preventScroll: !0 }); })); } function D() { if (o.disabled) return e.goToOption(c.Nothing); e.goToOption(c.Specific, n); } let y = u$3(); function L(t) { y.update(t); } function M(t) { y.wasMoved(t) && (o.disabled || v.value || e.goToOption(c.Specific, n, 0)); } function k(t) { y.wasMoved(t) && (o.disabled || v.value && e.goToOption(c.Nothing)); } return () => { let { disabled: t } = o, i = { active: v.value, selected: s.value, disabled: t }, { value: l, disabled: d, ...O } = o; return A$1({ ourProps: { id: n, ref: f, role: "option", tabIndex: t === !0 ? void 0 : -1, "aria-disabled": t === !0 ? !0 : void 0, "aria-selected": s.value, disabled: void 0, onClick: u, onFocus: D, onPointerenter: L, onMouseenter: L, onPointermove: M, onMousemove: M, onPointerleave: k, onMouseleave: k }, theirProps: O, slot: i, attrs: r, slots: b, name: "ListboxOption" }); }; } }); var a = Symbol("LabelContext"); function d() { let t = (0, vue.inject)(a, null); if (t === null) { let n = new Error("You used a