import { r as n, c as f, h as e, H as m, g as d } from "./index.61732cef.js";
import { c as h } from "./index-orsBiyT_.fc4357c3.js";
import { D as u } from "./media-query.service-CCYT6DU8.f0931fdc.js";
import "react";
import "react-dom";
import "./utils-CCck-DTo.e4e43b6a.js";
const b = () => '.sc-swirl-resource-list-file-item-h{display:block;width:100%}.sc-swirl-resource-list-file-item-h *.sc-swirl-resource-list-file-item{box-sizing:border-box}.resource-list-file-item.sc-swirl-resource-list-file-item{position:relative;display:flex;width:100%;padding:var(--s-space-12) var(--s-space-16);align-items:center;background-color:var(--s-background-default);line-height:var(--s-line-height-base);gap:var(--s-space-12)}.resource-list-file-item.sc-swirl-resource-list-file-item:focus{outline:none}.resource-list-file-item.sc-swirl-resource-list-file-item:focus-visible{background-color:var(--s-background-hovered)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.resource-list-file-item.sc-swirl-resource-list-file-item{padding:var(--s-space-12);font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.resource-list-file-item--has-control.sc-swirl-resource-list-file-item .resource-list-file-item__label-container.sc-swirl-resource-list-file-item{padding-right:calc(var(--s-space-12) + 2.5rem)}.resource-list-file-item__icon.sc-swirl-resource-list-file-item{width:1.5rem;height:1.5rem;color:var(--s-icon-highlight)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.resource-list-file-item__icon.sc-swirl-resource-list-file-item{width:1.25rem;height:1.25rem}}.resource-list-file-item__label-container.sc-swirl-resource-list-file-item{position:relative;display:flex;min-width:0;min-height:2.875rem;flex-grow:1;justify-content:center;flex-direction:column}.resource-list-file-item__label-container.sc-swirl-resource-list-file-item:after{position:absolute;right:0;bottom:calc(-1 * var(--s-space-12));left:0;height:0.0625rem;background-color:var(--s-border-default);content:""}.resource-list-file-item__label.sc-swirl-resource-list-file-item{overflow:hidden;font-weight:var(--s-font-weight-medium);white-space:nowrap;text-overflow:ellipsis}.resource-list-file-item__description.sc-swirl-resource-list-file-item{overflow:hidden;margin-top:var(--s-space-2);color:var(--s-text-subdued);font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm);white-space:nowrap;text-overflow:ellipsis}.resource-list-file-item__error-message.sc-swirl-resource-list-file-item{margin-top:var(--s-space-2)}.resource-list-file-item__remove-button.sc-swirl-resource-list-file-item{position:absolute;top:50%;right:var(--s-space-16);display:inline-flex;transform:translateY(-50%)}.resource-list-file-item__spinner.sc-swirl-resource-list-file-item{position:absolute;top:50%;right:var(--s-space-24);display:inline-flex;transform:translateY(-50%)}', p = class {
  constructor(i) {
    n(this, i), this.remove = f(this, "remove", 7), this.icon = "<swirl-icon-file></swirl-icon-file>", this.removeButtonLabel = "Remove file", this.mediaQueryUnsubscribe = () => {
    };
  }
  componentDidLoad() {
    this.mediaQueryUnsubscribe = u.subscribe((i) => {
      this.forceIconProps(i);
    });
  }
  disconnectedCallback() {
    this.mediaQueryUnsubscribe();
  }
  forceIconProps(i) {
    if (!Boolean(this.iconEl))
      return;
    const s = this.iconEl.children[0];
    s == null || s.setAttribute("size", i ? "20" : "24");
  }
  render() {
    const i = Boolean(this.errorMessage), s = !i && Boolean(this.description), r = !i && this.loading, t = this.removable && !r, l = this.el.closest('[role="grid"]') ? "row" : "listitem", o = l === "row" ? "gridcell" : void 0, c = h("resource-list-file-item", {
      "resource-list-file-item--has-control": r || t
    });
    return e(m, { key: "3826ef1e74ab990a584abbf2f021b6666c0b62af", role: l }, e("div", { key: "0ee127c0ea2eb388c93607b54e6d2057f6fccf82", class: c, part: "resource-list-file-item", role: o }, e("span", { key: "0908643a3a721461e722cb9f12f9572c489bf0e3", class: "resource-list-file-item__icon", innerHTML: this.icon, ref: (a) => this.iconEl = a }), e("span", { key: "3bbe6041118347f8368b9f6bfffa6773c17480d0", class: "resource-list-file-item__label-container" }, e("span", { key: "b9c61fa069de57b47b0925118fcd64330d0c4d2a", class: "resource-list-file-item__label", id: "label" }, this.label), s && e("span", { key: "1d5b463ecca7e93c332af863f2d055c0ee46aee4", class: "resource-list-file-item__description" }, this.description), i && e("span", { key: "1eba848c7fefd28712e483187cdc86f3ea5e1668", "aria-live": "polite", class: "resource-list-file-item__error-message" }, e("swirl-inline-error", { key: "434560349dc3fe9cc4df49daf426c08b06db2a22", message: this.errorMessage, size: "s" }))), r && e("span", { key: "eea51465daf2267a0cf3e04c355883b318a61fce", class: "resource-list-file-item__spinner" }, e("swirl-spinner", { key: "6743181704297c2c327e692937394ff4e6678d73", size: "s" })), t && e("span", { key: "ae09bfeaeb606840c3499fd03d4198dec5518fa9", class: "resource-list-file-item__remove-button" }, e("swirl-button", { key: "e7e88de842b076ef0b2c8ef059435c67801cb50a", hideLabel: !0, icon: "<swirl-icon-close></swirl-icon-close>", label: this.removeButtonLabel, onClick: this.remove.emit }))));
  }
  get el() {
    return d(this);
  }
};
p.style = b();
export {
  p as swirl_resource_list_file_item
};
