!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).StreamA=e()}(this,(function(){"use strict";const t=function(){let t;function e(){let t=new Object("Singleton");return t.uuid=function(){let t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){let n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:7&n|8).toString(16)}))}(),t}return{getInstance:function(){return t||(t=e()),t}}}();return class{constructor(t=!1,e=""){if(console.log("streamA"),t)this.url="http://"+e+"/stream/";else{const t=(new Date).getSeconds();this.url=t<=20?"https://analysis.qn32.com/stream/":"https://analyzesa.qn32.com/stream/"}this.infoObj,this.data="",this.timer,this.timerDelay=55e3,this.uuid="",this.debug=t,this.isSend=!1,this.version="240410",this.xhttp=new XMLHttpRequest}send(e){if(null!=e&&""!=e.streamname){e.project.toUpperCase();var n=this,i=null==e.player||""==e.player?"H5":e.player,s=null==e.time||""==e.time?0:e.time,o=window.location.hostname,h=null==e.uid||""==e.uid?"none":e.uid,r=`${window.screen.width}x${window.screen.height}:${null==window.orientation?0:window.orientation}:${window.devicePixelRatio}`;this.uuid=""==this.uuid?t.getInstance().uuid:this.uuid,this.data="project="+e.project+"&",this.data+="streamname="+e.streamname+"&",this.data+="cdn="+e.cdn+"&",this.data+="player="+i+"&",this.data+="time="+s+"&",this.data+="domain="+o+"&",this.data+="device="+this.bEncrypt(r)+"&",this.data+="uid="+h,this.isSend||(this.doSend(),this.timer=setInterval((function(){n.doSend()}),this.timerDelay),this.isSend=!0)}else console.log("Invalid Paramer!!!")}doSend(){const t=this.url+this.uuid+"?"+this.data;fetch(t)}stop(){clearInterval(this.timer),this.isSend=!1,this.uuid=""}bEncrypt(t){let e="gogokey",n="";for(let i=0;i