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, Le = (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 we = (A, e, t) => new Promise((n, i) => {
  var l = (m) => {
    try {
      o(t.next(m));
    } catch (r) {
      i(r);
    }
  }, s = (m) => {
    try {
      o(t.throw(m));
    } catch (r) {
      i(r);
    }
  }, o = (m) => m.done ? n(m.value) : Promise.resolve(m.value).then(l, s);
  o((t = t.apply(A, e)).next());
});
import { $ as Ne, b as Bt, a as Ct, S as Mt, i as Rt, s as Pe, f as ie, c as Ht, n as Xe, d as M, H as Me, h as R, j as a, k as f, y as H, l as c, m as Qt, o as Tt, p as zt, I as mt, w as X, t as fe, J as ft, K as ut, L as ue, x as L, v as Je, e as Ee, g as Fe, B as Dt, q as Wt, M as dt, N as Ie, z as h, r as je, u as gt, O as ht, A as xe, P as Ge, C as Lt, D as Pt, E as It, F as jt, G as xt } from "./PrizeEngineSuite-S74tK2VQ.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 && (Ct.set(e), Ne.set(A));
  });
}
function Se(A, e) {
  Bt(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-AVo42VZz.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-aqYmcKcL.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-DyImGdI2.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) {
  Ht(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[9].program.name[
      /*lang*/
      A[2]
    ] || /*activeGame*/
    A[9].program.name["*"]) + ""
  ), o, m, r, u, v, b, w, B, F, G, P, U, se = (
    /*$_*/
    A[15]("Rules") + ""
  ), ce, $, d, J, le, E, I;
  function T(y, x) {
    if (
      /*gameType*/
      y[14] === "wheelOfFortune"
    )
      return Ut;
    if (
      /*gameType*/
      y[14] === "flipCoin"
    )
      return qt;
    if (
      /*gameType*/
      y[14] === "mysteryChest"
    )
      return Vt;
  }
  let N = T(A), D = N && N(A);
  function V(y, x) {
    return (
      /*gameType*/
      y[14] !== "wheelOfFortune" || /*themeIndex*/
      y[21] === 7 ? _t : Kt
    );
  }
  let Ae = V(A), Z = Ae(A), j = (
    /*displayExpiry*/
    A[23] && _e(A)
  ), W = (
    /*showRulesOverlay*/
    A[18] && $e(A)
  );
  return {
    c() {
      e = f("div"), t = f("div"), n = f("button"), i = H(), l = f("div"), o = L(s), m = H(), r = f("button"), u = H(), v = f("div"), b = f("div"), D && D.c(), w = H(), B = f("div"), Z.c(), F = H(), j && j.c(), G = H(), P = f("button"), U = f("span"), ce = L(se), $ = H(), d = f("span"), J = H(), W && W.c(), le = Je(), c(n, "type", "button"), c(n, "class", "IconButton Back svelte-1m851ap"), c(l, "class", "HeaderTitle svelte-1m851ap"), c(r, "type", "button"), c(r, "class", "IconButton Close svelte-1m851ap"), c(t, "class", "Header svelte-1m851ap"), c(b, "class", "GameComponentContainer svelte-1m851ap"), c(d, "class", "ChevronUp svelte-1m851ap"), c(P, "type", "button"), c(P, "class", "RulesToggle svelte-1m851ap"), c(B, "class", "InfoSection svelte-1m851ap"), c(v, "class", "ViewWrapper svelte-1m851ap"), c(e, "class", "ViewLayer GameLayer svelte-1m851ap"), fe(
        e,
        "Mobile",
        /*mobileView*/
        A[24]
      ), fe(
        e,
        "hidden",
        /*showRulesOverlay*/
        A[18] || /*isMessageShown*/
        A[11]
      );
    },
    m(y, x) {
      R(y, e, x), a(e, t), a(t, n), a(t, i), a(t, l), a(l, o), a(t, m), a(t, r), a(e, u), a(e, v), a(v, b), D && D.m(b, null), a(v, w), a(v, B), Z.m(B, null), a(B, F), j && j.m(B, null), a(B, G), a(B, P), a(P, U), a(U, ce), a(P, $), a(P, d), R(y, J, x), W && W.m(y, x), R(y, le, x), E || (I = [
        ue(
          n,
          "click",
          /*onBack*/
          A[29]
        ),
        ue(
          r,
          "click",
          /*onClose*/
          A[30]
        ),
        ue(
          P,
          "click",
          /*click_handler*/
          A[37]
        )
      ], E = !0);
    },
    p(y, x) {
      x[0] & /*activeGame, lang*/
      516 && s !== (s = /*activeGame*/
      (y[9].program.name[
        /*lang*/
        y[2]
      ] || /*activeGame*/
      y[9].program.name["*"]) + "") && X(o, s), N === (N = T(y)) && D ? D.p(y, x) : (D && D.d(1), D = N && N(y), D && (D.c(), D.m(b, null))), Ae === (Ae = V(y)) && Z ? Z.p(y, x) : (Z.d(1), Z = Ae(y), Z && (Z.c(), Z.m(B, F))), /*displayExpiry*/
      y[23] ? j ? j.p(y, x) : (j = _e(y), j.c(), j.m(B, G)) : j && (j.d(1), j = null), x[0] & /*$_*/
      32768 && se !== (se = /*$_*/
      y[15]("Rules") + "") && X(ce, se), x[0] & /*showRulesOverlay, isMessageShown*/
      264192 && fe(
        e,
        "hidden",
        /*showRulesOverlay*/
        y[18] || /*isMessageShown*/
        y[11]
      ), /*showRulesOverlay*/
      y[18] ? W ? (W.p(y, x), x[0] & /*showRulesOverlay*/
      262144 && Me(W, 1)) : (W = $e(y), W.c(), Me(W, 1), W.m(le.parentNode, le)) : W && (ht(), ft(W, 1, 1, () => {
        W = null;
      }), ut());
    },
    d(y) {
      y && (M(e), M(J), M(le)), D && D.d(), Z.d(), j && j.d(), W && W.d(y), E = !1, mt(I);
    }
  };
}
function Vt(A) {
  let e;
  return {
    c() {
      e = f("prize-engine-chest"), h(
        e,
        "data",
        /*activeGame*/
        A[9]
      ), h(
        e,
        "endpoint",
        /*endpoint*/
        A[0]
      ), h(
        e,
        "session",
        /*session*/
        A[1]
      ), h(
        e,
        "lang",
        /*lang*/
        A[2]
      ), h(
        e,
        "clientstyling",
        /*clientstyling*/
        A[3]
      ), h(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        A[4]
      ), h(
        e,
        "translationurl",
        /*translationurl*/
        A[5]
      ), h(
        e,
        "mbsource",
        /*mbsource*/
        A[6]
      ), h(e, "isdrawer", "false");
    },
    m(t, n) {
      R(t, e, n);
    },
    p(t, n) {
      n[0] & /*activeGame*/
      512 && h(
        e,
        "data",
        /*activeGame*/
        t[9]
      ), n[0] & /*endpoint*/
      1 && h(
        e,
        "endpoint",
        /*endpoint*/
        t[0]
      ), n[0] & /*session*/
      2 && h(
        e,
        "session",
        /*session*/
        t[1]
      ), n[0] & /*lang*/
      4 && h(
        e,
        "lang",
        /*lang*/
        t[2]
      ), n[0] & /*clientstyling*/
      8 && h(
        e,
        "clientstyling",
        /*clientstyling*/
        t[3]
      ), n[0] & /*clientstylingurl*/
      16 && h(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[4]
      ), n[0] & /*translationurl*/
      32 && h(
        e,
        "translationurl",
        /*translationurl*/
        t[5]
      ), n[0] & /*mbsource*/
      64 && h(
        e,
        "mbsource",
        /*mbsource*/
        t[6]
      );
    },
    d(t) {
      t && M(e);
    }
  };
}
function qt(A) {
  let e;
  return {
    c() {
      e = f("prize-engine-coin"), h(
        e,
        "data",
        /*activeGame*/
        A[9]
      ), h(
        e,
        "endpoint",
        /*endpoint*/
        A[0]
      ), h(
        e,
        "session",
        /*session*/
        A[1]
      ), h(
        e,
        "lang",
        /*lang*/
        A[2]
      ), h(
        e,
        "clientstyling",
        /*clientstyling*/
        A[3]
      ), h(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        A[4]
      ), h(
        e,
        "translationurl",
        /*translationurl*/
        A[5]
      ), h(
        e,
        "mbsource",
        /*mbsource*/
        A[6]
      ), h(e, "isdrawer", "false");
    },
    m(t, n) {
      R(t, e, n);
    },
    p(t, n) {
      n[0] & /*activeGame*/
      512 && h(
        e,
        "data",
        /*activeGame*/
        t[9]
      ), n[0] & /*endpoint*/
      1 && h(
        e,
        "endpoint",
        /*endpoint*/
        t[0]
      ), n[0] & /*session*/
      2 && h(
        e,
        "session",
        /*session*/
        t[1]
      ), n[0] & /*lang*/
      4 && h(
        e,
        "lang",
        /*lang*/
        t[2]
      ), n[0] & /*clientstyling*/
      8 && h(
        e,
        "clientstyling",
        /*clientstyling*/
        t[3]
      ), n[0] & /*clientstylingurl*/
      16 && h(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[4]
      ), n[0] & /*translationurl*/
      32 && h(
        e,
        "translationurl",
        /*translationurl*/
        t[5]
      ), n[0] & /*mbsource*/
      64 && h(
        e,
        "mbsource",
        /*mbsource*/
        t[6]
      );
    },
    d(t) {
      t && M(e);
    }
  };
}
function Ut(A) {
  let e;
  return {
    c() {
      e = f("prize-engine-luckywheel"), h(
        e,
        "data",
        /*activeGame*/
        A[9]
      ), h(
        e,
        "endpoint",
        /*endpoint*/
        A[0]
      ), h(
        e,
        "session",
        /*session*/
        A[1]
      ), h(
        e,
        "lang",
        /*lang*/
        A[2]
      ), h(
        e,
        "clientstyling",
        /*clientstyling*/
        A[3]
      ), h(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        A[4]
      ), h(
        e,
        "translationurl",
        /*translationurl*/
        A[5]
      ), h(
        e,
        "mbsource",
        /*mbsource*/
        A[6]
      ), h(
        e,
        "size",
        /*luckywheelsize*/
        A[7]
      ), h(
        e,
        "mobilesize",
        /*luckywheelmobilesize*/
        A[8]
      ), h(e, "isdrawer", "false");
    },
    m(t, n) {
      R(t, e, n);
    },
    p(t, n) {
      n[0] & /*activeGame*/
      512 && h(
        e,
        "data",
        /*activeGame*/
        t[9]
      ), n[0] & /*endpoint*/
      1 && h(
        e,
        "endpoint",
        /*endpoint*/
        t[0]
      ), n[0] & /*session*/
      2 && h(
        e,
        "session",
        /*session*/
        t[1]
      ), n[0] & /*lang*/
      4 && h(
        e,
        "lang",
        /*lang*/
        t[2]
      ), n[0] & /*clientstyling*/
      8 && h(
        e,
        "clientstyling",
        /*clientstyling*/
        t[3]
      ), n[0] & /*clientstylingurl*/
      16 && h(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[4]
      ), n[0] & /*translationurl*/
      32 && h(
        e,
        "translationurl",
        /*translationurl*/
        t[5]
      ), n[0] & /*mbsource*/
      64 && h(
        e,
        "mbsource",
        /*mbsource*/
        t[6]
      ), n[0] & /*luckywheelsize*/
      128 && h(
        e,
        "size",
        /*luckywheelsize*/
        t[7]
      ), n[0] & /*luckywheelmobilesize*/
      256 && h(
        e,
        "mobilesize",
        /*luckywheelmobilesize*/
        t[8]
      );
    },
    d(t) {
      t && M(e);
    }
  };
}
function Kt(A) {
  let e, t, n = (
    /*$_*/
    A[15]("RemainingTimes") + ""
  ), i, l, s, o, m, r, u = (
    /*activeGame*/
    A[9].current.remainingTimes + ""
  ), v;
  return {
    c() {
      e = f("div"), t = f("span"), i = L(n), l = L(":"), s = H(), o = f("span"), o.innerHTML = `<img src="${Yt}" alt="Key"/>`, m = H(), r = f("span"), v = L(u), c(o, "class", "SmallIcon svelte-1m851ap"), c(e, "class", "InfoItem svelte-1m851ap");
    },
    m(b, w) {
      R(b, e, w), a(e, t), a(t, i), a(t, l), a(e, s), a(e, o), a(e, m), a(e, r), a(r, v);
    },
    p(b, w) {
      w[0] & /*$_*/
      32768 && n !== (n = /*$_*/
      b[15]("RemainingTimes") + "") && X(i, n), w[0] & /*activeGame*/
      512 && u !== (u = /*activeGame*/
      b[9].current.remainingTimes + "") && X(v, u);
    },
    d(b) {
      b && M(e);
    }
  };
}
function _t(A) {
  let e, t, n = (
    /*buttonTextParts*/
    A[19].base + ""
  ), i, l, s, o, m, r = (
    /*buttonTextParts*/
    A[19].count + ""
  ), u, v, b, w;
  return {
    c() {
      var B;
      e = f("button"), t = f("span"), i = L(n), l = H(), s = f("span"), s.textContent = "×", o = H(), m = f("span"), u = L(r), c(t, "class", "ButtonBase svelte-1m851ap"), c(s, "class", "ButtonCross svelte-1m851ap"), c(m, "class", "ButtonCount svelte-1m851ap"), c(e, "type", "button"), c(e, "class", "ActionButton primary svelte-1m851ap"), e.disabled = v = /*isDrawing*/
      A[17] || !/*activeGame*/
      ((B = A[9].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, o), a(e, m), a(m, u), b || (w = ue(
        e,
        "click",
        /*performDraw*/
        A[27]
      ), b = !0);
    },
    p(B, F) {
      var G;
      F[0] & /*buttonTextParts*/
      524288 && n !== (n = /*buttonTextParts*/
      B[19].base + "") && X(i, n), F[0] & /*buttonTextParts*/
      524288 && r !== (r = /*buttonTextParts*/
      B[19].count + "") && X(u, r), F[0] & /*isDrawing, activeGame*/
      131584 && v !== (v = /*isDrawing*/
      B[17] || !/*activeGame*/
      ((G = B[9].current) != null && G.remainingTimes)) && (e.disabled = v);
    },
    d(B) {
      B && M(e), b = !1, w();
    }
  };
}
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, o) {
      R(s, e, o), a(e, t), a(e, n), a(e, i), a(i, l);
    },
    p(s, o) {
      o[0] & /*displayExpiry*/
      8388608 && X(
        l,
        /*displayExpiry*/
        s[23]
      );
    },
    d(s) {
      s && M(e);
    }
  };
}
function $e(A) {
  var Re, He, Qe, Te, ze, De;
  let e, t, n, i, l, s = (
    /*$_*/
    A[15]("Rules") + ""
  ), o, m, r, u, v, b, w = (
    /*$_*/
    A[15]("RulesDescription") + ""
  ), B, F, G, P, U, se, ce, $, d, J = (
    /*$_*/
    A[15]("AvailablePeriod") + ""
  ), le, E, I, T = (
    /*formatDateTime*/
    A[31](
      /*activeGame*/
      (Re = A[9].program.trigger) == null ? void 0 : Re.startTime
    ) + ""
  ), N, D, V = (
    /*formatDateTime*/
    A[31](
      /*activeGame*/
      (He = A[9].program.trigger) == null ? void 0 : He.endTime
    ) + ""
  ), Ae, Z, j, W, y, x, oe, be, ye = (
    /*$_*/
    A[15]("TopRewards") + ""
  ), q, de, ge, he, me, K, ke, ve, O = (
    /*effectiveTermsUrl*/
    A[22] && et(A)
  ), Y = (
    /*activeGame*/
    ((ze = (Te = (Qe = A[9]) == null ? void 0 : Qe.program) == null ? void 0 : Te.trigger) == null ? void 0 : ze.periods) && tt(A)
  ), S = (
    /*activeGame*/
    ((De = A[9].program.wheelOfFortune) == null ? void 0 : De.partitions) && nt(A)
  );
  return {
    c() {
      e = f("div"), t = f("div"), n = f("div"), i = H(), l = f("div"), o = L(s), m = H(), r = f("button"), u = H(), v = f("div"), b = f("div"), B = L(w), F = H(), O && O.c(), G = H(), P = f("div"), U = f("div"), se = f("span"), ce = H(), $ = f("div"), d = f("strong"), le = L(J), E = H(), I = f("span"), N = L(T), D = L(" ~ "), Ae = L(V), Z = H(), Y && Y.c(), j = H(), W = f("div"), y = f("span"), x = H(), oe = f("div"), be = f("strong"), q = L(ye), de = H(), ge = f("span"), S && S.c(), c(n, "class", "HeaderPlaceholder svelte-1m851ap"), c(l, "class", "HeaderTitle svelte-1m851ap"), c(r, "type", "button"), c(r, "class", "IconButton Close svelte-1m851ap"), c(t, "class", "Header svelte-1m851ap"), c(b, "class", "GameDescription svelte-1m851ap"), c(se, "class", "Icon History svelte-1m851ap"), c(d, "class", "svelte-1m851ap"), c(I, "class", "svelte-1m851ap"), c($, "class", "DetailText"), c(U, "class", "DetailItem svelte-1m851ap"), c(y, "class", "Icon Cup svelte-1m851ap"), c(be, "class", "svelte-1m851ap"), c(ge, "class", "RewardList svelte-1m851ap"), c(oe, "class", "DetailText"), c(W, "class", "DetailItem Rewards svelte-1m851ap"), c(P, "class", "DetailsGrid svelte-1m851ap"), c(v, "class", "LayerContent svelte-1m851ap"), c(e, "class", "ViewLayer RulesLayer svelte-1m851ap"), fe(
        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, o), a(t, m), a(t, r), a(e, u), a(e, v), a(v, b), a(b, B), a(v, F), O && O.m(v, null), a(v, G), a(v, P), a(P, U), a(U, se), a(U, ce), a(U, $), a($, d), a(d, le), a($, E), a($, I), a(I, N), a(I, D), a(I, Ae), a(P, Z), Y && Y.m(P, null), a(P, j), a(P, W), a(W, y), a(W, x), a(W, oe), a(oe, be), a(be, q), a(oe, de), a(oe, ge), S && S.m(ge, null), K = !0, ke || (ve = ue(
        r,
        "click",
        /*click_handler_1*/
        A[38]
      ), ke = !0);
    },
    p(z, ee) {
      var We, p, g, C, Q, k;
      (!K || ee[0] & /*$_*/
      32768) && s !== (s = /*$_*/
      z[15]("Rules") + "") && X(o, s), (!K || ee[0] & /*$_*/
      32768) && w !== (w = /*$_*/
      z[15]("RulesDescription") + "") && X(B, w), /*effectiveTermsUrl*/
      z[22] ? O ? O.p(z, ee) : (O = et(z), O.c(), O.m(v, G)) : O && (O.d(1), O = null), (!K || ee[0] & /*$_*/
      32768) && J !== (J = /*$_*/
      z[15]("AvailablePeriod") + "") && X(le, J), (!K || ee[0] & /*activeGame*/
      512) && T !== (T = /*formatDateTime*/
      z[31](
        /*activeGame*/
        (We = z[9].program.trigger) == null ? void 0 : We.startTime
      ) + "") && X(N, T), (!K || ee[0] & /*activeGame*/
      512) && V !== (V = /*formatDateTime*/
      z[31](
        /*activeGame*/
        (p = z[9].program.trigger) == null ? void 0 : p.endTime
      ) + "") && X(Ae, V), /*activeGame*/
      (Q = (C = (g = z[9]) == null ? void 0 : g.program) == null ? void 0 : C.trigger) != null && Q.periods ? Y ? Y.p(z, ee) : (Y = tt(z), Y.c(), Y.m(P, j)) : Y && (Y.d(1), Y = null), (!K || ee[0] & /*$_*/
      32768) && ye !== (ye = /*$_*/
      z[15]("TopRewards") + "") && X(q, ye), /*activeGame*/
      (k = z[9].program.wheelOfFortune) != null && k.partitions ? S ? S.p(z, ee) : (S = nt(z), S.c(), S.m(ge, null)) : S && (S.d(1), S = null);
    },
    i(z) {
      K || (z && Ee(() => {
        K && (me && me.end(1), he = Fe(e, Ie, { y: "100%", duration: 400 }), he.start());
      }), K = !0);
    },
    o(z) {
      he && he.invalidate(), z && (me = dt(e, Ie, { y: "100%", duration: 400 })), K = !1;
    },
    d(z) {
      z && M(e), O && O.d(), Y && Y.d(), S && S.d(), z && me && me.end(), ke = !1, ve();
    }
  };
}
function et(A) {
  let e, t, n = (
    /*$_*/
    A[15]("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",
        /*effectiveTermsUrl*/
        A[22]
      ), c(e, "target", "_blank");
    },
    m(o, m) {
      R(o, e, m), a(e, t), a(t, i), a(e, l), a(e, s);
    },
    p(o, m) {
      m[0] & /*$_*/
      32768 && n !== (n = /*$_*/
      o[15]("Terms") + "") && X(i, n), m[0] & /*effectiveTermsUrl*/
      4194304 && c(
        e,
        "href",
        /*effectiveTermsUrl*/
        o[22]
      );
    },
    d(o) {
      o && M(e);
    }
  };
}
function tt(A) {
  let e, t = je(
    /*activeGame*/
    A[9].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, $_*/
      33587712) {
        t = je(
          /*activeGame*/
          i[9].program.trigger.periods
        );
        let s;
        for (s = 0; s < t.length; s += 1) {
          const o = Ue(i, t, s);
          n[s] ? n[s].p(o, l) : (n[s] = At(o), 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), gt(n, i);
    }
  };
}
function At(A) {
  let e, t, n, i, l, s = (
    /*$_*/
    A[15]("Recurrence") + ""
  ), o, m, r, u = (
    /*getRecurrenceText*/
    A[25](
      /*period*/
      A[60]
    ) + ""
  ), v, b;
  return {
    c() {
      e = f("div"), t = f("span"), n = H(), i = f("div"), l = f("strong"), o = L(s), m = H(), r = f("span"), v = L(u), b = H(), c(t, "class", "Icon History svelte-1m851ap"), c(l, "class", "svelte-1m851ap"), c(r, "class", "svelte-1m851ap"), c(i, "class", "DetailText"), c(e, "class", "DetailItem svelte-1m851ap");
    },
    m(w, B) {
      R(w, e, B), a(e, t), a(e, n), a(e, i), a(i, l), a(l, o), a(i, m), a(i, r), a(r, v), a(e, b);
    },
    p(w, B) {
      B[0] & /*$_*/
      32768 && s !== (s = /*$_*/
      w[15]("Recurrence") + "") && X(o, s), B[0] & /*activeGame*/
      512 && u !== (u = /*getRecurrenceText*/
      w[25](
        /*period*/
        w[60]
      ) + "") && X(v, u);
    },
    d(w) {
      w && M(e);
    }
  };
}
function nt(A) {
  let e, t = je(
    /*activeGame*/
    A[9].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*/
      516) {
        t = je(
          /*activeGame*/
          i[9].program.wheelOfFortune.partitions
        );
        let s;
        for (s = 0; s < t.length; s += 1) {
          const o = qe(i, t, s);
          n[s] ? n[s].p(o, l) : (n[s] = it(o), 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), gt(n, i);
    }
  };
}
function $t(A) {
  let e, t;
  return {
    c() {
      e = f("img"), c(e, "class", "RewardIcon svelte-1m851ap"), xe(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*/
      516 && !xe(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*/
      516 && 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, o) {
    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, o) {
      R(s, e, o), l && l.m(e, null), a(e, t);
    },
    p(s, o) {
      i === (i = n(s)) && l ? l.p(s, o) : (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(o, m) {
    if (
      /*internalLoading*/
      o[16]
    )
      return AA;
    if (
      /*viewData*/
      o[20]
    )
      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(o, m) {
      R(o, e, m), a(e, t), s && s.m(t, null);
    },
    p(o, m) {
      l === (l = i(o)) && s ? s.p(o, m) : (s && s.d(1), s = l && l(o), s && (s.c(), s.m(t, null)));
    },
    i(o) {
      o && (n || Ee(() => {
        n = Fe(e, Dt, { duration: 250 }), n.start();
      }));
    },
    o: Xe,
    d(o) {
      o && M(e), s && s.d();
    }
  };
}
function tA(A) {
  let e, t = (
    /*viewData*/
    A[20].key
  ), n, i, l = ot(A);
  function s(r, u) {
    return (
      /*messageMode*/
      r[12] === "gift" ? iA : nA
    );
  }
  let o = s(A), m = o(A);
  return {
    c() {
      e = f("div"), l.c(), n = H(), i = f("div"), m.c(), c(e, "class", "ViewDataContainer svelte-1m851ap"), fe(
        e,
        "shifted",
        /*internalMode*/
        A[13] === "confirmReject"
      ), c(i, "class", "ButtonGroup svelte-1m851ap"), fe(
        i,
        "wide-buttons",
        /*internalMode*/
        A[13] === "confirmReject"
      );
    },
    m(r, u) {
      R(r, e, u), l.m(e, null), R(r, n, u), R(r, i, u), m.m(i, null);
    },
    p(r, u) {
      u[0] & /*viewData*/
      1048576 && Pe(t, t = /*viewData*/
      r[20].key) ? (ht(), ft(l, 1, 1, Xe), ut(), l = ot(r), l.c(), Me(l, 1), l.m(e, null)) : l.p(r, u), u[0] & /*internalMode*/
      8192 && fe(
        e,
        "shifted",
        /*internalMode*/
        r[13] === "confirmReject"
      ), o === (o = s(r)) && m ? m.p(r, u) : (m.d(1), m = o(r), m && (m.c(), m.m(i, null))), u[0] & /*internalMode*/
      8192 && fe(
        i,
        "wide-buttons",
        /*internalMode*/
        r[13] === "confirmReject"
      );
    },
    d(r) {
      r && (M(e), M(n), M(i)), l.d(r), m.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: Xe,
    d(t) {
      t && M(e);
    }
  };
}
function lt(A) {
  let e, t, n;
  return {
    c() {
      e = f("div"), t = f("img"), xe(t.src, n = /*viewData*/
      A[20].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*/
      1048576 && !xe(t.src, n = /*viewData*/
      i[20].image) && c(t, "src", n);
    },
    d(i) {
      i && M(e);
    }
  };
}
function rt(A) {
  let e, t = (
    /*viewData*/
    A[20].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*/
      1048576 && t !== (t = /*viewData*/
      n[20].title + "") && (e.innerHTML = t);
    },
    d(n) {
      n && M(e);
    }
  };
}
function at(A) {
  let e, t = (
    /*viewData*/
    A[20].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*/
      1048576 && t !== (t = /*viewData*/
      n[20].text + "") && (e.innerHTML = t);
    },
    d(n) {
      n && M(e);
    }
  };
}
function ot(A) {
  let e, t, n, i, l, s, o = (
    /*viewData*/
    A[20].image && lt(A)
  ), m = (
    /*viewData*/
    A[20].title && rt(A)
  ), r = (
    /*viewData*/
    A[20].text && at(A)
  );
  return {
    c() {
      e = f("div"), o && o.c(), t = H(), m && m.c(), n = H(), r && r.c(), c(e, "class", "ViewDataContent svelte-1m851ap");
    },
    m(u, v) {
      R(u, e, v), o && o.m(e, null), a(e, t), m && m.m(e, null), a(e, n), r && r.m(e, null), s = !0;
    },
    p(u, v) {
      A = u, /*viewData*/
      A[20].image ? o ? o.p(A, v) : (o = lt(A), o.c(), o.m(e, t)) : o && (o.d(1), o = null), /*viewData*/
      A[20].title ? m ? m.p(A, v) : (m = rt(A), m.c(), m.m(e, n)) : m && (m.d(1), m = null), /*viewData*/
      A[20].text ? r ? r.p(A, v) : (r = at(A), r.c(), r.m(e, null)) : r && (r.d(1), r = null);
    },
    i(u) {
      s || (u && Ee(() => {
        s && (l && l.end(1), i = Fe(e, Ie, {
          y: (
            /*internalMode*/
            A[13] === "confirmReject" ? 10 : -10
          ),
          duration: 300,
          delay: 100
        }), i.start());
      }), s = !0);
    },
    o(u) {
      i && i.invalidate(), u && (l = dt(e, Ie, {
        y: (
          /*internalMode*/
          A[13] === "confirmReject" ? -10 : 10
        ),
        duration: 150
      })), s = !1;
    },
    d(u) {
      u && M(e), o && o.d(), m && m.d(), r && r.d(), u && l && l.end();
    }
  };
}
function nA(A) {
  let e, t, n;
  function i(o, m) {
    return (
      /*messageMode*/
      o[12] === "success" ? rA : (
        /*messageMode*/
        o[12] === "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(o, m) {
      R(o, e, m), s.m(e, null), t || (n = ue(
        e,
        "click",
        /*click_handler_6*/
        A[43]
      ), t = !0);
    },
    p(o, m) {
      l === (l = i(o)) && s ? s.p(o, m) : (s.d(1), s = l(o), s && (s.c(), s.m(e, null)));
    },
    d(o) {
      o && M(e), s.d(), t = !1, n();
    }
  };
}
function iA(A) {
  let e, t, n = (
    /*internalMode*/
    A[13]
  ), i, l, s, o = (
    /*internalMode*/
    A[13]
  ), m, r, u = pt(A), v = ct(A);
  return {
    c() {
      e = f("button"), t = f("div"), u.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[16], c(s, "class", "ButtonTextWrapper svelte-1m851ap"), c(l, "type", "button"), c(l, "class", "ActionButton outline svelte-1m851ap"), l.disabled = /*internalLoading*/
      A[16];
    },
    m(b, w) {
      R(b, e, w), a(e, t), u.m(t, null), R(b, i, w), R(b, l, w), a(l, s), v.m(s, null), m || (r = [
        ue(e, "click", function() {
          Ge(
            /*internalMode*/
            A[13] === "confirmReject" ? (
              /*click_handler_2*/
              A[39]
            ) : (
              /*click_handler_3*/
              A[40]
            )
          ) && /*internalMode*/
          (A[13] === "confirmReject" ? (
            /*click_handler_2*/
            A[39]
          ) : (
            /*click_handler_3*/
            A[40]
          )).apply(this, arguments);
        }),
        ue(l, "click", function() {
          Ge(
            /*internalMode*/
            A[13] === "confirmReject" ? (
              /*click_handler_4*/
              A[41]
            ) : (
              /*click_handler_5*/
              A[42]
            )
          ) && /*internalMode*/
          (A[13] === "confirmReject" ? (
            /*click_handler_4*/
            A[41]
          ) : (
            /*click_handler_5*/
            A[42]
          )).apply(this, arguments);
        })
      ], m = !0);
    },
    p(b, w) {
      A = b, w[0] & /*internalMode*/
      8192 && Pe(n, n = /*internalMode*/
      A[13]) ? (u.d(1), u = pt(A), u.c(), u.m(t, null)) : u.p(A, w), w[0] & /*internalLoading*/
      65536 && (e.disabled = /*internalLoading*/
      A[16]), w[0] & /*internalMode*/
      8192 && Pe(o, o = /*internalMode*/
      A[13]) ? (v.d(1), v = ct(A), v.c(), v.m(s, null)) : v.p(A, w), w[0] & /*internalLoading*/
      65536 && (l.disabled = /*internalLoading*/
      A[16]);
    },
    d(b) {
      b && (M(e), M(i), M(l)), u.d(b), v.d(b), m = !1, mt(r);
    }
  };
}
function sA(A) {
  let e = (
    /*$_*/
    A[15]("OK") + ""
  ), t;
  return {
    c() {
      t = L(e);
    },
    m(n, i) {
      R(n, t, i);
    },
    p(n, i) {
      i[0] & /*$_*/
      32768 && e !== (e = /*$_*/
      n[15]("OK") + "") && X(t, e);
    },
    d(n) {
      n && M(t);
    }
  };
}
function lA(A) {
  let e = (
    /*$_*/
    A[15]("Continue") + ""
  ), t;
  return {
    c() {
      t = L(e);
    },
    m(n, i) {
      R(n, t, i);
    },
    p(n, i) {
      i[0] & /*$_*/
      32768 && e !== (e = /*$_*/
      n[15]("Continue") + "") && X(t, e);
    },
    d(n) {
      n && M(t);
    }
  };
}
function rA(A) {
  let e = (
    /*$_*/
    A[15]("BackToGame") + ""
  ), t;
  return {
    c() {
      t = L(e);
    },
    m(n, i) {
      R(n, t, i);
    },
    p(n, i) {
      i[0] & /*$_*/
      32768 && e !== (e = /*$_*/
      n[15]("BackToGame") + "") && X(t, e);
    },
    d(n) {
      n && M(t);
    }
  };
}
function pt(A) {
  let e, t = (
    /*internalMode*/
    (A[13] === "confirmReject" ? (
      /*$_*/
      A[15]("KeepPrize")
    ) : (
      /*$_*/
      A[15]("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, $_*/
      40960 && t !== (t = /*internalMode*/
      (i[13] === "confirmReject" ? (
        /*$_*/
        i[15]("KeepPrize")
      ) : (
        /*$_*/
        i[15]("Accept")
      )) + "") && X(n, t);
    },
    d(i) {
      i && M(e);
    }
  };
}
function ct(A) {
  let e, t = (
    /*internalMode*/
    (A[13] === "confirmReject" ? (
      /*$_*/
      A[15]("RejectPrize")
    ) : (
      /*$_*/
      A[15]("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, $_*/
      40960 && t !== (t = /*internalMode*/
      (i[13] === "confirmReject" ? (
        /*$_*/
        i[15]("RejectPrize")
      ) : (
        /*$_*/
        i[15]("Reject")
      )) + "") && X(n, t);
    },
    d(i) {
      i && M(e);
    }
  };
}
function aA(A) {
  let e, t, n = (
    /*activeGame*/
    A[9] && Ke(A)
  ), i = (
    /*isMessageShown*/
    A[11] && 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[9] ? n ? n.p(l, s) : (n = Ke(l), n.c(), n.m(e, t)) : n && (n.d(1), n = null), /*isMessageShown*/
      l[11] ? i ? (i.p(l, s), s[0] & /*isMessageShown*/
      2048 && Me(i, 1)) : (i = st(l), i.c(), Me(i, 1), i.m(e, null)) : i && (i.d(1), i = null);
    },
    i(l) {
      Me(i);
    },
    o: Xe,
    d(l) {
      l && M(e), n && n.d(), i && i.d(), A[44](null);
    }
  };
}
let oA = null;
function pA(A, e, t) {
  let n, i, l, s, o, m, r;
  Qt(A, xt, (p) => t(15, r = p));
  let { data: u = null } = e, { endpoint: v = "" } = e, { session: b = "" } = e, { lang: w = "en" } = e, { clientstyling: B = "" } = e, { clientstylingurl: F = "" } = e, { translationurl: G = "" } = e, { mbsource: P = "" } = e, { twostepdraw: U = "false" } = e, { luckywheelsize: se = 324 } = e, { luckywheelmobilesize: ce = 240 } = e, { programs: $ = [] } = e, d = null, J;
  const le = Tt(window.navigator.userAgent);
  let E = !1, I = "", T = null, N = !1, D = !1, V = "", Ae = "", Z = !1, j = Date.now(), W = null;
  const y = (p, g) => {
    if (!p)
      return "";
    const Q = new Date(p).getTime() - g;
    if (Q <= 0)
      return "00d:00h:00m";
    const k = Math.floor(Q / (1e3 * 60 * 60 * 24)), pe = Math.floor(Q % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), re = Math.floor(Q % (1e3 * 60 * 60) / (1e3 * 60));
    return `${k.toString().padStart(2, "0")}d:${pe.toString().padStart(2, "0")}h:${re.toString().padStart(2, "0")}m`;
  }, x = (p) => [
    "",
    r("Monday"),
    r("Tuesday"),
    r("Wednesday"),
    r("Thursday"),
    r("Friday"),
    r("Saturday"),
    r("Sunday")
  ][p] || "", oe = (p) => {
    const g = ["th", "st", "nd", "rd"], C = p % 100;
    return p + (g[(C - 20) % 10] || g[C] || g[0]);
  }, be = (p) => {
    if (!p)
      return "";
    const { recurrenceType: g, frequency: C, dayFrom: Q, dayTo: k, maxImplicitTickets: pe, startTime: re, endTime: ae } = p, te = pe || 0, Be = te > 1 ? r("Spins") : r("Spin");
    let _ = `${te} ${Be}`;
    const Ce = r("Every"), ne = C || 1;
    switch (g == null ? void 0 : g.toLowerCase()) {
      case "single":
        _ += ` ${r("InThisPeriod")}`;
        break;
      case "minute":
        const vt = ne > 1 ? r("Minutes") : r("Minute");
        _ += ` ${Ce} ${ne > 1 ? ne + " " : ""}${vt}`;
        break;
      case "day":
        const wt = ne > 1 ? r("Days") : r("Day");
        _ += ` ${Ce} ${ne > 1 ? ne + " " : ""}${wt}`;
        break;
      case "week":
        if (Q && k)
          Q === k ? _ += ` ${Ce} ${x(Q)}` : _ += ` ${r("From")} ${x(Q)} ${r("To")} ${x(k)} ${r("EveryWeek")}`;
        else {
          const Ze = ne > 1 ? r("Weeks") : r("Week");
          _ += ` ${Ce} ${ne > 1 ? ne + " " : ""}${Ze}`;
        }
        break;
      case "month":
        if (Q && k)
          Q === k ? _ += ` ${Ce} ${oe(Q)} ${r("EachMonth")}` : _ += ` ${r("From")} ${oe(Q)} ${r("To")} ${oe(k)} ${r("EachMonth")}`;
        else {
          const Ze = ne > 1 ? r("Months") : r("Month");
          _ += ` ${Ce} ${ne > 1 ? ne + " " : ""}${Ze}`;
        }
        break;
      default:
        _ += ` ${r("InThisPeriod")}`;
    }
    return `${_} [${S(re)} ~ ${S(ae)}]`;
  };
  Nt();
  const ye = (p) => we(this, null, function* () {
    try {
      const C = yield (yield fetch(p)).json();
      Object.keys(C).forEach((Q) => {
        Se(Q, C[Q]);
      });
    } catch (g) {
      console.error("[PrizeDetails] Failed to load translations", g);
    }
  });
  var q;
  (function(p) {
    p[p.Assign = 0] = "Assign", p[p.Reward = 1] = "Reward", p[p.Reject = 2] = "Reject";
  })(q || (q = {}));
  const de = (C, ...Q) => we(this, [C, ...Q], function* (p, g = {}) {
    const k = new URL(v + "/v1" + p);
    g.params && Object.keys(g.params).forEach((ae) => k.searchParams.append(ae, g.params[ae]));
    const re = yield (yield fetch(k.toString(), {
      method: g.method || "GET",
      headers: Le(Le({
        "Content-Type": "application/json",
        Accept: "text/plain"
      }, b ? { "x-SessionId": b } : {}), g.headers),
      body: g.body
    })).text();
    try {
      return JSON.parse(re);
    } catch (ae) {
      return re;
    }
  }), ge = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (p) => {
    const g = Math.random() * 16 | 0;
    return (p === "x" ? g : g & 3 | 8).toString(16);
  }), he = () => we(this, null, function* () {
    var C;
    if (!d)
      return;
    const p = yield de("/wof/remainingTimes", {
      params: {
        filter: `ProgramId[]=${d.program.id}`
      }
    });
    let g = 0;
    if (((C = p == null ? void 0 : p.items) == null ? void 0 : C.length) > 0) {
      const Q = p.items.find((k) => k.programId === d.program.id);
      Q && (g = +Q.remainingTimes || 0);
    }
    t(9, d.current.remainingTimes = g, d), t(9, d = Le({}, d)), t(32, u = JSON.stringify(d));
  }), me = () => we(this, null, function* () {
    if (!d)
      return;
    let p = $;
    if (!p || p.length === 0)
      try {
        const C = yield de("/wof/lotteries");
        p = (C == null ? void 0 : C.items) || [];
      } catch (C) {
        console.error("[PrizeDetails] Check next program failed", C);
      }
    const g = p == null ? void 0 : p.find((C) => C.program.id === d.program.id);
    g && g.current ? (t(12, I = "show-next"), t(35, T = {
      startTime: S(g.current.startTime),
      name: g.program.name[w] || g.program.name["*"]
    })) : t(12, I = "no-next"), t(11, E = !0);
  }), K = () => we(this, null, function* () {
    var p;
    if (!(!d || N || D || E) && ((p = d.current) == null ? void 0 : p.remainingTimes) !== 0) {
      Ae = ge(), t(16, N = !0), t(17, D = !0), t(18, Z = !1), window.postMessage({ type: "PrizeGameStartAnimation" }, "*");
      try {
        const g = U === "true" ? q.Reward : q.Assign, C = yield de(`/wof/draw/${d.program.id}`, {
          method: "PUT",
          body: JSON.stringify({ guid: Ae, action: g })
        });
        ke(C, g);
      } catch (g) {
        window.postMessage(
          {
            type: "PrizeGameResult",
            data: { error: !0 }
          },
          "*"
        ), t(12, I = "error"), t(11, E = !0), t(16, N = !1), t(17, D = !1);
      }
    }
  }), ke = (p, g) => {
    var C, Q;
    if (t(16, N = !1), ((C = p == null ? void 0 : p.item) == null ? void 0 : C.state) === "fulfilled" || ((Q = p == null ? void 0 : p.item) == null ? void 0 : Q.state) === "drawn") {
      window.postMessage({ type: "PrizeGameResult", data: p }, "*");
      const k = d.program.wheelOfFortune.partitions[p.item.result.wheelOfFortunePartitionIndex], pe = (k == null ? void 0 : k.prizeText[w]) || (k == null ? void 0 : k.prizeText["*"]) || "", re = (k == null ? void 0 : k.name[w]) || (k == null ? void 0 : k.name["*"]) || "", ae = (k == null ? void 0 : k.prizeImage[w]) || (k == null ? void 0 : k.prizeImage["*"]) || "";
      p.item.result.outcomes.some((Be) => {
        var _;
        return ((_ = Be.action) == null ? void 0 : _.type) === "noprize";
      }) ? (t(12, I = "noprize"), t(35, T = { text: pe, image: ae })) : (g === q.Assign && I === "gift" ? t(12, I = "success") : t(12, I = g === q.Reward ? "gift" : "success-draw"), t(35, T = {
        text: pe,
        image: ae,
        bold: re
      })), t(13, V = ""), g !== q.Reward && he();
    } else
      window.postMessage(
        {
          type: "PrizeGameResult",
          data: { error: !0 }
        },
        "*"
      ), t(12, I = "error"), t(11, E = !0), t(17, D = !1);
  }, ve = (p) => we(this, null, function* () {
    var C;
    if (!d || N)
      return;
    t(16, N = !0);
    const g = p === "Assign" ? q.Assign : q.Reject;
    try {
      const Q = yield de(`/wof/draw/${d.program.id}`, {
        method: "PUT",
        body: JSON.stringify({ guid: Ae, action: g })
      });
      g === q.Assign ? ke(Q, q.Assign) : (t(11, E = !1), t(17, D = !1), yield he(), ((C = d.current) == null ? void 0 : C.remainingTimes) === 0 && me());
    } catch (Q) {
      window.postMessage(
        {
          type: "PrizeGameResult",
          data: { error: !0 }
        },
        "*"
      ), t(12, I = "error"), t(11, E = !0), t(16, N = !1), t(17, D = !1);
    }
  }), O = () => window.postMessage({ type: "BackToList" }, "*"), Y = () => window.postMessage({ type: "ClosePrizeEngineDrawer" }, "*"), S = (p) => p ? new Date(p).toISOString().replace("T", " ").substring(0, 19).replace(/-/g, "/") : "", Re = (p) => {
    const { type: g, action: C } = p.data;
    g === "PrizeGameRequestDraw" ? K() : g === "PrizeResultAction" ? ve(C) : g === "PrizeResultClose" ? (t(11, E = !1), t(17, D = !1), t(13, V = "")) : g === "PrizeGameToggleRules" ? t(18, Z = !Z) : g === "PrizeGameSpinEnd" && (t(11, E = !0), t(17, D = !1));
  };
  zt(() => (W = setInterval(
    () => {
      t(36, j = Date.now());
    },
    6e4
  ), window.addEventListener("message", Re), () => {
    window.removeEventListener("message", Re), W && clearInterval(W);
  }));
  const He = () => t(18, Z = !0), Qe = () => t(18, Z = !1), Te = () => t(13, V = ""), ze = () => ve("Assign"), De = () => ve("Reject"), z = () => t(13, V = "confirmReject"), ee = () => {
    var p;
    ((p = d == null ? void 0 : d.current) == null ? void 0 : p.remainingTimes) === 0 && ["success", "noprize", "success-draw"].includes(I) ? me() : (t(11, E = !1), t(13, V = ""), window.postMessage({ type: "PrizeResultClose" }, "*"));
  };
  function We(p) {
    Wt[p ? "unshift" : "push"](() => {
      J = p, t(10, J);
    });
  }
  return A.$$set = (p) => {
    "data" in p && t(32, u = p.data), "endpoint" in p && t(0, v = p.endpoint), "session" in p && t(1, b = p.session), "lang" in p && t(2, w = p.lang), "clientstyling" in p && t(3, B = p.clientstyling), "clientstylingurl" in p && t(4, F = p.clientstylingurl), "translationurl" in p && t(5, G = p.translationurl), "mbsource" in p && t(6, P = p.mbsource), "twostepdraw" in p && t(33, U = p.twostepdraw), "luckywheelsize" in p && t(7, se = p.luckywheelsize), "luckywheelmobilesize" in p && t(8, ce = p.luckywheelmobilesize), "programs" in p && t(34, $ = p.programs);
  }, A.$$.update = () => {
    var p, g, C, Q, k, pe, re, ae;
    if (A.$$.dirty[1] & /*data*/
    2)
      if (typeof u == "string")
        try {
          t(9, d = JSON.parse(u));
        } catch (te) {
          console.error("[PrizeDetails] Parse failed", te);
        }
      else
        t(9, d = u);
    A.$$.dirty[0] & /*activeGame*/
    512 | A.$$.dirty[1] & /*now*/
    32 && t(23, n = (p = d == null ? void 0 : d.current) != null && p.expiryTime ? y(d.current.expiryTime, j) : ""), A.$$.dirty[0] & /*activeGame, lang*/
    516 && t(22, i = ((C = (g = d == null ? void 0 : d.program) == null ? void 0 : g.termsUrl) == null ? void 0 : C[w]) || ((k = (Q = d == null ? void 0 : d.program) == null ? void 0 : Q.termsUrl) == null ? void 0 : k["*"])), A.$$.dirty[0] & /*translationurl*/
    32 && G && ye(G), A.$$.dirty[0] & /*lang*/
    4 && w && Zt(w), A.$$.dirty[0] & /*activeGame*/
    512 && d != null && d.translations && Object.keys(d.translations).forEach((te) => {
      Se(te, d.translations[te]);
    }), A.$$.dirty[0] & /*clientstyling, rootContainer*/
    1032 && B && J && Lt(J, B), A.$$.dirty[0] & /*clientstylingurl, rootContainer*/
    1040 && F && J && Pt(J, F), A.$$.dirty[0] & /*mbsource, rootContainer*/
    1088 && P && J && It(J, `${P}.Style`, oA), A.$$.dirty[0] & /*activeGame*/
    512 && t(14, l = (pe = d == null ? void 0 : d.program) == null ? void 0 : pe.type), A.$$.dirty[0] & /*activeGame*/
    512 && t(21, s = Number((ae = (re = d == null ? void 0 : d.program) == null ? void 0 : re.metadata) == null ? void 0 : ae.template) || 0), A.$$.dirty[0] & /*isMessageShown, internalMode, $_, messageMode*/
    47104 | A.$$.dirty[1] & /*messageValue*/
    16 && t(20, o = (() => {
      if (!E)
        return null;
      if (V === "confirmReject")
        return {
          key: "confirmReject",
          image: Ft,
          title: r("AreYouSure"),
          text: r("RejectWarningText")
        };
      switch (I) {
        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: I,
            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*/
    49664 && t(19, m = (() => {
      var Be;
      let te = r("Play");
      return l === "wheelOfFortune" ? te = r("Spin") : l === "flipCoin" ? te = r("FlipCoin") : l === "mysteryChest" && (te = r("OpenChest")), {
        base: te,
        count: ((Be = d == null ? void 0 : d.current) == null ? void 0 : Be.remainingTimes) || 0
      };
    })());
  }, [
    v,
    b,
    w,
    B,
    F,
    G,
    P,
    se,
    ce,
    d,
    J,
    E,
    I,
    V,
    l,
    r,
    N,
    D,
    Z,
    m,
    o,
    s,
    i,
    n,
    le,
    be,
    me,
    K,
    ve,
    O,
    Y,
    S,
    u,
    U,
    $,
    T,
    j,
    He,
    Qe,
    Te,
    ze,
    De,
    z,
    ee,
    We
  ];
}
class cA extends Mt {
  constructor(e) {
    super(), Rt(
      this,
      e,
      pA,
      aA,
      Pe,
      {
        data: 32,
        endpoint: 0,
        session: 1,
        lang: 2,
        clientstyling: 3,
        clientstylingurl: 4,
        translationurl: 5,
        mbsource: 6,
        twostepdraw: 33,
        luckywheelsize: 7,
        luckywheelmobilesize: 8,
        programs: 34
      },
      Gt,
      [-1, -1, -1]
    );
  }
  get data() {
    return this.$$.ctx[32];
  }
  set data(e) {
    this.$$set({ data: e }), ie();
  }
  get endpoint() {
    return this.$$.ctx[0];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), ie();
  }
  get session() {
    return this.$$.ctx[1];
  }
  set session(e) {
    this.$$set({ session: e }), ie();
  }
  get lang() {
    return this.$$.ctx[2];
  }
  set lang(e) {
    this.$$set({ lang: e }), ie();
  }
  get clientstyling() {
    return this.$$.ctx[3];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), ie();
  }
  get clientstylingurl() {
    return this.$$.ctx[4];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), ie();
  }
  get translationurl() {
    return this.$$.ctx[5];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), ie();
  }
  get mbsource() {
    return this.$$.ctx[6];
  }
  set mbsource(e) {
    this.$$set({ mbsource: e }), ie();
  }
  get twostepdraw() {
    return this.$$.ctx[33];
  }
  set twostepdraw(e) {
    this.$$set({ twostepdraw: e }), ie();
  }
  get luckywheelsize() {
    return this.$$.ctx[7];
  }
  set luckywheelsize(e) {
    this.$$set({ luckywheelsize: e }), ie();
  }
  get luckywheelmobilesize() {
    return this.$$.ctx[8];
  }
  set luckywheelmobilesize(e) {
    this.$$set({ luckywheelmobilesize: e }), ie();
  }
  get programs() {
    return this.$$.ctx[34];
  }
  set programs(e) {
    this.$$set({ programs: e }), ie();
  }
}
customElements.define("prize-engine-details", jt(cA, { data: {}, endpoint: {}, session: {}, lang: {}, clientstyling: {}, clientstylingurl: {}, translationurl: {}, mbsource: {}, twostepdraw: {}, luckywheelsize: {}, luckywheelmobilesize: {}, programs: {} }, [], [], !0));
export {
  cA as default
};
