UNPKG

@claudebernard/search-bar-element

Version:

An element providing some custom stuff.

1,386 lines (1,385 loc) 207 kB
var __defProp = Object.defineProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); var _a; import "@claudebernard/design-system"; const __variableDynamicImportRuntimeHelper = (glob, path, segs) => { const v2 = glob[path]; if (v2) { return typeof v2 === "function" ? v2() : Promise.resolve(v2); } return new Promise((_2, reject) => { (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)( reject.bind( null, new Error( "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "") ) ) ); }); }; /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const LOCALE_STATUS_EVENT = "lit-localize-status"; let installed = false; function _installMsgImplementation(impl) { if (installed) { throw new Error("lit-localize can only be configured once"); } installed = true; } /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ class LocalizeController { constructor(host) { this.__litLocalizeEventHandler = (event) => { if (event.detail.status === "ready") { this.host.requestUpdate(); } }; this.host = host; } hostConnected() { window.addEventListener(LOCALE_STATUS_EVENT, this.__litLocalizeEventHandler); } hostDisconnected() { window.removeEventListener(LOCALE_STATUS_EVENT, this.__litLocalizeEventHandler); } } const _updateWhenLocaleChanges = (host) => host.addController(new LocalizeController(host)); const updateWhenLocaleChanges = _updateWhenLocaleChanges; /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const localized = () => (clazz, _context) => { clazz.addInitializer(updateWhenLocaleChanges); return clazz; }; /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ class Deferred { constructor() { this.settled = false; this.promise = new Promise((resolve, reject) => { this._resolve = resolve; this._reject = reject; }); } resolve(value) { this.settled = true; this._resolve(value); } reject(error) { this.settled = true; this._reject(error); } } /** * @license * Copyright 2014 Travis Webb * SPDX-License-Identifier: MIT */ for (let i3 = 0; i3 < 256; i3++) { (i3 >> 4 & 15).toString(16) + (i3 & 15).toString(16); } /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ function dispatchStatusEvent(detail) { window.dispatchEvent(new CustomEvent(LOCALE_STATUS_EVENT, { detail })); } let activeLocale = ""; let loadingLocale; let sourceLocale$1; let validLocales; let loadLocale; let loading = new Deferred(); loading.resolve(); let requestId = 0; const configureLocalization = (config) => { _installMsgImplementation(); activeLocale = sourceLocale$1 = config.sourceLocale; validLocales = new Set(config.targetLocales); validLocales.add(config.sourceLocale); loadLocale = config.loadLocale; return { getLocale, setLocale: setLocale$1 }; }; const getLocale = () => { return activeLocale; }; const setLocale$1 = (newLocale) => { if (newLocale === (loadingLocale ?? activeLocale)) { return loading.promise; } if (!validLocales || !loadLocale) { throw new Error("Internal error"); } if (!validLocales.has(newLocale)) { throw new Error("Invalid locale code"); } requestId++; const thisRequestId = requestId; loadingLocale = newLocale; if (loading.settled) { loading = new Deferred(); } dispatchStatusEvent({ status: "loading", loadingLocale: newLocale }); const localePromise = newLocale === sourceLocale$1 ? ( // We could switch to the source locale synchronously, but we prefer to // queue it on a microtask so that switching locales is consistently // asynchronous. Promise.resolve({ templates: void 0 }) ) : loadLocale(newLocale); localePromise.then((mod) => { if (requestId === thisRequestId) { activeLocale = newLocale; loadingLocale = void 0; mod.templates; dispatchStatusEvent({ status: "ready", readyLocale: newLocale }); loading.resolve(); } }, (err) => { if (requestId === thisRequestId) { dispatchStatusEvent({ status: "error", errorLocale: newLocale, errorMessage: err.toString() }); loading.reject(err); } }); return loading.promise; }; var __defProp$4 = Object.defineProperty; var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField2 = (obj, key, value) => { __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; var __accessCheck = (obj, member, msg) => { if (!member.has(obj)) throw TypeError("Cannot " + msg); }; var __privateIn = (member, obj) => { if (Object(obj) !== obj) throw TypeError('Cannot use the "in" operator on this value'); return member.has(obj); }; var __privateAdd = (obj, member, value) => { if (member.has(obj)) throw TypeError("Cannot add the same private member more than once"); member instanceof WeakSet ? member.add(obj) : member.set(obj, value); }; var __privateMethod = (obj, member, method) => { __accessCheck(obj, member, "access private method"); return method; }; /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function defaultEquals(a2, b2) { return Object.is(a2, b2); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ let activeConsumer = null; let inNotificationPhase = false; let epoch = 1; const SIGNAL = /* @__PURE__ */ Symbol("SIGNAL"); function setActiveConsumer(consumer) { const prev = activeConsumer; activeConsumer = consumer; return prev; } function getActiveConsumer() { return activeConsumer; } function isInNotificationPhase() { return inNotificationPhase; } const REACTIVE_NODE = { version: 0, lastCleanEpoch: 0, dirty: false, producerNode: void 0, producerLastReadVersion: void 0, producerIndexOfThis: void 0, nextProducerIndex: 0, liveConsumerNode: void 0, liveConsumerIndexOfThis: void 0, consumerAllowSignalWrites: false, consumerIsAlwaysLive: false, producerMustRecompute: () => false, producerRecomputeValue: () => { }, consumerMarkedDirty: () => { }, consumerOnSignalRead: () => { } }; function producerAccessed(node) { if (inNotificationPhase) { throw new Error( typeof ngDevMode !== "undefined" && ngDevMode ? `Assertion error: signal read during notification phase` : "" ); } if (activeConsumer === null) { return; } activeConsumer.consumerOnSignalRead(node); const idx = activeConsumer.nextProducerIndex++; assertConsumerNode(activeConsumer); if (idx < activeConsumer.producerNode.length && activeConsumer.producerNode[idx] !== node) { if (consumerIsLive(activeConsumer)) { const staleProducer = activeConsumer.producerNode[idx]; producerRemoveLiveConsumerAtIndex(staleProducer, activeConsumer.producerIndexOfThis[idx]); } } if (activeConsumer.producerNode[idx] !== node) { activeConsumer.producerNode[idx] = node; activeConsumer.producerIndexOfThis[idx] = consumerIsLive(activeConsumer) ? producerAddLiveConsumer(node, activeConsumer, idx) : 0; } activeConsumer.producerLastReadVersion[idx] = node.version; } function producerIncrementEpoch() { epoch++; } function producerUpdateValueVersion(node) { if (!node.dirty && node.lastCleanEpoch === epoch) { return; } if (!node.producerMustRecompute(node) && !consumerPollProducersForChange(node)) { node.dirty = false; node.lastCleanEpoch = epoch; return; } node.producerRecomputeValue(node); node.dirty = false; node.lastCleanEpoch = epoch; } function producerNotifyConsumers(node) { if (node.liveConsumerNode === void 0) { return; } const prev = inNotificationPhase; inNotificationPhase = true; try { for (const consumer of node.liveConsumerNode) { if (!consumer.dirty) { consumerMarkDirty(consumer); } } } finally { inNotificationPhase = prev; } } function producerUpdatesAllowed() { return (activeConsumer == null ? void 0 : activeConsumer.consumerAllowSignalWrites) !== false; } function consumerMarkDirty(node) { var _a2; node.dirty = true; producerNotifyConsumers(node); (_a2 = node.consumerMarkedDirty) == null ? void 0 : _a2.call(node.wrapper ?? node); } function consumerBeforeComputation(node) { node && (node.nextProducerIndex = 0); return setActiveConsumer(node); } function consumerAfterComputation(node, prevConsumer) { setActiveConsumer(prevConsumer); if (!node || node.producerNode === void 0 || node.producerIndexOfThis === void 0 || node.producerLastReadVersion === void 0) { return; } if (consumerIsLive(node)) { for (let i3 = node.nextProducerIndex; i3 < node.producerNode.length; i3++) { producerRemoveLiveConsumerAtIndex(node.producerNode[i3], node.producerIndexOfThis[i3]); } } while (node.producerNode.length > node.nextProducerIndex) { node.producerNode.pop(); node.producerLastReadVersion.pop(); node.producerIndexOfThis.pop(); } } function consumerPollProducersForChange(node) { assertConsumerNode(node); for (let i3 = 0; i3 < node.producerNode.length; i3++) { const producer = node.producerNode[i3]; const seenVersion = node.producerLastReadVersion[i3]; if (seenVersion !== producer.version) { return true; } producerUpdateValueVersion(producer); if (seenVersion !== producer.version) { return true; } } return false; } function producerAddLiveConsumer(node, consumer, indexOfThis) { var _a2; assertProducerNode(node); assertConsumerNode(node); if (node.liveConsumerNode.length === 0) { (_a2 = node.watched) == null ? void 0 : _a2.call(node.wrapper); for (let i3 = 0; i3 < node.producerNode.length; i3++) { node.producerIndexOfThis[i3] = producerAddLiveConsumer(node.producerNode[i3], node, i3); } } node.liveConsumerIndexOfThis.push(indexOfThis); return node.liveConsumerNode.push(consumer) - 1; } function producerRemoveLiveConsumerAtIndex(node, idx) { var _a2; assertProducerNode(node); assertConsumerNode(node); if (typeof ngDevMode !== "undefined" && ngDevMode && idx >= node.liveConsumerNode.length) { throw new Error( `Assertion error: active consumer index ${idx} is out of bounds of ${node.liveConsumerNode.length} consumers)` ); } if (node.liveConsumerNode.length === 1) { (_a2 = node.unwatched) == null ? void 0 : _a2.call(node.wrapper); for (let i3 = 0; i3 < node.producerNode.length; i3++) { producerRemoveLiveConsumerAtIndex(node.producerNode[i3], node.producerIndexOfThis[i3]); } } const lastIdx = node.liveConsumerNode.length - 1; node.liveConsumerNode[idx] = node.liveConsumerNode[lastIdx]; node.liveConsumerIndexOfThis[idx] = node.liveConsumerIndexOfThis[lastIdx]; node.liveConsumerNode.length--; node.liveConsumerIndexOfThis.length--; if (idx < node.liveConsumerNode.length) { const idxProducer = node.liveConsumerIndexOfThis[idx]; const consumer = node.liveConsumerNode[idx]; assertConsumerNode(consumer); consumer.producerIndexOfThis[idxProducer] = idx; } } function consumerIsLive(node) { var _a2; return node.consumerIsAlwaysLive || (((_a2 = node == null ? void 0 : node.liveConsumerNode) == null ? void 0 : _a2.length) ?? 0) > 0; } function assertConsumerNode(node) { node.producerNode ?? (node.producerNode = []); node.producerIndexOfThis ?? (node.producerIndexOfThis = []); node.producerLastReadVersion ?? (node.producerLastReadVersion = []); } function assertProducerNode(node) { node.liveConsumerNode ?? (node.liveConsumerNode = []); node.liveConsumerIndexOfThis ?? (node.liveConsumerIndexOfThis = []); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function computedGet(node) { producerUpdateValueVersion(node); producerAccessed(node); if (node.value === ERRORED) { throw node.error; } return node.value; } function createComputed(computation) { const node = Object.create(COMPUTED_NODE); node.computation = computation; const computed = () => computedGet(node); computed[SIGNAL] = node; return computed; } const UNSET = /* @__PURE__ */ Symbol("UNSET"); const COMPUTING = /* @__PURE__ */ Symbol("COMPUTING"); const ERRORED = /* @__PURE__ */ Symbol("ERRORED"); const COMPUTED_NODE = /* @__PURE__ */ (() => { return { ...REACTIVE_NODE, value: UNSET, dirty: true, error: null, equal: defaultEquals, producerMustRecompute(node) { return node.value === UNSET || node.value === COMPUTING; }, producerRecomputeValue(node) { if (node.value === COMPUTING) { throw new Error("Detected cycle in computations."); } const oldValue = node.value; node.value = COMPUTING; const prevConsumer = consumerBeforeComputation(node); let newValue; let wasEqual = false; try { newValue = node.computation.call(node.wrapper); const oldOk = oldValue !== UNSET && oldValue !== ERRORED; wasEqual = oldOk && node.equal.call(node.wrapper, oldValue, newValue); } catch (err) { newValue = ERRORED; node.error = err; } finally { consumerAfterComputation(node, prevConsumer); } if (wasEqual) { node.value = oldValue; return; } node.value = newValue; node.version++; } }; })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function defaultThrowError() { throw new Error(); } let throwInvalidWriteToSignalErrorFn = defaultThrowError; function throwInvalidWriteToSignalError() { throwInvalidWriteToSignalErrorFn(); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function createSignal(initialValue) { const node = Object.create(SIGNAL_NODE); node.value = initialValue; const getter = () => { producerAccessed(node); return node.value; }; getter[SIGNAL] = node; return getter; } function signalGetFn() { producerAccessed(this); return this.value; } function signalSetFn(node, newValue) { if (!producerUpdatesAllowed()) { throwInvalidWriteToSignalError(); } if (!node.equal.call(node.wrapper, node.value, newValue)) { node.value = newValue; signalValueChanged(node); } } const SIGNAL_NODE = /* @__PURE__ */ (() => { return { ...REACTIVE_NODE, equal: defaultEquals, value: void 0 }; })(); function signalValueChanged(node) { node.version++; producerIncrementEpoch(); producerNotifyConsumers(node); } /** * @license * Copyright 2024 Bloomberg Finance L.P. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ const NODE = Symbol("node"); var Signal; ((Signal2) => { var _a2, _brand, _b, _brand2; class State { constructor(initialValue, options = {}) { __privateAdd(this, _brand); __publicField2(this, _a2); const ref = createSignal(initialValue); const node = ref[SIGNAL]; this[NODE] = node; node.wrapper = this; if (options) { const equals = options.equals; if (equals) { node.equal = equals; } node.watched = options[Signal2.subtle.watched]; node.unwatched = options[Signal2.subtle.unwatched]; } } get() { if (!(0, Signal2.isState)(this)) throw new TypeError("Wrong receiver type for Signal.State.prototype.get"); return signalGetFn.call(this[NODE]); } set(newValue) { if (!(0, Signal2.isState)(this)) throw new TypeError("Wrong receiver type for Signal.State.prototype.set"); if (isInNotificationPhase()) { throw new Error("Writes to signals not permitted during Watcher callback"); } const ref = this[NODE]; signalSetFn(ref, newValue); } } _a2 = NODE; _brand = /* @__PURE__ */ new WeakSet(); Signal2.isState = (s2) => typeof s2 === "object" && __privateIn(_brand, s2); Signal2.State = State; class Computed { // Create a Signal which evaluates to the value returned by the callback. // Callback is called with this signal as the parameter. constructor(computation, options) { __privateAdd(this, _brand2); __publicField2(this, _b); const ref = createComputed(computation); const node = ref[SIGNAL]; node.consumerAllowSignalWrites = true; this[NODE] = node; node.wrapper = this; if (options) { const equals = options.equals; if (equals) { node.equal = equals; } node.watched = options[Signal2.subtle.watched]; node.unwatched = options[Signal2.subtle.unwatched]; } } get() { if (!(0, Signal2.isComputed)(this)) throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get"); return computedGet(this[NODE]); } } _b = NODE; _brand2 = /* @__PURE__ */ new WeakSet(); Signal2.isComputed = (c2) => typeof c2 === "object" && __privateIn(_brand2, c2); Signal2.Computed = Computed; ((subtle2) => { var _a22, _brand3, _assertSignals, assertSignals_fn; function untrack(cb) { let output; let prevActiveConsumer = null; try { prevActiveConsumer = setActiveConsumer(null); output = cb(); } finally { setActiveConsumer(prevActiveConsumer); } return output; } subtle2.untrack = untrack; function introspectSources(sink) { var _a3; if (!(0, Signal2.isComputed)(sink) && !(0, Signal2.isWatcher)(sink)) { throw new TypeError("Called introspectSources without a Computed or Watcher argument"); } return ((_a3 = sink[NODE].producerNode) == null ? void 0 : _a3.map((n3) => n3.wrapper)) ?? []; } subtle2.introspectSources = introspectSources; function introspectSinks(signal) { var _a3; if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isState)(signal)) { throw new TypeError("Called introspectSinks without a Signal argument"); } return ((_a3 = signal[NODE].liveConsumerNode) == null ? void 0 : _a3.map((n3) => n3.wrapper)) ?? []; } subtle2.introspectSinks = introspectSinks; function hasSinks(signal) { if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isState)(signal)) { throw new TypeError("Called hasSinks without a Signal argument"); } const liveConsumerNode = signal[NODE].liveConsumerNode; if (!liveConsumerNode) return false; return liveConsumerNode.length > 0; } subtle2.hasSinks = hasSinks; function hasSources(signal) { if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isWatcher)(signal)) { throw new TypeError("Called hasSources without a Computed or Watcher argument"); } const producerNode = signal[NODE].producerNode; if (!producerNode) return false; return producerNode.length > 0; } subtle2.hasSources = hasSources; class Watcher { // When a (recursive) source of Watcher is written to, call this callback, // if it hasn't already been called since the last `watch` call. // No signals may be read or written during the notify. constructor(notify) { __privateAdd(this, _brand3); __privateAdd(this, _assertSignals); __publicField2(this, _a22); let node = Object.create(REACTIVE_NODE); node.wrapper = this; node.consumerMarkedDirty = notify; node.consumerIsAlwaysLive = true; node.consumerAllowSignalWrites = false; node.producerNode = []; this[NODE] = node; } // Add these signals to the Watcher's set, and set the watcher to run its // notify callback next time any signal in the set (or one of its dependencies) changes. // Can be called with no arguments just to reset the "notified" state, so that // the notify callback will be invoked again. watch(...signals) { if (!(0, Signal2.isWatcher)(this)) { throw new TypeError("Called unwatch without Watcher receiver"); } __privateMethod(this, _assertSignals, assertSignals_fn).call(this, signals); const node = this[NODE]; node.dirty = false; const prev = setActiveConsumer(node); for (const signal of signals) { producerAccessed(signal[NODE]); } setActiveConsumer(prev); } // Remove these signals from the watched set (e.g., for an effect which is disposed) unwatch(...signals) { if (!(0, Signal2.isWatcher)(this)) { throw new TypeError("Called unwatch without Watcher receiver"); } __privateMethod(this, _assertSignals, assertSignals_fn).call(this, signals); const node = this[NODE]; assertConsumerNode(node); for (let i3 = node.producerNode.length - 1; i3 >= 0; i3--) { if (signals.includes(node.producerNode[i3].wrapper)) { producerRemoveLiveConsumerAtIndex(node.producerNode[i3], node.producerIndexOfThis[i3]); const lastIdx = node.producerNode.length - 1; node.producerNode[i3] = node.producerNode[lastIdx]; node.producerIndexOfThis[i3] = node.producerIndexOfThis[lastIdx]; node.producerNode.length--; node.producerIndexOfThis.length--; node.nextProducerIndex--; if (i3 < node.producerNode.length) { const idxConsumer = node.producerIndexOfThis[i3]; const producer = node.producerNode[i3]; assertProducerNode(producer); producer.liveConsumerIndexOfThis[idxConsumer] = i3; } } } } // Returns the set of computeds in the Watcher's set which are still yet // to be re-evaluated getPending() { if (!(0, Signal2.isWatcher)(this)) { throw new TypeError("Called getPending without Watcher receiver"); } const node = this[NODE]; return node.producerNode.filter((n3) => n3.dirty).map((n3) => n3.wrapper); } } _a22 = NODE; _brand3 = /* @__PURE__ */ new WeakSet(); _assertSignals = /* @__PURE__ */ new WeakSet(); assertSignals_fn = function(signals) { for (const signal of signals) { if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isState)(signal)) { throw new TypeError("Called watch/unwatch without a Computed or State argument"); } } }; Signal2.isWatcher = (w2) => __privateIn(_brand3, w2); subtle2.Watcher = Watcher; function currentComputed() { var _a3; return (_a3 = getActiveConsumer()) == null ? void 0 : _a3.wrapper; } subtle2.currentComputed = currentComputed; subtle2.watched = Symbol("watched"); subtle2.unwatched = Symbol("unwatched"); })(Signal2.subtle || (Signal2.subtle = {})); })(Signal || (Signal = {})); /** * @license * Copyright 2023 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const i$6 = Symbol("SignalWatcherBrand"), s$5 = new FinalizationRegistry(({ watcher: t2, signal: i3 }) => { t2.unwatch(i3); }), h$5 = /* @__PURE__ */ new WeakMap(); function e$6(e2) { return true === e2[i$6] ? (console.warn("SignalWatcher should not be applied to the same class more than once."), e2) : class extends e2 { constructor() { super(...arguments), this._$St = new Signal.State(0), this._$Si = false, this._$So = true, this._$Sh = /* @__PURE__ */ new Set(); } _$Sl() { if (void 0 !== this._$Su) return; this._$Sv = new Signal.Computed(() => { this._$St.get(), super.performUpdate(); }); const i3 = this._$Su = new Signal.subtle.Watcher(function() { const t2 = h$5.get(this); void 0 !== t2 && (false === t2._$Si && t2.requestUpdate(), this.watch()); }); h$5.set(i3, this), s$5.register(this, { watcher: i3, signal: this._$Sv }), i3.watch(this._$Sv); } _$Sp() { void 0 !== this._$Su && (this._$Su.unwatch(this._$Sv), this._$Sv = void 0, this._$Su = void 0); } performUpdate() { this.isUpdatePending && (this._$Sl(), this._$Si = true, this._$St.set(this._$St.get() + 1), this._$Si = false, this._$Sv.get()); } update(t2) { try { this._$So ? (this._$So = false, super.update(t2)) : this._$Sh.forEach((t3) => t3.commit()); } finally { this.isUpdatePending = false, this._$Sh.clear(); } } requestUpdate(t2, i3, s2) { this._$So = true, super.requestUpdate(t2, i3, s2); } connectedCallback() { super.connectedCallback(), this.requestUpdate(); } disconnectedCallback() { super.disconnectedCallback(), queueMicrotask(() => { false === this.isConnected && this._$Sp(); }); } _(t2) { this._$Sh.add(t2); const i3 = this._$So; this.requestUpdate(), this._$So = i3; } m(t2) { this._$Sh.delete(t2); } }; } /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const t$3 = { ATTRIBUTE: 1, CHILD: 2 }, e$5 = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 }); let i$5 = class i { constructor(t2) { } get _$AU() { return this._$AM._$AU; } _$AT(t2, e2, i3) { this._$Ct = t2, this._$AM = e2, this._$Ci = i3; } _$AS(t2, e2) { return this.update(t2, e2); } update(t2, e2) { return this.render(...e2); } }; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const t$2 = globalThis, i$4 = t$2.trustedTypes, s$4 = i$4 ? i$4.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, e$4 = "$lit$", h$4 = `lit$${Math.random().toFixed(9).slice(2)}$`, o$6 = "?" + h$4, n$6 = `<${o$6}>`, r$7 = document, l$1 = () => r$7.createComment(""), c$3 = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, a$2 = Array.isArray, u$1 = (t2) => a$2(t2) || "function" == typeof (t2 == null ? void 0 : t2[Symbol.iterator]), d$1 = "[ \n\f\r]", f$3 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v = /-->/g, _$1 = />/g, m = RegExp(`>|${d$1}(?:([^\\s"'>=/]+)(${d$1}*=${d$1}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"), p$1 = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, y$2 = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }), x$1 = y$2(1), T$1 = Symbol.for("lit-noChange"), E$1 = Symbol.for("lit-nothing"), A$1 = /* @__PURE__ */ new WeakMap(), C$1 = r$7.createTreeWalker(r$7, 129); function P$1(t2, i3) { if (!a$2(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); return void 0 !== s$4 ? s$4.createHTML(i3) : i3; } const V = (t2, i3) => { const s2 = t2.length - 1, o2 = []; let r2, l2 = 2 === i3 ? "<svg>" : 3 === i3 ? "<math>" : "", c2 = f$3; for (let i4 = 0; i4 < s2; i4++) { const s3 = t2[i4]; let a2, u2, d2 = -1, y2 = 0; for (; y2 < s3.length && (c2.lastIndex = y2, u2 = c2.exec(s3), null !== u2); ) y2 = c2.lastIndex, c2 === f$3 ? "!--" === u2[1] ? c2 = v : void 0 !== u2[1] ? c2 = _$1 : void 0 !== u2[2] ? ($.test(u2[2]) && (r2 = RegExp("</" + u2[2], "g")), c2 = m) : void 0 !== u2[3] && (c2 = m) : c2 === m ? ">" === u2[0] ? (c2 = r2 ?? f$3, d2 = -1) : void 0 === u2[1] ? d2 = -2 : (d2 = c2.lastIndex - u2[2].length, a2 = u2[1], c2 = void 0 === u2[3] ? m : '"' === u2[3] ? g : p$1) : c2 === g || c2 === p$1 ? c2 = m : c2 === v || c2 === _$1 ? c2 = f$3 : (c2 = m, r2 = void 0); const x2 = c2 === m && t2[i4 + 1].startsWith("/>") ? " " : ""; l2 += c2 === f$3 ? s3 + n$6 : d2 >= 0 ? (o2.push(a2), s3.slice(0, d2) + e$4 + s3.slice(d2) + h$4 + x2) : s3 + h$4 + (-2 === d2 ? i4 : x2); } return [P$1(t2, l2 + (t2[s2] || "<?>") + (2 === i3 ? "</svg>" : 3 === i3 ? "</math>" : "")), o2]; }; let N$1 = class N { constructor({ strings: t2, _$litType$: s2 }, n3) { let r2; this.parts = []; let c2 = 0, a2 = 0; const u2 = t2.length - 1, d2 = this.parts, [f3, v2] = V(t2, s2); if (this.el = N.createElement(f3, n3), C$1.currentNode = this.el.content, 2 === s2 || 3 === s2) { const t3 = this.el.content.firstChild; t3.replaceWith(...t3.childNodes); } for (; null !== (r2 = C$1.nextNode()) && d2.length < u2; ) { if (1 === r2.nodeType) { if (r2.hasAttributes()) for (const t3 of r2.getAttributeNames()) if (t3.endsWith(e$4)) { const i3 = v2[a2++], s3 = r2.getAttribute(t3).split(h$4), e2 = /([.?@])?(.*)/.exec(i3); d2.push({ type: 1, index: c2, name: e2[2], strings: s3, ctor: "." === e2[1] ? H$1 : "?" === e2[1] ? I$1 : "@" === e2[1] ? L : k }), r2.removeAttribute(t3); } else t3.startsWith(h$4) && (d2.push({ type: 6, index: c2 }), r2.removeAttribute(t3)); if ($.test(r2.tagName)) { const t3 = r2.textContent.split(h$4), s3 = t3.length - 1; if (s3 > 0) { r2.textContent = i$4 ? i$4.emptyScript : ""; for (let i3 = 0; i3 < s3; i3++) r2.append(t3[i3], l$1()), C$1.nextNode(), d2.push({ type: 2, index: ++c2 }); r2.append(t3[s3], l$1()); } } } else if (8 === r2.nodeType) if (r2.data === o$6) d2.push({ type: 2, index: c2 }); else { let t3 = -1; for (; -1 !== (t3 = r2.data.indexOf(h$4, t3 + 1)); ) d2.push({ type: 7, index: c2 }), t3 += h$4.length - 1; } c2++; } } static createElement(t2, i3) { const s2 = r$7.createElement("template"); return s2.innerHTML = t2, s2; } }; function S$2(t2, i3, s2 = t2, e2) { var _a2, _b; if (i3 === T$1) return i3; let h3 = void 0 !== e2 ? (_a2 = s2._$Co) == null ? void 0 : _a2[e2] : s2._$Cl; const o2 = c$3(i3) ? void 0 : i3._$litDirective$; return (h3 == null ? void 0 : h3.constructor) !== o2 && ((_b = h3 == null ? void 0 : h3._$AO) == null ? void 0 : _b.call(h3, false), void 0 === o2 ? h3 = void 0 : (h3 = new o2(t2), h3._$AT(t2, s2, e2)), void 0 !== e2 ? (s2._$Co ?? (s2._$Co = []))[e2] = h3 : s2._$Cl = h3), void 0 !== h3 && (i3 = S$2(t2, h3._$AS(t2, i3.values), h3, e2)), i3; } class M { constructor(t2, i3) { this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; } get parentNode() { return this._$AM.parentNode; } get _$AU() { return this._$AM._$AU; } u(t2) { const { el: { content: i3 }, parts: s2 } = this._$AD, e2 = ((t2 == null ? void 0 : t2.creationScope) ?? r$7).importNode(i3, true); C$1.currentNode = e2; let h3 = C$1.nextNode(), o2 = 0, n3 = 0, l2 = s2[0]; for (; void 0 !== l2; ) { if (o2 === l2.index) { let i4; 2 === l2.type ? i4 = new R$1(h3, h3.nextSibling, this, t2) : 1 === l2.type ? i4 = new l2.ctor(h3, l2.name, l2.strings, this, t2) : 6 === l2.type && (i4 = new z(h3, this, t2)), this._$AV.push(i4), l2 = s2[++n3]; } o2 !== (l2 == null ? void 0 : l2.index) && (h3 = C$1.nextNode(), o2++); } return C$1.currentNode = r$7, e2; } p(t2) { let i3 = 0; for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; } } let R$1 = class R { get _$AU() { var _a2; return ((_a2 = this._$AM) == null ? void 0 : _a2._$AU) ?? this._$Cv; } constructor(t2, i3, s2, e2) { this.type = 2, this._$AH = E$1, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e2, this._$Cv = (e2 == null ? void 0 : e2.isConnected) ?? true; } get parentNode() { let t2 = this._$AA.parentNode; const i3 = this._$AM; return void 0 !== i3 && 11 === (t2 == null ? void 0 : t2.nodeType) && (t2 = i3.parentNode), t2; } get startNode() { return this._$AA; } get endNode() { return this._$AB; } _$AI(t2, i3 = this) { t2 = S$2(this, t2, i3), c$3(t2) ? t2 === E$1 || null == t2 || "" === t2 ? (this._$AH !== E$1 && this._$AR(), this._$AH = E$1) : t2 !== this._$AH && t2 !== T$1 && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : u$1(t2) ? this.k(t2) : this._(t2); } O(t2) { return this._$AA.parentNode.insertBefore(t2, this._$AB); } T(t2) { this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); } _(t2) { this._$AH !== E$1 && c$3(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(r$7.createTextNode(t2)), this._$AH = t2; } $(t2) { var _a2; const { values: i3, _$litType$: s2 } = t2, e2 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = N$1.createElement(P$1(s2.h, s2.h[0]), this.options)), s2); if (((_a2 = this._$AH) == null ? void 0 : _a2._$AD) === e2) this._$AH.p(i3); else { const t3 = new M(e2, this), s3 = t3.u(this.options); t3.p(i3), this.T(s3), this._$AH = t3; } } _$AC(t2) { let i3 = A$1.get(t2.strings); return void 0 === i3 && A$1.set(t2.strings, i3 = new N$1(t2)), i3; } k(t2) { a$2(this._$AH) || (this._$AH = [], this._$AR()); const i3 = this._$AH; let s2, e2 = 0; for (const h3 of t2) e2 === i3.length ? i3.push(s2 = new R(this.O(l$1()), this.O(l$1()), this, this.options)) : s2 = i3[e2], s2._$AI(h3), e2++; e2 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e2), i3.length = e2); } _$AR(t2 = this._$AA.nextSibling, i3) { var _a2; for ((_a2 = this._$AP) == null ? void 0 : _a2.call(this, false, true, i3); t2 && t2 !== this._$AB; ) { const i4 = t2.nextSibling; t2.remove(), t2 = i4; } } setConnected(t2) { var _a2; void 0 === this._$AM && (this._$Cv = t2, (_a2 = this._$AP) == null ? void 0 : _a2.call(this, t2)); } }; class k { get tagName() { return this.element.tagName; } get _$AU() { return this._$AM._$AU; } constructor(t2, i3, s2, e2, h3) { this.type = 1, this._$AH = E$1, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e2, this.options = h3, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = E$1; } _$AI(t2, i3 = this, s2, e2) { const h3 = this.strings; let o2 = false; if (void 0 === h3) t2 = S$2(this, t2, i3, 0), o2 = !c$3(t2) || t2 !== this._$AH && t2 !== T$1, o2 && (this._$AH = t2); else { const e3 = t2; let n3, r2; for (t2 = h3[0], n3 = 0; n3 < h3.length - 1; n3++) r2 = S$2(this, e3[s2 + n3], i3, n3), r2 === T$1 && (r2 = this._$AH[n3]), o2 || (o2 = !c$3(r2) || r2 !== this._$AH[n3]), r2 === E$1 ? t2 = E$1 : t2 !== E$1 && (t2 += (r2 ?? "") + h3[n3 + 1]), this._$AH[n3] = r2; } o2 && !e2 && this.j(t2); } j(t2) { t2 === E$1 ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); } } let H$1 = class H extends k { constructor() { super(...arguments), this.type = 3; } j(t2) { this.element[this.name] = t2 === E$1 ? void 0 : t2; } }; let I$1 = class I extends k { constructor() { super(...arguments), this.type = 4; } j(t2) { this.element.toggleAttribute(this.name, !!t2 && t2 !== E$1); } }; class L extends k { constructor(t2, i3, s2, e2, h3) { super(t2, i3, s2, e2, h3), this.type = 5; } _$AI(t2, i3 = this) { if ((t2 = S$2(this, t2, i3, 0) ?? E$1) === T$1) return; const s2 = this._$AH, e2 = t2 === E$1 && s2 !== E$1 || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h3 = t2 !== E$1 && (s2 === E$1 || e2); e2 && this.element.removeEventListener(this.name, this, s2), h3 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; } handleEvent(t2) { var _a2; "function" == typeof this._$AH ? this._$AH.call(((_a2 = this.options) == null ? void 0 : _a2.host) ?? this.element, t2) : this._$AH.handleEvent(t2); } } class z { constructor(t2, i3, s2) { this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; } get _$AU() { return this._$AM._$AU; } _$AI(t2) { S$2(this, t2); } } const j = t$2.litHtmlPolyfillSupport; j == null ? void 0 : j(N$1, R$1), (t$2.litHtmlVersions ?? (t$2.litHtmlVersions = [])).push("3.3.0"); const B$1 = (t2, i3, s2) => { const e2 = (s2 == null ? void 0 : s2.renderBefore) ?? i3; let h3 = e2._$litPart$; if (void 0 === h3) { const t3 = (s2 == null ? void 0 : s2.renderBefore) ?? null; e2._$litPart$ = h3 = new R$1(i3.insertBefore(l$1(), t3), t3, void 0, s2 ?? {}); } return h3._$AI(t2), h3; }; /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const f$2 = (o2) => void 0 === o2.strings; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const s$3 = (i3, t2) => { var _a2; const e2 = i3._$AN; if (void 0 === e2) return false; for (const i4 of e2) (_a2 = i4._$AO) == null ? void 0 : _a2.call(i4, t2, false), s$3(i4, t2); return true; }, o$5 = (i3) => { let t2, e2; do { if (void 0 === (t2 = i3._$AM)) break; e2 = t2._$AN, e2.delete(i3), i3 = t2; } while (0 === (e2 == null ? void 0 : e2.size)); }, r$6 = (i3) => { for (let t2; t2 = i3._$AM; i3 = t2) { let e2 = t2._$AN; if (void 0 === e2) t2._$AN = e2 = /* @__PURE__ */ new Set(); else if (e2.has(i3)) break; e2.add(i3), c$2(t2); } }; function h$3(i3) { void 0 !== this._$AN ? (o$5(this), this._$AM = i3, r$6(this)) : this._$AM = i3; } function n$5(i3, t2 = false, e2 = 0) { const r2 = this._$AH, h3 = this._$AN; if (void 0 !== h3 && 0 !== h3.size) if (t2) if (Array.isArray(r2)) for (let i4 = e2; i4 < r2.length; i4++) s$3(r2[i4], false), o$5(r2[i4]); else null != r2 && (s$3(r2, false), o$5(r2)); else s$3(this, i3); } const c$2 = (i3) => { i3.type == t$3.CHILD && (i3._$AP ?? (i3._$AP = n$5), i3._$AQ ?? (i3._$AQ = h$3)); }; let f$1 = class f extends i$5 { constructor() { super(...arguments), this._$AN = void 0; } _$AT(i3, t2, e2) { super._$AT(i3, t2, e2), r$6(this), this.isConnected = i3._$AU; } _$AO(i3, t2 = true) { var _a2, _b; i3 !== this.isConnected && (this.isConnected = i3, i3 ? (_a2 = this.reconnected) == null ? void 0 : _a2.call(this) : (_b = this.disconnected) == null ? void 0 : _b.call(this)), t2 && (s$3(this, i3), o$5(this)); } setValue(t2) { if (f$2(this._$Ct)) this._$Ct._$AI(t2, this); else { const i3 = [...this._$Ct._$AH]; i3[this._$Ci] = t2, this._$Ct._$AI(i3, this, 0); } } disconnected() { } reconnected() { } }; /** * @license * Copyright 2023 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ Signal.State; Signal.Computed; const r$5 = (l2, o2) => new Signal.State(l2, o2); var A = async (t2, r2) => { let e2 = typeof r2 == "function" ? await r2(t2) : r2; if (e2) return t2.scheme === "bearer" ? `Bearer ${e2}` : t2.scheme === "basic" ? `Basic ${btoa(e2)}` : e2; }, R2 = { bodySerializer: (t2) => JSON.stringify(t2, (r2, e2) => typeof e2 == "bigint" ? e2.toString() : e2) }, U = (t2) => { switch (t2) { case "label": return "."; case "matrix": return ";"; case "simple": return ","; default: return "&"; } }, _ = (t2) => { switch (t2) { case "form": return ","; case "pipeDelimited": return "|"; case "spaceDelimited": return "%20"; default: return ","; } }, D = (t2) => { switch (t2) { case "label": return "."; case "matrix": return ";"; case "simple": return ","; default: return "&"; } }, O = ({ allowReserved: t2, explode: r2, name: e2, style: a2, value: i3 }) => { if (!r2) { let s2 = (t2 ? i3 : i3.map((l2) => encodeURIComponent(l2))).join(_(a2)); switch (a2) { case "label": return `.${s2}`; case "matrix": return `;${e2}=${s2}`; case "simple": return s2; default: return `${e2}=${s2}`; } } let o2 = U(a2), n3 = i3.map((s2) => a2 === "label" || a2 === "simple" ? t2 ? s2 : encodeURIComponent(s2) : y$1({ allowReserved: t2, name: e2, value: s2 })).join(o2); return a2 === "label" || a2 === "matrix" ? o2 + n3 : n3; }, y$1 = ({ allowReserved: t2, name: r2, value: e2 }) => { if (e2 == null) return ""; if (typeof e2 == "object") throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these."); return `${r2}=${t2 ? e2 : encodeURIComponent(e2)}`; }, q = ({ allowReserved: t2, explode: r2, name: e2, style: a2, value: i3 }) => { if (i3 instanceof Date) return `${e2}=${i3.toISOString()}`; if (a2 !== "deepObject" && !r2) { let s2 = []; Object.entries(i3).forEach(([f3, u2]) => { s2 = [...s2, f3, t2 ? u2 : encodeURIComponent(u2)]; }); let l2 = s2.join(","); switch (a2) { case "form": return `${e2}=${l2}`; case "label": return `.${l2}`; case "matrix": return `;${e2}=${l2}`; default: return l2; } } let o2 = D(a2), n3 = Object.entries(i3).map(([s2, l2]) => y$1({ allowReserved: t2, name: a2 === "deepObject" ? `${e2}[${s2}]` : s2, value: l2 })).join(o2); return a2 === "label" || a2 === "matrix" ? o2 + n3 : n3; }; var H2 = /\{[^{}]+\}/g, B = ({ path: t2, url: r2 }) => { let e2 = r2, a2 = r2.match(H2); if (a2) for (let i3 of a2) { let o2 = false, n3 = i3.substring(1, i3.length - 1), s2 = "simple"; n3.endsWith("*") && (o2 = true, n3 = n3.substring(0, n3.length - 1)), n3.startsWith(".") ? (n3 = n3.substring(1), s2 = "label") : n3.startsWith(";") && (n3 = n3.substring(1), s2 = "matrix"); let l2 = t2[n3]; if (l2 == null) continue; if (Array.isArray(l2)) { e2 = e2.replace(i3, O({ explode: o2, name: n3, style: s2, value: l2 })); continue; } if (typeof l2 == "object") { e2 = e2.replace(i3, q({ explode: o2, name: n3, style: s2, value: l2 })); continue; } if (s2 === "matrix") { e2 = e2.replace(i3, `;${y$1({ name: n3, value: l2 })}`); continue; } let f3 = encodeURIComponent(s2 === "label" ? `.${l2}` : l2); e2 = e2.replace(i3, f3); } return e2; }, E = ({ allowReserved: t2, array: r2, object: e2 } = {}) => (i3) => { let o2 = []; if (i3 && typeof i3 == "object") for (let n3 in i3) { let s2 = i3[n3]; if (s2 != null) { if (Array.isArray(s2)) { o2 = [...o2, O({ allowReserved: t2, explode: true, name: n3, style: "form", value: s2, ...r2 })]; continue; } if (typeof s2 == "object") { o2 = [...o2, q({ allowReserved: t2, explode: true, name: n3, style: "deepObject", value: s2, ...e2 })]; continue; } o2 = [...o2, y$1({ allowReserved: t2, name: n3, value: s2 })]; } } return o2.join("&"); }, P = (t2) => { var _a2; if (!t2) return "stream"; let r2 = (_a2 = t2.split(";")[0]) == null ? void 0 : _a2.trim(); if (r2) { if (r2.startsWith("application/json") || r2.endsWith("+json")) return "json"; if (r2 === "multipart/form-data") return "formData"; if (["application/", "audio/", "image/", "video/"].some((e2) => r2.startsWith(e2))) return "blob"; if (r2.startsWith("text/")) return "text"; } }, I2 = async ({ security: t2, ...r2 }) => { for (let e2 of t2) { let a2 = await A(e2, r2.auth); if (!a2) continue; let i3 = e2.name ?? "Authorization"; switch (e2.in) { case "query": r2.query || (r2.query = {}), r2.query[i3] = a2; break; case "cookie": r2.headers.append("Cookie", `${i3}=${a2}`); break; case "header": default: r2.headers.set(i3, a2); break; } return; } }, S$1 = (t2) => W({ baseUrl: t2.baseUrl, path: t2.path, query: t2.query, querySerializer: typeof t2.querySerializer == "function" ? t2.querySerializer : E(t2.querySerializer), url: t2.url }), W = ({ baseUrl: t2, path: r2, query: e2, querySerializer: a2, url: i3 }) => { let o2 = i3.startsWith("/") ? i3 : `/${i3}`, n3 = (t2 ?? "") + o2; r2 && (n3 = B({ path: r2, url: n3 })); let s2 = e2 ? a2(e2) : ""; return s2.startsWith("?") && (s2 = s2.substring(1)), s2 && (n3 += `?${s2}`), n3; }, C = (t2, r2) => { var _a2; let e2 = { ...t2, ...r2 }; return ((_a2 = e2.baseUrl) == null ? void 0 : _a2.endsWith("/")) && (e2.baseUrl = e2.baseUrl.substring(0, e2.baseUrl.length - 1)), e2.headers = x(t2.headers, r2.headers), e2; }, x = (...t2) => { let r2 = new Headers(); for (let e2 of t2) { if (!e2 || typeof e2 != "object") continue; let a2 = e2 instanceof Headers ? e2.entries() : Object.entries(e2); for (let [i3, o2] of a2) if (o2 === null) r2.delete(i3); else if (Array.isArray(o2)) for (let n3 of o2) r2.append(i3, n3); else o2 !== void 0 && r2.set(i3, typeof o2 == "object" ? JSON.stringify(o2) : o2); } return r2; }, h$2 = class h { constructor() { __publicField(this, "_fns"); this._fns = []; } clear() { this._fns = []; } exists(r2) { return this._fns.indexOf(r2) !== -1; } eject(r2) { let e2 = this._fns.indexOf(r2); e2 !== -1 && (this._fns = [...this._fns.slice(0, e2), ...this._fns.slice(e2 + 1)]); } use(r2) { this._fns = [...this._fns, r2]; } }, T = () => ({ error: new h$2(), request: new h$2(), response: new h$2() }), N2 = E({ allowReserved: false, array: { explode: true, style: "form" }, object: { explode: true, style: "deepObject" } }), Q = { "Content-Type": "application/json" }, w = (t2 = {}) => ({ ...R2, headers: Q, parseAs: "auto", querySerializer: N2, ...t2 }); var J = (t2 = {}) => { let r2 = C(w(), t2), e2 = () => ({ ...r2 }), a2 = (n3) => (r2 = C(r2, n3), e2()), i3 = T(), o2 = async (n3) => { let s2 = { ...r2, ...n3, fetch: n3.fetch ?? r2.fetch ?? globalThis.fetch, headers: x(r2.headers, n3.headers) }; s2.security && await I2({ ...s2, security: s2.security }), s2.body && s2.bodySerializer && (s2.body = s2.bodySerializer(s2.body)), (s2.body === void 0 || s2.body === "") && s2.headers.delete("Content-Type"); let l2 = S$1(s2), f3 = { redirect: "follow", ...s2 }, u2 = new Request(l2, f3); for (let p2 of i3.request._fns) u2 = await p2(u2, s2); let k2 = s2.fetch, c2 = await k2(u2); for (let p2 of i3.response._fns) c2 = await p2(c2, u2, s2); let m2 = { request: u2, response: c2 }; if (c2.ok) { if (c2.status === 204 || c2.headers.get("Content-Length") === "0") return { data: {}, ...m2 }; let p2 = (s2.parseAs === "auto" ? P(c2.headers.get("Content-Type")) : s2.parseAs) ?? "json"; if (p2 === "stream") return { data: c2.body, ...m2 }; let b2 = await c2[p2](); return p2 === "json" && (s2.responseValidator && await s2.responseValidator(b2), s2.responseTransformer && (b2 = await s2.responseTransformer(b2))), { data: b2, ...m2 }; } let g2 = await c2.text(); try { g2 = JSON.parse(g2); } catch { } let d2 = g2; for (let p2 of i3.error._fns) d2 = await p2(g2, c2, u2, s2); if (d2 = d2 || {}, s2.throwOnError) throw d2; return { error: d2, ...m2 }; }; return { buildUrl: S$1, connect: (n3) => o2({ ...n3, method: "CONNECT" }), delete: (n3) => o2({ ...n3, method: "DELETE" }), get: (n3) => o2({ ...n3, method: "GET" }), getConfig: e2, head: (n3) => o2({ ...n3, method: "HEAD" }), interceptors: i3, options: (n3) => o2({ ...n3, method: "OPTIONS" }), patch: (n3) => o2({ ...n3, method: "PATCH" }), post: (n3) => o2({ ...n3, method: "POST" }), put: (n3) => o2({ ...n3, method: "PUT" }), request: o2, setConfig: a2, trace: (n3) => o2({ ...n3, method: "TRACE" }) }; }; const client = J(w({ baseUrl: "https://api-dev.claudebernard.fr/search/" })); const search3 = (options) => { return (options.client ?? client).post({ url: "/search/", ...options, headers: { "Content-Type": "application/json", ...options == null ? void 0 : options.headers } }); }; const PREFIX = "claudebernard"; const numberOfResults = 50; const allTrueCategories = { products: true, speciality: true, brands: true, ranges: true, genericGroups: true, genericAccessoriesGroups: true, biosimilarGroups: true, companies: true, commonNames: true, molecules: true, indications: true, segments: true, atcclass: true, bcbclass: true, sideEffects: true, universes: true, hybridGroups: true }; const allFalseCategories = { products: false, speciality: false, brands: false, ranges: false, genericGroups: false, genericAccessoriesGroups: false, biosimilarGroups: false, companies: false,