import { S as se, b as ne, s as le, f as G, c as ae, n as B, e as E, l as U, w as re, v as oe, K as Y, L as ce, g as q, C as de, t as fe, k as ge, x as P, m as n, o as m, p as j, y as F, q as t, z as ue, W as we, F as he, X as pe, J as X, A as ve, N as g, D as me } from "./CashierConfirmModal-CtWSrqbM.js";
import { f as J } from "./CashierModal-DV8aj-PX.js";
import { a as ze, $ as ye, i as _e, b as Te } from "./CashierError-Bxt3Xw3q.js";
import { d as Ce } from "./CashierMethodDetails-B8L97B6K.js";
_e({
  fallbackLocale: "en"
});
function K(a, e) {
  ze(a, e);
}
function be(a) {
  ye.set(a);
}
const Q = {
  en: {
    transactionHistoryTitle: "Transaction History",
    transactionIdTitle: "ID",
    transactionDateTitle: "Date",
    transactionTypeTitle: "Type",
    transactionStatusTitle: "Status",
    copyTransactionId: "Transaction Id copied to clipboard",
    transactionStatus: {
      Authorized: "Authorized",
      Success: "Success",
      Failed: "Failed",
      Rejected: "Rejected",
      Pending: "Pending"
    },
    transactionType: {
      Deposit: "Deposit",
      Withdraw: "Withdraw"
    }
  },
  tr: {
    transactionHistoryTitle: "Transaction History",
    transactionIdTitle: "ID",
    transactionDateTitle: "Date",
    transactionTypeTitle: "Type",
    transactionStatusTitle: "Status",
    copyTransactionId: "Transaction Id copied to clipboard",
    transactionStatus: {
      Authorized: "Authorized",
      Success: "Success",
      Failed: "Failed",
      Rejected: "Rejected",
      Pending: "Pending"
    },
    transactionType: {
      Deposit: "Yatırma",
      Withdraw: "Çekim"
    }
  }
};
function xe(a, e) {
  if (a) {
    const i = document.createElement("style");
    i.innerHTML = e, a.appendChild(i);
  }
}
function Se(a, e) {
  const i = new URL(e);
  fetch(i.href).then((s) => s.text()).then((s) => {
    const r = document.createElement("style");
    r.innerHTML = s, a && a.appendChild(r);
  }).catch((s) => {
    console.error("There was an error while trying to load client styling from URL", s);
  });
}
function ke(a) {
  ae(a, "svelte-1g1fw8z", ".svelte-1g1fw8z.svelte-1g1fw8z,.svelte-1g1fw8z.svelte-1g1fw8z::before,.svelte-1g1fw8z.svelte-1g1fw8z::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-style:inherit}.CopyTooltip.svelte-1g1fw8z.svelte-1g1fw8z{width:50%;display:flex;align-items:center;justify-content:center;background-color:var(--emw--color-primary, #7EC51E);position:absolute;top:-6px;left:50%;transform:translateX(-50%);color:var(--emw--color-white, #FFF);border-radius:var(--mmw--border-radius-medium-plus, 6px);z-index:1;opacity:1;container-name:copy-tooltip;font-size:var(--emw--font-size-medium, 16px);line-height:calc(var(--emw--font-size-medium, 16px) + 2px);padding:4px}.CashierTransactionHistory.svelte-1g1fw8z.svelte-1g1fw8z{display:flex;flex-direction:column;position:relative;width:100%;row-gap:var(--emw--spacing-small, 12px);container-name:transaction-history;container-type:inline-size;margin-bottom:var(--emw--spacing-small, 12px)}.CashierTransactionHistory.svelte-1g1fw8z table.svelte-1g1fw8z{font-size:var(--emw--font-size-medium, 16px);word-break:break-all;width:100%;border-collapse:collapse;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;margin-bottom:var(--emw--spacing-small-minus, 10px)}.CashierTransactionHistory.svelte-1g1fw8z table.svelte-1g1fw8z:not(:last-child){margin-bottom:var(--emw--spacing-large, 20px)}.CashierTransactionHistory.svelte-1g1fw8z thead tr.svelte-1g1fw8z{border-bottom:1px solid var(--mmw--color-grey-105, #E8E9EB);color:var(--mmw--color-grey-10, #111);height:50px}.CashierTransactionHistory.svelte-1g1fw8z tbody tr.svelte-1g1fw8z{color:var(--mmw--color-grey-290, #666)}.CashierTransactionHistory.svelte-1g1fw8z td.svelte-1g1fw8z{max-width:250px;vertical-align:middle;height:40px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 var(--emw--spacing-large, 20px) 0 var(--emw--spacing-small, 12px)}.CashierTransactionHistory.svelte-1g1fw8z tr.svelte-1g1fw8z{position:relative}@container transaction-history (width < 750px){.CashierTransactionHistory.svelte-1g1fw8z .CopyTooltip.svelte-1g1fw8z{width:100%}.CashierTransactionHistory.svelte-1g1fw8z .CashierTransactionId.svelte-1g1fw8z{max-width:150px}.CashierTransactionHistory.svelte-1g1fw8z td.svelte-1g1fw8z{padding:0 var(--emw--spacing-small, 12px) 0 var(--emw--spacing-small, 12px)}}@container transaction-history (width < 475px){.CashierTransactionHistory.svelte-1g1fw8z .CashierTransactionHistoryWrapper.svelte-1g1fw8z{padding:0 var(--emw--spacing-2x-small-plus, 6px)}.CashierTransactionHistory.svelte-1g1fw8z td.svelte-1g1fw8z{padding:0 var(--emw--spacing-2x-small-plus, 6px)}.CashierTransactionHistory.svelte-1g1fw8z td.svelte-1g1fw8z:first-child{max-width:75px}}@container transaction-history (width < 350px){.CashierTransactionHistory.svelte-1g1fw8z table.svelte-1g1fw8z{table-layout:fixed}.CashierTransactionHistory.svelte-1g1fw8z table td.svelte-1g1fw8z{padding:0 0 0 var(--emw--spacing-small, 5px)}}.CashierTransactionHistoryWrapper.svelte-1g1fw8z.svelte-1g1fw8z{background:var(--emw--color-background, #fff);box-shadow:0 0 4px var(--mmw--color-black-transparency-10, rgba(0, 0, 0, 0.1));border-radius:var(--mmw--border-radius-medium-plus, 6px);width:100%;box-sizing:border-box;padding:0 var(--emw--spacing-small, 12px)}.CashierTransactionHistoryTitle.svelte-1g1fw8z.svelte-1g1fw8z{color:var(--mmw--color-grey-10, #111);font-size:var(--emw--font-size-medium, 16px);font-weight:var(--emw--font-weight-normal, 400);line-height:calc(var(--emw--font-size-medium, 16px) + 2px);text-align:left}.CashierTransactionId.svelte-1g1fw8z.svelte-1g1fw8z{cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none}.CashierTransactionId.svelte-1g1fw8z.svelte-1g1fw8z:hover{background-color:var(--emw--color-gray-50, #F7F8FA)}.CashierTransactionHistoryStatus.svelte-1g1fw8z.svelte-1g1fw8z{line-height:calc(var(--emw--font-size-medium, 16px) + 2px)}.CashierTransactionHistoryContent.svelte-1g1fw8z.svelte-1g1fw8z{width:100%}.CashierTransactionHistoryIcon.svelte-1g1fw8z.svelte-1g1fw8z{vertical-align:middle;height:var(--emw--font-size-medium, 16px);width:var(--emw--font-size-medium, 16px)}");
}
function $(a, e, i) {
  const s = a.slice();
  return s[24] = e[i], s[26] = i, s;
}
function ee(a) {
  let e, i, s, r = (
    /*$_*/
    a[5]("transactionHistoryTitle") + ""
  ), c, o, d, u, y, x, _, H, I = (
    /*$_*/
    a[5]("transactionIdTitle") + ""
  ), S, b, L, T = (
    /*$_*/
    a[5]("transactionDateTitle") + ""
  ), R, V, M, A = (
    /*$_*/
    a[5]("transactionTypeTitle") + ""
  ), W, N, k, z = (
    /*$_*/
    a[5]("transactionStatusTitle") + ""
  ), f, l, w, h = (
    /*copied*/
    a[3] && te(a)
  ), Z = Y(
    /*txnHistory*/
    a[2]
  ), v = [];
  for (let p = 0; p < Z.length; p += 1)
    v[p] = ie($(a, Z, p));
  return {
    c() {
      e = m("div"), h && h.c(), i = j(), s = m("h3"), c = F(r), o = j(), d = m("div"), u = m("div"), y = m("table"), x = m("thead"), _ = m("tr"), H = m("td"), S = F(I), b = j(), L = m("td"), R = F(T), V = j(), M = m("td"), W = F(A), N = j(), k = m("td"), f = F(z), l = j(), w = m("tbody");
      for (let p = 0; p < v.length; p += 1)
        v[p].c();
      t(s, "class", "CashierTransactionHistoryTitle svelte-1g1fw8z"), t(H, "class", "svelte-1g1fw8z"), t(L, "class", "svelte-1g1fw8z"), t(M, "class", "svelte-1g1fw8z"), t(k, "class", "svelte-1g1fw8z"), t(_, "class", "svelte-1g1fw8z"), t(x, "class", "svelte-1g1fw8z"), t(w, "class", "svelte-1g1fw8z"), t(y, "class", "svelte-1g1fw8z"), t(u, "class", "CashierTransactionHistoryContent svelte-1g1fw8z"), t(d, "class", "CashierTransactionHistoryWrapper svelte-1g1fw8z"), t(e, "class", "CashierTransactionHistory svelte-1g1fw8z");
    },
    m(p, D) {
      U(p, e, D), h && h.m(e, null), n(e, i), n(e, s), n(s, c), n(e, o), n(e, d), n(d, u), n(u, y), n(y, x), n(x, _), n(_, H), n(H, S), n(_, b), n(_, L), n(L, R), n(_, V), n(_, M), n(M, W), n(_, N), n(_, k), n(k, f), n(y, l), n(y, w);
      for (let C = 0; C < v.length; C += 1)
        v[C] && v[C].m(w, null);
      a[16](e);
    },
    p(p, D) {
      if (/*copied*/
      p[3] ? h ? (h.p(p, D), D & /*copied*/
      8 && q(h, 1)) : (h = te(p), h.c(), q(h, 1), h.m(e, i)) : h && (de(), fe(h, 1, 1, () => {
        h = null;
      }), ge()), D & /*$_*/
      32 && r !== (r = /*$_*/
      p[5]("transactionHistoryTitle") + "") && P(c, r), D & /*$_*/
      32 && I !== (I = /*$_*/
      p[5]("transactionIdTitle") + "") && P(S, I), D & /*$_*/
      32 && T !== (T = /*$_*/
      p[5]("transactionDateTitle") + "") && P(R, T), D & /*$_*/
      32 && A !== (A = /*$_*/
      p[5]("transactionTypeTitle") + "") && P(W, A), D & /*$_*/
      32 && z !== (z = /*$_*/
      p[5]("transactionStatusTitle") + "") && P(f, z), D & /*$_, txnHistory, TransactionMainStatus, copied, copyToClipboard*/
      124) {
        Z = Y(
          /*txnHistory*/
          p[2]
        );
        let C;
        for (C = 0; C < Z.length; C += 1) {
          const O = $(p, Z, C);
          v[C] ? v[C].p(O, D) : (v[C] = ie(O), v[C].c(), v[C].m(w, null));
        }
        for (; C < v.length; C += 1)
          v[C].d(1);
        v.length = Z.length;
      }
    },
    d(p) {
      p && E(e), h && h.d(), ce(v, p), a[16](null);
    }
  };
}
function te(a) {
  let e, i = (
    /*$_*/
    a[5]("copyTransactionId") + ""
  ), s, r, c, o;
  return {
    c() {
      e = m("div"), s = F(i), t(e, "class", "CopyTooltip svelte-1g1fw8z");
    },
    m(d, u) {
      U(d, e, u), n(e, s), o = !0;
    },
    p(d, u) {
      a = d, (!o || u & /*$_*/
      32) && i !== (i = /*$_*/
      a[5]("copyTransactionId") + "") && P(s, i);
    },
    i(d) {
      o || (d && he(() => {
        o && (c && c.end(1), r = pe(e, J, { duration: 100 }), r.start());
      }), o = !0);
    },
    o(d) {
      r && r.invalidate(), d && (c = we(e, J, { duration: (
        /*tooltipduration*/
        a[0]
      ) })), o = !1;
    },
    d(d) {
      d && E(e), d && c && c.end();
    }
  };
}
function He(a) {
  let e, i, s, r, c;
  return {
    c() {
      e = g("svg"), i = g("g"), s = g("g"), r = g("g"), c = g("path"), t(i, "id", "SVGRepo_bgCarrier"), t(i, "stroke-width", "0"), t(i, "class", "svelte-1g1fw8z"), t(s, "id", "SVGRepo_tracerCarrier"), t(s, "stroke-linecap", "round"), t(s, "stroke-linejoin", "round"), t(s, "class", "svelte-1g1fw8z"), t(c, "fill-rule", "evenodd"), t(c, "clip-rule", "evenodd"), t(c, "d", "M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM16.0303 8.96967C16.3232 9.26256 16.3232 9.73744 16.0303 10.0303L11.0303 15.0303C10.7374 15.3232 10.2626 15.3232 9.96967 15.0303L7.96967 13.0303C7.67678 12.7374 7.67678 12.2626 7.96967 11.9697C8.26256 11.6768 8.73744 11.6768 9.03033 11.9697L10.5 13.4393L12.7348 11.2045L14.9697 8.96967C15.2626 8.67678 15.7374 8.67678 16.0303 8.96967Z"), t(c, "fill", "#7EC51E"), t(c, "class", "svelte-1g1fw8z"), t(r, "id", "SVGRepo_iconCarrier"), t(r, "class", "svelte-1g1fw8z"), t(e, "width", "18px"), t(e, "height", "18px"), t(e, "viewBox", "0 0 24 24"), t(e, "fill", "none"), t(e, "xmlns", "http://www.w3.org/2000/svg"), t(e, "class", "svelte-1g1fw8z");
    },
    m(o, d) {
      U(o, e, d), n(e, i), n(e, s), n(e, r), n(r, c);
    },
    d(o) {
      o && E(e);
    }
  };
}
function Re(a) {
  let e, i, s, r, c, o, d;
  return {
    c() {
      e = g("svg"), i = g("g"), s = g("rect"), r = g("g"), c = g("g"), o = g("text"), d = F("R j"), t(s, "x", "-2.4"), t(s, "y", "-2.4"), t(s, "width", "28.80"), t(s, "height", "28.80"), t(s, "rx", "14.4"), t(s, "fill", "#dd6617d4"), t(s, "class", "svelte-1g1fw8z"), t(i, "id", "SVGRepo_bgCarrier"), t(i, "stroke-width", "0"), t(i, "class", "svelte-1g1fw8z"), t(r, "id", "SVGRepo_tracerCarrier"), t(r, "stroke-linecap", "round"), t(r, "stroke-linejoin", "round"), t(r, "class", "svelte-1g1fw8z"), t(o, "x", "42%"), t(o, "y", "50%"), t(o, "dominant-baseline", "middle"), t(o, "text-anchor", "middle"), t(o, "font-family", "Arial"), t(o, "font-size", "16"), t(o, "fill", "#ffffff"), t(o, "class", "svelte-1g1fw8z"), t(c, "id", "SVGRepo_iconCarrier"), t(c, "class", "svelte-1g1fw8z"), t(e, "width", "16px"), t(e, "height", "18px"), t(e, "viewBox", "-2.4 -2.4 28.80 28.80"), t(e, "fill", "none"), t(e, "xmlns", "http://www.w3.org/2000/svg"), t(e, "class", "svelte-1g1fw8z");
    },
    m(u, y) {
      U(u, e, y), n(e, i), n(i, s), n(e, r), n(e, c), n(c, o), n(o, d);
    },
    d(u) {
      u && E(e);
    }
  };
}
function Ve(a) {
  let e, i, s, r, c, o, d;
  return {
    c() {
      e = g("svg"), i = g("g"), s = g("rect"), r = g("g"), c = g("g"), o = g("path"), d = g("path"), t(s, "x", "-2.4"), t(s, "y", "-2.4"), t(s, "width", "28.80"), t(s, "height", "28.80"), t(s, "rx", "14.4"), t(s, "fill", "#dd6617d4"), t(s, "class", "svelte-1g1fw8z"), t(i, "id", "SVGRepo_bgCarrier"), t(i, "stroke-width", "0"), t(i, "class", "svelte-1g1fw8z"), t(r, "id", "SVGRepo_tracerCarrier"), t(r, "stroke-linecap", "round"), t(r, "stroke-linejoin", "round"), t(r, "class", "svelte-1g1fw8z"), t(o, "d", "M13 6H11V7C11 7.55228 11.4477 8 12 8C12.5523 8 13 7.55228 13 7V6Z"), t(o, "fill", "#ffffff"), t(o, "class", "svelte-1g1fw8z"), t(d, "fill-rule", "evenodd"), t(d, "clip-rule", "evenodd"), t(d, "d", "M6 2V4H7V7C7 9.76142 9.23858 12 12 12C9.23858 12 7 14.2386 7 17V20H6V22H18V20H17V17C17 14.2386 14.7614 12 12 12C14.7614 12 17 9.76142 17 7V4H18V2H6ZM9 4H15V7C15 8.65685 13.6569 10 12 10C10.3431 10 9 8.65685 9 7V4ZM9 17V20H15V17C15 15.3431 13.6569 14 12 14C10.3431 14 9 15.3431 9 17Z"), t(d, "fill", "#ffffff"), t(d, "class", "svelte-1g1fw8z"), t(c, "id", "SVGRepo_iconCarrier"), t(c, "class", "svelte-1g1fw8z"), t(e, "width", "16px"), t(e, "height", "18px"), t(e, "viewBox", "-2.4 -2.4 28.80 28.80"), t(e, "fill", "none"), t(e, "xmlns", "http://www.w3.org/2000/svg"), t(e, "class", "svelte-1g1fw8z");
    },
    m(u, y) {
      U(u, e, y), n(e, i), n(i, s), n(e, r), n(e, c), n(c, o), n(c, d);
    },
    d(u) {
      u && E(e);
    }
  };
}
function De(a) {
  let e, i, s, r, c;
  return {
    c() {
      e = g("svg"), i = g("g"), s = g("g"), r = g("g"), c = g("path"), t(i, "id", "SVGRepo_bgCarrier"), t(i, "stroke-width", "0"), t(i, "class", "svelte-1g1fw8z"), t(s, "id", "SVGRepo_tracerCarrier"), t(s, "stroke-linecap", "round"), t(s, "stroke-linejoin", "round"), t(s, "class", "svelte-1g1fw8z"), t(c, "d", "M960 0c530.193 0 960 429.807 960 960s-429.807 960-960 960S0 1490.193 0 960 429.807 0 960 0Zm-9.838 1342.685c-84.47 0-153.19 68.721-153.19 153.19 0 84.47 68.72 153.192 153.19 153.192s153.19-68.721 153.19-153.191-68.72-153.19-153.19-153.19ZM1153.658 320H746.667l99.118 898.623h208.755L1153.658 320Z"), t(c, "fill-rule", "evenodd"), t(c, "class", "svelte-1g1fw8z"), t(r, "id", "SVGRepo_iconCarrier"), t(r, "class", "svelte-1g1fw8z"), t(e, "fill", "#ed0909"), t(e, "width", "16px"), t(e, "height", "18px"), t(e, "viewBox", "0 0 1920 1920"), t(e, "xmlns", "http://www.w3.org/2000/svg"), t(e, "class", "svelte-1g1fw8z");
    },
    m(o, d) {
      U(o, e, d), n(e, i), n(e, s), n(e, r), n(r, c);
    },
    d(o) {
      o && E(e);
    }
  };
}
function je(a) {
  let e, i, s, r, c, o;
  return {
    c() {
      e = g("svg"), i = g("g"), s = g("g"), r = g("g"), c = g("circle"), o = g("path"), t(i, "id", "SVGRepo_bgCarrier"), t(i, "stroke-width", "0"), t(i, "class", "svelte-1g1fw8z"), t(s, "id", "SVGRepo_tracerCarrier"), t(s, "stroke-linecap", "round"), t(s, "stroke-linejoin", "round"), t(s, "class", "svelte-1g1fw8z"), t(c, "cx", "32"), t(c, "cy", "32"), t(c, "r", "30"), t(c, "fill", "#4fd1d9"), t(c, "class", "svelte-1g1fw8z"), t(o, "d", "M28.6 17.5h6.9l10.3 29h-6.6l-1.9-6H26.6l-2 6h-6.3l10.3-29m-.4 18h7.4L32 24.1l-3.8 11.4"), t(o, "fill", "#ffffff"), t(o, "class", "svelte-1g1fw8z"), t(r, "id", "SVGRepo_iconCarrier"), t(r, "class", "svelte-1g1fw8z"), t(e, "width", "17px"), t(e, "height", "18px"), t(e, "viewBox", "0 0 64 64"), t(e, "xmlns", "http://www.w3.org/2000/svg"), t(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), t(e, "aria-hidden", "true"), t(e, "role", "img"), t(e, "class", "iconify iconify--emojione svelte-1g1fw8z"), t(e, "preserveAspectRatio", "xMidYMid meet"), t(e, "fill", "#000000");
    },
    m(d, u) {
      U(d, e, u), n(e, i), n(e, s), n(e, r), n(r, c), n(r, o);
    },
    d(d) {
      d && E(e);
    }
  };
}
function ie(a) {
  let e, i, s = (
    /*transaction*/
    a[24].Code + ""
  ), r, c, o, d = (
    /*transaction*/
    a[24].Date + ""
  ), u, y, x, _ = (
    /*$_*/
    a[5](`transactionType.${/*transaction*/
    a[24].Type}`) + ""
  ), H, I, S, b, L, T, R = (
    /*$_*/
    a[5](`transactionStatus.${/*transaction*/
    a[24].Status}`) + ""
  ), V, M, A, W;
  function N(f, l) {
    if (
      /*transaction*/
      f[24].Status === /*TransactionMainStatus*/
      f[4].Authorized
    )
      return je;
    if (
      /*transaction*/
      f[24].Status === /*TransactionMainStatus*/
      f[4].Failed
    )
      return De;
    if (
      /*transaction*/
      f[24].Status === /*TransactionMainStatus*/
      f[4].Pending
    )
      return Ve;
    if (
      /*transaction*/
      f[24].Status === /*TransactionMainStatus*/
      f[4].Rejected
    )
      return Re;
    if (
      /*transaction*/
      f[24].Status === /*TransactionMainStatus*/
      f[4].Success
    )
      return He;
  }
  let k = N(a), z = k && k(a);
  return {
    c() {
      e = m("tr"), i = m("td"), r = F(s), c = j(), o = m("td"), u = F(d), y = j(), x = m("td"), H = F(_), I = j(), S = m("td"), b = m("span"), z && z.c(), L = j(), T = m("span"), V = F(R), M = j(), t(i, "class", "CashierTransactionId svelte-1g1fw8z"), X(
        i,
        "copied",
        /*copied*/
        a[3]
      ), t(o, "class", "svelte-1g1fw8z"), t(x, "class", "svelte-1g1fw8z"), t(b, "class", "CashierTransactionHistoryIcon svelte-1g1fw8z"), t(T, "class", "CashierTransactionHistoryStatus svelte-1g1fw8z"), t(S, "class", "svelte-1g1fw8z"), t(e, "class", "svelte-1g1fw8z");
    },
    m(f, l) {
      U(f, e, l), n(e, i), n(i, r), n(e, c), n(e, o), n(o, u), n(e, y), n(e, x), n(x, H), n(e, I), n(e, S), n(S, b), z && z.m(b, null), n(S, L), n(S, T), n(T, V), n(e, M), A || (W = ve(
        i,
        "mousedown",
        /*mousedown_handler*/
        a[15]
      ), A = !0);
    },
    p(f, l) {
      l & /*txnHistory*/
      4 && s !== (s = /*transaction*/
      f[24].Code + "") && P(r, s), l & /*copied*/
      8 && X(
        i,
        "copied",
        /*copied*/
        f[3]
      ), l & /*txnHistory*/
      4 && d !== (d = /*transaction*/
      f[24].Date + "") && P(u, d), l & /*$_, txnHistory*/
      36 && _ !== (_ = /*$_*/
      f[5](`transactionType.${/*transaction*/
      f[24].Type}`) + "") && P(H, _), k !== (k = N(f)) && (z && z.d(1), z = k && k(f), z && (z.c(), z.m(b, null))), l & /*$_, txnHistory*/
      36 && R !== (R = /*$_*/
      f[5](`transactionStatus.${/*transaction*/
      f[24].Status}`) + "") && P(V, R);
    },
    d(f) {
      f && E(e), z && z.d(), A = !1, W();
    }
  };
}
function Fe(a) {
  let e, i = (
    /*txnHistory*/
    a[2].length && ee(a)
  );
  return {
    c() {
      i && i.c(), e = re();
    },
    m(s, r) {
      i && i.m(s, r), U(s, e, r);
    },
    p(s, [r]) {
      /*txnHistory*/
      s[2].length ? i ? i.p(s, r) : (i = ee(s), i.c(), i.m(e.parentNode, e)) : i && (i.d(1), i = null);
    },
    i: B,
    o: B,
    d(s) {
      s && E(e), i && i.d(s);
    }
  };
}
const Ie = "DD.MM.YYYY";
function Le(a, e, i) {
  let s;
  oe(a, Te, (l) => i(5, s = l));
  let { endpoint: r } = e, { session: c } = e, { lang: o = "en" } = e, { customerid: d } = e, { clientstyling: u = "" } = e, { clientstylingurl: y = "" } = e, { translationurl: x } = e, { tooltipduration: _ = 1e3 } = e, { txncount: H = 3 } = e, I = [], S = !1, b, L;
  var T;
  (function(l) {
    l.Deposit = "deposit", l.Withdraw = "withdraw", l.Refund = "refund", l.Unknown = "unknown", l.TaxDeduction = "taxDeduction";
  })(T || (T = {}));
  const R = [
    "Authorized",
    "Success",
    "Failed",
    "Rejected",
    "PendingApprovalStage1",
    "PendingApprovalStage2",
    "PendingApprovalStage3",
    "PendingNotification",
    "PendingOfflineNotification",
    "PendingConfirmation"
  ];
  var V;
  (function(l) {
    l.Authorized = "Authorized", l.Success = "Success", l.Failed = "Failed", l.Rejected = "Rejected", l.Pending = "Pending";
  })(V || (V = {}));
  const M = () => {
    let l = x;
    if (l)
      return fetch(l).then((w) => w.json()).then((w) => {
        Object.keys(w).forEach((h) => {
          K(h, w[h]);
        });
      }).catch((w) => {
        console.log(w);
      });
  };
  Object.keys(Q).forEach((l) => {
    K(l, Q[l]);
  });
  const A = () => {
    be(o);
  }, W = () => {
    const l = new URL(`${r}/api/v1/mm/payment/gettransactionshistory`), w = new Headers();
    w.append("accept", "application/json"), w.append("Content-Type", "application/json"), w.append("X-SessionId", `${c}`);
    const h = new Date((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 3)).toISOString(), Z = {
      method: "POST",
      mode: "cors",
      headers: w,
      body: JSON.stringify({
        language: o,
        customerId: d,
        count: H,
        page: 0,
        fromDate: h,
        toDate: null,
        statuses: {
          [T.Deposit]: R,
          [T.Withdraw]: R,
          [T.Refund]: ["Unknown"],
          [T.TaxDeduction]: ["Unknown"],
          [T.Unknown]: ["Unknown"]
        },
        calculateProfit: !1
      })
    };
    fetch(l, Z).then((v) => v.json()).then((v) => {
      i(2, I = N(v?.items || []));
    }).catch((v) => console.log(v));
  }, N = (l) => l.map((w) => {
    let h = w.generalFields.status;
    return w.generalFields.status.toLowerCase().includes("pending") && (h = V.Pending), {
      Code: w.generalFields.code,
      Date: Ce(w.generalFields.created).format(Ie),
      Status: h,
      Type: w.generalFields.type
    };
  }) || [], k = (l) => {
    const w = l.currentTarget;
    l.target === w && navigator.clipboard.writeText(w.innerText).then(() => {
      i(3, S = !0), clearTimeout(L), L = setTimeout(
        () => {
          i(3, S = !1);
        },
        2e3
      );
    }).catch((h) => {
      console.error("Could not copy text: ", h);
    });
  }, z = (l) => k(l);
  function f(l) {
    ue[l ? "unshift" : "push"](() => {
      b = l, i(1, b);
    });
  }
  return a.$$set = (l) => {
    "endpoint" in l && i(7, r = l.endpoint), "session" in l && i(8, c = l.session), "lang" in l && i(9, o = l.lang), "customerid" in l && i(10, d = l.customerid), "clientstyling" in l && i(11, u = l.clientstyling), "clientstylingurl" in l && i(12, y = l.clientstylingurl), "translationurl" in l && i(13, x = l.translationurl), "tooltipduration" in l && i(0, _ = l.tooltipduration), "txncount" in l && i(14, H = l.txncount);
  }, a.$$.update = () => {
    a.$$.dirty & /*lang*/
    512 && o && A(), a.$$.dirty & /*clientstyling, customStylingContainer*/
    2050 && u && b && xe(b, u), a.$$.dirty & /*clientstylingurl, customStylingContainer*/
    4098 && y && b && Se(b, y), a.$$.dirty & /*endpoint, session, customerid, lang*/
    1920 && r && c && d && o && W(), a.$$.dirty & /*translationurl*/
    8192 && x && M();
  }, [
    _,
    b,
    I,
    S,
    V,
    s,
    k,
    r,
    c,
    o,
    d,
    u,
    y,
    x,
    H,
    z,
    f
  ];
}
class Ae extends se {
  constructor(e) {
    super(), ne(
      this,
      e,
      Le,
      Fe,
      le,
      {
        endpoint: 7,
        session: 8,
        lang: 9,
        customerid: 10,
        clientstyling: 11,
        clientstylingurl: 12,
        translationurl: 13,
        tooltipduration: 0,
        txncount: 14
      },
      ke
    );
  }
  get endpoint() {
    return this.$$.ctx[7];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), G();
  }
  get session() {
    return this.$$.ctx[8];
  }
  set session(e) {
    this.$$set({ session: e }), G();
  }
  get lang() {
    return this.$$.ctx[9];
  }
  set lang(e) {
    this.$$set({ lang: e }), G();
  }
  get customerid() {
    return this.$$.ctx[10];
  }
  set customerid(e) {
    this.$$set({ customerid: e }), G();
  }
  get clientstyling() {
    return this.$$.ctx[11];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), G();
  }
  get clientstylingurl() {
    return this.$$.ctx[12];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), G();
  }
  get translationurl() {
    return this.$$.ctx[13];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), G();
  }
  get tooltipduration() {
    return this.$$.ctx[0];
  }
  set tooltipduration(e) {
    this.$$set({ tooltipduration: e }), G();
  }
  get txncount() {
    return this.$$.ctx[14];
  }
  set txncount(e) {
    this.$$set({ txncount: e }), G();
  }
}
me(Ae, { endpoint: {}, session: {}, lang: {}, customerid: {}, clientstyling: {}, clientstylingurl: {}, translationurl: {}, tooltipduration: {}, txncount: {} }, [], [], !0);
export {
  Ae as default
};
