import { c as E, p as j, f as q, b as C, d as O, u as z, h as A, n as F, o as w } from "./AssetItem-BxjLUzNd.js";
import { t as B, p as x, z as y, r as D, l as I, J as b, L as J, E as L, V as R, Z as U, bx as V, M as W, I as Z } from "./index-BBXAtvZr.js";
import { C as G } from "./App-BwT5MYkN.js";
import { C as K } from "./ContentHeader-CNIXuMji.js";
import { B as k } from "./Button-CqLZSfSk.js";
var N = q("<!> <!>", 1), P = q("<!> <!>", 1);
function H(i, r) {
  if (new.target) return E({ component: H, ...i });
  B(r, !1);
  let a = j(r, "options", 12), { title: d, description: p, onConfirm: m, onCancel: v } = a();
  var f = {
    get options() {
      return a();
    },
    set options(t) {
      a(t), I();
    },
    $set: z,
    $on: (t, n) => O(r, t, n)
  }, l = P(), g = x(l);
  K(g, {
    get text() {
      return d;
    },
    get description() {
      return p;
    }
  });
  var _ = y(g, 2);
  return G(_, {
    class: "crtw-flex crtw-justify-between crtw-gap-10",
    children: (t, n) => {
      var e = N(), o = x(e);
      k(o, {
        text: "Cancel",
        get onClick() {
          return v;
        }
      });
      var S = y(o, 2);
      k(S, {
        text: "Sign the message",
        get onClick() {
          return m;
        }
      }), C(t, e);
    },
    $$slots: { default: !0 }
  }), C(i, l), D(f);
}
function Q(i, r) {
  if (new.target) return E({ component: Q, ...i });
  B(r, !1);
  const a = () => w(W, "$pageOptsStore", p), d = () => w(Z, "$configStore", p), [p, m] = F();
  var v = this && this.__awaiter || function(t, n, e, o) {
    function S(c) {
      return c instanceof e ? c : new e(function(u) {
        u(c);
      });
    }
    return new (e || (e = Promise))(function(c, u) {
      function M(s) {
        try {
          $(o.next(s));
        } catch (h) {
          u(h);
        }
      }
      function T(s) {
        try {
          $(o.throw(s));
        } catch (h) {
          u(h);
        }
      }
      function $(s) {
        s.done ? c(s.value) : S(s.value).then(M, T);
      }
      $((o = o.apply(t, n || [])).next());
    });
  };
  const { close: f } = b(J), l = () => v(void 0, void 0, void 0, function* () {
    const t = b(U);
    if (!t) return;
    const e = yield (yield t.getSigner()).signMessage(a().message);
    V.signDataAndEmitEvent(d().credenza.generalWssUrl, e, a().socketEventDataHeaders), f();
  });
  var g = {
    $set: z,
    $on: (t, n) => O(r, t, n)
  };
  A();
  {
    let t = R(() => ({
      title: "Sign Transaction Request",
      description: "Please sign the requested transaction.",
      onCancel: f,
      onConfirm: l
    }));
    H(i, {
      get options() {
        return L(t);
      }
    });
  }
  var _ = D(g);
  return m(), _;
}
export {
  Q as default
};
//# sourceMappingURL=Sign-DNulN-zv.js.map
