window.cashierAPI = {}, cashierAPI.payout = function (t = {}) {
  const {
    authCode: e,
    paramsStr: o,
    payMethod: a
  } = t, r = {
    "Credit Card": "/pay/credit",
    ApplePay: "/applePay"
  }[a] || "/pay/localPay";
  let n = o ? function (t) {
    const e = {};
    return t.split("&").forEach((t => {
      const o = t.split("=");
      e[o[0]] = e[o[1]]
    })), e
  }(o) : {
    authCode: e,
    payMethod: a
  };
  n = "?ps=" + function (t, e, o) {
    if ("string" != typeof t || "number" != typeof e || "number" != typeof o) return;
    let a = [];
    o = o <= 25 ? o : o % 25;
    for (let r = 0; r < t.length; r++) {
      let n = t.charCodeAt(r);
      n = 1 * n ^ e, n = n.toString(o), a.push(n)
    }
    let r = String.fromCharCode(o + 97);
    return a.join(r)
  }(`${n.authCode}-${n.payMethod}`, 123, 64), location.href = "https://cashier1.uat.photontech.cc" + r + n
};
