import { c as L, p as tt, h as M, f as A, i as T, k as R, x as S, s as q, o as u, e as G, b as d, d as N, u as Q, a as et } from "./AssetItem-CFsdMEwW.js";
import { o as rt } from "./index-client-DJaMHbvZ.js";
import { v as Y, M as st, O as at, o as ct, G as _, m as b, I as t, w as I, p as ot, x as c, A as v, y as o, z as j, D as l, t as E, n as nt, r as it, Q as lt, Y as wt } from "./index-BxjwuJ6T.js";
import { b as pt } from "./App-pmcYlKkW.js";
var ft = A("<button> </button>"), ut = A(`<a class="crtw-flex crtw-justify-center crtw-items-center crtw-w-full crtw-h-[50px] crtw-cursor-pointer
          crtw-border-2 crtw-border-black crtw-rounded crtw-font-['Poppins'] crtw-text-base crtw-font-medium"> </a>`), xt = A(`<div class="crtw-flex crtw-flex-col crtw-justify-start crtw-items-start crtw-w-full crtw-mx-[50px]"><img alt="credenza-logo" class="crtw-w-[200px] crtw-mx-auto"/> <div class="crtw-flex crtw-flex-col crtw-justify-start crtw-items-start crtw-font-['Poppins'] crtw-w-full crtw-mt-[36px]"><span class="crtw-text-[24px] crtw-text-[#313a2c] crtw-font-medium"> </span> <span class="crtw-text-base crtw-text-[#747474] crtw-mb-1"> </span></div> <div class="crtw-flex crtw-flex crtw-gap-[6px] crtw-w-full crtw-items-center crtw-mb-[100px] crtw-mt-[30px]"><!> <button> </button></div></div>`);
function F(w, n) {
  if (new.target) return L({ component: F, ...w });
  Y(n, !1);
  let r = tt(n, "options", 12), p = b(), f = b(), e = b();
  const { close: g } = st(at), D = `crtw-px-[36px] crtw-flex crtw-justify-center crtw-items-center crtw-bg-black crtw-text-white crtw-h-[50px] crtw-cursor-pointer
      crtw-border-0 crtw-rounded crtw-font-['Poppins'] crtw-text-sm crtw-font-medium`;
  ct(
    () => (I(r()), t(p), t(f), t(e)),
    () => {
      r() && ((s) => {
        _(p, s.title), _(f, s.description), _(e, s.action);
      })(r());
    }
  ), ot();
  var H = {
    get options() {
      return r();
    },
    set options(s) {
      r(s), nt();
    },
    $set: Q,
    $on: (s, m) => N(n, s, m)
  };
  M();
  var h = xt(), O = c(h), y = v(O, 2), k = c(y), J = c(k, !0);
  o(k);
  var z = v(k, 2), K = c(z, !0);
  o(z), o(y);
  var B = v(y, 2), P = c(B);
  {
    var U = (s) => {
      var m = et(), W = it(m);
      {
        var X = (i) => {
          var a = ft();
          R(a, 1, S(D));
          var C = c(a, !0);
          o(a), j(() => u(C, (t(e), l(() => t(e).text)))), G("click", a, function(...$) {
            t(e).onClick?.apply(this, $);
          }), d(i, a);
        }, Z = (i) => {
          var a = ut(), C = c(a, !0);
          o(a), j(() => {
            q(a, "href", (t(e), l(() => t(e)?.link))), u(C, (t(e), l(() => t(e)?.text)));
          }), d(i, a);
        };
        T(W, (i) => {
          t(e), l(() => t(e)?.onClick) ? i(X) : (t(e), l(() => t(e)?.link) && i(Z, 1));
        });
      }
      d(s, m);
    };
    T(P, (s) => {
      t(e) && s(U);
    });
  }
  var x = v(P, 2);
  R(x, 1, S(D));
  var V = c(x, !0);
  return o(x), o(B), o(h), j(() => {
    q(O, "src", pt), u(J, t(p)), u(K, t(f)), u(V, (I(r()), l(() => r().closeButtonText || "Close")));
  }), G("click", x, g), d(w, h), E(H);
}
function mt(w, n) {
  if (new.target) return L({ component: mt, ...w });
  Y(n, !1);
  let r = b();
  const p = lt.subscribe((e) => {
    _(r, Object.assign(Object.assign({}, t(r)), e.richAlertData));
  });
  rt(p);
  var f = {
    $set: Q,
    $on: (e, g) => N(n, e, g)
  };
  M();
  {
    let e = wt(() => ({
      title: t(r).title || "Notification",
      description: t(r).description || "Choose your next steps",
      action: t(r).action,
      closeButtonText: t(r).closeButtonText
    }));
    F(w, {
      get options() {
        return t(e);
      }
    });
  }
  return E(f);
}
export {
  mt as default
};
//# sourceMappingURL=RichAlert-BXNsMMeF.js.map
