{"version":3,"file":"penpal-CBrj43M5.mjs","names":[],"sources":["../src/penpal/index.ts"],"sourcesContent":["import { connect, type Methods, WindowMessenger } from \"penpal\";\n\ntype Options<TMethods> = {\n  window: Window;\n  methods: TMethods;\n};\n\nexport const connectToWindow = <TMethods extends Methods, TExposedMethods extends Methods = Methods>({\n  window,\n  methods,\n}: Options<TExposedMethods>) => {\n  const messenger = new WindowMessenger({\n    remoteWindow: window,\n    // Allow all origins since the iframe is loaded from a trusted source (baseUrl)\n    // The security boundary is the checkout_token, not the origin\n    allowedOrigins: [\"*\"],\n  });\n  return connect<TMethods>({ methods, messenger });\n};\n"],"mappings":";;;AAOA,MAAa,mBAAwF,EACnG,QACA,cAC8B;AAO9B,QAAO,QAAkB;EAAE;EAAS,WANlB,IAAI,gBAAgB;GACpC,cAAc;GAGd,gBAAgB,CAAC,IAAI;GACtB,CAAC;EAC6C,CAAC"}