import { a as q, $ as F, S as O, i as D, s as G, f as H, b as V, n as z, d as M, t as L, c as S, m as g, e as w, p as C, u as k, r as d, g as X, h as Z, o as J, w as K, x as b, j as Q, y as A, z as Y, A as $, B as tt, C as et, D as it } from "./PlayerAccountController-CKaOyxPs.js";
function E(i, t) {
  q(i, t);
}
function rt(i) {
  F.set(i);
}
const I = {
  en: {
    titleTransactionHistory: "Transaction History",
    loading: "Loading, please wait ..."
  },
  "zh-hk": {
    titleTransactionHistory: "交易記錄",
    loading: "加載請稍候…"
  },
  fr: {
    titleTransactionHistory: "Historique des transactions",
    loading: "Chargement, veuillez patienter ..."
  },
  ro: {
    titleTransactionHistory: "Istoric tranzacții",
    loading: "Se încarcă..."
  },
  es: {
    titleTransactionHistory: "Historial de transacciones",
    loading: "Cargando ... Por favor espere ..."
  },
  pt: {
    titleTransactionHistory: "Histórico de transações",
    loading: "Carregando, por favor espere ..."
  },
  hr: {
    titleTransactionHistory: "Povijest transakcija",
    loading: "Učitavanje"
  },
  "pt-br": {
    titleTransactionHistory: "Histórico de transações",
    Loading: "Carregando, por favor espere..."
  },
  "es-mx": {
    titleTransactionHistory: "Historial de transacciones",
    Loading: "Cargando, por favor espere..."
  },
  "en-us": {
    titleTransactionHistory: "Transaction History",
    loading: "Loading, please wait ..."
  }
};
function nt(i) {
  V(i, "svelte-1v10tii", ".TransactionHistoryWrapper{background-color:var(--emw--color-pale, var(--emw--color-gray-50, #F1F1F1));border-radius:var(--emw--border-radius-large, 10px);color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));padding:50px 50px 30px 50px;max-width:100%}.TransactionHistoryWrapper.TransactionHistoryWrapperMobile{padding:20px 15px;max-width:unset;border-radius:0}.MenuReturnButton{color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));display:inline-flex;align-items:center;column-gap:10px;margin-bottom:10px}.MenuReturnButton svg{fill:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.TransactionHistoryTitle{font-size:var(--emw--font-size-x-large, 26px);color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));font-weight:var(--emw--font-weigh-normal, 400)}.TransactionHistoryTitleMobile{font-size:var(--emw--size-standard, 16px)}.TransactionHistoryTitleNone{display:none}.TransactionHistoryIframeWrapper iframe{border:none;width:100%;height:85vh}");
}
function at(i) {
  let t, e, s, n, c, m, u, y, f, o, a = (
    /*$_*/
    i[3]("titleTransactionHistory") + ""
  ), l, _, x;
  return {
    c() {
      t = w("div"), e = b("svg"), s = b("defs"), n = b("style"), c = k(".aaa{fill:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));}"), m = b("g"), u = b("g"), y = b("path"), f = C(), o = w("h2"), l = k(a), d(y, "class", "aaa"), d(y, "d", "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z"), d(y, "transform", "translate(15 15) rotate(180)"), d(u, "transform", "translate(20 158)"), d(m, "transform", "translate(-20 -158)"), d(e, "xmlns", "http://www.w3.org/2000/svg"), d(e, "width", "15"), d(e, "height", "15"), d(e, "viewBox", "0 0 15 15"), d(o, "class", "TransactionHistoryTitleMobile"), d(t, "class", "MenuReturnButton");
    },
    m(p, v) {
      S(p, t, v), g(t, e), g(e, s), g(s, n), g(n, c), g(e, m), g(m, u), g(u, y), g(t, f), g(t, o), g(o, l), _ || (x = K(
        t,
        "click",
        /*click_handler*/
        i[14]
      ), _ = !0);
    },
    p(p, v) {
      v & /*$_*/
      8 && a !== (a = /*$_*/
      p[3]("titleTransactionHistory") + "") && L(l, a);
    },
    d(p) {
      p && M(t), _ = !1, x();
    }
  };
}
function st(i) {
  let t, e, s;
  return {
    c() {
      t = w("div"), e = w("iframe"), A(e.src, s = /*iframeUrl*/
      i[2]) || d(e, "src", s), d(e, "title", "Transaction History Iframe"), d(t, "class", "TransactionHistoryIframeWrapper");
    },
    m(n, c) {
      S(n, t, c), g(t, e);
    },
    p(n, c) {
      c & /*iframeUrl*/
      4 && !A(e.src, s = /*iframeUrl*/
      n[2]) && d(e, "src", s);
    },
    d(n) {
      n && M(t);
    }
  };
}
function ot(i) {
  let t, e = (
    /*$_*/
    i[3]("loading") + ""
  ), s;
  return {
    c() {
      t = w("p"), s = k(e);
    },
    m(n, c) {
      S(n, t, c), g(t, s);
    },
    p(n, c) {
      c & /*$_*/
      8 && e !== (e = /*$_*/
      n[3]("loading") + "") && L(s, e);
    },
    d(n) {
      n && M(t);
    }
  };
}
function lt(i) {
  let t, e, s, n = (
    /*$_*/
    i[3]("titleTransactionHistory") + ""
  ), c, m, u = (
    /*isMobile*/
    i[4] && at(i)
  );
  function y(a, l) {
    return (
      /*isLoading*/
      a[1] ? ot : st
    );
  }
  let f = y(i), o = f(i);
  return {
    c() {
      t = w("div"), u && u.c(), e = C(), s = w("h2"), c = k(n), m = C(), o.c(), d(s, "class", "TransactionHistoryTitle " + /*isMobile*/
      (i[4] ? "TransactionHistoryTitleNone" : "")), d(t, "class", "TransactionHistoryWrapper " + /*isMobile*/
      (i[4] ? "TransactionHistoryWrapperMobile" : ""));
    },
    m(a, l) {
      S(a, t, l), u && u.m(t, null), g(t, e), g(t, s), g(s, c), g(t, m), o.m(t, null), i[15](t);
    },
    p(a, [l]) {
      /*isMobile*/
      a[4] && u.p(a, l), l & /*$_*/
      8 && n !== (n = /*$_*/
      a[3]("titleTransactionHistory") + "") && L(c, n), f === (f = y(a)) && o ? o.p(a, l) : (o.d(1), o = f(a), o && (o.c(), o.m(t, null)));
    },
    i: z,
    o: z,
    d(a) {
      a && M(t), u && u.d(), o.d(), i[15](null);
    }
  };
}
function ct(i, t, e) {
  let s;
  X(i, it, (r) => e(3, s = r));
  let { endpoint: n = "" } = t, { session: c = "" } = t, { playerid: m = "" } = t, { lang: u = "en" } = t, { clientstyling: y = "" } = t, { clientstylingurl: f = "" } = t, { mbsource: o } = t, { translationurl: a = "" } = t, l, _, x = window.navigator.userAgent, p = Z(x) !== "PC", v = !0, B = "";
  const W = () => {
    fetch(a).then((h) => h.json()).then((h) => {
      Object.keys(h).forEach((T) => {
        E(T, h[T]);
      });
    }).catch((h) => {
      console.log(h);
    });
  };
  Object.keys(I).forEach((r) => {
    E(r, I[r]);
  });
  const j = () => {
    window.postMessage(
      {
        type: "PlayerAccountMenuActive",
        isMobile: p
      },
      window.location.href
    );
  }, P = () => {
    let r = new URL(`${n}/v1/player/${m}/hostedcashier/customertransactionhistoryurl`);
    r.searchParams.append("language", u);
    let h = {
      method: "GET",
      headers: {
        "X-SessionId": c,
        accept: "application/json"
      }
    };
    fetch(r.href, h).then((T) => T.json()).then(
      (T) => {
        e(1, v = !1), e(2, B = T.CashierUrl);
      },
      (T) => {
        console.error(T);
      }
    );
  }, R = () => {
    rt(u);
  };
  J(() => () => {
  });
  const U = () => j();
  function N(r) {
    Q[r ? "unshift" : "push"](() => {
      l = r, e(0, l);
    });
  }
  return i.$$set = (r) => {
    "endpoint" in r && e(6, n = r.endpoint), "session" in r && e(7, c = r.session), "playerid" in r && e(8, m = r.playerid), "lang" in r && e(9, u = r.lang), "clientstyling" in r && e(10, y = r.clientstyling), "clientstylingurl" in r && e(11, f = r.clientstylingurl), "mbsource" in r && e(12, o = r.mbsource), "translationurl" in r && e(13, a = r.translationurl);
  }, i.$$.update = () => {
    i.$$.dirty & /*lang*/
    512 && u && R(), i.$$.dirty & /*session, playerid, endpoint, lang*/
    960 && c && m && n && u && P(), i.$$.dirty & /*clientstyling, customStylingContainer*/
    1025 && y && l && Y(l, y), i.$$.dirty & /*clientstylingurl, customStylingContainer*/
    2049 && f && l && $(l, f), i.$$.dirty & /*mbsource, customStylingContainer*/
    4097 && o && l && tt(l, `${o}.Style`, _), i.$$.dirty & /*translationurl*/
    8192 && a && W();
  }, [
    l,
    v,
    B,
    s,
    p,
    j,
    n,
    c,
    m,
    u,
    y,
    f,
    o,
    a,
    U,
    N
  ];
}
class ut extends O {
  constructor(t) {
    super(), D(
      this,
      t,
      ct,
      lt,
      G,
      {
        endpoint: 6,
        session: 7,
        playerid: 8,
        lang: 9,
        clientstyling: 10,
        clientstylingurl: 11,
        mbsource: 12,
        translationurl: 13
      },
      nt
    );
  }
  get endpoint() {
    return this.$$.ctx[6];
  }
  set endpoint(t) {
    this.$$set({ endpoint: t }), H();
  }
  get session() {
    return this.$$.ctx[7];
  }
  set session(t) {
    this.$$set({ session: t }), H();
  }
  get playerid() {
    return this.$$.ctx[8];
  }
  set playerid(t) {
    this.$$set({ playerid: t }), H();
  }
  get lang() {
    return this.$$.ctx[9];
  }
  set lang(t) {
    this.$$set({ lang: t }), H();
  }
  get clientstyling() {
    return this.$$.ctx[10];
  }
  set clientstyling(t) {
    this.$$set({ clientstyling: t }), H();
  }
  get clientstylingurl() {
    return this.$$.ctx[11];
  }
  set clientstylingurl(t) {
    this.$$set({ clientstylingurl: t }), H();
  }
  get mbsource() {
    return this.$$.ctx[12];
  }
  set mbsource(t) {
    this.$$set({ mbsource: t }), H();
  }
  get translationurl() {
    return this.$$.ctx[13];
  }
  set translationurl(t) {
    this.$$set({ translationurl: t }), H();
  }
}
et(ut, { endpoint: {}, session: {}, playerid: {}, lang: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, translationurl: {} }, [], [], !0);
export {
  ut as default
};
