import { ChildUtils as o } from "./accelbyte-widgets577.mjs";
import { Ctx as i } from "./accelbyte-widgets33.mjs";
import { z as n } from "zod";
const a = n.enum(["complete", "cancel", "requestData"]);
n.enum(["paymentSuccess", "paymentGenericError"]);
function m({ message: t, origin: r = "*" }) {
  const e = typeof t == "string" ? t : JSON.stringify(t);
  if (!(typeof t != "string" && !a.options.includes(t.action))) {
    if (!o.isInIframe()) {
      i.getAppState().paymentMethodManager.setPaymentStationMessage(e);
      return;
    }
    window.parent.postMessage(e, r);
  }
}
export {
  a as PAYMENT_STATION_ACTION,
  m as sendMessageToParentWindow
};
