import {
  __spreadProps,
  __spreadValues
} from "./chunk-NWKJXI2N.js";

// ../../../node_modules/@lit/reactive-element/development/decorators/custom-element.js
var legacyCustomElement = (tagName, clazz) => {
  window.customElements.define(tagName, clazz);
  return clazz;
};
var standardCustomElement = (tagName, descriptor) => {
  const { kind, elements } = descriptor;
  return {
    kind,
    elements,
    finisher(clazz) {
      window.customElements.define(tagName, clazz);
    }
  };
};
var customElement = (tagName) => (classOrDescriptor) => typeof classOrDescriptor === "function" ? legacyCustomElement(tagName, classOrDescriptor) : standardCustomElement(tagName, classOrDescriptor);

// ../../../node_modules/@lit/reactive-element/development/decorators/property.js
var standardProperty = (options, element) => {
  if (element.kind === "method" && element.descriptor && !("value" in element.descriptor)) {
    return __spreadProps(__spreadValues({}, element), {
      finisher(clazz) {
        clazz.createProperty(element.key, options);
      }
    });
  } else {
    return {
      kind: "field",
      key: Symbol(),
      placement: "own",
      descriptor: {},
      originalKey: element.key,
      initializer() {
        if (typeof element.initializer === "function") {
          this[element.key] = element.initializer.call(this);
        }
      },
      finisher(clazz) {
        clazz.createProperty(element.key, options);
      }
    };
  }
};
var legacyProperty = (options, proto, name) => {
  proto.constructor.createProperty(name, options);
};
function property(options) {
  return (protoOrDescriptor, name) => name !== void 0 ? legacyProperty(options, protoOrDescriptor, name) : standardProperty(options, protoOrDescriptor);
}

// ../../../node_modules/@lit/reactive-element/development/decorators/state.js
function state(options) {
  return property(__spreadProps(__spreadValues({}, options), {
    state: true
  }));
}

// ../../../node_modules/@lit/reactive-element/development/decorators/base.js
var decorateProperty = ({ finisher, descriptor }) => (protoOrDescriptor, name) => {
  var _a;
  if (name !== void 0) {
    const ctor = protoOrDescriptor.constructor;
    if (descriptor !== void 0) {
      Object.defineProperty(protoOrDescriptor, name, descriptor(name));
    }
    finisher === null || finisher === void 0 ? void 0 : finisher(ctor, name);
  } else {
    const key = (_a = protoOrDescriptor.originalKey) !== null && _a !== void 0 ? _a : protoOrDescriptor.key;
    const info = descriptor != void 0 ? {
      kind: "method",
      placement: "prototype",
      key,
      descriptor: descriptor(protoOrDescriptor.key)
    } : __spreadProps(__spreadValues({}, protoOrDescriptor), { key });
    if (finisher != void 0) {
      info.finisher = function(ctor) {
        finisher(ctor, key);
      };
    }
    return info;
  }
};

// ../../../node_modules/@lit/reactive-element/development/decorators/event-options.js
function eventOptions(options) {
  return decorateProperty({
    finisher: (ctor, name) => {
      Object.assign(ctor.prototype[name], options);
    }
  });
}

// ../../../node_modules/@lit/reactive-element/development/decorators/query.js
function query(selector, cache) {
  return decorateProperty({
    descriptor: (name) => {
      const descriptor = {
        get() {
          var _a, _b;
          return (_b = (_a = this.renderRoot) === null || _a === void 0 ? void 0 : _a.querySelector(selector)) !== null && _b !== void 0 ? _b : null;
        },
        enumerable: true,
        configurable: true
      };
      if (cache) {
        const key = typeof name === "symbol" ? Symbol() : `__${name}`;
        descriptor.get = function() {
          var _a, _b;
          if (this[key] === void 0) {
            this[key] = (_b = (_a = this.renderRoot) === null || _a === void 0 ? void 0 : _a.querySelector(selector)) !== null && _b !== void 0 ? _b : null;
          }
          return this[key];
        };
      }
      return descriptor;
    }
  });
}

// ../../../node_modules/@lit/reactive-element/development/decorators/query-all.js
function queryAll(selector) {
  return decorateProperty({
    descriptor: (_name) => ({
      get() {
        var _a, _b;
        return (_b = (_a = this.renderRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(selector)) !== null && _b !== void 0 ? _b : [];
      },
      enumerable: true,
      configurable: true
    })
  });
}

// ../../../node_modules/@lit/reactive-element/development/decorators/query-async.js
function queryAsync(selector) {
  return decorateProperty({
    descriptor: (_name) => ({
      async get() {
        var _a;
        await this.updateComplete;
        return (_a = this.renderRoot) === null || _a === void 0 ? void 0 : _a.querySelector(selector);
      },
      enumerable: true,
      configurable: true
    })
  });
}

// ../../../node_modules/@lit/reactive-element/development/decorators/query-assigned-nodes.js
function queryAssignedNodes(slotName = "", flatten = false, selector = "") {
  return decorateProperty({
    descriptor: (_name) => ({
      get() {
        var _a, _b, _c;
        const slotSelector = `slot${slotName ? `[name=${slotName}]` : ":not([name])"}`;
        const slot = (_a = this.renderRoot) === null || _a === void 0 ? void 0 : _a.querySelector(slotSelector);
        let nodes = (_c = (_b = slot) === null || _b === void 0 ? void 0 : _b.assignedNodes({ flatten })) !== null && _c !== void 0 ? _c : [];
        if (selector) {
          nodes = nodes.filter((node) => node.nodeType === Node.ELEMENT_NODE && node.matches(selector));
        }
        return nodes;
      },
      enumerable: true,
      configurable: true
    })
  });
}
export {
  customElement,
  eventOptions,
  property,
  query,
  queryAll,
  queryAssignedNodes,
  queryAsync,
  state
};
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
//# sourceMappingURL=lit_decorators_js.js.map
