import{g as v}from"./params.af7ed354.js";let r=!1,n=null,d;const a=o=>{d(o,n,a)},W=(o,i,e,u,s,l,t,_,c)=>{let f=50,w=50;{const m=window.outerHeight;f=(window.innerWidth-e)/2,w=(m-50-u)/2}let p=`location=0,status=0,width=${e},height=${u},left=${f},top=${w}`;(i==="_blank"||i==="_self")&&(p=""),(!n||n.closed)&&(n=window.open(o,i,p)),n&&n.focus(),r=window.setInterval(()=>g(l,t,_,c),500),c&&(d=c,window.addEventListener("message",a,!1))},g=(o,i,e,u=!1)=>{if(u){if(!n){window.removeEventListener("message",a,!1),window.clearInterval(r),e();return}n.closed&&(n=null,window.removeEventListener("message",a,!1),window.clearInterval(r),e());return}let s={};try{s=v(n.location.search)}catch{}const l=[];if(o.forEach(t=>{if(s[t]!==void 0&&s[t]){l.push(!0);return}l.push(!1)}),l.every(t=>t))return window.clearInterval(r),i(s).then(()=>{n.close(),n=null,e(!0)});if(!n){window.clearInterval(r),e();return}n.closed&&(n=null,window.clearInterval(r),e())};export{W as p};
