var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/cypress/index.ts
var index_exports = {};
__export(index_exports, {
  AlertScreenReaderPageObject: () => AlertScreenReaderPageObject,
  CalendarPageObject: () => CalendarPageObject,
  FBadgePageObject: () => FBadgePageObject,
  FCalendarDayPageObject: () => FCalendarDayPageObject,
  FCalenderDayPageobject: () => FCalenderDayPageobject,
  FCheckboxFieldPageObject: () => FCheckboxFieldPageObject,
  FCheckboxGroupFieldPageObject: () => FCheckboxFieldPageObject,
  FCheckboxGroupPageObject: () => FCheckboxGroupPageObject,
  FContextMenuPageObject: () => FContextMenuPageObject,
  FCrudDatasetPageObject: () => FCrudDatasetPageObject,
  FDatepickerFieldPageobject: () => FDatepickerFieldPageobject,
  FDefinitionListPageObject: () => FDefinitionListPageObject,
  FDetailsPanelPageObject: () => FDetailsPanelPageObject,
  FDialogueTreeItemPageObject: () => FDialogueTreeItemPageObject,
  FDialogueTreePageObject: () => FDialogueTreePageObject,
  FErrorListPageObject: () => FErrorListPageObject,
  FExpandablePanelPageObject: () => FExpandablePanelPageObject,
  FExpandableParagraphPageObject: () => FExpandableParagraphPageObject,
  FFieldsetPageObject: () => FFieldsetPageObject,
  FFileItemPageObject: () => FFileItemPageObject,
  FFileSelectorPageObject: () => FFileSelectorPageObject,
  FFormModalPageObject: () => FFormModalPageObject,
  FInteractiveTablePageObject: () => FInteractiveTablePageObject,
  FLabelPageObject: () => FLabelPageObject,
  FListItemPageObject: () => FListItemPageObject,
  FListPageObject: () => FListPageObject,
  FLoaderPageObject: () => FLoaderPageObject,
  FMessageBoxPageObject: () => FMessageBoxPageObject,
  FMinimizablePanelPageObject: () => FMinimizablePanelPageObject,
  FModalPageObject: () => FModalPageObject,
  FNavigationMenuPageobject: () => FNavigationMenuPageobject,
  FOfflinePageObject: () => FOfflinePageObject,
  FOutputFieldPageobject: () => FOutputFieldPageobject,
  FPageHeaderPageobject: () => FPageHeaderPageobject,
  FPaginatorPageObject: () => FPaginatorPageObject,
  FProgressbarPageObject: () => FProgressbarPageObject,
  FRadioFieldPageObject: () => FRadioFieldPageObject,
  FRadioGroupFieldPageObject: () => FRadioFieldPageObject,
  FRadioGroupPageObject: () => FRadioGroupPageObject,
  FSelectFieldPageObject: () => FSelectFieldPageObject,
  FSortFilterDatasetPageObject: () => FSortFilterDatasetPageObject,
  FStaticFieldPageObject: () => FStaticFieldPageObject,
  FTableColumnPageObject: () => FTableColumnPageObject,
  FTablePageObject: () => FTablePageObject,
  FTextFieldPageObject: () => FTextFieldPageObject,
  FTextareaFieldPageObject: () => FTextareaFieldPageObject,
  FTooltipPageObject: () => FTooltipPageObject,
  FValidationFormPageObject: () => FValidationFormPageObject,
  FWizardPageobject: () => FWizardPageobject,
  FWizardStepHeaderPageobject: () => FWizardStepHeaderPageobject,
  FWizardStepPageobject: () => FWizardStepPageobject,
  ICalendarNavbarPageObject: () => ICalendarNavbarPageObject,
  IPopupMenuPageObject: () => IPopupMenuPageObject,
  IPopupPageObject: () => IPopupPageObject,
  Input: () => Input,
  STATUS: () => STATUS,
  dayType: () => dayType
});
module.exports = __toCommonJS(index_exports);

// src/cypress/FCalendarDay.pageobject.ts
var dayType = /* @__PURE__ */ ((dayType2) => {
  dayType2["day"] = "calendar-day";
  dayType2["highlight"] = "calendar-day--highlight";
  dayType2["selected"] = "calendar-day--selected";
  dayType2["disabled"] = "calendar-day--disabled";
  return dayType2;
})(dayType || {});
var FCalendarDayPageObject = class {
  selector;
  constructor(selector) {
    this.selector = selector;
  }
  el() {
    return cy.get(this.selector);
  }
  number() {
    return cy.get(`${this.selector}>span:first`);
  }
  srOnly() {
    return cy.get(`${this.selector}>.sr-only`);
  }
  button() {
    return this.el().parent('[data-test="select-day-button"]');
  }
  click() {
    return this.button().click();
  }
};
var FCalenderDayPageobject = class extends FCalendarDayPageObject {
};

// src/cypress/FBadge.pageobject.ts
var FBadgePageObject = class {
  selector;
  /**
   * @param selector - the root of the badge.
   */
  constructor(selector) {
    this.selector = selector;
  }
  el() {
    return cy.get(this.selector);
  }
  status() {
    return this.el().then(
      (el) => (
        /* eslint-disable-next-line sonarjs/slow-regex -- technical debt */
        el[0].className.replace(/.*badge--(\w+).*/, "$1")
      )
    );
  }
  isInverted() {
    return this.el().then(
      (el) => (
        /* eslint-disable-next-line sonarjs/slow-regex -- technical debt */
        el[0].className.replace(/.*badge--(\w+)-(\w+).*/, "$2") === "inverted"
      )
    );
  }
};

// src/cypress/FCheckboxField.pageobject.ts
var FCheckboxFieldPageObject = class {
  selector;
  el;
  /**
   * @param selector - the root of the checkbox, usually `<div class="checkbox">...</div>`.
   * @param index -  the index of matched radiobuttons
   */
  constructor(selector, index) {
    if (index) {
      this.selector = `${selector}:nth(${String(index)})`;
    } else {
      this.selector = selector;
    }
    this.el = () => cy.get(this.selector);
  }
  checkbox() {
    return cy.get(`${this.selector} input`);
  }
  label() {
    return cy.get(`${this.selector} .checkbox__label`);
  }
  select() {
    return this.label().click();
  }
  isSelected() {
    return this.checkbox().then((el) => {
      return el.get(0).checked;
    });
  }
  value() {
    return this.checkbox().then((el) => {
      return el.get(0).value;
    });
  }
  details() {
    return cy.get(`${this.selector} .checkbox__details`);
  }
};

// src/cypress/FLabel.pageobject.ts
var FLabelPageObject = class {
  selector;
  el;
  /**
   * @param selector - the root of the label, usually `<label class="label">...</label>`.
   */
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(this.selector);
  }
  /**
   * Hjälptext
   */
  description() {
    return cy.get(`${this.selector} .label__description`);
  }
  /**
   * ErrorIcon
   */
  errorIcon() {
    return cy.get(`${this.selector} .icon.label__icon--left.f-icon-error`);
  }
  /**
   * Formatbeskrivning
   */
  formatDescription() {
    return cy.get(
      `${this.selector} .label__description.label__description--format`
    );
  }
  /**
   * Felmeddelande
   */
  errorMessage() {
    return cy.get(`${this.selector} .label__message.label__message--error`);
  }
};

// src/cypress/FTooltip.pageobject.ts
var FTooltipPageObject = class {
  selector;
  /**
   * @param selector - the root of the tooltip
   */
  constructor(selector) {
    this.selector = selector;
  }
  el() {
    return cy.get(this.selector);
  }
  iButton() {
    return cy.get(
      [
        /* no attached to anything */
        `.tooltip__button:has(~ :is(${this.selector}))`,
        /* attached to label or heading */
        `.tooltip__container:has(.tooltip__button):has(~ :is(${this.selector})) > .tooltip__button`
      ].join(", ")
    );
  }
  header() {
    return cy.get(`${this.selector} .tooltip__header`);
  }
  body() {
    return cy.get(`${this.selector} .tooltip__body`);
  }
  closeButton() {
    return cy.get(`${this.selector} .close-button`);
  }
};

// src/cypress/FCheckboxGroup.pageobject.ts
var FCheckboxGroupPageObject = class {
  selector;
  el;
  label;
  tooltip;
  /**
   * @param selector - the root of the checkbox group, usually `<div class="checkbox-group">...</div>`.
   */
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(this.selector);
    this.label = new FLabelPageObject(`${this.selector} legend.label`);
    this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
  }
  content() {
    return cy.get(`${this.selector} .checkbox-group__content`);
  }
  checkBox(checkboxSelector) {
    return new FCheckboxFieldPageObject(
      `${this.selector} ${checkboxSelector}`
    );
  }
  numberOfCheckboxes() {
    return cy.get(`${this.selector} input`).then((el) => {
      return el.length;
    });
  }
};

// src/cypress/FContextMenu.pageobject.ts
var FContextMenuPageObject = class {
  selector;
  el() {
    return cy.get(this.selector);
  }
  /**
   * @param selector - the root of the page header, usually `<nav class="contextmenu">...</nav>`.
   */
  constructor(selector) {
    this.selector = selector;
  }
  /**
   * Get all items in the FContextMenu
   * @returns all items
   */
  items() {
    return cy.get(`${this.selector} .contextmenu__list__item`);
  }
  /**
   * Get the item at position index in the FContextMenu
   *
   * @param index - the position index in the item array
   * @returns Menu item with given index
   */
  item(index) {
    return this.items().eq(index);
  }
  /**
   * Get link for item at index
   *
   * @param index - the position index in the item array
   * @returns link with given index
   */
  getItemLink(index) {
    return cy.get(
      `${this.selector} .contextmenu__list__item a:nth(${String(index)})`
    );
  }
};

// src/cypress/FErrorList.pageobject.ts
var FErrorListPageObject = class {
  selector;
  el;
  /**
   * @param selector - the root of the errorlist.
   */
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(this.selector);
  }
  /**
   * Get `li` elements. Verify count using `.should("have.length", N)`.
   */
  listItems() {
    return cy.get(`${this.selector} li`);
  }
  /**
   * Get `a` elements. Verify count using `.should("have.length", N)`.
   */
  links() {
    return cy.get(`${this.selector} a`);
  }
  getLink(index) {
    return cy.get(`${this.selector} a:nth(${String(index)})`);
  }
  getLinkByName(error) {
    let link = () => cy.get(`${this.selector} ${error}`);
    return cy.get(`${this.selector} a`).each((el) => {
      if (el.get(0).textContent.trim() === error) {
        link = () => el.get(0);
      }
    }).then(() => {
      return link();
    });
  }
  hasError(error) {
    let hasSelectedError = false;
    return cy.get(`${this.selector} li`).each((el) => {
      if (el.get(0).textContent.trim() === error) {
        hasSelectedError = true;
      }
    }).then(() => {
      return hasSelectedError;
    });
  }
};

// src/cypress/FValidationForm.pageobject.ts
var FValidationFormPageObject = class {
  selector;
  errorlist;
  /**
   * @param selector - the root of the validation form.
   */
  constructor(selector) {
    this.selector = selector;
    this.errorlist = new FErrorListPageObject(
      `${this.selector} .error-list`
    );
  }
  el() {
    return cy.get(this.selector);
  }
};

// src/cypress/FCrudDataset.pageobject.ts
var FCrudDatasetPageObject = class {
  selector;
  el;
  form;
  constructor(selector = ".crud-dataset") {
    this.selector = selector;
    this.el = () => cy.get(this.selector);
    this.form = new FValidationFormPageObject(`${this.selector} form`);
  }
  addButton() {
    return cy.get(
      `${this.selector} [data-test="f-crud-dataset-add-button"]`
    );
  }
  cancelButton() {
    return cy.get(
      `${this.selector} .modal__footer > .button-group > .button--secondary`
    );
  }
  confirmButton() {
    return cy.get(
      `${this.selector} .modal__footer > .button-group > .button--primary`
    );
  }
};

// src/cypress/FDetailsPanel.pageobject.ts
var FDetailsPanelPageObject = class _FDetailsPanelPageObject {
  /** Base selector */
  selector;
  constructor(selector) {
    this.selector = selector;
  }
  /**
   * Get a selector based on the panel name.
   */
  static nameSelector(name) {
    return `[data-panel-name="${name}"]`;
  }
  /**
   * Get details panel based on its `name` prop.
   *
   * @param name - Name given to panel.
   */
  static fromName(name) {
    const selector = _FDetailsPanelPageObject.nameSelector(name);
    return new _FDetailsPanelPageObject(selector);
  }
  /**
   * Panel element.
   */
  el() {
    return cy.get(this.selector);
  }
  /**
   * Content in header slot (as defined by consumer).
   */
  header() {
    return cy.get(`${this.selector} [slot=header]`);
  }
  /**
   * Content in content slot (as defined by consumer).
   */
  content() {
    return cy.get(`${this.selector} [slot=content]`);
  }
  /**
   * Content in footer slot (as defined by consumer).
   */
  footer() {
    return cy.get(`${this.selector} [slot=footer]`);
  }
  /**
   * Default submit button.
   */
  closeButton() {
    return this.el().shadow().find(".panel__close-button");
  }
};

// src/cypress/FDefinitionList.pageobject.ts
var FDefinitionListPageObject = class {
  /**
   * The root of the component.
   *
   * @param selector - The selector
   */
  selector;
  /**
   * @param selector - The selector.
   */
  constructor(selector) {
    this.selector = selector;
  }
  /**
   * Gets the page object element.
   *
   * @returns The page object element.
   */
  el() {
    return cy.get(this.selector);
  }
  /**
   * Gets the definition value.
   *
   * @param index - Index of definition in definition list.
   * @returns The definition value.
   */
  definition(index) {
    return cy.get(
      `${this.selector} .definition-list__definition:nth(${index})`
    );
  }
  /**
   * Gets the number of definitions.
   *
   * @returns The number of definitions.
   */
  numberOfDefinitions() {
    return cy.get(`${this.selector} .definition-list__term`).its("length");
  }
  /**
   * Gets the term of a definition.
   *
   * @param index - Index of definition in definition list.
   * @returns The term of the definition.
   */
  term(index) {
    return cy.get(`${this.selector} .definition-list__term:nth(${index})`);
  }
};

// src/cypress/FExpandablePanel.pageobject.ts
var FExpandablePanelPageObject = class {
  selector;
  el;
  expandCollapseIcon;
  header;
  body;
  notificationIcon;
  relatedInfo;
  /**
   * @param selector - the root of the expandablepanel, usually `<div class="expandable-panel">...</div>`.
   */
  constructor(selector) {
    this.selector = `.expandable-panel:has(${selector})`;
    this.el = () => cy.get(this.selector);
    this.expandCollapseIcon = () => cy.get(`${this.selector} .expandable-panel__icon`);
    this.header = () => cy.get(`${this.selector} .expandable-panel__heading button`);
    this.notificationIcon = () => cy.get(
      `${this.selector} .expandable-panel__heading .expandable-panel__notification`
    );
    this.body = () => cy.get(`${this.selector} .expandable-panel__body`);
    this.relatedInfo = () => cy.get(`${this.selector} .expandable-panel__outside`);
  }
  /**
   * Returns the number of notifications
   */
  numberOfNotifications() {
    let nrOfNotifications = 0;
    this.notificationIcon().invoke("text").then(
      (text) => text.replace(/(\d+)/, (match, matchGroup1) => {
        nrOfNotifications = Number.parseInt(matchGroup1, 10);
        return matchGroup1;
      })
    );
    return cy.wrap("Count number of notifications").then(() => {
      return nrOfNotifications;
    });
  }
  isOpen() {
    let isPanelOpen = false;
    this.el().invoke("attr", "class").then((classes) => {
      const panelClasses = classes ? classes.split(" ") : [];
      isPanelOpen = panelClasses.includes(
        "expandable-panel--expanded"
      );
    });
    return cy.wrap("Check if panel is expanded").then(() => {
      return isPanelOpen;
    });
  }
};

// src/selectors/FList.selectors.ts
function FListSelectors(selector = ".list") {
  return Object.freeze({
    /**
     * The base selector for the component.
     *
     * This is the same selector that the consumer provided.
     *
     * @public
     * @since v6.42.0
     * @returns The root selector for the component.
     */
    get selector() {
      return selector;
    },
    /**
     * Get all list items.
     *
     * @public
     * @since v6.42.0
     * @returns A selector for all of the list items.
     */
    listItems() {
      return `${selector} > .list__item:not(.list__item--empty) > .list__item__itempane`;
    },
    /**
     * Get the list item with the given index.
     *
     * @public
     * @since v6.42.0
     * @param index - The index of the item (0-based).
     * @returns A selector for the list item with the given index.
     */
    listItemByIndex(index) {
      return `${selector} > .list__item:nth-child(${index + 1}):not(.list__item--empty)`;
    },
    /**
     * Get the element displaying the empty message when the list is empty.
     *
     * @public
     * @since v6.42.0
     * @returns A selector for the element with empty text.
     */
    emptyMessage() {
      return `${selector} > .list__item.list__item--empty`;
    }
  });
}

// src/selectors/FPaginator.selectors.ts
function FPaginatorSelectors(selector = ".paginator") {
  return Object.freeze({
    /**
     * The base selector for the component.
     *
     * This is the same selector that the consumer provided.
     *
     * @public
     * @since v6.34.0
     * @returns The root selector for the component.
     */
    get selector() {
      return selector;
    },
    /**
     * Get the button for the current page.
     *
     * @public
     * @since v6.34.0
     * @returns A selector for the currently active page button.
     */
    currentPageButton() {
      return `${selector} .paginator__page--active`;
    },
    /**
     * Get the button for the first page.
     *
     * @public
     * @since v6.34.0
     * @returns A selector for the button that navigates to the first
     * page.
     */
    firstPageButton() {
      return `${selector} [data-page~="first"]`;
    },
    /**
     * Get the button for the last page.
     *
     * @public
     * @since v6.34.0
     * @returns A selector for the button that navigates to the last
     * page.
     */
    lastPageButton() {
      return `${selector} [data-page~="last"]`;
    },
    /**
     * Get the button for navigating to the next page.
     *
     * @public
     * @since v6.34.0
     * @returns A selector for the button that navigates to the next
     * page.
     */
    nextPageButton() {
      return `${selector} .paginator__next`;
    },
    /**
     * Get the button for a specific page by displayed text.
     *
     * This returns the button that displays the given text.
     *
     * @public
     * @since v6.34.0
     * @param text - The text displayed on the requested button. If a
     * numeric value is provided, it is converted to a string.
     * @returns A selector for the specified page button.
     */
    pageButtonByText(text) {
      return `${selector} > [data-page~="${text}"]`;
    },
    /**
     * Get the button for a specific page by index.
     *
     * The index starts at zero for the first button. A negative index
     * selects buttons from the end, e.g. `-1` selects the last button.
     *
     * @public
     * @since v6.34.0
     * @param index - The zero-based page index, or a negative index to
     * select from the end (e.g. `-1` selects the last button).
     * @returns A selector for the specified page button.
     */
    pageButtonByIndex(index) {
      return `${selector} > [data-index~="${index}"]`;
    },
    /**
     * Get the buttons for all pages shown.
     *
     * @public
     * @since v6.34.0
     * @returns A selector for all displayed page buttons.
     */
    pageButtons() {
      return `${selector} .paginator__page`;
    },
    /**
     * Get the page counter element.
     *
     * The counter replaces the page buttons in compact mode on mobile
     * devices.
     *
     * @public
     * @since v6.34.0
     * @returns A selector for the page counter element.
     */
    pageCounter() {
      return `${selector} .paginator__page-counter`;
    },
    /**
     * Get the button for navigating to the previous page.
     *
     * @public
     * @since v6.34.0
     * @returns A selector for the button that navigates to the previous
     * page.
     */
    previousPageButton() {
      return `${selector} .paginator__previous`;
    }
  });
}

// src/selectors/FExpandableParagraph.selectors.ts
function FExpandableParagraphSelectors(selector = ".expandable-paragraph") {
  return Object.freeze({
    /**
     * The base selector for the component.
     *
     * This is the same selector that the consumer provided.
     *
     * @public
     * @since v6.43.0
     * @returns The root selector for the component.
     */
    get selector() {
      return selector;
    },
    /**
     * Get the expand/collapse icon.
     *
     * @public
     * @since v6.43.0
     * @returns The expand/collapse icon.
     */
    expandCollapseIcon() {
      return `${selector} .expandable-paragraph__icon`;
    },
    /**
     * Get the header.
     *
     * @public
     * @since v6.43.0
     * @returns The header.
     */
    header() {
      return `${selector} .expandable-paragraph__heading .expandable-paragraph__button`;
    },
    /**
     * Get the body.
     *
     * @public
     * @since v6.43.0
     * @returns The body.
     */
    body() {
      return `${selector} .expandable-paragraph__content`;
    },
    /**
     * Get the related info.
     *
     * @public
     * @since v6.43.0
     * @returns The related info.
     */
    relatedInfo() {
      return `${selector} .expandable-paragraph__related-information`;
    }
  });
}

// src/cypress/FExpandableParagraph.pageobject.ts
var FExpandableParagraphPageObject = class {
  _selectors;
  /**
   * @param selector - The root of the FExpandableParagraph component
   */
  constructor(selector = ".expandable-paragraph") {
    this._selectors = FExpandableParagraphSelectors(selector);
  }
  get selector() {
    return this._selectors.selector;
  }
  /**
   * Get the root element.
   *
   * @returns The element itself.
   */
  el() {
    return cy.get(this._selectors.selector);
  }
  /**
   * Get the expand/collapse icon.
   *
   * @returns The expand/collapse icon.
   */
  expandCollapseIcon() {
    return cy.get(this._selectors.expandCollapseIcon());
  }
  /**
   * Get the header.
   *
   * @returns The header.
   */
  header() {
    return cy.get(this._selectors.header());
  }
  /**
   * Get the body.
   *
   * @returns The body.
   */
  body() {
    return cy.get(this._selectors.body());
  }
  /**
   * Get the related info.
   *
   * @returns The related info.
   */
  relatedInfo() {
    return cy.get(this._selectors.relatedInfo());
  }
  /**
   * Get if the paragraph is open or not.
   *
   * @returns If the paragraph is open or not.
   */
  isOpen() {
    return this.el().then(($el) => {
      return $el.hasClass("expandable-paragraph--open");
    });
  }
};

// src/cypress/FRadioField.pageobject.ts
var FRadioFieldPageObject = class {
  selector;
  el;
  /**
   * @param selector - the root of the radio button, usually `<div class="radio-button">...</div>`.
   * @param index -  the index of matched radiobuttons
   */
  constructor(selector, index) {
    if (index) {
      this.selector = `${selector}:nth(${String(index)})`;
    } else {
      this.selector = selector;
    }
    this.el = () => cy.get(this.selector);
  }
  radioButton() {
    return cy.get(`${this.selector} input`);
  }
  label() {
    return cy.get(`${this.selector} .radio-button__label`);
  }
  select() {
    return cy.get(`${this.selector} label`).click();
  }
  details() {
    return cy.get(`${this.selector} .radio-button__details`);
  }
  isSelected() {
    return this.radioButton().then((el) => {
      return el.get(0).checked;
    });
  }
  value() {
    return this.radioButton().then((el) => {
      return el.get(0).value;
    });
  }
};

// src/cypress/FFieldset.pageobject.ts
var FFieldsetPageObject = class {
  selector;
  el;
  label;
  tooltip;
  /**
   * @param selector - the root of the fieldset, usually `<div class="radio-button-group">...</div>` or `<div class="checkbox-group">...</div>`.
   */
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(this.selector);
    this.label = new FLabelPageObject(`${this.selector} .label`);
    this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
  }
  content() {
    return cy.get(`${this.selector} .fieldset__content`);
  }
  radioButton(buttonSelector) {
    return new FRadioFieldPageObject(`${this.selector} ${buttonSelector}`);
  }
  numberOfRadio() {
    return cy.get(`${this.selector} .radio-button`).then((el) => {
      return el.length;
    });
  }
  checkBox(checkboxSelector) {
    return new FCheckboxFieldPageObject(
      `${this.selector} ${checkboxSelector}`
    );
  }
  numberOfCheckboxes() {
    return cy.get(`${this.selector} .checkbox`).then((el) => {
      return el.length;
    });
  }
};

// src/cypress/FProgressbar.pageobject.ts
var FProgressbarPageObject = class {
  selector;
  /**
   * @param selector - the root of the static field, usually `<div class="progress">...</div>`.
   */
  constructor(selector = ".progress") {
    this.selector = selector;
  }
  /**
   * Get the element itself.
   */
  el() {
    return cy.get(this.selector);
  }
  /**
   * @internal
   */
  progressMeter() {
    return cy.get(`${this.selector} .progress__meter`);
  }
  /**
   * Returns progressbar status, one of:
   *
   * - `"pending"` - for value `0`.
   * - `"inprogress"` - for values between `1` and `99`.
   * - `"finished"` - for value `100`.
   */
  progressStatus() {
    return this.progressMeter().then((el) => {
      return el[0].classList[1].replace(
        /* eslint-disable-next-line sonarjs/slow-regex -- technical debt */
        /.*progress__meter--(\w+).*/,
        "$1"
      );
    });
  }
  /**
   * Get the current value of the progressbar.
   */
  value() {
    return this.progressMeter().then((el) => {
      return Number.parseInt(el[0].ariaValueNow ?? "0", 10);
    });
  }
};

// src/cypress/FFileItem.pageobject.ts
var FFileItemPageObject = class {
  selector;
  el;
  /**
   * @internal
   */
  _progressMeter;
  /**
   * @param selector - the root of the file item, usually `<div class="file-item">...</div>`.
   */
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(this.selector);
    this._progressMeter = new FProgressbarPageObject(this.selector);
  }
  /**
   * @internal
   */
  _cancelDeleteButton() {
    return cy.get(`${this.selector} [data-test=file-item__file-remove]`);
  }
  /**
   * @internal
   */
  _cancelDeleteButtonIcon() {
    return cy.get(
      `${this.selector} [data-test=file-item__file-remove] .icon`
    );
  }
  /**
   * @internal
   */
  _fileIcon() {
    return cy.get(`${this.selector} .file-item__file-open .icon`);
  }
  /**
   * Filename of the uploaded file.
   */
  fileName() {
    return cy.get(`${this.selector} .file-item__file-name`);
  }
  /**
   * Filename extension in lowercase.
   */
  typeOfFile() {
    return this._fileIcon().then(
      (el) => (
        /* eslint-disable-next-line sonarjs/slow-regex -- technical debt */
        el[0].classList[1].replace(/.*f-icon-(\w+).*/, "$1")
      )
    );
  }
  /**
   * @deprecated Deprecated alias for `typeOfFile`.
   */
  typeOfFileIcon() {
    return this.typeOfFile();
  }
  /**
   * @internal
   */
  typeOfButtonIcon() {
    return this._cancelDeleteButtonIcon().then(
      (el) => (
        /* eslint-disable-next-line sonarjs/slow-regex -- technical debt */
        el[0].classList[2].replace(/.*f-icon-(\w+).*/, "$1")
      )
    );
  }
};

// src/cypress/FFileSelector.pageobject.ts
var FFileSelectorPageObject = class {
  selector;
  el;
  addFile;
  icon;
  /**
   * @param selector - the root of the file file selector, usually `<div class="file-selector">...</div>`.
   */
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(this.selector);
    this.addFile = () => cy.get(`${this.selector} > input`);
    this.icon = () => cy.get(`${this.selector}  .f-icon-paper-clip`);
  }
};

// src/cypress/FListItem.pageobject.ts
var FListItemPageObject = class {
  selector;
  el;
  index;
  /**
   * @param selector - the root of the li, usually `<li class="list__item">...</li>`.
   * @param index - the index of matched li:s.
   */
  constructor(selector, index) {
    this.selector = `${selector}:nth(${String(index)})`;
    this.index = index;
    this.el = () => cy.get(this.selector);
  }
  /**
   * Select checkbox page object
   */
  selectCheckbox() {
    return new FCheckboxFieldPageObject(
      `${this.selector} .list__item__selectpane__input`
    );
  }
  /**
   * Content / Clickable link if checkbox:false
   */
  content() {
    return cy.get(`${this.selector} .list__item__itempane`);
  }
};

// src/cypress/FList.pageobject.ts
var FListPageObject = class {
  _selectors;
  /**
   * @param selector - the root of the list, usually `<ul class="list">...</ul>`.
   */
  constructor(selector = ".list") {
    this._selectors = FListSelectors(selector);
  }
  get selector() {
    return this._selectors.selector;
  }
  el() {
    return cy.get(this._selectors.selector);
  }
  /**
   * Hämta page object för specifikt list item.
   */
  listItem(index) {
    return new FListItemPageObject(`${this.selector} > .list__item`, index);
  }
  /**
   * Hämta alla list items.
   */
  listItems() {
    return cy.get(this._selectors.listItems());
  }
  /**
   * Felmeddelande
   */
  emptyMessage() {
    return cy.get(this._selectors.emptyMessage());
  }
};

// src/cypress/FLoader.pageobject.ts
var FLoaderPageObject = class {
  selector;
  /**
   * @param selector - the root of the loader, usually `<div class="loader">...</div>`.
   */
  constructor(selector = ".loader") {
    this.selector = selector;
  }
  el() {
    return cy.get(this.selector);
  }
  wrapper() {
    return cy.get(`${this.selector} .loader__wrapper`);
  }
  waitText() {
    return cy.get(`${this.selector} .loader__wait-text`);
  }
};

// src/cypress/FMessageBox.pageobject.ts
var FMessageBoxPageObject = class {
  selector;
  el;
  errors;
  /**
   * @param selector - the root of the message box, usually `<div class="message-box">...</div>`.
   */
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(selector);
    this.errors = new FErrorListPageObject(this.selector);
  }
  icon() {
    return cy.get(`${this.selector} .message-box__icon`);
  }
  content() {
    return cy.get(`${this.selector} .message-box__content`);
  }
  typeOfMessage() {
    return this.el().then(
      (el) => (
        /* eslint-disable-next-line sonarjs/slow-regex -- technical debt */
        el[0].className.replace(/.*message-box--(\w+).*/, "$1")
      )
    );
  }
};

// src/cypress/FMinimizablePanel.pageobject.ts
var FMinimizablePanelPageObject = class {
  /** Base selector */
  selector;
  /**
   * @param selector - panel selector.
   */
  constructor(selector) {
    this.selector = selector;
  }
  /**
   * Panel element.
   */
  el() {
    return cy.get(this.selector);
  }
  /**
   * Content in header slot (as defined by consumer).
   */
  header() {
    return cy.get(`${this.selector} [slot=header]`);
  }
  /**
   * Content in content slot (as defined by consumer).
   */
  content() {
    return cy.get(`${this.selector} [slot=content]`);
  }
  /**
   * Content in footer slot (as defined by consumer).
   */
  footer() {
    return cy.get(`${this.selector} [slot=footer]`);
  }
  /**
   * Toggle button.
   */
  toggleButton() {
    return this.el().shadow().find(".panel__button");
  }
};

// src/cypress/FModal.pageobject.ts
var FModalPageObject = class {
  selector;
  el;
  /**
   * @param selector - the root of the Modal, usually `<div class="modal">...</div>`.
   */
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(`${this.selector} .modal__dialog-container`);
  }
  title() {
    return cy.get(
      `${this.selector} .modal__dialog-container .modal__title`
    );
  }
  body() {
    return cy.get(
      `${this.selector} .modal__dialog-container .modal__content`
    );
  }
  primaryButton() {
    return cy.get(
      `${this.selector} .modal__dialog-container .modal__footer .button--primary`
    );
  }
  secondaryButton() {
    return cy.get(
      `${this.selector} .modal__dialog-container .modal__footer .button--secondary`
    );
  }
  closeCross() {
    return cy.get(
      `${this.selector} .modal__dialog-container .close-button`
    );
  }
  typeOfModal() {
    return cy.get(this.selector).then((el) => el[0].className.replace(/.*modal--(\w+).*/, "$1"));
  }
};

// src/cypress/FFormModal.pageobject.ts
var FFormModalPageObject = class extends FModalPageObject {
  selector;
  el;
  /**
   * @param selector - the root of the Modal, usually `<div class="modal">...</div>`.
   */
  constructor(selector) {
    super(selector);
    this.selector = selector;
    this.el = () => cy.get(this.selector);
  }
  submitButton() {
    return this.primaryButton();
  }
  cancelButton() {
    return this.secondaryButton();
  }
};

// src/cypress/IPopupMenu.pageobject.ts
var IPopupMenuPageObject = class {
  selector;
  el() {
    return cy.get(this.selector);
  }
  /**
   * @param selector - the root of the IPopupMenu, usually `<nav class="IPopupMenu">...</nav>`.
   */
  constructor(selector) {
    this.selector = selector;
  }
  /**
   * Get all items in the IPopupMenu
   * @returns all items
   */
  items() {
    return cy.get(`${this.selector} .ipopupmenu__list__item`);
  }
  /**
   * Get the item at position index in the IPopupMenu
   *
   * @param index - the position index in the item array
   * @returns Menu item with given index
   */
  item(index) {
    return this.items().eq(index);
  }
  /**
   * Get link for item at index
   *
   * @param index - the position index in the item array
   * @returns link with given index
   */
  getItemLink(index) {
    return cy.get(
      `${this.selector} .ipopupmenu__list__item a:nth(${String(index)})`
    );
  }
  /**
   * Get currently selected menu item
   *
   * @returns Currently selected item
   */
  getSelectedItem() {
    return this.items().get(
      `${this.selector} .ipopupmenu__list__item--highlight`
    );
  }
};

// src/cypress/FNavigationMenu/FNavigationMenu.pageobject.ts
var FNavigationMenuPageobject = class {
  selector;
  /**
   * @param selector - the root of the navigation menu, usually `.imenu`.
   */
  constructor(selector = ".imenu") {
    this.selector = selector;
  }
  el() {
    return cy.get(this.selector);
  }
  /**
   * Get all visible items in the menu, including the popup menu item.
   *
   * @returns All visible menu items.
   */
  items() {
    return cy.get(
      `${this.selector} .imenu__list__item:not(.imenu__list__item--hidden)`
    );
  }
  /**
   * Get all overflowed (hidden) items in the menu.
   *
   * @returns All overflowed menu items.
   */
  overflowItems() {
    return cy.get(`${this.selector} .imenu__list__item--hidden`);
  }
  /**
   * Get the visible item at position index in the menu, including popup item.
   *
   * @param index - the position index in the item array.
   * @returns Menu item with given index.
   */
  item(index) {
    return this.items().eq(index);
  }
  /**
   * Get link for visible item at given index, including popup item.
   *
   * @param index - the position index in the item array.
   * @returns link with given index.
   */
  itemLink(index) {
    return cy.get(
      `${this.selector} .imenu__list__item:not(.imenu__list__item--hidden) a:nth(${String(index)})`
    );
  }
  /**
   * Get currently selected menu item.
   *
   * @returns Currently selected item.
   */
  selectedItem() {
    return this.items().get(
      `${this.selector} .imenu__list__item--highlight`
    );
  }
  /**
   * Get the menu item that open the popup menu.
   *
   * @returns The popup menu item.
   */
  popupItem() {
    return this.items().get(`${this.selector} .imenu__popup-item__wrapper`);
  }
  /**
   * Returns `IPopupMenu` page object.
   */
  popupMenu() {
    return new IPopupMenuPageObject(`.ipopupmenu > ul.ipopupmenu__list`);
  }
};

// src/cypress/FOffline.pageobject.ts
var FOfflinePageObject = class {
  selector;
  el;
  banner;
  /**
   * @param selector - optional custom selector to offline component.
   */
  constructor(selector = "body > .offline__wrapper") {
    this.selector = selector;
    this.el = () => cy.get(this.selector);
    this.banner = () => cy.get(`${this.selector} .offline`);
  }
};

// src/cypress/FOutputField.pageobject.ts
var FOutputFieldPageobject = class {
  selector;
  el;
  label;
  tooltip;
  body;
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(this.selector);
    this.label = new FLabelPageObject(`${this.selector} .label`);
    this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
    this.body = () => cy.get(`${this.selector} .output-field__output`);
  }
};

// src/cypress/input.ts
var Input = class {
  selector;
  inputSelector;
  el;
  constructor(selector, inputSelector) {
    this.selector = selector;
    this.inputSelector = inputSelector;
    this.el = () => cy.get(this.selector);
  }
  enter(text) {
    return cy.get(`${this.selector} ${this.inputSelector}`).clear().type(text).blur();
  }
  value() {
    return cy.get(`${this.selector}  ${this.inputSelector}`).then((el) => {
      return el.get(0).value;
    });
  }
};

// src/cypress/FTextField.pageobject.ts
var FTextFieldPageObject = class extends Input {
  selector;
  el;
  label;
  tooltip;
  /**
   * @param selector - the root of the text field, usually `<div class="text-field">...</div>`.
   */
  constructor(selector) {
    super(selector, "input");
    this.selector = selector;
    this.el = () => cy.get(this.selector);
    this.label = new FLabelPageObject(`${this.selector} .label`);
    this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
  }
  input() {
    return cy.get(`${this.selector} input`);
  }
  errorIcon() {
    return cy.get(`${this.selector} .icon.text-field__icon.f-icon-error`);
  }
};

// src/cypress/ICalendarNavbar.pageobject.ts
var ICalendarNavbarPageObject = class {
  selector;
  /**
   * @param selector - CSS selector to the ICalendarNavbar object
   */
  constructor(selector = ".calendar-navbar") {
    this.selector = selector;
  }
  el() {
    return cy.get(this.selector);
  }
  text() {
    return cy.get(`${this.selector} .calendar-navbar__month--title`);
  }
  /**
   * @internal
   */
  yearSelectorButton() {
    return cy.get(
      `${this.selector} .calendar-navbar__year-selector-button`
    );
  }
  prevButton() {
    return cy.get(`${this.selector} .calendar-navbar__arrow--previous`);
  }
  nextButton() {
    return cy.get(`${this.selector} .calendar-navbar__arrow--next`);
  }
};

// src/cypress/FDatepickerField.pageobject.ts
var FDatepickerFieldPageobject = class {
  selector;
  textField;
  calendarNavbar;
  constructor(selector) {
    this.selector = selector;
    this.textField = new FTextFieldPageObject(
      `${this.selector} .text-field`
    );
    this.calendarNavbar = new ICalendarNavbarPageObject(
      `${this.selector} .calendar-navbar`
    );
  }
  el() {
    return cy.get(this.selector);
  }
  input() {
    return this.textField.input();
  }
  textFieldErrorMessage() {
    return this.textField.label.errorMessage();
  }
  toggleCalendarButton() {
    return cy.get(`${this.selector} [data-test="calendar-button"]`);
  }
  closeCalendarButton() {
    return cy.get(`${this.selector}__close__button`);
  }
  popup() {
    return cy.get(`${this.selector} .popup`);
  }
  calendar() {
    return cy.get(`${this.selector} .calendar__wrapper`);
  }
  calendarCaption() {
    return this.calendarNavbar.text();
  }
  /**
   * @internal
   */
  navYearSelectorButton() {
    return this.calendarNavbar.yearSelectorButton();
  }
  navPrevButton() {
    return this.calendarNavbar.prevButton();
  }
  navNextButton() {
    return this.calendarNavbar.nextButton();
  }
  dayButton(date) {
    return cy.get(`${this.selector} [data-date="${date}"]`);
  }
  disabledDay(date) {
    return cy.get(
      `${this.selector} [data-date="${date}"] .calendar-day--disabled`
    );
  }
  selectedDay() {
    return cy.get(`${this.selector} [data-date] .calendar-day--selected`);
  }
  highlightedDay() {
    return cy.get(`${this.selector} [data-date] .calendar-day--today`);
  }
  /**
   * @internal
   */
  yearSelector() {
    return cy.get(`${this.selector} .calendar__year-selector`);
  }
  /**
   * @internal
   */
  highlightedYear() {
    return cy.get(
      `${this.selector} .calendar__year-selector__year--highlight`
    );
  }
  /**
   * Get all available years from year selector.
   *
   * @internal
   */
  availableYears() {
    return cy.get(`${this.selector} .calendar__year-selector__year`);
  }
};

// src/cypress/FPageHeader/FPageHeader.pageobject.ts
var FPageHeaderPageobject = class {
  selector;
  /**
   * @param selector - the root of the page header, usually `div.page-header__root`.
   */
  constructor(selector = ".page-header__root") {
    this.selector = selector;
  }
  /**
   * Get root element.
   */
  el() {
    return cy.get(this.selector);
  }
  /**
   * Get skiplink anchor element and wrapper for `skip-link-text` slot.
   */
  skipLink() {
    return cy.get(`${this.selector} .iskiplink`).then(($el) => {
      $el.css({ top: 45, left: 10 });
    });
  }
  /**
   * Get wrapper element for `default` slot.
   */
  applicationName() {
    return cy.get(`${this.selector} .page-header__app-name`);
  }
  /**
   * Get wrapper element for `right` slot.
   */
  rightSlot() {
    return cy.get(`${this.selector} .page-header__right-slot`);
  }
  /**
   * Get wrapper element for `logo` slot.
   */
  logoSlot() {
    return cy.get(`${this.selector} div.page-header__logo`);
  }
};

// src/cypress/FRadioGroup.pageobject.ts
var FRadioGroupPageObject = class {
  selector;
  el;
  label;
  tooltip;
  /**
   * @param selector - the root of the radio group, usually `<div class="radio-button-group">...</div>`.
   */
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(this.selector);
    this.label = new FLabelPageObject(`${this.selector} legend.label`);
    this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
  }
  content() {
    return cy.get(`${this.selector} .radio-button-group__content`);
  }
  radioButton(buttonSelector) {
    return new FRadioFieldPageObject(`${this.selector} ${buttonSelector}`);
  }
  numberOfOptions() {
    return cy.get(`${this.selector} .radio-button`).then((el) => {
      return el.length;
    });
  }
};

// src/cypress/FSelectField.pageobject.ts
var FSelectFieldPageObject = class {
  selector;
  el;
  label;
  tooltip;
  /**
   * @param selector - the root of the select field, usually `<div class="select-field">...</div>`.
   */
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(this.selector);
    this.label = new FLabelPageObject(`${this.selector} .label`);
    this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
  }
  dropdown() {
    return cy.get(`${this.selector} select`);
  }
  arrowIcon() {
    return cy.get(
      `${this.selector} .icon.select-field__icon.f-icon-arrow-down`
    );
  }
  numberOfOptions() {
    return this.dropdown().then(
      (el) => el.find("option").not('[disabled="disabled"]').length
    );
  }
  listOfOptions() {
    const listItem = [];
    return cy.get(`${this.selector} select option`).not('[disabled="disabled"]').each((el) => {
      return listItem.push(el.get(0).textContent.trim());
    }).then(() => listItem);
  }
  /**
   * Get the currently selected `<option>` element.
   */
  selectedOption() {
    return cy.get(`${this.selector} option:selected`);
  }
  selectedValue() {
    return this.dropdown().then((el) => {
      return el.get(0).value;
    });
  }
};

// src/cypress/FSortFilterDataset.pageobject.ts
var FSortFilterDatasetPageObject = class {
  selector;
  el;
  textField;
  selectField;
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(this.selector);
    this.selectField = new FSelectFieldPageObject(
      `${this.selector} .select-field--inline`
    );
    this.textField = new FTextFieldPageObject(
      `${this.selector} .sort-filter-dataset__search`
    );
  }
  header() {
    return cy.get(
      `${this.selector} .iflex .sort-filter-dataset__toolbar__header`
    );
  }
};

// src/cypress/FStaticField.pageobject.ts
var FStaticFieldPageObject = class {
  selector;
  el;
  label;
  tooltip;
  /**
   * @param selector - the root of the static field, usually `<div class="output-field">...</div>`.
   */
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(this.selector);
    this.label = new FLabelPageObject(`${this.selector} .label`);
    this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
  }
  body() {
    return cy.get(`${this.selector} p`);
  }
};

// src/cypress/FInteractiveTable.pageobject.ts
var FInteractiveTablePageObject = class {
  selector;
  /**
   * @param selector - root element selector for `FInteractiveTable`, usually `.table`.
   */
  constructor(selector = ".table") {
    this.selector = selector;
  }
  /**
   * Get root element.
   */
  el() {
    return cy.get(this.selector);
  }
  /**
   * Get table cell (typically `<td>` but can be `<th>` if row headers are
   * present).
   *
   * Both row and column are 1-indexed, i.e. 1:1 selects the first cell in the
   * first row.
   *
   * Neither the marker for expandable rows or the radio/checkbox for selectable
   * rows are included in the column count, i.e. `1` always refers to the
   * first column with content.
   *
   * For expandable rows the row count depend on whenever a row is expanded or
   * not. If the first row is collapsed the second row refers to the next
   * parent row while if the first row is expanded the second row refers to
   * the first expanded row under the first row.
   *
   * @public
   * @param descriptor - Row and column number of cell (1-indexed).
   * @returns The cell element.
   */
  cell(descriptor) {
    const rowIndex = descriptor.row - 1;
    const colIndex = descriptor.col - 1;
    return cy.get(
      [
        this.selector,
        `tbody`,
        `tr:not(.table__expandable-row--collapsed):nth(${String(rowIndex)})`,
        `> .table__column:nth(${String(colIndex)})`
      ].join(" ")
    );
  }
  /**
   * Get `<caption>` element.
   */
  caption() {
    return cy.get(`${this.selector} caption`);
  }
  /**
   * Get table header cell (`<th>` in `<thead>`).
   *
   * Neither the marker for expandable rows or the radio/checkbox for selectable
   * rows are included in the column count, i.e. `1` always refers to the
   * first column with content.
   *
   * @public
   * @param col - column number of header (1-indexed).
   * @returns The header cell element.
   */
  header(col) {
    const index = col - 1;
    return cy.get(
      `${this.selector} thead .table__column:nth(${String(index)})`
    );
  }
  /**
   * Get all table headers (`<th>` in `<thead>`).
   *
   * Includes the headers for radios/checkboxes in selectable rows and markers in expandable rows.
   */
  headersRow() {
    return cy.get(`${this.selector} thead th`);
  }
  /**
   * Get row (`<tr>` in `<tbody>`) of given index.
   *
   * Includes expandable rows even if not expanded.
   *
   * @param index - Row number (0-indexed).
   */
  row(index) {
    return cy.get(`${this.selector} tbody tr:nth(${String(index)})`);
  }
  /**
   * Get all table body rows (`<tr>` in `<tbody>`).
   *
   * Includes expandable rows even if not expanded.
   */
  bodyRow() {
    return cy.get(`${this.selector} tbody tr`);
  }
  /**
   * Get page object with selector for the checkbox in given row.
   *
   * For expandable rows the row count depend on whenever a row is expanded or
   * not. If the first row is collapsed the second row refers to the next
   * parent row while if the first row is expanded the second row refers to
   * the first expanded row under the first row.
   *
   * Requires a `selectable` table of type `multi`.
   *
   * @public
   * @deprecated Use ´.selectable()´ instead. Deprecated since v6.28.0.
   * @param row - Row number (1-indexed).
   * @returns Page object for `FCheckboxField`.
   */
  checkbox(row) {
    const index = row - 1;
    return new FCheckboxFieldPageObject(
      [
        this.selector,
        `tbody`,
        `tr:not(.table__expandable-row--collapsed):nth(${String(index)})`,
        `.checkbox`
      ].join(" ")
    );
  }
  /**
   * Get selectable input element (checkbox or radio) in given row.
   *
   * For expandable rows the row count depend on whenever a row is expanded or
   * not. If the first row is collapsed the second row refers to the next
   * parent row while if the first row is expanded the second row refers to
   * the first expanded row under the first row.
   *
   * Requires a `selectable` table.
   *
   * @public
   * @since v6.28.0
   * @param row - Row number (1-indexed).
   * @returns Input element.
   */
  selectable(row) {
    const index = row - 1;
    return cy.get(
      [
        this.selector,
        `tbody`,
        `tr:not(.table__expandable-row--collapsed):nth(${String(index)})`,
        `input`
      ].join(" ")
    ).first();
  }
  /**
   * Get sort order icon in given column.
   *
   * Index includes the columns for radios/checkboxes in selectable rows and markers in expandable rows.
   *
   * @param index - Column index (0-indexed).
   * @param order - Column sort order.
   * @returns icon of given sort order.
   */
  getColumnSortedByIcon(index, order) {
    let iconName;
    switch (order) {
      case "ascending":
        iconName = "f-icon-caret-up";
        break;
      case "descending":
        iconName = "f-icon-caret-down";
        break;
      case "unsorted":
        iconName = "f-icon-sort";
        break;
      default:
        throw new Error("Invalid order");
    }
    return cy.get(
      `${this.selector} thead th:nth(${String(index)}) svg.${iconName}`
    );
  }
  /**
   * Get page object for `FTableColumn` with selector targeting the header row.
   *
   * @deprecated Use `header()` instead. Deprecated since v6.11.0.
   * @returns Page object for `FTableColumn`.
   */
  /* eslint-disable-next-line @typescript-eslint/no-deprecated -- for backwards compatibility */
  headerRowItem() {
    return new FTableColumnPageObject(`${this.selector} .table__row`, 0);
  }
  /**
   * Get page object for `FTableColumn` with selector targeting the given row number.
   *
   * Index includes the header row (index 0 selects the header row while 1 selects first row in table body).
   * Index ignores expandable rows.
   *
   * @deprecated Use `cell()` for body content and `header()` for header content instead. Deprecated since v6.11.0.
   * @param index - Row number (0-indexed).
   * @returns Page object for `FTableColumn`.
   */
  /* eslint-disable-next-line @typescript-eslint/no-deprecated -- for backwards compatibility */
  columnItem(index) {
    return new FTableColumnPageObject(
      `${this.selector} .table__row`,
      index
    );
  }
};

// src/cypress/FTableColumn.pageobject.ts
var FTableColumnPageObject = class {
  selector;
  el;
  index;
  constructor(selector, index) {
    this.selector = `${selector}:nth(${String(index)})`;
    this.index = index;
    this.el = () => cy.get(this.selector);
  }
  /**
   * @deprecated Use ´FInteractiveTablePageObject.cell()´ instead. Deprecated since v6.11.0.
   */
  tableRowBodyContent(position) {
    return cy.get(`${this.selector} td:nth(${String(position)})`);
  }
  /**
   * @deprecated Use ´FInteractiveTablePageObject.header()´ instead. Deprecated since v6.11.0.
   */
  tableRowHeaderContent() {
    return cy.get(`${this.selector} th`);
  }
  /**
   * @deprecated Use ´FInteractiveTablePageObject.selectable()´ instead. Deprecated since v6.11.0.
   */
  checkbox() {
    return new FCheckboxFieldPageObject(this.selector);
  }
};

// src/cypress/FTextareaField.pageobject.ts
var FTextareaFieldPageObject = class extends Input {
  selector;
  el;
  label;
  tooltip;
  /**
   * @param selector - the root of the textarea field, usually `<div class="textarea-field">...</div>`.
   */
  constructor(selector) {
    super(selector, "textarea");
    this.selector = selector;
    this.el = () => cy.get(this.selector);
    this.label = new FLabelPageObject(`${this.selector} .label`);
    this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
  }
  input() {
    return cy.get(`${this.selector} textarea`);
  }
  errorIcon() {
    return cy.get(
      `${this.selector} .icon.textarea-field__icon.f-icon-error`
    );
  }
};

// src/cypress/IAnimateExpand.pageobject.ts
var IAnimateExpandPageobject = class {
  selector;
  el() {
    return cy.get(this.selector);
  }
  content() {
    return cy.get(`${this.selector} [data-test="animation-content"]`);
  }
  animationClass() {
    return cy.get(`${this.selector} .animate-expand--expanded`);
  }
  /**
   * Wait for open animation to finish.
   */
  waitOnOpen() {
    cy.log("Wait for open animation to finish");
    this.animationClass().should("exist");
    this.waitOnAnimationCompleted();
  }
  /**
   * Wait for open animation to not exist.
   */
  waitOnAnimationCompleted() {
    cy.log("Wait for open animation to complete");
    this.animationClass().should("not.exist");
  }
  /**
   * Wait for close animation to finish.
   */
  waitOnClose() {
    cy.log("Wait for close animation to finish");
    cy.get(`${this.selector} [data-test="animation-content"] > *`).should(
      "not.exist"
    );
  }
  constructor(selector) {
    this.selector = selector;
  }
};

// src/cypress/FWizard/FWizardStepHeader.pageobject.ts
var FWizardStepHeaderPageobject = class {
  selector;
  el;
  successIcon;
  stepNumber;
  stepOf;
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(`${this.selector} .wizard-step__header`);
    this.successIcon = () => cy.get(
      `${this.selector} .wizard-step__icon-container__circle .f-icon-success`
    );
    this.stepNumber = () => cy.get(`${this.selector} [data-test="step-number"]`).invoke("text");
    this.stepOf = () => cy.get(`${this.selector} .wizard-step__step-of`);
  }
  title() {
    return cy.get(
      `${this.selector} .wizard-step__header .wizard-step__header__title`
    ).then((element) => {
      if (element.children("a").length > 0) {
        return cy.get(
          `${this.selector} .wizard-step__header .wizard-step__header__title > a`
        );
      }
      return cy.get(
        `${this.selector} .wizard-step__header .wizard-step__header__title`
      );
    });
  }
};

// src/cypress/FWizard/FWizardStep.pageobject.ts
var STATUS = /* @__PURE__ */ ((STATUS2) => {
  STATUS2["done"] = "done";
  STATUS2["open"] = "open";
  STATUS2["pending"] = "pending";
  return STATUS2;
})(STATUS || {});
var FWizardStepPageobject = class {
  selector;
  el() {
    return cy.get(this.selector);
  }
  /**
   * Get the header pageobject in the FWizardStep
   */
  header;
  /**
   * get the errorlist pageobject in the FWizardStep
   */
  errors;
  /**
   * Get the primary button element of the FWizardStep
   */
  continue() {
    this.waitOnAnimationCompleted();
    return cy.get(`${this.selector} .button-group:last .button--primary`);
  }
  /**
   * Get the secondary button element of the FWizardStep
   */
  cancel() {
    this.waitOnAnimationCompleted();
    return cy.get(`${this.selector} .button-group:last .button--secondary`);
  }
  /**
   * Get the body element of the FWizardStep
   */
  body() {
    return cy.get(`${this.selector} .wizard-step-body`);
  }
  /**
   * Get the steps number
   */
  stepNumber() {
    return cy.get(`${this.selector} [data-test="step-number"]`).invoke("text");
  }
  /**
   * Get the title element
   */
  title() {
    return cy.get(`${this.selector} .wizard-step__header__title`).then((element) => {
      if (element.children("a").length > 0) {
        return cy.get(
          `${this.selector} .wizard-step__header__title > a`
        );
      }
      return cy.get(`${this.selector} .wizard-step__header__title`);
    });
  }
  /**
   * Wait for open animation to finish.
   */
  waitOnOpen() {
    this.animateExpand.waitOnOpen();
  }
  /**
   * Wait for close animation to finish.
   */
  waitOnClose() {
    this.animateExpand.waitOnClose();
  }
  /**
   * Wait for any animation to complete.
   */
  waitOnAnimationCompleted() {
    this.animateExpand.waitOnAnimationCompleted();
  }
  animateExpand;
  constructor(selector) {
    this.selector = selector;
    this.errors = new FErrorListPageObject(`${this.selector} .error-list`);
    this.header = new FWizardStepHeaderPageobject(this.selector);
    this.animateExpand = new IAnimateExpandPageobject(this.selector);
  }
  /**
   * Get the status of the wizard step.
   * @see STATUS
   */
  status() {
    return this.el().then(
      (el) => (
        /* eslint-disable-next-line sonarjs/slow-regex -- technical debt */
        el[0].className.replace(/.*wizard-step--(\w+).*/, "$1")
      )
    );
  }
};

// src/cypress/FWizard/FWizard.pageobject.ts
var FWizardPageobject = class {
  selector;
  el() {
    return cy.get(this.selector);
  }
  /**
   * Get all FWizardSteps in the FWizard
   *
   * @returns all steps
   */
  steps() {
    return cy.get(`${this.selector} .wizard-step`);
  }
  /**
   * Get specfic step in wizard.
   *
   * @param index - step to retrieve (0-indexed)
   * @returns FWizardStepPageObject
   */
  getStep(index) {
    return new FWizardStepPageobject(
      `${this.selector} .wizard-step:nth(${String(index)})`
    );
  }
  /**
   * Turns off the animation att css class level.
   */
  turnOffAnimation() {
    cy.get(".wizard-step__content").invoke("css", "transition", "none");
  }
  constructor(selector) {
    this.selector = selector;
  }
};

// src/cypress/ICalendar/Calendar.pageobject.ts
var monthList = [
  "Januari",
  "Februari",
  "Mars",
  "April",
  "Maj",
  "Juni",
  "Juli",
  "Augusti",
  "September",
  "Oktober",
  "November",
  "December"
];
var CalendarPageObject = class {
  selector;
  navigationBar;
  constructor(selector) {
    this.selector = selector;
    this.navigationBar = new ICalendarNavbarPageObject(
      `${this.selector} .calendar-navbar`
    );
  }
  el() {
    return cy.get(this.selector);
  }
  /**
   * Get the caption text.
   *
   * @internal
   */
  calendarCaption() {
    return this.navigationBar.text();
  }
  /**
   * return the weeknumbers surrounding the days in the calendar
   */
  weekNumbers() {
    return cy.get(`${this.selector} .calendar-month__cell--week-number`);
  }
  /**
   * return the weekday names surrounding the days in the calendar
   */
  headerCells() {
    return cy.get(
      `${this.selector} .calendar-month__header-cell  > :is(abbr, span)`
    );
  }
  /**
   * Day to select in the calendar day-view via day number
   */
  dayButton(day = 1) {
    return cy.get(
      `${this.selector} .calendar-month__button:nth(${String(day - 1)})`
    );
  }
  day(day = 1) {
    return new FCalendarDayPageObject(
      `${this.selector} .calendar-month__button:nth(${String(
        day - 1
      )}) .calendar-day`
    );
  }
  /**
   * Uses the calendar navigation bar navigate to selected year and month
   * jan = 0, dec = 11
   * @param targetYear - Selected year
   * @param targetMonth - Selected month 0-11, 0 = Jan 11 = dec
   */
  navigateTo(targetYear, targetMonth) {
    cy.log(`Navigate to ${monthList[targetMonth]} ${String(targetYear)}`);
    this.navigationBar.text().then((el) => {
      let currYear = 2023;
      let currentMonth = 0;
      el.text().replace(
        /* eslint-disable-next-line sonarjs/slow-regex -- technical debt */
        /(\w+)\s+(\d+)/,
        (match, p1, p2) => {
          currentMonth = monthList.indexOf(p1);
          currYear = Number.parseInt(p2, 10);
          return String(currYear);
        }
      );
      const yearDiff = Math.abs(currYear - targetYear);
      const monthDiff = Math.abs(currentMonth - targetMonth);
      let diffInMonths = currYear > targetYear ? yearDiff * -12 : yearDiff * 12;
      diffInMonths += currentMonth > targetMonth ? -monthDiff : monthDiff;
      if (diffInMonths !== 0) {
        const stepMonth = diffInMonths < 0 ? this.navigationBar.prevButton() : this.navigationBar.nextButton();
        for (let i = 0; i < Math.abs(diffInMonths); i++) {
          stepMonth.click();
        }
      }
    });
  }
  /**
   * @internal
   */
  navYearSelectorButton() {
    return this.navigationBar.yearSelectorButton();
  }
  /**
   * @internal
   */
  yearSelector() {
    return cy.get(`${this.selector} .calendar__year-selector`);
  }
  /**
   * @internal
   */
  yearSelectorListbox() {
    return cy.get(`${this.selector} .calendar__year-selector__listbox`);
  }
  /**
   * @internal
   */
  highlightedYear() {
    return cy.get(
      `${this.selector} .calendar__year-selector__year--highlight`
    );
  }
  /**
   * Get all available years from year selector.
   *
   * @internal
   */
  availableYears() {
    return cy.get(`${this.selector} .calendar__year-selector__year`);
  }
};

// src/cypress/IPopup.pageobject.ts
var IPopupPageObject = class {
  selector;
  /**
   * @param selector - the root of the IPopup.
   */
  constructor(selector = ".popup") {
    this.selector = selector;
  }
  el() {
    return cy.get(this.selector);
  }
};

// src/cypress/AlertScreenReader.pageobject.ts
var AlertScreenReaderPageObject = class {
  selector = "#fkui-alert-screen-reader";
  /**
   * Returns the alertScreenReader element with text.
   */
  el() {
    return cy.get(this.selector);
  }
};

// src/cypress/FDialogueTreeItem.pageobject.ts
var FDialogueTreeItemPageObject = class {
  selector;
  el;
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(this.selector);
  }
  title() {
    return cy.get(this.selector);
  }
  button() {
    return cy.get(`${this.selector} button`);
  }
  select() {
    return this.button().click();
  }
};

// src/cypress/FDialogueTree.pageobject.ts
var FDialogueTreePageObject = class {
  selector;
  el;
  constructor(selector) {
    this.selector = selector;
    this.el = () => cy.get(this.selector);
  }
  options() {
    return cy.get(`${this.selector} li`);
  }
  option(index) {
    return new FDialogueTreeItemPageObject(
      `${this.selector} li:nth(${String(index)})`
    );
  }
};

// src/cypress/FPaginator.pageobject.ts
var FPaginatorPageObject = class {
  _selectors;
  /**
   * @param selector - The root of the FPaginator component
   */
  constructor(selector = ".paginator") {
    this._selectors = FPaginatorSelectors(selector);
  }
  get selector() {
    return this._selectors.selector;
  }
  /**
   * Get the root element.
   *
   * @returns The element itself.
   */
  el() {
    return cy.get(this._selectors.selector);
  }
  /**
   * Get the button for the current page.
   *
   * @returns The button for the current page.
   */
  currentPageButton() {
    return cy.get(this._selectors.currentPageButton());
  }
  /**
   * Get the button for navigating to the next page.
   *
   * @returns The button for navigating to the next page.
   */
  nextButton() {
    return cy.get(this._selectors.nextPageButton());
  }
  /**
   * Gets the button/buttons for the specified page/pages.
   *
   * @param page - The index of the page button (if number); the number of the page (if string)
   * @returns The button for the specified page (if param `page` is defined); the buttons for all pages shown (if param `page` is undefined).
   */
  pageButton(page) {
    switch (typeof page) {
      case "number":
        return cy.get(this._selectors.pageButtonByIndex(page));
      case "string":
        return cy.get(this._selectors.pageButtonByText(page));
      default:
        return cy.get(this._selectors.pageButtons());
    }
  }
  /**
   * Get the page counter.
   * The element replaces the page buttons in compact mode.
   *
   * @returns The page counter.
   */
  pageCounter() {
    return cy.get(`${this._selectors.pageCounter()} [aria-hidden]`);
  }
  /**
   * Get the button for navigating to the previous page.
   *
   * @returns The button for navigating to the previous page.
   */
  previousButton() {
    return cy.get(this._selectors.previousPageButton());
  }
};

// src/cypress/FTable.pageobject.ts
var FTablePageObject = class {
  selector;
  selectHeader = ".table-ng__column--selectable";
  columnTitle = ".table-ng__column__title";
  columnDescription = ".table-ng__column__description";
  expandCell = ".table-ng__cell--expand";
  selectCell = ".table-ng__cell--selectable";
  /**
   * @param selector - root element selector for `FTable`, usually `.table-ng`.
   */
  constructor(selector = ".table-ng") {
    this.selector = selector;
  }
  /**
   * Get root element.
   *
   * @public
   */
  el() {
    return cy.get(this.selector);
  }
  /**
   * Get table header cell (`<th>` in `<thead>`).
   *
   * The headers for expandable buttons and selectable checkboxes are included.
   *
   * @public
   * @param col - Column number of header (1-indexed).
   * @returns The header cell element (`<th>`).
   */
  header(col) {
    const colIndex = String(col - 1);
    return cy.get([this.thead, `th:nth(${colIndex})`].join(" "));
  }
  /**
   * Get column title from table header.
   *
   * The headers for expandable buttons and selectable checkboxes are included.
   *
   * @public
   * @param col - Column number of header (1-indexed).
   * @returns Column description in header.
   */
  headerTitle(col) {
    const colIndex = String(col - 1);
    return cy.get(
      [this.thead, `th:nth(${colIndex})`, this.columnTitle].join(" ")
    );
  }
  /**
   * Get column description from table header.
   *
   * The headers for expandable buttons and selectable checkboxes are included.
   *
   * @public
   * @param col - Column number of header (1-indexed).
   * @returns Column description in header.
   */
  headerDescription(col) {
    const colIndex = String(col - 1);
    return cy.get(
      [this.thead, `th:nth(${colIndex})`, this.columnDescription].join(
        " "
      )
    );
  }
  /**
   * Get table cell (typically `<td>` but can be `<th>` if row headers are
   * present).
   *
   * Both row and column are 1-indexed, i.e. 1:1 selects the first cell in the
   * first row.
   *
   * The columns for expandable buttons and selectable checkboxes are included in column count.
   *
   * For expandable rows the row count depend on whenever a row is expanded or
   * not. If the first row is collapsed the second row refers to the next
   * parent row while if the first row is expanded the second row refers to
   * the first expanded row under the first row.
   *
   * @public
   * @param descriptor - Row and column number of cell (1-indexed).
   * @returns The cell element.
   */
  cell(descriptor) {
    const row = this.bodyRow(descriptor.row);
    const nth = `nth-child(${descriptor.col})`;
    return cy.get([row, `> td:${nth},`, row, `> th:${nth}`].join(" "));
  }
  /**
   * Get expand button of given row.
   *
   * Only applicable if using an expandable table.
   *
   * @public
   * @param row - Row number for the expand button (1-indexed).
   * @returns Expand button of given row.
   */
  expandButton(row) {
    return cy.get([this.bodyRow(row), this.expandCell, `button`].join(" "));
  }
  /**
   * Get checkbox in the table header for selectable column.
   *
   * Only applicable if using a multiselect table.
   *
   * @public
   * @returns Checkbox in selectable column header.
   */
  selectHeaderInput() {
    return cy.get([this.thead, this.selectHeader, `input`].join(" "));
  }
  /**
   * Get select input of given row.
   *
   * Only applicable if using a selectable table.
   * Input is a checkbox if using a multiselect table and radio if single.
   *
   * @param row - Row number for the select input (1-indexed).
   * @returns Select input of given row.
   */
  selectInput(row) {
    return cy.get([this.bodyRow(row), this.selectCell, `input`].join(" "));
  }
  /**
   * Get the currently open context menu.
   *
   * The context menu must have been opened for this to return an element.
   *
   * @internal
   * @returns The opened context menu element.
   */
  contextmenu() {
    return cy.get(`ul.contextmenu__list`);
  }
  /**
   * Get the menu items of the currently open context menu.
   *
   * The context menu must have been opened for this to return an element.
   *
   * @public
   * @returns The context menu items.
   */
  contextmenuItems() {
    return cy.get(`ul.contextmenu__list .contextmenu__list__item`);
  }
  /**
   * Get the dropdown from a select cell.
   *
   * Only applicable if using a select cell.
   *
   * Element is teleported and does not use given selector. Method may
   * not work properly if there are several dropdowns open simultaneously.
   *
   * @internal
   * @returns Dropdown for a select cell.
   */
  selectDropdown() {
    return cy.get(".combobox__listbox");
  }
  /**
   * Get an option in a select cell dropdown.
   *
   * Only applicable if using a select cell.
   *
   * Element is teleported and does not use given selector. Method may
   * not work properly if there are several dropdowns open simultaneously.
   *
   * @public
   * @param option - option number (1-indexed).
   * @returns Option of given number from a select cell dropdown.
   */
  selectDropdownOption(option) {
    const index = option - 1;
    return cy.get(
      `.combobox__listbox li.combobox__listbox__option:nth(${index})`
    );
  }
  /**
   * Get table caption.
   *
   * Only applicable if caption slot is used.
   *
   * @public
   * @returns The table caption.
   */
  caption() {
    return cy.get(`${this.selector} caption`);
  }
  /**
   * Get table footer.
   *
   * Only applicable if footer slot is used.
   *
   * @public
   * @returns The table footer.
   */
  footer() {
    return cy.get(this.tfoot);
  }
  /**
   * Get current tabbable element in the table.
   *
   * If table is untouched, it is the first cell in the table body (including columns for expandable and selectable).
   * If the cell has an interactable element, it is instead the interactable that is returned and not the cell.
   *
   * @internal
   * @returns The current tabbable element.
   */
  tabbableElement() {
    return cy.get(`${this.selector} [tabindex=0]`);
  }
  /**
   * Get all visible rows (`<tr>` in `<tbody>`).
   *
   * Includes expanded rows if table is expandable.
   *
   * @public
   * @returns All visible rows in the table.
   */
  rows() {
    return cy.get(`${this.tbody} tr`);
  }
  /** @internal */
  bodyRow(row) {
    const rowIndex = String(row - 1);
    return `${this.tbody} tr:nth(${rowIndex})`;
  }
  /** @internal */
  get thead() {
    return `${this.selector} thead`;
  }
  /** @internal */
  get tbody() {
    return `${this.selector} tbody`;
  }
  /** @internal */
  get tfoot() {
    return `${this.selector} tfoot`;
  }
};
//# sourceMappingURL=cypress.cjs.js.map
