import { S as Ae, b as Oe, s as Te, f as b, c as Me, n as J, e as C, J as O, l as S, o as y, q as P, v as Z, K as X, L as Be, C as D, p as A, z as Le, m as k, A as R, x as qe, y as xe, E as Fe } from "./CashierConfirmModal-untxGhsx.js";
import { a as Ie, i as ze, $ as Ee, b as Ue } from "./CashierError-Cns-3PNq.js";
import { d as Q, u as Re, x as He } from "./CashierMethodDetails-7JZYjPuV.js";
function $(t, i) {
  Ie(t, i);
}
function je(t) {
  ze({
    fallbackLocale: "en"
  }), Ee.set(t);
}
const ee = {
  en: {
    "verification.video.how-to": "How to verify yourself",
    "verification.idenfy.referred-awaiting": "ID verification is in progress. We will inform you as soon as verification is completed and you can withdraw money back",
    "verification.message.failed": "We apologize, but we were unable to verify your account. Please contact support team",
    "verification.idenfy.link-name": "link",
    "verification.idenfy.in-progress": "To withdraw funds to your account you are required to pass user verification. Please have your ID ready and follow the {link} to start verification",
    "verification.shuftipro.in-progress.Biometric": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification.",
    "verification.shuftipro.in-progress.Biometric.Documents": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification and {Documents} verification.",
    "verification.shuftipro.in-progress.Biometric.Documents.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification, {Documents} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.Biometric.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.Documents": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Documents} verification.",
    "verification.shuftipro.in-progress.Documents.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Documents} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {ProofOfAddress} verification.",
    "verification.shuftipro.link-name.Biometric": "Biometric",
    "verification.shuftipro.link-name.Documents": "Documents",
    "verification.shuftipro.link-name.ProofOfAddress": "Proof Of Address",
    "verification.shuftipro.validations-started": "After completing verification, please proceed with the transaction"
  },
  tr: {
    "verification.video.how-to": "Kimlik doğrulama nasıl yapılır",
    "verification.idenfy.referred-awaiting": "Kimlik doğrulaması işlemde. Doğrulama tamamlandığında size haber vereceğiz",
    "verification.message.failed": "Döküman doğrulama başarısız, hesabınız doğrulanamadı",
    "verification.idenfy.link-name": "link",
    "verification.idenfy.in-progress": "Hesabınızdan çekim yapabilmek için kullanıcı doğrulaması gerekiyor. Lütfen kimliğinizi hazır edin ve {link} adresinden doğrulamayı başlatın",
    "verification.shuftipro.in-progress.Biometric": "İşlemi gerçekleştirmek için kullanıcı doğrulamasını geçmeniz gerekmektedir. Doğrulamayı başlatmak için Lütfen linke tıklayın {Biometric}",
    "verification.shuftipro.in-progress.Biometric.Documents": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification and {Documents} verification.",
    "verification.shuftipro.in-progress.Biometric.Documents.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification, {Documents} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.Biometric.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.Documents": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Documents} verification.",
    "verification.shuftipro.in-progress.Documents.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Documents} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {ProofOfAddress} verification.",
    "verification.shuftipro.link-name.Biometric": "Doğrulama Yap",
    "verification.shuftipro.link-name.Documents": "Documents",
    "verification.shuftipro.link-name.ProofOfAddress": "Proof Of Address",
    "verification.shuftipro.validations-started": "Lütfen Doğrulamayı tamamladıktan sonra işleme devam ediniz"
  },
  hr: {
    "verification.video.how-to": "How to verify yourself",
    "verification.idenfy.referred-awaiting": "ID verification is in progress. We will inform you as soon as verification is completed and you can withdraw money back",
    "verification.message.failed": "We apologize, but we were unable to verify your account. Please contact support team",
    "verification.idenfy.link-name": "link",
    "verification.idenfy.in-progress": "To withdraw funds to your account you are required to pass user verification. Please have your ID ready and follow the {link} to start verification",
    "verification.shuftipro.in-progress.Biometric": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification.",
    "verification.shuftipro.in-progress.Biometric.Documents": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification and {Documents} verification.",
    "verification.shuftipro.in-progress.Biometric.Documents.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification, {Documents} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.Biometric.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.Documents": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Documents} verification.",
    "verification.shuftipro.in-progress.Documents.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Documents} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {ProofOfAddress} verification.",
    "verification.shuftipro.link-name.Biometric": "Biometric",
    "verification.shuftipro.link-name.Documents": "Documents",
    "verification.shuftipro.link-name.ProofOfAddress": "Proof Of Address",
    "verification.shuftipro.validations-started": "After completing verification, please proceed with the transaction"
  }
};
if (typeof window < "u") {
  let t = function(i) {
    return function(...r) {
      try {
        return i.apply(this, r);
      } catch (s) {
        if (s instanceof DOMException && s.message.includes("has already been used with this registry") || s.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw s;
      }
    };
  };
  customElements.define = t(customElements.define), import("./CashierVideoModal-CVDvqrcy.js").then(({ default: i }) => {
    !customElements.get("cashier-video-modal") && customElements.define("cashier-video-modal", i.element);
  });
}
function Ne(t) {
  Me(t, "svelte-1emynn4", "*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;-webkit-tap-highlight-color:transparent}.CashierVerifications{box-shadow:0 0 4px var(--mmw--color-black-transparency-10, rgba(0, 0, 0, 0.1))}.CashierVerifications.CashierVerificationsDesktop{border-radius:var(--mmw--border-radius-medium-plus, 6px);overflow:hidden}.CashierVerifications.CashierVerificationsDesktop:has(.CashierVerificationMessage){margin-bottom:var(--emw--spacing-small, 12px)}.CashierVerificationsWrapper{display:flex;flex-direction:column;width:100%}.IconVerification{width:30px;display:flex}.CashierVerificationMessage{display:flex;align-items:center;box-sizing:border-box;background:var(--emw--color-gray-50, #F7F8FA);border-bottom:1px solid var(--mmw--color-grey-105, #E8E9EB);padding:0 var(--emw--spacing-small, 12px);transition:0.5s;max-height:500px}.CashierVerificationMessage:first-child{transition:none;cursor:pointer}.CashierVerificationMessage:first-child:hover{background:linear-gradient(0, var(--emw--color-gray-50, #F7F8FA) 0%, var(--emw--color-white, #fff) 100%)}.CashierVerificationMessage:not(.ShowAll):not(:first-child){max-height:0;overflow:hidden}.CashierVerificationMessage:hover .CashierVerificationChevron svg path{opacity:1}svg{height:20px}svg .IconColor{fill:var(--emw--color-warning, #ec9109)}p{color:var(--mmw--color-grey-10, #111);font-size:var(--emw--font-size-small, 14px);font-family:inherit;line-height:120%;margin:var(--emw--spacing-small, 12px)}.CashierVerificationsDesktop p{font-size:var(--emw--font-size-medium, 16px)}.text{word-break:break-word}.CashierVerificationChevron{cursor:pointer;margin-left:auto}.CashierVerificationChevron svg{transition:0.25s}.CashierVerificationChevron svg path{fill:var(--mmw--color-grey-290, #666);opacity:0.5}.CashierVerificationChevron:hover svg path{opacity:1}.ShowAll .CashierVerificationChevron svg{-o-transform:rotate(180deg);-ms-transform:rotate(180deg);-moz-transform:rotate(180deg);-webkit-transform:rotate(180deg);transform:rotate(180deg)}.CashierVerificationVideo{display:flex;width:100%;align-items:center;box-sizing:border-box;background:var(--emw--color-gray-50, #F7F8FA);border-bottom:1px solid var(--mmw--color-grey-105, #E8E9EB);padding:0 var(--emw--spacing-small, 12px);transition:0.5s;max-height:500px}.IconVideo{width:30px;display:flex;justify-content:center}.CashierVerificationVideoLink{cursor:pointer;color:var(--mmw--color-grey-10, #111);font-family:inherit;font-size:var(--emw--font-size-small, 14px);line-height:120%;margin:var(--emw--spacing-small, 12px);text-decoration:underline}.CashierVerificationVideoLinkDesktop{font-size:var(--emw--font-size-medium, 16px)}");
}
function ie(t, i, r) {
  const s = t.slice();
  return s[51] = i[r], s[53] = r, s;
}
function te(t) {
  let i, r, s, c, d = X(
    /*displayMessages*/
    t[4]
  ), f = [];
  for (let a = 0; a < d.length; a += 1)
    f[a] = oe(ie(t, d, a));
  let h = (
    /*videoExists*/
    t[7] && ne(t)
  );
  return {
    c() {
      i = y("div");
      for (let a = 0; a < f.length; a += 1)
        f[a].c();
      r = A(), h && h.c(), s = A(), c = y("cashier-video-modal"), P(i, "class", "CashierVerificationsWrapper"), D(
        c,
        "clientstylingurl",
        /*clientstylingurl*/
        t[1]
      ), D(
        c,
        "clientstyling",
        /*clientstyling*/
        t[0]
      ), D(
        c,
        "ismobileview",
        /*ismobileview*/
        t[2]
      ), D(
        c,
        "videosrc",
        /*videoSrc*/
        t[8]
      );
    },
    m(a, u) {
      S(a, i, u);
      for (let n = 0; n < f.length; n += 1)
        f[n] && f[n].m(i, null);
      S(a, r, u), h && h.m(a, u), S(a, s, u), S(a, c, u);
    },
    p(a, u) {
      if (u[0] & /*allVerificationsVisible, showAllVerifications, displayMessages*/
      1072) {
        d = X(
          /*displayMessages*/
          a[4]
        );
        let n;
        for (n = 0; n < d.length; n += 1) {
          const V = ie(a, d, n);
          f[n] ? f[n].p(V, u) : (f[n] = oe(V), f[n].c(), f[n].m(i, null));
        }
        for (; n < f.length; n += 1)
          f[n].d(1);
        f.length = d.length;
      }
      /*videoExists*/
      a[7] ? h ? h.p(a, u) : (h = ne(a), h.c(), h.m(s.parentNode, s)) : h && (h.d(1), h = null), u[0] & /*clientstylingurl*/
      2 && D(
        c,
        "clientstylingurl",
        /*clientstylingurl*/
        a[1]
      ), u[0] & /*clientstyling*/
      1 && D(
        c,
        "clientstyling",
        /*clientstyling*/
        a[0]
      ), u[0] & /*ismobileview*/
      4 && D(
        c,
        "ismobileview",
        /*ismobileview*/
        a[2]
      ), u[0] & /*videoSrc*/
      256 && D(
        c,
        "videosrc",
        /*videoSrc*/
        a[8]
      );
    },
    d(a) {
      a && (C(i), C(r), C(s), C(c)), Be(f, a), h && h.d(a);
    }
  };
}
function re(t) {
  let i, r, s;
  function c(...d) {
    return (
      /*click_handler*/
      t[18](
        /*index*/
        t[53],
        ...d
      )
    );
  }
  return {
    c() {
      i = y("span"), i.innerHTML = '<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1ZM8.70711 9.79289C8.31658 9.40237 7.68342 9.40237 7.29289 9.79289C6.90237 10.1834 6.90237 10.8166 7.29289 11.2071L11.2929 15.2071C11.6834 15.5976 12.3166 15.5976 12.7071 15.2071L16.7071 11.2071C17.0976 10.8166 17.0976 10.1834 16.7071 9.79289C16.3166 9.40237 15.6834 9.40237 15.2929 9.79289L12 13.0858L8.70711 9.79289Z" fill="#000000"></path></svg>', P(i, "class", "CashierVerificationChevron");
    },
    m(d, f) {
      S(d, i, f), r || (s = R(i, "click", c), r = !0);
    },
    p(d, f) {
      t = d;
    },
    d(d) {
      d && C(i), r = !1, s();
    }
  };
}
function oe(t) {
  let i, r, s, c, d = (
    /*message*/
    t[51] + ""
  ), f, h, a, u, n = (
    /*displayMessages*/
    t[4].length > 1 && /*index*/
    t[53] === 0 && re(t)
  );
  function V(...g) {
    return (
      /*click_handler_1*/
      t[19](
        /*index*/
        t[53],
        ...g
      )
    );
  }
  return {
    c() {
      i = y("div"), r = y("div"), r.innerHTML = '<svg width="64px" height="64px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><path d="M4.39254 16.2614C2.64803 13.1941 1.66074 9.71783 1.51646 6.15051C1.50127 5.77507 1.70918 5.42812 2.04153 5.25282L11.5335 0.246091C11.8254 0.0920859 12.1746 0.0920859 12.4665 0.246091L21.9585 5.25282C22.2908 5.42812 22.4987 5.77507 22.4835 6.15051C22.3393 9.71783 21.352 13.1941 19.6075 16.2614C17.8618 19.3307 15.4169 21.8869 12.4986 23.7001C12.1931 23.8899 11.8069 23.8899 11.5014 23.7001C8.58313 21.8869 6.13817 19.3307 4.39254 16.2614Z" fill="#fa9200"></path><path d="M8.25 12.75L11.25 15L17.25 9" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></g></svg>', s = A(), c = y("p"), f = A(), n && n.c(), h = A(), P(r, "class", "IconVerification"), P(c, "class", "text"), P(i, "class", "CashierVerificationMessage"), O(
        i,
        "ShowAll",
        /*allVerificationsVisible*/
        t[5]
      );
    },
    m(g, p) {
      S(g, i, p), k(i, r), k(i, s), k(i, c), c.innerHTML = d, k(i, f), n && n.m(i, null), k(i, h), a || (u = R(i, "click", V), a = !0);
    },
    p(g, p) {
      t = g, p[0] & /*displayMessages*/
      16 && d !== (d = /*message*/
      t[51] + "") && (c.innerHTML = d), /*displayMessages*/
      t[4].length > 1 && /*index*/
      t[53] === 0 ? n ? n.p(t, p) : (n = re(t), n.c(), n.m(i, h)) : n && (n.d(1), n = null), p[0] & /*allVerificationsVisible*/
      32 && O(
        i,
        "ShowAll",
        /*allVerificationsVisible*/
        t[5]
      );
    },
    d(g) {
      g && C(i), n && n.d(), a = !1, u();
    }
  };
}
function ne(t) {
  let i, r, s, c, d = (
    /*$_*/
    t[9]("verification.video.how-to") + ""
  ), f, h, a;
  return {
    c() {
      i = y("div"), r = y("div"), r.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516 17.561-9.845 28.324-16.541 28.324-29.579 0-17.246-21.999-28.693-39.784-28.693-23.189 0-33.894 10.977-48.942 29.969-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8zM298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42 18.841-42 42-42 42 18.841 42 42z"></path></svg>', s = A(), c = y("div"), f = xe(d), P(r, "class", "IconVideo"), P(c, "class", "CashierVerificationVideoLink"), O(
        c,
        "CashierVerificationVideoLinkDesktop",
        /*desktopView*/
        t[6]
      ), P(i, "class", "CashierVerificationVideo");
    },
    m(u, n) {
      S(u, i, n), k(i, r), k(i, s), k(i, c), k(c, f), h || (a = R(
        c,
        "click",
        /*click_handler_2*/
        t[20]
      ), h = !0);
    },
    p(u, n) {
      n[0] & /*$_*/
      512 && d !== (d = /*$_*/
      u[9]("verification.video.how-to") + "") && qe(f, d), n[0] & /*desktopView*/
      64 && O(
        c,
        "CashierVerificationVideoLinkDesktop",
        /*desktopView*/
        u[6]
      );
    },
    d(u) {
      u && C(i), h = !1, a();
    }
  };
}
function Ke(t) {
  let i, r = (
    /*displayMessages*/
    t[4] && te(t)
  );
  return {
    c() {
      i = y("div"), r && r.c(), P(i, "class", "CashierVerifications"), O(
        i,
        "CashierVerificationsDesktop",
        /*desktopView*/
        t[6]
      );
    },
    m(s, c) {
      S(s, i, c), r && r.m(i, null), t[21](i);
    },
    p(s, c) {
      /*displayMessages*/
      s[4] ? r ? r.p(s, c) : (r = te(s), r.c(), r.m(i, null)) : r && (r.d(1), r = null), c[0] & /*desktopView*/
      64 && O(
        i,
        "CashierVerificationsDesktop",
        /*desktopView*/
        s[6]
      );
    },
    i: J,
    o: J,
    d(s) {
      s && C(i), r && r.d(), t[21](null);
    }
  };
}
const We = "verification_explanation_video_widgets.MP4";
function Ye(t, i, r) {
  let s, c;
  Z(t, Ue, (e) => r(9, s = e)), Z(t, He, (e) => r(27, c = e)), Q.extend(Re);
  let { endpoint: d } = i, { lang: f = "en" } = i, { translationurl: h = "" } = i, { clientstyling: a = "" } = i, { clientstylingurl: u = "" } = i, { session: n = "" } = i, { customerid: V = "" } = i, { ismobileview: g = "" } = i, p, H = /* @__PURE__ */ new Set(), j = /* @__PURE__ */ new Set(), B, L, q, x = !0, N = !0, F = !1, I = "";
  var T;
  (function(e) {
    e.Manual = "Manual", e.ShuftiPro = "ShuftiPro";
  })(T || (T = {}));
  var z;
  (function(e) {
    e.Requested = "Requested";
  })(z || (z = {}));
  var m;
  (function(e) {
    e.Unknown = "Unknown", e.Unverified = "Unverified", e.InProgress = "InProgress", e.Failed = "Failed", e.Verified = "Verified", e.Referred = "Referred", e.True = "True", e.False = "False", e.AwaitingForResponse = "AwaitingForResponse";
  })(m || (m = {}));
  var M;
  (function(e) {
    e.Unknown = "Unknown", e.Documents = "Documents", e.Age = "Age", e.Pep = "Pep", e.Sanction = "Sanction", e.Aml = "Aml", e.ProofOfAddress = "ProofOfAddress", e.SourceOfWealth = "SourceOfWealth", e.SocialMedia = "SocialMedia", e.Biometric = "Biometric";
  })(M || (M = {}));
  const se = [
    m.InProgress,
    m.Referred,
    m.AwaitingForResponse
  ], ae = () => {
    let e = h;
    if (e)
      return fetch(e).then((o) => o.json()).then((o) => {
        Object.keys(o).forEach((l) => {
          $(l, o[l]);
        });
      }).catch((o) => {
        console.log(o);
      });
  };
  Object.keys(ee).forEach((e) => {
    $(e, ee[e]);
  });
  const le = () => {
    je(f);
  }, ce = () => {
    let e = document.createElement("style");
    e.innerHTML = a, p.appendChild(e);
  }, fe = () => {
    let e = new URL(u), o = document.createElement("style");
    fetch(e.href).then((l) => l.text()).then((l) => {
      o.innerHTML = l, setTimeout(
        () => {
          p.appendChild(o);
        },
        1
      );
    });
  }, K = () => {
    const { merchantId: e, customerId: o } = ue();
    if (!e)
      return;
    const l = new URL(`${d}/v1/player/verification/GetKYCStatus`), v = new Headers();
    v.append("accept", "application/json"), v.append("Content-Type", "application/json"), v.append("X-Client-Request-Timestamp", Q.utc().format("YYYY-MM-DD HH:mm:ss.SSS"));
    const U = {
      method: "POST",
      headers: v,
      body: JSON.stringify({
        MerchantId: e,
        CustomerId: o,
        All: !1,
        AllParameters: !1
      })
    };
    fetch(l, U).then((_) => _.json()).then((_) => {
      r(17, L = _.StaticCdnUrl + "/cashier/operator-assets/" + e), B = he(_.Verifications), B.VerificationStatuses.forEach((w) => {
        w.VerificationUrlType !== "Widget" && H.add(w.Vendor);
      }), r(4, q = Y());
    });
  }, de = () => {
    c && K();
  }, ue = () => {
    let e = (n || c).split(".")[1];
    if (e) {
      let o = JSON.parse(atob(e));
      return {
        merchantId: o?.mid,
        customerId: `${o?.mid}~${V}`
      };
    }
    return { merchantId: null, customerId: null };
  }, he = (e) => {
    if (!e || !e.length)
      return {
        VerificationSummaryStatus: m.Unverified,
        VerificationStatuses: []
      };
    const o = pe(e);
    if (o && o.length) {
      const l = me(o);
      return {
        VerificationSummaryStatus: l.Status,
        VerificationUrl: l.Flags?.DeferredUrlKey,
        VerificationStatuses: W(o, l.Status)
      };
    } else
      return {
        VerificationSummaryStatus: e.some((v) => v.Status === m.Failed) ? m.Failed : m.Verified,
        VerificationStatuses: W(e, [m.Failed])
      };
  }, me = (e) => e.reduce(
    (o, l) => o ? new Date(o) < new Date(l) ? l : o : l,
    0
  ), W = (e, o) => e.filter((l) => o.includes(l.Status)).map((l) => ({
    Type: l.Type,
    Vendor: l.VendorName,
    VerificationDocuments: l.Documents ? [...Object.values(l.Documents)] : [],
    VerificationUrlType: l.Flags?.DeferredUrlTypeKey,
    VerificationUrl: l.Flags?.DeferredUrlKey
  })), pe = (e) => e.filter((o) => se.includes(o.Status) ? o.Flags && o.Flags.DeferredUrlKey || ge(o) || ve(o) : !1), ge = (e) => {
    const o = e.Documents && e.VendorName === T.Manual, l = Object.values(e.Documents).some((v) => v.Status === z.Requested);
    return o && l;
  }, ve = (e) => e.VendorName === T.ShuftiPro && e.Status === m.Referred, Y = () => {
    switch (B.VerificationSummaryStatus) {
      case m.InProgress:
        const e = [];
        return H.forEach((o) => {
          e.push(we(o));
        }), e;
      case m.Referred:
        return [s("verification.idenfy.referred-awaiting")];
      case m.Failed:
        return [s("verification.message.failed")];
    }
  }, we = (e) => {
    const o = B.VerificationStatuses.filter((l) => l.Vendor === e);
    if (e === T.ShuftiPro)
      return ye(o);
    {
      const l = s("verification.idenfy.link-name"), v = {
        link: `<a href="${o[0].VerificationUrl}" target="_blank">${l}</a>`
      };
      return s("verification.idenfy.in-progress", { values: v });
    }
  }, ye = (e) => {
    const o = [], l = {}, v = [
      M.Biometric,
      M.Documents,
      M.ProofOfAddress
    ];
    e.forEach((w) => {
      v.includes(w.Type) && (o.push(w.Type), l[w.Type] = ke(w, Pe(w.Type)));
    });
    let U = o.every((w) => j.has(w)), _ = `verification.shuftipro.in-progress.${o.sort().join(".")}`;
    return U ? s("verification.shuftipro.validations-started") : s(_, { values: l });
  }, ke = (e, o) => `<a class="verificationLink ${e.Type}" href=" ${e.VerificationUrl} " target="_blank">${o}</a>`, Pe = (e) => s(`verification.shuftipro.link-name.${e}`), E = (e, o) => {
    if (e.stopPropagation(), e.target && (e.target.href || e.target.closest("a"))) {
      if (e.target.closest(".verificationLink")) {
        const l = e.target.className.split(" ")[1];
        j.add(l), r(4, q = Y());
      }
      return;
    }
    o === 0 && r(5, x = !x);
  }, Ve = () => {
    r(6, N = g === "false");
  }, be = () => {
    r(8, I = L + "/" + f + "/" + We);
    try {
      fetch(I, { method: "HEAD" }).then((e) => {
        r(7, F = e.ok);
      });
    } catch {
      r(7, F = !1);
    }
  }, G = () => {
    window.postMessage({ type: "ShowCashierVideoModal" }, window.location.href);
  }, De = (e, o) => E(o, e), Ce = (e, o) => E(o, e), Se = () => G();
  function _e(e) {
    Le[e ? "unshift" : "push"](() => {
      p = e, r(3, p);
    });
  }
  return t.$$set = (e) => {
    "endpoint" in e && r(12, d = e.endpoint), "lang" in e && r(13, f = e.lang), "translationurl" in e && r(14, h = e.translationurl), "clientstyling" in e && r(0, a = e.clientstyling), "clientstylingurl" in e && r(1, u = e.clientstylingurl), "session" in e && r(15, n = e.session), "customerid" in e && r(16, V = e.customerid), "ismobileview" in e && r(2, g = e.ismobileview);
  }, t.$$.update = () => {
    t.$$.dirty[0] & /*lang*/
    8192 && f && le(), t.$$.dirty[0] & /*endpoint, session*/
    36864 && d && n && K(), t.$$.dirty[0] & /*endpoint, session*/
    36864 && d && !n && de(), t.$$.dirty[0] & /*translationurl*/
    16384 && h && ae(), t.$$.dirty[0] & /*clientstyling, customStylingContainer*/
    9 && a && p && ce(), t.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
    10 && u && p && fe(), t.$$.dirty[0] & /*ismobileview*/
    4 && g && Ve(), t.$$.dirty[0] & /*staticCdnUrl*/
    131072 && L && be();
  }, [
    a,
    u,
    g,
    p,
    q,
    x,
    N,
    F,
    I,
    s,
    E,
    G,
    d,
    f,
    h,
    n,
    V,
    L,
    De,
    Ce,
    Se,
    _e
  ];
}
class Ge extends Ae {
  constructor(i) {
    super(), Oe(
      this,
      i,
      Ye,
      Ke,
      Te,
      {
        endpoint: 12,
        lang: 13,
        translationurl: 14,
        clientstyling: 0,
        clientstylingurl: 1,
        session: 15,
        customerid: 16,
        ismobileview: 2
      },
      Ne,
      [-1, -1]
    );
  }
  get endpoint() {
    return this.$$.ctx[12];
  }
  set endpoint(i) {
    this.$$set({ endpoint: i }), b();
  }
  get lang() {
    return this.$$.ctx[13];
  }
  set lang(i) {
    this.$$set({ lang: i }), b();
  }
  get translationurl() {
    return this.$$.ctx[14];
  }
  set translationurl(i) {
    this.$$set({ translationurl: i }), b();
  }
  get clientstyling() {
    return this.$$.ctx[0];
  }
  set clientstyling(i) {
    this.$$set({ clientstyling: i }), b();
  }
  get clientstylingurl() {
    return this.$$.ctx[1];
  }
  set clientstylingurl(i) {
    this.$$set({ clientstylingurl: i }), b();
  }
  get session() {
    return this.$$.ctx[15];
  }
  set session(i) {
    this.$$set({ session: i }), b();
  }
  get customerid() {
    return this.$$.ctx[16];
  }
  set customerid(i) {
    this.$$set({ customerid: i }), b();
  }
  get ismobileview() {
    return this.$$.ctx[2];
  }
  set ismobileview(i) {
    this.$$set({ ismobileview: i }), b();
  }
}
Fe(Ge, { endpoint: {}, lang: {}, translationurl: {}, clientstyling: {}, clientstylingurl: {}, session: {}, customerid: {}, ismobileview: {} }, [], [], !0);
export {
  Ge as default
};
