import { ap as attr_class, as as attr, at as bind_props, a6 as derived, an as stringify } from './index2-BLq4EEng.js';

/* empty css                                          */
function html(value) {
  var html2 = String(value ?? "");
  var open = "<!---->";
  return open + html2 + "<!---->";
}
function Loader($$renderer, $$props) {
  let { classes } = $$props;
  $$renderer.push(`<div${attr_class(`loader ${stringify(classes ?? "")}`, "svelte-hpq2nw")}></div>`);
}
function Button($$renderer, $$props) {
  $$renderer.component(($$renderer2) => {
    let {
      text,
      enable = true,
      disabled = false,
      showLoader = false,
      loaderType,
      type = "button",
      testId,
      ariaLabel,
      ariaExpanded,
      ariaSelected,
      role,
      onclick,
      onkeyup = () => {
      },
      showProgressBar = false,
      icon,
      children,
      classes
    } = $$props;
    let isDisabled = derived(() => !enable || disabled || showLoader);
    $$renderer2.push(`<div${attr_class(`button-container ${stringify(classes ?? "")}`, "svelte-r0a4nq")}>`);
    if (showProgressBar) {
      $$renderer2.push("<!--[0-->");
      $$renderer2.push(`<div class="button-progress-bar svelte-r0a4nq"></div>`);
    } else {
      $$renderer2.push("<!--[-1-->");
    }
    $$renderer2.push(`<!--]--> <button${attr("disabled", isDisabled(), true)}${attr("type", type)}${attr("data-pw", testId)}${attr("aria-label", ariaLabel)}${attr("aria-expanded", ariaExpanded)}${attr("aria-selected", ariaSelected)}${attr("role", role)}${attr_class("svelte-r0a4nq", void 0, { "disabled": isDisabled() })}>`);
    if (showLoader && loaderType === "Circular") {
      $$renderer2.push("<!--[0-->");
      $$renderer2.push(`<div class="button-loader svelte-r0a4nq">`);
      Loader($$renderer2, {});
      $$renderer2.push(`<!----></div>`);
    } else {
      $$renderer2.push("<!--[-1-->");
    }
    $$renderer2.push(`<!--]--> `);
    if (typeof icon === "function") {
      $$renderer2.push("<!--[0-->");
      $$renderer2.push(`<div class="button-icon svelte-r0a4nq">`);
      icon($$renderer2);
      $$renderer2.push(`<!----></div>`);
    } else {
      $$renderer2.push("<!--[-1-->");
    }
    $$renderer2.push(`<!--]--> `);
    if (typeof text === "string" && text.length > 0) {
      $$renderer2.push("<!--[0-->");
      $$renderer2.push(`<div class="button-text svelte-r0a4nq">${html(text)}</div>`);
    } else {
      $$renderer2.push("<!--[-1-->");
    }
    $$renderer2.push(`<!--]--> `);
    if (typeof children === "function") {
      $$renderer2.push("<!--[0-->");
      children($$renderer2);
      $$renderer2.push(`<!---->`);
    } else {
      $$renderer2.push("<!--[-1-->");
    }
    $$renderer2.push(`<!--]--></button></div>`);
    bind_props($$props, { showProgressBar });
  });
}

export { Button as B, html as h };
//# sourceMappingURL=Button-DmE4ENkb.js.map
