"use strict";(()=>{var b,a=null,f,v,d,t,n="",o,i="";do d=Math.random().toString(36).slice(2),n=`overlay_${d}`,i=`iframe_${d}`,t=document.getElementById(n),o=document.getElementById(i);while(t!=null||o!=null);t=document.createElement("div");t.id=n;o=document.createElement("iframe");o.id=i;t.appendChild(o);var s=document.createElement("style");s.type="text/css";var h=()=>{t.remove(),s.remove(),document.body.style.overflow="auto"},T=(r,e={})=>{if(a==null){a=new Promise((x,C)=>{f=x,v=C}),b=r;let l=e?.z1??"600",c=e?.z1??"800",g=e?.width??"600px",m=e?.height??"800px",p=e?.coverColor??"rgba(0, 0, 0, 0.8)",u=e?.border??"0px",y=e?.borderRadius??"0px",w=e?.borderShadow??"0px",P=e?.loadingPage1??"https://3ds2.pagway.com.br/loading/1.html",R=e?.loadingPage2??"https://3ds2.pagway.com.br/loading/2.html",S={...e,z1:l,z2:c,width:g,height:m,coverColor:p,border:u,borderRadius:y,borderShadow:w,loadingPage1:P,loadingPage2:R},E=r?.homologacao??!1?"https://hml-3ds2.pagway.com.br/lyra":"https://3ds2.pagway.com.br/lyra",$=new URLSearchParams(S).toString();o.src=`${E}?${$}`,s.innerHTML=`#${n}{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:${p};z-index:${l};display:flex;justify-content:center;align-items:center}#${i}{border:0px;min-width:${g};min-height:${m};background-color:white;text-align:center;z-index:${c};border:${u};border-radius:${y};box-shadow:${w}}`,document.head.appendChild(s),document.body.appendChild(t),document.body.style.overflow="hidden"}return a};window.addEventListener("message",r=>{switch(r.data.type){case"IFRAME_READY":o.contentWindow!=null&&o.contentWindow.postMessage(JSON.stringify({eventName:"SDK_TRANSACTION_DATA",value:b}),"*");break;case"CLOSE_SUCCESS":h(),f({ok:!0});break;case"CLOSE_FAIL":a=null,h(),v({ok:!1});break}});window.pagwaylyra=T;})();