import { a as U, $ as V, S as G, i as J, s as Z, f as k, b as F, n as C, d as W, v as K, t as D, r as o, q as v, c as q, m as l, w as R, e as M, p as A, u as L, J as Q, g as X, h as Y, o as $, x as E, j as tt, z as et, A as st, B as it, C as nt, D as lt } from "./PlayerAccountController-DQUfjs7n.js";
function z(s, t) {
  U(s, t);
}
function ot(s) {
  V.set(s);
}
const rt = {
  en: {
    titleBettingHistory: "Betting History",
    settledBets: "Settled Bets",
    openBets: "Open Bets"
  },
  ro: {
    titleBettingHistory: "Istoric Pariuri",
    settledBets: "Pariuri Decise",
    openBets: "Pariuri Deschise"
  },
  es: {
    titleBettingHistory: "Historial de Apuestas",
    settledBets: "Apuestas cerradas",
    openBets: "Apuestas abiertas"
  },
  hr: {
    titleBettingHistory: "Povijest klađenja",
    settledBets: "Obračunate oklade",
    openBets: "Otvorene oklade"
  },
  "pt-br": {
    titleBettingHistory: "Histórico de apostas",
    settledBets: "Apostas liquidadas",
    openBets: "apostas abertas"
  },
  "es-mx": {
    titleBettingHistory: "Historial de apuesta",
    settledBets: "Apuestas liquidadas",
    openBets: "Apuestas abiertas"
  },
  tr: {
    titleBettingHistory: "Bahis Geçmişi",
    settledBets: "Sonuçlandırılmış Bahisler",
    openBets: "Açık Bahisler"
  },
  "en-us": {
    titleBettingHistory: "Betting History",
    settledBets: "Settled Bets",
    openBets: "Open Bets"
  }
};
function at(s) {
  F(s, "svelte-1kgy21f", `@import 'https://static.everymatrix.com/omfe-widgets/s/widgets/1.2.0-alpha.0/widgets.min.css';:host{font-family:system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"}.BettingHistoryTitle{font-size:26px;color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));font-weight:400}.BettingHistoryTitle.BettingHistoryTitleMobile{font-size:16px}.BettingHistoryTitle.BettingHistoryTitleNone{display:none}.BettingHistoryWrapper{color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));padding:50px 50px 30px 50px;max-width:100%}.BettingHistoryWrapper.BettingHistoryWrapperMobile{padding:20px 15px;max-width:unset}.BettingHistoryTabs{width:100%;display:flex;justify-content:center}.BettingHistoryButton{margin:0;width:100%;padding:20px;border:none;font-size:24px;color:var(--emw--color-black, #000);background:var(--emw--color-white, #fff);border:2px solid var(--emw--color-black, #000)}.BettingHistoryButton.BettingHistoryButtonMobile{padding:20px;font-size:12px}.BettingHistoryButton.BettingHistoryButtonSelected{color:var(--emw--color-white, #fff);background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));border:none}.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))}.OM-MatchScore,.OM-MatchScore__List{display:flex;align-items:center;justify-content:center;list-style-type:none;margin:0;padding:0}`);
}
function ct(s) {
  let t, n, y, m, b, h, c, r, f, g, d = (
    /*$_*/
    s[4]("titleBettingHistory") + ""
  ), S, B, a;
  return {
    c() {
      t = M("div"), n = E("svg"), y = E("defs"), m = E("style"), b = L(".aaa{fill:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));}"), h = E("g"), c = E("g"), r = E("path"), f = A(), g = M("h2"), S = L(d), o(r, "class", "aaa"), o(r, "d", "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z"), o(r, "transform", "translate(15 15) rotate(180)"), o(c, "transform", "translate(20 158)"), o(h, "transform", "translate(-20 -158)"), o(n, "xmlns", "http://www.w3.org/2000/svg"), o(n, "width", "15"), o(n, "height", "15"), o(n, "viewBox", "0 0 15 15"), o(g, "class", "BettingHistoryTitleMobile"), o(t, "class", "MenuReturnButton");
    },
    m(H, _) {
      q(H, t, _), l(t, n), l(n, y), l(y, m), l(m, b), l(n, h), l(h, c), l(c, r), l(t, f), l(t, g), l(g, S), B || (a = R(
        t,
        "click",
        /*click_handler*/
        s[14]
      ), B = !0);
    },
    p(H, _) {
      _ & /*$_*/
      16 && d !== (d = /*$_*/
      H[4]("titleBettingHistory") + "") && D(S, d);
    },
    d(H) {
      H && W(t), B = !1, a();
    }
  };
}
function N(s) {
  return { c: C, m: C, d: C };
}
function ut(s) {
  let t, n, y, m = (
    /*$_*/
    s[4]("bettingHistory.title") + ""
  ), b, h, c, r, f = (
    /*$_*/
    s[4]("bettingHistory.openBets") + ""
  ), g, d, S, B, a = (
    /*$_*/
    s[4]("bettingHistory.settledBets") + ""
  ), H, _, I, u, P, T, O, j, x, w = (
    /*isMobile*/
    s[5] && ct(s)
  ), e = (
    /*showModal*/
    s[3] === "true" && /*selectedBetId*/
    s[1] && N()
  );
  return {
    c() {
      t = M("div"), w && w.c(), n = A(), y = M("h2"), b = L(m), h = A(), c = M("div"), r = M("button"), g = L(f), S = A(), B = M("button"), H = L(a), I = A(), u = M("om-betting-history-list"), P = A(), e && e.c(), T = A(), O = M("div"), o(y, "class", "BettingHistoryTitle " + /*isMobile*/
      (s[5] ? "BettingHistoryTitleNone" : "")), o(y, "part", "`BettingHistoryTitleMobile"), o(r, "class", d = `BettingHistoryButton ${/*isMobile*/
      s[5] ? "BettingHistoryButtonMobile" : ""} ${/*betstatus*/
      s[0] === "openBets" ? "BettingHistoryButtonSelected" : ""}`), o(B, "class", _ = `BettingHistoryButton ${/*isMobile*/
      s[5] ? "BettingHistoryButtonMobile" : ""} ${/*betstatus*/
      s[0] === "settledBets" ? "BettingHistoryButtonSelected" : ""}`), o(c, "class", "BettingHistoryTabs"), v(
        u,
        "bet-status",
        /*betstatus*/
        s[0]
      ), v(u, "item-layout", "V2"), v(u, "match-score-layout", "v2"), v(u, "match-score-scope", "BHDetailed"), v(u, "date-format", "dd.mm.yyyy"), v(u, "time-format", "HH:MM"), v(u, "tournament-route", ":sportId/:tournamentId"), v(u, "match-route", ":betId"), o(O, "class", "OM-MatchScore OM-MatchScore__List"), o(t, "class", "BettingHistoryWrapper"), Q(
        t,
        "BettingHistoryWrapperMobile",
        /*isMobile*/
        s[5]
      );
    },
    m(i, p) {
      q(i, t, p), w && w.m(t, null), l(t, n), l(t, y), l(y, b), l(t, h), l(t, c), l(c, r), l(r, g), l(c, S), l(c, B), l(B, H), l(t, I), l(t, u), l(t, P), e && e.m(t, null), l(t, T), l(t, O), s[17](t), j || (x = [
        R(
          r,
          "click",
          /*click_handler_1*/
          s[15]
        ),
        R(
          B,
          "click",
          /*click_handler_2*/
          s[16]
        ),
        R(
          u,
          "routeChange",
          /*handleMoreDetails*/
          s[8]
        )
      ], j = !0);
    },
    p(i, [p]) {
      /*isMobile*/
      i[5] && w.p(i, p), p & /*$_*/
      16 && m !== (m = /*$_*/
      i[4]("bettingHistory.title") + "") && D(b, m), p & /*$_*/
      16 && f !== (f = /*$_*/
      i[4]("bettingHistory.openBets") + "") && D(g, f), p & /*betstatus*/
      1 && d !== (d = `BettingHistoryButton ${/*isMobile*/
      i[5] ? "BettingHistoryButtonMobile" : ""} ${/*betstatus*/
      i[0] === "openBets" ? "BettingHistoryButtonSelected" : ""}`) && o(r, "class", d), p & /*$_*/
      16 && a !== (a = /*$_*/
      i[4]("bettingHistory.settledBets") + "") && D(H, a), p & /*betstatus*/
      1 && _ !== (_ = `BettingHistoryButton ${/*isMobile*/
      i[5] ? "BettingHistoryButtonMobile" : ""} ${/*betstatus*/
      i[0] === "settledBets" ? "BettingHistoryButtonSelected" : ""}`) && o(B, "class", _), p & /*betstatus*/
      1 && v(
        u,
        "bet-status",
        /*betstatus*/
        i[0]
      ), /*showModal*/
      i[3] === "true" && /*selectedBetId*/
      i[1] ? e || (e = N(), e.c(), e.m(t, T)) : e && (e.d(1), e = null);
    },
    i: C,
    o: C,
    d(i) {
      i && W(t), w && w.d(), e && e.d(), s[17](null), j = !1, K(x);
    }
  };
}
function gt(s, t, n) {
  let y;
  X(s, lt, (e) => n(4, y = e));
  let { betstatus: m = "openBets" } = t, { lang: b = "en" } = t, { selectedBetId: h = null } = t, { clientstyling: c = "" } = t, { clientstylingurl: r = "" } = t, { mbsource: f } = t, { translationurl: g = "" } = t, d = "false", S = window.navigator.userAgent, B = Y(S) !== "PC", a, H;
  const _ = () => {
    fetch(g).then((i) => i.json()).then((i) => {
      Object.keys(i).forEach((p) => {
        z(p, i[p]);
      });
    }).catch((i) => {
      console.log(i);
    });
  };
  Object.entries(rt).forEach(([e, i]) => {
    z(e, i);
  });
  const I = (e) => {
    n(0, m = e);
  }, u = () => {
    window.postMessage(
      {
        type: "PlayerAccountMenuActive",
        isMobile: B
      },
      window.location.href
    );
  }, P = (e) => {
    const { betId: i } = e.detail.params;
    n(1, h = i), n(3, d = "true");
  }, T = (e) => {
    var i;
    ((i = e.data) == null ? void 0 : i.type) === "ModalClosed" && n(3, d = "false");
  };
  $(() => (window.addEventListener("message", T, !1), () => {
    window.removeEventListener("message", T);
  }));
  const O = () => u(), j = () => I("openBets"), x = () => I("settledBets");
  function w(e) {
    tt[e ? "unshift" : "push"](() => {
      a = e, n(2, a);
    });
  }
  return s.$$set = (e) => {
    "betstatus" in e && n(0, m = e.betstatus), "lang" in e && n(9, b = e.lang), "selectedBetId" in e && n(1, h = e.selectedBetId), "clientstyling" in e && n(10, c = e.clientstyling), "clientstylingurl" in e && n(11, r = e.clientstylingurl), "mbsource" in e && n(12, f = e.mbsource), "translationurl" in e && n(13, g = e.translationurl);
  }, s.$$.update = () => {
    s.$$.dirty & /*lang*/
    512 && b && ot(b), s.$$.dirty & /*clientstyling, customStylingContainer*/
    1028 && c && a && et(a, c), s.$$.dirty & /*clientstylingurl, customStylingContainer*/
    2052 && r && a && st(a, r), s.$$.dirty & /*mbsource, customStylingContainer*/
    4100 && f && a && it(a, `${f}.Style`, H), s.$$.dirty & /*translationurl*/
    8192 && g && _();
  }, [
    m,
    h,
    a,
    d,
    y,
    B,
    I,
    u,
    P,
    b,
    c,
    r,
    f,
    g,
    O,
    j,
    x,
    w
  ];
}
class dt extends G {
  constructor(t) {
    super(), J(
      this,
      t,
      gt,
      ut,
      Z,
      {
        betstatus: 0,
        lang: 9,
        selectedBetId: 1,
        clientstyling: 10,
        clientstylingurl: 11,
        mbsource: 12,
        translationurl: 13
      },
      at
    );
  }
  get betstatus() {
    return this.$$.ctx[0];
  }
  set betstatus(t) {
    this.$$set({ betstatus: t }), k();
  }
  get lang() {
    return this.$$.ctx[9];
  }
  set lang(t) {
    this.$$set({ lang: t }), k();
  }
  get selectedBetId() {
    return this.$$.ctx[1];
  }
  set selectedBetId(t) {
    this.$$set({ selectedBetId: t }), k();
  }
  get clientstyling() {
    return this.$$.ctx[10];
  }
  set clientstyling(t) {
    this.$$set({ clientstyling: t }), k();
  }
  get clientstylingurl() {
    return this.$$.ctx[11];
  }
  set clientstylingurl(t) {
    this.$$set({ clientstylingurl: t }), k();
  }
  get mbsource() {
    return this.$$.ctx[12];
  }
  set mbsource(t) {
    this.$$set({ mbsource: t }), k();
  }
  get translationurl() {
    return this.$$.ctx[13];
  }
  set translationurl(t) {
    this.$$set({ translationurl: t }), k();
  }
}
nt(dt, { betstatus: {}, lang: {}, selectedBetId: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, translationurl: {} }, [], [], !0);
export {
  dt as default
};
