var bt = Object.defineProperty;
var Oe = Object.getOwnPropertySymbols;
var yt = Object.prototype.hasOwnProperty, kt = Object.prototype.propertyIsEnumerable;
var Ye = (A, e, t) => e in A ? bt(A, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : A[e] = t, De = (A, e) => {
  for (var t in e || (e = {}))
    yt.call(e, t) && Ye(A, t, e[t]);
  if (Oe)
    for (var t of Oe(e))
      kt.call(e, t) && Ye(A, t, e[t]);
  return A;
};
var ve = (A, e, t) => new Promise((n, i) => {
  var l = (r) => {
    try {
      m(t.next(r));
    } catch (p) {
      i(p);
    }
  }, s = (r) => {
    try {
      m(t.throw(r));
    } catch (p) {
      i(p);
    }
  }, m = (r) => r.done ? n(r.value) : Promise.resolve(r.value).then(l, s);
  m((t = t.apply(A, e)).next());
});
import { S as Bt, b as Ct, s as We, f as te, c as Mt, n as je, d as M, x as Be, e as R, m as a, k as f, g as H, l as c, w as Rt, o as Ht, r as pt, E as X, N as pe, G as ft, y as ut, z as dt, p as fe, F as L, h as Je, C as Ee, D as Fe, A as Qt, B as gt, j as d, L as Le, M as ht, q as Pe, i as Ge, I as Tt, J as zt, K as Dt, t as Wt } from "./CasinoGameOverlay-BCNHuJyW.js";
import { f as Lt, a as Ie } from "./LotteryProgramWof-L_XhzqSJ.js";
import { $ as Ne, a as Pt, b as It, i as jt, c as xt } from "./CasinoMysteryChestContainer-Cvh18rRx.js";
import "../stencil/ui-skeleton-xXZA3rYO.js";
const Ve = {
  en: {
    NoContent: "You don't have any lottery programs available now.",
    NoNext: `You don't have any spins available. Please check <a href="javascript:void(0)">Terms and Conditions</a>`,
    NoHistories: "No histories",
    Program: "Program",
    History: "History",
    ActiveTickets: "Active Tickets",
    ImplicitTickets: "Implicit Tickets",
    RemainingTimes: "Remaining Times",
    Retry: "Network is a bit busy now, please click OK to re-spin",
    ShowNext: "{name} will be available on<br /> <strong>{startTime}</strong> <br />Please wait till it is open.",
    DrawFailed: "The prize assignment may be failed, please contact customer support for more details",
    Timeout: "Network is a bit busy now, please try again later.",
    ErrorNetwork: "You are offline, please check your network settings",
    ErrorJSON: "Unexpected Data Response, please contact customer support",
    Congratulation: "Congratulations!",
    Continue: "Continue",
    NoPrizeTitle: "Not This Time!",
    NoPrize: "Don't Worry! Your turn might come next. Try Again!",
    Success: "You won a {prize}!",
    OK: "OK",
    Rewards: "Rewards",
    Status: "Status",
    Time: "Time",
    Loss: "OOPs! You are close to a prize!",
    Fulfilled: "Successful",
    Drawn: "Failed",
    Rules: "Rules",
    LuckyWheels: "Lucky Wheels",
    InfoTooltip: "Luckywheel tooltips",
    RulesDescription: "Lucky Wheel is a particularly interesting game, will bring you a lot of surprises; When you obtained the Lucky Wheel, means you got a chance to spin the Lucky Wheel, and if you are lucky, you can get the surprise prize.",
    Terms: "Terms&Conditions",
    PrizeAgenda: "Prize agenda",
    TournamentTicket: "Tournament ticket",
    FreeSpins: "Free spins",
    BonusMoney: "Bonus Money",
    LoyaltyPoints: "Loyalty Points&Coins",
    LuckyWheel: "LuckyWheel",
    CoinRoyale: "Coin Royale",
    MysteryChest: "Mystery Chest",
    CustomRewards: "Custom Rewards",
    Play: "Play",
    Spin: "Spin",
    FlipCoin: "Flip Coin",
    OpenChest: "Open Chest",
    AvailablePeriod: "Available Period",
    Recurrence: "Recurrence",
    TopRewards: "Top Rewards",
    AreYouSure: "Are you sure",
    RejectWarningText: "Once rejected, this prize will be lost<br/>and cannot be recovered.<br/>Please confirm your decision",
    KeepPrize: "No, I want to keep prize",
    RejectPrize: "Yes, I reject prize",
    Accept: "Accept",
    Reject: "Reject",
    RewardIssued: "Your reward has issued successfully",
    BackToGame: "Back to Game",
    Spins: "Spins",
    Every: "every",
    Minute: "minute",
    Minutes: "minutes",
    Day: "day",
    Days: "days",
    Week: "week",
    Weeks: "weeks",
    Month: "month",
    Months: "months",
    InThisPeriod: "in this period",
    From: "from",
    To: "to",
    EveryWeek: "every week",
    EachMonth: "of each month",
    Monday: "Monday",
    Tuesday: "Tuesday",
    Wednesday: "Wednesday",
    Thursday: "Thursday",
    Friday: "Friday",
    Saturday: "Saturday",
    Sunday: "Sunday"
  }
};
function Xt({ withLocale: A, translations: e }) {
  Ne.subscribe((t) => {
    t == null && (It.set(e), Ne.set(A));
  });
}
function Se(A, e) {
  Pt(A, e);
}
function Zt(A) {
  Ne.set(A);
}
const Nt = () => {
  Xt({ withLocale: "en", translations: {} }), Object.keys(Ve).forEach((A) => {
    Se(A, Ve[A]);
  });
};
if (typeof window != "undefined") {
  let A = function(e) {
    return function(...t) {
      try {
        return e.apply(this, t);
      } catch (n) {
        if (n instanceof DOMException && n.message.includes("has already been used with this registry") || n.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw n;
      }
    };
  };
  customElements.define = A(customElements.define), import("./PrizeEngineChest-CrKunN1E.js").then(({ default: e }) => {
    !customElements.get("prize-engine-chest") && customElements.define("prize-engine-chest", e.element);
  });
}
if (typeof window != "undefined") {
  let A = function(e) {
    return function(...t) {
      try {
        return e.apply(this, t);
      } catch (n) {
        if (n instanceof DOMException && n.message.includes("has already been used with this registry") || n.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw n;
      }
    };
  };
  customElements.define = A(customElements.define), import("./PrizeEngineCoin-B_p_euw2.js").then(({ default: e }) => {
    !customElements.get("prize-engine-coin") && customElements.define("prize-engine-coin", e.element);
  });
}
if (typeof window != "undefined") {
  let A = function(e) {
    return function(...t) {
      try {
        return e.apply(this, t);
      } catch (n) {
        if (n instanceof DOMException && n.message.includes("has already been used with this registry") || n.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw n;
      }
    };
  };
  customElements.define = A(customElements.define), import("./PrizeEngineLuckywheel-D68v5Knk.js").then(({ default: e }) => {
    !customElements.get("prize-engine-luckywheel") && customElements.define("prize-engine-luckywheel", e.element);
  });
}
const St = "data:image/webp;base64, ", Jt = "data:image/webp;base64, ", Et = "data:image/webp;base64, ", Ft = "data:image/webp;base64, ", Ot = "data:image/webp;base64, ", Yt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAABCcAAAQnAEmzTo0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMVSURBVHgBbVTNThNRGD3fnSmYYNLizhVl4ZriC9AhcUFcWDYmbsQuiCsT0aioJJRogrJhacJC0MSwMsALMIUHsDQxYSeDCVspiWA7befz3Jm2AnGSm7k/3+85517Bf75F9fMOoikXjTzHkIO6OAgrnFcdNLaK8mjzso+cX5S0kk2h9ZHGeUNnOtY4MlzDRVjjP801DBpBG83xorwMur6mO3ml33MCqSg0r4h2Beo9kduDCtDYHDyUKc5lPAI+03z4CvTbFy3lLgSa1f2sC9dngWk6HjbQLjyTW+VOyb2qp2W6LGg95rRGu0EX2F7X2WwvkEG/z0oyHCesJNuHlF9SP2PPNA6hcbBVXeWeTQh7FgiiwRS344Sv9ehOhMami+aag7MZ/n3iMGLQrKZw4hloxUFTB3B2k7j4BD5HvPZa+O0NoL1BEsYitMdNC1qQOLP5VJLRWgunHtdVZssp+ivEbYhVDocwv2hGTEzQguMVpVSL+WExKeh9kxxK7a3ciDEpicdgraLGTant3zoEBHm30+NQF7O78mbHQI6ZKC/P9UjdmN7mgYM/pDxU0svew7QgXHgqEwvW6YOuUhoh2w6HDMJD6+PEo06iQvp3ACXl5p+4RJN9rXaDGBjLKiuUAIh6NCQfhcGKWEkzvSjZa93t97pbYFYC2ThwUd/heYGZM8wcOEiNFqVY69p+1RfHBDww7K9saZzT/XxH3ZkIMt+xGya4U8yYkViYFrNTf1WXY2ms6xx9lNqTPWPgrHFCEJ15G4RZfbY2wsL3BIaB9CfPgz7oKH33OEZctBmsxKsjUzxjDnfLLMp1Iq87QDtPx4plMSI2Z6R4RiaCJAlg23HQ5zFwlUlyV5D6Qck8YNJgUpY2Y4BTkCI3KHvN8n8c4qpnZYCeqhPwE2xangWccA/y7JgBvN4VKclwYBKD+A7143R5SbfHOhxq94qs6Ar33A3ECVFjB+OT8i5ImD73LfIZiXgNqKMsWeo+HZlEJ3XOwzTX9nkpU3fFe+eekQuBLtFfsHeOziNO/DaRYkqB/zU+bOXLPn8BG6xnv5+RMCQAAAAASUVORK5CYII=";
function Gt(A) {
  Mt(A, "svelte-1m851ap", `:host{display:block;height:100%;width:100%;flex-grow:1}.PrizeDetailsContent.svelte-1m851ap.svelte-1m851ap{width:100%;height:100%;display:flex;flex-direction:column;position:relative;overflow:hidden;font-family:var(--emw--font-family-primary, "Ubuntu", sans-serif);background:transparent}.ViewLayer.svelte-1m851ap.svelte-1m851ap{width:100%;height:100%;display:flex;flex-direction:column;background:transparent}.ViewLayer.hidden.svelte-1m851ap.svelte-1m851ap{visibility:hidden}.GameLayer.svelte-1m851ap.svelte-1m851ap{position:relative;z-index:1;padding:40px 80px;box-sizing:border-box}.GameLayer.Mobile.svelte-1m851ap.svelte-1m851ap{padding:0}.GameLayer.Mobile.svelte-1m851ap .Header.svelte-1m851ap{height:auto;padding:32px 36px}.GameLayer.Mobile.svelte-1m851ap .HeaderTitle.svelte-1m851ap{font-size:var(--emw--font-size-medium, 16px);font-weight:500;line-height:1}.GameLayer.Mobile.svelte-1m851ap .IconButton.svelte-1m851ap{width:24px;height:24px}.GameLayer.Mobile.svelte-1m851ap .GameComponentContainer.svelte-1m851ap{height:370px;flex-grow:0;padding-top:20px}.GameLayer.Mobile.svelte-1m851ap .InfoSection.svelte-1m851ap{height:196px;flex-grow:0;margin:0;padding:20px 0;justify-content:flex-start;box-sizing:border-box;gap:12px}.GameLayer.Mobile.svelte-1m851ap .ActionButton.svelte-1m851ap{width:170px;height:48px;font-size:16px;box-shadow:0px 8px 12px 6px rgba(0, 0, 0, 0.15), 0px 4px 4px 0px rgba(0, 0, 0, 0.3);gap:4px;margin-bottom:8px}.GameLayer.Mobile.svelte-1m851ap .ActionButton .ButtonBase.svelte-1m851ap{text-transform:capitalize}.GameLayer.Mobile.svelte-1m851ap .ActionButton .ButtonCross.svelte-1m851ap{font-size:12px}.GameLayer.Mobile.svelte-1m851ap .ActionButton .ButtonCount.svelte-1m851ap{font-size:14px}.GameLayer.Mobile.svelte-1m851ap .InfoItem.svelte-1m851ap{font-size:12px;color:#a9ccbd;gap:4px;margin-bottom:12px}.GameLayer.Mobile.svelte-1m851ap .RulesToggle.svelte-1m851ap{position:relative;bottom:auto;left:auto;transform:none;opacity:0.5;font-size:12px;padding:8px;margin-top:auto}.RulesLayer.svelte-1m851ap.svelte-1m851ap{position:absolute;inset:0;z-index:100;padding:40px 80px;box-sizing:border-box;display:flex;flex-direction:column}.RulesLayer.Mobile.svelte-1m851ap.svelte-1m851ap{padding:20px 28px}.RulesLayer.Mobile.svelte-1m851ap .Header.svelte-1m851ap{padding:12px 8px 24px}.RulesLayer.Mobile.svelte-1m851ap .IconButton.svelte-1m851ap{width:24px;height:24px}.RulesLayer.svelte-1m851ap .HeaderPlaceholder.svelte-1m851ap{width:30px}.MessageLayer.svelte-1m851ap.svelte-1m851ap{position:absolute;inset:0;z-index:100;background:var(--emw--color-gray-transparency-30, rgba(13, 27, 29, 0.92))}.LayerContent.svelte-1m851ap.svelte-1m851ap{flex-grow:1;overflow-y:auto;display:flex;flex-direction:column;padding:0 24px}.LayerContent.Center.svelte-1m851ap.svelte-1m851ap{justify-content:center;align-items:center;text-align:center}.Header.svelte-1m851ap.svelte-1m851ap{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 24px;flex-shrink:0;position:relative}.Header.svelte-1m851ap .HeaderTitle.svelte-1m851ap{color:var(--emw--color-primary, #d3ffed);font-size:var(--emw--font-size-large, 22px);font-weight:700;text-align:center;flex-grow:1}.ViewWrapper.svelte-1m851ap.svelte-1m851ap{flex-grow:1;display:flex;flex-direction:column;overflow:hidden}.GameComponentContainer.svelte-1m851ap.svelte-1m851ap{flex-grow:1;display:flex;flex-direction:column;min-height:0;justify-content:center;align-items:center}.InfoSection.svelte-1m851ap.svelte-1m851ap{display:flex;flex-direction:column;align-items:center;gap:16px;margin-top:16px;margin-bottom:48px;flex-shrink:0}.InfoItem.svelte-1m851ap.svelte-1m851ap{display:flex;align-items:center;gap:8px;color:var(--emw--color-primary, #d3ffed);font-size:var(--emw--font-size-medium, 16px)}.SmallIcon.svelte-1m851ap.svelte-1m851ap{width:20px;height:20px;background-size:contain;background-repeat:no-repeat;background-position:center;display:flex;align-items:center;justify-content:center;color:var(--emw--color-secondary-variant, #729787)}.IconButton.svelte-1m851ap.svelte-1m851ap{width:30px;height:30px;border:0;cursor:pointer;background-color:transparent;background-size:100%;background-repeat:no-repeat;padding:0}.IconButton.Back.svelte-1m851ap.svelte-1m851ap{background:center/100% url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M10.3579 5.26604C10.0032 4.91132 9.42806 4.91132 9.07334 5.26604L5.26604 9.07334C4.91132 9.42806 4.91132 10.0032 5.26604 10.3579L9.07334 14.1652C9.42806 14.5199 10.0032 14.5199 10.3579 14.1652C10.7126 13.8105 10.7126 13.2354 10.3579 12.8806L8.10118 10.6239H10.7817C12.0761 10.6239 12.9922 10.6246 13.7085 10.6832C14.4142 10.7408 14.8455 10.85 15.1847 11.0229C15.8735 11.3738 16.4335 11.9338 16.7844 12.6226C16.9573 12.9618 17.0665 13.3931 17.1241 14.0989C17.1827 14.8151 17.1834 15.7312 17.1834 17.0256V18.0917C17.1834 18.5933 17.59 19 18.0917 19C18.5933 19 19 18.5933 19 18.0917V16.9854C19 15.74 19 14.7498 18.9347 13.9509C18.8679 13.1329 18.7281 12.4359 18.403 11.7978C17.8779 10.7673 17.04 9.92938 16.0095 9.40427C15.3714 9.07918 14.6744 8.9394 13.8564 8.87257C13.0575 8.80729 12.0673 8.8073 10.8219 8.8073H8.10118L10.3579 6.55059C10.7126 6.19587 10.7126 5.62076 10.3579 5.26604Z" fill="%23729787"/></svg>') no-repeat}.IconButton.Close.svelte-1m851ap.svelte-1m851ap{background-image:url('data:image/svg+xml,<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 6 6 18M6 6l12 12" stroke="%23729787" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>')}.GameDescription.svelte-1m851ap.svelte-1m851ap{margin-bottom:32px;font-size:var(--emw--font-size-small, 14px);color:var(--emw--color-primary-variant, #a9ccbe);line-height:1.6}.TermsLink.svelte-1m851ap.svelte-1m851ap{display:inline-flex;align-items:center;gap:6px;background:linear-gradient(90deg, var(--emw--color-teal, #75ffe9) 0%, var(--emw--color-green, #b2ff6d) 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;text-decoration:none;font-weight:700;margin-bottom:32px}.TermsLink.svelte-1m851ap .ExternalIcon.svelte-1m851ap{width:16px;height:16px;background:center/contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M18 13V19C18 19.5304 17.7893 20.0391 17.4142 20.4142C17.0391 20.7893 16.5304 21 16 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V8C3 7.46957 3.21071 6.96086 3.58579 6.58579C3.96086 6.21071 4.46957 6 5 6H11M15 3H21M21 3V9M21 3L10 13" stroke="%2375FFE9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>')}.DetailsGrid.svelte-1m851ap.svelte-1m851ap{display:flex;flex-direction:column;gap:32px}.DetailItem.svelte-1m851ap.svelte-1m851ap{display:flex;gap:12px;align-items:flex-start}.DetailItem.svelte-1m851ap .Icon.svelte-1m851ap{width:20px;height:20px;flex-shrink:0}.DetailItem.svelte-1m851ap .Icon.History.svelte-1m851ap{background:center/contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M12 8V12L15 14M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="%23ffffff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>')}.DetailItem.svelte-1m851ap .Icon.Cup.svelte-1m851ap{background:center/contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M6 9H4.5C3.67157 9 3 8.32843 3 7.5V6.5C3 5.67157 3.67157 5 4.5 5H6M18 9H19.5C20.3284 9 21 8.32843 21 7.5V6.5C21 5.67157 20.3284 5 19.5 5H18M18 22H6M12 15V22M18 5V12C18 15.3137 15.3137 18 12 18C8.68629 18 6 15.3137 6 12V5H18Z" stroke="%23ffffff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>')}.DetailItem.svelte-1m851ap .DetailText strong.svelte-1m851ap{color:var(--emw--color-white, #ffffff);font-weight:700;font-size:var(--emw--font-size-small-plus, 15px);display:block;margin-bottom:4px}.DetailItem.svelte-1m851ap .DetailText span.svelte-1m851ap{color:var(--emw--color-secondary-variant, #a9ccbe);line-height:1.5}.RewardList.svelte-1m851ap.svelte-1m851ap{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.RewardItem.svelte-1m851ap.svelte-1m851ap{color:var(--emw--color-secondary-variant, #a9ccbe)}.RewardItem.svelte-1m851ap .RewardIcon.svelte-1m851ap{width:24px;height:24px;object-fit:contain}.ImageWrapper.svelte-1m851ap.svelte-1m851ap{position:relative;display:flex;justify-content:center;align-items:center;width:100px;height:100px;margin-bottom:24px}.ImageWrapper.svelte-1m851ap.svelte-1m851ap::before{content:"";position:absolute;width:160px;height:160px;background:radial-gradient(circle, var(--emw--color-teal-10, rgba(117, 255, 233, 0.1019607843)) 0%, transparent 50%);border-radius:50%;z-index:0;filter:blur(10px)}.ImageWrapper.svelte-1m851ap .GiftImage.svelte-1m851ap{height:100px;object-fit:contain;position:relative;z-index:1}.ViewDataContainer.svelte-1m851ap.svelte-1m851ap{display:grid;width:100%;min-height:200px;align-items:center;justify-items:center;transition:transform 0.4s cubic-bezier(0.4, 0, 0.2, 1)}.ViewDataContainer.shifted.svelte-1m851ap.svelte-1m851ap{transform:translateY(-16px)}.ViewDataContainer.svelte-1m851ap .ViewDataContent.svelte-1m851ap{grid-area:1/1;display:flex;flex-direction:column;align-items:center}.MessageTitle.svelte-1m851ap.svelte-1m851ap{font-size:var(--emw--size-medium-2x-minus, 32px);font-weight:700;margin:0 0 16px;color:var(--emw--color-white, white);line-height:1.2}.MessageText.svelte-1m851ap.svelte-1m851ap{font-size:var(--emw--font-size-medium, 16px);color:var(--emw--color-primary-variant, #a9ccbe);max-width:320px;line-height:1.5;margin:0 0 24px}.ButtonGroup.svelte-1m851ap.svelte-1m851ap{display:flex;flex-direction:column;gap:16px;width:100%;align-items:center;margin-top:8px}.ButtonGroup.wide-buttons.svelte-1m851ap .ActionButton.svelte-1m851ap{width:280px}.ActionButton.svelte-1m851ap.svelte-1m851ap{cursor:pointer;height:60px;width:240px;border-radius:54px;font-weight:700;font-size:var(--emw--font-size-medium-plus, 18px);transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);display:flex;align-items:center;justify-content:center;padding:0}.ActionButton.svelte-1m851ap .ButtonTextWrapper.svelte-1m851ap{display:grid;place-items:center}.ActionButton.svelte-1m851ap .ButtonTextWrapper span.svelte-1m851ap{grid-area:1/1}.ActionButton.primary.svelte-1m851ap.svelte-1m851ap{border:none;background:linear-gradient(90deg, var(--emw--color-teal, #75ffe9) 0%, var(--emw--color-green, #b2ff6d) 100%);color:var(--emw--color-background-secondary, #152b30)}.ActionButton.outline.svelte-1m851ap.svelte-1m851ap{background:transparent;border:1px solid var(--emw--color-teal, #75ffe9);color:var(--emw--color-white, white)}.ActionButton.svelte-1m851ap.svelte-1m851ap:disabled{opacity:0.5;cursor:not-allowed}.SkeletonWrapper.svelte-1m851ap.svelte-1m851ap{display:flex;flex-direction:column;align-items:center;width:100%;gap:32px}.SkeletonWrapper.svelte-1m851ap .SkeletonContent.svelte-1m851ap{display:flex;flex-direction:column;align-items:center;gap:24px;justify-content:center}.RulesToggle.svelte-1m851ap.svelte-1m851ap{position:absolute;bottom:20px;left:50%;transform:translateX(-50%);background:transparent;border:none;color:var(--emw--color-secondary-variant, #729787);font-size:var(--emw--font-size-small, 14px);display:flex;align-items:center;gap:4px;cursor:pointer;padding:8px}.RulesToggle.svelte-1m851ap .ChevronUp.svelte-1m851ap{width:12px;height:12px;background-color:currentColor;mask:center/contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 15L12 9L6 15" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/></svg>')}`);
}
function qe(A, e, t) {
  const n = A.slice();
  return n[57] = e[t], n;
}
function Ue(A, e, t) {
  const n = A.slice();
  return n[60] = e[t], n;
}
function Ke(A) {
  let e, t, n, i, l, s = (
    /*activeGame*/
    (A[10].program.name[
      /*lang*/
      A[2]
    ] || /*activeGame*/
    A[10].program.name["*"]) + ""
  ), m, r, p, g, v, b, y, B, F, G, I, _, ie = (
    /*$_*/
    A[16]("Rules") + ""
  ), ae, $, h, J, se, E, P;
  function T(k, x) {
    if (
      /*gameType*/
      k[15] === "wheelOfFortune"
    )
      return Ut;
    if (
      /*gameType*/
      k[15] === "flipCoin"
    )
      return qt;
    if (
      /*gameType*/
      k[15] === "mysteryChest"
    )
      return Vt;
  }
  let N = T(A), D = N && N(A);
  function V(k, x) {
    return (
      /*gameType*/
      k[15] !== "wheelOfFortune" || /*themeIndex*/
      k[22] === 7 ? _t : Kt
    );
  }
  let Ae = V(A), Z = Ae(A), j = (
    /*displayExpiry*/
    A[23] && _e(A)
  ), W = (
    /*showRulesOverlay*/
    A[19] && $e(A)
  );
  return {
    c() {
      e = f("div"), t = f("div"), n = f("button"), i = H(), l = f("div"), m = L(s), r = H(), p = f("button"), g = H(), v = f("div"), b = f("div"), D && D.c(), y = H(), B = f("div"), Z.c(), F = H(), j && j.c(), G = H(), I = f("button"), _ = f("span"), ae = L(ie), $ = H(), h = f("span"), J = H(), W && W.c(), se = Je(), c(n, "type", "button"), c(n, "class", "IconButton Back svelte-1m851ap"), c(l, "class", "HeaderTitle svelte-1m851ap"), c(p, "type", "button"), c(p, "class", "IconButton Close svelte-1m851ap"), c(t, "class", "Header svelte-1m851ap"), c(b, "class", "GameComponentContainer svelte-1m851ap"), c(h, "class", "ChevronUp svelte-1m851ap"), c(I, "type", "button"), c(I, "class", "RulesToggle svelte-1m851ap"), c(B, "class", "InfoSection svelte-1m851ap"), c(v, "class", "ViewWrapper svelte-1m851ap"), c(e, "class", "ViewLayer GameLayer svelte-1m851ap"), pe(
        e,
        "Mobile",
        /*mobileView*/
        A[24]
      ), pe(
        e,
        "hidden",
        /*showRulesOverlay*/
        A[19] || /*isMessageShown*/
        A[12]
      );
    },
    m(k, x) {
      R(k, e, x), a(e, t), a(t, n), a(t, i), a(t, l), a(l, m), a(t, r), a(t, p), a(e, g), a(e, v), a(v, b), D && D.m(b, null), a(v, y), a(v, B), Z.m(B, null), a(B, F), j && j.m(B, null), a(B, G), a(B, I), a(I, _), a(_, ae), a(I, $), a(I, h), R(k, J, x), W && W.m(k, x), R(k, se, x), E || (P = [
        fe(
          n,
          "click",
          /*onBack*/
          A[29]
        ),
        fe(
          p,
          "click",
          /*onClose*/
          A[30]
        ),
        fe(
          I,
          "click",
          /*click_handler*/
          A[37]
        )
      ], E = !0);
    },
    p(k, x) {
      x[0] & /*activeGame, lang*/
      1028 && s !== (s = /*activeGame*/
      (k[10].program.name[
        /*lang*/
        k[2]
      ] || /*activeGame*/
      k[10].program.name["*"]) + "") && X(m, s), N === (N = T(k)) && D ? D.p(k, x) : (D && D.d(1), D = N && N(k), D && (D.c(), D.m(b, null))), Ae === (Ae = V(k)) && Z ? Z.p(k, x) : (Z.d(1), Z = Ae(k), Z && (Z.c(), Z.m(B, F))), /*displayExpiry*/
      k[23] ? j ? j.p(k, x) : (j = _e(k), j.c(), j.m(B, G)) : j && (j.d(1), j = null), x[0] & /*$_*/
      65536 && ie !== (ie = /*$_*/
      k[16]("Rules") + "") && X(ae, ie), x[0] & /*showRulesOverlay, isMessageShown*/
      528384 && pe(
        e,
        "hidden",
        /*showRulesOverlay*/
        k[19] || /*isMessageShown*/
        k[12]
      ), /*showRulesOverlay*/
      k[19] ? W ? (W.p(k, x), x[0] & /*showRulesOverlay*/
      524288 && Be(W, 1)) : (W = $e(k), W.c(), Be(W, 1), W.m(se.parentNode, se)) : W && (ft(), ut(W, 1, 1, () => {
        W = null;
      }), dt());
    },
    d(k) {
      k && (M(e), M(J), M(se)), D && D.d(), Z.d(), j && j.d(), W && W.d(k), E = !1, pt(P);
    }
  };
}
function Vt(A) {
  let e;
  return {
    c() {
      e = f("prize-engine-chest"), d(
        e,
        "data",
        /*activeGame*/
        A[10]
      ), d(
        e,
        "endpoint",
        /*endpoint*/
        A[0]
      ), d(
        e,
        "session",
        /*session*/
        A[1]
      ), d(
        e,
        "lang",
        /*lang*/
        A[2]
      ), d(
        e,
        "clientstyling",
        /*clientstyling*/
        A[3]
      ), d(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        A[4]
      ), d(
        e,
        "translationurl",
        /*translationurl*/
        A[5]
      ), d(
        e,
        "mbsource",
        /*mbsource*/
        A[6]
      ), d(e, "isdrawer", "false");
    },
    m(t, n) {
      R(t, e, n);
    },
    p(t, n) {
      n[0] & /*activeGame*/
      1024 && d(
        e,
        "data",
        /*activeGame*/
        t[10]
      ), n[0] & /*endpoint*/
      1 && d(
        e,
        "endpoint",
        /*endpoint*/
        t[0]
      ), n[0] & /*session*/
      2 && d(
        e,
        "session",
        /*session*/
        t[1]
      ), n[0] & /*lang*/
      4 && d(
        e,
        "lang",
        /*lang*/
        t[2]
      ), n[0] & /*clientstyling*/
      8 && d(
        e,
        "clientstyling",
        /*clientstyling*/
        t[3]
      ), n[0] & /*clientstylingurl*/
      16 && d(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[4]
      ), n[0] & /*translationurl*/
      32 && d(
        e,
        "translationurl",
        /*translationurl*/
        t[5]
      ), n[0] & /*mbsource*/
      64 && d(
        e,
        "mbsource",
        /*mbsource*/
        t[6]
      );
    },
    d(t) {
      t && M(e);
    }
  };
}
function qt(A) {
  let e;
  return {
    c() {
      e = f("prize-engine-coin"), d(
        e,
        "data",
        /*activeGame*/
        A[10]
      ), d(
        e,
        "endpoint",
        /*endpoint*/
        A[0]
      ), d(
        e,
        "session",
        /*session*/
        A[1]
      ), d(
        e,
        "lang",
        /*lang*/
        A[2]
      ), d(
        e,
        "clientstyling",
        /*clientstyling*/
        A[3]
      ), d(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        A[4]
      ), d(
        e,
        "translationurl",
        /*translationurl*/
        A[5]
      ), d(
        e,
        "mbsource",
        /*mbsource*/
        A[6]
      ), d(e, "isdrawer", "false");
    },
    m(t, n) {
      R(t, e, n);
    },
    p(t, n) {
      n[0] & /*activeGame*/
      1024 && d(
        e,
        "data",
        /*activeGame*/
        t[10]
      ), n[0] & /*endpoint*/
      1 && d(
        e,
        "endpoint",
        /*endpoint*/
        t[0]
      ), n[0] & /*session*/
      2 && d(
        e,
        "session",
        /*session*/
        t[1]
      ), n[0] & /*lang*/
      4 && d(
        e,
        "lang",
        /*lang*/
        t[2]
      ), n[0] & /*clientstyling*/
      8 && d(
        e,
        "clientstyling",
        /*clientstyling*/
        t[3]
      ), n[0] & /*clientstylingurl*/
      16 && d(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[4]
      ), n[0] & /*translationurl*/
      32 && d(
        e,
        "translationurl",
        /*translationurl*/
        t[5]
      ), n[0] & /*mbsource*/
      64 && d(
        e,
        "mbsource",
        /*mbsource*/
        t[6]
      );
    },
    d(t) {
      t && M(e);
    }
  };
}
function Ut(A) {
  let e;
  return {
    c() {
      e = f("prize-engine-luckywheel"), d(
        e,
        "data",
        /*activeGame*/
        A[10]
      ), d(
        e,
        "endpoint",
        /*endpoint*/
        A[0]
      ), d(
        e,
        "session",
        /*session*/
        A[1]
      ), d(
        e,
        "lang",
        /*lang*/
        A[2]
      ), d(
        e,
        "clientstyling",
        /*clientstyling*/
        A[3]
      ), d(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        A[4]
      ), d(
        e,
        "translationurl",
        /*translationurl*/
        A[5]
      ), d(
        e,
        "mbsource",
        /*mbsource*/
        A[6]
      ), d(
        e,
        "size",
        /*luckywheelsize*/
        A[8]
      ), d(
        e,
        "mobilesize",
        /*luckywheelmobilesize*/
        A[9]
      ), d(e, "isdrawer", "false");
    },
    m(t, n) {
      R(t, e, n);
    },
    p(t, n) {
      n[0] & /*activeGame*/
      1024 && d(
        e,
        "data",
        /*activeGame*/
        t[10]
      ), n[0] & /*endpoint*/
      1 && d(
        e,
        "endpoint",
        /*endpoint*/
        t[0]
      ), n[0] & /*session*/
      2 && d(
        e,
        "session",
        /*session*/
        t[1]
      ), n[0] & /*lang*/
      4 && d(
        e,
        "lang",
        /*lang*/
        t[2]
      ), n[0] & /*clientstyling*/
      8 && d(
        e,
        "clientstyling",
        /*clientstyling*/
        t[3]
      ), n[0] & /*clientstylingurl*/
      16 && d(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[4]
      ), n[0] & /*translationurl*/
      32 && d(
        e,
        "translationurl",
        /*translationurl*/
        t[5]
      ), n[0] & /*mbsource*/
      64 && d(
        e,
        "mbsource",
        /*mbsource*/
        t[6]
      ), n[0] & /*luckywheelsize*/
      256 && d(
        e,
        "size",
        /*luckywheelsize*/
        t[8]
      ), n[0] & /*luckywheelmobilesize*/
      512 && d(
        e,
        "mobilesize",
        /*luckywheelmobilesize*/
        t[9]
      );
    },
    d(t) {
      t && M(e);
    }
  };
}
function Kt(A) {
  let e, t, n = (
    /*$_*/
    A[16]("RemainingTimes") + ""
  ), i, l, s, m, r, p, g = (
    /*activeGame*/
    A[10].current.remainingTimes + ""
  ), v;
  return {
    c() {
      e = f("div"), t = f("span"), i = L(n), l = L(":"), s = H(), m = f("span"), m.innerHTML = `<img src="${Yt}" alt="Key"/>`, r = H(), p = f("span"), v = L(g), c(m, "class", "SmallIcon svelte-1m851ap"), c(e, "class", "InfoItem svelte-1m851ap");
    },
    m(b, y) {
      R(b, e, y), a(e, t), a(t, i), a(t, l), a(e, s), a(e, m), a(e, r), a(e, p), a(p, v);
    },
    p(b, y) {
      y[0] & /*$_*/
      65536 && n !== (n = /*$_*/
      b[16]("RemainingTimes") + "") && X(i, n), y[0] & /*activeGame*/
      1024 && g !== (g = /*activeGame*/
      b[10].current.remainingTimes + "") && X(v, g);
    },
    d(b) {
      b && M(e);
    }
  };
}
function _t(A) {
  let e, t, n = (
    /*buttonTextParts*/
    A[20].base + ""
  ), i, l, s, m, r, p = (
    /*buttonTextParts*/
    A[20].count + ""
  ), g, v, b, y;
  return {
    c() {
      var B;
      e = f("button"), t = f("span"), i = L(n), l = H(), s = f("span"), s.textContent = "×", m = H(), r = f("span"), g = L(p), c(t, "class", "ButtonBase svelte-1m851ap"), c(s, "class", "ButtonCross svelte-1m851ap"), c(r, "class", "ButtonCount svelte-1m851ap"), c(e, "type", "button"), c(e, "class", "ActionButton primary svelte-1m851ap"), e.disabled = v = /*isDrawing*/
      A[18] || !/*activeGame*/
      ((B = A[10].current) != null && B.remainingTimes);
    },
    m(B, F) {
      R(B, e, F), a(e, t), a(t, i), a(e, l), a(e, s), a(e, m), a(e, r), a(r, g), b || (y = fe(
        e,
        "click",
        /*performDraw*/
        A[27]
      ), b = !0);
    },
    p(B, F) {
      var G;
      F[0] & /*buttonTextParts*/
      1048576 && n !== (n = /*buttonTextParts*/
      B[20].base + "") && X(i, n), F[0] & /*buttonTextParts*/
      1048576 && p !== (p = /*buttonTextParts*/
      B[20].count + "") && X(g, p), F[0] & /*isDrawing, activeGame*/
      263168 && v !== (v = /*isDrawing*/
      B[18] || !/*activeGame*/
      ((G = B[10].current) != null && G.remainingTimes)) && (e.disabled = v);
    },
    d(B) {
      B && M(e), b = !1, y();
    }
  };
}
function _e(A) {
  let e, t, n, i, l;
  return {
    c() {
      e = f("div"), t = f("span"), t.innerHTML = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="14" r="7" stroke="currentColor" stroke-width="1.5"></circle><path d="M12 11V14L14 16" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 4V7" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9 4H15" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17 7L18 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M7 7L6 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>', n = H(), i = f("span"), l = L(
        /*displayExpiry*/
        A[23]
      ), c(t, "class", "SmallIcon Timer svelte-1m851ap"), c(e, "class", "InfoItem svelte-1m851ap");
    },
    m(s, m) {
      R(s, e, m), a(e, t), a(e, n), a(e, i), a(i, l);
    },
    p(s, m) {
      m[0] & /*displayExpiry*/
      8388608 && X(
        l,
        /*displayExpiry*/
        s[23]
      );
    },
    d(s) {
      s && M(e);
    }
  };
}
function $e(A) {
  var Ce, Me, Re, He, Qe, Te;
  let e, t, n, i, l, s = (
    /*$_*/
    A[16]("Rules") + ""
  ), m, r, p, g, v, b, y = (
    /*$_*/
    A[16]("RulesDescription") + ""
  ), B, F, G, I, _, ie, ae, $, h, J = (
    /*$_*/
    A[16]("AvailablePeriod") + ""
  ), se, E, P, T = (
    /*formatDateTime*/
    A[31](
      /*activeGame*/
      (Ce = A[10].program.trigger) == null ? void 0 : Ce.startTime
    ) + ""
  ), N, D, V = (
    /*formatDateTime*/
    A[31](
      /*activeGame*/
      (Me = A[10].program.trigger) == null ? void 0 : Me.endTime
    ) + ""
  ), Ae, Z, j, W, k, x, le, we, be = (
    /*$_*/
    A[16]("TopRewards") + ""
  ), q, ue, de, ge, oe, U, ye, he, O = (
    /*terms*/
    A[7] && et(A)
  ), Y = (
    /*activeGame*/
    ((Qe = (He = (Re = A[10]) == null ? void 0 : Re.program) == null ? void 0 : He.trigger) == null ? void 0 : Qe.periods) && tt(A)
  ), S = (
    /*activeGame*/
    ((Te = A[10].program.wheelOfFortune) == null ? void 0 : Te.partitions) && nt(A)
  );
  return {
    c() {
      e = f("div"), t = f("div"), n = f("div"), i = H(), l = f("div"), m = L(s), r = H(), p = f("button"), g = H(), v = f("div"), b = f("div"), B = L(y), F = H(), O && O.c(), G = H(), I = f("div"), _ = f("div"), ie = f("span"), ae = H(), $ = f("div"), h = f("strong"), se = L(J), E = H(), P = f("span"), N = L(T), D = L(" ~ "), Ae = L(V), Z = H(), Y && Y.c(), j = H(), W = f("div"), k = f("span"), x = H(), le = f("div"), we = f("strong"), q = L(be), ue = H(), de = f("span"), S && S.c(), c(n, "class", "HeaderPlaceholder svelte-1m851ap"), c(l, "class", "HeaderTitle svelte-1m851ap"), c(p, "type", "button"), c(p, "class", "IconButton Close svelte-1m851ap"), c(t, "class", "Header svelte-1m851ap"), c(b, "class", "GameDescription svelte-1m851ap"), c(ie, "class", "Icon History svelte-1m851ap"), c(h, "class", "svelte-1m851ap"), c(P, "class", "svelte-1m851ap"), c($, "class", "DetailText"), c(_, "class", "DetailItem svelte-1m851ap"), c(k, "class", "Icon Cup svelte-1m851ap"), c(we, "class", "svelte-1m851ap"), c(de, "class", "RewardList svelte-1m851ap"), c(le, "class", "DetailText"), c(W, "class", "DetailItem Rewards svelte-1m851ap"), c(I, "class", "DetailsGrid svelte-1m851ap"), c(v, "class", "LayerContent svelte-1m851ap"), c(e, "class", "ViewLayer RulesLayer svelte-1m851ap"), pe(
        e,
        "Mobile",
        /*mobileView*/
        A[24]
      );
    },
    m(z, ee) {
      R(z, e, ee), a(e, t), a(t, n), a(t, i), a(t, l), a(l, m), a(t, r), a(t, p), a(e, g), a(e, v), a(v, b), a(b, B), a(v, F), O && O.m(v, null), a(v, G), a(v, I), a(I, _), a(_, ie), a(_, ae), a(_, $), a($, h), a(h, se), a($, E), a($, P), a(P, N), a(P, D), a(P, Ae), a(I, Z), Y && Y.m(I, null), a(I, j), a(I, W), a(W, k), a(W, x), a(W, le), a(le, we), a(we, q), a(le, ue), a(le, de), S && S.m(de, null), U = !0, ye || (he = fe(
        p,
        "click",
        /*click_handler_1*/
        A[38]
      ), ye = !0);
    },
    p(z, ee) {
      var ze, o, u, C, Q, w;
      (!U || ee[0] & /*$_*/
      65536) && s !== (s = /*$_*/
      z[16]("Rules") + "") && X(m, s), (!U || ee[0] & /*$_*/
      65536) && y !== (y = /*$_*/
      z[16]("RulesDescription") + "") && X(B, y), /*terms*/
      z[7] ? O ? O.p(z, ee) : (O = et(z), O.c(), O.m(v, G)) : O && (O.d(1), O = null), (!U || ee[0] & /*$_*/
      65536) && J !== (J = /*$_*/
      z[16]("AvailablePeriod") + "") && X(se, J), (!U || ee[0] & /*activeGame*/
      1024) && T !== (T = /*formatDateTime*/
      z[31](
        /*activeGame*/
        (ze = z[10].program.trigger) == null ? void 0 : ze.startTime
      ) + "") && X(N, T), (!U || ee[0] & /*activeGame*/
      1024) && V !== (V = /*formatDateTime*/
      z[31](
        /*activeGame*/
        (o = z[10].program.trigger) == null ? void 0 : o.endTime
      ) + "") && X(Ae, V), /*activeGame*/
      (Q = (C = (u = z[10]) == null ? void 0 : u.program) == null ? void 0 : C.trigger) != null && Q.periods ? Y ? Y.p(z, ee) : (Y = tt(z), Y.c(), Y.m(I, j)) : Y && (Y.d(1), Y = null), (!U || ee[0] & /*$_*/
      65536) && be !== (be = /*$_*/
      z[16]("TopRewards") + "") && X(q, be), /*activeGame*/
      (w = z[10].program.wheelOfFortune) != null && w.partitions ? S ? S.p(z, ee) : (S = nt(z), S.c(), S.m(de, null)) : S && (S.d(1), S = null);
    },
    i(z) {
      U || (z && Ee(() => {
        U && (oe && oe.end(1), ge = Fe(e, Ie, { y: "100%", duration: 400 }), ge.start());
      }), U = !0);
    },
    o(z) {
      ge && ge.invalidate(), z && (oe = gt(e, Ie, { y: "100%", duration: 400 })), U = !1;
    },
    d(z) {
      z && M(e), O && O.d(), Y && Y.d(), S && S.d(), z && oe && oe.end(), ye = !1, he();
    }
  };
}
function et(A) {
  let e, t, n = (
    /*$_*/
    A[16]("Terms") + ""
  ), i, l, s;
  return {
    c() {
      e = f("a"), t = f("span"), i = L(n), l = H(), s = f("span"), c(s, "class", "ExternalIcon svelte-1m851ap"), c(e, "class", "TermsLink svelte-1m851ap"), c(
        e,
        "href",
        /*terms*/
        A[7]
      ), c(e, "target", "_blank");
    },
    m(m, r) {
      R(m, e, r), a(e, t), a(t, i), a(e, l), a(e, s);
    },
    p(m, r) {
      r[0] & /*$_*/
      65536 && n !== (n = /*$_*/
      m[16]("Terms") + "") && X(i, n), r[0] & /*terms*/
      128 && c(
        e,
        "href",
        /*terms*/
        m[7]
      );
    },
    d(m) {
      m && M(e);
    }
  };
}
function tt(A) {
  let e, t = Le(
    /*activeGame*/
    A[10].program.trigger.periods
  ), n = [];
  for (let i = 0; i < t.length; i += 1)
    n[i] = At(Ue(A, t, i));
  return {
    c() {
      for (let i = 0; i < n.length; i += 1)
        n[i].c();
      e = Je();
    },
    m(i, l) {
      for (let s = 0; s < n.length; s += 1)
        n[s] && n[s].m(i, l);
      R(i, e, l);
    },
    p(i, l) {
      if (l[0] & /*getRecurrenceText, activeGame, $_*/
      33620992) {
        t = Le(
          /*activeGame*/
          i[10].program.trigger.periods
        );
        let s;
        for (s = 0; s < t.length; s += 1) {
          const m = Ue(i, t, s);
          n[s] ? n[s].p(m, l) : (n[s] = At(m), n[s].c(), n[s].m(e.parentNode, e));
        }
        for (; s < n.length; s += 1)
          n[s].d(1);
        n.length = t.length;
      }
    },
    d(i) {
      i && M(e), ht(n, i);
    }
  };
}
function At(A) {
  let e, t, n, i, l, s = (
    /*$_*/
    A[16]("Recurrence") + ""
  ), m, r, p, g = (
    /*getRecurrenceText*/
    A[25](
      /*period*/
      A[60]
    ) + ""
  ), v, b;
  return {
    c() {
      e = f("div"), t = f("span"), n = H(), i = f("div"), l = f("strong"), m = L(s), r = H(), p = f("span"), v = L(g), b = H(), c(t, "class", "Icon History svelte-1m851ap"), c(l, "class", "svelte-1m851ap"), c(p, "class", "svelte-1m851ap"), c(i, "class", "DetailText"), c(e, "class", "DetailItem svelte-1m851ap");
    },
    m(y, B) {
      R(y, e, B), a(e, t), a(e, n), a(e, i), a(i, l), a(l, m), a(i, r), a(i, p), a(p, v), a(e, b);
    },
    p(y, B) {
      B[0] & /*$_*/
      65536 && s !== (s = /*$_*/
      y[16]("Recurrence") + "") && X(m, s), B[0] & /*activeGame*/
      1024 && g !== (g = /*getRecurrenceText*/
      y[25](
        /*period*/
        y[60]
      ) + "") && X(v, g);
    },
    d(y) {
      y && M(e);
    }
  };
}
function nt(A) {
  let e, t = Le(
    /*activeGame*/
    A[10].program.wheelOfFortune.partitions
  ), n = [];
  for (let i = 0; i < t.length; i += 1)
    n[i] = it(qe(A, t, i));
  return {
    c() {
      for (let i = 0; i < n.length; i += 1)
        n[i].c();
      e = Je();
    },
    m(i, l) {
      for (let s = 0; s < n.length; s += 1)
        n[s] && n[s].m(i, l);
      R(i, e, l);
    },
    p(i, l) {
      if (l[0] & /*activeGame, lang*/
      1028) {
        t = Le(
          /*activeGame*/
          i[10].program.wheelOfFortune.partitions
        );
        let s;
        for (s = 0; s < t.length; s += 1) {
          const m = qe(i, t, s);
          n[s] ? n[s].p(m, l) : (n[s] = it(m), n[s].c(), n[s].m(e.parentNode, e));
        }
        for (; s < n.length; s += 1)
          n[s].d(1);
        n.length = t.length;
      }
    },
    d(i) {
      i && M(e), ht(n, i);
    }
  };
}
function $t(A) {
  let e, t;
  return {
    c() {
      e = f("img"), c(e, "class", "RewardIcon svelte-1m851ap"), Pe(e.src, t = /*partition*/
      A[57].image1[
        /*lang*/
        A[2]
      ] || /*partition*/
      A[57].image1["*"]) || c(e, "src", t), c(e, "alt", "");
    },
    m(n, i) {
      R(n, e, i);
    },
    p(n, i) {
      i[0] & /*activeGame, lang*/
      1028 && !Pe(e.src, t = /*partition*/
      n[57].image1[
        /*lang*/
        n[2]
      ] || /*partition*/
      n[57].image1["*"]) && c(e, "src", t);
    },
    d(n) {
      n && M(e);
    }
  };
}
function eA(A) {
  let e, t = (
    /*partition*/
    (A[57].name[
      /*lang*/
      A[2]
    ] || /*partition*/
    A[57].name["*"]) + ""
  ), n;
  return {
    c() {
      e = f("span"), n = L(t), c(e, "class", "svelte-1m851ap");
    },
    m(i, l) {
      R(i, e, l), a(e, n);
    },
    p(i, l) {
      l[0] & /*activeGame, lang*/
      1028 && t !== (t = /*partition*/
      (i[57].name[
        /*lang*/
        i[2]
      ] || /*partition*/
      i[57].name["*"]) + "") && X(n, t);
    },
    d(i) {
      i && M(e);
    }
  };
}
function it(A) {
  let e, t;
  function n(s, m) {
    if (
      /*partition*/
      s[57].name[
        /*lang*/
        s[2]
      ] || /*partition*/
      s[57].name["*"]
    )
      return eA;
    if (
      /*partition*/
      s[57].image1
    )
      return $t;
  }
  let i = n(A), l = i && i(A);
  return {
    c() {
      e = f("span"), l && l.c(), t = H(), c(e, "class", "RewardItem svelte-1m851ap");
    },
    m(s, m) {
      R(s, e, m), l && l.m(e, null), a(e, t);
    },
    p(s, m) {
      i === (i = n(s)) && l ? l.p(s, m) : (l && l.d(1), l = i && i(s), l && (l.c(), l.m(e, t)));
    },
    d(s) {
      s && M(e), l && l.d();
    }
  };
}
function st(A) {
  let e, t, n;
  function i(m, r) {
    if (
      /*internalLoading*/
      m[17]
    )
      return AA;
    if (
      /*viewData*/
      m[21]
    )
      return tA;
  }
  let l = i(A), s = l && l(A);
  return {
    c() {
      e = f("div"), t = f("div"), s && s.c(), c(t, "class", "LayerContent Center svelte-1m851ap"), c(e, "class", "ViewLayer MessageLayer svelte-1m851ap");
    },
    m(m, r) {
      R(m, e, r), a(e, t), s && s.m(t, null);
    },
    p(m, r) {
      l === (l = i(m)) && s ? s.p(m, r) : (s && s.d(1), s = l && l(m), s && (s.c(), s.m(t, null)));
    },
    i(m) {
      m && (n || Ee(() => {
        n = Fe(e, Lt, { duration: 250 }), n.start();
      }));
    },
    o: je,
    d(m) {
      m && M(e), s && s.d();
    }
  };
}
function tA(A) {
  let e, t = (
    /*viewData*/
    A[21].key
  ), n, i, l = ot(A);
  function s(p, g) {
    return (
      /*messageMode*/
      p[13] === "gift" ? iA : nA
    );
  }
  let m = s(A), r = m(A);
  return {
    c() {
      e = f("div"), l.c(), n = H(), i = f("div"), r.c(), c(e, "class", "ViewDataContainer svelte-1m851ap"), pe(
        e,
        "shifted",
        /*internalMode*/
        A[14] === "confirmReject"
      ), c(i, "class", "ButtonGroup svelte-1m851ap"), pe(
        i,
        "wide-buttons",
        /*internalMode*/
        A[14] === "confirmReject"
      );
    },
    m(p, g) {
      R(p, e, g), l.m(e, null), R(p, n, g), R(p, i, g), r.m(i, null);
    },
    p(p, g) {
      g[0] & /*viewData*/
      2097152 && We(t, t = /*viewData*/
      p[21].key) ? (ft(), ut(l, 1, 1, je), dt(), l = ot(p), l.c(), Be(l, 1), l.m(e, null)) : l.p(p, g), g[0] & /*internalMode*/
      16384 && pe(
        e,
        "shifted",
        /*internalMode*/
        p[14] === "confirmReject"
      ), m === (m = s(p)) && r ? r.p(p, g) : (r.d(1), r = m(p), r && (r.c(), r.m(i, null))), g[0] & /*internalMode*/
      16384 && pe(
        i,
        "wide-buttons",
        /*internalMode*/
        p[14] === "confirmReject"
      );
    },
    d(p) {
      p && (M(e), M(n), M(i)), l.d(p), r.d();
    }
  };
}
function AA(A) {
  let e;
  return {
    c() {
      e = f("div"), e.innerHTML = '<div class="SkeletonContent svelte-1m851ap"><ui-skeleton structure="rectangle" width="100px" height="100px" border-radius="20px"></ui-skeleton> <ui-skeleton structure="text" width="240px" height="24px"></ui-skeleton></div> <div class="SkeletonFooter"><ui-skeleton structure="rectangle" width="240px" height="60px" border-radius="54px"></ui-skeleton></div>', c(e, "class", "SkeletonWrapper svelte-1m851ap");
    },
    m(t, n) {
      R(t, e, n);
    },
    p: je,
    d(t) {
      t && M(e);
    }
  };
}
function lt(A) {
  let e, t, n;
  return {
    c() {
      e = f("div"), t = f("img"), Pe(t.src, n = /*viewData*/
      A[21].image) || c(t, "src", n), c(t, "alt", ""), c(t, "class", "GiftImage svelte-1m851ap"), c(e, "class", "ImageWrapper svelte-1m851ap");
    },
    m(i, l) {
      R(i, e, l), a(e, t);
    },
    p(i, l) {
      l[0] & /*viewData*/
      2097152 && !Pe(t.src, n = /*viewData*/
      i[21].image) && c(t, "src", n);
    },
    d(i) {
      i && M(e);
    }
  };
}
function rt(A) {
  let e, t = (
    /*viewData*/
    A[21].title + ""
  );
  return {
    c() {
      e = f("p"), c(e, "class", "MessageTitle svelte-1m851ap");
    },
    m(n, i) {
      R(n, e, i), e.innerHTML = t;
    },
    p(n, i) {
      i[0] & /*viewData*/
      2097152 && t !== (t = /*viewData*/
      n[21].title + "") && (e.innerHTML = t);
    },
    d(n) {
      n && M(e);
    }
  };
}
function at(A) {
  let e, t = (
    /*viewData*/
    A[21].text + ""
  );
  return {
    c() {
      e = f("p"), c(e, "class", "MessageText svelte-1m851ap");
    },
    m(n, i) {
      R(n, e, i), e.innerHTML = t;
    },
    p(n, i) {
      i[0] & /*viewData*/
      2097152 && t !== (t = /*viewData*/
      n[21].text + "") && (e.innerHTML = t);
    },
    d(n) {
      n && M(e);
    }
  };
}
function ot(A) {
  let e, t, n, i, l, s, m = (
    /*viewData*/
    A[21].image && lt(A)
  ), r = (
    /*viewData*/
    A[21].title && rt(A)
  ), p = (
    /*viewData*/
    A[21].text && at(A)
  );
  return {
    c() {
      e = f("div"), m && m.c(), t = H(), r && r.c(), n = H(), p && p.c(), c(e, "class", "ViewDataContent svelte-1m851ap");
    },
    m(g, v) {
      R(g, e, v), m && m.m(e, null), a(e, t), r && r.m(e, null), a(e, n), p && p.m(e, null), s = !0;
    },
    p(g, v) {
      A = g, /*viewData*/
      A[21].image ? m ? m.p(A, v) : (m = lt(A), m.c(), m.m(e, t)) : m && (m.d(1), m = null), /*viewData*/
      A[21].title ? r ? r.p(A, v) : (r = rt(A), r.c(), r.m(e, n)) : r && (r.d(1), r = null), /*viewData*/
      A[21].text ? p ? p.p(A, v) : (p = at(A), p.c(), p.m(e, null)) : p && (p.d(1), p = null);
    },
    i(g) {
      s || (g && Ee(() => {
        s && (l && l.end(1), i = Fe(e, Ie, {
          y: (
            /*internalMode*/
            A[14] === "confirmReject" ? 10 : -10
          ),
          duration: 300,
          delay: 100
        }), i.start());
      }), s = !0);
    },
    o(g) {
      i && i.invalidate(), g && (l = gt(e, Ie, {
        y: (
          /*internalMode*/
          A[14] === "confirmReject" ? -10 : 10
        ),
        duration: 150
      })), s = !1;
    },
    d(g) {
      g && M(e), m && m.d(), r && r.d(), p && p.d(), g && l && l.end();
    }
  };
}
function nA(A) {
  let e, t, n;
  function i(m, r) {
    return (
      /*messageMode*/
      m[13] === "success" ? rA : (
        /*messageMode*/
        m[13] === "noprize" ? lA : sA
      )
    );
  }
  let l = i(A), s = l(A);
  return {
    c() {
      e = f("button"), s.c(), c(e, "type", "button"), c(e, "class", "ActionButton primary svelte-1m851ap");
    },
    m(m, r) {
      R(m, e, r), s.m(e, null), t || (n = fe(
        e,
        "click",
        /*click_handler_6*/
        A[43]
      ), t = !0);
    },
    p(m, r) {
      l === (l = i(m)) && s ? s.p(m, r) : (s.d(1), s = l(m), s && (s.c(), s.m(e, null)));
    },
    d(m) {
      m && M(e), s.d(), t = !1, n();
    }
  };
}
function iA(A) {
  let e, t, n = (
    /*internalMode*/
    A[14]
  ), i, l, s, m = (
    /*internalMode*/
    A[14]
  ), r, p, g = mt(A), v = ct(A);
  return {
    c() {
      e = f("button"), t = f("div"), g.c(), i = H(), l = f("button"), s = f("div"), v.c(), c(t, "class", "ButtonTextWrapper svelte-1m851ap"), c(e, "type", "button"), c(e, "class", "ActionButton primary svelte-1m851ap"), e.disabled = /*internalLoading*/
      A[17], c(s, "class", "ButtonTextWrapper svelte-1m851ap"), c(l, "type", "button"), c(l, "class", "ActionButton outline svelte-1m851ap"), l.disabled = /*internalLoading*/
      A[17];
    },
    m(b, y) {
      R(b, e, y), a(e, t), g.m(t, null), R(b, i, y), R(b, l, y), a(l, s), v.m(s, null), r || (p = [
        fe(e, "click", function() {
          Ge(
            /*internalMode*/
            A[14] === "confirmReject" ? (
              /*click_handler_2*/
              A[39]
            ) : (
              /*click_handler_3*/
              A[40]
            )
          ) && /*internalMode*/
          (A[14] === "confirmReject" ? (
            /*click_handler_2*/
            A[39]
          ) : (
            /*click_handler_3*/
            A[40]
          )).apply(this, arguments);
        }),
        fe(l, "click", function() {
          Ge(
            /*internalMode*/
            A[14] === "confirmReject" ? (
              /*click_handler_4*/
              A[41]
            ) : (
              /*click_handler_5*/
              A[42]
            )
          ) && /*internalMode*/
          (A[14] === "confirmReject" ? (
            /*click_handler_4*/
            A[41]
          ) : (
            /*click_handler_5*/
            A[42]
          )).apply(this, arguments);
        })
      ], r = !0);
    },
    p(b, y) {
      A = b, y[0] & /*internalMode*/
      16384 && We(n, n = /*internalMode*/
      A[14]) ? (g.d(1), g = mt(A), g.c(), g.m(t, null)) : g.p(A, y), y[0] & /*internalLoading*/
      131072 && (e.disabled = /*internalLoading*/
      A[17]), y[0] & /*internalMode*/
      16384 && We(m, m = /*internalMode*/
      A[14]) ? (v.d(1), v = ct(A), v.c(), v.m(s, null)) : v.p(A, y), y[0] & /*internalLoading*/
      131072 && (l.disabled = /*internalLoading*/
      A[17]);
    },
    d(b) {
      b && (M(e), M(i), M(l)), g.d(b), v.d(b), r = !1, pt(p);
    }
  };
}
function sA(A) {
  let e = (
    /*$_*/
    A[16]("OK") + ""
  ), t;
  return {
    c() {
      t = L(e);
    },
    m(n, i) {
      R(n, t, i);
    },
    p(n, i) {
      i[0] & /*$_*/
      65536 && e !== (e = /*$_*/
      n[16]("OK") + "") && X(t, e);
    },
    d(n) {
      n && M(t);
    }
  };
}
function lA(A) {
  let e = (
    /*$_*/
    A[16]("Continue") + ""
  ), t;
  return {
    c() {
      t = L(e);
    },
    m(n, i) {
      R(n, t, i);
    },
    p(n, i) {
      i[0] & /*$_*/
      65536 && e !== (e = /*$_*/
      n[16]("Continue") + "") && X(t, e);
    },
    d(n) {
      n && M(t);
    }
  };
}
function rA(A) {
  let e = (
    /*$_*/
    A[16]("BackToGame") + ""
  ), t;
  return {
    c() {
      t = L(e);
    },
    m(n, i) {
      R(n, t, i);
    },
    p(n, i) {
      i[0] & /*$_*/
      65536 && e !== (e = /*$_*/
      n[16]("BackToGame") + "") && X(t, e);
    },
    d(n) {
      n && M(t);
    }
  };
}
function mt(A) {
  let e, t = (
    /*internalMode*/
    (A[14] === "confirmReject" ? (
      /*$_*/
      A[16]("KeepPrize")
    ) : (
      /*$_*/
      A[16]("Accept")
    )) + ""
  ), n;
  return {
    c() {
      e = f("span"), n = L(t), c(e, "class", "svelte-1m851ap");
    },
    m(i, l) {
      R(i, e, l), a(e, n);
    },
    p(i, l) {
      l[0] & /*internalMode, $_*/
      81920 && t !== (t = /*internalMode*/
      (i[14] === "confirmReject" ? (
        /*$_*/
        i[16]("KeepPrize")
      ) : (
        /*$_*/
        i[16]("Accept")
      )) + "") && X(n, t);
    },
    d(i) {
      i && M(e);
    }
  };
}
function ct(A) {
  let e, t = (
    /*internalMode*/
    (A[14] === "confirmReject" ? (
      /*$_*/
      A[16]("RejectPrize")
    ) : (
      /*$_*/
      A[16]("Reject")
    )) + ""
  ), n;
  return {
    c() {
      e = f("span"), n = L(t), c(e, "class", "svelte-1m851ap");
    },
    m(i, l) {
      R(i, e, l), a(e, n);
    },
    p(i, l) {
      l[0] & /*internalMode, $_*/
      81920 && t !== (t = /*internalMode*/
      (i[14] === "confirmReject" ? (
        /*$_*/
        i[16]("RejectPrize")
      ) : (
        /*$_*/
        i[16]("Reject")
      )) + "") && X(n, t);
    },
    d(i) {
      i && M(e);
    }
  };
}
function aA(A) {
  let e, t, n = (
    /*activeGame*/
    A[10] && Ke(A)
  ), i = (
    /*isMessageShown*/
    A[12] && st(A)
  );
  return {
    c() {
      e = f("div"), n && n.c(), t = H(), i && i.c(), c(e, "class", "PrizeDetailsContent svelte-1m851ap");
    },
    m(l, s) {
      R(l, e, s), n && n.m(e, null), a(e, t), i && i.m(e, null), A[44](e);
    },
    p(l, s) {
      /*activeGame*/
      l[10] ? n ? n.p(l, s) : (n = Ke(l), n.c(), n.m(e, t)) : n && (n.d(1), n = null), /*isMessageShown*/
      l[12] ? i ? (i.p(l, s), s[0] & /*isMessageShown*/
      4096 && Be(i, 1)) : (i = st(l), i.c(), Be(i, 1), i.m(e, null)) : i && (i.d(1), i = null);
    },
    i(l) {
      Be(i);
    },
    o: je,
    d(l) {
      l && M(e), n && n.d(), i && i.d(), A[44](null);
    }
  };
}
let oA = null;
function mA(A, e, t) {
  let n, i, l, s, m, r;
  Rt(A, xt, (o) => t(16, r = o));
  let { data: p = null } = e, { endpoint: g = "" } = e, { session: v = "" } = e, { lang: b = "en" } = e, { clientstyling: y = "" } = e, { clientstylingurl: B = "" } = e, { translationurl: F = "" } = e, { mbsource: G = "" } = e, { twostepdraw: I = "false" } = e, { terms: _ = "" } = e, { luckywheelsize: ie = 324 } = e, { luckywheelmobilesize: ae = 240 } = e, { programs: $ = [] } = e, h = null, J;
  const se = jt(window.navigator.userAgent);
  let E = !1, P = "", T = null, N = !1, D = !1, V = "", Ae = "", Z = !1, j = Date.now(), W = null;
  const k = (o, u) => {
    if (!o)
      return "";
    const Q = new Date(o).getTime() - u;
    if (Q <= 0)
      return "00d:00h:00m";
    const w = Math.floor(Q / (1e3 * 60 * 60 * 24)), re = Math.floor(Q % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), me = Math.floor(Q % (1e3 * 60 * 60) / (1e3 * 60));
    return `${w.toString().padStart(2, "0")}d:${re.toString().padStart(2, "0")}h:${me.toString().padStart(2, "0")}m`;
  }, x = (o) => [
    "",
    r("Monday"),
    r("Tuesday"),
    r("Wednesday"),
    r("Thursday"),
    r("Friday"),
    r("Saturday"),
    r("Sunday")
  ][o] || "", le = (o) => {
    const u = ["th", "st", "nd", "rd"], C = o % 100;
    return o + (u[(C - 20) % 10] || u[C] || u[0]);
  }, we = (o) => {
    if (!o)
      return "";
    const { recurrenceType: u, frequency: C, dayFrom: Q, dayTo: w, maxImplicitTickets: re, startTime: me, endTime: ce } = o, xe = re || 0, Xe = xe > 1 ? r("Spins") : r("Spin");
    let K = `${xe} ${Xe}`;
    const ke = r("Every"), ne = C || 1;
    switch (u == null ? void 0 : u.toLowerCase()) {
      case "single":
        K += ` ${r("InThisPeriod")}`;
        break;
      case "minute":
        const vt = ne > 1 ? r("Minutes") : r("Minute");
        K += ` ${ke} ${ne > 1 ? ne + " " : ""}${vt}`;
        break;
      case "day":
        const wt = ne > 1 ? r("Days") : r("Day");
        K += ` ${ke} ${ne > 1 ? ne + " " : ""}${wt}`;
        break;
      case "week":
        if (Q && w)
          Q === w ? K += ` ${ke} ${x(Q)}` : K += ` ${r("From")} ${x(Q)} ${r("To")} ${x(w)} ${r("EveryWeek")}`;
        else {
          const Ze = ne > 1 ? r("Weeks") : r("Week");
          K += ` ${ke} ${ne > 1 ? ne + " " : ""}${Ze}`;
        }
        break;
      case "month":
        if (Q && w)
          Q === w ? K += ` ${ke} ${le(Q)} ${r("EachMonth")}` : K += ` ${r("From")} ${le(Q)} ${r("To")} ${le(w)} ${r("EachMonth")}`;
        else {
          const Ze = ne > 1 ? r("Months") : r("Month");
          K += ` ${ke} ${ne > 1 ? ne + " " : ""}${Ze}`;
        }
        break;
      default:
        K += ` ${r("InThisPeriod")}`;
    }
    return `${K} [${S(me)} ~ ${S(ce)}]`;
  };
  Nt();
  const be = (o) => ve(this, null, function* () {
    try {
      const C = yield (yield fetch(o)).json();
      Object.keys(C).forEach((Q) => {
        Se(Q, C[Q]);
      });
    } catch (u) {
      console.error("[PrizeDetails] Failed to load translations", u);
    }
  });
  var q;
  (function(o) {
    o[o.Assign = 0] = "Assign", o[o.Reward = 1] = "Reward", o[o.Reject = 2] = "Reject";
  })(q || (q = {}));
  const ue = (C, ...Q) => ve(this, [C, ...Q], function* (o, u = {}) {
    const w = new URL(g + "/v1" + o);
    u.params && Object.keys(u.params).forEach((ce) => w.searchParams.append(ce, u.params[ce]));
    const me = yield (yield fetch(w.toString(), {
      method: u.method || "GET",
      headers: De(De({
        "Content-Type": "application/json",
        Accept: "text/plain"
      }, v ? { "x-SessionId": v } : {}), u.headers),
      body: u.body
    })).text();
    try {
      return JSON.parse(me);
    } catch (ce) {
      return me;
    }
  }), de = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (o) => {
    const u = Math.random() * 16 | 0;
    return (o === "x" ? u : u & 3 | 8).toString(16);
  }), ge = () => ve(this, null, function* () {
    var C;
    if (!h)
      return;
    const o = yield ue("/wof/remainingTimes", {
      params: {
        filter: `ProgramId[]=${h.program.id}`
      }
    });
    let u = 0;
    if (((C = o == null ? void 0 : o.items) == null ? void 0 : C.length) > 0) {
      const Q = o.items.find((w) => w.programId === h.program.id);
      Q && (u = +Q.remainingTimes || 0);
    }
    t(10, h.current.remainingTimes = u, h), t(10, h = De({}, h)), t(32, p = JSON.stringify(h));
  }), oe = () => ve(this, null, function* () {
    if (!h)
      return;
    let o = $;
    if (!o || o.length === 0)
      try {
        const C = yield ue("/wof/lotteries");
        o = (C == null ? void 0 : C.items) || [];
      } catch (C) {
        console.error("[PrizeDetails] Check next program failed", C);
      }
    const u = o == null ? void 0 : o.find((C) => C.program.id === h.program.id);
    u && u.current ? (t(13, P = "show-next"), t(35, T = {
      startTime: S(u.current.startTime),
      name: u.program.name[b] || u.program.name["*"]
    })) : t(13, P = "no-next"), t(12, E = !0);
  }), U = () => ve(this, null, function* () {
    var o;
    if (!(!h || N || D || E) && ((o = h.current) == null ? void 0 : o.remainingTimes) !== 0) {
      Ae = de(), t(17, N = !0), t(18, D = !0), t(19, Z = !1), window.postMessage({ type: "PrizeGameStartAnimation" }, "*");
      try {
        const u = I === "true" ? q.Reward : q.Assign, C = yield ue(`/wof/draw/${h.program.id}`, {
          method: "PUT",
          body: JSON.stringify({ guid: Ae, action: u })
        });
        ye(C, u);
      } catch (u) {
        window.postMessage(
          {
            type: "PrizeGameResult",
            data: { error: !0 }
          },
          "*"
        ), t(13, P = "error"), t(12, E = !0), t(17, N = !1), t(18, D = !1);
      }
    }
  }), ye = (o, u) => {
    var C, Q;
    if (t(17, N = !1), ((C = o == null ? void 0 : o.item) == null ? void 0 : C.state) === "fulfilled" || ((Q = o == null ? void 0 : o.item) == null ? void 0 : Q.state) === "drawn") {
      window.postMessage({ type: "PrizeGameResult", data: o }, "*");
      const w = h.program.wheelOfFortune.partitions[o.item.result.wheelOfFortunePartitionIndex], re = (w == null ? void 0 : w.prizeText[b]) || (w == null ? void 0 : w.prizeText["*"]) || "", me = (w == null ? void 0 : w.name[b]) || (w == null ? void 0 : w.name["*"]) || "", ce = (w == null ? void 0 : w.prizeImage[b]) || (w == null ? void 0 : w.prizeImage["*"]) || "";
      o.item.result.outcomes.some((Xe) => {
        var K;
        return ((K = Xe.action) == null ? void 0 : K.type) === "noprize";
      }) ? (t(13, P = "noprize"), t(35, T = { text: re, image: ce })) : (u === q.Assign && P === "gift" ? t(13, P = "success") : t(13, P = u === q.Reward ? "gift" : "success-draw"), t(35, T = {
        text: re,
        image: ce,
        bold: me
      })), t(14, V = ""), u !== q.Reward && ge();
    } else
      window.postMessage(
        {
          type: "PrizeGameResult",
          data: { error: !0 }
        },
        "*"
      ), t(13, P = "error"), t(12, E = !0), t(18, D = !1);
  }, he = (o) => ve(this, null, function* () {
    var C;
    if (!h || N)
      return;
    t(17, N = !0);
    const u = o === "Assign" ? q.Assign : q.Reject;
    try {
      const Q = yield ue(`/wof/draw/${h.program.id}`, {
        method: "PUT",
        body: JSON.stringify({ guid: Ae, action: u })
      });
      u === q.Assign ? ye(Q, q.Assign) : (t(12, E = !1), t(18, D = !1), yield ge(), ((C = h.current) == null ? void 0 : C.remainingTimes) === 0 && oe());
    } catch (Q) {
      window.postMessage(
        {
          type: "PrizeGameResult",
          data: { error: !0 }
        },
        "*"
      ), t(13, P = "error"), t(12, E = !0), t(17, N = !1), t(18, D = !1);
    }
  }), O = () => window.postMessage({ type: "BackToList" }, "*"), Y = () => window.postMessage({ type: "ClosePrizeEngineDrawer" }, "*"), S = (o) => o ? new Date(o).toISOString().replace("T", " ").substring(0, 19).replace(/-/g, "/") : "", Ce = (o) => {
    const { type: u, action: C } = o.data;
    u === "PrizeGameRequestDraw" ? U() : u === "PrizeResultAction" ? he(C) : u === "PrizeResultClose" ? (t(12, E = !1), t(18, D = !1), t(14, V = "")) : u === "PrizeGameToggleRules" ? t(19, Z = !Z) : u === "PrizeGameSpinEnd" && (t(12, E = !0), t(18, D = !1));
  };
  Ht(() => (W = setInterval(
    () => {
      t(36, j = Date.now());
    },
    6e4
  ), window.addEventListener("message", Ce), () => {
    window.removeEventListener("message", Ce), W && clearInterval(W);
  }));
  const Me = () => t(19, Z = !0), Re = () => t(19, Z = !1), He = () => t(14, V = ""), Qe = () => he("Assign"), Te = () => he("Reject"), z = () => t(14, V = "confirmReject"), ee = () => {
    var o;
    ((o = h == null ? void 0 : h.current) == null ? void 0 : o.remainingTimes) === 0 && ["success", "noprize", "success-draw"].includes(P) ? oe() : (t(12, E = !1), t(14, V = ""), window.postMessage({ type: "PrizeResultClose" }, "*"));
  };
  function ze(o) {
    Qt[o ? "unshift" : "push"](() => {
      J = o, t(11, J);
    });
  }
  return A.$$set = (o) => {
    "data" in o && t(32, p = o.data), "endpoint" in o && t(0, g = o.endpoint), "session" in o && t(1, v = o.session), "lang" in o && t(2, b = o.lang), "clientstyling" in o && t(3, y = o.clientstyling), "clientstylingurl" in o && t(4, B = o.clientstylingurl), "translationurl" in o && t(5, F = o.translationurl), "mbsource" in o && t(6, G = o.mbsource), "twostepdraw" in o && t(33, I = o.twostepdraw), "terms" in o && t(7, _ = o.terms), "luckywheelsize" in o && t(8, ie = o.luckywheelsize), "luckywheelmobilesize" in o && t(9, ae = o.luckywheelmobilesize), "programs" in o && t(34, $ = o.programs);
  }, A.$$.update = () => {
    var o, u, C, Q;
    if (A.$$.dirty[1] & /*data*/
    2)
      if (typeof p == "string")
        try {
          t(10, h = JSON.parse(p));
        } catch (w) {
          console.error("[PrizeDetails] Parse failed", w);
        }
      else
        t(10, h = p);
    A.$$.dirty[0] & /*activeGame*/
    1024 | A.$$.dirty[1] & /*now*/
    32 && t(23, n = (o = h == null ? void 0 : h.current) != null && o.expiryTime ? k(h.current.expiryTime, j) : ""), A.$$.dirty[0] & /*translationurl*/
    32 && F && be(F), A.$$.dirty[0] & /*lang*/
    4 && b && Zt(b), A.$$.dirty[0] & /*activeGame*/
    1024 && h != null && h.translations && Object.keys(h.translations).forEach((w) => {
      Se(w, h.translations[w]);
    }), A.$$.dirty[0] & /*clientstyling, rootContainer*/
    2056 && y && J && Tt(J, y), A.$$.dirty[0] & /*clientstylingurl, rootContainer*/
    2064 && B && J && zt(J, B), A.$$.dirty[0] & /*mbsource, rootContainer*/
    2112 && G && J && Dt(J, `${G}.Style`, oA), A.$$.dirty[0] & /*activeGame*/
    1024 && t(15, i = (u = h == null ? void 0 : h.program) == null ? void 0 : u.type), A.$$.dirty[0] & /*activeGame*/
    1024 && t(22, l = Number((Q = (C = h == null ? void 0 : h.program) == null ? void 0 : C.metadata) == null ? void 0 : Q.template) || 0), A.$$.dirty[0] & /*isMessageShown, internalMode, $_, messageMode*/
    94208 | A.$$.dirty[1] & /*messageValue*/
    16 && t(21, s = (() => {
      if (!E)
        return null;
      if (V === "confirmReject")
        return {
          key: "confirmReject",
          image: Ft,
          title: r("AreYouSure"),
          text: r("RejectWarningText")
        };
      switch (P) {
        case "error":
          return {
            key: "error",
            image: Et,
            title: r("DrawFailed")
          };
        case "noprize":
          return {
            key: "noprize",
            image: Jt,
            title: r("NoPrizeTitle"),
            text: (T == null ? void 0 : T.text) || r("NoPrize")
          };
        case "gift":
        case "success-draw":
          return {
            key: P,
            image: (T == null ? void 0 : T.image) || St,
            title: r("Congratulation"),
            text: (T == null ? void 0 : T.text) || r("Success", {
              values: { prize: (T == null ? void 0 : T.bold) || "" }
            })
          };
        case "success":
          return {
            key: "success",
            image: Ot,
            text: r("RewardIssued")
          };
        case "show-next":
          return {
            key: "show-next",
            text: r("ShowNext", {
              values: {
                startTime: T == null ? void 0 : T.startTime,
                name: T == null ? void 0 : T.name
              }
            })
          };
        case "no-next":
          return { key: "no-next", text: r("NoNext") };
        default:
          return null;
      }
    })()), A.$$.dirty[0] & /*$_, gameType, activeGame*/
    99328 && t(20, m = (() => {
      var re;
      let w = r("Play");
      return i === "wheelOfFortune" ? w = r("Spin") : i === "flipCoin" ? w = r("FlipCoin") : i === "mysteryChest" && (w = r("OpenChest")), {
        base: w,
        count: ((re = h == null ? void 0 : h.current) == null ? void 0 : re.remainingTimes) || 0
      };
    })());
  }, [
    g,
    v,
    b,
    y,
    B,
    F,
    G,
    _,
    ie,
    ae,
    h,
    J,
    E,
    P,
    V,
    i,
    r,
    N,
    D,
    Z,
    m,
    s,
    l,
    n,
    se,
    we,
    oe,
    U,
    he,
    O,
    Y,
    S,
    p,
    I,
    $,
    T,
    j,
    Me,
    Re,
    He,
    Qe,
    Te,
    z,
    ee,
    ze
  ];
}
class cA extends Bt {
  constructor(e) {
    super(), Ct(
      this,
      e,
      mA,
      aA,
      We,
      {
        data: 32,
        endpoint: 0,
        session: 1,
        lang: 2,
        clientstyling: 3,
        clientstylingurl: 4,
        translationurl: 5,
        mbsource: 6,
        twostepdraw: 33,
        terms: 7,
        luckywheelsize: 8,
        luckywheelmobilesize: 9,
        programs: 34
      },
      Gt,
      [-1, -1, -1]
    );
  }
  get data() {
    return this.$$.ctx[32];
  }
  set data(e) {
    this.$$set({ data: e }), te();
  }
  get endpoint() {
    return this.$$.ctx[0];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), te();
  }
  get session() {
    return this.$$.ctx[1];
  }
  set session(e) {
    this.$$set({ session: e }), te();
  }
  get lang() {
    return this.$$.ctx[2];
  }
  set lang(e) {
    this.$$set({ lang: e }), te();
  }
  get clientstyling() {
    return this.$$.ctx[3];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), te();
  }
  get clientstylingurl() {
    return this.$$.ctx[4];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), te();
  }
  get translationurl() {
    return this.$$.ctx[5];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), te();
  }
  get mbsource() {
    return this.$$.ctx[6];
  }
  set mbsource(e) {
    this.$$set({ mbsource: e }), te();
  }
  get twostepdraw() {
    return this.$$.ctx[33];
  }
  set twostepdraw(e) {
    this.$$set({ twostepdraw: e }), te();
  }
  get terms() {
    return this.$$.ctx[7];
  }
  set terms(e) {
    this.$$set({ terms: e }), te();
  }
  get luckywheelsize() {
    return this.$$.ctx[8];
  }
  set luckywheelsize(e) {
    this.$$set({ luckywheelsize: e }), te();
  }
  get luckywheelmobilesize() {
    return this.$$.ctx[9];
  }
  set luckywheelmobilesize(e) {
    this.$$set({ luckywheelmobilesize: e }), te();
  }
  get programs() {
    return this.$$.ctx[34];
  }
  set programs(e) {
    this.$$set({ programs: e }), te();
  }
}
customElements.define("prize-engine-details", Wt(cA, { data: {}, endpoint: {}, session: {}, lang: {}, clientstyling: {}, clientstylingurl: {}, translationurl: {}, mbsource: {}, twostepdraw: {}, terms: {}, luckywheelsize: {}, luckywheelmobilesize: {}, programs: {} }, [], [], !0));
export {
  cA as default
};
