import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
import { d as defineCustomElement$2 } from './telia-vst2.js';

const teliaFieldsetCss = ".telia-fieldset{border:0;margin:0;min-width:0;padding:0}.telia-fieldset>telia-chip-choice,.telia-fieldset>telia-chip-filter,.telia-fieldset>telia-checkbox,.telia-fieldset>telia-radio-button{display:block;margin-bottom:calc(1.6rem * var(--voca-rem-multiplier))}.telia-fieldset>telia-chip-choice:last-child,.telia-fieldset>telia-chip-filter:last-child,.telia-fieldset>telia-checkbox:last-child,.telia-fieldset>telia-radio-button:last-child{margin-bottom:0}.telia-fieldset telia-p,.telia-fieldset telia-notification,.telia-fieldset telia-text-input,.telia-fieldset telia-textarea,.telia-fieldset telia-toggle,.telia-fieldset telia-select{display:block;margin-bottom:calc(2.4rem * var(--voca-rem-multiplier))}.telia-fieldset telia-p:last-child,.telia-fieldset telia-notification:last-child,.telia-fieldset telia-text-input:last-child,.telia-fieldset telia-textarea:last-child,.telia-fieldset telia-toggle:last-child,.telia-fieldset telia-select:last-child{margin-bottom:0}.telia-fieldset>legend{color:#222222;font-family:\"TeliaSans\", Helvetica, Arial, \"Lucida Grande\", sans-serif;font-weight:bold;font-size:calc(2rem * var(--voca-rem-multiplier));line-height:1.25;margin-bottom:calc(2.4rem * var(--voca-rem-multiplier))}@media screen and (min-width: 37.5em){.telia-fieldset>legend{font-size:calc(\n    calc(2rem * var(--voca-rem-multiplier)) + 0.4 *\n      (100vw - calc(60rem * var(--voca-rem-multiplier))) / 84\n  )}}@media screen and (min-width: 90em){.telia-fieldset>legend{font-size:calc(2.4rem * var(--voca-rem-multiplier))}}.telia-fieldset .telia-fieldset>legend{color:#222222;font-family:\"TeliaSans\", Helvetica, Arial, \"Lucida Grande\", sans-serif;font-weight:500;font-size:calc(1.6rem * var(--voca-rem-multiplier));line-height:1.25;margin-bottom:calc(2.4rem * var(--voca-rem-multiplier))}.telia-fieldset--horizontal{margin-bottom:calc(-1 * calc(1.6rem * var(--voca-rem-multiplier)))}.telia-fieldset--horizontal>telia-chip-choice,.telia-fieldset--horizontal>telia-chip-filter{display:inline-block;margin:0 calc(1.6rem * var(--voca-rem-multiplier)) calc(1.6rem * var(--voca-rem-multiplier)) 0}.telia-fieldset--horizontal>telia-chip-choice:last-of-type,.telia-fieldset--horizontal>telia-chip-filter:last-of-type{margin-right:0}";

const TeliaFieldset$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    /** Disables descendant form controls.*/
    this.disabled = false;
    /** Indicates that contents in this fieldset are required to fill out. Please note that using this property does NOT add constraints on descendant elements, but is merely a visual guide to help the user fill the form correctly. Set required on each input as appropriate.*/
    this.required = false;
    /** Tracking id is used to identify and count Component usage */
    this.dataTrackingId = 'telia-fieldset';
  }
  validateLegend(value) {
    const isBlank = typeof value !== 'string' || value == '';
    if (isBlank) {
      throw new Error('legend: required');
    }
  }
  componentWillLoad() {
    this.validateLegend(this.legend);
  }
  render() {
    const componentClass = 'telia-fieldset';
    const wrapperClasses = {
      [`${componentClass}`]: true,
      [`${componentClass}--${this.variant}`]: !!this.variant,
    };
    return (h("fieldset", { disabled: this.disabled, form: this.form, name: this.name, class: wrapperClasses }, h("telia-vst", { dataTrackingId: this.dataTrackingId }), h("legend", null, this.required && h("span", { "aria-hidden": "true" }, '* '), this.legend), h("slot", null)));
  }
  static get watchers() { return {
    "legend": ["validateLegend"]
  }; }
  static get style() { return teliaFieldsetCss; }
}, [4, "telia-fieldset", {
    "dataTestid": [1, "data-testid"],
    "disabled": [4],
    "form": [1],
    "name": [1],
    "legend": [1],
    "required": [4],
    "variant": [1]
  }]);
function defineCustomElement$1() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["telia-fieldset", "telia-vst"];
  components.forEach(tagName => { switch (tagName) {
    case "telia-fieldset":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, TeliaFieldset$1);
      }
      break;
    case "telia-vst":
      if (!customElements.get(tagName)) {
        defineCustomElement$2();
      }
      break;
  } });
}
defineCustomElement$1();

const TeliaFieldset = TeliaFieldset$1;
const defineCustomElement = defineCustomElement$1;

export { TeliaFieldset, defineCustomElement };
