You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.9 MiB
48 lines
1.9 MiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-pipei-shipin-detail"],{"0111":function(e,t,i){"use strict";i("6a54");var r=i("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("c1a3"),i("bf0f"),i("18f7"),i("de6c"),i("4626"),i("fd3c"),i("2797");var n,o=r(i("2634")),s=r(i("9b1b")),a=r(i("2fdc")),c=r(i("80b1")),u=r(i("efe5")),l=i("44ca"),d=i("3436"),h=i("d154"),p=i("ab3c");n=l.ZegoExpressEngine;var f=function(){function e(t,i){(0,c.default)(this,e),this.zegoWebRTC=new n(t,i||"test"),e._instance=this,this.channelData=new Map,this.beautyEnable=!1,this.beautyParams=null,this.cameraConfig={},this.zegoWebRTC.setDebugVerbose(!1),e.rangeAudioInstance=this.zegoWebRTC.createRangeAudioInstance()}return(0,u.default)(e,[{key:"getStreamByChannel",value:function(){var e=(0,a.default)((0,o.default)().mark((function e(t){var i,r,n,a;return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=this.channelData.get(t||0)||new Map,r=i.get("stream"),r){e.next=11;break}return n=i.get("streamConfig"),null!==n&&void 0!==n&&n.camera&&(n.camera=(0,s.default)((0,s.default)({},n.camera),this.cameraConfig)),e.next=7,this.zegoWebRTC.createStream(n);case 7:r=e.sent,a=this.channelData.get(t||0)||new Map,a.set("stream",r),this.channelData.set(t||0,a);case 11:return e.abrupt("return",r);case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"on",value:function(e,t){if(["roomStreamExtraInfoUpdate","apiCalledResult","roomOnlineUserCountUpdate","publisherRenderVideoFirstFrame","publisherCapturedAudioFirstFrame","publisherCapturedVideoFirstFrame","playerRecvAudioFirstFrame","playerRecvVideoFirstFrame","playerRenderVideoFirstFrame","publisherVideoSizeChanged","playerVideoSizeChanged","publisherRelayCDNStateUpdate","playerMediaEvent","mixerRelayCDNStateUpdate","mixerSoundLevelUpdate","autoMixerSoundLevelUpdate","mediaPlayerStateUpdate","mediaPlayerNetworkEvent","mediaPlayerPlayingProgress","remoteSpeakerStateUpdate","audioRouteChange"].includes(e))return(0,p.isNotSupported)(e);var i,r=this.changeEventName(e);switch(e){case"publisherQualityUpdate":i=function(e,i){var r,n=i.video,o=i.audio,a=n.videoPacketsLostRate+o.audioPacketsLostRate?(n.videoPacketsLost+o.audioPacketsLost)/(n.videoPacketsLost/n.videoPacketsLostRate+o.audioPacketsLost/o.audioPacketsLostRate):0;r=(0,s.default)((0,s.default)({},i),{},{videoSendFPS:n.videoTransferFPS,rtt:i.totalRoundTripTime,videoKBPS:n.videoBitrate,audioKBPS:o.audioBitrate,audioSendFPS:o.audioFPS,packetLostRate:a}),t(e,r)};break;case"playerQualityUpdate":i=function(e,i){var r,n=i.video,o=i.audio,a=n.videoPacketsLostRate+o.audioPacketsLostRate?(n.videoPacketsLost+o.audioPacketsLost)/(n.videoPacketsLost/n.videoPacketsLostRate+o.audioPacketsLost/o.audioPacketsLostRate):0;r=(0,s.default)((0,s.default)({},i),{},{videoKBPS:n.videoBitrate,rtt:i.totalRoundTripTime,videoRecvFPS:n.videoFPS,audioKBPS:o.audioBitrate,audioRecvFPS:o.audioFPS,packetLostRate:a,audioDejitterFPS:o.audioJitter,videoDejitterFPS:n.videoJitter}),t(e,r)};break;case"roomUserUpdate":i=function(e,i,r){t(e,"ADD"==i?0:1,r)};case"roomStreamUpdate":i=function(e,i,r,n){t(e,"ADD"==i?0:1,r,n&&(0,p.formatObjString)(n))};break;case"roomStateUpdate":i=function(e,i,r,n){var o=d.ZegoRoomState.DisConnected;switch(i){case"LOGINING":case"RECONNECTING":o=d.ZegoRoomState.Connecting;break;case"LOGINED":case"RECONNECTED":o=d.ZegoRoomState.Connected;break}t(e,o,r,n&&(0,p.formatObjString)(n))};break;case"publisherStateUpdate":case"playerStateUpdate":i=function(e){var i,r,n;switch(i=e.streamID,r=e.state,e.state){case"PUBLISH_REQUESTING":r=d.ZegoPublisherState.PublishRequesting;break;case"NO_PUBLISH":r=d.ZegoPublisherState.NoPublish;break;case"PUBLISHING":r=d.ZegoPublisherState.Publishing;break;case"PLAY_REQUESTING":r=d.ZegoPlayerState.PlayRequesting;break;case"PLAYING":r=d.ZegoPlayerState.Playing;break;case"NO_PLAY":r=d.ZegoPlayerState.NoPlay}n=e.errorCode,t(i,r,n,e.extendedData&&(0,p.formatObjString)(e.extendedData))};break;case"remoteCameraStateUpdate":i=function(e,i){t(e,"OPEN"===i?0:10)};break;case"roomTokenWillExpire":i=function(e){t(e,30)};break;default:i=t}return this.zegoWebRTC.on(r,i)}},{key:"off",value:function(e,t){return this.zegoWebRTC.off(this.changeEventName(e),t)}},{key:"changeEventName",value:function(e){var t;switch(t=e,e){case"roomStateUpdate":t="roomStateChanged";break;case"roomTokenWillExpire":t="tokenWillExpire";break;case"roomStreamExtraInfoUpdate":t="streamExtraInfoUpdate";break;case"publisherQualityUpdate":t="publishQualityUpdate";break;case"playerQualityUpdate":t="playQualityUpdate";break;case"capturedSoundLevelInfoUpdate":t="capturedSoundLevelUpdate";break;case"remoteSoundLevelInfoUpdate":t="SoundLevelUpdate";break;case"localDeviceExceptionOccurred":t="deviceError";break;case"remoteCameraStateUpdate":t="remoteCameraStatusUpdate";break}return t}},{key:"uploadLog",value:function(){return(0,p.isNotSupported)("uploadLog")}},{key:"callExperimentalAPI",value:function(){return(0,p.isNotSupported)("callExperimentalAPI")}},{key:"setDummyCaptureImagePath",value:function(){var e=(0,a.default)((0,o.default)().mark((function e(t,i){var r;return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.getStreamByChannel(i);case 2:return r=e.sent,e.abrupt("return",this.zegoWebRTC.setDummyCaptureImagePath(t,r));case 4:case"end":return e.stop()}}),e,this)})));return function(t,i){return e.apply(this,arguments)}}()},{key:"loginRoom",value:function(e,t,i){var r,n=i||{},o=n.token,s=n.isUserStatusNotify;return r={},i&&(r.userUpdate=s),this.zegoWebRTC.loginRoom(e,o||"",t,r)}},{key:"logoutRoom",value:function(e){return(0,p.getPromiseInstance)(this.zegoWebRTC.logoutRoom(e))}},{key:"switchRoom",value:function(){return(0,p.isNotSupported)("switchRoom")}},{key:"renewToken",value:function(e,t){return(0,p.getPromiseInstance)(this.zegoWebRTC.renewToken(t,e))}},{key:"setRoomExtraInfo",value:function(e,t,i){return this.zegoWebRTC.setRoomExtraInfo(e,t,i)}},{key:"sendBroadcastMessage",value:function(e,t){return this.zegoWebRTC.sendBroadcastMessage(e,t)}},{key:"sendBarrageMessage",value:function(e,t){return this.zegoWebRTC.sendBarrageMessage(e,t)}},{key:"sendCustomCommand",value:function(e,t,i){var r=null===i||void 0===i?void 0:i.map((function(e){return null===e||void 0===e?void 0:e.userID}));return this.zegoWebRTC.sendCustomCommand(e,t,r||[])}},{key:"startPublishingStream",value:function(){var e=(0,a.default)((0,o.default)().mark((function e(t,i,r){var n,s,a;return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=i||0,e.next=3,this.getStreamByChannel(i);case 3:if(n=e.sent,s=this.channelData.get(i)||new Map,s.set("publisConfig",r),s.set("streamID",t),s.set("stopPub",!1),this.channelData.set(i,s),!this.beautyEnable){e.next=12;break}return e.next=12,this.zegoWebRTC.setEffectsBeauty(n,this.beautyEnable,this.beautyParams||{});case 12:return r=Object.assign(r||{},this.publishOption||{}),e.next=15,(0,p.getPromiseInstance)(this.zegoWebRTC.startPublishingStream(t,n,r));case 15:if(a=e.sent,!0!==a){e.next=18;break}return e.abrupt("return",(0,p.getPromiseInstance)(n));case 18:return e.abrupt("return",(0,p.getPromiseInstance)(a));case 19:case"end":return e.stop()}}),e,this)})));return function(t,i,r){return e.apply(this,arguments)}}()},{key:"stopPublishingStream",value:function(e){var t=this.channelData.get(e||0),i=null===t||void 0===t?void 0:t.get("streamID");return null===t||void 0===t||t.set("stopPub",!0),this.channelData.set(e||0,null),t&&t.get("stopPre")&&this.zegoWebRTC.destroyStream(t.get("stream")),(0,p.getPromiseInstance)(this.zegoWebRTC.stopPublishingStream(i))}},{key:"startPreview",value:function(){var e=(0,a.default)((0,o.default)().mark((function e(t,i){var r,n;return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",console.warn("the startPreview must be have a target Element"));case 2:return r=this.channelData.get(i||0)||new Map,e.next=5,this.getStreamByChannel(i);case 5:if(n=e.sent,!this.beautyEnable){e.next=9;break}return e.next=9,this.zegoWebRTC.setEffectsBeauty(n,this.beautyEnable,this.beautyParams||{});case 9:t.srcObject=n,r.set("stopPre",!1),r.set("previewVideoElem",t),this.channelData.set(i||0,r);case 13:case"end":return e.stop()}}),e,this)})));return function(t,i){return e.apply(this,arguments)}}()},{key:"stopPreview",value:function(e){var t=this;return new Promise((function(i){var r,n=(null===(r=t.channelData)||void 0===r?void 0:r.get(e||0))||new Map;n.set("stopPre",!0);var o=null===n||void 0===n?void 0:n.get("previewVideoElem");o&&(o.srcObject=null,null===n||void 0===n||n.delete("previewVideoElem")),t.channelData.set(e||0,n),n&&n.get("stopPub")&&t.zegoWebRTC.destroyStream(n.get("stream")),i()}))}},{key:"setVideoConfig",value:function(){var e=(0,a.default)((0,o.default)().mark((function e(t,i){var r,n,a,c,u;return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("number"===typeof t?(n=[{bitrate:300,width:320,height:180},{bitrate:400,width:480,height:270},{bitrate:600,width:640,height:360},{bitrate:1200,width:960,height:540},{bitrate:1500,width:1280,height:720},{bitrate:3e3,width:1920,height:1080}],r=(0,s.default)({frameRate:15},n[t])):r={width:t.captureWidth,height:t.captureHeight,frameRate:t.fps,maxBitrate:t.bitrate,bitrate:t.bitrate},i=i||0,a=this.channelData.get(i)||new Map,c=a.get("streamConfig")||{},void 0!==t.codecID&&(this.publishOption=this.publishOption||{},this.publishOption.videoCodec=2==t.codecID?"VP8":"H264"),a.set("videoConfig",{config:t,webConfig:r}),!c.screen){e.next=11;break}return c.screen=(0,s.default)((0,s.default)({},r),{},{videoQuality:4}),a.set("streamConfig",c),this.channelData.set(i,a),e.abrupt("return",(0,p.getPromiseInstance)({errorCode:0,extendedData:""}));case 11:return this.channelData.set(i,a),e.next=14,this.getStreamByChannel(i);case 14:return u=e.sent,e.abrupt("return",this.zegoWebRTC.setVideoConfig(u,r));case 16:case"end":return e.stop()}}),e,this)})));return function(t,i){return e.apply(this,arguments)}}()},{key:"getVideoConfig",value:function(e){var t,i,r;return(0,p.getPromiseInstance)(null===(t=this.channelData)||void 0===t||null===(i=t.get(e||0))||void 0===i||null===(r=i.get("videoConfig"))||void 0===r?void 0:r.config)}},{key:"setVideoMirrorMode",value:function(){return(0,p.isNotSupported)("setVideoMirrorMode")}},{key:"setAppOrientation",value:function(){return(0,p.isNotSupported)("setAppOrientation")}},{key:"mutePublishStreamAudio",value:function(){var e=(0,a.default)((0,o.default)().mark((function e(t,i){var r;return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.getStreamByChannel(i);case 2:return r=e.sent,e.abrupt("return",this.zegoWebRTC.mutePublishStreamAudio(r,t));case 4:case"end":return e.stop()}}),e,this)})));return function(t,i){return e.apply(this,arguments)}}()},{key:"mutePublishStreamVideo",value:function(){var e=(0,a.default)((0,o.default)().mark((function e(t,i){var r;return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.getStreamByChannel(i);case 2:return r=e.sent,e.abrupt("return",this.zegoWebRTC.mutePublishStreamVideo(r,t));case 4:case"end":return e.stop()}}),e,this)})));return function(t,i){return e.apply(this,arguments)}}()},{key:"enableTrafficControl",value:function(){return(0,p.isNotSupported)("enableTrafficControl")}},{key:"setMinVideoBitrateForTrafficControl",value:function(){return(0,p.isNotSupported)("setMinVideoBitrateForTrafficControl")}},{key:"setCaptureVolume",value:function(e){var t,i,r=(null===(t=this.channelData.get(0))||void 0===t?void 0:t.get("stream"))||(null===(i=this.channelData.get(1))||void 0===i?void 0:i.get("stream"));return this.zegoWebRTC.setCaptureVolume(r,e)}},{key:"enableHardwareEncoder",value:function(){return(0,p.isNotSupported)("enableHardwareEncoder")}},{key:"addPublishCdnUrl",value:function(e,t){return this.zegoWebRTC.addPublishCdnUrl(t,e)}},{key:"removePublishCdnUrl",value:function(e,t){return this.zegoWebRTC.removePublishCdnUrl(t,e)}},{key:"enablePublishDirectToCDN",value:function(){return(0,p.isNotSupported)("enablePublishDirectToCDN")}},{key:"startPlayingStream",value:function(e,t){return(0,p.getPromiseInstance)(this.zegoWebRTC.startPlayingStream(e,t))}},{key:"stopPlayingStream",value:function(e){return(0,p.getPromiseInstance)(this.zegoWebRTC.stopPlayingStream(e))}},{key:"setPublishWatermark",value:function(){return(0,p.isNotSupported)("setPublishWatermark")}},{key:"takePublishStreamSnapshot",value:function(){return(0,p.isNotSupported)("takePublishStreamSnapshot")}},{key:"takePlayStreamSnapshot",value:function(){return(0,p.isNotSupported)("takePlayStreamSnapshot")}},{key:"setPlayVolume",value:function(e,t){return(0,p.isNotSupported)("setPlayVolume")}},{key:"setAllPlayStreamVolume",value:function(){return(0,p.isNotSupported)("setAllPlayStreamVolume")}},{key:"setPlayStreamVideoType",value:function(){return(0,p.isNotSupported)("setPlayStreamVideoType")}},{key:"setPlayStreamBufferIntervalRange",value:function(){return(0,p.isNotSupported)("setPlayStreamBufferIntervalRange")}},{key:"setPlayStreamFocusOn",value:function(){return(0,p.isNotSupported)("setPlayStreamFocusOn")}},{key:"mutePlayStreamAudio",value:function(e,t){return this.zegoWebRTC.mutePlayStreamAudio(e,t)}},{key:"mutePlayStreamVideo",value:function(e,t){return this.zegoWebRTC.mutePlayStreamVideo(e,t)}},{key:"muteAllPlayStreamAudio",value:function(){return(0,p.isNotSupported)("muteAllPlayStreamAudio")}},{key:"muteAllPlayStreamVideo",value:function(e){return(0,p.isNotSupported)("muteAllPlayStreamVideo")}},{key:"enableHardwareDecoder",value:function(){return(0,p.isNotSupported)("enableHardwareDecoder")}},{key:"startMixerTask",value:function(){var e=(0,a.default)((0,o.default)().mark((function e(t){var i,r,n,a,c,u,l,d,h,f,m,v,g,y,b,_,S;return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.videoConfig,r=t.audioConfig,n=t.inputList,a=t.outputList,c=t.taskID,u=n,l=a,u.forEach((function(e){var t=e.layout,i=t.x,r=t.y,n=t.width,o=t.height;e.layout={top:+r,left:+i,bottom:+r+ +o,right:+i+ +n}})),h={outputBitrate:600,outputFPS:15,outputWidth:360,outputHeight:480},i&&(f=i.height,m=i.width,v=i.bitrate,g=i.fps,h={outputBitrate:v,outputHeight:f,outputWidth:m,outputFPS:g}),r&&(y=r.channel,b=r.bitrate,_=r.codecID,S=_,h=(0,s.default)((0,s.default)({},h),{},{outputAudioChannels:y||1,outputAudioBitrate:b,outputAudioCodecID:S})),d={inputList:u,outputList:l,outputConfig:h,taskID:c},e.abrupt("return",this.zegoWebRTC.startMixerTask(d).then((function(e){var t;return t={errorCode:e.errorCode,extendedData:new Map},e.extendedData&&(t.extendedData=(0,p.formatObjString)(e.extendedData)),t})));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopMixerTask",value:function(e){return this.zegoWebRTC.stopMixerTask(e.taskID)}},{key:"startAutoMixerTask",value:function(){return(0,p.isNotSupported)("startAutoMixerTask")}},{key:"stopAutoMixerTask",value:function(e){return(0,p.isNotSupported)("stopAutoMixerTask")}},{key:"muteMicrophone",value:function(e){return(0,p.getPromiseInstance)(this.zegoWebRTC.muteMicrophone(e))}},{key:"isMicrophoneMuted",value:function(){return p.getPromiseInstance.call(this,this.zegoWebRTC.isMicrophoneMuted())}},{key:"muteSpeaker",value:function(){return(0,p.isNotSupported)("muteSpeaker")}},{key:"isSpeakerMuted",value:function(){return(0,p.isNotSupported)("isSpeakerMuted")}},{key:"enableAudioCaptureDevice",value:function(e){return(0,p.isNotSupported)("enableAudioCaptureDevice")}},{key:"enableCamera",value:function(){var e=(0,a.default)((0,o.default)().mark((function e(t,i){var r,n,s;return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r=this.channelData.get(i||0)||new Map,n=r.get("stream"),n){e.next=9;break}return s=r.get("streamConfig")||{},s.camera=s.camera||{},s.camera.video=t,r.set("streamConfig",s),this.channelData.set(i||0,r),e.abrupt("return");case 9:return e.abrupt("return",this.zegoWebRTC.enableVideoCaptureDevice(n,t));case 10:case"end":return e.stop()}}),e,this)})));return function(t,i){return e.apply(this,arguments)}}()},{key:"useFrontCamera",value:function(e,t){var i=this.channelData.get(t||0)||new Map,r=i.get("streamConfig")||{};return r.camera=r.camera||{},r.camera.facingMode=e?"user":"environment",i.set("streamConfig",r),this.channelData.set(t||0,i),(0,p.getPromiseInstance)(!0)}},{key:"setCameraZoomFactor",value:function(){return(0,p.isNotSupported)("setCameraZoomFactor")}},{key:"getCameraMaxZoomFactor",value:function(){return(0,p.isNotSupported)("getCameraMaxZoomFactor")}},{key:"startSoundLevelMonitor",value:function(){return(0,p.isNotSupported)("startSoundLevelMonitor")}},{key:"stopSoundLevelMonitor",value:function(){return(0,p.isNotSupported)("stopSoundLevelMonitor")}},{key:"enableAEC",value:function(e){var t=this;return(0,p.getPromiseInstance)(function(){t.cameraConfig.AEC=e}())}},{key:"setAECMode",value:function(){return(0,p.isNotSupported)("setAECMode")}},{key:"enableAGC",value:function(e){var t=this;return(0,p.getPromiseInstance)(function(){t.cameraConfig.AGC=e}())}},{key:"enableANS",value:function(e){var t=this;return(0,p.getPromiseInstance)(function(){t.cameraConfig.ANS=e}())}},{key:"enableTransientANS",value:function(){return(0,p.isNotSupported)("enableTransientANS")}},{key:"setANSMode",value:function(){return(0,p.isNotSupported)("setANSMode")}},{key:"enableHeadphoneMonitor",value:function(){return(0,p.isNotSupported)("enableHeadphoneMonitor")}},{key:"setHeadphoneMonitorVolume",value:function(){return(0,p.isNotSupported)("setHeadphoneMonitorVolume")}},{key:"enableHeadphoneAEC",value:function(){return(0,p.isNotSupported)("enableHeadphoneAEC")}},{key:"setAudioRouteToSpeaker",value:function(e){return(0,p.isNotSupported)("setAudioRouteToSpeaker")}},{key:"getAudioRouteType",value:function(){return(0,p.isNotSupported)("getAudioRouteType")}},{key:"startEffectsEnv",value:function(){}},{key:"stopEffectsEnv",value:function(){var e,t,i=(null===(e=this.channelData.get(0))||void 0===e?void 0:e.get("stream"))||(null===(t=this.channelData.get(1))||void 0===t?void 0:t.get("stream"));return this.zegoWebRTC.setEffectsBeauty(i,!1)}},{key:"enableEffectsBeauty",value:function(e){return this.beautyEnable=e,(0,p.getPromiseInstance)(!0)}},{key:"setEffectsBeautyParam",value:function(e){return this.beautyParams=e,(0,p.getPromiseInstance)(!0)}},{key:"createMediaPlayer",value:function(){var t,i=null;return this.mediaPlayerMap||(this.mediaPlayerMap=new Map),(null===(t=this.mediaPlayerMap)||void 0===t?void 0:t.size)<4&&(i=new h.MediaPlayer,i.setWebRtcInstance(this),i.index=e.mediaPlayerIndex,this.mediaPlayerMap.set(i.index,i),e.mediaPlayerIndex++),(0,p.getPromiseInstance)(i)}},{key:"destroyMediaPlayer",value:function(e){var t=this;return new Promise((function(i,r){try{t.mediaPlayerMap&&(t.mediaPlayerMap.delete(e.index),e=null),i()}catch(n){r(n)}}))}},{key:"loadResourceWithConfig",value:function(){return(0,p.isNotSupported)("loadResourceWithConfig")}}],[{key:"instance",value:function(){return e._instance}},{key:"createEngineWithProfile",value:function(t){return(0,p.getPromiseInstance)(new e(t.appID,"test"))}},{key:"createEngine",value:function(t,i,r,n){return(0,p.getPromiseInstance)(new e(t,"test"))}},{key:"destroyEngine",value:function(){var t=e._instance;if(t){var i,r,n,s,c=null===(i=t.channelData)||void 0===i||null===(r=i.get(0))||void 0===r?void 0:r.get("stream"),u=null===(n=t.channelData)||void 0===n||null===(s=n.get(0))||void 0===s?void 0:s.get("stream");return new Promise(function(){var i=(0,a.default)((0,o.default)().mark((function i(r,n){return(0,o.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(i.prev=0,i.t0=c,!i.t0){i.next=5;break}return i.next=5,null===t||void 0===t?void 0:t.zegoWebRTC.destroyStream(c);case 5:if(i.t1=u,!i.t1){i.next=9;break}return i.next=9,null===t||void 0===t?void 0:t.zegoWebRTC.destroyStream(u);case 9:null===t||void 0===t||t.stopPreview(0),null===t||void 0===t||t.stopPreview(1),null===t||void 0===t||t.zegoWebRTC.destroyEngine(),e._instance=null,r(!0),i.next=19;break;case 16:i.prev=16,i.t2=i["catch"](0),n(i.t2);case 19:case"end":return i.stop()}}),i,null,[[0,16]])})));return function(e,t){return i.apply(this,arguments)}}())}}},{key:"getVersion",value:function(){var t;return p.getPromiseInstance.call(this,null===(t=e._instance)||void 0===t?void 0:t.zegoWebRTC.getVersion())}},{key:"setEngineConfig",value:function(){return(0,p.isNotSupported)("setEngineConfig")}},{key:"setRoomMode",value:function(t){var i;return p.getPromiseInstance.call(this,null===(i=e._instance)||void 0===i?void 0:i.zegoWebRTC.enableMultiRoom(1===t))}}]),e}();t.default=f,f.mediaPlayerIndex=0},"01e0":function(e,t,i){e.exports=i.p+"static/yuyin-01.png"},"030a":function(e,t,i){"use strict";e.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version},"0594":function(e,t,i){"use strict";i("6a54"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("64aa");var r=i("3436"),n={name:"ZegoLocalView",props:{viewMode:{type:Number,default:r.ZegoViewMode.ScaleToFill},channel:{type:Number,default:r.ZegoPublishChannel.Main},canvasType:{type:Number,default:0}}};t.default=n},"0829":function(e,t,i){"use strict";var r=i("8bdb"),n=i("ea07").entries;r({target:"Object",stat:!0},{entries:function(e){return n(e)}})},"0b46":function(e,t,i){"use strict";var r=i("6a50");r("Int8",(function(e){return function(t,i,r){return e(this,t,i,r)}}))},"15ab":function(e,t,i){"use strict";var r=i("7658"),n=i("57e7");r("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),n)},1851:function(e,t,i){"use strict";var r=i("8bdb"),n=i("84d6"),o=i("1cb5");r({target:"Array",proto:!0},{fill:n}),o("fill")},1878:function(e,t,i){"use strict";var r=i("9839"),n=i("7ddb").exportTypedArrayStaticMethod,o=i("b32e");n("from",o,r)},"1a8a":function(e,t,i){"use strict";var r=i("f259");r("species")},"1ea2":function(e,t,i){"use strict";var r=i("af9e"),n=i("1c06"),o=i("ada5"),s=i("5d6e"),a=Object.isExtensible,c=r((function(){a(1)}));e.exports=c||s?function(e){return!!n(e)&&((!s||"ArrayBuffer"!==o(e))&&(!a||a(e)))}:a},"20f3":function(e,t,i){"use strict";var r=i("8bdb"),n=i("5145");r({target:"Array",proto:!0,forced:n!==[].lastIndexOf},{lastIndexOf:n})},"247d":function(e,t,i){"use strict";var r=i("6a50");r("Uint16",(function(e){return function(t,i,r){return e(this,t,i,r)}}))},"295e":function(e,t,i){"use strict";var r=i("6a50");r("Uint32",(function(e){return function(t,i,r){return e(this,t,i,r)}}))},"2bb3":function(e,t,i){"use strict";var r=i("29d8");e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},"2c61":function(e,t,i){"use strict";var r,n,o,s,a=i("85c1"),c=i("9f9e"),u=i("ae5c"),l=i("474f"),d=i("338c"),h=i("af9e"),p=i("3794"),f=i("37ad"),m=i("3f57"),v=i("7f28"),g=i("2bb3"),y=i("db06"),b=a.setImmediate,_=a.clearImmediate,S=a.process,T=a.Dispatch,E=a.Function,C=a.MessageChannel,w=a.String,I=0,R={};h((function(){r=a.location}));var k=function(e){if(d(R,e)){var t=R[e];delete R[e],t()}},P=function(e){return function(){k(e)}},A=function(e){k(e.data)},D=function(e){a.postMessage(w(e),r.protocol+"//"+r.host)};b&&_||(b=function(e){v(arguments.length,1);var t=l(e)?e:E(e),i=f(arguments,1);return R[++I]=function(){c(t,void 0,i)},n(I),I},_=function(e){delete R[e]},y?n=function(e){S.nextTick(P(e))}:T&&T.now?n=function(e){T.now(P(e))}:C&&!g?(o=new C,s=o.port2,o.port1.onmessage=A,n=u(s.postMessage,s)):a.addEventListener&&l(a.postMessage)&&!a.importScripts&&r&&"file:"!==r.protocol&&!h(D)?(n=D,a.addEventListener("message",A,!1)):n="onreadystatechange"in m("script")?function(e){p.appendChild(m("script"))["onreadystatechange"]=function(){p.removeChild(this),k(e)}}:function(e){setTimeout(P(e),0)}),e.exports={set:b,clear:_}},"2d48":function(e,t,i){"use strict";var r=i("6a50");r("Int16",(function(e){return function(t,i,r){return e(this,t,i,r)}}))},3436:function(e,t,i){"use strict";i("6a54");var r=i("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.ZegoWatermark=t.ZegoVoiceChangerParam=t.ZegoViewMode=t.ZegoVideoStreamType=t.ZegoVideoMirrorMode=t.ZegoVideoConfigPreset=t.ZegoVideoConfig=t.ZegoVideoCodecID=t.ZegoUser=t.ZegoUpdateType=t.ZegoTrafficControlProperty=t.ZegoTrafficControlMinVideoBitrateMode=t.ZegoStreamResourceType=t.ZegoStreamResourceSwitchMode=t.ZegoStreamResourceMode=t.ZegoStreamRelayCDNUpdateReason=t.ZegoStreamRelayCDNState=t.ZegoStreamQualityLevel=t.ZegoSoundLevelConfig=t.ZegoScenario=t.ZegoRoomStateChangedReason=t.ZegoRoomState=t.ZegoRoomMode=t.ZegoRoomConfig=t.ZegoRemoteDeviceState=t.ZegoRect=t.ZegoPublisherState=t.ZegoPublisherConfig=t.ZegoPublishChannel=t.ZegoPlayerState=t.ZegoPlayerMediaEvent=t.ZegoPlayerConfig=t.ZegoOrientation=t.ZegoNetWorkResourceCache=t.ZegoMultimediaLoadType=t.ZegoMixerVideoConfig=t.ZegoMixerTask=t.ZegoMixerOutput=t.ZegoMixerInputContentType=t.ZegoMixerInput=t.ZegoMixerAudioConfig=t.ZegoMediaPlayerState=t.ZegoMediaPlayerResource=t.ZegoMediaPlayerNetworkEvent=t.ZegoMediaPlayerAudioChannel=t.ZegoMediaPlayer=t.ZegoLogConfig=t.ZegoEngineState=t.ZegoEngineProfile=t.ZegoEngineConfig=t.ZegoEffectsBeautyParam=t.ZegoDeviceType=t.ZegoDeviceExceptionType=t.ZegoDataRecordType=t.ZegoDataRecordState=t.ZegoDataRecordProgress=t.ZegoDataRecordConfig=t.ZegoCDNConfig=t.ZegoAutoMixerTask=t.ZegoAudioRoute=t.ZegoAudioMixMode=t.ZegoAudioConfigPreset=t.ZegoAudioConfig=t.ZegoAudioCodecID=t.ZegoAudioChannel=t.ZegoAlphaLayoutType=t.ZegoAccurateSeekConfig=t.ZegoANSMode=t.ZegoAECMode=void 0,i("c1a3"),i("bf0f"),i("18f7"),i("de6c");var n,o,s,a,c,u,l,d,h,p,f,m,v,g,y,b,_,S,T,E,C,w,I,R,k,P,A,D,N,O,M,L,x,U,B,z,q,X,H,F,V,G,j=r(i("efe5")),Q=r(i("80b1"));t.ZegoScenario=n,function(e){e[e["General"]=0]="General",e[e["Communication"]=1]="Communication",e[e["Live"]=2]="Live",e[e["Default"]=3]="Default",e[e["StandardVideoCall"]=4]="StandardVideoCall",e[e["HighQualityVideoCall"]=5]="HighQualityVideoCall",e[e["StandardChatroom"]=6]="StandardChatroom",e[e["HighQualityChatroom"]=7]="HighQualityChatroom",e[e["Broadcast"]=8]="Broadcast",e[e["Karaoke"]=9]="Karaoke",e[e["StandardVoiceCall"]=10]="StandardVoiceCall"}(n||(t.ZegoScenario=n={})),t.ZegoRoomMode=o,function(e){e[e["SingleRoom"]=0]="SingleRoom",e[e["MultiRoom"]=1]="MultiRoom"}(o||(t.ZegoRoomMode=o={})),t.ZegoEngineState=s,function(e){e[e["Start"]=0]="Start",e[e["Stop"]=1]="Stop"}(s||(t.ZegoEngineState=s={})),t.ZegoRoomState=a,function(e){e[e["Disconnected"]=0]="Disconnected",e[e["Connecting"]=1]="Connecting",e[e["Connected"]=2]="Connected"}(a||(t.ZegoRoomState=a={})),t.ZegoRoomStateChangedReason=c,function(e){e[e["Logining"]=0]="Logining",e[e["Logined"]=1]="Logined",e[e["LoginFailed"]=2]="LoginFailed",e[e["Reconnecting"]=3]="Reconnecting",e[e["Reconnected"]=4]="Reconnected",e[e["ReconnectFailed"]=5]="ReconnectFailed",e[e["KickOut"]=6]="KickOut",e[e["Logout"]=7]="Logout",e[e["LogoutFailed"]=8]="LogoutFailed"}(c||(t.ZegoRoomStateChangedReason=c={})),t.ZegoPublishChannel=u,function(e){e[e["Main"]=0]="Main",e[e["Aux"]=1]="Aux",e[e["Third"]=2]="Third",e[e["Fourth"]=3]="Fourth"}(u||(t.ZegoPublishChannel=u={})),t.ZegoViewMode=l,function(e){e[e["AspectFit"]=0]="AspectFit",e[e["AspectFill"]=1]="AspectFill",e[e["ScaleToFill"]=2]="ScaleToFill"}(l||(t.ZegoViewMode=l={})),t.ZegoVideoMirrorMode=d,function(e){e[e["OnlyPreviewMirror"]=0]="OnlyPreviewMirror",e[e["BothMirror"]=1]="BothMirror",e[e["NoMirror"]=2]="NoMirror",e[e["OnlyPublishMirror"]=3]="OnlyPublishMirror"}(d||(t.ZegoVideoMirrorMode=d={})),t.ZegoPublisherState=h,function(e){e[e["NoPublish"]=0]="NoPublish",e[e["PublishRequesting"]=1]="PublishRequesting",e[e["Publishing"]=2]="Publishing"}(h||(t.ZegoPublisherState=h={})),t.ZegoVideoConfigPreset=p,function(e){e[e["Preset180P"]=0]="Preset180P",e[e["Preset270P"]=1]="Preset270P",e[e["Preset360P"]=2]="Preset360P",e[e["Preset540P"]=3]="Preset540P",e[e["Preset720P"]=4]="Preset720P",e[e["Preset1080P"]=5]="Preset1080P"}(p||(t.ZegoVideoConfigPreset=p={})),t.ZegoStreamQualityLevel=f,function(e){e[e["Excellent"]=0]="Excellent",e[e["Good"]=1]="Good",e[e["Medium"]=2]="Medium",e[e["Bad"]=3]="Bad",e[e["Die"]=4]="Die",e[e["Unknown"]=5]="Unknown"}(f||(t.ZegoStreamQualityLevel=f={})),t.ZegoAudioChannel=m,function(e){e[e["Unknown"]=0]="Unknown",e[e["Mono"]=1]="Mono",e[e["Stereo"]=2]="Stereo"}(m||(t.ZegoAudioChannel=m={})),t.ZegoAudioMixMode=v,function(e){e[e["Raw"]=0]="Raw",e[e["Focused"]=1]="Focused"}(v||(t.ZegoAudioMixMode=v={})),t.ZegoAudioCodecID=g,function(e){e[e["Default"]=0]="Default",e[e["Normal"]=1]="Normal",e[e["Normal2"]=2]="Normal2",e[e["Normal3"]=3]="Normal3",e[e["Low"]=4]="Low",e[e["Low2"]=5]="Low2",e[e["Low3"]=6]="Low3"}(g||(t.ZegoAudioCodecID=g={})),t.ZegoVideoCodecID=y,function(e){e[e["Default"]=0]="Default",e[e["SVC"]=1]="SVC",e[e["VP8"]=2]="VP8",e[e["H265"]=3]="H265",e[e["H264DualStream"]=4]="H264DualStream",e[e["Unknown"]=100]="Unknown"}(y||(t.ZegoVideoCodecID=y={})),t.ZegoOrientation=b,function(e){e[e["PortraitUp"]=0]="PortraitUp",e[e["LandscapeLeft"]=1]="LandscapeLeft",e[e["PortraitDown"]=2]="PortraitDown",e[e["LandscapeRight"]=3]="LandscapeRight"}(b||(t.ZegoOrientation=b={})),t.ZegoVideoStreamType=_,function(e){e[e["Default"]=0]="Default",e[e["Small"]=1]="Small",e[e["Big"]=2]="Big"}(_||(t.ZegoVideoStreamType=_={})),t.ZegoAECMode=S,function(e){e[e["Aggressive"]=0]="Aggressive",e[e["Medium"]=1]="Medium",e[e["Soft"]=2]="Soft"}(S||(t.ZegoAECMode=S={})),t.ZegoANSMode=T,function(e){e[e["Soft"]=0]="Soft",e[e["Medium"]=1]="Medium",e[e["Aggressive"]=2]="Aggressive",e[e["AI"]=3]="AI",e[e["AIBalanced"]=4]="AIBalanced"}(T||(t.ZegoANSMode=T={})),t.ZegoTrafficControlProperty=E,function(e){e[e["Basic"]=0]="Basic",e[e["AdaptiveFPS"]=1]="AdaptiveFPS",e[e["AdaptiveResolution"]=2]="AdaptiveResolution",e[e["AdaptiveAudioBitrate"]=4]="AdaptiveAudioBitrate"}(E||(t.ZegoTrafficControlProperty=E={})),t.ZegoTrafficControlMinVideoBitrateMode=C,function(e){e[e["NoVideo"]=0]="NoVideo",e[e["UltraLowFPS"]=1]="UltraLowFPS"}(C||(t.ZegoTrafficControlMinVideoBitrateMode=C={})),t.ZegoPlayerState=w,function(e){e[e["NoPlay"]=0]="NoPlay",e[e["PlayRequesting"]=1]="PlayRequesting",e[e["Playing"]=2]="Playing"}(w||(t.ZegoPlayerState=w={})),t.ZegoPlayerMediaEvent=I,function(e){e[e["AudioBreakOccur"]=0]="AudioBreakOccur",e[e["AudioBreakResume"]=1]="AudioBreakResume",e[e["VideoBreakOccur"]=2]="VideoBreakOccur",e[e["VideoBreakResume"]=3]="VideoBreakResume"}(I||(t.ZegoPlayerMediaEvent=I={})),t.ZegoStreamResourceMode=R,function(e){e[e["Default"]=0]="Default",e[e["OnlyCDN"]=1]="OnlyCDN",e[e["OnlyL3"]=2]="OnlyL3",e[e["OnlyRTC"]=3]="OnlyRTC",e[e["CDNPlus"]=4]="CDNPlus"}(R||(t.ZegoStreamResourceMode=R={})),t.ZegoStreamResourceSwitchMode=k,function(e){e[e["Default"]=0]="Default",e[e["SwitchToRTC"]=1]="SwitchToRTC",e[e["KeepOriginal"]=2]="KeepOriginal"}(k||(t.ZegoStreamResourceSwitchMode=k={})),t.ZegoStreamResourceType=P,function(e){e[e["Default"]=0]="Default",e[e["CDN"]=1]="CDN",e[e["L3"]=2]="L3"}(P||(t.ZegoStreamResourceType=P={})),t.ZegoUpdateType=A,function(e){e[e["Add"]=0]="Add",e[e["Delete"]=1]="Delete"}(A||(t.ZegoUpdateType=A={})),t.ZegoStreamRelayCDNState=D,function(e){e[e["NoRelay"]=0]="NoRelay",e[e["RelayRequesting"]=1]="RelayRequesting",e[e["Relaying"]=2]="Relaying"}(D||(t.ZegoStreamRelayCDNState=D={})),t.ZegoStreamRelayCDNUpdateReason=N,function(e){e[e["None"]=0]="None",e[e["ServerError"]=1]="ServerError",e[e["HandshakeFailed"]=2]="HandshakeFailed",e[e["AccessPointError"]=3]="AccessPointError",e[e["CreateStreamFailed"]=4]="CreateStreamFailed",e[e["BadName"]=5]="BadName",e[e["CDNServerDisconnected"]=6]="CDNServerDisconnected",e[e["Disconnected"]=7]="Disconnected",e[e["MixStreamAllInputStreamClosed"]=8]="MixStreamAllInputStreamClosed",e[e["MixStreamAllInputStreamNoData"]=9]="MixStreamAllInputStreamNoData",e[e["MixStreamServerInternalError"]=10]="MixStreamServerInternalError"}(N||(t.ZegoStreamRelayCDNUpdateReason=N={})),t.ZegoDeviceType=O,function(e){e[e["Unknown"]=0]="Unknown",e[e["Camera"]=1]="Camera",e[e["Microphone"]=2]="Microphone",e[e["Speaker"]=3]="Speaker",e[e["AudioDevice"]=4]="AudioDevice",e[e["AudioSession"]=5]="AudioSession"}(O||(t.ZegoDeviceType=O={})),t.ZegoDeviceExceptionType=M,function(e){e[e["Unknown"]=0]="Unknown",e[e["Generic"]=1]="Generic",e[e["InvalidId"]=2]="InvalidId",e[e["PermissionNotGranted"]=3]="PermissionNotGranted",e[e["ZeroCaptureFps"]=4]="ZeroCaptureFps",e[e["DeviceOccupied"]=5]="DeviceOccupied",e[e["DeviceUnplugged"]=6]="DeviceUnplugged",e[e["RebootRequired"]=7]="RebootRequired",e[e["MediaServicesWereLost"]=8]="MediaServicesWereLost",e[e["SiriIsRecording"]=9]="SiriIsRecording",e[e["SoundLevelTooLow"]=10]="SoundLevelTooLow",e[e["MagneticCase"]=11]="MagneticCase",e[e["AudioSessionDeactive"]=12]="AudioSessionDeactive",e[e["AudioSessionCategoryChange"]=13]="AudioSessionCategoryChange"}(M||(t.ZegoDeviceExceptionType=M={})),t.ZegoRemoteDeviceState=L,function(e){e[e["Open"]=0]="Open",e[e["GenericError"]=1]="GenericError",e[e["InvalidID"]=2]="InvalidID",e[e["NoAuthorization"]=3]="NoAuthorization",e[e["ZeroFPS"]=4]="ZeroFPS",e[e["InUseByOther"]=5]="InUseByOther",e[e["Unplugged"]=6]="Unplugged",e[e["RebootRequired"]=7]="RebootRequired",e[e["SystemMediaServicesLost"]=8]="SystemMediaServicesLost",e[e["Disable"]=9]="Disable",e[e["Mute"]=10]="Mute",e[e["Interruption"]=11]="Interruption",e[e["InBackground"]=12]="InBackground",e[e["MultiForegroundApp"]=13]="MultiForegroundApp",e[e["BySystemPressure"]=14]="BySystemPressure",e[e["NotSupport"]=15]="NotSupport"}(L||(t.ZegoRemoteDeviceState=L={})),t.ZegoAudioRoute=x,function(e){e[e["Speaker"]=0]="Speaker",e[e["Headphone"]=1]="Headphone",e[e["Bluetooth"]=2]="Bluetooth",e[e["Receiver"]=3]="Receiver",e[e["ExternalUSB"]=4]="ExternalUSB",e[e["AirPlay"]=5]="AirPlay"}(x||(t.ZegoAudioRoute=x={})),t.ZegoMixerInputContentType=U,function(e){e[e["Audio"]=0]="Audio",e[e["Video"]=1]="Video",e[e["VideoOnly"]=2]="VideoOnly"}(U||(t.ZegoMixerInputContentType=U={})),t.ZegoAudioConfigPreset=B,function(e){e[e["BasicQuality"]=0]="BasicQuality",e[e["StandardQuality"]=1]="StandardQuality",e[e["StandardQualityStereo"]=2]="StandardQualityStereo",e[e["HighQuality"]=3]="HighQuality",e[e["HighQualityStereo"]=4]="HighQualityStereo"}(B||(t.ZegoAudioConfigPreset=B={})),t.ZegoMediaPlayerState=z,function(e){e[e["NoPlay"]=0]="NoPlay",e[e["Playing"]=1]="Playing",e[e["Pausing"]=2]="Pausing",e[e["PlayEnded"]=3]="PlayEnded"}(z||(t.ZegoMediaPlayerState=z={})),t.ZegoMediaPlayerNetworkEvent=q,function(e){e[e["BufferBegin"]=0]="BufferBegin",e[e["BufferEnded"]=1]="BufferEnded"}(q||(t.ZegoMediaPlayerNetworkEvent=q={})),t.ZegoMediaPlayerAudioChannel=X,function(e){e[e["Left"]=0]="Left",e[e["Right"]=1]="Right",e[e["All"]=2]="All"}(X||(t.ZegoMediaPlayerAudioChannel=X={})),t.ZegoDataRecordType=H,function(e){e[e["Default"]=0]="Default",e[e["OnlyAudio"]=1]="OnlyAudio",e[e["OnlyVideo"]=2]="OnlyVideo",e[e["AudioAndVideo"]=3]="AudioAndVideo"}(H||(t.ZegoDataRecordType=H={})),t.ZegoDataRecordState=F,function(e){e[e["NoRecord"]=0]="NoRecord",e[e["Recording"]=1]="Recording",e[e["Success"]=2]="Success"}(F||(t.ZegoDataRecordState=F={})),t.ZegoMultimediaLoadType=V,function(e){e[e["FilePath"]=0]="FilePath",e[e["Memory"]=1]="Memory",e[e["ResourceID"]=2]="ResourceID"}(V||(t.ZegoMultimediaLoadType=V={})),t.ZegoAlphaLayoutType=G,function(e){e[e["None"]=0]="None",e[e["Left"]=1]="Left",e[e["Right"]=2]="Right",e[e["Bottom"]=3]="Bottom"}(G||(t.ZegoAlphaLayoutType=G={}));var W=(0,j.default)((function e(){(0,Q.default)(this,e),this.logPath="",this.logSize=5242880,this.logCount=3}));t.ZegoLogConfig=W;var Z=(0,j.default)((function e(t,i,r){(0,Q.default)(this,e),this.appID=t,this.appSign=i,this.scenario=r}));t.ZegoEngineProfile=Z;var K=(0,j.default)((function e(){(0,Q.default)(this,e)}));t.ZegoEngineConfig=K;var J=(0,j.default)((function e(t,i,r){(0,Q.default)(this,e),this.maxMemberCount=t,this.isUserStatusNotify=i,this.token=r}));t.ZegoRoomConfig=J;var Y=(0,j.default)((function e(t,i,r,n,o,s,a){(0,Q.default)(this,e),this.captureWidth=t,this.captureHeight=i,this.encodeWidth=r,this.encodeHeight=n,this.fps=o,this.bitrate=s,this.codecID=a}));t.ZegoVideoConfig=Y;var $=(0,j.default)((function e(t){(0,Q.default)(this,e),this.pitch=t}));t.ZegoVoiceChangerParam=$;var ee=(0,j.default)((function e(t,i){(0,Q.default)(this,e),this.userID=t,this.userName=i}));t.ZegoUser=ee;var te=(0,j.default)((function e(t,i,r,n){(0,Q.default)(this,e),this.x=t,this.y=i,this.width=r,this.height=n}));t.ZegoRect=te;var ie=(0,j.default)((function e(){(0,Q.default)(this,e)}));t.ZegoPublisherConfig=ie;var re=(0,j.default)((function e(t,i){(0,Q.default)(this,e),this.url=t,this.authParam=i}));t.ZegoCDNConfig=re;var ne=(0,j.default)((function e(t){(0,Q.default)(this,e),this.cdnConfig=t}));t.ZegoPlayerConfig=ne;var oe=(0,j.default)((function e(){(0,Q.default)(this,e),this.whitenIntensity=50,this.rosyIntensity=50,this.smoothIntensity=50,this.sharpenIntensity=50}));t.ZegoEffectsBeautyParam=oe;var se=(0,j.default)((function e(){(0,Q.default)(this,e),this.bitrate=48,this.channel=m.Mono,this.codecID=g.Default,this.mixMode=v.Raw}));t.ZegoMixerAudioConfig=se;var ae=(0,j.default)((function e(){(0,Q.default)(this,e),this.width=360,this.height=640,this.fps=15,this.bitrate=600}));t.ZegoMixerVideoConfig=ae;var ce=(0,j.default)((function e(t,i,r,n){(0,Q.default)(this,e),this.streamID=t,this.contentType=i,this.layout=r,this.soundLevelID=n}));t.ZegoMixerInput=ce;var ue=(0,j.default)((function e(t){(0,Q.default)(this,e),this.target=t}));t.ZegoMixerOutput=ue;var le=(0,j.default)((function e(t,i){(0,Q.default)(this,e),this.imageURL=t,this.layout=i}));t.ZegoWatermark=le;var de=(0,j.default)((function e(t){(0,Q.default)(this,e),this.taskID=t,this.inputList=[],this.outputList=[],this.audioConfig=new se,this.videoConfig=new ae,this.enableSoundLevel=!1,this.backgroundImageURL="",this.watermark=new le("",new te(0,0,0,0)),this.advancedConfig=new Map}));t.ZegoMixerTask=de;var he=(0,j.default)((function e(t,i){(0,Q.default)(this,e),this.millisecond=t,this.enableVAD=i}));t.ZegoSoundLevelConfig=he;var pe=(0,j.default)((function e(){(0,Q.default)(this,e),this.taskID="",this.roomID="",this.outputList=[],this.audioConfig=new se,this.enableSoundLevel=!1}));t.ZegoAutoMixerTask=pe;var fe=(0,j.default)((function e(t,i,r){(0,Q.default)(this,e),this.bitrate=t,this.channel=i,this.codecID=r}));t.ZegoAudioConfig=fe;var me=(0,j.default)((function e(t,i){(0,Q.default)(this,e),this.filePath=t,this.recordType=i}));t.ZegoDataRecordConfig=me;var ve=(0,j.default)((function e(t,i,r){(0,Q.default)(this,e),this.duration=t,this.currentFileSize=i,this.quality=r}));t.ZegoDataRecordProgress=ve;var ge=(0,j.default)((function e(){(0,Q.default)(this,e),this.timeout=5e3}));t.ZegoAccurateSeekConfig=ge;var ye=(0,j.default)((function e(t,i){(0,Q.default)(this,e),this.time=t,this.size=i}));t.ZegoNetWorkResourceCache=ye;var be=(0,j.default)((function e(){(0,Q.default)(this,e),this.loadType=V.FilePath,this.startPosition=0,this.alphaLayout=G.None,this.filePath="",this.memory=void 0,this.resourceID=""}));t.ZegoMediaPlayerResource=be;var _e=(0,j.default)((function e(){(0,Q.default)(this,e)}));t.ZegoMediaPlayer=_e},"35fd9":function(e,t,i){"use strict";var r=i("8bdb"),n=i("85c1"),o=i("2c61").clear;r({global:!0,bind:!0,enumerable:!0,forced:n.clearImmediate!==o},{clearImmediate:o})},"3be4":function(e,t,i){var r=i("82c1");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var n=i("967d").default;n("6007ac7c",r,!0,{sourceMap:!1,shadowMode:!1})},4085:function(e,t,i){"use strict";var r=i("8bdb"),n=i("85c1");r({global:!0,forced:n.globalThis!==n},{globalThis:n})},"44ca":function(module,exports,__webpack_require__){(function(module){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__("bdbb").default;__webpack_require__("4085"),__webpack_require__("c9b5"),__webpack_require__("bf0f"),__webpack_require__("ab80"),__webpack_require__("f7a5"),__webpack_require__("aa9c"),__webpack_require__("4db2"),__webpack_require__("295e"),__webpack_require__("4d8f"),__webpack_require__("7b97"),__webpack_require__("668a"),__webpack_require__("c5b7"),__webpack_require__("8ff5"),__webpack_require__("2378"),__webpack_require__("641a"),__webpack_require__("64e0"),__webpack_require__("cce3"),__webpack_require__("efba"),__webpack_require__("d009"),__webpack_require__("bd7d"),__webpack_require__("7edd"),__webpack_require__("d798"),__webpack_require__("f547"),__webpack_require__("5e54"),__webpack_require__("b60a"),__webpack_require__("8c18"),__webpack_require__("12973"),__webpack_require__("f991"),__webpack_require__("198e"),__webpack_require__("8557"),__webpack_require__("63b1"),__webpack_require__("1954"),__webpack_require__("1cf1"),__webpack_require__("7a76"),__webpack_require__("e966"),__webpack_require__("c223"),__webpack_require__("dd2b"),__webpack_require__("6a54"),__webpack_require__("aa77"),__webpack_require__("fd3c"),__webpack_require__("3efd"),__webpack_require__("01a2"),__webpack_require__("e39c"),__webpack_require__("844d"),__webpack_require__("18f7"),__webpack_require__("de6c"),__webpack_require__("c1a3"),__webpack_require__("5ef2"),__webpack_require__("5c47"),__webpack_require__("2c10"),__webpack_require__("64aa"),__webpack_require__("0829"),__webpack_require__("dc8a"),__webpack_require__("d4b5"),__webpack_require__("2797"),__webpack_require__("a1c1"),__webpack_require__("4100"),__webpack_require__("cf80"),__webpack_require__("0506"),__webpack_require__("bd06"),__webpack_require__("4626"),__webpack_require__("c6c6"),__webpack_require__("66a6"),__webpack_require__("9db6"),__webpack_require__("dc69"),__webpack_require__("c976"),__webpack_require__("8f71"),__webpack_require__("5ac7"),__webpack_require__("dfcf"),__webpack_require__("473f"),__webpack_require__("d1aa"),__webpack_require__("80e3"),__webpack_require__("c753"),__webpack_require__("1a8a"),__webpack_require__("4ea4"),__webpack_require__("1851"),__webpack_require__("20f3"),__webpack_require__("9370"),__webpack_require__("6730"),__webpack_require__("0c26"),__webpack_require__("4e9b"),__webpack_require__("114e"),__webpack_require__("c240"),__webpack_require__("22b6"),__webpack_require__("1878"),__webpack_require__("c02e"),__webpack_require__("08eb"),__webpack_require__("8a8d"),__webpack_require__("247d"),__webpack_require__("f555"),__webpack_require__("0b46"),__webpack_require__("9480"),__webpack_require__("2d48"),__webpack_require__("4f9b"),__webpack_require__("825c"),__webpack_require__("9327"),__webpack_require__("ccbe"),__webpack_require__("15d1"),__webpack_require__("d5c6"),__webpack_require__("5a56"),__webpack_require__("f074"),__webpack_require__("e838"),__webpack_require__("dc89"),__webpack_require__("2425"),__webpack_require__("c24b"),__webpack_require__("7200"),__webpack_require__("7627"),__webpack_require__("9a2c"),__webpack_require__("23f4"),__webpack_require__("7d2f"),__webpack_require__("9c4e"),__webpack_require__("f771"),__webpack_require__("f3f7"),__webpack_require__("a578"),__webpack_require__("fe6b"),__webpack_require__("e062"),function(e,t){"object"==_typeof(exports)&&"object"==_typeof(module)?module.exports=t():(__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_FACTORY__=t,__WEBPACK_AMD_DEFINE_RESULT__="function"===typeof __WEBPACK_AMD_DEFINE_FACTORY__?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__,void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}("undefined"!=typeof self&&self,(function(){return function(){var __webpack_modules__={5434:function(e,t,i){"undefined"!=typeof self&&self,e.exports=function(e,t,i,r,n){return s=[function(e,t,i){"use strict";function r(e){return"number"==typeof e}function n(e){return"string"==typeof e}function o(e){return"boolean"==typeof e}function s(e){return void 0===e}function a(e){return null!==e&&e instanceof Object}function c(e){return"function"==typeof e}function u(e){return e instanceof Array}i.d(t,"d",(function(){return r})),i.d(t,"f",(function(){return n})),i.d(t,"b",(function(){return o})),i.d(t,"g",(function(){return s})),i.d(t,"e",(function(){return a})),i.d(t,"c",(function(){return c})),i.d(t,"a",(function(){return u}))},function(t,i){t.exports=e},function(e,t,i){(function(t){var r;e.exports=(r=function(e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),!(r=!(r=!(r="undefined"!=typeof globalThis&&globalThis.crypto?globalThis.crypto:r)&&"undefined"!=typeof window&&window.msCrypto?window.msCrypto:r)&&void 0!==t&&t.crypto?t.crypto:r))try{r=i(15)}catch(s){}var n=Object.create||function(e){return o.prototype=e,e=new o,o.prototype=null,e};function o(){}var s={},a=s.lib={},c=a.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,i=e.words,r=this.sigBytes,n=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<n;o++)t[r+o>>>2]|=(i[o>>>2]>>>24-o%4*8&255)<<24-(r+o)%4*8;else for(var s=0;s<n;s+=4)t[r+s>>>2]=i[s>>>2];return this.sigBytes+=n,this},clamp:function(){var t=this.words,i=this.sigBytes;t[i>>>2]&=4294967295<<32-i%4*8,t.length=e.ceil(i/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],i=0;i<e;i+=4)t.push(function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")}());return new u.init(t,e)}}),l=s.enc={},d=l.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,r=[],n=0;n<i;n++){var o=t[n>>>2]>>>24-n%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,i=[],r=0;r<t;r+=2)i[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(i,t/2)}},h=l.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,r=[],n=0;n<i;n++)r.push(String.fromCharCode(t[n>>>2]>>>24-n%4*8&255));return r.join("")},parse:function(e){for(var t=e.length,i=[],r=0;r<t;r++)i[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(i,t)}},p=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},f=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var i,r=this._data,n=r.words,o=r.sigBytes,s=this.blockSize,a=o/(4*s),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s;if(t=e.min(4*c,o),c){for(var l=0;l<c;l+=s)this._doProcessBlock(n,l);i=n.splice(0,c),r.sigBytes-=t}return new u.init(i,t)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),m=(a.Hasher=f.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,i){return new e.init(i).finalize(t)}},_createHmacHelper:function(e){return function(t,i){return new m.HMAC.init(e,i).finalize(t)}}}),s.algo={});return s}(Math),r)}).call(this,i(14))},function(e,i){e.exports=t},function(e,t){e.exports=i},function(e,t,i){e.exports=function(e){for(var t=Math,i=e,r=i.lib,n=r.WordArray,o=r.Hasher,s=i.algo,a=[],c=0;c<64;c++)a[c]=4294967296*t.abs(t.sin(c+1))|0;var u=s.MD5=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var i=0;i<16;i++){var r=t+i,n=e[r];e[r]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o=this._hash.words,s=e[t+0],c=e[t+1],u=e[t+2],f=e[t+3],m=e[t+4],v=e[t+5],g=e[t+6],y=e[t+7],b=e[t+8],_=e[t+9],S=e[t+10],T=e[t+11],E=e[t+12],C=e[t+13],w=e[t+14],I=e[t+15],R=o[0],k=o[1],P=o[2],A=o[3];R=l(R,k,P,A,s,7,a[0]),A=l(A,R,k,P,c,12,a[1]),P=l(P,A,R,k,u,17,a[2]),k=l(k,P,A,R,f,22,a[3]),R=l(R,k,P,A,m,7,a[4]),A=l(A,R,k,P,v,12,a[5]),P=l(P,A,R,k,g,17,a[6]),k=l(k,P,A,R,y,22,a[7]),R=l(R,k,P,A,b,7,a[8]),A=l(A,R,k,P,_,12,a[9]),P=l(P,A,R,k,S,17,a[10]),k=l(k,P,A,R,T,22,a[11]),R=l(R,k,P,A,E,7,a[12]),A=l(A,R,k,P,C,12,a[13]),P=l(P,A,R,k,w,17,a[14]),R=d(R,k=l(k,P,A,R,I,22,a[15]),P,A,c,5,a[16]),A=d(A,R,k,P,g,9,a[17]),P=d(P,A,R,k,T,14,a[18]),k=d(k,P,A,R,s,20,a[19]),R=d(R,k,P,A,v,5,a[20]),A=d(A,R,k,P,S,9,a[21]),P=d(P,A,R,k,I,14,a[22]),k=d(k,P,A,R,m,20,a[23]),R=d(R,k,P,A,_,5,a[24]),A=d(A,R,k,P,w,9,a[25]),P=d(P,A,R,k,f,14,a[26]),k=d(k,P,A,R,b,20,a[27]),R=d(R,k,P,A,C,5,a[28]),A=d(A,R,k,P,u,9,a[29]),P=d(P,A,R,k,y,14,a[30]),R=h(R,k=d(k,P,A,R,E,20,a[31]),P,A,v,4,a[32]),A=h(A,R,k,P,b,11,a[33]),P=h(P,A,R,k,T,16,a[34]),k=h(k,P,A,R,w,23,a[35]),R=h(R,k,P,A,c,4,a[36]),A=h(A,R,k,P,m,11,a[37]),P=h(P,A,R,k,y,16,a[38]),k=h(k,P,A,R,S,23,a[39]),R=h(R,k,P,A,C,4,a[40]),A=h(A,R,k,P,s,11,a[41]),P=h(P,A,R,k,f,16,a[42]),k=h(k,P,A,R,g,23,a[43]),R=h(R,k,P,A,_,4,a[44]),A=h(A,R,k,P,E,11,a[45]),P=h(P,A,R,k,I,16,a[46]),R=p(R,k=h(k,P,A,R,u,23,a[47]),P,A,s,6,a[48]),A=p(A,R,k,P,y,10,a[49]),P=p(P,A,R,k,w,15,a[50]),k=p(k,P,A,R,v,21,a[51]),R=p(R,k,P,A,E,6,a[52]),A=p(A,R,k,P,f,10,a[53]),P=p(P,A,R,k,S,15,a[54]),k=p(k,P,A,R,c,21,a[55]),R=p(R,k,P,A,b,6,a[56]),A=p(A,R,k,P,I,10,a[57]),P=p(P,A,R,k,g,15,a[58]),k=p(k,P,A,R,C,21,a[59]),R=p(R,k,P,A,m,6,a[60]),A=p(A,R,k,P,T,10,a[61]),P=p(P,A,R,k,u,15,a[62]),k=p(k,P,A,R,_,21,a[63]),o[0]=o[0]+R|0,o[1]=o[1]+k|0,o[2]=o[2]+P|0,o[3]=o[3]+A|0},_doFinalize:function(){var e=this._data,i=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;i[n>>>5]|=128<<24-n%32;var o=t.floor(r/4294967296),s=r;i[15+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),i[14+(n+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(i.length+1),this._process();for(var a=this._hash,c=a.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,i,r,n,o,s){var a=e+(t&i|~t&r)+n+s;return(a<<o|a>>>32-o)+t}function d(e,t,i,r,n,o,s){var a=e+(t&r|i&~r)+n+s;return(a<<o|a>>>32-o)+t}function h(e,t,i,r,n,o,s){var a=e+(t^i^r)+n+s;return(a<<o|a>>>32-o)+t}function p(e,t,i,r,n,o,s){var a=e+(i^(t|~r))+n+s;return(a<<o|a>>>32-o)+t}return i.MD5=o._createHelper(u),i.HmacMD5=o._createHmacHelper(u),e.MD5}(i(2))},function(e,t,i){e.exports=function(e){for(var t=e,i=t.lib.BlockCipher,r=t.algo,n=[],o=[],s=[],a=[],c=[],u=[],l=[],d=[],h=[],p=[],f=[],m=0;m<256;m++)f[m]=m<128?m<<1:m<<1^283;var v=0,g=0;for(m=0;m<256;m++){var y=g^g<<1^g<<2^g<<3^g<<4;n[v]=y=y>>>8^255&y^99,o[y]=v;var b=f[v],_=f[b],S=f[_],T=257*f[y]^16843008*y;s[v]=T<<24|T>>>8,a[v]=T<<16|T>>>16,c[v]=T<<8|T>>>24,u[v]=T,l[y]=(T=16843009*S^65537*_^257*b^16843008*v)<<24|T>>>8,d[y]=T<<16|T>>>16,h[y]=T<<8|T>>>24,p[y]=T,v?(v=b^f[f[f[S^b]]],g^=f[f[g]]):v=g=1}var E=[0,1,2,4,8,16,32,64,128,27,54],C=r.AES=i.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,i=e.sigBytes/4,r=4*((this._nRounds=i+6)+1),o=this._keySchedule=[],s=0;s<r;s++)s<i?o[s]=t[s]:(u=o[s-1],s%i?i>6&&s%i==4&&(u=n[u>>>24]<<24|n[u>>>16&255]<<16|n[u>>>8&255]<<8|n[255&u]):(u=n[(u=u<<8|u>>>24)>>>24]<<24|n[u>>>16&255]<<16|n[u>>>8&255]<<8|n[255&u],u^=E[s/i|0]<<24),o[s]=o[s-i]^u);for(var a=this._invKeySchedule=[],c=0;c<r;c++){if(s=r-c,c%4)var u=o[s];else u=o[s-4];a[c]=c<4||s<=4?u:l[n[u>>>24]]^d[n[u>>>16&255]]^h[n[u>>>8&255]]^p[n[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,c,u,n)},decryptBlock:function(e,t){var i=e[t+1];e[t+1]=e[t+3],e[t+3]=i,this._doCryptBlock(e,t,this._invKeySchedule,l,d,h,p,o),i=e[t+1],e[t+1]=e[t+3],e[t+3]=i},_doCryptBlock:function(e,t,i,r,n,o,s,a){for(var c=this._nRounds,u=e[t]^i[0],l=e[t+1]^i[1],d=e[t+2]^i[2],h=e[t+3]^i[3],p=4,f=1;f<c;f++){var m=r[u>>>24]^n[l>>>16&255]^o[d>>>8&255]^s[255&h]^i[p++],v=r[l>>>24]^n[d>>>16&255]^o[h>>>8&255]^s[255&u]^i[p++],g=r[d>>>24]^n[h>>>16&255]^o[u>>>8&255]^s[255&l]^i[p++],y=r[h>>>24]^n[u>>>16&255]^o[l>>>8&255]^s[255&d]^i[p++];u=m,l=v,d=g,h=y}m=(a[u>>>24]<<24|a[l>>>16&255]<<16|a[d>>>8&255]<<8|a[255&h])^i[p++],v=(a[l>>>24]<<24|a[d>>>16&255]<<16|a[h>>>8&255]<<8|a[255&u])^i[p++],g=(a[d>>>24]<<24|a[h>>>16&255]<<16|a[u>>>8&255]<<8|a[255&l])^i[p++],y=(a[h>>>24]<<24|a[u>>>16&255]<<16|a[l>>>8&255]<<8|a[255&d])^i[p++],e[t]=m,e[t+1]=v,e[t+2]=g,e[t+3]=y},keySize:8});return t.AES=i._createHelper(C),e.AES}(i(2),(i(16),i(5),i(9),i(19)))},function(e,t,i){e.exports=i(2).enc.Utf8},function(e,t,i){function r(e){var t;return(l[e]||(t=l[e]={i:e,l:!1,exports:{}},u[e].call(t.exports,t,t.exports,r),t.l=!0,t)).exports}var n,o,s,a,c,u,l;e.exports=(n=i(10),o=i(20),s=i(5),a=i(6),c=i(7),u=[function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.LinkedList=t.ListNode=t.ENUM_CONNECT_STATE=t.ENUM_NETWORK_STATE=t.SOCKET_DISCONNECT=t.errorList=t.Queue=t.getSeq=t.E_CLIENT_TYPE=t.ENUM_LOG_LEVEL=t.ENUM_REMOTE_TYPE=t.ZEGO_BROWSER_TYPE=t.ZEGO_ENV=t.PROTO_VERSION=void 0,t.PROTO_VERSION="1.0.4",(n=t.ZEGO_ENV||(t.ZEGO_ENV={}))[n.BROWSER=0]="BROWSER",n[n.WEIXINMINI=1]="WEIXINMINI",(n=t.ZEGO_BROWSER_TYPE||(t.ZEGO_BROWSER_TYPE={}))[n.IE=0]="IE",n[n.FIREFOX=1]="FIREFOX",n[n.CHROME=2]="CHROME",n[n.SAFARI=3]="SAFARI",n[n.OPERA=4]="OPERA",n[n.WEIXIN=5]="WEIXIN",n[n.WEIXINMINI=6]="WEIXINMINI",n[n.UNKOWN=7]="UNKOWN",(n=t.ENUM_REMOTE_TYPE||(t.ENUM_REMOTE_TYPE={}))[n.DISABLE=0]="DISABLE",n[n.WEBSOCKET=1]="WEBSOCKET",n[n.HTTPS=2]="HTTPS",t.ENUM_LOG_LEVEL={DEBUG:0,INFO:1,WARN:2,ERROR:3,REPORT:99,DISABLE:100,debug:0,info:1,warn:2,error:3,report:99,disable:100},(n=t.E_CLIENT_TYPE||(t.E_CLIENT_TYPE={}))[n.ClientType_None=0]="ClientType_None",n[n.ClientType_H5=1]="ClientType_H5",n[n.ClientType_SmallPragram=2]="ClientType_SmallPragram",n[n.ClientType_Webrtc=3]="ClientType_Webrtc",t.getSeq=(r=1,function(){return r++}),o.prototype.isEmpty=function(){return 0==this.items.length},o.prototype.enqueue=function(e){this.items.push(e)},o.prototype.dequeue=function(){return this.isEmpty()?"Underflow":this.items.shift()},o.prototype.front=function(){return this.isEmpty()?"No elements in Queue":this.items[0]},o.prototype.size=function(){return this.items.length},o.prototype.clear=function(){this.items=[]},o.prototype.all=function(){return this.items};var r,n=o;function o(){this.items=[],this.items=[]}t.Queue=n,t.errorList={TIMEOUT:{code:100001,msg:"network timeout"},DATAEXIST:{code:100002,msg:"data exist"},BROKEN:{code:100003,msg:"network broken"}},t.SOCKET_DISCONNECT=-1,(n=t.ENUM_NETWORK_STATE||(t.ENUM_NETWORK_STATE={}))[n.offline=0]="offline",n[n.online=1]="online",(n=t.ENUM_CONNECT_STATE||(t.ENUM_CONNECT_STATE={}))[n.disconnected=0]="disconnected",n[n.connecting=1]="connecting",n[n.connected=2]="connected",Object.defineProperty(a.prototype,"id",{get:function(){return this.h||null},set:function(e){this.h=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"data",{get:function(){return this.v},set:function(e){this.v=e},enumerable:!1,configurable:!0}),a.prototype.hasNext=function(){return this.next&&this.next.id},a.prototype.hasPrev=function(){return this.prev&&this.prev.id};var s=a;function a(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this.next=null,this.prev=null,this.h=e,this.v=t}function c(){this.start=new s,this.end=new s,this.g=0,this._=0,this.start.next=this.end,this.start.prev=null,this.end.prev=this.start,this.end.next=null}t.ListNode=s,c.prototype.insertBefore=function(e,t){return(t=new s(this.g,t)).next=e,t.prev=e.prev,e.prev&&(e.prev.next=t),e.prev=t,++this.g,++this._,t},c.prototype.addLast=function(e){return this.insertBefore(this.end,e)},c.prototype.add=function(e){return this.addLast(e)},c.prototype.getFirst=function(){return 0===this._?null:this.start.next},c.prototype.getLast=function(){return 0===this._?null:this.end.prev},c.prototype.size=function(){return this._},c.prototype.getFromFirst=function(e){var t=0,i=this.start.next;if(0<=e)for(;t<e&&null!==i;)i=i.next,++t;else i=null;if(null===i)throw"Index out of bounds.";return i},c.prototype.get=function(e){return 0===e?this.getFirst():e===this._-1?this.getLast():this.getFromFirst(e)},c.prototype.remove=function(e){return e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),--this._,e},c.prototype.removeFirst=function(){return 0<this._&&this.start.next?this.remove(this.start.next):null},c.prototype.removeLast=function(){return 0<this._&&this.end.prev?this.remove(this.end.prev):null},c.prototype.removeAll=function(){this.start.next=this.end,this.end.prev=this.start,this._=0,this.g=0},c.prototype.each=function(e){for(var t=this.start;t.hasNext();)e(t=t.next)},c.prototype.find=function(e){for(var t=this.start,i=!1,r=null;t.hasNext()&&!i;)e(t=t.next)&&(r=t,i=!0);return r},c.prototype.map=function(e){for(var t=this.start,i=[];t.hasNext();)e(t=t.next)&&i.push(t);return i},c.prototype.push=function(e){return this.addLast(e)},c.prototype.unshift=function(e){this.insertBefore(0<this._?this.start.next:this.end,e)},c.prototype.pop=function(){return this.removeLast()},c.prototype.shift=function(){return this.removeFirst()},t.LinkedList=c},function(e,t,i){"use strict";var r=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(r=o.next()).done;)s.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return s},n=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e},o=(Object.defineProperty(t,"u",{value:!0}),t.ContextAPI=t.suppressInstrumentation=t.ROOT_CONTEXT=t.BaseContext=t.setSpan=t.getSpanContext=t.getSpan=t.createContextKey=void 0,i(16));function s(e){return Symbol.for(e)}var a=(t.createContextKey=s)("OpenTelemetry Context Key SUPPRESS_INSTRUMENTATION"),c=s("OpenTelemetry Context Key SPAN");function u(e){return e.getValue(c)||void 0}function l(e){this.O=e,this.S=new o.StackContextManager}t.getSpan=u,t.getSpanContext=function(e){return null==(e=u(e))?void 0:e.context()},t.setSpan=function(e,t){return e.setValue(c,t)},t.BaseContext=i=function e(t){var i=this;i.M=t?new Map(t):new Map,i.getValue=function(e){return i.M.get(e)},i.setValue=function(t,r){var n=new e(i.M);return n.M.set(t,r),n},i.deleteValue=function(t){var r=new e(i.M);return r.M.delete(t),r}},t.ROOT_CONTEXT=new i,t.suppressInstrumentation=function(e){return e.setValue(a,!0)},l.getInstance=function(e){return void 0===e&&(e="context"),this.j||(this.j=new l(e)),this.j},l.prototype.active=function(){return this.S.active()},l.prototype.with=function(e,t,i){for(var r,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];return(r=this.T()).with.apply(r,n([e,t,i],o))},l.prototype.T=function(){return this.S},t.ContextAPI=l},function(e,t,i){"use strict";var r,n;Object.defineProperty(t,"u",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=t.TraceFlags=t.SpanKind=t.SpanStatusCode=void 0,(r=t.SpanStatusCode||(t.SpanStatusCode={}))[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR",(r=t.SpanKind||(t.SpanKind={}))[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER",(n=r=t.TraceFlags||(t.TraceFlags={}))[n.NONE=0]="NONE",n[n.SAMPLED=1]="SAMPLED",t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:r.NONE}},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.log=t.ZegoLog=void 0,n.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.join("");console.log(i)},n.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.join("");console.debug(i)},n.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.join("");console.info(i)},n.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.join("");console.warn(i)},n.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.join("");console.error(i)};var r=n;function n(){}r=new(t.ZegoLog=r),t.log=r},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.FAIL_TIME=t.FAIL_MAX_COUNT=t.FAIL_COUNT=t.STORE_SIZE=t.CACHE_SIZE=t.BUCKET_CONFIG=t.DEFAULT_CONFIG=void 0,t.DEFAULT_CONFIG={importantLevel:0,reportSize:3e3,reportNum:10,bps:16e3,netTimeout:10},t.BUCKET_CONFIG={bucketSize:1e4,tokensPerInterval:1600},t.CACHE_SIZE={totalAvailCache:102400,cacheMaxSize:2e4,cacheDelPer:.2},t.STORE_SIZE={totalDBSize:2048e3,storeDelPer:.2},t.FAIL_COUNT=5,t.FAIL_MAX_COUNT=10,t.FAIL_TIME=30},function(e,t,i){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.u?e:{default:e}},n=(Object.defineProperty(t,"u",{value:!0}),t.uuid=t.calculateMemSize=t.analyzeKey=t.getCurrentTime=t.getCurrentEnv=t.getBrowser=void 0,i(0)),o=r(i(31)),s=(t.getBrowser=function(){var e=window.navigator.userAgent,t=null!=window.ActiveXObject&&-1!=e.indexOf("MSIE"),i=-1!=e.indexOf("Firefox"),r=null!=window.opr,o=e.indexOf("Chrome")&&window.chrome,s=-1!=e.indexOf("Safari")&&-1!=e.indexOf("Version");return e=e.toLowerCase().match(/MicroMessenger/i)&&"micromessenger"===e.toLowerCase().match(/MicroMessenger/i)[0],t?n.ZEGO_BROWSER_TYPE.IE:i?n.ZEGO_BROWSER_TYPE.FIREFOX:r?n.ZEGO_BROWSER_TYPE.OPERA:o?n.ZEGO_BROWSER_TYPE.CHROME:s?n.ZEGO_BROWSER_TYPE.SAFARI:e?n.ZEGO_BROWSER_TYPE.WEIXIN:n.ZEGO_BROWSER_TYPE.UNKOWN},t.getCurrentEnv=function(){var e=window.navigator.userAgent;return new Promise((function(t){-1==e.indexOf("MicroMessage")?t(n.ZEGO_ENV.BROWSER):wx.miniProgram.getEnv((function(e){}))}))},["00","01","02","03","04","05","06","07","08","09"]);t.getCurrentTime=function(){var e=new Date;return[e.getFullYear()+"/",(s[e.getMonth()+1]||e.getMonth()+1)+"/",(s[e.getDate()]||e.getDate())+" ",(s[e.getHours()]||e.getHours())+":",(s[e.getMinutes()]||e.getMinutes())+":",s[e.getSeconds()]||e.getSeconds(),"."+e.getTime()%1e3].join("")},t.analyzeKey=function(e){return e=e.split("_"),{level:Number(e[0]),timestamp:e[1],seq:e[2]}},t.calculateMemSize=function(e){return o.default(e)},t.uuid=function(e,t){var i,r,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[];if(t=t||n.length,e)for(i=0;i<e;i++)o[i]=n[0|Math.random()*t];else for(o[8]=o[13]=o[18]=o[23]="-",o[14]="4",i=0;i<36;i++)o[i]||(r=0|16*Math.random(),o[i]=n[19==i?3&r|8:r]);return o.join("")}},function(e,t,i){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},n=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(r=o.next()).done;)s.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return s};function o(e){var t,i,n;if(null!=e&&Array.isArray(e))try{for(var o=r(e),s=o.next();!s.done;s=o.next()){var a=s.value;if(null!=a)if(n){if(_typeof(a)!==n)return!1}else n=_typeof(a)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return!0}Object.defineProperty(t,"u",{value:!0}),t.sanitizeAttributes=t.isAttributeValue=void 0,t.isAttributeValue=o,t.sanitizeAttributes=function(e){var t,i,s={};if(null!=e&&"object"==_typeof(e))try{for(var a=r(Object.entries(e)),c=a.next();!c.done;c=a.next()){var u=n(c.value,2),l=u[0],d=u[1];o(d)&&(s[l]=Array.isArray(d)?d.slice():d)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}return s}},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.IdGenerator=void 0;var r=Array(32);function n(e){return function(){for(var t=0;t<2*e;t++)r[t]=Math.floor(16*Math.random())+48,58<=r[t]&&(r[t]+=39);return String.fromCharCode.apply(null,r.slice(0,2*e))}}t.IdGenerator=function(){this.generateTraceId=n(16),this.generateSpanId=n(8),this.generateEventId=n(4)}},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.Resource=t.SDK_INFO=t.SemanticResourceAttributes=void 0,t.SemanticResourceAttributes={PROCESS_RUNTIME_NAME:"process.runtime.name",TELEMETRY_SDK_NAME:"telemetry.sdk.name",TELEMETRY_SDK_LANGUAGE:"telemetry.sdk.language",TELEMETRY_SDK_VERSION:"telemetry.sdk.version"},t.SDK_INFO=((r={})[t.SemanticResourceAttributes.TELEMETRY_SDK_NAME]="opentelemetry",r[t.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]="browser",r[t.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]="webjs",r[t.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]=t.VERSION,r),n.empty=function(){return n.EMPTY},n.createTelemetrySDKResource=function(){var e;return new n(((e={})[t.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]=t.SDK_INFO[t.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE],e[t.SemanticResourceAttributes.TELEMETRY_SDK_NAME]=t.SDK_INFO[t.SemanticResourceAttributes.TELEMETRY_SDK_NAME],e[t.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]=t.SDK_INFO[t.SemanticResourceAttributes.TELEMETRY_SDK_VERSION],e))},n.prototype.merge=function(e){return e&&Object.keys(e.attributes).length?new n(Object.assign({},this.attributes,e.attributes)):this},n.EMPTY=new n({});var r=n;function n(e){this.attributes=e}t.Resource=r},function(e,t,i){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},n=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(r=o.next()).done;)s.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return s},o=(Object.defineProperty(t,"u",{value:!0}),t.Span=void 0,i(6)),s=i(1),a=i(2),c=i(7),u=i(17);function l(e,t,i,r,n,o,s,u){void 0===u&&(u=[]),this.attributes={},this.links=[],this.events=[],this.status={code:a.SpanStatusCode.UNSET},this.endTime=0,this.N=!1,this.A=0,this.exported=!0,this.R=e.context,this.reporter=e.reporter,this.spanProcessor=e.spanProcessor,this.parentTracer=e,this.name=i,this.level=r,this.spanContext=n,this.parentSpanId=s,this.kind=o,this.links=u,this.startTime=Date.now(),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this.I=e.getActiveTraceParams(),this.k=new c.IdGenerator}l.prototype.context=function(){return this.spanContext},l.prototype.setAttribute=function(e,t){return null==t||0===e.length||!o.isAttributeValue(t)||Object.keys(this.attributes).length>=this.I.numberOfAttributesPerSpan&&!Object.prototype.hasOwnProperty.call(this.attributes,e)||(this.attributes[e]=t),this},l.prototype.appendAttribute=function(e,t){return null==t||0===e.length||!o.isAttributeValue(t)||Object.keys(this.attributes).length>=this.I.numberOfAttributesPerSpan&&!Object.prototype.hasOwnProperty.call(this.attributes,e)||(this.attributes[e]&&Array.isArray(this.attributes[e])?this.attributes[e].push(t):this.attributes[e]=[t]),this},l.prototype.setAttributes=function(e){var t,i;try{for(var o=r(Object.entries(e)),s=o.next();!s.done;s=o.next()){var a=n(s.value,2);this.setAttribute(a[0],a[1])}}catch(e){t={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return this},l.prototype.addEvent=function(e,t,i){this.events.length>=this.I.numberOfEventsPerSpan&&this.events.shift();var r=this.k.generateEventId();return u.isTimeInput(t)&&(void 0===i&&(i=t),t=void 0),void 0===i&&(i=u.hrTime()),this.events.push({name:e,attributes:t,time:u.timeInputToHrTime(i),event_id:r}),this},l.prototype.setStatus=function(e){return this.status=e,this},l.prototype.updateName=function(e){return this.name=e,this},l.prototype.end=function(e){var t,i=this;this.D()||(this.N=!0,this.resource=this.parentTracer.resource,this.spanProcessor.spanBeforeEnd&&this.spanProcessor.spanBeforeEnd(this),t=u.getCurrentTime(),this.setAttribute("e_time_s",t),this.endTime=Date.now(),this.A=this.endTime-this.startTime,this.R.with(s.suppressInstrumentation(this.R.active()),(function(){var t=i.P(i);i.spanProcessor.spanEnd&&i.spanProcessor.spanEnd(t,i.level),t.droped||!1===e||(delete t.droped,i.reporter.report(JSON.stringify(t),i.level))})))},l.prototype.spanReport=function(){var e=this.P(this);this.reporter.report(JSON.stringify(e),this.level)},l.prototype.isRecording=function(){return!1===this.N},Object.defineProperty(l.prototype,"duration",{get:function(){return this.A},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"ended",{get:function(){return this.N},enumerable:!1,configurable:!0}),l.prototype.D=function(){return this.N},l.prototype.P=function(e){var t=[],i=(e.events.forEach((function(e){var i={};Object.keys(e).forEach((function(t){"name"===t&&(i[t]=e[t]),"time"===t&&(i.timestamp=u.hrTimeToMilliseconds(e[t])),"attributes"===t&&(i.tags=e[t])})),t.push(i)})),[]);return e.links.forEach((function(e){i.push({span_id:e.context.spanId,trace_id:e.context.traceId})})),{trace_id:e.spanContext.traceId,parent_span_id:e.parentSpanId,name:e.name,span_id:e.spanContext.spanId,kind:e.kind,start_time:e.startTime,end_time:e.endTime,duration:e.duration,logs:t,tags:e.attributes,links:i}},t.Span=l},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.ZegoSpan=void 0;var r=i(3),n=i(9);function o(e,t){this.spanId=e,this.span=t}o.prototype.setAttribute=function(e,t){var i=this;return this.span?this.span.setAttribute(e,t):this.B().then((function(){i.span&&i.span.setAttribute(e,t)})),this},o.prototype.setAttributes=function(e){var t=this;return this.span?this.span.setAttributes(e):this.B().then((function(){t.span&&t.span.setAttributes(e)})),this},o.prototype.appendAttribute=function(e,t){var i=this;return this.span?this.span.appendAttribute(e,t):this.B().then((function(){i.span&&i.span.appendAttribute(e,t)})),this},o.prototype.addEvent=function(e,t,i){var r=this;return this.span?this.span.addEvent(e,t,i):this.B().then((function(){r.span&&r.span.addEvent(e,t,i)})),this},o.prototype.setStatus=function(e){var t=this;return this.span?this.span.setStatus(e):this.B().then((function(){t.span&&t.span.setStatus(e)})),this},o.prototype.updateName=function(e){var t=this;return this.span?this.span.updateName(e):this.B().then((function(){t.span&&t.span.updateName(e)})),this},o.prototype.end=function(e){var t=this;void 0===e&&(e=!0),this.span?this.span.end(e):this.B(!0).then((function(){t.span&&t.span.end(e),t.U()}))},o.prototype.setSpanActive=function(e){this.activeCallback=e},o.prototype.setSpanEnd=function(e){this.endCallback=e},o.prototype.spanReport=function(){var e;null!=(e=this.span)&&e.spanReport()},o.prototype.U=function(){this.L()||(this.J(this.spanId),this.endCallback&&this.endCallback(this.spanInfo))},o.prototype.L=function(){return"noop"===this.spanId},o.prototype.B=function(e){var t=this;return void 0===e&&(e=!1),new Promise((function(i,r){t.store.getItem(t.spanId).then((function(r){var s=new n.Span(o.tracer,o.tracer.context.active(),r.name,r.level,r.spanContext,r.kind,r.parentSpanId,r.links);s.setStatus(r.status),s.setAttributes(r.attributes),t.span=s,t.activeCallback&&t.activeCallback(t.spanId,e),i()})).catch((function(e){r(e)}))}))},o.prototype.J=function(e){var t=this;this.store.getItem(e).then((function(i){i&&t.store.removeItem(e).then((function(){r.log.log("remove suc")})).catch((function(e){r.log.warn("remove fail")}))}))},t.ZegoSpan=o},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.createZegoStore=t.ZegoWechatMiniStore=t.ZEGO_ENV=void 0;var r,n,o=i(12),s=((n=r=t.ZEGO_ENV||(t.ZEGO_ENV={}))[n.BROWSER=0]="BROWSER",n[n.WEIXINMINI=1]="WEIXINMINI",i(3)),a=(c.prototype.getItem=function(e){var t=this;return new Promise((function(i,r){try{i(wx.getStorageSync(t.keyPrefix+e))}catch(i){r(i)}}))},c.prototype.setItem=function(e,t){var i=this;return new Promise((function(r,n){try{wx.setStorageSync(i.keyPrefix+e,t),r()}catch(r){n(r)}}))},c.prototype.removeItem=function(e){var t=this;return new Promise((function(i,r){try{i(wx.removeStorageSync(t.keyPrefix+e))}catch(i){r(i)}}))},c.prototype.clear=function(){return new Promise((function(e,t){try{wx.clearStorageSync(),e()}catch(e){t(e)}}))},c.prototype.keys=function(){var e=this;return new Promise((function(t,i){try{var r=wx.getStorageInfoSync().keys,n=(s.log.warn("keys",r),[]);r.forEach((function(t){0==t.indexOf(e.keyPrefix)&&n.push(t.replace(e.keyPrefix,""))})),s.log.warn("keyArr",JSON.stringify(n)),n.sort(),t(n)}catch(t){i(t)}}))},c);function c(e){this.storeName=e,this.keyPrefix=e+"/"}t.ZegoWechatMiniStore=a,t.createZegoStore=function(e,t,i){return t===r.BROWSER?o.createInstance({name:e+":"+(i||"store")}):new a(e)}},function(e,t){e.exports=n},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.DynamicCode=t.ZegoTracer=t.ZegoSpan=void 0;var r=i(14),n=(Object.defineProperty(t,"ZegoTracer",{enumerable:!0,get:function(){return r.ZegoTracer}}),i(46)),o=(Object.defineProperty(t,"DynamicCode",{enumerable:!0,get:function(){return n.DynamicCode}}),i(10));Object.defineProperty(t,"ZegoSpan",{enumerable:!0,get:function(){return o.ZegoSpan}})},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.ZegoTracer=void 0;var r=i(15),n=i(21),o=i(10),s=i(22),a=i(3),c=i(1),u=i(8),l=i(23),d=i(39),h=i(11),p=i(44),f=i(45);function m(e){this.q=s.DEFAULT_MAX_SPAN_SIZE,this.level=0,this.log=new p.ZegoLog,this.stateCenter=new f.StateCenter(this.log),this.stateCenter.proxyCtrl=e}m.prototype.init=function(e){this.options=e,this.name=e.product,this.reporter=new l.ZegoDataReport(this.name,this.stateCenter),this.reporter.init({appID:e.appID,env:e.env||0,importantLevel:e.importantLevel,levels:e.levels,deviceID:e.deviceID,bps:e.bps,serverUrl:e.serverUrl}),this.tracer=new r.Tracer({name:this.name,version:e.version},{resource:new u.Resource(e.resources)},this.reporter,{spanStart:e.spanStart,spanBeforeEnd:e.spanBeforeEnd,spanEnd:e.spanEnd}),this.reporter.setProcessData(this.tracer.resource.attributes),this.C(this.options),this.dyStore=h.createZegoStore(e.product+"_"+e.appID+"_dy",e.env||0)},m.prototype.C=function(e){this.rootSpan=this.tracer.startSpan("root",0);var t=c.setSpan(this.tracer.context.active(),this.rootSpan);this.tracer.context.T().M=t,this.rootSpan.end()},m.prototype.createSpan=function(e,t,i){var r,u;return e<=this.level?(r=c.setSpan(this.tracer.context.active(),i&&i.parent?i.parent.span:this.rootSpan),u=[],i&&i.linkSpans&&(i.linkSpans.forEach((function(e){u.push({context:e.span.context()})})),delete i.linkSpans),t=this.tracer.startSpan(t,e,Object.assign({},i,{links:u}),r),e=new o.ZegoSpan(t.spanContext.spanId,t),o.ZegoSpan.tracer=this.tracer,e):(a.log.warn("createSpan level not fix"),new o.ZegoSpan(s.NOOP_SPAN_ID,new n.NoopSpan))},m.prototype.setLogger=function(e){this.stateCenter.logger=e},m.prototype.setTimeOffset=function(e){this.reporter.setTimeOffset(e)},m.prototype.setWaitNtpTimeout=function(e){this.reporter.setWaitNtpTimeout(e)},m.prototype.setLogLevel=function(e){return this.stateCenter.F.setLogLevel(e)},m.prototype.startReport=function(e){return this.reporter.startReport(e)},m.prototype.setConfig=function(e){this.reporter.setConfig(e)},m.prototype.loadJs=function(e,t,i,r,n,o){return d.loadJS(e,this.dyStore,t,i,r,n,o)},m.prototype.flush=function(e){this.reporter.flush(e)},m.prototype.setUnloadState=function(e){this.reporter.setUnloadState(e)},m.prototype.shutdown=function(){this.reporter.saveDataBeforeUnload()},m.prototype.destroy=function(){this.reporter.uninit()},m.prototype.setSampleConfig=function(e){this.level=e.level||this.level},m.prototype.setResource=function(e){this.tracer.setResource(e),this.reporter.setProcessData(this.tracer.resource.attributes)},m.prototype.setNetStateCheck=function(){this.reporter.setNetStateCheck()},t.ZegoTracer=m},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.Tracer=void 0;var r=i(6),n=i(1),o=i(2),s=i(7),a=i(8),c=i(9),u=i(18),l=i(19);function d(e,t,i,r){var o=l.mergeConfig(t);this.I=o.traceParams,this.k=new s.IdGenerator,this.resource=null!=(o=t.resource)?o:a.Resource.createTelemetrySDKResource(),this.instrumentationLibrary=e,t=Math.random().toString(36).slice(-6),this.context=new n.ContextAPI(t),this.reporter=i,this.spanProcessor=r||{}}d.prototype.startSpan=function(e,t,i,s){var a,l,d,h=function(e,t){if(!e.root)return n.getSpanContext(t)}(i=void 0===i?{}:i,s=void 0===s?this.context.active():s),p=this.k.generateSpanId(),f=(h&&u.isSpanContextValid(h)?(a=h.traceId,l=h.traceState,d=h.spanId):a=this.k.generateTraceId(),h=null!=(h=i.kind)?h:o.SpanKind.INTERNAL,null!=(f=i.links)?f:[]),m=(i=r.sanitizeAttributes(i.attributes),o.TraceFlags.NONE);return(s=new c.Span(this,s,e,t,{traceId:a,spanId:p,traceFlags:m,traceState:l},h,d,f)).setAttributes(i),this.spanProcessor.spanStart&&this.spanProcessor.spanStart(s),s},d.prototype.setResource=function(e){this.resource=this.resource.merge(new a.Resource(e))},d.prototype.getActiveTraceParams=function(){return this.I},t.Tracer=d},function(e,t,i){"use strict";var r=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(r=o.next()).done;)s.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return s},n=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e},o=(Object.defineProperty(t,"u",{value:!0}),t.StackContextManager=void 0,i(1));function s(){this.W=!1,this.M=o.ROOT_CONTEXT}s.prototype.K=function(e,t){function i(){for(var i=this,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return r.with(t,(function(){return e.apply(i,n)}))}void 0===t&&(t=o.ROOT_CONTEXT);var r=this;return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:e.length}),i},s.prototype.active=function(){return this.M},s.prototype.bind=function(e,t){return void 0===(t=void 0===t?o.ROOT_CONTEXT:t)&&(t=this.active()),"function"==typeof e?this.K(e,t):e},s.prototype.disable=function(){return this.M=o.ROOT_CONTEXT,this.W=!1,this},s.prototype.enable=function(){return this.W||(this.W=!0,this.M=o.ROOT_CONTEXT),this},s.prototype.with=function(e,t,i){for(var r=[],s=3;s<arguments.length;s++)r[s-3]=arguments[s];var a=this.M;this.M=e||o.ROOT_CONTEXT;try{return t.call.apply(t,n([i],r))}finally{this.M=a}},t.StackContextManager=s},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.getCurrentTime=t.isTimeInput=t.hrTimeToMilliseconds=t.hrTimeDuration=t.timeInputToHrTime=t.isTimeInputHrTime=t.hrTime=void 0;var r=Math.pow(10,9),n=["00","01","02","03","04","05","06","07","08","09"];function o(e){e/=1e3;var t=Math.trunc(e);return[t,Number((e-t).toFixed(9))*r]}function s(){var e,t=performance.timeOrigin;return"number"!=typeof t?(e=performance).timing&&e.timing.fetchStart:t}function a(e){var t=o(s()),i=(e=o("number"==typeof e?e:performance.now()),t[0]+e[0]);return r<(t=t[1]+e[1])&&(t-=r,i+=1),[i,t]}function c(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}t.hrTime=a,t.isTimeInputHrTime=c,t.timeInputToHrTime=function(e){if(c(e))return e;if("number"==typeof e)return(e<s()?a:o)(e);if(e instanceof Date)return o(e.getTime());throw TypeError("Invalid input type")},t.hrTimeDuration=function(e,t){var i=t[0]-e[0];return(t=t[1]-e[1])<0&&(--i,t+=r),[i,t]},t.hrTimeToMilliseconds=function(e){return Math.round(1e3*e[0]+e[1]/1e6)},t.isTimeInput=function(e){return c(e)||"number"==typeof e||e instanceof Date},t.getCurrentTime=function(){var e=new Date;return[e.getFullYear()+"/",(n[e.getMonth()+1]||e.getMonth()+1)+"/",(n[e.getDate()]||e.getDate())+" ",(n[e.getHours()]||e.getHours())+":",(n[e.getMinutes()]||e.getMinutes())+":",n[e.getSeconds()]||e.getSeconds(),"."+e.getTime()%1e3].join("")}},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0,i=i(2);var r=/^([0-9a-f]{32})$/i,n=/^[0-9a-f]{16}$/i;function o(e){return r.test(e)&&e!==t.INVALID_TRACEID}function s(e){return n.test(e)&&e!==t.INVALID_SPANID}t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:i.TraceFlags.NONE},t.isValidTraceId=o,t.isValidSpanId=s,t.isSpanContextValid=function(e){return o(e.traceId)&&s(e.spanId)}},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.mergeConfig=void 0;var r=i(20);t.mergeConfig=function(e){var t=Object.assign({},r.DEFAULT_CONFIG,e);return t.traceParams=Object.assign({},r.DEFAULT_CONFIG.traceParams,e.traceParams||{}),t}},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.DEFAULT_CONFIG=void 0,t.DEFAULT_CONFIG={traceParams:{numberOfAttributesPerSpan:128,numberOfLinksPerSpan:128,numberOfEventsPerSpan:128}}},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.NoopSpan=void 0;var r=i(2);function n(e){void 0===e&&(e=r.INVALID_SPAN_CONTEXT),this.X=e}n.prototype.context=function(){return this.X},n.prototype.setAttribute=function(e,t){return this},n.prototype.appendAttribute=function(e,t){return this},n.prototype.setAttributes=function(e){return this},n.prototype.addEvent=function(e,t,i){return this},n.prototype.setStatus=function(e){return this},n.prototype.updateName=function(e){return this},n.prototype.end=function(e){},n.prototype.isRecording=function(){return!1},n.prototype.spanReport=function(){},n.prototype.recordException=function(e,t){},t.NoopSpan=n},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.NOOP_SPAN_ID=t.SCHEDULED_DELAY_MILLIS=t.DEFAULT_MAX_SPAN_SIZE=t.readSpanKeys=void 0,t.readSpanKeys=["name","level","kind","spanContext","parentSpanId","startTime","endTime","status","attributes","links","events","duration","ended","resource","instrumentationLibrary"],t.DEFAULT_MAX_SPAN_SIZE=1e3,t.SCHEDULED_DELAY_MILLIS=3e3,t.NOOP_SPAN_ID="noop"},function(e,t,i){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},n=this&&this.__awaiter||function(e,t,i,r){return new(i=i||Promise)((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){var c=[s,a];if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&c[0]?r.return:c[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,c[1])).done)return n;switch(r=0,(c=n?[2&c[0],n.value]:c)[0]){case 0:case 1:n=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!n||c[1]>n[0]&&c[1]<n[3]))o.label=c[1];else if(6===c[0]&&o.label<n[1])o.label=n[1],n=c;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(c)}}c=t.call(e,o)}catch(a){c=[6,a],r=0}finally{i=n=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},s=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(r=o.next()).done;)s.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return s},a=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e},c=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},u=(Object.defineProperty(t,"u",{value:!0}),t.ZegoDataReport=void 0,i(0)),l=i(24),d=i(30),h=i(38),p=i(5),f=i(4);function m(e,t){this.G=t,this.QUEUE_MAX=100,this.cacheMaxSize=f.CACHE_SIZE.cacheMaxSize,this.cacheDelPer=f.CACHE_SIZE.cacheDelPer,this.state="normal",this.forceDataTotalLen=0,this.reportPackagesSize=0,this.staticConfig={totalAvailCache:f.CACHE_SIZE.totalAvailCache,totalDBSize:f.STORE_SIZE.totalDBSize,bps:1600},this.dataInDb=[],this.listenerList={progressUpdate:[],forceResult:[],postFail:[],dataDroped:[]},this.tempBuffer=[],this.traceType={MEM_I_API:0,MEM_O_DONE:0,MEM_O_DUMP:0,MEM_I_LOAD:0,DB_O_DROP:0,DB_O_DONE:0,DB_I_BACKUP:0},this.isPaused=!1,this.pro="json",this.isLoadReportData=!1,this.dropCount=0,this.timeInterval=!1,this.isWaitNtpTimeout=!1,this.waitNtpTimeout=2e3,this.postDataState="",this.product=e,this.reportMap=new Map}m.prototype.init=function(e){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(i){switch(i.label){case 0:return this.config=r(r({},f.DEFAULT_CONFIG),e),this.config.env%2!=1&&this.H(),this.zegoService=new l.ZegoService(this.config.env||u.ZEGO_ENV.BROWSER,this.config.bps||f.DEFAULT_CONFIG.bps,this.product,this.pro,this.G),this.zegoService.setLogUrlParams({product:this.product,signature:this.config.token||"",appid:this.config.appID,id_name:this.config.userID||"",deviceid:this.config.deviceID||""}),this.config.serverUrl&&this.zegoService.setLogServer(this.config.serverUrl),this.zegoService.setPostSucCallback(this.product,this.Y.bind(this)),this.zegoService.setPostFailCallback(this.product,(function(e){return n(t,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return this.G.logger.warn("zt.zd.i fail"),this.postDataState="fail",this.dropCount++,this.V(e),[4,this.Z(1)];case 1:return t.sent(),this.$("postFail"),[2]}}))}))})),this.tt(),this.storeHandler=new d.ZegoStoreHandler(this.product+"_"+this.config.appID+"_datareporter",p.uuid(6),this.config,this.traceType,this.staticConfig,this.G),this.storeHandler.setDropCallBack((function(e){t.traceType.DB_O_DROP+=p.calculateMemSize(e),t.$("dataDroped",e)})),[4,this.storeHandler.loadPendingData()];case 1:return i.sent(),this.storeHandler.init().then((function(){t.it()})).catch((function(e){console.warn(e)})),this.nt(),this.rt(),this.et(),[2]}}))}))},m.prototype.uninit=function(){this.isWaitNtpTimeout=!1,this.ntpTimer&&(clearTimeout(this.ntpTimer),this.ntpTimer=null),this.zegoService.destroy()},m.prototype.setConfig=function(e){"object"==_typeof(e)&&"number"==typeof e.bps&&(this.config.bps=e.bps,this.zegoService.setBps(this.config.bps)),"object"==_typeof(e)&&"number"==typeof e.totalDBSize&&(this.staticConfig.totalDBSize=e.totalDBSize),"object"==_typeof(e)&&"string"==typeof e.serverUrl&&""!==e.serverUrl&&(this.config.serverUrl=e.serverUrl,this.zegoService.setLogServer(this.config.serverUrl))},m.prototype.pause=function(){this.isPaused=!0},m.prototype.resume=function(){this.isPaused=!1;var e=(t=this.pendingQueue.getPendingDataInfo()).pendingDataSize,t=t.size;this.st(e,t)},m.prototype.startReport=function(e){var t=e.get("userID"),i=e.get("token");return!(!t||"string"!=typeof t||!i||"string"!=typeof i||(this.startCommonField=e,this.config.userID=t,this.config.token=i,this.zegoService.setLogUrlParams({product:this.product,signature:this.config.token,appid:this.config.appID,id_name:this.config.userID||"",deviceid:this.config.deviceID||""}),this.ut()&&this.ot(),(t=e.get("serverUrl"))&&(this.config.serverUrl=t,this.zegoService.setLogServer(this.config.serverUrl)),this.isConfigOK(this.config)&&(e=(i=this.pendingQueue.getPendingDataInfo()).pendingDataSize,t=i.size,this.st(e,t)),0))},m.prototype.setTimeOffset=function(e){var t=this;this.clientTimeOffset=e,this.tempBuffer.forEach((function(e){(e=e.data).tags.time_offset||(e.tags.time_offset=t.clientTimeOffset)})),this.config.userID&&this.ot()},m.prototype.setProcessData=function(e){this.G.processData=e},m.prototype.on=function(e,t){return this.ht(e,t)},m.prototype.off=function(e,t){return this.ct(e,t)},m.prototype.report=function(e,t){var i;if(15e3<e.length)return!1;try{i=JSON.parse(e)}catch(e){return!1}return this.G.F.debug(e+" "+t),(null!=i&&i.id_name||null!=(e=null==i?void 0:i.tags)&&e.id_name||this.config.userID)&&this.ut()?(null!=i&&i.id_name||null!=(e=null==i?void 0:i.tags)&&e.id_name?this.clientTimeOffset&&(i.tags.time_offset=this.clientTimeOffset):(this.clientTimeOffset&&(i.tags.time_offset=this.clientTimeOffset),i.tags.id_name=this.config.userID),this.ft(JSON.stringify(i),t)):this.tempBuffer.push({data:i,level:t}),!0},m.prototype.setUnloadState=function(e){this.unloadLevel=e,this.state="unload"},m.prototype.ft=function(e,t){var i=this,r=p.calculateMemSize(e),n=(this.traceType.MEM_I_API+=r,u.getSeq()),o=(new Date).getTime(),s={seq:n,content:e,level:t,timestamp:o};"unload"===this.state?void 0!==this.unloadLevel&&t<=this.unloadLevel?(this.storeHandler.saveDataToStorage(s),this.pendingQueue.enqueue(s,t)):this.G.F.debug("level is low"):t<=this.config.importantLevel?(s.key=t+"_"+o+"_"+n,this.dataInDb.push(s.key),this.storeHandler.storeData(s).then((function(e){i.pendingQueue.enqueue(s,t),i.traceType.DB_I_BACKUP+=r})).catch((function(e){var r=i.dataInDb.findIndex((function(e){return e===s.key}));-1<r&&i.dataInDb.splice(r,1),i.pendingQueue.enqueue(s,t)}))):this.pendingQueue.enqueue(s,t),"force"===this.state&&(o=p.calculateMemSize(e),this.forceDataTotalLen+=o)},m.prototype.ut=function(){return this.isWaitNtpTimeout||void 0!==this.clientTimeOffset},m.prototype.ot=function(){var e,t=this.tempBuffer.shift();t&&(e=t.data,t=t.level,e.tags.id_name=this.config.userID,this.ft(JSON.stringify(e),t),this.ot())},m.prototype.isConfigOK=function(e){return""!==e.userID&&""!==e.token&&""!==e.server},m.prototype.testSize=function(e){},m.prototype.flush=function(e){var t;"force"!==this.state&&(this.state="force",t=16e6,"object"==_typeof(e)&&"number"==typeof e.bps&&(t=e.bps),this.zegoService.setBps(t),this.forceDataTotalLen=this.storeHandler.storeSize+this.pendingQueue.pendingDataSize+this.reportPackagesSize,t=(e=this.pendingQueue.getPendingDataInfo()).pendingDataSize,e=e.size,0<t?this.st(t,e):this.it())},m.prototype.setWaitNtpTimeout=function(e){this.waitNtpTimeout=e},m.prototype.rt=function(){var e=this;this.ntpTimer=setTimeout((function(){e.isWaitNtpTimeout=!0,e.config.userID&&e.ot()}),this.waitNtpTimeout)},m.prototype.nt=function(){var e=this,t=(this.G.F.debug("startReportTimer "+new Date),this.timeInterval=!0,(i=this.pendingQueue.getPendingDataInfo()).pendingDataSize),i=i.size;this.st(t,i),this.reportTimer=window.setTimeout((function(){e.nt()}),3e4)},m.prototype.et=function(){return n(this,void 0,void 0,(function(){var e,t,i=this;return o(this,(function(r){switch(r.label){case 0:return t=this.pendingQueue.getPendingDataInfo(),e=t.pendingDataSize,t=t.size,e>this.config.reportSize||t>this.config.reportNum?[4,this.st(e,t)]:[3,2];case 1:return r.sent(),[3,3];case 2:this.it(),r.label=3;case 3:return this.checkDataTimer=window.setTimeout((function(){i.et()}),15e3),[2]}}))}))},m.prototype.H=function(){var e=this,t=navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPhone/i);navigator.userAgent.indexOf("Firefox"),window.addEventListener(t?"pagehide":"beforeunload",(function(){window.event&&(window.event.cancelBubble=!0),e.saveDataBeforeUnload()}))},m.prototype.saveDataBeforeUnload=function(){var e=(e=this.pendingQueue.readStoreData(1)).storeArr,t=(this.storeHandler.resetCommonStore(),[]);t.push.apply(t,a(e)),e=this.zegoService.readReportQueueData(),t.push.apply(t,a(e)),0<t.length&&this.storeHandler.storePendingData(t)},m.prototype.setNetStateCheck=function(){"fail"===this.postDataState&&this.zegoService.handleNetConnect()},m.prototype.Y=function(e,t,i){return n(this,void 0,void 0,(function(){var i,r,n,s,a,c=this;return o(this,(function(o){switch(o.label){case 0:for(this.G.F.debug("post suc"),this.postDataState="suc",e.forEach((function(e){c.traceType.MEM_O_DONE+=p.calculateMemSize(e.content)})),i=function(t){var i=e[t];r.storeHandler.removeDataItem(i).then((function(e){i.key&&c.reportMap.delete(i.key)})).catch((function(e){}))},r=this,n=0;n<e.length;n++)i(n);return this.reportPackagesSize-=t,a=this.pendingQueue.getPendingDataInfo(),s=a.pendingDataSize,a=a.size,s>this.config.reportSize||a>this.config.reportNum?[4,this.st(s,a)]:[3,2];case 1:return o.sent(),[3,3];case 2:this.it(),o.label=3;case 3:return"force"===this.state&&0==this.reportPackagesSize&&(s=this.reportPackagesSize+this.pendingQueue.pendingDataSize+this.storeHandler.storeSize,a=1-Number((s/this.forceDataTotalLen).toFixed(2)),this.listenerList.progressUpdate&&this.$("progressUpdate",a),0<this.storeHandler.storeSize)&&this.it((function(e){0===e&&(c.state="normal",c.zegoService.setBps(c.config.bps||f.DEFAULT_CONFIG.bps),c.listenerList.forceSuccessCallback)&&c.$("forceResult","SUCCESS")})),[2]}}))}))},m.prototype.st=function(e,t){return n(this,void 0,void 0,(function(){var i,r,n,s,a;return o(this,(function(o){switch(o.label){case 0:return e>this.config.reportSize||t>this.config.reportNum||["force","unload"].includes(this.state)||this.timeInterval?(this.timeInterval=!1,!this.isPaused&&this.config.userID&&this.config.token&&this.config.serverUrl?[3,3]:(this.G.F.debug("isPaused "+this.isPaused+" "+this.userID+" "+this.config.token+" "+this.config.serverUrl),e>=this.cacheMaxSize||this.staticConfig.totalAvailCache<=0?[4,this.Z(this.cacheDelPer)]:[3,2])):[3,7];case 1:o.sent(),o.label=2;case 2:return[2];case 3:return this.zegoService.reportAllowed()?[3,6]:(this.zegoService.resumeReport(),e>=this.cacheMaxSize||this.staticConfig.totalAvailCache<=0?[4,this.Z(this.cacheDelPer)]:[3,5]);case 4:o.sent(),o.label=5;case 5:return[2];case 6:if(n=this.pendingQueue.readReportData(this.config.reportSize),i=n.totalLen,n=n.reportDataArr,i<=0)return[2];for(n=this.at(n),this.zegoService.report(r=n.packageArr,n=n.packageLen,this.product,"unload"===this.state),s=0;s<r.length;s++)this.reportMap.set((a=r[s]).key,a);this.reportPackagesSize+=n,this.pendingQueue.refresh(i),o.label=7;case 7:return[2]}}))}))},m.prototype.tt=function(){var e=this;this.pendingQueue=new h.PendingQueue(this.config.levels,this.product,this.staticConfig,this.G),this.pendingQueue.setListener({enCallback:function(t,i,r){return n(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.st(r,i)];case 1:return e.sent(),[2]}}))}))}})},m.prototype.lt=function(){var e=this;this.storeHandler.readStoreDataItem().then((function(t){var i=p.calculateMemSize(t.content);e.traceType.MEM_I_LOAD+=i,e.pendingQueue.enqueue(t,t.level)})).catch((function(e){}))},m.prototype.Z=function(e){return n(this,void 0,void 0,(function(){var t,i,r,n,s,a,u,l,d;return o(this,(function(h){switch(h.label){case 0:i=this.pendingQueue.readStoreData(e),t=i.totalLen,i=i.storeArr,r=function(e){var i,r;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,n.vt(e,t)];case 1:return o.sent(),i=e.level+"_"+e.timestamp+"_"+e.seq,-1<(r=n.dataInDb.findIndex((function(e){return e===i})))&&n.dataInDb.splice(r,1),[3,3];case 2:return o.sent(),[3,3];case 3:return[2]}}))},n=this,h.label=1;case 1:h.trys.push([1,6,7,8]),s=c(i),a=s.next(),h.label=2;case 2:return a.done?[3,5]:[5,r(u=a.value)];case 3:h.sent(),h.label=4;case 4:return a=s.next(),[3,2];case 5:return[3,8];case 6:return u=h.sent(),l={error:u},[3,8];case 7:try{a&&!a.done&&(d=s.return)&&d.call(s)}finally{if(l)throw l.error}return[7];case 8:return[2]}}))}))},m.prototype.V=function(e){var t=this;e.length&&e.forEach((function(e){t.storeHandler.storeData(e).then((function(i){var r=p.calculateMemSize(e.content);t.traceType.MEM_O_DUMP+=r})).catch((function(e){}))}))},m.prototype.vt=function(e,t){var i=this;return new Promise((function(t,r){return n(i,void 0,void 0,(function(){var i;return o(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.storeHandler.storeData(e)];case 1:return n.sent(),i=p.calculateMemSize(e.content),this.traceType.MEM_O_DUMP+=i,t(),[3,3];case 2:return i=n.sent(),r(i),[3,3];case 3:return[2]}}))}))}))},m.prototype.it=function(e){var t=this;this.storeHandler.storeSize<=0||this.isLoadReportData||(this.isLoadReportData=!0,this.storeHandler.loadDBData(this.config.reportSize,5,Math.floor(this.cacheMaxSize/3),(function(e){return-1<t.dataInDb.indexOf(e)})).then((function(i){t.isLoadReportData=!1,i.datas.forEach((function(e){var i;t.reportMap.has(e.key)||t.pendingQueue.findInQueue(e)||(i=p.calculateMemSize(e.content),t.traceType.MEM_I_LOAD+=i,t.pendingQueue.enqueue(e,e.level),t.dataInDb.push(e.key))})),e&&e(i.len)})).catch((function(e){t.isLoadReportData=!1})))},m.prototype.at=function(e){var t=this,i=0;return e.forEach((function(e){var r,n,o=JSON.parse(e.content);if(t.startCommonField)try{for(var a=c(t.startCommonField),u=a.next();!u.done;u=a.next()){var l=s(u.value,2),d=l[0];"userID"!==d&&"token"!==d&&"serverUrl"!==d&&(o[d]=l[1])}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}i+=p.calculateMemSize(o),e.content=JSON.stringify(o)})),{packageArr:e,packageLen:i}},m.prototype.ht=function(e,t){return!!this.listenerList[e]&&"function"==typeof t&&(-1==this.listenerList[e].indexOf(t)&&this.listenerList[e].push(t),!0)},m.prototype.ct=function(e,t){var i;return!!this.listenerList[e]&&(i=this.listenerList[e],t?i.splice(i.indexOf(t),1):this.listenerList[e]=[],!0)},m.prototype.$=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this.listenerList[e]&&this.listenerList[e].forEach((function(e){try{e.apply(void 0,a(t))}catch(e){}}))},t.ZegoDataReport=m},function(e,t,i){"use strict";var r=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(r=o.next()).done;)s.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return s},n=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e},o=(Object.defineProperty(t,"u",{value:!0}),t.ZegoService=void 0,i(0)),s=i(25),a=i(29),c=i(4);function u(e,t,i,r,n){var a,c,u,l=this;this.dt=e,this.yt=i,this.wt=r,this.G=n,this.isDestroy=!1,this.websocket=null,this.packageLen=0,this.packagesDataSize=0,this.PACKAGE_MAX_LEN=5,this.msgID=0,this.logUploadTimer=null,this.logUploadInterval=1e4,this.logCacheSend=[],this.logCacheMax=100,this.bt=1e3,this.postSucCallbackList={},this.postFailCallbackList={},this.failCount=0,this.failStartTime=0,this.netWorkFail=!1,this.networkState=o.ENUM_NETWORK_STATE.online,this.state=o.ENUM_CONNECT_STATE.disconnected,this.gt=(c=a=0,u=function(){c=a=0},{onOpen:function(){a=performance.now()},onClose:function(){0<a&&(performance.now()-a<100?(c++,l.G.logger.info("zt.rzs.wfsc frequently shutdown.")):u())},isOutOfMaxTimes:function(){return 10<=c}}),this.bindWindowListener(),this.networkState=o.ENUM_NETWORK_STATE.online,this.service=new s.LogService(e,i,r,n),this.setBps(t),this.reportQueue=new o.Queue}u.prototype.destroy=function(){var e;null!=(e=this.websocket)&&e.close(),this.service.closeSocket(),this.logUploadTimer&&clearTimeout(this.logUploadTimer),this.reportQueue.clear(),this.isDestroy=!0},u.prototype.bindWindowListener=function(){var e=this;window.addEventListener("offline",(function(){e.networkState=o.ENUM_NETWORK_STATE.offline})),window.addEventListener("online",(function(t){e.handleNetConnect()}))},u.prototype.handleNetConnect=function(){this.networkState=o.ENUM_NETWORK_STATE.online;var e=this.url;this.url="",this.setLogServer(e),this.netWorkFail=!1},u.prototype.setLogServer=function(e){try{return e.startsWith("wss:")||e.startsWith("ws:")?(this.logType=o.ENUM_REMOTE_TYPE.WEBSOCKET,this._t(e)):e.startsWith("https:")||e.startsWith("http:")?(this.logType=o.ENUM_REMOTE_TYPE.HTTPS,this.Ot(e)):this.logType=o.ENUM_REMOTE_TYPE.DISABLE,!0}catch(e){return!1}},u.prototype.setLogUrlParams=function(e){this.logParams=e},u.prototype._t=function(e){var t=this;this.url!=e&&(this.url=e)&&(this.St(),this.logParams.id_name)&&(this.gt.isOutOfMaxTimes()?(this.G.logger.warn("zt.rzs.owsls frequently shutdown too many times. cannot create socket anymore."),this.state=o.ENUM_CONNECT_STATE.disconnected):(this.state=o.ENUM_CONNECT_STATE.connecting,e+="?product="+this.logParams.product+"&appid="+this.logParams.appid+"&token="+encodeURIComponent(this.logParams.signature)+"&deviceid="+this.logParams.deviceid+"&id_name="+this.logParams.id_name,this.service.createSocket(e),this.service.openHandler((function(){t.service.onPush(),t.service.startCheck(),t.G.logger.info("zt.rzs.owsls socket open"),t.openHandler(),t.gt.onOpen()})),this.service.closeHandler((function(e){t.G.logger.warn("zt.rzs.owsls socket close "+JSON.stringify(e.code||e)),t.state=o.ENUM_CONNECT_STATE.disconnected,t.service.closeSocket(),t.gt.onClose()})),this.service.errorHandler((function(e){t.G.logger.warn("zt.rzs.owsls socket error "+JSON.stringify(e.code||e)),t.state=o.ENUM_CONNECT_STATE.disconnected,t.service.closeSocket()}))))},u.prototype.St=function(){this.service.closeSocket()},u.prototype.Ot=function(e){(this.url=e)&&this.Mt()},u.prototype.Mt=function(){this.logUploadTimer&&(clearInterval(this.logUploadTimer),this.logUploadTimer=null)},u.prototype.Et=function(e,t,i,r){this.dt===o.ZEGO_ENV.BROWSER?this.jt(e,t,i,r):this.SendHttpsLogWeChatMini(e,t,i,r)},u.prototype.jt=function(e,t,i,r){var n=this,o=(e=JSON.stringify({body:{data:e}}),new XMLHttpRequest);o.onreadystatechange=function(){if(4==o.readyState)if(200==o.status){if(0!=o.responseText.length)try{var e=JSON.parse(o.responseText).interval;"number"==typeof e&&n.logUploadInterval!==e&&n.Ot(n.url),i&&i()}catch(e){r&&r()}}else r&&r()},o.open("POST",this.url,!0),o.send(e)},u.prototype.SendHttpsLogWeChatMini=function(e,t,i,r){var n=this;e={appid:this.logParams.appid+"",timestamp:(new Date).getTime()+"",token:this.logParams.signature,id_name:this.logParams.id_name,product:this.logParams.product,message_id:++this.msgID,req_sdk:1,s:JSON.stringify({speed_detail:e})},wx.request({url:this.url,data:JSON.stringify(e),method:"POST",success:function(e){0!=e.data.length&&("number"==typeof(e=e&&e.data&&e.data.interval)&&n.logUploadInterval!==e&&n.Ot(n.url),i)&&i()},fail:function(e){r&&r()}})},u.prototype.openHandler=function(){this.state=o.ENUM_CONNECT_STATE.connected,this.startReport()},u.prototype.setPostSucCallback=function(e,t){this.postSucCallbackList[e]=t},u.prototype.setPostFailCallback=function(e,t){this.postFailCallbackList[e]=t},u.prototype.reportAllowed=function(){return this.packageLen<this.PACKAGE_MAX_LEN},u.prototype.report=function(e,t,i,r){this.packageLen++,this.packagesDataSize+=t,this.reportQueue.enqueue({reportDatas:e,dataLen:t,product:i}),this.netWorkFail=!1,this.failCount=0,this.failStartTime=0,this.startReport(r)},u.prototype.setBps=function(e){this.tokenBucket=new a.TokenBucket(c.BUCKET_CONFIG.bucketSize,e/8,"sec")},u.prototype.startReport=function(e){var t,i,r,n,s=this;this.isDestroy||(this.logType===o.ENUM_REMOTE_TYPE.WEBSOCKET&&this.state===o.ENUM_CONNECT_STATE.disconnected?(t=this.url,this.url="",this.setLogServer(t)):0<this.reportQueue.size()&&(t=this.reportQueue.dequeue(),i=t.reportDatas,r=t.dataLen,n=t.product,new Date,e?this.sendReport(i,r,n):this.tokenBucket.removeTokens(r,(function(){s.sendReport(i,r,n)}))))},u.prototype.Tt=function(){if(this.failCount<=0)return!1;1==this.failCount&&(this.failStartTime=Date.now());var e=(Date.now()-this.failStartTime)/1e3;return this.failCount>=c.FAIL_COUNT&&e>c.FAIL_TIME||this.failCount>=c.FAIL_MAX_COUNT},u.prototype.sendReport=function(e,t,i){var r=this;this.reportData(e,t,i,(function(){r.failCount=0,r.failStartTime=0,r.packageLen--,r.packagesDataSize-=t,r.postSucCallbackList[i]&&r.postSucCallbackList[i](e,t,i)}),(function(n){var o;r.reportQueue.enqueue({reportDatas:e,dataLen:t,product:i}),r.failCount++,r.Tt()?(r.netWorkFail=!0,o=r.decodeReportQueue(),Object.keys(r.postFailCallbackList).forEach((function(e){r.postFailCallbackList[i](o[e])}))):r.startReport()}))},u.prototype.resumeReport=function(){!0===this.netWorkFail&&this.networkState===o.ENUM_NETWORK_STATE.online&&(this.netWorkFail=!1,this.startReport())},u.prototype.reportData=function(e,t,i,r,n){var s=this,a=[];e.forEach((function(e){a.push(JSON.parse(e.content))})),this.logType==o.ENUM_REMOTE_TYPE.WEBSOCKET?this.networkState===o.ENUM_NETWORK_STATE.offline?n&&n(o.errorList.BROKEN):this.service.sendMessage("report",a,r,(function(e){var t;s.state===o.ENUM_CONNECT_STATE.disconnected&&e===o.SOCKET_DISCONNECT&&(t=s.url,s.url="",s.setLogServer(t)),n&&n(e)})):this.logType==o.ENUM_REMOTE_TYPE.HTTPS&&this.Et(a,t,r,(function(){n&&n()}))},u.prototype.unsigned2signed=function(e){var t=parseInt(e,10);if(256<t)return t%256;for(var i=[];0<t;)i.push(t%2!=0?1:0),t=Number(t/2);for(i.reverse();i.length<8;)i.unshift(0);var r="";if(1==(i=i.join("")).substr(0,1)){for(var n=1;n<i.length;n++)1==i.substr(n,1)?r+=0:r+=1;return"-"+(parseInt(r,2)+1)}for(n=0;n<i.length;n++)r+=i.substr(n,1);return parseInt(r,2)},u.prototype.decodeReportQueue=function(){for(var e={},t=this.reportQueue.size(),i=0;i<t;i++){var r=this.reportQueue.dequeue(),o=r.reportDatas,s=r.dataLen;e[r=r.product]||(e[r]=[]),e[r]=n(e[r],o),this.reportQueue.enqueue({reportDatas:o,dataLen:s,product:r})}return e},u.prototype.readReportQueueData=function(){for(var e=[],t=this.reportQueue.size(),i=0;i<t;i++){var r=this.reportQueue.dequeue();e.push.apply(e,n(r.reportDatas))}return e},t.ZegoService=u},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.LogService=void 0;var r=i(26),n=i(4),o=i(0);function s(e,t,i,n){this.dt=e,this.yt=t,this.wt=i,this.G=n,this.Nt=new r.ZegoSocketService(this.dt,this.yt,this.wt,this.G),this.At=0,this.Rt={}}s.prototype.It=function(e){var t,i,r=this,n=this.Nt.sendCommandMap[e.messageId||(null==(n=null==e?void 0:e.data)?void 0:n.message_id)];null!=n&&(i=n.v,delete this.Nt.sendCommandMap[e.messageId||(null==(t=null==e?void 0:e.data)?void 0:t.message_id)],this.Nt.sendCommandList.remove(n),0===e.code?setTimeout((function(){i&&null!=i.success&&i.success(e,r.At)}),0):setTimeout((function(){i&&null!=i.error&&i.error(e,r.At)}),0))},s.prototype.onPush=function(){var e=this;this.Nt.onMessage=function(t){e.It(t)}},s.prototype.closeHandler=function(e){this.Nt.closeHandler(e)},s.prototype.openHandler=function(e){this.Nt.openHandler(e)},s.prototype.errorHandler=function(e){this.Nt.errorHandler(e)},s.prototype.kt=function(e){return{Protocol:"req",cmd:e,appid:123,seq:++this.At,session_id:""}},s.prototype.startCheck=function(){this.Nt.startCheck()},s.prototype.stopCheck=function(){this.Nt.stopCheck()},s.prototype.isDisConnect=function(){return!this.Nt||this.Nt.isDisConnect()},s.prototype.createSocket=function(e){this.Nt.createSocket(e),this.Rt={}},s.prototype.closeSocket=function(){this.Nt.closeSocket()},s.prototype.sendMessage=function(e,t,i,r,s,a){return this.Nt.isDisConnect()?(r&&r(o.SOCKET_DISCONNECT),0):(s=s||this.kt(e),this.Nt.sendMessage(s,t,i,r,{timeOut:1e3*n.DEFAULT_CONFIG.netTimeout}))},s.prototype.on=function(e,t){this.Rt[e]=t},t.LogService=s},function(e,t,i){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},n=(Object.defineProperty(t,"u",{value:!0}),t.ZegoSocketService=void 0,i(27)),o=i(0),s=i(28);function a(e,t,i,r){this.yt=t,this.wt=i,this.G=r,this.Dt=null,this.sendCommandList=new o.LinkedList,this.sendCommandMap={},this.xt=100,this.Pt=3e4,this.Bt=2e3,this.ENV=e}a.prototype.createSocket=function(e){this.Dt=n.createZegoWebSocket(e,this.ENV,this.G.proxyCtrl),this.Dt.binaryType="arraybuffer"},a.prototype.closeSocket=function(){this.Dt&&(this.Dt.onclose=null,this.Dt.onerror=null,this.Dt.close(),this.Dt=null)},a.prototype.isDisConnect=function(){return!this.Dt||1!==this.Dt.readyState},a.prototype.sendMessage=function(e,t,i,n,o){void 0===i&&(i=null),void 0===n&&(n=null),void 0===o&&(o={timeOut:6e3});var a=r(r({},this.G.processData),{time_upload:Date.now()});return a={data:t={message_id:e.seq,product:this.yt,s:JSON.stringify({speed_detail:t,process:a})},seq:e.seq,deleted:!1,sendTime:Date.parse(new Date+""),timeOut:o.timeOut,success:i,error:n},o=this.sendCommandList.push(a),this.sendCommandMap[a.seq]=o,this.Dt&&"pb"!==this.wt&&(this.G.F.debug("upload data",JSON.stringify(t)),i=s.deflate(JSON.stringify(t)),this.Dt.send(i)),e.seq},a.prototype.Ut=function(e){for(var t=e.getFirst();null!=t;)e.remove(t),t.v&&t.v.error&&setTimeout((function(){t&&t.v&&t.v.error&&t.v.error(o.errorList.TIMEOUT,t.v.data.message_id,t.v.data.s)}),0),t=e.getFirst()},a.prototype.zt=function(e,t){for(var i=e.getFirst(),r=Date.parse(new Date+""),n=0;!(null==i||i.v&&i.v.sendTime+i.v.timeOut>r||(i.v&&delete t[i.v.data.message_id],e.remove(i),!(i.v&&null==i.v.error||i.v&&i.v.sendTime+this.Pt<r)&&i&&i.v&&i.v.error&&i.v.error(o.errorList.TIMEOUT,i.v.data.message_id,i.v.data.s),++n>=this.xt));)i=e.getFirst()},a.prototype.startCheck=function(){var e=this;this.zt(this.sendCommandList,this.sendCommandMap),this.Lt=setTimeout((function(){e.startCheck()}),this.Bt)},a.prototype.stopCheck=function(){this.Ut(this.sendCommandList),clearTimeout(this.Lt)},a.prototype.openHandler=function(e){var t=this;this.Dt&&(this.Dt.onopen=function(i){t.responseHandler(),e(i)})},a.prototype.responseHandler=function(){var e=this;this.Dt&&(this.Dt.onmessage=function(t){t="string"==typeof t.data?JSON.parse(t.data):JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t.data))),e.onMessage(t)})},a.prototype.closeHandler=function(e){this.Dt&&(this.Dt.onclose=function(t){e(t)})},a.prototype.errorHandler=function(e){this.Dt&&(this.Dt.onerror=e)},a.prototype.onMessage=function(e){},t.ZegoSocketService=a},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.createZegoWebSocket=t.ZegoWeiXinMiniWebSocket=void 0;var r=i(0),n=(o.prototype.init=function(){var e=this;this.Jt&&(this.readyState=0,this.Jt.onOpen((function(t){e.readyState=e.Jt.readyState,"function"==typeof e.onopen&&(e.onopen(t),e.Jt.onClose((function(t){e.readyState=e.Jt.readyState,"function"==typeof e.onclose&&e.onclose(t)})),e.Jt.onMessage((function(t){"function"==typeof e.onmessage&&e.onmessage(t)})))})),this.Jt.onError((function(t){e.readyState=e.Jt.readyState,"function"==typeof e.onerror&&e.onerror(t)})))},o.prototype.onopen=function(e){},o.prototype.onerror=function(e){},o.prototype.onclose=function(e){},o.prototype.onmessage=function(e){},o.prototype.send=function(e){this.Jt&&this.Jt.send({data:e})},o.prototype.close=function(){this.Jt&&this.Jt.close()},o);function o(e,t){this.url=e,this.readyState=3,this.Jt=wx.connectSocket({url:e}),this.init()}t.ZegoWeiXinMiniWebSocket=n,t.createZegoWebSocket=function(e,t,i){return t%2===r.ZEGO_ENV.BROWSER?(t=e,i?i.createSocket(t,1):new WebSocket(t)):new n(e)}},function(e,t){e.exports=o},function(e,t,i){"use strict";function r(e,t,i,r){if(this.bucketSize=1,this.tokensPerInterval=1,this.interval=1e3,this.parentBucket=null,this.content=0,this.lastDrip=0,this.bucketSize=e,this.tokensPerInterval=t,"string"==typeof i)switch(i){case"sec":case"second":this.interval=1e3;break;case"min":case"minute":this.interval=6e4;break;case"hr":case"hour":this.interval=36e5;break;case"day":this.interval=864e5;break;default:throw new Error("Invaid interval "+i)}else this.interval=i;this.parentBucket=r,this.content=0,this.lastDrip=+new Date}Object.defineProperty(t,"u",{value:!0}),t.TokenBucket=void 0,r.prototype.removeTokens=function(e,t){var i=this;return this.bucketSize?e>this.bucketSize?(setTimeout(t.bind(null,"Requested tokens "+e+" exceeds bucket size "+this.bucketSize,null),0),!1):(this.drip(),e>this.content?r():this.parentBucket?this.parentBucket.removeTokens(e,(function(n,o){return n?t(n,null):e>i.content?r():(i.content-=e,void t(null,Math.min(o,i.content)))})):(this.content-=e,setTimeout(t.bind(null,null,this.content),0),!0)):(setTimeout(t.bind(null,null,e,Number.POSITIVE_INFINITY),0),!0);function r(){var r=Math.ceil(i.interval/i.tokensPerInterval*(e-i.content));return setTimeout((function(){i.removeTokens(e,t)}),r),!1}},r.prototype.tryRemoveTokens=function(e){if(this.bucketSize){if(e>this.bucketSize)return!1;if(this.drip(),e>this.content)return!1;if(this.parentBucket&&!this.parentBucket.tryRemoveTokens(e))return!1;this.content-=e}return!0},r.prototype.drip=function(){var e,t;this.tokensPerInterval?(t=+new Date,e=Math.max(t-this.lastDrip,0),this.lastDrip=t,t=e*(this.tokensPerInterval/this.interval),this.content=Math.min(this.content+t,this.bucketSize)):this.content=this.bucketSize},t.TokenBucket=r},function(e,t,i){"use strict";var r=this&&this.__awaiter||function(e,t,i,r){return new(i=i||Promise)((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){var c=[s,a];if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&c[0]?r.return:c[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,c[1])).done)return n;switch(r=0,(c=n?[2&c[0],n.value]:c)[0]){case 0:case 1:n=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!n||c[1]>n[0]&&c[1]<n[3]))o.label=c[1];else if(6===c[0]&&o.label<n[1])o.label=n[1],n=c;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(c)}}c=t.call(e,o)}catch(a){c=[6,a],r=0}finally{i=n=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},o=this&&this.__importDefault||function(e){return e&&e.u?e:{default:e}},s=(Object.defineProperty(t,"u",{value:!0}),t.ZegoStoreHandler=void 0,i(11)),a=i(5),c=i(4),u=o(i(12));function l(e,t,i,r,n,o){this.O=e,this.qt=t,this.Ct=i,this.Ft=r,this.Wt=n,this.G=o,this.storeSize=0,this.storeTime=0,this.storeDelPer=c.STORE_SIZE.storeDelPer,this.updateTimeFreq=6e4,this.storeSleepInterval=6e5,this.droping=!1,this.bufferData=[],this.updateTimer=null,this.interSymbol="#",this.drops=[],this.storesKeys="",this.transStores=[],this.store=s.createZegoStore(e,i.env,t),this.commonStore=s.createZegoStore("data_common",i.env,"reporter")}Object.defineProperty(l.prototype,"Kt",{get:function(){return"z_t_"+this.Ct.appID},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"Xt",{get:function(){return"z_store_keys"},enumerable:!1,configurable:!0}),l.prototype.init=function(){return r(this,void 0,void 0,(function(){var e,t;return n(this,(function(i){switch(i.label){case 0:return i.trys.push([0,6,,7]),this.setCommonStoreState(),[4,this.transferStoreData()];case 1:return i.sent(),[4,this.commonStore.getItem(this.O+this.interSymbol+this.qt)];case 2:return(e=i.sent())?[3,4]:[4,this.commonStore.setItem(this.O+this.interSymbol+this.qt,t={storeSize:this.storeSize,lock:0,pros:1})];case 3:return i.sent(),[3,5];case 4:t="string"==typeof e?JSON.parse(e):e,this.storeSize=t.storeSize,i.label=5;case 5:return[3,7];case 6:return i.sent(),[3,7];case 7:return[2]}}))}))},l.prototype.uninit=function(){this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null)},l.prototype.setCommonStoreState=function(){var e=this,t=(this.getStorage(this.Xt)||"").split(";");this.transStores=t.filter((function(t){return t.includes(e.Ct.appID+"")})),t=t.filter((function(t){return!t.includes(e.Ct.appID+"")})),this.storesKeys=t.join(";")},l.prototype.resetCommonStore=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return this.saveStorage(this.Xt,this.storesKeys+(0<this.storesKeys.length?";":"")+this.O+this.interSymbol+this.qt),[4,this.commonStore.setItem(this.O+this.interSymbol+this.qt,{storeSize:this.storeSize,lock:0,pros:0})];case 1:return e.sent(),[2]}}))}))},l.prototype.transferStoreData=function(){return r(this,void 0,void 0,(function(){var e,t,i,o,c=this;return n(this,(function(u){switch(u.label){case 0:return[4,this.commonStore.keys()];case 1:e=u.sent(),t=function(t){var o,u,l,d,h,p,f,m;return n(this,(function(v){switch(v.label){case 0:return(o=e[t])===i.O+i.interSymbol+i.qt?[3,9]:[4,i.commonStore.getItem(o)];case 1:return(u="string"==typeof(u=v.sent())?JSON.parse(u):u).lock||u.pros&&!i.transStores.includes(o)?[3,9]:(d=o.split(i.interSymbol),[4,(h=s.createZegoStore(l=d[0],i.Ct.env,d=d[1])).keys()]);case 2:return 0!=(p=v.sent()).length?[3,3]:[3,8];case 3:return u.lock=1,[4,i.commonStore.setItem(o,u)];case 4:v.sent(),f=function(e){var t,o,s;return n(this,(function(u){switch(u.label){case 0:return[4,h.getItem(t=p[e])];case 1:return o=u.sent(),-1!==t.indexOf("pending")?o&&JSON.parse(o).forEach((function(e){return r(c,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,this.storeData(e)];case 1:return t.sent(),[2]}}))}))})):(s=a.analyzeKey(t),i.storeData({level:s.level,timestamp:s.timestamp,seq:s=s.seq,content:o})),setTimeout((function(){return r(c,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,h.removeItem(t)];case 1:return e.sent(),[2]}}))}))}),300),[2]}}))},m=0,v.label=5;case 5:return m<p.length?[5,f(m)]:[3,8];case 6:v.sent(),v.label=7;case 7:return m++,[3,5];case 8:i.drops.push({name:l,storeName:d}),v.label=9;case 9:return[2]}}))},i=this,o=0,u.label=2;case 2:return o<e.length?[5,t(o)]:[3,5];case 3:u.sent(),u.label=4;case 4:return o++,[3,2];case 5:return this.transportStorageData(),setTimeout((function(){return r(c,void 0,void 0,(function(){var e,t,i;return n(this,(function(r){switch(r.label){case 0:e=0,r.label=1;case 1:if(!(e<this.drops.length))return[3,7];t=(i=this.drops[e]).name,i=i.storeName,r.label=2;case 2:return r.trys.push([2,5,,6]),[4,this.dropInstance(t,i)];case 3:return r.sent(),[4,this.commonStore.removeItem(t+this.interSymbol+i)];case 4:case 5:return r.sent(),[3,6];case 6:return e++,[3,1];case 7:return[2]}}))}))}),1e3),[2]}}))}))},l.prototype.dropInstance=function(e,t){return new Promise((function(i,r){u.default.dropInstance({name:e+":"+t}).then((function(){i()})).catch((function(e){r(e)}))}))},l.prototype.setDropCallBack=function(e){this.dropCallBack=e},l.prototype.storeData=function(e){var t=this;return new Promise((function(i,o){return r(t,void 0,void 0,(function(){var t,r,o,s,c=this;return n(this,(function(n){switch(n.label){case 0:r=e.content,o=(t=e.level)+"_"+(o=e.timestamp)+"_"+e.seq,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.store.getItem(o)];case 2:return n.sent()?(i(),[2]):[3,4];case 3:return n.sent(),[3,4];case 4:if(this.droping)return this.bufferData.push(e),[2];if(s=a.calculateMemSize(o)+a.calculateMemSize(r),this.Wt.totalDBSize-s<=0)return this.dropDBData(t,o,r).then((function(){c.droping=!1,c.bufferDump()})).catch((function(e){})),i(),[2];n.label=5;case 5:return n.trys.push([5,8,,9]),[4,this.store.setItem(o,r)];case 6:return n.sent(),this.storeSize+=s,this.Wt.totalDBSize-=s,[4,this.Gt()];case 7:return n.sent(),i(),[3,9];case 8:return"QuotaExceededError"===n.sent().name&&this.dropDBData(t,o,r).then((function(){c.droping=!1,c.bufferDump()})).catch((function(e){})),[3,9];case 9:return[2]}}))}))}))},l.prototype.loadPendingData=function(){return r(this,void 0,void 0,(function(){var e=this;return n(this,(function(t){switch(t.label){case 0:return[4,this.store.keys()];case 1:return t.sent().forEach((function(t){return r(e,void 0,void 0,(function(){var e,i=this;return n(this,(function(o){switch(o.label){case 0:return-1===t.indexOf("pending")?[3,3]:[4,this.store.getItem(t)];case 1:return(e=o.sent())?(JSON.parse(e).forEach((function(e){return r(i,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,this.storeData(e)];case 1:return t.sent(),[2]}}))}))})),[4,this.store.removeItem(t)]):[3,3];case 2:o.sent(),o.label=3;case 3:return[2]}}))}))})),[2]}}))}))},l.prototype.storePendingData=function(e){return r(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,this.store.setItem("pending"+(new Date).getTime(),JSON.stringify(e))];case 1:return t.sent(),[2]}}))}))},l.prototype.bufferDump=function(){return r(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return(e=this.bufferData.pop())?[4,this.storeData(e)]:[3,2];case 1:t.sent(),this.bufferDump(),t.label=2;case 2:return[2]}}))}))},l.prototype.dropDBData=function(e,t,i){return r(this,void 0,void 0,(function(){var e=this;return n(this,(function(o){return this.droping=!0,[2,new Promise((function(o,s){return r(e,void 0,void 0,(function(){var e,r,c,u,l;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,10,,11]),[4,this.store.keys()];case 1:(e=n.sent()).reverse(),r=Math.ceil(e.length*this.storeDelPer),c=0,n.label=2;case 2:return c<r?[4,this.store.getItem(e[c])]:[3,7];case 3:return null==(u=n.sent())?[3,6]:[4,this.store.removeItem(e[c])];case 4:return n.sent(),l=a.calculateMemSize(e[c])+a.calculateMemSize(u),this.Wt.totalDBSize+=l,this.storeSize-=l,[4,this.Gt()];case 5:n.sent(),this.dropCallBack(u),n.label=6;case 6:return c++,[3,2];case 7:return[4,this.store.setItem(t,i)];case 8:return n.sent(),this.storeSize+=a.calculateMemSize(t)+a.calculateMemSize(i),[4,this.Gt()];case 9:return n.sent(),o(),[3,11];case 10:return l=n.sent(),s(l),[3,11];case 11:return[2]}}))}))}))]}))}))},l.prototype.removeDataItem=function(e){var t=this;return new Promise((function(i,o){return r(t,void 0,void 0,(function(){var t,r,s,c,u;return n(this,(function(n){switch(n.label){case 0:t=(t=e.level)+"_"+(s=e.timestamp)+"_"+(c=e.seq),n.label=1;case 1:return n.trys.push([1,6,,7]),[4,this.store.getItem(t)];case 2:return(r=n.sent())?[4,this.store.removeItem(t)]:[3,5];case 3:return n.sent(),s=a.calculateMemSize(1==this.Ct.env?JSON.parse(r):r),c=a.calculateMemSize(t)+s,this.storeSize-=c,this.Wt.totalDBSize+=c,this.Ft.DB_O_DONE+=c,[4,this.Gt()];case 4:n.sent(),i(),n.label=5;case 5:return[3,7];case 6:return u=n.sent(),o(u),[3,7];case 7:return[2]}}))}))}))},l.prototype.Gt=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),[4,this.commonStore.getItem(this.O+this.interSymbol+this.qt)];case 1:return e.sent()?[4,this.commonStore.setItem(this.O+this.interSymbol+this.qt,{storeSize:this.storeSize,lock:0,pros:1})]:[3,3];case 2:e.sent(),e.label=3;case 3:return[3,5];case 4:return e.sent(),[3,5];case 5:return[2]}}))}))},l.prototype.readStoreDataItem=function(){var e=this;return new Promise((function(t,i){return r(e,void 0,void 0,(function(){var e,r,o,s;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,this.store.keys()];case 1:return e=n.sent(),[4,this.store.getItem(e[0])];case 2:return r=n.sent(),o=a.analyzeKey(e[0]),t({level:s=o.level,timestamp:o.timestamp,seq:o=o.seq,content:r}),[3,4];case 3:return s=n.sent(),i(s),[3,4];case 4:return[2]}}))}))}))},l.prototype.loadDBData=function(e,t,i,o){var s=this;return new Promise((function(c,u){return r(s,void 0,void 0,(function(){var r,s,l,d,h,p,f,m,v,g;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),[4,this.store.keys()];case 1:r=n.sent(),s=[],p=h=d=l=0,n.label=2;case 2:return p<r.length?o(r[p])?[3,4]:[4,this.store.getItem(r[p])]:[3,5];case 3:if(null==(f=n.sent()))return[3,4];if(m=a.analyzeKey(r[p]),s.push({level:m.level,timestamp:g=m.timestamp,seq:m=m.seq,content:f,key:r[p]}),v=a.calculateMemSize(f),d+=v,e<=(l+=v)&&(l=0,h++),t<=h&&i<=d)return[3,5];n.label=4;case 4:return p++,[3,2];case 5:return c({datas:s,len:d}),[3,7];case 6:return g=n.sent(),u(g),[3,7];case 7:return[2]}}))}))}))},l.prototype.sortKeys=function(e,t){void 0===t&&(t=!1),e.sort((function(e,t){return e=e.split("_"),+(t=t.split("_"))[0]-+e[0]||+t[1]-+e[1]||+t[2]-+e[2]})),t&&e.reverse()},l.prototype.saveStorage=function(e,t){try{localStorage.setItem(e,t)}catch(e){this.G.F.debug("storage set err")}},l.prototype.getStorage=function(e){try{return localStorage.getItem(e)}catch(e){this.G.F.debug("storage get err")}},l.prototype.saveDataToStorage=function(e){try{this.saveStorage(this.Kt+"_"+e.level+"_"+e.timestamp+"_"+e.seq,e.content)}catch(e){this.G.F.debug("saveDataToStorage "+JSON.stringify(e))}},l.prototype.transportStorageData=function(){for(var e=[],t=0;t<localStorage.length;t++){var i,r,n,o,s=localStorage.key(t);this.G.F.debug("transportStorageData "+s),null!=s&&s.startsWith(this.Kt)&&(n=s.replace(this.Kt+"_",""),i=(n=a.analyzeKey(n)).level,r=n.timestamp,n=n.seq,"string"==typeof(o=this.getStorage(s))&&this.storeData({level:i,timestamp:r,seq:n,content:o}),e.push(s))}setTimeout((function(){for(var t=0;t<e.length;t++)localStorage.removeItem(e[t])}),100)},t.ZegoStoreHandler=l},function(e,t,i){"use strict";var r=i(32),n=i(33).Buffer;e.exports=function(e){return function e(t){return function(i){if(n.isBuffer(i))return i.length;switch(_typeof(i)){case"string":return i.length*r.STRING;case"boolean":return r.BOOLEAN;case"number":return r.NUMBER;case"symbol":return Symbol.keyFor&&Symbol.keyFor(i)?Symbol.keyFor(i).length*r.STRING:(i.toString().length-8)*r.STRING;case"object":if(Array.isArray(i))return i.map(e(t)).reduce((function(e,t){return e+t}),0);var o=t,s=i;if(null==s)return 0;for(var a=0,c=function(e){var t,i=[];for(t in e)i.push(t);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),Array.prototype.push.apply(i,e)),i}(s),u=0;u<c.length;u++){var l=c[u];if("object"==_typeof(s[l])&&null!==s[l]){if(o.has(s[l]))continue;o.add(s[l])}a+=e(o)(l);try{a+=e(o)(s[l])}catch(o){o instanceof RangeError&&(a=0)}}return a;default:return 0}}}(new WeakSet)(e)}},function(e,t){e.exports={STRING:2,BOOLEAN:4,NUMBER:8}},function(e,t,i){"use strict";(function(e){var r=i(35),n=i(36),o=i(37);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(e=null===e?new c(t):e).length=t,e}function c(e,t,i){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,i);if("number"!=typeof e)return u(this,e,t,i);if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}function u(e,t,i,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer){var n=e,s=t,u=i;if(u<0||s.byteLength<u)throw new RangeError("'offset' is out of bounds");if(s.byteLength<u+(r||0))throw new RangeError("'length' is out of bounds");return s=void 0===u&&void 0===r?new Uint8Array(s):void 0===r?new Uint8Array(s,u):new Uint8Array(s,u,r),c.TYPED_ARRAY_SUPPORT?(n=s).__proto__=c.prototype:n=h(n,s),n}if("string"!=typeof t){if(u=e,c.isBuffer(r=t))return 0!==(u=a(u,s=0|p(r.length))).length&&r.copy(u,0,0,s),u;if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(s=r.length)!=s?a(u,0):h(u,r);if("Buffer"===r.type&&o(r.data))return h(u,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}if(n=e,r=t,c.isEncoding(e="string"==typeof(e=i)&&""!==e?e:"utf8"))return(r=(n=a(n,t=0|f(r,e))).write(r,e))!==t?n.slice(0,r):n;throw new TypeError('"encoding" must be a valid string encoding')}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(l(t),e=a(e,t<0?0:0|p(t)),!c.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function h(e,t){var i=t.length<0?0:0|p(t.length);e=a(e,i);for(var r=0;r<i;r+=1)e[r]=255&t[r];return e}function p(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function f(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;var i=(e="string"!=typeof e?""+e:e).length;if(0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return A(e).length;default:if(r)return P(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function v(e,t,i,r,n){if(0===e.length)return-1;if("string"==typeof i?(r=i,i=0):2147483647<i?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,(i=(i=isNaN(i)?n?0:e.length-1:i)<0?e.length+i:i)>=e.length){if(n)return-1;i=e.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:g(e,t,i,r,n);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(n?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,i):g(e,[t],i,r,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,i,r,n){var o=1,s=e.length,a=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s/=o=2,a/=2,i/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n)for(var u=-1,l=i;l<s;l++)if(c(e,l)===c(t,-1===u?0:l-u)){if(l-(u=-1===u?l:u)+1===a)return u*o}else-1!==u&&(l-=l-u),u=-1;else for(l=i=s<i+a?s-a:i;0<=l;l--){for(var d=!0,h=0;h<a;h++)if(c(e,l+h)!==c(t,h)){d=!1;break}if(d)return l}return-1}function y(e,t,i,r){return D(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,r)}function b(e,t,i){i=Math.min(e.length,i);for(var r=[],n=t;n<i;){var o,s,a,c,u=e[n],l=null,d=239<u?4:223<u?3:191<u?2:1;if(n+d<=i)switch(d){case 1:u<128&&(l=u);break;case 2:128==(192&(o=e[n+1]))&&127<(c=(31&u)<<6|63&o)&&(l=c);break;case 3:s=e[n+2],128==(192&(o=e[n+1]))&&128==(192&s)&&2047<(c=(15&u)<<12|(63&o)<<6|63&s)&&(c<55296||57343<c)&&(l=c);break;case 4:s=e[n+2],a=e[n+3],128==(192&(o=e[n+1]))&&128==(192&s)&&128==(192&a)&&65535<(c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)&&c<1114112&&(l=c)}null===l?(l=65533,d=1):65535<l&&(r.push((l-=65536)>>>10&1023|55296),l=56320|1023&l),r.push(l),n+=d}var h=r,p=h.length;if(p<=_)return String.fromCharCode.apply(String,h);for(var f="",m=0;m<p;)f+=String.fromCharCode.apply(String,h.slice(m,m+=_));return f}t.Buffer=c,t.SlowBuffer=function(e){return c.alloc(+(e=+e!=e?0:e))},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),c.poolSize=8192,c.Ht=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,i){return u(null,e,t,i)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol)&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0}),c.alloc=function(e,t,i){return l(e),e<=0||void 0===t?a(null,e):"string"==typeof i?a(null,e).fill(t,i):a(null,e).fill(t)},c.allocUnsafe=function(e){return d(null,e)},c.allocUnsafeSlow=function(e){return d(null,e)},c.isBuffer=function(e){return!(null==e||!e.Yt)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,r=t.length,n=0,o=Math.min(i,r);n<o;++n)if(e[n]!==t[n]){i=e[n],r=t[n];break}return i<r?-1:r<i?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);if(void 0===t)for(n=t=0;n<e.length;++n)t+=e[n].length;for(var i=c.allocUnsafe(t),r=0,n=0;n<e.length;++n){var s=e[n];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,r),r+=s.length}return i},c.byteLength=f,c.prototype.Yt=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0==e?"":0===arguments.length?b(this,0,e):function(e,t,i){var n,o,s=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((i=void 0===i||i>this.length?this.length:i)<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var a=t,c=i,u=this.length;(!c||c<0||u<c)&&(c=u);for(var l="",d=a=!a||a<0?0:a;d<c;++d)l+=(o=this[d])<16?"0"+o.toString(16):o.toString(16);return l;case"utf8":case"utf-8":return b(this,t,i);case"ascii":u=t;for(var h=i,p="",f=(h=Math.min(this.length,h),u);f<h;++f)p+=String.fromCharCode(127&this[f]);return p;case"latin1":case"binary":a=t;for(var m=i,v="",g=(m=Math.min(this.length,m),a);g<m;++g)v+=String.fromCharCode(this[g]);return v;case"base64":return y=this,n=i,0===(_=t)&&n===y.length?r.fromByteArray(y):r.fromByteArray(y.slice(_,n));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var y=t,_=i,S=this.slice(y,_),T="",E=0;E<S.length;E+=2)T+=String.fromCharCode(S[E]+256*S[E+1]);return T;default:if(s)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(c.isBuffer(e))return this===e||0===c.compare(this,e);throw new TypeError("Argument must be a Buffer")},c.prototype.inspect=function(){var e="",i=t.INSPECT_MAX_BYTES;return 0<this.length&&(e=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i)&&(e+=" ... "),"<Buffer "+e+">"},c.prototype.compare=function(e,t,i,r,n){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),(t=void 0===t?0:t)<0||i>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(n<=r&&i<=t)return 0;if(n<=r)return-1;if(i<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(r>>>=0),s=(i>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(r,n),l=e.slice(t,i),d=0;d<a;++d)if(u[d]!==l[d]){o=u[d],s=l[d];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},c.prototype.indexOf=function(e,t,i){return v(this,e,t,i,!0)},c.prototype.lastIndexOf=function(e,t,i){return v(this,e,t,i,!1)},c.prototype.write=function(e,t,i,r){if(void 0===t)r="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)r=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}var n=this.length-t;if((void 0===i||n<i)&&(i=n),0<e.length&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r=r||"utf8";for(var o,s,a,c,u=!1;;)switch(r){case"hex":var l,d=e,h=i,p=(l=Number(t)||0,this.length-l);if((!h||p<(h=Number(h)))&&(h=p),(p=d.length)%2!=0)throw new TypeError("Invalid hex string");p/2<h&&(h=p/2);for(var f=0;f<h;++f){var m=parseInt(d.substr(2*f,2),16);if(isNaN(m))return f;this[l+f]=m}return f;case"utf8":case"utf-8":return s=i,D(P(e,(o=this).length-(p=t)),o,p,s);case"ascii":case"latin1":case"binary":return y(this,e,t,i);case"base64":return o=this,s=t,a=i,D(A(e),o,s,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=i,D(function(e,t){for(var i,r,n=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(i=e.charCodeAt(o))>>8,n.push(i%256),n.push(r);return n}(e,this.length-(a=t)),this,a,c);default:if(u)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),u=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function S(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(i<e+t)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,i,r,n,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n<t||t<o)throw new RangeError('"value" argument is out of bounds');if(i+r>e.length)throw new RangeError("Index out of range")}function E(e,t,i,r){t<0&&(t=65535+t+1);for(var n=0,o=Math.min(e.length-i,2);n<o;++n)e[i+n]=(t&255<<8*(r?n:1-n))>>>8*(r?n:1-n)}function C(e,t,i,r){t<0&&(t=4294967295+t+1);for(var n=0,o=Math.min(e.length-i,4);n<o;++n)e[i+n]=t>>>8*(r?n:3-n)&255}function w(e,t,i,r){if(i+r>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function I(e,t,i,r,o){return o||w(e,0,i,4),n.write(e,t,i,r,23,4),i+4}function R(e,t,i,r,o){return o||w(e,0,i,8),n.write(e,t,i,r,52,8),i+8}c.prototype.slice=function(e,t){var i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i<e&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):i<t&&(t=i),t<e&&(t=e),c.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=c.prototype;else for(var r=t-e,n=new c(r,void 0),o=0;o<r;++o)n[o]=this[o+e];return n},c.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||S(e,t,this.length);for(var r=this[e],n=1,o=0;++o<t&&(n*=256);)r+=this[e+o]*n;return r},c.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||S(e,t,this.length);for(var r=this[e+--t],n=1;0<t&&(n*=256);)r+=this[e+--t]*n;return r},c.prototype.readUInt8=function(e,t){return t||S(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||S(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||S(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||S(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||S(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||S(e,t,this.length);for(var r=this[e],n=1,o=0;++o<t&&(n*=256);)r+=this[e+o]*n;return(n*=128)<=r&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||S(e,t,this.length);for(var r=t,n=1,o=this[e+--r];0<r&&(n*=256);)o+=this[e+--r]*n;return(n*=128)<=o&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return t||S(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){return t||S(e,2,this.length),32768&(t=this[e]|this[e+1]<<8)?4294901760|t:t},c.prototype.readInt16BE=function(e,t){return t||S(e,2,this.length),32768&(t=this[e+1]|this[e]<<8)?4294901760|t:t},c.prototype.readInt32LE=function(e,t){return t||S(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||S(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||S(e,4,this.length),n.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||S(e,4,this.length),n.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||S(e,8,this.length),n.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||S(e,8,this.length),n.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,i,r){e=+e,t|=0,i|=0,r||T(this,e,t,i,Math.pow(2,8*i)-1,0);var n=1,o=0;for(this[t]=255&e;++o<i&&(n*=256);)this[t+o]=e/n&255;return t+i},c.prototype.writeUIntBE=function(e,t,i,r){e=+e,t|=0,i|=0,r||T(this,e,t,i,Math.pow(2,8*i)-1,0);var n=i-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+i},c.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||T(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||T(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):E(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||T(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):E(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||T(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||T(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,i,r){e=+e,t|=0,r||T(this,e,t,i,(r=Math.pow(2,8*i-1))-1,-r);var n=0,o=1,s=0;for(this[t]=255&e;++n<i&&(o*=256);)e<0&&0===s&&0!==this[t+n-1]&&(s=1),this[t+n]=(e/o|0)-s&255;return t+i},c.prototype.writeIntBE=function(e,t,i,r){e=+e,t|=0,r||T(this,e,t,i,(r=Math.pow(2,8*i-1))-1,-r);var n=i-1,o=1,s=0;for(this[t+n]=255&e;0<=--n&&(o*=256);)e<0&&0===s&&0!==this[t+n+1]&&(s=1),this[t+n]=(e/o|0)-s&255;return t+i},c.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||T(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&(e=e<0?255+e+1:e),t+1},c.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||T(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):E(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||T(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):E(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||T(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,i){return I(this,e,t,!0,i)},c.prototype.writeFloatBE=function(e,t,i){return I(this,e,t,!1,i)},c.prototype.writeDoubleLE=function(e,t,i){return R(this,e,t,!0,i)},c.prototype.writeDoubleBE=function(e,t,i){return R(this,e,t,!1,i)},c.prototype.copy=function(e,t,i,r){if(i=i||0,r||0===r||(r=this.length),t>=e.length&&(t=e.length),(r=0<r&&r<i?i:r)===i)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length);var n,o=(r=e.length-t<r-i?e.length-t+i:r)-i;if(this===e&&i<t&&t<r)for(n=o-1;0<=n;--n)e[n+t]=this[n+i];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(n=0;n<o;++n)e[n+t]=this[n+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+o),t);return o},c.prototype.fill=function(e,t,i,r){if("string"==typeof e){var n;if("string"==typeof t?(r=t,t=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),1===e.length&&(n=e.charCodeAt(0))<256&&(e=n),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(!(i<=t))if(t>>>=0,i=void 0===i?this.length:i>>>0,"number"==typeof(e=e||0))for(a=t;a<i;++a)this[a]=e;else for(var o=c.isBuffer(e)?e:P(new c(e,r).toString()),s=o.length,a=0;a<i-t;++a)this[a+t]=o[a%s];return this};var k=/[^+\/0-9A-Za-z-_]/g;function P(e,t){t=t||1/0;for(var i,r=e.length,n=null,o=[],s=0;s<r;++s){if(55295<(i=e.charCodeAt(s))&&i<57344){if(!n){if(56319<i){-1<(t-=3)&&o.push(239,191,189);continue}if(s+1===r){-1<(t-=3)&&o.push(239,191,189);continue}n=i;continue}if(i<56320){-1<(t-=3)&&o.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&-1<(t-=3)&&o.push(239,191,189);if(n=null,i<128){if(--t<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function A(e){return r.toByteArray(function(e){var t;if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(k,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,i,r){for(var n=0;n<r&&!(n+i>=t.length||n>=e.length);++n)t[n+i]=e[n];return n}}).call(this,i(34))},function(e,t){var i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==("undefined"===typeof window?"undefined":_typeof(window))&&(i=window)}e.exports=i},function(e,t,i){"use strict";t.byteLength=function(e){return 3*((e=c(e))[0]+(e=e[1]))/4-e},t.toByteArray=function(e){for(var t,i=(r=c(e))[0],r=r[1],s=new o(3*(i+r)/4-r),a=0,u=0<r?i-4:i,l=0;l<u;l+=4)t=n[e.charCodeAt(l)]<<18|n[e.charCodeAt(l+1)]<<12|n[e.charCodeAt(l+2)]<<6|n[e.charCodeAt(l+3)],s[a++]=t>>16&255,s[a++]=t>>8&255,s[a++]=255&t;return 2===r&&(t=n[e.charCodeAt(l)]<<2|n[e.charCodeAt(l+1)]>>4,s[a++]=255&t),1===r&&(t=n[e.charCodeAt(l)]<<10|n[e.charCodeAt(l+1)]<<4|n[e.charCodeAt(l+2)]>>2,s[a++]=t>>8&255,s[a++]=255&t),s},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,o=[],s=0,a=i-n;s<a;s+=16383)o.push(function(e,t){for(var i,n=[],o=s;o<t;o+=3)n.push(r[(i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]))>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return n.join("")}(e,a<s+16383?a:s+16383));return 1==n?o.push(r[(t=e[i-1])>>2]+r[t<<4&63]+"=="):2==n&&o.push(r[(t=(e[i-2]<<8)+e[i-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=s[a],n[s.charCodeAt(a)]=a;function c(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");return t=(e=-1===(e=e.indexOf("="))?t:e)===t?0:4-e%4,[e,t]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,i,r,n){var o,s,a=8*n-r-1,c=(1<<a)-1,u=c>>1,l=-7,d=i?n-1:0,h=i?-1:1;for(n=e[t+d],d+=h,o=n&(1<<-l)-1,n>>=-l,l+=a;0<l;o=256*o+e[t+d],d+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;0<l;s=256*s+e[t+d],d+=h,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(n?-1:1);s+=Math.pow(2,r),o-=u}return(n?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,i,r,n,o){var s,a,c=8*o-n-1,u=(1<<c)-1,l=u>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1;for(o=t<0||0===t&&1/t<0?1:0,t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(r=Math.pow(2,-s))<1&&(s--,r*=2),2<=(t+=1<=s+l?d/r:d*Math.pow(2,1-l))*r&&(s++,r/=2),u<=s+l?(a=0,s=u):1<=s+l?(a=(t*r-1)*Math.pow(2,n),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,n),s=0));8<=n;e[i+h]=255&a,h+=p,a/=256,n-=8);for(s=s<<n|a,c+=n;0<c;e[i+h]=255&s,h+=p,s/=256,c-=8);e[i+h-p]|=128*o}},function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},function(e,t,i){"use strict";var r=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(r=o.next()).done;)s.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return s},n=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e},o=(Object.defineProperty(t,"u",{value:!0}),t.PendingQueue=void 0,i(0)),s=i(5);function a(e,t,i,r){var n=this;this.Vt=e,this.yt=t,this.Wt=i,this.G=r,this.byteLength=0,this.size=0,this.pendingDataSize=0,this.cacheMap=new Map,e.forEach((function(e){n.cacheMap.set(e,new o.Queue)}))}a.prototype.enqueue=function(e,t){(t=this.cacheMap.get(t))&&!t.all().find((function(t){return t.content==e.content}))&&(t.enqueue(e),t=s.calculateMemSize(e.content),this.pendingDataSize+=t,this.size++,this.Wt.totalAvailCache-=t,this.enCallback)&&this.enCallback(this.byteLength,this.size,this.pendingDataSize)},a.prototype.dequeue=function(e){return e=null==(e=this.cacheMap.get(e))?void 0:e.dequeue(),this.size--,this.deCallback&&this.deCallback(),e},a.prototype.findInQueue=function(e){var t=null==(t=this.cacheMap.get(e.level))?void 0:t.all();return null==t?void 0:t.find((function(t){return t.key===e.key}))},a.prototype.readReportData=function(e){var t=n(this.cacheMap.entries());return t=this.readData(t,e,!0),this.reset(),{totalLen:t.totalLen,reportDataArr:t.resArr}},a.prototype.readStoreData=function(e){e=Math.ceil(this.pendingDataSize*e);var t=n(this.cacheMap.entries()).reverse();return t=this.readData(t,e,!1),this.refresh(t.totalLen),{totalLen:t.totalLen,storeArr:t.resArr}},a.prototype.readData=function(e,t,i){var n=[],o=0;e:for(var a=0;a<e.length;a++)for(var c=r(e[a],2),u=c[0],l=c[1];l.size();){var d=this.dequeue(u);if(n.push(d),t<(o+=s.calculateMemSize(d.content)))break e}return{totalLen:o,resArr:n}},a.prototype.decodeReportData=function(e){var t=this;e.forEach((function(e){t.enqueue(e,e.level)}))},a.prototype.setListener=function(e){this.enCallback=e.enCallback,this.deCallback=e.deCallback},a.prototype.getPendingDataInfo=function(){return{pendingDataSize:this.pendingDataSize,size:this.size}},a.prototype.refresh=function(e){this.pendingDataSize-=e,this.Wt.totalAvailCache+=e},a.prototype.reset=function(){this.byteLength=0},t.PendingQueue=a},function(e,t,i){"use strict";var r=this&&this.__awaiter||function(e,t,i,r){return new(i=i||Promise)((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){var c=[s,a];if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&c[0]?r.return:c[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,c[1])).done)return n;switch(r=0,(c=n?[2&c[0],n.value]:c)[0]){case 0:case 1:n=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!n||c[1]>n[0]&&c[1]<n[3]))o.label=c[1];else if(6===c[0]&&o.label<n[1])o.label=n[1],n=c;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(c)}}c=t.call(e,o)}catch(a){c=[6,a],r=0}finally{i=n=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},o=(Object.defineProperty(t,"u",{value:!0}),t.loadJS=void 0,i(40));function s(e,t,i){return(e=o.decrypt(e,t))&&o.hashMd5(e)===i?e:""}t.loadJS=function(e,t,i,o,a,c,u){var l=this;return new Promise((function(d,h){return r(l,void 0,void 0,(function(){var l,p,f,m,v;return n(this,(function(g){switch(g.label){case 0:if(l="dy",e)return[3,7];g.label=1;case 1:return g.trys.push([1,5,,6]),[4,t.getItem("code")];case 2:return p=g.sent(),[4,t.getItem("key")];case 3:return f=g.sent(),[4,t.getItem("hash")];case 4:m=g.sent();var y=s(p,f,m)||c,b=l,_=u,S=document.getElementsByTagName("HEAD").item(0),T=document.createElement("script");T.language="javascript",T.type="text/javascript",T.id=b,T.param=_;try{T.appendChild(document.createTextNode(y))}catch(b){T.text=y}return S.appendChild(T),d(),[3,6];case 5:return g.sent(),h(),[3,6];case 6:return[2];case 7:if(window.ActiveXObject)try{v=new ActiveXObject("Msxml2.XMLHTTP")}catch(g){v=new ActiveXObject("Microsoft.XMLHTTP")}else window.XMLHttpRequest&&(v=new XMLHttpRequest);return v.open("GET",i,!0),v.send(null),v.onreadystatechange=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:if(4!=v.readyState)return[3,10];if(!(200<=v.status&&v.status<300||0==v.status||304==v.status))return[3,8];e.label=1;case 1:return e.trys.push([1,6,,7]),s(v.responseText,o,a)?[4,t.setItem("code",v.responseText)]:[3,5];case 2:return e.sent(),[4,t.setItem("key",o)];case 3:return e.sent(),[4,t.setItem("hash",a)];case 4:e.sent(),e.label=5;case 5:return d(),[3,7];case 6:return e.sent(),h(),[3,7];case 7:return[2];case 8:return h(),[2];case 9:return[3,11];case 10:case 11:return[2]}}))}))},[2]}}))}))}))}},function(e,t,i){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.u?e:{default:e}},n=(Object.defineProperty(t,"u",{value:!0}),t.hashMd5=t.decrypt=void 0,r(i(41))),o=r(i(42)),s=r(i(43));t.decrypt=function(e,t){var i="";try{i=o.default.decrypt(e,t).toString(s.default)}catch(e){}return i},t.hashMd5=function(e){return n.default(e).toString()}},function(e,t){e.exports=s},function(e,t){e.exports=a},function(e,t){e.exports=c},function(e,t,i){"use strict";function r(){this.logLevel=t.ENUM_LOG_LEVEL.DISABLE}Object.defineProperty(t,"u",{value:!0}),t.ZegoLog=t.ENUM_LOG_LEVEL=void 0,t.ENUM_LOG_LEVEL={DEBUG:0,INFO:1,WARN:2,ERROR:3,REPORT:99,DISABLE:100,debug:0,info:1,warn:2,error:3,report:99,disable:100},r.prototype.setLogLevel=function(e){return void 0!==(e=t.ENUM_LOG_LEVEL[e])&&(this.logLevel=e,!0)},r.prototype.debug=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var r=e.join(" ");this.logLevel!==t.ENUM_LOG_LEVEL.DISABLE&&this.logLevel<=t.ENUM_LOG_LEVEL.DEBUG&&console.debug(r)},r.prototype.log=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var r=e.join(" ");this.logLevel!==t.ENUM_LOG_LEVEL.DISABLE&&this.logLevel<=t.ENUM_LOG_LEVEL.INFO&&console.log(r)},r.prototype.info=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var r=e.join(" ");this.logLevel!==t.ENUM_LOG_LEVEL.DISABLE&&this.logLevel<=t.ENUM_LOG_LEVEL.INFO&&console.info(r)},r.prototype.warn=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var r=e.join(" ");this.logLevel!==t.ENUM_LOG_LEVEL.DISABLE&&this.logLevel<=t.ENUM_LOG_LEVEL.WARN&&console.warn(r)},r.prototype.error=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var r=e.join(" ");this.logLevel!==t.ENUM_LOG_LEVEL.DISABLE&&this.logLevel<=t.ENUM_LOG_LEVEL.ERROR&&console.error(r)},t.ZegoLog=r},function(e,t,i){"use strict";function r(e){this.logger=e,this.F=e}Object.defineProperty(t,"u",{value:!0}),t.StateCenter=void 0,r.prototype.isLogin=function(){return!0},t.StateCenter=r},function(e,t,i){"use strict";var r=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(r=o.next()).done;)s.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return s},n=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e},o=(Object.defineProperty(t,"u",{value:!0}),t.DynamicCode=void 0,i(3));function s(){this.init()}s.prototype.init=function(){window.dyObj={}},s.prototype.runExecution=function(e,t,i){e=new(Function.bind.apply(Function,n([void 0],e,[i])));try{e.apply(void 0,n(t))}catch(e){o.log.error(e)}},t.DynamicCode=s}],l={},r.m=u,r.c=l,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"u",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==_typeof(e)&&e&&e.u)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.u?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=13))},function(e,t,i){var r,n,o,s,a;e.exports=(e=i(2),i(17),i(18),r=(o=(i=e).lib).Base,n=o.WordArray,s=(o=i.algo).MD5,a=o.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var i,r=this.cfg,o=r.hasher.create(),s=n.create(),a=s.words,c=r.keySize,u=r.iterations;a.length<c;){i&&o.update(i),i=o.update(e).finalize(t),o.reset();for(var l=1;l<u;l++)i=o.finalize(i),o.reset();s.concat(i)}return s.sigBytes=4*c,s}}),i.EvpKDF=function(e,t,i){return a.create(i).compute(e,t)},e.EvpKDF)},function(e,t){e.exports=r},function(e,t,i){function r(e){var t;return(a[e]||(t=a[e]={i:e,l:!1,exports:{}},s[e].call(t.exports,t,t.exports,r),t.l=!0,t)).exports}var n,o,s,a;e.exports=(n=i(1),o=i(3),s=[function(e,t){e.exports=n},function(e,t){e.exports=o},function(e,t,i){"use strict";var r,n,o,s,a,c,u,l;i.r(t),i.d(t,"ZegoConnectionAgent",(function(){return ke})),i.d(t,"NetAgentPCRequest",(function(){return ye})),i.d(t,"NetAgentHttpRequest",(function(){return Ce})),i.d(t,"BusinessService",(function(){return o})),i.d(t,"BrokenType",(function(){return m})),i.d(t,"NET_ACCESS_CONFIG",(function(){return de})),i.d(t,"ConnectedType",(function(){return f})),i.d(t,"DisconnectedType",(function(){return p})),i.d(t,"Mode",(function(){return a})),i.d(t,"Method",(function(){return h})),(t=r=r||{})[t.offline=0]="offline",t[t.online=1]="online",(t=n=n||{})[t.MSG_TYPE_STREAM_CLOSED=2]="MSG_TYPE_STREAM_CLOSED",t[t.MSG_TYPE_CLOSE_CONNECTION=3]="MSG_TYPE_CLOSE_CONNECTION",t[t.MSG_TYPE_HTTP_REQUEST=4]="MSG_TYPE_HTTP_REQUEST",t[t.MSG_TYPE_HTTP_RESPONSE=5]="MSG_TYPE_HTTP_RESPONSE",t[t.MSG_TYPE_HB_REQUEST=12]="MSG_TYPE_HB_REQUEST",t[t.MSG_TYPE_HB_RESPONSE=13]="MSG_TYPE_HB_RESPONSE",t[t.MSG_TYPE_GET_CONFIG_REQUEST=14]="MSG_TYPE_GET_CONFIG_REQUEST",t[t.MSG_TYPE_GET_CONFIG_RESPONSE=15]="MSG_TYPE_GET_CONFIG_RESPONSE",t[t.MSG_TYPE_HTTP_REQUEST_ACK=16]="MSG_TYPE_HTTP_REQUEST_ACK",t[t.MSG_TYPE_PC_UPWARD_MESSAGE=17]="MSG_TYPE_PC_UPWARD_MESSAGE",t[t.MSG_TYPE_PC_UPWARD_MESSAGE_ACK=18]="MSG_TYPE_PC_UPWARD_MESSAGE_ACK",t[t.MSG_TYPE_PC_ESTABLISHED=19]="MSG_TYPE_PC_ESTABLISHED",t[t.MSG_TYPE_PC_BROKEN=20]="MSG_TYPE_PC_BROKEN",t[t.MSG_TYPE_PC_DOWNWARD_MESSAGE=21]="MSG_TYPE_PC_DOWNWARD_MESSAGE",t[t.MSG_TYPE_REDIRECT=22]="MSG_TYPE_REDIRECT",t[t.MSG_TYPE_GET_APPCONFIG_REQUEST=23]="MSG_TYPE_GET_APPCONFIG_REQUEST",t[t.MSG_TYPE_GET_APPCONFIG_RESPONSE=24]="MSG_TYPE_GET_APPCONFIG_RESPONSE",t[t.MSG_TYPE_PUSH_APPCONFIG=25]="MSG_TYPE_PUSH_APPCONFIG",t[t.MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST=26]="MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST",t[t.MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE=27]="MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE",t[t.MSG_TYPE_PUSH_EXCEPTION=30]="MSG_TYPE_PUSH_EXCEPTION",t[t.MSG_TYPE_HTTP_REQUEST2=33]="MSG_TYPE_HTTP_REQUEST2",t[t.MSG_TYPE_REDIRECT2=34]="MSG_TYPE_REDIRECT2",t[t.MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST2=35]="MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST2",t[t.MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE2=36]="MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE2",t[t.MSG_TYPE_GET_SVRADDR_REQUEST=39]="MSG_TYPE_GET_SVRADDR_REQUEST",t[t.MSG_TYPE_GET_SVRADDR_RESPONSE=40]="MSG_TYPE_GET_SVRADDR_RESPONSE",(t=y=y||{})[t.ACCESSHUB_INVALID_FRAME=2e4]="ACCESSHUB_INVALID_FRAME",t[t.ACCESSHUB_NEED_ENCRYPT=20001]="ACCESSHUB_NEED_ENCRYPT",t[t.ACCESSHUB_DECRYPT=20002]="ACCESSHUB_DECRYPT",t[t.ACCESSHUB_MSGTYPE=20003]="ACCESSHUB_MSGTYPE",t[t.ACCESSHUB_UNMARSHAL=20004]="ACCESSHUB_UNMARSHAL",t[t.ACCESSHUB_TIMEOUT=20005]="ACCESSHUB_TIMEOUT",t[t.ACCESSHUB_CONNECT=20006]="ACCESSHUB_CONNECT",t[t.ACCESSHUB_BROKEN=20007]="ACCESSHUB_BROKEN",t[t.ACCESSHUB_INTERNAL_ERROR=20008]="ACCESSHUB_INTERNAL_ERROR",t[t.ACCESSHUB_MARSHAL=20009]="ACCESSHUB_MARSHAL",t[t.ACCESSHUB_UNSUPPORTED_SERVICE=20010]="ACCESSHUB_UNSUPPORTED_SERVICE",t[t.ACCESSHUB_TOO_FREQUENTLY=20011]="ACCESSHUB_TOO_FREQUENTLY",t[t.ACCESSHUB_INVALID_APPID=20012]="ACCESSHUB_INVALID_APPID",t[t.ACCESSHUB_HB_TIMEOUT=20013]="ACCESSHUB_HB_TIMEOUT",t[t.ACCESSHUB_INVALID_SIGNATURE=20014]="ACCESSHUB_INVALID_SIGNATURE",(t=o=o||{})[t.SERVICE_UNSET=0]="SERVICE_UNSET",t[t.SERVICE_MEDIAGW=1]="SERVICE_MEDIAGW",t[t.SERVICE_LIVEROOM=2]="SERVICE_LIVEROOM",t[t.SERVICE_MIX=3]="SERVICE_MIX",t[t.SERVICE_ZEUS=4]="SERVICE_ZEUS",t[t.SERVICE_ZPUSH=5]="SERVICE_ZPUSH",t[t.SERVICE_L3=6]="SERVICE_L3",t[t.SERVICE_TALKLINE=7]="SERVICE_TALKLINE",t[t.SERVICE_EDUSUITE=8]="SERVICE_EDUSUITE",t[t.SERVICE_ZIM=9]="SERVICE_ZIM",t[t.SERVICE_ClOUD_SETTING=10]="SERVICE_ClOUD_SETTING",t[t.SERVICE_ZEUSHB=11]="SERVICE_ZEUSHB",t[t.SERVICE_USER_LOGIC=12]="SERVICE_USER_LOGIC",t[t.SERVICE_UNIFYDISPATCH=13]="SERVICE_UNIFYDISPATCH",t[t.SERVICE_QUALITY=14]="SERVICE_QUALITY",t[t.SERVICE_SECURITY=15]="SERVICE_SECURITY",t[t.SERVICE_KTVCPR=16]="SERVICE_KTVCPR",t[t.SERVICE_SWITCH4LIVEROOM=17]="SERVICE_SWITCH4LIVEROOM",t[t.SERVICE_WEBRTC_SIGNAL=18]="SERVICE_WEBRTC_SIGNAL",t[t.SERVICE_L3_WEBRTC_SIGNAL=19]="SERVICE_L3_WEBRTC_SIGNAL",t[t.SERVICE_VIDEOCPR=20]="SERVICE_VIDEOCPR",t[t.SERVICE_CDN=21]="SERVICE_CDN",t[t.SERVICE_CLOUDRECORD=22]="SERVICE_CLOUDRECORD",t[t.SERVICE_INNER_ECHO=23]="SERVICE_INNER_ECHO",t[t.SERVICE_OUTER_ECHO=24]="SERVICE_OUTER_ECHO",t[t.SERVICE_LOCALHOST_ECHO=25]="SERVICE_LOCALHOST_ECHO",t[t.SERVICE_ECHO=26]="SERVICE_ECHO",t[t.SERVICE_DOCSERVICE=27]="SERVICE_DOCSERVICE",t[t.SERVICE_AUTHSVR=28]="SERVICE_AUTHSVR",(t=s=s||{})[t.ZEGOCONN_RUN_ENV_UNSET=0]="ZEGOCONN_RUN_ENV_UNSET",t[t.ZEGOCONN_RUN_ENV_BROWSER=1]="ZEGOCONN_RUN_ENV_BROWSER",t[t.ZEGOCONN_RUN_ENV_APPLET=2]="ZEGOCONN_RUN_ENV_APPLET",(t=a=a||{})[t.Mode_UNSET=0]="Mode_UNSET",t[t.MODE_ONLINE=1]="MODE_ONLINE",t[t.MODE_TEST=2]="MODE_TEST",t[t.MODE_ALPHA=3]="MODE_ALPHA",(t=c=c||{})[t.HTTP=0]="HTTP",t[t.PC=1]="PC",t[t.OTHER=2]="OTHER",(t=u=u||{})[t.NONE=0]="NONE",t[t.BROKEN=1]="BROKEN",t[t.DISCONNECT=2]="DISCONNECT",(t=l=l||{})[t.CONNECTED=0]="CONNECTED",t[t.DISCONNECT=1]="DISCONNECT",t[t.BROKEN=2]="BROKEN";var d,h,p,f,m,v=[y.ACCESSHUB_INVALID_APPID,y.ACCESSHUB_INVALID_SIGNATURE],g=((t=d=d||{})[t.ACTION_RESERVED=0]="ACTION_RESERVED",t[t.ACTION_DISPATCH=1]="ACTION_DISPATCH",t[t.ACTION_RETRY=2]="ACTION_RETRY",t[t.ACTION_NEXT_NODE=3]="ACTION_NEXT_NODE",t[t.ACTION_ABORT=4]="ACTION_ABORT",t[t.ACTION_NEXT_GROUP=5]="ACTION_NEXT_GROUP",(y=h=h||{})[y.METHOD_UNSET=0]="METHOD_UNSET",y[y.METHOD_GET=1]="METHOD_GET",y[y.METHOD_POST=2]="METHOD_POST",y[y.METHOD_PUT=3]="METHOD_PUT",y[y.METHOD_PATCH=4]="METHOD_PATCH",y[y.METHOD_DELETE=5]="METHOD_DELETE",y[y.METHOD_HEAD=6]="METHOD_HEAD",y[y.METHOD_OPTIONS=7]="METHOD_OPTIONS",(t=p=p||{})[t.CLOSE=0]="CLOSE",t[t.TEMP=1]="TEMP",t[t.TIMEOUT=2]="TIMEOUT",(y=f=f||{})[y.AUTO=0]="AUTO",y[y.MANUAL=1]="MANUAL",(t=m=m||{})[t.EMPTY=0]="EMPTY",t[t.CLOSE=1]="CLOSE",{2:"stream_closed",3:"close_connection",4:"http_request",5:"http_response",12:"hb_request",13:"hb_response",14:"get_config_request",15:"get_config_response",16:"http_request_ack",17:"pc_upward_message",18:"pc_upward_message_ack",19:"pc_established",20:"pc_broken",21:"pc_downward_message",22:"redirect",23:"get_appconfig_request",24:"get_appconfig_response",25:"push_appconfig",26:"accesshub_dispatch_request",27:"accesshub_dispatch_response",30:"push_exception",33:"http_request2",34:"redirect2",35:"accesshub_dispatch_request2",36:"accesshub_dispatch_response2",39:"get_svraddr_request",40:"get_svraddr_response"}),y=i(0),b=i.n(y),_=(t=i(1),i(1));y=i(0),_.util.Long=y,_.util.Long.fromBits=_.util.Long?_.util.Long.fromBits:function(){return 0};for(var S=_.roots,T=_.types?_.types.basic:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0,string:2,bytes:2},E=_.types?_.types.packed:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0},C=Object.keys(T),w={$:function(e){return w[e]?w[e].call(this):S[e].decode?S[e].decode(this,this.uint32()):w.$.call(this,"int32")}},I={$:function(e,t,i){var r=T[e];return void 0===r?S[e].encode?(this.uint32(i<<3|2).fork(),S[e].encode(t,this).ldelim()):I.$.call(this,"int32",t,i):I[e].call(this.uint32(i<<3|r),t)}},R=0;R<C.length;R++)w[C[R]]=_.Reader.prototype[C[R]],I[C[R]]=_.Writer.prototype[C[R]];!function e(t,i,r,n){for(var o=0,s=Object.keys(t);o<s.length;o++){var a=s[o];if(t[a].$m&&Object.keys(t[a].$m).every((function(e){return Number(e)}))){if(r[a])throw Error("nested type ".concat(r,".").concat(a," has already exist"));r[a]=function(t,r){function n(e){for(var i in t)"{"===(i=t[i])[1].charAt(0)?this[i[0]]={}:"["!==i[1].charAt(0)&&"<"!==i[1].charAt(0)||(this[i[0]]=[]);if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)null!=e[r[n]]&&(this[r[n]]=e[r[n]])}var o,s={};for(o in t){var a=t[o],c=a[1];"{"===c.charAt(0)?(n.prototype[a[0]]=_.util.emptyObject,s[c]={$m:c.substring(1).split(",").map((function(e,t){return["$"+(t+1),e,null]})).reduce((function(e,t,i){return e[i+1]=t,e}),{})}):n.prototype[a[0]]="["===c.charAt(0)||"<"===c.charAt(0)?_.util.emptyArray:"bytes"===c?_.util.newBuffer([]):a[2]&&a[2].hasOwnProperty("low")&&a[2].hasOwnProperty("high")?_.util.Long.fromBits(a[2].low,a[2].high,a[2].unsigned):a[2]}return n.create=function(e){return new n(e)},n.decode=function(e,i){e instanceof _.Reader||(e=_.Reader.create(e));for(var r=void 0===i?e.len:e.pos+i,o=new n;e.pos<r;){var s=e.uint32(),a=s>>>3;if(0<a&&t[a]){var c=t[a][0],u=t[a][1];if("{"===u.charAt(0))o[c]===_.util.emptyObject&&(o[c]={}),a=n.$namespace[u].decode(e,e.uint32()),o[c][a.$1]=a.$2;else if("["===u.charAt(0)||"<"===u.charAt(0))if(u=u.substring(1),o[c]&&o[c].length||(o[c]=[]),void 0!==E[u=w[u]||S[u].decode?u:"int32"]&&2==(7&s))for(var l=e.uint32()+e.pos;e.pos<l;)o[c].push(w.$.call(e,u));else o[c].push(w.$.call(e,u));else o[c]=w.$.call(e,u)}else e.skipType(7&s)}return o},n.encode=function(e,i){for(var r in i=i||_.Writer.create(),t){var o=t[r][0];if("{"===(u=t[r][1]).charAt(0)){if(null!=e[o]&&e.hasOwnProperty(o))for(var s=0,a=Object.keys(e[o]);s<a.length;++s)i.uint32(r<<3|2).fork(),n.$namespace[u].encode({$1:a[s],$2:e[o][a[s]]},i).ldelim()}else if("["===u.charAt(0)||"<"===u.charAt(0)){var c="<"===u.charAt(0),u=u.substring(1),l=e[o];if(null!=l&&l.length)if(u=void 0!==T[u]||S[u].encode?u:"int32",c&&void 0!==E[u]){for(i.uint32(r<<3|2).fork(),s=0;s<l.length;s++)I[u].call(i,l[s]);i.ldelim()}else for(s=0;s<l.length;s++)I.$.call(i,u,l[s],r)}else null!=e[o]&&e.hasOwnProperty(o)&&I.$.call(i,u,e[o],r)}return i},Object.keys(s).length&&(n.$namespace=e(s,i+"."+r,n.$namespace||{},!0)),n}(t[a].$m,a)}else t[a].$s?r[a]=function(e,t){function r(e,t,i){_.rpc.Service.call(this,e,t,i)}return((r.prototype=Object.create(_.rpc.Service.prototype)).constructor=r).create=function(e,t,i){return new r(e,t,i)},Object.keys(e).forEach((function(n){var o=e[n];function s(e,t){return this.rpcCall(s,S[o[0]],S[o[1]],e,t)}Object.defineProperty(s,"name",{value:n}),Object.defineProperty(s,"path",{value:i+"."+t}),r.prototype[n]=s})),r}(t[a].$s,a):t[a].$e&&Object.values(t[a].$e).every((function(e){return Number(e)===e}))&&(r[a]=function(e){for(var t=Object.keys(e),i={},r=0;r<t.length;r++)i[i[t[r]]=e[t[r]]]=t[r];return i}(t[a].$e));r[a]&&!n&&(S[i+"."+a]=r[a]),delete t[a].$m,delete t[a].$s,delete t[a].$e,r[a]=e(t[a],i?i+"."+a:a,r[a]||{})}return r}({protocol:{proto_accesshub:{AccesshubAddr:{$m:{1:["ipv4","fixed32",0],2:["ipv6","protocol.proto_accesshub.IPV6Addr",null],3:["quic_port","uint32",0],4:["wss_port","uint32",0]}},AccesshubDispatchGroup:{$m:{1:["group","string",""],2:["quic_nodes","<string",null],3:["mtcp_nodes","<string",null],4:["wss_nodes","<string",null]}},AccesshubDispatchGroup2:{$m:{1:["group","string",""],2:["nodes","<protocol.proto_accesshub.AccesshubAddr",null],3:["nodes_dual","<protocol.proto_accesshub.AccesshubAddr",null]}},AccesshubDispatchRequest2:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["appid","uint32",0],3:["biz_type","uint32",0],4:["mode_no","protocol.proto_accesshub.Mode",0],5:["id_name","string",""],6:["sdk_type","protocol.proto_accesshub.SdkType",0],7:["zegoconn_version","uint32",0],8:["zegoconn_run_env","protocol.proto_accesshub.ZegoconnRunEnv",0],9:["device_id","string",""],10:["client_ip","string",""],11:["geofencing_type","uint32",0],12:["geofencings","[uint32",null],13:["addr_type","uint32",0]}},AccesshubDispatchResponse2:{$m:{1:["code","int32",0],2:["message","string",""],3:["data","protocol.proto_accesshub.AccesshubDispatchResponseData2",null]}},AccesshubDispatchResponseData2:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["rand","string",""],3:["secret","string",""],4:["groups","<protocol.proto_accesshub.AccesshubDispatchGroup2",null],5:["wss_groups","<protocol.proto_accesshub.WssAccesshubDispatchGroup",null],6:["ttl","uint32",0]}},BackendConnType:{$e:{BACKEND_CONN_TYPE_UNSET:0,BACKEND_CONN_TYPE_TCP:1,BACKEND_CONN_TYPE_WSS:2}},CloseConnection:{$m:{1:["reason","int32",0],2:["msg","string",""],3:["action","int32",0]},Action:{$e:{ACTION_RESERVED:0,ACTION_DISPATCH:1,ACTION_RETRY:2,ACTION_NEXT_NODE:3,ACTION_ABORT:4,ACTION_NEXT_GROUP:5}}},ConnectionClosed:{$m:{1:["code","int32",0],2:["msg","string",""]}},ErrorCode:{$e:{OK:0,DISPATCH_NO_AVAILABLE_NODE:1e4,DISPATCH_INTERNAL_ERROR:10001,DISPATCH_INVALID_FRAME:10002,DISPATCH_UNMARSHAL:10003,DISPATCH_MSGTYPE:10004,DISPATCH_MARSHAL:10005,DISPATCH_TOO_FREQUENTLY:10006,DISPATCH_EMPTY_GEOFENCING:10007,ACCESSHUB_INVALID_FRAME:2e4,ACCESSHUB_NEED_ENCRYPT:20001,ACCESSHUB_DECRYPT:20002,ACCESSHUB_MSGTYPE:20003,ACCESSHUB_UNMARSHAL:20004,ACCESSHUB_TIMEOUT:20005,ACCESSHUB_CONNECT:20006,ACCESSHUB_BROKEN:20007,ACCESSHUB_INTERNAL_ERROR:20008,ACCESSHUB_MARSHAL:20009,ACCESSHUB_UNSUPPORTED_SERVICE:20010,ACCESSHUB_TOO_FREQUENTLY:20011,ACCESSHUB_INVALID_APPID:20012,ACCESSHUB_HB_TIMEOUT:20013,ACCESSHUB_INVALID_SIGNATURE:20014,ACCESSHUB_AUTH_FAILED:20015,ACCESSHUB_UNSUPPORTED_INTERFACE:20016,ACCESSHUB_EMPTY_GEOFENCING:20017,ACCESSHUB_ACCESS_DENIED:20018,ACCESSHUB_SPECIAL_CUSTOMER:20019,ACCESSHUB_GET_STREAM_FAILED:3e4,ACCESSHUB_GET_CONN_FAILED:30001,ACCESSHUB_DO_HTTP_REQUEST_FAILED:30002,ACCESSHUB_UNMARSHAL_HB_FAILED:30003,ACCESSHUB_DO_BACKEND_DISPATCH_FAILED:30004}},GeoFencing:{$e:{CN:2,NA:3,EU:4,AS:5,IN:6,NCN:7}},GeoFencingType:{$e:{NONE:0,UNION:1,EXCLUDE:2}},GetAppConfigRequest:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["appid","uint32",0],3:["biz_type","uint32",0],4:["mode_no","protocol.proto_accesshub.Mode",0],5:["id_name","string",""],6:["config_key","string",""],7:["ts","uint64",{low:0,high:0,unsigned:!0}],8:["signature","bytes",[]],9:["lite_sign","string",""],10:["token","string",""],11:["sdk_type","protocol.proto_accesshub.SdkType",0],12:["zegoconn_version","uint32",0],13:["zegoconn_run_env","protocol.proto_accesshub.ZegoconnRunEnv",0],14:["device_id","string",""],15:["etag","uint32",0],16:["is_special_customer","uint32",0]}},GetAppConfigResponse:{$m:{1:["code","int32",0],2:["message","string",""],3:["data","protocol.proto_accesshub.GetAppConfigResponseData",null]}},GetAppConfigResponseData:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["data","bytes",[]],3:["ts","uint64",{low:0,high:0,unsigned:!0}],4:["etag","uint32",0]}},GetConfigRequest:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["appid","uint32",0],3:["biz_type","uint32",0],4:["mode","string",""],5:["id_name","string",""],6:["reqid","string",""],7:["zegoconn_version","uint32",0],8:["sdk_type","protocol.proto_accesshub.SdkType",0],9:["zegoconn_run_env","protocol.proto_accesshub.ZegoconnRunEnv",0],10:["device_id","string",""],11:["mode_no","protocol.proto_accesshub.Mode",0],12:["geofencing_type","uint32",0],13:["geofencings","[uint32",null]}},GetConfigResponse:{$m:{1:["code","int32",0],2:["message","string",""],3:["data","protocol.proto_accesshub.GetConfigResponseData",null]}},GetConfigResponseData:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["quic_hb_interval","uint32",0],3:["quic_hb_timeout","uint32",0],4:["logic_hb_interval","uint32",0],5:["logic_hb_timeout","uint32",0],6:["pc_establish_timeout","uint32",0],7:["sdk_link_detect_interval","uint32",0],8:["sdk_link_detect_duration","uint32",0],9:["client_outer_ip","string",""],10:["ntp_time","uint64",{low:0,high:0,unsigned:!0}],11:["root_rsa_certs_ver","uint32",0],12:["geofencing_id","uint32",0],13:["svraddr_ver","uint32",0],14:["root_ecc_certs_ver","uint32",0]}},GetSvraddrRequest:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["appid","uint32",0],3:["biz_type","uint32",0],4:["mode","protocol.proto_accesshub.Mode",0],5:["id_name","string",""],6:["sdk_type","protocol.proto_accesshub.SdkType",0],7:["zegoconn_run_env","protocol.proto_accesshub.ZegoconnRunEnv",0],8:["zegoconn_version","uint32",0],9:["device_id","string",""],10:["geofencing_type","uint32",0],11:["geofencings","[uint32",null]}},GetSvraddrResponse:{$m:{1:["code","int32",0],2:["msg","string",""],3:["data","protocol.proto_accesshub.GetSvraddrResponseData",null]}},GetSvraddrResponseData:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["geofencing_id","uint32",0],3:["svraddr_ver","uint32",0],4:["anycast_ips","<protocol.proto_accesshub.IPAddr",null],5:["zegons_domain","string",""],6:["zegons_ips","<protocol.proto_accesshub.IPAddr",null],7:["accesshub_domain","string",""],8:["accesshub_ips","<protocol.proto_accesshub.IPAddr",null],9:["logreport_domain","string",""],10:["logreport_ips","<protocol.proto_accesshub.IPAddr",null],11:["detaillog_domain","string",""],12:["detaillog_ips","<protocol.proto_accesshub.IPAddr",null],13:["stunsvr_domain","string",""],14:["stunsvr_ips","<protocol.proto_accesshub.IPAddr",null],15:["zimfile_domain","string",""],16:["zimfile_ips","<protocol.proto_accesshub.IPAddr",null],17:["accesshub_sni","string",""],18:["accesshub_web_domain","string",""],19:["logreport_web_domain","string",""]}},HBRequest:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["ts","int64",{low:0,high:0,unsigned:!1}]}},HBResponse:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["ts","int64",{low:0,high:0,unsigned:!1}],3:["ntp_time","uint64",{low:0,high:0,unsigned:!0}]}},HTTPRequest:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["appid","uint32",0],3:["biz_type","uint32",0],4:["mode","string",""],5:["id_name","string",""],6:["reqid","string",""],7:["stick","string",""],8:["service","string",""],9:["location","string",""],10:["method","string",""],11:["headers","<protocol.proto_accesshub.HTTPRequest.HTTPHeader",null],12:["body","bytes",[]],13:["ack","bool",!1],14:["mode_no","protocol.proto_accesshub.Mode",0],15:["service_no","protocol.proto_accesshub.Service",0],16:["method_no","protocol.proto_accesshub.Method",0],17:["sdk_type","protocol.proto_accesshub.SdkType",0],18:["zegoconn_run_env","protocol.proto_accesshub.ZegoconnRunEnv",0],19:["zegoconn_version","uint32",0],20:["device_id","string",""],21:["reduce_resp_header","uint32",0]},HTTPHeader:{$m:{1:["name","string",""],2:["val","string",""]}}},HTTPRequest2:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["appid","uint32",0],3:["biz_type","uint32",0],4:["mode","protocol.proto_accesshub.Mode",0],5:["id_name","string",""],6:["sdk_type","protocol.proto_accesshub.SdkType",0],7:["zegoconn_run_env","protocol.proto_accesshub.ZegoconnRunEnv",0],8:["zegoconn_version","uint32",0],9:["headers","<protocol.proto_accesshub.HTTPRequest.HTTPHeader",null],10:["method","protocol.proto_accesshub.Method",0],11:["interface_id","uint32",0],12:["res_id","string",""],13:["params","string",""],14:["body","bytes",[]],15:["ack","bool",!1],16:["device_id","string",""],17:["ts","uint64",{low:0,high:0,unsigned:!0}],18:["signature","bytes",[]],19:["token","string",""],20:["lite_sign","string",""],21:["reduce_resp_header","uint32",0]}},HTTPRequestAck:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}]}},HTTPRequestDroped:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["reason","int32",0],3:["msg","string",""]}},HTTPResponse:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["headers","<protocol.proto_accesshub.HTTPRequest.HTTPHeader",null],3:["status_code","int32",0],4:["body","bytes",[]]}},IPAddr:{$m:{1:["ipv4","fixed32",0],2:["ipv6","protocol.proto_accesshub.IPV6Addr",null]}},IPV6Addr:{$m:{1:["high","fixed64",{low:0,high:0,unsigned:!1}],2:["low","fixed64",{low:0,high:0,unsigned:!1}]}},MessageType:{$e:{MSG_TYPE_EMPTY:0,MSG_TYPE_CONNECTION_CLOSED:1,MSG_TYPE_STREAM_CLOSED:2,MSG_TYPE_CLOSE_CONNECTION:3,MSG_TYPE_HTTP_REQUEST:4,MSG_TYPE_HTTP_RESPONSE:5,MSG_TYPE_HTTP_REQUEST_DROPED:6,MSG_TYPE_PROXY_CONNECT:7,MSG_TYPE_PROXY_CONNECTED:8,MSG_TYPE_PROXY_CONNECTION_CLOSED:9,MSG_TYPE_PROXY_SEND_DATA:10,MSG_TYPE_PROXY_RECV_DATA:11,MSG_TYPE_HB_REQUEST:12,MSG_TYPE_HB_RESPONSE:13,MSG_TYPE_GET_CONFIG_REQUEST:14,MSG_TYPE_GET_CONFIG_RESPONSE:15,MSG_TYPE_HTTP_REQUEST_ACK:16,MSG_TYPE_PC_UPWARD_MESSAGE:17,MSG_TYPE_PC_UPWARD_MESSAGE_ACK:18,MSG_TYPE_PC_ESTABLISHED:19,MSG_TYPE_PC_BROKEN:20,MSG_TYPE_PC_DOWNWARD_MESSAGE:21,MSG_TYPE_REDIRECT:22,MSG_TYPE_GET_APPCONFIG_REQUEST:23,MSG_TYPE_GET_APPCONFIG_RESPONSE:24,MSG_TYPE_PUSH_APPCONFIG:25,MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST:26,MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE:27,MSG_TYPE_GET_IM_CONFIG_REQUEST:28,MSG_TYPE_GET_IM_CONFIG_RESPONSE:29,MSG_TYPE_PUSH_EXCEPTION:30,MSG_TYPE_RESOLVE_DOMAIN_REQUEST:31,MSG_TYPE_RESOLVE_DOMAIN_RESPONSE:32,MSG_TYPE_HTTP_REQUEST2:33,MSG_TYPE_REDIRECT2:34,MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST2:35,MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE2:36,MSG_TYPE_GET_ROOTCERTS_REQUEST:37,MSG_TYPE_GET_ROOTCERTS_RESPONSE:38,MSG_TYPE_GET_SVRADDR_REQUEST:39,MSG_TYPE_GET_SVRADDR_RESPONSE:40,MSG_TYPE_UA_DISPATCH_REQUEST:50,MSG_TYPE_UA_DISPATCH_RESPONSE:51,MSG_TYPE_UA_ECHO_REQUEST:52,MSG_TYPE_UA_ECHO_RESPONSE:53,MSG_TYPE_NODE_REGISTER_REQUEST:100,MSG_TYPE_NODE_REGISTER_RESPONSE:101,MSG_TYPE_NODE_HB_REQUEST:102,MSG_TYPE_NODE_HB_RESPONSE:103}},Method:{$e:{METHOD_UNSET:0,METHOD_GET:1,METHOD_POST:2,METHOD_PUT:3,METHOD_PATCH:4,METHOD_DELETE:5,METHOD_HEAD:6,METHOD_OPTIONS:7}},Mode:{$e:{Mode_UNSET:0,MODE_ONLINE:1,MODE_TEST:2,MODE_ALPHA:3}},PCBroken:{$m:{}},PCDownwardMessage:{$m:{1:["payload","bytes",[]],2:["wss_message_type","uint32",0],3:["ts","uint64",{low:0,high:0,unsigned:!0}]}},PCEstablished:{$m:{1:["elapse","uint32",0],2:["from","uint32",0]}},PCUpwardMessage:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["appid","uint32",0],3:["biz_type","uint32",0],4:["mode_no","protocol.proto_accesshub.Mode",0],5:["id_name","string",""],6:["service_no","protocol.proto_accesshub.Service",0],7:["ack","bool",!1],8:["payload","bytes",[]],9:["sdk_type","protocol.proto_accesshub.SdkType",0],10:["wss_message_type","uint32",0],11:["wss_path","string",""],12:["wss_raw_query","string",""],13:["zegoconn_version","uint32",0],14:["zegoconn_run_env","protocol.proto_accesshub.ZegoconnRunEnv",0],15:["backend_conn_type","protocol.proto_accesshub.BackendConnType",0],16:["device_id","string",""],17:["geofencing_type","uint32",0],18:["geofencings","[uint32",null],19:["addr_type","uint32",0]}},PCUpwardMessageAck:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}]}},ProxyConnectionClosed:{$m:{1:["code","int32",0],2:["msg","string",""],3:["connected","int32",0]}},PushAppConfig:{$m:{1:["config_key","string",""],2:["data","bytes",[]]}},PushException:{$m:{1:["reason","int32",0],2:["msg","string",""],3:["txid","uint64",{low:0,high:0,unsigned:!0}]}},Redirect2:{$m:{1:["rand","string",""],2:["secret","string",""],3:["groups","<protocol.proto_accesshub.AccesshubDispatchGroup2",null],4:["wss_groups","<protocol.proto_accesshub.WssAccesshubDispatchGroup",null],5:["ttl","uint32",0]}},SdkType:{$e:{SDK_TYPE_UNSET:0,SDK_TYPE_NATIVE:1,SDK_TYPE_WSS_WEB:3}},Service:{$e:{SERVICE_UNSET:0,SERVICE_MEDIAGW:1,SERVICE_LIVEROOM:2,SERVICE_MIX:3,SERVICE_ZEUS:4,SERVICE_ZPUSH:5,SERVICE_L3:6,SERVICE_TALKLINE:7,SERVICE_EDUSUITE:8,SERVICE_ZIM:9,SERVICE_ClOUD_SETTING:10,SERVICE_ZEUSHB:11,SERVICE_USER_LOGIC:12,SERVICE_UNIFYDISPATCH:13,SERVICE_QUALITY:14,SERVICE_SECURITY:15,SERVICE_KTVCPR:16,SERVICE_SWITCH4LIVEROOM:17,SERVICE_WEBRTC_SIGNAL:18,SERVICE_L3_WEBRTC_SIGNAL:19,SERVICE_VIDEOCPR:20,SERVICE_CDN:21,SERVICE_CLOUDRECORD:22,SERVICE_INNER_ECHO:23,SERVICE_OUTER_ECHO:24,SERVICE_LOCALHOST_ECHO:25,SERVICE_ECHO:26,SERVICE_DOCSERVICE:27,SERVICE_AUTHSVR:28,SERVICE_WEBLIVEROOM:29,SERVICE_WHITEBOARD:30,SERVICE_METAWORLD:31,SERVICE_ZEGOLAND:32}},StreamClosed:{$m:{1:["code","int32",0],2:["msg","string",""]}},WssAccesshubDispatchGroup:{$m:{1:["group","string",""],2:["host","string",""],3:["main_domain","string",""]}},ZegoconnRunEnv:{$e:{ZEGOCONN_RUN_ENV_UNSET:0,ZEGOCONN_RUN_ENV_BROWSER:1,ZEGOCONN_RUN_ENV_APPLET:2}}},proto_initconfig:{AppConfig:{$m:{1:["test_id","int32",0],2:["domain","string",""],3:["flexible_domain","string",""],4:["replace_flexible_domain","string",""]}},InitConfig:{$m:{1:["app_config","protocol.proto_initconfig.AppConfig",null],4:["speedlog_config","protocol.proto_initconfig.SpeedlogConfig",null],5:["media_config","protocol.proto_initconfig.MediaConfig",null]}},MediaConfig:{$m:{1:["play_config","protocol.proto_initconfig.MediaPlayConfig",null],2:["publish_config","protocol.proto_initconfig.MediaPublishConfig",null]}},MediaPlayConfig:{$m:{5:["resource_info","<protocol.proto_initconfig.MediaResourceInfo",null]}},MediaPublishConfig:{$m:{2:["resource_info","<protocol.proto_initconfig.MediaResourceInfo",null],5:["enable_subject_segmentation","int32",0],6:["object_segmentation_platform","int32",0]}},MediaResourceInfo:{$m:{1:["resource_type","protocol.proto_initconfig.ResourceType",0],2:["service_info","<protocol.proto_initconfig.MediaServiceProtocolInfo",null]}},MediaServiceProtocolInfo:{$m:{1:["config_id","string",""],2:["protocol","protocol.proto_initconfig.ProtocolType",0],3:["url_template","string",""],4:["resolve_type","protocol.proto_initconfig.ResolveType",0],5:["push_cdn_authentication","int32",0],6:["cdn_quic_version","<int32",null]}},ProtocolType:{$e:{UDP:0,RTMP:1,FLV:2,HLS:3,WEBRTC:4}},ResolveType:{$e:{LOCAL_DNS:0,DISPATCH:1}},ResourceType:{$e:{CDN:0,RTC:1,L3:2,CDN_PLUS:3,CDN_PLUS_BACKUP:4}},SpeedlogConfig:{$m:{1:["report_count","int32",0],2:["report_retry_interval","int32",0],3:["push_quality_sample_count","int32",0],4:["pull_quality_sample_count","int32",0],5:["hardware_report_cycle","int32",0],6:["room_user_max_count","int32",0],7:["room_stream_max_count","int32",0],8:["charge_info_report_cycle","int32",0],9:["charge_info_report_mode","int32",0],10:["disable_report_pull","<protocol.proto_initconfig.ResourceType",null],11:["report_max_bytes","int32",0],12:["push_quality_report_freq","int32",0],13:["pull_quality_report_freq","int32",0],14:["charge_info_report_no_playing","int32",0]}}}}},"",S,!1);var k=S.protocol,P=function(){return(P=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};t.util.Long=b.a,t.configure(),U.prototype.encodeRequest=function(e,t,i){var r,n=(o=this._[e])[0],o=o[1];return o=(n=this.S(this.h[n][o],t)).length,0===this.stateCenter.appInfo.model?((r=new Uint8Array(13+o))[0]=175,r[1]=0,r[2]=e>>8,r[3]=e-(r[2]<<8),r.set(new Uint8Array(Int32Array.from([o]).buffer).reverse(),4),r.set(new Uint8Array(Int32Array.from([i]).buffer).reverse(),8),r[12]=0):((r=new Uint8Array(13+o))[0]=172,r[1]=0,r[2]=0,r.set(new Uint8Array(Int32Array.from([i]).buffer).reverse(),3),r[7]=e>>8,r[8]=e-(r[2]<<8),r.set(new Uint8Array(Int32Array.from([o]).buffer).reverse(),9)),r.set(n,13),r},U.prototype.decodeResponse=function(e){var t,i=0===this.stateCenter.appInfo.model?(t=(e[2]<<8)+e[3],new DataView(e.buffer).getUint32(8)):(t=(e[7]<<8)+e[8],new DataView(e.buffer).getUint32(3)),r=e.slice(13);try{var n=this._[t];return[i,t,this.T(this.h[n[0]][n[1]],r)]}catch(e){return[i,t,{code:1}]}},U.prototype.decodeConfigMessage=function(e){return this.T(this.h.proto_initconfig.InitConfig,e)},U.prototype.S=function(e,t){return e.encode(new e(t)).finish()},U.prototype.T=function(e,t){return P({},e.decode(t))};var A,D=U,N=(Object.defineProperty(x.prototype,"id",{get:function(){return this.v||null},set:function(e){this.v=e},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"data",{get:function(){return this.C},set:function(e){this.C=e},enumerable:!1,configurable:!0}),x.prototype.hasNext=function(){return this.next&&this.next.id},x.prototype.hasPrev=function(){return this.prev&&this.prev.id},x),O=(L.prototype.insertBefore=function(e,t){return(t=new N(this.R,t)).next=e,t.prev=e.prev,e.prev&&(e.prev.next=t),e.prev=t,++this.R,++this.O,t},L.prototype.addLast=function(e){return this.insertBefore(this.end,e)},L.prototype.add=function(e){return this.addLast(e)},L.prototype.getFirst=function(){return 0===this.O?null:this.start.next},L.prototype.getLast=function(){return 0===this.O?null:this.end.prev},L.prototype.size=function(){return this.O},L.prototype.getFromFirst=function(e){var t=0,i=this.start.next;if(0<=e)for(;t<e&&null!==i;)i=i.next,++t;else i=null;if(null===i)throw"Index out of bounds.";return i},L.prototype.get=function(e){return 0===e?this.getFirst():e===this.O-1?this.getLast():this.getFromFirst(e)},L.prototype.remove=function(e){return e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),--this.O,e},L.prototype.removeFirst=function(){return 0<this.O&&this.start.next?this.remove(this.start.next):null},L.prototype.removeLast=function(){return 0<this.O&&this.end.prev?this.remove(this.end.prev):null},L.prototype.removeAll=function(){this.start.next=this.end,this.end.prev=this.start,this.O=0,this.R=0},L.prototype.each=function(e){for(var t=this.start;t.hasNext();)e(t=t.next)},L.prototype.find=function(e){for(var t=this.start,i=!1,r=null;t.hasNext()&&!i;)e(t=t.next)&&(r=t,i=!0);return r},L.prototype.map=function(e){for(var t=this.start,i=[];t.hasNext();)e(t=t.next)&&i.push(t);return i},L.prototype.push=function(e){return this.addLast(e)},L.prototype.unshift=function(e){this.insertBefore(0<this.O?this.start.next:this.end,e)},L.prototype.pop=function(){return this.removeLast()},L.prototype.shift=function(){return this.removeFirst()},L);function M(){this.txid=0,this.linkRetryTime=60,this.updatedMsgTime=0,this.connectServer=""}function L(){this.start=new N,this.end=new N,this.R=0,this.O=0,this.start.next=this.end,this.start.prev=null,this.end.prev=this.start,this.end.next=null}function x(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this.next=null,this.prev=null,this.v=e,this.C=t}function U(e){this.stateCenter=e,this.h=k,this._=((e={})[n.MSG_TYPE_STREAM_CLOSED]=["proto_accesshub","ConnectionClosed"],e[n.MSG_TYPE_CLOSE_CONNECTION]=["proto_accesshub","CloseConnection"],e[n.MSG_TYPE_HTTP_REQUEST]=["proto_accesshub","HTTPRequest"],e[n.MSG_TYPE_HTTP_RESPONSE]=["proto_accesshub","HTTPResponse"],e[n.MSG_TYPE_HTTP_REQUEST2]=["proto_accesshub","HTTPRequest2"],e[n.MSG_TYPE_HB_REQUEST]=["proto_accesshub","HBRequest"],e[n.MSG_TYPE_HB_RESPONSE]=["proto_accesshub","HBResponse"],e[n.MSG_TYPE_GET_CONFIG_REQUEST]=["proto_accesshub","GetConfigRequest"],e[n.MSG_TYPE_GET_CONFIG_RESPONSE]=["proto_accesshub","GetConfigResponse"],e[n.MSG_TYPE_GET_SVRADDR_REQUEST]=["proto_accesshub","GetSvraddrRequest"],e[n.MSG_TYPE_GET_SVRADDR_RESPONSE]=["proto_accesshub","GetSvraddrResponse"],e[n.MSG_TYPE_HTTP_REQUEST_ACK]=["proto_accesshub","HTTPRequestAck"],e[n.MSG_TYPE_PC_UPWARD_MESSAGE]=["proto_accesshub","PCUpwardMessage"],e[n.MSG_TYPE_PC_UPWARD_MESSAGE_ACK]=["proto_accesshub","PCUpwardMessageAck"],e[n.MSG_TYPE_PC_ESTABLISHED]=["proto_accesshub","PCEstablished"],e[n.MSG_TYPE_PC_BROKEN]=["proto_accesshub","PCBroken"],e[n.MSG_TYPE_PC_DOWNWARD_MESSAGE]=["proto_accesshub","PCDownwardMessage"],e[n.MSG_TYPE_REDIRECT]=["proto_accesshub","Redirect"],e[n.MSG_TYPE_REDIRECT2]=["proto_accesshub","Redirect2"],e[n.MSG_TYPE_GET_APPCONFIG_REQUEST]=["proto_accesshub","GetAppConfigRequest"],e[n.MSG_TYPE_GET_APPCONFIG_RESPONSE]=["proto_accesshub","GetAppConfigResponse"],e[n.MSG_TYPE_PUSH_APPCONFIG]=["proto_accesshub","PushAppConfig"],e[n.MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST]=["proto_accesshub","AccesshubDispatchRequest"],e[n.MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE]=["proto_accesshub","AccesshubDispatchResponse"],e[n.MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST2]=["proto_accesshub","AccesshubDispatchRequest2"],e[n.MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE2]=["proto_accesshub","AccesshubDispatchResponse2"],e[n.MSG_TYPE_PUSH_EXCEPTION]=["proto_accesshub","PushException"],e)}M.prototype.createSocket=function(e){},M.prototype.setState=function(e){},M.prototype.initEvent=function(e,t,i,r){},M.prototype.sendMessage=function(e,t,i,r,n,o,s,a){void 0===r&&(r=!0),void 0===n&&(n=null),void 0===o&&(o=null),void 0===s&&(s=null)},i=M,(y=A=A||{})[y.BROWSER=0]="BROWSER",y[y.WEIXINMINI=1]="WEIXINMINI",z.prototype.init=function(){var e=this;this.P&&(this.readyState=0,this.P.onOpen((function(t){e.readyState=e.P.readyState,"function"==typeof e.onopen&&(e.onopen(t),e.P.onClose((function(t){e.readyState=e.P.readyState,"function"==typeof e.onclose&&e.onclose(t)})),e.P.onMessage((function(t){"function"==typeof e.onmessage&&e.onmessage(t)})))})),this.P.onError((function(t){e.readyState=e.P.readyState,"function"==typeof e.onerror&&e.onerror(t)})))},z.prototype.onopen=function(e){},z.prototype.onerror=function(e){},z.prototype.onclose=function(e){},z.prototype.onmessage=function(e){},z.prototype.send=function(e){e instanceof Uint8Array&&(e=new Uint8Array(e).buffer),this.P&&this.P.send({data:e})},z.prototype.close=function(){this.P&&this.P.close()};var B=z;function z(e,t){this.url=e,this.readyState=3,this.P=wx.connectSocket({url:e}),this.init()}function q(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}function X(e){var t=unescape||window.unescape;return Uint8Array.from(Array.from(t(encodeURIComponent(e))).map((function(e){return e.charCodeAt(0)})))}function H(e){var t=escape||window.escape;return decodeURIComponent(t(String.fromCharCode.apply(String,Array.from(e))))}function F(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}Xe.prototype.createSocket=function(e){var t,i;this.A=(i=this.proxyCtrl,(t=this.ENV%2)%2===A.BROWSER?(t=e,i?i.createSocket(t,0):new WebSocket(t)):new B(e))},Xe.prototype.openHandler=function(e){var t=this;this.A&&(this.A.onopen=function(i){t.A.binaryType="arraybuffer",t.responseHandler(),e(i)})},Xe.prototype.responseHandler=function(){var e=this;this.A&&(this.A.onmessage=function(t){t="string"==typeof t.data?JSON.parse(t.data):t.data,e.onMessage(t)})},Xe.prototype.onMessage=function(e){},Xe.prototype.closeHandler=function(e){this.A&&(this.A.onclose=function(t){e(t)})},Xe.prototype.errorHandler=function(e){this.A&&(this.A.onerror=e)},Xe.prototype.closeSocket=function(){this.A&&(this.A.onclose=null,this.A.onerror=null,this.A.close(),this.A=null)},Xe.prototype.isDisConnect=function(){return!this.A||1!==this.A.readyState},Xe.prototype.sendMessage=function(e){this.isDisConnect()||this.A&&this.A.send(e)};var V,G=Xe,j={TIMEOUT:{code:1100002,msg:"network timeout."},SOCKET_CLOSE:{code:1100003,msg:"socket close"},NET_SOCKET_TIMEOUT:{code:1100004,msg:"net agent timeout"},NET_HB_TIMEOUT:{code:1100005,msg:"net hb timeout"},NET_CONNECT_TIMEOUT:{code:1100006,msg:"net connect timeout"}},Q={code:1100007,msg:"the user breaks the network connection"},W="zn.zca.gc",Z="zn.zca.gac",K="zn.zca.rd",J="zn.zca.cc",Y="zn.shq.0",$="zn.nab.gsa",ee="zn.nab.du",te="zn.nab.gac",ie="zn.nhb.s",re="zn.rlh.at",ne="zn.rlh.sm",oe="zn.wl.cs.0",se="zn.wl.bse",ae="zn.napr.sr",ce="zn.napr.ope",ue="zn.nahr.sr",le="zn.nahr.sr2",de={domains:["accesshub-wss.zego.im"],mode:"online",modeNo:a.MODE_ONLINE,sdkType:3,connectVer:31,pcEstablishTimeout:15,scheme:"wss",location:"accesshub",wssMessageType:1,model:0},he=(V=function(e,t){return(V=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(e,t)},function(){return(he=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)}),pe=function(e){function t(t,i,r,o,s,a){var c=e.call(this)||this;return c.I=t,c.N=i,c.D=r,c.M=o,c.U=s,c.proxyCtrl=a,c.socketService=new G(c.N,c.proxyCtrl),c.urlIndex=0,c.updatedMsgTime=0,c.unUpdateMsgTimeTypes=[n.MSG_TYPE_HB_REQUEST,n.MSG_TYPE_HB_RESPONSE,n.MSG_TYPE_GET_CONFIG_REQUEST,n.MSG_TYPE_GET_CONFIG_RESPONSE,n.MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST2,n.MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE2,n.MSG_TYPE_GET_SVRADDR_REQUEST,n.MSG_TYPE_GET_SVRADDR_RESPONSE,n.MSG_TYPE_GET_APPCONFIG_REQUEST,n.MSG_TYPE_GET_APPCONFIG_RESPONSE],c.netLinkState=0,c.sendCommandList=new O,c.unSendCommandList=new O,c.sendCommandMap={},c.unSendCommandMap={},c.H=100,c.G=15e3,c.Y=1e3,c.V=5e3,c.connectInterval=1e4,c.connectTimer=null,c.connectRsp={},c.unlogTypes=[12,13],c.tryServers=[],c.tryConnectEvents=[],c.connectStartTime=0,c.updatedMsgTime=Date.now(),c}var i=t,r=e;if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=i}return V(i,r),i.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o),t.prototype.initEvent=function(e,t,i,r){this.B=e,this.k=t,this.L=i,this.q=r},t.prototype.createSocket=function(e){this.servers=e,this.urlIndex=0},t.prototype.destroySocket=function(e,t){this.M.info("zn.wl.ds.0 call "+e),this.socketService.closeSocket(),this.netLinkState=0,e!==u.NONE&&(t&&(this.j(this.servers?this.servers[this.urlIndex]:"",t.code,!0),this.B)&&this.B(this.tryServers,this.tryConnectEvents),this.k)&&this.k(e===u.BROKEN),this.resetConnect()},t.prototype.refreshServers=function(e){this.servers=q(q([],e,!0),this.servers,!0)},t.prototype.connectSocket=function(e,t,i){var r=this,n=(void 0===e&&(e=!0),this.M.info(oe+" call"),this.connectRsp.suc=t,!1),o=(this.connectRsp.fail=function(){i&&(n?r.M.info(oe+" fail cb has exec"):(i(),n=!0))},e&&(this.urlIndex=(this.urlIndex+1)%this.servers.length),this.servers[this.urlIndex]);return this.connectServer=o,this.M.info(oe+" server "+o),this.tryServers.push(o),this.connectStartTime=Date.now(),this.closeSocket(),this.netLinkState=1,this.socketService.createSocket(o),this.L&&this.L(!0),this.bindSocketEvent(),this.connectTimer=setTimeout((function(){r.M.info(oe+" timeout"),r.j(o,j.NET_CONNECT_TIMEOUT.code),r.connectRsp.fail&&r.connectRsp.fail()}),this.connectInterval),!0},t.prototype.bindSocketEvent=function(){var e=this;this.openHandler((function(){e.M.info(se+" open"),e.resetConnect(),e.connectRsp.suc&&e.connectRsp.suc(),e.netLinkState=2,e.j(e.connectServer,0),e.B&&e.B(e.tryServers,e.tryConnectEvents),e.tryConnectEvents=[],e.checkUnSendMsgs(e.unSendCommandList,e.unSendCommandMap)})),this.closeHandler((function(t){e.M.warn(se+" close "+JSON.stringify(t.code||t)),e.resetConnect(),e.connectRsp.fail&&e.connectRsp.fail(),e.j(e.connectServer,(null==t?void 0:t.code)||j.NET_CONNECT_TIMEOUT.code),e.k&&e.k(!0),e.netLinkState=0})),this.errorHandler((function(t){e.M.warn(se+" error "+JSON.stringify(t.code||t)),e.resetConnect(),e.connectRsp.fail&&e.connectRsp.fail(),e.j(e.connectServer,(null==t?void 0:t.code)||j.NET_CONNECT_TIMEOUT.code),e.k&&e.k(!0),e.netLinkState=0})),this.onMessage()},t.prototype.closeSocket=function(){this.M.info("zn.wl.cs.1 call"),this.socketService.closeSocket(),this.netLinkState=0},t.prototype.j=function(e,t,i){(this.connectStartTime||i)&&(i=this.connectStartTime?Date.now()-this.connectStartTime:0,this.tryConnectEvents.push({url:e,time_consumed:i,connect_type:3,error:t}))},t.prototype.resetConnect=function(){this.connectTimer&&(clearTimeout(this.connectTimer),this.connectTimer=null)},t.prototype.release=function(){this.stopCheck()},t.prototype.isConnect=function(){return 2===this.netLinkState},t.prototype.isDisConnect=function(){return!this.socketService||this.socketService.isDisConnect()},t.prototype.isConnecting=function(){return 1===this.netLinkState},t.prototype.setState=function(e){this.netLinkState=e},t.prototype.closeHandler=function(e){this.socketService.closeHandler(e)},t.prototype.openHandler=function(e){this.socketService.openHandler(e)},t.prototype.errorHandler=function(e){this.socketService.errorHandler(e)},t.prototype.sendMessage=function(e,t,i,r,o,a,c,u){void 0===r&&(r=!0),void 0===o&&(o=null),void 0===a&&(a=null),void 0===c&&(c=null),void 0===(u=void 0===u?{}:u).timeout&&(u.timeout=5e3),void 0===u.isInSendMap&&(u.isInSendMap=!0),void 0===u.isMsgCache&&(u.isMsgCache=!0),this.txid++;var l={appid:this.I,biz_type:0,mode_no:(null==(l=this.U.appInfo)?void 0:l.mode)||de.modeNo,id_name:this.U.userId,sdk_type:de.sdkType,zegoconn_run_env:0===this.N?s.ZEGOCONN_RUN_ENV_BROWSER:s.ZEGOCONN_RUN_ENV_APPLET,zegoconn_version:(null==(l=this.U.appInfo)?void 0:l.connVer)||de.connectVer};null!=(d=this.U.appInfo)&&d.deviceID&&(l.device_id=null==(d=this.U.appInfo)?void 0:d.deviceID);var d=he(he({txid:this.txid},r?l:{}),i);r={data:d,txid:this.txid,sendTime:Date.now(),streamID:t,type:e,timeOut:u.timeout||this.V,ack:i.ack,success:o,error:a,ackFunc:c,isSend:!0,isCheck:e!==n.MSG_TYPE_PC_UPWARD_MESSAGE,extras:u.extras},u.isInSendMap&&(l=this.sendCommandList.push(r),this.sendCommandMap[this.txid]=l,this.F||this.startCheck()),10!==d.service&&14!==d.interface_id&&this.unUpdateMsgTimeTypes.includes(e)||(this.updatedMsgTime=Date.now()),-1===this.unlogTypes.indexOf(e)&&this.M.info("zn.wl.sm type: "+e+"-"+g[e]+" streamID: "+t+" txid: "+this.txid),this.isConnect()?this.sendUint8Data(e,d,t,u.extras):u.isMsgCache&&(r.isSend=!1,i=this.unSendCommandList.push(r),this.unSendCommandMap[this.txid]=i)},t.prototype.checkUnSendMsgs=function(e,t){for(var i,r=e.getFirst();null!=r;)r.C&&delete t[null==(i=r.C)?void 0:i.txid],e.remove(r),r.C&&!1===(null==(i=r.C)?void 0:i.isSend)&&r.C.type&&r.C.streamID&&r.C.data&&(this.sendUint8Data(r.C.type,r.C.data,r.C.streamID),r.C.isSend=!0),r=e.getFirst()},t.prototype.W=function(e){return e.buffer.slice(e.byteOffset,e.byteLength+e.byteOffset)},t.prototype.sendUint8Data=function(e,t,i,r){e=this.D.encodeRequest(e,t,i),this.socketService.sendMessage(this.W(e))},t.prototype.onMessage=function(){var e=this;this.socketService.onMessage=function(t){t=new Uint8Array(t);var i,r,n=(r=e.D.decodeResponse(t))[0],o=r[1],s=((r=r[2]).txid&&b.a.isLong(r.txid)&&r.txid.toNumber&&(r.txid=r.txid.toNumber()),e.unUpdateMsgTimeTypes.includes(o)||(e.updatedMsgTime=Date.now()),(null==r?void 0:r.txid)||(null==(s=null==r?void 0:r.data)?void 0:s.txid));-1===e.unlogTypes.indexOf(o)&&(i=s?", txid: ".concat(s):"",e.M.info("zn.wl.om"+" streamID: ".concat(n,", msgType: ").concat(o,"-").concat(g[o])+i)),s&&e.isRspMsg(s)?e.handleSendCommandMsgRsp(n,o,s,r,{size:t.length}):e.q(n,o,r,{size:t.length})}},t.prototype.isRspMsg=function(e){return void 0!==this.sendCommandMap[e]},t.prototype.startCheck=function(){var e=this;this.K(this.sendCommandList,this.sendCommandMap,this.unSendCommandList,this.unSendCommandMap),this.F=setTimeout((function(){e.startCheck()}),this.Y)},t.prototype.stopCheck=function(){this.Z(this.sendCommandList),this.F&&(clearTimeout(this.F),this.F=null)},t.prototype.K=function(e,t,i,r){for(var n,o,s=e.getFirst(),a=e.size(),c=Date.now(),u=0,l=0;null!=s;){if(s.C&&s.C.sendTime+s.C.timeOut>c){if(++l<a){var d=e.removeFirst();d&&null!=d&&d.data&&(d=e.push(null==d?void 0:d.data),null!=(o=s.C))&&o.txid&&(t[null==(o=s.C)?void 0:o.txid]=d),s=e.getFirst();continue}break}if(e.remove(s),s.C&&(delete t[s.C.txid],o=r[s.C.txid])&&(i.remove(o),delete r[s.C.txid]),++l,s.C&&null==s.C.error||s.C&&s.C.sendTime+this.G<c||(d=s&&s.C&&s.C.error,s&&s.C&&null!=(n=s.C)&&n.isCheck&&d&&d({},s&&s.C&&s.C.txid,j.TIMEOUT)),++u>=this.H)break;s=e.getFirst()}},t.prototype.Z=function(e){for(var t,i=e.getFirst();null!=i&&i.C;)!function(){var r,n,o;e.remove(i),i.C.isSend&&i.C.error&&(r=i&&i.C&&i.C.error,n=i&&i.C&&i.C.txid,o=i&&i.C&&(null==(t=i.C)?void 0:t.isCheck),setTimeout((function(){o&&r&&r({},n,j.TIMEOUT)}),0)),i=e.getFirst()}()},t.prototype.handleSendCommandMsgRsp=function(e,t,i,r,o){var s,a=this.sendCommandMap[i];null!=a&&(null!=(s=a.C)&&s.ack||(delete this.sendCommandMap[i],this.sendCommandList.remove(a)),r.code&&0!==r.code?s&&null!=s.error&&(s.error(r,i),s.success=null,s.error=null):t===n.MSG_TYPE_PUSH_EXCEPTION?(r.code=r.reason,r.message=r.msg,delete r.reason,delete r.msg,s&&null!=s.error&&(s.error(r,i),s.success=null,s.error=null)):t===n.MSG_TYPE_HTTP_REQUEST_ACK?s&&null!=s.ackFunc&&s.ackFunc(r,i):s&&null!=s.success&&(s.success(r,i,o),s.success=null,s.error=null))},t}(i),fe=(qe.prototype.getConfig=function(e,t){var i;this.M.info("zn.nab.gc call"),this.J.createStream(c.OTHER).sendMessage(n.MSG_TYPE_GET_CONFIG_REQUEST,{geofencing_type:null==(i=this.stateCenter.appInfo.geoFencing)?void 0:i.type,geofencings:null==(i=this.stateCenter.appInfo.geoFencing)?void 0:i.list},e,t)},qe.prototype.dispatchURL=function(e,t){var i,r=this;this.M.info(ee+" call"),this.J.createStream(c.OTHER).sendMessage(n.MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST2,{geofencing_type:null==(i=this.stateCenter.appInfo.geoFencing)?void 0:i.type,geofencings:null==(i=this.stateCenter.appInfo.geoFencing)?void 0:i.list},(function(t){r.M.info(ee+" suc "),e&&e(t)}),(function(e,i,n){r.M.info(ee+" fail"),t&&t(n||e)}))},qe.prototype.getAppConfig=function(e,t,i,r,o,s){var a=this;return new Promise((function(u,l){function d(e,t,i){i?(a.M.error(te+" fail "+JSON.stringify(i)),l(i)):0===e.code?(a.M.info(te+" suc"),i=a.decodeConfigMessage(e.data.data),u({code:0,data:i,etag:e.data.etag})):(a.M.error(te+" fail "+e.code),l({code:e.code}))}a.M.info(te+" call");var h={id_name:t,config_key:e,token:i,mode_no:(null==(h=a.stateCenter.appInfo)?void 0:h.mode)||de.modeNo,etag:o,is_special_customer:null!=s&&s.isSpecial?1:0};a.J.createStream(c.OTHER).sendMessage(n.MSG_TYPE_GET_APPCONFIG_REQUEST,h,d,d,null,{timeout:r})}))},qe.prototype.decodeConfigMessage=function(e){return this.D.decodeConfigMessage(e)},qe.prototype.getSvrAddr=function(){var e=this;return new Promise((function(t,i){var r;e.M.info("".concat($," call")),e.J.createStream(c.OTHER).sendMessage(n.MSG_TYPE_GET_SVRADDR_REQUEST,{geofencing_type:null==(r=e.stateCenter.appInfo.geoFencing)?void 0:r.type,geofencings:null==(r=e.stateCenter.appInfo.geoFencing)?void 0:r.list},(function(i){e.M.info("".concat($," suc")),t(i)}),(function(t,r,n){e.M.info("".concat($," fail")),i(n||t)}))}))},qe),me=(ze.prototype.init=function(e){var t=this;this.M.info("zn.nhb.ii call"),this.ot||(this.ot=this.J.createStream(c.OTHER)),1<=e.data.logic_hb_interval&&e.data.logic_hb_interval<=10&&(this.tt=e.data.logic_hb_interval),3<=e.data.logic_hb_timeout&&e.data.logic_hb_timeout<=30&&(this.nt=e.data.logic_hb_timeout),this.et=0,this.it=this.nt/this.tt,this.X&&clearTimeout(this.X),this.X=setTimeout((function(){t.start()}),1e3*this.tt)},ze.prototype.start=function(){var e,t,i,r=this;this.M.debug(ie+" call "),this.et++>this.it?(this.M.error(ie+" come to try limit"),this.reset(),this.netHbLogout(j.NET_HB_TIMEOUT)):(e=(new Date).getTime(),t=function(t,i,n){var o=(new Date).getTime()-e;r.M.debug(ie+" hb callback "+o),n&&0!==(null==n?void 0:n.code)?r.M.info(ie+" fail "+JSON.stringify(n)):(null!=t&&t.ntp_time&&(n="number"==typeof(o=t.ntp_time)?o:o.toNumber(),t=(new Date).getTime(),0===r.U.appInfo.env)&&r.U.updateNTP(e,n,t),r.et=0)},i={ts:Date.now()},this.ot.sendMessage(n.MSG_TYPE_HB_REQUEST,i,t,t,null),this.ot.isFirst=!1,this.X&&clearTimeout(this.X),this.X=setTimeout((function(){r.start()}),1e3*this.tt))},ze.prototype.netHbLogout=function(e){},ze.prototype.reset=function(){this.X&&(clearTimeout(this.X),this.X=null),this.et=0},ze),ve=(Be.prototype.addEventHandler=function(e,t){if(this.st[e]||(this.st[e]=[]),"function"!=typeof t)throw new Error("Params callBack is not a Function");return this.st[e]&&-1==this.st[e].indexOf(t)&&this.st[e].push(t),!0},Be.prototype.removeEventHandler=function(e,t){return!!this.st[e]&&(this.st[e]=t?this.st[e].filter((function(e){return e!==t})):[],!0)},Be.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this.st[e]&&this.st[e].forEach((function(i){try{i.apply(void 0,t)}catch(i){console.error('Fail to execute callback of event "'.concat(e,'" : ').concat(i))}}))},Be),ge=function(){return(ge=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},ye=(Ue.prototype.sendRequest=function(e,t,i,r){var o=this,s=e.payload,a=(null!=(a=this.ut)&&a.encode&&(s=X(e.payload)),{service_no:this.rt,ack:e.ack,payload:s,wss_message_type:null!=(s=null==(a=this.ut)?void 0:a.messageType)?s:de.wssMessageType,wss_path:null==(a=this.ut)?void 0:a.path,wss_raw_query:null==(s=this.ut)?void 0:s.query,zegoconn_version:de.connectVer});this.netPcStream.isConnect()||(this.M.info(ae+" pc is not connect"),this.eventManager.emit("connectStart")),this.netPcStream.sendMessage(n.MSG_TYPE_PC_UPWARD_MESSAGE,a,(function(){o.M.info(ae+" suc"),i&&i()}),(function(e){o.M.error(ae+" fail"),t&&t(e)}),null,{isInSendMap:"boolean"==typeof e.isInSendMap&&e.isInSendMap,extras:r,isMsgCache:null==(s=this.ut)?void 0:s.isMsgCache})},Ue.prototype.onPushEvent=function(e,t,i){var r;switch(this.M.info(ce+" msgType: ".concat(e)),e){case n.MSG_TYPE_PC_ESTABLISHED:this.netPcStream.isFirst=!1,this.pcEstablished(t,this.netPcStream.StreamID);break;case n.MSG_TYPE_PC_BROKEN:this.pcBroken();break;case n.MSG_TYPE_PC_DOWNWARD_MESSAGE:this.M.info(ce+" ".concat(this.rt," down ").concat((null==t?void 0:t.ts)&&t.ts.toNumber&&t.ts.toNumber()||t.ts));var o=t.payload;null!=(r=this.ut)&&r.encode&&(o=H(t.payload)),this.eventManager.emit("downLoadMessage",o,i);break;case n.MSG_TYPE_PUSH_EXCEPTION:this.M.info(ce+" ".concat(this.rt," exception ").concat(JSON.stringify(t))),this.eventManager.emit("exception",t,i)}},Ue.prototype.on=function(e,t){return this.eventManager.addEventHandler(e,t)},Ue.prototype.off=function(e,t){this.eventManager.removeEventHandler(e,t)},Ue.prototype.pcEstablished=function(e,t){this.M.info("zn.napr.pe call "+JSON.stringify(e)),this.setConnectState(l.CONNECTED);var i=f.MANUAL;this.lastConnectState===l.BROKEN&&this.connectState===l.CONNECTED&&(i=f.AUTO),this.eventManager.emit("connected",i),this.reportEvent("pcConnectedEvent",{proxy_link_sources:null==e?void 0:e.from,connect_stream:t}),this.brokenTimer&&clearTimeout(this.brokenTimer)},Ue.prototype.pcBroken=function(){var e=this;this.M.info("zn.napr.pb call"),this.setConnectState(l.BROKEN),this.eventManager.emit("broken"),this.reportEvent("pcBrokenEvent"),this.brokenTimer=setTimeout((function(){e.eventManager.emit("disconnected",p.TEMP),e.reportEvent("pcDisconnectedEvent")}),1e3*this.ct)},Ue.prototype.resetBrokenTimer=function(){this.brokenTimer&&clearTimeout(this.brokenTimer)},Ue.prototype.ht=function(e,t){var i;this.M.info("zn.napr.cr call "+this.rt+" "+this.connectState),this.connectState!==l.DISCONNECT&&(this.netPcStream.closeStream(0,""),this.resetBrokenTimer(),i=this.J.getStreamID(),this.netPcStream.refresh(i),this.eventManager.emit(e,t),i="","broken"===e?i="pcBrokenEvent":"disconnected"===e&&(i="pcDisconnectedEvent"),i)&&this.reportEvent(i),this.setConnectState(l.DISCONNECT)},Ue.prototype.closePc=function(){this.ht("broken")},Ue.prototype.closeRequest=function(){this.ht("disconnected",p.CLOSE)},Ue.prototype.setConnectState=function(e){this.connectState!==e&&(this.lastConnectState=this.connectState,this.connectState=e)},Ue.prototype.reportEvent=function(e,t){this.eventManager.emit(e,ge({service_no:this.rt},t))},Ue),be=(xe.prototype.getRequest=function(e,t){return e=new ye(this.M,e,this.J,this.pcEstablishTimeout,t),this.pcStreamRequests.push(e),e},xe.prototype.updateConnectState=function(e,t,i){this.M.info("zn.naprm.ucs call "+e+" "+t),this.pcStreamRequests.forEach((function(r){e===l.BROKEN?(r.eventManager.emit("broken"),r.reportEvent("pcBrokenEvent")):e===l.DISCONNECT&&(r.eventManager.emit("disconnected",t,i),r.reportEvent("pcDisconnectedEvent"))}))},xe.prototype.closePCs=function(){this.pcStreamRequests.forEach((function(e){e.closePc()}))},xe.prototype.setEstablishTimeout=function(e){this.pcEstablishTimeout=e},xe),_e=(Le.prototype.initLink=function(e){this.link=e},Le.prototype.startMaxTime=function(){var e=this;this.M.info(ne+" call"),this.maxTimer||(this.M.info(ne+" start max timer"),this.maxTimer=setTimeout((function(){e.M.warn(ne+" over max time ".concat(e.RETRY_MAX_TIME,"s, stop retry")),e.isOverTime=!0,e.link.destroySocket(u.NONE),e.stopMaxTime(),e.invalid(),e.onactive(!1,j.NET_SOCKET_TIMEOUT)}),1e3*this.RETRY_MAX_TIME))},Le.prototype.stopMaxTime=function(){this.maxTimer&&clearTimeout(this.maxTimer),this.maxTimer=null},Le.prototype.active=function(e,t,i){var n=this;if(void 0===i&&(i=!1),this.M.info(re+" call "+e+" "+(t=void 0!==t&&t)),this.U.isDestroyed)return!1;if(this.retryTimer)return this.M.info(re+" has actived, ignore"),!1;var o=this.U.networkState==r.offline;if(o){if(this.M.info(re+" check if really offline. "+this.lt),this.lt>=this.Et)return this.M.warn(re+" network is broken, stop retry"),!1}else this.lt=0;return this.link.isConnecting()&&!i?(this.M.info(re+" link is connecting, ignore"),!1):this.isOverTime?(this.M.info(re+" retry over time, stop retry"),!1):(1==this._t?this.ft=Math.floor(Math.random()*(1-this.RETRY_START_TIME_INTERVAL)+this.RETRY_START_TIME_INTERVAL):(i=Math.pow(2,Math.round(this._t/this.RETRY_CONTINUE_COUNT+1)),this.ft=i>this.RETRY_MAX_TIME_INTERVAL?this.RETRY_MAX_TIME_INTERVAL:i),this.M.info(re+" interval "+this.ft),this.retryTimer=setTimeout((function(){n.link.destroySocket(u.BROKEN),n.link.connectSocket(e,(function(){n.M.info(re+" suc"),n.U.networkState=r.online,n.stopMaxTime(),n.invalid(),n.onactive(!0)}),(function(){n.M.info(re+" fail"),n.maxTimer||n.startMaxTime(),n.active(!0,!1,!0)})),n.retryTimer&&clearTimeout(n.retryTimer),n.retryTimer=null,o?n.lt++:n._t++}),t?0:1e3*this.ft),!0)},Le.prototype.onactive=function(){for(var e=0;e<arguments.length;e++);},Le.prototype.init=function(e,t,i,r){this.invalid(),this.stopMaxTime(),this.isOverTime=!1,"number"==typeof e&&e<3600&&(this.RETRY_MAX_TIME=e),"number"==typeof t&&(this.RETRY_START_TIME_INTERVAL=t),"number"==typeof i&&(this.RETRY_CONTINUE_COUNT=i),"number"==typeof r&&(this.RETRY_MAX_TIME_INTERVAL=r)},Le.prototype.invalid=function(){this.M.info("zn.rlh.ivd end retry"),this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=null,this._t=1,this.lt=0},Le),Se=(Me.prototype.updateNTP=function(e,t,i){var r;i<e||(r=i-e,this.timeOffset=Math.round((t-e+(t-i))/2),e=Math.round(t+r/2),(!this.networkRTT||r<this.networkRTT)&&(this.networkRTT=r,this.ntpTimeInfo={performanceTime:Math.round(performance.now()),ntp:e}))},Me),Te=(Oe.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.join(" ");console.log(i)},Oe.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.join(" ");console.debug(i)},Oe.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.join(" ");console.info(i)},Oe.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.join(" ");console.warn(i)},Oe.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.join(" ");console.error(i)},Oe),Ee=function(){return(Ee=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Ce=(Ne.prototype.sendRequest=function(e,t,i,r,o){var s=this,a=e.disableLog;e={service_no:this.rt,ack:e.ack,headers:e.headers,body:X(JSON.stringify(e.body)),id_name:e.idName,method_no:e.method_no,stick:e.stick,location:e.location,reduce_resp_header:e.reduceRspHeaders?1:0},this.netHttpStream.sendMessage(n.MSG_TYPE_HTTP_REQUEST,e,(function(e){s.closeStream();var i=("gzip"===(null==(i=(null==e?void 0:e.headers).find((function(e){return"Content-Encoding"===(null==e?void 0:e.name)})))?void 0:i.val)?a||s.M.info(ue+" gzip"):e.body&&(i=H(e.body),e.body=i),Ee(Ee({},e),{body:void 0}));a||s.M.info(ue+" suc "+JSON.stringify(i)),t&&t(e)}),(function(e,t,r){s.closeStream(),a||s.M.error(ue+" fail"),i&&i(r||e)}),(function(e){a||s.M.error(ue+" ack"),r&&r(e)}),o),this.netHttpStream.isFirst=!1},Ne.prototype.sendRequest2=function(e,t,i,r,o){var s=this,a=1===e.format?X(JSON.stringify(e.body)):e.body;a={ack:e.ack,body:a,id_name:e.idName,method:e.method,interface_id:e.interfaceID,token:e.token,reduce_resp_header:e.reduceRspHeaders?1:0},e.headers&&(a.headers=e.headers),e.resID&&(a.res_id=e.resID),e.urlParams&&(a.params=e.urlParams),e.mode&&(a.mode=e.mode),this.netHttpStream.sendMessage(n.MSG_TYPE_HTTP_REQUEST2,a,(function(r,n){s.closeStream();var o=(null==r?void 0:r.headers).find((function(e){return"Content-Encoding"===(null==e?void 0:e.name)}));if(200===r.status_code){if("gzip"===(null==o?void 0:o.val))s.M.info(le+" gzip");else if(r.body&&1===e.format)try{a=H(r.body),r.body=a}catch(n){s.M.info(le+" decode "+JSON.stringify(n))}o=Ee(Ee({},r),{body:void 0}),s.M.info(le+" suc "+JSON.stringify(o)),t&&t(r,n)}else{try{var a=H(r.body);r.body=a}catch(n){s.M.info(le+" status "+r.status_code+" "+JSON.stringify(n))}i&&i(r)}}),(function(e,t,r){s.closeStream(),s.M.error(le+" fail"),i&&i(r||e)}),(function(e){s.M.error(le+" ack"),r&&r(e)}),o),this.netHttpStream.isFirst=!1},Ne.prototype.closeStream=function(){this.M.info("zn.nahr.cs call"),this.netHttpStream.closeStream(0,"")},Ne),we=(Object.defineProperty(De.prototype,"StreamID",{get:function(){return this.St},enumerable:!1,configurable:!0}),De.prototype.refresh=function(e){this.St=e,this.isFirst=!0},De.prototype.sendMessage=function(e,t,i,r,n,o){var s=this;void 0===i&&(i=null),void 0===r&&(r=null),this.Tt.sendMessage(e,this.St,t,this.isFirst,(function(e,t,r){s.dt!==c.PC&&(s.isFree=!0),i&&i(e,r)}),(function(e,t,i){s.dt!==c.PC&&(s.isFree=!0),r&&r(e,t,i)}),n=void 0===n?null:n,o=void 0===o?{timeout:5e3,isInSendMap:!0}:o)},De.prototype.onPushEvent=function(e,t,i){},De.prototype.closeStream=function(e,t){this.Tt.sendMessage(n.MSG_TYPE_STREAM_CLOSED,this.St,{code:e,msg:t},void 0,void 0,void 0,void 0,{isInSendMap:!1})},De.prototype.isConnect=function(){return this.Tt.isConnect()},De),Ie=(Ae.prototype.createStream=function(e){var t=new we(e,this.streamID++,this.Tt);return e===c.PC&&this.pcStreams.push(t),t},Ae.prototype.onPushEvent=function(e,t,i,r){var n=this.pcStreams.find((function(t){return t.StreamID===e}));n&&n.onPushEvent(t,i,r)},Ae.prototype.getStreamID=function(){return this.streamID++},Ae),Re=function(){return(Re=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},ke=(Object.defineProperty(Pe.prototype,"isDestroy",{get:function(){return this.stateCenter.isDestroyed},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"clientIP",{get:function(){return this.stateCenter.clientIP},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"timeOffset",{get:function(){return this.stateCenter.timeOffset},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"linkConnectState",{get:function(){return this.Ct},set:function(e){this.lastLinkConnectState=this.Ct,this.Ct=e},enumerable:!1,configurable:!0}),Pe.prototype.init=function(){this.logger=new Te,this.stateCenter=new Se,this.protobuf=new D(this.stateCenter),this.eventManager=new ve,this.Nt(),this.inited=!0},Pe.prototype.unInit=function(){this.inited=!1,this.zegoLink.release()},Pe.prototype.setAppInfo=function(e){this.logger.info("zn.sai.0 "+JSON.stringify(e)),this.stateCenter.appInfo=Re({model:de.model},e),this.stateCenter.networkState=!navigator||navigator.onLine?r.online:r.offline,0===e.env?this.Dt():1===e.env&&this.Mt(),this.zegoLink=new pe(e.appID,e.env,this.protobuf,this.logger,this.stateCenter,this.proxyCtrl),this.zegoLink.initEvent(this.B,this.k,this.L,this.q),this.streamManager=new Ie(this.zegoLink),this.businessRequestMgr=new fe(this.streamManager,this.protobuf,this.logger,this.stateCenter),this.netHeartBeatHandler=new me(this.streamManager,this.logger,this.stateCenter),this.netAgentPCRequestMgr=new be(this.streamManager,this.logger),this.Ut()},Pe.prototype.setUserInfo=function(e){this.stateCenter.userId=e},Pe.prototype.setNetAgentDefaultServers=function(e){this.connectServers=F([],e,!0)},Pe.prototype.setNetAgentSpecifiedServers=function(e){throw this.logger.info("zn.sss.0 "+JSON.stringify(e)),Error("not support")},Pe.prototype.setBackupDomains=function(e){throw Error("not support")},Pe.prototype.setDispatchConnectServers=function(e){this.Ht(e)},Pe.prototype.startHttpRequest=function(e,t,i,r,n){var o=this;if(n&&"number"==typeof(null==n?void 0:n.timeout)&&((null==n?void 0:n.timeout)<1e3||1e4<(null==n?void 0:n.timeout)))throw Error("timeout must between 1 and 10 second");var s=this.reportSeq++;this.eventManager.emit("requestEvent",s,"start"),this.isConnect()||(this.logger.info(Y+" link is not connect"),this.connectUa()),new Ce(this.logger,this.streamManager,e.service).sendRequest(e,(function(i){o.eventManager.emit("requestEvent",s,"end",{na_req_location:e.location,status_code:i.status_code,err_code:0}),t&&t(i)}),(function(t){o.eventManager.emit("requestEvent",s,"end",{na_req_location:e.location,err_code:t.code||0}),i&&i(t)}),r,n)},Pe.prototype.startHttpRequest2=function(e,t,i,r,n){var o=this,s=this.reportSeq++;this.eventManager.emit("requestEvent",s,"start"),this.isConnect()||(this.logger.info(Y+" link is not connect"),this.connectUa()),new Ce(this.logger,this.streamManager).sendRequest2(e,(function(i,r){o.eventManager.emit("requestEvent",s,"end",{na_req_interface:e.interfaceID,status_code:i.status_code,err_code:0}),t&&t(i,r)}),(function(t){o.eventManager.emit("requestEvent",s,"end",{na_req_interface:e.interfaceID,err_code:t.code||0}),i&&i(t)}),r,n)},Pe.prototype.getAppConfigByAgent=function(e,t,i,r,n){return this.isConnect()||(this.logger.info("zn.gab.0 link is not connect"),this.connectUa()),this.yt(e,this.stateCenter.userId,t,i,r,n)},Pe.prototype.getPCRequest=function(e,t){var i=this;return(t=this.netAgentPCRequestMgr.getRequest(e,t)).on("disconnected",(function(t){i.logger.warn("zn.zca.gpr "+e+" disconnect "+t),t===p.TEMP&&(i.Pt(),i.Gt())})),t.on("connectStart",(function(){i.connectUa()})),t},Pe.prototype.connectUa=function(){this.isDestroy||(this.logger.info("zn.zca.cua call"),this.retryLinkHandler&&(this.retryLinkHandler.init(),this.Gt(!1,!0)))},Pe.prototype.destroyConnect=function(e){this.logger.info("zn.zca.dc.0 call"),this.wt(e)},Pe.prototype.destroy=function(){this.logger.info("zn.zca.dy.0 call"),this.destroyConnect(2!==this.linkConnectState?Q:void 0),this.vt&&clearTimeout(this.vt),this.retryLinkHandler&&this.retryLinkHandler.invalid(),this.retryLinkHandler&&this.retryLinkHandler.stopMaxTime(),this.stateCenter.isDestroyed=!0},Pe.prototype.isConnect=function(){return this.zegoLink&&this.zegoLink.isConnect()},Pe.prototype.on=function(e,t){return this.logger.info("zn.zca.o.0 "+e),this.eventManager.addEventHandler(e,t)},Pe.prototype.off=function(e,t){this.logger.info("zn.zca.o.1 "+e),this.eventManager.removeEventHandler(e,t)},Pe.prototype.setLogger=function(e){this.logger=e},Pe.prototype.setAccess=function(e){this.stateCenter.useNetAgent=e},Pe.prototype.getVersion=function(){return"1.1.8"},Pe.prototype.Ut=function(){var e=this;this.netHeartBeatHandler.netHbLogout=function(t){e.retryLinkHandler&&([j.NET_HB_TIMEOUT.code].includes(t.code)?(e.retryLinkHandler.startMaxTime(),e.Pt(),e.Gt()):(e.retryLinkHandler.stopMaxTime(),e.retryLinkHandler.invalid(),e.eventManager.emit("disconnected"),e.At()))}},Pe.prototype.Dt=function(){var e=this;window.addEventListener("offline",(function(){e.Yt()})),window.addEventListener("online",(function(){e.Vt()}))},Pe.prototype.Mt=function(){var e=this;wx.onNetworkStatusChange((function(t){t.isConnected?e.Vt():e.Yt()}))},Pe.prototype.Vt=function(){this.logger.info("zn.zca.noh.0 network is online"),this.stateCenter.networkState=r.online,this.stateCenter.useNetAgent&&this.Bt()},Pe.prototype.Yt=function(){this.logger.info("zn.zca.noh.1 network is broken"),this.stateCenter.networkState=r.offline,this.stateCenter.useNetAgent&&this.zt()},Pe.prototype.Nt=function(){var e=this;if(this.stateCenter.useNetAgent){if(this.isConnect()){var t=Date.now()-this.zegoLink.updatedMsgTime;if(t>1e3*this.linkMsgMaxInterval)return this.logger.info("zn.zca.clm interval: "+t),void this.wt()}this.vt&&clearTimeout(this.vt),this.vt=setTimeout((function(){e.Nt()}),1e3*this.linkMsgCheckInterval)}},Pe.prototype.Ht=function(e){var t=this;0<e.length&&(this.connectServers=F([],e,!0)),0<this.defaultConnectServers.length&&this.defaultConnectServers.forEach((function(e){t.connectServers.includes(e)||t.connectServers.push(e)})),this.zegoLink.createSocket(this.connectServers),this.retryLinkHandler||(this.retryLinkHandler=new _e(this.logger,this.stateCenter)),this.retryLinkHandler.init(),this.retryLinkHandler.initLink(this.zegoLink),this.retryLinkHandler.onactive=function(e,i){i===j.NET_SOCKET_TIMEOUT&&(t.eventManager.emit("disconnected",i),t.At(),t.netAgentPCRequestMgr.updateConnectState(l.DISCONNECT,p.TIMEOUT,i))},this.Gt(!1,!0)},Pe.prototype.wt=function(e){this.netHeartBeatHandler&&this.netHeartBeatHandler.reset(),this.zegoLink&&this.zegoLink.destroySocket(u.DISCONNECT,e)},Pe.prototype.gt=function(){function e(e,r,n){n?t.logger.info(W+" fail "+JSON.stringify(n)):0===e.code?(t.logger.info(W+" suc "+JSON.stringify(e)),t.kt(e,i)):t.logger.info(W+" fail "+JSON.stringify(e))}var t=this,i=(new Date).getTime();this.businessRequestMgr.getConfig(e,e)},Pe.prototype.kt=function(e,t){var i,r;this.netHeartBeatHandler.init(e),this.netAgentPCRequestMgr.setEstablishTimeout(e.data.pc_establish_timeout),null!=(i=null==e?void 0:e.data)&&i.client_outer_ip&&(this.stateCenter.clientIP=e.data.client_outer_ip),null!=(i=null==e?void 0:e.data)&&i.ntp_time&&(i="number"==typeof(i=e.data.ntp_time)?i:i.toNumber(),r=(new Date).getTime(),0===this.stateCenter.appInfo.env)&&this.stateCenter.updateNTP(t,i,r),this.eventManager.emit("clientInfo",{clientIP:this.clientIP,timeOffset:this.timeOffset,geofencingID:t=e.data.geofencing_id})},Pe.prototype.Rt=function(){var e=this;return new Promise((function(t,i){e.businessRequestMgr.dispatchURL((function(i){i=i.data.wss_groups;var r=(e.logger.info(ee+" wss_groups: "+JSON.stringify(i)),i.some((function(e){return e.host.includes("geo")}))),n=null!=(n=e.stateCenter.appInfo)&&n.geoFencing||r?i:e.Lt(i);r=e.$t(n),t({servers:r,domains:n})}),(function(e){i(e)}))}))},Pe.prototype.Ot=function(){var e=this;return new Promise((function(t,i){e.businessRequestMgr.getSvrAddr().then((function(r){var n,o,s,a=r.code,c=r.msg;r=r.data,0===a?(n=r.accesshub_domain,o=r.logreport_domain,s=r.detaillog_domain,r=r.geofencing_id,e.logger.info("".concat($," domains: ").concat(n," ").concat(o," ").concat(s)),t({accesshub_domain:n,logreport_domain:o,detaillog_domain:s,geofencing_id:r})):i({code:a,msg:c})})).catch((function(e){i(e)}))}))},Pe.prototype.$t=function(e){return Array.isArray(e)&&0<e.length?e.map((function(e){return de.scheme+"://"+e.host+"/"+de.location})):[]},Pe.prototype.Lt=function(e){return(e=F([],e,!0)).filter((function(e){return!!e.host}))},Pe.prototype.yt=function(e,t,i,r,n,o){var s=this;return new Promise((function(a,c){"string"==typeof t&&"string"==typeof i?s.businessRequestMgr.getAppConfig(e,t,i,r,n,o).then((function(e){a(Re(Re({},e),{retryCount:s.getAppConfigFailCount}))})).catch((function(r){var o;s.logger.error(Z+" "+JSON.stringify(r)),!(-1<v.indexOf(r.code))&&(s.getAppConfigFailCount++,20008===r.code||1100002===r.code)&&s.getAppConfigFailCount<3?s.yt(e,t,i,n).then((function(e){return a(e)})).catch((function(e){return c(e)})):(o=s.getAppConfigFailCount,s.getAppConfigFailCount=0,c(Re(Re({},r),{retryCount:o})))})):s.logger.error(Z+" userID or token must be string")}))},Pe.prototype.At=function(){var e=(new Date).getTime()-this.connectedTime;this.connectid&&this.eventManager.emit("disConnectedEvent",{duration:e,server:this.zegoLink.connectServer,connectid:this.connectid})},Pe.prototype.bt=function(e){this.logger.info(K+" ".concat(JSON.stringify(e.wss_groups))),(e=this.$t(e.wss_groups))&&Array.isArray(e)&&0<e.length?(this.Pt(),this.stateCenter.specified&&(this.logger.info(K+" specified"),e=this.specifiedServers),this.zegoLink.createSocket(e),this.Gt(!1,!0)):this.logger.warn(K+" wss_groups null")},Pe.prototype.It=function(e){var t=this;switch(this.logger.info(J+" ".concat(e.reason," ").concat(e.msg," ").concat(e.action)),e.action){case d.ACTION_DISPATCH:var i=this.reportSeq++;this.eventManager.emit("dispatchEvent",i,"start"),this.Rt().then((function(e){var r=e.servers;t.eventManager.emit("dispatchEvent",i,"end",{domains:e=e.domains,reason:"ConnectClosed"}),Array.isArray(r)&&0<r.length&&(t.eventManager.emit("dispatchResultUpdate",{servers:r,domains:e}),e=t.stateCenter.specified?t.specifiedServers:r,t.Pt(),t.zegoLink.createSocket(e),t.Gt(!1,!0))})).catch((function(e){t.logger.info(J+" dispatch fail")}));break;case d.ACTION_RETRY:this.Pt(),this.Gt(!1);break;case d.ACTION_NEXT_GROUP:this.netAgentPCRequestMgr.closePCs(),this.eventManager.emit("broken",m.CLOSE),this.Gt()}},Pe.prototype.Bt=function(){this.retryLinkHandler&&(this.zegoLink.isConnect()?this.retryLinkHandler.stopMaxTime():this.Gt())},Pe.prototype.zt=function(){this.Pt(),this.retryLinkHandler&&(this.retryLinkHandler.invalid(),this.retryLinkHandler.startMaxTime(),this.zegoLink.setState(0))},Pe.prototype.Gt=function(e,t){this.retryLinkHandler.active(e,t)&&this.xt()},Pe.prototype.xt=function(){var e=this.reportSeq++;this.connectSeq=e,this.eventManager.emit("connectedEvent",e,"start")},Pe.prototype.Pt=function(){this.logger.info("zn.zca.dc.1 call"),this.netAgentPCRequestMgr.closePCs(),this.eventManager.emit("broken"),2===this.lastLinkConnectState&&0===this.linkConnectState&&this.At()},Pe.prototype.getNetworkTimeInfo=function(){var e,t=Date.now()+this.stateCenter.timeOffset,i=Math.round(this.stateCenter.networkRTT/2),r=this.stateCenter.ntpTimeInfo;return r&&(e=performance.now()-r.performanceTime,t=Math.round(r.ntp+e)),{timestamp:t,maxDeviation:i}},Pe);function Pe(e){var t=this;this.proxyCtrl=e,this.vt=null,this.connectServers=[],this.specifiedServers=[],this.getAppConfigFailCount=0,this.getAppConfigTime=0,this.inited=!1,this.linkMsgMaxInterval=90,this.linkMsgCheckInterval=5,this.connectedTime=0,this.connectid="",this.reportSeq=0,this.connectSeq=0,this.defaultConnectServers=[],this.Ct=0,this.lastLinkConnectState=0,this.B=function(e,i){var r;t.linkConnectState=2,t.gt(),0===t.stateCenter.appInfo.env&&(r=t.reportSeq++,t.eventManager.emit("dispatchEvent",r,"start"),t.Rt().then((function(e){var i=e.servers;e=e.domains.map((function(e){return e.host})),t.eventManager.emit("dispatchEvent",r,"end",{domains:e}),0<i.length&&t.eventManager.emit("dispatchResultUpdate",{servers:i,domains:e})})).catch((function(e){})),t.Ot().then((function(e){t.eventManager.emit("svrAddrResultUpdate",{accesshub_domain:e.accesshub_domain,logreport_domain:e.logreport_domain,detaillog_domain:e.detaillog_domain,geofencing_id:e=e.geofencing_id})})).catch((function(e){}))),t.eventManager.emit("connected"),t.connectedTime=(new Date).getTime(),t.connectid=function(e){var t,i="0123456789".split(""),r=[];for(e=i.length,t=0;t<16;t++)r[t]=i[0|Math.random()*e];return r.join("")}(),t.eventManager.emit("connectedEvent",t.connectSeq,"end",{servers:e,count:e.length,connectid:t.connectid,connectEvents:i})},this.L=function(){t.logger.info("zn.zca.oce call"),t.linkConnectState=1},this.k=function(e){t.logger.info("zn.zca.ode"+" ".concat(e)),t.linkConnectState=0,e?(t.Pt(),t.netAgentPCRequestMgr.updateConnectState(l.BROKEN)):(t.eventManager.emit("disconnected"),t.netAgentPCRequestMgr.updateConnectState(l.DISCONNECT),t.At())},this.q=function(e,i,r,o){switch(i){case n.MSG_TYPE_REDIRECT:case n.MSG_TYPE_REDIRECT2:t.bt(r);break;case n.MSG_TYPE_CLOSE_CONNECTION:t.It(r);break;case n.MSG_TYPE_PC_BROKEN:case n.MSG_TYPE_PC_ESTABLISHED:case n.MSG_TYPE_PC_DOWNWARD_MESSAGE:case n.MSG_TYPE_PUSH_EXCEPTION:t.streamManager.onPushEvent(e,i,r,o);break;case n.MSG_TYPE_PUSH_APPCONFIG:t.businessRequestMgr.decodeConfigMessage(r.data)}}}function Ae(e){this.Tt=e,this.streamID=1,this.httpStreams=[],this.pcStreams=[]}function De(e,t,i){this.dt=e,this.St=t,this.Tt=i,this.isFree=!1,this.isFirst=!0}function Ne(e,t,i){this.M=e,this.J=t,this.rt=i,this.netHttpStream=this.J.createStream(c.HTTP)}function Oe(){}function Me(){this.networkState=r.online,this.useNetAgent=!0,this.specified=!1,this.clientIP="",this.timeOffset=0,this.networkRTT=0,this.isDestroyed=!1}function Le(e,t){this.M=e,this.U=t,this.RETRY_START_TIME_INTERVAL=4,this.RETRY_CONTINUE_COUNT=2,this.RETRY_MAX_TIME_INTERVAL=32,this.retryTimer=null,this.maxTimer=null,this._t=1,this.lt=0,this.Et=3,this.isOverTime=!1,this.RETRY_MAX_TIME=90}function xe(e,t){this.J=e,this.M=t,this.pcStreamRequests=[],this.pcEstablishTimeout=de.pcEstablishTimeout}function Ue(e,t,i,r,n){this.M=e,this.rt=t,this.J=i,this.ct=r,this.ut=n,this.connectState=l.DISCONNECT,this.lastConnectState=l.DISCONNECT,this.brokenTimer=null,this.listenerList={connected:[],broken:[]},this.netPcStream=this.J.createStream(c.PC),this.eventManager=new ve,this.netPcStream.onPushEvent=this.onPushEvent.bind(this)}function Be(){this.st={}}function ze(e,t,i){this.J=e,this.M=t,this.U=i,this.X=null,this.tt=5,this.nt=10,this.it=0,this.et=0}function qe(e,t,i,r){this.J=e,this.D=t,this.M=i,this.stateCenter=r}function Xe(e,t){this.proxyCtrl=t,this.A=null,this.ENV=e}}],a={},r.m=s,r.c=a,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"u",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==_typeof(e)&&e&&e.u)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.u?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2))},function(e,t,i){function r(e){var t;return(c[e]||(t=c[e]={i:e,l:!1,exports:{}},a[e].call(t.exports,t,t.exports,r),t.l=!0,t)).exports}var n,o,s,a,c;e.exports=(n=i(10),o=i(1),s=i(3),a=[function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.AUTH_FAIL=t.MULTI_FILE_NOT_EXIST=t.INFLATE_DATA_FAIL=t.FILE_REQUEST_FAIL=t.NOT_INIT=void 0,t.NOT_INIT={code:1001,msg:"not init"},t.FILE_REQUEST_FAIL={code:1002,msg:"fetch request fail"},t.INFLATE_DATA_FAIL={code:1003,msg:"inflate fail"},t.MULTI_FILE_NOT_EXIST={code:1004,msg:"get multi file fail"},t.AUTH_FAIL={code:1005,msg:"auth failed"}},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.SETTINGFETCHHANDLER_FETCHSETTING=t.SETTINGCACHEHANDLER_STORE_SETTING=t.SETTINGCACHEHANDLER_GET_CACHE_SETTING=t.SETTING_POLLING_SETTING=t.SETTING_GET_CLOUD_SETTING=t.SETTING__FETCH_SETTING=t.SETTING_FETCH_SETTING=t.SETTING_INIT=t.constRUCTOR=void 0,t.constRUCTOR="zs.0",t.SETTING_INIT="zs.ii.0",t.SETTING_FETCH_SETTING="zs.fs.0",t.SETTING__FETCH_SETTING="zs.fs.1",t.SETTING_GET_CLOUD_SETTING="zs.gcs.0",t.SETTING_POLLING_SETTING="zs.ps.0",t.SETTINGCACHEHANDLER_GET_CACHE_SETTING="zs.sch.gcs.0",t.SETTINGCACHEHANDLER_STORE_SETTING="zs.sch.ss.0",t.SETTINGFETCHHANDLER_FETCHSETTING="zs.sfh.fs.0"},function(e,t,i){"use strict";var r;Object.defineProperty(t,"u",{value:!0}),t.ProductMap=t.Product=t.SOCKET_DISCONNECT=t.ENUM_REMOTE_TYPE=t.ZEGO_BROWSER_TYPE=t.ZEGO_ENV=t.PROTO_VERSION=void 0,t.PROTO_VERSION="1.1.2",(r=t.ZEGO_ENV||(t.ZEGO_ENV={}))[r.BROWSER=0]="BROWSER",r[r.WEIXINMINI=1]="WEIXINMINI",(r=t.ZEGO_BROWSER_TYPE||(t.ZEGO_BROWSER_TYPE={}))[r.IE=0]="IE",r[r.FIREFOX=1]="FIREFOX",r[r.CHROME=2]="CHROME",r[r.SAFARI=3]="SAFARI",r[r.OPERA=4]="OPERA",r[r.WEIXIN=5]="WEIXIN",r[r.WEIXINMINI=6]="WEIXINMINI",r[r.UNKOWN=7]="UNKOWN",(r=t.ENUM_REMOTE_TYPE||(t.ENUM_REMOTE_TYPE={}))[r.DISABLE=0]="DISABLE",r[r.WEBSOCKET=1]="WEBSOCKET",r[r.HTTPS=2]="HTTPS",t.SOCKET_DISCONNECT=-1,(r=t.Product||(t.Product={}))[r.RTC=0]="RTC",r[r.WEB_RTC=1]="WEB_RTC",r[r.ZIM=2]="ZIM",r[r.ROOM_KIT=3]="ROOM_KIT",r[r.DOC_SHARE=4]="DOC_SHARE",r[r.WHITE_BOARD=5]="WHITE_BOARD",r[r.SELF_CHECK=999]="SELF_CHECK",r[r.TEST_ANOOUS=1e3]="TEST_ANOOUS",t.ProductMap={0:"rtc_sdk_native",1:"Web_SDK",2:"ZIM",3:"roomkitWeb",4:"docsshare",5:"WhiteBoard"}},function(e,t){e.exports=n},function(e,t,i){"use strict";var r=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(r=o.next()).done;)s.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return s},n=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e},o=(Object.defineProperty(t,"u",{value:!0}),t.decodeString=t.decodeCompressData=t.generateUUID=t.checkValidNumber=t.analyzeKey=t.getCurrentTime=t.getBrowser=void 0,i(16)),s=(t.getBrowser=function(){var e=window.navigator.userAgent,t=null!=window.ActiveXObject&&-1!=e.indexOf("MSIE"),i=-1!=e.indexOf("Firefox"),r=null!=window.opr,n=e.indexOf("Chrome")&&window.chrome,o=-1!=e.indexOf("Safari")&&-1!=e.indexOf("Version");return e=e.toLowerCase().match(/MicroMessenger/i)&&"micromessenger"===e.toLowerCase().match(/MicroMessenger/i)[0],t?"IE":i?"FIREFOX":r?"OPERA":n?"CHROME":o?"SAFARI":e?"WEIXIN":"UNKOWN"},["00","01","02","03","04","05","06","07","08","09"]);t.getCurrentTime=function(){var e=new Date;return[e.getFullYear()+"/",(s[e.getMonth()+1]||e.getMonth()+1)+"/",(s[e.getDate()]||e.getDate())+" ",(s[e.getHours()]||e.getHours())+":",(s[e.getMinutes()]||e.getMinutes())+":",s[e.getSeconds()]||e.getSeconds(),"."+e.getTime()%1e3].join("")},t.analyzeKey=function(e){return e=e.split("_"),{level:Number(e[0]),timestamp:e[1],seq:e[2]}},t.checkValidNumber=function(e,t,i){return t=t||1,i=i||1e4,"number"==typeof e&&e%1==0&&t<=e&&e<=i},t.generateUUID=function(e){if(0===(e=void 0===e?0:e))try{i=localStorage.getItem("z_deviceID")}catch(e){}else wx.getStorageSync("z_deviceID");if(!i){var t=(new Date).getTime(),i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?i:3&i|8).toString(36)}));if(0===e)try{localStorage.setItem("z_deviceID",i)}catch(e){}else wx.setStorageSync("z_deviceID",i)}return i},t.decodeCompressData=function(e){try{return o.inflate(e,{to:"string"})}catch(e){console.error(e)}},t.decodeString=function(e){return decodeURIComponent(window.escape(String.fromCharCode.apply(String,n(Array.from(e)))))}},function(e,t){e.exports=o},function(e,t){e.exports=s},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.INIT_CONFIG=void 0,t.INIT_CONFIG={env:0,compress:!0,p_version:1}},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.ZegoSetting=void 0;var r=i(9);Object.defineProperty(t,"ZegoSetting",{enumerable:!0,get:function(){return r.ZegoSetting}})},function(e,t,i){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},n=this&&this.__awaiter||function(e,t,i,r){return new(i=i||Promise)((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){var c=[s,a];if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&c[0]?r.return:c[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,c[1])).done)return n;switch(r=0,(c=n?[2&c[0],n.value]:c)[0]){case 0:case 1:n=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!n||c[1]>n[0]&&c[1]<n[3]))o.label=c[1];else if(6===c[0]&&o.label<n[1])o.label=n[1],n=c;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(c)}}c=t.call(e,o)}catch(a){c=[6,a],r=0}finally{i=n=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},s=(Object.defineProperty(t,"u",{value:!0}),t.ZegoSetting=void 0,i(0)),a=i(2),c=i(10),u=i(11),l=i(13),d=i(7),h=i(4),p=i(1);function f(){this.fileList=[],this.publicEnvVariable={},this.proEnvVariable={},this.pollingTimer=null,this.pollingInterval=300,this.inited=!1,this.checkFailCount=0,this.checkFailed=!1,this.log=new c.ZegoLog}Object.defineProperty(f.prototype,"envVariable",{get:function(){return Object.assign({},this.publicEnvVariable,this.proEnvVariable)},enumerable:!1,configurable:!0}),f.prototype.init=function(e){var t,i=this;return e.pollingFreq&&!h.checkValidNumber(e.pollingFreq)?(this.log.error(p.SETTING_INIT+" pollingFreq must be integer number"),!1):(this.options=Object.assign({},d.INIT_CONFIG,e),this.h(),this.settingFetchHandler=new l.SettingFetchHandler(this.options,this.log),this.settingFetchHandler.setDataReport(this.options.reportNotify),e=Math.round(60*Math.random()),this.log.info(p.SETTING_INIT+" delay "+e),this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null),this.options.pollingFreq&&60<=this.options.pollingFreq&&(this.pollingInterval=this.options.pollingFreq),this.delayTimer=setTimeout((function(){i.v(1e3*i.pollingInterval,!1)}),1e3*e),this.settingCacheHandler=new u.SettingCacheHandler("setting_"+(this.options.online?"online_":"test_")+(e=this.options.product||this.options.productNum)+"_"+this.options.appID,this.log,this.options.env),[0,1,2,3,4,5].includes(e)&&(t=a.ProductMap[e])&&(1===e&&this.settingCacheHandler.dropOldStore("setting_"+(this.options.online?"online_":"test_")+"undefined_"+this.options.appID),this.settingCacheHandler.dropOldStore("setting_"+(this.options.online?"online_":"test_")+t+"_"+this.options.appID)),null!=(e=this.options)&&e.unify&&this.options.connection&&null!=(e=null==(t=this.options)?void 0:t.connection)&&e.on("connected",(function(){i.settingFetchHandler.checkUnSendMsgs(i.settingFetchHandler.unSendCommandList)})),this.g(),this.inited=!0)},f.prototype.uninit=function(){this.pollingTimer&&(clearTimeout(this.pollingTimer),this.pollingTimer=null)},f.prototype.setEnvVariable=function(e,t){this.proEnvVariable[e]=String(t)},f.prototype.getEnvVariable=function(e){return this.envVariable[e]},f.prototype.setEnvVariables=function(e){var t=this;Object.keys(e).forEach((function(i){"string"!=typeof e[i]&&"number"!=typeof e[i]&&t.log.error("zs.sev env "+i+" type error"),t.proEnvVariable[i]=String(e[i])}))},f.prototype.getEnvVariables=function(){return this.envVariable},f.prototype.enablePolling=function(e,t){var i=this;t?t.forEach((function(t){var r=i.fileList.find((function(e){return e.fileName===t}));r&&(r.needPolling=e)})):this.fileList.forEach((function(t){return t.needPolling=e}))},f.prototype.setToken=function(e){this.token!==e&&this.g(),this.token=e},f.prototype.setUserID=function(e){this.userID!==e&&this.g(),this.userID=e},f.prototype.getSettingCache=function(e){return n(this,void 0,void 0,(function(){var t,i;return o(this,(function(r){switch(r.label){case 0:return this.inited?(t=this.fileList.find((function(t){return t.fileName===e})))?[2,Promise.resolve({setting:t.setting,versions:t.versions})]:[3,1]:[2,Promise.reject(s.NOT_INIT)];case 1:return[4,this.settingCacheHandler.getCacheSetting(e)];case 2:return(t=r.sent())&&(this.fileList.find((function(t){return t.fileName===e}))||this.fileList.push({fileName:e,fetchedTime:0,needPolling:!1,setting:t.setting,versions:t.versions}),i={setting:t.setting,versions:t.versions}),[2,Promise.resolve(i)]}}))}))},f.prototype.fetchSetting=function(e,t,i){return void 0===t&&(t={}),void 0===i&&(i=!0),this.log.info(p.SETTING_FETCH_SETTING+" call "+e),this.inited?(this.activePolling(),0<Object.keys(t).length?(this.log.info(p.SETTING_FETCH_SETTING+" get file with params"),this._(e,r(r({},this.envVariable),t))):(t=this.fileList.find((function(t){return t.fileName===e})))?(this.log.info(p.SETTING_FETCH_SETTING+" file exist"),(new Date).getTime()-t.fetchedTime<1e3*this.pollingInterval?(this.log.info(p.SETTING_FETCH_SETTING+" fetch time interval in freq"),t.needPolling=i,Promise.resolve({setting:t.setting,versions:t.versions})):this.O(e,t,i)):(this.log.info(p.SETTING_FETCH_SETTING+" file not found"),this.O(e,t,i))):Promise.reject(s.NOT_INIT)},f.prototype.fetchMultiSetting=function(e,t,i){var a=this;return void 0===t&&(t={}),void 0===i&&(i=!0),this.log.info(p.SETTING_FETCH_SETTING+" call "+JSON.stringify(e)),this.inited?(this.activePolling(),0<Object.keys(t).length?(this.log.info(p.SETTING_FETCH_SETTING+" get file with params"),this._(e,r(r({},this.envVariable),t))):new Promise((function(t,r){var s={},c=[];if(e.forEach((function(e){return n(a,void 0,void 0,(function(){var t;return o(this,(function(i){return(t=this.fileList.find((function(t){return t.fileName===e})))&&(new Date).getTime()-t.fetchedTime<1e3*this.pollingInterval?(this.log.info(p.SETTING_FETCH_SETTING+" fetch time interval in freq"),s[e]={setting:t.setting,versions:t.versions}):c.push(e),[2]}))}))})),!(0<c.length))return t(s);a._(c,a.envVariable).then((function(e){return a.k(e,i),Object.assign(s,e),t(s)})).catch((function(e){c.forEach((function(e){return n(a,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return(t=this.fileList.find((function(t){return t.fileName==e})))?t.fetchedTime=(new Date).getTime():this.fileList.find((function(t){return t.fileName===e}))||this.fileList.push({fileName:e,fetchedTime:(new Date).getTime(),needPolling:i,setting:{},versions:{}}),[4,this.settingCacheHandler.getCacheSetting(e)];case 1:return t=r.sent(),s[e]={setting:t.setting,versions:t.versions},[2]}}))}))})),0<Object.keys(s).length?t(s):r(e)}))}))):(this.log.info(p.SETTING_FETCH_SETTING+" not init"),Promise.reject(s.NOT_INIT))},f.prototype.setOptions=function(e){e&&"boolean"==typeof e.unify&&(this.options.unify=e.unify,this.settingFetchHandler.setOptions(this.options))},f.prototype.setLog=function(e){this.log=e},f.prototype._=function(e,t){var i=this;return new Promise((function(r,a){return n(i,void 0,void 0,(function(){var i,n,c,u,l,d,h,f,m,v=this;return o(this,(function(o){switch(o.label){case 0:if(o.trys.push([0,6,,7]),this.checkFailed)return this.log.warn(p.SETTING_GET_CLOUD_SETTING+" check fail"),a(s.AUTH_FAIL),[2];n=(i=e instanceof Array)?e:[e],c=[],u={},l=function(e){return e=e.map((function(e){return v.settingCacheHandler.getCacheSetting(e)})),Promise.all(e)},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,l(n)];case 2:return d=o.sent(),n.forEach((function(e,t){var i;c.push({file_name:e,hash:null==(i=d[t].versions)?void 0:i.hash,g_version:null==(i=d[t].versions)?void 0:i.g_version}),u[e]=d[t]})),[3,4];case 3:return o.sent(),n.forEach((function(e){c.push({file_name:e})})),[3,4];case 4:return[4,this.settingFetchHandler.fetchSetting(c,t,this.token,this.userID,!1)];case 5:return m=o.sent(),h=m.data,m=m.polling_interval,this.checkFailCount=0,this.log.info(p.SETTING_GET_CLOUD_SETTING+" suc"),"number"==typeof m&&5<=m&&this.pollingInterval!==60*m&&(this.log.warn(p.SETTING_GET_CLOUD_SETTING+" polling interval change"),this.pollingInterval=60*m,this.uninit(),this.activePolling()),i?(f={},e.forEach((function(e){var t;0==(null==(t=h[e])?void 0:t.code)&&(h[e].hashChange?(v.log.info(p.SETTING_GET_CLOUD_SETTING+" file "+e+" changed"),f[e]={setting:null==(t=h[e])?void 0:t.data,versions:null==(t=h[e])?void 0:t.versions}):u[e]&&(f[e]={setting:null==(t=u[e])?void 0:t.setting,versions:null==(t=u[e])?void 0:t.versions}))})),0<Object.keys(f).length?r(f):a(s.MULTI_FILE_NOT_EXIST)):0===(null==(m=h[e])?void 0:m.code)&&null!=(m=h[e])&&m.data?r({setting:null==(m=h[e])?void 0:m.data,versions:null==(m=h[e])?void 0:m.versions}):a({code:null==(m=h[e])?void 0:m.code,msg:null==(m=h[e])?void 0:m.message}),[3,7];case 6:return m=o.sent(),this.log.error(p.SETTING_GET_CLOUD_SETTING+" fail "+JSON.stringify(m)),21002!==(null==m?void 0:m.code)&&401!==(null==m?void 0:m.status_code)||(this.checkFailCount+=1),2<=this.checkFailCount&&(this.checkFailed=!0),a(m),[3,7];case 7:return[2]}}))}))}))},f.prototype.k=function(e,t){var i=this;Object.keys(e).forEach((function(r){(n=i.fileList.find((function(e){return e.fileName==r})))?(n.fetchedTime=(new Date).getTime(),n.setting=e[r].setting,n.versions=e[r].versions,n.needPolling=t):i.fileList.find((function(e){return e.fileName===r}))||i.fileList.push({fileName:r,fetchedTime:(new Date).getTime(),needPolling:t,setting:e[r].setting,versions:e[r].versions});var n=r;i.settingCacheHandler.storeSetting(n,e[r])}))},f.prototype.O=function(e,t,i){var r=this;return new Promise((function(s,a){r.log.info(p.SETTING__FETCH_SETTING+" call"),r._(e,r.envVariable).then((function(n){t?(t.fetchedTime=(new Date).getTime(),t.setting=n.setting,t.versions=n.versions,t.needPolling=i):r.fileList.find((function(t){return t.fileName===e}))||r.fileList.push({fileName:e,fetchedTime:(new Date).getTime(),needPolling:i,setting:n.setting,versions:n.versions}),r.settingCacheHandler.storeSetting(e,n),s(n),r.log.info(p.SETTING__FETCH_SETTING+" call suc")})).catch((function(c){return n(r,void 0,void 0,(function(){var r,n;return o(this,(function(o){switch(o.label){case 0:t?t.fetchedTime=(new Date).getTime():this.fileList.find((function(t){return t.fileName===e}))||this.fileList.push({fileName:e,fetchedTime:(new Date).getTime(),needPolling:i,setting:{},versions:{}}),r=e,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.settingCacheHandler.getCacheSetting(r)];case 2:return n=o.sent(),s(n),[3,4];case 3:return o.sent(),a(c),[3,4];case 4:return this.log.info(p.SETTING__FETCH_SETTING+" setting not contain or fetch file fail"),[2]}}))}))}))}))},f.prototype.h=function(){var e;0==this.options.env?(this.publicEnvVariable.userAgent=navigator.userAgent,this.publicEnvVariable.platform=navigator.platform,this.publicEnvVariable.browser=h.getBrowser(),this.publicEnvVariable.deviceid=h.generateUUID()):1==this.options.env&&(e=wx.getSystemInfoSync(),this.publicEnvVariable.brand=e.brand,this.publicEnvVariable.model=e.model,this.publicEnvVariable.system=e.system,this.publicEnvVariable.platform=e.platform,this.publicEnvVariable.wechatVersion=e.version,this.publicEnvVariable.wechatSDKVersion=e.SDKVersion,this.publicEnvVariable.deviceid=h.generateUUID(this.options.env))},f.prototype.v=function(e,t){return void 0===t&&(t=!0),n(this,void 0,void 0,(function(){var i,r,s,a,c=this;return o(this,(function(u){switch(u.label){case 0:if(this.log.info(p.SETTING_POLLING_SETTING+" call "+e+" "+t),i=e,t){if(r=[],this.fileList.forEach((function(e){e.needPolling&&r.push({file_name:e.fileName,hash:e.versions.hash,g_version:e.versions.g_version})})),!this.checkFailed)return[3,1];this.log.warn(p.SETTING_GET_CLOUD_SETTING+" has checked fail")}return[3,7];case 1:if(!(0<r.length))return[3,6];u.label=2;case 2:return u.trys.push([2,4,,5]),[4,this.settingFetchHandler.fetchSetting(r,this.envVariable,this.token,this.userID)];case 3:return a=u.sent(),s=a.data,a=a.polling_interval,this.log.info(p.SETTING_POLLING_SETTING+" fetch suc"),this.checkFailCount=0,"number"==typeof a&&5<=a&&this.pollingInterval!==60*a&&(this.log.warn(p.SETTING_POLLING_SETTING+" polling interval change"),this.pollingInterval=60*a,i=1e3*this.pollingInterval),this.fileList.forEach((function(e){return n(c,void 0,void 0,(function(){var t,i,r,n,a,c,u,l,d;return o(this,(function(o){switch(o.label){case 0:return e.fetchedTime=(new Date).getTime(),t=e.fileName,d=(n=s[e.fileName]).code,u=n.data,l=n.versions,i=n.message,r=n.hashChange,n&&0===d&&u?(n=JSON.stringify(u),a=JSON.stringify(e.setting),c={setting:u,versions:l,code:d,message:i},r&&a!==n&&(this.log.info(p.SETTING_POLLING_SETTING+" "+e.fileName+" setting changed"),e.setting=c.setting,e.versions=c.versions,this.options.pollingNotify(e.fileName,c)),[4,this.settingCacheHandler.getCacheSetting(t)]):[3,2];case 1:u=o.sent(),l=JSON.stringify(u),d=JSON.stringify(c),r&&l!==d&&this.settingCacheHandler.storeSetting(t,c),o.label=2;case 2:return[2]}}))}))})),[3,5];case 4:return a=u.sent(),this.log.error(p.SETTING_POLLING_SETTING+" fetch fail "+JSON.stringify(a)),21002!==(null==a?void 0:a.code)&&401!==(null==a?void 0:a.status_code)||(this.checkFailCount+=1),2<=this.checkFailCount&&(this.checkFailed=!0),[3,5];case 5:return[3,7];case 6:this.log.info(p.SETTING_POLLING_SETTING+" polling no file"),u.label=7;case 7:return this.pollingTimer&&clearTimeout(this.pollingTimer),this.pollingTimer=setTimeout((function(){c.v(i)}),i),[2]}}))}))},f.prototype.activePolling=function(){this.pollingTimer||this.v(1e3*this.pollingInterval)},f.prototype.g=function(){this.checkFailCount=0,this.checkFailed=!1},t.ZegoSetting=f},function(e,t,i){"use strict";function r(){}Object.defineProperty(t,"u",{value:!0}),t.ZegoLog=void 0,r.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.join(" ");console.log(i)},r.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.join(" ");console.debug(i)},r.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.join(" ");console.info(i)},r.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.join(" ");console.warn(i)},r.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.join(" ");console.error(i)},t.ZegoLog=r},function(e,t,i){"use strict";var r=this&&this.__awaiter||function(e,t,i,r){return new(i=i||Promise)((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){var c=[s,a];if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&c[0]?r.return:c[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,c[1])).done)return n;switch(r=0,(c=n?[2&c[0],n.value]:c)[0]){case 0:case 1:n=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!n||c[1]>n[0]&&c[1]<n[3]))o.label=c[1];else if(6===c[0]&&o.label<n[1])o.label=n[1],n=c;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(c)}}c=t.call(e,o)}catch(a){c=[6,a],r=0}finally{i=n=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},o=this&&this.__importDefault||function(e){return e&&e.u?e:{default:e}},s=(Object.defineProperty(t,"u",{value:!0}),t.SettingCacheHandler=void 0,o(i(3))),a=i(1),c=i(12);function u(e,t,i){void 0===i&&(i=0),this.S=e,this.D=t,this.store=c.createZegoStore(e,i)}u.prototype.getCacheSetting=function(e){return r(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return this.D.info(a.SETTINGCACHEHANDLER_GET_CACHE_SETTING+" call"),[4,this.store.getItem(e)];case 1:return[2,t.sent()||""]}}))}))},u.prototype.storeSetting=function(e,t){return r(this,void 0,void 0,(function(){return n(this,(function(i){switch(i.label){case 0:return this.D.info(a.SETTINGCACHEHANDLER_STORE_SETTING+" call"),[4,this.store.setItem(e,t)];case 1:return i.sent(),[2]}}))}))},u.prototype.dropOldStore=function(e){s.default.dropInstance({name:e}).then((function(){console.debug("Dropped ",e)})).catch((function(e){console.warn(e)}))},t.SettingCacheHandler=u},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.createZegoStore=t.ZegoWechatMiniStore=void 0;var r=i(3),n=i(2),o=(s.prototype.getItem=function(e){var t=this;return new Promise((function(i,r){try{i(wx.getStorageSync(t.keyPrefix+e))}catch(i){r(i)}}))},s.prototype.setItem=function(e,t){var i=this;return new Promise((function(r,n){try{wx.setStorageSync(i.keyPrefix+e,t),r()}catch(r){n(r)}}))},s.prototype.removeItem=function(e){var t=this;return new Promise((function(i,r){try{i(wx.removeStorageSync(t.keyPrefix+e))}catch(i){r(i)}}))},s.prototype.clear=function(){return new Promise((function(e,t){try{wx.clearStorageSync(),e()}catch(e){t(e)}}))},s.prototype.keys=function(){var e=this;return new Promise((function(t,i){try{var r=wx.getStorageInfoSync().keys,n=(console.warn("keys",r),[]);r.forEach((function(t){0==t.indexOf(e.keyPrefix)&&n.push(t.replace(e.keyPrefix,""))})),console.warn("keyArr",n),n.sort(),t(n)}catch(t){i(t)}}))},s);function s(e){this.storeName=e,this.keyPrefix=e+"/"}t.ZegoWechatMiniStore=o,t.createZegoStore=function(e,t){return t===n.ZEGO_ENV.BROWSER?r.createInstance({name:e}):new o(e)}},function(e,t,i){"use strict";var r,n,o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},s=this&&this.__importDefault||function(e){return e&&e.u?e:{default:e}},a=(Object.defineProperty(t,"u",{value:!0}),t.SettingFetchHandler=void 0,i(14)),c=i(15),u=i(4),l=i(17),d=i(7),h=s(i(5)),p=i(1),f=i(0);function m(e,t){this.j=e,this.D=t,this.seq=0,this.userID="",this.unSendCommandList=new c.LinkedList,this.testNetPackageSize=!1,this.protobuf=new l.CloudSettingProtoBuf}r={SERVICE_ClOUD_SETTING:10,10:"SERVICE_ClOUD_SETTING"},s=n={METHOD_UNSET:0,0:"METHOD_UNSET",METHOD_GET:1,1:"METHOD_GET",METHOD_POST:2,2:"METHOD_POST"},m.prototype.setOptions=function(e){this.j=e},m.prototype.setDataReport=function(e){this.reportFunc=e},m.prototype.setUserID=function(e){this.userID=e},m.prototype.fetchSetting=function(e,t,i,r,n){var s=this;return void 0===n&&(n=!0),new Promise((function(c,l){function h(e){var t,i=e.code,r=e.data,o=e.polling_interval;e=e.reportData,s.D.info(p.SETTINGFETCHHANDLER_FETCHSETTING+" unify "+i),r&&(t=[],Object.keys(r).forEach((function(e){var i;t.push({name:e,code:r[e].code,message:null==(i=r[e])?void 0:i.message,versions:JSON.stringify(null==(i=r[e])?void 0:i.versions),content:JSON.stringify(null==(i=r[e])?void 0:i.data)})}))),s.reportFunc&&s.reportFunc(y,"request_end",{code:i,reportData:e,params:g,requestKV:v,files:t,polling:n}),c({data:r,polling_interval:o})}function f(e){var t=e.code,i=e.msg,r=e.status_code;e=e.reportData,s.D.warn(p.SETTINGFETCHHANDLER_FETCHSETTING+" unify "+t),s.reportFunc&&s.reportFunc(y,"request_end",{code:t,params:g,requestKV:v,reportData:e,polling:n}),l({code:t,msg:i,status_code:r})}var m={product:s.j.product,files:e.map((function(e){return e.file_name})),param:o(o({},t),{deviceid:void 0}),appid:s.j.appID,token:i,id_name:r,timestamp:(new Date).getTime(),biztype:0,deviceid:t.deviceid||u.generateUUID(s.j.env),compress:!1,mode:s.j.online?"online":"test"},v=m.param,g={appid:m.appid,token:m.token,id_name:m.id_name,deviceid:m.deviceid},y=s.seq++;if(s.reportFunc&&s.reportFunc(y,"request_start",{polling:n}),null!=(S=s.j)&&S.unify&&s.j.connection)if(void 0!==s.j.productNum){var b,_=[];for(b in m.param)void 0!==m.param[b]&&_.push({key:b,value:m.param[b]});var S={product:s.j.productNum,response_compress:d.INIT_CONFIG.compress?0:1,files:e,param_list:_,p_version:d.INIT_CONFIG.p_version},T=(s.D.info(p.SETTINGFETCHHANDLER_FETCHSETTING+" files "+JSON.stringify(S.files)),s.j.online?1:2);s.sendCloudPBRequest(r,S,i,T,h,f)}else s.sendCloudRequest(r,m,"/cloud-setting/get",(function(e){h(e)}),(function(e){f(e)}));else s.j.urls&&a.fetch(s.j.urls,m,s.j.env||0).then((function(e){var t,i=e.code,r=e.data,o=e.polling_interval;e=e.reportData,s.D.info(p.SETTINGFETCHHANDLER_FETCHSETTING+" "+i),r&&(t=[],Object.keys(r).forEach((function(e){var i;t.push({name:e,code:r[e].code,message:null==(i=r[e])?void 0:i.message,versions:JSON.stringify(null==(i=r[e])?void 0:i.versions),content:JSON.stringify(null==(i=r[e])?void 0:i.data)})}))),s.reportFunc&&s.reportFunc(y,"request_end",{code:i,reportData:e,params:g,requestKV:v,files:t,polling:n}),c({data:r,polling_interval:o})})).catch((function(e){var t=e.code,i=e.msg;e=e.reportData,s.D.warn(p.SETTINGFETCHHANDLER_FETCHSETTING+" "+t),s.reportFunc&&s.reportFunc(y,"request_end",{code:t,params:g,requestKV:v,reportData:e,polling:n}),l({code:t,msg:i})}))}))},m.prototype.sendCloudRequest=function(e,t,i,s,a,c,u){var l=this,d=(void 0===c&&(c=3),void 0===u&&(u=[]),(new Date).getTime());this.sendNetAgentHttpRequest({service:r.SERVICE_ClOUD_SETTING,body:t,ack:!1,idName:e,method_no:n.METHOD_POST,location:i},(function(r){var n,h,p,m,v;200===(null==r?void 0:r.status_code)?(n=(m=JSON.parse(r.body)).code,h=m.message,p=m.data,m=m.polling_interval,v=(new Date).getTime()-d,u.push({timestamp:d,url:i,error:n,duration:v}),0===n?s({code:n,msg:h,data:p,polling_interval:m,reportData:u}):a({code:n,msg:h,reportData:u})):(v=(new Date).getTime()-d,u.push({timestamp:d,url:i,error:null==r?void 0:r.status_code,duration:v}),0<c?(c--,l.sendCloudRequest(e,t,i,s,a,c,u)):a(o(o({},f.FILE_REQUEST_FAIL),{reportData:u})))}),(function(r){var n=(new Date).getTime()-d;u.push({timestamp:d,url:i,error:r.code,duration:n}),0<c?(c--,l.sendCloudRequest(e,t,i,s,a,c,u)):a(o(o({},f.FILE_REQUEST_FAIL),{reportData:u}))}),null,{timeout:4e3})},m.prototype.sendNetAgentHttpRequest=function(e,t,i,r,n){e={param:e,suc:t,err:i,ack:r,option:n},null!=(t=this.j.connection)&&t.isConnect()?this.sendNetUintData(e):this.unSendCommandList.push(e)},m.prototype.sendNetUintData=function(e){var t,i=e.param,r=e.suc,n=e.err,o=e.ack;e=e.option,null!=(t=this.j.connection)&&t.startHttpRequest(i,r,n,o,e)},m.prototype.checkUnSendMsgs=function(e){for(var t=e.getFirst();null!=t;)e.remove(t),t.T&&t.T.param&&this.sendNetUintData(t.T),t=e.getFirst()},m.prototype.sendCloudPBRequest=function(e,t,i,r,s,a,c,l){var d,m=this,v=(void 0===c&&(c=3),void 0===l&&(l=[]),(new Date).getTime()),g=this.protobuf.encodeCloudSettingReq(t);null!=(d=this.j.connection)&&d.startHttpRequest2({interfaceID:14,body:g,ack:!1,idName:e,method:n.METHOD_POST,token:i,mode:r,reduceRspHeaders:!0},(function(n,d){if(200===(null==n?void 0:n.status_code)){var g=m.protobuf.decodeCloudSettingRsp(n.body),y=g.message,b=g.polling_interval,_=g.code||0,S=(h.default.isLong(_)&&(_=_.toNumber()),(new Date).getTime()-v);if(l.push({timestamp:v,error:_,duration:S}),0===_){for(var T={},E=0;E<g.file_response.length;E++){var C=(P=g.file_response[E]).message,w=P.file_name,I=P.hash,R=P.g_version,k=P.json_data,P=(m.D.info(p.SETTINGFETCHHANDLER_FETCHSETTING+" file rsp "+w+" "+R+" "+I.toString()),P.code||0),A=(h.default.isLong(P)&&(P=P.toNumber()),{});if(0<(null==I?void 0:I.byteLength)&&0<(null==k?void 0:k.byteLength))try{var D=0===t.response_compress?u.decodeCompressData(k):u.decodeString(k);A=JSON.parse(D)}catch(n){m.D.info(p.SETTINGFETCHHANDLER_FETCHSETTING+" decode fail "+(null==n?void 0:n.message)?n.message:JSON.stringify(n))}T[w]={code:P,message:C,versions:{hash:I,g_version:R},data:A,hashChange:0===I.byteLength?0:1}}s({code:_,msg:y,data:T,polling_interval:b,reportData:l})}else a({code:_,msg:y,reportData:l})}else S=(new Date).getTime()-v,l.push({timestamp:v,error:null==n?void 0:n.status_code,duration:S}),0<c?(c--,m.sendCloudPBRequest(e,t,i,r,s,a,c,l)):a(o(o({},f.FILE_REQUEST_FAIL),{reportData:l,status_code:null==n?void 0:n.status_code}))}),(function(n){var u=(new Date).getTime()-v;l.push({timestamp:v,error:n.code,duration:u}),0<c?(c--,m.sendCloudPBRequest(e,t,i,r,s,a,c,l)):a(o(o({},f.FILE_REQUEST_FAIL),{reportData:l,status_code:null==n?void 0:n.status_code}))}),null,{timeout:4e3,extras:{protoCmd:"GetCloudSettingConfigRequest"}})},t.SettingFetchHandler=i=m},function(e,t,i){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},n=(Object.defineProperty(t,"u",{value:!0}),t.fetch=void 0,i(0));t.fetch=function e(t,i,o,s,a,c){return void 0===s&&(s=5),void 0===a&&(a=0),void 0===c&&(c=[]),new Promise((function(u,l){a=a||(new Date).getTime();var d,h,p,f=(new Date).getTime();0===o?((d=new XMLHttpRequest).open("post",h=t[(s+1)%2]||t[0]),1==i.compress&&(d.responseType="arraybuffer"),d.ontimeout=function(){console.warn("The request for "+h+" timed out.")},d.onreadystatechange=function(){var p,m,v,g,y;4==d.readyState&&(200<=d.status&&d.status<300||304==d.status?(v=void 0,1!=i.compress&&(v=d.responseText),y=(new Date).getTime()-f,p=(v=JSON.parse(v)).code,m=v.message,g=v.data,v=v.polling_interval,c.push({timestamp:f,url:h,error:p,duration:y}),0===p?u({code:p,msg:m,data:g,polling_interval:v,reportData:c}):l({code:p,msg:m,reportData:c})):(g=(new Date).getTime()-f,c.push({timestamp:f,url:h,error:d.status,duration:g}),y=(new Date).getTime()-a,0<s&&y<8e3?e(t,i,o,--s,a,c).then((function(e){u(e)})).catch((function(e){l(e)})):l(r(r({},n.FILE_REQUEST_FAIL),{reportData:c}))))},d.timeout=8e3,d.send(JSON.stringify(i))):(p=t[(s+1)%2]||t[0],wx.request({url:p,data:i,method:"POST",success:function(d){console.log(d.data);var h=(g=d.data).code,m=g.message,v=g.data,g=g.polling_interval;void 0!==h?0===h?(console.log("post suc"),u({code:h,msg:m,data:v,polling_interval:g,reportData:c})):(console.error("post fail ",h,m),l({code:h,msg:m,reportData:c})):(v=(new Date).getTime()-f,c.push({timestamp:f,url:p,error:n.FILE_REQUEST_FAIL.code,msg:d.data,duration:v}),0<s?e(t,i,o,--s,a,c).then((function(e){u(e)})).catch((function(e){l(e)})):l(r(r({},n.FILE_REQUEST_FAIL),{reportData:c})))},fail:function(d){console.log("send failed "+JSON.stringify(d)+d.statusCode);var h=(new Date).getTime()-f;c.push({timestamp:f,url:p,error:n.FILE_REQUEST_FAIL.code,msg:d.errMsg,duration:h}),0<s?e(t,i,o,--s,a,c).then((function(e){u(e)})).catch((function(e){l(e)})):l(r(r({},n.FILE_REQUEST_FAIL),{reportData:c}))}}))}))}},function(e,t,i){"use strict";Object.defineProperty(t,"u",{value:!0}),t.LinkedList=t.ListNode=void 0,Object.defineProperty(n.prototype,"id",{get:function(){return this.N||null},set:function(e){this.N=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){return this.T},set:function(e){this.T=e},enumerable:!1,configurable:!0}),n.prototype.hasNext=function(){return this.next&&this.next.id},n.prototype.hasPrev=function(){return this.prev&&this.prev.id};var r=n;function n(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this.next=null,this.prev=null,this.N=e,this.T=t}function o(){this.start=new r,this.end=new r,this.R=0,this.A=0,this.start.next=this.end,this.start.prev=null,this.end.prev=this.start,this.end.next=null}t.ListNode=r,o.prototype.insertBefore=function(e,t){return(t=new r(this.R,t)).next=e,t.prev=e.prev,e.prev&&(e.prev.next=t),e.prev=t,++this.R,++this.A,t},o.prototype.addLast=function(e){return this.insertBefore(this.end,e)},o.prototype.add=function(e){return this.addLast(e)},o.prototype.getFirst=function(){return 0===this.A?null:this.start.next},o.prototype.getLast=function(){return 0===this.A?null:this.end.prev},o.prototype.size=function(){return this.A},o.prototype.getFromFirst=function(e){var t=0,i=this.start.next;if(0<=e)for(;t<e&&null!==i;)i=i.next,++t;else i=null;if(null===i)throw"Index out of bounds.";return i},o.prototype.get=function(e){return 0===e?this.getFirst():e===this.A-1?this.getLast():this.getFromFirst(e)},o.prototype.remove=function(e){return e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),--this.A,e},o.prototype.removeFirst=function(){return 0<this.A&&this.start.next?this.remove(this.start.next):null},o.prototype.removeLast=function(){return 0<this.A&&this.end.prev?this.remove(this.end.prev):null},o.prototype.removeAll=function(){this.start.next=this.end,this.end.prev=this.start,this.A=0,this.R=0},o.prototype.each=function(e){for(var t=this.start;t.hasNext();)e(t=t.next)},o.prototype.find=function(e){for(var t=this.start,i=!1,r=null;t.hasNext()&&!i;)e(t=t.next)&&(r=t,i=!0);return r},o.prototype.map=function(e){for(var t=this.start,i=[];t.hasNext();)e(t=t.next)&&i.push(t);return i},o.prototype.push=function(e){return this.addLast(e)},o.prototype.unshift=function(e){this.insertBefore(0<this.A?this.start.next:this.end,e)},o.prototype.pop=function(){return this.removeLast()},o.prototype.shift=function(){return this.removeFirst()},t.LinkedList=o},function(e,t,i){!function(e){"use strict";function t(e,t,i,r){var o=n,s=r+i;e^=-1;for(var a=r;a<s;a++)e=e>>>8^o[255&(e^t[a])];return~e}function i(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}var r=function(e,t,i,r){for(var n=65535&e,o=e>>>16&65535,s=0;0!==i;){for(i-=s=2e3<i?2e3:i;o=o+(n=n+t[r++]|0)|0,--s;);n%=65521,o%=65521}return n|o<<16},n=new Uint32Array(function(){for(var e=[],t=0;t<256;t++){for(var i=t,r=0;r<8;r++)i=1&i?3988292384^i>>>1:i>>>1;e[t]=i}return e}()),o=16209,s=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),a=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),c=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),u=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),l=function(e,t,i,r,n,o,l,d){var h,p,f,m,v,g,y,b,_,S=d.bits,T=0,E=0,C=0,w=0,I=0,R=0,k=0,P=0,A=0,D=0,N=null,O=new Uint16Array(16),M=new Uint16Array(16),L=null;for(T=0;T<=15;T++)O[T]=0;for(E=0;E<r;E++)O[t[i+E]]++;for(I=S,w=15;1<=w&&0===O[w];w--);if(w<I&&(I=w),0===w)n[o++]=20971520,n[o++]=20971520,d.bits=1;else{for(C=1;C<w&&0===O[C];C++);for(I<C&&(I=C),T=P=1;T<=15;T++)if((P=(P<<1)-O[T])<0)return-1;if(0<P&&(0===e||1!==w))return-1;for(M[1]=0,T=1;T<15;T++)M[T+1]=M[T]+O[T];for(E=0;E<r;E++)0!==t[i+E]&&(l[M[t[i+E]]++]=E);if(g=0===e?(N=L=l,20):1===e?(N=s,L=a,257):(N=c,L=u,0),T=C,v=o,k=E=D=0,f=-1,m=(A=1<<(R=I))-1,1===e&&852<A||2===e&&592<A)return 1;for(;;){for(_=l[E]+1<g?(b=0,l[E]):l[E]>=g?(b=L[l[E]-g],N[l[E]-g]):(b=96,0),h=1<<(y=T-k),C=p=1<<R;n[v+(D>>k)+(p-=h)]=y<<24|b<<16|_,0!==p;);for(h=1<<T-1;D&h;)h>>=1;if(D=0!==h?(D&h-1)+h:0,E++,0==--O[T]){if(T===w)break;T=t[i+l[E]]}if(I<T&&(D&m)!==f){for(v+=C,P=1<<(R=T-(k=0===k?I:k));R+k<w&&!((P-=O[R+k])<=0);)R++,P<<=1;if(A+=1<<R,1===e&&852<A||2===e&&592<A)return 1;n[f=D&m]=I<<24|R<<16|v-o}}0!==D&&(n[v+D]=T-k<<24|64<<16),d.bits=I}return 0},d={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},h=d.Z_FINISH,p=d.Z_BLOCK,f=d.Z_TREES,m=d.Z_OK,v=d.Z_STREAM_END,g=d.Z_NEED_DICT,y=d.Z_STREAM_ERROR,b=d.Z_DATA_ERROR,_=d.Z_MEM_ERROR,S=d.Z_BUF_ERROR,T=d.Z_DEFLATED,E=16180,C=16190,w=16191,I=16209;function R(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(e,n){var s,a,c,u,d,R,k,P,O,x,U,B,z,q,X,H,F,V,G,j,Q,W,Z,K,J=0,Y=new Uint8Array(4),$=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(N(e)||!e.output||!e.input&&0!==e.avail_in)return y;(s=e.state).mode===w&&(s.mode=16192),d=e.next_out,c=e.output,u=e.next_in,a=e.input,P=s.hold,O=s.bits,x=R=e.avail_in,U=k=e.avail_out,W=m;e:for(;;)switch(s.mode){case E:if(0===s.wrap)s.mode=16192;else{for(;O<16;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}2&s.wrap&&35615===P?(0===s.wbits&&(s.wbits=15),Y[s.check=0]=255&P,Y[1]=P>>>8&255,s.check=t(s.check,Y,2,0),O=P=0,s.mode=16181):(s.head&&(s.head.done=!1),!(1&s.wrap)||(((255&P)<<8)+(P>>8))%31?(e.msg="incorrect header check",s.mode=I):(15&P)!==T?(e.msg="unknown compression method",s.mode=I):(O-=4,Q=8+(15&(P>>>=4)),0===s.wbits&&(s.wbits=Q),15<Q||Q>s.wbits?(e.msg="invalid window size",s.mode=I):(s.dmax=1<<s.wbits,s.flags=0,e.adler=s.check=1,s.mode=512&P?16189:w,O=P=0)))}break;case 16181:for(;O<16;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}if(s.flags=P,(255&s.flags)!==T){e.msg="unknown compression method",s.mode=I;break}if(57344&s.flags){e.msg="unknown header flags set",s.mode=I;break}s.head&&(s.head.text=P>>8&1),512&s.flags&&4&s.wrap&&(Y[0]=255&P,Y[1]=P>>>8&255,s.check=t(s.check,Y,2,0)),O=P=0,s.mode=16182;case 16182:for(;O<32;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}s.head&&(s.head.time=P),512&s.flags&&4&s.wrap&&(Y[0]=255&P,Y[1]=P>>>8&255,Y[2]=P>>>16&255,Y[3]=P>>>24&255,s.check=t(s.check,Y,4,0)),O=P=0,s.mode=16183;case 16183:for(;O<16;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}s.head&&(s.head.xflags=255&P,s.head.os=P>>8),512&s.flags&&4&s.wrap&&(Y[0]=255&P,Y[1]=P>>>8&255,s.check=t(s.check,Y,2,0)),O=P=0,s.mode=16184;case 16184:if(1024&s.flags){for(;O<16;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}s.length=P,s.head&&(s.head.extra_len=P),512&s.flags&&4&s.wrap&&(Y[0]=255&P,Y[1]=P>>>8&255,s.check=t(s.check,Y,2,0)),O=P=0}else s.head&&(s.head.extra=null);s.mode=16185;case 16185:if(1024&s.flags&&((B=(B=s.length)>R?R:B)&&(s.head&&(Q=s.head.extra_len-s.length,s.head.extra||(s.head.extra=new Uint8Array(s.head.extra_len)),s.head.extra.set(a.subarray(u,u+B),Q)),512&s.flags&&4&s.wrap&&(s.check=t(s.check,a,B,u)),R-=B,u+=B,s.length-=B),s.length))break e;s.length=0,s.mode=16186;case 16186:if(2048&s.flags){if(0===R)break e;for(B=0;Q=a[u+B++],s.head&&Q&&s.length<65536&&(s.head.name+=String.fromCharCode(Q)),Q&&B<R;);if(512&s.flags&&4&s.wrap&&(s.check=t(s.check,a,B,u)),R-=B,u+=B,Q)break e}else s.head&&(s.head.name=null);s.length=0,s.mode=16187;case 16187:if(4096&s.flags){if(0===R)break e;for(B=0;Q=a[u+B++],s.head&&Q&&s.length<65536&&(s.head.comment+=String.fromCharCode(Q)),Q&&B<R;);if(512&s.flags&&4&s.wrap&&(s.check=t(s.check,a,B,u)),R-=B,u+=B,Q)break e}else s.head&&(s.head.comment=null);s.mode=16188;case 16188:if(512&s.flags){for(;O<16;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}if(4&s.wrap&&P!==(65535&s.check)){e.msg="header crc mismatch",s.mode=I;break}O=P=0}s.head&&(s.head.hcrc=s.flags>>9&1,s.head.done=!0),e.adler=s.check=0,s.mode=w;break;case 16189:for(;O<32;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}e.adler=s.check=i(P),O=P=0,s.mode=C;case C:if(0===s.havedict)return e.next_out=d,e.avail_out=k,e.next_in=u,e.avail_in=R,s.hold=P,s.bits=O,g;e.adler=s.check=1,s.mode=w;case w:if(n===p||n===f)break e;case 16192:if(s.last)P>>>=7&O,O-=7&O,s.mode=16206;else{for(;O<3;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}switch(s.last=1&P,--O,3&(P>>>=1)){case 0:s.mode=16193;break;case 1:te=void 0;var ee=s;if(M){A=new Int32Array(512),D=new Int32Array(32);for(var te=0;te<144;)ee.lens[te++]=8;for(;te<256;)ee.lens[te++]=9;for(;te<280;)ee.lens[te++]=7;for(;te<288;)ee.lens[te++]=8;for(l(1,ee.lens,0,288,A,0,ee.work,{bits:9}),te=0;te<32;)ee.lens[te++]=5;l(2,ee.lens,0,32,D,0,ee.work,{bits:5}),M=!1}if(ee.lencode=A,ee.lenbits=9,ee.distcode=D,ee.distbits=5,s.mode=16199,n!==f)break;P>>>=2,O-=2;break e;case 2:s.mode=16196;break;case 3:e.msg="invalid block type",s.mode=I}P>>>=2,O-=2}break;case 16193:for(P>>>=7&O,O-=7&O;O<32;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}if((65535&P)!=(P>>>16^65535)){e.msg="invalid stored block lengths",s.mode=I;break}if(s.length=65535&P,O=P=0,s.mode=16194,n===f)break e;case 16194:s.mode=16195;case 16195:if(B=s.length){if(0===(B=k<(B=R<B?R:B)?k:B))break e;c.set(a.subarray(u,u+B),d),R-=B,u+=B,k-=B,d+=B,s.length-=B}else s.mode=w;break;case 16196:for(;O<14;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}if(s.nlen=257+(31&P),O-=5,s.ndist=1+(31&(P>>>=5)),O-=5,s.ncode=4+(15&(P>>>=5)),P>>>=4,O-=4,286<s.nlen||30<s.ndist){e.msg="too many length or distance symbols",s.mode=I;break}s.have=0,s.mode=16197;case 16197:for(;s.have<s.ncode;){for(;O<3;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}s.lens[$[s.have++]]=7&P,P>>>=3,O-=3}for(;s.have<19;)s.lens[$[s.have++]]=0;if(s.lencode=s.lendyn,s.lenbits=7,W=l(0,s.lens,0,19,s.lencode,0,s.work,Z={bits:s.lenbits}),s.lenbits=Z.bits,W){e.msg="invalid code lengths set",s.mode=I;break}s.have=0,s.mode=16198;case 16198:for(;s.have<s.nlen+s.ndist;){for(;H=(J=s.lencode[P&(1<<s.lenbits)-1])>>>16&255,F=65535&J,!((X=J>>>24)<=O);){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}if(F<16)P>>>=X,O-=X,s.lens[s.have++]=F;else{if(16===F){for(K=X+2;O<K;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}if(P>>>=X,O-=X,0===s.have){e.msg="invalid bit length repeat",s.mode=I;break}Q=s.lens[s.have-1],B=3+(3&P),P>>>=2,O-=2}else if(17===F){for(K=X+3;O<K;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}Q=0,B=3+(7&(P>>>=X)),P>>>=3,O=O-X-3}else{for(K=X+7;O<K;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}Q=0,B=11+(127&(P>>>=X)),P>>>=7,O=O-X-7}if(s.have+B>s.nlen+s.ndist){e.msg="invalid bit length repeat",s.mode=I;break}for(;B--;)s.lens[s.have++]=Q}}if(s.mode===I)break;if(0===s.lens[256]){e.msg="invalid code -- missing end-of-block",s.mode=I;break}if(s.lenbits=9,W=l(1,s.lens,0,s.nlen,s.lencode,0,s.work,Z={bits:s.lenbits}),s.lenbits=Z.bits,W){e.msg="invalid literal/lengths set",s.mode=I;break}if(s.distbits=6,s.distcode=s.distdyn,W=l(2,s.lens,s.nlen,s.ndist,s.distcode,0,s.work,Z={bits:s.distbits}),s.distbits=Z.bits,W){e.msg="invalid distances set",s.mode=I;break}if(s.mode=16199,n===f)break e;case 16199:s.mode=16200;case 16200:if(6<=R&&258<=k){e.next_out=d,e.avail_out=k,e.next_in=u,e.avail_in=R,s.hold=P,s.bits=O,ue=fe=ae=se=oe=ne=re=ie=Ee=Te=pe=le=void 0;var ie,re,ne,oe,se,ae,ce=e,ue=ce.state,le=ce.next_in,de=ce.input,he=le+(ce.avail_in-5),pe=ce.next_out,fe=ce.output,me=pe-(U-ce.avail_out),ve=pe+(ce.avail_out-257),ge=ue.dmax,ye=ue.wsize,be=ue.whave,_e=ue.wnext,Se=ue.window,Te=ue.hold,Ee=ue.bits,Ce=ue.lencode,we=ue.distcode,Ie=(1<<ue.lenbits)-1,Re=(1<<ue.distbits)-1;t:do{for(Ee<15&&(Te+=de[le++]<<Ee,Te+=de[le++]<<(Ee+=8),Ee+=8),ie=Ce[Te&Ie];;){if(Te>>>=re=ie>>>24,Ee-=re,0==(re=ie>>>16&255))fe[pe++]=65535&ie;else{if(!(16&re)){if(!(64&re)){ie=Ce[(65535&ie)+(Te&(1<<re)-1)];continue}if(32&re){ue.mode=16191;break t}ce.msg="invalid literal/length code",ue.mode=o;break t}for(ne=65535&ie,(re&=15)&&(Ee<re&&(Te+=de[le++]<<Ee,Ee+=8),ne+=Te&(1<<re)-1,Te>>>=re,Ee-=re),Ee<15&&(Te+=de[le++]<<Ee,Te+=de[le++]<<(Ee+=8),Ee+=8),ie=we[Te&Re];;){if(Te>>>=re=ie>>>24,Ee-=re,!(16&(re=ie>>>16&255))){if(!(64&re)){ie=we[(65535&ie)+(Te&(1<<re)-1)];continue}ce.msg="invalid distance code",ue.mode=o;break t}if(oe=65535&ie,Ee<(re&=15)&&(Te+=de[le++]<<Ee,(Ee+=8)<re)&&(Te+=de[le++]<<Ee,Ee+=8),(oe+=Te&(1<<re)-1)>ge){ce.msg="invalid distance too far back",ue.mode=o;break t}if(Te>>>=re,Ee-=re,oe>(re=pe-me)){if((re=oe-re)>be&&ue.sane){ce.msg="invalid distance too far back",ue.mode=o;break t}if(ae=Se,(se=0)===_e){if(se+=ye-re,re<ne){for(ne-=re;fe[pe++]=Se[se++],--re;);se=pe-oe,ae=fe}}else if(_e<re){if(se+=ye+_e-re,(re-=_e)<ne){for(ne-=re;fe[pe++]=Se[se++],--re;);if(se=0,_e<ne){for(ne-=re=_e;fe[pe++]=Se[se++],--re;);se=pe-oe,ae=fe}}}else if(se+=_e-re,re<ne){for(ne-=re;fe[pe++]=Se[se++],--re;);se=pe-oe,ae=fe}for(;2<ne;)fe[pe++]=ae[se++],fe[pe++]=ae[se++],fe[pe++]=ae[se++],ne-=3;ne&&(fe[pe++]=ae[se++],1<ne)&&(fe[pe++]=ae[se++])}else{for(se=pe-oe;fe[pe++]=fe[se++],fe[pe++]=fe[se++],fe[pe++]=fe[se++],2<(ne-=3););ne&&(fe[pe++]=fe[se++],1<ne)&&(fe[pe++]=fe[se++])}break}}break}}while(le<he&&pe<ve);le-=ne=Ee>>3,Te&=(1<<(Ee-=ne<<3))-1,ce.next_in=le,ce.next_out=pe,ce.avail_in=le<he?he-le+5:5-(le-he),ce.avail_out=pe<ve?ve-pe+257:257-(pe-ve),ue.hold=Te,ue.bits=Ee,d=e.next_out,c=e.output,k=e.avail_out,u=e.next_in,a=e.input,R=e.avail_in,P=s.hold,O=s.bits,s.mode===w&&(s.back=-1);break}for(s.back=0;H=(J=s.lencode[P&(1<<s.lenbits)-1])>>>16&255,F=65535&J,!((X=J>>>24)<=O);){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}if(H&&!(240&H)){for(V=X,G=H,j=F;H=(J=s.lencode[j+((P&(1<<V+G)-1)>>V)])>>>16&255,F=65535&J,!(V+(X=J>>>24)<=O);){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}P>>>=V,O-=V,s.back+=V}if(P>>>=X,O-=X,s.back+=X,s.length=F,0===H){s.mode=16205;break}if(32&H){s.back=-1,s.mode=w;break}if(64&H){e.msg="invalid literal/length code",s.mode=I;break}s.extra=15&H,s.mode=16201;case 16201:if(s.extra){for(K=s.extra;O<K;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}s.length+=P&(1<<s.extra)-1,P>>>=s.extra,O-=s.extra,s.back+=s.extra}s.was=s.length,s.mode=16202;case 16202:for(;H=(J=s.distcode[P&(1<<s.distbits)-1])>>>16&255,F=65535&J,!((X=J>>>24)<=O);){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}if(!(240&H)){for(V=X,G=H,j=F;H=(J=s.distcode[j+((P&(1<<V+G)-1)>>V)])>>>16&255,F=65535&J,!(V+(X=J>>>24)<=O);){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}P>>>=V,O-=V,s.back+=V}if(P>>>=X,O-=X,s.back+=X,64&H){e.msg="invalid distance code",s.mode=I;break}s.offset=F,s.extra=15&H,s.mode=16203;case 16203:if(s.extra){for(K=s.extra;O<K;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}s.offset+=P&(1<<s.extra)-1,P>>>=s.extra,O-=s.extra,s.back+=s.extra}if(s.offset>s.dmax){e.msg="invalid distance too far back",s.mode=I;break}s.mode=16204;case 16204:if(0===k)break e;if(s.offset>(B=U-k)){if((B=s.offset-B)>s.whave&&s.sane){e.msg="invalid distance too far back",s.mode=I;break}z=B>s.wnext?s.wsize-(B-=s.wnext):s.wnext-B,B>s.length&&(B=s.length),q=s.window}else q=c,z=d-s.offset,B=s.length;for(k-=B=k<B?k:B,s.length-=B;c[d++]=q[z++],--B;);0===s.length&&(s.mode=16200);break;case 16205:if(0===k)break e;c[d++]=s.length,k--,s.mode=16200;break;case 16206:if(s.wrap){for(;O<32;){if(0===R)break e;R--,P|=a[u++]<<O,O+=8}if(e.total_out+=U-=k,s.total+=U,4&s.wrap&&U&&(e.adler=s.check=(s.flags?t:r)(s.check,c,U,d-U)),U=k,4&s.wrap&&(s.flags?P:i(P))!==s.check){e.msg="incorrect data check",s.mode=I;break}O=P=0}s.mode=16207;case 16207:if(s.wrap&&s.flags){for(;O<32;){if(0===R)break e;R--,P+=a[u++]<<O,O+=8}if(4&s.wrap&&P!==(4294967295&s.total)){e.msg="incorrect length check",s.mode=I;break}O=P=0}s.mode=16208;case 16208:W=v;break e;case I:W=b;break e;case 16210:return _;default:return y}return e.next_out=d,e.avail_out=k,e.next_in=u,e.avail_in=R,s.hold=P,s.bits=O,(s.wsize||U!==e.avail_out&&s.mode<I&&(s.mode<16206||n!==h))&&L(e,e.output,e.next_out,U-e.avail_out),U-=e.avail_out,e.total_in+=x-=e.avail_in,e.total_out+=U,s.total+=U,4&s.wrap&&U&&(e.adler=s.check=(s.flags?t:r)(s.check,c,U,e.next_out-U)),e.data_type=s.bits+(s.last?64:0)+(s.mode===w?128:0)+(16199===s.mode||16194===s.mode?256:0),(0==x&&0===U||n===h)&&W===m?S:W}function P(e,t){var i,n=t.length;return N(e)||0!==(i=e.state).wrap&&i.mode!==C?y:i.mode===C&&r(1,t,n,0)!==i.check?b:L(e,t,n,n)?(i.mode=16210,_):(i.havedict=1,m)}var A,D,N=function(e){var t;return!e||!(t=e.state)||t.strm!==e||t.mode<E||16211<t.mode?1:0},O=function(e){var t;return N(e)||((t=e.state).wsize=0,t.whave=0,t.wnext=0,N(t=e))?y:(t.total_in=t.total_out=(e=t.state).total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=E,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,m)},M=!0,L=function(e,t,i,r){var n;return null===(e=e.state).window&&(e.wsize=1<<e.wbits,e.wnext=0,e.whave=0,e.window=new Uint8Array(e.wsize)),r>=e.wsize?(e.window.set(t.subarray(i-e.wsize,i),0),e.wnext=0,e.whave=e.wsize):((n=e.wsize-e.wnext)>r&&(n=r),e.window.set(t.subarray(i-r,i-r+n),e.wnext),(r-=n)?(e.window.set(t.subarray(i-r,i),0),e.wnext=r,e.whave=e.wsize):(e.wnext+=n,e.wnext===e.wsize&&(e.wnext=0),e.whave<e.wsize&&(e.whave+=n))),0},x=O;function U(e){return(U="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return _typeof(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof(e)})(e)}var B=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){B=!1}for(var z=new Uint8Array(256),q=0;q<256;q++)z[q]=252<=q?6:248<=q?5:240<=q?4:224<=q?3:192<=q?2:1;function X(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function H(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}z[254]=z[254]=1;var F={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},V=Object.prototype.toString,G=d.Z_NO_FLUSH,j=d.Z_FINISH,Q=d.Z_OK,W=d.Z_STREAM_END,Z=d.Z_NEED_DICT,K=d.Z_STREAM_ERROR,J=d.Z_DATA_ERROR,Y=d.Z_MEM_ERROR;function $(e){this.options=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!==U(i))throw new TypeError(i+"must be non-object");for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}}return e}({chunkSize:65536,windowBits:15,to:""},e||{});var t,i,r=this.options;if(r.raw&&0<=r.windowBits&&r.windowBits<16&&(r.windowBits=-r.windowBits,0===r.windowBits)&&(r.windowBits=-15),!(0<=r.windowBits&&r.windowBits<16)||e&&e.windowBits||(r.windowBits+=32),15<r.windowBits&&r.windowBits<48&&!(15&r.windowBits)&&(r.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new X,this.strm.avail_out=0,(e=function(e,t){var i,r,n;return e?(i=new R,(e.state=i).strm=e,i.window=null,i.mode=E,i=t,(n=N(t=e)||(n=t.state,i<0?(r=0,i=-i):(r=5+(i>>4),i<48&&(i&=15)),i&&(i<8||15<i))?y:(null!==n.window&&n.wbits!==i&&(n.window=null),n.wrap=r,n.wbits=i,O(t)))!==m&&(e.state=null),n):y}(this.strm,r.windowBits))!==Q)throw new Error(F[e]);if(this.header=new H,i=this.header,N(t=this.strm)||!(2&(t=t.state).wrap)||((t.head=i).done=!1),r.dictionary&&("string"==typeof r.dictionary?r.dictionary=function(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);for(var t,i,r,n,o=e.length,s=0,a=0;a<o;a++)55296==(64512&(i=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(r=e.charCodeAt(a+1)))&&(i=65536+(i-55296<<10)+(r-56320),a++),s+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(s),a=n=0;n<s;a++)55296==(64512&(i=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(r=e.charCodeAt(a+1)))&&(i=65536+(i-55296<<10)+(r-56320),a++),i<128?t[n++]=i:(i<2048?t[n++]=192|i>>>6:(i<65536?t[n++]=224|i>>>12:(t[n++]=240|i>>>18,t[n++]=128|i>>>12&63),t[n++]=128|i>>>6&63),t[n++]=128|63&i);return t}(r.dictionary):"[object ArrayBuffer]"===V.call(r.dictionary)&&(r.dictionary=new Uint8Array(r.dictionary)),r.raw)&&(e=P(this.strm,r.dictionary))!==Q)throw new Error(F[e])}function ee(e,t){if((t=new $(t)).push(e),t.err)throw t.msg||F[t.err];return t.result}function te(e,t){return(t=t||{}).raw=!0,ee(e,t)}$.prototype.push=function(e,t){var i,r,n=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(r=t===~~t?t:!0===t?j:G,n.input="[object ArrayBuffer]"===V.call(e)?new Uint8Array(e):e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(o),n.next_out=0,n.avail_out=o),(i=k(n,r))===Z&&s&&((i=P(n,s))===Q?i=k(n,r):i===J&&(i=Z));0<n.avail_in&&i===W&&0<n.state.wrap&&0!==e[n.next_in];)x(n),i=k(n,r);switch(i){case K:case J:case Z:case Y:return this.onEnd(i),!(this.ended=!0)}var a,c,u,l=n.avail_out;if(!n.next_out||0!==n.avail_out&&i!==W||("string"===this.options.to?(a=function(e,t){for(var i=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=i&&128==(192&e[i]);)i--;return!(i<0||0===i)&&i+z[e[i]]>t?i:t}(n.output,n.next_out),c=n.next_out-a,u=function(e,t){var i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));for(var r=new Array(2*i),n=0,o=0;o<i;){var s=e[o++];if(s<128)r[n++]=s;else{var a=z[s];if(4<a)r[n++]=65533,o+=a-1;else{for(s&=2===a?31:3===a?15:7;1<a&&o<i;)s=s<<6|63&e[o++],a--;1<a?r[n++]=65533:s<65536?r[n++]=s:(r[n++]=55296|(s-=65536)>>10&1023,r[n++]=56320|1023&s)}}}var c=r,u=n;if(u<65534&&c.subarray&&B)return String.fromCharCode.apply(null,c.length===u?c:c.subarray(0,u));for(var l="",d=0;d<u;d++)l+=String.fromCharCode(c[d]);return l}(n.output,a),n.next_out=c,n.avail_out=o-c,c&&n.output.set(n.output.subarray(a,a+c),0),this.onData(u)):this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out))),i!==Q||0!==l){if(i===W)return c=void 0,i=N(a=this.strm)?y:((c=a.state).window&&(c.window=null),a.state=null,m),this.onEnd(i),this.ended=!0;if(0===n.avail_in)break}}return!0},$.prototype.onData=function(e){this.chunks.push(e)},$.prototype.onEnd=function(e){e===Q&&(this.result="string"===this.options.to?this.chunks.join(""):function(e){for(var t=0,i=0,r=e.length;i<r;i++)t+=e[i].length;for(var n=new Uint8Array(t),o=0,s=0,a=e.length;o<a;o++){var c=e[o];n.set(c,s),s+=c.length}return n}(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ie=ee,re=ee,ne={Inflate:$,inflate:ie,inflateRaw:te,ungzip:re,constants:d};e.Inflate=$,e.constants=d,e.default=ne,e.inflate=ie,e.inflateRaw=te,e.ungzip=re,Object.defineProperty(e,"u",{value:!0})}(t)},function(e,t,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,i,r){void 0===r&&(r=i),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,r){e[r=void 0===r?i:r]=t[i]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.u)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.u?e:{default:e}},a=(Object.defineProperty(t,"u",{value:!0}),t.CloudSettingProtoBuf=void 0,s(i(5))),c=(o=o(i(6)),s(i(18)).default.cloudsetting);function u(){}o.util.Long=a.default,o.configure(),u.prototype.encodeCloudSettingReq=function(e){var t=c.GetCloudSettingConfigRequest;return e=t.create(e),t.encode(e).finish()},u.prototype.decodeCloudSettingRsp=function(e){return c.GetCloudSettingConfigResponse.decode(e)},t.CloudSettingProtoBuf=u},function(e,t,i){"use strict";i.r(t);for(var r=i(6),n=r.util.Long?r.util.Long.fromBits:function(){return 0},o=r.roots,s=r.types?r.types.basic:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0,string:2,bytes:2},a=r.types?r.types.packed:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0},c=Object.keys(s),u={$:function(e){return u[e]?u[e].call(this):o[e].decode?o[e].decode(this,this.uint32()):u.$.call(this,"int32")}},l={$:function(e,t,i){var r=s[e];return void 0===r?o[e].encode?(this.uint32(i<<3|2).fork(),o[e].encode(t,this).ldelim()):l.$.call(this,"int32",t,i):l[e].call(this.uint32(i<<3|r),t)}},d=0;d<c.length;d++)u[c[d]]=r.Reader.prototype[c[d]],l[c[d]]=r.Writer.prototype[c[d]];!function e(t,i,c,d){for(var h=0,p=Object.keys(t);h<p.length;h++){var f=p[h];if(t[f].$m&&Object.keys(t[f].$m).every((function(e){return Number(e)}))){if(c[f])throw Error("nested type ".concat(c,".").concat(f," has already exist"));c[f]=function(t,c){function d(e){for(var i in t)"{"===(i=t[i])[1].charAt(0)?this[i[0]]={}:"["!==i[1].charAt(0)&&"<"!==i[1].charAt(0)||(this[i[0]]=[]);if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)null!=e[r[n]]&&(this[r[n]]=e[r[n]])}var h,p={};for(h in t){var f=t[h],m=f[1];"{"===m.charAt(0)?(d.prototype[f[0]]=r.util.emptyObject,p[m]={$m:m.substring(1).split(",").map((function(e,t){return["$"+(t+1),e,null]})).reduce((function(e,t,i){return e[i+1]=t,e}),{})}):d.prototype[f[0]]="["===m.charAt(0)||"<"===m.charAt(0)?r.util.emptyArray:"bytes"===m?r.util.newBuffer([]):f[2]&&f[2].hasOwnProperty("low")&&f[2].hasOwnProperty("high")?n(f[2].low,f[2].high,f[2].unsigned):f[2]}return d.create=function(e){return new d(e)},d.decode=function(e,i){e instanceof r.Reader||(e=r.Reader.create(e));for(var n=void 0===i?e.len:e.pos+i,s=new d;e.pos<n;){var c=e.uint32();if(0<(p=c>>>3)&&t[p]){var l=t[p][0];if("{"===(h=t[p][1]).charAt(0))s[l]===r.util.emptyObject&&(s[l]={}),p=d.$namespace[h].decode(e,e.uint32()),s[l][p.$1]=p.$2;else if("["===h.charAt(0)||"<"===h.charAt(0)){h=h.substring(1),s[l]&&s[l].length||(s[l]=[]);var h,p=!u[h]&&!o[h].decode;if(void 0!==a[h=p?"int32":h]&&2==(7&c))for(var f=e.uint32()+e.pos;e.pos<f;)s[l].push(u.$.call(e,h));else s[l].push(u.$.call(e,h))}else s[l]=u.$.call(e,h)}else e.skipType(7&c)}return s},d.encode=function(e,i){for(var n in i=i||r.Writer.create(),t){var c=t[n][0];if("{"===(m=t[n][1]).charAt(0)){if(null!=e[c]&&e.hasOwnProperty(c))for(var u=0,h=Object.keys(e[c]);u<h.length;++u)i.uint32(n<<3|2).fork(),d.$namespace[m].encode({$1:h[u],$2:e[c][h[u]]},i).ldelim()}else if("["===m.charAt(0)||"<"===m.charAt(0)){var p="<"===m.charAt(0),f=(m=m.substring(1),e[c]);if(null!=f&&f.length){var m=void 0!==s[m]||o[m].encode?m:"int32";if(p&&void 0!==a[m]){for(i.uint32(n<<3|2).fork(),u=0;u<f.length;u++)l[m].call(i,f[u]);i.ldelim()}else for(u=0;u<f.length;u++)l.$.call(i,m,f[u],n)}}else null!=e[c]&&e.hasOwnProperty(c)&&l.$.call(i,m,e[c],n)}return i},Object.keys(p).length&&(d.$namespace=e(p,i+"."+c,d.$namespace||{},!0)),d}(t[f].$m,f)}else t[f].$s?c[f]=function(e,t){function n(e,t,i){r.rpc.Service.call(this,e,t,i)}return((n.prototype=Object.create(r.rpc.Service.prototype)).constructor=n).create=function(e,t,i){return new n(e,t,i)},Object.keys(e).forEach((function(r){var s=e[r];function a(e,t){return this.rpcCall(a,o[s[0]],o[s[1]],e,t)}Object.defineProperty(a,"name",{value:r}),Object.defineProperty(a,"path",{value:i+"."+t}),n.prototype[r]=a})),n}(t[f].$s,f):t[f].$e&&Object.values(t[f].$e).every((function(e){return Number(e)===e}))&&(c[f]=function(e){for(var t=Object.keys(e),i={},r=0;r<t.length;r++)i[i[t[r]]=e[t[r]]]=t[r];return i}(t[f].$e));c[f]&&!d&&(o[i+"."+f]=c[f]),delete t[f].$m,delete t[f].$s,delete t[f].$e,c[f]=e(t[f],i?i+"."+f:f,c[f]||{})}return c}({cloudsetting:{cloudsetting:{CloudSettingFileResponse:{$m:{1:["code","int64",{low:0,high:0,unsigned:!1}],2:["message","string",""],3:["file_name","string",""],4:["global_version","string",""],5:["version","string",""],6:["app_version","string",""],7:["json_data","bytes",[]],8:["hash","bytes",[]],9:["g_version","uint32",0]}},File:{$m:{1:["file_name","string",""],2:["hash","bytes",[]],3:["g_version","uint32",0]}},GetCloudSettingConfigRequest:{$m:{1:["product","cloudsetting.cloudsetting.Product",0],2:["response_compress","int32",0],3:["file_list","<string",null],4:["param_list","<cloudsetting.cloudsetting.Param",null],5:["files","<cloudsetting.cloudsetting.File",null],6:["p_version","uint32",0]}},GetCloudSettingConfigResponse:{$m:{1:["code","int64",{low:0,high:0,unsigned:!1}],2:["message","string",""],3:["polling_interval","int32",0],4:["file_response","<cloudsetting.cloudsetting.CloudSettingFileResponse",null]}},Param:{$m:{1:["key","string",""],2:["value","string",""]}},Product:{$e:{RTC:0,WEB_RTC:1,ZIM:2,ROOM_KIT:3,DOC_SHARE:4,WHITE_BOARD:5,SELF_CHECK:999,TEST_ANOOUS:1e3}}}}},"",o,!1),r.util.global.cloudsetting=o.cloudsetting,t.default=o.cloudsetting}],c={},r.m=a,r.c=c,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"u",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==_typeof(e)&&e&&e.u)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.u?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8))},function(e,t,i){var r;e.exports=(r=i(2),function(){var e,t;"function"==typeof ArrayBuffer&&(t=(e=r.lib.WordArray).init,(e.init=function(e){if((e=(e=e instanceof ArrayBuffer?new Uint8Array(e):e)instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e)instanceof Uint8Array){for(var i=e.byteLength,r=[],n=0;n<i;n++)r[n>>>2]|=e[n]<<24-n%4*8;t.call(this,r,i)}else t.apply(this,arguments)}).prototype=e)}(),r.lib.WordArray)},function(e,t){var i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==("undefined"===typeof window?"undefined":_typeof(window))&&(i=window)}e.exports=i},function(e,t){},function(e,t,i){var r;e.exports=(e=i(2),r=e.lib.WordArray,e.enc.Base64={stringify:function(e){for(var t=e.words,i=e.sigBytes,r=this._map,n=(e.clamp(),[]),o=0;o<i;o+=3)for(var s=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<i;a++)n.push(r.charAt(s>>>6*(3-a)&63));var c=r.charAt(64);if(c)for(;n.length%4;)n.push(c);return n.join("")},parse:function(e){var t=e.length,i=this._map;if(!(n=this._reverseMap))for(var n=this._reverseMap=[],o=0;o<i.length;o++)n[i.charCodeAt(o)]=o;var s=i.charAt(64);return s&&-1!==(s=e.indexOf(s))&&(t=s),function(e,t,i){for(var n,o,s=[],a=0,c=0;c<t;c++)c%4&&(n=i[e.charCodeAt(c-1)]<<c%4*2,o=i[e.charCodeAt(c)]>>>6-c%4*2,s[a>>>2]|=(n|o)<<24-a%4*8,a++);return r.create(s,a)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64)},function(e,t,i){var r,n,o,s;e.exports=(e=i(2),s=(i=e).lib,r=s.WordArray,n=s.Hasher,o=[],s=(s=i.algo).SHA1=n.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var i=this._hash.words,r=i[0],n=i[1],s=i[2],a=i[3],c=i[4],u=0;u<80;u++){o[u]=u<16?0|e[t+u]:(l=o[u-3]^o[u-8]^o[u-14]^o[u-16])<<1|l>>>31;var l=(r<<5|r>>>27)+c+o[u];l+=u<20?1518500249+(n&s|~n&a):u<40?1859775393+(n^s^a):u<60?(n&s|n&a|s&a)-1894007588:(n^s^a)-899497514,c=a,a=s,s=n<<30|n>>>2,n=r,r=l}i[0]=i[0]+r|0,i[1]=i[1]+n|0,i[2]=i[2]+s|0,i[3]=i[3]+a|0,i[4]=i[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(64+r>>>9<<4)]=Math.floor(i/4294967296),t[15+(64+r>>>9<<4)]=i,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}}),i.SHA1=n._createHelper(s),i.HmacSHA1=n._createHmacHelper(s),e.SHA1)},function(e,t,i){var r;e.exports=(e=i(2),r=e.enc.Utf8,void(e.algo.HMAC=(i=e.lib.Base).extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));for(var i=e.blockSize,n=4*i,o=((t=t.sigBytes>n?e.finalize(t):t).clamp(),e=this._oKey=t.clone(),t=this._iKey=t.clone(),e.words),s=t.words,a=0;a<i;a++)o[a]^=1549556828,s[a]^=909522486;e.sigBytes=t.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher;return e=t.finalize(e),t.reset(),t.finalize(this._oKey.clone().concat(e))}})))},function(e,t,i){var r,n,o,s,a,c,u,l,d,h,p,f;e.exports=(e=i(2),i(9),void(e.lib.Cipher||(i=e.lib,r=i.Base,n=i.WordArray,o=i.BufferedBlockAlgorithm,d=e.enc,s=d.Base64,a=e.algo.EvpKDF,c=i.Cipher=o.extend({cfg:r.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,i){this.cfg=this.cfg.extend(i),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?f:h}return function(t){return{encrypt:function(i,r,n){return e(r).encrypt(t,i,r,n)},decrypt:function(i,r,n){return e(r).decrypt(t,i,r,n)}}}}()}),i.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),d=e.mode={},u=i.BlockCipherMode=r.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),d=d.CBC=function(){var e=u.extend();function t(e,t,i){var r,n=this._iv;n?(r=n,this._iv=void 0):r=this._prevBlock;for(var o=0;o<i;o++)e[t+o]^=r[o]}return e.Encryptor=e.extend({processBlock:function(e,i){var r=this._cipher,n=r.blockSize;t.call(this,e,i,n),r.encryptBlock(e,i),this._prevBlock=e.slice(i,i+n)}}),e.Decryptor=e.extend({processBlock:function(e,i){var r=this._cipher,n=r.blockSize,o=e.slice(i,i+n);r.decryptBlock(e,i),t.call(this,e,i,n),this._prevBlock=o}}),e}(),p=(e.pad={}).Pkcs7={pad:function(e,t){for(var i=(t*=4)-e.sigBytes%t,r=i<<24|i<<16|i<<8|i,o=[],s=0;s<i;s+=4)o.push(r);t=n.create(o,i),e.concat(t)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},i.BlockCipher=c.extend({cfg:c.cfg.extend({mode:d,padding:p}),reset:function(){c.reset.call(this);var e,t=(i=this.cfg).iv,i=i.mode;this._xformMode==this._ENC_XFORM_MODE?e=i.createEncryptor:(e=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,t&&t.words):(this._mode=e.call(i,this,t&&t.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),l=i.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),d=(e.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return(e=(e=e.salt)?n.create([1398893684,1701076831]).concat(e).concat(t):t).toString(s)},parse:function(e){var t,i=(e=s.parse(e)).words;return 1398893684==i[0]&&1701076831==i[1]&&(t=n.create(i.slice(2,4)),i.splice(0,4),e.sigBytes-=16),l.create({ciphertext:e,salt:t})}},h=i.SerializableCipher=r.extend({cfg:r.extend({format:d}),encrypt:function(e,t,i,r){r=this.cfg.extend(r),t=(n=e.createEncryptor(i,r)).finalize(t);var n=n.cfg;return l.create({ciphertext:t,key:i,iv:n.iv,algorithm:e,mode:n.mode,padding:n.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,i,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(i,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),p=(e.kdf={}).OpenSSL={execute:function(e,t,i,r){return r=r||n.random(8),e=a.create({keySize:t+i}).compute(e,r),i=n.create(e.words.slice(t),4*i),e.sigBytes=4*t,l.create({key:e,iv:i,salt:r})}},f=i.PasswordBasedCipher=h.extend({cfg:h.cfg.extend({kdf:p}),encrypt:function(e,t,i,r){return i=(r=this.cfg.extend(r)).kdf.execute(i,e.keySize,e.ivSize),r.iv=i.iv,(e=h.encrypt.call(this,e,t,i.key,r)).mixIn(i),e},decrypt:function(e,t,i,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),i=r.kdf.execute(i,e.keySize,e.ivSize,t.salt),r.iv=i.iv,h.decrypt.call(this,e,t,i.key,r)}}))))},function(e,t){e.exports=n},function(e,t,i){"use strict";i.r(t),i.d(t,"ZegoExpressWebRTMEngine",(function(){return Ur})),i.d(t,"getReportSeq",(function(){return f})),i.d(t,"getSeq",(function(){return p})),i.d(t,"ZegoLogger",(function(){return n.ZegoLogger})),i.d(t,"ZegoDataReport",(function(){return n.ZegoDataReport})),i.d(t,"ZegoExpressWebRTM",(function(){return Rr})),i.d(t,"BusinessService",(function(){return E})),i.d(t,"NetConnection",(function(){return R})),i.d(t,"ZReporter",(function(){return Lr})),i.d(t,"getUserAgent",(function(){return qi})),i.d(t,"isIos",(function(){return Xi})),i.d(t,"isMacOs",(function(){return Hi})),i.d(t,"isAndroid",(function(){return Fi})),i.d(t,"isWindows",(function(){return Vi})),i.d(t,"isWin32",(function(){return Gi})),i.d(t,"isLinux",(function(){return ji})),i.d(t,"getOsType",(function(){return Qi})),i.d(t,"getNetTypeNum",(function(){return Wi}));var r,n=i(4);(t=r=r||{})[t.SWITCH_ONE=1]="SWITCH_ONE",t[t.SWITCH_TWO=2]="SWITCH_TWO";var o,s,a,c,u,l,d,h,p=((t=o=o||{})[t.TT_NONE=0]="TT_NONE",t[t.TT_PC=1]="TT_PC",t[t.TT_IOS=2]="TT_IOS",t[t.TT_ANDROID=3]="TT_ANDROID",t[t.TT_MAC=4]="TT_MAC",t[t.TT_LINUX=5]="TT_LINUX",t[t.TT_WEB=6]="TT_WEB",t[t.TT_MINIPROGRAM=7]="TT_MINIPROGRAM",t[t.TT_UNKNOWN=32]="TT_UNKNOWN",(t=s=s||{})[t.logout=0]="logout",t[t.trylogin=1]="trylogin",t[t.login=2]="login",(t=a=a||{})[t.I=0]="I",t[t.H=10]="H",t[t.M=100]="M",t[t.L=1e3]="L",(t=c=c||{})[t.offline=0]="offline",t[t.online=1]="online",(t=u=u||{})[t.NT_NONE=0]="NT_NONE",t[t.NT_LINE=1]="NT_LINE",t[t.NT_WIFI=2]="NT_WIFI",t[t.NT_2G=3]="NT_2G",t[t.NT_3G=4]="NT_3G",t[t.NT_4G=5]="NT_4G",t[t.NT_UNKNOWN=32]="NT_UNKNOWN",(t=l=l||{}).WIN32="WIN32",t.MAC="Mac",t.ANDROID="Android",t.LINUX="Linux",t.IOS="iOS",t.UNKNOWN="WTF",function(){return d++}),f=(h=d=1,function(){return h++}),m=(Object.defineProperty(v.prototype,"id",{get:function(){return this._id||null},set:function(e){this._id=e},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"data",{get:function(){return this._data},set:function(e){this._data=e},enumerable:!1,configurable:!0}),v.prototype.hasNext=function(){return this.next&&this.next.id},v.prototype.hasPrev=function(){return this.prev&&this.prev.id},v);function v(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this.next=null,this.prev=null,this._id=e,this._data=t}y.prototype.insertBefore=function(e,t){return(t=new m(this._idCounter,t)).next=e,t.prev=e.prev,e.prev&&(e.prev.next=t),e.prev=t,++this._idCounter,++this._numNodes,t},y.prototype.addLast=function(e){return this.insertBefore(this.end,e)},y.prototype.add=function(e){return this.addLast(e)},y.prototype.getFirst=function(){return 0===this._numNodes?null:this.start.next},y.prototype.getLast=function(){return 0===this._numNodes?null:this.end.prev},y.prototype.size=function(){return this._numNodes},y.prototype.getFromFirst=function(e){var t=0,i=this.start.next;if(0<=e)for(;t<e&&null!==i;)i=i.next,++t;else i=null;if(null===i)throw"Index out of bounds.";return i},y.prototype.get=function(e){return 0===e?this.getFirst():e===this._numNodes-1?this.getLast():this.getFromFirst(e)},y.prototype.remove=function(e){return e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),--this._numNodes,e},y.prototype.removeFirst=function(){return 0<this._numNodes&&this.start.next?this.remove(this.start.next):null},y.prototype.removeLast=function(){return 0<this._numNodes&&this.end.prev?this.remove(this.end.prev):null},y.prototype.removeAll=function(){this.start.next=this.end,this.end.prev=this.start,this._numNodes=0,this._idCounter=0},y.prototype.each=function(e){for(var t=this.start;t.hasNext();)e(t=t.next)},y.prototype.find=function(e){for(var t=this.start,i=!1,r=null;t.hasNext()&&!i;)e(t=t.next)&&(r=t,i=!0);return r},y.prototype.map=function(e){for(var t=this.start,i=[];t.hasNext();)e(t=t.next)&&i.push(t);return i},y.prototype.push=function(e){return this.addLast(e)},y.prototype.unshift=function(e){this.insertBefore(0<this._numNodes?this.start.next:this.end,e)},y.prototype.pop=function(){return this.removeLast()},y.prototype.shift=function(){return this.removeFirst()};var g=y;function y(){this.start=new m,this.end=new m,this._idCounter=0,this._numNodes=0,this.start.next=this.end,this.start.prev=null,this.end.prev=this.start,this.end.next=null}var b,_,S,T,E,C,w="未引入消息模块",I=i(11).ZegoConnectionAgent,R=(Object.defineProperty(k.prototype,"clientIP",{get:function(){var e;return(null==(e=this.connection)?void 0:e.clientIP)||""},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"timeOffset",{get:function(){var e;return null==(e=this.connection)?void 0:e.timeOffset},enumerable:!1,configurable:!0}),k.prototype.init=function(){var e;null!=(e=this.connection)&&e.init()},k.prototype.unInit=function(){var e;null!=(e=this.connection)&&e.unInit()},k.prototype.setAppInfo=function(e){var t;null!=(t=this.connection)&&t.setAppInfo(e)},k.prototype.setUserInfo=function(e){var t;null!=(t=this.connection)&&t.setUserInfo(e)},k.prototype.setNetAgentDefaultServers=function(e){var t;null!=(t=this.connection)&&t.setNetAgentDefaultServers(e)},k.prototype.setBackupDomains=function(e){var t;null!=(t=this.connection)&&t.setBackupDomains(e)},k.prototype.setDispatchConnectServers=function(e){var t;null!=(t=this.connection)&&t.setDispatchConnectServers(e)},k.prototype.setNetAgentSpecifiedServers=function(e){var t;null!=(t=this.connection)&&t.setNetAgentSpecifiedServers(e)},k.prototype.startHttpRequest=function(e,t,i,r,n){var o;null!=(o=this.connection)&&o.startHttpRequest(e,t,i,r,n)},k.prototype.startHttpRequest2=function(e,t,i,r,n){var o;null!=(o=this.connection)&&o.startHttpRequest2(e,t,i,r,n)},k.prototype.getAppConfigByAgent=function(e,t,i,r,n){var o;return null==(o=this.connection)?void 0:o.getAppConfigByAgent(e,t,i,r,n)},k.prototype.getPCRequest=function(e,t){var i;return(null==(i=this.connection)?void 0:i.getPCRequest(e,t))||null},k.prototype.connectUa=function(){var e;null!=(e=this.connection)&&e.connectUa()},k.prototype.destroyConnect=function(){var e;null!=(e=this.connection)&&e.destroyConnect()},k.prototype.destroy=function(){var e;null!=(e=this.connection)&&e.destroy()},k.prototype.isConnect=function(){return!!this.connection&&this.connection.isConnect()},k.prototype.on=function(e,t){var i;return(null==(i=this.connection)?void 0:i.on(e,t))||!0},k.prototype.off=function(e,t){var i;return null==(i=this.connection)?void 0:i.off(e,t)},k.prototype.setLogger=function(e){var t;return null==(t=this.connection)?void 0:t.setLogger(e)},k.prototype.setAccess=function(e){var t;return null==(t=this.connection)?void 0:t.setAccess(e)},k.prototype.getNTP=function(){var e;return(null==(e=this.connection)?void 0:e.getNetworkTimeInfo())||{timestamp:0,maxDeviation:0}},k);function k(){this.connection=null,this.isLoad=!1,this.callBackList=[],this.connection=new I(Rr.proxyCtrl)}(t=b=b||{})[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL",(t=_=_||{})[t.EMPTY=0]="EMPTY",t[t.CLOSE=1]="CLOSE",(t=S=S||{})[t.Mode_UNSET=0]="Mode_UNSET",t[t.MODE_ONLINE=1]="MODE_ONLINE",t[t.MODE_TEST=2]="MODE_TEST",t[t.MODE_ALPHA=3]="MODE_ALPHA",(t=T=T||{})[t.CLOSE=0]="CLOSE",t[t.TEMP=1]="TEMP",t[t.TIMEOUT=2]="TIMEOUT",(t=E=E||{})[t.SERVICE_UNSET=0]="SERVICE_UNSET",t[t.SERVICE_MEDIAGW=1]="SERVICE_MEDIAGW",t[t.SERVICE_LIVEROOM=2]="SERVICE_LIVEROOM",t[t.SERVICE_MIX=3]="SERVICE_MIX",t[t.SERVICE_ZEUS=4]="SERVICE_ZEUS",t[t.SERVICE_ZPUSH=5]="SERVICE_ZPUSH",t[t.SERVICE_L3=6]="SERVICE_L3",t[t.SERVICE_TALKLINE=7]="SERVICE_TALKLINE",t[t.SERVICE_EDUSUITE=8]="SERVICE_EDUSUITE",t[t.SERVICE_ZIM=9]="SERVICE_ZIM",t[t.SERVICE_ClOUD_SETTING=10]="SERVICE_ClOUD_SETTING",t[t.SERVICE_ZEUSHB=11]="SERVICE_ZEUSHB",t[t.SERVICE_USER_LOGIC=12]="SERVICE_USER_LOGIC",t[t.SERVICE_UNIFYDISPATCH=13]="SERVICE_UNIFYDISPATCH",t[t.SERVICE_QUALITY=14]="SERVICE_QUALITY",t[t.SERVICE_SECURITY=15]="SERVICE_SECURITY",t[t.SERVICE_KTVCPR=16]="SERVICE_KTVCPR",t[t.SERVICE_SWITCH4LIVEROOM=17]="SERVICE_SWITCH4LIVEROOM",t[t.SERVICE_WEBRTC_SIGNAL=18]="SERVICE_WEBRTC_SIGNAL",t[t.SERVICE_L3_WEBRTC_SIGNAL=19]="SERVICE_L3_WEBRTC_SIGNAL",t[t.SERVICE_VIDEOCPR=20]="SERVICE_VIDEOCPR",t[t.SERVICE_CDN=21]="SERVICE_CDN",t[t.SERVICE_CLOUDRECORD=22]="SERVICE_CLOUDRECORD",t[t.SERVICE_INNER_ECHO=23]="SERVICE_INNER_ECHO",t[t.SERVICE_OUTER_ECHO=24]="SERVICE_OUTER_ECHO",t[t.SERVICE_LOCALHOST_ECHO=25]="SERVICE_LOCALHOST_ECHO",t[t.SERVICE_ECHO=26]="SERVICE_ECHO",t[t.SERVICE_DOCSERVICE=27]="SERVICE_DOCSERVICE",t[t.SERVICE_AUTHSVR=28]="SERVICE_AUTHSVR",(t=C=C||{}).Logining="LOGINING",t.Logined="LOGINED",t.LoginFailed="LOGIN_FAILED",t.Reconnecting="RECONNECTING",t.Reconnected="RECONNECTED",t.ReconnectFailed="RECONNECT_FAILED",t.Kickout="KICKOUT",t.Logout="LOGOUT",t.LogoutFailed="LOGOUT_FAILED";var P={SERVER:{code:0,msg:"liverooom cmd error"},SUCCESS:{code:0,msg:"success."},INIT:{code:2000000001,msg:"init sdk wrong"},NOT_LOGIN:{code:1000002,msg:"not login"},APPID_INVALID:{code:1001004,msg:"appid invalid"},SDK_NOT_SPECIAL:{code:1001005,msg:"sdk require special"},NETWORK_BROKEN:{code:1000017,msg:"network is broken"},GEO_SET_ERROR:{code:1000018,msg:"geo set error"},INPUT_PARAM:{code:1100001,msg:"input parm error."},TIMEOUT:{code:1100002,msg:"network timeout."},SOCKET_CLOSE:{code:1100003,msg:"socket close"},NET_SOCKET_TIMEOUT:{code:1100004,msg:"net agent timeout"},NET_HB_TIMEOUT:{code:1100005,msg:"net hb timeout"},INIT_SDK_WRONG:{code:1101e3,msg:"init sdk wrong"},ROOM_COUNT_EXCEED:{code:1002001,msg:"login rooms exceeds the upper limit"},USER_ID_NULL:{code:1002005,msg:"user ID is empty"},USER_ID_INVALID_CHARACTER:{code:1002006,msg:"user ID contains illegal characters"},USER_ID_TOO_LONG:{code:1002007,msg:"user ID is too long"},USER_NAME_NULL:{code:1002008,msg:"username is empty"},USER_NAME_TOO_LONG:{code:1002010,msg:"username is too long"},ROOM_ID_NULL:{code:1002011,msg:"room ID is empty"},ROOM_ID_INVALID_CHARACTER:{code:1002012,msg:"room ID contains illegal characters"},ROOM_ID_TOO_LONG:{code:1002013,msg:"room ID is too long"},ROOM_NOT_EXIST:{code:1002014,msg:"room not exist"},ROOM_EXTRA_INFO_KEY_LIMIT:{code:1002017,msg:"room extra info key exceed the limit"},DIFFERENT_USER_ID:{code:1002018,msg:"In multi-room mode, only the same user id can be used."},LOGIN_TIMEOUT:{code:1002031,msg:"login timeout"},ROOM_MAX_USER_COUNT:{code:1002034,msg:"users logging into the room exceeds the maximum number"},MULTI_ROOM_UNABLE:{code:1002036,msg:"multi room unable"},MULTIPLE_LOGIN_KICKOUT:{code:1002050,msg:"kickout may be the same user ID login other"},NETWORK_RECOVERY:{code:1002051,msg:"network recovery"},ROOM_RETRY_TIMEOUT:{code:1002053,msg:"network is broken and login fail."},MANUAL_KICKOUT:{code:1002055,msg:"server has sent a signal to kick out"},REPEATEDLY_LOGIN:{code:1002056,msg:"user repeatedly login"},REPEATEDLY_ENTER_ROOM:{code:1002057,msg:"user repeatedly enter room"},ALREADY_LOGIN:{code:1002058,msg:"user already logged in"},FORBID_BLACK_USER:{code:1002066,msg:"forbid black user"},WHITE_BOARD_VERSION_ERROR:{code:1002098,msg:"Mismatch with RTC SDK version, please upgrade ZegoSuperBoard or ZegoWhiteboardView SDK to the latest version"},ROOM_INNER_ERROR:{code:1002099,msg:"room inner error"},HEARTBEAT_TIMEOUT:{code:1102001,msg:"heartbeat timeout."},PARSE_JSON_ERROR:{code:1102011,msg:"parse json error."},LOGIN_PROCESSING:{code:1102012,msg:"login is processing."},LIVEROMM_REQUEST_ERROR:{code:1102013,msg:"liveroom request error."},ZPUSH_REQUEST_FAIL:{code:1102014,msg:"zpush request fail."},LOGIN_STATE_WRONG:{code:1102015,msg:"user login state is wrong."},TOKEN_ERROR:{code:1102016,msg:"token error"},DIAPATCH_ERROR:{code:1102017,msg:"dispatch error"},TOKEN_EXPIRED:{code:1102018,msg:"token expired"},SUBCMD_ERROR:{code:1102019,msg:"subcmd error."},ZEGO_AUTH_ERROR:{code:1102020,msg:"zego auth error."},BIZ_CHANNEL_ERROR:{code:1102021,msg:"biz channel error."},UPLOAD_LOG_ERROR:{code:1102025,msg:"upload zip logs failed"}},A=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1],D=(t=i(6),i.n(t)),N=(t=i(7),i.n(t));function O(){var e=window.navigator.userAgent,t=null!=window.ActiveXObject&&-1!=e.indexOf("MSIE"),i=-1!=e.indexOf("Firefox"),r=null!=window.opr,n=e.indexOf("Chrome")&&window.chrome;return e=-1!=e.indexOf("Safari")&&-1!=e.indexOf("Version"),t?"IE":i?"Firefox":r?"Opera":n?"Chrome":e?"Safari":"Unkown"}function M(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return((null==e?void 0:e.effectiveType)||(null==e?void 0:e.type)||"unknown").toUpperCase()}function L(e,t){return D.a.encrypt(e,t).toString()}function x(e,t){try{return D.a.decrypt(e,t).toString(N.a)}catch(e){return""}}function U(e,t){try{localStorage.setItem(e,t)}catch(e){}}function B(e){try{return localStorage.getItem(e)}catch(e){}}var z=i(0),q=function(){return(q=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},X="TOKEN_ERROR",H="MULTIPLE_LOGIN_KICKOUT",F="TOKEN_EXPIRED",V="ZPUSH_REQUEST_FAIL",G="BIZ_CHANNEL_ERROR",j="ROOM_INNER_ERROR";function Q(e,t){return 0==t?Object(z.d)(e)&&e%1==0&&0<=e:Object(z.d)(e)&&e%1==0&&0<e}function W(e,t,i){t.success&&(i[e+"SuccessCallback"]=t.success),t.error&&(i[e+"ErrorCallback"]=t.error)}function Z(e,t){return t[e+"ErrorCallback"]}function K(e,t){return t[e+"SuccessCallback"]}function J(e,t,i,r){W(e,{success:function(e,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var s=t,a=i,c=r,u=n;switch(e){case"eventStart":s.eventStart(a,c);break;case"eventEndWithMsgInfo":s.eventEndWithMsgInfo(a,c,u[0]);break;case"addEventMsg":s.addEventMsg(a,c,u[0],u[1]);break;case"addEvent":s.addEvent(a,c);break;case"eventEnd":s.eventEnd(a,c);break;case"addMsgInfo":s.addMsgInfo(a,u[0])}}},r)}function Y(e,t){var i={code:-1,message:"server error"};return i.code=1e9<e?e-1e9+52e6:e+2002e6,t&&(i.message=t),i}function $(e,t,i,r){return{interResolve:function(r){e.uploadReport(t),i(r)},interReject:function(i,n){var o;void 0===n&&(n=""),(o=i.code<2e9&&1e9<i.code?Y(i.code,i.msg):{code:i.code,message:i.msg})&&e.addMsgInfo(t,{error:o.code,message:o.message+n}),e.uploadReport(t),r({errorCode:i.code||i.errorCode})}}}function ee(e){var t,i,r={1:"parse json error.",1001:"login is processing.",1002:"liveroom request error.",1003:"zpush connect fail.",1004:"zpush handshake fail.",1005:"zpush login fail.",1006:"user login state is wrong.",1007:"got no zpush addr",1008:"token error",1009:"dispatch error",1010:"token expired",1011:"token format error",2002:"biz channel error",1e9:"liveroom cmd error, code:",1000002001:"need relogin",1000002002:"third token auth error",1000002003:"token nonce type should be int64",1000002004:"token appid type should be uint32",1000002005:"token timeout type should be int64",1000002006:"token user_id type should be string",1000002007:"token room_id type should be string",1000002008:"token format error",1000002009:"token privilege type should be map",1000002010:"token expire_time type should be int64",1000002011:"token user_id type should be string",1000002012:"token not exist",1000002013:"token update error",1000002014:"token not need to check"};return 0===e?P.SUCCESS:((t=q({},P.ROOM_INNER_ERROR)).code=e,t.msg=1e9<e?(i=r[e])?"liveroom cmd error, code: "+e+", message: "+i:r[1e9]+e:r[e]?r[e]+" code:"+e:"unknown error code:"+e,t)}function te(e,t){delete t[e+"SuccessCallback"],delete t[e+"ErrorCallback"]}function ie(e,t){var i={1016:"MULTI_ROOM_UNABLE",1105:"ROOM_MAX_USER_COUNT",1012:"PUBLISHER_ERROR_REPETITIVE_PUBLISH_STREAM",2002:X,2003:"ROOM_ERROR_LOGIN_TIMEOUT",2010:X,5022:"ROOM_COUNT_EXCEED",5030:"FORBID_BLACK_USER"};return t?2e5<e&&e<3e5?i[e-2e5]:e<2e5?{50013:H,50116:X,50117:F,50118:X,50119:X,50120:X,50121:X,50122:X,50123:F,50124:X,50125:X,50126:X,50127:X,50128:X}[e]||i[e]||j:i[e]||j:1e9<e?i[e-1e9]||"":{1:"PARSE_JSON_ERROR",1001:"LOGIN_PROCESSING",1002:"LIVEROMM_REQUEST_ERROR",1003:V,1004:V,1005:V,1006:"LOGIN_STATE_WRONG",1007:V,1008:X,1009:"DIAPATCH_ERROR",1010:F,1011:X,1012:"SUBCMD_ERROR",1101:"ZEGO_AUTH_ERROR",2001:G,2002:G}[e]||j}function re(e){return parseInt(Math.random()*(e+1)+"",10)}function ne(e){return!(!e.startsWith("wss")||-1===e.indexOf("test")||!e.endsWith("ws"))}function oe(e){try{var t,i=Uint8Array.from(function(e){for(var t,i,r,n,o=e.length,s=0,a="";s<o;){for(;t=A[255&e.charCodeAt(s++)],s<o&&-1==t;);if(-1==t)break;for(;i=A[255&e.charCodeAt(s++)],s<o&&-1==i;);if(-1==i)break;a+=String.fromCharCode(t<<2|(48&i)>>4);do{if(61==(r=255&e.charCodeAt(s++)))return a}while(r=A[r],s<o&&-1==r);if(-1==r)break;a+=String.fromCharCode((15&i)<<4|(60&r)>>2);do{if(61==(n=255&e.charCodeAt(s++)))return a}while(n=A[n],s<o&&-1==n);if(-1==n)break;a+=String.fromCharCode((3&r)<<6|n)}return a}(e),(function(e){return e.charCodeAt(0)})),r=new DataView(i.buffer);return 0<(t=Object(z.c)(r.getBigInt64)?r.getBigUint64(0):(s=(o=r).getUint32(n=0,!1),o=o.getUint32(n+4,!1),n=Math.pow(2,32)*s+o,Number.isSafeInteger(n)||console.warn(n,"exceeds MAX_SAFE_INTEGER. Precision may be lost"),n))?Number(t):Number(r.getBigUint64(0,!0))}catch(e){console.error("token error")}var n,o,s;return-1}function se(e){var t=(new Date).getTime(),i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?i:3&i|8).toString(36)}));return 0===e?function(e){for(var t,i=document.createElement("canvas"),r=((r=i.getContext("2d")).textBaseline="top",r.font="14px 'Arial'",r.fillStyle="#f60",r.fillRect(125,1,62,20),r.fillStyle="#069",r.fillText(e,2,15),r.fillStyle="rgba(102, 204, 0, 0.7)",r.fillText(e,4,17),i.toDataURL().replace("data:image/png;base64,","")),n=atob(r).slice(-16,-12),o="",s=0,a=(n+="").length;s<a;s++)o+=(t=n.charCodeAt(s).toString(16)).length<2?"0"+t:t;return o}("hello, zego")+i.slice(8):i}var ae={product:"rtc_web",importLevel:a.H,levels:[0,10,100,1e3],bps:32e3},ce="init",ue="0c9e6e0f8c0a8f4e",le="z_net_access_servers",de="z_appconfig",he="z_appconfig_etag",pe="z_rtc_domains",fe={domains:["accesshub-wss.zego.im","accesshub-wss.coolzcloud.com","accesshub-wss.zegocloud.com"],prefixDomain:"accesshub-wss",normalPriDomains:["coolbcloud.com","coolgcloud.com"],specialDomain:"cooldcloud.com",mode:"online",modeNo:S.MODE_ONLINE,sdkType:3,connectVer:4,pcEstablishTimeout:15,scheme:"wss",location:"accesshub",wssMessageType:1},me=[{id:2,relative_geofencings:[],accesshub:"accesshub-wss-geo-2",logreport:"weblogger-wss-geo-2",detaillog:"detaillog-geo-2"},{id:3,relative_geofencings:[7],accesshub:"accesshub-wss-geo-3",logreport:"weblogger-wss-geo-3",detaillog:"detaillog-geo-3"},{id:4,relative_geofencings:[7],accesshub:"accesshub-wss-geo-4",logreport:"weblogger-wss-geo-4",detaillog:"detaillog-geo-4"},{id:5,relative_geofencings:[7],accesshub:"accesshub-wss-geo-5",logreport:"weblogger-wss-geo-5",detaillog:"detaillog-geo-5"},{id:6,relative_geofencings:[7],accesshub:"accesshub-wss-geo-6",logreport:"weblogger-wss-geo-6",detaillog:"detaillog-geo-6"},{id:7,relative_geofencings:[3,4,5,6,1],accesshub:"accesshub-wss-geo-7",logreport:"weblogger-wss-geo-7",detaillog:"detaillog-geo-7"}],ve=[2,3,4,5,6];function ge(e,t){this.Zt=e,this.Qt=t,this.RETRY_MAX_TIME=300,this.RETRY_START_TIME_INTERVAL=4,this.RETRY_CONTINUE_COUNT=2,this.RETRY_MAX_TIME_INTERVAL=32,this.retryTimer=null,this.maxTimer=null,this.retryActiveCount=1,this.isOverTime=!1}function ye(e){return e}function be(e){return e}function _e(e){return e}function Se(e){return e}ge.prototype.init=function(e,t,i,r){this.invalid(),this.stopMaxTime(),this.isOverTime=!1,Object(z.d)(e)&&e<3600&&(this.RETRY_MAX_TIME=e),Object(z.d)(t)&&(this.RETRY_START_TIME_INTERVAL=t),Object(z.d)(i)&&(this.RETRY_CONTINUE_COUNT=i),Object(z.d)(r)&&(this.RETRY_MAX_TIME_INTERVAL=r)},ge.prototype.invalid=function(){};var Te="zm.0",Ee="zm.slf",Ce="zm.lg",we="zm.lo",Ie="zm.fac",Re="zm.fac.tk",ke="zm.hlu",Pe="zm.cna",Ae="zm.gsac",De="zm.zpl.url",Ne="zm.on",Oe="zm.rntk",Me="zm.rm.lg",Le="zm.rm.tl",xe="zm.rm.lgr",Ue="zm.rm.lo",Be="zm.rm.kco",ze="zm.hhl",qe="zm.hb.st",Xe="zm.hb.rsp",He="zm.rrh.hlf",Fe="zm.us.urp",Ve="zm.us.uph",Ge="ON_LISTENER",je="zm.st.ofls",Qe="zm.lrh.sm",We="zm.lrh.hsp",Ze="zm.lrh.lgi",Ke="zm.lrh.ful",Je="zm.lrh.lgo",Ye="zm.lrh.sru",$e="zm.lrh.hd",et={event:"/sdk/init",error:{kInvalidParamError:P.INPUT_PARAM},system_info:be,servers:function(e){return e},is_from_cache:Se,project:be,liveroom_version:be,biz_type:_e,lua_md5:be,sev_env:be,use_na:_e},tt="listener",it="/sdk/set_debug",rt=be,nt={event:"/sdk/set_log_config",error:{kInvalidParamError:P.INPUT_PARAM},log_level:function(e){return e},remote_log_level:be,log_url:be},ot={event:"/sdk/on_listener",listener:be,error:{INPUT_PARAM:P.INPUT_PARAM}},st=be,at={event:"/sdk/login",room_id:be,room_sid_string:be,user_state_update:_e,max_member_cnt:_e,message:be,token:be,svr_env:be,server:be,try_cnt:_e,room_mode:_e,role:_e,audience_create_room:_e,liveroom_sid_string:be,error:{ROOM_ID_NULL:P.ROOM_ID_NULL,INPUT_PARAM:P.INPUT_PARAM,ROOM_ID_TOO_LONG:P.ROOM_ID_TOO_LONG,ROOM_ID_INVALID_CHARACTER:P.ROOM_ID_INVALID_CHARACTER,USER_ID_NULL:P.USER_ID_NULL,USER_ID_TOO_LONG:P.USER_ID_TOO_LONG,USER_ID_INVALID_CHARACTER:P.USER_ID_INVALID_CHARACTER,USER_NAME_NULL:P.USER_NAME_NULL,USER_NAME_TOO_LONG:P.USER_NAME_TOO_LONG,REPEATEDLY_LOGIN:P.REPEATEDLY_LOGIN,LOGIN_TIMEOUT:P.LOGIN_TIMEOUT,INNER_ERROR:P.ROOM_INNER_ERROR,NETWORK_BROKEN:P.NETWORK_BROKEN,ROOM_COUNT_EXCEED:P.ROOM_COUNT_EXCEED,DIFFERENT_USER_ID:P.DIFFERENT_USER_ID}},ct="/sdk/sublogin",ut=be,lt={event:"/zpush/login",sdk_zpush_sessionid_string:be},dt={event:"/liveroom/enter"},ht={event:"/sdk/renew_token",error:{INPUT_PARAM:P.INPUT_PARAM,NOT_LOGIN:P.NOT_LOGIN},token:be},pt={event:"/sdk/logout",error:{INPUT_PARAM:P.INPUT_PARAM,ROOM_NOT_EXIST:P.ROOM_NOT_EXIST},room_id:be,room_sid_string:be,is_multi:Se,is_send_cmd_net:Se,liveroom_sid_string:be},ft=be,mt=be,vt="/sdk/relogin",gt={event:"/liveroom/tempbroken"},yt={event:"/sdk/reconnect",room_broken_time:_e},bt={event:"/sdk/disconnect",valid_d:_e,total_d:_e,tempbroken_cnt:_e},_t=_e,St=_e,Tt={event:"/liveroom/hb",room_id:be,room_sid_string:be,interval:_e,stream_seq:_e,server_user_seq:_e,error:{NOT_LOGIN:P.NOT_LOGIN,HB_TIMEOUT:P.TIMEOUT}},Et="/sdk/listener",Ct={event:"/sdk/enable_multi_room",is_multi:Se,error:{kInvalidParamError:P.INPUT_PARAM,kAlreadyLoginError:P.ALREADY_LOGIN}},wt=ye,It=ye,Rt=ye,kt="/cloud_setting/request",Pt=ye,At=ye,Dt={event:"/liveroom/get_current_user_list",user_index:_e,is_time_ascend:Se,use_na:_e},Nt="/zegoconn/connect",Ot=be,Mt=_e,Lt=ye,xt=be,Ut=be,Bt=_e,zt="/zegoconn/request",qt=ye,Xt=ye,Ht=_e,Ft={event:"/zegoconn/proxy_connect",service_no:_e,proxy_link_sources:_e,recv_time:_e,connect_stream:_e},Vt={event:"/zegoconn/proxy_broken",service_no:_e},Gt={event:"/zegoconn/proxy_disconnect",service_no:_e},jt=[50116,50118,50119,50120,50121,50122,50124,50125,50126,50127,50128];Qt=function(e,t){return(Qt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(e,t)};var Qt,Wt,Zt,Kt=function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},Jt=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}Qt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Yt,Wt=ge),Object.defineProperty(Yt.prototype,"ti",{get:function(){return this.Qt.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(Yt.prototype,"ii",{get:function(){return this.Qt.useNetAgent},enumerable:!1,configurable:!0}),Yt.prototype.renewLocalToken=function(e,t){this.token=e,this._room.token=this.token;var i=(new Date).getTime(),r=void 0;t&&Object(z.d)(t)?r=1e3*t:Object(z.f)(e)&&["03","04"].includes(e.substring(0,2))&&(t=1e3*oe(e.substring(2)),this.Zt.info("zm.rm.rlt time "+t+" "+i+" "+this.Qt.local_time_deviation),r=t-(i-this.Qt.local_time_deviation)),r&&this.roomHandler.resetTokenTimer(r),this.Zt.setTokenInfo(e),this.Qt.actionListener("_tokenRenewed",e,this._room.roomID)},Yt.prototype.initRoom=function(e,t,i,r,n,o,s){this.roomHandler=e,this.roomID=t,this.renewLocalToken(i),this.user=r,this.server=n,this.serverBak=o||n,this.config=s},Yt.prototype.active=function(e){var t=this,i=(this.Zt.info(Me+" retry call "+(null==(i=this._room)?void 0:i.roomID)+" "+(e=void 0!==e&&e)),null!=(i=this.loginRoomCallback)&&i.success?ct:vt);if(this.subLoginSpan||(this.subLoginSpan=this.ti.createSpan(a.H,{key:at.event,par:this.roomID},{key:i,par:this.roomID},i,!0),this.spanKey=i),this.roomHandler.setRunState(s.trylogin),this._room.isMulti&&(null==(i=this.Qt.roomModulesList.find((function(e){return!e.isMulti})))?void 0:i.runState)!==s.login)this.Zt.info(Me+" service is disconnected, multi room stop retry");else if(this.retryTimer)this.Zt.info(Me+" has actived, ignore");else{var r=this.Qt.networkState==c.offline;if(r){if(this.Zt.info(Me+" check if really offline. "+this._retryNetCount),this._retryNetCount>=this._retryNetMaxTimes)return void this.Zt.warn(Me+" network is broken, stop retry")}else this._retryNetCount=0;this.isOverTime?this.Zt.info(Me+" retry over time, stop retry"):(1==this.retryActiveCount?this.retryActiveInterval=Math.floor(Math.random()*(1-this.RETRY_START_TIME_INTERVAL)+this.RETRY_START_TIME_INTERVAL):(i=Math.pow(2,Math.round(this.retryActiveCount/this.RETRY_CONTINUE_COUNT+1)),this.retryActiveInterval=i>this.RETRY_MAX_TIME_INTERVAL?this.RETRY_MAX_TIME_INTERVAL:i),this.Zt.info(Me+" interval "+this.retryActiveInterval),this.retryTimer=setTimeout((function(){t.roomHandler.login(t.retryActiveCount%2==1?t.server:t.serverBak,t.roomID,t.token,t.user,t.config,(function(e){t.Qt.networkState=c.online,t.handleLoginFinish(e)}),(function(e,i){t.handleLoginFinish(!1,e,i)})),t.retryTimer&&clearTimeout(t.retryTimer),t.retryTimer=null,r?t._retryNetCount++:t.retryActiveCount++}),e?0:1e3*this.retryActiveInterval))}},Yt.prototype.startMaxTime=function(){var e=this;this.maxTimer||(this.Zt.info(Me+" start max timer"),0===this.activeStartTime&&(this.activeStartTime=(new Date).getTime()),this.maxTimer=setTimeout((function(){var t;e.Zt.info(Me+" over max time ".concat(e.RETRY_MAX_TIME,"s, stop retry")),e.isOverTime=!0,e.roomHandler.resetRoom(),0!==e.activeStartTime&&(t=0<(t=(new Date).getTime()-e.activeStartTime)?t:void 0),e.ni(!1,P.LOGIN_TIMEOUT),e.subLoginSpan&&(e.ti.spanEnd({key:e.spanKey,par:e.roomID},{error:P.LOGIN_TIMEOUT.code,message:P.LOGIN_TIMEOUT.msg,try_time:t}),e.subLoginSpan=null),e.loginRoomCallback.fail&&(e.loginRoomCallback.fail(P.LOGIN_TIMEOUT),e.roomHandler.disconnectedHandle(P.LOGIN_TIMEOUT),e.resetCallBack())}),1e3*this.RETRY_MAX_TIME))},Yt.prototype.stopMaxTime=function(){this.Zt.info(Me+" stop max timer"),0!==this.activeStartTime&&(this.activeStartTime=0),this.maxTimer&&clearTimeout(this.maxTimer),this.maxTimer=null},Yt.prototype.onactive=function(e,t){},Yt.prototype.retryLoginRoom=function(e,t){void 0===e&&(e=!1),void 0===t&&(t=!1),this.maxTimer||this.startMaxTime(),t&&this._room.resetSessionInfo(),this.active(e)},Yt.prototype.handleError=function(e,t){if(this.RETRY_MAX_TIME<3)return!1;if(e=e.code,t){t=[200207,200208];var i=void 0;if(this.ii){if(40001<=e&&e<=40100||50200<=e&&e<=50299||[201002,30019].includes(e))return this._room.resetSessionInfo(),!0;if(i=Kt(Kt([202002,205030,205035],jt,!0),[50013],!1),10015===e)return this._room.retryConnect(),!0}return!(null!=i&&i.includes(e)||!t.includes(e)&&(this._room.lastRunState!=s.login||(this.Zt.warn("zm.rrh.he reset"),this._room.resetUserSession(),this.invalid(),0)))}return!0},Yt.prototype.setLoginRoomCallback=function(e,t){this.loginRoomCallback.success=e,this.loginRoomCallback.fail=t},Yt.prototype.loginFail=function(e){this.roomHandler.resetRoom(),this.ni(!1,e),this.loginRoomCallback.fail&&(this.loginRoomCallback.fail(e),this.roomHandler.disconnectedHandle(e),this.resetCallBack())},Yt.prototype.handleLoginFinish=function(e,t,i){var r;this.Zt.info(He+" "+e+" "+JSON.stringify(t)),t?(this.subLoginSpan&&(r=void 0,0!==this.activeStartTime&&(r=0<(r=(new Date).getTime()-this.activeStartTime)?r:void 0),this.ti.spanEnd({key:this.spanKey,par:this.roomID},{error:t.code,message:t.msg,try_time:r}),this.subLoginSpan=null),this.handleError(t,i)?(this.Zt.info(He+" retry"),this.retryLoginRoom()):(this.Zt.info(He+" reset"),this.roomHandler.resetRoom(),this.ni(e,t),this.loginRoomCallback.fail&&(this.loginRoomCallback.fail(t),this.roomHandler.disconnectedHandle(t),this.resetCallBack()))):(r=void 0,0!==this.activeStartTime&&(r=0<(r=(new Date).getTime()-this.activeStartTime)?r:void 0),this.ni(e,{code:0,msg:""}),this.subLoginSpan&&(this.ti.spanEnd({key:this.spanKey,par:this.roomID},{room_id:this.roomID,room_sid_string:null==(i=this._room)?void 0:i.roomSidString,try_time:r}),this.subLoginSpan=null),this.loginRoomCallback.success&&(this.loginRoomCallback.success(e),this.resetCallBack()))},Yt.prototype.invalid=function(){this.Zt.info("zm.rh.ivd end retry"),this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=null,this.retryActiveCount=1,this._retryNetCount=0},Yt.prototype.ni=function(e,t){this.stopMaxTime(),this.invalid(),this.onactive(e,t)},Yt.prototype.resetCallBack=function(){this.loginRoomCallback.success=void 0,this.loginRoomCallback.fail=void 0},Yt);function Yt(e,t,i){var r=Wt.call(this,e,t)||this;return r.Zt=e,r.Qt=t,r._room=i,r.activeStartTime=0,r._retryNetCount=0,r._retryNetMaxTimes=3,r.spanKey="",r.loginRoomCallback={},r}(t=Zt=Zt||{}).NOT_EMPTY="NOT_EMPTY",t.ILLEGAL_CHARACTERS="ILLEGAL_CHARACTERS",t.TYPE_STRING="TYPE_STRING",t.TYPE_INTEGER="TYPE_INTEGER",t.TYPE_OBJECT="TYPE_OBJECT",t.MAX_LENGTH_10="MAX_LENGTH_10",t.MAX_LENGTH_64="MAX_LENGTH_64",t.MAX_LENGTH_100="MAX_LENGTH_100",t.MAX_LENGTH_128="MAX_LENGTH_128",t.MAX_LENGTH_256="MAX_LENGTH_256",t.MAX_LENGTH_1024="MAX_LENGTH_1024";var $t={error:{code:0,msg:"suc"}},ei={NOT_EMPTY:function(e,t,i,r,n){return void 0===t||""===t||null===t?(r.error("".concat(i," ").concat(e," is empty")),n):$t},ILLEGAL_CHARACTERS:function(e,t,i,r,n){return/^([0-9a-zA-Z#!$%&()`'+-;<=.>@^_~,\\*])+$/.test(t)&&/^[^:/]*$/g.test(t)?$t:(r.error("".concat(i," ").concat(e," contains illegal characters")),n)},TYPE_STRING:function(e,t,i,r,n){return Object(z.f)(t)?$t:(r.error("".concat(i," ").concat(e," must be string")),n)},TYPE_INTEGER:function(e,t,i,r,n){return Q(t,!1)?$t:(r.error("".concat(i," ").concat(e," must be integer number")),n)},TYPE_OBJECT:function(e,t,i,r,n){return t&&Object(z.e)(t)?$t:(r.error("".concat(i," ").concat(e," must be object")),n)},MAX_LENGTH_10:function(e,t,i,r,n){return 10<t.length?(r.error("".concat(i," ").concat(e," is too long")),n):$t},MAX_LENGTH_64:function(e,t,i,r,n){return 64<t.length?(r.error("".concat(i," ").concat(e," is too long")),n):$t},MAX_LENGTH_100:function(e,t,i,r,n){return 100<t.length?(r.error("".concat(i," ").concat(e," is too long")),n):$t},MAX_LENGTH_128:function(e,t,i,r,n){return 128<t.length?(r.error("".concat(i," ").concat(e," is too long")),n):$t},MAX_LENGTH_256:function(e,t,i,r,n){return 256<t.length?(r.error("".concat(i," ").concat(e," is too long")),n):$t},MAX_LENGTH_1024:function(e,t,i,r,n){return 1024<t.length?(r.error("".concat(i," ").concat(e," is too long")),n):$t}};Object.defineProperty(ii.prototype,"debug",{get:function(){return this._debug},set:function(e){this._debug=e,n.LoggerStateCenter.getInstance().debug=e},enumerable:!1,configurable:!0}),Object.defineProperty(ii.prototype,"testEnvironment",{get:function(){return this._testEnvironment},set:function(e){this._testEnvironment=e,n.LoggerStateCenter.getInstance().testEnvironment=e},enumerable:!1,configurable:!0}),Object.defineProperty(ii.prototype,"ENV",{get:function(){return this._env},set:function(e){this._env=e,n.LoggerStateCenter.getInstance().ENV=e},enumerable:!1,configurable:!0}),Object.defineProperty(ii.prototype,"roomid",{get:function(){return this.roomModulesList[0]?this.roomModulesList[0].roomID:""},enumerable:!1,configurable:!0}),Object.defineProperty(ii.prototype,"serverTimeOffset",{get:function(){return this.roomModulesList[0]?this.roomModulesList[0].messageHandler.serverTimeOffset:0},enumerable:!1,configurable:!0}),ii.prototype.getRequestId=function(){return this.idName+"-"+p()},ii.prototype.actionListener=function(e){for(var t,i=this,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];["getAnchorInfo","HBResponse","roomOnlineUserCountUpdate","roomLoginResponse"].includes(e)||e.startsWith("_")||!this.listenerList[e]||((t=this.reporter.createSpan(a.H,{key:tt},{key:""},Et)).setAttributes({listener:e,listener_params:JSON.stringify(r)}),t.end()),["roomStateChanged","tokenWillExpire"].includes(e)&&this.Zt.info("zm.al ".concat(e," ").concat(JSON.stringify(r),". pageID: ").concat(Rr.pageID," , instID: ").concat(this.id)),this.listenerList[e]&&this.listenerList[e].forEach((function(t){try{t.apply(void 0,r)}catch(t){i.Zt.error("zm.st.at ",e," ",JSON.stringify(t))}}))},ii.prototype.onListener=function(e,t){return this.listenerList[e]?Object(z.c)(t)?(-1==this.listenerList[e].indexOf(t)&&this.listenerList[e].push(t),!0):(this.Zt.error(Ge+" listener callBack must be funciton"),!1):(this.Zt.error(Ge+" event "+e+" no found"),!1)},ii.prototype.offListener=function(e,t){return this.listenerList[e]?Object(z.c)(t)?(-1!==this.listenerList[e].indexOf(t)&&(this.listenerList[e]=this.listenerList[e].filter((function(e){return e!==t}))),!0):(this.Zt.error(je+" listener callBack must be funciton"),!1):(this.Zt.error(je+" event "+e+" no found"),!1)},Object.defineProperty(ii.prototype,"sdKVersion",{get:function(){return this._sdkVersion},set:function(e){this._sdkVersion=e},enumerable:!1,configurable:!0}),ii.prototype.proxyRes=function(e,t,i){return{interResolve:function(i){t(i),e.end()},interReject:function(t,r){var n;void 0===r&&(r=""),(n=t.code<2e9&&1e9<t.code?Y(t.code,t.msg):{code:t.code,message:t.msg})&&e.setAttributes({error:n.code,message:n.message+r}),e.end(),i({errorCode:t.code})}}};var ti=ii;function ii(e,t){this.Zt=e,this._dataReport=t,this.id="",this._debug=!1,this.appConfigEtag=-1,this.appConfigFetched=!1,this.requestList={},this.mode=S.MODE_ONLINE,this.connectState="connected",this.testNetPackageSize=!1,this.netGeoFencing={},this.advanceConfig={},this.svrDomains={},this._testEnvironment=!1,this._env=0,this.type="PUBLIC",this.debugCustom=!1,this.configOK=!1,this.role=2,this.relateService=[],this.maxMemberCount=0,this.roomCreateFlag=1,this.local_time_deviation=0,this.callbackList={},this.listenerList={roomUserUpdate:[],roomOnlineUserCountUpdate:[],getAnchorInfo:[],_getAnchorInfo:[],IMRecvCustomCommand:[],IMRecvBroadcastMessage:[],recvReliableMessage:[],roomExtraInfoUpdate:[],IMRecvBarrageMessage:[],recvJoinLiveRequest:[],recvInviteJoinLiveRequest:[],recvEndJoinLiveCommand:[],roomLoginResponse:[],_roomLogin:[],_appConfigRsp:[],_netAppConfigRsp:[],_connectChanged:[],HBResponse:[],roomStateUpdate:[],_roomStateUpdate:[],_getTotalUserList:[],_userStateUpdate:[],_recvBigRoomMessage:[],_recvRoomMsg:[],_kickout:[],tokenWillExpire:[],_tokenExpired:[],roomStateChanged:[],hallStateUpdate:[],_hallStateUpdate:[],roomTokenWillExpire:[],_tokenRenewed:[],_protobufResponse:[],_cloudSettingNotify:[],_settingCanFetch:[]},this.reportList={},this.reportSeqList={login:0,relogin:0},this.networkState=c.online,this.roomRetryTime=300,this.roomModulesList=[],this.isMultiRoom=!1,this.setMultiRoom=!1,this.protoFormat="json",this.settingFetched=!1,this.useNetAgent=!0,this.netHasSet=!1,this.configRoomAuth=!1,this.configCheckToken=!1,this._sdkVersion="unknown",this.mode=fe.modeNo}Object.defineProperty(ni.prototype,"ti",{get:function(){return this.Qt.reporter},enumerable:!1,configurable:!0}),ni.prototype.init=function(e){var t=this,i=e.body.hearbeat_interval<3e3?3e3:e.body.hearbeat_interval;this._tryHeartbeatCount=0,this._heartbeatTimer&&clearTimeout(this._heartbeatTimer),this._loginHeartbeatTimer=setTimeout((function(){t.start(i)}),i),this.initCount++},ni.prototype.start=function(e){var t,i=this,r=(this.Zt.info(qe+" call"),this.ti.createSpan(a.H,{key:at.event,par:this._room.roomID},{key:""},Tt.event));this._room.isLogin()?3<++this._tryHeartbeatCount?(this.Zt.error(qe+" come to try limit"),this.ti.setError(r,Tt.error.HB_TIMEOUT),this.hbLogout(P.HEARTBEAT_TIMEOUT),this.ti.createSpan(a.H,{key:at.event,par:this._room.roomID},{key:""},"/zpush/hb_timeout").end()):(this._liveRoomHandler.heartBeat(t=function(e,t){var n=e.body&&e.body.err_code;e.header&&e.body?0!==n&&(n=Y(e.body.err_code||e.body.code,e.body.err_message||e.body.message),r.setAttributes({error:n.code,message:n.message+e.body.err_code})):r.setAttributes({error:(0<e.code?e:P.ROOM_INNER_ERROR).code,message:e.msg||P.ROOM_INNER_ERROR}),i._handleHeartbeatRsp(e,t),0===(null==(n=null==e?void 0:e.body)?void 0:n.err_code)&&r.setAttributes({interval:Tt.interval(null==(t=null==e?void 0:e.body)?void 0:t.hearbeat_interval),stream_seq:Tt.stream_seq(null==(n=null==e?void 0:e.body)?void 0:n.stream_seq),server_user_seq:Tt.server_user_seq(null==(t=null==e?void 0:e.body)?void 0:t.server_user_seq)}),r.end()},t,this._room),this._heartbeatInterval=e,t=this._heartbeatInterval,2<=this.initCount?(t=Math.round(Math.random()*(this._heartbeatInterval+1)),this.initCount=1):t=this._heartbeatInterval,this._heartbeatTimer=setTimeout((function(){i.start(i._heartbeatInterval)}),t),this.Zt.info(qe+" call success")):(this.Zt.error(qe+" state error"),this.ti.setError(r,Tt.error.NOT_LOGIN))},ni.prototype._handleHeartbeatRsp=function(e,t){if(e.body&&e.body.err_code&&0!==e.body.err_code)return this.Zt.error(Xe+" disconnect, server error=",e.body.err_code),1000000152==e.body.err_code?void this.hbLogout(P.HEARTBEAT_TIMEOUT):void this.hbLogout(ee(e.body.err_code));e.header&&e.body?((this._tryHeartbeatCount=0)!==e.body.hearbeat_interval&&(this._heartbeatInterval=e.body.hearbeat_interval,this._heartbeatInterval<3e3)&&(this._heartbeatInterval=3e3),this.heartbeatRspNotiFy(e,this._room.roomID),this.Zt.info(Xe+" call success")):(this.Zt.error(Xe+" disconnect, error=",JSON.stringify(e)+", seq = "+t),this.hbLogout(e))},ni.prototype.heartbeatRspNotiFy=function(e,t){},ni.prototype.hbLogout=function(e){},ni.prototype.resetHeartbeat=function(){clearTimeout(this._heartbeatTimer),this._heartbeatTimer=null,clearTimeout(this._loginHeartbeatTimer),this._loginHeartbeatTimer=null,this._tryHeartbeatCount=0,this.initCount=0,this.Zt.info("zm.hb.rst call success")};var ri=ni;function ni(e,t,i,r,n,o){this.Zt=e,this.Qt=t,this._dataReport=i,this._liveRoomHandler=r,this._room=n,this._service=o,this._tryHeartbeatCount=0,this._heartbeatTimer=null,this._loginHeartbeatTimer=null,this.initCount=0}var oi={code:1102026,msg:"cancel login"};function si(e){return t=escape||window.escape,decodeURIComponent(t(String.fromCharCode.apply(String,Array.from(e))));var t}var ai=function(e){return t=unescape||window.unescape,Uint8Array.from(Array.from(t(encodeURIComponent(e))).map((function(e){return e.charCodeAt(0)})));var t},ci="DISCONNECTED",ui="CONNECTED",li="CONNECTING",di=(Object.defineProperty(hi.prototype,"ii",{get:function(){return this.Qt.useNetAgent},enumerable:!1,configurable:!0}),Object.defineProperty(hi.prototype,"ti",{get:function(){return this.Qt.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(hi.prototype,"ei",{get:function(){return this.si.roomID},enumerable:!1,configurable:!0}),hi.prototype.resetTokenTimer=function(e){var t=this;this.Zt.info("zm.rm.rst call: "+(e=2147483647<(e=(e-=3e4)<0?0:e)?2147483647:e)),this._tokenTimer&&clearTimeout(this._tokenTimer),this._tokenTimer=setTimeout((function(){t.Qt.actionListener("tokenWillExpire",t.ei),t.Qt.actionListener("roomTokenWillExpire",t.ei)}),e)},hi.prototype._stopTokenTimer=function(){this._tokenTimer&&clearTimeout(this._tokenTimer),this._tokenTimer=null},hi.prototype.setRunState=function(e){this.si.runState!==e&&(this.si.lastRunState=this.si.runState,this.si.runState=e)},hi.prototype._resetTryLogin=function(){this._tryLoginTimer&&clearTimeout(this._tryLoginTimer),this._tryLoginTimer=null},hi.prototype._reportLogoutSpan=function(e){var t,i=this.Qt.isMultiRoom?"/liveroom/quit":"/switch/logout_user";i=this.ti.createSpan(a.H,{key:pt.event,par:this.ei},{key:""},i),e&&this.ii&&"0"===this.ri.roomServicer.zPushSid&&(this.ri.roomServicer.zPushSid=null==(t=null==(t=null==(t=this.ri)?void 0:t.roomServicer)?void 0:t.switchSessionID)?void 0:t.toString()),this.updateTimes(),e=this.ii?e?null==(e=null==(t=this.ri)?void 0:t.roomServicer)?void 0:e.zPushSid:null==(t=null==(e=null==(t=this.ri)?void 0:t.roomServicer)?void 0:e.switchSessionID)?void 0:t.toString():void 0,i.setAttributes({room_id:pt.room_id(null==(t=this.si)?void 0:t.roomID),room_sid_string:pt.room_sid_string(null==(t=this.si)?void 0:t.roomSidString),liveroom_sid_string:ft(null==(t=this.si)?void 0:t.userSidString),sdk_zpush_sessionid_string:mt(e),valid_d:this.validTime,total_d:this.totalTime,tempbroken_cnt:this.brokenCounts}),i.end()},hi.prototype.resetRoom=function(e){var t,i=this;this.Zt.info("zm.rm.rr call"),1<this.Qt.roomModulesList.length&&!e&&(this.si.isMulti=!0),this._resetTryLogin(),this.si.sessionExist&&this.si.runState!==s.logout&&!this.si.isDisConnect()&&this.ri.logout(this.si,t=function(e){i.handleLogoutRsp(e,!i.si.isMulti)},t),this._reportLogoutSpan(e),this.setRunState(s.logout),this.si.resetRoomSession(),this.si.resetUserSession(),this.si.isMulti||(this.Qt.userid="",this.Zt.setSessionInfo(this.Qt.appid,this.ei,this.si.userSidString,this.Qt.idName,this.Qt.nickName,this.Qt.sdKVersion),null!=(t=this.ri)&&t.reset()),this.resetRoomCallBack(),this.Qt.roomModulesList=this.Qt.roomModulesList.filter((function(e){return e!==i.si})),(e=this.Qt.roomModulesList[0])&&(e.isMulti=!1,e.runState!==s.login)&&e&&e.retryRoom(),this.Qt.isMultiRoom&&0===this.Qt.roomModulesList.length&&(this.ti.createSpan(a.H,{key:pt.event,par:this.ei},{key:""},"/zpush/multi_logout_user").end(),this.ri.roomServicer.zPushSid="0"),this.Zt.info("zm.rm.rr call success")},hi.prototype.resetRoomCallBack=function(){},hi.prototype.loginSuccessCallBack=function(e,t){},hi.prototype.handlePushKickout=function(e,t,i){var r=this,n=(this.Zt.info(Be+" call "+JSON.stringify(e)),function(e,t){var i={code:e,message:"kickout reason = "+e},r={code:63000005,message:"zpush token expired",name:F};switch(e){case 1:return{code:63000001,message:"zpush multiple login kickout",name:H};case 2:return{code:63000002,message:"zpush manual kickout",name:"MANUAL_KICKOUT"};case 4:return t?r:{code:63000004,message:"zpush multiple login kickout",name:H};case 5:if(!t)return r;default:i.code=e,i.message="kickout reason = "+e}return i}(e.body.reason||(null==(n=e.body)?void 0:n.kickout_reason),this.ii)),o=this.ti.createSpan(a.H,{key:at.event,par:this.ei},{key:""},"/sdk/kickout"),c=(this.updateTimes(),o.setAttributes({error:null==(c=P[n.name||"ROOM_INNER_ERROR"])?void 0:c.code,message:n.message,kickout_reason:_t((null==(c=e.body)?void 0:c.reason)||(null==(c=e.body)?void 0:c.kickout_reason)),need_relogin:St(null==(c=null==e?void 0:e.body)?void 0:c.need_relogin),valid_d:this.validTime,total_d:this.totalTime,tempbroken_cnt:this.brokenCounts}),o.end(),this.si.roomTryHandler);c?(c.onactive=function(e,t){r.Zt.info(Be+" onactive"),r.disconnectedHandle(t),r.Qt.actionListener("_kickout",t)},e.body.need_relogin&&1==e.body.need_relogin?this.si.retryRoom(!1,!0):(this.setRunState(s.logout),this.resetRoom(t),o={},e&&e.body.custom_reason?o.custom_kickout_message=e.body.custom_reason:n.name&&P[n.name]&&(o.custom_kickout_message=P[n.name].msg+"; kickout reason: "+(c=e.body.reason||e.body.kickout_reason)),this.disconnectedHandle(n.name&&P[n.name]?P[n.name]:P.ROOM_INNER_ERROR,{extendedData:JSON.stringify(o),isKickout:!0}),this.Qt.actionListener("_kickout",{code:P.MANUAL_KICKOUT.code,msg:P.MANUAL_KICKOUT.msg+e.body.reason||e.body.kickout_reason}))):this.Zt.info(Be+" try handler no found")},hi.prototype.handleHbLogout=function(e){var t=this,i=this.si.roomTryHandler;i&&(i.onactive=function(e,i){t.Zt.warn(ze+" onactive"),t.transError(i),t.disconnectedHandle(i)},[P.HEARTBEAT_TIMEOUT,P.SOCKET_CLOSE].includes(e)||[105,152,2001].includes(null==e?void 0:e.code)||e.msg.endsWith("1000002001")||e.msg.endsWith("1000000152")||e.msg.endsWith("1000000105")?this.si.retryRoom():[P.TIMEOUT].includes(e)?this.Zt.warn(ze+" timeout"):(this.Zt.warn(ze+" unexpected error: ".concat(JSON.stringify(e))),this.logoutByError(e)))},hi.prototype.logoutByError=function(e){var t=this.si.roomTryHandler;t&&(t.stopMaxTime(),t.invalid(),this.resetRoom(),this.disconnectedHandle(e))},hi.prototype.onDisconnect=function(e){},hi.prototype.onConnecting=function(e){this._roomStateHandle(li,C.Logining,e)},hi.prototype.disconnectedHandle=function(e,t){var i;e&&0!==e.code?(this._stopTokenTimer(),i=null!=t&&t.isKickout?C.Kickout:C.ReconnectFailed,this.transError(e),this._roomStateHandle(ci,i,e,(null==t?void 0:t.extendedData)||e.msg)):this._roomStateHandle(ui,C.Reconnected,e,null==t?void 0:t.extendedData)},hi.prototype.updateTimes=function(){this.updateValidTime(),this.updateTotalTime()},hi.prototype.updateValidTime=function(){this.oi&&(this.validTime=this.validTime+Date.now()-this.oi,this.oi=0)},hi.prototype.updateTotalTime=function(){this.ui&&(this.totalTime=Date.now()-this.ui)},hi.prototype._roomStateHandle=function(e,t,i,r,n){var o=this.si.roomID,s=Date.now();if(!t||t!=C.Reconnecting||(this.hi++,1!=this.hi)){this.Zt.info("zm.rm.scb "+e+" "+JSON.stringify(i)),[ui,ci].includes(e)&&(this.hi=0,this.ci)&&this.brokenCounts++,e!==ui&&this.updateTimes(),(t=t&&[C.LoginFailed,C.ReconnectFailed].includes(t)?null!=(u=this.si.roomTryHandler)&&u.loginRoomCallback.fail?C.LoginFailed:C.ReconnectFailed:t)&&[C.Logined,C.Reconnected].includes(t)&&(null!=(u=this.si.roomTryHandler)&&u.loginRoomCallback.success?(t=C.Logined,this.ui=this.ui||s):t=C.Reconnected,this.ci=!1,this.oi=s),t&&[C.Logining,C.Reconnecting].includes(t)&&(t=null!=(u=this.si.roomTryHandler)&&u.loginRoomCallback.success?C.Logining:C.Reconnecting,this.ui)&&(this.ci=!0);var c,u,l=0;switch(t){case C.Reconnecting:c=gt,this.tempBrokenTime=(new Date).getTime();break;case C.ReconnectFailed:c=bt;break;case C.Reconnected:c=yt,l=(new Date).getTime()-this.tempBrokenTime}this.si.lastRoomState=this.si.roomState,this.si.roomState=e,this.si.roomReasonState=t,this.si.roomState!==this.si.lastRoomState&&(this.Qt.actionListener("_roomStateUpdate",o,e,i?i.code:0,r,n),n||(this.Qt.actionListener("roomStateUpdate",o,e,s=(s=(null==i?void 0:i.code)||0)==oi.code?0:s,r),this.Qt.actionListener("roomStateChanged",o,t,s,r)),c)&&((u=this.ti.createSpan(a.H,{key:at.event,par:o},{key:""},c.event)).setAttributes(t===C.Reconnected?{room_broken_time:yt.room_broken_time(l)}:{error:(null==i?void 0:i.code)||0,message:r||""}),c==bt&&u.setAttributes({valid_d:this.validTime,total_d:this.totalTime,tempbroken_cnt:this.brokenCounts}),u.end()),e===ci&&(this.ui=0,this.totalTime=0,this.validTime=0,this.brokenCounts=0)}},hi.prototype.transError=function(e){var t;this.Zt.info("zm.rm.te "+JSON.stringify(e)),0!==e.code&&(e.code<2e9&&1e9<e.code||e.code<1e6)&&(t=ie(e.code,this.Qt.useNetAgent))&&P[t]&&(e.code=P[t].code,e.msg=P[t].msg)},hi.prototype.login=function(e,t,i,r,n,o,c){var u;this.Zt.info(Me+" call:"+t),this.Zt.remoteReport(Me+" call:"+i),this.si.isMulti||this.Zt.setSessionInfo(this.Qt.appid,t,"",r.userID,"",this.Qt.sdKVersion),n&&(u=n.userUpdate,n=n.maxMemberCount,u&&Object(z.b)(u)&&(this.si.userStateUpdate=u),n)&&Object(z.d)(n)&&(this.si.maxMemberCount=n),this.Qt.configOK?(this.si.runState!==s.trylogin&&this.setRunState(s.trylogin),this.si.isCancelLogin=!1,this.si.roomID=t,this.si.token=i,this.si.thirdToken=i,this.Qt.idName=r.userID,this.Qt.nickName=r.userName||r.userID,this.loginCallback.success=o,this.loginCallback.fail=c,this.server=e,this.ti.spanSetAttributes({key:ct,bak_key:vt,par:t},{server:this.ii?void 0:ut(this.server)}),this.liveRoomLoginKey=this.si.isMulti?dt:lt,this.ti.createSpan(a.H,{key:ct,bak_key:vt,par:this.ei},{key:this.liveRoomLoginKey.event,par:this.ei},this.liveRoomLoginKey.event,!0),this._resetTryLogin(),this.onConnecting({code:0,msg:""}),this._tryLogin(e),this.Zt.info(Me+" call success")):(this.Zt.error(Me+" init sdk wrong"),c(P.INIT))},hi.prototype._tryLogin=function(e){var t,i=this;if(this.si.runState!==s.trylogin)this.Zt.error("zb.rh.tl state error");else{var r;if(this.ii)return this.si.isMulti&&this.si.isDisConnect()?void this.Zt.warn(Le+" liveroom is not connected"):(r=function(e,t){i.handleLoginRsp(e,t)},void(null!=(t=this.ri)&&t.isUaConnect?(this.ti.spanSetAttributes({key:this.liveRoomLoginKey.event,par:null==(t=this.si)?void 0:t.roomID},{sdk_zpush_sessionid_string:null==(t=null==(t=null==(t=this.ri)?void 0:t.roomServicer)?void 0:t.switchSessionID)?void 0:t.toString()}),this.ri.login(this.si,r,r)):(this._tryLoginTimer=setTimeout((function(){i.Zt.info(Le+" over time no response, login timeout"),i.loginCallback.fail&&i.loginCallback.fail(at.error.LOGIN_TIMEOUT)}),this._tryLoginInterval),this.Zt.warn(Le+" ua is not connected"))));this._tryLoginTimer=setTimeout((function(){i.Zt.info(Le+" over time no response, login timeout"),i.loginCallback.fail&&i.loginCallback.fail(at.error.LOGIN_TIMEOUT)}),this._tryLoginInterval),this.Zt.info(Le+" call success")}},hi.prototype.handleLoginRsp=function(e,t){this.Zt.info(xe+" seq: "+t+" "+JSON.stringify(e)),this.si.runState!==s.trylogin?this.si.isCancelLogin?(this.handleLoginFail(oi),this.si.isCancelLogin=!1):this.Zt.error(xe+" state error"):e.header&&e.body?e.header.seq!==t&&0==this.si.isMulti?this.Zt.error(xe+" in wrong seq, local=",t+"",",recv=",e.header.seq):0!==e.body.err_code?(this.Zt.error(xe+" server error=",e.body.err_code),this.handleLoginFail(e)):(this.Zt.info(xe+" call success."),this.handleLoginSuccess(e)):(this.Zt.error(xe+" "+JSON.stringify(e)),this.handleLoginFail(e))},hi.prototype.handleLoginFail=function(e){this._resetTryLogin();var t=at.error.INNER_ERROR;e.header&&e.body?t=ee(e.body.err_code):e.code&&e.msg&&(t=e),this.ti.spanEnd({key:this.liveRoomLoginKey.event,par:this.ei},{error:t.code,message:t.msg}),this.loginCallback.fail&&this.loginCallback.fail(t,!0)},hi.prototype.handleLoginSuccess=function(e){var t,i,r=this,n=(this.si.checkRoomSession(e.body.room_session_id)&&(this.si.loginTime=Date.now()),this.si.lastRunState),o=(this.setRunState(s.login),this.Qt.userid=e.body.user_id,this.ii?(this.si.longRoomSid=e.body.room_session_id,this.si.longSid=e.body.session_id):(this.si.sessionID=e.body.session_id,this.si.roomSessionID=e.body.room_session_id),(o={})[this.ei]={room_sid_string:this.si.roomSidString},this.ti.setPublicPros(o),null==(o=null==e?void 0:e.body)?void 0:o.token_remain_time);this.Qt.configRoomAuth=0<o,e.body.ret_timestamp&&["03","04"].includes(this.si.token.substring(0,2))&&(i=(t=(new Date).getTime())-e.body.ret_timestamp,this.Qt.local_time_deviation=i<5e3?0:i,i=0<o?1e3*o:1e3*oe(this.si.token.substring(2))-(t-this.Qt.local_time_deviation),this.resetTokenTimer(i)),this.si.isMulti||this.Zt.setSessionInfo(this.Qt.appid,this.ei,this.si.userSidString,this.Qt.idName,this.Qt.nickName,this.Qt.sdKVersion),this.ti.spanEnd({key:this.liveRoomLoginKey.event,par:this.ei},{server:this.ii?void 0:ut(this.server),room_id:null==(o=this.si)?void 0:o.roomID,room_sid_string:null==(t=this.si)?void 0:t.roomSidString,zpush_sessionid_string:this.ii&&null!=(o=null==(i=null==e?void 0:e.header)?void 0:i.session_id)?o.toString():void 0,liveroom_sid_string:null==(t=this.si)?void 0:t.userSidString}),this._resetTryLogin(),this.loginSuccessCallBack(n,e),this._roomStateHandle(ui,C.Logined,{code:0,msg:""}),this.Zt.makeZipLogSpaceUpload().catch((function(e){r.Zt.error("zm.rm.lgsuc zip log upload error: "+JSON.stringify(e))})),this.loginCallback.success&&this.loginCallback.success(!0)},hi.prototype.closeHandler=function(e){},hi.prototype.logout=function(e,t){this.Zt.info(Ue+" call");var i={code:0,msg:""};this.si.runState===s.logout?this.Zt.warn("zb.rh.lo at logout"):(this.si.runState===s.trylogin&&(this.si.isCancelLogin=!0,i=oi),this.resetRoom(e),this._roomStateHandle(ci,C.Logout,i,void 0,t),this._stopTokenTimer(),this.Zt.info(Ue+" call success"))},hi.prototype.handleLogoutRsp=function(e,t){this.Zt.info(Ue+" result=",e.body&&e.body.err_code?e.body.err_code:"-1"),this.ii&&t&&null!=(e=this.ri)&&e.closeRequest()},hi);function hi(e,t,i,r,n,o){this.Zt=e,this.Qt=t,this._dataReport=i,this.si=r,this.ri=n,this.ai=o,this._tryLoginTimer=null,this._tryLoginCount=0,this._tryLoginInterval=1e4,this._tokenTimer=null,this._beforeExpire=30,this.server="",this.tempBrokenTime=0,this.hi=0,this.validTime=0,this.totalTime=0,this.brokenCounts=0,this.oi=0,this.ui=0,this.ci=!1,this.loginCallback={}}var pi=function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},fi=(mi.prototype.loginRsp=function(e,t){this._anchor_info=e.body.anchor_info||this._anchor_info,this._userListInterval=e.body.userlist_interval||this._userListInterval,this._userListMergeInterval=e.body.userlist_merge_timeout||this._userListMergeInterval,e.body.anchor_info&&(this.Qt.actionListener("getAnchorInfo",e.body.anchor_info.anchor_id_name,e.body.anchor_info.anchor_nick_name),this.Qt.actionListener("_getAnchorInfo",e.body.anchor_info.anchor_id_name,e.body.anchor_info.anchor_nick_name)),e.body.online_count&&this.Qt.actionListener("roomOnlineUserCountUpdate",this._room.roomID,e.body.online_count),this.Zt.info("zm.us.lgr userStateUpdate "+this._room.userStateUpdate),this._room.userStateUpdate&&this.fetchUserList(t)},mi.prototype.patchUserList=function(e){var t=this;e.body.server_user_seq!==this._userSeq&&this._room.userStateUpdate&&!this._userSeqMergeMap&&(this.Zt.info("zm.us.pt call update user "+this._userSeq+" server "+e.body.server_user_seq),this._userSeqMergeMap||(this._userSeqMergeMap={}),this._userSeqMergeTimer&&clearTimeout(this._userSeqMergeTimer),this._userSeqMergeTimer=setTimeout((function(){t.handleMergeTimeout()}),this._userListMergeInterval)),this._minUserSeq=e.body.server_user_seq,null!=e.body.online_count&&0!=e.body.online_count&&this.Qt.actionListener("roomOnlineUserCountUpdate",this._room.roomID,e.body.online_count)},mi.prototype.resetUserHandler=function(){this._userQuerying=!1,this._lastUserQueryTime=0,this._userTempList=[],this._userSeq=0,this._minUserSeq=0,this._userList=void 0,this._userSeqMergeMap={},this._userSeqMergeTimer=void 0,this._userQueryTimer=void 0,this._userListInterval=3e4,this._userListMergeInterval=5e3,this._anchor_info={anchor_id:"",anchor_id_name:"",anchor_nick_name:""}},mi.prototype.fetchUserList=function(e){this._userQuerying?this.Zt.warn("zm.us.ftu is already querying"):(this._userQuerying=!0,this._userTempList=[],this.fetchUserListWithPage(0,e||0),this.Zt.info("zm.us.ftu the first time call"))},mi.prototype.fetchUserListWithPage=function(e,t){function i(e){r.handleFetchUserListRsp(e,t)}var r=this,n={user_index:e,sort_type:0},o=Dt;null!=(this.Qt.reporter.createSpan(a.H,{key:at.event,par:this._room.roomID},{key:o.event,par:this._room.roomID},o.event,!0).setAttribute("user_index",o.user_index(e)),o=this.Qt.useNetAgent?this._liveRoomHandler:this._service)&&o.fetchUserList(n,i,i,this._room)},mi.prototype.handleFetchUserListRsp=function(e,t){var i=this;if(this.Qt.reporter.spanEnd({key:Dt.event,par:this._room.roomID},{error:(null==(r=null==e?void 0:e.body)?void 0:r.err_code)||(null==e?void 0:e.code),message:(null==(r=null==e?void 0:e.body)?void 0:r.err_message)||(null==e?void 0:e.msg)}),e.body&&0!=e.body.err_code)this._userQuerying=!1,this._lastUserQueryTime=Date.now()+this._userListInterval,this.Zt.info(Fe+" fetch error "+e.body.err_code);else if(e.header&&e.body)if(this._room.userStateUpdate){this._userTempList=pi(pi([],this._userTempList,!0),e.body.user_baseinfos,!0);var r=e.body.ret_user_index;if(r!=e.body.server_user_index)this.Zt.info(Fe+" fetch another page"),this.fetchUserListWithPage(r+1,t);else{this._userSeq=e.body.server_user_seq;for(var n=[],o=[],a=0;a<this._userTempList.length;a++){var c={userID:this._userTempList[a].id_name,userName:this._userTempList[a].nick_name,role:this._userTempList[a].role};4!==c.role&&(n.push(c),o.push({idName:this._userTempList[a].id_name,nickName:this._userTempList[a].nick_name,role:this._userTempList[a].role}))}if(this.Qt.actionListener("_getTotalUserList",this._room.roomID,o),t==s.login){if(this._userList){var u=this._userList,l=n;t=function(e,t){0!==e.length&&i.onUserStateUpdate(i._room.roomID,"ADD",e),0!==t.length&&i.onUserStateUpdate(i._room.roomID,"DELETE",t)},(r=this.Zt).debug("msl.0 call");var d=[],h=[];l=l||[];for(var p=0;p<l.length;p++){for(var f=!1,m=0;m<u.length;m++)if(l[p].userID===u[m].userID){f=!0;break}f||d.push(l[p])}for(var v=0;v<u.length;v++){f=!1;for(var g=0;g<l.length;g++)if(u[v].userID===l[g].userID){f=!0;break}f||h.push(u[v])}for(u.splice(0),p=0;p<l.length;p++)u.push(u[p]);t(d,h),r.debug("msl.0 call success")}this._userList=n}else 0!==(this._userList=n).length&&this.onUserStateUpdate(this._room.roomID,"ADD",n);this._userQuerying=!1,this._lastUserQueryTime=Date.now()+this._userListInterval,this._userTempList=[],this.Zt.info(Fe+" call success user_list "+n+", count: "+n.length+", seq: "+this._userSeq)}}else this.Zt.info(Fe+" not update");else this._userQuerying=!1,this._lastUserQueryTime=Date.now()+this._userListInterval,this.Zt.info(Fe+" fetch error "+e)},mi.prototype.handlePushUserStateUpdateMsg=function(e){if(this.Zt.info(Ve+" call"),this._room.userStateUpdate)if(this._userSeq===e.body.user_list_seq)this.Zt.warn(Ve+" user_list_seq is the same with local seq");else if(this._userSeq+e.body.user_actions.length!==e.body.user_list_seq)this.mergeUserByUserSeq(e.body.user_list_seq,e.body.user_actions);else{this._userSeq=e.body.user_list_seq;for(var t=[],i=0;i<e.body.user_actions.length;i++){var r={action:e.body.user_actions[i].Action,idName:e.body.user_actions[i].IdName,nickName:e.body.user_actions[i].NickName,role:e.body.user_actions[i].Role,loginTime:e.body.user_actions[i].LoginTime};4!==r.role&&t.push(r)}this.Qt.actionListener("_userStateUpdate",e.body.room_id,t);var n=[],o=[];t.forEach((function(e){1==e.action?n.push({userID:e.idName,userName:e.nickName,role:e.role}):2==e.action&&o.push({userID:e.idName,userName:e.nickName,role:e.role})})),this._userList&&(this._userList=this._userList.concat(n).filter((function(e){return!o.some((function(t){return t.userID==e.userID}))}))),0!==n.length&&this.onUserStateUpdate(e.body.room_id,"ADD",n),0!==o.length&&this.onUserStateUpdate(e.body.room_id,"DELETE",o),this.Zt.info(Ve+" call success")}else this.Zt.info(Ve+" userStateUpdate is false")},mi.prototype.onUserStateUpdate=function(e,t,i){var r=this;i=i.filter((function(e){return e.userID!==r.Qt.idName})),0!=i.length&&(i=i.map((function(e){return{userID:e.userID,userName:e.userName}})),this.Qt.actionListener("roomUserUpdate",e,t,i))},mi.prototype.mergeUserByUserSeq=function(e,t){var i=this;this._userSeqMergeMap||(this.Zt.warn("zm.us.mg new merge userlist "+this._userSeq+" server "+e),this._userSeqMergeMap={},this._userSeqMergeTimer&&clearTimeout(this._userSeqMergeTimer),this._userSeqMergeTimer=setTimeout((function(){i.handleMergeTimeout()}),this._userListMergeInterval)),this._userSeqMergeMap[e]=t,this.Zt.warn("zm.us.mg merge userlist "+this._userSeq+" server "+e+" userlist "+t.length)},mi.prototype.mergeUser=function(e){var t=this,i=(this.Zt.info("zm.us.mg merge userlist "+this._userSeq+" userSeqList "+e.join(",")),this._userSeq=e[e.length-1],this._lastUserQueryTime=Date.now()+this._userListInterval,{}),r=((e.forEach((function(e){t._userSeqMergeMap&&t._userSeqMergeMap[e].forEach((function(e){i[e.IdName]=e}))})),this._userSeqMergeMap=null,e=Object.values(i).map((function(e){return{action:e.Action,idName:e.IdName,nickName:e.NickName,role:e.Role,loginTime:e.LoginTime?String(e.LoginTime):""}})).filter((function(e){return 4!==e.role}))).sort((function(e,t){return e.loginTime.localeCompare(t.loginTime)})),[]),n=[];e.forEach((function(e){1==e.action?r.push({userID:e.idName,userName:e.nickName,role:e.role}):2==e.action&&n.push({userID:e.idName,userName:e.nickName,role:e.role})})),this._userList=this._userList&&this._userList.concat(r).filter((function(e){return!n.some((function(t){return t.userID==e.userID}))})),0!==r.length&&this.onUserStateUpdate(this._room.roomID,"ADD",r),0!==n.length&&this.onUserStateUpdate(this._room.roomID,"DELETE",n),this.Qt.actionListener("_userStateUpdate",this._room.roomID,e)},mi.prototype.handleMergeTimeout=function(){var e,t=this,i=Object.keys(this._userSeqMergeMap).map((function(e){return+e})).sort((function(e,t){return e-t}));i[i.length-1]-i[0]+1===i.length||i[i.length-1]>=this._minUserSeq?this.mergeUser(i):(this._userSeqMergeMap=null,e=this._lastUserQueryTime-Date.now(),this.Zt.info("zm.us.mto fetch merge userlist "+this._userSeq+" userSeqList "+i.join(",")+" wait "+e),0<e?(this._userQueryTimer&&clearTimeout(this._userQueryTimer),this._userQueryTimer=setTimeout((function(){t.fetchUserList()}),e)):this.fetchUserList())},mi);function mi(e,t,i,r,n,o){this.Zt=e,this.Qt=t,this._dataReport=i,this._liveRoomHandler=r,this._room=n,this._service=o,this._userQuerying=!1,this._userTempList=[],this._userSeq=0,this._minUserSeq=0,this._userList=[],this._userSeqMergeMap=null,this._userListInterval=3e4,this._userListMergeInterval=5e3,this._anchor_info={anchor_id:"",anchor_id_name:"",anchor_nick_name:""}}Object.defineProperty(gi.prototype,"logger",{get:function(){return this.Zt},enumerable:!1,configurable:!0}),Object.defineProperty(gi.prototype,"stateCenter",{get:function(){return this.Qt},enumerable:!1,configurable:!0}),Object.defineProperty(gi.prototype,"liveRoomHandler",{get:function(){return this._liveRoomHandler},enumerable:!1,configurable:!0}),Object.defineProperty(gi.prototype,"_isUseNetAgent",{get:function(){return this.Qt.useNetAgent},enumerable:!1,configurable:!0}),Object.defineProperty(gi.prototype,"sessionExist",{get:function(){return null!==this.longSid||"0"!==this.sessionID},enumerable:!1,configurable:!0}),Object.defineProperty(gi.prototype,"roomSidString",{get:function(){return this.longRoomSid?this.longRoomSid.toString():"0"},enumerable:!1,configurable:!0}),Object.defineProperty(gi.prototype,"userSidString",{get:function(){return this.longSid?this.longSid.toString():"0"},enumerable:!1,configurable:!0}),gi.prototype.initMessageHandler=function(){},gi.prototype.initLiveHandler=function(){},gi.prototype.init=function(){this.bindHeatBeatHandler(),this.bindRoomHandler(),this.bindMessageHandler(),this.bindLiveHandler()},gi.prototype.bindHeatBeatHandler=function(){var e=this;this.heartBeatHandler.hbLogout=function(t){e.roomHandler.handleHbLogout(t)},this.heartBeatHandler.heartbeatRspNotiFy=function(t,i){e.messageHandler&&e.messageHandler.loginRsp(t),e.userHandler.patchUserList(t),e._HBResponse(t,i)}},gi.prototype.bindRoomHandler=function(){var e=this;this.roomHandler.loginSuccessCallBack=function(t,i){e.Zt.info("zm.lrm.brh login suc "+t),e.heartBeatHandler.init(i),e._isUseNetAgent?e._liveRoomHandler.startCheck():e.service&&(e.service.stopCheck(),e.service.startCheck()),e.userHandler.loginRsp(i,t),e.messageHandler&&e.messageHandler.loginRsp(i),e.isMulti||e.fi(),e.li(i)},this.roomHandler.resetRoomCallBack=function(){e.heartBeatHandler.resetHeartbeat(),e.liveHandler&&e.liveHandler.resetLiveHandler(),e.messageHandler&&e.messageHandler.resetMessageInfo(),e._isUseNetAgent&&e._liveRoomHandler&&e._liveRoomHandler.stopCheck(),e.userHandler.resetUserHandler(),e.roomTryHandler&&(e.roomTryHandler.invalid(),e.roomTryHandler.stopMaxTime())}},gi.prototype.bindUserHandler=function(){},gi.prototype.bindMessageHandler=function(){},gi.prototype.bindLiveHandler=function(){},gi.prototype._HBResponse=function(e,t){this.Qt.actionListener("HBResponse",e,t)},gi.prototype.li=function(e){this.Qt.actionListener("roomLoginResponse",e)},gi.prototype.checkRoomSession=function(e){return this._isUseNetAgent?null!==this.longRoomSid&&this.longRoomSid.eq(e):this.roomSessionID===e},gi.prototype.fi=function(){var e=this;this.Qt.roomModulesList.forEach((function(t){var i=t.roomTryHandler;t.runState!==s.login&&i&&1==t.isMulti&&(i.onactive=function(i,r){var n;r&&0!==r.code?((n=ie(r.code,e._isUseNetAgent))&&P[n]&&(r=P[n]),t.roomHandler._roomStateHandle("DISCONNECTED",C.ReconnectFailed,r,r.msg)):t.roomHandler._roomStateHandle("CONNECTED",C.Reconnected,r)},i.retryLoginRoom())}))},gi.prototype.isLogin=function(){return this.runState===s.login},gi.prototype.isLogout=function(){return this.runState===s.logout},gi.prototype.isTryLogin=function(){return this.runState===s.trylogin},gi.prototype.isDisConnect=function(){return(this._isUseNetAgent?this._liveRoomHandler:this.service).isDisConnect()},gi.prototype.retryConnect=function(){this.Zt.info("zm.lrm.rc call"),this._isUseNetAgent&&(this.resetSessionInfo(),this._liveRoomHandler.closeRequest())},gi.prototype.retryRoom=function(e,t){void 0===t&&(t=!1),this.Zt.info("zm.lrm.rr.0 call retryNow:".concat(e=void 0!==e&&e,", resetSession:").concat(t));var i=this.roomTryHandler;i&&this.rtm.isUaConnect&&i.retryLoginRoom(e,t)},gi.prototype.resetSessionInfo=function(){var e;this.Zt.info("zm.lrm.rsi call"),this.resetRoomSession(),this.resetUserSession(),null!=(e=this._liveRoomHandler)&&e.reset()},gi.prototype.resetRoomSession=function(){this.roomSessionID="0",this.longRoomSid=null},gi.prototype.resetUserSession=function(){this.sessionID="0",this.longSid=null};var vi=gi;function gi(e,t,i,r,n,o,a){this.roomID=e,this.Qt=t,this.Zt=i,this.dataReport=r,this.rtm=n,this._liveRoomHandler=o,this.service=a,this.runState=s.logout,this.lastRunState=s.logout,this.lastRoomState="DISCONNECTED",this.roomState="DISCONNECTED",this.roomReasonState=C.Logout,this.roomSessionID="0",this.sessionID="0",this.longSid=null,this.longRoomSid=null,this.isMulti=!1,this.token="",this.thirdToken="",this.loginTime=0,this.userStateUpdate=!1,this.maxMemberCount=0,this.roomName="",this.isCancelLogin=!1,this.roomHandler=new di(this.Zt,this.Qt,this.dataReport,this,o,this.service),this.heartBeatHandler=new ri(this.Zt,this.Qt,this.dataReport,this._liveRoomHandler,this,this.service),this.userHandler=new fi(this.Zt,this.Qt,this.dataReport,this._liveRoomHandler,this,this.service),this.initMessageHandler(),this.initLiveHandler(),this.init()}var yi=function(){},bi=(Object.defineProperty(_i.prototype,"ti",{get:function(){return this.Qt.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(_i.prototype,"logger",{get:function(){return this.Zt},enumerable:!1,configurable:!0}),Object.defineProperty(_i.prototype,"stateCenter",{get:function(){return this.Qt},enumerable:!1,configurable:!0}),_i.prototype.checkResponse=function(e){return!1},_i.prototype.handleSendCommandMsgRsp=function(e){},_i.prototype.onPush=function(){},_i.prototype.handlePushKickout=function(e){},_i.prototype.handlePushCustomMsg=function(e){},_i.prototype.handlePushRoomMsg=function(e){},_i.prototype.handlePushUserStateUpdateMsg=function(e){},_i.prototype.handlePushMergeMsg=function(e){},_i.prototype.handlePushTransMsg=function(e){},_i.prototype.handleBigImMsgRsp=function(e){},_i.prototype.handlePushSignalMsg=function(e){},_i.prototype.handlePushTokenExpire=function(e){},_i.prototype.closeHandler=function(e){},_i.prototype.openHandler=function(e){},_i.prototype.errorHandler=function(e){},_i.prototype.getHeader=function(e,t,i,r){return{Protocol:"req",cmd:e,appid:this.Qt.appid,seq:++this.cmdSeq,user_id:this.Qt.userid,session_id:t||"",room_id:i||"",room_session_id:r||"",biz_version:this.Qt.bizVersion||""}},_i.prototype.startCheck=function(){},_i.prototype.stopCheck=function(){},_i.prototype.isDisConnect=function(){return!1},_i.prototype.createSocket=function(e){},_i.prototype.closeSocket=function(){},_i.prototype.sendMessage=function(e,t,i,r,n,o){return 0},_i.prototype.on=function(e,t){},_i.prototype.login=function(e,t,i){return-1},_i.prototype.logout=function(e,t,i){return-1},_i.prototype.heartBeat=function(e,t,i){return-1},_i.prototype.fetchUserList=function(e,t,i,r){return this.sendMessage("user_list",e,t,i,void 0,r)},_i.prototype.fetchUserListV2=function(e,t,i,r){return this.sendMessage("user_list_v2",e,t,i,void 0,r)},_i.prototype.fetchReliableMessage=function(e,t,i,r){return this.sendMessage("trans_fetch",e,t,i,void 0,r)},_i.prototype.sendReliableMessage=function(e,t,i,r){return this.sendMessage("trans",e,t,i,void 0,r)},_i.prototype.sendRoomMsg=function(e,t,i,r){return this.sendMessage("im_chat",e,t,i,void 0,r)},_i.prototype.sendCustomCommand=function(e,t,i,r){return this.sendMessage("custommsg",e,t,i,void 0,r)},_i.prototype.sendBigRoomMessage=function(e,t,i,r){return this.sendMessage("bigim_chat",e,t,i,void 0,r)},_i.prototype.sendRelayMessage=function(e,t,i,r){return this.sendMessage("relay",e,t,i,void 0,r)},_i.prototype.sendSignalCmd=function(e,t,i,r){return this.sendMessage("signal",e,t,i,void 0,r)},_i.prototype.sendPB=function(e){return!1},_i);function _i(e,t,i){this.Qt=e,this.Zt=t,this.rtm=i,this.cmdSeq=0,this.responseRouters={},this.service=new yi(this.Qt.ENV)}Ti.prototype.setSetting=function(e,t){var i,r=Array.isArray(t)&&0<t.length;for(i in e){var n,o=e[i];if(Object(z.d)(o.ctrlmode)&&[1,2].includes(o.ctrlmode))this.setting[i]=o,this.setting[i+"_ctrlmode"]=o.ctrlmode;else for(var s in o)s.endsWith("_ctrlmode")||r&&-1==t.indexOf(s)||(1===(n=o[s+"_ctrlmode"])||2===n?this.setting[s]=o[s]:this.defaultSetting[s]&&(this.setting[s]=this.defaultSetting[s]),Object(z.d)(n)&&(this.setting[s+"_ctrlmode"]=o[s+"_ctrlmode"]))}},Ti.prototype.getSetting=function(e,t){return void 0===t&&(t=!1),this.close||t&&2!=this.setting[e+"_ctrlmode"]?void 0:this.setting[e]};var Si=Ti;function Ti(e){this.close=e,this.defaultSetting={remote_log_level:"info",zip_log:0,detaillog_domain:""},this.requestList={},this.setting=JSON.parse(JSON.stringify(this.defaultSetting))}for(var Ei=i(3),Ci=(t=i(1),Ei.util.Long=t,Ei.util.Long.fromBits=Ei.util.Long?Ei.util.Long.fromBits:function(){return 0},Ei.roots),wi=Ei.types?Ei.types.basic:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0,string:2,bytes:2},Ii=Ei.types?Ei.types.packed:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0},Ri=Object.keys(wi),ki={$:function(e){return ki[e]?ki[e].call(this):Ci[e].decode?Ci[e].decode(this,this.uint32()):ki.$.call(this,"int32")}},Pi={$:function(e,t,i){var r=wi[e];return void 0===r?Ci[e].encode?(this.uint32(i<<3|2).fork(),Ci[e].encode(t,this).ldelim()):Pi.$.call(this,"int32",t,i):Pi[e].call(this.uint32(i<<3|r),t)}},Ai=0;Ai<Ri.length;Ai++)ki[Ri[Ai]]=Ei.Reader.prototype[Ri[Ai]],Pi[Ri[Ai]]=Ei.Writer.prototype[Ri[Ai]];!function e(t,i,r,n){for(var o=0,s=Object.keys(t);o<s.length;o++){var a=s[o];if(t[a].$m&&Object.keys(t[a].$m).every((function(e){return Number(e)}))){if(r[a])throw Error("nested type ".concat(r,".").concat(a," has already exist"));r[a]=function(t,r){function n(e){for(var i in t)"{"===(i=t[i])[1].charAt(0)?this[i[0]]={}:"["!==i[1].charAt(0)&&"<"!==i[1].charAt(0)||(this[i[0]]=[]);if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)null!=e[r[n]]&&(this[r[n]]=e[r[n]])}var o,s={};for(o in t){var a=t[o],c=a[1];"{"===c.charAt(0)?(n.prototype[a[0]]=Ei.util.emptyObject,s[c]={$m:c.substring(1).split(",").map((function(e,t){return["$"+(t+1),e,null]})).reduce((function(e,t,i){return e[i+1]=t,e}),{})}):n.prototype[a[0]]="["===c.charAt(0)||"<"===c.charAt(0)?Ei.util.emptyArray:"bytes"===c?Ei.util.newBuffer([]):a[2]&&a[2].hasOwnProperty("low")&&a[2].hasOwnProperty("high")?Ei.util.Long.fromBits(a[2].low,a[2].high,a[2].unsigned):a[2]}return n.create=function(e){return new n(e)},n.decode=function(e,i){e instanceof Ei.Reader||(e=Ei.Reader.create(e));for(var r=void 0===i?e.len:e.pos+i,o=new n;e.pos<r;){var s=e.uint32();if(0<(u=s>>>3)&&t[u]){var a=t[u][0];if("{"===(c=t[u][1]).charAt(0))o[a]===Ei.util.emptyObject&&(o[a]={}),u=n.$namespace[c].decode(e,e.uint32()),o[a][u.$1]=u.$2;else if("["===c.charAt(0)||"<"===c.charAt(0)){c=c.substring(1),o[a]&&o[a].length||(o[a]=[]);var c,u=!ki[c]&&!Ci[c].decode;if(void 0!==Ii[c=u?"int32":c]&&2==(7&s))for(var l=e.uint32()+e.pos;e.pos<l;)o[a].push(ki.$.call(e,c));else o[a].push(ki.$.call(e,c))}else o[a]=ki.$.call(e,c)}else e.skipType(7&s)}return o},n.encode=function(e,i){for(var r in i=i||Ei.Writer.create(),t){var o=t[r][0];if("{"===(l=t[r][1]).charAt(0)){if(null!=e[o]&&e.hasOwnProperty(o))for(var s=0,a=Object.keys(e[o]);s<a.length;++s)i.uint32(r<<3|2).fork(),n.$namespace[l].encode({$1:a[s],$2:e[o][a[s]]},i).ldelim()}else if("["===l.charAt(0)||"<"===l.charAt(0)){var c="<"===l.charAt(0),u=(l=l.substring(1),e[o]);if(null!=u&&u.length){var l=void 0!==wi[l]||Ci[l].encode?l:"int32";if(c&&void 0!==Ii[l]){for(i.uint32(r<<3|2).fork(),s=0;s<u.length;s++)Pi[l].call(i,u[s]);i.ldelim()}else for(s=0;s<u.length;s++)Pi.$.call(i,l,u[s],r)}}else null!=e[o]&&e.hasOwnProperty(o)&&Pi.$.call(i,l,e[o],r)}return i},Object.keys(s).length&&(n.$namespace=e(s,i+"."+r,n.$namespace||{},!0)),n}(t[a].$m,a)}else t[a].$s?r[a]=function(e,t){function r(e,t,i){Ei.rpc.Service.call(this,e,t,i)}return((r.prototype=Object.create(Ei.rpc.Service.prototype)).constructor=r).create=function(e,t,i){return new r(e,t,i)},Object.keys(e).forEach((function(n){var o=e[n];function s(e,t){return this.rpcCall(s,Ci[o[0]],Ci[o[1]],e,t)}Object.defineProperty(s,"name",{value:n}),Object.defineProperty(s,"path",{value:i+"."+t}),r.prototype[n]=s})),r}(t[a].$s,a):t[a].$e&&Object.values(t[a].$e).every((function(e){return Number(e)===e}))&&(r[a]=function(e){for(var t=Object.keys(e),i={},r=0;r<t.length;r++)i[i[t[r]]=e[t[r]]]=t[r];return i}(t[a].$e));r[a]&&!n&&(Ci[i+"."+a]=r[a]),delete t[a].$m,delete t[a].$s,delete t[a].$e,r[a]=e(t[a],i?i+"."+a:a,r[a]||{})}return r}({liveroom:{liveroom_cs_v3:{AddStreamReq:{$m:{1:["stream_id","bytes",[]],2:["stream_title","bytes",[]],3:["stream_type","uint32",0],4:["stream_attr","bytes",[]],5:["extra_info","bytes",[]],6:["client_req_seq","uint32",0],7:["third_token","bytes",[]],8:["censor_mode","uint32",0],9:["need_gather","uint32",0],10:["sdk_custom_info","bytes",[]],11:["stream_attr_opts","liveroom.liveroom_cs_v3.StreamAttrOptions",null]}},AddStreamRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["stream_seq","uint32",0],3:["stream_sid","string",""],4:["stream_ver","uint32",0],5:["stream_nid","uint32",0],6:["token_remain_time","uint32",0]}},AnchorInfo:{$m:{1:["id_name","bytes",[]],2:["user_id","uint64",{low:0,high:0,unsigned:!0}],3:["nick_name","bytes",[]]}},BigImData:{$m:{1:["id_name","bytes",[]],2:["nick_name","bytes",[]],3:["role","uint32",0],4:["msg_id","bytes",[]],5:["msg_category","uint32",0],6:["msg_type","uint32",0],7:["msg_content","bytes",[]],8:["msg_timestamp","int64",{low:0,high:0,unsigned:!1}]}},Capabilities:{$m:{1:["video_codec","uint32",0],2:["gop_mode","uint32",0]}},CommonRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null]}},DeleteStreamReq:{$m:{1:["stream_sid","string",""],2:["stream_id","bytes",[]],3:["client_req_seq","uint32",0]}},DeleteStreamRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["stream_seq","uint32",0],3:["stream_ver","uint32",0]}},EnterRoomReq:{$m:{1:["net_type","uint32",0],2:["conn_type","uint32",0],3:["room_id","bytes",[]],4:["room_name","bytes",[]],5:["role","uint32",0],6:["third_token","bytes",[]],7:["room_create_flag","uint32",0],8:["user_state_flag","uint32",0],9:["user_count_limit","uint32",0],10:["relate_service","string",""],11:["need_gather_stream","uint32",0],12:["callback_data","bytes",[]],13:["service_flags","uint32",0],14:["license_token","bytes",[]],15:["user_session_id","uint64",{low:0,high:0,unsigned:!0}],16:["capabilities","liveroom.liveroom_cs_v3.Capabilities",null]}},EnterRoomRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["user_session_id","uint64",{low:0,high:0,unsigned:!0}],3:["room_session_id","uint64",{low:0,high:0,unsigned:!0}],4:["user_id","uint64",{low:0,high:0,unsigned:!0}],5:["ret_timestamp","int64",{low:0,high:0,unsigned:!1}],6:["big_im_time_window","uint32",0],7:["liveroom_hb_interval","uint32",0],8:["liveroom_hb_timeout","uint32",0],9:["online_count","uint32",0],10:["anchor_info","liveroom.liveroom_cs_v3.AnchorInfo",null],11:["userlist_merge_timeout","uint32",0],12:["userlist_interval","uint32",0],13:["token_remain_time","uint32",0],14:["trans_list_seq","uint32",0],15:["trans_channel_list","<liveroom.liveroom_cs_v3.TransChannel",null],16:["stream_count","uint32",0],17:["stream_list_seq","uint32",0],18:["stream_info_list","<liveroom.liveroom_cs_v3.StreamInfo",null],19:["stream_fetch_flag","uint32",0],20:["stream_list_push_merge_timeout","uint32",0],21:["stream_list_hb_merge_timeout","uint32",0],22:["relate_result_list","<liveroom.liveroom_cs_v3.RelateResult",null],23:["gather_list_seq","uint32",0],24:["gather_info_list","<liveroom.liveroom_cs_v3.GatherInfo",null]}},EnumSignalTransmitResult:{$e:{ok:0,version_err:1}},EnumSignalTransparentMsgType:{$e:{SignalTransparentMsgTypeSDK:0,SignalTransparentMsgTypeServer:1,SignalTransparentMsgTypeBoth:2}},GatherInfo:{$m:{1:["gather_id","string",""]}},GetCapabilityReq:{$m:{}},GetCapabilityRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["capability_seq","int64",{low:0,high:0,unsigned:!1}],3:["capabilities","liveroom.liveroom_cs_v3.Capabilities",null]}},GetGatherListReq:{$m:{}},GetGatherListRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["gather_list_seq","uint32",0],3:["gather_info_list","<liveroom.liveroom_cs_v3.GatherInfo",null]}},GetImReq:{$m:{1:["msg_id","uint64",{low:0,high:0,unsigned:!0}],2:["sort_type","uint32",0],3:["msg_count","uint32",0]}},GetImRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["server_msg_id","uint64",{low:0,high:0,unsigned:!0}],3:["ret_msg_id","uint64",{low:0,high:0,unsigned:!0}],4:["msg_list","<liveroom.liveroom_cs_v3.GetImRspImData",null]}},GetImRspImData:{$m:{1:["id_name","bytes",[]],2:["nick_name","bytes",[]],3:["role","uint32",0],4:["msg_id","uint64",{low:0,high:0,unsigned:!0}],5:["msg_category","uint32",0],6:["msg_type","uint32",0],7:["msg_content","bytes",[]],8:["send_time","int64",{low:0,high:0,unsigned:!1}]}},GetStreamListReq:{$m:{}},GetStreamListRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["stream_list_seq","uint32",0],3:["stream_info_list","<liveroom.liveroom_cs_v3.StreamInfo",null],4:["stream_refresh","uint32",0]}},GetTransReq:{$m:{1:["trans_channel","bytes",[]],2:["trans_list","<liveroom.liveroom_cs_v3.GetTransReqTransData",null]}},GetTransReqTransData:{$m:{1:["trans_type","bytes",[]],2:["trans_local_seq","uint32",0]}},GetTransRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["trans_channel","bytes",[]],3:["trans_list_seq","uint32",0],4:["trans_list","<liveroom.liveroom_cs_v3.GetTransRspTransData",null]}},GetTransRspTransData:{$m:{1:["err_code","uint32",0],2:["trans_type","bytes",[]],3:["trans_data","bytes",[]],4:["trans_send_time","int64",{low:0,high:0,unsigned:!1}],5:["trans_seq","uint32",0],6:["id_name","bytes",[]],7:["nick_name","bytes",[]],8:["role","uint32",0]}},GetUserlistReq:{$m:{1:["sort_type","uint32",0],2:["user_index","uint32",0]}},GetUserlistRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["server_user_seq","uint64",{low:0,high:0,unsigned:!0}],3:["server_user_index","int64",{low:0,high:0,unsigned:!1}],4:["ret_user_index","int64",{low:0,high:0,unsigned:!1}],5:["user_base_info_list","<liveroom.liveroom_cs_v3.UserBaseInfo",null]}},GetUserTransReq:{$m:{1:["trans_channel","bytes",[]],2:["user_trans_list","<liveroom.liveroom_cs_v3.GetUserTransReqTransData",null]}},GetUserTransReqTransData:{$m:{1:["trans_type","bytes",[]],2:["trans_local_seq","uint32",0]}},GetUserTransRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["trans_channel","bytes",[]],3:["user_trans_list","<liveroom.liveroom_cs_v3.GetUserTransRspTransData",null]}},GetUserTransRspTransData:{$m:{1:["err_code","uint32",0],2:["trans_type","bytes",[]],3:["trans_data","bytes",[]],4:["trans_send_time","int64",{low:0,high:0,unsigned:!1}],5:["trans_seq","uint32",0],6:["id_name","bytes",[]],7:["nick_name","bytes",[]],8:["role","uint32",0]}},HbReq:{$m:{}},HbRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["ret_timestamp","int64",{low:0,high:0,unsigned:!1}],3:["hb_interval","uint32",0],4:["hb_timeout","uint32",0],5:["stream_seq","uint32",0],6:["user_seq","int64",{low:0,high:0,unsigned:!1}],7:["online_count","uint32",0],8:["big_im_time_window","uint32",0],9:["trans_channel_list","<liveroom.liveroom_cs_v3.TransChannel",null],10:["user_trans_channel_list","<liveroom.liveroom_cs_v3.TransChannel",null],11:["stream_refresh","uint32",0],12:["trans_list_seq","uint32",0],13:["gather_list_seq","uint32",0],14:["capability_seq","int64",{low:0,high:0,unsigned:!1}]}},ImData:{$m:{1:["id_name","bytes",[]],2:["nick_name","bytes",[]],3:["role","uint32",0],4:["msg_id","uint64",{low:0,high:0,unsigned:!0}],5:["msg_category","uint32",0],6:["msg_type","uint32",0],7:["msg_content","bytes",[]],8:["send_time","int64",{low:0,high:0,unsigned:!1}]}},LiveroomSessionInfo:{$m:{1:["RoomId","bytes",[]],2:["UserSessionId","uint64",{low:0,high:0,unsigned:!0}],3:["RoomSessionId","uint64",{low:0,high:0,unsigned:!0}],4:["Role","uint32",0]}},PushBigIm:{$m:{1:["msg_list","<liveroom.liveroom_cs_v3.BigImData",null]}},PushCapabilityChange:{$m:{1:["capability_seq","int64",{low:0,high:0,unsigned:!1}],2:["capabilities","liveroom.liveroom_cs_v3.Capabilities",null]}},PushIm:{$m:{1:["server_msg_id","uint64",{low:0,high:0,unsigned:!0}],2:["ret_msg_id","uint64",{low:0,high:0,unsigned:!0}],4:["msg_list","<liveroom.liveroom_cs_v3.ImData",null]}},PushStartGather:{$m:{1:["gather_id","string",""],2:["gather_seq","uint32",0]}},PushStopGather:{$m:{1:["gather_id","string",""],2:["gather_seq","uint32",0]}},PushStream:{$m:{1:["stream_seq","uint32",0],2:["stream_info_list","<liveroom.liveroom_cs_v3.PushStreamInfo",null]}},PushStreamInfo:{$m:{1:["stream_id","bytes",[]],2:["stream_sid","string",""],3:["id_name","bytes",[]],4:["nick_name","bytes",[]],5:["stream_title","bytes",[]],6:["stream_ver","uint32",0],7:["stream_attr","bytes",[]],8:["stream_src","uint32",0],9:["stream_state","uint32",0],10:["stream_type","uint32",0],11:["stream_nid","uint32",0],12:["extra_info","bytes",[]],13:["create_time","int64",{low:0,high:0,unsigned:!1}],14:["close_type","uint32",0],15:["need_gather","uint32",0],16:["sdk_custom_info","bytes",[]],17:["stream_attr_opts","liveroom.liveroom_cs_v3.StreamAttrOptions",null]}},PushTrans:{$m:{1:["id_name","bytes",[]],2:["nick_name","bytes",[]],3:["role","uint32",0],4:["trans_type","bytes",[]],5:["trans_data","bytes",[]],6:["trans_seq","uint32",0],7:["trans_send_time","int64",{low:0,high:0,unsigned:!1}],8:["trans_channel","bytes",[]],9:["trans_list_seq","uint32",0]}},PushTransparentMsg:{$m:{1:["msg_data","bytes",[]],2:["client_seq","uint64",{low:0,high:0,unsigned:!0}],3:["sender_idname","bytes",[]],4:["sender_nickname","bytes",[]]}},PushUserInfoUpdated:{$m:{1:["server_user_seq","int64",{low:0,high:0,unsigned:!1}],2:["user_action_list","<liveroom.liveroom_cs_v3.UserAction",null]}},PushUserKickout:{$m:{1:["id_name","bytes",[]],2:["user_session_id","uint64",{low:0,high:0,unsigned:!0}],3:["kickout_reason","int32",0],4:["custom_reason","bytes",[]]}},PushUserLogReport:{$m:{}},PushUserTokenExpire:{$m:{1:["token","string",""],2:["stop_stream_info","liveroom.liveroom_cs_v3.StopStream",null]}},PushUserTrans:{$m:{1:["id_name","bytes",[]],2:["nick_name","bytes",[]],3:["role","uint32",0],4:["trans_send_time","int64",{low:0,high:0,unsigned:!1}],5:["trans_channel","bytes",[]],6:["trans_seq_list","<liveroom.liveroom_cs_v3.PushUserTransInfo",null]}},PushUserTransInfo:{$m:{1:["trans_type","bytes",[]],2:["trans_data","bytes",[]],3:["trans_seq","uint32",0]}},QuitRoomReq:{$m:{}},QuitRoomRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null]}},RelateResult:{$m:{1:["service","string",""],2:["relate_result","uint32",0]}},RenewTokenReq:{$m:{1:["token","string",""]}},RenewTokenRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["token_remain_time","uint32",0],3:["stop_stream_id_list","<bytes",null]}},RspHead:{$m:{1:["code","uint32",0],2:["message","string",""]}},SendBigImReq:{$m:{1:["msg_list","<liveroom.liveroom_cs_v3.SendBigImReqMsgData",null]}},SendBigImReqMsgData:{$m:{1:["msg_category","uint32",0],2:["msg_type","uint32",0],3:["msg_content","bytes",[]],4:["msg_timestamp","int64",{low:0,high:0,unsigned:!1}],5:["msg_client_id","bytes",[]]}},SendBigImRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["big_im_time_window","uint32",0],3:["msg_list","<liveroom.liveroom_cs_v3.SendBigImRspMsgData",null]}},SendBigImRspMsgData:{$m:{1:["msg_id","bytes",[]],2:["msg_client_id","bytes",[]]}},SendImReq:{$m:{1:["msg_category","uint32",0],2:["msg_type","uint32",0],3:["msg_content","bytes",[]],4:["to_user_list","<liveroom.liveroom_cs_v3.ToUser",null]}},SendImRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["msg_id","uint64",{low:0,high:0,unsigned:!0}]}},SetTransReq:{$m:{1:["trans_type","bytes",[]],2:["trans_data","bytes",[]],3:["trans_local_seq","uint32",0],4:["trans_channel","bytes",[]]}},SetTransRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["trans_type","bytes",[]],3:["trans_seq","uint32",0],4:["trans_list_seq","uint32",0],5:["trans_channel","bytes",[]]}},SetUserAttrReq:{$m:{1:["use_data_channel","uint32",0],2:["is_modify_use_data_channel","bool",!1],3:["user_type","uint32",0],4:["is_modify_user_type","bool",!1]}},SetUserAttrRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null]}},SignalLiveCustomReq:{$m:{1:["push_message","bytes",[]],2:["to_user_list","<liveroom.liveroom_cs_v3.ToUser",null]}},SignalLiveCustomRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null]}},SignalLiveInviteReq:{$m:{1:["push_message","bytes",[]],2:["to_user_list","<liveroom.liveroom_cs_v3.ToUser",null]}},SignalLiveInviteRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null]}},SignalLiveRequestReq:{$m:{1:["push_message","bytes",[]],2:["to_user_list","<liveroom.liveroom_cs_v3.ToUser",null]}},SignalLiveRequestRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null]}},SignalLiveResultReq:{$m:{1:["push_message","bytes",[]],2:["to_user_list","<liveroom.liveroom_cs_v3.ToUser",null]}},SignalLiveResultRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null]}},SignalLiveStopReq:{$m:{1:["push_message","bytes",[]],2:["to_user_list","<liveroom.liveroom_cs_v3.ToUser",null]}},SignalLiveStopRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null]}},SignalTransmitReq:{$m:{1:["to_user_list","<bytes",null],2:["transmit_data","bytes",[]]}},SignalTransmitResult:{$m:{1:["to_user","bytes",[]],2:["result","liveroom.liveroom_cs_v3.EnumSignalTransmitResult",0]}},SignalTransmitRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["result","<liveroom.liveroom_cs_v3.SignalTransmitResult",null]}},SignalTransparentMsgReq:{$m:{1:["msg_type","liveroom.liveroom_cs_v3.EnumSignalTransparentMsgType",0],2:["msg_data","bytes",[]],3:["to_user_list","<bytes",null],4:["client_seq","uint64",{low:0,high:0,unsigned:!0}]}},SignalTransparentMsgRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null]}},StopStream:{$m:{1:["stream_id_list","<bytes",null]}},StreamAttrOptions:{$m:{1:["stream_resource","sint32",0],2:["stream_codec","sint32",0],3:["play_mode","uint32",0],4:["forbid_play_expire_time","int64",{low:0,high:0,unsigned:!1}]}},StreamInfo:{$m:{1:["stream_id","bytes",[]],2:["stream_sid","string",""],3:["id_name","bytes",[]],4:["nick_name","bytes",[]],5:["stream_title","bytes",[]],6:["stream_ver","uint32",0],7:["stream_attr","bytes",[]],8:["create_time","int64",{low:0,high:0,unsigned:!1}],9:["stream_src","uint32",0],10:["stream_state","uint32",0],11:["stream_type","uint32",0],12:["stream_nid","uint32",0],13:["extra_info","bytes",[]],14:["need_gather","uint32",0],15:["sdk_custom_info","bytes",[]],16:["stream_attr_opts","liveroom.liveroom_cs_v3.StreamAttrOptions",null]}},ToUser:{$m:{1:["id_name","bytes",[]],2:["user_id","uint64",{low:0,high:0,unsigned:!0}]}},TransChannel:{$m:{1:["trans_channel","bytes",[]],2:["trans_seq_list","<liveroom.liveroom_cs_v3.TransSeq",null]}},TransSeq:{$m:{1:["trans_type","bytes",[]],2:["trans_seq","uint32",0]}},UpdateStreamAttrReq:{$m:{1:["stream_id","bytes",[]],2:["client_req_seq","uint32",0],3:["update_flag","uint32",0],4:["sdk_custom_info","bytes",[]],5:["stream_attr_opts","liveroom.liveroom_cs_v3.StreamAttrOptions",null]}},UpdateStreamAttrRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["stream_seq","uint32",0]}},UpdateStreamReq:{$m:{1:["stream_sid","string",""],2:["stream_id","bytes",[]],3:["stream_title","bytes",[]],4:["stream_attr","bytes",[]],5:["extra_info","bytes",[]],6:["client_req_seq","uint32",0],7:["nick_name","bytes",[]]}},UpdateStreamRsp:{$m:{1:["rsp_head","liveroom.liveroom_cs_v3.RspHead",null],2:["stream_seq","uint32",0],3:["stream_ver","uint32",0]}},UserAction:{$m:{1:["action","uint32",0],2:["id_name","bytes",[]],3:["nick_name","bytes",[]],4:["role","uint32",0],5:["login_time","int64",{low:0,high:0,unsigned:!1}]}},UserBaseInfo:{$m:{1:["id_name","bytes",[]],2:["nick_name","bytes",[]],3:["role","uint32",0]}}},proto_switch_v3:{AnchorInfo:{$m:{1:["id_name","bytes",[]],2:["user_id","uint64",{low:0,high:0,unsigned:!0}],3:["nick_name","bytes",[]]}},Capabilities:{$m:{1:["video_codec","uint32",0],2:["gop_mode","uint32",0]}},CommonRsp:{$m:{1:["rsp_head","liveroom.proto_switch_v3.RspHead",null]}},GatherInfo:{$m:{1:["gather_id","string",""]}},Header:{$m:{1:["cmd","uint32",0],2:["seq","uint32",0],3:["timestamp","int64",{low:0,high:0,unsigned:!1}],4:["controls","bytes",[]],5:["flags","bytes",[]],6:["context_key","uint32",0],101:["dev_traffic_label","bytes",[]]}},LiveroomProtoVersion:{$e:{PROTO_VERSION_NONE:0,RPOTO_V020000:131072}},LoginRoomReq:{$m:{1:["app_id","uint32",0],2:["biz_type","uint32",0],3:["room_id","bytes",[]],4:["room_name","bytes",[]],5:["role","uint32",0],6:["id_name","bytes",[]],7:["nick_name","bytes",[]],8:["device_id","string",""],9:["term_type","liveroom.proto_switch_v3.TermType",0],10:["net_type","liveroom.proto_switch_v3.NetType",0],11:["sdk_conn_type","liveroom.proto_switch_v3.SdkConnType",0],12:["sdk_version","uint32",0],13:["biz_version","string",""],14:["client_stamp","bytes",[]],15:["login_logic","uint32",0],16:["third_token","bytes",[]],17:["login_token","bytes",[]],18:["relogin_token","bytes",[]],19:["switch_session_id","uint64",{low:0,high:0,unsigned:!0}],20:["user_session_id","uint64",{low:0,high:0,unsigned:!0}],21:["room_create_flag","uint32",0],22:["user_state_flag","uint32",0],23:["user_count_limit","uint32",0],24:["relate_service","string",""],25:["need_gather_stream","uint32",0],26:["callback_data","bytes",[]],27:["service_flags","uint32",0],28:["license_token","bytes",[]],29:["relogin_type","liveroom.proto_switch_v3.ReloginType",0],30:["Capabilities","liveroom.proto_switch_v3.Capabilities",null]}},LoginRoomRsp:{$m:{1:["rsp_head","liveroom.proto_switch_v3.RspHead",null],2:["switch_session_id","uint64",{low:0,high:0,unsigned:!0}],3:["user_session_id","uint64",{low:0,high:0,unsigned:!0}],4:["room_session_id","uint64",{low:0,high:0,unsigned:!0}],5:["user_id","uint64",{low:0,high:0,unsigned:!0}],6:["ret_timestamp","int64",{low:0,high:0,unsigned:!1}],7:["big_im_time_window","uint32",0],8:["liveroom_hb_interval","uint32",0],9:["liveroom_hb_timeout","uint32",0],10:["online_count","uint32",0],11:["anchor_info","liveroom.proto_switch_v3.AnchorInfo",null],12:["relogin_token","bytes",[]],13:["userlist_merge_timeout","uint32",0],14:["userlist_interval","uint32",0],15:["token_remain_time","uint32",0],16:["trans_list_seq","uint32",0],17:["trans_channel_list","<liveroom.proto_switch_v3.TransChannel",null],18:["stream_count","uint32",0],19:["stream_list_seq","uint32",0],20:["stream_info_list","<liveroom.proto_switch_v3.StreamInfo",null],21:["stream_fetch_flag","uint32",0],22:["stream_list_push_merge_timeout","uint32",0],23:["stream_list_hb_merge_timeout","uint32",0],24:["relate_result_list","<liveroom.proto_switch_v3.RelateResult",null],25:["gather_list_seq","uint32",0],26:["gather_info_list","<liveroom.proto_switch_v3.GatherInfo",null]}},LogoutRoomReq:{$m:{2:["logout_check","bytes",[]]}},LogoutRoomRsp:{$m:{1:["rsp_head","liveroom.proto_switch_v3.RspHead",null]}},MergePushHead:{$m:{1:["qos_flag","uint32",0],2:["send_time","int64",{low:0,high:0,unsigned:!1}]}},MergePushInfo:{$m:{1:["sub_cmd","uint32",0],2:["sub_seq","uint32",0],3:["msg_body","bytes",[]]}},MergePushReq:{$m:{1:["head","liveroom.proto_switch_v3.MergePushHead",null],2:["message_list","<liveroom.proto_switch_v3.MergePushInfo",null]}},MergePushRsp:{$m:{1:["message_list","<liveroom.proto_switch_v3.MergePushRspInfo",null],2:["server_send_time","int64",{low:0,high:0,unsigned:!1}]}},MergePushRspInfo:{$m:{1:["sub_cmd","uint32",0],2:["sub_seq","uint32",0]}},NetType:{$e:{NT_NONE:0,NT_LINE:1,NT_WIFI:2,NT_2G:3,NT_3G:4,NT_4G:5,NT_UNKNOWN:32}},PushKickout:{$m:{1:["reason","uint32",0],2:["message","string",""],3:["is_need_relogin","uint32",0]}},PushReq:{$m:{1:["head","liveroom.proto_switch_v3.PushReqHead",null],2:["msg_body","bytes",[]]}},PushReqHead:{$m:{1:["sub_cmd","uint32",0],2:["qos_flag","uint32",0],3:["send_time","int64",{low:0,high:0,unsigned:!1}]}},PushRsp:{$m:{1:["code","uint32",0],2:["message","string",""],3:["sub_cmd","uint32",0],4:["server_send_time","int64",{low:0,high:0,unsigned:!1}]}},RelateResult:{$m:{1:["service","string",""],2:["relate_result","uint32",0]}},ReloginType:{$e:{ReloginType_None:0,ReloginType_SdkAuto:1}},RspHead:{$m:{1:["code","uint32",0],2:["message","string",""]}},SdkConnType:{$e:{SdkConnType_None:0,SdkConnType_Tcp:1,SdkConnType_Websocket:2}},StreamAttrOptions:{$m:{1:["stream_resource","sint32",0],2:["stream_codec","sint32",0],3:["play_mode","uint32",0],4:["forbid_play_expire_time","int64",{low:0,high:0,unsigned:!1}]}},StreamInfo:{$m:{1:["stream_id","bytes",[]],2:["stream_sid","string",""],3:["id_name","bytes",[]],4:["nick_name","bytes",[]],5:["create_time","int64",{low:0,high:0,unsigned:!1}],6:["extra_info","bytes",[]],7:["title","bytes",[]],8:["stream_ver","uint32",0],9:["stream_attr","bytes",[]],10:["stream_src","uint32",0],11:["stream_state","uint32",0],12:["stream_type","uint32",0],13:["stream_nid","uint32",0],14:["need_gather","uint32",0],15:["sdk_custom_info","bytes",[]],16:["stream_attr_opts","liveroom.proto_switch_v3.StreamAttrOptions",null]}},TermType:{$e:{TT_NONE:0,TT_PC:1,TT_IOS:2,TT_ANDROID:3,TT_MAC:4,TT_LINUX:5,TT_WEB:6,TT_MINI_PROGRAM:7,TT_UNKNOWN:32}},TransChannel:{$m:{1:["trans_channel","bytes",[]],2:["trans_seq_list","<liveroom.proto_switch_v3.TransSeq",null]}},TransSeq:{$m:{1:["trans_type","bytes",[]],2:["trans_seq","uint32",0]}}},webproxy:{HTTPHeader:{$m:{1:["name","string",""],2:["val","string",""]}},HTTPRequest:{$m:{1:["appid","uint32",0],2:["biz_type","uint32",0],3:["mode","liveroom.webproxy.Mode",0],4:["id_name","string",""],5:["token","string",""],6:["url","string",""],7:["method","liveroom.webproxy.Method",0],8:["headers","<liveroom.webproxy.HTTPHeader",null],9:["body","bytes",[]]}},HTTPResponse:{$m:{1:["code","int32",0],2:["message","string",""],3:["data","liveroom.webproxy.HTTPResponseData",null]}},HTTPResponseData:{$m:{1:["status_code","int32",0],2:["headers","<liveroom.webproxy.HTTPHeader",null],3:["body","bytes",[]]}},IntranetCheckRequest:{$m:{1:["appid","uint32",0],2:["biz_type","uint32",0],3:["mode","liveroom.webproxy.Mode",0],4:["id_name","string",""],5:["token","string",""],6:["vrs_ipv4","fixed32",0],7:["vrs_ipv6","liveroom.webproxy.IPv6Addr",null]}},IntranetCheckResponse:{$m:{1:["code","int32",0],2:["message","string",""],3:["data","liveroom.webproxy.IntranetCheckResponseData",null]}},IntranetCheckResponseData:{$m:{1:["intranet","bool",!1]}},IPv6Addr:{$m:{1:["high","fixed64",{low:0,high:0,unsigned:!1}],2:["low","fixed64",{low:0,high:0,unsigned:!1}]}},Method:{$e:{METHOD_UNSET:0,METHOD_GET:1,METHOD_POST:2,METHOD_PUT:3,METHOD_PATCH:4,METHOD_DELETE:5,METHOD_HEAD:6,METHOD_OPTIONS:7}},Mode:{$e:{MODE_UNSET:0,MODE_ONLINE:1,MODE_TEST:2}},TurnInfoRequest:{$m:{1:["appid","uint32",0],2:["biz_type","uint32",0],3:["mode","liveroom.webproxy.Mode",0],4:["id_name","string",""],5:["token","string",""]}},TurnInfoResponse:{$m:{1:["code","int32",0],2:["message","string",""],3:["data","liveroom.webproxy.TurnInfoResponseData",null]}},TurnInfoResponseData:{$m:{1:["username","string",""],2:["password","string",""],3:["turn_ipv4","fixed32",0],4:["turn_ipv6","liveroom.webproxy.IPv6Addr",null],5:["turn_port","uint32",0],6:["expiration_in_seconds","uint32",0],7:["turn_internal_ipv4","fixed32",0]}},WssBindRequest:{$m:{1:["appid","uint32",0],2:["biz_type","uint32",0],3:["mode","liveroom.webproxy.Mode",0],4:["id_name","string",""],5:["token","string",""],6:["url","string",""],7:["ack","bool",!1]}},WssBindRequestAck:{$m:{}},WssBindResponse:{$m:{1:["code","int32",0],2:["message","string",""]}}}}},"",Ci,!1);var Di,Ni=Ci.liveroom,Oi={1002:"LoginRoomRsp",1004:"LogoutRoomRsp",1101:"PushReq",1103:"MergePushReq",1105:"PushKickout",10001:"PushUserInfoUpdated",10002:"PushUserKickout",10003:"PushUserLogReport",10004:"PushUserTokenExpire",12001:"PushStream",12002:"PushStream",12003:"PushStream",13001:"PushIm",14001:"PushBigIm",15001:"PushTrans",15002:"PushUserTrans",301002:"EnterRoomRsp",301004:"QuitRoomRsp",301006:"HbRsp",301008:"RenewTokenRsp",301012:"SetTransRsp",301014:"GetTransRsp",302002:"AddStreamRsp",302004:"DeleteStreamRsp",302006:"UpdateStreamRsp",302008:"GetStreamListRsp",303002:"SendImRsp",303006:"SendBigImRsp",303010:"SignalLiveRequestRsp",303012:"SignalLiveResultRsp",303014:"SignalLiveInviteRsp",303016:"SignalLiveStopRsp",303018:"SignalLiveCustomRsp",304002:"GetUserlistRsp"},Mi=((t=Di=Di||{})[t.LoginRoomReq=1001]="LoginRoomReq",t[t.LoginRoomRsp=1002]="LoginRoomRsp",t[t.LogoutRoomReq=1003]="LogoutRoomReq",t[t.LogoutRoomRsp=1004]="LogoutRoomRsp",t[t.PushReq=1101]="PushReq",t[t.PushRsp=1102]="PushRsp",t[t.MergePushReq=1103]="MergePushReq",t[t.MergePushRsp=1104]="MergePushRsp",t[t.PushKickout=1105]="PushKickout",t[t.PushUserInfoUpdated=10001]="PushUserInfoUpdated",t[t.PushUserKickout=10002]="PushUserKickout",t[t.PushUserLogReport=10003]="PushUserLogReport",t[t.PushUserTokenExpire=10004]="PushUserTokenExpire",t[t.PushIm=13001]="PushIm",t[t.PushBigIm=14001]="PushBigIm",t[t.PushTrans=15001]="PushTrans",t[t.PushUserTrans=15002]="PushUserTrans",t[t.EnterRoomReq=301001]="EnterRoomReq",t[t.EnterRoomRsp=301002]="EnterRoomRsp",t[t.QuitRoomReq=301003]="QuitRoomReq",t[t.QuitRoomRsp=301004]="QuitRoomRsp",t[t.HbReq=301005]="HbReq",t[t.HbRsp=301006]="HbRsp",t[t.RenewTokenReq=301007]="RenewTokenReq",t[t.RenewTokenRsp=301008]="RenewTokenRsp",t[t.SetUserAttrReq=301009]="SetUserAttrReq",t[t.SetUserAttrRsp=301010]="SetUserAttrRsp",t[t.SetTransReq=301011]="SetTransReq",t[t.SetTransRsp=301012]="SetTransRsp",t[t.GetTransReq=301013]="GetTransReq",t[t.GetTransRsp=301014]="GetTransRsp",t[t.GetUserTransReq=301015]="GetUserTransReq",t[t.GetUserTransRsp=301016]="GetUserTransRsp",t[t.AddStreamReq=302001]="AddStreamReq",t[t.AddStreamRsp=302002]="AddStreamRsp",t[t.DeleteStreamReq=302003]="DeleteStreamReq",t[t.DeleteStreamRsp=302004]="DeleteStreamRsp",t[t.UpdateStreamReq=302005]="UpdateStreamReq",t[t.UpdateStreamRsp=302006]="UpdateStreamRsp",t[t.GetStreamListReq=302007]="GetStreamListReq",t[t.GetStreamListRsp=302008]="GetStreamListRsp",t[t.SendImReq=303001]="SendImReq",t[t.SendImRsp=303002]="SendImRsp",t[t.GetImReq=303003]="GetImReq",t[t.GetImRsp=303004]="GetImRsp",t[t.SendBigImReq=303005]="SendBigImReq",t[t.SendBigImRsp=303006]="SendBigImRsp",t[t.SignalLiveRequestReq=303009]="SignalLiveRequestReq",t[t.SignalLiveRequestRsp=303010]="SignalLiveRequestRsp",t[t.SignalLiveResultReq=303011]="SignalLiveResultReq",t[t.SignalLiveResultRsp=303012]="SignalLiveResultRsp",t[t.SignalLiveInviteReq=303013]="SignalLiveInviteReq",t[t.SignalLiveInviteRsp=303014]="SignalLiveInviteRsp",t[t.SignalLiveStopReq=303015]="SignalLiveStopReq",t[t.SignalLiveStopRsp=303016]="SignalLiveStopRsp",t[t.SignalLiveCustomReq=303017]="SignalLiveCustomReq",t[t.SignalLiveCustomRsp=303018]="SignalLiveCustomRsp",t[t.SignalTransmitReq=303019]="SignalTransmitReq",t[t.SignalTransmitRsp=303020]="SignalTransmitRsp",t[t.GetUserlistReq=304001]="GetUserlistReq",t[t.GetUserlistRsp=304002]="GetUserlistRsp",t=i(3),i(13)),Li=i.n(Mi),xi=(Mi=i(5),i.n(Mi)),Ui=(Bi.prototype.md5Bytes=function(e){return this.wordArray2Uint8Array(xi()(this.uint8Array2WordArray(e)))},Bi.prototype.wordArray2Uint8Array=function(e){for(var t=e.words,i=e.sigBytes,r=new Uint8Array(i),n=0;n<i;n++)r[n]=t[n>>>2]>>>24-n%4*8&255;return r},Bi.prototype.uint8Array2WordArray=function(e){for(var t=e.length,i=[],r=0;r<t;r++)i[r>>>2]|=(255&e[r])<<24-r%4*8;return Li.a.create(i,t)},Bi);function Bi(){}Mi=i(1);var zi=i.n(Mi);function qi(){return navigator.userAgent||""}function Xi(){return null!==navigator.platform.match("iPhone")}function Hi(){return null!==navigator.platform.match("Mac")}function Fi(){return null!==qi().match("Android")}function Vi(){return null!==qi().match("Android")}function Gi(){return null!==navigator.platform.match("Win32")&&null===qi().match("WOW64")}function ji(){return null!==navigator.platform.match("Linux")}function Qi(){return Xi()?l.IOS:Fi()?l.ANDROID:Hi()?l.MAC:Gi()?l.WIN32:l.UNKNOWN}function Wi(){var e=u.NT_UNKNOWN,t="",i=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return-1<(t=((null==i?void 0:i.effectiveType)||(null==i?void 0:i.type)||"unknown").toUpperCase()).indexOf("4G")?e=u.NT_4G:-1<t.indexOf("2G")?e=u.NT_2G:-1<t.indexOf("3G")?e=u.NT_3G:-1<t.indexOf("WIFI")?e=u.NT_WIFI:-1<t.indexOf("LINE")?e=u.NT_LINE:-1<t.indexOf("NONE")&&(e=u.NT_NONE),e}var Zi,Ki=function(){return(Ki=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Ji=(t.util.Long=zi.a,t.configure(),Ni),Yi=Ni.liveroom_cs_v3,$i=Ni.proto_switch_v3,er=((Mi=Zi=Zi||{})[Mi.disconnected=0]="disconnected",Mi[Mi.broken=1]="broken",Mi[Mi.connected=2]="connected",Object.defineProperty(tr.prototype,"nickName",{get:function(){return ai(this.Qt.nickName)},enumerable:!1,configurable:!0}),Object.defineProperty(tr.prototype,"TermType",{get:function(){return this.Qt.ENV%2==0?o.TT_WEB:o.TT_MINIPROGRAM},enumerable:!1,configurable:!0}),Object.defineProperty(tr.prototype,"ti",{get:function(){return this.Qt.reporter},enumerable:!1,configurable:!0}),tr.prototype.isDisConnect=function(){return this._state!==Zi.connected},tr.prototype.getHeader=function(e,t){return e={cmd:e,seq:++this.seq,timestamp:(new Date).getTime()},this.controls&&(e.controls=this.controls),null!=t&&t.contextKey&&(e.context_key=null==t?void 0:t.contextKey),t=$i.Header.create(e),t=$i.Header.encode(t).finish(),[e.seq,t]},Object.defineProperty(tr.prototype,"isUaConnect",{get:function(){return this._ua.isConnect()},enumerable:!1,configurable:!0}),tr.prototype.sendMessage=function(e,t,i,r,n,o,s){var a=this;if(void 0===o&&(o={timeout:6e3}),void 0===s&&(s=!0),this.Zt.info(Qe+" call"),"LoginRoomReq"!==e&&this._state!==Zi.connected)return this.Zt.warn(Qe+" state "+this._state),r&&r(P.SOCKET_CLOSE),-1;if(Object(z.d)(e))l=e;else if(l=Di[e],Object(z.g)(l))return this.Zt.warn(Qe+" cmd not found "+e),-1;var c=0,u=Object(z.g)(null==n?void 0:n.roomID)?null==(u=this.Qt.roomModulesList[0])?void 0:u.roomID:null==n?void 0:n.roomID,l=("LoginRoomReq"!==e&&u&&(c=this._roomIDKeys[u]),u=this.getHeader(l,{contextKey:c}))[1];return t=this.getHead(l.length,(c=t).length),t=new Uint8Array(Array.from(t).concat(Array.from(l)).concat(Array.from(c))),s&&(l={seq:this.seq,deleted:!1,sendTime:Date.parse(new Date+""),timeout:o.timeout,success:i,error:function(e,t,i){a.Zt.info(Qe+" seq: "+t+" "+JSON.stringify(e)+" "+JSON.stringify(i));var n=null==e?void 0:e.body,o=null==n?void 0:n.err_code,s=null==(s=null==e?void 0:e.header)?void 0:s.cmd,c=null==i?void 0:i.roomID;if(s!==Di.LoginRoomRsp){if(i=a.Qt.roomModulesList.find((function(e){return e.roomID==c})),-1<[1002,105].indexOf(o))return s===Di.EnterRoomRsp&&i?i?void i.retryRoom(!1,!0):void a.Zt.error(Qe+" room no found ignore "):void a.rtm.retryRoom(!1,void 0,!0);if([141].includes(o)&&i)return void i.roomHandler.logoutByError({code:o,msg:null==n?void 0:n.err_message})}r&&r(e,t)},params:n},c=this.sendCommandList.push(l),this.sendCommandMap[l.seq]=c),this.Zt.info(Qe+" seq: "+u[0]+" cmd: "+e),null!=(s=this.liveroomRequest)&&s.sendRequest({payload:t,ack:"LoginRoomReq"===e},(function(e){a.Zt.info(Qe+" fail")}),(function(){a.Zt.info(Qe+" ack")}),{}),u[0]},tr.prototype.getHead=function(e,t){var i=new Uint8Array(7);return i[0]=49,i[1]=e>>8,i[2]=e-(i[1]<<8),i.set(new Uint8Array(Int32Array.from([t]).buffer).reverse(),3),i},tr.prototype.handlePush=function(e,t){var i,r,n;49===e[0]&&(i=$i.Header.decode(e.slice(7,7+(n=(e[1]<<8)+e[2]))),e=e.slice(7+n),Oi[i.cmd]?(n=this.decodeResponseBody(i,e),this.swPushCmdList.includes(i.cmd)?this.handleSwitchPush(i,n):(this.Zt.info("zm.lrh.hp down "+(r=Oi[i.cmd]||i.cmd)+" "+JSON.stringify(this.transBuf(n))),r={header:this.transHeader(i),body:this.transRsp(n)},n=this._roomKeyIDs[i.context_key],Object(z.g)(n)||(r.header.room_id=n),this.handleSendCommandMsgRsp(r))):(this.Zt.info("zm.lrh.hp cmd is not rtc"),this.onSwitchMessage(i,e)))},tr.prototype.handleSwitchPush=function(e,t){var i,r,n=this._roomKeyIDs[e.context_key];if(n||this.noContextKeyCmdList.includes(e.cmd))if(e.cmd===Di.PushReq)if((r=this.transRsp(t.head)).room_id=n,this.Qt.roomModulesList.find((function(e){return e.roomID==n}))){var o,s,a={header:r,body:this.unStructCmdList.includes(t.head.sub_cmd)?{signal_msg:si(t.msg_body),sub_cmd:t.head.sub_cmd}:11005===t.head.sub_cmd?{custommsg:si(t.msg_body)}:Oi[t.head.sub_cmd]?this.transRsp(this._decode(Yi[Oi[t.head.sub_cmd]],t.msg_body)):{}};if(this.Zt.info(We+" push "+JSON.stringify(this.transBuf(a))),this.rtcPushCmdList.includes(t.head.sub_cmd))switch(t.head.sub_cmd){case Di.PushUserInfoUpdated:this.handlePushUserStateUpdateMsg(a);break;case Di.PushUserKickout:this.transKeysName(a.body,this.loginKeyTransMap),this.handlePushKickout(a,!1);break;case Di.PushTrans:this.handlePushTransMsg(a);break;case Di.PushIm:this.handlePushRoomMsg(a);break;case 11005:this.handlePushCustomMsg(a);break;case 12001:case 12002:case 12003:this.handlePushStreamMsg(a);break;case 11001:case 11002:case 11003:case 11004:this.handlePushSignalMsg(a);break;case Di.PushUserTokenExpire:this.handlePushTokenExpire(a)}else this.Zt.info(We+" white "),this.onSwitchMessage(e,t);1==t.head.qos_flag&&(o=$i.PushRsp.create({code:0,message:"",sub_cmd:t.head.sub_cmd,server_send_time:t.head.send_time}),s=$i.PushRsp.encode(o).finish(),this.sendMessage("PushRsp",s,void 0,void 0))}else this.Zt.warn(We+" room no found ignore ");else e.cmd===Di.MergePushReq?((r=this.transRsp(t.head)).room_id=n,this.Qt.roomModulesList.find((function(e){return e.roomID==n}))?(i=[],t.message_list.forEach((function(e){var t;i.push({sub_cmd:e.sub_cmd,sub_seq:e.sub_seq}),e.sub_cmd===Di.PushBigIm&&(t=Yi.PushBigIm.decode(e.msg_body),e.msg_body=t)})),delete(r={header:r,body:this.transRsp(t)}).body.head,this.handlePushMergeMsg(r),1==t.head.qos_flag&&(o=$i.MergePushRsp.create({messages:i,server_send_time:t.head.send_time}),s=$i.MergePushRsp.encode(o).finish(),this.sendMessage("MergePushRsp",s,void 0,void 0))):this.Zt.warn(We+" room no found ignore ")):e.cmd===Di.PushKickout&&this.handlePushKickout({header:e,body:{reason:900<t.reason?t.reason-900:t.reason,msg:t.message,need_relogin:void 0!==t.is_need_relogin?t.is_need_relogin:0}},!0);else this.Zt.warn(We+" ctx key not found")},tr.prototype.handlePushTokenExpire=function(e){},tr.prototype.handlePushKickout=function(e,t){},tr.prototype.handlePushStreamMsg=function(e){},tr.prototype.handlePushSignalMsg=function(e){},tr.prototype.handlePushMergeMsg=function(e){},tr.prototype.handlePushCustomMsg=function(e){},tr.prototype.handlePushRoomMsg=function(e){},tr.prototype.handlePushTransMsg=function(e){},tr.prototype.onSwitchMessage=function(e,t){},tr.prototype.decodeResponseBody=function(e,t){var i=this.onSwitchCmdList.includes(e.cmd)?"proto_switch_v3":"liveroom_cs_v3";return this._decode(this._protoInstance[i][Oi[e.cmd]],t)},tr.prototype.handlePushUserStateUpdateMsg=function(e){},tr.prototype.login=function(e,t,i){var r,n,o,s=this,a=(this._state==Zi.disconnected&&(this.Zt.info(Ze+" state disconnect"),this.closeRequest()),(new Date).getTime()+""),c={user_session_id:null!=(c=e.longSid)?c:zi.a.fromInt(0),net_type:Wi(),room_id:ai(e.roomID),room_name:ai(e.roomName),nick_name:this.nickName,role:this.Qt.role,third_token:ai(e.token),room_create_flag:this.Qt.roomCreateFlag,user_state_flag:e.userStateUpdate?1:0,user_count_limit:e.maxMemberCount,relate_service:this.Qt.relateService.join()||""};e.isMulti?(n=Ki(Ki({},c),{conn_type:2}),delete(r=Ki(Ki({},n),{room_id:e.roomID,room_name:e.roomName})).third_token,this.Zt.info(Ze+" enter "+JSON.stringify(r)),n=Yi.EnterRoomReq.create(n),o=Yi.EnterRoomReq.encode(n).finish(),this.sendMessage("EnterRoomReq",o,(function(i,r){s._transLoginRspKeys(i,e),t&&t(i,r)}),(function(e,t){i&&i(e,t)}),{roomID:e.roomID})):(c=Ki(Ki({},c),{app_id:this.Qt.appid,id_name:ai(this.Qt.idName),device_id:this.Qt.deviceID,term_type:this.TermType,sdk_version:this._getNumSDKVersion(),client_stamp:ai(a),relogin_token:this.switchSessionID.notEquals(zi.a.fromInt(0))?ai(this.reloginToken):"",switch_session_id:this.switchSessionID,user_session_id:null!=(c=e.longSid)?c:zi.a.fromInt(0),biz_type:0,biz_version:this.Qt.bizVersion||"",login_logic:this.Qt.isMultiRoom?3:1,sdk_conn_type:2}),e.roomReasonState===C.Reconnecting&&(c.relogin_type=1),delete(r=Ki(Ki({},c),{id_name:this.Qt.idName,nick_name:this.Qt.nickName,client_stamp:a,k1_sign:void 0,relogin_token:this.reloginToken,room_id:e.roomID,room_name:e.roomName,user_session_id:e.longSid})).third_token,this.logoutCheckToken=e.token,this.Zt.info(Ze+" login "+JSON.stringify(r)),this.Zt.remoteReport(Ze+" token "+e.token),n=$i.LoginRoomReq.create(c),o=$i.LoginRoomReq.encode(n).finish(),this.sendMessage("LoginRoomReq",o,(function(i,r){var n;s.Zt.info(Ze+" login rsp"),s.switchSessionID=i.body.switch_session_id,s.reloginToken=i.body.relogin_token,null!=(n=null==i?void 0:i.header)&&n.controls&&(s.controls=null==(n=null==i?void 0:i.header)?void 0:n.controls),s._transLoginRspKeys(i,e),t&&t(i,r)}),(function(e,t){i&&i(e,t)})))},tr.prototype._transLoginRspKeys=function(e,t){null!=(i=e.header)&&i.context_key&&(this._roomIDKeys[t.roomID]=null==(i=e.header)?void 0:i.context_key,this._roomKeyIDs[null==(i=e.header)?void 0:i.context_key]=t.roomID,e.header.room_id=t.roomID),this.longToStringNumber(e.body,["ret_timestamp"],"toString"),this.transKeysName(e.body,this.loginKeyTransMap),this.keysExist(e.body,["token_remain_time","stream_seq"]);var i={anchor_id_name:e.body.anchor_info.id_name,anchor_id:e.body.anchor_info.user_id,anchor_nick_name:e.body.anchor_info.nick_name};e.body.anchor_info=i},tr.prototype.transKeysName=function(e,t){t.forEach((function(t){Object(z.g)(e[t[0]])||(e[t[1]]=e[t[0]],delete e[t[0]])}))},tr.prototype.keysExist=function(e,t){t.forEach((function(t){void 0===e[t]&&(e[t]=0)}))},tr.prototype.longToStringNumber=function(e,t,i){t.forEach((function(t){zi.a.isLong(e[t])&&(e[t]=e[t][i]())}))},tr.prototype.logout=function(e,t,i){var r,n,o,s;return e.isMulti?(r={},this.Zt.info(Je+" quit "+e.roomID),o=Yi.QuitRoomReq.create(r),s=Yi.QuitRoomReq.encode(o).finish(),this.sendMessage("QuitRoomReq",s,t,i,{roomID:null==e?void 0:e.roomID})):(r={logout_code:0,logout_check:this.crypto.md5Bytes(ai(this.logoutCheckToken)),user_session_id:e.longSid,logout_logic:this.Qt.isMultiRoom?3:1},n=this.transBuf(r),this.Zt.info(Je+" logout "+JSON.stringify(n)),o=$i.LogoutRoomReq.create(r),s=$i.LogoutRoomReq.encode(o).finish(),this.sendMessage("LogoutRoomReq",s,t,i,{roomID:null==e?void 0:e.roomID}))},tr.prototype._checkSendMessageList=function(e){for(var t=e.getFirst();null!=t;)e.remove(t),t._data&&t._data.error&&setTimeout((function(){t&&t._data&&t._data.error&&t._data.error(P.TIMEOUT,t._data.seq)}),0),t=e.getFirst()},tr.prototype._checkMessageListTimeout=function(e,t){for(var i=e.getFirst(),r=Date.parse(new Date+""),n=0,o=this;null!=i&&"break"!==function(){var s,a;return i._data&&i._data.sendTime+i._data.timeout>r||(i._data&&delete t[i._data.seq],e.remove(i),i._data&&null==i._data.error||i._data&&i._data.sendTime+o._sendDataDropTimeout<r||(s=i&&i._data&&i._data.error,a=i&&i._data&&i._data.seq,setTimeout((function(){s&&s(P.TIMEOUT,a)}),0)),++n>=o._sendDataCheckOnceCount)?"break":void(i=e.getFirst())}(););},tr.prototype.startCheck=function(){var e=this;this._checkMessageListTimeout(this.sendCommandList,this.sendCommandMap),this._sendDataCheckTimer=setTimeout((function(){e.startCheck()}),this._sendDataCheckInterval)},tr.prototype.stopCheck=function(){this._checkSendMessageList(this.sendCommandList),clearTimeout(this._sendDataCheckTimer)},tr.prototype.handleSendCommandMsgRsp=function(e){var t,i,r=this.sendCommandMap[e.header.seq];null!=r&&(i=null==(t=r._data)?void 0:t.params,delete this.sendCommandMap[e.header.seq],this.sendCommandList.remove(r),0===e.body.err_code?setTimeout((function(){t&&null!=t.success&&t.success(e,e.header.seq)}),0):setTimeout((function(){t&&null!=t.error&&t.error(e,e.header.seq,i)}),0))},tr.prototype.getReqHead=function(e){return{}},tr.prototype.heartBeat=function(e,t,i){var r=this,n=Yi.HbReq.create({});n=Yi.HbReq.encode(n).finish(),this.sendMessage("HbReq",n,(function(t,i){r.transKeysName(t.body,[["hb_interval","hearbeat_interval"],["hb_timeout","hearbeat_timeout"],["big_im_time_window","bigim_time_window"],["trans_channel_list","trans_seqs"]]),t.body.server_user_seq=t.body.user_seq.toNumber(),r.longToStringNumber(t.body,["ret_timestamp"],"toNumber"),e&&e(t,i)}),t,{roomID:null==i?void 0:i.roomID})},tr.prototype.fetchUserList=function(e,t,i,r){var n=this,o=(e=Ki({},e),this.transBuf(e));return this.Zt.info(Ke+" "+JSON.stringify(o)),o=Yi.GetUserlistReq.create(e),e=Yi.GetUserlistReq.encode(o).finish(),this.sendMessage("GetUserlistReq",e,(function(e,i){n.Zt.info(Ke+" suc "+i),n.transKeysName(e.body,[["user_base_info_list","user_baseinfos"]]),n.longToStringNumber(e.body,["server_user_seq","server_user_index","ret_user_index"],"toNumber"),t&&t(e,i)}),i,{roomID:null==r?void 0:r.roomID})},tr.prototype.sendRoomMsg=function(e,t,i,r){var n=this,o=(e={msg_category:e.msg_category,msg_type:e.msg_type,msg_content:ai(e.msg_content)},this.transBuf(e));return this.Zt.info("zm.lrh.srm.1 "+JSON.stringify(o)),o=Yi.SendImReq.create(e),e=Yi.SendImReq.encode(o).finish(),this.sendMessage("SendImReq",e,(function(e,i){n.longToStringNumber(e.body,["msg_id"],"toNumber"),t&&t(e,i)}),i,{roomID:null==r?void 0:r.roomID})},tr.prototype.sendReliableMessage=function(e,t,i,r){e={trans_type:ai(e.trans_type),trans_data:ai(e.trans_data),trans_local_seq:e.trans_local_seq,trans_channel:ai(e.trans_channel)};var n=this.transBuf(e);return this.Zt.info("zm.lrh.srm.0 "+JSON.stringify(n)),n=Yi.SetTransReq.create(e),e=Yi.SetTransReq.encode(n).finish(),this.sendMessage("SetTransReq",e,t,i,{roomID:null==r?void 0:r.roomID})},tr.prototype.fetchReliableMessage=function(e,t,i,r){var n=e.fetch_array.map((function(e){return{trans_type:ai(e.trans_type),trans_local_seq:e.trans_seq}}));return e={trans_channel:ai(e.trans_channel),trans_list:n},n=this.transBuf(e),this.Zt.info("zm.lrh.frm "+JSON.stringify(n)),n=Yi.GetTransReq.create(e),e=Yi.GetTransReq.encode(n).finish(),this.sendMessage("GetTransReq",e,t,i,{roomID:null==r?void 0:r.roomID})},tr.prototype.sendCustomCommand=function(e,t,i,r){var n=this,o=e.dest_id_name.map((function(e){return{id_name:ai(e)}}));return o=Ki({to_user_list:o,push_message:ai(e.custom_msg)},e),e=this.transBuf(o),this.Zt.info("zm.lrh.scc "+JSON.stringify(e)),e=Yi.SignalLiveCustomReq.create(o),o=Yi.SignalLiveCustomReq.encode(e).finish(),this.sendMessage("SignalLiveCustomReq",o,(function(e,i){t&&t(n.transRsp(e),i)}),(function(e,t){i&&i(e,t)}),{roomID:null==r?void 0:r.roomID})},tr.prototype.sendBigRoomMessage=function(e,t,i,r){e={msg_list:e.msgs.map((function(e){return{msg_category:e.msg_category,msg_type:e.msg_type,msg_timestamp:zi.a.fromNumber(Date.now()),msg_content:ai(e.msg_content),msg_client_id:ai(e.bigmsg_client_id)}}))};var n=this.transBuf(e);return this.Zt.info("zm.lrh.sbrm "+JSON.stringify(n)),n=Yi.SendBigImReq.create(e),e=Yi.SendBigImReq.encode(n).finish(),this.sendMessage("SendBigImReq",e,t,i,{roomID:null==r?void 0:r.roomID})},tr.prototype.sendSignalCmd=function(e,t,i,r){var n="";switch(e.sub_cmd){case 1003:n="SignalLiveInviteReq";break;case 1001:n="SignalLiveRequestReq";break;case 1002:n="SignalLiveResultReq";break;case 1004:n="SignalLiveStopReq"}var o=e.dest_id_name.map((function(e){return{id_name:ai(e)}}));return e={push_message:ai(e.signal_msg),to_user_list:o},o=this.transBuf(e),this.Zt.info("zm.lrh.ssc "+JSON.stringify(o)),o=Yi[n].create(e),e=Yi[n].encode(o).finish(),this.sendMessage(n,e,t,i,{roomID:null==r?void 0:r.roomID})},tr.prototype.sendStreamUpdate=function(e,t,i,r){var n,o=this;try{n=JSON.parse(e.stream_msg)}catch(e){}var s,a="",c=(this.Zt.info(Ye+" "+JSON.stringify(Ki(Ki({},e),{third_token:void 0}))),this.Zt.remoteReport(Ye+" token "+e.third_token),this.Qt.roomModulesList.find((function(e){return e.roomID==r.roomID})));if(!c)return this.Zt.error(Ye+" room no found ignore "),-1;switch(e.sub_cmd){case 2001:a="AddStreamReq",s={stream_id:ai(n.stream_id),extra_info:ai(n.extra_info),client_req_seq:this.seq+1,third_token:ai(e.third_token||"")};break;case 2002:a="DeleteStreamReq",s={stream_id:ai(n.stream_id),stream_sid:n.stream_sid,client_req_seq:this.seq+1};break;case 2003:a="UpdateStreamReq",s={stream_id:ai(n.stream_id),stream_sid:n.stream_sid,client_req_seq:this.seq+1,extra_info:ai(n.extra_info)}}var u=this.transBuf(s);return this.Zt.info(Ye+" "+JSON.stringify(u)),u=Yi[a].create(s),u=Yi[a].encode(u).finish(),this.sendMessage(a,u,(function(e,i){o.Zt.info(Ye+" suc "+a+" "+JSON.stringify(e)),e.header.room_id=c.roomID,t&&t(e,i)}),(function(e,t){o.Zt.info(Ye+" fail "+a+" "+JSON.stringify(e)),i&&i(e,t)}),{roomID:null==r?void 0:r.roomID})},tr.prototype.getStreamList=function(e,t,i,r){var n,o,s=this;this.Qt.roomModulesList.find((function(e){return e.roomID==r.roomID}))?(n=this.transBuf(o={}),this.Zt.info("zm.lrh.gs "+JSON.stringify(n)),n=Yi.GetStreamListReq.create(o),o=Yi.GetStreamListReq.encode(n).finish(),this.sendMessage("GetStreamListReq",o,(function(e,i){var r;null!=(r=e.body)&&r.stream_info_list.forEach((function(e){e.create_time=e.create_time.toNumber()})),s.transKeysName(e.body,[["stream_list_seq","stream_seq"],["stream_info_list","stream_info"]]),t&&t(e,i)}),(function(e,t){i&&i(e,t)}),{roomID:null==r?void 0:r.roomID})):this.Zt.error("zm.lrh.gs room no found ignore "+r.roomID)},tr.prototype.transBuf=function(e){var t=this,i={};return Object.keys(e).forEach((function(r){["logout_check","k2_sign","k1_sign"].includes(r)?i[r]=e[r]:t.transReqBytes(i,e,r)})),i},tr.prototype.transReqBytes=function(e,t,i){var r=this;if(zi.a.isLong(t[i]))e[i]=t[i].toString();else if("[object Object]"===Object.prototype.toString.call(t[i]))e[i]={},Object.keys(t[i]).forEach((function(n){return r.transReqBytes(e[i],t[i],n)}));else if("[object Array]"===Object.prototype.toString.call(t[i])&&"[object Object]"===Object.prototype.toString.call(t[i][0])){e[i]=[];for(var n=0;n<t[i].length;n++)!function(n){var o={};Object.keys(t[i][n]).forEach((function(e){r.transReqBytes(o,t[i][n],e)})),e[i].push(o)}(n)}else e[i]="[object Uint8Array]"===Object.prototype.toString.call(t[i])?si(t[i]):t[i]},tr.prototype.transHeader=function(e){return e.timestamp=zi.a.isLong(e.timestamp)?e.timestamp.toString():e.timestamp,e},tr.prototype.transRsp=function(e){var t=this,i=e&&e.rsp_head?this.transRspHead(e.rsp_head):{},r=Ki(Ki({},e),i),n=(delete r.rsp_head,{});return Object.keys(r).forEach((function(e){"k2_sign"===e?n[e]=r[e]:t.transBytes(n,r,e)})),n},tr.prototype.transBytes=function(e,t,i){var r=this;if(zi.a.isLong(t[i]))e[i]=t[i];else if("[object Object]"===Object.prototype.toString.call(t[i]))e[i]={},Object.keys(t[i]).forEach((function(n){return r.transBytes(e[i],t[i],n)}));else if("[object Array]"===Object.prototype.toString.call(t[i])&&"[object Object]"===Object.prototype.toString.call(t[i][0])){e[i]=[];for(var n=0;n<t[i].length;n++)!function(n){var o={};Object.keys(t[i][n]).forEach((function(e){r.transBytes(o,t[i][n],e)})),e[i].push(o)}(n)}else e[i]="[object Uint8Array]"===Object.prototype.toString.call(t[i])?si(t[i]):t[i]},tr.prototype.transRspHead=function(e){return e?{err_code:e.code||0,err_message:e.message}:{}},tr.prototype._decode=function(e,t){return Ki({},e.decode(t))},tr.prototype.di=function(e,t){var i=this;this.Zt.info($e+" call"),this._state=Zi.disconnected,this.Qt.useNetAgent&&e===T.TIMEOUT&&this.Qt.roomModulesList.forEach((function(e){(e=e.roomTryHandler)&&(i.isUaConnect?(i.Zt.info($e+" ua is connect"),e.retryLoginRoom()):(i.Zt.info($e+" ua is disconnect"),i._ua.connectUa()))}))},tr.prototype._handleBroken=function(){this.Zt.info("zm.lrh.hb call"),this._state=Zi.broken,this.Qt.useNetAgent&&this.handleReconnecting("zm.lrh.hb")},tr.prototype.handleReconnecting=function(e){var t=this;this.Qt.roomModulesList.forEach((function(i){var r=i.roomTryHandler,n=i.roomHandler;r&&(r.invalid(),r.onactive=function(i,r){t.Zt.info(e+" onactive"),n.transError(r),n.disconnectedHandle(r)},r.startMaxTime(),n._roomStateHandle("CONNECTING",C.Reconnecting,P.NETWORK_BROKEN))}))},tr.prototype._i=function(e){this.Zt.info("zm.lrh.hc call "+e),this._state=Zi.connected,this.Qt.useNetAgent&&e===b.AUTO&&this.rtm.retryRoom()},tr.prototype.renewToken=function(e,t,i,r){var n=this,o=Yi.RenewTokenReq.create(e={token:e.token});o=Yi.RenewTokenReq.encode(o).finish(),e=this.transBuf(e),this.Zt.info("zm.lrh.rt "+JSON.stringify(e)),this.sendMessage("RenewTokenReq",o,(function(e,i){n.keysExist(e.body,["token_remain_time"]),t&&t(e,i)}),i,{roomID:null==r?void 0:r.roomID})},tr.prototype.reset=function(){this.Zt.info("zm.lrh.r.0 call "),this._state=Zi.disconnected,this.switchSessionID=zi.a.fromInt(0),this._sendDataCheckTimer&&clearTimeout(this._sendDataCheckTimer)},tr.prototype.closeRequest=function(){var e;null!=(e=this.liveroomRequest)&&e.closeRequest()},tr.prototype.resetSessionInfo=function(){this.switchSessionID=zi.a.fromInt(0)},tr.prototype._getNumSDKVersion=function(){var e=0===this.Qt.ENV?6:7,t=this.rtm.version.split(".").map((function(e){return parseInt(e)}));return e<<28|t[0]<<20|t[1]<<8|t[2]},tr);function tr(e,t,i,r,n){var o=this;this.Zt=e,this.Qt=t,this._ua=i,this._dataReport=r,this.rtm=n,this.seq=0,this.sendCommandList=new g,this.sendCommandMap={},this.logoutCheckToken="",this.zPushSid="0",this.loginKeyTransMap=[["user_session_id","session_id"],["liveroom_hb_interval","hearbeat_interval"],["liveroom_hb_timeout","hearbeat_timeout"],["big_im_time_window","bigim_time_window"],["trans_channel_list","trans_seqs"],["stream_list_seq","stream_seq"],["stream_info_list","stream_info"]],this._sendDataCheckOnceCount=100,this._sendDataDropTimeout=1e4,this._sendDataCheckInterval=2e3,this._protoInstance=Ji,this._roomKeyIDs={},this._roomIDKeys={},this.swPushCmdList=[Di.PushReq,Di.MergePushReq,Di.PushKickout],this.onSwitchCmdList=[Di.LoginRoomRsp,Di.LogoutRoomRsp,Di.PushKickout,Di.PushReq,Di.MergePushReq],this.noContextKeyCmdList=[1105],this.rtcPushCmdList=[10001,10002,10004,11001,11002,11003,11004,11005,12001,12002,12003,13001,15001],this._state=Zi.disconnected,this.unStructCmdList=[11001,11002,11003,11004],this.reloginToken="",this.crypto=new Ui,this.liveroomRequest=this._ua.getPCRequest(E.SERVICE_SWITCH4LIVEROOM),this.switchSessionID=zi.a.fromInt(0),null!=(e=this.liveroomRequest)&&e.on("connected",(function(e){o._i(e)})),null!=(t=this.liveroomRequest)&&t.on("broken",(function(e){o._handleBroken()})),null!=(i=this.liveroomRequest)&&i.on("disconnected",(function(e,t){o.di(e,t)})),null!=(r=this.liveroomRequest)&&r.on("downLoadMessage",(function(e,t){o.handlePush(e,t)})),null!=(n=this.liveroomRequest)&&n.on("exception",(function(e,t){o.Zt.info("zm.lrh.o.0 except "+JSON.stringify(e))})),null!=(e=this.liveroomRequest)&&e.on("pcBrokenEvent",(function(e){var t=Vt,i=o.ti.createSpan(a.H,{key:Nt},{key:""},t.event);i.setAttributes({service_no:t.service_no(null==e?void 0:e.service_no)}),i.end()})),null!=(t=this.liveroomRequest)&&t.on("pcDisconnectedEvent",(function(e){var t=Gt,i=o.ti.createSpan(a.H,{key:Nt},{key:""},t.event);i.setAttributes({service_no:t.service_no(null==e?void 0:e.service_no)}),i.end()})),null!=(i=this.liveroomRequest)&&i.on("pcConnectedEvent",(function(e){var t=Ft,i=o.ti.createSpan(a.H,{key:Nt},{key:""},t.event);i.setAttributes({service_no:t.service_no(e.service_no),recv_time:t.recv_time((new Date).getTime()),proxy_link_sources:t.proxy_link_sources(e.proxy_link_sources),connect_stream:t.connect_stream(e.connect_stream)}),i.end()}))}var ir=(Object.defineProperty(rr.prototype,"logger",{get:function(){return this.Zt},enumerable:!1,configurable:!0}),Object.defineProperty(rr.prototype,"stateCenter",{get:function(){return this.Qt},enumerable:!1,configurable:!0}),rr.prototype.listenCallBack=function(){var e=this;this.roomServicer.handlePushCustomMsg=function(t){e.handlePushCustomMsg(t)},this.roomServicer.handlePushTokenExpire=function(t){var i,r=null==(r=null==(r=null==t?void 0:t.body)?void 0:r.stop_stream)?void 0:r.stream_id_list.map(si);null!=(i=null==(i=null==t?void 0:t.body)?void 0:i.stop_stream)&&(i.stream_id_list=r),e.Qt.actionListener("_tokenExpired",t)},this.roomServicer.handlePushKickout=function(t,i){var r;i?function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}([],e.Qt.roomModulesList,!0).forEach((function(e){e.roomHandler.handlePushKickout(t,!0,!0)})):(r=null==(i=null==t?void 0:t.header)?void 0:i.room_id,i=e.Qt.roomModulesList.find((function(e){return e.roomID==r})),e.roomServicer.longToStringNumber(t.body,["session_id"],"toString"),i?i.roomHandler.handlePushKickout(t):e.Zt.error("zm.lrh.pk room no found ignore "+JSON.stringify(null==(i=t.header)?void 0:i.room_id)))},this.roomServicer.handlePushStreamMsg=function(t){e.handlePushStreamMsg(t)},this.roomServicer.handlePushSignalMsg=function(t){e.handlePushSignalMsg(t)},this.roomServicer.handlePushMergeMsg=function(t){e.handlePushMergeMsg(t)},this.roomServicer.handlePushRoomMsg=function(t){e.handlePushRoomMsg(t)},this.roomServicer.handlePushTransMsg=function(t){e.handlePushTransMsg(t)},this.roomServicer.onSwitchMessage=function(t,i){e.onSwitchMessage(t,i)},this.roomServicer.handlePushUserStateUpdateMsg=function(t){var i,r,n,o=null==(s=null==t?void 0:t.header)?void 0:s.room_id,s=e.Qt.roomModulesList.find((function(e){return e.roomID==o}));s?(n=t.body.user_action_list.map((function(e){return{Action:e.action,IdName:e.id_name,NickName:e.nick_name,Role:e.role,LoginTime:e.login_time.toString()}})),r=e.Qt.reporter.createSpan(a.H,{key:at.event,par:o},{key:""},"/liveroom/recv_user_update_info"),n={body:{user_actions:n,user_list_seq:t.body.server_user_seq.toNumber(),room_id:o}},r.setAttributes({user_list_seq:null==(i=null===n?void 0:n.body)?void 0:i.user_list_seq,update_user:null==(i=null===n?void 0:n.body)?void 0:i.user_actions}),r.end(),s.userHandler.handlePushUserStateUpdateMsg(n)):e.Zt.error("zm.lrh.puu room no found ignore "+JSON.stringify(t))}},rr.prototype.isDisConnect=function(){return!!this.roomServicer&&this.roomServicer.isDisConnect()},Object.defineProperty(rr.prototype,"isUaConnect",{get:function(){return!!this.roomServicer&&this.roomServicer.isUaConnect},enumerable:!1,configurable:!0}),rr.prototype.sendMessage=function(e,t,i,r,n,o,s){var a;return null==(a=this.roomServicer)?void 0:a.sendMessage(e,t,i,r,n,o)},rr.prototype.handlePushTokenExpire=function(e){},rr.prototype.handlePushKickout=function(e,t){},rr.prototype.handlePushStreamMsg=function(e){},rr.prototype.handlePushSignalMsg=function(e){},rr.prototype.handlePushMergeMsg=function(e){},rr.prototype.handlePushCustomMsg=function(e){},rr.prototype.handlePushRoomMsg=function(e){},rr.prototype.handlePushTransMsg=function(e){},rr.prototype.onSwitchMessage=function(e,t){},rr.prototype.handlePushUserStateUpdateMsg=function(e){},rr.prototype.login=function(e,t,i){var r;null!=(r=this.roomServicer)&&r.login(e,t,i)},rr.prototype.logout=function(e,t,i){var r;return null==(r=this.roomServicer)?void 0:r.logout(e,t,i)},rr.prototype.startCheck=function(){var e;null!=(e=this.roomServicer)&&e.startCheck()},rr.prototype.stopCheck=function(){var e;null!=(e=this.roomServicer)&&e.stopCheck()},rr.prototype.getReqHead=function(e){var t;return null==(t=this.roomServicer)?void 0:t.getReqHead(e)},rr.prototype.heartBeat=function(e,t,i){var r;null!=(r=this.roomServicer)&&r.heartBeat(e,t,i)},rr.prototype.fetchUserList=function(e,t,i,r){var n;return null==(n=this.roomServicer)?void 0:n.fetchUserList(e,t,i,r)},rr.prototype.sendRoomMsg=function(e,t,i,r){var n;return null==(n=this.roomServicer)?void 0:n.sendRoomMsg(e,t,i,r)},rr.prototype.sendReliableMessage=function(e,t,i,r){var n;return null==(n=this.roomServicer)?void 0:n.sendReliableMessage(e,t,i,r)},rr.prototype.fetchReliableMessage=function(e,t,i,r){var n;return null==(n=this.roomServicer)?void 0:n.fetchReliableMessage(e,t,i,r)},rr.prototype.sendCustomCommand=function(e,t,i,r){var n;return null==(n=this.roomServicer)?void 0:n.sendCustomCommand(e,t,i,r)},rr.prototype.sendBigRoomMessage=function(e,t,i,r){var n;return null==(n=this.roomServicer)?void 0:n.sendBigRoomMessage(e,t,i,r)},rr.prototype.sendSignalCmd=function(e,t,i,r){var n;return null==(n=this.roomServicer)?void 0:n.sendSignalCmd(e,t,i,r)},rr.prototype.sendStreamUpdate=function(e,t,i,r){var n;return null==(n=this.roomServicer)?void 0:n.sendStreamUpdate(e,t,i,r)},rr.prototype.getStreamList=function(e,t,i,r){var n;return null==(n=this.roomServicer)?void 0:n.getStreamList(e,t,i,r)},rr.prototype.renewToken=function(e,t,i,r){var n;null!=(n=this.roomServicer)&&n.renewToken(e,t,i,r)},rr.prototype.reset=function(){var e;null!=(e=this.roomServicer)&&e.reset()},rr.prototype.closeRequest=function(){var e;null!=(e=this.roomServicer)&&e.closeRequest()},rr);function rr(e,t,i,r,n){this.Zt=e,this.Qt=t,this.ua=i,this._dataReport=r,this.rtm=n,this.roomServicer=new er(e,t,i,r,n),this.listenCallBack()}var nr=i(12),or=(sr.prototype.setLog=function(e){this.close||this.zegoSetting.setLog(e)},sr.prototype.init=function(e){this.close||this.zegoSetting.init(e)},sr.prototype.setEnvVariable=function(e,t){this.close||this.zegoSetting.setEnvVariable(e,t)},sr.prototype.getEnvVariables=function(){if(!this.close)return this.zegoSetting.getEnvVariables()},sr.prototype.fetchSetting=function(e,t,i){return this.close?Promise.resolve():this.zegoSetting.fetchSetting(e,t,i)},sr.prototype.fetchMultiSetting=function(e,t,i){return this.close?Promise.resolve():this.zegoSetting.fetchMultiSetting(e,t,i)},sr.prototype.setOptions=function(e){if(!this.close)return this.zegoSetting.setOptions(e)},sr.prototype.getSettingCache=function(e){return this.close?Promise.resolve():this.zegoSetting.getSettingCache(e)},sr.prototype.setToken=function(e){this.close||this.zegoSetting.setToken(e)},sr.prototype.setUserID=function(e){this.close||this.zegoSetting.setUserID(e)},sr.prototype.activePolling=function(){this.close||this.zegoSetting.activePolling()},sr.prototype.uninit=function(){var e;this.close||null!=(e=this.zegoSetting)&&e.uninit()},sr.prototype.getEnvVariable=function(e){this.close||this.zegoSetting.getEnvVariable(e)},sr);function sr(e){void 0===e&&(e=!1),this.close=!1,this.isLoad=!1,this.callBackList=[],this.close=e,this.close||(this.zegoSetting=new nr.ZegoSetting)}var ar,cr=function(){return(cr=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},ur=function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){var u=[a,c];if(i)throw new TypeError("Generator is already executing.");for(;o=s&&u[s=0]?0:o;)try{if(i=1,r&&(n=2&u[0]?r.return:u[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,u[1])).done)return n;switch(r=0,(u=n?[2&u[0],n.value]:u)[0]){case 0:case 1:n=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3]))o.label=u[1];else if(6===u[0]&&o.label<n[1])o.label=n[1],n=u;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(u)}}u=t.call(e,o)}catch(c){u=[6,c],r=0}finally{i=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},lr=((t=ar=ar||{})[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSING=2]="CLOSING",t[t.CLOSED=3]="CLOSED",0),dr=(Object.defineProperty(hr.prototype,"binaryType",{get:function(){return this._binaryType},set:function(e){this._binaryType=e},enumerable:!1,configurable:!0}),hr.prototype.addEventListener=function(e,t,i){var r;this.eventMap[e]?null!=(r=this.eventMap[e])&&r.push(t):this.eventMap[e]=[t],"open"!==e&&null!=(r=this.socket)&&r.addEventListener(e,t,i)},hr.prototype.removeEventListener=function(e,t,i){var r;this.eventMap[e]=(this.eventMap[e]||[]).filter((function(e){return e!==t})),"open"!==e&&null!=(r=this.socket)&&r.removeEventListener(e,t,i)},hr.prototype.dispatchEvent=function(e){throw new Error("Method not implemented.")},Object.defineProperty(hr.prototype,"readyState",{get:function(){var e;return this.isConnecting?ar.CONNECTING:(null==(e=null==this?void 0:this.socket)?void 0:e.readyState)||ar.CLOSED},enumerable:!1,configurable:!0}),hr.prototype.createSocket=function(){return function(e,t,i,r){return new(i=i||Promise)((function(t,n){function o(e){try{a(r.next(e))}catch(e){n(e)}}function s(e){try{a(r.throw(e))}catch(e){n(e)}}function a(e){var r;e.done?t(e.value):((r=e.value)instanceof i?r:new i((function(e){e(r)}))).then(o,s)}a((r=r.apply(e,[])).next())}))}(this,0,void 0,(function(){var e,t,i,r,n,o=this;return ur(this,(function(s){switch(s.label){case 0:if(this.socket&&this.socket.readyState!==ar.CLOSED)return[2];e=null,t=this.activeServer?function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}([this.activeServer],this.servers,!0):this.servers,i=function(i){var n,s,a;return ur(this,(function(c){switch(c.label){case 0:s="wss://".concat(n=t[i],"/proxy/ws"),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,new Promise((function(e,t){var i=new WebSocket(s),r=(Object.keys(o.eventMap).forEach((function(e){"open"!==e&&(o.eventMap[e]||[]).forEach((function(t){i.addEventListener(e,t)}))})),i.binaryType="arraybuffer",i.onclose=function(e){o.onclose&&o.onclose(e)},i.onerror=function(e){o.onerror&&o.onerror(e),t(e)},0);i.onmessage=function(e){r++;var t=e.data;if(1===r);else if(2===r){if(0!==(t=Ni.webproxy.WssBindResponse.decode(new Uint8Array(t))).code)throw"zm.prx.1"+" cloud proxy token auth failed. result: ".concat(JSON.stringify(t));o.isConnecting=!1,(o.eventMap.open||[]).forEach((function(t){t(o,e)})),o.onopen&&o.onopen()}else o.onmessage&&o.onmessage(e)},i.onopen=function(t){o.socket=i,e(t),o.authProxy(i)}}))];case 2:return c.sent(),[3,4];case 3:return a=c.sent(),e=a,[2,"continue"];case 4:return r.onActiveServer&&(r.onActiveServer(n),r.onActiveServer=void 0),r.url=s,[2,"break"]}}))},r=this,n=0,s.label=1;case 1:return n<t.length?[5,i(n)]:[3,4];case 2:if("break"===s.sent())return[3,4];s.label=3;case 3:return n++,[3,1];case 4:return this.socket||setTimeout((function(){throw e}),0),[2]}}))}))},hr.prototype.authProxy=function(e){var t,i,r,n,o=this.socket;o&&(t=(r=this.params).token,i=r.target,n=Ni.webproxy.WssBindRequest.encode({appid:n=r.appid,biz_type:0,mode:1,id_name:r=r.userID,token:t,url:i,ack:!0}).finish(),o.send(n))},hr.prototype.setParams=function(e){this.params=cr(cr({},this.params),e)},hr.prototype.open=function(){this.isConnecting=!0,this.readyState!==ar.CLOSED&&this.createSocket()},hr.prototype.close=function(){var e;null!=(e=this.socket)&&e.close()},hr.prototype.send=function(e){var t;null!=(t=this.socket)&&t.send(e)},hr.prototype.onopen=function(){},hr.prototype.onclose=function(e){},hr.prototype.onerror=function(e){},hr.prototype.onmessage=function(e){},Object.defineProperty(hr.prototype,"bufferedAmount",{get:function(){var e;return(null==(e=this.socket)?void 0:e.bufferedAmount)||0},enumerable:!1,configurable:!0}),Object.defineProperty(hr.prototype,"extensions",{get:function(){var e;return(null==(e=this.socket)?void 0:e.extensions)||""},enumerable:!1,configurable:!0}),Object.defineProperty(hr.prototype,"protocol",{get:function(){var e;return(null==(e=this.socket)?void 0:e.protocol)||""},enumerable:!1,configurable:!0}),hr);function hr(e,t,i){this.servers=e,this.params=t,this.activeServer=i,this.isConnecting=!1,this._binaryType="blob",this.eventMap={},this.url="",this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,this.id=lr++,this.open()}var pr=function(e,t,i,r){return new(i=i||Promise)((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},fr=function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){var u=[a,c];if(i)throw new TypeError("Generator is already executing.");for(;o=s&&u[s=0]?0:o;)try{if(i=1,r&&(n=2&u[0]?r.return:u[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,u[1])).done)return n;switch(r=0,(u=n?[2&u[0],n.value]:u)[0]){case 0:case 1:n=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3]))o.label=u[1];else if(6===u[0]&&o.label<n[1])o.label=n[1],n=u;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(u)}}u=t.call(e,o)}catch(c){u=[6,c],r=0}finally{i=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},mr=function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},vr=Ni.webproxy;function gr(e){for(var t=0,i=0;i<e.length;i++)t+=e[i].length;var r=new Uint8Array(t),n=0;for(i=0;i<e.length;i++)r.set(e[i],n),n+=e[i].length;return r}function yr(e){return pr(this,void 0,void 0,(function(){var t,i;return fr(this,(function(r){switch(r.label){case 0:for("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",t="----WebKitFormBoundary",i=0;i<16;i++)t+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(Math.floor(62*Math.random()));return[4,function(e,t){return pr(this,void 0,void 0,(function(){var i,r,n,o,s,a;return fr(this,(function(c){switch(c.label){case 0:i=new Uint8Array,r=[],n=Array.from(e),o=function(e){var o,s;return fr(this,(function(a){switch(a.label){case 0:return o=n[e][0],s=n[e][1],r.push("--"+t),s instanceof Blob?[4,new Promise((function(e){var t=new FileReader;t.onloadend=function(){var n,a=t.result;a&&(r.push('Content-Disposition: form-data; name="'+o+'"; filename="'+((null==s?void 0:s.name)||"blob")+'"',"Content-Type: "+s.type,"\r\n"),n=ai(r.join("\r\n")),r=[],a=new Uint8Array(a),i=gr([i,n,a])),e(0)},t.readAsArrayBuffer(s)}))]:[3,2];case 1:return a.sent(),[3,3];case 2:r.push('Content-Disposition: form-data; name="'+o+'"',"",s),a.label=3;case 3:return[2]}}))},s=0,c.label=1;case 1:return s<n.length?[5,o(s)]:[3,4];case 2:c.sent(),c.label=3;case 3:return s++,[3,1];case 4:return r.push("--"+t+"--"),a=ai(r.join("\r\n")),r=[],[2,i=gr([i,a])]}}))}))}(e,t)];case 1:return[2,{body:r.sent(),contentType:"multipart/form-data; boundary="+t}]}}))}))}Object.defineProperty(_r.prototype,"urls",{get:function(){return this.proxyList.map((function(e){var t=e.hostName;return e=e.port,"".concat(t).concat(e?":"+e:"")}))},enumerable:!1,configurable:!0}),_r.prototype.vi=function(e){this.activeServer&&this.activeServer===e||(this.activeServer=e,this.turnInfo=void 0,this.turnExpireTime=void 0)},_r.prototype.destroy=function(){this.proxyList=[]},_r.prototype.init=function(e){this.appID=e.appID},_r.prototype.createSocket=function(e,t){var i=this;if(this.appID)return(e=new dr(this.urls,{target:e,appid:this.appID,token:this.token,userID:this.userID},this.activeServer)).onActiveServer=function(e){i.vi(e)},e;throw"zego cloud proxy config error. can not init proxy."},_r.prototype.getTurnInfo=function(){var e;return pr(this,void 0,void 0,(function(){var t,i;return fr(this,(function(r){switch(r.label){case 0:return this.turnExpireTime&&this.turnInfo&&Date.now()<this.turnExpireTime?[2,this.turnInfo]:(this.turnExpireTime=void 0,this.turnInfo=void 0,t=vr.TurnInfoRequest.encode({appid:this.appID,biz_type:0,mode:1,id_name:this.userID,token:this.token}).finish(),[4,this.handleFetch("/turn/info",t)]);case 1:return t=r.sent(),(i=vr.TurnInfoResponse.decode(new Uint8Array(t))).code||(this.turnInfo=i,this.turnExpireTime=Date.now()+.8*((null==(e=null==i?void 0:i.data)?void 0:e.expiration_in_seconds)||0)*1e3),[2,i]}}))}))},_r.prototype.handleFetch=function(e,t){return void 0===e&&(e="/"),pr(this,void 0,void 0,(function(){var i,r,n,o,s,a,c;return fr(this,(function(u){switch(u.label){case 0:r=i=null,n=this.activeServer?mr([this.activeServer],this.urls,!0):this.urls,o=0,u.label=1;case 1:if(!(o<n.length))return[3,7];a="https://".concat(s=n[o]).concat(e),u.label=2;case 2:return u.trys.push([2,4,,5]),[4,fetch(a,{method:"post",body:t})];case 3:return i=u.sent(),this.vi(s),[3,5];case 4:return c=u.sent(),r=c,[3,6];case 5:return[3,7];case 6:return o++,[3,1];case 7:if(r)throw r;return[4,null==i?void 0:i.arrayBuffer()];case 8:return[2,u.sent()||[]]}}))}))},_r.prototype.intranetCheck=function(e,t){return pr(this,void 0,void 0,(function(){var i;return fr(this,(function(r){switch(r.label){case 0:return i=vr.IntranetCheckRequest.encode({appid:this.appID,biz_type:0,mode:1,id_name:this.userID,token:this.token,vrs_ipv4:e,vrs_ipv6:t}).finish(),[4,this.handleFetch("/intranet/check",i)];case 1:return i=r.sent(),[2,vr.IntranetCheckResponse.decode(new Uint8Array(i))]}}))}))},_r.prototype.startHttpRequest=function(e,t,i,r){var n=this,o=!1;0<((null==r?void 0:r.timeout)||0)&&setTimeout((function(){o||(o=!0,i&&i({status_code:-1,headers:[],body:ai("request time out.")}))}),null==r?void 0:r.timeout),new Promise((function(t,i){return pr(n,void 0,void 0,(function(){var r,n,o,s,a,c,u,l,d,h,p,f;return fr(this,(function(m){switch(m.label){case 0:return(f=null==(f=e.headers)?void 0:f.find((function(e){return"content-type"===e.name.toLowerCase()&&e.val.toLowerCase().includes("multipart/form-data")})))&&e.body instanceof FormData?[4,yr(e.body)]:[3,2];case 1:r=m.sent(),u=r.contentType,e.body=r=r.body,f.val=u,m.label=2;case 2:r=e.body,"string"==typeof e.body&&(r=ai(e.body)),n=vr.HTTPRequest.encode({appid:this.appID,biz_type:0,mode:1,id_name:this.userID,url:e.location,token:this.token,method:e.method_no,headers:e.headers,body:r}).finish(),s=o=null,a=this.activeServer?mr([this.activeServer],this.urls,!0):this.urls,c=0,m.label=3;case 3:if(!(c<a.length))return[3,9];l="https://".concat(u=a[c],"/proxy/http"),m.label=4;case 4:return m.trys.push([4,6,,7]),[4,fetch(l,{method:"post",body:n})];case 5:return o=m.sent(),s=null,[3,7];case 6:return d=m.sent(),s=d,[3,8];case 7:return[3,9];case 8:return c++,[3,3];case 9:return s?(i({status_code:-1,headers:[],body:ai(JSON.stringify(s))}),[2]):[4,null==o?void 0:o.arrayBuffer()];case 10:if(d=m.sent()||[],h=vr.HTTPResponse.decode(new Uint8Array(d)),p=null==h?void 0:h.data,0===(null==h?void 0:h.code)&&p){if(!e.origin)try{p.body=JSON.parse(si(p.body))}catch(m){p.body=si(p.body)}t(p)}else i({status_code:-1,headers:[],body:JSON.parse(si(p.body))});return[2]}}))}))})).then((function(e){!o&&t&&(o=!0,t(e))})).catch((function(e){!o&&i&&(o=!0,i)&&i({status_code:-1,headers:[],body:ai(JSON.stringify(e))})}))};var br=_r;function _r(e,t){this.proxyList=e,this.token=t,this.enable=!1,this.appID=0,this.userID="web_proxy_"+Date.now()}var Sr=(Tr.prototype.init=function(e){},Tr.prototype.createSocket=function(e,t){try{return new WebSocket(this.mi(e,t))}catch(e){throw console.error(e),e}},Tr.prototype.mi=function(e,t){var i=this;return e.replace(/^(https?:\/\/|wss?:\/\/)([\w.-]+)(?::(\d+))?/,(function(e,r,n,o){var s="";if(i.gi){var a=i.gi,c=a.accesshubProxy,u=a.loggerProxy,l=a.detaillogProxy;switch(t){case 0:s=r+c;break;case 1:s=r+u;break;case 2:s=r+l}}return s?s.endsWith("/")?s.substring(0,s.length-1):s:e}))},Tr.prototype.startHttpRequest=function(e,t,i,r){var n=this,o=!1;0<((null==r?void 0:r.timeout)||0)&&setTimeout((function(){o||(o=!0,i&&i({status_code:-1,headers:[],body:ai("request time out.")}))}),null==r?void 0:r.timeout),new Promise((function(t,i){return function(e,t,i,r){return new(i=i||Promise)((function(t,n){function o(e){try{a(r.next(e))}catch(e){n(e)}}function s(e){try{a(r.throw(e))}catch(e){n(e)}}function a(e){var r;e.done?t(e.value):((r=e.value)instanceof i?r:new i((function(e){e(r)}))).then(o,s)}a((r=r.apply(e,[])).next())}))}(n,0,void 0,(function(){var r,n,o,s,a,c;return function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){var u=[a,c];if(i)throw new TypeError("Generator is already executing.");for(;o=s&&u[s=0]?0:o;)try{if(i=1,r&&(n=2&u[0]?r.return:u[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,u[1])).done)return n;switch(r=0,(u=n?[2&u[0],n.value]:u)[0]){case 0:case 1:n=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3]))o.label=u[1];else if(6===u[0]&&o.label<n[1])o.label=n[1],n=u;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(u)}}u=t.call(e,o)}catch(c){u=[6,c],r=0}finally{i=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,(function(u){switch(u.label){case 0:r=e.body,o=n=null,s=this.mi(e.location,e.serviceType),u.label=1;case 1:return u.trys.push([1,3,,4]),a=1===e.method_no?"get":"post",[4,fetch(s,{method:a,body:r})];case 2:return n=u.sent(),o=null,[3,4];case 3:return a=u.sent(),o=a,[3,4];case 4:return o?(i({status_code:-1,headers:[],body:ai(JSON.stringify(o))}),[2]):[4,null==n?void 0:n.json()];case 5:return c=u.sent(),n?t({status_code:(null==n?void 0:n.status)||-1,body:c,headers:[]}):i({status_code:-1,headers:[],body:ai("request failed.")}),[2]}}))}))})).then((function(e){!o&&t&&(o=!0,t(e))})).catch((function(e){!o&&i&&(o=!0,i)&&i({status_code:-1,headers:[],body:ai(JSON.stringify(e))})}))},Tr.prototype.destroy=function(){},Tr);function Tr(e){this.gi=e}var Er=function(){return(Er=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Cr=function(e,t,i,r){return new(i=i||Promise)((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},wr=function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){var u=[a,c];if(i)throw new TypeError("Generator is already executing.");for(;o=s&&u[s=0]?0:o;)try{if(i=1,r&&(n=2&u[0]?r.return:u[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,u[1])).done)return n;switch(r=0,(u=n?[2&u[0],n.value]:u)[0]){case 0:case 1:n=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3]))o.label=u[1];else if(6===u[0]&&o.label<n[1])o.label=n[1],n=u;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(u)}}u=t.call(e,o)}catch(c){u=[6,c],r=0}finally{i=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},Ir=function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},Rr=(Object.defineProperty(kr.prototype,"logger",{get:function(){return this.Zt},enumerable:!1,configurable:!0}),Object.defineProperty(kr.prototype,"stateCenter",{get:function(){return this.Qt},enumerable:!1,configurable:!0}),Object.defineProperty(kr.prototype,"modules",{get:function(){return{service:this.service}},enumerable:!1,configurable:!0}),Object.defineProperty(kr.prototype,"isUseNetAgent",{get:function(){return this.Qt.useNetAgent},enumerable:!1,configurable:!0}),Object.defineProperty(kr.prototype,"isUaConnect",{get:function(){return this.netAgent.isConnect()},enumerable:!1,configurable:!0}),Object.defineProperty(kr.prototype,"reporter",{get:function(){return this.ti},enumerable:!1,configurable:!0}),kr.prototype.destroyRTM=function(){this.Qt.roomModulesList.some((function(e){return!(null!=e&&e.isLogout()||e.roomState===ci)}))&&this.logoutRoom(),this.ti.setUnloadState(a.I),this.ti.destroy(),this.pi()},kr.prototype.getSettingUnify=function(e){var t;return void 0===e&&(e=!1),!!this.Qt.configOK&&(t=this.Qt.settingConfig.getSetting("unify",e),this.Zt.info("zm.gsu "+e+" "+JSON.stringify(t)),t?(e=t.enable,t=t.sdk_conn_ver,!!(e&&fe.connectVer>=t)):this.isUseNetAgent)},kr.prototype._initCallback=function(){this.proxyRes=$,this.actionSuccessCallback=K,this.actionErrorCallback=Z,this.getServerError=ee,this.generateRandumNumber=re,this.unregisterCallback=te,this.logReportCallback=J,this.registerCallback=W},kr.prototype._initSpans=function(){this.ti.createSpan(a.H,{key:et.event},{key:tt},tt,!0).end()},kr.prototype._handleZipLogUrl=function(){var e,t,i="";null!=(e=this.Qt.advanceConfig.customDomain)&&e.detaillog&&""!==(null==(e=this.Qt.advanceConfig.customDomain)?void 0:e.detaillog)?(t=null==(e=this.Qt.advanceConfig.customDomain)?void 0:e.detaillog,i="https://".concat(t,"/log/userupload"),this.Zt.info(De+" set detaillog url by advance config "+i),this.Zt.setZipLogUploadUrl(i)):null!=(e=this.Qt.geoFencing)&&e.detaillog&&""!==(null==(e=this.Qt.geoFencing)?void 0:e.detaillog)?(i="https://".concat(null==(e=this.Qt.geoFencing)?void 0:e.detaillog,"/log/userupload"),this.Zt.info(De+" set detaillog url by geoFencing "+i),this.Zt.setZipLogUploadUrl(i)):(t=void 0,this.Qt.settingConfig.getSetting("detaillog_domain")?(t=this.Qt.settingConfig.getSetting("detaillog_domain"),this.Zt.info("".concat(De," set detaillog domain by cloudsetting ").concat(t))):this.Qt.svrDomains.detaillog&&(t=this.Qt.svrDomains.detaillog,this.Zt.info("".concat(De," set detaillog domain by svr ").concat(t))),t&&""!==t&&(i="https://".concat(t,"/log/userupload"),this.Zt.info(De+" set detaillog url "+i),this.Zt.setZipLogUploadUrl(i)))},kr.prototype.getStoreAppConfig=function(){if(this.Zt.info(Ae+" call"),localStorage){var e=B(de+"_"+this.getAppID()+"_"+(this.Qt.mode||fe.modeNo));if(e){var t=B(he+"_"+this.getAppID()+"_"+(this.Qt.mode||fe.modeNo));t||this.Zt.info(Ae+" no store config etag");try{var i,r=x(e,ue);r?(this.Qt.appConfig=JSON.parse(r),this.ti.spanSetAttributes({key:et.event},{is_from_cache:et.is_from_cache(!0)}),this.Qt.actionListener("_appConfigRsp")):localStorage.removeItem(de+"_"+this.getAppID()+"_"+(this.Qt.mode||fe.modeNo)),t&&(i=x(t,ue),this.Qt.appConfigEtag=parseInt(i))}catch(e){this.Zt.warn(Ae+" "+JSON.stringify(e))}}else this.Zt.info(Ae+" no store config")}else this.Zt.warn(Ae+" no localstorage")},kr.prototype.bi=function(){var e=this,t=(this.Zt.info(Pe+" call"),this.netAgent.on("disconnected",(function(t){e.Zt.info("".concat(Pe," netAgent disconnect"))})),this.netAgent.on("connected",(function(){e.Zt.info("".concat(Pe," netAgent connect")),e.ti.setNetStateCheck(),e.isUseNetAgent&&(e.fetchAppConfig(),e.retryRoom(!0))})),this.netAgent.on("broken",(function(t){e.Zt.info("".concat(Pe," netAgent broken")),t===_.CLOSE&&e.Qt.roomModulesList.forEach((function(e){e.resetSessionInfo()}))})),this.netAgent.on("dispatchEvent",(function(t,i,r){var n;e.Zt.info("".concat(Pe," dispatch")),"start"===i?(n=e.ti.createSpan(a.H,{key:Nt},{key:""},"/zegoconn/auto_dispatch"),e.Qt.requestList[t]=n):"end"===i&&(n=e.Qt.requestList[t])&&(n.setAttributes({domain_list:r.domains}),n.end())})),this.netAgent.on("dispatchResultUpdate",(function(t){var i=t.servers;t=t.domains,e.Zt.info("".concat(Pe," dispatchResult ").concat(JSON.stringify(i),", ").concat(JSON.stringify(t))),1!==e.Qt.netGeoFencing.id?(t&&t[0]&&(e.Qt.netGeoFencing.accesshub=t[0]),e.setLocalGeoFencing()):(t=L(JSON.stringify(i),ue),U(le+"_"+e.Qt.appid+"_"+(e.Qt.mode||fe.modeNo),t))})),this.netAgent.on("svrAddrResultUpdate",(function(t){var i=t.accesshub_domain,r=t.logreport_domain,n=t.detaillog_domain;1!==(t=t.geofencing_id)?(r&&(e.Qt.netGeoFencing.logreport=r),n&&(e.Qt.netGeoFencing.detaillog=n),e.Qt.netGeoFencing.id=t,e.setLocalGeoFencing()):(t=L(JSON.stringify({accesshub_domain:i,logreport_domain:r,detaillog_domain:n}),ue),U(pe+"_"+e.Qt.appid+"_"+(e.Qt.mode||fe.modeNo),t)),r&&(e.stateCenter.svrDomains.logreport=r,e.handleLogUpload()),n&&(e.stateCenter.svrDomains.detaillog=n,e._handleZipLogUrl())})),this.netAgent.on("connectedEvent",(function(t,i,r){var n;e.Zt.info("".concat(Pe," connect")),"start"===i?(n=e.ti.createSpan(a.H,{key:et.event},{key:Nt},Nt,!0),e.Qt.requestList[t]=n):"end"===i&&(n=e.Qt.requestList[t])&&(i=r.connectEvents||[],n.setAttributes({request_count:Mt(r.count),connect_id:Ot(r.connectid),events:Lt(i),error:(null==(t=i[0])?void 0:t.error)||0}),n.end())})),this.netAgent.on("requestEvent",(function(t,i,r){var n;e.Zt.info("".concat(Pe," request")),"start"===i?(n=e.ti.createSpan(a.H,{key:et.event},{key:zt},zt,!0),e.Qt.requestList[t]=n):"end"===i&&(n=e.Qt.requestList[t])&&(n.setAttributes({req_location:qt(r.na_req_location),http_code:r.status_code,error:r.err_code}),n.end())})),this.netAgent.on("disConnectedEvent",(function(t){var i=t.duration,r=t.server,n=(t=t.connectid,e.Zt.info("".concat(Pe," disconnect")),e.ti.createSpan(a.H,{key:et.event},{key:""},"/zegoconn/disconnect"));n.setAttributes({url:Ut(r),connect_duration:Bt(i),connect_id:xt(t)}),n.end()})),null!=(t=this.netAgent)&&t.on("clientInfo",(function(t){var i=t.timeOffset;t=t.geofencingID,Object(z.d)(i)&&e.ti.setTimeOffset(i),e._updateTimeOffsetInterval(),Object(z.d)(t)&&(e.Qt.netGeoFencing.id=t)})),[]),i=(n=this.Ei()).accesshub,r=n.logreport,n=n.detaillog;t=i,this.stateCenter.svrDomains.logreport=r[0],this.stateCenter.svrDomains.detaillog=n[0],this.Zt.info("".concat(Pe," hard domains ").concat(JSON.stringify(t))),i=this.getServerDomains(),this.Zt.info("".concat(Pe," svr domains ").concat(JSON.stringify(t))),i&&(r=i.accesshub_domain,n=i.logreport_domain,i=i.detaillog_domain,r&&(t=[r],this.stateCenter.svrDomains.accesshub=r),n&&(this.stateCenter.svrDomains.logreport=n),i)&&(this.stateCenter.svrDomains.detaillog=i),(n=null==(r=kr.engineOptions)?void 0:r.accessDomains)&&(t=n),t=this.getGeoDomains()||t,i=!1,(r=this.yi()).accesshub&&""!==r.accesshub&&(i=!0,t=[r.accesshub],this.stateCenter.svrDomains.accesshub=r.accesshub),r.logreport&&""!==r.logreport&&(this.stateCenter.svrDomains.logreport=r.logreport),r.detaillog&&""!==r.detaillog&&(this.stateCenter.svrDomains.detaillog=r.detaillog),this.Zt.info("".concat(Pe," advance config domains: ").concat(JSON.stringify(r),", set domains ").concat(JSON.stringify(t),", ")),this.Zt.info("".concat(Pe," domains ").concat(JSON.stringify(t))),r=t.map((function(e){return"wss://".concat(e,"/accesshub")})),this.netAgent.setNetAgentDefaultServers(r),this.dispatchServers=[],this.dispatchServers=this.Qt.geoFencing||i||n?r:this._getDispatchUrl(),this.handleLogUpload(),this._handleZipLogUrl(),this.netAgent.setDispatchConnectServers(this.dispatchServers)},kr.prototype._getMainDomain=function(e){return(e=e.split("."))[e.length-2]+"."+e[e.length-1]},kr.prototype.yi=function(){var e={};return this.stateCenter.advanceConfig.customDomain&&(this.stateCenter.advanceConfig.customDomain.accesshub&&(e.accesshub=this.stateCenter.advanceConfig.customDomain.accesshub),this.stateCenter.advanceConfig.customDomain.logreport&&(e.logreport=this.stateCenter.advanceConfig.customDomain.logreport),this.stateCenter.advanceConfig.customDomain.detaillog)&&(e.detaillog=this.stateCenter.advanceConfig.customDomain.detaillog),e},kr.prototype._replaceMainDomain=function(e){var t,i;this.Qt.geoFencing&&(i=this._getMainDomain(null==(i=this.Qt.geoFencing)?void 0:i.accesshub),this.Qt.geoFencing.accesshub=null==(t=this.Qt.geoFencing)?void 0:t.accesshub.replace(i,e),this.Qt.geoFencing.logreport=null==(t=this.Qt.geoFencing)?void 0:t.logreport.replace(i,e),this.Qt.geoFencing.detaillog=null==(t=this.Qt.geoFencing)?void 0:t.detaillog.replace(i,e))},kr.prototype.hashMainDomain=function(){var e=fe.normalPriDomains.length,t=function(e,t){for(var i=0;0<e;)i+=e%10,e=Math.floor(e/10);return Math.floor(i/t)}(this.getAppID(),e);return fe.normalPriDomains[t%e]},kr.prototype.Ei=function(){var e={accesshub:[],logreport:[],detaillog:[]},t=(null==(i=this._options)?void 0:i.prefixDomain)||fe.prefixDomain,i="weblogger-wss",r=this.hashMainDomain(),n=fe.normalPriDomains.filter((function(e){return e!==r}));return e.accesshub=Ir([r],n,!0).map((function(e){return t+"."+e})),e.logreport=[i+"."+r],e.detaillog=["detaillog-global."+r],e},kr.prototype._getDispatchUrl=function(){var e=B(le+"_"+this.Qt.appid+"_"+(this.Qt.mode||fe.modeNo));if(e&&(e=x(e,ue)))try{return JSON.parse(e)}catch(e){}return[]},kr.prototype.getServerDomains=function(){var e=B(pe+"_"+this.Qt.appid+"_"+(this.Qt.mode||fe.modeNo));if(e&&(e=x(e,ue)))try{return JSON.parse(e)}catch(e){}return null},kr.prototype.Si=function(e){return fe.scheme+"://"+e+"/"+fe.location},kr.prototype._bindWindowListener=function(){var e=this,t=navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPhone/i),i=O(),r="micromessenger"==(n=navigator.userAgent).toLowerCase().match(/MicroMessenger/i),n=-1<n.indexOf("Android")||-1<n.indexOf("Adr"),o=t||r&&n?"pagehide":"Firefox"===i?"beforeunload":"unload";window.addEventListener(o,(function(){return Cr(e,void 0,void 0,(function(){return wr(this,(function(e){switch(e.label){case 0:return this.Zt.info("zm.wl "+o),this.ti.setUnloadState(a.I),this._onBeforePageUnload?[4,this._onBeforePageUnload()]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.logoutRoom(),[2]}}))}))})),window.addEventListener("offline",(function(){e.Oi()})),window.addEventListener("online",(function(){e.wi()}))},kr.prototype.retryRoom=function(e,t,i){var r;void 0===e&&(e=!1),void 0===i&&(i=!1),this.logger.info("".concat("zm.rr"," retryNow:").concat(e," roomid:").concat(t,", resetSession:").concat(i)),t?(r=this.Qt.roomModulesList.find((function(e){return e.roomID==t})))&&r.retryRoom(e,i):this.Qt.roomModulesList.forEach((function(t){null!=t&&t.retryRoom(e,i)}))},kr.prototype.wi=function(){this.Zt.info("zm.wl network is online"),this.Qt.networkState!==c.online&&(this.Qt.networkState=c.online,this.pi())},kr.prototype.pi=function(){this.Ti&&(clearInterval(this.Ti),this.Ti=null)},kr.prototype.Ri=function(){var e=this;this.pi(),this.Zt.info("zm.nt.od start network online detection.."),this.Ti=setInterval((function(){e.Qt.networkState!==c.offline&&e.pi(),e.Qt.useNetAgent&&e.isUaConnect&&(e.Zt.info("zm.nt.od detected network online"),e.wi(),e.pi())}),this.Ii)},kr.prototype.Oi=function(){this.Zt.info("zm.wl network is broken"),this.Qt.networkState!==c.offline&&(this.Qt.networkState=c.offline,this.Ri())},kr.prototype.setLogConfig=function(e){this.Zt.info(Ee+" call");var t,i=this.ti.createSpan(a.H,{key:et.event},{key:nt.event},nt.event);if(e.logLevel&&["debug","info","warn","error","report","disable"].includes(e.logLevel)&&(this.Zt.setLogLevel(e.logLevel),i.setAttributes({log_level:nt.log_level(e.logLevel)})),e.remoteLogLevel&&["debug","info","warn","error","report","disable"].includes(e.remoteLogLevel)&&i.setAttributes({remote_log_level:nt.remote_log_level(e.remoteLogLevel)}),Object(z.f)(e.logURL)&&(e.logURL.startsWith("wss://")||e.logURL.startsWith("https://")))null!=(t=this.Qt.geoFencing)&&t.logreport?this.Zt.info(Ee+" geo exist"):(this.Zt.setLogServer(e.logURL),0===this.Qt.ENV&&(this.Qt.logDomain=null==(t=this.Zt.url)?void 0:t.split("/")[2],this.ti.setConfig({serverUrl:"wss://"+this.Qt.logDomain+"/zglog/tlog"}))),i.setAttributes({log_url:nt.log_url(e.logURL)}),i.end();else if(e.logURL)return this.Zt.error(Ee+"log url must be a wss or https url"),this.ti.setError(i,nt.error.kInvalidParamError),!1;return this.Zt.info(Ee+" call success"),i.end(),!0},kr.prototype.setDebugVerbose=function(e){var t=this.ti.createSpan(a.H,{key:et.event},{key:it},it);Object(z.b)(e)&&(this.Qt.debug=e,this.Qt.debugCustom=!0,t.setAttributes({debug:rt(e?"true":"false")})),t.end(),this.Zt.info("zm.sdv call success")},kr.prototype._setDebug=function(e){Object(z.f)(e)&&-1<e.indexOf("wss")?this.Qt.debug=ne(e):Array.isArray(e)&&0<e.length&&e.every((function(e){return Object(z.f)(e)&&-1<e.indexOf("wss")}))?this.Qt.debug=ne(e[0]):this.Zt.info("zm.0 server wrong"),this.Qt.testEnvironment=this.Qt.debug},kr.prototype.renewToken=function(e,t){var i,r,n,o,s=this,c=this.ti.createSpan(a.H,{key:at.event,par:t},{key:""},ht.event);return Object(z.g)(t)||Object(z.f)(t)&&""!=t?(r=this.getRoomModules(t)||this.Qt.roomModulesList[0])?Object(z.f)(e)&&r.roomTryHandler?(e===r.roomTryHandler.token?(this.Zt.info(Oe+" token has not changed"),c.setAttributes({error:ht.error.INPUT_PARAM.code,message:"token has not changed"}),c.end()):(c.setAttributes({token:ht.token(e)}),this.Qt.configRoomAuth?(n=function(t){var i;null!=(i=r.roomTryHandler)&&i.renewLocalToken(e,null==(i=null==t?void 0:t.body)?void 0:i.token_remain_time),s.cloudSetting.setToken(e),s.ti.setReporterInfo(s.Qt.idName||"",e),s.Qt.configCheckToken=!0,c.end(),s.Zt.info(Oe+" "+JSON.stringify(t))},o=function(t){var i=null==(i=null==t?void 0:t.body)?void 0:i.err_code;s.ti.setError(c,t),!i||1000002014!==i&&2014!==i?s.Zt.error(Oe+" "+JSON.stringify(t)):(s.Qt.configCheckToken=!1,null!=(i=r.roomTryHandler)&&i.renewLocalToken(e),s.cloudSetting.setToken(e),s.Zt.warn(Oe+" "+JSON.stringify(t)))},this.isUseNetAgent?null!=(i=this.liveRoomHandler)&&i.renewToken({token:e},n,o,r):this.service.sendMessage("renew_token",{token:e},n,o,void 0,{sessionID:r.sessionID,roomID:t,roomSessionID:r.roomSessionID})):(null!=(i=r.roomTryHandler)&&i.renewLocalToken(e),this.cloudSetting.setToken(e),this.ti.setReporterInfo(this.Qt.idName||"",e),c.end())),!0):(Object(z.f)(e)&&!r.roomTryHandler?(this.Zt.error(Oe+" calling must after loginRoom"),this.ti.setError(c,ht.error.NOT_LOGIN)):(this.Zt.error(Oe+" token must be string and not empty"),this.ti.setError(c,ht.error.INPUT_PARAM)),!1):(this.Zt.error(Oe+" calling must after loginRoom"),this.ti.setError(c,ht.error.NOT_LOGIN),!1):(this.Zt.error(Oe+" roomID must be string and no empty"),!1)},kr.prototype.setCloudSettingURLs=function(e){var t=this;this.Zt.info("zm.scsu call "),Array.isArray(e)&&0<e.length&&e.every((function(e){return Object(z.f)(e)&&-1<e.indexOf("http")}))&&this.cloudSetting.init({productNum:1,appID:this.Qt.appid,env:this.Qt.ENV,pollingNotify:function(e,i){t.Zt.info("zm.scsu"," setting file changed "+e+" "+JSON.stringify(i)),t.Qt.actionListener("_cloudSettingNotify",e,i)},reportNotify:this._cloudReportNotify.bind(this),online:!this.Qt.testEnvironment,unify:this.isUseNetAgent,connection:this.netAgent})},kr.prototype.loginRoom=function(e,t,i,r){var n=this;return this.Zt.info(Ce+" call by user "+(null==i?void 0:i.userID)+" "+e+" "+this.version),new Promise((function(o,a){return Cr(n,void 0,void 0,(function(){var n,u,l,d,h,p,f,m,v,g;return wr(this,(function(y){switch(y.label){case 0:return 1!==this.Qt.ENV?[3,2]:[4,new Promise((function(e){}))];case 1:y.sent(),y.label=2;case 2:if(u=this._loginReport(o,a,e,t,r),g=u.interResolve,n=u.interReject,u=u.loginSpan,(r=r||{}).maxMemberCount||(r.maxMemberCount=0),d=(m=this.Qt).roomModulesList,h=at.error,!(l=m.isMultiRoom)&&0<d.length)n(h.ROOM_COUNT_EXCEED);else{for(p=0;p<d.length;p++){if((f=d[p]).roomID===e)return n(h.REPEATEDLY_LOGIN),[2];if(f=f.roomTryHandler,l&&f&&f.user.userID!==i.userID)return n(h.DIFFERENT_USER_ID),[2]}if(m=new vi(e,this.Qt,this.Zt,this._dataReport,this,this.liveRoomHandler,this.service),(v=m.roomTryHandler)||(v=new Jt(this.Zt,this.Qt,m),m.roomTryHandler=v),v.init(this.Qt.roomRetryTime),v.initRoom(m.roomHandler,e,t,i,this.Qt.server,this.Qt.serverBak,r),v.setLoginRoomCallback(g,n),m.roomHandler._roomStateHandle(li,C.Logining,{code:0,msg:""}),(g=function(e,t){var i,r,n=[],o={};for(i in e)o[e[i].order]=e[i],e[i].key=i;for(r in o)n.push(o[r]);for(var s=0;s<n.length;s++)for(var a=n[s].rules,c=0;c<a.length;c++){var u={key:n[s].key,value:n[s].value,action:t.action,logger:t.logger},l=u.value,d=a[c].name?""+a[c].name:"";if((void 0===l&&d===Zt.NOT_EMPTY||void 0!==l)&&ei[d]&&(d=ei[d](u.key,l,u.action,u.logger,a[c]))!=$t)return d}return $t}({roomID:{order:0,value:e,rules:[{name:Zt.NOT_EMPTY,error:h.ROOM_ID_NULL},{name:Zt.TYPE_STRING,error:h.INPUT_PARAM,extMsg:"roomID must be string"},{name:Zt.MAX_LENGTH_128,error:h.ROOM_ID_TOO_LONG},{name:Zt.ILLEGAL_CHARACTERS,error:h.ROOM_ID_INVALID_CHARACTER}]},token:{order:1,value:t,rules:[{name:Zt.NOT_EMPTY,error:h.INPUT_PARAM},{name:Zt.TYPE_STRING,error:h.INPUT_PARAM}]},user:{order:2,value:i,rules:[{name:Zt.NOT_EMPTY,error:h.INPUT_PARAM,extMsg:" param user error."},{name:Zt.TYPE_OBJECT,error:h.INPUT_PARAM,extMsg:" param user error."}]},"user.userID":{order:3,value:i.userID,rules:[{name:Zt.NOT_EMPTY,error:h.USER_ID_NULL,extMsg:" param user error."},{name:Zt.TYPE_STRING,error:h.INPUT_PARAM,extMsg:" param userID error."},{name:Zt.MAX_LENGTH_64,error:h.USER_ID_TOO_LONG},{name:Zt.ILLEGAL_CHARACTERS,error:h.USER_ID_INVALID_CHARACTER}]},"user.userName":{order:4,value:i.userName,rules:[{name:Zt.TYPE_STRING,error:h.INPUT_PARAM,extMsg:" userName must be string."},{name:Zt.MAX_LENGTH_256,error:h.USER_NAME_TOO_LONG}]},config:{order:5,value:r,rules:[]},"config.maxMemberCount":{order:6,value:r.maxMemberCount,rules:[{name:Zt.TYPE_INTEGER,error:h.INPUT_PARAM,extMsg:" maxMemberCount must be integer number."}]}},{action:Ce,logger:this.Zt}))!==$t)m.roomHandler._roomStateHandle(ci,C.LoginFailed,g.error,g.extMsg),n(g.error,g.extMsg);else{if(this.Zt.setSessionInfo(this.Qt.appid,"","",i.userID,"",this.version),0<this.Qt.roomModulesList.length&&1==this.Qt.isMultiRoom?m.isMulti=!0:Ir([],this.Qt.roomModulesList,!0).forEach((function(e){return e.roomHandler.logout()})),r&&(m.config=r),this.Qt.roomModulesList.push(m),this.netAgent&&(this.Qt.idName=i.userID,this.netAgent.setUserInfo(i.userID),this.Qt.actionListener("_roomLogin",e,t),this.isUaConnect)&&this.fetchAppConfig(t),this.cloudSetting.setUserID(i.userID),this.cloudSetting.setToken(t),this.cloudSetting.activePolling(),u.setAttributes({id_name:i.userID}),this.ti.setCommonAttributes({id_name:i.userID}),this.ti.setReporterInfo(i.userID,t),this.Zt.setTokenInfo(t,i.userID),this.ti.setSpanInMap(u,{key:at.event,par:e}),g=this.Qt.settingConfig.getSetting("room_server",!0),Array.isArray(g)&&0<g.length&&(this.Zt.info(Ce," setting room_server "+g),this.Qt.server=g[0],this.Qt.serverBak=g[1]||g[0]),this.Qt.setMultiRoom=!0,this.isUseNetAgent){if(!this.isUaConnect)return this.Zt.info(Ce," us is not connected"),m.roomHandler.setRunState(s.trylogin),this.netAgent.connectUa(),[2];this.Qt.networkState=c.online}v.retryLoginRoom(!0)}}return[2]}}))}))}))},kr.prototype.handleLogUpload=function(e){var t="";e&&e.app_config?t=e.app_config.domain:this.Qt.appConfig&&this.Qt.appConfig.app_config&&(t=this.Qt.appConfig.app_config.domain),this.Zt.info(ke+" call"),this.Zt.url?this.Zt.info(ke+" log is connected"):(this.Qt.advanceConfig.customDomain&&this.Qt.advanceConfig.customDomain.logreport?(this.Qt.logDomain=this.Qt.advanceConfig.customDomain.logreport,t=this._getMainDomain(this.Qt.advanceConfig.customDomain.logreport)):null!=(e=this.Qt.geoFencing)&&e.logreport?(this.Qt.logDomain=null==(e=this.Qt.geoFencing)?void 0:e.logreport,t=this._getMainDomain(null==(e=this.Qt.geoFencing)?void 0:e.logreport)):this.Qt.testEnvironment?(this.Qt.logDomain="weblogger-hk-test.zegocloud.com",t="zegocloud.com"):0===this.stateCenter.ENV&&this.Qt.svrDomains.logreport?(this.Qt.logDomain=this.Qt.svrDomains.logreport,t=this._getMainDomain(this.Qt.svrDomains.logreport)):t&&(this.Qt.logDomain="weblogger".concat(this.Qt.appid,"-api.").concat(t)),t?(e="",0===this.Qt.ENV?(e="wss://".concat(this.Qt.logDomain,"/log"),this.ti.setConfig({serverUrl:"wss://".concat(this.Qt.logDomain,"/zglog/tlog")})):e="https://".concat(this.Qt.logDomain,"/httplog"),this.Zt.setLogServer(e)):this.Zt.warn(ke+" appconfig no domain"))},kr.prototype.fetchAppConfigByTargetToken=function(e,t){return Cr(this,void 0,void 0,(function(){var i,r,n,o,s;return wr(this,(function(a){switch(a.label){case 0:if(this.Zt.info(Re+" call"),!t)return this.Zt.warn(Re+" user not exist"),[2];if(i=this.getUserID(),r="",n=null,e)r=e;else{if(!(0<this.Qt.roomModulesList.length))return this.Zt.warn(Re+" token not exist"),[2];r=this.getToken()}this.Zt.roomid||this.Zt.setSessionInfo(this.Qt.appid,"player-no-room","",t,"",this.Qt.sdKVersion),a.label=1;case 1:return a.trys.push([1,3,4,5]),this.netAgent.setUserInfo(t),[4,this.netAgent.getAppConfigByAgent("init",r,5e3,this.Qt.appConfigEtag,{isSpecial:!1})];case 2:return o=a.sent(),s=o.data,0===o.code&&(this.handleLogUpload(s),n=s),[3,5];case 3:return a.sent(),this.Zt.error(Re+" token not validated"),[3,5];case 4:return i&&this.netAgent.setUserInfo(i),this.Zt.info(Re+" call success"),[2,n];case 5:return[2]}}))}))},kr.prototype.fetchAppConfig=function(e){return Cr(this,void 0,void 0,(function(){var t,i,r,n,o,s,c,u,l;return wr(this,(function(d){switch(d.label){case 0:if(this.Qt.appConfigFetched)return this.Zt.warn(Ie+" config fetched"),[2];if(!this.getUserID())return this.Zt.warn(Ie+" user not exist"),[2];if(t="",e)t=e;else{if(!(0<this.Qt.roomModulesList.length))return this.Zt.warn(Ie+" token not exist"),[2];t=this.getToken()}i=this.ti.createSpan(a.H,{key:et.event},{key:""},"/sdk_config/init"),this.Zt.info(Ce+" initConfig etag: "+this.Qt.appConfigEtag),-1!==this.Qt.appConfigEtag&&this.Qt.appConfig.speedlog_config&&void 0===this.Qt.appConfig.speedlog_config.charge_info_report_cycle&&(this.Qt.appConfigEtag=-1,this.Zt.warn(Ce+" reset etag")),r=!!this.Qt.appConfig,d.label=1;case 1:return d.trys.push([1,3,,4]),[4,this.netAgent.getAppConfigByAgent("init",t,5e3,this.Qt.appConfigEtag,{isSpecial:!1})];case 2:if(o=d.sent(),c=o.code,u=o.data,n=o.etag,o=o.retryCount,i.setAttributes({trigger_reason:Xt(this.Qt.appConfig?"refresh":"normal"),try_count:Ht(o||0)}),i.end(),this.Qt.appConfigFetched=!0,this.Zt.info(Ce+" initConfig code:"+c+" data: "+JSON.stringify(u)+" etag: "+n),this.Qt.appConfigEtag!==n){if(0==Object.keys(u).length)return this.Zt.info(Ce+" initConfig data null"),[2];this.Qt.appConfig={app_config:o=u.app_config,media_config:{publish_config:(c=u.media_config).publish_config,play_config:c=c.play_config},speedlog_config:Er(Er({},u=u.speedlog_config),{charge_info_report_no_playing:u.charge_info_report_no_playing||0})},this.Qt.appConfigEtag=n,o=JSON.stringify(this.Qt.appConfig),s=L(o,ue),U(de+"_"+this.getAppID()+"_"+(this.Qt.mode||fe.modeNo),s),c=L(this.Qt.appConfigEtag+"",ue),U(he+"_"+this.getAppID()+"_"+(this.Qt.mode||fe.modeNo),c)}return!r&&this.Qt.appConfig&&this.Qt.actionListener("_appConfigRsp"),!this.Qt.netAppConfig&&this.Qt.appConfig&&(this.Qt.netAppConfig=Object.assign(this.Qt.appConfig),this.Qt.actionListener("_netAppConfigRsp",this.Qt.netAppConfig),this._onAppConfigUpdate)&&this._onAppConfigUpdate(this.Qt.netAppConfig),[3,4];case 3:return u=d.sent(),this.Zt.error(Ce+" fail "+JSON.stringify(u)),i.setAttributes({error:null==u?void 0:u.code}),i.end(),[20012,20008,20019].includes(null==u?void 0:u.code)&&(l=20019===(null==u?void 0:u.code)?JSON.parse(JSON.stringify(P.SDK_NOT_SPECIAL)):JSON.parse(JSON.stringify(P.APPID_INVALID)),this.Qt.roomModulesList.forEach((function(e){e.roomTryHandler&&e.roomTryHandler.loginFail(l)}))),[3,4];case 4:return[2]}}))}))},kr.prototype._getCloudSetting=function(){var e,t=this;null!=(e=this.cloudSetting)&&e.fetchMultiSetting([ce,"room","rtc"]).then((function(e){var i,r;t.Zt.info(Ce," settingConfig "+JSON.stringify(e)),e&&(t.Qt.settingConfig.setSetting(null==(r=null==e?void 0:e.init)?void 0:r.setting,["remote_log_level","zip_log","detaillog_domain"]),t.Qt.actionListener("_settingCanFetch",null==e?void 0:e.rtc),(r=t.Qt.settingConfig.getSetting("remote_log_level",!0))&&(t.Zt.info("".concat(Ce," setting remote_log_level ").concat(r)),t.Zt.setRemoteLogLevel(r)),e=t.Qt.settingConfig.getSetting("zip_log"),Object(z.g)(e)||(t.Zt.info("".concat(Te," force setting zip_log ").concat(e)),t.Zt.setZipLogConfig(e,!0)),t._handleZipLogUrl(),(r=t.Qt.settingConfig.getSetting("unify",t.Qt.netHasSet))&&(t.Zt.info("".concat(Ce," unify ").concat(JSON.stringify(r))),e=r.enable,r=r.sdk_conn_ver,i=!0,i=!!(e&&fe.connectVer>=r),!0===t.isUseNetAgent)&&!1===i&&(t.cloudSetting.setOptions({unify:!1}),"connecting"!==t.Qt.connectState&&(t.Qt.connectState="connecting",t.Qt.actionListener("_connectChanged","connecting")),e=Ir([],t.Qt.roomModulesList,!0),Ir([],t.Qt.roomModulesList,!0).forEach((function(e){e.roomHandler.logout(!0,!0)})),t.Qt.useNetAgent=i,e.forEach((function(e){t.Qt.roomModulesList.push(e);var i=e.roomTryHandler;(i=i||(e.roomTryHandler=new Jt(t.Zt,t.Qt,e))).init(t.Qt.roomRetryTime),i.initRoom(e.roomHandler,e.roomID,e.token,{userID:t.Qt.idName,userName:t.Qt.nickName},t.Qt.server,t.Qt.serverBak,e.config),i.onactive=function(i,r){i?"connected"!==t.Qt.connectState&&(t.Qt.connectState="connected",t.Qt.actionListener("_connectChanged","connected",{roomID:e.roomID})):(t.Zt.info(Ce," onactive"),e.roomHandler.transError(r),e.roomHandler.disconnectedHandle(r))},i.retryLoginRoom()}))),r=t.Qt.settingConfig.getSetting("report_script"))&&(i=r.url,e=r.key,r=r.hash,t.Zt.info("".concat(Ce," report script ").concat(i," ").concat(e," ").concat(r)),t.ti.loadScript(!0,i,e,r))})).catch((function(e){t.Zt.warn(Ce," settingConfig "+JSON.stringify(e))})),this.Qt.onListener("_cloudSettingNotify",(function(e,i){var r=t.cloudSetting.getEnvVariables()||{},n=t.ti.createSpan(a.H,{key:et.event},{key:""},"/cloud_setting/refresh");n.setAttributes({request_kv:It(r),files:Rt([{name:e,content:i.setting,versions:i.versions,code:null==i?void 0:i.code,message:null==i?void 0:i.message}])}),n.end(),e===ce&&(t.Qt.settingConfig.setSetting(null==i?void 0:i.setting,["remote_log_level"]),r=t.Qt.settingConfig.getSetting("remote_log_level"))&&(t.Zt.info(Ce," setting remote_log_level "+r),t.Zt.setRemoteLogLevel(r))}))},kr.prototype._cloudReportNotify=function(e,t,i){0!==(null==i?void 0:i.code)||!1===(null==i?void 0:i.polling)?"request_start"===t?this.ti.createSpan(a.H,{key:et.event},{key:kt,par:e+""},kt,!0):"request_end"===t&&this.ti.spanEnd({key:kt,par:e+""},{request_detail:Pt(null==i?void 0:i.reportData),files:At(null==i?void 0:i.files),code:null==i?void 0:i.code,request_params:null==i?void 0:i.params,request_kv:null==i?void 0:i.requestKV}):this.Zt.info("zm.crn not report")},kr.prototype._loginReport=function(e,t,i,r,n){var o=this,s=at,c=this.ti.createSpan(a.I,{key:et.event},{key:""},s.event);return c.setAttributes({svr_env:s.svr_env(this.Qt.testEnvironment?"test":"online"),token:s.token(r)}),n&&(Object(z.b)(n.userUpdate)&&c.setAttribute("user_state_update",s.user_state_update(n.userUpdate?1:0)),Object(z.d)(n.maxMemberCount))&&c.setAttributes({max_member_cnt:s.max_member_cnt(n.maxMemberCount)}),{interResolve:function(t){var r=o.getRoomSessionID(i),n=o.getRoomModules(i),a=o.getSessionId(i);c.setAttributes({room_id:s.room_id(i),room_sid_string:s.room_sid_string(r),liveroom_sid_string:s.liveroom_sid_string(a),try_cnt:s.try_cnt(null==(r=null==n?void 0:n.roomTryHandler)?void 0:r.retryActiveCount),server:s.server(null==(a=null==n?void 0:n.roomHandler)?void 0:a.server),room_mode:s.room_mode(o.Qt.isMultiRoom?1:0),role:s.role(o.Qt.role),audience_create_room:s.audience_create_room(o.Qt.roomCreateFlag?1:0),max_member_cnt:s.max_member_cnt((null==n?void 0:n.maxMemberCount)||0)}),c.end(),e(t)},interReject:function(e,r){var n,a;void 0===r&&(r=""),c.setAttributes({room_id:s.room_id(i)}),e.code<2e9&&1e9<e.code||e.code<1e6?(n=Y(e.code,e.msg),a=ie(e.code,o.isUseNetAgent)):n={code:e.code,message:e.msg},n&&o.ti.setError(c,{code:n.code,msg:n.message+r}),a&&P[a]&&(e.code=P[a].code,e.msg.includes("unknown"))&&(e.msg=P[a].msg),t(e.code&&e.msg&&""!==r?{code:e.code,msg:e.msg+r}:e)},loginSpan:c}},kr.prototype.logoutRoom=function(e){var t=this,i=(this.Zt.info(we+" call by user "+e),[]);if(this.Qt.roomModulesList.length){if(void 0===e)Ir([],this.Qt.roomModulesList,!0).forEach((function(e){t._logoutSpan(e),i.push(e.roomID),e.roomHandler.logout(!0)})),this.cloudSetting.uninit();else{if(!Object(z.f)(e)||""==e)return this.Zt.error(we+" roomID must be string and not empty"),void this._logoutSpan(void 0,pt.error.INPUT_PARAM);var r=this.getRoomModules(e);r?(this._logoutSpan(r),i.push(e),r.roomHandler.logout(),0===this.Qt.roomModulesList.length&&this.cloudSetting.uninit()):(this.Zt.error(we+" room not exist"),this._logoutSpan(void 0,pt.error.ROOM_NOT_EXIST,e))}this.ti.deleteCommonAttributes(["id_name"]),this.ti.clearRoomSpans(i)}else this.Zt.warn(we+" no room")},kr.prototype.uploadLog=function(){var e=this;return new Promise((function(t,i){e.Zt.info("zm.zip.udlg call"),e.Zt.uploadStorageLog().then((function(){e.Zt.info("zm.zip.udlg call success"),t({errorCode:0,extendedData:"upload logs success!"})})).catch((function(t){e.Zt.error("zm.zip.udlg upload zip log failed, result: "+((null==t?void 0:t.message)||"unknown")),i({errorCode:P.UPLOAD_LOG_ERROR.code,extendedData:P.UPLOAD_LOG_ERROR.msg+", result: "+((null==t?void 0:t.message)||"unknown")})}))}))},kr.prototype.sendCustomCommand=function(e,t,i){return new Promise((function(e,t){console.error(w),t()}))},kr.prototype._sendCustomCommand=function(e,t,i){return new Promise((function(e,t){console.error(w),t()}))},kr.prototype.sendBroadcastMessage=function(e,t){return new Promise((function(e,t){console.error(w),t()}))},kr.prototype._sendBroadcastMessage=function(e,t,i,r){return void 0===i&&(i=1),void 0===r&&(r=1),new Promise((function(e,t){console.error(w),t()}))},kr.prototype.setRoomExtraInfo=function(e,t,i){return new Promise((function(e,t){console.error(w),t()}))},kr.prototype._setRoomExtraInfo=function(e,t,i){return new Promise((function(e,t){console.error(w),t()}))},kr.prototype.sendBarrageMessage=function(e,t){return new Promise((function(e,t){console.error(w),t()}))},kr.prototype._sendBarrageMessage=function(e,t,i,r){return void 0===i&&(i=1),void 0===r&&(r=1),new Promise((function(e,t){console.error(w),t()}))},kr.prototype.sendRelayMessage=function(e,t,i,r,n){console.error(w)},kr.prototype.requestJoinLive=function(e,t,i,r,n){return console.error(w),!1},kr.prototype.inviteJoinLive=function(e,t,i,r,n){return console.error(w),!1},kr.prototype.endJoinLive=function(e,t,i,r){return console.error(w),!1},kr.prototype.respondJoinLive=function(e,t,i,r,n){return console.error(w),!1},kr.prototype.getVersion=function(){return this.version},kr.prototype.setSdkBizVersion=function(e){Object(z.f)(e)&&""!==e&&(this.Qt.bizVersion=e)},kr.prototype.on=function(e,t){var i=this.ti.createSpan(a.H,{key:tt},{key:""},ot.event);return i.setAttributes({listener:ot.listener(e)}),this.Qt.listenerList[e]?Object(z.c)(t)?(-1==this.Qt.listenerList[e].indexOf(t)&&this.Qt.listenerList[e].push(t),i.end(),!0):(this.Zt.error(Ne+" listener callBack must be funciton"),this.ti.setError(i,ot.error.INPUT_PARAM," listener callBack must be function"),!1):(this.Zt.error(Ne+" event "+e+" no found"),this.ti.setError(i,ot.error.INPUT_PARAM," event "+e+" no found"),!1)},kr.prototype.off=function(e,t){var i,r=this.ti.createSpan(a.H,{key:tt},{key:""},"/sdk/off_listener");return r.setAttributes({listener:st(e)}),this.Qt.listenerList[e]?(i=this.Qt.listenerList[e],t?0<=(t=i.indexOf(t))&&i.splice(t,1):this.Qt.listenerList[e]=[],r.end(),!0):(this.Zt.error("zm.off listener no found"),this.ti.setError(r,ot.error.INPUT_PARAM," event "+e+" no found"),!1)},kr.prototype._on=function(e,t){return this.Qt.listenerList[e]?Object(z.c)(t)?(-1==this.Qt.listenerList[e].indexOf(t)&&this.Qt.listenerList[e].push(t),!0):(this.Zt.error(Ne+" listener callBack must be funciton"),!1):(this.Zt.error(Ne+" event "+e+" no found"),!1)},kr.prototype._off=function(e,t){var i;return this.Qt.listenerList[e]?(i=this.Qt.listenerList[e],t?i.splice(i.indexOf(t),1):this.Qt.listenerList[e]=[],!0):(this.Zt.error("zm.off listener no found"),!1)},kr.prototype.isTestEnvironment=function(){return this.Qt.testEnvironment},kr.prototype.isLogin=function(e){return!!(e=this.getRoomModules(e)||this.Qt.roomModulesList[0])&&e.isLogin()},kr.prototype.getMultiRoom=function(){return this.Qt.isMultiRoom},kr.prototype.getAppID=function(){return this.Qt.appid},kr.prototype.getUserID=function(){return this.Qt.idName},kr.prototype.getUserName=function(){return this.Qt.nickName},kr.prototype.getToken=function(e){return(this.getRoomModules(e)||this.Qt.roomModulesList[0]).token},kr.prototype.setRoomCreateFlag=function(e){this.Qt.roomCreateFlag=e},kr.prototype.setRole=function(e){this.Qt.role=e},kr.prototype.getSessionId=function(e){return(e=this.getRoomModules(e)||this.Qt.roomModulesList[0])?e.userSidString:"0"},kr.prototype.getRoomSessionID=function(e){return(e=this.getRoomModules(e)||this.Qt.roomModulesList[0])?e.roomSidString:"0"},kr.prototype.getAppConfig=function(){return this.Qt.appConfig},kr.prototype.setTestPackageSize=function(e){this.stateCenter.configOK&&(this.cloudSetting.zegoSetting&&(this.cloudSetting.zegoSetting.settingFetchHandler.testNetPackageSize=e),this.Qt.testNetPackageSize=e)},kr.prototype.setCloudEnv=function(e){this.cloudSetting&&(this.cloudSetting.zegoSetting.options.online="online"===e)},kr.prototype.setAccess=function(e){this.Qt.configOK&&(this.Qt.netHasSet=!0,this.Qt.useNetAgent=e,this.Qt.useNetAgent=this.getSettingUnify(!0),this.netAgent.setAccess(this.isUseNetAgent),this.cloudSetting.setOptions({unify:this.isUseNetAgent}))},kr.prototype.enableMultiRoom=function(e){var t=this.ti.createSpan(a.H,{key:et.event},{key:""},Ct.event);return Object(z.b)(e)?(t.setAttribute("is_multi",Ct.is_multi(e)),0<this.Qt.roomModulesList.length||this.Qt.setMultiRoom?(this.Zt.error("zm.emr multi room can only be set once before first login"),this.ti.setError(t,Ct.error.kInvalidParamError),!1):(t.end(),this.Qt.isMultiRoom=e,this.Qt.setMultiRoom=!0)):(this.Zt.error("zm.emr param must be boolean"),this.ti.setError(t,Ct.error.kAlreadyLoginError),!1)},kr.prototype.getRoomModules=function(e){return this.Qt.roomModulesList.find((function(t){return t.roomID==e}))},kr.prototype._onAppConfigUpdate=function(e){},kr.prototype._onBeforePageUnload=function(){},kr.use=function(e){switch(e.type){case"message":case"live":e.install(kr,vi,bi,ir)}},kr.setGeoFence=function(e,t){if(![0,1,2].includes(e))throw new Error("GeoFencing set Error");if(!t.every((function(e){return ve.find((function(t){return t===e}))})))throw new Error("GeoFencing set Error");kr.geoFenceType=e,kr.geoFenceAreaList=t},kr.setEngineOptions=function(e){if(e.geoFenceType){if(![0,1,2].includes(e.geoFenceType))throw new Error("GeoFencing set Error");kr.geoFenceType=e.geoFenceType}if(e.geoFenceAreaList){if(!e.geoFenceAreaList.every((function(e){return me.find((function(t){return t.id===e}))})))throw new Error("GeoFencing set Error");kr.geoFenceAreaList=e.geoFenceAreaList}if(e.customDomain&&e.customDomain&&"object"==_typeof(e.customDomain)){if(e.customDomain.accesshub&&"string"!=typeof e.customDomain.accesshub)throw new Error("config of customDomain.accesshub should be a string.");if(e.customDomain.logreport&&"string"!=typeof e.customDomain.logreport)throw new Error("config of customDomain.logreport should be a string.");if(e.customDomain.detaillog&&"string"!=typeof e.customDomain.detaillog)throw new Error("config of customDomain.detaillog should be a string.");kr.customDomain=e.customDomain}kr.engineOptions=e},kr.prototype.resetRoomTokenTimer=function(e,t){(e=this.getRoomModules(e)||this.Qt.roomModulesList[0])&&t&&0<t&&e.roomHandler.resetTokenTimer(1e3*t)},kr.prototype.isDisConnect=function(){return(this.isUseNetAgent?this.liveRoomHandler:this.service).isDisConnect()},kr.prototype.sendMessage=function(e,t,i,r){this.liveRoomHandler.sendMessage(e,t,i,r)},kr.prototype.getNetworkInfo=function(){return this.netAgent.getNTP()},kr.prototype.setProtoFormat=function(e){if(!["json","pb"].includes(e=void 0===e?"json":e))throw new Error("Failed to execute 'setProtoFormat': Arguments 'format' must be 'json' or 'pb'.");this.Qt.protoFormat=e},kr.prototype.setSdkLoginRelateService=function(e){Array.isArray(e)&&e.every((function(e){return Object(z.f)(e)}))&&(this.Qt.relateService=e)},kr.prototype.getRoomID=function(){return this.Qt.roomid},kr.prototype.getServerTimeOffset=function(){return this.Qt.serverTimeOffset},kr.prototype.getReqHead=function(e){return e=Object(z.f)(e)&&""!==e&&this.getRoomModules(e)||this.Qt.roomModulesList[0],this.liveRoomHandler.getReqHead(e)},kr.prototype.sendSwitchMessage=function(e,t){throw this.Zt.error("".concat("zm.ssm"," ").concat(P.WHITE_BOARD_VERSION_ERROR.msg)),P.WHITE_BOARD_VERSION_ERROR},kr.prototype.onSwitchMessage=function(e){e&&this.liveRoomHandler&&(this.liveRoomHandler.onSwitchMessage=e)},kr.prototype.onAppConfigUpdate=function(e){e&&(this._onAppConfigUpdate=e)},kr.prototype.onBeforePageUnload=function(e){e&&(this._onBeforePageUnload=e)},kr.prototype.getProtoVer=function(){return r.SWITCH_TWO},kr.prototype.sendBusinessMessage=function(e,t,i){return Object(z.d)(e)&&t?this.liveRoomHandler.sendMessage(e,t,void 0,void 0,i,void 0,!1):-1},kr.prototype._logoutSpan=function(e,t,i){var r,n=this,o=this.ti.createSpan(a.I,{key:et.event},{key:pt.event,par:null==e?void 0:e.roomID},pt.event,!0);o.setAttributes({is_multi:pt.is_multi(this.Qt.isMultiRoom),is_send_cmd_net:pt.is_send_cmd_net(!0)}),e?((r=e.roomHandler).updateTimes(),o.setAttributes({room_id:pt.room_id(null==e?void 0:e.roomID),room_sid_string:pt.room_sid_string(null==e?void 0:e.roomSidString),liveroom_sid_string:pt.liveroom_sid_string(null==e?void 0:e.userSidString),valid_d:r.validTime,total_d:r.totalTime,tempbroken_cnt:r.brokenCounts})):Object(z.f)(i)&&o.setAttributes({room_id:pt.room_id(i),valid_d:0,total_d:0,tempbroken_cnt:0}),t?this.ti.setError(o,t):o.end(),setTimeout((function(){n.ti.flush()}),200)},kr.prototype.getMsgSpan=function(e,t,i){return this.ti.createSpan(a.H,{key:at.event,par:t},{key:e,par:t},e,i=void 0!==i&&i)},kr.prototype._updateTimeOffsetInterval=function(){var e=this;Object(z.d)(this.netAgent.timeOffset)&&this.ti.setTimeOffset(this.netAgent.timeOffset),this.timeOffsetUpdateTimer=setTimeout((function(){e._updateTimeOffsetInterval()}),9e5)},kr.prototype.setLocalGeoFencing=function(){var e;null!=(e=this.Qt.netGeoFencing)&&e.id&&null!=(e=this.Qt.netGeoFencing)&&e.accesshub&&(e=L(JSON.stringify(this.Qt.netGeoFencing),ue),U("z_geos_"+this.Qt.appid+"_"+(this.Qt.mode||fe.modeNo),e),this.Qt.netGeoFencing={})},kr.prototype.getLocalGeoFencing=function(){var e=B("z_geos_"+this.Qt.appid+"_"+(this.Qt.mode||fe.modeNo));if(e){if(e=x(e,ue))try{return JSON.parse(e)}catch(e){this.Zt.warn("zm.glgf local geo descrypt fail")}}else this.Zt.info("zm.glgf no local geo");return null},kr.prototype.getGeoDomains=function(){if(kr.geoFenceType&&kr.geoFenceAreaList){this.Zt.info("".concat(Pe," geo type ").concat(kr.geoFenceType," area ").concat(kr.geoFenceAreaList.join(",")));var e=void 0,t=[],i=this._getGeoFencingIDAndDomain(kr.geoFenceType,kr.geoFenceAreaList);if(!i)throw this.Zt.warn("".concat(Pe," geofencing not exist")),P.GEO_SET_ERROR;var r,n=this.getLocalGeoFencing(),o=!1;null!=n&&n.id&&(r=i.find((function(e){return e.id===(null==n?void 0:n.id)})))&&(o=!0,e={id:null==n?void 0:n.id,accesshub:(null==n?void 0:n.accesshub)||(null==r?void 0:r.accesshub),logreport:(null==n?void 0:n.logreport)||(null==r?void 0:r.logreport),detaillog:(null==n?void 0:n.detaillog)||(null==r?void 0:r.detaillog)},null!=n&&n.accesshub&&t.push(null==n?void 0:n.accesshub),t.push(null==r?void 0:r.accesshub)),o||(e={id:(r=i[0]).id,accesshub:o=r.accesshub,logreport:r.logreport,detaillog:r.detaillog},t.push(o)),this.Qt.geoFencing=e,this.Zt.info("".concat(Pe," use geo ").concat(JSON.stringify(this.Qt.geoFencing))),i=t}return i},kr.prototype._getGeoFencingIDAndDomain=function(e,t){var i=this.hashMainDomain(),r=JSON.parse(JSON.stringify(me)),n=(r.forEach((function(e){e.accesshub+="."+i,e.logreport+="."+i,e.detaillog+="."+i})),[]);return 1===e?t.forEach((function(e){var t=r.find((function(t){return t.id===e}));t&&n.push(t)})):2===e&&(n=JSON.parse(JSON.stringify(r)),t.forEach((function(e){var t=r.find((function(t){return t.id===e}));t&&(n=n.filter((function(e){return e.id!==(null==t?void 0:t.id)})),t.relative_geofencings.forEach((function(e){n=n.filter((function(t){return t.id!==e}))})))}))),0<n.length?n:null},kr.setCloudProxyConfig=function(e,t,i){i?this.proxyCtrl||(this.proxyCtrl=new br(e,t)):(null!=(i=this.proxyCtrl)&&i.destroy(),this.proxyCtrl=null)},kr.setLocalProxyConfig=function(e,t){t?this.proxyCtrl||(this.proxyCtrl=new Sr(e)):(null!=(t=this.proxyCtrl)&&t.destroy(),this.proxyCtrl=null)},kr.rtmVersion="2.4.0",kr.customDomain={},kr.proxyCtrl=null,kr.pageID="",kr);function kr(e,t,i,r,o,s,u,l){var d,h,m,v=this,g=(this.Zt=i,this._dataReport=r,this.ti=o,this.version=s,this._options=l,this.service={},this.Ti=null,this.Ii=1e3,this.id="",this._roomLoginResponseListener=function(){clearTimeout(v.cloudSettingTimer),v.cloudSettingTimer=setTimeout((function(){v.Zt.info(Ce+" fetch cloud setting"),v._getCloudSetting()}),100)},this.Qt=new ti(this.Zt,this._dataReport),this.Qt.ENV=u,this.Qt.product=ae.product,this.Qt.advanceConfig=Er(Er({},this.Qt.advanceConfig),{customDomain:kr.customDomain}),this.cloudSetting=new or(null==(i=kr.engineOptions)?void 0:i.closeCloudSetting),this.getReportSeq=f,this.getSeq=p,this._initCallback(),this.Qt.deviceID=(void 0===(r=u)&&(r=0),(o=B("z_deviceID"))||((new Date).getTime(),U("z_deviceID",o=se(r)),o)),kr.pageID||(kr.pageID=se(u)),s=this.Qt.id=se(u),this.logger.info("".concat(Te," deviceID: ").concat(this.Qt.deviceID,", pageID: ").concat(kr.pageID,", instID: ").concat(s)),this.ti.init(e,u,this.Qt.deviceID),this.ti.setLogger(this.Zt),this.Qt.reporter=this.ti,et),y=this.ti.createSpan(a.H,{key:""},{key:g.event},g.event,!0);0!=u&&1!=u||this._setDebug(t),l="Express",null!=(i=this._options)&&i.reportData&&(d=null==(o=null==(r=this._options)?void 0:r.reportData)?void 0:o.version,l=(null==(i=null==(s=this._options)?void 0:s.reportData)?void 0:i.project)||l),y.setAttributes({biz_type:g.biz_type(0),project:g.project(l),servers:g.servers(Object(z.f)(t)?[t]:t),liveroom_version:g.liveroom_version(d),is_from_cache:g.is_from_cache(!1),sev_env:g.sev_env(this.Qt.testEnvironment?"test":"online")}),function(e,t,i){if(e&&Object(z.d)(e)&&Q(e)){if(t&&(Object(z.f)(t)||Array.isArray(t))&&""!=t)return 1;i.error("ccp.0 server must be string or string array and not empty")}else i.error("ccp.0 appid must be positive integer number and not empty")}(e,t,this.Zt)?(this.Qt.appid=e,this.Qt.configOK=!0,this.Qt.sdKVersion=this.version,this.Qt.testEnvironment&&(this.Qt.mode=S.MODE_TEST),this.netAgent=new R,this.Zt.setSessionInfo(this.Qt.appid,"","","","",this.version),this.netAgent.init(),this.netAgent.setLogger(this.Zt),r={appID:this.Qt.appid,env:this.Qt.ENV,mode:this.Qt.mode},kr.engineOptions&&kr.engineOptions.pri&&(r.model=1),kr.geoFenceType&&kr.geoFenceAreaList&&(r.geoFencing={type:kr.geoFenceType,list:kr.geoFenceAreaList}),this.netAgent.setAppInfo(r),this.liveRoomHandler=new ir(this.Zt,this.Qt,this.netAgent,this._dataReport,this),this.service=new bi(this.Qt,this.Zt,this),o="",0===u?o="rtc":1===u&&(o="ali"),this.Qt.settingConfig=new Si(null==(s=kr.engineOptions)?void 0:s.closeCloudSetting),this.cloudSetting.setLog(this.Zt),this.cloudSetting.init({productNum:1,appID:e,env:u,pollingNotify:function(e,t){v.Zt.info(Te," setting file changed "+e+" "+JSON.stringify(t)),v.Qt.actionListener("_cloudSettingNotify",e,t)},reportNotify:this._cloudReportNotify.bind(this),online:!this.Qt.testEnvironment,unify:this.isUseNetAgent,connection:this.netAgent}),(i=this.Qt.settingConfig.getSetting("remote_log_level"))&&(this.Zt.info("".concat(Te," setting remote_log_level default ").concat(i)),this.Zt.setRemoteLogLevel(i)),l=this.Qt.settingConfig.getSetting("zip_log"),Object(z.g)(l)||(this.Zt.info("".concat(Te," setting zip_log default ").concat(l)),this.Zt.setZipLogConfig(l)),this.cloudSetting.setEnvVariable("environment",o),d=this.cloudSetting.getSettingCache(ce),r=this.cloudSetting.getSettingCache("room"),h=!1,m=setTimeout((function(){v.Zt.warn("".concat(Te," time out, get cache settings failed!")),v.isUseNetAgent&&(h=!0,v.bi(),v.getStoreAppConfig()),y.setAttributes({use_na:g.use_na(v.isUseNetAgent?1:0)}),y.end()}),3e3),Promise.all([d,r]).then((function(i){m&&clearTimeout(m);var r=null==i?void 0:i[0],n=(v.Qt.settingConfig.setSetting(null==r?void 0:r.setting),v.Qt.useNetAgent=v.getSettingUnify(v.Qt.netHasSet),v.cloudSetting.setOptions({unify:v.isUseNetAgent}),v.isUseNetAgent&&!h&&(v.bi(),v.getStoreAppConfig()),(n=v.Qt.settingConfig.getSetting("remote_log_level",!0))&&(v.Zt.info("".concat(Te," setting remote_log_level ").concat(n)),v.Zt.setRemoteLogLevel(n)),v._handleZipLogUrl(),v.Qt.settingConfig.getSetting("zip_log")),o=(Object(z.g)(n)||(v.Zt.info("".concat(Te," setting zip_log ").concat(n)),v.Zt.setZipLogConfig(n)),(n=v.Qt.settingConfig.getSetting("report_script"))?(o=n.url,s=n.key,n=n.hash,v.Zt.info("".concat(Te," report script ").concat(o," ").concat(s," ").concat(n)),v.ti.loadScript(!1,o,s,n),y.setAttributes({lua_md5:g.lua_md5(n)})):v.ti.loadScript(!1,"","",""),null==i?void 0:i[1]),s=(v.Qt.settingConfig.setSetting(null==o?void 0:o.setting),v.ti.createSpan(a.H,{key:g.event},{key:""},"/cloud_setting/cache"));if(s.setAttributes({files:wt([{name:ce,content:JSON.stringify(null==r?void 0:r.setting),versions:JSON.stringify(null==r?void 0:r.versions),code:0,message:""},{name:"room",content:JSON.stringify(null==o?void 0:o.setting),versions:JSON.stringify(null==o?void 0:o.versions),code:0,message:""}])}),s.end(),y.setAttributes({use_na:g.use_na(v.isUseNetAgent?1:0)}),y.end(),n=Array.isArray(t)?t[0]:t,!v.isUseNetAgent&&(i=e,(r=((null==(r=n)?void 0:r.replace("webliveroom","-"))||"").split("-")||[])[1])&&/\d*/i.test(r[1])&&+r[1]!=i)throw v.Zt.error("".concat(Te," the server does not match the appID")),new Error("The server does not match the appID")})).catch((function(e){if(m&&clearTimeout(m),y.setAttributes({use_na:g.use_na(v.isUseNetAgent?1:0)}),y.end(),v.Zt.warn("".concat(Te," initConfig ").concat(JSON.stringify(e))),(null==e?void 0:e.code)===P.GEO_SET_ERROR.code)throw Error("GeoFencing set Error")})),Object(z.f)(t)?(this.Qt.server=t,this.Qt.serverBak=t):Array.isArray(t)&&0<t.length&&(this.Qt.server=t[0],this.Qt.serverBak=t[1]||t[0]),this.Zt.info("".concat(Te," ").concat(null!=(s=null===navigator||void 0===navigator?void 0:navigator.appVersion)?s:""," ").concat(this.version," rtmVersion: ").concat(kr.rtmVersion," logVersion:").concat(n.ZegoLogger.logVersion)),this._bindWindowListener(),this.Qt.networkState=!navigator||navigator.onLine?c.online:c.offline,u="Firefox"===O()?null===navigator||void 0===navigator?void 0:navigator.userAgent:null===navigator||void 0===navigator?void 0:navigator.appVersion,y.setAttribute("sys_info",u||""),this._initSpans(),this.Zt.setSessionInfo(this.Qt.appid,"","","","",this.version)):(this.Zt.error("".concat(Te," init sdk error")),this.ti.setError(y,g.error.kInvalidParamError)),this.Qt.onListener("roomLoginResponse",this._roomLoginResponseListener)}var Pr=i(8),Ar=function(){return(Ar=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Dr=(Nr.prototype.init=function(e,t,i){var r=this;this._tracer.init({product:this._product,version:"1.0.0",env:t,appID:e,deviceID:i,importantLevel:ae.importLevel,levels:ae.levels,bps:ae.bps,spanStart:function(e){try{Object(z.c)(window.scriptSpanStart)&&scriptSpanStart(r.commonStates,r._tracer,e)}catch(e){r.Zt.warn("zm.tc.ii dy span start "+e)}},spanBeforeEnd:function(e){e.setAttribute("ntype_end",M())},spanEnd:function(e,t){try{Object(z.c)(window.scriptSpanEnd)&&scriptSpanEnd(r.commonStates,r._tracer,e)}catch(e){r.Zt.warn("zm.tc.ii dy span end ",JSON.stringify(e))}},resources:{product:this._product,appid:e,device_id:i,console:0==t?"rtc":"ali"}})},Nr.prototype.setConfig=function(e){this._tracer.setConfig(e)},Nr.prototype.loadScript=function(e,t,i,r){return function(e,t,i,r){return new(i=i||Promise)((function(t,n){function o(e){try{a(r.next(e))}catch(e){n(e)}}function s(e){try{a(r.throw(e))}catch(e){n(e)}}function a(e){var r;e.done?t(e.value):((r=e.value)instanceof i?r:new i((function(e){e(r)}))).then(o,s)}a((r=r.apply(e,[])).next())}))}(this,0,void 0,(function(){var n;return function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){var u=[a,c];if(i)throw new TypeError("Generator is already executing.");for(;o=s&&u[s=0]?0:o;)try{if(i=1,r&&(n=2&u[0]?r.return:u[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,u[1])).done)return n;switch(r=0,(u=n?[2&u[0],n.value]:u)[0]){case 0:case 1:n=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3]))o.label=u[1];else if(6===u[0]&&o.label<n[1])o.label=n[1],n=u;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(u)}}u=t.call(e,o)}catch(c){u=[6,c],r=0}finally{i=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._tracer.loadJs(e,t,i,r,"\nfunction scriptSpanStart(states, tracer, span) {\n \n}\nfunction scriptSpanEnd(states, tracer, span) {\n if (span['tags']['msg_content']) {\n span['tags']['msg_content_size'] = span['tags']['msg_content'].length;\n delete span['tags']['msg_content'];\n }\n delete span['tags']['resp'];\n const filterSpans = ['/rtc/login', '/rtc/hb', '/rtc/recv_remote_stream'];\n if (filterSpans.includes(span.name)) {\n console.log(span.name + ' do not report');\n span.droped = true;\n }\n}\nfunction scriptInit(states, tracer) {\n\n}\n\n",{})];case 1:return o.sent(),Object(z.c)(window.scriptInit)&&scriptInit(this.commonStates,this._tracer),[3,3];case 2:return n=o.sent(),this.Zt.warn("zm.tc.ls"," load script fail "+JSON.stringify(n)),[3,3];case 3:return[2]}}))}))},Nr.prototype.setReporterInfo=function(e,t){var i=new Map;i.set("userID",e),i.set("token",t),this._tracer.startReport(i)},Nr.prototype.flush=function(e){this._tracer.flush(e)},Nr.prototype.destroy=function(){this._tracer.destroy()},Nr.prototype.setCommonStates=function(e){this.commonStates=e},Nr.prototype.setResource=function(e){this._tracer.setResource(e)},Nr.prototype.setCommonAttributes=function(e){this._commonAttrs=Object.assign({},this._commonAttrs,e)},Nr.prototype.deleteCommonAttributes=function(e){var t=this;e.forEach((function(e){delete t._commonAttrs[e]}))},Nr.prototype.createSpan=function(e,t,i){return(e=this._tracer.createSpan(e,t,{parent:i})).setAttributes(Ar({ntype:M(),os_type:this.osType,error:0,message:""},this._commonAttrs)),e},Nr.prototype.spanEnd=function(e,t){e&&t&&e.setAttributes(Ar({},t)),e&&e.end()},Nr.prototype.spanSetAttributes=function(e,t){e&&e.setAttributes(t)},Nr.prototype.spanAppendAttribute=function(e,t,i){e&&e.appendAttribute(t,i)},Nr.prototype.setError=function(e,t,i){e.setAttributes({error:t.code||t.errorCode,message:(t.msg||t.message||t.extendedData)+" "+(i=void 0===i?"":i)}),e.end()},Nr.prototype.setLogger=function(e){this._tracer.setLogger(e)},Nr.prototype.setTimeOffset=function(e){this._tracer.setTimeOffset(e)},Nr.prototype.setUnloadState=function(e){this.isUnload=!0,this._tracer.setUnloadState(e)},Nr.prototype.setNetStateCheck=function(){this._tracer.setNetStateCheck()},Nr);function Nr(e){this.Zt=e,this._product=ae.product,this._commonAttrs={},this.commonStates={},this.isUnload=!1,new Pr.DynamicCode,this._tracer=new Pr.ZegoTracer(Rr.proxyCtrl),this._tracer.setSampleConfig({level:a.L}),this.osType=Qi()}var Or=["/sdk/start_publish","/publish/start","/publish/restart"],Mr=["/sdk/start_play","/play/start","/play/restart"],Lr=(xr.prototype.init=function(e,t,i){this.tracerHandler.init(e,t,i)},xr.prototype.setConfig=function(e){this.tracerHandler.setConfig(e)},xr.prototype.loadScript=function(e,t,i,r){return this.tracerHandler.loadScript(e,t,i,r)},xr.prototype.setReporterInfo=function(e,t){this.tracerHandler.setReporterInfo(e,t)},xr.prototype.flush=function(e){this.tracerHandler.flush(e)},xr.prototype.destroy=function(){this.tracerHandler.destroy()},xr.prototype.setCommonStates=function(e){this.tracerHandler.setCommonStates(e)},xr.prototype.setResource=function(e){this.tracerHandler.setResource(e)},xr.prototype.setCommonAttributes=function(e){this.tracerHandler.setCommonAttributes(e)},xr.prototype.deleteCommonAttributes=function(e){this.tracerHandler.deleteCommonAttributes(e)},xr.prototype.clearRoomSpans=function(e){var t=this;e.forEach((function(e){for(var i in t._reportList)null==t._reportList[i].span&&delete t._reportList[i][e]}))},xr.prototype.setPublicPros=function(e){this._publicPros=Object.assign({},this._publicPros,e)},xr.prototype.createSpan=function(e,t,i,r,n){var o;t&&t.key&&t.par?(s=t.par1?"_"+t.par1:"",!(o=null==(o=this._reportList[t.key])?void 0:o[t.par+s])&&t.bak_key&&(o=null==(a=this._reportList[t.bak_key])?void 0:a[t.par+s])):t&&!(o=this._reportList[t.key])&&t.bak_key&&(o=this._reportList[t.bak_key]);var s,a=this.tracerHandler.createSpan(e,r,o=o||this._reportList[et.event]);return"/sdk/login"===t.key&&(a.setAttribute("room_id",t.par),this._publicPros[t.par])&&a.setAttributes(this._publicPros[t.par]),(Or.includes(t.key)||Mr.includes(t.key))&&a.setAttribute("stream_id",t.par),Or.includes(t.key)&&this._publicPros["_publish_"+t.par]&&a.setAttributes(this._publicPros["_publish_"+t.par]),Mr.includes(t.key)&&this._publicPros["_play_"+t.par]&&a.setAttributes(this._publicPros["_play_"+t.par]),n&&(i.par?(this._reportList[i.key]||(this._reportList[i.key]={}),this._reportList[i.key][i.par+(s=i.par1?"_"+i.par1:"")]=a):this._reportList[i.key]=a),a},xr.prototype.setSpanInMap=function(e,t){t.par?(this._reportList[t.key]||(this._reportList[t.key]={}),this._reportList[t.key][t.par+(t.par2?"_"+t.par2:"")]=e):this._reportList[t.key]=e},xr.prototype.spanEnd=function(e,t,i){var r;e.par?(r=e.par1?"_"+e.par1:"",r=this._reportList[e.key]&&this._reportList[e.key][e.par+r],this._reportList[e.key]&&!i&&delete this._reportList[e.key][e.par]):(r=this._reportList[e.key],i||delete this._reportList[e.key]),this.tracerHandler.spanEnd(r,t)},xr.prototype.spanSetAttributes=function(e,t){var i,r;e.par?(i=e.par1?"_"+e.par1:"",!(r=this._reportList[e.key]&&this._reportList[e.key][e.par+i])&&e.bak_key&&(r=this._reportList[e.bak_key]&&this._reportList[e.bak_key][e.par+i])):!(r=this._reportList[e.key])&&e.bak_key&&(r=this._reportList[e.key]),this.tracerHandler.spanSetAttributes(r,t)},xr.prototype.spanAppendAttribute=function(e,t,i){var r,n;e.par?(r=e.par1?"_"+e.par1:"",!(n=this._reportList[e.key]&&this._reportList[e.key][e.par+r])&&e.bak_key&&(n=this._reportList[e.bak_key]&&this._reportList[e.bak_key][e.par+r])):!(n=this._reportList[e.key])&&e.bak_key&&(n=this._reportList[e.key]),this.tracerHandler.spanAppendAttribute(n,t,i)},xr.prototype.setError=function(e,t,i){this.tracerHandler.setError(e,t,i)},xr.prototype.setLogger=function(e){this.tracerHandler.setLogger(e)},xr.prototype.setTimeOffset=function(e){this.tracerHandler.setTimeOffset(e)},xr.prototype.setUnloadState=function(e){this.tracerHandler.setUnloadState(e)},xr.prototype.setNetStateCheck=function(){this.tracerHandler.setNetStateCheck()},xr);function xr(e){this.Zt=e,this._reportList={},this._publicPros={},this.tracerHandler=new Dr(e)}Br.prototype.enableMultiRoom=function(e){return this.zegoWebRTM.enableMultiRoom(e)},Br.prototype.loginRoom=function(e,t,i,r){return this.zegoWebRTM.loginRoom(e,t,i,r)},Br.prototype.logoutRoom=function(e){return this.zegoWebRTM.logoutRoom(e)},Br.prototype.renewToken=function(e,t){return this.zegoWebRTM.renewToken(e,t)},Br.prototype.sendBarrageMessage=function(e,t){return this.zegoWebRTM.sendBarrageMessage(e,t)},Br.prototype.sendBroadcastMessage=function(e,t){return this.zegoWebRTM.sendBroadcastMessage(e,t)},Br.prototype.sendCustomCommand=function(e,t,i){return this.zegoWebRTM.sendCustomCommand(e,t,i)},Br.prototype.setRoomExtraInfo=function(e,t,i){return this.zegoWebRTM.setRoomExtraInfo(e,t,i)},Br.prototype.setLogConfig=function(e){return this.zegoWebRTM.setLogConfig(e)},Br.prototype.setDebugVerbose=function(e){return this.zegoWebRTM.setDebugVerbose(e)},Br.prototype.on=function(e,t){return this.zegoWebRTM.on(e,t)},Br.prototype.getVersion=function(){return this.zegoWebRTM.getVersion()},Br.prototype.off=function(e,t){return this.zegoWebRTM.off(e,t)},Br.use=function(e){Rr.use(e)},Br.setGeoFence=function(e,t){Rr.setGeoFence(e,t)},Br.setEngineOptions=function(e){Rr.setEngineOptions(e)},Br.setCloudProxyConfig=function(e,t,i){Rr.setCloudProxyConfig(e,t,i)},Br.setLocalProxyConfig=function(e,t){Rr.setLocalProxyConfig(e,t)},Br.version="2.4.0";var Ur=Br;function Br(e,t,i,r){var o;void 0===i&&(i=0),null!=(o=Rr.proxyCtrl)&&o.init({appID:e}),this.logger=new n.ZegoLogger(i,Rr.proxyCtrl||void 0),this.dataReport=new n.ZegoDataReport(this.logger),this.reporter=new Lr(this.logger),this.zegoWebRTM=new Rr(e,t,this.logger,this.dataReport,this.reporter,Br.version,i,r)}}],a={},o.m=s,o.c=a,o.d=function(e,t,i){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==_typeof(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(i,r,function(t){return e[t]}.bind(null,r));return i},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=21);function o(e){var t;return(a[e]||(t=a[e]={i:e,l:!1,exports:{}},s[e].call(t.exports,t,t.exports,o),t.l=!0,t)).exports}var s,a}(i(1583),i(2100),i(8103),i(9483),i(6344))},812:function(e){"undefined"!=typeof self&&self,e.exports=function(){return t={0:function(e,t,i){"use strict";function r(e){return"number"==typeof e}function n(e){return"string"==typeof e}function o(e){return"boolean"==typeof e}function s(e){return void 0===e}function a(e){return null!==e&&e instanceof Object}function c(e){return"function"==typeof e}function u(e){return e instanceof Array}i.d(t,"d",(function(){return r})),i.d(t,"f",(function(){return n})),i.d(t,"b",(function(){return o})),i.d(t,"g",(function(){return s})),i.d(t,"e",(function(){return a})),i.d(t,"c",(function(){return c})),i.d(t,"a",(function(){return u}))},23:function(e,t,i){"use strict";function r(e){return e}i.r(t);var n="zm.lv.ssg",o="zm.lv.pss",s="/liveroom/send_end_join_live",a=r,c=r,u="/liveroom/send_invite_join_live",l=r,d=r,h="/liveroom/send_join_live_result",p=r,f=r,m="/liveroom/send_request_join_live",v=r,g=r,y={code:1002014,msg:"room not exist"},b={code:1002099,msg:"room inner error"},_=i(0),S=(Object.defineProperty(T.prototype,"u",{get:function(){return this.h.reporter},enumerable:!1,configurable:!0}),T.prototype.resetLiveHandler=function(){this.joinLiveCallbackMap={},this.joinLiveRequestMap={}},T.prototype.getSignalCmdContent=function(e,t,i){return e={request_id:e,room_id:this.room.roomID,from_userid:this.h.idName,from_username:this.h.nickName,to_userid:t},null!=i&&(e.result=i),JSON.stringify(e)},T.prototype.requestJoinLive=function(e,t,i,r){var n,o=this.h.getRequestId(),s=this.getSignalCmdContent(o,e);return null!=r&&(this.u.spanSetAttributes({key:m,par:null==(n=this.room)?void 0:n.roomID},{request_id:g(o)}),this.joinLiveCallbackMap[o]=r,this.sendSignalCmd(1001,s,e,t,i),!0)},T.prototype.sendSignalCmd=function(e,t,i,r,o){var s=this;this.room.isLogin()?((this.h.useNetAgent?this.liveRoomHandler:this.service).sendSignalCmd({sub_cmd:e,signal_msg:t,dest_id_name:[i]},(function(e){r&&r(e.header.seq)}),(function(e){var t=b;e.header&&e.body?o&&o(s.rtm.getServerError(e.body.err_code),e.header.seq):(e.code&&e.msg&&(t=e),o&&o(t,0))}),this.room),this.v.info(n+" call success"+e)):this.v.error(n+" state error")},T.prototype.inviteJoinLive=function(e,t,i,r){var n,o=this.h.getRequestId(),s=this.getSignalCmdContent(o,e);return null!=r&&(this.u.spanSetAttributes({key:u,par:null==(n=this.room)?void 0:n.roomID},{request_id:d(o)}),this.joinLiveCallbackMap[o]=r,this.sendSignalCmd(1003,s,e,t,i),!0)},T.prototype.endJoinLive=function(e,t,i){var r,n=this.h.getRequestId(),o=this.getSignalCmdContent(n,e);return this.u.spanSetAttributes({key:s,par:null==(r=this.room)?void 0:r.roomID},{request_id:c(n)}),this.sendSignalCmd(1004,o,e,t,i),!0},T.prototype.respondJoinLive=function(e,t,i,r){var n=this.joinLiveRequestMap[e];if(!n)return this.v.info("zm.lv.rjl no dest id name"),!1;this.u.spanSetAttributes({key:h,par:null==(o=this.room)?void 0:o.roomID},{to_user_id:p(n)});var o=0;return t=this.getSignalCmdContent(e,n,o=!0===t?1:o),this.sendSignalCmd(1002,t,n,i,r),delete this.joinLiveRequestMap[e],!0},T.prototype.handlePushSignalMsg=function(e){var t=JSON.parse(e.body.signal_msg);switch(this.v.info(o+" hpsm= ",t),e.body.sub_cmd){case 11001:this.handlePushJoinLiveRequestMsg(t);break;case 11002:this.handlePushJoinLiveResultMsg(t);break;case 11003:this.handlePushJoinLiveInviteMsg(t);break;case 11004:this.handlePushJoinLiveStopMsg(t)}},T.prototype.handlePushJoinLiveRequestMsg=function(e){var t,i=e.request_id;Object(_.f)(i)?(t=e.from_userid,Object(_.f)(t)?(this.joinLiveRequestMap[i]=t,this.onRecvJoinLiveRequest(i,e.from_userid,e.from_username,e.room_id),this.v.info(o+" onRecvJoinLiveRequest "+t)):this.v.error(o+" no from user")):this.v.error(o+" no requestId")},T.prototype.onRecvJoinLiveRequest=function(e,t,i,r){this.h.actionListener("recvJoinLiveRequest",e,t,i,r)},T.prototype.handlePushJoinLiveInviteMsg=function(e){var t,i=e.request_id;Object(_.f)(i)?(t=e.from_userid,Object(_.f)(t)?(this.joinLiveRequestMap[i]=t,this.onRecvInviteJoinLiveRequest(i,e.from_userid,e.from_username,e.room_id),this.v.info(o+" onRecvInviteJoinLiveRequest "+t)):this.v.error(o+" no from user")):this.v.error(o+"no requestId")},T.prototype.onRecvInviteJoinLiveRequest=function(e,t,i,r){this.h.actionListener("recvInviteJoinLiveRequest",e,t,i,r)},T.prototype.handlePushJoinLiveResultMsg=function(e){var t,i,r=e.request_id;Object(_.f)(r)?null==(t=e.result)?this.v.info(o+" no result"):(t=1==t,this.joinLiveCallbackMap[r]&&((i=this.joinLiveCallbackMap[r])?(this.v.info(o+" joinLiveRequest/invite result "+t),delete this.joinLiveCallbackMap[r],i(t,e.from_userid,e.from_username)):this.v.info(o+" no callback"))):this.v.error(o+" no requestId")},T.prototype.handlePushJoinLiveStopMsg=function(e){var t=e.request_id;Object(_.f)(t)?(this.v.info(o+" onRecvEndJoinLiveCommand "+e.from_userid),this.onRecvEndJoinLiveCommand(t,e.from_userid,e.from_username,e.room_id)):this.v.error(o+" no requestId")},T.prototype.onRecvEndJoinLiveCommand=function(e,t,i,r){this.h.actionListener("recvEndJoinLiveCommand",e,t,i,r)},T);function T(e,t,i,r,n,o){this.v=e,this.h=t,this.service=i,this.liveRoomHandler=r,this.rtm=n,this.room=o,this.joinLiveCallbackMap={},this.joinLiveRequestMap={}}var E={requestJoinLive:function(e,t,i,r,n){var o=this,s=this.getMsgSpan(m,n||(null==(a=this.stateCenter.roomModulesList[0])?void 0:a.roomID),!0),a=this.getRoomModules(n)||this.stateCenter.roomModulesList[0];return a?(s.setAttributes({to_user_id:v(e)}),a.liveHandler.requestJoinLive(e,(function(e){s.end(),t(e)}),(function(e,t){o.stateCenter.reporter.setError(s,e),i(e,t)}),r)):(this.stateCenter.reporter.setError(s,y),i&&i(y,0),!1)},inviteJoinLive:function(e,t,i,r,n){var o=this,s=this.getMsgSpan(u,n||(null==(a=this.stateCenter.roomModulesList[0])?void 0:a.roomID),!0),a=this.getRoomModules(n)||this.stateCenter.roomModulesList[0];return a?(s.setAttributes({to_user_id:l(e)}),a.liveHandler.inviteJoinLive(e,(function(e){s.end(),t(e)}),(function(e,t){o.stateCenter.reporter.setError(s,e),i(e,t)}),r)):(this.stateCenter.reporter.setError(s,y),i&&i(y,0),!1)},endJoinLive:function(e,t,i,r){var n=this,o=this.getMsgSpan(s,r||(null==(c=this.stateCenter.roomModulesList[0])?void 0:c.roomID),!0),c=this.getRoomModules(r)||this.stateCenter.roomModulesList[0];return c?(o.setAttributes({to_user_id:a(e)}),c.liveHandler.endJoinLive(e,(function(e){o.end(),t(e)}),(function(e,t){n.stateCenter.reporter.setError(o,e),i(e,t)}))):(this.stateCenter.reporter.setError(o,y),i&&i(y,0),!1)},respondJoinLive:function(e,t,i,r,n){var o=this,s=this.getMsgSpan(h,n||(null==(a=this.stateCenter.roomModulesList[0])?void 0:a.roomID),!0),a=this.getRoomModules(n)||this.stateCenter.roomModulesList[0];return a?(s.setAttributes({request_id:f(e),join_result:t}),a.liveHandler.respondJoinLive(e,t,(function(e){s.end(),i(e)}),(function(e,t){o.stateCenter.reporter.setError(s,e),r(e,t)}))):(this.stateCenter.reporter.setError(s,y),r&&r(y,0),!1)}},C={handlePushSignalMsg:function(e){var t=null==(i=null==e?void 0:e.header)?void 0:i.room_id,i=this.stateCenter.roomModulesList.find((function(e){return e.roomID==t}));i?i.liveHandler.handlePushSignalMsg(e):this.logger.error("zm.sv.ps room no found ignore "+JSON.stringify(e))}},w={initLiveHandler:function(){this.liveHandler=new S(this.logger,this.stateCenter,this.service,this.liveRoomHandler,this.rtm,this)}};t.default={type:"live",install:function(e,t,i,r){for(var n in E)Object.defineProperty(e.prototype,n,{value:E[n],writable:!1});for(var n in C)Object.defineProperty(i.prototype,n,{value:C[n],writable:!1}),Object.defineProperty(r.prototype,n,{value:C[n],writable:!1});for(var n in w)Object.defineProperty(t.prototype,n,{value:w[n],writable:!1})}}}},i={},e.m=t,e.c=i,e.d=function(t,i,r){e.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:r})},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.t=function(t,i){if(1&i&&(t=e(t)),8&i)return t;if(4&i&&"object"==_typeof(t)&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&i&&"string"!=typeof t)for(var n in t)e.d(r,n,function(e){return t[e]}.bind(null,n));return r},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.p="",e(e.s=23);function e(r){var n;return(i[r]||(n=i[r]={i:r,l:!1,exports:{}},t[r].call(n.exports,n,n.exports,e),n.l=!0,n)).exports}var t,i}()},7368:function(e,t,i){"undefined"!=typeof self&&self,e.exports=function(e){return i={0:function(e,t,i){"use strict";function r(e){return"number"==typeof e}function n(e){return"string"==typeof e}function o(e){return"boolean"==typeof e}function s(e){return void 0===e}function a(e){return null!==e&&e instanceof Object}function c(e){return"function"==typeof e}function u(e){return e instanceof Array}i.d(t,"d",(function(){return r})),i.d(t,"f",(function(){return n})),i.d(t,"b",(function(){return o})),i.d(t,"g",(function(){return s})),i.d(t,"e",(function(){return a})),i.d(t,"c",(function(){return c})),i.d(t,"a",(function(){return u}))},1:function(t,i){t.exports=e},22:function(e,t,i){"use strict";function r(e){return e}function n(e){return e}function o(e){return e}i.r(t);var s,a="zm.scc",c="zm.sbcm",u="zm.srlm",l="zm.sbrm",d="zm.msg.sdr",h="zm.msg.rlr",p="zm.msg.rps",f="zm.msg.srm",m="zm.msg.scm",v="zm.msg.sbm",g="zm.msg.bps",y="zm.msg.slm",b="zm.sv.ps",_={code:1100001,msg:"input parm error."},S={code:1100002,msg:"network timeout."},T={code:1000002,msg:"not login"},E={code:1009001,msg:"message content is empty"},C={code:1009010,msg:"failed to send message"},w={code:1002014,msg:"room not exist"},I={code:1002099,msg:"room inner error"},R={code:1109001,msg:"frequency limited."},k={INPUT_PARAM:_,IM_CONTENT_NULL:E,IM_CONTENT_TOO_LONG:G={code:1009002,msg:"message content is too long"},ROOM_NOT_EXIST:w},P="/liveroom/send_custom_command",A=n,D={INPUT_PARAM:_,IM_CONTENT_NULL:E,IM_CONTENT_TOO_LONG:G,ROOM_NOT_EXIST:w},N="/liveroom/send_room_message",O=o,M=o,L={INPUT_PARAM:_,IM_CONTENT_NULL:E,IM_CONTENT_TOO_LONG:G,ROOM_NOT_EXIST:w},x=n,U=n,B=_,z={code:1102022,msg:"trans send frequently"},q=w,X=r,H=r,F=n,V=o,G=((E=s=s||{})[E.I=0]="I",E[E.H=10]="H",E[E.M=100]="M",E[E.L=1e3]="L",i(1)),j=i.n(G),Q=i(0),W=(Object.defineProperty(Z.prototype,"_isUseNetAgent",{get:function(){return this.u.useNetAgent},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"h",{get:function(){return this.u.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"_serviceHandler",{get:function(){return this._isUseNetAgent?this._liveRoomHandler:this._service},enumerable:!1,configurable:!0}),Z.prototype.loginRsp=function(e){var t=this,i=(e=e.body).ret_timestamp,r=e.bigim_time_window,n=e.dati_time_window,o=e.trans_seqs;if(null!=i&&Object(Q.f)(i)&&(e=parseFloat(i),this._serverTimeOffset=0==e?0:+i-(new Date).getTime()),r&&Object(Q.d)(r)&&(this._bigimTimeWindow=r),n&&Object(Q.d)(n)&&(this._datiTimeWindow=n),o)for(var s=0;s<o.length;s++){var a=o[s].trans_channel,c=o[s].trans_seq_list||o[s].trans_seq_array;0<(c=(c=c.filter((function(e){var i=e.trans_type;return e=e.trans_seq,!t.transSeqMap[i]||t.transSeqMap[i].seq<e}))).map((function(e){return{trans_type:e.trans_type,trans_local_seq:e.trans_seq}}))).length&&this.fetchReliableMessage(a,c)}},Z.prototype.sendReliableMessage=function(e,t,i,r){var n,o=this;this.g.info(d+" call"),this._room.isLogin()?this._isReliable?(this.g.error(d+" send too often"),r(z)):(this.transSeqMap[e]||(this.transSeqMap[e]={seq:0}),n={trans_type:e,trans_data:t,trans_local_seq:this.transSeqMap[e].seq,trans_channel:"clt"},this._isReliable=!0,this._serviceHandler.sendReliableMessage(n,(function(r){o.transSeqMap[e].seq=r.body.trans_seq,o.g.info(d+" trans "+e+" seq "+r.body.trans_seq),o._isReliable=!1,o.roomExtraInfo[e]={key:e,value:t,updateUser:{userID:o._room.userID,userName:o._room.userName},updateTime:Date.now()},i({seq:r.header.seq,errorCode:0})}),(function(e){var t=I;e.body&&e.body.err_code?(t=o._rtm.getServerError(e.body.err_code),o.g.error(f+" "+t.msg)):t=e,o._isReliable=!1,r(t)}),this._room)):(this.g.error(d+" state error"),r&&r(T))},Z.prototype.fetchReliableMessage=function(e,t){function i(e){r.handleFetchTransRsp(e,n)}var r=this,n=(e={trans_channel:e,fetch_array:t},this.h.createSpan(s.H,{key:"/sdk/login",par:this._room.roomID},{key:""},"/liveroom/get_room_extrainfo"));n.setAttributes({fetch_array:X(t)}),this._serviceHandler.fetchReliableMessage(e,i,i,this._room),this.g.info("zm.msg.frm call success")},Z.prototype.handleFetchTransRsp=function(e,t){if(e.body&&0!=e.body.err_code)this.g.error(h+" trans send error "+e.body.err_code),this.u.tracer.setError(t,{code:e.body.err_code});else if(e.header&&e.body){var i=e.body.trans_list||e.body.trans_fetch_results,r=[],n=[];if(Array.isArray(i)&&0<i.length){for(var o=0;o<i.length;o++){var s,a,c=i[o];1000001109===c.err_code?this.g.warn(h+" fetch trans unknown type "+c.err_code):(n.push({trans_type:s=c.trans_type,trans_seq:a=c.trans_seq}),1000001110===c.err_code?(this.g.warn(h+" fetch trans seq is wrong "+c.err_code),this.transSeqMap[s]={seq:a}):!this.transSeqMap[s]||this.transSeqMap[s].seq<a?(this.transSeqMap[s]={seq:a},r.push(c)):this.g.warn(h+" fetch trans seq wrong"))}this.roomExtraInfo={},0<r.length&&this.onRecvReliableMessage(r)}t.setAttributes({result_array:H(n)}),t.end()}else this.g.error(h+" trans send error "+e),this.u.tracer.setError(t,S)},Z.prototype.handlePushTransMsg=function(e){var t,i=e.body.trans_type,r=e.body.trans_seq;!this.transSeqMap[i]||this.transSeqMap[i].seq<r?(this.transSeqMap[i]={seq:r},this.onRecvReliableMessage([e.body],(null==(t=null==e?void 0:e.body)?void 0:t.trans_idname)===this.u.idName||(null==(t=null==e?void 0:e.body)?void 0:t.id_name)===this.u.idName)):this.g.warn(p+" trans seq wrong"),this.g.info(p+" trans "+i+" seq "+r)},Z.prototype.sendRoomMsg=function(e,t,i,r,n,o){var s=this;if(!this._room.isLogin())return this.g.error(f+" state error"),o(T),!1;var a=Date.parse(new Date+"");return 0<this._sendRoomMsgTime&&this._sendRoomMsgTime+this._sendRoomMsgInterval>a?(this.g.info(f+" freq error"),o&&o(R,0,e,r),!1):(this._sendRoomMsgTime=a,a=this._serviceHandler.sendRoomMsg({msg_category:e,msg_type:1,msg_priority:1,msg_content:r},(function(e){n({seq:e.header.seq,errorCode:0,messageID:e.body.msg_id})}),(function(e){var t,i,r=I;e.header&&e.body?(i=(t=[s._rtm.getServerError(e.body.err_code),e.body.msg_id])[1],s.g.error(f+" "+(r=t[0]).msg),o({seq:e.header.seq,errorCode:(r=r==S?C:r).code,messageID:i})):(e.code&&e.msg&&(r=e),o({seq:0,errorCode:r.code,messageID:0}))}),this._room),this.h.spanSetAttributes({key:N,par:null==(e=this._room)?void 0:e.roomID},{send_seq:O(a)}),this.g.info(f+" call success"),!0)},Z.prototype.handlePushRoomMsg=function(e){var t,i=[];this._isUseNetAgent&&(t=e.body.msg_list,e.body.msg_list.forEach((function(e){e={fromUser:{userID:e.id_name,userName:e.nick_name},message:e.msg_content,sendTime:e.send_time.toNumber(),messageID:e.msg_id.toNumber()},i.push(e)})),e.body.server_msg_id=e.body.server_msg_id.toNumber(),e.body.ret_msg_id=e.body.ret_msg_id.toNumber()),this.u.actionListener("IMRecvBroadcastMessage",this._room.roomID,i),this.u.actionListener("_recvRoomMsg",t,e.body.server_msg_id,e.body.ret_msg_id)},Z.prototype.sendCustomCommand=function(e,t,i,r){var n,o=this;return this._room.isLogin()?(t={from_userid:this.u.idName,from_username:this.u.nickName,request_id:this.u.getRequestId(),custom_content:t||"",room_id:this._room.roomID},this.h.spanSetAttributes({key:P,par:null==(n=this._room)?void 0:n.roomID},{request_id:A(t.request_id)}),n={dest_id_name:e,custom_msg:JSON.stringify(t)},this._serviceHandler.sendCustomCommand(n,(function(e){i({seq:e.header.seq,errorCode:0})}),(function(e){var t,i=o._rtm.getServerError(e.body.err_code);o.g.error(m+" "+i.msg),t=2===(null==(t=e.body)?void 0:t.err_code)||1000000002===(null==(t=e.body)?void 0:t.err_code)?_:i==S?C:i,r({seq:e.header.seq,errorCode:t.code,code:t.code})}),this._room),this.g.info(m+" call success"),!0):(this.g.error(m+" state error"),r(T),!1)},Z.prototype.handlePushCustomMsg=function(e){e=[(e=JSON.parse(e.body.custommsg)).from_userid,e.from_username,e.room_id,e.custom_content],this.u.actionListener("IMRecvCustomCommand",e[2],{userID:e[0],userName:e[1]},e[3])},Z.prototype.sendBigRoomMessage=function(e,t,i,r,n,o){var s,a,c,u,l=this;this._room.isLogin()?(s=this._bigimTimeWindow,a=this._serverTimeOffset,c=(new Date).getTime()+a,u=this._rtm.getSeq().toString(),this._bigImCallbackMap[u]={success:n,error:o},0==s?this.sendBigRoomMessageInternal([{msg_category:e,msg_type:1,msg_content:r,bigmsg_client_id:u}],(function(e){l.handleBigImMsgRsp(e)}),(function(e){o&&o(e)})):(n=Math.floor(c/s),this._bigImLastTimeIndex<n&&0==this._bigIMmessageList.length?(this._bigImLastTimeIndex=n,this.sendBigRoomMessageInternal([{msg_category:e,msg_type:1,msg_content:r,bigmsg_client_id:u}],(function(e){l.handleBigImMsgRsp(e)}),(function(e){o&&o(e)}))):(this._bigIMmessageList.push({msg_category:e,msg_type:1,msg_content:r,bigmsg_client_id:u}),1==this._bigIMmessageList.length&&this.setBigImTimer(a,s)))):(this.g.error(v+" state error"),o&&o(T))},Z.prototype.sendBigRoomMessageInternal=function(e,t,i){this._serviceHandler.sendBigRoomMessage({msgs:e},(function(e){t(e)}),(function(e){var t=I;e.header&&e.body||(e.code&&e.msg&&(t=e),i(t)),i(t)}),this._room),this.g.info(v+" sendBigRoomMessage called")},Z.prototype.handleBigImMsgRsp=function(e){this._bigimTimeWindow=e.body.bigim_time_window;for(var t=e.body.msg_list||e.body.msgs,i=0;i<t.length;i++){var r,n=t[i].msg_client_id||t[i].bigmsg_client_id;this._bigImCallbackMap[n]&&(null!=(r=this._bigImCallbackMap[n].success)&&r({seq:e.header.seq,errorCode:0,messageID:t[i].msg_id||t[i].bigmsg_id}),delete this._bigImCallbackMap[n])}},Z.prototype.setBigImTimer=function(e,t){var i=this;e=t-((new Date).getTime()+e)%t,t=this._rtm.generateRandumNumber(t)+e,this._bigImTimer=setTimeout((function(){i.onBigImTimer()}),t)},Z.prototype.onBigImTimer=function(){for(var e=this,t=(new Date).getTime()+this._serverTimeOffset,i=(this._bigImLastTimeIndex=Math.floor(t/this._bigimTimeWindow),[]),r=[],n=0;n<this._bigIMmessageList.length&&!(20<=n);n++){var o=this._bigIMmessageList[n];i.push({msg_category:o.msg_category,msg_type:o.msg_type,msg_content:o.msg_content,bigmsg_client_id:o.bigmsg_client_id}),r.push(o.bigmsg_client_id)}20<this._bigIMmessageList.length?this._bigIMmessageList.splice(0,20):this._bigIMmessageList=[],this.sendBigRoomMessageInternal(i,(function(t){e.handleBigImMsgRsp(t)}),(function(t,i){for(var n=0;n<r.length;n++){var o=r[n],s=e._bigImCallbackMap[o];s&&(null!=s.error&&s.error(t,i),delete e._bigImCallbackMap[o])}})),this._bigImTimer&&clearTimeout(this._bigImTimer),this._bigImTimer=null,0<this._bigIMmessageList.length&&this.setBigImTimer(this._serverTimeOffset,this._bigimTimeWindow)},Z.prototype.handlePushMergeMsg=function(e){for(var t=e.body.message_list||e.body.messages,i=0;i<t.length;i++)14001===t[i].sub_cmd&&this.handlePushBigRooMsg(t[i].msg_body)},Z.prototype.handlePushBigRooMsg=function(e){var t;if(Object(Q.f)(e))try{t=JSON.parse(e)}catch(e){return void this.g.warn(g+"parse json error")}else t=e;if(t){e=t.room_id||this._room.roomID;for(var i=[],r=t.msg_list||t.msg_data,n=0;n<r.length;n++){var o=r[n];o.id_name==this.u.idName?this.g.info(g+" self message"):i.push({idName:o.id_name,nickName:o.nick_name,messageId:o.msg_id||o.bigmsg_id,category:o.msg_category,type:o.msg_type,content:o.msg_content,time:o.send_time||j.a.isLong(o.msg_timestamp)&&o.msg_timestamp.toNumber()})}0==i.length?this.g.info(g+" no other pushData except self"):this.onRecvBigRoomMessage(i,e),this.g.info(g+"call success")}else this.g.warn(g+" cann't find message body")},Z.prototype.onRecvBigRoomMessage=function(e,t){var i=[];e.forEach((function(e){i.push(e={fromUser:{userID:e.idName,userName:e.nickName},message:e.content,sendTime:e.time,messageID:e.messageId})})),this.u.actionListener("IMRecvBarrageMessage",t,i),this.u.actionListener("_recvBigRoomMessage",e,t)},Z.prototype.resetMessageInfo=function(){this.transSeqMap={},this.realyMessageList=[],this._relayTimer&&(clearTimeout(this._relayTimer),this._relayTimer=null),this._bigImLastTimeIndex=0,this._bigIMmessageList=[],this._bigImCallbackMap={},this._bigImTimer&&(clearTimeout(this._bigImTimer),this._bigImTimer=null),this._serverTimeOffset=0,this._datiTimeWindow=0,this._bigimTimeWindow=0},Z.prototype.sendRelayMessage=function(e,t,i,r){var n=this._datiTimeWindow,o=this._serverTimeOffset;0<n?(this.realyMessageList.push({type:e,data:t,success:i,error:r}),1==this.realyMessageList.length&&this.setRelayTimer(o,n)):this.sendRelayMessageInternal(e,t,i,r)},Z.prototype.sendRelayMessageInternal=function(e,t,i,r){var n=this;this.g.info(y+" call"),this._serviceHandler.sendRelayMessage(e={relay_type:e,relay_data:t},(function(e){i&&i(e.header.seq,e.body.relay_result)}),(function(e){var t=I;e.header&&e.body?r&&r(n._rtm.getServerError(e.body.err_code),e.header.seq):(e.code&&e.msg&&(t=e),r&&r(t,0))}),t=this._room)},Z.prototype.setRelayTimer=function(e,t){var i=this;e=(new Date).getTime()+e,e=this._rtm.generateRandumNumber(2*t-e%t),this.g.info(y+" setTimer "+e),this._relayTimer=setTimeout((function(){i.onRelayTimer()}),e)},Z.prototype.onRelayTimer=function(){var e;0==this.realyMessageList.length?this.g.info(y+" no relay data"):(this.sendRelayMessageInternal((e=this.realyMessageList[0]).type,e.data,e.success,e.error),this._relayTimer&&clearTimeout(this._relayTimer),this._relayTimer=null,this.realyMessageList.splice(0,1),0<this.realyMessageList.length&&this.setRelayTimer(this._serverTimeOffset,this._datiTimeWindow))},Z);function Z(e,t,i,r,n,o,s){var a=this;this.g=e,this.u=t,this._dataReport=i,this._service=r,this._liveRoomHandler=n,this._rtm=o,this._room=s,this._sendRoomMsgTime=0,this._sendRoomMsgInterval=500,this._bigImCallbackMap={},this._bigImLastTimeIndex=0,this._bigIMmessageList=[],this._bigImTimer=null,this._relayTimer=null,this._serverTimeOffset=0,this._datiTimeWindow=0,this._bigimTimeWindow=0,this._isReliable=!1,this.transSeqMap={},this.roomExtraInfo={},this.onRecvReliableMessage=function(e,t){void 0===t&&(t=!1);var i=e.map((function(e){var t={key:e.trans_type,value:e.trans_data,updateUser:{userID:e.id_name||e.trans_idname,userName:e.nick_name||e.trans_nickname},updateTime:j.a.isLong(e.trans_send_time)?e.trans_send_time.toNumber():e.trans_send_time};return a.roomExtraInfo[e.trans_type]=t}));t?a.g.warn(p+" id name same"):(0<i.length&&a.u.actionListener("roomExtraInfoUpdate",a._room.roomID,Object.values(a.roomExtraInfo)),e.forEach((function(e){a.u.actionListener("recvReliableMessage",e.trans_type,e.trans_seq,e.trans_data)})))},this.realyMessageList=[]}function K(e,t,i,r){var n=this;return void 0===i&&(i=1),void 0===r&&(r=1),new Promise((function(o,s){var a,u=n.getMsgSpan(N,e,!0),l=(s=n.stateCenter.proxyRes(u,(function(e){u.setAttributes({msg_id:M(e.messageID)}),o(e)}),s)).interResolve;s=s.interReject,Object(Q.f)(e)&&""!=e?void 0===t||""==t?(n.logger.error(c+" message is empty"),s(L.IM_CONTENT_NULL)):Object(Q.f)(t)?1024<t.length?(n.logger.error(c+" message too long"),s(L.IM_CONTENT_TOO_LONG)):(a=n.getRoomModules(e),u.setAttributes({send_seq:O(),msg_content:t}),a?a.messageHandler.sendRoomMsg(i,r,e,t,(function(e){e.messageID&&u.setAttributes({msg_id:e.messageID}),l(e)}),s):s(L.ROOM_NOT_EXIST)):(n.logger.error(c+" message must be string"),s(L.INPUT_PARAM," param message error")):(n.logger.error(c+" roomid must be string and not empty"),s(L.INPUT_PARAM," param roomID error"))}))}function J(e,t,i){var r=this;return new Promise((function(n,o){var s,c,u=r.getMsgSpan(P,e,!0);o=(n=r.stateCenter.proxyRes(u,n,o)).interResolve,n=n.interReject,Object(Q.f)(e)&&""!=e?!Object(Q.a)(i)||i.find((function(e){return!Object(Q.f)(e)}))?(r.logger.error(a+" dstMembers must be string array"),n(D.INPUT_PARAM," param toUserList error")):Object(Q.f)(t)||Object(Q.e)(t)?Object(Q.f)(t)&&1024<t.length?(r.logger.error(a+" command too long"),n(D.IM_CONTENT_TOO_LONG)):(s=r.getRoomModules(e),c=Object(Q.f)(t)?t:JSON.stringify(t),u.setAttributes({msg_content:c}),s?s.messageHandler.sendCustomCommand(i,t,o,n):n(D.ROOM_NOT_EXIST)):(r.logger.error(a+" custom content must be a non empty string or object"),n(D.INPUT_PARAM," param command error")):(r.logger.error(a+" roomid must be string and not empty"),n(_," param roomID error"))}))}function Y(e,t,i,r){var n=this;return void 0===i&&(i=1),void 0===r&&(r=1),new Promise((function(o,s){var a=n.getMsgSpan("/liveroom/send_big_room_message",e);s=(o=n.stateCenter.proxyRes(a,o,s)).interResolve,o=o.interReject,Object(Q.f)(e)&&""!=e?void 0===t||""==t?(n.logger.error(l+" message is empty"),o(k.IM_CONTENT_NULL)):Object(Q.f)(t)?1024<t.length?(n.logger.error(l+" message too long"),o(k.IM_CONTENT_TOO_LONG)):(a.setAttributes({msg_content:t}),(a=n.getRoomModules(e))?a.messageHandler.sendBigRoomMessage(i,r,e,t,s,o):o(k.ROOM_NOT_EXIST)):(n.logger.error(l+" message must be string"),o(k.INPUT_PARAM," param message error")):(n.logger.error(l+" roomid must be string and not empty"),o(k.INPUT_PARAM," param roomID error"))}))}function $(e,t,i){var r=this;return new Promise((function(n,o){var s=r.getMsgSpan("/liveroom/set_room_extrainfo",e),a=(n=r.stateCenter.proxyRes(s,n,(function(e){r.stateCenter.useNetAgent&&1015===e.errorCode&&(e.errorCode=1002017),o(e)}))).interResolve;n=n.interReject,Object(Q.f)(e)&&""!=e?t&&Object(Q.f)(t)?128<t.length?(r.logger.error(u+" type is too long"),n({errorCode:B.code})):i&&Object(Q.f)(i)?4096<i.length?(r.logger.error(u+" type is too long"),n({errorCode:B.code})):(s.setAttributes({key:x(t),value:U(i)}),(s=r.getRoomModules(e))?s.messageHandler.sendReliableMessage(t,i,a,n):n(q)):(r.logger.error(u+" data must be string"),n({errorCode:B.code})):(r.logger.error(u+" type must be string"),n({errorCode:B.code})):(r.logger.error(c+" roomid must be string and not empty"),n(L.INPUT_PARAM," param roomID error"))}))}var ee={_sendBroadcastMessage:K,sendBroadcastMessage:function(e,t){var i=this;return new Promise((function(r,n){K.call(i,e,t).then((function(e){r({errorCode:e.errorCode,messageID:e.messageID,extendedData:e.extendedData})})).catch((function(e){n(e)}))}))},_sendCustomCommand:J,sendCustomCommand:function(e,t,i){var r=this;return new Promise((function(n,o){J.call(r,e,t,i).then((function(e){n({errorCode:e.errorCode,extendedData:e.extendedData})})).catch((function(e){o(e)}))}))},_sendBarrageMessage:Y,sendBarrageMessage:function(e,t){var i=this;return new Promise((function(r,n){Y.call(i,e,t).then((function(e){r({errorCode:e.errorCode,messageID:e.messageID,extendedData:e.extendedData})})).catch((function(e){n(e)}))}))},_setRoomExtraInfo:$,setRoomExtraInfo:function(e,t,i){return $.call(this,e,t,i)},sendRelayMessage:function(e,t,i,r,n){(n=this.getRoomModules(n)||this.stateCenter.roomModulesList[0])?n.messageHandler.sendRelayMessage(e,t,i,r):r&&r(w,0)}},te={handlePushRoomMsg:function(e){(e=this.handlePushMsg(e))[0].messageHandler.handlePushRoomMsg(e=e[1])},handlePushCustomMsg:function(e){(e=this.handlePushMsg(e))[0].messageHandler.handlePushCustomMsg(e=e[1])},handlePushMergeMsg:function(e){var t=null==(t=null==e?void 0:e.header)?void 0:t.room_id;(t=this.rtm.getRoomModules(t))?t.messageHandler.handlePushMergeMsg(e):this.logger.error(b+" room no found ignore "+JSON.stringify(e))},handlePushTransMsg:function(e){var t,i=(r=this.handlePushMsg(e))[0],r=r[1],n=null==(n=null==e?void 0:e.header)?void 0:n.room_id;(n=this.rtm.getMsgSpan("/liveroom/recv_room_extrainfo",n)).setAttributes({trans_type:F(null==(t=null==e?void 0:e.body)?void 0:t.trans_type),trans_seq:V(null==(t=null==e?void 0:e.body)?void 0:t.trans_seq)}),n.end(),i.messageHandler.handlePushTransMsg(r)},handleBigImMsgRsp:function(e){var t=null==(t=null==e?void 0:e.header)?void 0:t.room_id;(t=this.rtm.getRoomModules(t))?t.messageHandler.handleBigImMsgRsp(e):this.logger.error(b+" room no found ignore "+JSON.stringify(e))},handlePushMsg:function(e){var t=null==(t=null==e?void 0:e.header)?void 0:t.room_id;if(t=this.rtm.getRoomModules(t))return[t,e];this.logger.error(b+" room no found ignore "+JSON.stringify(e))}},ie={initMessageHandler:function(){this.messageHandler=new W(this.logger,this.stateCenter,this.dataReport,this.service,this.liveRoomHandler,this.rtm,this)}};t.default={type:"message",install:function(e,t,i,r){for(var n in ee)Object.defineProperty(e.prototype,n,{value:ee[n],writable:!1});for(var n in te)Object.defineProperty(i.prototype,n,{value:te[n],writable:!1}),Object.defineProperty(r.prototype,n,{value:te[n],writable:!1});for(var n in ie)Object.defineProperty(t.prototype,n,{value:ie[n],writable:!1})}}}},r={},t.m=i,t.c=r,t.d=function(e,i,r){t.o(e,i)||Object.defineProperty(e,i,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,i){if(1&i&&(e=t(e)),8&i)return e;if(4&i&&"object"==_typeof(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&i&&"string"!=typeof e)for(var n in e)t.d(r,n,function(t){return e[t]}.bind(null,n));return r},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=22);function t(e){var n;return(r[e]||(n=r[e]={i:e,l:!1,exports:{}},i[e].call(n.exports,n,n.exports,t),n.l=!0,n)).exports}var i,r}(i(1583))},6344:function(e,t,i){"use strict";var r=i(8021),n=i(6901),o=i(8042),s=i(6471),a=i(5798),c=Object.prototype.toString,u=i(8404),l=u.Z_NO_FLUSH,d=u.Z_SYNC_FLUSH,h=u.Z_FULL_FLUSH,p=u.Z_FINISH,f=u.Z_OK,m=u.Z_STREAM_END,v=u.Z_DEFAULT_COMPRESSION,g=u.Z_DEFAULT_STRATEGY,y=u.Z_DEFLATED;function b(e){this.options=n.assign({level:v,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:g},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var i=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==f)throw new Error(s[i]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var u;if(u="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,i=r.deflateSetDictionary(this.strm,u),i!==f)throw new Error(s[i]);this._dict_set=!0}}function _(e,t){var i=new b(t);if(i.push(e,!0),i.err)throw i.msg||s[i.err];return i.result}b.prototype.push=function(e,t){var i,n,s=this.strm,a=this.options.chunkSize;if(this.ended)return!1;for(n=t===~~t?t:!0===t?p:l,s.input="string"==typeof e?o.string2buf(e):"[object ArrayBuffer]"===c.call(e)?new Uint8Array(e):e,s.next_in=0,s.avail_in=s.input.length;;)if(0===s.avail_out&&(s.output=new Uint8Array(a),s.next_out=0,s.avail_out=a),(n===d||n===h)&&s.avail_out<=6)this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;else{if(i=r.deflate(s,n),i===m)return s.next_out>0&&this.onData(s.output.subarray(0,s.next_out)),i=r.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===f;if(0!==s.avail_out){if(n>0&&s.next_out>0)this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;else if(0===s.avail_in)break}else this.onData(s.output)}return!0},b.prototype.onData=function(e){this.chunks.push(e)},b.prototype.onEnd=function(e){e===f&&(this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Deflate=b,e.exports.deflate=_,e.exports.deflateRaw=function(e,t){return(t=t||{}).raw=!0,_(e,t)},e.exports.gzip=function(e,t){return(t=t||{}).gzip=!0,_(e,t)},e.exports.constants=i(8404)},6901:function(e){"use strict";var t=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};e.exports.assign=function(e){for(var i=Array.prototype.slice.call(arguments,1);i.length;){var r=i.shift();if(r){if("object"!=_typeof(r))throw new TypeError(r+"must be non-object");for(var n in r)t(r,n)&&(e[n]=r[n])}}return e},e.exports.flattenChunks=function(e){for(var t=0,i=0,r=e.length;i<r;i++)t+=e[i].length;for(var n=new Uint8Array(t),o=0,s=0,a=e.length;o<a;o++){var c=e[o];n.set(c,s),s+=c.length}return n}},8042:function(e){"use strict";var t=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){t=!1}for(var i=new Uint8Array(256),r=0;r<256;r++)i[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;i[254]=i[254]=1,e.exports.string2buf=function(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,i,r,n,o,s=e.length,a=0;for(n=0;n<s;n++)i=e.charCodeAt(n),55296==(64512&i)&&n+1<s&&(r=e.charCodeAt(n+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),n++)),a+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(a),o=0,n=0;o<a;n++)i=e.charCodeAt(n),55296==(64512&i)&&n+1<s&&(r=e.charCodeAt(n+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),n++)),i<128?t[o++]=i:i<2048?(t[o++]=192|i>>>6,t[o++]=128|63&i):i<65536?(t[o++]=224|i>>>12,t[o++]=128|i>>>6&63,t[o++]=128|63&i):(t[o++]=240|i>>>18,t[o++]=128|i>>>12&63,t[o++]=128|i>>>6&63,t[o++]=128|63&i);return t},e.exports.buf2string=function(e,r){var n,o,s=r||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,r));var a=new Array(2*s);for(o=0,n=0;n<s;){var c=e[n++];if(c<128)a[o++]=c;else{var u=i[c];if(u>4)a[o++]=65533,n+=u-1;else{for(c&=2===u?31:3===u?15:7;u>1&&n<s;)c=c<<6|63&e[n++],u--;u>1?a[o++]=65533:c<65536?a[o++]=c:(c-=65536,a[o++]=55296|c>>10&1023,a[o++]=56320|1023&c)}}}return function(e,i){if(i<65534&&e.subarray&&t)return String.fromCharCode.apply(null,e.length===i?e:e.subarray(0,i));for(var r="",n=0;n<i;n++)r+=String.fromCharCode(e[n]);return r}(a,o)},e.exports.utf8border=function(e,t){(t=t||e.length)>e.length&&(t=e.length);for(var r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+i[e[r]]>t?r:t}},2976:function(e){"use strict";e.exports=function(e,t,i,r){for(var n=65535&e,o=e>>>16&65535,s=0;0!==i;){s=i>2e3?2e3:i,i-=s;do{n=n+t[r++]|0,o=o+n|0}while(--s);n%=65521,o%=65521}return n|o<<16}},8404:function(e){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},2282:function(e){"use strict";var t=new Uint32Array(function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}());e.exports=function(e,i,r,n){var o=t,s=n+r;e^=-1;for(var a=n;a<s;a++)e=e>>>8^o[255&(e^i[a])];return~e}},8021:function(e,t,i){"use strict";var r=i(9773),n=r._tr_init,o=r._tr_stored_block,s=r._tr_flush_block,a=r._tr_tally,c=r._tr_align,u=i(2976),l=i(2282),d=i(6471),h=i(8404),p=h.Z_NO_FLUSH,f=h.Z_PARTIAL_FLUSH,m=h.Z_FULL_FLUSH,v=h.Z_FINISH,g=h.Z_BLOCK,y=h.Z_OK,b=h.Z_STREAM_END,_=h.Z_STREAM_ERROR,S=h.Z_DATA_ERROR,T=h.Z_BUF_ERROR,E=h.Z_DEFAULT_COMPRESSION,C=h.Z_FILTERED,w=h.Z_HUFFMAN_ONLY,I=h.Z_RLE,R=h.Z_FIXED,k=h.Z_DEFAULT_STRATEGY,P=h.Z_UNKNOWN,A=h.Z_DEFLATED,D=258,N=262,O=42,M=113,L=666,x=function(e,t){return e.msg=d[t],t},U=function(e){return 2*e-(e>4?9:0)},B=function(e){for(var t=e.length;--t>=0;)e[t]=0},z=function(e){var t,i,r,n=e.w_size;t=e.hash_size,r=t;do{i=e.head[--r],e.head[r]=i>=n?i-n:0}while(--t);t=n,r=t;do{i=e.prev[--r],e.prev[r]=i>=n?i-n:0}while(--t)},q=function(e,t,i){return(t<<e.hash_shift^i)&e.hash_mask},X=function(e){var t=e.state,i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+i),e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))},H=function(e,t){s(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,X(e.strm)},F=function(e,t){e.pending_buf[e.pending++]=t},V=function(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},G=function(e,t,i,r){var n=e.avail_in;return n>r&&(n=r),0===n?0:(e.avail_in-=n,t.set(e.input.subarray(e.next_in,e.next_in+n),i),1===e.state.wrap?e.adler=u(e.adler,t,n,i):2===e.state.wrap&&(e.adler=l(e.adler,t,n,i)),e.next_in+=n,e.total_in+=n,n)},j=function(e,t){var i,r,n=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,c=e.strstart>e.w_size-N?e.strstart-(e.w_size-N):0,u=e.window,l=e.w_mask,d=e.prev,h=e.strstart+D,p=u[o+s-1],f=u[o+s];e.prev_length>=e.good_match&&(n>>=2),a>e.lookahead&&(a=e.lookahead);do{if(i=t,u[i+s]===f&&u[i+s-1]===p&&u[i]===u[o]&&u[++i]===u[o+1]){o+=2,i++;do{}while(u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&o<h);if(r=D-(h-o),o=h-D,r>s){if(e.match_start=t,s=r,r>=a)break;p=u[o+s-1],f=u[o+s]}}}while((t=d[t&l])>c&&0!=--n);return s<=e.lookahead?s:e.lookahead},Q=function(e){var t,i,r,n=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-N)&&(e.window.set(e.window.subarray(n,n+n-i),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,e.insert>e.strstart&&(e.insert=e.strstart),z(e),i+=n),0===e.strm.avail_in)break;if(t=G(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=t,e.lookahead+e.insert>=3)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=q(e,e.ins_h,e.window[r+1]);e.insert&&(e.ins_h=q(e,e.ins_h,e.window[r+3-1]),e.prev[r&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=r,r++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<N&&0!==e.strm.avail_in)},W=function(e,t){var i,r,n,s=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,c=e.strm.avail_in;do{if(i=65535,n=e.bi_valid+42>>3,e.strm.avail_out<n)break;if(n=e.strm.avail_out-n,r=e.strstart-e.block_start,i>r+e.strm.avail_in&&(i=r+e.strm.avail_in),i>n&&(i=n),i<s&&(0===i&&t!==v||t===p||i!==r+e.strm.avail_in))break;a=t===v&&i===r+e.strm.avail_in?1:0,o(e,0,0,a),e.pending_buf[e.pending-4]=i,e.pending_buf[e.pending-3]=i>>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,X(e.strm),r&&(r>i&&(r=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,i-=r),i&&(G(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(0===a);return c-=e.strm.avail_in,c&&(c>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=c&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-c,e.strm.next_in),e.strstart),e.strstart+=c,e.insert+=c>e.w_size-e.insert?e.w_size-e.insert:c),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?4:t!==p&&t!==v&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(n=e.window_size-e.strstart,e.strm.avail_in>n&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,n+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),n>e.strm.avail_in&&(n=e.strm.avail_in),n&&(G(e.strm,e.window,e.strstart,n),e.strstart+=n,e.insert+=n>e.w_size-e.insert?e.w_size-e.insert:n),e.high_water<e.strstart&&(e.high_water=e.strstart),n=e.bi_valid+42>>3,n=e.pending_buf_size-n>65535?65535:e.pending_buf_size-n,s=n>e.w_size?e.w_size:n,r=e.strstart-e.block_start,(r>=s||(r||t===v)&&t!==p&&0===e.strm.avail_in&&r<=n)&&(i=r>n?n:r,a=t===v&&0===e.strm.avail_in&&i===r?1:0,o(e,e.block_start,i,a),e.block_start+=i,X(e.strm)),a?3:1)},Z=function(e,t){for(var i,r;;){if(e.lookahead<N){if(Q(e),e.lookahead<N&&t===p)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=q(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-N&&(e.match_length=j(e,i)),e.match_length>=3)if(r=a(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=q(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=q(e,e.ins_h,e.window[e.strstart+1]);else r=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(H(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===v?(H(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(H(e,!1),0===e.strm.avail_out)?1:2},K=function(e,t){for(var i,r,n;;){if(e.lookahead<N){if(Q(e),e.lookahead<N&&t===p)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=q(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-N&&(e.match_length=j(e,i),e.match_length<=5&&(e.strategy===C||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,r=a(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=q(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(H(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=a(e,0,e.window[e.strstart-1]),r&&H(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=a(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===v?(H(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(H(e,!1),0===e.strm.avail_out)?1:2};function J(e,t,i,r,n){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=r,this.func=n}var Y=[new J(0,0,0,0,W),new J(4,4,8,4,Z),new J(4,5,16,8,Z),new J(4,6,32,32,Z),new J(4,4,16,16,K),new J(8,16,32,32,K),new J(8,16,128,128,K),new J(8,32,128,256,K),new J(32,128,258,1024,K),new J(32,258,258,4096,K)];function $(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=A,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),B(this.dyn_ltree),B(this.dyn_dtree),B(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),B(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),B(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var ee=function(e){if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.status!==O&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==M&&t.status!==L?1:0},te=function(e){if(ee(e))return x(e,_);e.total_in=e.total_out=0,e.data_type=P;var t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?O:M,e.adler=2===t.wrap?0:1,t.last_flush=-2,n(t),y},ie=function(e){var t,i=te(e);return i===y&&((t=e.state).window_size=2*t.w_size,B(t.head),t.max_lazy_match=Y[t.level].max_lazy,t.good_match=Y[t.level].good_length,t.nice_match=Y[t.level].nice_length,t.max_chain_length=Y[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),i},re=function(e,t,i,r,n,o){if(!e)return _;var s=1;if(t===E&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),n<1||n>9||i!==A||r<8||r>15||t<0||t>9||o<0||o>R||8===r&&1!==s)return x(e,_);8===r&&(r=9);var a=new $;return e.state=a,a.strm=e,a.status=O,a.wrap=s,a.gzhead=null,a.w_bits=r,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=n+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<n+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=t,a.strategy=o,a.method=i,ie(e)};e.exports.deflateInit=function(e,t){return re(e,t,A,15,8,k)},e.exports.deflateInit2=re,e.exports.deflateReset=ie,e.exports.deflateResetKeep=te,e.exports.deflateSetHeader=function(e,t){return ee(e)||2!==e.state.wrap?_:(e.state.gzhead=t,y)},e.exports.deflate=function(e,t){if(ee(e)||t>g||t<0)return e?x(e,_):_;var i=e.state;if(!e.output||0!==e.avail_in&&!e.input||i.status===L&&t!==v)return x(e,0===e.avail_out?T:_);var r=i.last_flush;if(i.last_flush=t,0!==i.pending){if(X(e),0===e.avail_out)return i.last_flush=-1,y}else if(0===e.avail_in&&U(t)<=U(r)&&t!==v)return x(e,T);if(i.status===L&&0!==e.avail_in)return x(e,T);if(i.status===O&&0===i.wrap&&(i.status=M),i.status===O){var n,s=A+(i.w_bits-8<<4)<<8;if(n=i.strategy>=w||i.level<2?0:i.level<6?1:6===i.level?2:3,s|=n<<6,0!==i.strstart&&(s|=32),s+=31-s%31,V(i,s),0!==i.strstart&&(V(i,e.adler>>>16),V(i,65535&e.adler)),e.adler=1,i.status=M,X(e),0!==i.pending)return i.last_flush=-1,y}if(57===i.status)if(e.adler=0,F(i,31),F(i,139),F(i,8),i.gzhead)F(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),F(i,255&i.gzhead.time),F(i,i.gzhead.time>>8&255),F(i,i.gzhead.time>>16&255),F(i,i.gzhead.time>>24&255),F(i,9===i.level?2:i.strategy>=w||i.level<2?4:0),F(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(F(i,255&i.gzhead.extra.length),F(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=l(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69;else if(F(i,0),F(i,0),F(i,0),F(i,0),F(i,0),F(i,9===i.level?2:i.strategy>=w||i.level<2?4:0),F(i,3),i.status=M,X(e),0!==i.pending)return i.last_flush=-1,y;if(69===i.status){if(i.gzhead.extra){for(var u=i.pending,d=(65535&i.gzhead.extra.length)-i.gzindex;i.pending+d>i.pending_buf_size;){var h=i.pending_buf_size-i.pending;if(i.pending_buf.set(i.gzhead.extra.subarray(i.gzindex,i.gzindex+h),i.pending),i.pending=i.pending_buf_size,i.gzhead.hcrc&&i.pending>u&&(e.adler=l(e.adler,i.pending_buf,i.pending-u,u)),i.gzindex+=h,X(e),0!==i.pending)return i.last_flush=-1,y;u=0,d-=h}var S=new Uint8Array(i.gzhead.extra);i.pending_buf.set(S.subarray(i.gzindex,i.gzindex+d),i.pending),i.pending+=d,i.gzhead.hcrc&&i.pending>u&&(e.adler=l(e.adler,i.pending_buf,i.pending-u,u)),i.gzindex=0}i.status=73}if(73===i.status){if(i.gzhead.name){var E,C=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>C&&(e.adler=l(e.adler,i.pending_buf,i.pending-C,C)),X(e),0!==i.pending)return i.last_flush=-1,y;C=0}E=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,F(i,E)}while(0!==E);i.gzhead.hcrc&&i.pending>C&&(e.adler=l(e.adler,i.pending_buf,i.pending-C,C)),i.gzindex=0}i.status=91}if(91===i.status){if(i.gzhead.comment){var R,k=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>k&&(e.adler=l(e.adler,i.pending_buf,i.pending-k,k)),X(e),0!==i.pending)return i.last_flush=-1,y;k=0}R=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,F(i,R)}while(0!==R);i.gzhead.hcrc&&i.pending>k&&(e.adler=l(e.adler,i.pending_buf,i.pending-k,k))}i.status=103}if(103===i.status){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size&&(X(e),0!==i.pending))return i.last_flush=-1,y;F(i,255&e.adler),F(i,e.adler>>8&255),e.adler=0}if(i.status=M,X(e),0!==i.pending)return i.last_flush=-1,y}if(0!==e.avail_in||0!==i.lookahead||t!==p&&i.status!==L){var P=0===i.level?W(i,t):i.strategy===w?function(e,t){for(var i;;){if(0===e.lookahead&&(Q(e),0===e.lookahead)){if(t===p)return 1;break}if(e.match_length=0,i=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(H(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===v?(H(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(H(e,!1),0===e.strm.avail_out)?1:2}(i,t):i.strategy===I?function(e,t){for(var i,r,n,o,s=e.window;;){if(e.lookahead<=D){if(Q(e),e.lookahead<=D&&t===p)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=e.strstart-1,r=s[n],r===s[++n]&&r===s[++n]&&r===s[++n])){o=e.strstart+D;do{}while(r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&n<o);e.match_length=D-(o-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=a(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(H(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===v?(H(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(H(e,!1),0===e.strm.avail_out)?1:2}(i,t):Y[i.level].func(i,t);if(3!==P&&4!==P||(i.status=L),1===P||3===P)return 0===e.avail_out&&(i.last_flush=-1),y;if(2===P&&(t===f?c(i):t!==g&&(o(i,0,0,!1),t===m&&(B(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),X(e),0===e.avail_out))return i.last_flush=-1,y}return t!==v?y:i.wrap<=0?b:(2===i.wrap?(F(i,255&e.adler),F(i,e.adler>>8&255),F(i,e.adler>>16&255),F(i,e.adler>>24&255),F(i,255&e.total_in),F(i,e.total_in>>8&255),F(i,e.total_in>>16&255),F(i,e.total_in>>24&255)):(V(i,e.adler>>>16),V(i,65535&e.adler)),X(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?y:b)},e.exports.deflateEnd=function(e){if(ee(e))return _;var t=e.state.status;return e.state=null,t===M?x(e,S):y},e.exports.deflateSetDictionary=function(e,t){var i=t.length;if(ee(e))return _;var r=e.state,n=r.wrap;if(2===n||1===n&&r.status!==O||r.lookahead)return _;if(1===n&&(e.adler=u(e.adler,t,i,0)),r.wrap=0,i>=r.w_size){0===n&&(B(r.head),r.strstart=0,r.block_start=0,r.insert=0);var o=new Uint8Array(r.w_size);o.set(t.subarray(i-r.w_size,i),0),t=o,i=r.w_size}var s=e.avail_in,a=e.next_in,c=e.input;for(e.avail_in=i,e.next_in=0,e.input=t,Q(r);r.lookahead>=3;){var l=r.strstart,d=r.lookahead-2;do{r.ins_h=q(r,r.ins_h,r.window[l+3-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++}while(--d);r.strstart=l,r.lookahead=2,Q(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=c,e.avail_in=s,r.wrap=n,y},e.exports.deflateInfo="pako deflate (from Nodeca project)"},6471:function(e){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},9773:function(e){"use strict";function t(e){for(var t=e.length;--t>=0;)e[t]=0}var i=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),r=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),n=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),o=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);t(s);var a=new Array(60);t(a);var c=new Array(512);t(c);var u=new Array(256);t(u);var l=new Array(29);t(l);var d,h,p,f=new Array(30);function m(e,t,i,r,n){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=r,this.max_length=n,this.has_stree=e&&e.length}function v(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}t(f);var g=function(e){return e<256?c[e]:c[256+(e>>>7)]},y=function(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},b=function(e,t,i){e.bi_valid>16-i?(e.bi_buf|=t<<e.bi_valid&65535,y(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)},_=function(e,t,i){b(e,i[2*t],i[2*t+1])},S=function(e,t){var i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1},T=function(e,t,i){var r,n,o=new Array(16),s=0;for(r=1;r<=15;r++)s=s+i[r-1]<<1,o[r]=s;for(n=0;n<=t;n++){var a=e[2*n+1];0!==a&&(e[2*n]=S(o[a]++,a))}},E=function(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},C=function(e){e.bi_valid>8?y(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},w=function(e,t,i,r){var n=2*t,o=2*i;return e[n]<e[o]||e[n]===e[o]&&r[t]<=r[i]},I=function(e,t,i){for(var r=e.heap[i],n=i<<1;n<=e.heap_len&&(n<e.heap_len&&w(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!w(t,r,e.heap[n],e.depth));)e.heap[i]=e.heap[n],i=n,n<<=1;e.heap[i]=r},R=function(e,t,n){var o,s,a,c,d=0;if(0!==e.sym_next)do{o=255&e.pending_buf[e.sym_buf+d++],o+=(255&e.pending_buf[e.sym_buf+d++])<<8,s=e.pending_buf[e.sym_buf+d++],0===o?_(e,s,t):(a=u[s],_(e,a+256+1,t),c=i[a],0!==c&&(s-=l[a],b(e,s,c)),o--,a=g(o),_(e,a,n),c=r[a],0!==c&&(o-=f[a],b(e,o,c)))}while(d<e.sym_next);_(e,256,t)},k=function(e,t){var i,r,n,o=t.dyn_tree,s=t.stat_desc.static_tree,a=t.stat_desc.has_stree,c=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=573,i=0;i<c;i++)0!==o[2*i]?(e.heap[++e.heap_len]=u=i,e.depth[i]=0):o[2*i+1]=0;for(;e.heap_len<2;)n=e.heap[++e.heap_len]=u<2?++u:0,o[2*n]=1,e.depth[n]=0,e.opt_len--,a&&(e.static_len-=s[2*n+1]);for(t.max_code=u,i=e.heap_len>>1;i>=1;i--)I(e,o,i);n=c;do{i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],I(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=r,o[2*n]=o[2*i]+o[2*r],e.depth[n]=(e.depth[i]>=e.depth[r]?e.depth[i]:e.depth[r])+1,o[2*i+1]=o[2*r+1]=n,e.heap[1]=n++,I(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var i,r,n,o,s,a,c=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,d=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,f=t.stat_desc.max_length,m=0;for(o=0;o<=15;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,i=e.heap_max+1;i<573;i++)r=e.heap[i],o=c[2*c[2*r+1]+1]+1,o>f&&(o=f,m++),c[2*r+1]=o,r>u||(e.bl_count[o]++,s=0,r>=p&&(s=h[r-p]),a=c[2*r],e.opt_len+=a*(o+s),d&&(e.static_len+=a*(l[2*r+1]+s)));if(0!==m){do{for(o=f-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[f]--,m-=2}while(m>0);for(o=f;0!==o;o--)for(r=e.bl_count[o];0!==r;)n=e.heap[--i],n>u||(c[2*n+1]!==o&&(e.opt_len+=(o-c[2*n+1])*c[2*n],c[2*n+1]=o),r--)}}(e,t),T(o,u,e.bl_count)},P=function(e,t,i){var r,n,o=-1,s=t[1],a=0,c=7,u=4;for(0===s&&(c=138,u=3),t[2*(i+1)+1]=65535,r=0;r<=i;r++)n=s,s=t[2*(r+1)+1],++a<c&&n===s||(a<u?e.bl_tree[2*n]+=a:0!==n?(n!==o&&e.bl_tree[2*n]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,o=n,0===s?(c=138,u=3):n===s?(c=6,u=3):(c=7,u=4))},A=function(e,t,i){var r,n,o=-1,s=t[1],a=0,c=7,u=4;for(0===s&&(c=138,u=3),r=0;r<=i;r++)if(n=s,s=t[2*(r+1)+1],!(++a<c&&n===s)){if(a<u)do{_(e,n,e.bl_tree)}while(0!=--a);else 0!==n?(n!==o&&(_(e,n,e.bl_tree),a--),_(e,16,e.bl_tree),b(e,a-3,2)):a<=10?(_(e,17,e.bl_tree),b(e,a-3,3)):(_(e,18,e.bl_tree),b(e,a-11,7));a=0,o=n,0===s?(c=138,u=3):n===s?(c=6,u=3):(c=7,u=4)}},D=!1,N=function(e,t,i,r){b(e,0+(r?1:0),3),C(e),y(e,i),y(e,~i),i&&e.pending_buf.set(e.window.subarray(t,t+i),e.pending),e.pending+=i};e.exports._tr_init=function(e){D||(function(){var e,t,o,v,g,y=new Array(16);for(o=0,v=0;v<28;v++)for(l[v]=o,e=0;e<1<<i[v];e++)u[o++]=v;for(u[o-1]=v,g=0,v=0;v<16;v++)for(f[v]=g,e=0;e<1<<r[v];e++)c[g++]=v;for(g>>=7;v<30;v++)for(f[v]=g<<7,e=0;e<1<<r[v]-7;e++)c[256+g++]=v;for(t=0;t<=15;t++)y[t]=0;for(e=0;e<=143;)s[2*e+1]=8,e++,y[8]++;for(;e<=255;)s[2*e+1]=9,e++,y[9]++;for(;e<=279;)s[2*e+1]=7,e++,y[7]++;for(;e<=287;)s[2*e+1]=8,e++,y[8]++;for(T(s,287,y),e=0;e<30;e++)a[2*e+1]=5,a[2*e]=S(e,5);d=new m(s,i,257,286,15),h=new m(a,r,0,30,15),p=new m(new Array(0),n,0,19,7)}(),D=!0),e.l_desc=new v(e.dyn_ltree,d),e.d_desc=new v(e.dyn_dtree,h),e.bl_desc=new v(e.bl_tree,p),e.bi_buf=0,e.bi_valid=0,E(e)},e.exports._tr_stored_block=N,e.exports._tr_flush_block=function(e,t,i,r){var n,c,u=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),k(e,e.l_desc),k(e,e.d_desc),u=function(e){var t;for(P(e,e.dyn_ltree,e.l_desc.max_code),P(e,e.dyn_dtree,e.d_desc.max_code),k(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*o[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),n=e.opt_len+3+7>>>3,c=e.static_len+3+7>>>3,c<=n&&(n=c)):n=c=i+5,i+4<=n&&-1!==t?N(e,t,i,r):4===e.strategy||c===n?(b(e,2+(r?1:0),3),R(e,s,a)):(b(e,4+(r?1:0),3),function(e,t,i,r){var n;for(b(e,t-257,5),b(e,i-1,5),b(e,r-4,4),n=0;n<r;n++)b(e,e.bl_tree[2*o[n]+1],3);A(e,e.dyn_ltree,t-1),A(e,e.dyn_dtree,i-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),R(e,e.dyn_ltree,e.dyn_dtree)),E(e),r&&C(e)},e.exports._tr_tally=function(e,t,i){return e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=i,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(u[i]+256+1)]++,e.dyn_dtree[2*g(t)]++),e.sym_next===e.sym_end},e.exports._tr_align=function(e){b(e,2,3),_(e,256,s),function(e){16===e.bi_valid?(y(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},5798:function(e){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},8103:function(e,t,i){"undefined"!=typeof self&&self,e.exports=function(e){return i=[function(t,i){t.exports=e},,function(e,t,i){"use strict";i.r(t),i.d(t,"ZegoLogger",(function(){return Me})),i.d(t,"ZegoDataReport",(function(){return p})),i.d(t,"createZegoWebSocket",(function(){return d})),i.d(t,"LoggerStateCenter",(function(){return s})),a.getInstance=function(){return a.instance||(a.instance=new a).u(),a.instance},a.prototype.u=function(){},Object.defineProperty(a.prototype,"testEnvironment",{get:function(){return this.h},set:function(e){this.h=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"ENV",{get:function(){return this.v},set:function(e){this.v=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"debug",{get:function(){return this.g},set:function(e){this.g=e},enumerable:!1,configurable:!0}),a.instance=new a;var r,n,o,s=a;function a(){this.h=!0,this.v=0,this.g=!0}(t=j=j||{})[t.IE=0]="IE",t[t.FIREFOX=1]="FIREFOX",t[t.CHROME=2]="CHROME",t[t.SAFARI=3]="SAFARI",t[t.OPERA=4]="OPERA",t[t.WEIXIN=5]="WEIXIN",t[t.WEIXINMINI=6]="WEIXINMINI",t[t.UNKOWN=7]="UNKOWN",(j=r=r||{})[j.BROWSER=0]="BROWSER",j[j.WEIXINMINI=1]="WEIXINMINI",(n=n||{})[n.DEFAULT=0]="DEFAULT",(t=o=o||{})[t.DISABLE=0]="DISABLE",t[t.WEBSOCKET=1]="WEBSOCKET",t[t.HTTPS=2]="HTTPS";var c={DEBUG:0,INFO:1,WARN:2,ERROR:3,REPORT:99,DISABLE:100,debug:0,info:1,warn:2,error:3,report:99,disable:100},u=(l.prototype.init=function(){var e=this;this.O&&(this.readyState=0,this.O.onOpen((function(t){e.readyState=e.O.readyState,"function"==typeof e.onopen&&(e.onopen(t),e.O.onClose((function(t){e.readyState=e.O.readyState,"function"==typeof e.onclose&&e.onclose(t)})),e.O.onMessage((function(t){"function"==typeof e.onmessage&&e.onmessage(t)})))})),this.O.onError((function(t){e.readyState=e.O.readyState,"function"==typeof e.onerror&&e.onerror(t)})))},l.prototype.onopen=function(e){},l.prototype.onerror=function(e){},l.prototype.onclose=function(e){},l.prototype.onmessage=function(e){},l.prototype.send=function(e){this.O&&this.O.send({data:e})},l.prototype.close=function(){this.O&&this.O.close()},l);function l(e,t){this.url=e,this.readyState=3,this.init()}function d(e,t,i){return t%2===r.BROWSER?(t=e,i?i.createSocket(t,1):new WebSocket(t)):new u(e)}var h=function(){return(h=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},p=(f.prototype.newReport=function(e,t){this.dataStatistics[e]={event_time:Date.now(),time_consumed:0,seq:e,error:0,message:"success",event:t,events:[]}},f.prototype.addMsgExt=function(e,t){this.dataStatistics[e]?this.dataStatistics[e].msg_ext=t:console.warn("".concat(e," not exist"))},f.prototype.addMsgInfo=function(e,t){this.dataStatistics[e]?Object.assign(this.dataStatistics[e],t):console.warn("".concat(e," not exist"))},f.prototype.eventStart=function(e,t){this.dataStatistics[e]?null==this.dataStatistics[e].events?this.logger.warn("zd.es.0 no events"):this.dataStatistics[e].events.push({event:t,event_time:Date.now(),time_consumed:0}):this.logger.warn("zd.es.0 no seq match")},f.prototype.eventEnd=function(e,t,i){if(this.dataStatistics[e]){var r=this.dataStatistics[e].events;if(r&&0!==r.length){for(var n=r.length-1;0<=n;n--)if(r[n].event==t&&0==r[n].time_consumed){r[n].time_consumed=Date.now()-r[n].event_time;break}}else this.logger.info("zd.ee.0 no events")}else this.logger.info("zd.ee.0 no seq match")},f.prototype.eventEndWithMsg=function(e,t,i){if(this.dataStatistics[e]){var r=this.dataStatistics[e].events;if(r){for(var n=r.length-1;0<=n;n--)if(r[n].event==t&&0==r[n].time_consumed){r[n].time_consumed=Date.now()-r[n].event_time,null==r[n].msg_ext&&(r[n].msg_ext={}),r[n].msg_ext=h({},i);break}}else this.logger.warn("zd.ee.0 no events")}else this.logger.warn("zd.ee.0 no seq match")},f.prototype.eventEndWithMsgInfo=function(e,t,i){if(this.dataStatistics[e]){var r=this.dataStatistics[e].events;if(r){for(var n=r.length-1;0<=n;n--)if(r[n].event==t&&0==r[n].time_consumed){r[n].time_consumed=Date.now()-r[n].event_time,Object.assign(r[n],i);break}}else this.logger.warn("zd.ee.0 no events")}else this.logger.warn("zd.ee.0 no seq match")},f.prototype.addEventInfo=function(e,t,i,r){if(this.dataStatistics[e]){var n=this.dataStatistics[e].events;if(null==n)this.logger.warn("zd.aei.0 no events");else for(var o=n.length-1;0<=o;o--)if(n[o].event==t&&null!=n[o].time_consumed){null==n[o].msg_ext?n[o].msg_ext={}:n[o].msg_ext&&(n[o].msg_ext[i]=r);break}}else this.logger.warn("zd.aei.0 no seq match")},f.prototype.addEventMsg=function(e,t,i,r){if(this.dataStatistics[e]){var n=this.dataStatistics[e].events;if(null==n)this.logger.warn("zd.aem.0 no events");else for(var o=n.length-1;0<=o;o--)if(n[o].event==t){n[o][i]=r;break}}else this.logger.warn("zd.aem.0 no seq match")},f.prototype.addEvent=function(e,t,i){this.dataStatistics[e]?this.dataStatistics[e].events&&this.dataStatistics[e].events.push(i?{event:t,event_time:Date.now(),msg_ext:i}:{event:t,event_time:Date.now()}):this.logger.warn("zd.ae.0 no seq match")},f.prototype.uploadReport=function(e,t,i,r){var n=this.dataStatistics[e];null!=n&&(t&&(n.event=t),n.time_consumed=Date.now()-n.event_time,i&&this.addMsgInfo(e,{error:i.code,message:i.message||i.msg+" "+(r||"")}),this.logger.report(n),delete this.dataStatistics[e])},f);function f(e){this.dataStatistics={},this.logger=e}var m,v=["00","01","02","03","04","05","06","07","08","09"];function g(){var e=new Date;return[e.getFullYear()+"/",(v[e.getMonth()+1]||e.getMonth()+1)+"/",(v[e.getDate()]||e.getDate())+" ",(v[e.getHours()]||e.getHours())+":",(v[e.getMinutes()]||e.getMinutes())+":",v[e.getSeconds()]||e.getSeconds(),"."+e.getTime()%1e3].join("")}(j=m=m||{}).WEBSOCKET_STATE_CHANGE="zl.net.wsc",j.OPEN_WS="zl.net.opws";var y=function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},b=(Object.defineProperty(_.prototype,"url",{get:function(){return this.j.url},set:function(e){this.j.url=e},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"strategy",{get:function(){return this._.strategy},enumerable:!1,configurable:!0}),_.prototype.setStrategy=function(e){this._.setStrategy(e),this.S=this._.build()},_.prototype.addRemoteWsLog=function(e){var t;if(this.j.env!=r.BROWSER)throw new Error("cannot use net strategy on mini program");this.closed()&&(t=this.url,this.url="",this.openWebSocketLogServer(t)),this.k.push(e),this.connected()&&this.S&&this.S.active()},_.prototype.stopWebSocketServer=function(){this.O&&(this.O.onclose=null,this.O.onerror=null,this.O.close(),this.O=null)},_.prototype.P=function(){this.O&&this.j.useStrategy&&(this._.setWs(this.O),this._.setCache(this.k),this.S=this._.build())},_.prototype.N=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];var r=this.T,n="";switch(e){case"onconnecting":this.T="never_opened"===this.T?"first_connecting":"reconnecting";break;case"onopen":this.T="connected";break;case"onclosed":this.T="closed";var o=t[0];o&&(n+=" close code=".concat(o.code));break;case"onerror":this.T="error"}e=m.WEBSOCKET_STATE_CHANGE+" log ws state change: ".concat(r," -> ").concat(this.T),n&&(e+=n),this.D.info(e)},_.prototype.openWebSocketLogServer=function(e){var t=this;this.url!=e&&((this.url&&""!==this.url||"never_opened"===this.T)&&this.D.info(m.OPEN_WS+" log url change to: ".concat(e)),this.url=e)&&(this.stopWebSocketServer(),this.O=d(e,this.j.env,this.I),this.P(),this.N("onconnecting"),this.O.onopen=function(){var e;t.j.useStrategy&&null!=(e=t.S)&&e.active(),t.N("onopen")},this.O.onclose=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];console.warn("onclose websocket error:",e),t.N.apply(t,y(["onclosed"],e,!1))},this.O.onmessage=function(){},this.O.onerror=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];console.warn("open log websocket error:",e),t.N("onerror")})},_.prototype.closed=function(){return null==this.O||2==this.O.readyState||3==this.O.readyState},_.prototype.connected=function(){return null!==this.O&&1==this.O.readyState},_.prototype.connecting=function(){return null!==this.O&&0==this.O.readyState},_.prototype.wsSend=function(e){this.O&&this.O.send(e)},_.prototype.destroy=function(){this.O=null},_);function _(e,t,i,r){this.k=e,this.j=t,this.D=i,this.I=r,this.O=null,this.T="never_opened",this._=new X,this.S=null}T.prototype.active=function(){var e=this;this.A&&1===this.A.readyState&&0!==this.k.size()&&this.q.canSendLog()&&(this.q.getLog().forEach((function(t){e.A.send(t)})),this.q.onSendLog())};var S=T;function T(e,t,i){this.A=e,this.k=t,this.q=i,this.q.onCanSendActive=this.active.bind(this)}function E(e){this.cache=e}C=function(e,t){return(C=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}C(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(P,w=E),P.prototype.getLog=function(){return this.cache.clear()},P.prototype.canSendLog=function(){return 0<this.cache.size()},P.prototype.onSendLog=function(){};var C,w,I,R,k=P;function P(e){return w.call(this,e)||this}function A(){var e=null!==R&&R.apply(this,arguments)||this;return e.maxDelay=10,e.maxPacketLen=20480,e.locked=!1,e}I=function(e,t){return(I=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}I(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(A,R=E),A.prototype.canSendLog=function(){return!this.locked&&0<this.cache.size()},A.prototype.getLog=function(){for(var e=[],t=0;t<this.maxPacketLen-4e3;){var i=this.cache.getOneLogPacket();if(!i||i.length<=0)break;t+=i.length||0,e.push(i)}return e},A.prototype.onSendLog=function(){var e=this;this.locked=!0,setTimeout((function(){e.locked=!1,e.onCanSendActive&&e.onCanSendActive()}),this.maxDelay)},D=function(e,t){return(D=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}D(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(q,N=t=A);var D,N,O,M,L,x,U,B,z=q;function q(e){return(e=N.call(this,e)||this).maxDelay=10,e.maxPacketLen=20480,e}O=function(e,t){return(O=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}O(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}((function(){return null!==M&&M.apply(this,arguments)||this}),M=t),L=function(e,t){return(L=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}L(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}((function(){return null!==x&&x.apply(this,arguments)||this}),x=t),U=function(e,t){return(U=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}U(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}((function(){return null!==B&&B.apply(this,arguments)||this}),B=t),Object.defineProperty(H.prototype,"strategy",{get:function(){return this.q},enumerable:!1,configurable:!0}),H.prototype.setWs=function(e){this.A=e},H.prototype.setCache=function(e){this.k=e},H.prototype.setStrategy=function(e){e&&(this.q=e)},H.prototype.build=function(){if(this.A&&this.k)return new S(this.A,this.k,this.q!==n.DEFAULT?new k(this.k):new z(this.k));throw new Error("cannot build log sender")};var X=H;function H(){this.q=n.DEFAULT}V.R=function(){return!(!window||!window.localStorage)},V.bin2hex=function(e){for(var t,i="",r=0,n=(e+="").length;r<n;r++)i+=(t=e.charCodeAt(r).toString(16)).length<2?"0"+t:t;return i},V.getCanvasFingerprint=function(e){var t=document.createElement("canvas"),i=((i=t.getContext("2d")).textBaseline="top",i.font="14px 'Arial'",i.fillStyle="#f60",i.fillRect(125,1,62,20),i.fillStyle="#069",i.fillText(e,2,15),i.fillStyle="rgba(102, 204, 0, 0.7)",i.fillText(e,4,17),t.toDataURL().replace("data:image/png;base64,",""));return e=atob(i),this.bin2hex(e.slice(-16,-12))},V.generateUUID=function(){var e,t,i=localStorage.getItem(this.C);return i||(e=(new Date).getTime(),i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var i=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?i:3&i|8).toString(36)})),t=this.getCanvasFingerprint("hello, zego")+i.slice(8),localStorage.setItem(this.C,t),i)},V.id=function(){var e;return V.R()?((e=localStorage.getItem(this.C))||(e=V.generateUUID(),localStorage.setItem(this.C,e)),e):""},V.C="z_deviceID";var F=V;function V(){}var G=function(){this.url="",this.env=r.BROWSER,this.useStrategy=!0,this.token="",this.deviceid=F.id()};Object.defineProperty(Q.prototype,"buffer",{get:function(){return this.queue},set:function(e){this.queue=e},enumerable:!1,configurable:!0}),Q.prototype.push=function(e){if(!e)throw new Error("item null!");e&&this.queue.push(e)},Q.prototype.pop=function(){return this.queue.shift()},Q.prototype.front=function(){return this.queue[0]};var j=Q;function Q(){this.queue=[]}W=function(e,t){return(W=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(e,t)};var W,Z,K=function(){return(K=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},J=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}W(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Y,Z=j),Y.prototype.size=function(){return this.queue.length},Y.prototype.getOneLogPacket=function(){var e="";if(this.size()){var t=JSON.parse(this.queue[this.queue.length-1]).userid,i=this.j.userid||t;if(i){for(;0<this.queue.length;){if(4e3<(e+this.queue[0]).length)return e;var r=JSON.parse(this.queue[0]);r=K(K({},r),{userid:r.userid||i,roomid:r.roomid||this.j.roomid,userName:r.userName||this.j.userName}),e=e+JSON.stringify(r)+"\n",this.queue.shift()}return""===e?void 0:e}}},Y.prototype.clear=function(){for(var e=[];0<this.queue.length;){var t=this.getOneLogPacket();if(!t)break;e.push(t)}return e},Y);function Y(e){var t=Z.call(this)||this;return t.j=e,t}var $=(ee.prototype.save=function(e){return this.J.save(this.M,{log:e})},ee.prototype.queryList=function(e){return this.J.queryByCursor(this.M,e)},ee.prototype.delete=function(e){return this.J.deleteItems(this.M,e)},ee.prototype.storedBytesSize=function(){var e=this;return new Promise((function(t,i){return function(e,t,i,r){return new(i=i||Promise)((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(e,void 0,void 0,(function(){var e,r;return function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){var u=[a,c];if(i)throw new TypeError("Generator is already executing.");for(;o=s&&u[s=0]?0:o;)try{if(i=1,r&&(n=2&u[0]?r.return:u[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,u[1])).done)return n;switch(r=0,(u=n?[2&u[0],n.value]:u)[0]){case 0:case 1:n=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3]))o.label=u[1];else if(6===u[0]&&o.label<n[1])o.label=n[1],n=u;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(u)}}u=t.call(e,o)}catch(c){u=[6,c],r=0}finally{i=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,(function(n){return e=this.J.openCursor(this.M),r=0,e.onsuccess=function(e){(e=null==(e=e.target)?void 0:e.result)?(r+=e.value.log.length,e.continue()):t(r)},e.onerror=function(e){i(e)},[2]}))}))}))},ee.prototype.lines=function(){return this.J.lines(this.M)},ee.prototype.deleteByCount=function(e){return this.J.deleteByCount(this.M,e)},ee.prototype.deleteAll=function(){return this.J.deleteAll(this.M)},ee);function ee(e){this.J=e,this.M="zego_log"}var te=function(e,t,i,r){return new(i=i||Promise)((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},ie=function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){var u=[a,c];if(i)throw new TypeError("Generator is already executing.");for(;o=s&&u[s=0]?0:o;)try{if(i=1,r&&(n=2&u[0]?r.return:u[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,u[1])).done)return n;switch(r=0,(u=n?[2&u[0],n.value]:u)[0]){case 0:case 1:n=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3]))o.label=u[1];else if(6===u[0]&&o.label<n[1])o.label=n[1],n=u;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(u)}}u=t.call(e,o)}catch(c){u=[6,c],r=0}finally{i=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},re=(ne.prototype.openDB=function(e){return te(this,void 0,void 0,(function(){var t,i,r=this;return ie(this,(function(n){switch(n.label){case 0:return t=window.indexedDB.open(e.database,e.version),i=this,[4,new Promise((function(i){t.onupgradeneeded=function(t){var i=t.target&&t.target.result;e.tableList.forEach((function(e){var t;i.objectStoreNames.contains(e.tableName)||(t=i.createObjectStore(e.tableName,{keyPath:"id",autoIncrement:!0}),e.tableItems.forEach((function(e){e.index&&t.createIndex(e.itemName,e.itemName,{unique:e.unique})})))}))},t.onsuccess=function(e){r.L=e=e.target&&e.target.result,i(t)}}))];case 1:return i.W=n.sent(),[2]}}))}))},ne.prototype.B=function(){if(!this.W&&!this.L)throw new Error("indexDB not open")},ne.prototype.save=function(e,t){var i=this;return new Promise((function(r,n){return te(i,void 0,void 0,(function(){var i,o;return ie(this,(function(s){return this.B(),i=this.L.transaction([e],"readwrite").objectStore(e),(o=i.add(t)).onsuccess=function(e){r(o.result)},o.onerror=function(e){n("save item fail")},[2]}))}))}))},ne.prototype.update=function(e,t){var i=this;return new Promise((function(e,t){i.B(),e()}))},ne.prototype.queryById=function(e,t){var i=this;return new Promise((function(r,n){return te(i,void 0,void 0,(function(){var i,o;return ie(this,(function(s){return this.B(),i=this.L.transaction([e]).objectStore(e),(o=i.get(t)).onsuccess=function(e){r(o.result?o.result:null)},o.onerror=function(e){n()},[2]}))}))}))},ne.prototype.queryByCursor=function(e,t){var i=this;return new Promise((function(r,n){return te(i,void 0,void 0,(function(){var i,o;return ie(this,(function(s){return this.B(),o=this.L.transaction([e]).objectStore(e),i=[],(o=o.openCursor()).onsuccess=function(e){(e=null==(e=e.target)?void 0:e.result)&&(!t||i.length<t)?(i.push(e.value),e.continue()):r(i)},o.onerror=function(e){n()},[2]}))}))}))},ne.prototype.lines=function(e){var t=this;return new Promise((function(i,r){return te(t,void 0,void 0,(function(){var t,n;return ie(this,(function(o){return this.B(),t=(t=this.L.transaction([e]).objectStore(e)).openCursor(),n=0,t.onsuccess=function(e){(e=null==(e=e.target)?void 0:e.result)?(n++,e.continue()):i(n)},t.onerror=function(e){r()},[2]}))}))}))},ne.prototype.openCursor=function(e){return this.B(),this.L.transaction([e]).objectStore(e).openCursor()},ne.prototype.deleteById=function(e,t){var i=this;return new Promise((function(r,n){return te(i,void 0,void 0,(function(){var i;return ie(this,(function(o){return this.B(),(i=(i=this.L.transaction([e],"readwrite").objectStore(e)).delete(t)).onsuccess=function(e){r()},i.onerror=function(e){n()},[2]}))}))}))},ne.prototype.deleteByCount=function(e,t){var i=this;return new Promise((function(r,n){return te(i,void 0,void 0,(function(){var i,n;return ie(this,(function(o){switch(o.label){case 0:this.B(),i=8192,o.label=1;case 1:return 0<t?[4,this.queryByCursor(e,Math.min(t,i))]:[3,4];case 2:return 0===(n=o.sent()).length?[3,4]:(t-=i,[4,this.deleteItems(e,n)]);case 3:return o.sent(),[3,1];case 4:return r(),[2]}}))}))}))},ne.prototype.deleteAll=function(e){var t=this;return new Promise((function(i,r){return te(t,void 0,void 0,(function(){var t;return ie(this,(function(n){return this.B(),(t=(t=this.L.transaction([e],"readwrite").objectStore(e)).clear()).onsuccess=function(e){i()},t.onerror=function(e){r()},[2]}))}))}))},ne.prototype.deleteItems=function(e,t){var i=this;return new Promise((function(r){return te(i,void 0,void 0,(function(){var i;return ie(this,(function(n){switch(n.label){case 0:return this.B(),i=this.L.transaction([e],"readwrite").objectStore(e),[4,Promise.all(t.map((function(e){return new Promise((function(t,r){var n=i.delete(e.id);n.onsuccess=function(e){t()},n.onerror=function(e){r()}}))})))];case 1:return n.sent(),r(),[2]}}))}))}))},ne);function ne(){}var oe={version:1,database:"zego_logger_db",tableList:[{tableName:"zego_log",tableItems:[{itemName:"log",index:!1,unique:!1}]}]};se=function(e,t){return(se=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}se(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(ue,ae=j);var se,ae,ce=ue;function ue(){return null!==ae&&ae.apply(this,arguments)||this}var le=function(){return(le=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},de=function(e,t,i,r){return new(i=i||Promise)((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},he=function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){var u=[a,c];if(i)throw new TypeError("Generator is already executing.");for(;o=s&&u[s=0]?0:o;)try{if(i=1,r&&(n=2&u[0]?r.return:u[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,u[1])).done)return n;switch(r=0,(u=n?[2&u[0],n.value]:u)[0]){case 0:case 1:n=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3]))o.label=u[1];else if(6===u[0]&&o.label<n[1])o.label=n[1],n=u;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(u)}}u=t.call(e,o)}catch(c){u=[6,c],r=0}finally{i=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},pe=(fe.prototype.pushTask=function(e,t,i,r,n){e={task:e},t&&(e=le(le({},e),{args:t})),i&&(e=le(le({},e),{successCallback:i})),r&&(e=le(le({},e),{errorCallback:r})),n&&(e=le(le({},e),{completeCallback:n})),this.G.push(e)},fe.prototype.X=function(e){return de(this,void 0,void 0,(function(){var t,i;return he(this,(function(r){switch(r.label){case 0:t=null,r.label=1;case 1:return r.trys.push([1,4,5,6]),e&&e.args?t=e.task.apply(e,e.args):e&&(t=e.task()),t instanceof Promise?[4,t]:[3,3];case 2:t=r.sent(),r.label=3;case 3:return e.successCallback&&e.successCallback(t),[3,6];case 4:if(i=r.sent(),e.errorCallback)return e.errorCallback(i),[3,6];throw i;case 5:return e.completeCallback&&e.completeCallback(),[7];case 6:return[2]}}))}))},fe.prototype.runATask=function(){return de(this,void 0,void 0,(function(){var e;return he(this,(function(t){switch(t.label){case 0:return this.G.length<=0?[2]:(e=this.G.shift())?[4,this.X(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},fe.prototype.runAllTask=function(){return de(this,void 0,void 0,(function(){var e;return he(this,(function(t){switch(t.label){case 0:return 0<this.G.length?(e=this.G.shift())?[4,this.X(e)]:[3,2]:[3,3];case 1:t.sent(),t.label=2;case 2:return[3,0];case 3:return[2]}}))}))},fe.prototype.size=function(){return this.G.length},fe);function fe(){this.G=[]}var me=i(0),ve=(ge.prototype.writeLine=function(e){e&&""!==e&&this.F.push(e)},ge.prototype.saveAs=function(e,t){var i=document.createElement("a");i.href=URL.createObjectURL(e),i.download=t,i.click()},ge.prototype.createZip=function(){var e="";return 0<this.F.length&&(e=this.F.join("\n"),this.F=[]),e=Object(me.deflate)(e),e=this.uint8arrayToBase64(e),new Blob([e],{type:"text/plain;charset=utf-8"})},ge.prototype.uint8arrayToBase64=function(e){for(var t,i=0,r=e.length,n="";i<r;)t=e.subarray(i,Math.min(i+32768,r)),n+=String.fromCharCode.apply(null,Array.from(t)),i+=32768;return btoa(n)},ge);function ge(){this.F=[]}var ye=function(e,t,i,r){return new(i=i||Promise)((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},be=function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){var u=[a,c];if(i)throw new TypeError("Generator is already executing.");for(;o=s&&u[s=0]?0:o;)try{if(i=1,r&&(n=2&u[0]?r.return:u[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,u[1])).done)return n;switch(r=0,(u=n?[2&u[0],n.value]:u)[0]){case 0:case 1:n=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3]))o.label=u[1];else if(6===u[0]&&o.label<n[1])o.label=n[1],n=u;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(u)}}u=t.call(e,o)}catch(c){u=[6,c],r=0}finally{i=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},_e=(Se.prototype.H=function(){return!!(this.j.appid&&this.j.userid&&""!==this.j.userid&&this.j.token&&""!==this.j.token&&this.j.deviceid&&""!==this.j.deviceid)},Se.prototype.setUploadUrl=function(e){this.U=e},Se.prototype.upload=function(e){return ye(this,void 0,void 0,(function(){var t=this;return be(this,(function(i){if(this.H())return[2,new Promise((function(i,r){return ye(t,void 0,void 0,(function(){var t,n=this;return be(this,(function(o){switch(o.label){case 0:return t=function(){return ye(n,void 0,void 0,(function(){var t,i,n=this;return be(this,(function(o){switch(o.label){case 0:this.Z=!0,(t=new FormData).append("logs",e),t.append("hello",this.j.appid.toString()),t.append("appid",this.j.appid.toString()),t.append("uin",this.j.userid.toString()),t.append("timestamp",(new Date).getTime().toString()),t.append("token",this.j.token),t.append("deviceid",this.j.deviceid),o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,Te.post(this.U,t,this.proxyCtrl)];case 2:if(0!==(i=o.sent()).code)throw new Error("upload logs failed, error=".concat(JSON.stringify(i)));return[3,5];case 3:return i=o.sent(),r(i),[3,5];case 4:return setTimeout((function(){return ye(n,void 0,void 0,(function(){return be(this,(function(e){switch(e.label){case 0:return this.Z=!1,[4,this.K.runATask()];case 1:return e.sent(),[2]}}))}))}),100),[7];case 5:return[2]}}))}))},this.Z?(this.K.pushTask(t,[],(function(){i()}),(function(e){r(e)})),[3,3]):[3,1];case 1:return[4,t()];case 2:o.sent(),i(),o.label=3;case 3:return[2]}}))}))}))];throw new Error("cannot upload logs, please login room before you upload logs.")}))}))},Se);function Se(e,t){this.j=e,this.proxyCtrl=t,this.V="detaillog-global.zego.im",this.U="https://".concat(this.V,"/log/userupload"),this.K=new pe,this.Z=!1}var Te=(Ee.post=function(e,t,i){var r=this;return new Promise((function(n,o){return function(e,t,i,r){return new(i=i||Promise)((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(r,void 0,void 0,(function(){var r;return function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){var u=[a,c];if(i)throw new TypeError("Generator is already executing.");for(;o=s&&u[s=0]?0:o;)try{if(i=1,r&&(n=2&u[0]?r.return:u[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,u[1])).done)return n;switch(r=0,(u=n?[2&u[0],n.value]:u)[0]){case 0:case 1:n=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3]))o.label=u[1];else if(6===u[0]&&o.label<n[1])o.label=n[1],n=u;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(u)}}u=t.call(e,o)}catch(c){u=[6,c],r=0}finally{i=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,(function(s){try{i?i.startHttpRequest({location:e,body:t,method_no:2,headers:[{name:"Content-Type",val:"multipart/form-data"}],serviceType:2},(function(e){200===e.status_code?n(e.body):o("request fail. status="+e.status_code)}),(function(e){o("request fail. result: "+JSON.stringify(e))})):((r=new XMLHttpRequest).open("POST",e,!0),r.responseType="json",r.send(t),r.onreadystatechange=function(){r.readyState===XMLHttpRequest.DONE&&(200===r.status?n(r.response):o("request fail. status="+r.status))})}catch(s){o(s)}return[2]}))}))}))},Ee);function Ee(){}var Ce=function(){return(Ce=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},we=(Ie.prototype.build=function(e){var t=Ce(Ce({},JSON.parse(e)),{sdkid:this.Y});if(++this.$%100==0)return(e=JSON.stringify(t)).substring(1,e.length-1);for(i in t)this.tt.includes(i)||(t[i]===this.nt[i]?delete t[i]:this.nt[i]=t[i]);var i,r=[];for(i in t)this.tt.includes(i)?r.push(t[i]):r.push("".concat(i,":").concat(t[i]));return r.join(",")},Ie.prototype.buildFullMessageLog=function(e){return e=JSON.parse(e),e=Ce(Ce(Ce({},this.nt),e),{sdkid:this.Y}),JSON.stringify(e)},Ie);function Ie(e){this.j=e,this.nt={},this.tt=["time","action","content","sdkid"],this.$=0,this.Y=(e=5,crypto.getRandomValues(new Uint8Array(e)).reduce((function(e,t){return e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():62<t?"-":"_")}),""))}var Re=function(e,t,i,r){return new(i=i||Promise)((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},ke=function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){var u=[a,c];if(i)throw new TypeError("Generator is already executing.");for(;o=s&&u[s=0]?0:o;)try{if(i=1,r&&(n=2&u[0]?r.return:u[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,u[1])).done)return n;switch(r=0,(u=n?[2&u[0],n.value]:u)[0]){case 0:case 1:n=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3]))o.label=u[1];else if(6===u[0]&&o.label<n[1])o.label=n[1],n=u;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(u)}}u=t.call(e,o)}catch(c){u=[6,c],r=0}finally{i=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},Pe=(Object.defineProperty(Ae.prototype,"dbOpened",{get:function(){return this.it},enumerable:!1,configurable:!0}),Object.defineProperty(Ae.prototype,"dbTryOpened",{get:function(){return this.et},enumerable:!1,configurable:!0}),Ae.prototype.rt=function(){return Re(this,void 0,void 0,(function(){var e;return ke(this,(function(t){switch(t.label){case 0:return[4,this.ot.lines()];case 1:return 153600<(e=t.sent())?[4,this.ot.deleteByCount(e/2)]:[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},Ae.prototype.makeStorageSpaceUpload=function(){return Re(this,void 0,void 0,(function(){var e,t=this;return ke(this,(function(i){return this.st?(e=function(){return Re(t,void 0,void 0,(function(){return ke(this,(function(e){switch(e.label){case 0:return[4,this.ot.lines()];case 1:return 3072<e.sent()?[4,this.ut()]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},[2,new Promise((function(i,r){return Re(t,void 0,void 0,(function(){var t;return ke(this,(function(n){switch(n.label){case 0:return this.dbOpened?[3,1]:(this.ct.pushTask(e,[],(function(){i()}),(function(e){r(e)})),[3,5]);case 1:return n.trys.push([1,3,,4]),[4,e()];case 2:return n.sent(),[3,4];case 3:return t=n.sent(),r(t),[2];case 4:i(),n.label=5;case 5:return[2]}}))}))}))]):[2]}))}))},Ae.prototype.openDB=function(){return Re(this,void 0,void 0,(function(){return ke(this,(function(e){switch(e.label){case 0:return this.et?[2]:(this.et=!0,[4,this.J.openDB(oe)]);case 1:return e.sent(),this.it=!0,[4,this.rt()];case 2:return e.sent(),[4,this.ct.runAllTask()];case 3:return e.sent(),[4,this.ht.runATask()];case 4:return e.sent(),this.ft(),[2]}}))}))},Ae.prototype.lt=function(){return this.st&&Ae.isEnvSupport()&&!this.it&&!this.et},Ae.prototype.enable=function(){this.st||(this.st=!0,this.lt()&&this.openDB())},Ae.prototype.saveLog=function(e){this.lt()&&this.openDB(),this.k.push(this.vt.build(e)),this.ft()},Ae.prototype.removeLogList=function(e){return Re(this,void 0,void 0,(function(){return ke(this,(function(t){switch(t.label){case 0:return 0===e.length?[2]:[4,this.ot.delete(e)];case 1:return t.sent(),[2]}}))}))},Ae.prototype.empty=function(){return Re(this,void 0,void 0,(function(){return ke(this,(function(e){switch(e.label){case 0:return[4,this.ot.queryList(1)];case 1:return[2,0===e.sent().length]}}))}))},Ae.prototype.ft=function(){var e,t=this;this.st&&this.dbOpened&&!this.dt&&(this.dt=!0,(e=function(){var i=t.k.front();i?i&&t.ot.save(i).then((function(){t.k.pop(),e()})).catch((function(e){t.dt=!1,console.error(e)})):t.dt=!1})())},Ae.isEnvSupport=function(){return!(!window||!("indexedDB"in window))},Ae.prototype.wt=function(){return Re(this,void 0,void 0,(function(){var e,t,i,r;return ke(this,(function(n){switch(n.label){case 0:return[4,this.ot.lines()];case 1:e=n.sent(),t=3145728,i=function(){var i,n,o;return ke(this,(function(s){switch(s.label){case 0:return[4,r.ot.queryList(Math.min(t,e))];case 1:return i=s.sent(),e-=t,i.length<=0?[2,"break"]:(n=new ve,i.forEach((function(e){n.writeLine(e.log)})),o=n.createZip(),[4,r.bt.upload(o)]);case 2:return s.sent(),[4,r.ot.delete(i)];case 3:return s.sent(),[2]}}))},r=this,n.label=2;case 2:return 0<e?[5,i()]:[3,4];case 3:return"break"===n.sent()?[3,4]:[3,2];case 4:return[2]}}))}))},Ae.prototype.ut=function(){var e=this;return new Promise((function(t,i){return Re(e,void 0,void 0,(function(){var e,r=this;return ke(this,(function(n){return e=function(){return Re(r,void 0,void 0,(function(){return ke(this,(function(e){switch(e.label){case 0:return[4,this.wt()];case 1:return e.sent(),[2]}}))}))},this.ht.pushTask(e,[],(function(){t()}),(function(e){i(e)}),(function(){0<r.ht.size()&&r.ht.runATask()})),this.dbOpened&&1===this.ht.size()&&this.ht.runATask(),[2]}))}))}))},Ae.prototype.yt=function(){var e=this;return new Promise((function(t,i){return Re(e,void 0,void 0,(function(){var e,r=this;return ke(this,(function(n){return this.gt=!1,this.Ot=!0,e=function(){return Re(r,void 0,void 0,(function(){return ke(this,(function(e){switch(e.label){case 0:return this.Ot=!0,[4,this.wt()];case 1:return e.sent(),[2]}}))}))},this.ht.pushTask(e,[],(function(){r.gt=!0,r.Ot=!1,t()}),(function(e){r.Ot=!1,i(e)}),(function(){0<r.ht.size()&&r.ht.runATask()})),this.dbOpened&&1===this.ht.size()&&this.ht.runATask(),[2]}))}))}))},Ae.prototype.setUploadUrl=function(e){this.bt.setUploadUrl(e)},Ae.prototype.startUpload=function(){return Re(this,void 0,void 0,(function(){return ke(this,(function(e){switch(e.label){case 0:if(!this.st)throw new Error("zip logs upload is not enabled.");if(0!==this.jt&&performance.now()-this.jt<6e4&&this.gt||this.Ot)throw new Error("Logs upload failed. Do not report frequently.");return this.jt=performance.now(),[4,this.yt()];case 1:return e.sent(),[2]}}))}))},Ae.prototype.destroy=function(){},Ae);function Ae(e,t){this.j=e,this.proxyCtrl=t,this.J=new re,this.ot=new $(this.J),this.it=!1,this.et=!1,this.k=new ce,this.dt=!1,this.ct=new pe,this.ht=new pe,this.st=!1,this.jt=0,this.gt=!1,this.Ot=!1,this.bt=new _e(this.j,t),this.vt=new we(this.j)}var De=function(){return(De=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Ne=function(e,t,i,r){return new(i=i||Promise)((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Oe=function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){var u=[a,c];if(i)throw new TypeError("Generator is already executing.");for(;o=s&&u[s=0]?0:o;)try{if(i=1,r&&(n=2&u[0]?r.return:u[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,u[1])).done)return n;switch(r=0,(u=n?[2&u[0],n.value]:u)[0]){case 0:case 1:n=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(n=0<(n=o.trys).length&&n[n.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3]))o.label=u[1];else if(6===u[0]&&o.label<n[1])o.label=n[1],n=u;else{if(!(n&&o.label<n[2])){n[2]&&o.ops.pop(),o.trys.pop();continue}o.label=n[2],o.ops.push(u)}}u=t.call(e,o)}catch(c){u=[6,c],r=0}finally{i=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},Me=(Object.defineProperty(Le.prototype,"url",{get:function(){return this.j.url||""},set:function(e){this.j.url=e},enumerable:!1,configurable:!0}),Object.defineProperty(Le.prototype,"logType",{get:function(){return this.j.logType||o.DISABLE},set:function(e){this.j.logType=e},enumerable:!1,configurable:!0}),Object.defineProperty(Le.prototype,"env",{get:function(){return this.j.env},set:function(e){this.j.env=e},enumerable:!1,configurable:!0}),Object.defineProperty(Le.prototype,"appid",{get:function(){return this.j.appid},set:function(e){this.j.appid=e},enumerable:!1,configurable:!0}),Object.defineProperty(Le.prototype,"roomid",{get:function(){return this.j.roomid},set:function(e){this.j.roomid=e},enumerable:!1,configurable:!0}),Object.defineProperty(Le.prototype,"sessionid",{get:function(){return this.j.sessionid},set:function(e){this.j.sessionid=e},enumerable:!1,configurable:!0}),Object.defineProperty(Le.prototype,"userid",{get:function(){return this.j.userid},set:function(e){this.j.userid=e},enumerable:!1,configurable:!0}),Object.defineProperty(Le.prototype,"userName",{get:function(){return this.j.userName},set:function(e){this.j.userName=e},enumerable:!1,configurable:!0}),Object.defineProperty(Le.prototype,"version",{get:function(){return this.j.version},set:function(e){this.j.version=e},enumerable:!1,configurable:!0}),Le.prototype.setLogLevel=function(e){return void 0!==(e=c[e])&&(this.logLevel=e,!0)},Le.prototype.setRemoteLogLevel=function(e){return void 0!==(e=c[e])&&(this.logRemoteLevel=e,!0)},Le.prototype.setSessionInfo=function(e,t,i,r,n,o){this.appid=e,this.roomid=t,this.sessionid=i,this.userid=r,this.userName=n,this.version=o},Le.prototype.setTokenInfo=function(e,t,i){this.j.token=e||"",t&&(this.j.userid=t),i&&(this.j.userName=i)},Le.prototype.setZipLogConfig=function(e,t){1===e&&this.xt?this.xt.enable():0==e&&t&&this.xt&&(this.xt.destroy(),this.xt=null)},Le.prototype.setZipLogUploadUrl=function(e){this.xt&&this.xt.setUploadUrl(e)},Le.prototype.makeZipLogSpaceUpload=function(){return Ne(this,void 0,void 0,(function(){return Oe(this,(function(e){switch(e.label){case 0:return this.xt?[4,this.xt.makeStorageSpaceUpload()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},Le.prototype.uploadStorageLog=function(){return Ne(this,void 0,void 0,(function(){return Oe(this,(function(e){switch(e.label){case 0:return this.xt?[4,this.xt.startUpload()]:[3,2];case 1:return e.sent(),[3,3];case 2:throw new Error("cannot use zip log module");case 3:return[2]}}))}))},Le.prototype.report=function(e){e=this._t(c.REPORT,e),this.logLevel!==c.DISABLE&&this.logLevel<=c.REPORT&&!this.isDestroy&&console.debug(e),this.St(c.REPORT,e,!0)},Le.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=this.Et(c.DEBUG,e.join(""));this.logLevel!==c.DISABLE&&this.logLevel<=c.DEBUG&&!this.isDestroy&&console.debug(i),this.kt(c.DEBUG,i)},Le.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=this.Et(c.INFO,e.join(""));this.logLevel!==c.DISABLE&&this.logLevel<=c.INFO&&!this.isDestroy&&console.info(i),this.kt(c.INFO,i)},Le.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=this.Et(c.WARN,e.join(""));this.logLevel!==c.DISABLE&&this.logLevel<=c.WARN&&!this.isDestroy&&console.warn(i),this.kt(c.WARN,i)},Le.prototype.remoteReport=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=this.Et(c.INFO,e.join(""));this.kt(c.INFO,i)},Le.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=this.Et(c.ERROR,e.join(""));this.logLevel!==c.DISABLE&&this.logLevel<=c.ERROR&&!this.isDestroy&&(console.error(i),this.env%2===r.BROWSER&&window&&this.stateCenter.debug&&window.alert(e.join("").substr(e.join("").indexOf(" ")+1,4500))),this.kt(c.ERROR,i)},Le.prototype.kt=function(e,t){this.logRemoteLevel!==c.DISABLE&&this.logRemoteLevel<=e&&(this.St(e,t),this.xt)&&this.xt.saveLog(t)},Le.prototype.setLogServer=function(e){if(this.isDestroy)return!1;try{return e.startsWith("wss:")?(this.logType=o.WEBSOCKET,this.Pt.openWebSocketLogServer(e)):e.startsWith("https:")?(this.logType=o.HTTPS,this.Nt(e)):this.logType=o.DISABLE,!0}catch(e){return this.error(JSON.stringify(e)),!1}},Le.prototype.Tt=function(){this.logType==o.WEBSOCKET?this.zt():this.logType==o.HTTPS&&(this.Dt(),this.It()),this.logType=o.DISABLE},Le.prototype.zt=function(){this.Pt.stopWebSocketServer()},Le.prototype.Nt=function(e){var t=this;(this.url=e)&&(this.It(),this.logUploadTimer||(this.logUploadTimer=setInterval((function(){t.Dt()}),this.logUploadInterval)))},Le.prototype.It=function(){this.logUploadTimer&&(clearInterval(this.logUploadTimer),this.logUploadTimer=null)},Le.prototype.St=function(e,t,i){return void 0===i&&(i=!1),Ne(this,void 0,void 0,(function(){return Oe(this,(function(r){if(!this.isDestroy)if(this.logType==o.WEBSOCKET)this.At(e,t);else if(this.logType==o.HTTPS)this.qt(e,t,i);else if(this.logLevel!==c.DISABLE&&this.logLevel<=e)for(this.Rt.push(t);this.Rt.size()>this.Ct;)this.Rt.pop();return[2]}))}))},Le.prototype.Jt=function(){var e=this;this.Pt.connected()&&this.Rt.clear().forEach((function(t){e.Pt.wsSend(t)}))},Le.prototype.clearCache=function(){0!==this.Rt.size()&&this.Jt()},Le.prototype.Mt=function(e){this.Rt.size()<this.Ct&&this.Rt.push(e)},Le.prototype.Lt=function(e){this.Pt.connected()?this.Pt.wsSend(e):this.Mt(e)},Le.prototype.At=function(e,t){return Ne(this,void 0,void 0,(function(){var e;return Oe(this,(function(i){return"string"==typeof t&&4e3<t.length?console.info("log over maximum, ignore"):this.j.useStrategy&&this.env==r.BROWSER?this.Pt.addRemoteWsLog(t):this.Pt.closed()?(e=this.url,this.url="",this.setLogServer(e),this.Mt(t)):this.Pt.connecting()?this.Mt(t):this.Pt.connected()&&(this.clearCache(),this.Lt(t)),[2]}))}))},Le.prototype.qt=function(e,t,i){this.Rt.push(t),(this.Rt.size()>=this.Ct||!0===i)&&this.Dt()},Le.prototype.Et=function(e,t){var i={time:i=g(),level:e,action:(t=[t.substr(0,t.indexOf(" "))||t,t.substr(t.indexOf(" ")+1,4500)||t])[0],content:t[1],appid:this.appid,roomid:this.roomid,userid:this.userid,userName:this.userName,sessionid:this.sessionid};return JSON.stringify(i)},Le.prototype._t=function(e,t){var i,n=g();return i=this.env%2===r.BROWSER?"rtc":"ali",t=De(De({},t),{time:n,level:e,console:i,appid:this.appid,room_id:this.roomid,roomid:this.roomid,userid:this.userid,id_name:this.userid,userName:this.userName,sessionid:this.sessionid,sdk_version:this.version,test_environment:this.stateCenter.testEnvironment,version:this.version,event_id:this.appid+"_"+this.userid+"_"+t.event_time+"_"+t.seq}),JSON.stringify(t)},Le.prototype.Dt=function(){0!=this.Rt.size()&&(this.env%2===r.BROWSER?this.Wt():this.SendHttpsLogWeChatMini())},Le.prototype.Wt=function(){var e=this,t=this.Rt.buffer.join("\n"),i=this.Rt.buffer,r=new XMLHttpRequest;r.onreadystatechange=function(){if(4==r.readyState){if(200==r.status){if(0==r.responseText.length)return;try{var t=JSON.parse(r.responseText).interval;"number"==typeof t&&e.logUploadInterval!==t&&(e.timeInterval=t,e.Nt(e.url))}catch(t){e.Rt.buffer=i.concat(e.Rt.buffer),console.log("send result failed "+t)}}else e.Rt.buffer=i.concat(e.Rt.buffer),console.log("send failed "+r.status);i=null}},r.open("POST",this.url,!0),0==this.env?r.send(t):1==this.env&&(r.setRequestHeader("content-type","application/json"),r.send(JSON.stringify({user_id:this.userid,log:t}))),this.Rt.buffer=[]},Le.prototype.SendHttpsLogWeChatMini=function(){},Le.prototype.destroy=function(){this.Tt(),this.logUploadTimer&&clearTimeout(this.logUploadTimer),s.instance=void 0,this.Pt.destroy(),this.xt&&this.xt.destroy(),this.url="",this.isDestroy=!0},Le.logVersion="1.4.5",Le);function Le(e,t){var i=this;this.proxyCtrl=t,this.logLevel=c.INFO,this.logRemoteLevel=0,this.logUploadTimer=null,this.logUploadInterval=1e4,this.existUserID=!1,this.isDestroy=!1,this.Ct=8192,this.D={debug:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.debug.apply(i,e)},info:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.info.apply(i,e)},warn:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.warn.apply(i,e)},error:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.error.apply(i,e)}},this.stateCenter=s.getInstance(),this.j=new G,this.j.env=e,this.Rt=new J(this.j),this.Pt=new b(this.Rt,this.j,this.D,this.proxyCtrl),this.env==r.BROWSER&&Pe.isEnvSupport()&&(this.xt=new Pe(this.j,this.proxyCtrl))}}],r={},t.m=i,t.c=r,t.d=function(e,i,r){t.o(e,i)||Object.defineProperty(e,i,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"Bt",{value:!0})},t.t=function(e,i){if(1&i&&(e=t(e)),8&i)return e;if(4&i&&"object"==_typeof(e)&&e&&e.Bt)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&i&&"string"!=typeof e)for(var n in e)t.d(r,n,function(t){return e[t]}.bind(null,n));return r},t.n=function(e){var i=e&&e.Bt?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2);function t(e){var n;return(r[e]||(n=r[e]={i:e,l:!1,exports:{}},i[e].call(n.exports,n,n.exports,t),n.l=!0,n)).exports}var i,r}(i(9165))},9165:function(e,t,i){"use strict";var r=i(1005),n=i(7696),o=i(2190),s=i(3986),a=i(7449),c=Object.prototype.toString,u=i(3566),l=u.Z_NO_FLUSH,d=u.Z_SYNC_FLUSH,h=u.Z_FULL_FLUSH,p=u.Z_FINISH,f=u.Z_OK,m=u.Z_STREAM_END,v=u.Z_DEFAULT_COMPRESSION,g=u.Z_DEFAULT_STRATEGY,y=u.Z_DEFLATED;function b(e){this.options=n.assign({level:v,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:g},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var i=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==f)throw new Error(s[i]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var u;if(u="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,i=r.deflateSetDictionary(this.strm,u),i!==f)throw new Error(s[i]);this._dict_set=!0}}function _(e,t){var i=new b(t);if(i.push(e,!0),i.err)throw i.msg||s[i.err];return i.result}b.prototype.push=function(e,t){var i,n,s=this.strm,a=this.options.chunkSize;if(this.ended)return!1;for(n=t===~~t?t:!0===t?p:l,s.input="string"==typeof e?o.string2buf(e):"[object ArrayBuffer]"===c.call(e)?new Uint8Array(e):e,s.next_in=0,s.avail_in=s.input.length;;)if(0===s.avail_out&&(s.output=new Uint8Array(a),s.next_out=0,s.avail_out=a),(n===d||n===h)&&s.avail_out<=6)this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;else{if(i=r.deflate(s,n),i===m)return s.next_out>0&&this.onData(s.output.subarray(0,s.next_out)),i=r.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===f;if(0!==s.avail_out){if(n>0&&s.next_out>0)this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;else if(0===s.avail_in)break}else this.onData(s.output)}return!0},b.prototype.onData=function(e){this.chunks.push(e)},b.prototype.onEnd=function(e){e===f&&(this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Deflate=b,e.exports.deflate=_,e.exports.deflateRaw=function(e,t){return(t=t||{}).raw=!0,_(e,t)},e.exports.gzip=function(e,t){return(t=t||{}).gzip=!0,_(e,t)},e.exports.constants=i(3566)},7696:function(e){"use strict";var t=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};e.exports.assign=function(e){for(var i=Array.prototype.slice.call(arguments,1);i.length;){var r=i.shift();if(r){if("object"!=_typeof(r))throw new TypeError(r+"must be non-object");for(var n in r)t(r,n)&&(e[n]=r[n])}}return e},e.exports.flattenChunks=function(e){for(var t=0,i=0,r=e.length;i<r;i++)t+=e[i].length;for(var n=new Uint8Array(t),o=0,s=0,a=e.length;o<a;o++){var c=e[o];n.set(c,s),s+=c.length}return n}},2190:function(e){"use strict";var t=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){t=!1}for(var i=new Uint8Array(256),r=0;r<256;r++)i[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;i[254]=i[254]=1,e.exports.string2buf=function(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,i,r,n,o,s=e.length,a=0;for(n=0;n<s;n++)i=e.charCodeAt(n),55296==(64512&i)&&n+1<s&&(r=e.charCodeAt(n+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),n++)),a+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(a),o=0,n=0;o<a;n++)i=e.charCodeAt(n),55296==(64512&i)&&n+1<s&&(r=e.charCodeAt(n+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),n++)),i<128?t[o++]=i:i<2048?(t[o++]=192|i>>>6,t[o++]=128|63&i):i<65536?(t[o++]=224|i>>>12,t[o++]=128|i>>>6&63,t[o++]=128|63&i):(t[o++]=240|i>>>18,t[o++]=128|i>>>12&63,t[o++]=128|i>>>6&63,t[o++]=128|63&i);return t},e.exports.buf2string=function(e,r){var n,o,s=r||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,r));var a=new Array(2*s);for(o=0,n=0;n<s;){var c=e[n++];if(c<128)a[o++]=c;else{var u=i[c];if(u>4)a[o++]=65533,n+=u-1;else{for(c&=2===u?31:3===u?15:7;u>1&&n<s;)c=c<<6|63&e[n++],u--;u>1?a[o++]=65533:c<65536?a[o++]=c:(c-=65536,a[o++]=55296|c>>10&1023,a[o++]=56320|1023&c)}}}return function(e,i){if(i<65534&&e.subarray&&t)return String.fromCharCode.apply(null,e.length===i?e:e.subarray(0,i));for(var r="",n=0;n<i;n++)r+=String.fromCharCode(e[n]);return r}(a,o)},e.exports.utf8border=function(e,t){(t=t||e.length)>e.length&&(t=e.length);for(var r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+i[e[r]]>t?r:t}},2565:function(e){"use strict";e.exports=function(e,t,i,r){for(var n=65535&e,o=e>>>16&65535,s=0;0!==i;){s=i>2e3?2e3:i,i-=s;do{n=n+t[r++]|0,o=o+n|0}while(--s);n%=65521,o%=65521}return n|o<<16}},3566:function(e){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},6657:function(e){"use strict";var t=new Uint32Array(function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}());e.exports=function(e,i,r,n){var o=t,s=n+r;e^=-1;for(var a=n;a<s;a++)e=e>>>8^o[255&(e^i[a])];return~e}},1005:function(e,t,i){"use strict";var r=i(7020),n=r._tr_init,o=r._tr_stored_block,s=r._tr_flush_block,a=r._tr_tally,c=r._tr_align,u=i(2565),l=i(6657),d=i(3986),h=i(3566),p=h.Z_NO_FLUSH,f=h.Z_PARTIAL_FLUSH,m=h.Z_FULL_FLUSH,v=h.Z_FINISH,g=h.Z_BLOCK,y=h.Z_OK,b=h.Z_STREAM_END,_=h.Z_STREAM_ERROR,S=h.Z_DATA_ERROR,T=h.Z_BUF_ERROR,E=h.Z_DEFAULT_COMPRESSION,C=h.Z_FILTERED,w=h.Z_HUFFMAN_ONLY,I=h.Z_RLE,R=h.Z_FIXED,k=h.Z_DEFAULT_STRATEGY,P=h.Z_UNKNOWN,A=h.Z_DEFLATED,D=258,N=262,O=42,M=113,L=666,x=function(e,t){return e.msg=d[t],t},U=function(e){return 2*e-(e>4?9:0)},B=function(e){for(var t=e.length;--t>=0;)e[t]=0},z=function(e){var t,i,r,n=e.w_size;t=e.hash_size,r=t;do{i=e.head[--r],e.head[r]=i>=n?i-n:0}while(--t);t=n,r=t;do{i=e.prev[--r],e.prev[r]=i>=n?i-n:0}while(--t)},q=function(e,t,i){return(t<<e.hash_shift^i)&e.hash_mask},X=function(e){var t=e.state,i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+i),e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))},H=function(e,t){s(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,X(e.strm)},F=function(e,t){e.pending_buf[e.pending++]=t},V=function(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},G=function(e,t,i,r){var n=e.avail_in;return n>r&&(n=r),0===n?0:(e.avail_in-=n,t.set(e.input.subarray(e.next_in,e.next_in+n),i),1===e.state.wrap?e.adler=u(e.adler,t,n,i):2===e.state.wrap&&(e.adler=l(e.adler,t,n,i)),e.next_in+=n,e.total_in+=n,n)},j=function(e,t){var i,r,n=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,c=e.strstart>e.w_size-N?e.strstart-(e.w_size-N):0,u=e.window,l=e.w_mask,d=e.prev,h=e.strstart+D,p=u[o+s-1],f=u[o+s];e.prev_length>=e.good_match&&(n>>=2),a>e.lookahead&&(a=e.lookahead);do{if(i=t,u[i+s]===f&&u[i+s-1]===p&&u[i]===u[o]&&u[++i]===u[o+1]){o+=2,i++;do{}while(u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&o<h);if(r=D-(h-o),o=h-D,r>s){if(e.match_start=t,s=r,r>=a)break;p=u[o+s-1],f=u[o+s]}}}while((t=d[t&l])>c&&0!=--n);return s<=e.lookahead?s:e.lookahead},Q=function(e){var t,i,r,n=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-N)&&(e.window.set(e.window.subarray(n,n+n-i),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,e.insert>e.strstart&&(e.insert=e.strstart),z(e),i+=n),0===e.strm.avail_in)break;if(t=G(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=t,e.lookahead+e.insert>=3)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=q(e,e.ins_h,e.window[r+1]);e.insert&&(e.ins_h=q(e,e.ins_h,e.window[r+3-1]),e.prev[r&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=r,r++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<N&&0!==e.strm.avail_in)},W=function(e,t){var i,r,n,s=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,c=e.strm.avail_in;do{if(i=65535,n=e.bi_valid+42>>3,e.strm.avail_out<n)break;if(n=e.strm.avail_out-n,r=e.strstart-e.block_start,i>r+e.strm.avail_in&&(i=r+e.strm.avail_in),i>n&&(i=n),i<s&&(0===i&&t!==v||t===p||i!==r+e.strm.avail_in))break;a=t===v&&i===r+e.strm.avail_in?1:0,o(e,0,0,a),e.pending_buf[e.pending-4]=i,e.pending_buf[e.pending-3]=i>>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,X(e.strm),r&&(r>i&&(r=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,i-=r),i&&(G(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(0===a);return c-=e.strm.avail_in,c&&(c>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=c&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-c,e.strm.next_in),e.strstart),e.strstart+=c,e.insert+=c>e.w_size-e.insert?e.w_size-e.insert:c),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?4:t!==p&&t!==v&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(n=e.window_size-e.strstart,e.strm.avail_in>n&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,n+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),n>e.strm.avail_in&&(n=e.strm.avail_in),n&&(G(e.strm,e.window,e.strstart,n),e.strstart+=n,e.insert+=n>e.w_size-e.insert?e.w_size-e.insert:n),e.high_water<e.strstart&&(e.high_water=e.strstart),n=e.bi_valid+42>>3,n=e.pending_buf_size-n>65535?65535:e.pending_buf_size-n,s=n>e.w_size?e.w_size:n,r=e.strstart-e.block_start,(r>=s||(r||t===v)&&t!==p&&0===e.strm.avail_in&&r<=n)&&(i=r>n?n:r,a=t===v&&0===e.strm.avail_in&&i===r?1:0,o(e,e.block_start,i,a),e.block_start+=i,X(e.strm)),a?3:1)},Z=function(e,t){for(var i,r;;){if(e.lookahead<N){if(Q(e),e.lookahead<N&&t===p)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=q(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-N&&(e.match_length=j(e,i)),e.match_length>=3)if(r=a(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=q(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=q(e,e.ins_h,e.window[e.strstart+1]);else r=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(H(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===v?(H(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(H(e,!1),0===e.strm.avail_out)?1:2},K=function(e,t){for(var i,r,n;;){if(e.lookahead<N){if(Q(e),e.lookahead<N&&t===p)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=q(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-N&&(e.match_length=j(e,i),e.match_length<=5&&(e.strategy===C||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,r=a(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=q(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(H(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=a(e,0,e.window[e.strstart-1]),r&&H(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=a(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===v?(H(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(H(e,!1),0===e.strm.avail_out)?1:2};function J(e,t,i,r,n){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=r,this.func=n}var Y=[new J(0,0,0,0,W),new J(4,4,8,4,Z),new J(4,5,16,8,Z),new J(4,6,32,32,Z),new J(4,4,16,16,K),new J(8,16,32,32,K),new J(8,16,128,128,K),new J(8,32,128,256,K),new J(32,128,258,1024,K),new J(32,258,258,4096,K)];function $(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=A,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),B(this.dyn_ltree),B(this.dyn_dtree),B(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),B(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),B(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var ee=function(e){if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.status!==O&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==M&&t.status!==L?1:0},te=function(e){if(ee(e))return x(e,_);e.total_in=e.total_out=0,e.data_type=P;var t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?O:M,e.adler=2===t.wrap?0:1,t.last_flush=-2,n(t),y},ie=function(e){var t,i=te(e);return i===y&&((t=e.state).window_size=2*t.w_size,B(t.head),t.max_lazy_match=Y[t.level].max_lazy,t.good_match=Y[t.level].good_length,t.nice_match=Y[t.level].nice_length,t.max_chain_length=Y[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),i},re=function(e,t,i,r,n,o){if(!e)return _;var s=1;if(t===E&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),n<1||n>9||i!==A||r<8||r>15||t<0||t>9||o<0||o>R||8===r&&1!==s)return x(e,_);8===r&&(r=9);var a=new $;return e.state=a,a.strm=e,a.status=O,a.wrap=s,a.gzhead=null,a.w_bits=r,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=n+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<n+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=t,a.strategy=o,a.method=i,ie(e)};e.exports.deflateInit=function(e,t){return re(e,t,A,15,8,k)},e.exports.deflateInit2=re,e.exports.deflateReset=ie,e.exports.deflateResetKeep=te,e.exports.deflateSetHeader=function(e,t){return ee(e)||2!==e.state.wrap?_:(e.state.gzhead=t,y)},e.exports.deflate=function(e,t){if(ee(e)||t>g||t<0)return e?x(e,_):_;var i=e.state;if(!e.output||0!==e.avail_in&&!e.input||i.status===L&&t!==v)return x(e,0===e.avail_out?T:_);var r=i.last_flush;if(i.last_flush=t,0!==i.pending){if(X(e),0===e.avail_out)return i.last_flush=-1,y}else if(0===e.avail_in&&U(t)<=U(r)&&t!==v)return x(e,T);if(i.status===L&&0!==e.avail_in)return x(e,T);if(i.status===O&&0===i.wrap&&(i.status=M),i.status===O){var n,s=A+(i.w_bits-8<<4)<<8;if(n=i.strategy>=w||i.level<2?0:i.level<6?1:6===i.level?2:3,s|=n<<6,0!==i.strstart&&(s|=32),s+=31-s%31,V(i,s),0!==i.strstart&&(V(i,e.adler>>>16),V(i,65535&e.adler)),e.adler=1,i.status=M,X(e),0!==i.pending)return i.last_flush=-1,y}if(57===i.status)if(e.adler=0,F(i,31),F(i,139),F(i,8),i.gzhead)F(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),F(i,255&i.gzhead.time),F(i,i.gzhead.time>>8&255),F(i,i.gzhead.time>>16&255),F(i,i.gzhead.time>>24&255),F(i,9===i.level?2:i.strategy>=w||i.level<2?4:0),F(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(F(i,255&i.gzhead.extra.length),F(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=l(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69;else if(F(i,0),F(i,0),F(i,0),F(i,0),F(i,0),F(i,9===i.level?2:i.strategy>=w||i.level<2?4:0),F(i,3),i.status=M,X(e),0!==i.pending)return i.last_flush=-1,y;if(69===i.status){if(i.gzhead.extra){for(var u=i.pending,d=(65535&i.gzhead.extra.length)-i.gzindex;i.pending+d>i.pending_buf_size;){var h=i.pending_buf_size-i.pending;if(i.pending_buf.set(i.gzhead.extra.subarray(i.gzindex,i.gzindex+h),i.pending),i.pending=i.pending_buf_size,i.gzhead.hcrc&&i.pending>u&&(e.adler=l(e.adler,i.pending_buf,i.pending-u,u)),i.gzindex+=h,X(e),0!==i.pending)return i.last_flush=-1,y;u=0,d-=h}var S=new Uint8Array(i.gzhead.extra);i.pending_buf.set(S.subarray(i.gzindex,i.gzindex+d),i.pending),i.pending+=d,i.gzhead.hcrc&&i.pending>u&&(e.adler=l(e.adler,i.pending_buf,i.pending-u,u)),i.gzindex=0}i.status=73}if(73===i.status){if(i.gzhead.name){var E,C=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>C&&(e.adler=l(e.adler,i.pending_buf,i.pending-C,C)),X(e),0!==i.pending)return i.last_flush=-1,y;C=0}E=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,F(i,E)}while(0!==E);i.gzhead.hcrc&&i.pending>C&&(e.adler=l(e.adler,i.pending_buf,i.pending-C,C)),i.gzindex=0}i.status=91}if(91===i.status){if(i.gzhead.comment){var R,k=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>k&&(e.adler=l(e.adler,i.pending_buf,i.pending-k,k)),X(e),0!==i.pending)return i.last_flush=-1,y;k=0}R=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,F(i,R)}while(0!==R);i.gzhead.hcrc&&i.pending>k&&(e.adler=l(e.adler,i.pending_buf,i.pending-k,k))}i.status=103}if(103===i.status){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size&&(X(e),0!==i.pending))return i.last_flush=-1,y;F(i,255&e.adler),F(i,e.adler>>8&255),e.adler=0}if(i.status=M,X(e),0!==i.pending)return i.last_flush=-1,y}if(0!==e.avail_in||0!==i.lookahead||t!==p&&i.status!==L){var P=0===i.level?W(i,t):i.strategy===w?function(e,t){for(var i;;){if(0===e.lookahead&&(Q(e),0===e.lookahead)){if(t===p)return 1;break}if(e.match_length=0,i=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(H(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===v?(H(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(H(e,!1),0===e.strm.avail_out)?1:2}(i,t):i.strategy===I?function(e,t){for(var i,r,n,o,s=e.window;;){if(e.lookahead<=D){if(Q(e),e.lookahead<=D&&t===p)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=e.strstart-1,r=s[n],r===s[++n]&&r===s[++n]&&r===s[++n])){o=e.strstart+D;do{}while(r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&n<o);e.match_length=D-(o-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=a(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(H(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===v?(H(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(H(e,!1),0===e.strm.avail_out)?1:2}(i,t):Y[i.level].func(i,t);if(3!==P&&4!==P||(i.status=L),1===P||3===P)return 0===e.avail_out&&(i.last_flush=-1),y;if(2===P&&(t===f?c(i):t!==g&&(o(i,0,0,!1),t===m&&(B(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),X(e),0===e.avail_out))return i.last_flush=-1,y}return t!==v?y:i.wrap<=0?b:(2===i.wrap?(F(i,255&e.adler),F(i,e.adler>>8&255),F(i,e.adler>>16&255),F(i,e.adler>>24&255),F(i,255&e.total_in),F(i,e.total_in>>8&255),F(i,e.total_in>>16&255),F(i,e.total_in>>24&255)):(V(i,e.adler>>>16),V(i,65535&e.adler)),X(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?y:b)},e.exports.deflateEnd=function(e){if(ee(e))return _;var t=e.state.status;return e.state=null,t===M?x(e,S):y},e.exports.deflateSetDictionary=function(e,t){var i=t.length;if(ee(e))return _;var r=e.state,n=r.wrap;if(2===n||1===n&&r.status!==O||r.lookahead)return _;if(1===n&&(e.adler=u(e.adler,t,i,0)),r.wrap=0,i>=r.w_size){0===n&&(B(r.head),r.strstart=0,r.block_start=0,r.insert=0);var o=new Uint8Array(r.w_size);o.set(t.subarray(i-r.w_size,i),0),t=o,i=r.w_size}var s=e.avail_in,a=e.next_in,c=e.input;for(e.avail_in=i,e.next_in=0,e.input=t,Q(r);r.lookahead>=3;){var l=r.strstart,d=r.lookahead-2;do{r.ins_h=q(r,r.ins_h,r.window[l+3-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++}while(--d);r.strstart=l,r.lookahead=2,Q(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=c,e.avail_in=s,r.wrap=n,y},e.exports.deflateInfo="pako deflate (from Nodeca project)"},3986:function(e){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},7020:function(e){"use strict";function t(e){for(var t=e.length;--t>=0;)e[t]=0}var i=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),r=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),n=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),o=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);t(s);var a=new Array(60);t(a);var c=new Array(512);t(c);var u=new Array(256);t(u);var l=new Array(29);t(l);var d,h,p,f=new Array(30);function m(e,t,i,r,n){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=r,this.max_length=n,this.has_stree=e&&e.length}function v(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}t(f);var g=function(e){return e<256?c[e]:c[256+(e>>>7)]},y=function(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},b=function(e,t,i){e.bi_valid>16-i?(e.bi_buf|=t<<e.bi_valid&65535,y(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)},_=function(e,t,i){b(e,i[2*t],i[2*t+1])},S=function(e,t){var i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1},T=function(e,t,i){var r,n,o=new Array(16),s=0;for(r=1;r<=15;r++)s=s+i[r-1]<<1,o[r]=s;for(n=0;n<=t;n++){var a=e[2*n+1];0!==a&&(e[2*n]=S(o[a]++,a))}},E=function(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},C=function(e){e.bi_valid>8?y(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},w=function(e,t,i,r){var n=2*t,o=2*i;return e[n]<e[o]||e[n]===e[o]&&r[t]<=r[i]},I=function(e,t,i){for(var r=e.heap[i],n=i<<1;n<=e.heap_len&&(n<e.heap_len&&w(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!w(t,r,e.heap[n],e.depth));)e.heap[i]=e.heap[n],i=n,n<<=1;e.heap[i]=r},R=function(e,t,n){var o,s,a,c,d=0;if(0!==e.sym_next)do{o=255&e.pending_buf[e.sym_buf+d++],o+=(255&e.pending_buf[e.sym_buf+d++])<<8,s=e.pending_buf[e.sym_buf+d++],0===o?_(e,s,t):(a=u[s],_(e,a+256+1,t),c=i[a],0!==c&&(s-=l[a],b(e,s,c)),o--,a=g(o),_(e,a,n),c=r[a],0!==c&&(o-=f[a],b(e,o,c)))}while(d<e.sym_next);_(e,256,t)},k=function(e,t){var i,r,n,o=t.dyn_tree,s=t.stat_desc.static_tree,a=t.stat_desc.has_stree,c=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=573,i=0;i<c;i++)0!==o[2*i]?(e.heap[++e.heap_len]=u=i,e.depth[i]=0):o[2*i+1]=0;for(;e.heap_len<2;)n=e.heap[++e.heap_len]=u<2?++u:0,o[2*n]=1,e.depth[n]=0,e.opt_len--,a&&(e.static_len-=s[2*n+1]);for(t.max_code=u,i=e.heap_len>>1;i>=1;i--)I(e,o,i);n=c;do{i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],I(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=r,o[2*n]=o[2*i]+o[2*r],e.depth[n]=(e.depth[i]>=e.depth[r]?e.depth[i]:e.depth[r])+1,o[2*i+1]=o[2*r+1]=n,e.heap[1]=n++,I(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var i,r,n,o,s,a,c=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,d=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,f=t.stat_desc.max_length,m=0;for(o=0;o<=15;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,i=e.heap_max+1;i<573;i++)r=e.heap[i],o=c[2*c[2*r+1]+1]+1,o>f&&(o=f,m++),c[2*r+1]=o,r>u||(e.bl_count[o]++,s=0,r>=p&&(s=h[r-p]),a=c[2*r],e.opt_len+=a*(o+s),d&&(e.static_len+=a*(l[2*r+1]+s)));if(0!==m){do{for(o=f-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[f]--,m-=2}while(m>0);for(o=f;0!==o;o--)for(r=e.bl_count[o];0!==r;)n=e.heap[--i],n>u||(c[2*n+1]!==o&&(e.opt_len+=(o-c[2*n+1])*c[2*n],c[2*n+1]=o),r--)}}(e,t),T(o,u,e.bl_count)},P=function(e,t,i){var r,n,o=-1,s=t[1],a=0,c=7,u=4;for(0===s&&(c=138,u=3),t[2*(i+1)+1]=65535,r=0;r<=i;r++)n=s,s=t[2*(r+1)+1],++a<c&&n===s||(a<u?e.bl_tree[2*n]+=a:0!==n?(n!==o&&e.bl_tree[2*n]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,o=n,0===s?(c=138,u=3):n===s?(c=6,u=3):(c=7,u=4))},A=function(e,t,i){var r,n,o=-1,s=t[1],a=0,c=7,u=4;for(0===s&&(c=138,u=3),r=0;r<=i;r++)if(n=s,s=t[2*(r+1)+1],!(++a<c&&n===s)){if(a<u)do{_(e,n,e.bl_tree)}while(0!=--a);else 0!==n?(n!==o&&(_(e,n,e.bl_tree),a--),_(e,16,e.bl_tree),b(e,a-3,2)):a<=10?(_(e,17,e.bl_tree),b(e,a-3,3)):(_(e,18,e.bl_tree),b(e,a-11,7));a=0,o=n,0===s?(c=138,u=3):n===s?(c=6,u=3):(c=7,u=4)}},D=!1,N=function(e,t,i,r){b(e,0+(r?1:0),3),C(e),y(e,i),y(e,~i),i&&e.pending_buf.set(e.window.subarray(t,t+i),e.pending),e.pending+=i};e.exports._tr_init=function(e){D||(function(){var e,t,o,v,g,y=new Array(16);for(o=0,v=0;v<28;v++)for(l[v]=o,e=0;e<1<<i[v];e++)u[o++]=v;for(u[o-1]=v,g=0,v=0;v<16;v++)for(f[v]=g,e=0;e<1<<r[v];e++)c[g++]=v;for(g>>=7;v<30;v++)for(f[v]=g<<7,e=0;e<1<<r[v]-7;e++)c[256+g++]=v;for(t=0;t<=15;t++)y[t]=0;for(e=0;e<=143;)s[2*e+1]=8,e++,y[8]++;for(;e<=255;)s[2*e+1]=9,e++,y[9]++;for(;e<=279;)s[2*e+1]=7,e++,y[7]++;for(;e<=287;)s[2*e+1]=8,e++,y[8]++;for(T(s,287,y),e=0;e<30;e++)a[2*e+1]=5,a[2*e]=S(e,5);d=new m(s,i,257,286,15),h=new m(a,r,0,30,15),p=new m(new Array(0),n,0,19,7)}(),D=!0),e.l_desc=new v(e.dyn_ltree,d),e.d_desc=new v(e.dyn_dtree,h),e.bl_desc=new v(e.bl_tree,p),e.bi_buf=0,e.bi_valid=0,E(e)},e.exports._tr_stored_block=N,e.exports._tr_flush_block=function(e,t,i,r){var n,c,u=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),k(e,e.l_desc),k(e,e.d_desc),u=function(e){var t;for(P(e,e.dyn_ltree,e.l_desc.max_code),P(e,e.dyn_dtree,e.d_desc.max_code),k(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*o[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),n=e.opt_len+3+7>>>3,c=e.static_len+3+7>>>3,c<=n&&(n=c)):n=c=i+5,i+4<=n&&-1!==t?N(e,t,i,r):4===e.strategy||c===n?(b(e,2+(r?1:0),3),R(e,s,a)):(b(e,4+(r?1:0),3),function(e,t,i,r){var n;for(b(e,t-257,5),b(e,i-1,5),b(e,r-4,4),n=0;n<r;n++)b(e,e.bl_tree[2*o[n]+1],3);A(e,e.dyn_ltree,t-1),A(e,e.dyn_dtree,i-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),R(e,e.dyn_ltree,e.dyn_dtree)),E(e),r&&C(e)},e.exports._tr_tally=function(e,t,i){return e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=i,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(u[i]+256+1)]++,e.dyn_dtree[2*g(t)]++),e.sym_next===e.sym_end},e.exports._tr_align=function(e){b(e,2,3),_(e,256,s),function(e){16===e.bi_valid?(y(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},7449:function(e){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},4537:function(e){"use strict";e.exports=function(e,t){for(var i=new Array(arguments.length-1),r=0,n=2,o=!0;n<arguments.length;)i[r++]=arguments[n++];return new Promise((function(n,s){i[r]=function(e){if(o)if(o=!1,e)s(e);else{for(var t=new Array(arguments.length-1),i=0;i<t.length;)t[i++]=arguments[i];n.apply(null,t)}};try{e.apply(t||null,i)}catch(e){o&&(o=!1,s(e))}}))}},7419:function(e,t){"use strict";var i=t;i.length=function(e){var t=e.length;if(!t)return 0;for(var i=0;--t%4>1&&"="===e.charAt(t);)++i;return Math.ceil(3*e.length)/4-i};for(var r=new Array(64),n=new Array(123),o=0;o<64;)n[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;i.encode=function(e,t,i){for(var n,o=null,s=[],a=0,c=0;t<i;){var u=e[t++];switch(c){case 0:s[a++]=r[u>>2],n=(3&u)<<4,c=1;break;case 1:s[a++]=r[n|u>>4],n=(15&u)<<2,c=2;break;case 2:s[a++]=r[n|u>>6],s[a++]=r[63&u],c=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0)}return c&&(s[a++]=r[n],s[a++]=61,1===c&&(s[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,s.slice(0,a))),o.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var s="invalid encoding";i.decode=function(e,t,i){for(var r,o=i,a=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&a>1)break;if(void 0===(u=n[u]))throw Error(s);switch(a){case 0:r=u,a=1;break;case 1:t[i++]=r<<2|(48&u)>>4,r=u,a=2;break;case 2:t[i++]=(15&r)<<4|(60&u)>>2,r=u,a=3;break;case 3:t[i++]=(3&r)<<6|u,a=0}}if(1===a)throw Error(s);return i-o},i.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},9211:function(e){"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,i){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:i||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var i=this._listeners[e],r=0;r<i.length;)i[r].fn===t?i.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var i=[],r=1;r<arguments.length;)i.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,i)}return this}},945:function(e){"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),i=new Uint8Array(t.buffer),r=128===i[3];function n(e,r,n){t[0]=e,r[n]=i[0],r[n+1]=i[1],r[n+2]=i[2],r[n+3]=i[3]}function o(e,r,n){t[0]=e,r[n]=i[3],r[n+1]=i[2],r[n+2]=i[1],r[n+3]=i[0]}function s(e,r){return i[0]=e[r],i[1]=e[r+1],i[2]=e[r+2],i[3]=e[r+3],t[0]}function a(e,r){return i[3]=e[r],i[2]=e[r+1],i[1]=e[r+2],i[0]=e[r+3],t[0]}e.writeFloatLE=r?n:o,e.writeFloatBE=r?o:n,e.readFloatLE=r?s:a,e.readFloatBE=r?a:s}():function(){function t(e,t,i,r){var n=t<0?1:0;if(n&&(t=-t),0===t)e(1/t>0?0:2147483648,i,r);else if(isNaN(t))e(2143289344,i,r);else if(t>34028234663852886e22)e((n<<31|2139095040)>>>0,i,r);else if(t<11754943508222875e-54)e((n<<31|Math.round(t/1401298464324817e-60))>>>0,i,r);else{var o=Math.floor(Math.log(t)/Math.LN2);e((n<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,i,r)}}function s(e,t,i){var r=e(t,i),n=2*(r>>31)+1,o=r>>>23&255,s=8388607&r;return 255===o?s?NaN:n*(1/0):0===o?1401298464324817e-60*n*s:n*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=t.bind(null,i),e.writeFloatBE=t.bind(null,r),e.readFloatLE=s.bind(null,n),e.readFloatBE=s.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),i=new Uint8Array(t.buffer),r=128===i[7];function n(e,r,n){t[0]=e,r[n]=i[0],r[n+1]=i[1],r[n+2]=i[2],r[n+3]=i[3],r[n+4]=i[4],r[n+5]=i[5],r[n+6]=i[6],r[n+7]=i[7]}function o(e,r,n){t[0]=e,r[n]=i[7],r[n+1]=i[6],r[n+2]=i[5],r[n+3]=i[4],r[n+4]=i[3],r[n+5]=i[2],r[n+6]=i[1],r[n+7]=i[0]}function s(e,r){return i[0]=e[r],i[1]=e[r+1],i[2]=e[r+2],i[3]=e[r+3],i[4]=e[r+4],i[5]=e[r+5],i[6]=e[r+6],i[7]=e[r+7],t[0]}function a(e,r){return i[7]=e[r],i[6]=e[r+1],i[5]=e[r+2],i[4]=e[r+3],i[3]=e[r+4],i[2]=e[r+5],i[1]=e[r+6],i[0]=e[r+7],t[0]}e.writeDoubleLE=r?n:o,e.writeDoubleBE=r?o:n,e.readDoubleLE=r?s:a,e.readDoubleBE=r?a:s}():function(){function t(e,t,i,r,n,o){var s=r<0?1:0;if(s&&(r=-r),0===r)e(0,n,o+t),e(1/r>0?0:2147483648,n,o+i);else if(isNaN(r))e(0,n,o+t),e(2146959360,n,o+i);else if(r>17976931348623157e292)e(0,n,o+t),e((s<<31|2146435072)>>>0,n,o+i);else{var a;if(r<22250738585072014e-324)e((a=r/5e-324)>>>0,n,o+t),e((s<<31|a/4294967296)>>>0,n,o+i);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=r*Math.pow(2,-c))>>>0,n,o+t),e((s<<31|c+1023<<20|1048576*a&1048575)>>>0,n,o+i)}}}function s(e,t,i,r,n){var o=e(r,n+t),s=e(r,n+i),a=2*(s>>31)+1,c=s>>>20&2047,u=4294967296*(1048575&s)+o;return 2047===c?u?NaN:a*(1/0):0===c?5e-324*a*u:a*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,i,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=s.bind(null,n,0,4),e.readDoubleBE=s.bind(null,o,4,0)}(),e}function i(e,t,i){t[i]=255&e,t[i+1]=e>>>8&255,t[i+2]=e>>>16&255,t[i+3]=e>>>24}function r(e,t,i){t[i]=e>>>24,t[i+1]=e>>>16&255,t[i+2]=e>>>8&255,t[i+3]=255&e}function n(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:function _(module){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}module.exports=inquire},6662:function(e){"use strict";e.exports=function(e,t,i){var r=i||8192,n=r>>>1,o=null,s=r;return function(i){if(i<1||i>n)return e(i);s+i>r&&(o=e(r),s=0);var a=t.call(o,s,s+=i);return 7&s&&(s=1+(7|s)),a}}},4997:function(e,t){"use strict";var i=t;i.length=function(e){for(var t=0,i=0,r=0;r<e.length;++r)(i=e.charCodeAt(r))<128?t+=1:i<2048?t+=2:55296==(64512&i)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},i.read=function(e,t,i){if(i-t<1)return"";for(var r,n=null,o=[],s=0;t<i;)(r=e[t++])<128?o[s++]=r:r>191&&r<224?o[s++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(r>>10),o[s++]=56320+(1023&r)):o[s++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),s=0);return n?(s&&n.push(String.fromCharCode.apply(String,o.slice(0,s))),n.join("")):String.fromCharCode.apply(String,o.slice(0,s))},i.write=function(e,t,i){for(var r,n,o=i,s=0;s<e.length;++s)(r=e.charCodeAt(s))<128?t[i++]=r:r<2048?(t[i++]=r>>6|192,t[i++]=63&r|128):55296==(64512&r)&&56320==(64512&(n=e.charCodeAt(s+1)))?(++s,t[i++]=(r=65536+((1023&r)<<10)+(1023&n))>>18|240,t[i++]=r>>12&63|128,t[i++]=r>>6&63|128,t[i++]=63&r|128):(t[i++]=r>>12|224,t[i++]=r>>6&63|128,t[i++]=63&r|128);return i-o}},9483:function(e,t,i){ |
|
/*! |
|
localForage -- Offline Storage, Improved |
|
Version 1.10.0 |
|
https://localforage.github.io/localForage |
|
(c) 2013-2017 Mozilla, Apache License 2.0 |
|
*/ |
|
e.exports=function e(t,i,r){function n(s,a){if(!i[s]){if(!t[s]){if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[s]={exports:{}};t[s][0].call(u.exports,(function(e){var i=t[s][1][e];return n(i||e)}),u,u.exports,e,t,i,r)}return i[s].exports}for(var o=void 0,s=0;s<r.length;s++)n(r[s]);return n}({1:[function(e,t,r){(function(e){"use strict";var i,r,n=e.MutationObserver||e.WebKitMutationObserver;if(n){var o=0,s=new n(l),a=e.document.createTextNode("");s.observe(a,{characterData:!0}),i=function(){a.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)i="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){l(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(l,0)};else{var c=new e.MessageChannel;c.port1.onmessage=l,i=function(){c.port2.postMessage(0)}}var u=[];function l(){var e,t;r=!0;for(var i=u.length;i;){for(t=u,u=[],e=-1;++e<i;)t[e]();i=u.length}r=!1}t.exports=function(e){1!==u.push(e)||r||i()}}).call(this,void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,i){"use strict";var r=e(1);function n(){}var o={},s=["REJECTED"],a=["FULFILLED"],c=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,e!==n&&p(this,e)}function l(e,t,i){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof i&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}function d(e,t,i){r((function(){var r;try{r=t(i)}catch(t){return o.reject(e,t)}r===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,r)}))}function h(e){var t=e&&e.then;if(e&&("object"==_typeof(e)||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function p(e,t){var i=!1;function r(t){i||(i=!0,o.reject(e,t))}function n(t){i||(i=!0,o.resolve(e,t))}var s=f((function(){t(n,r)}));"error"===s.status&&r(s.value)}function f(e,t){var i={};try{i.value=e(t),i.status="success"}catch(e){i.status="error",i.value=e}return i}t.exports=u,u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===s)return this;var i=new this.constructor(n);return this.state!==c?d(i,this.state===a?e:t,this.outcome):this.queue.push(new l(i,e,t)),i},l.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},l.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},l.prototype.callRejected=function(e){o.reject(this.promise,e)},l.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},o.resolve=function(e,t){var i=f(h,t);if("error"===i.status)return o.reject(e,i.value);var r=i.value;if(r)p(e,r);else{e.state=a,e.outcome=t;for(var n=-1,s=e.queue.length;++n<s;)e.queue[n].callFulfilled(t)}return e},o.reject=function(e,t){e.state=s,e.outcome=t;for(var i=-1,r=e.queue.length;++i<r;)e.queue[i].callRejected(t);return e},u.resolve=function(e){return e instanceof this?e:o.resolve(new this(n),e)},u.reject=function(e){var t=new this(n);return o.reject(t,e)},u.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var i=e.length,r=!1;if(!i)return this.resolve([]);for(var s=new Array(i),a=0,c=-1,u=new this(n);++c<i;)l(e[c],c);return u;function l(e,n){t.resolve(e).then((function(e){s[n]=e,++a!==i||r||(r=!0,o.resolve(u,s))}),(function(e){r||(r=!0,o.reject(u,e))}))}},u.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var i=e.length,r=!1;if(!i)return this.resolve([]);for(var s=-1,a=new this(n);++s<i;)c(e[s]);return a;function c(e){t.resolve(e).then((function(e){r||(r=!0,o.resolve(a,e))}),(function(e){r||(r=!0,o.reject(a,e))}))}}},{1:1}],3:[function(e,t,r){(function(t){"use strict";"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,i){"use strict";var r="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return _typeof(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof(e)};var n=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function o(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(n){if("TypeError"!==n.name)throw n;for(var i=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)i.append(e[r]);return i.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var s=Promise;function a(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function c(e,t,i){"function"==typeof t&&e.then(t),"function"==typeof i&&e.catch(i)}function u(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function l(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var d="local-forage-detect-blob-support",h=void 0,p={},f=Object.prototype.toString,m="readonly",v="readwrite";function g(e){for(var t=e.length,i=new ArrayBuffer(t),r=new Uint8Array(i),n=0;n<t;n++)r[n]=e.charCodeAt(n);return i}function y(e){return"boolean"==typeof h?s.resolve(h):function(e){return new s((function(t){var i=e.transaction(d,v),r=o([""]);i.objectStore(d).put(r,"key"),i.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},i.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),i=navigator.userAgent.match(/Edge\//);t(i||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return h=e}))}function b(e){var t=p[e.name],i={};i.promise=new s((function(e,t){i.resolve=e,i.reject=t})),t.deferredOperations.push(i),t.dbReady=t.dbReady?t.dbReady.then((function(){return i.promise})):i.promise}function _(e){var t=p[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function S(e,t){var i=p[e.name].deferredOperations.pop();if(i)return i.reject(t),i.promise}function T(e,t){return new s((function(i,r){if(p[e.name]=p[e.name]||A(),e.db){if(!t)return i(e.db);b(e),e.db.close()}var o=[e.name];t&&o.push(e.version);var s=n.open.apply(n,o);t&&(s.onupgradeneeded=function(t){var i=s.result;try{i.createObjectStore(e.storeName),t.oldVersion<=1&&i.createObjectStore(d)}catch(i){if("ConstraintError"!==i.name)throw i;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),s.onerror=function(e){e.preventDefault(),r(s.error)},s.onsuccess=function(){var t=s.result;t.onversionchange=function(e){e.target.close()},i(t),_(e)}}))}function E(e){return T(e,!1)}function C(e){return T(e,!0)}function w(e,t){if(!e.db)return!0;var i=!e.db.objectStoreNames.contains(e.storeName),r=e.version>e.db.version;if(e.version<e.db.version&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),r||i){if(i){var n=e.db.version+1;n>e.version&&(e.version=n)}return!0}return!1}function I(e){return o([g(atob(e.data))],{type:e.type})}function R(e){return e&&e.__local_forage_encoded_blob}function k(e){var t=this,i=t._initReady().then((function(){var e=p[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return c(i,e,e),i}function P(e,t,i,r){void 0===r&&(r=1);try{var n=e.db.transaction(e.storeName,t);i(null,n)}catch(n){if(r>0&&(!e.db||"InvalidStateError"===n.name||"NotFoundError"===n.name))return s.resolve().then((function(){if(!e.db||"NotFoundError"===n.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),C(e)})).then((function(){return function(e){b(e);for(var t=p[e.name],i=t.forages,r=0;r<i.length;r++){var n=i[r];n._dbInfo.db&&(n._dbInfo.db.close(),n._dbInfo.db=null)}return e.db=null,E(e).then((function(t){return e.db=t,w(e)?C(e):t})).then((function(r){e.db=t.db=r;for(var n=0;n<i.length;n++)i[n]._dbInfo.db=r})).catch((function(t){throw S(e,t),t}))}(e).then((function(){P(e,t,i,r-1)}))})).catch(i);i(n)}}function A(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}var D={_driver:"asyncStorage",_initStorage:function(e){var t=this,i={db:null};if(e)for(var r in e)i[r]=e[r];var n=p[i.name];n||(n=A(),p[i.name]=n),n.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=k);var o=[];function a(){return s.resolve()}for(var c=0;c<n.forages.length;c++){var u=n.forages[c];u!==t&&o.push(u._initReady().catch(a))}var l=n.forages.slice(0);return s.all(o).then((function(){return i.db=n.db,E(i)})).then((function(e){return i.db=e,w(i,t._defaultConfig.version)?C(i):e})).then((function(e){i.db=n.db=e,t._dbInfo=i;for(var r=0;r<l.length;r++){var o=l[r];o!==t&&(o._dbInfo.db=i.db,o._dbInfo.version=i.version)}}))},_support:function(){try{if(!n||!n.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,t){var i=this,r=new s((function(t,r){i.ready().then((function(){P(i._dbInfo,m,(function(n,o){if(n)return r(n);try{var s=o.objectStore(i._dbInfo.storeName).openCursor(),a=1;s.onsuccess=function(){var i=s.result;if(i){var r=i.value;R(r)&&(r=I(r));var n=e(r,i.key,a++);void 0!==n?t(n):i.continue()}else t()},s.onerror=function(){r(s.error)}}catch(e){r(e)}}))})).catch(r)}));return a(r,t),r},getItem:function(e,t){var i=this;e=u(e);var r=new s((function(t,r){i.ready().then((function(){P(i._dbInfo,m,(function(n,o){if(n)return r(n);try{var s=o.objectStore(i._dbInfo.storeName).get(e);s.onsuccess=function(){var e=s.result;void 0===e&&(e=null),R(e)&&(e=I(e)),t(e)},s.onerror=function(){r(s.error)}}catch(e){r(e)}}))})).catch(r)}));return a(r,t),r},setItem:function(e,t,i){var r=this;e=u(e);var n=new s((function(i,n){var o;r.ready().then((function(){return o=r._dbInfo,"[object Blob]"===f.call(t)?y(o.db).then((function(e){return e?t:function(e){return new s((function(t,i){var r=new FileReader;r.onerror=i,r.onloadend=function(i){var r=btoa(i.target.result||"");t({__local_forage_encoded_blob:!0,data:r,type:e.type})},r.readAsBinaryString(e)}))}(t)})):t})).then((function(t){P(r._dbInfo,v,(function(o,s){if(o)return n(o);try{var a=s.objectStore(r._dbInfo.storeName);null===t&&(t=void 0);var c=a.put(t,e);s.oncomplete=function(){void 0===t&&(t=null),i(t)},s.onabort=s.onerror=function(){n(c.error?c.error:c.transaction.error)}}catch(e){n(e)}}))})).catch(n)}));return a(n,i),n},removeItem:function(e,t){var i=this;e=u(e);var r=new s((function(t,r){i.ready().then((function(){P(i._dbInfo,v,(function(n,o){if(n)return r(n);try{var s=o.objectStore(i._dbInfo.storeName).delete(e);o.oncomplete=function(){t()},o.onerror=function(){r(s.error)},o.onabort=function(){r(s.error?s.error:s.transaction.error)}}catch(e){r(e)}}))})).catch(r)}));return a(r,t),r},clear:function(e){var t=this,i=new s((function(e,i){t.ready().then((function(){P(t._dbInfo,v,(function(r,n){if(r)return i(r);try{var o=n.objectStore(t._dbInfo.storeName).clear();n.oncomplete=function(){e()},n.onabort=n.onerror=function(){i(o.error?o.error:o.transaction.error)}}catch(e){i(e)}}))})).catch(i)}));return a(i,e),i},length:function(e){var t=this,i=new s((function(e,i){t.ready().then((function(){P(t._dbInfo,m,(function(r,n){if(r)return i(r);try{var o=n.objectStore(t._dbInfo.storeName).count();o.onsuccess=function(){e(o.result)},o.onerror=function(){i(o.error)}}catch(e){i(e)}}))})).catch(i)}));return a(i,e),i},key:function(e,t){var i=this,r=new s((function(t,r){e<0?t(null):i.ready().then((function(){P(i._dbInfo,m,(function(n,o){if(n)return r(n);try{var s=o.objectStore(i._dbInfo.storeName),a=!1,c=s.openKeyCursor();c.onsuccess=function(){var i=c.result;i?0===e||a?t(i.key):(a=!0,i.advance(e)):t(null)},c.onerror=function(){r(c.error)}}catch(e){r(e)}}))})).catch(r)}));return a(r,t),r},keys:function(e){var t=this,i=new s((function(e,i){t.ready().then((function(){P(t._dbInfo,m,(function(r,n){if(r)return i(r);try{var o=n.objectStore(t._dbInfo.storeName).openKeyCursor(),s=[];o.onsuccess=function(){var t=o.result;t?(s.push(t.key),t.continue()):e(s)},o.onerror=function(){i(o.error)}}catch(e){i(e)}}))})).catch(i)}));return a(i,e),i},dropInstance:function(e,t){t=l.apply(this,arguments);var i=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||i.name,e.storeName=e.storeName||i.storeName);var r,o=this;if(e.name){var c=e.name===i.name&&o._dbInfo.db?s.resolve(o._dbInfo.db):E(e).then((function(t){var i=p[e.name],r=i.forages;i.db=t;for(var n=0;n<r.length;n++)r[n]._dbInfo.db=t;return t}));r=c.then(e.storeName?function(t){if(t.objectStoreNames.contains(e.storeName)){var i=t.version+1;b(e);var r=p[e.name],o=r.forages;t.close();for(var a=0;a<o.length;a++){var c=o[a];c._dbInfo.db=null,c._dbInfo.version=i}var u=new s((function(t,r){var o=n.open(e.name,i);o.onerror=function(e){o.result.close(),r(e)},o.onupgradeneeded=function(){o.result.deleteObjectStore(e.storeName)},o.onsuccess=function(){var e=o.result;e.close(),t(e)}}));return u.then((function(e){r.db=e;for(var t=0;t<o.length;t++){var i=o[t];i._dbInfo.db=e,_(i._dbInfo)}})).catch((function(t){throw(S(e,t)||s.resolve()).catch((function(){})),t}))}}:function(t){b(e);var i=p[e.name],r=i.forages;t.close();for(var o=0;o<r.length;o++)r[o]._dbInfo.db=null;var a=new s((function(t,i){var r=n.deleteDatabase(e.name);r.onerror=function(){var e=r.result;e&&e.close(),i(r.error)},r.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},r.onsuccess=function(){var e=r.result;e&&e.close(),t(e)}}));return a.then((function(e){i.db=e;for(var t=0;t<r.length;t++)_(r[t]._dbInfo)})).catch((function(t){throw(S(e,t)||s.resolve()).catch((function(){})),t}))})}else r=s.reject("Invalid arguments");return a(r,t),r}};var N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",O=/^~~local_forage_type~([^~]+)~/,M="__lfsc__:",L=M.length,x="arbf",U="blob",B=L+x.length,z=Object.prototype.toString;function q(e){var t,i,r,n,o,s=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var u=new ArrayBuffer(s),l=new Uint8Array(u);for(t=0;t<a;t+=4)i=N.indexOf(e[t]),r=N.indexOf(e[t+1]),n=N.indexOf(e[t+2]),o=N.indexOf(e[t+3]),l[c++]=i<<2|r>>4,l[c++]=(15&r)<<4|n>>2,l[c++]=(3&n)<<6|63&o;return u}function X(e){var t,i=new Uint8Array(e),r="";for(t=0;t<i.length;t+=3)r+=N[i[t]>>2],r+=N[(3&i[t])<<4|i[t+1]>>4],r+=N[(15&i[t+1])<<2|i[t+2]>>6],r+=N[63&i[t+2]];return i.length%3==2?r=r.substring(0,r.length-1)+"=":i.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var H={serialize:function(e,t){var i="";if(e&&(i=z.call(e)),e&&("[object ArrayBuffer]"===i||e.buffer&&"[object ArrayBuffer]"===z.call(e.buffer))){var r,n=M;e instanceof ArrayBuffer?(r=e,n+=x):(r=e.buffer,"[object Int8Array]"===i?n+="si08":"[object Uint8Array]"===i?n+="ui08":"[object Uint8ClampedArray]"===i?n+="uic8":"[object Int16Array]"===i?n+="si16":"[object Uint16Array]"===i?n+="ur16":"[object Int32Array]"===i?n+="si32":"[object Uint32Array]"===i?n+="ui32":"[object Float32Array]"===i?n+="fl32":"[object Float64Array]"===i?n+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(n+X(r))}else if("[object Blob]"===i){var o=new FileReader;o.onload=function(){var i="~~local_forage_type~"+e.type+"~"+X(this.result);t(M+U+i)},o.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(i){console.error("Couldn't convert value into a JSON string: ",e),t(null,i)}},deserialize:function(e){if(e.substring(0,L)!==M)return JSON.parse(e);var t,i=e.substring(B),r=e.substring(L,B);if(r===U&&O.test(i)){var n=i.match(O);t=n[1],i=i.substring(n[0].length)}var s=q(i);switch(r){case x:return s;case U:return o([s],{type:t});case"si08":return new Int8Array(s);case"ui08":return new Uint8Array(s);case"uic8":return new Uint8ClampedArray(s);case"si16":return new Int16Array(s);case"ur16":return new Uint16Array(s);case"si32":return new Int32Array(s);case"ui32":return new Uint32Array(s);case"fl32":return new Float32Array(s);case"fl64":return new Float64Array(s);default:throw new Error("Unkown type: "+r)}},stringToBuffer:q,bufferToString:X};function F(e,t,i,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],i,r)}function V(e,t,i,r,n,o){e.executeSql(i,r,n,(function(e,s){s.code===s.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,a){a.rows.length?o(e,s):F(e,t,(function(){e.executeSql(i,r,n,o)}),o)}),o):o(e,s)}),o)}function G(e,t,i,r){var n=this;e=u(e);var o=new s((function(o,s){n.ready().then((function(){void 0===t&&(t=null);var a=t,c=n._dbInfo;c.serializer.serialize(t,(function(t,u){u?s(u):c.db.transaction((function(i){V(i,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){o(a)}),(function(e,t){s(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(r>0)return void o(G.apply(n,[e,a,i,r-1]));s(t)}}))}))})).catch(s)}));return a(o,i),o}function j(e){return new s((function(t,i){e.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(i,r){for(var n=[],o=0;o<r.rows.length;o++)n.push(r.rows.item(o).name);t({db:e,storeNames:n})}),(function(e,t){i(t)}))}),(function(e){i(e)}))}))}var Q={_driver:"webSQLStorage",_initStorage:function(e){var t=this,i={db:null};if(e)for(var r in e)i[r]="string"!=typeof e[r]?e[r].toString():e[r];var n=new s((function(e,r){try{i.db=openDatabase(i.name,String(i.version),i.description,i.size)}catch(e){return r(e)}i.db.transaction((function(n){F(n,i,(function(){t._dbInfo=i,e()}),(function(e,t){r(t)}))}),r)}));return i.serializer=H,n},_support:function(){return"function"==typeof openDatabase}(),iterate:function(e,t){var i=this,r=new s((function(t,r){i.ready().then((function(){var n=i._dbInfo;n.db.transaction((function(i){V(i,n,"SELECT * FROM "+n.storeName,[],(function(i,r){for(var o=r.rows,s=o.length,a=0;a<s;a++){var c=o.item(a),u=c.value;if(u&&(u=n.serializer.deserialize(u)),void 0!==(u=e(u,c.key,a+1)))return void t(u)}t()}),(function(e,t){r(t)}))}))})).catch(r)}));return a(r,t),r},getItem:function(e,t){var i=this;e=u(e);var r=new s((function(t,r){i.ready().then((function(){var n=i._dbInfo;n.db.transaction((function(i){V(i,n,"SELECT * FROM "+n.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,i){var r=i.rows.length?i.rows.item(0).value:null;r&&(r=n.serializer.deserialize(r)),t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return a(r,t),r},setItem:function(e,t,i){return G.apply(this,[e,t,i,1])},removeItem:function(e,t){var i=this;e=u(e);var r=new s((function(t,r){i.ready().then((function(){var n=i._dbInfo;n.db.transaction((function(i){V(i,n,"DELETE FROM "+n.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){r(t)}))}))})).catch(r)}));return a(r,t),r},clear:function(e){var t=this,i=new s((function(e,i){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){V(t,r,"DELETE FROM "+r.storeName,[],(function(){e()}),(function(e,t){i(t)}))}))})).catch(i)}));return a(i,e),i},length:function(e){var t=this,i=new s((function(e,i){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){V(t,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(t,i){var r=i.rows.item(0).c;e(r)}),(function(e,t){i(t)}))}))})).catch(i)}));return a(i,e),i},key:function(e,t){var i=this,r=new s((function(t,r){i.ready().then((function(){var n=i._dbInfo;n.db.transaction((function(i){V(i,n,"SELECT key FROM "+n.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,i){var r=i.rows.length?i.rows.item(0).key:null;t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return a(r,t),r},keys:function(e){var t=this,i=new s((function(e,i){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){V(t,r,"SELECT key FROM "+r.storeName,[],(function(t,i){for(var r=[],n=0;n<i.rows.length;n++)r.push(i.rows.item(n).key);e(r)}),(function(e,t){i(t)}))}))})).catch(i)}));return a(i,e),i},dropInstance:function(e,t){t=l.apply(this,arguments);var i=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||i.name,e.storeName=e.storeName||i.storeName);var r,n=this;return a(r=e.name?new s((function(t){var r;r=e.name===i.name?n._dbInfo.db:openDatabase(e.name,"","",0),t(e.storeName?{db:r,storeNames:[e.storeName]}:j(r))})).then((function(e){return new s((function(t,i){e.db.transaction((function(r){function n(e){return new s((function(t,i){r.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){i(t)}))}))}for(var o=[],a=0,c=e.storeNames.length;a<c;a++)o.push(n(e.storeNames[a]));s.all(o).then((function(){t()})).catch((function(e){i(e)}))}),(function(e){i(e)}))}))})):s.reject("Invalid arguments"),t),r}};function W(e,t){var i=e.name+"/";return e.storeName!==t.storeName&&(i+=e.storeName+"/"),i}function Z(){return!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}()||localStorage.length>0}var K={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var i in e)t[i]=e[i];return t.keyPrefix=W(e,this._defaultConfig),Z()?(this._dbInfo=t,t.serializer=H,s.resolve()):s.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var i=this,r=i.ready().then((function(){for(var t=i._dbInfo,r=t.keyPrefix,n=r.length,o=localStorage.length,s=1,a=0;a<o;a++){var c=localStorage.key(a);if(0===c.indexOf(r)){var u=localStorage.getItem(c);if(u&&(u=t.serializer.deserialize(u)),void 0!==(u=e(u,c.substring(n),s++)))return u}}}));return a(r,t),r},getItem:function(e,t){var i=this;e=u(e);var r=i.ready().then((function(){var t=i._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&(r=t.serializer.deserialize(r)),r}));return a(r,t),r},setItem:function(e,t,i){var r=this;e=u(e);var n=r.ready().then((function(){void 0===t&&(t=null);var i=t;return new s((function(n,o){var s=r._dbInfo;s.serializer.serialize(t,(function(t,r){if(r)o(r);else try{localStorage.setItem(s.keyPrefix+e,t),n(i)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||o(e),o(e)}}))}))}));return a(n,i),n},removeItem:function(e,t){var i=this;e=u(e);var r=i.ready().then((function(){localStorage.removeItem(i._dbInfo.keyPrefix+e)}));return a(r,t),r},clear:function(e){var t=this,i=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,i=localStorage.length-1;i>=0;i--){var r=localStorage.key(i);0===r.indexOf(e)&&localStorage.removeItem(r)}}));return a(i,e),i},length:function(e){var t=this.keys().then((function(e){return e.length}));return a(t,e),t},key:function(e,t){var i=this,r=i.ready().then((function(){var t,r=i._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(r.keyPrefix.length)),t}));return a(r,t),r},keys:function(e){var t=this,i=t.ready().then((function(){for(var e=t._dbInfo,i=localStorage.length,r=[],n=0;n<i;n++){var o=localStorage.key(n);0===o.indexOf(e.keyPrefix)&&r.push(o.substring(e.keyPrefix.length))}return r}));return a(i,e),i},dropInstance:function(e,t){if(t=l.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var i=this.config();e.name=e.name||i.name,e.storeName=e.storeName||i.storeName}var r,n=this;return r=e.name?new s((function(t){t(e.storeName?W(e,n._defaultConfig):e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var i=localStorage.key(t);0===i.indexOf(e)&&localStorage.removeItem(i)}})):s.reject("Invalid arguments"),a(r,t),r}},J=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Y=function(e,t){for(var i=e.length,r=0;r<i;){if(J(e[r],t))return!0;r++}return!1},$=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ee={},te={},ie={INDEXEDDB:D,WEBSQL:Q,LOCALSTORAGE:K},re=[ie.INDEXEDDB._driver,ie.WEBSQL._driver,ie.LOCALSTORAGE._driver],ne=["dropInstance"],oe=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ne),se={description:"",driver:re.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ae(e,t){e[t]=function(){var i=arguments;return e.ready().then((function(){return e[t].apply(e,i)}))}}function ce(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var i in t)t.hasOwnProperty(i)&&(arguments[0][i]=$(t[i])?t[i].slice():t[i])}return arguments[0]}var ue=function(){function e(t){for(var i in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ie)if(ie.hasOwnProperty(i)){var r=ie[i],n=r._driver;this[i]=n,ee[n]||this.defineDriver(r)}this._defaultConfig=ce({},se),this._config=ce({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":r(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,i){var r=new s((function(t,i){try{var r=e._driver,n=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void i(n);for(var o=oe.concat("_initStorage"),c=0,u=o.length;c<u;c++){var l=o[c];if((!Y(ne,l)||e[l])&&"function"!=typeof e[l])return void i(n)}(function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),i=s.reject(t);return a(i,arguments[arguments.length-1]),i}},i=0,r=ne.length;i<r;i++){var n=ne[i];e[n]||(e[n]=t(n))}})();var d=function(i){ee[r]&&console.info("Redefining LocalForage driver: "+r),ee[r]=e,te[r]=i,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(d,i):d(!!e._support):d(!0)}catch(e){i(e)}}));return c(r,t,i),r},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,i){var r=ee[e]?s.resolve(ee[e]):s.reject(new Error("Driver not found."));return c(r,t,i),r},e.prototype.getSerializer=function(e){var t=s.resolve(H);return c(t,e),t},e.prototype.ready=function(e){var t=this,i=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return c(i,e,e),i},e.prototype.setDriver=function(e,t,i){var r=this;$(e)||(e=[e]);var n=this._getSupportedDrivers(e);function o(){r._config.driver=r.driver()}function a(e){return r._extend(e),o(),r._ready=r._initStorage(r._config),r._ready}var u=null!==this._driverSet?this._driverSet.catch((function(){return s.resolve()})):s.resolve();return this._driverSet=u.then((function(){var e=n[0];return r._dbInfo=null,r._ready=null,r.getDriver(e).then((function(e){r._driver=e._driver,o(),r._wrapLibraryMethodsWithReady(),r._initDriver=function(e){return function(){var t=0;return function i(){for(;t<e.length;){var n=e[t];return t++,r._dbInfo=null,r._ready=null,r.getDriver(n).then(a).catch(i)}o();var c=new Error("No available storage method found.");return r._driverSet=s.reject(c),r._driverSet}()}}(n)}))})).catch((function(){o();var e=new Error("No available storage method found.");return r._driverSet=s.reject(e),r._driverSet})),c(this._driverSet,t,i),this._driverSet},e.prototype.supports=function(e){return!!te[e]},e.prototype._extend=function(e){ce(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],i=0,r=e.length;i<r;i++){var n=e[i];this.supports(n)&&t.push(n)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=oe.length;e<t;e++)ae(this,oe[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),le=new ue;t.exports=le},{3:3}]},{},[4])(4)},2100:function(e,t,i){"use strict";e.exports=i(9482)},9482:function(e,t,i){"use strict";var r=t;function n(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=i(1173),r.BufferWriter=i(3155),r.Reader=i(1408),r.BufferReader=i(593),r.util=i(9693),r.rpc=i(5994),r.roots=i(5054),r.configure=n,n()},1408:function(e,t,i){"use strict";e.exports=c;var r,n=i(9693),o=n.LongBits,s=n.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},d=function(){return n.Buffer?function(e){return(c.create=function(e){return n.Buffer.isBuffer(e)?new r(e):l(e)})(e)}:l};function h(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new o(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.create=d(),c.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|p(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,i=this.pos+e;if(i>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,i):t===i?new this.buf.constructor(0):this._slice.call(this.buf,t,i)},c.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){r=e,c.create=d(),r._configure();var t=n.Long?"toLong":"toNumber";n.merge(c.prototype,{int64:function(){return h.call(this)[t](!1)},uint64:function(){return h.call(this)[t](!0)},sint64:function(){return h.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},593:function(e,t,i){"use strict";e.exports=o;var r=i(1408);(o.prototype=Object.create(r.prototype)).constructor=o;var n=i(9693);function o(e){r.call(this,e)}o._configure=function(){n.Buffer&&(o.prototype._slice=n.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},5054:function(e){"use strict";e.exports={}},5994:function(e,t,i){"use strict";t.Service=i(7948)},7948:function(e,t,i){"use strict";e.exports=n;var r=i(9693);function n(e,t,i){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(i)}(n.prototype=Object.create(r.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(t,i,n,o,s){if(!o)throw TypeError("request must be specified");var a=this;if(!s)return r.asPromise(e,a,t,i,n,o);if(a.rpcImpl)try{return a.rpcImpl(t,i[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,i){if(e)return a.emit("error",e,t),s(e);if(null!==i){if(!(i instanceof n))try{i=n[a.responseDelimited?"decodeDelimited":"decode"](i)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",i,t),s(null,i)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},n.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:function(e,t,i){"use strict";e.exports=n;var r=i(9693);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=n.zero=new n(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var i=e>>>0,r=(e-i)/4294967296>>>0;return t&&(r=~r>>>0,i=~i>>>0,++i>4294967295&&(i=0,++r>4294967295&&(r=0))),new n(i,r)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if(r.isString(e)){if(!r.Long)return n.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):o},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,i=~this.hi>>>0;return t||(i=i+1>>>0),-(t+4294967296*i)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;n.fromHash=function(e){return e===s?o:new n((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:i<128?9:10}},9693:function(e,t,i){"use strict";var r=t;function n(e,t,i){for(var r=Object.keys(t),n=0;n<r.length;++n)void 0!==e[r[n]]&&i||(e[r[n]]=t[r[n]]);return e}function o(e){function t(e,i){if(!(this instanceof t))return new t(e,i);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),i&&n(this,i)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}r.asPromise=i(4537),r.base64=i(7419),r.EventEmitter=i(9211),r.float=i(945),r.inquire=i(7199),r.utf8=i(4997),r.pool=i(6662),r.LongBits=i(1945),r.isNode=Boolean(void 0!==i.g&&i.g&&i.g.process&&i.g.process.versions&&i.g.process.versions.node),r.global=r.isNode&&i.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==_typeof(e)},r.isset=r.isSet=function(e,t){var i=e[t];return!(null==i||!e.hasOwnProperty(t))&&("object"!=_typeof(i)||(Array.isArray(i)?i.length:Object.keys(i).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var i=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(i.lo,i.hi,t):i.toNumber(Boolean(t))},r.merge=n,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=o,r.ProtocolError=o("ProtocolError"),r.oneOfGetter=function(e){for(var t={},i=0;i<e.length;++i)t[e[i]]=1;return function(){for(var e=Object.keys(this),i=e.length-1;i>-1;--i)if(1===t[e[i]]&&null!=this[e[i]])return e[i]}},r.oneOfSetter=function(e){return function(t){for(var i=0;i<e.length;++i)e[i]!==t&&delete this[e[i]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,i){return new e(t,i)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},1173:function(e,t,i){"use strict";e.exports=d;var r,n=i(9693),o=n.LongBits,s=n.base64,a=n.utf8;function c(e,t,i){this.fn=e,this.len=t,this.next=void 0,this.val=i}function u(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var h=function(){return n.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};function p(e,t,i){t[i]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,i){for(;e.hi;)t[i++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[i++]=127&e.lo|128,e.lo=e.lo>>>7;t[i++]=e.lo}function v(e,t,i){t[i]=255&e,t[i+1]=e>>>8&255,t[i+2]=e>>>16&255,t[i+3]=e>>>24}d.create=h(),d.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(d.alloc=n.pool(d.alloc,n.Array.prototype.subarray)),d.prototype._push=function(e,t,i){return this.tail=this.tail.next=new c(e,t,i),this.len+=t,this},(f.prototype=Object.create(c.prototype)).fn=function(e,t,i){for(;e>127;)t[i++]=127&e|128,e>>>=7;t[i]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(m,10,o.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.int64=d.prototype.uint64=function(e){var t=o.from(e);return this._push(m,t.length(),t)},d.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(m,t.length(),t)},d.prototype.bool=function(e){return this._push(p,1,e?1:0)},d.prototype.sfixed32=d.prototype.fixed32=function(e){return this._push(v,4,e>>>0)},d.prototype.sfixed64=d.prototype.fixed64=function(e){var t=o.from(e);return this._push(v,4,t.lo)._push(v,4,t.hi)},d.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var g=n.Array.prototype.set?function(e,t,i){t.set(e,i)}:function(e,t,i){for(var r=0;r<e.length;++r)t[i+r]=e[r]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(p,1,0);if(n.isString(e)){var i=d.alloc(t=s.length(e));s.decode(e,i,0),e=i}return this.uint32(t)._push(g,t,e)},d.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(p,1,0)},d.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=e.next,this.tail=t,this.len+=i),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),i=0;e;)e.fn(e.val,t,i),i+=e.len,e=e.next;return t},d._configure=function(e){r=e,d.create=h(),r._configure()}},3155:function(e,t,i){"use strict";e.exports=o;var r=i(1173);(o.prototype=Object.create(r.prototype)).constructor=o;var n=i(9693);function o(){r.call(this)}function s(e,t,i){e.length<40?n.utf8.write(e,t,i):t.utf8Write?t.utf8Write(e,i):t.write(e,i)}o._configure=function(){o.alloc=n._Buffer_allocUnsafe,o.writeBytesBuffer=n.Buffer&&n.Buffer.prototype instanceof Uint8Array&&"set"===n.Buffer.prototype.set.name?function(e,t,i){t.set(e,i)}:function(e,t,i){if(e.copy)e.copy(t,i,0,e.length);else for(var r=0;r<e.length;)t[i++]=e[r++]}},o.prototype.bytes=function(e){n.isString(e)&&(e=n._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=n.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},o._configure()},8413:function(e,t,i){"use strict";var r=i(2100),n=i(1583);r.util.Long=n,r.util.Long.fromBits=r.util.Long?r.util.Long.fromBits:function(){return 0};for(var o=r.roots,s=r.types?r.types.basic:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0,string:2,bytes:2},a=r.types?r.types.packed:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0},c=Object.keys(s),u={$:function(e){return u[e]?u[e].call(this):o[e].decode?o[e].decode(this,this.uint32()):u.$.call(this,"int32")}},l={$:function(e,t,i){var r=s[e];return void 0===r?o[e].encode?(this.uint32(i<<3|2).fork(),o[e].encode(t,this).ldelim()):l.$.call(this,"int32",t,i):l[e].call(this.uint32(i<<3|r),t)}},d=0;d<c.length;d++)u[c[d]]=r.Reader.prototype[c[d]],l[c[d]]=r.Writer.prototype[c[d]];!function e(t,i,n,c){for(var d=0,h=Object.keys(t);d<h.length;d++){var p=h[d];if(t[p].$m&&Object.keys(t[p].$m).every((function(e){return Number(e)}))){if(n[p])throw Error("nested type ".concat(n,".").concat(p," has already exist"));n[p]=function(t,n){function c(e){for(var i in t){var r=t[i];"{"===r[1].charAt(0)?this[r[0]]={}:"["!==r[1].charAt(0)&&"<"!==r[1].charAt(0)||(this[r[0]]=[])}if(e)for(var n=Object.keys(e),o=0;o<n.length;++o)null!=e[n[o]]&&(this[n[o]]=e[n[o]])}var d={};for(var h in t){var p=t[h],f=p[1];"{"===f.charAt(0)?(c.prototype[p[0]]=r.util.emptyObject,d[f]={$m:f.substring(1).split(",").map((function(e,t){return["$".concat(t+1),e,null]})).reduce((function(e,t,i){return e[i+1]=t,e}),{})}):c.prototype[p[0]]="["===f.charAt(0)||"<"===f.charAt(0)?r.util.emptyArray:"bytes"===f?r.util.newBuffer([]):p[2]&&p[2].hasOwnProperty("low")&&p[2].hasOwnProperty("high")?r.util.Long.fromBits(p[2].low,p[2].high,p[2].unsigned):p[2]}return c.create=function(e){return new c(e)},c.decode=function(e,i){e instanceof r.Reader||(e=r.Reader.create(e));for(var n=void 0===i?e.len:e.pos+i,s=new c;e.pos<n;){var l=e.uint32(),d=l>>>3;if(d>0&&t[d]){var h=t[d][0],p=t[d][1];if("{"===p.charAt(0)){s[h]===r.util.emptyObject&&(s[h]={});var f=c.$namespace[p].decode(e,e.uint32());s[h][f.$1]=f.$2}else if("["===p.charAt(0)||"<"===p.charAt(0))if(p=p.substring(1),s[h]&&s[h].length||(s[h]=[]),void 0!==a[p=u[p]||o[p].decode?p:"int32"]&&2==(7&l))for(var m=e.uint32()+e.pos;e.pos<m;)s[h].push(u.$.call(e,p));else s[h].push(u.$.call(e,p));else s[h]=u.$.call(e,p)}else e.skipType(7&l)}return s},c.encode=function(e,i){for(var n in i||(i=r.Writer.create()),t){var u=t[n][0],d=t[n][1];if("{"===d.charAt(0)){if(null!=e[u]&&e.hasOwnProperty(u))for(var h=0,p=Object.keys(e[u]);h<p.length;++h)i.uint32(n<<3|2).fork(),c.$namespace[d].encode({$1:p[h],$2:e[u][p[h]]},i).ldelim()}else if("["===d.charAt(0)||"<"===d.charAt(0)){var f="<"===d.charAt(0);d=d.substring(1);var m=e[u];if(null!=m&&m.length)if(d=void 0!==s[d]||o[d].encode?d:"int32",f&&void 0!==a[d]){for(i.uint32(n<<3|2).fork(),h=0;h<m.length;h++)l[d].call(i,m[h]);i.ldelim()}else for(h=0;h<m.length;h++)l.$.call(i,d,m[h],n)}else null!=e[u]&&e.hasOwnProperty(u)&&l.$.call(i,d,e[u],n)}return i},Object.keys(d).length&&(c.$namespace=e(d,i+"."+n,c.$namespace||{},!0)),c}(t[p].$m,p)}else t[p].$s?n[p]=function(e,t){function n(e,t,i){r.rpc.Service.call(this,e,t,i)}return(n.prototype=Object.create(r.rpc.Service.prototype)).constructor=n,n.create=function(e,t,i){return new n(e,t,i)},Object.keys(e).forEach((function(r){var s=e[r];function a(e,t){return this.rpcCall(a,o[s[0]],o[s[1]],e,t)}Object.defineProperty(a,"name",{value:r}),Object.defineProperty(a,"path",{value:"".concat(i,".").concat(t)}),n.prototype[r]=a})),n}(t[p].$s,p):t[p].$e&&Object.values(t[p].$e).every((function(e){return Number(e)===e}))&&(n[p]=function(e,t){for(var i=Object.keys(e),r={},n=0;n<i.length;n++)r[r[i[n]]=e[i[n]]]=i[n];return r}(t[p].$e));n[p]&&!c&&(o["".concat(i,".").concat(p)]=n[p]),delete t[p].$m,delete t[p].$s,delete t[p].$e,n[p]=e(t[p],i?"".concat(i,".").concat(p):p,n[p]||{})}return n}({mixstream:{proto_mixstream:{MixAdvanceConfig:{$m:{1:["key","string",""],2:["value","string",""]}},MixImage:{$m:{1:["url","string",""],2:["display_mode","int32",0]}},MixInputStream:{$m:{1:["stream_input_common","mixstream.proto_mixstream.MixInputStreamCommon",null],2:["volume","int32",0],3:["audio_focus","int32",0],4:["audio_h_angle","int32",0],5:["render_mode","int32",0],6:["corner_radius","uint32",0],7:["label","mixstream.proto_mixstream.MixLabel",null],8:["image","mixstream.proto_mixstream.MixImage",null]}},MixInputStreamCommon:{$m:{1:["stream_id","string",""],2:["sound_level_id","uint32",0],3:["content_control","int32",0],4:["layer_rect","mixstream.proto_mixstream.MixRect",null],5:["stream_url","string",""]}},MixLabel:{$m:{1:["text","string",""],2:["text_left","int32",0],3:["text_top","int32",0],4:["font","mixstream.proto_mixstream.MixLableFont",null]}},MixLableFont:{$m:{1:["font_type","int32",0],2:["font_size","int32",0],3:["font_color","int32",0],4:["font_transparency","int32",0],5:["font_border_color","sint32",0]}},MixOutputStream:{$m:{1:["output_stream_common","mixstream.proto_mixstream.MixOutputStreamCommon",null],2:["video_enc_id","int32",0],3:["video_encode_latency","int32",0],4:["video_encode_profile","int32",0],5:["low_bitrate_hd","int32",0]}},MixOutputStreamCommon:{$m:{1:["is_url","int32",0],2:["target","string",""],3:["video_fps","int32",0],4:["rate_control_mode","int32",0],5:["video_bitrate","int32",0],6:["video_width","int32",0],7:["video_height","int32",0],8:["output_quality","int32",0],9:["audio_bitrate","int32",0],10:["audio_enc_id","int32",0]}},MixRect:{$m:{1:["top","int32",0],2:["left","int32",0],3:["bottom","int32",0],4:["right","int32",0],5:["layer","int32",0]}},MixStartReplyData:{$m:{1:["request_id","string",""],2:["play_infos","<mixstream.proto_mixstream.PlayInfo",null]}},MixStreamCommon:{$m:{1:["user_data","string",""],2:["output_bg_color","int32",0],3:["output_bg_image","string",""],4:["with_sound_level","int32",0],5:["single_stream_pass_through","int32",0],6:["alignment_type","int32",0]}},MixstreamServerCommonResponse:{$m:{1:["code","uint32",0],2:["message","string",""]}},MixStreamStartRequest:{$m:{1:["request_seq","uint32",0],2:["mix_protocol_version","int32",0],3:["task_id","string",""],4:["room_id","string",""],5:["mix_stream_common","mixstream.proto_mixstream.MixStreamCommon",null],6:["audio_channel_cnt","int32",0],7:["audio_mix_mode","int32",0],8:["recv_buffer_level","sint32",0],9:["input_stream","<mixstream.proto_mixstream.MixInputStream",null],10:["water_mark","mixstream.proto_mixstream.MixWaterMark",null],11:["advance_config","<mixstream.proto_mixstream.MixAdvanceConfig",null],12:["output_stream","<mixstream.proto_mixstream.MixOutputStream",null],13:["white_board","mixstream.proto_mixstream.MixWhiteBoard",null],14:["timestamp","int64",{low:0,high:0,unsigned:!1}]}},MixStreamStartResponse:{$m:{1:["request_seq","uint32",0],2:["common_response","mixstream.proto_mixstream.MixstreamServerCommonResponse",null],3:["data","mixstream.proto_mixstream.MixStartReplyData",null],4:["error_streamid_list","<string",null]}},MixStreamStopRequest:{$m:{1:["request_seq","uint32",0],2:["task_id","string",""],3:["room_id","string",""],4:["is_url","int32",0],5:["target","string",""],6:["timestamp","int64",{low:0,high:0,unsigned:!1}]}},MixStreamStopResponse:{$m:{1:["request_seq","uint32",0],2:["common_response","mixstream.proto_mixstream.MixstreamServerCommonResponse",null]}},MixWaterMark:{$m:{1:["image","string",""],2:["layout_rect","mixstream.proto_mixstream.MixRect",null]}},MixWhiteBoard:{$m:{1:["whiteboard_id","uint64",{low:0,high:0,unsigned:!0}],2:["horizontal_ratio","int32",0],3:["vertical_ratio","int32",0],4:["is_ppt_animation","int32",0],5:["layout_rect","mixstream.proto_mixstream.MixRect",null],6:["background_color","int32",0]}},PlayInfo:{$m:{1:["stream_alias","string",""],2:["rtmp_url","string",""],3:["hls_url","string",""],4:["hdl_url","string",""]}}}}},"",o,!1),t.Z=o.mixstream},1054:function(e,t,i){"use strict";var r,n=i(2100),o=n.Reader,s=n.Writer,a=n.util,c=n.roots.default||(n.roots.default={});c.proto_media=((r={}).MediaServerCommonResponse=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.code=0,e.prototype.message="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=s.create()),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(8).uint32(e.code),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&t.uint32(18).string(e.message),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var i=void 0===t?e.len:e.pos+t,r=new c.proto_media.MediaServerCommonResponse;e.pos<i;){var n=e.uint32();switch(n>>>3){case 1:r.code=e.uint32();break;case 2:r.message=e.string();break;default:e.skipType(7&n)}}return r},e}(),r.RelayPublishCdnRequest=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.request_seq=0,e.prototype.request_cmd=0,e.prototype.streamid="",e.prototype.cdn_server="",e.prototype.publish_timeout=0,e.prototype.request_seq_v2=a.Long?a.Long.fromBits(0,0,!0):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=s.create()),null!=e.request_seq&&Object.hasOwnProperty.call(e,"request_seq")&&t.uint32(8).uint32(e.request_seq),null!=e.request_cmd&&Object.hasOwnProperty.call(e,"request_cmd")&&t.uint32(16).int32(e.request_cmd),null!=e.streamid&&Object.hasOwnProperty.call(e,"streamid")&&t.uint32(26).string(e.streamid),null!=e.cdn_server&&Object.hasOwnProperty.call(e,"cdn_server")&&t.uint32(34).string(e.cdn_server),null!=e.publish_timeout&&Object.hasOwnProperty.call(e,"publish_timeout")&&t.uint32(40).uint32(e.publish_timeout),null!=e.request_seq_v2&&Object.hasOwnProperty.call(e,"request_seq_v2")&&t.uint32(48).uint64(e.request_seq_v2),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var i=void 0===t?e.len:e.pos+t,r=new c.proto_media.RelayPublishCdnRequest;e.pos<i;){var n=e.uint32();switch(n>>>3){case 1:r.request_seq=e.uint32();break;case 2:r.request_cmd=e.int32();break;case 3:r.streamid=e.string();break;case 4:r.cdn_server=e.string();break;case 5:r.publish_timeout=e.uint32();break;case 6:r.request_seq_v2=e.uint64();break;default:e.skipType(7&n)}}return r},e}(),r.RelayPublishCdnResponse=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.request_seq=0,e.prototype.response=null,e.prototype.request_seq_v2=a.Long?a.Long.fromBits(0,0,!0):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=s.create()),null!=e.request_seq&&Object.hasOwnProperty.call(e,"request_seq")&&t.uint32(8).uint32(e.request_seq),null!=e.response&&Object.hasOwnProperty.call(e,"response")&&c.proto_media.MediaServerCommonResponse.encode(e.response,t.uint32(18).fork()).ldelim(),null!=e.request_seq_v2&&Object.hasOwnProperty.call(e,"request_seq_v2")&&t.uint32(24).uint64(e.request_seq_v2),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var i=void 0===t?e.len:e.pos+t,r=new c.proto_media.RelayPublishCdnResponse;e.pos<i;){var n=e.uint32();switch(n>>>3){case 1:r.request_seq=e.uint32();break;case 2:r.response=c.proto_media.MediaServerCommonResponse.decode(e,e.uint32());break;case 3:r.request_seq_v2=e.uint64();break;default:e.skipType(7&n)}}return r},e}(),r),e.exports=c},6531:function(){var e=function(){"use strict";function t(e,t){postMessage({action:Ue,cbn:t,result:e})}function i(e){var t=[];return t[e-1]=void 0,t}function r(e,t){return s(e[0]+t[0],e[1]+t[1])}function n(e,t){return function(e,t){var i,r;return i=e*ze,r=t,0>t&&(r+=ze),[r,i]}(Math.max(Math.min(e[1]/ze,2147483647),-2147483648)&Math.max(Math.min(t[1]/ze,2147483647),-2147483648),u(e)&u(t))}function o(e,t){var i,r;return e[0]==t[0]&&e[1]==t[1]?0:(r=0>t[1],(i=0>e[1])&&!r?-1:!i&&r?1:p(e,t)[1]<0?-1:1)}function s(e,t){var i,r;for(e%=0x10000000000000000,t=(t%=0x10000000000000000)-(i=t%ze)+(r=Math.floor(e/ze)*ze),e=e-r+i;0>e;)e+=ze,t-=ze;for(;e>4294967295;)e-=ze,t+=ze;for(t%=0x10000000000000000;t>0x7fffffff00000000;)t-=0x10000000000000000;for(;-0x8000000000000000>t;)t+=0x10000000000000000;return[e,t]}function a(e,t){return e[0]==t[0]&&e[1]==t[1]}function c(e){return e>=0?[e,0]:[e+ze,-ze]}function u(e){return e[0]>=2147483648?~~Math.max(Math.min(e[0]-ze,2147483647),-2147483648):~~Math.max(Math.min(e[0],2147483647),-2147483648)}function l(e){return 30>=e?1<<e:l(30)*l(e-30)}function d(e,t){var i,r,n,o;if(t&=63,a(e,Xe))return t?He:e;if(0>e[1])throw Error("Neg");return o=l(t),r=e[1]*o%0x10000000000000000,(r+=i=(n=e[0]*o)-n%ze)>=0x8000000000000000&&(r-=0x10000000000000000),[n-=i,r]}function h(e,t){var i;return i=l(t&=63),s(Math.floor(e[0]/i),e[1]/i)}function p(e,t){return s(e[0]-t[0],e[1]-t[1])}function f(e,t){return e.Mc=t,e.Lc=0,e.Yb=t.length,e}function m(e){return e.Lc>=e.Yb?-1:255&e.Mc[e.Lc++]}function v(e,t,i,r){return e.Lc>=e.Yb?-1:(r=Math.min(r,e.Yb-e.Lc),S(e.Mc,e.Lc,t,i,r),e.Lc+=r,r)}function g(e){return e.Mc=i(32),e.Yb=0,e}function y(e){var t=e.Mc;return t.length=e.Yb,t}function b(e,t){e.Mc[e.Yb++]=t<<24>>24}function _(e,t,i,r){S(t,i,e.Mc,e.Yb,r),e.Yb+=r}function S(e,t,i,r,n){for(var o=0;n>o;++o)i[r+o]=e[t+o]}function T(t,i,r,n,s){var a,c;if(o(n,qe)<0)throw Error("invalid length "+n);for(t.Tb=n,function(e,t){(function(e,t){e.ab=t;for(var i=0;t>1<<i;++i);e.$b=2*i})(t,1<<e.s),t.n=e.f,function(e,t){var i=e.X;e.X=t,e.b&&i!=e.X&&(e.wb=-1,e.b=null)}(t,e.m),t.eb=0,t.fb=3,t.Y=2,t.y=3}(s,a=W({})),a.Gc=void 0===e.disableEndMark,function(e,t){e.fc[0]=9*(5*e.Y+e.eb)+e.fb<<24>>24;for(var i=0;4>i;++i)e.fc[1+i]=e.ab>>8*i<<24>>24;_(t,e.fc,0,5)}(a,r),c=0;64>c;c+=8)b(r,255&u(h(n,c)));t.yb=(a.W=0,a.oc=i,a.pc=0,function(e){var t,i;e.b||(t={},i=4,e.X||(i=2),function(e,t){e.qb=t>2,e.qb?(e.w=0,e.xb=4,e.R=66560):(e.w=2,e.xb=3,e.R=0)}(t,i),e.b=t),de(e.A,e.eb,e.fb),(e.ab!=e.wb||e.Hb!=e.n)&&(A(e.b,e.ab,4096,e.n,274),e.wb=e.ab,e.Hb=e.n)}(a),a.d.Ab=r,function(e){(function(e){e.l=0,e.J=0;for(var t=0;4>t;++t)e.v[t]=0})(e),function(e){e.mc=He,e.xc=He,e.E=-1,e.Jb=1,e.Oc=0}(e.d),ke(e.C),ke(e._),ke(e.bb),ke(e.hb),ke(e.Ub),ke(e.vc),ke(e.Sb),function(e){var t,i=1<<e.u+e.I;for(t=0;i>t;++t)ke(e.V[t].tb)}(e.A);for(var t=0;4>t;++t)ke(e.K[t].G);oe(e.$,1<<e.Y),oe(e.i,1<<e.Y),ke(e.S.G),e.N=0,e.jb=0,e.q=0,e.s=0}(a),K(a),Z(a),a.$.rb=a.n+1-2,le(a.$,1<<a.Y),a.i.rb=a.n+1-2,le(a.i,1<<a.Y),a.g=He,function(e,t){return e.cb=t,e.Z=null,e.zc=1,e}({},a))}function E(e,t,i){return e.Nb=g({}),T(e,f({},t),e.Nb,c(t.length),i),e}function C(e,t){return e.Nb=g({}),function(e,t,i){var r,n,o,s,a="",u=[];for(n=0;5>n;++n){if(-1==(o=m(t)))throw Error("truncated input");u[n]=o<<24>>24}if(!function(e,t){var i,r,n,o,s,a,c;if(5>t.length)return 0;for(n=(c=255&t[0])%9,o=(a=~~(c/9))%5,s=~~(a/5),i=0,r=0;4>r;++r)i+=(255&t[1+r])<<8*r;return i>99999999||!function(e,t,i,r){if(t>8||i>4||r>4)return 0;G(e.gb,i,t);var n=1<<r;return X(e.Rb,n),X(e.sb,n),e.Dc=n-1,1}(e,n,o,s)?0:function(e,t){return 0>t?0:(e.Ob!=t&&(e.Ob=t,e.nb=Math.max(e.Ob,1),O(e.B,Math.max(e.nb,4096))),1)}(e,i)}(r=q({}),u))throw Error("corrupted input");for(n=0;64>n;n+=8){if(-1==(o=m(t)))throw Error("truncated input");1==(o=o.toString(16)).length&&(o="0"+o),a=o+""+a}/^0+$|^f+$/i.test(a)?e.Tb=qe:(s=parseInt(a,16),e.Tb=s>4294967295?qe:c(s)),e.yb=function(e,t,i,r){return e.e.Ab=t,x(e.B),e.B.cc=i,function(e){e.B.h=0,e.B.o=0,ke(e.Gb),ke(e.pb),ke(e.Zb),ke(e.Cb),ke(e.Db),ke(e.Eb),ke(e.kc),function(e){var t,i;for(i=1<<e.u+e.I,t=0;i>t;++t)ke(e.V[t].Ib)}(e.gb);for(var t=0;4>t;++t)ke(e.kb[t].G);V(e.Rb),V(e.sb),ke(e.Fb.G),function(e){e.Bb=0,e.E=-1;for(var t=0;5>t;++t)e.Bb=e.Bb<<8|m(e.Ab)}(e.e)}(e),e.U=0,e.ib=0,e.Jc=0,e.Ic=0,e.Qc=0,e.Nc=r,e.g=He,e.jc=0,function(e,t){return e.Z=t,e.cb=null,e.zc=1,e}({},e)}(r,t,i,e.Tb)}(e,f({},t),e.Nb),e}function w(e,t){return e.c[e.f+e.o+t]}function I(e,t,i,r){var n,o;for(e.T&&e.o+t+r>e.h&&(r=e.h-(e.o+t)),++i,o=e.f+e.o+t,n=0;r>n&&e.c[o+n]==e.c[o+n-i];++n);return n}function R(e){return e.h-e.o}function k(e){var t,i;if(!e.T)for(;;){if(!(i=-e.f+e.Kb-e.h))return;if(-1==(t=v(e.cc,e.c,e.f+e.h,i)))return e.zb=e.h,e.f+e.zb>e.H&&(e.zb=e.H-e.f),void(e.T=1);e.h+=t,e.h>=e.o+e._b&&(e.zb=e.h-e._b)}}function P(e,t){e.f+=t,e.zb-=t,e.o-=t,e.h-=t}function A(e,t,r,n,o){var s,a;1073741567>t&&(e.Fc=16+(n>>1),function(e,t,r,n){var o;e.Bc=t,e._b=r,o=t+r+n,(null==e.c||e.Kb!=o)&&(e.c=null,e.Kb=o,e.c=i(e.Kb)),e.H=e.Kb-r}(e,t+r,n+o,256+~~((t+r+n+o)/2)),e.ob=n,e.p!=(s=t+1)&&(e.L=i(2*(e.p=s))),a=65536,e.qb&&(a=t-1,a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a>>=1,(a|=65535)>16777216&&(a>>=1),e.Ec=a,++a,a+=e.R),a!=e.rc&&(e.ub=i(e.rc=a)))}function D(e){var t;++e.k>=e.p&&(e.k=0),function(e){++e.o,e.o>e.zb&&(e.f+e.o>e.H&&function(e){var t,i,r;for((r=e.f+e.o-e.Bc)>0&&--r,i=e.f+e.h-r,t=0;i>t;++t)e.c[t]=e.c[r+t];e.f-=r}(e),k(e))}(e),1073741823==e.o&&(N(e.L,2*e.p,t=e.o-e.p),N(e.ub,e.rc,t),P(e,t))}function N(e,t,i){var r,n;for(r=0;t>r;++r)i>=(n=e[r]||0)?n=0:n-=i,e[r]=n}function O(e,t){(null==e.Lb||e.M!=t)&&(e.Lb=i(t)),e.M=t,e.o=0,e.h=0}function M(e){var t=e.o-e.h;t&&(_(e.cc,e.Lb,e.h,t),e.o>=e.M&&(e.o=0),e.h=e.o)}function L(e,t){var i=e.o-t-1;return 0>i&&(i+=e.M),e.Lb[i]}function x(e){M(e),e.cc=null}function U(e){return 4>(e-=2)?e:3}function B(e){return 4>e?0:10>e?e-3:e-6}function z(e){if(!e.zc)throw Error("bad state");return e.cb?function(e){(function(e,t,i,n){var s,l,d,h,f,m,v,g,y,b,_,S,T,E,C;if(t[0]=He,i[0]=He,n[0]=1,e.oc&&(e.b.cc=e.oc,function(e){e.f=0,e.o=0,e.h=0,e.T=0,k(e),e.k=0,P(e,-1)}(e.b),e.W=1,e.oc=null),!e.pc){if(e.pc=1,E=e.g,a(e.g,He)){if(!R(e.b))return void J(e,u(e.g));ie(e),T=u(e.g)&e.y,Pe(e.d,e.C,(e.l<<4)+T,0),e.l=B(e.l),d=w(e.b,-e.s),pe(he(e.A,u(e.g),e.J),e.d,d),e.J=d,--e.s,e.g=r(e.g,Fe)}if(!R(e.b))return void J(e,u(e.g));for(;;){if(v=Y(e,u(e.g)),b=e.mb,T=u(e.g)&e.y,l=(e.l<<4)+T,1==v&&-1==b)Pe(e.d,e.C,l,0),d=w(e.b,-e.s),C=he(e.A,u(e.g),e.J),7>e.l?pe(C,e.d,d):(y=w(e.b,-e.v[0]-1-e.s),fe(C,e.d,y,d)),e.J=d,e.l=B(e.l);else{if(Pe(e.d,e.C,l,1),4>b){if(Pe(e.d,e.bb,e.l,1),b?(Pe(e.d,e.hb,e.l,1),1==b?Pe(e.d,e.Ub,e.l,0):(Pe(e.d,e.Ub,e.l,1),Pe(e.d,e.vc,e.l,b-2))):(Pe(e.d,e.hb,e.l,0),Pe(e.d,e._,l,1==v?0:1)),1==v?e.l=7>e.l?9:11:(ae(e.i,e.d,v-2,T),e.l=7>e.l?8:11),h=e.v[b],0!=b){for(m=b;m>=1;--m)e.v[m]=e.v[m-1];e.v[0]=h}}else{for(Pe(e.d,e.bb,e.l,0),e.l=7>e.l?7:10,ae(e.$,e.d,v-2,T),S=ne(b-=4),g=U(v),Se(e.K[g],e.d,S),S>=4&&(_=b-(s=(2|1&S)<<(f=(S>>1)-1)),14>S?we(e.Sb,s-S-1,e.d,f,_):(Ae(e.d,_>>4,f-4),Ee(e.S,e.d,15&_),++e.Qb)),h=b,m=3;m>=1;--m)e.v[m]=e.v[m-1];e.v[0]=h,++e.Mb}e.J=w(e.b,v-1-e.s)}if(e.s-=v,e.g=r(e.g,c(v)),!e.s){if(e.Mb>=128&&K(e),e.Qb>=16&&Z(e),t[0]=e.g,i[0]=De(e.d),!R(e.b))return void J(e,u(e.g));if(o(p(e.g,E),[4096,0])>=0)return e.pc=0,void(n[0]=0)}}}})(e.cb,e.cb.Xb,e.cb.uc,e.cb.Kc),e.Pb=e.cb.Xb[0],e.cb.Kc[0]&&(function(e){re(e),e.d.Ab=null}(e.cb),e.zc=0)}(e):function(e){var t=function(e){var t,i,n,s,a,l;if(l=u(e.g)&e.Dc,Re(e.e,e.Gb,(e.U<<4)+l)){if(Re(e.e,e.Zb,e.U))n=0,Re(e.e,e.Cb,e.U)?(Re(e.e,e.Db,e.U)?(Re(e.e,e.Eb,e.U)?(i=e.Qc,e.Qc=e.Ic):i=e.Ic,e.Ic=e.Jc):i=e.Jc,e.Jc=e.ib,e.ib=i):Re(e.e,e.pb,(e.U<<4)+l)||(e.U=7>e.U?9:11,n=1),n||(n=H(e.sb,e.e,l)+2,e.U=7>e.U?8:11);else if(e.Qc=e.Ic,e.Ic=e.Jc,e.Jc=e.ib,n=2+H(e.Rb,e.e,l),e.U=7>e.U?7:10,(a=be(e.kb[U(n)],e.e))>=4){if(e.ib=(2|1&a)<<(s=(a>>1)-1),14>a)e.ib+=function(e,t,i,r){var n,o,s=1,a=0;for(o=0;r>o;++o)n=Re(i,e,t+s),s<<=1,s+=n,a|=n<<o;return a}(e.kc,e.ib-a-1,e.e,s);else if(e.ib+=function(e,t){var i,r,n=0;for(i=t;0!=i;--i)e.E>>>=1,e.Bb-=e.E&(r=e.Bb-e.E>>>31)-1,n=n<<1|1-r,-16777216&e.E||(e.Bb=e.Bb<<8|m(e.Ab),e.E<<=8);return n}(e.e,s-4)<<4,e.ib+=function(e,t){var i,r,n=1,o=0;for(r=0;e.F>r;++r)i=Re(t,e.G,n),n<<=1,n+=i,o|=i<<r;return o}(e.Fb,e.e),0>e.ib)return-1==e.ib?1:-1}else e.ib=a;if(o(c(e.ib),e.g)>=0||e.ib>=e.nb)return-1;(function(e,t,i){var r=e.o-t-1;for(0>r&&(r+=e.M);0!=i;--i)r>=e.M&&(r=0),e.Lb[e.o++]=e.Lb[r++],e.o>=e.M&&M(e)})(e.B,e.ib,n),e.g=r(e.g,c(n)),e.jc=L(e.B,0)}else t=function(e,t,i){return e.V[((t&e.qc)<<e.u)+((255&i)>>>8-e.u)]}(e.gb,u(e.g),e.jc),e.jc=7>e.U?function(e,t){var i=1;do{i=i<<1|Re(t,e.Ib,i)}while(256>i);return i<<24>>24}(t,e.e):function(e,t,i){var r,n,o=1;do{if(n=i>>7&1,i<<=1,r=Re(t,e.Ib,(1+n<<8)+o),o=o<<1|r,n!=r){for(;256>o;)o=o<<1|Re(t,e.Ib,o);break}}while(256>o);return o<<24>>24}(t,e.e,L(e.B,e.ib)),function(e,t){e.Lb[e.o++]=t,e.o>=e.M&&M(e)}(e.B,e.jc),e.U=B(e.U),e.g=r(e.g,Fe);return 0}(e.Z);if(-1==t)throw Error("corrupted input");e.Pb=qe,e.Pc=e.Z.g,(t||o(e.Z.Nc,He)>=0&&o(e.Z.g,e.Z.Nc)>=0)&&(M(e.Z.B),x(e.Z.B),e.Z.e.Ab=null,e.zc=0)}(e),e.zc}function q(e){e.B={},e.e={},e.Gb=i(192),e.Zb=i(12),e.Cb=i(12),e.Db=i(12),e.Eb=i(12),e.pb=i(192),e.kb=i(4),e.kc=i(114),e.Fb=ye({},4),e.Rb=F({}),e.sb=F({}),e.gb={};for(var t=0;4>t;++t)e.kb[t]=ye({},6);return e}function X(e,t){for(;t>e.O;++e.O)e.ec[e.O]=ye({},3),e.hc[e.O]=ye({},3)}function H(e,t,i){return Re(t,e.wc,0)?8+(Re(t,e.wc,1)?8+be(e.tc,t):be(e.hc[i],t)):be(e.ec[i],t)}function F(e){return e.wc=i(2),e.ec=i(16),e.hc=i(16),e.tc=ye({},8),e.O=0,e}function V(e){ke(e.wc);for(var t=0;e.O>t;++t)ke(e.ec[t].G),ke(e.hc[t].G);ke(e.tc.G)}function G(e,t,r){var n,o;if(null==e.V||e.u!=r||e.I!=t)for(e.I=t,e.qc=(1<<t)-1,e.u=r,e.V=i(o=1<<e.u+e.I),n=0;o>n;++n)e.V[n]=j({})}function j(e){return e.Ib=i(768),e}function Q(e,t){var i,r,n,o;e.jb=t,n=e.a[t].r,r=e.a[t].j;do{e.a[t].t&&(ge(e.a[n]),e.a[n].r=n-1,e.a[t].Ac&&(e.a[n-1].t=0,e.a[n-1].r=e.a[t].r2,e.a[n-1].j=e.a[t].j2)),i=r,r=e.a[o=n].j,n=e.a[o].r,e.a[o].j=i,e.a[o].r=t,t=o}while(t>0);return e.mb=e.a[0].j,e.q=e.a[0].r}function W(e){var t;for(e.v=i(4),e.a=[],e.d={},e.C=i(192),e.bb=i(12),e.hb=i(12),e.Ub=i(12),e.vc=i(12),e._=i(192),e.K=[],e.Sb=i(114),e.S=_e({},4),e.$=ce({}),e.i=ce({}),e.A={},e.m=[],e.P=[],e.lb=[],e.nc=i(16),e.x=i(4),e.Q=i(4),e.Xb=[He],e.uc=[He],e.Kc=[0],e.fc=i(5),e.yc=i(128),e.vb=0,e.X=1,e.D=0,e.Hb=-1,e.mb=0,t=0;4096>t;++t)e.a[t]={};for(t=0;4>t;++t)e.K[t]=_e({},6);return e}function Z(e){for(var t=0;16>t;++t)e.nc[t]=Ce(e.S,t);e.Qb=0}function K(e){var t,i,r,n,o,s,a,c;for(n=4;128>n;++n)s=ne(n),e.yc[n]=Ie(e.Sb,(t=(2|1&s)<<(r=(s>>1)-1))-s-1,r,n-t);for(o=0;4>o;++o){for(i=e.K[o],a=o<<6,s=0;e.$b>s;++s)e.P[a+s]=Te(i,s);for(s=14;e.$b>s;++s)e.P[a+s]+=(s>>1)-1-4<<6;for(c=128*o,n=0;4>n;++n)e.lb[c+n]=e.P[a+n];for(;128>n;++n)e.lb[c+n]=e.P[a+ne(n)]+e.yc[n]}e.Mb=0}function J(e,t){re(e),function(e,t){if(e.Gc){Pe(e.d,e.C,(e.l<<4)+t,1),Pe(e.d,e.bb,e.l,0),e.l=7>e.l?7:10,ae(e.$,e.d,0,t);var i=U(2);Se(e.K[i],e.d,63),Ae(e.d,67108863,26),Ee(e.S,e.d,15)}}(e,t&e.y);for(var i=0;5>i;++i)Ne(e.d)}function Y(e,t){var i,r,n,o,s,a,c,u,l,d,h,p,f,m,v,g,y,b,_,S,T,E,C,k,P,A,D,N,O,M,L,x,U,z,q,X,H,F,V,G,j,W,Z,K;if(e.jb!=e.q)return f=e.a[e.q].r-e.q,e.mb=e.a[e.q].j,e.q=e.a[e.q].r,f;if(e.q=e.jb=0,e.N?(p=e.vb,e.N=0):p=ie(e),A=e.D,2>(k=R(e.b)+1))return e.mb=-1,1;for(k>273&&(k=273),V=0,l=0;4>l;++l)e.x[l]=e.v[l],e.Q[l]=I(e.b,-1,e.x[l],273),e.Q[l]>e.Q[V]&&(V=l);if(e.Q[V]>=e.n)return e.mb=V,te(e,(f=e.Q[V])-1),f;if(p>=e.n)return e.mb=e.m[A-1]+4,te(e,p-1),p;if(c=w(e.b,-1),y=w(e.b,-e.v[0]-1-1),2>p&&c!=y&&2>e.Q[V])return e.mb=-1,1;if(e.a[0].Hc=e.l,e.a[1].z=je[e.C[(e.l<<4)+(U=t&e.y)]>>>2]+ve(he(e.A,t,e.J),e.l>=7,y,c),ge(e.a[1]),F=(b=je[2048-e.C[(e.l<<4)+U]>>>2])+je[2048-e.bb[e.l]>>>2],y==c&&(G=F+function(e,t,i){return je[e.hb[t]>>>2]+je[e._[(t<<4)+i]>>>2]}(e,e.l,U),e.a[1].z>G&&(e.a[1].z=G,function(e){e.j=0,e.t=0}(e.a[1]))),2>(h=p>=e.Q[V]?p:e.Q[V]))return e.mb=e.a[1].j,1;e.a[1].r=0,e.a[0].bc=e.x[0],e.a[0].ac=e.x[1],e.a[0].dc=e.x[2],e.a[0].lc=e.x[3],d=h;do{e.a[d--].z=268435455}while(d>=2);for(l=0;4>l;++l)if(!(2>(H=e.Q[l]))){q=F+ee(e,l,e.l,U);do{o=q+ue(e.i,H-2,U),(M=e.a[H]).z>o&&(M.z=o,M.r=0,M.j=l,M.t=0)}while(--H>=2)}if(C=b+je[e.bb[e.l]>>>2],p>=(d=e.Q[0]>=2?e.Q[0]+1:2)){for(D=0;d>e.m[D];)D+=2;for(;o=C+$(e,u=e.m[D+1],d,U),(M=e.a[d]).z>o&&(M.z=o,M.r=0,M.j=u+4,M.t=0),d!=e.m[D]||(D+=2)!=A;++d);}for(i=0;;){if(++i==h)return Q(e,i);if(_=ie(e),A=e.D,_>=e.n)return e.vb=_,e.N=1,Q(e,i);if(++t,x=e.a[i].r,e.a[i].t?(--x,e.a[i].Ac?(W=e.a[e.a[i].r2].Hc,W=4>e.a[i].j2?7>W?8:11:7>W?7:10):W=e.a[x].Hc,W=B(W)):W=e.a[x].Hc,x==i-1?W=e.a[i].j?B(W):7>W?9:11:(e.a[i].t&&e.a[i].Ac?(x=e.a[i].r2,L=e.a[i].j2,W=7>W?8:11):W=4>(L=e.a[i].j)?7>W?8:11:7>W?7:10,O=e.a[x],4>L?L?1==L?(e.x[0]=O.ac,e.x[1]=O.bc,e.x[2]=O.dc,e.x[3]=O.lc):2==L?(e.x[0]=O.dc,e.x[1]=O.bc,e.x[2]=O.ac,e.x[3]=O.lc):(e.x[0]=O.lc,e.x[1]=O.bc,e.x[2]=O.ac,e.x[3]=O.dc):(e.x[0]=O.bc,e.x[1]=O.ac,e.x[2]=O.dc,e.x[3]=O.lc):(e.x[0]=L-4,e.x[1]=O.bc,e.x[2]=O.ac,e.x[3]=O.dc)),e.a[i].Hc=W,e.a[i].bc=e.x[0],e.a[i].ac=e.x[1],e.a[i].dc=e.x[2],e.a[i].lc=e.x[3],a=e.a[i].z,c=w(e.b,-1),y=w(e.b,-e.x[0]-1-1),r=a+je[e.C[(W<<4)+(U=t&e.y)]>>>2]+ve(he(e.A,t,w(e.b,-2)),W>=7,y,c),S=0,(T=e.a[i+1]).z>r&&(T.z=r,T.r=i,T.j=-1,T.t=0,S=1),F=(b=a+je[2048-e.C[(W<<4)+U]>>>2])+je[2048-e.bb[W]>>>2],y!=c||i>T.r&&!T.j||T.z>=(G=F+(je[e.hb[W]>>>2]+je[e._[(W<<4)+U]>>>2]))&&(T.z=G,T.r=i,T.j=0,T.t=0,S=1),!(2>(k=P=(P=R(e.b)+1)>4095-i?4095-i:P))){if(k>e.n&&(k=e.n),!S&&y!=c&&(K=Math.min(P-1,e.n),(v=I(e.b,0,e.x[0],K))>=2)){for(Z=B(W),E=r+je[2048-e.C[(Z<<4)+(z=t+1&e.y)]>>>2]+je[2048-e.bb[Z]>>>2],N=i+1+v;N>h;)e.a[++h].z=268435455;o=E+(ue(e.i,v-2,z)+ee(e,0,Z,z)),(M=e.a[N]).z>o&&(M.z=o,M.r=i+1,M.j=0,M.t=1,M.Ac=0)}for(j=2,X=0;4>X;++X)if(!(2>(m=I(e.b,-1,e.x[X],k)))){g=m;do{for(;i+m>h;)e.a[++h].z=268435455;o=F+(ue(e.i,m-2,U)+ee(e,X,W,U)),(M=e.a[i+m]).z>o&&(M.z=o,M.r=i,M.j=X,M.t=0)}while(--m>=2);if(m=g,X||(j=m+1),P>m&&(K=Math.min(P-1-m,e.n),(v=I(e.b,m,e.x[X],K))>=2)){for(Z=7>W?8:11,z=t+m&e.y,n=F+(ue(e.i,m-2,U)+ee(e,X,W,U))+je[e.C[(Z<<4)+z]>>>2]+ve(he(e.A,t+m,w(e.b,m-1-1)),1,w(e.b,m-1-(e.x[X]+1)),w(e.b,m-1)),Z=B(Z),E=n+je[2048-e.C[(Z<<4)+(z=t+m+1&e.y)]>>>2]+je[2048-e.bb[Z]>>>2],N=m+1+v;i+N>h;)e.a[++h].z=268435455;o=E+(ue(e.i,v-2,z)+ee(e,0,Z,z)),(M=e.a[i+N]).z>o&&(M.z=o,M.r=i+m+1,M.j=0,M.t=1,M.Ac=1,M.r2=i,M.j2=X)}}if(_>k){for(_=k,A=0;_>e.m[A];A+=2);e.m[A]=_,A+=2}if(_>=j){for(C=b+je[e.bb[W]>>>2];i+_>h;)e.a[++h].z=268435455;for(D=0;j>e.m[D];)D+=2;for(m=j;;++m)if(o=C+$(e,s=e.m[D+1],m,U),(M=e.a[i+m]).z>o&&(M.z=o,M.r=i,M.j=s+4,M.t=0),m==e.m[D]){if(P>m&&(K=Math.min(P-1-m,e.n),(v=I(e.b,m,s,K))>=2)){for(n=o+je[e.C[((Z=7>W?7:10)<<4)+(z=t+m&e.y)]>>>2]+ve(he(e.A,t+m,w(e.b,m-1-1)),1,w(e.b,m-(s+1)-1),w(e.b,m-1)),Z=B(Z),E=n+je[2048-e.C[(Z<<4)+(z=t+m+1&e.y)]>>>2]+je[2048-e.bb[Z]>>>2],N=m+1+v;i+N>h;)e.a[++h].z=268435455;o=E+(ue(e.i,v-2,z)+ee(e,0,Z,z)),(M=e.a[i+N]).z>o&&(M.z=o,M.r=i+m+1,M.j=0,M.t=1,M.Ac=1,M.r2=i,M.j2=s+4)}if((D+=2)==A)break}}}}}function $(e,t,i,r){var n=U(i);return(128>t?e.lb[128*n+t]:e.P[(n<<6)+function(e){return 131072>e?Ge[e>>6]+12:134217728>e?Ge[e>>16]+32:Ge[e>>26]+52}(t)]+e.nc[15&t])+ue(e.$,i-2,r)}function ee(e,t,i,r){var n;return t?(n=je[2048-e.hb[i]>>>2],1==t?n+=je[e.Ub[i]>>>2]:(n+=je[2048-e.Ub[i]>>>2],n+=Oe(e.vc[i],t-2))):(n=je[e.hb[i]>>>2],n+=je[2048-e._[(i<<4)+r]>>>2]),n}function te(e,t){t>0&&(function(e,t){var i,r,n,o,s,a,c,u,l,d,h,p,f,m,v;do{if(e.h>=e.o+e.ob)d=e.ob;else if(e.xb>(d=e.h-e.o)){D(e);continue}for(h=e.o>e.p?e.o-e.p:0,r=e.f+e.o,e.qb?(e.ub[1023&(v=Ve[255&e.c[r]]^255&e.c[r+1])]=e.o,e.ub[1024+(65535&(v^=(255&e.c[r+2])<<8))]=e.o,a=(v^Ve[255&e.c[r+3]]<<5)&e.Ec):a=255&e.c[r]^(255&e.c[r+1])<<8,n=e.ub[e.R+a],e.ub[e.R+a]=e.o,f=1+(e.k<<1),m=e.k<<1,u=l=e.w,i=e.Fc;;){if(h>=n||0==i--){e.L[f]=e.L[m]=0;break}if(o=(e.k>=(s=e.o-n)?e.k-s:e.k-s+e.p)<<1,e.c[(p=e.f+n)+(c=l>u?u:l)]==e.c[r+c]){for(;++c!=d&&e.c[p+c]==e.c[r+c];);if(c==d){e.L[m]=e.L[o],e.L[f]=e.L[o+1];break}}(255&e.c[r+c])>(255&e.c[p+c])?(e.L[m]=n,n=e.L[m=o+1],l=c):(e.L[f]=n,n=e.L[f=o],u=c)}D(e)}while(0!=--t)}(e.b,t),e.s+=t)}function ie(e){var t=0;return e.D=function(e,t){var i,r,n,o,s,a,c,u,l,d,h,p,f,m,v,g,y,b,_,S,T;if(e.h>=e.o+e.ob)m=e.ob;else if(e.xb>(m=e.h-e.o))return D(e),0;for(y=0,v=e.o>e.p?e.o-e.p:0,r=e.f+e.o,g=1,u=0,l=0,e.qb?(u=1023&(T=Ve[255&e.c[r]]^255&e.c[r+1]),l=65535&(T^=(255&e.c[r+2])<<8),d=(T^Ve[255&e.c[r+3]]<<5)&e.Ec):d=255&e.c[r]^(255&e.c[r+1])<<8,n=e.ub[e.R+d]||0,e.qb&&(o=e.ub[u]||0,s=e.ub[1024+l]||0,e.ub[u]=e.o,e.ub[1024+l]=e.o,o>v&&e.c[e.f+o]==e.c[r]&&(t[y++]=g=2,t[y++]=e.o-o-1),s>v&&e.c[e.f+s]==e.c[r]&&(s==o&&(y-=2),t[y++]=g=3,t[y++]=e.o-s-1,o=s),0!=y&&o==n&&(y-=2,g=1)),e.ub[e.R+d]=e.o,_=1+(e.k<<1),S=e.k<<1,p=f=e.w,0!=e.w&&n>v&&e.c[e.f+n+e.w]!=e.c[r+e.w]&&(t[y++]=g=e.w,t[y++]=e.o-n-1),i=e.Fc;;){if(v>=n||0==i--){e.L[_]=e.L[S]=0;break}if(a=(e.k>=(c=e.o-n)?e.k-c:e.k-c+e.p)<<1,e.c[(b=e.f+n)+(h=f>p?p:f)]==e.c[r+h]){for(;++h!=m&&e.c[b+h]==e.c[r+h];);if(h>g&&(t[y++]=g=h,t[y++]=c-1,h==m)){e.L[S]=e.L[a],e.L[_]=e.L[a+1];break}}(255&e.c[r+h])>(255&e.c[b+h])?(e.L[S]=n,n=e.L[S=a+1],f=h):(e.L[_]=n,n=e.L[_=a],p=h)}return D(e),y}(e.b,e.m),e.D>0&&(t=e.m[e.D-2])==e.n&&(t+=I(e.b,t-1,e.m[e.D-1],273-t)),++e.s,t}function re(e){e.b&&e.W&&(e.b.cc=null,e.W=0)}function ne(e){return 2048>e?Ge[e]:2097152>e?Ge[e>>10]+20:Ge[e>>20]+40}function oe(e,t){ke(e.db);for(var i=0;t>i;++i)ke(e.Vb[i].G),ke(e.Wb[i].G);ke(e.ic.G)}function se(e,t,i,r,n){var o,s,a,c,u;for(o=je[e.db[0]>>>2],a=(s=je[2048-e.db[0]>>>2])+je[e.db[1]>>>2],c=s+je[2048-e.db[1]>>>2],u=0,u=0;8>u;++u){if(u>=i)return;r[n+u]=o+Te(e.Vb[t],u)}for(;16>u;++u){if(u>=i)return;r[n+u]=a+Te(e.Wb[t],u-8)}for(;i>u;++u)r[n+u]=c+Te(e.ic,u-8-8)}function ae(e,t,i,r){(function(e,t,i,r){8>i?(Pe(t,e.db,0,0),Se(e.Vb[r],t,i)):(i-=8,Pe(t,e.db,0,1),8>i?(Pe(t,e.db,1,0),Se(e.Wb[r],t,i)):(Pe(t,e.db,1,1),Se(e.ic,t,i-8)))})(e,t,i,r),0==--e.sc[r]&&(se(e,r,e.rb,e.Cc,272*r),e.sc[r]=e.rb)}function ce(e){return function(e){e.db=i(2),e.Vb=i(16),e.Wb=i(16),e.ic=_e({},8);for(var t=0;16>t;++t)e.Vb[t]=_e({},3),e.Wb[t]=_e({},3)}(e),e.Cc=[],e.sc=[],e}function ue(e,t,i){return e.Cc[272*i+t]}function le(e,t){for(var i=0;t>i;++i)se(e,i,e.rb,e.Cc,272*i),e.sc[i]=e.rb}function de(e,t,r){var n,o;if(null==e.V||e.u!=r||e.I!=t)for(e.I=t,e.qc=(1<<t)-1,e.u=r,e.V=i(o=1<<e.u+e.I),n=0;o>n;++n)e.V[n]=me({})}function he(e,t,i){return e.V[((t&e.qc)<<e.u)+((255&i)>>>8-e.u)]}function pe(e,t,i){var r,n,o=1;for(n=7;n>=0;--n)Pe(t,e.tb,o,r=i>>n&1),o=o<<1|r}function fe(e,t,i,r){var n,o,s,a,c=1,u=1;for(o=7;o>=0;--o)n=r>>o&1,a=u,c&&(a+=1+(s=i>>o&1)<<8,c=s==n),Pe(t,e.tb,a,n),u=u<<1|n}function me(e){return e.tb=i(768),e}function ve(e,t,i,r){var n,o,s=1,a=7,c=0;if(t)for(;a>=0;--a)if(c+=Oe(e.tb[(1+(o=i>>a&1)<<8)+s],n=r>>a&1),s=s<<1|n,o!=n){--a;break}for(;a>=0;--a)c+=Oe(e.tb[s],n=r>>a&1),s=s<<1|n;return c}function ge(e){e.j=-1,e.t=0}function ye(e,t){return e.F=t,e.G=i(1<<t),e}function be(e,t){var i,r=1;for(i=e.F;0!=i;--i)r=(r<<1)+Re(t,e.G,r);return r-(1<<e.F)}function _e(e,t){return e.F=t,e.G=i(1<<t),e}function Se(e,t,i){var r,n,o=1;for(n=e.F;0!=n;)--n,Pe(t,e.G,o,r=i>>>n&1),o=o<<1|r}function Te(e,t){var i,r,n=1,o=0;for(r=e.F;0!=r;)--r,o+=Oe(e.G[n],i=t>>>r&1),n=(n<<1)+i;return o}function Ee(e,t,i){var r,n,o=1;for(n=0;e.F>n;++n)Pe(t,e.G,o,r=1&i),o=o<<1|r,i>>=1}function Ce(e,t){var i,r,n=1,o=0;for(r=e.F;0!=r;--r)i=1&t,t>>>=1,o+=Oe(e.G[n],i),n=n<<1|i;return o}function we(e,t,i,r,n){var o,s,a=1;for(s=0;r>s;++s)Pe(i,e,t+a,o=1&n),a=a<<1|o,n>>=1}function Ie(e,t,i,r){var n,o,s=1,a=0;for(o=i;0!=o;--o)n=1&r,r>>>=1,a+=je[(2047&(e[t+s]-n^-n))>>>2],s=s<<1|n;return a}function Re(e,t,i){var r,n=t[i];return(-2147483648^(r=(e.E>>>11)*n))>(-2147483648^e.Bb)?(e.E=r,t[i]=n+(2048-n>>>5)<<16>>16,-16777216&e.E||(e.Bb=e.Bb<<8|m(e.Ab),e.E<<=8),0):(e.E-=r,e.Bb-=r,t[i]=n-(n>>>5)<<16>>16,-16777216&e.E||(e.Bb=e.Bb<<8|m(e.Ab),e.E<<=8),1)}function ke(e){for(var t=e.length-1;t>=0;--t)e[t]=1024}function Pe(e,t,i,o){var s,a=t[i];s=(e.E>>>11)*a,o?(e.xc=r(e.xc,n(c(s),[4294967295,0])),e.E-=s,t[i]=a-(a>>>5)<<16>>16):(e.E=s,t[i]=a+(2048-a>>>5)<<16>>16),-16777216&e.E||(e.E<<=8,Ne(e))}function Ae(e,t,i){for(var n=i-1;n>=0;--n)e.E>>>=1,1==(t>>>n&1)&&(e.xc=r(e.xc,c(e.E))),-16777216&e.E||(e.E<<=8,Ne(e))}function De(e){return r(r(c(e.Jb),e.mc),[4,0])}function Ne(e){var t,i=u(function(e,t){var i;return i=h(e,t&=63),0>e[1]&&(i=r(i,d([2,0],31))),i}(e.xc,32));if(0!=i||o(e.xc,[4278190080,0])<0){e.mc=r(e.mc,c(e.Jb)),t=e.Oc;do{b(e.Ab,t+i),t=255}while(0!=--e.Jb);e.Oc=u(e.xc)>>>24}++e.Jb,e.xc=d(n(e.xc,[16777215,0]),8)}function Oe(e,t){return je[(2047&(e-t^-t))>>>2]}function Me(e){for(var t,i,r,n=0,o=0,s=e.length,a=[],c=[];s>n;++n,++o){if(128&(t=255&e[n]))if(192==(224&t)){if(n+1>=s)return e;if(128!=(192&(i=255&e[++n])))return e;c[o]=(31&t)<<6|63&i}else{if(224!=(240&t))return e;if(n+2>=s)return e;if(128!=(192&(i=255&e[++n])))return e;if(128!=(192&(r=255&e[++n])))return e;c[o]=(15&t)<<12|(63&i)<<6|63&r}else{if(!t)return e;c[o]=t}16383==o&&(a.push(String.fromCharCode.apply(String,c)),o=-1)}return o>0&&(c.length=o,a.push(String.fromCharCode.apply(String,c))),a.join("")}function Le(e){var t,i,r,n=[],o=0,s=e.length;if("object"==_typeof(e))return e;for(function(e,t,i,r,n){var o;for(o=0;i>o;++o)r[n++]=e.charCodeAt(o)}(e,0,s,n,0),r=0;s>r;++r)(t=n[r])>=1&&127>=t?++o:o+=!t||t>=128&&2047>=t?2:3;for(i=[],o=0,r=0;s>r;++r)(t=n[r])>=1&&127>=t?i[o++]=t<<24>>24:!t||t>=128&&2047>=t?(i[o++]=(192|t>>6&31)<<24>>24,i[o++]=(128|63&t)<<24>>24):(i[o++]=(224|t>>12&15)<<24>>24,i[o++]=(128|t>>6&63)<<24>>24,i[o++]=(128|63&t)<<24>>24);return i}function xe(e){return e[1]+e[0]}var Ue=3,Be="function"==typeof setImmediate?setImmediate:setTimeout,ze=4294967296,qe=[4294967295,-ze],Xe=[0,-0x8000000000000000],He=[0,0],Fe=[1,0],Ve=function(){var e,t,i,r=[];for(e=0;256>e;++e){for(i=e,t=0;8>t;++t)1&i?i=i>>>1^-306674912:i>>>=1;r[e]=i}return r}(),Ge=function(){var e,t,i,r=2,n=[0,1];for(i=2;22>i;++i)for(t=1<<(i>>1)-1,e=0;t>e;++e,++r)n[r]=i<<24>>24;return n}(),je=function(){var e,t,i,r=[];for(t=8;t>=0;--t)for(e=1<<9-t,i=1<<9-t-1;e>i;++i)r[i]=(t<<6)+(e-i<<6>>>9-t-1);return r}(),Qe=function(){var e=[{s:16,f:64,m:0},{s:20,f:64,m:0},{s:19,f:64,m:1},{s:20,f:64,m:1},{s:21,f:128,m:1},{s:22,f:128,m:1},{s:23,f:128,m:1},{s:24,f:255,m:1},{s:25,f:255,m:1}];return function(t){return e[t-1]||e[6]}}();return"undefined"==typeof onmessage||"undefined"!=typeof window&&void 0!==window.document||(onmessage=function(t){t&&t.gc&&(2==t.gc.action?e.decompress(t.gc.gc,t.gc.cbn):1==t.gc.action&&e.compress(t.gc.gc,t.gc.Rc,t.gc.cbn))}),{compress:function(e,i,r,n){var o,s,a={},c=void 0===r&&void 0===n;if("function"!=typeof r&&(s=r,r=n=0),n=n||function(e){return void 0!==s?t(e,s):void 0},r=r||function(e,t){return void 0!==s?postMessage({action:1,cbn:s,result:e,error:t}):void 0},c){for(a.c=E({},Le(e),Qe(i));z(a.c.yb););return y(a.c.Nb)}try{a.c=E({},Le(e),Qe(i)),n(0)}catch(e){return r(null,e)}Be((function e(){try{for(var t,i=(new Date).getTime();z(a.c.yb);)if(o=xe(a.c.yb.Pb)/xe(a.c.Tb),(new Date).getTime()-i>200)return n(o),Be(e,0),0;n(1),t=y(a.c.Nb),Be(r.bind(null,t),0)}catch(e){r(null,e)}}),0)},decompress:function(e,i,r){var n,o,s,a,c={},u=void 0===i&&void 0===r;if("function"!=typeof i&&(o=i,i=r=0),r=r||function(e){return void 0!==o?t(s?e:-1,o):void 0},i=i||function(e,t){return void 0!==o?postMessage({action:2,cbn:o,result:e,error:t}):void 0},u){for(c.d=C({},e);z(c.d.yb););return Me(y(c.d.Nb))}try{c.d=C({},e),a=xe(c.d.Tb),s=a>-1,r(0)}catch(e){return i(null,e)}Be((function e(){try{for(var t,o=0,u=(new Date).getTime();z(c.d.yb);)if(++o%1e3==0&&(new Date).getTime()-u>200)return s&&(n=xe(c.d.yb.Z.g)/a,r(n)),Be(e,0),0;r(1),t=Me(y(c.d.Nb)),Be(i.bind(null,t),0)}catch(e){i(null,e)}}),0)}}}();this.G=e},5515:function(e){e.exports=function(){return function e(t,i,r){function n(s,a){if(!i[s]){if(!t[s]){if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[s]={exports:{}};t[s][0].call(u.exports,(function(e){return n(t[s][1][e]||e)}),u,u.exports,e,t,i,r)}return i[s].exports}for(var o=void 0,s=0;s<r.length;s++)n(r[s]);return n}}()({1:[function(e,t,i){"use strict";var r=(0,e("./adapter_factory.js").adapterFactory)({window:window});t.exports=r},{"./adapter_factory.js":2}],2:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.adapterFactory=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).window,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0},i=r.log,u=r.detectBrowser(e),l={browserDetails:u,commonShim:c,extractVersion:r.extractVersion,disableLog:r.disableLog,disableWarnings:r.disableWarnings};switch(u.browser){case"chrome":if(!n||!n.shimPeerConnection||!t.shimChrome)return i("Chrome shim is not included in this adapter release."),l;i("adapter.js shimming chrome."),l.browserShim=n,n.shimGetUserMedia(e),n.shimMediaStream(e),n.shimPeerConnection(e),n.shimOnTrack(e),n.shimAddTrackRemoveTrack(e),n.shimGetSendersWithDtmf(e),n.shimGetStats(e),n.shimSenderReceiverGetStats(e),n.fixNegotiationNeeded(e),c.shimRTCIceCandidate(e),c.shimConnectionState(e),c.shimMaxMessageSize(e),c.shimSendThrowTypeError(e),c.removeAllowExtmapMixed(e);break;case"firefox":if(!s||!s.shimPeerConnection||!t.shimFirefox)return i("Firefox shim is not included in this adapter release."),l;i("adapter.js shimming firefox."),l.browserShim=s,s.shimGetUserMedia(e),s.shimPeerConnection(e),s.shimOnTrack(e),s.shimRemoveStream(e),s.shimSenderGetStats(e),s.shimReceiverGetStats(e),s.shimRTCDataChannel(e),c.shimRTCIceCandidate(e),c.shimConnectionState(e),c.shimMaxMessageSize(e),c.shimSendThrowTypeError(e);break;case"edge":if(!o||!o.shimPeerConnection||!t.shimEdge)return i("MS edge shim is not included in this adapter release."),l;i("adapter.js shimming edge."),l.browserShim=o,o.shimGetUserMedia(e),o.shimGetDisplayMedia(e),o.shimPeerConnection(e),o.shimReplaceTrack(e),c.shimMaxMessageSize(e),c.shimSendThrowTypeError(e);break;case"safari":if(!a||!t.shimSafari)return i("Safari shim is not included in this adapter release."),l;i("adapter.js shimming safari."),l.browserShim=a,a.shimRTCIceServerUrls(e),a.shimCreateOfferLegacy(e),a.shimCallbacksAPI(e),a.shimLocalStreamsAPI(e),a.shimRemoteStreamsAPI(e),a.shimTrackEventTransceiver(e),a.shimGetUserMedia(e),c.shimRTCIceCandidate(e),c.shimMaxMessageSize(e),c.shimSendThrowTypeError(e),c.removeAllowExtmapMixed(e);break;default:i("Unsupported browser!")}return l};var r=u(e("./utils")),n=u(e("./chrome/chrome_shim")),o=u(e("./edge/edge_shim")),s=u(e("./firefox/firefox_shim")),a=u(e("./safari/safari_shim")),c=u(e("./common_shim"));function u(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}},{"./chrome/chrome_shim":3,"./common_shim":6,"./edge/edge_shim":7,"./firefox/firefox_shim":11,"./safari/safari_shim":14,"./utils":15}],3:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.shimGetDisplayMedia=i.shimGetUserMedia=void 0;var r="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return _typeof(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof(e)},n=e("./getusermedia");Object.defineProperty(i,"shimGetUserMedia",{enumerable:!0,get:function(){return n.shimGetUserMedia}});var o=e("./getdisplaymedia");Object.defineProperty(i,"shimGetDisplayMedia",{enumerable:!0,get:function(){return o.shimGetDisplayMedia}}),i.shimMediaStream=function(e){e.MediaStream=e.MediaStream||e.webkitMediaStream},i.shimOnTrack=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var i=this;return this._ontrackpoly||(this._ontrackpoly=function(t){t.stream.addEventListener("addtrack",(function(r){var n;n=e.RTCPeerConnection.prototype.getReceivers?i.getReceivers().find((function(e){return e.track&&e.track.id===r.track.id})):{track:r.track};var o=new Event("track");o.track=r.track,o.receiver=n,o.transceiver={receiver:n},o.streams=[t.stream],i.dispatchEvent(o)})),t.stream.getTracks().forEach((function(r){var n;n=e.RTCPeerConnection.prototype.getReceivers?i.getReceivers().find((function(e){return e.track&&e.track.id===r.id})):{track:r};var o=new Event("track");o.track=r,o.receiver=n,o.transceiver={receiver:n},o.streams=[t.stream],i.dispatchEvent(o)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else s.wrapPeerConnectionEvent(e,"track",(function(e){return e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e}))},i.shimGetSendersWithDtmf=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&(this._dtmf="audio"===t.kind?e.createDTMFSender(t):null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var i=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){var n=i.apply(this,arguments);return n||(n=t(this,e),this._senders.push(n)),n};var n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){n.apply(this,arguments);var t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}var o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var i=this;this._senders=this._senders||[],o.apply(this,[e]),e.getTracks().forEach((function(e){i._senders.push(t(i,e))}))};var s=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._senders=this._senders||[],s.apply(this,[e]),e.getTracks().forEach((function(e){var i=t._senders.find((function(t){return t.track===e}));i&&t._senders.splice(t._senders.indexOf(i),1)}))}}else if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var a=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=a.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&(this._dtmf="audio"===this.track.kind?this._pc.createDTMFSender(this.track):null),this._dtmf}})}},i.shimGetStats=function(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(e,i,r){var n=this,o=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof arguments[0]))return t.apply(this,[]);var s=function(e){var t={};return e.result().forEach((function(e){var i={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((function(t){i[t]=e.stat(t)})),t[i.id]=i})),t},a=function(e){return new Map(Object.keys(e).map((function(t){return[t,e[t]]})))};return arguments.length>=2?t.apply(this,[function(e){o[1](a(s(e)))},arguments[0]]):new Promise((function(e,i){t.apply(n,[function(t){e(a(s(t)))},i])})).then(i,r)}}},i.shimSenderReceiverGetStats=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver){if(!("getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,i=t.apply(this,[]);return i.forEach((function(t){return t._pc=e})),i});var i=e.RTCPeerConnection.prototype.addTrack;i&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=i.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return s.filterStats(t,e.track,!0)}))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var n=e.RTCPeerConnection.prototype.getReceivers;n&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=n.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t}),s.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return s.filterStats(t,e.track,!1)}))}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var o=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){var t=arguments[0],i=void 0,r=void 0,n=void 0;return this.getSenders().forEach((function(e){e.track===t&&(i?n=!0:i=e)})),this.getReceivers().forEach((function(e){return e.track===t&&(r?n=!0:r=e),e.track===t})),n||i&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return o.apply(this,arguments)}}}},i.shimAddTrackRemoveTrackWithNative=a,i.shimAddTrackRemoveTrack=function(e){if(e.RTCPeerConnection){var t=s.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return a(e);var i=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=i.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map((function(t){return e._reverseStreams[t.id]}))};var r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var i=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((function(e){if(i.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){var n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}r.apply(this,[t])};var n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},n.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,i){var r=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var n=[].slice.call(arguments,1);if(1!==n.length||!n[0].getTracks().find((function(e){return e===t})))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find((function(e){return e.track===t})))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var o=this._streams[i.id];if(o)o.addTrack(t),Promise.resolve().then((function(){r.dispatchEvent(new Event("negotiationneeded"))}));else{var s=new e.MediaStream([t]);this._streams[i.id]=s,this._reverseStreams[s.id]=i,this.addStream(s)}return this.getSenders().find((function(e){return e.track===t}))},["createOffer","createAnswer"].forEach((function(t){var i=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){var e=this,t=arguments;return arguments.length&&"function"==typeof arguments[0]?i.apply(this,[function(i){var r=u(e,i);t[0].apply(null,[r])},function(e){t[1]&&t[1].apply(null,e)},arguments[2]]):i.apply(this,arguments).then((function(t){return u(e,t)}))}}));var o=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=l(this,arguments[0]),o.apply(this,arguments)):o.apply(this,arguments)};var c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=c.get.apply(this);return""===e.type?e:u(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};var i=void 0;Object.keys(this._streams).forEach((function(r){t._streams[r].getTracks().find((function(t){return e.track===t}))&&(i=t._streams[r])})),i&&(1===i.getTracks().length?this.removeStream(this._reverseStreams[i.id]):i.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function u(e,t){var i=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var r=e._reverseStreams[t];i=i.replace(new RegExp(e._streams[r.id].id,"g"),r.id)})),new RTCSessionDescription({type:t.type,sdp:i})}function l(e,t){var i=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var r=e._reverseStreams[t],n=e._streams[r.id];i=i.replace(new RegExp(r.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:i})}},i.shimPeerConnection=function(e){if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection){["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var i=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),i.apply(this,arguments)}}));var t=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}},i.fixNegotiationNeeded=function(e){s.wrapPeerConnectionEvent(e,"negotiationneeded",(function(e){if("stable"===e.target.signalingState)return e}))};var s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(e("../utils.js"));function a(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((function(t){return e._shimmedLocalStreams[t][0]}))};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,i){if(!i)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var r=t.apply(this,arguments);return this._shimmedLocalStreams[i.id]?-1===this._shimmedLocalStreams[i.id].indexOf(r)&&this._shimmedLocalStreams[i.id].push(r):this._shimmedLocalStreams[i.id]=[i,r],r};var i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((function(e){if(t.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")}));var r=this.getSenders();i.apply(this,arguments);var n=this.getSenders().filter((function(e){return-1===r.indexOf(e)}));this._shimmedLocalStreams[e.id]=[e].concat(n)};var r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};var n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((function(i){var r=t._shimmedLocalStreams[i].indexOf(e);-1!==r&&t._shimmedLocalStreams[i].splice(r,1),1===t._shimmedLocalStreams[i].length&&delete t._shimmedLocalStreams[i]})),n.apply(this,arguments)}}},{"../utils.js":15,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.shimGetDisplayMedia=function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(i){return t(i).then((function(t){var r=i.video&&i.video.width,n=i.video&&i.video.height;return i.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:i.video&&i.video.frameRate||3}},r&&(i.video.mandatory.maxWidth=r),n&&(i.video.mandatory.maxHeight=n),e.navigator.mediaDevices.getUserMedia(i)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}},{}],5:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return _typeof(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof(e)};i.shimGetUserMedia=function(e){var t=e&&e.navigator;if(t.mediaDevices){var i=n.detectBrowser(e),s=function(e){if("object"!==(void 0===e?"undefined":r(e))||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach((function(i){if("require"!==i&&"advanced"!==i&&"mediaSource"!==i){var n="object"===r(e[i])?e[i]:{ideal:e[i]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);var o=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==n.ideal){t.optional=t.optional||[];var s={};"number"==typeof n.ideal?(s[o("min",i)]=n.ideal,t.optional.push(s),(s={})[o("max",i)]=n.ideal,t.optional.push(s)):(s[o("",i)]=n.ideal,t.optional.push(s))}void 0!==n.exact&&"number"!=typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[o("",i)]=n.exact):["min","max"].forEach((function(e){void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[o(e,i)]=n[e])}))}})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},a=function(e,n){if(i.version>=61)return n(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"===r(e.audio)){var a=function(e,t,i){t in e&&!(i in e)&&(e[i]=e[t],delete e[t])};a((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),a(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=s(e.audio)}if(e&&"object"===r(e.video)){var c=e.video.facingMode;c=c&&("object"===(void 0===c?"undefined":r(c))?c:{ideal:c});var u=i.version<66;if(c&&("user"===c.exact||"environment"===c.exact||"user"===c.ideal||"environment"===c.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||u)){delete e.video.facingMode;var l=void 0;if("environment"===c.exact||"environment"===c.ideal?l=["back","rear"]:"user"!==c.exact&&"user"!==c.ideal||(l=["front"]),l)return t.mediaDevices.enumerateDevices().then((function(t){var i=(t=t.filter((function(e){return"videoinput"===e.kind}))).find((function(e){return l.some((function(t){return e.label.toLowerCase().includes(t)}))}));return!i&&t.length&&l.includes("back")&&(i=t[t.length-1]),i&&(e.video.deviceId=c.exact?{exact:i.deviceId}:{ideal:i.deviceId}),e.video=s(e.video),o("chrome: "+JSON.stringify(e)),n(e)}))}e.video=s(e.video)}return o("chrome: "+JSON.stringify(e)),n(e)},c=function(e){return i.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};if(t.getUserMedia=function(e,i,r){a(e,(function(e){t.webkitGetUserMedia(e,i,(function(e){r&&r(c(e))}))}))}.bind(t),t.mediaDevices.getUserMedia){var u=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return a(e,(function(e){return u(e).then((function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((function(e){e.stop()})),new DOMException("","NotFoundError");return t}),(function(e){return Promise.reject(c(e))}))}))}}}};var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(e("../utils.js"));var o=n.log},{"../utils.js":15}],6:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return _typeof(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof(e)};i.shimRTCIceCandidate=function(e){if(!(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)){var t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){var i=new t(e),o=n.default.parseCandidate(e.candidate),s=Object.assign(i,o);return s.toJSON=function(){return{candidate:s.candidate,sdpMid:s.sdpMid,sdpMLineIndex:s.sdpMLineIndex,usernameFragment:s.usernameFragment}},s}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,o.wrapPeerConnectionEvent(e,"icecandidate",(function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t}))}},i.shimMaxMessageSize=function(e){if(!e.RTCSctpTransport&&e.RTCPeerConnection){var t=o.detectBrowser(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var i=function(e){if(!e||!e.sdp)return!1;var t=n.default.splitSections(e.sdp);return t.shift(),t.some((function(e){var t=n.default.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},r=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var i=parseInt(t[1],10);return i!=i?-1:i},s=function(e){var i=65536;return"firefox"===t.browser&&(i=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),i},a=function(e,i){var r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);var o=n.default.matchPrefix(e.sdp,"a=max-message-size:");return o.length>0?r=parseInt(o[0].substr(19),10):"firefox"===t.browser&&-1!==i&&(r=2147483637),r},c=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,i(arguments[0])){var e=r(arguments[0]),t=s(e),n=a(arguments[0],e),o=void 0;o=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);var u={};Object.defineProperty(u,"maxMessageSize",{get:function(){return o}}),this._sctp=u}return c.apply(this,arguments)}}},i.shimSendThrowTypeError=function(e){if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var t=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=t.apply(this,arguments);return i(e,this),e},o.wrapPeerConnectionEvent(e,"datachannel",(function(e){return i(e.channel,e.target),e}))}function i(e,t){var i=e.send;e.send=function(){var r=arguments[0];if("open"===e.readyState&&t.sctp&&(r.length||r.size||r.byteLength)>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return i.apply(e,arguments)}}},i.shimConnectionState=function(e){if(e.RTCPeerConnection&&!("connectionState"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((function(e){var i=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(e){var t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;var i=new Event("connectionstatechange",e);t.dispatchEvent(i)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),i.apply(this,arguments)}}))}},i.removeAllowExtmapMixed=function(e){if(e.RTCPeerConnection){var t=o.detectBrowser(e);if(!("chrome"===t.browser&&t.version>=71)){var i=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(e){return e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")&&(e.sdp=e.sdp.split("\n").filter((function(e){return"a=extmap-allow-mixed"!==e.trim()})).join("\n")),i.apply(this,arguments)}}}};var n=function(e){return e&&e.__esModule?e:{default:e}}(e("sdp")),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(e("./utils"))},{"./utils":15,sdp:17}],7:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.shimGetDisplayMedia=i.shimGetUserMedia=void 0;var r=e("./getusermedia");Object.defineProperty(i,"shimGetUserMedia",{enumerable:!0,get:function(){return r.shimGetUserMedia}});var n=e("./getdisplaymedia");Object.defineProperty(i,"shimGetDisplayMedia",{enumerable:!0,get:function(){return n.shimGetDisplayMedia}}),i.shimPeerConnection=function(e){var t=o.detectBrowser(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var i=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){i.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);var r=(0,a.default)(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=(0,s.filterIceServers)(e.iceServers,t.version),o.log("ICE servers after filtering:",e.iceServers)),new r(e)},e.RTCPeerConnection.prototype=r.prototype},i.shimReplaceTrack=function(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)};var o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(e("../utils")),s=e("./filtericeservers"),a=function(e){return e&&e.__esModule?e:{default:e}}(e("rtcpeerconnection-shim"))},{"../utils":15,"./filtericeservers":8,"./getdisplaymedia":9,"./getusermedia":10,"rtcpeerconnection-shim":16}],8:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.filterIceServers=function(e,t){var i=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var t=e.urls||e.url;e.url&&!e.urls&&r.deprecated("RTCIceServer.url","RTCIceServer.urls");var n="string"==typeof t;return n&&(t=[t]),t=t.filter((function(e){if(0===e.indexOf("stun:"))return!1;var t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!i?(i=!0,!0):t&&!i})),delete e.url,e.urls=n?t[0]:t,!!t.length}}))};var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(e("../utils"))},{"../utils":15}],9:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.shimGetDisplayMedia=function(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}},{}],10:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.shimGetUserMedia=function(e){var t=e&&e.navigator,i=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return i(e).catch((function(e){return Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}}(e))}))}}},{}],11:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.shimGetDisplayMedia=i.shimGetUserMedia=void 0;var r="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return _typeof(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof(e)},n=e("./getusermedia");Object.defineProperty(i,"shimGetUserMedia",{enumerable:!0,get:function(){return n.shimGetUserMedia}});var o=e("./getdisplaymedia");Object.defineProperty(i,"shimGetDisplayMedia",{enumerable:!0,get:function(){return o.shimGetDisplayMedia}}),i.shimOnTrack=function(e){"object"===(void 0===e?"undefined":r(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},i.shimPeerConnection=function(e){var t=s.detectBrowser(e);if("object"===(void 0===e?"undefined":r(e))&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var i=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),i.apply(this,arguments)}}));var i=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?i.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())};var n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},o=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(e,i,r){return o.apply(this,[e||null]).then((function(e){if(t.version<53&&!i)try{e.forEach((function(e){e.type=n[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach((function(t,i){e.set(i,Object.assign({},t,{type:n[t.type]||t.type}))}))}return e})).then(i,r)}}},i.shimSenderGetStats=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpSender.prototype))){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,i=t.apply(this,[]);return i.forEach((function(t){return t._pc=e})),i});var i=e.RTCPeerConnection.prototype.addTrack;i&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=i.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}},i.shimReceiverGetStats=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpReceiver.prototype))){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,i=t.apply(this,[]);return i.forEach((function(t){return t._pc=e})),i}),s.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}},i.shimRemoveStream=function(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;s.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(i){i.track&&e.getTracks().includes(i.track)&&t.removeTrack(i)}))})},i.shimRTCDataChannel=function(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)};var s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(e("../utils"))},{"../utils":15,"./getdisplaymedia":12,"./getusermedia":13}],12:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.shimGetDisplayMedia=function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(i){if(!i||!i.video){var r=new DOMException("getDisplayMedia without video constraints is undefined");return r.name="NotFoundError",r.code=8,Promise.reject(r)}return!0===i.video?i.video={mediaSource:t}:i.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(i)})}},{}],13:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return _typeof(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof(e)};i.shimGetUserMedia=function(e){var t=n.detectBrowser(e),i=e&&e.navigator,o=e&&e.MediaStreamTrack;if(i.getUserMedia=function(e,t,r){n.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),i.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&"autoGainControl"in i.mediaDevices.getSupportedConstraints())){var s=function(e,t,i){t in e&&!(i in e)&&(e[i]=e[t],delete e[t])},a=i.mediaDevices.getUserMedia.bind(i.mediaDevices);if(i.mediaDevices.getUserMedia=function(e){return"object"===(void 0===e?"undefined":r(e))&&"object"===r(e.audio)&&(e=JSON.parse(JSON.stringify(e)),s(e.audio,"autoGainControl","mozAutoGainControl"),s(e.audio,"noiseSuppression","mozNoiseSuppression")),a(e)},o&&o.prototype.getSettings){var c=o.prototype.getSettings;o.prototype.getSettings=function(){var e=c.apply(this,arguments);return s(e,"mozAutoGainControl","autoGainControl"),s(e,"mozNoiseSuppression","noiseSuppression"),e}}if(o&&o.prototype.applyConstraints){var u=o.prototype.applyConstraints;o.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"===(void 0===e?"undefined":r(e))&&(e=JSON.parse(JSON.stringify(e)),s(e,"autoGainControl","mozAutoGainControl"),s(e,"noiseSuppression","mozNoiseSuppression")),u.apply(this,[e])}}}};var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(e("../utils"))},{"../utils":15}],14:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return _typeof(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof(e)};i.shimLocalStreamsAPI=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){var i=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getTracks().forEach((function(r){return t.call(i,r,e)}))},e.RTCPeerConnection.prototype.addTrack=function(e,i){return i&&(this._localStreams?this._localStreams.includes(i)||this._localStreams.push(i):this._localStreams=[i]),t.call(this,e,i)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._localStreams||(this._localStreams=[]);var i=this._localStreams.indexOf(e);if(-1!==i){this._localStreams.splice(i,1);var r=e.getTracks();this.getSenders().forEach((function(e){r.includes(e.track)&&t.removeTrack(e)}))}})}},i.shimRemoteStreamsAPI=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){var t=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach((function(e){if(t._remoteStreams||(t._remoteStreams=[]),!t._remoteStreams.includes(e)){t._remoteStreams.push(e);var i=new Event("addstream");i.stream=e,t.dispatchEvent(i)}}))})}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((function(t){if(e._remoteStreams||(e._remoteStreams=[]),!(e._remoteStreams.indexOf(t)>=0)){e._remoteStreams.push(t);var i=new Event("addstream");i.stream=t,e.dispatchEvent(i)}}))}),t.apply(e,arguments)}}},i.shimCallbacksAPI=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,i=t.createOffer,n=t.createAnswer,o=t.setLocalDescription,s=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){var r=i.apply(this,[arguments.length>=2?arguments[2]:arguments[0]]);return t?(r.then(e,t),Promise.resolve()):r},t.createAnswer=function(e,t){var i=n.apply(this,[arguments.length>=2?arguments[2]:arguments[0]]);return t?(i.then(e,t),Promise.resolve()):i};var c=function(e,t,i){var r=o.apply(this,[e]);return i?(r.then(t,i),Promise.resolve()):r};t.setLocalDescription=c,t.setRemoteDescription=c=function(e,t,i){var r=s.apply(this,[e]);return i?(r.then(t,i),Promise.resolve()):r},t.addIceCandidate=c=function(e,t,i){var r=a.apply(this,[e]);return i?(r.then(t,i),Promise.resolve()):r}}},i.shimGetUserMedia=function(e){var t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){var i=t.mediaDevices,r=i.getUserMedia.bind(i);t.mediaDevices.getUserMedia=function(e){return r(o(e))}}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,i,r){t.mediaDevices.getUserMedia(e).then(i,r)}.bind(t))},i.shimConstraints=o,i.shimRTCIceServerUrls=function(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,i){if(e&&e.iceServers){for(var r=[],o=0;o<e.iceServers.length;o++){var s=e.iceServers[o];!s.hasOwnProperty("urls")&&s.hasOwnProperty("url")?(n.deprecated("RTCIceServer.url","RTCIceServer.urls"),(s=JSON.parse(JSON.stringify(s))).urls=s.url,delete s.url,r.push(s)):r.push(e.iceServers[o])}e.iceServers=r}return new t(e,i)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in e.RTCPeerConnection&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})},i.shimTrackEventTransceiver=function(e){"object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&"receiver"in e.RTCTrackEvent.prototype&&!e.RTCTransceiver&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},i.shimCreateOfferLegacy=function(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);var i=this.getTransceivers().find((function(e){return"audio"===e.receiver.track.kind}));!1===e.offerToReceiveAudio&&i?"sendrecv"===i.direction?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":"recvonly"===i.direction&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):!0!==e.offerToReceiveAudio||i||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);var r=this.getTransceivers().find((function(e){return"video"===e.receiver.track.kind}));!1===e.offerToReceiveVideo&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveVideo||r||this.addTransceiver("video")}return t.apply(this,arguments)}};var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(e("../utils"));function o(e){return e&&void 0!==e.video?Object.assign({},e,{video:n.compactObject(e.video)}):e}},{"../utils":15}],15:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return _typeof(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof(e)};i.extractVersion=s,i.wrapPeerConnectionEvent=function(e,t,i){if(e.RTCPeerConnection){var r=e.RTCPeerConnection.prototype,n=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return n.apply(this,arguments);var o=function(e){var t=i(e);t&&r(t)};return this._eventMap=this._eventMap||{},this._eventMap[r]=o,n.apply(this,[e,o])};var o=r.removeEventListener;r.removeEventListener=function(e,i){if(e!==t||!this._eventMap||!this._eventMap[i])return o.apply(this,arguments);var r=this._eventMap[i];return delete this._eventMap[i],o.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}},i.disableLog=function(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":r(e))+". Please use a boolean."):(n=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},i.disableWarnings=function(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":r(e))+". Please use a boolean."):(o=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))},i.log=function(){if("object"===("undefined"==typeof window?"undefined":r(window))){if(n)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},i.deprecated=function(e,t){o&&console.warn(e+" is deprecated, please use "+t+" instead.")},i.detectBrowser=function(e){var t=e.navigator,i={browser:null,version:null};if(void 0===e||!e.navigator)return i.browser="Not a browser.",i;if(t.mozGetUserMedia)i.browser="firefox",i.version=s(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)i.browser="chrome",i.version=s(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))i.browser="edge",i.version=s(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return i.browser="Not a supported browser.",i;i.browser="safari",i.version=s(t.userAgent,/AppleWebKit\/(\d+)\./,1)}return i},i.compactObject=function e(t){return"object"!==(void 0===t?"undefined":r(t))?t:Object.keys(t).reduce((function(i,n){var o="object"===r(t[n]),s=o?e(t[n]):t[n],a=o&&!Object.keys(s).length;return void 0===s||a?i:Object.assign(i,function(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}({},n,s))}),{})},i.walkStats=a,i.filterStats=function(e,t,i){var r=i?"outbound-rtp":"inbound-rtp",n=new Map;if(null===t)return n;var o=[];return e.forEach((function(e){"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((function(t){e.forEach((function(i){i.type===r&&i.trackId===t.id&&a(e,i,n)}))})),n};var n=!0,o=!0;function s(e,t,i){var r=e.match(t);return r&&r.length>=i&&parseInt(r[i],10)}function a(e,t,i){t&&!i.has(t.id)&&(i.set(t.id,t),Object.keys(t).forEach((function(r){r.endsWith("Id")?a(e,e.get(t[r]),i):r.endsWith("Ids")&&t[r].forEach((function(t){a(e,e.get(t),i)}))})))}},{}],16:[function(e,t,i){"use strict";var r=e("sdp");function n(e,t,i,n,o){var s=r.writeRtpDescription(e.kind,t);if(s+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),s+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===i?"actpass":o||"active"),s+="a=mid:"+e.mid+"\r\n",s+=e.rtpSender&&e.rtpReceiver?"a=sendrecv\r\n":e.rtpSender?"a=sendonly\r\n":e.rtpReceiver?"a=recvonly\r\n":"a=inactive\r\n",e.rtpSender){var a=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=a;var c="msid:"+(n?n.id:"-")+" "+a+"\r\n";s+="a="+c,s+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+c,e.sendEncodingParameters[0].rtx&&(s+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+c,s+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return s+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(s+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),s}function o(e,t){var i={codecs:[],headerExtensions:[],fecMechanisms:[]},r=function(e,t){e=parseInt(e,10);for(var i=0;i<t.length;i++)if(t[i].payloadType===e||t[i].preferredPayloadType===e)return t[i]},n=function(e,t,i,n){var o=r(e.parameters.apt,i),s=r(t.parameters.apt,n);return o&&s&&o.name.toLowerCase()===s.name.toLowerCase()};return e.codecs.forEach((function(r){for(var o=0;o<t.codecs.length;o++){var s=t.codecs[o];if(r.name.toLowerCase()===s.name.toLowerCase()&&r.clockRate===s.clockRate){if("rtx"===r.name.toLowerCase()&&r.parameters&&s.parameters.apt&&!n(r,s,e.codecs,t.codecs))continue;(s=JSON.parse(JSON.stringify(s))).numChannels=Math.min(r.numChannels,s.numChannels),i.codecs.push(s),s.rtcpFeedback=s.rtcpFeedback.filter((function(e){for(var t=0;t<r.rtcpFeedback.length;t++)if(r.rtcpFeedback[t].type===e.type&&r.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var r=0;r<t.headerExtensions.length;r++){var n=t.headerExtensions[r];if(e.uri===n.uri){i.headerExtensions.push(n);break}}})),i}function s(e,t,i){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(i)}function a(e,t){var i=e.getRemoteCandidates().find((function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type}));return i||e.addRemoteCandidate(t),!i}function c(e,t){var i=new Error(t);return i.name=e,i.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],i}t.exports=function(e,t){function i(t,i){i.addTrack(t),i.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function u(t,i){i.removeTrack(t),i.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}function l(t,i,r,n){var o=new Event("track");o.track=i,o.receiver=r,o.transceiver={receiver:r},o.streams=n,e.setTimeout((function(){t._dispatchEvent("track",o)}))}var d=function(i){var n=this,o=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){n[e]=o[e].bind(o)})),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",i=JSON.parse(JSON.stringify(i||{})),this.usingBundle="max-bundle"===i.bundlePolicy,"negotiate"===i.rtcpMuxPolicy)throw c("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(i.rtcpMuxPolicy||(i.rtcpMuxPolicy="require"),i.iceTransportPolicy){case"all":case"relay":break;default:i.iceTransportPolicy="all"}switch(i.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:i.bundlePolicy="balanced"}if(i.iceServers=function(e,t){var i=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var r=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var n="string"==typeof r;return n&&(r=[r]),r=r.filter((function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||i?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(i=!0,!0)})),delete e.url,e.urls=n?r[0]:r,!!r.length}}))}(i.iceServers||[],t),this._iceGatherers=[],i.iceCandidatePoolSize)for(var s=i.iceCandidatePoolSize;s>0;s--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:i.iceServers,gatherPolicy:i.iceTransportPolicy}));else i.iceCandidatePoolSize=0;this._config=i,this.transceivers=[],this._sdpSessionId=r.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(d.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(d.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),d.prototype.onicecandidate=null,d.prototype.onaddstream=null,d.prototype.ontrack=null,d.prototype.onremovestream=null,d.prototype.onsignalingstatechange=null,d.prototype.oniceconnectionstatechange=null,d.prototype.onconnectionstatechange=null,d.prototype.onicegatheringstatechange=null,d.prototype.onnegotiationneeded=null,d.prototype.ondatachannel=null,d.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},d.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},d.prototype.getConfiguration=function(){return this._config},d.prototype.getLocalStreams=function(){return this.localStreams},d.prototype.getRemoteStreams=function(){return this.remoteStreams},d.prototype._createTransceiver=function(e,t){var i={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&this.transceivers.length>0)i.iceTransport=this.transceivers[0].iceTransport,i.dtlsTransport=this.transceivers[0].dtlsTransport;else{var r=this._createIceAndDtlsTransports();i.iceTransport=r.iceTransport,i.dtlsTransport=r.dtlsTransport}return t||this.transceivers.push(i),i},d.prototype.addTrack=function(t,i){if(this._isClosed)throw c("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var r;if(this.transceivers.find((function(e){return e.track===t})))throw c("InvalidAccessError","Track already exists.");for(var n=0;n<this.transceivers.length;n++)this.transceivers[n].track||this.transceivers[n].kind!==t.kind||(r=this.transceivers[n]);return r||(r=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(i)&&this.localStreams.push(i),r.track=t,r.stream=i,r.rtpSender=new e.RTCRtpSender(t,r.dtlsTransport),r.rtpSender},d.prototype.addStream=function(e){var i=this;if(t>=15025)e.getTracks().forEach((function(t){i.addTrack(t,e)}));else{var r=e.clone();e.getTracks().forEach((function(e,t){var i=r.getTracks()[t];e.addEventListener("enabled",(function(e){i.enabled=e.enabled}))})),r.getTracks().forEach((function(e){i.addTrack(e,r)}))}},d.prototype.removeTrack=function(t){if(this._isClosed)throw c("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var i=this.transceivers.find((function(e){return e.rtpSender===t}));if(!i)throw c("InvalidAccessError","Sender was not created by this connection.");var r=i.stream;i.rtpSender.stop(),i.rtpSender=null,i.track=null,i.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(r)&&this.localStreams.indexOf(r)>-1&&this.localStreams.splice(this.localStreams.indexOf(r),1),this._maybeFireNegotiationNeeded()},d.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var i=t.getSenders().find((function(t){return t.track===e}));i&&t.removeTrack(i)}))},d.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},d.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},d.prototype._createIceGatherer=function(t,i){var r=this;if(i&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var n=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(n,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var i=!e.candidate||0===Object.keys(e.candidate).length;n.state=i?"completed":"gathering",null!==r.transceivers[t].bufferedCandidateEvents&&r.transceivers[t].bufferedCandidateEvents.push(e)},n.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),n},d.prototype._gather=function(t,i){var n=this,o=this.transceivers[i].iceGatherer;if(!o.onlocalcandidate){var s=this.transceivers[i].bufferedCandidateEvents;this.transceivers[i].bufferedCandidateEvents=null,o.removeEventListener("localcandidate",this.transceivers[i].bufferCandidates),o.onlocalcandidate=function(e){if(!(n.usingBundle&&i>0)){var s=new Event("icecandidate");s.candidate={sdpMid:t,sdpMLineIndex:i};var a=e.candidate,c=!a||0===Object.keys(a).length;if(c)"new"!==o.state&&"gathering"!==o.state||(o.state="completed");else{"new"===o.state&&(o.state="gathering"),a.component=1,a.ufrag=o.getLocalParameters().usernameFragment;var u=r.writeCandidate(a);s.candidate=Object.assign(s.candidate,r.parseCandidate(u)),s.candidate.candidate=u,s.candidate.toJSON=function(){return{candidate:s.candidate.candidate,sdpMid:s.candidate.sdpMid,sdpMLineIndex:s.candidate.sdpMLineIndex,usernameFragment:s.candidate.usernameFragment}}}var l=r.getMediaSections(n._localDescription.sdp);l[s.candidate.sdpMLineIndex]+=c?"a=end-of-candidates\r\n":"a="+s.candidate.candidate+"\r\n",n._localDescription.sdp=r.getDescription(n._localDescription.sdp)+l.join("");var d=n.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==n.iceGatheringState&&(n.iceGatheringState="gathering",n._emitGatheringStateChange()),c||n._dispatchEvent("icecandidate",s),d&&(n._dispatchEvent("icecandidate",new Event("icecandidate")),n.iceGatheringState="complete",n._emitGatheringStateChange())}},e.setTimeout((function(){s.forEach((function(e){o.onlocalcandidate(e)}))}),0)}},d.prototype._createIceAndDtlsTransports=function(){var t=this,i=new e.RTCIceTransport(null);i.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var r=new e.RTCDtlsTransport(i);return r.ondtlsstatechange=function(){t._updateConnectionState()},r.onerror=function(){Object.defineProperty(r,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:i,dtlsTransport:r}},d.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var i=this.transceivers[e].iceTransport;i&&(delete i.onicestatechange,delete this.transceivers[e].iceTransport);var r=this.transceivers[e].dtlsTransport;r&&(delete r.ondtlsstatechange,delete r.onerror,delete this.transceivers[e].dtlsTransport)},d.prototype._transceive=function(e,i,n){var s=o(e.localCapabilities,e.remoteCapabilities);i&&e.rtpSender&&(s.encodings=e.sendEncodingParameters,s.rtcp={cname:r.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(s.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(s)),n&&e.rtpReceiver&&s.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),s.encodings=e.recvEncodingParameters.length?e.recvEncodingParameters:[{}],s.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(s.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(s.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(s))},d.prototype.setLocalDescription=function(e){var t,i,n=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(c("TypeError",'Unsupported type "'+e.type+'"'));if(!s("setLocalDescription",e.type,n.signalingState)||n._isClosed)return Promise.reject(c("InvalidStateError","Can not set local "+e.type+" in state "+n.signalingState));if("offer"===e.type)t=r.splitSections(e.sdp),i=t.shift(),t.forEach((function(e,t){var i=r.parseRtpParameters(e);n.transceivers[t].localCapabilities=i})),n.transceivers.forEach((function(e,t){n._gather(e.mid,t)}));else if("answer"===e.type){t=r.splitSections(n._remoteDescription.sdp),i=t.shift();var a=r.matchPrefix(i,"a=ice-lite").length>0;t.forEach((function(e,t){var s=n.transceivers[t],c=s.iceGatherer,u=s.iceTransport,l=s.dtlsTransport,d=s.localCapabilities,h=s.remoteCapabilities;if(!(r.isRejected(e)&&0===r.matchPrefix(e,"a=bundle-only").length||s.rejected)){var p=r.getIceParameters(e,i),f=r.getDtlsParameters(e,i);a&&(f.role="server"),n.usingBundle&&0!==t||(n._gather(s.mid,t),"new"===u.state&&u.start(c,p,a?"controlling":"controlled"),"new"===l.state&&l.start(f));var m=o(d,h);n._transceive(s,m.codecs.length>0,!1)}}))}return n._localDescription={type:e.type,sdp:e.sdp},n._updateSignalingState("offer"===e.type?"have-local-offer":"stable"),Promise.resolve()},d.prototype.setRemoteDescription=function(n){var d=this;if(-1===["offer","answer"].indexOf(n.type))return Promise.reject(c("TypeError",'Unsupported type "'+n.type+'"'));if(!s("setRemoteDescription",n.type,d.signalingState)||d._isClosed)return Promise.reject(c("InvalidStateError","Can not set remote "+n.type+" in state "+d.signalingState));var h={};d.remoteStreams.forEach((function(e){h[e.id]=e}));var p=[],f=r.splitSections(n.sdp),m=f.shift(),v=r.matchPrefix(m,"a=ice-lite").length>0,g=r.matchPrefix(m,"a=group:BUNDLE ").length>0;d.usingBundle=g;var y=r.matchPrefix(m,"a=ice-options:")[0];return d.canTrickleIceCandidates=!!y&&y.substr(14).split(" ").indexOf("trickle")>=0,f.forEach((function(s,c){var l=r.splitLines(s),f=r.getKind(s),y=r.isRejected(s)&&0===r.matchPrefix(s,"a=bundle-only").length,b=l[0].substr(2).split(" ")[2],_=r.getDirection(s,m),S=r.parseMsid(s),T=r.getMid(s)||r.generateIdentifier();if(y||"application"===f&&("DTLS/SCTP"===b||"UDP/DTLS/SCTP"===b))d.transceivers[c]={mid:T,kind:f,protocol:b,rejected:!0};else{var E,C,w,I,R,k,P,A,D;!y&&d.transceivers[c]&&d.transceivers[c].rejected&&(d.transceivers[c]=d._createTransceiver(f,!0));var N,O,M=r.parseRtpParameters(s);y||(N=r.getIceParameters(s,m),(O=r.getDtlsParameters(s,m)).role="client"),P=r.parseRtpEncodingParameters(s);var L=r.parseRtcpParameters(s),x=r.matchPrefix(s,"a=end-of-candidates",m).length>0,U=r.matchPrefix(s,"a=candidate:").map((function(e){return r.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===n.type||"answer"===n.type)&&!y&&g&&c>0&&d.transceivers[c]&&(d._disposeIceAndDtlsTransports(c),d.transceivers[c].iceGatherer=d.transceivers[0].iceGatherer,d.transceivers[c].iceTransport=d.transceivers[0].iceTransport,d.transceivers[c].dtlsTransport=d.transceivers[0].dtlsTransport,d.transceivers[c].rtpSender&&d.transceivers[c].rtpSender.setTransport(d.transceivers[0].dtlsTransport),d.transceivers[c].rtpReceiver&&d.transceivers[c].rtpReceiver.setTransport(d.transceivers[0].dtlsTransport)),"offer"!==n.type||y)"answer"!==n.type||y||(C=(E=d.transceivers[c]).iceGatherer,w=E.iceTransport,I=E.dtlsTransport,R=E.rtpReceiver,k=E.sendEncodingParameters,A=E.localCapabilities,d.transceivers[c].recvEncodingParameters=P,d.transceivers[c].remoteCapabilities=M,d.transceivers[c].rtcpParameters=L,U.length&&"new"===w.state&&(!v&&!x||g&&0!==c?U.forEach((function(e){a(E.iceTransport,e)})):w.setRemoteCandidates(U)),g&&0!==c||("new"===w.state&&w.start(C,N,"controlling"),"new"===I.state&&I.start(O)),!o(E.localCapabilities,E.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&E.sendEncodingParameters[0].rtx&&delete E.sendEncodingParameters[0].rtx,d._transceive(E,"sendrecv"===_||"recvonly"===_,"sendrecv"===_||"sendonly"===_),!R||"sendrecv"!==_&&"sendonly"!==_?delete E.rtpReceiver:(D=R.track,S?(h[S.stream]||(h[S.stream]=new e.MediaStream),i(D,h[S.stream]),p.push([D,R,h[S.stream]])):(h.default||(h.default=new e.MediaStream),i(D,h.default),p.push([D,R,h.default]))));else{(E=d.transceivers[c]||d._createTransceiver(f)).mid=T,E.iceGatherer||(E.iceGatherer=d._createIceGatherer(c,g)),U.length&&"new"===E.iceTransport.state&&(!x||g&&0!==c?U.forEach((function(e){a(E.iceTransport,e)})):E.iceTransport.setRemoteCandidates(U)),A=e.RTCRtpReceiver.getCapabilities(f),t<15019&&(A.codecs=A.codecs.filter((function(e){return"rtx"!==e.name}))),k=E.sendEncodingParameters||[{ssrc:1001*(2*c+2)}];var B,z=!1;"sendrecv"===_||"sendonly"===_?(z=!E.rtpReceiver,R=E.rtpReceiver||new e.RTCRtpReceiver(E.dtlsTransport,f),z&&(D=R.track,S&&"-"===S.stream||(S?(h[S.stream]||(h[S.stream]=new e.MediaStream,Object.defineProperty(h[S.stream],"id",{get:function(){return S.stream}})),Object.defineProperty(D,"id",{get:function(){return S.track}}),B=h[S.stream]):(h.default||(h.default=new e.MediaStream),B=h.default)),B&&(i(D,B),E.associatedRemoteMediaStreams.push(B)),p.push([D,R,B]))):E.rtpReceiver&&E.rtpReceiver.track&&(E.associatedRemoteMediaStreams.forEach((function(e){var t=e.getTracks().find((function(e){return e.id===E.rtpReceiver.track.id}));t&&u(t,e)})),E.associatedRemoteMediaStreams=[]),E.localCapabilities=A,E.remoteCapabilities=M,E.rtpReceiver=R,E.rtcpParameters=L,E.sendEncodingParameters=k,E.recvEncodingParameters=P,d._transceive(d.transceivers[c],!1,z)}}})),void 0===d._dtlsRole&&(d._dtlsRole="offer"===n.type?"active":"passive"),d._remoteDescription={type:n.type,sdp:n.sdp},d._updateSignalingState("offer"===n.type?"have-remote-offer":"stable"),Object.keys(h).forEach((function(t){var i=h[t];if(i.getTracks().length){if(-1===d.remoteStreams.indexOf(i)){d.remoteStreams.push(i);var r=new Event("addstream");r.stream=i,e.setTimeout((function(){d._dispatchEvent("addstream",r)}))}p.forEach((function(e){i.id===e[2].id&&l(d,e[0],e[1],[i])}))}})),p.forEach((function(e){e[2]||l(d,e[0],e[1],[])})),e.setTimeout((function(){d&&d.transceivers&&d.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))}))}),4e3),Promise.resolve()},d.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},d.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},d.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},d.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var i=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",i)}},d.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var i=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",i)}},d.prototype.createOffer=function(){var i=this;if(i._isClosed)return Promise.reject(c("InvalidStateError","Can not call createOffer after close"));var o=i.transceivers.filter((function(e){return"audio"===e.kind})).length,s=i.transceivers.filter((function(e){return"video"===e.kind})).length,a=arguments[0];if(a){if(a.mandatory||a.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==a.offerToReceiveAudio&&(o=!0===a.offerToReceiveAudio?1:!1===a.offerToReceiveAudio?0:a.offerToReceiveAudio),void 0!==a.offerToReceiveVideo&&(s=!0===a.offerToReceiveVideo?1:!1===a.offerToReceiveVideo?0:a.offerToReceiveVideo)}for(i.transceivers.forEach((function(e){"audio"===e.kind?--o<0&&(e.wantReceive=!1):"video"===e.kind&&--s<0&&(e.wantReceive=!1)}));o>0||s>0;)o>0&&(i._createTransceiver("audio"),o--),s>0&&(i._createTransceiver("video"),s--);var u=r.writeSessionBoilerplate(i._sdpSessionId,i._sdpSessionVersion++);i.transceivers.forEach((function(n,o){var s=n.track,a=n.kind,c=n.mid||r.generateIdentifier();n.mid=c,n.iceGatherer||(n.iceGatherer=i._createIceGatherer(o,i.usingBundle));var u=e.RTCRtpSender.getCapabilities(a);t<15019&&(u.codecs=u.codecs.filter((function(e){return"rtx"!==e.name}))),u.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),n.remoteCapabilities&&n.remoteCapabilities.codecs&&n.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),u.headerExtensions.forEach((function(e){(n.remoteCapabilities&&n.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var l=n.sendEncodingParameters||[{ssrc:1001*(2*o+1)}];s&&t>=15019&&"video"===a&&!l[0].rtx&&(l[0].rtx={ssrc:l[0].ssrc+1}),n.wantReceive&&(n.rtpReceiver=new e.RTCRtpReceiver(n.dtlsTransport,a)),n.localCapabilities=u,n.sendEncodingParameters=l})),"max-compat"!==i._config.bundlePolicy&&(u+="a=group:BUNDLE "+i.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),u+="a=ice-options:trickle\r\n",i.transceivers.forEach((function(e,t){u+=n(e,e.localCapabilities,"offer",e.stream,i._dtlsRole),u+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===i.iceGatheringState||0!==t&&i.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,u+="a="+r.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(u+="a=end-of-candidates\r\n"))}));var l=new e.RTCSessionDescription({type:"offer",sdp:u});return Promise.resolve(l)},d.prototype.createAnswer=function(){var i=this;if(i._isClosed)return Promise.reject(c("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==i.signalingState&&"have-local-pranswer"!==i.signalingState)return Promise.reject(c("InvalidStateError","Can not call createAnswer in signalingState "+i.signalingState));var s=r.writeSessionBoilerplate(i._sdpSessionId,i._sdpSessionVersion++);i.usingBundle&&(s+="a=group:BUNDLE "+i.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),s+="a=ice-options:trickle\r\n";var a=r.getMediaSections(i._remoteDescription.sdp).length;i.transceivers.forEach((function(e,r){if(!(r+1>a)){if(e.rejected)return"application"===e.kind?s+="DTLS/SCTP"===e.protocol?"m=application 0 DTLS/SCTP 5000\r\n":"m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?s+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(s+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(s+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var c;e.stream&&("audio"===e.kind?c=e.stream.getAudioTracks()[0]:"video"===e.kind&&(c=e.stream.getVideoTracks()[0]),c&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1}));var u=o(e.localCapabilities,e.remoteCapabilities);!u.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,s+=n(e,u,"answer",e.stream,i._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(s+="a=rtcp-rsize\r\n")}}));var u=new e.RTCSessionDescription({type:"answer",sdp:s});return Promise.resolve(u)},d.prototype.addIceCandidate=function(e){var t,i=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(n,o){if(!i._remoteDescription)return o(c("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var s=e.sdpMLineIndex;if(e.sdpMid)for(var u=0;u<i.transceivers.length;u++)if(i.transceivers[u].mid===e.sdpMid){s=u;break}var l=i.transceivers[s];if(!l)return o(c("OperationError","Can not add ICE candidate"));if(l.rejected)return n();var d=Object.keys(e.candidate).length>0?r.parseCandidate(e.candidate):{};if("tcp"===d.protocol&&(0===d.port||9===d.port))return n();if(d.component&&1!==d.component)return n();if((0===s||s>0&&l.iceTransport!==i.transceivers[0].iceTransport)&&!a(l.iceTransport,d))return o(c("OperationError","Can not add ICE candidate"));var h=e.candidate.trim();0===h.indexOf("a=")&&(h=h.substr(2)),(t=r.getMediaSections(i._remoteDescription.sdp))[s]+="a="+(d.type?h:"end-of-candidates")+"\r\n",i._remoteDescription.sdp=r.getDescription(i._remoteDescription.sdp)+t.join("")}else for(var p=0;p<i.transceivers.length&&(i.transceivers[p].rejected||(i.transceivers[p].iceTransport.addRemoteCandidate({}),(t=r.getMediaSections(i._remoteDescription.sdp))[p]+="a=end-of-candidates\r\n",i._remoteDescription.sdp=r.getDescription(i._remoteDescription.sdp)+t.join(""),!i.usingBundle));p++);n()}))},d.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var i=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===t?i=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(i=e.rtpReceiver)})),!i)throw c("InvalidAccessError","Invalid selector.");return i.getStats()}var r=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&r.push(e[t].getStats())}))})),Promise.all(r).then((function(e){var t=new Map;return e.forEach((function(e){e.forEach((function(e){t.set(e.id,e)}))})),t}))},["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach((function(t){var i=e[t];if(i&&i.prototype&&i.prototype.getStats){var r=i.prototype.getStats;i.prototype.getStats=function(){return r.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(i){e[i].type=function(e){return{inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type}(e[i]),t.set(i,e[i])})),t}))}}}));var h=["createOffer","createAnswer"];return h.forEach((function(e){var t=d.prototype[e];d.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then((function(t){"function"==typeof e[0]&&e[0].apply(null,[t])}),(function(t){"function"==typeof e[1]&&e[1].apply(null,[t])})):t.apply(this,arguments)}})),(h=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=d.prototype[e];d.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)}),(function(t){"function"==typeof e[2]&&e[2].apply(null,[t])})):t.apply(this,arguments)}})),["getStats"].forEach((function(e){var t=d.prototype[e];d.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)})):t.apply(this,arguments)}})),d}},{sdp:17}],17:[function(e,t,i){"use strict";var r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},r.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){var t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},r.parseCandidate=function(e){for(var t,i={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":i.relatedAddress=t[r+1];break;case"rport":i.relatedPort=parseInt(t[r+1],10);break;case"tcptype":i.tcpType=t[r+1];break;case"ufrag":i.ufrag=t[r+1],i.usernameFragment=t[r+1];break;default:i[t[r]]=t[r+1]}return i},r.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var i=e.type;return t.push("typ"),t.push(i),"host"!==i&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},r.parseIceOptions=function(e){return e.substr(14).split(" ")},r.parseRtpMap=function(e){var t=e.substr(9).split(" "),i={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),i.name=t[0],i.clockRate=parseInt(t[1],10),i.channels=3===t.length?parseInt(t[2],10):1,i.numChannels=i.channels,i},r.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var i=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==i?"/"+i:"")+"\r\n"},r.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,i={},r=e.substr(e.indexOf(" ")+1).split(";"),n=0;n<r.length;n++)i[(t=r[n].trim().split("="))[0].trim()]=t[1];return i},r.writeFmtp=function(e){var t="",i=e.payloadType;if(void 0!==e.preferredPayloadType&&(i=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach((function(t){r.push(e.parameters[t]?t+"="+e.parameters[t]:t)})),t+="a=fmtp:"+i+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",i=e.payloadType;return void 0!==e.preferredPayloadType&&(i=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+i+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),i={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(i.attribute=e.substr(t+1,r-t-1),i.value=e.substr(r+1)):i.attribute=e.substr(t+1),i},r.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},r.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var i="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){i+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),i},r.getIceParameters=function(e,t){var i=r.splitLines(e);return{usernameFragment:(i=i.concat(r.splitLines(t))).filter((function(e){return 0===e.indexOf("a=ice-ufrag:")}))[0].substr(12),password:i.filter((function(e){return 0===e.indexOf("a=ice-pwd:")}))[0].substr(10)}},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},i=r.splitLines(e)[0].split(" "),n=3;n<i.length;n++){var o=i[n],s=r.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){var a=r.parseRtpMap(s),c=r.matchPrefix(e,"a=fmtp:"+o+" ");switch(a.parameters=c.length?r.parseFmtp(c[0]):{},a.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(r.parseRtcpFb),t.codecs.push(a),a.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(a.name.toUpperCase())}}}return r.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(r.parseExtmap(e))})),t},r.writeRtpDescription=function(e,t){var i="";i+="m="+e+" ",i+=t.codecs.length>0?"9":"0",i+=" UDP/TLS/RTP/SAVPF ",i+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",i+="c=IN IP4 0.0.0.0\r\n",i+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){i+=r.writeRtpMap(e),i+=r.writeFmtp(e),i+=r.writeRtcpFb(e)}));var n=0;return t.codecs.forEach((function(e){e.maxptime>n&&(n=e.maxptime)})),n>0&&(i+="a=maxptime:"+n+"\r\n"),i+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){i+=r.writeExtmap(e)})),i},r.parseRtpEncodingParameters=function(e){var t,i=[],n=r.parseRtpParameters(e),o=-1!==n.fecMechanisms.indexOf("RED"),s=-1!==n.fecMechanisms.indexOf("ULPFEC"),a=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=a.length>0&&a[0].ssrc,u=r.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));u.length>0&&u[0].length>1&&u[0][0]===c&&(t=u[0][1]),n.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&t&&(r.rtx={ssrc:t}),i.push(r),o&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:c,mechanism:s?"red+ulpfec":"red"},i.push(r))}})),0===i.length&&c&&i.push({ssrc:c});var l=r.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substr(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substr(5),10)*.95-16e3:void 0,i.forEach((function(e){e.maxBitrate=l}))),i},r.parseRtcpParameters=function(e){var t={},i=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];i&&(t.cname=i.value,t.ssrc=i.ssrc);var n=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=n.length>0,t.compound=0===n.length;var o=r.matchPrefix(e,"a=rtcp-mux");return t.mux=o.length>0,t},r.parseMsid=function(e){var t,i=r.matchPrefix(e,"a=msid:");if(1===i.length)return{stream:(t=i[0].substr(7).split(" "))[0],track:t[1]};var n=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return n.length>0?{stream:(t=n[0].value.split(" "))[0],track:t[1]}:void 0},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(e,t,i){var n=void 0!==t?t:2;return"v=0\r\no="+(i||"thisisadapterortc")+" "+(e||r.generateSessionId())+" "+n+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,i,n){var o=r.writeRtpDescription(e.kind,t);if(o+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===i?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",o+=e.direction?"a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?"a=sendrecv\r\n":e.rtpSender?"a=sendonly\r\n":e.rtpReceiver?"a=recvonly\r\n":"a=inactive\r\n",e.rtpSender){var s="msid:"+n.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+s,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),o},r.getDirection=function(e,t){for(var i=r.splitLines(e),n=0;n<i.length;n++)switch(i[n]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[n].substr(2)}return t?r.getDirection(t):"sendrecv"},r.getKind=function(e){return r.splitLines(e)[0].split(" ")[0].substr(2)},r.isRejected=function(e){return"0"===e.split(" ",2)[1]},r.parseMLine=function(e){var t=r.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},r.parseOLine=function(e){var t=r.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},r.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=r.splitLines(e),i=0;i<t.length;i++)if(t[i].length<2||"="!==t[i].charAt(1))return!1;return!0},"object"==_typeof(t)&&(t.exports=r)},{}]},{},[1])(1)},1583:function(e,t){var i,r=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0; |
|
/** |
|
* @license |
|
* Copyright 2009 The Closure Library Authors |
|
* Copyright 2020 Daniel Wirtz / The long.js Authors. |
|
* |
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
* you may not use this file except in compliance with the License. |
|
* You may obtain a copy of the License at |
|
* |
|
* http://www.apache.org/licenses/LICENSE-2.0 |
|
* |
|
* Unless required by applicable law or agreed to in writing, software |
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
* See the License for the specific language governing permissions and |
|
* limitations under the License. |
|
* |
|
* SPDX-License-Identifier: Apache-2.0 |
|
*/ |
|
var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function i(e,t,i){this.low=0|e,this.high=0|t,this.unsigned=!!i}function r(e){return!0===(e&&e.__isLong__)}function n(e){var t=Math.clz32(e&-e);return e?31-t:t}Object.defineProperty(i.prototype,"__isLong__",{value:!0}),i.isLong=r;var o={},s={};function a(e,t){var i,r,n;return t?(n=0<=(e>>>=0)&&e<256)&&(r=s[e])?r:(i=u(e,0,!0),n&&(s[e]=i),i):(n=-128<=(e|=0)&&e<128)&&(r=o[e])?r:(i=u(e,e<0?-1:0,!1),n&&(o[e]=i),i)}function c(e,t){if(isNaN(e))return t?y:g;if(t){if(e<0)return y;if(e>=f)return E}else{if(e<=-m)return C;if(e+1>=m)return T}return e<0?c(-e,t).neg():u(e%p|0,e/p|0,t)}function u(e,t,r){return new i(e,t,r)}i.fromInt=a,i.fromNumber=c,i.fromBits=u;var l=Math.pow;function d(e,t,i){if(0===e.length)throw Error("empty string");if("number"==typeof t?(i=t,t=!1):t=!!t,"NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t?y:g;if((i=i||10)<2||36<i)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return d(e.substring(1),t,i).neg();for(var n=c(l(i,8)),o=g,s=0;s<e.length;s+=8){var a=Math.min(8,e.length-s),u=parseInt(e.substring(s,s+a),i);if(a<8){var h=c(l(i,a));o=o.mul(h).add(c(u))}else o=(o=o.mul(n)).add(c(u))}return o.unsigned=t,o}function h(e,t){return"number"==typeof e?c(e,t):"string"==typeof e?d(e,t):u(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}i.fromString=d,i.fromValue=h;var p=4294967296,f=p*p,m=f/2,v=a(1<<24),g=a(0);i.ZERO=g;var y=a(0,!0);i.UZERO=y;var b=a(1);i.ONE=b;var _=a(1,!0);i.UONE=_;var S=a(-1);i.NEG_ONE=S;var T=u(-1,2147483647,!1);i.MAX_VALUE=T;var E=u(-1,-1,!0);i.MAX_UNSIGNED_VALUE=E;var C=u(0,-2147483648,!1);i.MIN_VALUE=C;var w=i.prototype;return w.toInt=function(){return this.unsigned?this.low>>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(C)){var t=c(e),i=this.div(t),r=i.mul(t).sub(this);return i.toString(e)+r.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=c(l(e,6),this.unsigned),o=this,s="";;){var a=o.div(n),u=(o.sub(a.mul(n)).toInt()>>>0).toString(e);if((o=a).isZero())return u+s;for(;u.length<6;)u="0"+u;s=""+u+s}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(C)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},w.isZero=function(){return 0===this.high&&0===this.low},w.eqz=w.isZero,w.isNegative=function(){return!this.unsigned&&this.high<0},w.isPositive=function(){return this.unsigned||this.high>=0},w.isOdd=function(){return!(1&~this.low)},w.isEven=function(){return!(1&this.low)},w.equals=function(e){return r(e)||(e=h(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.ne=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.le=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.ge=w.greaterThanOrEqual,w.compare=function(e){if(r(e)||(e=h(e)),this.eq(e))return 0;var t=this.isNegative(),i=e.isNegative();return t&&!i?-1:!t&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(C)?C:this.not().add(b)},w.neg=w.negate,w.add=function(e){r(e)||(e=h(e));var t=0,i=0,n=0,o=0;return n+=(o+=(65535&this.low)+(65535&e.low))>>>16,i+=(n+=(this.low>>>16)+(e.low>>>16))>>>16,t+=(i+=(65535&this.high)+(65535&e.high))>>>16,t+=(this.high>>>16)+(e.high>>>16),u((n&=65535)<<16|(o&=65535),(t&=65535)<<16|(i&=65535),this.unsigned)},w.subtract=function(e){return r(e)||(e=h(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return this;if(r(e)||(e=h(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return this.unsigned?y:g;if(this.eq(C))return e.isOdd()?C:g;if(e.eq(C))return this.isOdd()?C:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(v)&&e.lt(v))return c(this.toNumber()*e.toNumber(),this.unsigned);var i=65535&this.high,n=this.low>>>16,o=65535&this.low,s=65535&e.high,a=e.low>>>16,l=65535&e.low,d=0,p=0,f=0,m=0;return f+=(m+=o*l)>>>16,p+=(f+=n*l)>>>16,f&=65535,p+=(f+=o*a)>>>16,d+=(p+=i*l)>>>16,p&=65535,d+=(p+=n*a)>>>16,p&=65535,d+=(p+=o*s)>>>16,d+=(this.high>>>16)*l+i*a+n*s+o*(e.high>>>16),u((f&=65535)<<16|(m&=65535),(d&=65535)<<16|(p&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(r(e)||(e=h(e)),e.isZero())throw Error("division by zero");var i,n,o;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return _;o=y}else{if(this.eq(C))return e.eq(b)||e.eq(S)?C:e.eq(C)?b:(i=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?b:S:(n=this.sub(e.mul(i)),o=i.add(n.div(e)));if(e.eq(C))return this.unsigned?y:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=g}for(n=this;n.gte(e);){i=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(i)/Math.LN2),a=s<=48?1:l(2,s-48),d=c(i),p=d.mul(e);p.isNegative()||p.gt(n);)p=(d=c(i-=a,this.unsigned)).mul(e);d.isZero()&&(d=b),o=o.add(d),n=n.sub(p)}return o},w.div=w.divide,w.modulo=function(e){return r(e)||(e=h(e)),t?u((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.rem=w.modulo,w.not=function(){return u(~this.low,~this.high,this.unsigned)},w.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},w.clz=w.countLeadingZeros,w.countTrailingZeros=function(){return this.low?n(this.low):n(this.high)+32},w.ctz=w.countTrailingZeros,w.and=function(e){return r(e)||(e=h(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return r(e)||(e=h(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return r(e)||(e=h(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):u(0,this.low<<e-32,this.unsigned)},w.shl=w.shiftLeft,w.shiftRight=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):u(32===e?this.high:this.high>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.shr_u=w.shiftRightUnsigned,w.rotateLeft=function(e){var t;return r(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?u(this.high,this.low,this.unsigned):e<32?u(this.low<<e|this.high>>>(t=32-e),this.high<<e|this.low>>>t,this.unsigned):u(this.high<<(e-=32)|this.low>>>(t=32-e),this.low<<e|this.high>>>t,this.unsigned)},w.rotl=w.rotateLeft,w.rotateRight=function(e){var t;return r(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?u(this.high,this.low,this.unsigned):e<32?u(this.high<<(t=32-e)|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned):u(this.low<<(t=32-(e-=32))|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned)},w.rotr=w.rotateRight,w.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},i.fromBytes=function(e,t,r){return r?i.fromBytesLE(e,t):i.fromBytesBE(e,t)},i.fromBytesLE=function(e,t){return new i(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},i.fromBytesBE=function(e,t){return new i(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},e.default=i,"default"in e?e.default:e}({});void 0===(i=function(){return r}.apply(t,[]))||(e.exports=i)}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var i=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(i.exports,i,i.exports,__webpack_require__),i.exports}__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=function(e,t){for(var i in t)__webpack_require__.o(t,i)&&!__webpack_require__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__webpack_require__.g=function(){if("object"==("undefined"===typeof globalThis?"undefined":_typeof(globalThis)))return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==("undefined"===typeof window?"undefined":_typeof(window)))return window}}(),__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};return function(){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{WebRTCUtil:function(){return ho},ZegoExpressEngine:function(){return Pm}});var e,t,i,r,n,o=__webpack_require__(5434),s="3.4.0";!function(e){e[e.debug=0]="debug",e[e.info=1]="info",e[e.warn=2]="warn",e[e.error=3]="error",e[e.report=99]="report",e[e.disable=100]="disable"}(e||(e={})),function(e){e[e.CN=2]="CN",e[e.NA=3]="NA",e[e.EU=4]="EU",e[e.AS=5]="AS",e[e.IN=6]="IN",e[e.NCN=7]="NCN"}(t||(t={})),function(e){e[e.disable=0]="disable",e[e.websocket=1]="websocket",e[e.https=2]="https"}(i||(i={})),function(e){e[e.SDKProject_Other=0]="SDKProject_Other",e[e.SDKProject_ZegoExpressVideo=1]="SDKProject_ZegoExpressVideo",e[e.SDKProject_ZegoExpressAudio=2]="SDKProject_ZegoExpressAudio",e[e.SDKProject_ZegoLiveRoom=3]="SDKProject_ZegoLiveRoom",e[e.SDKProject_ZegoAudioRoom=4]="SDKProject_ZegoAudioRoom",e[e.SDKProject_ZegoAVKit=5]="SDKProject_ZegoAVKit",e[e.SDKProject_ZegoWebRTC=6]="SDKProject_ZegoWebRTC",e[e.SDKProject_ZegoMiniProgram=7]="SDKProject_ZegoMiniProgram"}(r||(r={})),function(e){e[e.disconnected=0]="disconnected",e[e.connecting=1]="connecting",e[e.connected=2]="connected"}(n||(n={}));var a,c,u,l,d={width:320,height:240,frameRate:15,bitRate:300},h={width:640,height:480,frameRate:15,bitRate:800},p={width:1280,height:720,frameRate:20,bitRate:1500},f={frameRate:20,bitRate:800},m={frameRate:15,bitRate:1500},v={frameRate:5,bitRate:2e3},g={stop:0,start:1,waiterAnswer:2,waitingCandidate:3,sendCandidate:4,iceConnected:5,iceDisconnected:6,iceClosed:7,iceFailed:8};!function(e){e[e.tryProbe=0]="tryProbe",e[e.probed=2]="probed"}(a||(a={})),function(e){e[e.CDN=0]="CDN",e[e.RTC=1]="RTC",e[e.L3=2]="L3",e[e.DG=3]="DG"}(c||(c={})),function(e){e[e.UDP=0]="UDP",e[e.RTMP=1]="RTMP",e[e.FLV=2]="FLV",e[e.HLS=3]="HLS",e[e.WEBRTC=4]="WEBRTC"}(u||(u={})),function(e){e[e.replaceNew=0]="replaceNew",e[e.changeResolution=1]="changeResolution"}(l||(l={}));var y,b,_,S=1e3,T={waiting_url:1,tryPublish:2,update_info:3,publishing:4,stop:5,retryPublish:6},E=2001;!function(e){e[e.logout=0]="logout",e[e.trylogin=1]="trylogin",e[e.login=2]="login"}(y||(y={})),function(e){e[e.logout=0]="logout",e[e.trylogin=1]="trylogin",e[e.login=2]="login",e[e.reconnect=3]="reconnect"}(b||(b={})),function(e){e[e.offline=0]="offline",e[e.online=1]="online"}(_||(_={}));var C,w={0:{code:1,description:"user_stop_publishing_stream_normal"},1:{code:2,description:"user_heart_beat_timeout"},2:{code:3,description:"user_repeat_login"},3:{code:4,description:"user_kicked_out"},4:{code:5,description:"user_offline"},100:{code:6,description:"remove_by_server"}};!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.CDN=1]="CDN",e[e.RTC=2]="RTC",e[e.L3=3]="L3"}(C||(C={}));var I,R,k=12001;!function(e){e[e.publish_quality=0]="publish_quality",e[e.play_quality=1]="play_quality",e[e.charge=2]="charge"}(I||(I={})),function(e){e[e.low=1]="low",e[e.stantard=2]="stantard",e[e.hight=3]="hight",e[e.custome=4]="custome"}(R||(R={}));var P,A,D,N,O,M,L={stop:0,start:1,waiterAnswer:2,waitingCandidate:3,sendCandidate:4,iceConnected:5,iceDisconnected:6,iceClosed:7,iceFailed:8};!function(e){e[e.captureFpsToLow=1001]="captureFpsToLow",e[e.captureVolumeToLow=1002]="captureVolumeToLow",e[e.sendVideoBitrateToLow=1003]="sendVideoBitrateToLow",e[e.sendFpsToLow=1004]="sendFpsToLow",e[e.sendAudioBitrateToLow=1005]="sendAudioBitrateToLow",e[e.receiveVolumeToLow=1006]="receiveVolumeToLow",e[e.receiveAudioDecodedFail=1007]="receiveAudioDecodedFail",e[e.receiveVideoDecodedFail=1008]="receiveVideoDecodedFail",e[e.receiveVideoFpsDecodedToLow=1009]="receiveVideoFpsDecodedToLow",e[e.renderVideoFpsToLow=1010]="renderVideoFpsToLow",e[e.captureFpsNormal=2001]="captureFpsNormal",e[e.captureVolumeNormal=2002]="captureVolumeNormal",e[e.sendVideoBitrateNormal=2003]="sendVideoBitrateNormal",e[e.sendFpsNormal=2004]="sendFpsNormal",e[e.sendAudioBitrateNormal=2005]="sendAudioBitrateNormal",e[e.receiveVolumeNormal=2006]="receiveVolumeNormal",e[e.receiveAudioDecodedNormal=2007]="receiveAudioDecodedNormal",e[e.receiveVideoDecodedNormal=2008]="receiveVideoDecodedNormal",e[e.receiveVideoFpsDecodedNormal=2009]="receiveVideoFpsDecodedNormal",e[e.renderVideoFpsNormal=2010]="renderVideoFpsNormal"}(P||(P={})),function(e){e[e.cdn=0]="cdn",e[e.ultra=1]="ultra"}(A||(A={})),function(e){e[e.stop=0]="stop",e[e.start=1]="start"}(D||(D={})),function(e){e[e.cdn=0]="cdn",e[e.ultra=1]="ultra",e[e.customUrl=2]="customUrl"}(N||(N={})),function(e){e[e.CDN=0]="CDN",e[e.BGP=1]="BGP"}(O||(O={})),function(e){e[e.ClientType_None=0]="ClientType_None",e[e.ClientType_H5=1]="ClientType_H5",e[e.ClientType_SmallPragram=2]="ClientType_SmallPragram",e[e.ClientType_Webrtc=3]="ClientType_Webrtc"}(M||(M={}));var x,U,B,z,q,X,H,F,V,G,j,Q,W,Z,K,J=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this._id=null,this.next=null,this.prev=null,this._id=e,this._data=t}return Object.defineProperty(e.prototype,"id",{get:function(){return this._id?this._id:null},set:function(e){this._id=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(e){this._data=e},enumerable:!1,configurable:!0}),e.prototype.hasNext=function(){return this.next&&this.next.id},e.prototype.hasPrev=function(){return this.prev&&this.prev.id},e}(),Y=function(){function e(){this.start=new J,this.end=new J,this._idCounter=0,this._numNodes=0,this.start.next=this.end,this.start.prev=null,this.end.prev=this.start,this.end.next=null}return e.prototype.insertBefore=function(e,t){var i=new J(this._idCounter,t);return i.next=e,i.prev=e.prev,e.prev&&(e.prev.next=i),e.prev=i,++this._idCounter,++this._numNodes,i},e.prototype.addLast=function(e){return this.insertBefore(this.end,e)},e.prototype.add=function(e){return this.addLast(e)},e.prototype.getFirst=function(){return 0===this._numNodes?null:this.start.next},e.prototype.getLast=function(){return 0===this._numNodes?null:this.end.prev},e.prototype.size=function(){return this._numNodes},e.prototype.getFromFirst=function(e){var t=0,i=this.start.next;if(e>=0)for(;t<e&&null!==i;)i=i.next,++t;else i=null;if(null===i)throw"Index out of bounds.";return i},e.prototype.get=function(e){return 0===e?this.getFirst():e===this._numNodes-1?this.getLast():this.getFromFirst(e)},e.prototype.remove=function(e){return e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),--this._numNodes,e},e.prototype.removeFirst=function(){var e=null;return this._numNodes>0&&this.start.next&&(e=this.remove(this.start.next)),e},e.prototype.removeLast=function(){var e=null;return this._numNodes>0&&this.end.prev&&(e=this.remove(this.end.prev)),e},e.prototype.removeAll=function(){this.start.next=this.end,this.end.prev=this.start,this._numNodes=0,this._idCounter=0},e.prototype.each=function(e){for(var t=this.start;t.hasNext();)e(t=t.next)},e.prototype.find=function(e){for(var t=this.start,i=!1,r=null;t.hasNext()&&!i;)e(t=t.next)&&(r=t,i=!0);return r},e.prototype.map=function(e){for(var t=this.start,i=[];t.hasNext();)e(t=t.next)&&i.push(t);return i},e.prototype.push=function(e){return this.addLast(e)},e.prototype.unshift=function(e){this.insertBefore(this._numNodes>0?this.start.next:this.end,e)},e.prototype.pop=function(){return this.removeLast()},e.prototype.shift=function(){return this.removeFirst()},e}();!function(e){e[e.Unknown=-1]="Unknown",e[e.Excellent=0]="Excellent",e[e.Good=1]="Good",e[e.Middle=2]="Middle",e[e.Poor=3]="Poor",e[e.Die=4]="Die"}(x||(x={})),function(e){e[e.MinQuality=0]="MinQuality",e[e.DieQuality=0]="DieQuality",e[e.PoorMinQuality=1]="PoorMinQuality",e[e.MiddleMinQuality=30]="MiddleMinQuality",e[e.GoodMinQuality=60]="GoodMinQuality",e[e.ExcellentMinQuality=85]="ExcellentMinQuality",e[e.MaxQuality=100]="MaxQuality"}(U||(U={})),function(e){e[e.ZegoDefined=0]="ZegoDefined",e[e.UserUnregister=1]="UserUnregister"}(B||(B={})),function(e){e[e.CDN=0]="CDN",e[e.L3=1]="L3"}(z||(z={})),function(e){e[e.RTC=0]="RTC",e[e.CDN=1]="CDN",e[e.L3=2]="L3",e[e.DG=3]="DG"}(q||(q={})),function(e){e[e.PortraitSegmentation=0]="PortraitSegmentation"}(X||(X={})),function(e){e[e.Default=3]="Default",e[e.StandardVideoCall=4]="StandardVideoCall",e[e.HighVideoCall=5]="HighVideoCall",e[e.StandardChatroom=6]="StandardChatroom",e[e.HighQualityChatroom=7]="HighQualityChatroom",e[e.Broadcast=8]="Broadcast",e[e.UNKNOWN=100]="UNKNOWN"}(H||(H={})),function(e){e[e.I=0]="I",e[e.H=10]="H",e[e.M=100]="M",e[e.L=1e3]="L"}(F||(F={})),function(e){e[e.BASE_LINE=1]="BASE_LINE",e[e.MAIN=2]="MAIN",e[e.HIGH=3]="HIGH"}(V||(V={})),function(e){e.ONLY_BASELINE="only_baseline",e.HARD_SOFT_ENCODEC_FIRST="hard_or_soft_encodec_first",e.HIGH_PROFILE_FIRST="high_profile_first"}(G||(G={})),function(e){e[e.useAnalyzer=0]="useAnalyzer",e[e.useWorklet=1]="useWorklet"}(j||(j={})),function(e){e[e.None=0]="None",e[e.Vocalist=1]="Vocalist",e[e.BackingSinging=2]="BackingSinging"}(Q||(Q={})),function(e){e[e.METHOD_UNSET=0]="METHOD_UNSET",e[e.METHOD_GET=1]="METHOD_GET",e[e.METHOD_POST=2]="METHOD_POST",e[e.METHOD_PUT=3]="METHOD_PUT",e[e.METHOD_PATCH=4]="METHOD_PATCH",e[e.METHOD_DELETE=5]="METHOD_DELETE",e[e.METHOD_HEAD=6]="METHOD_HEAD",e[e.METHOD_OPTIONS=7]="METHOD_OPTIONS"}(W||(W={})),function(e){e[e.SERVICE_UNSET=0]="SERVICE_UNSET",e[e.SERVICE_MEDIAGW=1]="SERVICE_MEDIAGW",e[e.SERVICE_LIVEROOM=2]="SERVICE_LIVEROOM",e[e.SERVICE_MIX=3]="SERVICE_MIX",e[e.SERVICE_ZEUS=4]="SERVICE_ZEUS",e[e.SERVICE_ZPUSH=5]="SERVICE_ZPUSH",e[e.SERVICE_L3=6]="SERVICE_L3",e[e.SERVICE_TALKLINE=7]="SERVICE_TALKLINE",e[e.SERVICE_EDUSUITE=8]="SERVICE_EDUSUITE",e[e.SERVICE_ZIM=9]="SERVICE_ZIM",e[e.SERVICE_ClOUD_SETTING=10]="SERVICE_ClOUD_SETTING",e[e.SERVICE_ZEUSHB=11]="SERVICE_ZEUSHB",e[e.SERVICE_USER_LOGIC=12]="SERVICE_USER_LOGIC",e[e.SERVICE_UNIFYDISPATCH=13]="SERVICE_UNIFYDISPATCH",e[e.SERVICE_QUALITY=14]="SERVICE_QUALITY",e[e.SERVICE_SECURITY=15]="SERVICE_SECURITY",e[e.SERVICE_KTVCPR=16]="SERVICE_KTVCPR",e[e.SERVICE_SWITCH4LIVEROOM=17]="SERVICE_SWITCH4LIVEROOM",e[e.SERVICE_WEBRTC_SIGNAL=18]="SERVICE_WEBRTC_SIGNAL",e[e.SERVICE_L3_WEBRTC_SIGNAL=19]="SERVICE_L3_WEBRTC_SIGNAL",e[e.SERVICE_VIDEOCPR=20]="SERVICE_VIDEOCPR",e[e.SERVICE_CDN=21]="SERVICE_CDN",e[e.SERVICE_CLOUDRECORD=22]="SERVICE_CLOUDRECORD",e[e.SERVICE_INNER_ECHO=23]="SERVICE_INNER_ECHO",e[e.SERVICE_OUTER_ECHO=24]="SERVICE_OUTER_ECHO",e[e.SERVICE_LOCALHOST_ECHO=25]="SERVICE_LOCALHOST_ECHO",e[e.SERVICE_ECHO=26]="SERVICE_ECHO",e[e.SERVICE_DOCSERVICE=27]="SERVICE_DOCSERVICE",e[e.SERVICE_AUTHSVR=28]="SERVICE_AUTHSVR"}(Z||(Z={})),function(e){e[e.Default=0]="Default",e[e.Extranet=1]="Extranet",e[e.Intranet=2]="Intranet"}(K||(K={})); |
|
/** |
|
* @license |
|
* Copyright 2009 The Closure Library Authors |
|
* Copyright 2020 Daniel Wirtz / The long.js Authors. |
|
* |
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
* you may not use this file except in compliance with the License. |
|
* You may obtain a copy of the License at |
|
* |
|
* http://www.apache.org/licenses/LICENSE-2.0 |
|
* |
|
* Unless required by applicable law or agreed to in writing, software |
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
* See the License for the specific language governing permissions and |
|
* limitations under the License. |
|
* |
|
* SPDX-License-Identifier: Apache-2.0 |
|
*/ |
|
var $=null;try{$=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function ee(e,t,i){this.low=0|e,this.high=0|t,this.unsigned=!!i}function te(e){return!0===(e&&e.__isLong__)}function ie(e){var t=Math.clz32(e&-e);return e?31-t:t}Object.defineProperty(ee.prototype,"__isLong__",{value:!0}),ee.isLong=te;var re={},ne={};function oe(e,t){var i,r,n;return t?(n=0<=(e>>>=0)&&e<256)&&(r=ne[e])?r:(i=ae(e,0,!0),n&&(ne[e]=i),i):(n=-128<=(e|=0)&&e<128)&&(r=re[e])?r:(i=ae(e,e<0?-1:0,!1),n&&(re[e]=i),i)}function se(e,t){if(isNaN(e))return t?ve:me;if(t){if(e<0)return ve;if(e>=he)return Se}else{if(e<=-pe)return Te;if(e+1>=pe)return _e}return e<0?se(-e,t).neg():ae(e%de|0,e/de|0,t)}function ae(e,t,i){return new ee(e,t,i)}ee.fromInt=oe,ee.fromNumber=se,ee.fromBits=ae;var ce=Math.pow;function ue(e,t,i){if(0===e.length)throw Error("empty string");if("number"==typeof t?(i=t,t=!1):t=!!t,"NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t?ve:me;if((i=i||10)<2||36<i)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return ue(e.substring(1),t,i).neg();for(var n=se(ce(i,8)),o=me,s=0;s<e.length;s+=8){var a=Math.min(8,e.length-s),c=parseInt(e.substring(s,s+a),i);if(a<8){var u=se(ce(i,a));o=o.mul(u).add(se(c))}else o=(o=o.mul(n)).add(se(c))}return o.unsigned=t,o}function le(e,t){return"number"==typeof e?se(e,t):"string"==typeof e?ue(e,t):ae(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}ee.fromString=ue,ee.fromValue=le;var de=4294967296,he=de*de,pe=he/2,fe=oe(1<<24),me=oe(0);ee.ZERO=me;var ve=oe(0,!0);ee.UZERO=ve;var ge=oe(1);ee.ONE=ge;var ye=oe(1,!0);ee.UONE=ye;var be=oe(-1);ee.NEG_ONE=be;var _e=ae(-1,2147483647,!1);ee.MAX_VALUE=_e;var Se=ae(-1,-1,!0);ee.MAX_UNSIGNED_VALUE=Se;var Te=ae(0,-2147483648,!1);ee.MIN_VALUE=Te;var Ee=ee.prototype;Ee.toInt=function(){return this.unsigned?this.low>>>0:this.low},Ee.toNumber=function(){return this.unsigned?(this.high>>>0)*de+(this.low>>>0):this.high*de+(this.low>>>0)},Ee.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(Te)){var t=se(e),i=this.div(t),r=i.mul(t).sub(this);return i.toString(e)+r.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=se(ce(e,6),this.unsigned),o=this,s="";;){var a=o.div(n),c=(o.sub(a.mul(n)).toInt()>>>0).toString(e);if((o=a).isZero())return c+s;for(;c.length<6;)c="0"+c;s=""+c+s}},Ee.getHighBits=function(){return this.high},Ee.getHighBitsUnsigned=function(){return this.high>>>0},Ee.getLowBits=function(){return this.low},Ee.getLowBitsUnsigned=function(){return this.low>>>0},Ee.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Te)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},Ee.isZero=function(){return 0===this.high&&0===this.low},Ee.eqz=Ee.isZero,Ee.isNegative=function(){return!this.unsigned&&this.high<0},Ee.isPositive=function(){return this.unsigned||this.high>=0},Ee.isOdd=function(){return!(1&~this.low)},Ee.isEven=function(){return!(1&this.low)},Ee.equals=function(e){return te(e)||(e=le(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},Ee.eq=Ee.equals,Ee.notEquals=function(e){return!this.eq(e)},Ee.neq=Ee.notEquals,Ee.ne=Ee.notEquals,Ee.lessThan=function(e){return this.comp(e)<0},Ee.lt=Ee.lessThan,Ee.lessThanOrEqual=function(e){return this.comp(e)<=0},Ee.lte=Ee.lessThanOrEqual,Ee.le=Ee.lessThanOrEqual,Ee.greaterThan=function(e){return this.comp(e)>0},Ee.gt=Ee.greaterThan,Ee.greaterThanOrEqual=function(e){return this.comp(e)>=0},Ee.gte=Ee.greaterThanOrEqual,Ee.ge=Ee.greaterThanOrEqual,Ee.compare=function(e){if(te(e)||(e=le(e)),this.eq(e))return 0;var t=this.isNegative(),i=e.isNegative();return t&&!i?-1:!t&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},Ee.comp=Ee.compare,Ee.negate=function(){return!this.unsigned&&this.eq(Te)?Te:this.not().add(ge)},Ee.neg=Ee.negate,Ee.add=function(e){te(e)||(e=le(e));var t=0,i=0,r=0,n=0;return r+=(n+=(65535&this.low)+(65535&e.low))>>>16,i+=(r+=(this.low>>>16)+(e.low>>>16))>>>16,t+=(i+=(65535&this.high)+(65535&e.high))>>>16,t+=(this.high>>>16)+(e.high>>>16),ae((r&=65535)<<16|(n&=65535),(t&=65535)<<16|(i&=65535),this.unsigned)},Ee.subtract=function(e){return te(e)||(e=le(e)),this.add(e.neg())},Ee.sub=Ee.subtract,Ee.multiply=function(e){if(this.isZero())return this;if(te(e)||(e=le(e)),$)return ae($.mul(this.low,this.high,e.low,e.high),$.get_high(),this.unsigned);if(e.isZero())return this.unsigned?ve:me;if(this.eq(Te))return e.isOdd()?Te:me;if(e.eq(Te))return this.isOdd()?Te:me;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(fe)&&e.lt(fe))return se(this.toNumber()*e.toNumber(),this.unsigned);var t=65535&this.high,i=this.low>>>16,r=65535&this.low,n=65535&e.high,o=e.low>>>16,s=65535&e.low,a=0,c=0,u=0,l=0;return u+=(l+=r*s)>>>16,c+=(u+=i*s)>>>16,u&=65535,c+=(u+=r*o)>>>16,a+=(c+=t*s)>>>16,c&=65535,a+=(c+=i*o)>>>16,c&=65535,a+=(c+=r*n)>>>16,a+=(this.high>>>16)*s+t*o+i*n+r*(e.high>>>16),ae((u&=65535)<<16|(l&=65535),(a&=65535)<<16|(c&=65535),this.unsigned)},Ee.mul=Ee.multiply,Ee.divide=function(e){if(te(e)||(e=le(e)),e.isZero())throw Error("division by zero");var t,i,r;if($)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?ae((this.unsigned?$.div_u:$.div_s)(this.low,this.high,e.low,e.high),$.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?ve:me;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return ve;if(e.gt(this.shru(1)))return ye;r=ve}else{if(this.eq(Te))return e.eq(ge)||e.eq(be)?Te:e.eq(Te)?ge:(t=this.shr(1).div(e).shl(1)).eq(me)?e.isNegative()?ge:be:(i=this.sub(e.mul(t)),r=t.add(i.div(e)));if(e.eq(Te))return this.unsigned?ve:me;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=me}for(i=this;i.gte(e);){t=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var n=Math.ceil(Math.log(t)/Math.LN2),o=n<=48?1:ce(2,n-48),s=se(t),a=s.mul(e);a.isNegative()||a.gt(i);)a=(s=se(t-=o,this.unsigned)).mul(e);s.isZero()&&(s=ge),r=r.add(s),i=i.sub(a)}return r},Ee.div=Ee.divide,Ee.modulo=function(e){return te(e)||(e=le(e)),$?ae((this.unsigned?$.rem_u:$.rem_s)(this.low,this.high,e.low,e.high),$.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},Ee.mod=Ee.modulo,Ee.rem=Ee.modulo,Ee.not=function(){return ae(~this.low,~this.high,this.unsigned)},Ee.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},Ee.clz=Ee.countLeadingZeros,Ee.countTrailingZeros=function(){return this.low?ie(this.low):ie(this.high)+32},Ee.ctz=Ee.countTrailingZeros,Ee.and=function(e){return te(e)||(e=le(e)),ae(this.low&e.low,this.high&e.high,this.unsigned)},Ee.or=function(e){return te(e)||(e=le(e)),ae(this.low|e.low,this.high|e.high,this.unsigned)},Ee.xor=function(e){return te(e)||(e=le(e)),ae(this.low^e.low,this.high^e.high,this.unsigned)},Ee.shiftLeft=function(e){return te(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?ae(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):ae(0,this.low<<e-32,this.unsigned)},Ee.shl=Ee.shiftLeft,Ee.shiftRight=function(e){return te(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?ae(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):ae(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},Ee.shr=Ee.shiftRight,Ee.shiftRightUnsigned=function(e){return te(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?ae(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):ae(32===e?this.high:this.high>>>e-32,0,this.unsigned)},Ee.shru=Ee.shiftRightUnsigned,Ee.shr_u=Ee.shiftRightUnsigned,Ee.rotateLeft=function(e){var t;return te(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?ae(this.high,this.low,this.unsigned):e<32?ae(this.low<<e|this.high>>>(t=32-e),this.high<<e|this.low>>>t,this.unsigned):ae(this.high<<(e-=32)|this.low>>>(t=32-e),this.low<<e|this.high>>>t,this.unsigned)},Ee.rotl=Ee.rotateLeft,Ee.rotateRight=function(e){var t;return te(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?ae(this.high,this.low,this.unsigned):e<32?ae(this.high<<(t=32-e)|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned):ae(this.low<<(t=32-(e-=32))|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned)},Ee.rotr=Ee.rotateRight,Ee.toSigned=function(){return this.unsigned?ae(this.low,this.high,!1):this},Ee.toUnsigned=function(){return this.unsigned?this:ae(this.low,this.high,!0)},Ee.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},Ee.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},Ee.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},ee.fromBytes=function(e,t,i){return i?ee.fromBytesLE(e,t):ee.fromBytesBE(e,t)},ee.fromBytesLE=function(e,t){return new ee(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},ee.fromBytesBE=function(e,t){return new ee(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)};var Ce=ee,we=Promise,Ie=document;function Re(){return navigator.userAgent||""}function ke(){var e,t=navigator.userAgent,i=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*([\d\.]+)/i)||[];return/trident/i.test(i[1])?{name:"IE",version:(e=/\brv[ :]+([\d\.]+)/g.exec(t)||[])[1]||""}:"Chrome"===i[1]&&null!=(e=t.match(/\bOPR|Edge\/([\d\.]+)/))?{name:"Opera",version:e[1]}:(i=i[2]?[i[1],i[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/([\d+\.]+)/i))&&i.splice(1,1,e[1]),{name:i[0],version:i[1]})}function Pe(){return"safari"==ke().name.toLowerCase()}function Ae(){return"chrome"==ke().name.toLowerCase()}function De(){return"firefox"==ke().name.toLowerCase()}function Ne(e,t,i){void 0===i&&(i=!0);var r=Ie.createElement("video");return e&&(r.style.width=e+"px;"),t&&(r.style.height=t+"px;"),r.setAttribute("muted",""),r.muted=!0,i&&(r.setAttribute("autoplay",""),r.autoplay=!0),r.setAttribute("playsinline",""),r.setAttribute("webkit-playsinline",""),r}function Oe(e,t){var i=Ie.createElement("canvas");return i.width=e,i.height=t,i}function Me(e,t,i){void 0===i&&(i=""),e.info("".concat(t," call ").concat(i))}function Le(e,t,i){void 0===i&&(i=""),e.info("".concat(t," end ").concat(i))}function xe(e,t,i){void 0===i&&(i=""),e.info("".concat(t," success ").concat(i))}function Ue(){var e=Re();return!!(e.match(/Mobi/i)||e.match(/Android/i)||e.match(/iPhone/i))}function Be(){return"micromessenger"==Re().toLowerCase().match(/MicroMessenger/i)}function ze(){var e=Re().toLowerCase().match(/cpu iphone os (.*?) like mac os/);return e&&e[1]||""}function qe(e,t){var i=function(e){var t=e.reduce((function(t,i,r){var n="".concat(i," module");return 0==r?n:r==e.length-1?"".concat(t," and ").concat(n):"".concat(t,", ").concat(n)}),"");return"should install ".concat(t)}(e);return console.error(i),{errorCode:t||ot.code,extendedData:i}}function Xe(e,t){return new we((function(i,r){r(qe(e,t))}))}var He="room not exist",Fe="device is not found",Ve="stream is not from zego",Ge="input param error",je="no preview",Qe="network is broken",We="stop retry",Ze="the user cancels the stream request.",Ke={code:1000002,message:"not login room"},Je={code:1000017,message:Qe},Ye={code:1000018,message:"local stream wrong"},$e={code:1001021,message:"set geoFence fail"},et={code:1100001,message:Ge},tt={code:1100002,message:"network timeout."},it={code:1100003,msg:"socket close"},rt={code:1100999,message:"unknown server error"},nt={code:1101002,message:"get app config fail"},ot={code:1101003,message:"Module not imported"},st={code:1002014,msg:He},at={code:1102017,message:"dispatch error"},ct={code:1102018,message:"token expired"},ut={code:1102022,message:"dispatch request timeout"},lt={code:1102023,message:"connect signal fail"},dt={code:1103001,message:Ge},ht={code:1103002,message:"browser do not support"},pt={code:1103011,message:"enumerate devices fail"},ft={code:1103012,message:"use camera device fail"},mt={code:1103021,message:"session request fail"},vt={code:1103022,message:"create offer error"},gt={code:1103044,message:Ve},yt={code:1103055,message:"publish stream no found"},bt={code:1103061,message:"get media fail"},_t={code:1103068,message:"update sdp fail"},St={code:1103089,message:Ze},Tt={code:1104001,message:"input parm error"},Et={code:1104021,message:"session request fail"},Ct={code:1104027,message:"server session closed"},wt={code:1104038,message:"resource mode is not supported"},It={code:1104042,message:Ze},Rt={code:1104043,message:"mini sdp error"},kt={code:1104044,message:"stream is not playing"},Pt=1006006,At=1106007,Dt=1106008,Nt={code:1000067,message:"Logged in room, setting scenario is not supported"},Ot={code:1103083,message:"sdp wrong format"},Mt={code:1103084,message:"mini sdp buffer size exceeded"},Lt={code:1103085,message:"url size exceeded"},xt={code:1103052,message:"publisher cdn push error"},Ut={code:1103074,message:"video track is not readable"},Bt=1103047,zt="track is not found",qt={code:1103048,message:Fe},Xt={code:1103045,message:"video is false"},Ht={code:1103046,message:"audio is false"},Ft=1103070,Vt="not support handle track",Gt={code:1000055,message:"cdn url is invalid"},jt="not support beauty effect",Qt={code:1103076,message:"audio track is not readable"},Wt={code:1017130,message:"get mini sdp error"},Zt={code:1017131,message:"parse mini sdp error"},Kt={code:1017132,message:"worker is invalid"},Jt=function(e){return e},Yt=function(e){return e},$t=function(e){return e},ei=function(e){return e},ti=function(e){return e},ii="/sdk/init",ri=ii,ni="/sdk/login",oi="listener",si={event:"/sdk/on_listener",listener:Yt,error:{ki:et}},ai={event:"/sdk/off_listener",listener:Yt,error:{ki:et}},ci=ii,ui={event:"/sdk/create_stream",error:{Ai:ht,ki:dt,Ni:{code:1103042,message:"screen canceled"},Ci:{code:1103010,message:"screen fail"},Di:{code:1103043,message:"screen not support"},zi:{code:1103053,message:"https is required"},Pi:bt,xi:{code:1103064,message:"get device not allowed"},Mi:{code:1103065,message:"device is not readable"},ji:{code:1103066,message:"device does not meet constraints"}},stream_type:Yt,screen:Jt,camera:Jt,custom:Jt,preview_conf:Jt,media_stream_id:Yt},li={event:"/sdk/start_publish",error:{Ui:dt,Li:tt,qi:ut,Bi:at,Gi:Je,Fi:gt,Hi:{code:1103099,message:"stream is not capturing"},Ji:{code:1103073,message:"video effect is starting, please operate after video effect is started"},Qi:Ke,Vi:{code:1103051,message:"publisher retry timeout"},Ki:{code:1003025,message:"stream is forbided by media server"},Wi:ct,Zi:{code:1103027,message:"server session closed"},Yi:{code:1103030,message:"negotiation timeout"},Xi:vt,$i:{code:1103023,message:"setLocalDescription error"},tn:{code:1103060,message:"session request timeout"},nn:mt,en:{code:1103025,message:"other side offer error"},rn:{code:1103028,message:"ice connection error"},un:{code:1103050,message:"websocket disconnected"},an:{code:1103024,message:"mediaDesc error"},hn:{code:1103026,message:"candidate error"},cn:{code:1103056,message:"publish is publishing"},ln:{code:1103058,message:"client ip changed"},dn:{code:1103059,message:"ttl over time"},vn:{code:1103067,message:"update sdp time out"},mn:_t,pn:{code:1103078,message:"publish stream poor and net probe poor"},gn:{code:1103100,message:"background process is start, but not subscribe yet"},bn:St,yn:Rt},urls:$t,is_center:ti,server_url:Yt,publish_option:Jt,message:Yt,stream_id:Yt,stream_sid:ei,room_id:Yt,video_en_codec_id:ei,cap_w:ei,cap_h:ei,w:ei,h:ei,video_en_fps:ei,video_en_bps:ei,audio_c_channel_count:ei,audio_en_bps:ei,aec_level:ei,ans_level:ei,agc:ti,enable_camera:ti,enable_mic:ti,video_activate:ti,audio_activate:ti,gw_version:ei,use_na:ei},di={event:"/publish/start",is_peer:ti,reason:Yt,url:Yt,ip:Yt,peer_id:ei,source_type:Yt,net_protocol:Yt,wait_consume:ei,dispatch_consume:ei,signal_consume:ei,is_center:ti},hi={event:"/publish/restart",stream_id:Yt,server_url:Yt,reason_code:ei},pi={event:"/sdk/publish",room_id:Yt,room_sid_string:Yt,retry_btime:ei,max_retry_interval:ei,fail_cnt:ei,continuous_fail_cnt:ei,probe_ip_cnt:ei,valid_probe_ip_cnt:ei,poor_quality_retry_cnt:ei,use_resource_type:$t,probe_not_trigger_retry_info:Jt,stop_reason:Yt,child_error:ei,try_time:ei,try_cnt:ei,server_url:Yt,publish_begin_time:ei,publish_state_time:ei,bitrate:ei,h:ei,w:ei,cap_w:ei,cap_h:ei,fps:ei,use_na:ei,env:ei,webrtc_sid:ei,stream_id:Yt,itemtype:Yt,total_d:ei,valid_d:ei,tempbroken_cnt:ei},fi=ei,mi=ei,vi=ei,gi=ei,yi=ei,bi=ei,_i={event:"/rtc/publish",tryidx:ei,url:Yt,ip:Yt,net_protocol:Yt,lsttime:ei,denied_info:Yt,dispatch_external_ip:Yt,total_stat:Jt,room_id:Yt,room_sid_string:Yt,resource_type:Yt,protocol:Yt,stop_reason:Yt,try_time:ei},Si={event:"/sdk/stop_publish",error:{ki:dt},stream_id:Yt,stream_sid:ei,room_id:Yt},Ti={event:"/sdk/start_play",error:{_n:{code:1000015,message:"streamID is empty"},wn:Tt,En:{code:1000014,message:"stream ID is too long"},Sn:{code:1000016,message:"stream ID contains illegal characters"},kn:Ke,Rn:{code:1103049,message:"repeated pull same stream"},In:tt,Tn:ut,An:at,Nn:Je,Cn:wt,Dn:{code:1104039,message:"play stream not found"},zn:{code:1104031,message:"player retry timeout"},Pn:Ct,xn:{code:1104035,message:"reset session push"},Mn:{code:1104030,message:"negotiation timeout"},Xi:{code:1104022,message:"create offer error"},$i:{code:1104023,message:"setLocalDescription error"},nn:Et,tn:{code:1104036,message:"session request timeout"},en:{code:1104025,message:"other side offer error"},rn:{code:1104028,message:"ice connection error"},un:{code:1104029,message:"websocket disconnected"},hn:{code:1104026,message:"candidate error"},an:{code:1104024,message:"mediaDesc error"},jn:{code:1104032,message:"player is playing"},ln:{code:1104033,message:"client ip changed"},dn:{code:1104034,message:"ttl is over time"},Un:{code:1104037,message:"probe time out"},Ln:{code:1104041,message:"stream quality poor and net probe poor"},qn:It,yn:Rt},room_id:Yt,urls:$t,is_center:ti,server_url:Yt,video_layer:ei,play_option:Jt,message:Yt,stream_id:Yt,stream_sid:ei,resource_mode:ei,src:Yt,video_codec_id:Yt,room_sid_string:Yt,is_multi:ti,audio_activate:ti,video_activate:ti,gw_version:ei,use_na:ei,biz_product:ei},Ei={event:"/play/start",is_peer:ti,reason:Yt,url:Yt,ip:Yt,peer_id:ei,source_type:Yt,net_protocol:Yt,wait_consume:ei,dispatch_consume:ei,signal_consume:ei,is_center:ti},Ci={event:"/play/restart",stream_id:Yt,server_url:Yt,reason_code:ei},wi={event:"/sdk/play",audio_cumulative_break_time:ei,audio_cumulative_decode_time:ei,video_cumulative_break_time:ei,video_cumulative_decode_time:ei,l3_a_break_time:ei,l3_a_decode_time:ei,l3_v_break_time:ei,l3_v_decode_time:ei,rtc_a_break_time:ei,rtc_a_decode_time:ei,rtc_v_break_time:ei,rtc_v_decode_time:ei,fft_audio:ei,fft_video:ei,room_id:Yt,room_sid_string:Yt,retry_btime:ei,max_retry_interval:ei,use_na:ei,fail_cnt:ei,continuous_fail_cnt:ei,probe_ip_cnt:ei,valid_probe_ip_cnt:ei,poor_quality_retry_cnt:ei,probe_not_trigger_retry_info:Jt,use_resource_type:$t,stop_reason:Yt,child_error:ei,try_time:ei,try_cnt:ei,webrtc_sid:ei,itemtype:Yt,server_url:Yt,play_begin_time:ei,play_state_time:ei,play_state_cnt:ei,first_frame_time:ei,protocol:Yt,dispatch_external_ip:Yt,total_stat:Jt,w:ei,h:ei,abrc:ei,vbrc:ei,vinfo:Jt,total_d:ei,valid_d:ei,tempbroken_cnt:ei},Ii={event:"/rtc/play",tryidx:ei,url:Yt,ip:Yt,stream_id:Yt,room_id:Yt,room_sid_string:Yt,net_protocol:Yt,lsttime:ei,denied_info:Yt,stop_reason:Yt,dispatch_external_ip:Yt,env:ei,resource_type:Yt,protocol:Yt,total_stat:Jt,vinfo:Jt,try_time:ei},Ri={event:"/sdk/stop_play",error:{ki:dt},room_id:Yt,stream_id:Yt,webrtc_sid:ei,stream_sid:ei,biz_product:ei},ki={Ai:ht,Bn:pt},Pi=Jt,Ai=Yt,Di={event:"/device/audio_device_changed",error:{Ai:ht,Bn:pt},interrupt:ei,device:Yt,device_name:Yt},Ni={event:"/device/video_device_changed",error:{Ai:ht,Bn:pt},interrupt:ei,device:Yt,device_name:Yt},Oi=Jt,Mi=Yt,Li=Yt,xi=ei,Ui=Yt,Bi=Yt,zi=ei,qi={event:"/sdk/destroy_stream",error:{Gn:Ye},stop_reason:Yt},Xi="/device/api/audio_output",Hi=Yt,Fi=Yt,Vi={event:"/liveroom/recv_stream_update_info",stream_update_type:Yt,stream_seq:ei,stream_list:Jt,error:{Fn:st}},Gi=Yt,ji=Yt,Qi=Yt,Wi={event:"/liveroom/get_current_stream_list",room_id:Yt,room_sid_string:Yt,stream_seq:ei,stream_size:ei,stream_list:Jt,use_ua:ei,error:{ki:dt,NOT_LOGIN:Ke}},Zi={event:"/sdk/net_first_video_frame",webrtc_sid:ei,fft_consumed:Jt,resource_type:Yt,reliability:ei,push_consumed:ei,prepare_recv_consumed:ei,connected_consumed:ei,protocol:Yt,biz_product:ei,dev_changed:ti},Ki={event:"/sdk/net_first_audio_frame",webrtc_sid:ei,fft_consumed:Jt,resource_type:Yt,reliability:ei,push_consumed:ei,prepare_recv_consumed:ei,connected_consumed:ei,protocol:Yt,biz_product:ei,dev_changed:ti},Ji="/app/lifecycle",Yi=Yt,$i={event:"/sdk/set_capture_volume",error:{ki:et}},er="/sdk/listener",tr=ei,ir=$t,rr={event:"/sdk/net_probe_result",is_switch:ti,is_publish:ti,stream_id:Yt,result:ei,node:Yt,net_quality:ei,probe_net_quality:ei},nr=Jt,or="/cdn/play",sr=Yt,ar=Yt,cr=Yt,ur="/l3/play",lr=ei,dr=ei,hr=Yt,pr=Yt,fr={event:"/publish/stream_resource",urls:$t,try_cnt:ei,is_center:ti},mr="/publish/server_connect",vr=Yt,gr=Yt,yr=ti,br=Yt,_r=ti,Sr={event:"/publish/create_session",sdp:Yt,is_mini:ti,gw_nodes:$t,gw_nodes_ttl:ei,gw_version:ei,webrtc_sid:ei},Tr=Yt,Er=ti,Cr=ei,wr="/publish/ice_connected",Ir=ei,Rr=ei,kr=Jt,Pr="/rtc/recv_reset_session",Ar="/rtc/ice_connection_state_changed",Dr=Yt,Nr=ei,Or=Yt,Mr=ti,Lr=Jt,xr=Jt,Ur={event:"/play/stream_resource",urls:$t,try_cnt:ei,is_center:ti},Br="/play/server_connect",zr=Yt,qr=ti,Xr=Yt,Hr=ti,Fr={event:"/play/create_session",sdp:Yt,is_mini:ti,gw_nodes:$t,gw_nodes_ttl:ei,gw_version:ei,webrtc_sid:ei},Vr=Yt,Gr=ti,jr=ei,Qr="/play/ice_connected",Wr=ei,Zr=Yt,Kr=ti,Jr=Jt,Yr=Jt,$r="/zegoconn/connect",en={event:"/zegoconn/proxy_connect",service_no:ei,proxy_link_sources:ei,recv_time:ei,connect_stream:ei},tn={event:"/zegoconn/proxy_broken",service_no:ei},rn={event:"/zegoconn/proxy_disconnect",service_no:ei},nn=ei,on=Yt,sn={event:"/sdk/publish_target",error:{ki:et,Hn:yt,Jn:Ke,Qn:{code:1103063,message:"publish target no response"},Vn:{code:1102021,message:"biz channel error."},Kn:{code:1102024,message:"invalid channel"},Wn:rt}},an=Yt,cn={event:"/liveroom/send_stream_extra_info",error:{ki:et,Zn:{code:1003050,message:"extra info of publishing stream is null"},Jn:Ke,Hn:yt,Yn:{code:1103062,message:"update stream info fail"}},stream_id:Yt,stream_extra_info:Yt,room_sid_string:Yt,room_id:Yt,send_seq:ei};function un(e){return"number"==typeof e}function ln(e){return"string"==typeof e}function dn(e){return"boolean"==typeof e}function hn(e){return void 0===e}function pn(e){return null!==e&&e instanceof Object}function fn(e){return"function"==typeof e}function mn(e){return e instanceof Array}function vn(e){return e instanceof Uint8Array}function gn(e){return e instanceof MediaStream}function yn(e){return e instanceof HTMLElement}function bn(e){return e instanceof HTMLMediaElement}function _n(e){return e instanceof ArrayBuffer}var Sn=ui.error.ki;function Tn(e){return/^([0-9a-zA-Z#!$%&()`'+-;<=.>@^_~,\\*])+$/.test(e)&&/^[^:/]*$/g.test(e)}function En(e){return!!(e.startsWith("rtmp://")||e.startsWith("avertp://")||e.startsWith("https://")&&e.endsWith(".flv")||e.startsWith("https://")&&e.endsWith(".m3u8"))}function Cn(e,t,i){t.success&&(i[e+"SuccessCallback"]=t.success),t.error&&(i[e+"ErrorCallback"]=t.error)}function wn(e,t){return t[e+"SuccessCallback"]}function In(e,t,i,r){Cn(e,{success:function(e,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];!function(e,t,i,r,n){switch(i){case"eventStart":e.eventStart(t,r);break;case"eventEndWithMsgInfo":e.eventEndWithMsgInfo(t,r,n[0]);break;case"addEventMsg":e.addEventMsg(t,r,n[0],n[1]);break;case"addEvent":e.addEvent(t,r);break;case"eventEnd":e.eventEnd(t,r);break;case"addMsgInfo":e.addMsgInfo(t,n[0])}}(t,i,e,r,n)}},r)}function Rn(e,t,i){return t?{code:e,message:i||"liveroom error"}:{code:0,message:""}}function kn(e,t){delete t[e+"SuccessCallback"],delete t[e+"ErrorCallback"]}function Pn(e,t){var i={code:-1,message:"server error"};return e>1e9&&(i.code=e-1e9+52e6),t&&(i.message=t),i}function An(e,t){var i={1016:"MULTI_ROOM_UNABLE",1105:"ROOM_MAX_USER_COUNT",1012:"PUBLISHER_ERROR_REPETITIVE_PUBLISH_STREAM",2002:"TOKEN_ERROR",2003:"ROOM_ERROR_LOGIN_TIMEOUT",2010:"TOKEN_ERROR",5022:"ROOM_COUNT_EXCEED"};return t?e>2e5&&e<3e5?i[e-2e5]:e<2e5?{50116:"TOKEN_ERROR",50117:"TOKEN_EXPIRED",50118:"TOKEN_ERROR",50119:"TOKEN_ERROR",50120:"TOKEN_ERROR",50121:"TOKEN_ERROR",50122:"TOKEN_ERROR",50123:"TOKEN_EXPIRED",50124:"TOKEN_ERROR",50125:"TOKEN_ERROR",50126:"TOKEN_ERROR",50127:"TOKEN_ERROR",50128:"TOKEN_ERROR"}[e]||i[e]||"ROOM_INNER_ERROR":i[e]||"ROOM_INNER_ERROR":""}function Dn(e,t,i,r){var n,o=[],s=[],a=[],c=[];i||(i=[]);for(var u=0;u<i.length;u++)if(i[u].anchor_id_name!=e&&i[u].id_name!=e&&i[u].user_id!=e){n=!1;for(var l=0;l<t.length;l++)if(i[u].stream_id===t[l].stream_id){i[u].extra_info!==t[l].extra_info&&a.push(i[u]),JSON.stringify(i[u].stream_attr_opts)!==JSON.stringify(t[l].stream_attr_opts)&&c.push(i[u]),n=!0;break}n||o.push(i[u])}for(var d=0;d<t.length;d++)if(t[d].anchor_id_name!=e&&t[d].id_name!=e&&t[d].user_id!=e){n=!1;for(var h=0;h<i.length;h++)if(t[d].stream_id===i[h].stream_id){n=!0;break}n||s.push(t[d])}for(t.splice(0),u=0;u<i.length;u++)t.push(i[u]);r(o,s,a,c)}function Nn(e,t){return 0==t?un(e)&&e%1==0&&e>=0:un(e)&&e%1==0&&e>0}function On(e,t,i){return t=null!=t?t:1,i=null!=i?i:1e4,un(e)&&e%1==0&&e>=t&&e<=i}function Mn(e,t){var i,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[];if(t=t||r.length,e)for(i=0;i<e;i++)n[i]=r[0|Math.random()*t];else{var o=void 0;for(n[8]=n[13]=n[18]=n[23]="-",n[14]="4",i=0;i<36;i++)n[i]||(o=0|16*Math.random(),n[i]=r[19==i?3&o|8:o])}return n.join("")}function Ln(e,t,i,r){if(!pn(e))return{result:!1,message:"Invalid constraint. Constraint Extend must be a object"};if(0===Object.keys(e).length)return{result:!1,message:"".concat(t," can not be a empty object")};for(var n=0,o=["exact","ideal","max","min"];n<o.length;n++){var s=o[n],a=e[s];if(un(a)&&!Nn(a,!1))return{result:!1,message:" ".concat(s," of ").concat(t," must be integer number")};if(un(i)&&un(a)&&a<i)return{result:!1,message:" ".concat(s," of ").concat(t," must greater than ").concat(i)};if(un(r)&&un(a)&&a>r)return{result:!1,message:" ".concat(s," of ").concat(t," cannot greater than ").concat(r)}}return{result:!0,message:"Constraint Extend OK."}}function xn(e,t,i,r,n){var o=Ln(e,t,r,n);return o.result||i&&i(Sn,o.message),o.result}function Un(e,t){for(var i=0,r=["frameRate","width","height"];i<r.length;i++){var n=r[i],o=e[n];if(hn(o))return t&&t(Sn," ".concat(n," is required when videoQuality is 4")),!1;if(un(o)&&!Nn(o,!1))return t&&t(Sn," ".concat(n," must be integer number")),!1;if(un(o)&&("width"===n||"height"===n)&&o<0)return t&&t(Sn," ".concat(n," must greater than 0.")),!1;if(un(o)&&"width"===n&&o>7680)t&&t(Sn," ".concat(n," cannot greater than 7680."));else if(un(o)&&"height"===n&&o>4320)t&&t(Sn," ".concat(n," cannot greater than 4320."));else if(pn(o)){if("width"===n&&!xn(o,n,t,0,7680))return!1;if("height"===n&&!xn(o,n,t,0,4320))return!1;if("frameRate"===n&&!xn(o,n,t))return!1}else if(!un(o)&&pn(o))return t&&t(Sn," ".concat(n," must be number or object")),!1}return!0}function Bn(e,t){if(hn(e))return t(Sn," bitrate is required when videoQuality is 4"),!1;if(un(e)){if(!On(e,0,10240))return t(Sn," bitrate must be integer number"),!1;if(!function(e,t){return!(e>10240&&(t(Sn," bitrate cannot greater than 10 Mbps"),1))}(e,t))return!1}else t(Sn," bitrate must be number");return!0}function zn(e){var t=e.message.match(/action:(\d+)/),i=t?Number(t[1]):NaN;return[Ti.error.dn,Ti.error.ln,li.error.dn,li.error.ln].includes(e)||[6].includes(i)}function qn(e,t,i){return e.push(t),e.length>i&&e.shift(),e.reduce((function(e,t){return e+t}))/e.length}function Xn(e){return e<600?97-Math.pow(.09*e,1.1):18*Math.exp(.002*(600-e))}function Hn(e,t){if(t)return e<=55?99-Math.pow(.8*e,1.18):U.PoorMinQuality;var i=100*e;return i<=40?96-Math.pow(i,1.22):U.PoorMinQuality}function Fn(e,t,i){if(hn(i))return Math.min(Xn(e),Hn(t,!0));var r=function(e){return e<=50?98-Math.pow(e,1.15):U.PoorMinQuality}(i);return.15*r+.85*Math.min(Xn(e),Hn(t,!1))}function Vn(e){return e>=U.ExcellentMinQuality?x.Excellent:e>=U.GoodMinQuality?x.Good:e>=U.MiddleMinQuality?x.Middle:e>=U.PoorMinQuality?x.Poor:x.Die}function Gn(){var e=!!window.RTCRtpScriptTransform;if(!e){var t=!!RTCRtpSender.prototype.createEncodedStreams,i=!1;try{new ReadableStream,i=!0}catch(e){console.error("Transferable streams are not supported.")}e=t&&i}return e}function jn(){return"function"==typeof RTCPeerConnection.prototype.setConfiguration}function Qn(e){for(var t,i=0,r=e.length,n="";i<r;)t=e.subarray(i,Math.min(i+32768,r)),n+=String.fromCharCode.apply(null,Array.from(t)),i+=32768;return btoa(n)}function Wn(e){var t=[];return e.getTracks().forEach((function(e){t.push("audio"===e.kind?"mic(".concat(e.id,",").concat(e.label,",").concat(e.muted,",").concat(e.enabled,",").concat(e.readyState,")"):"camera(".concat(e.id,",").concat(e.label,",").concat(e.muted,",").concat(e.enabled,",").concat(e.readyState,")"))})),t.join("|")}function Zn(e,t,i){t.info("audio"===e.kind?i+" "+"mic(".concat(e.id,",").concat(e.label,",").concat(e.muted,",").concat(e.enabled,",").concat(e.readyState,")"):i+" "+"camera(".concat(e.id,",").concat(e.label,",").concat(e.muted,",").concat(e.enabled,",").concat(e.readyState,")"))}function Kn(e,t,i){var r=(new Date).getTime(),n=(0,o.getReportSeq)();return function(e){var t=0;if(0==e.length)return t;for(var i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i),t|=0;return t>>>0}("".concat(e,"_").concat(t,"_").concat(i,"_").concat(r,"_").concat(n))}function Jn(e,t){return(e&1<<t)>>t}function Yn(e,t,i,r,n,o,s){return void 0===s&&(s=!1),e.createSpan(t,{key:n,bak_key:o,par:i},{key:r,par:i},r,s)}function $n(e){for(var t in e)pn(e[t])?$n(e[t]):e.hasOwnProperty(t)||(un(e[t])&&(e[t]=0),ln(e[t])&&(e[t]=""))}var eo=function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},to=function(){function e(){}return e.zegoSdp=function(e){var t=e.split("\r\n"),i=[],r=[];t.forEach((function(e){var t=e.match(/a=rtpmap:(\d+)\s+((H264\/90000)|(opus\/48000\/2))/);t&&t[1]&&t[2]&&("H264/90000"===t[2]&&i.push(t[1]),"opus/48000/2"===t[2]&&r.push(t[1]))}));var n=[];return t.map((function(e){var t=!0,o=e.match(/((a=rtcp-fb:)|(a=rtpmap:)|(a=fmtp:))(\d+)/);if(o&&o[5]&&(eo(eo([],i,!0),r,!0).some((function(e){return e==o[5]}))||(t=!1)),e.indexOf("m=video")>-1){var s=e.split(" ");e=eo([s[0],s[1],s[2]],i,!0).join(" ")}else e.indexOf("m=audio")>-1&&(s=e.split(" "),e=eo([s[0],s[1],s[2]],r,!0).join(" "));t&&n.push(e)})),n.join("\r\n")},e.getSDPByVideDecodeType=function(e,t,i,r){var n={str:"",arr:[],obj:{H264:[],H265:[],VP8:[],VP9:[],OTHER:[]}};if(!e.includes("m=video"))return e;var o=/m=video.+/.exec(e)[0];o=o.match(/[\s|\d]+/g)[1].replace(" ",""),n.str=o,n.arr=n.str.split(" "),n.arr.forEach((function(t){var i=new RegExp("a=rtpmap:"+t+".+").exec(e)[0];i.includes("H264")?n.obj.H264.push(t):i.includes("H265")?n.obj.H265.push(t):i.includes("VP8")?n.obj.VP8.push(t):i.includes("VP9")?n.obj.VP9.push(t):n.obj.OTHER.push(t)})),n.obj.OTHER.forEach((function(t){var i=new RegExp("a=fmtp:"+t+".+apt=(\\d+)").exec(e),r=i&&i[1];r&&(n.obj.H264.includes(r)?n.obj.H264.push(t):n.obj.H265.includes(r)?n.obj.H265.push(t):n.obj.VP8.includes(r)?n.obj.VP8.push(t):n.obj.VP9.includes(r)&&n.obj.VP9.push(t))}));var s=[];if("VP9"===t?s=eo(eo(eo([],n.obj.H265,!0),n.obj.H264,!0),n.obj.VP8,!0):"VP8"===t?s=eo(eo(eo([],n.obj.H265,!0),n.obj.H264,!0),n.obj.VP9,!0):"H264"===t?s=eo(eo(eo([],n.obj.H265,!0),n.obj.VP8,!0),n.obj.VP9,!0):"H265"===t&&(s=eo(eo(eo([],n.obj.VP8,!0),n.obj.H264,!0),n.obj.VP9,!0)),"H264"==t&&dn(i)){var a=function(e){return function(t){return!!t.includes("profile-level-id=")&&(e?!t.includes("profile-level-id=42e01f"):t.includes("profile-level-id=42e01f"))}},c=function(e){return function(t){if(!t.includes("profile-level-id="))return!1;switch(e){case V.BASE_LINE:return!t.includes("profile-level-id=42");case V.MAIN:return!t.includes("profile-level-id=4d");case V.HIGH:return!t.includes("profile-level-id=64");default:return!1}}},u=function(t){return function(){var i=[];return n.obj.H264.forEach((function(r){for(var n=new RegExp("a=fmtp:"+r+".+\\s\\n","g").exec(e)||[],o=0,s=t;o<s.length;o++)0!==n.filter(s[o]).length&&i.push(r);var a=new RegExp("a=fmtp:"+r+".+apt=(\\d+)").exec(e),c=a&&a[1];c&&i.includes(c)&&i.push(r)})),i}};s=s.concat(function(){for(var e=[],t=0,o=hn(r)||r!==G.HARD_SOFT_ENCODEC_FIRST?hn(r)||r!==G.HIGH_PROFILE_FIRST?[u([c(V.BASE_LINE),a(i)]),u([c(V.BASE_LINE),a(!i)]),u([a(i)]),u([a(!i)])]:[u([c(V.HIGH),a(i)]),u([c(V.HIGH),a(!i)]),u([a(i)]),u([a(!i)])]:[u([a(i),c(V.BASE_LINE)]),u([a(i)]),u([a(!i),c(V.BASE_LINE)]),u([a(!i)])];t<o.length;t++){if(e=(0,o[t])(),new Set(e).size!==n.obj.H264.length)break;e=[]}return e}())}return s.forEach((function(t){var i=n.arr.indexOf(t);i>=0&&n.arr.splice(i,1);var r=new RegExp("a=rtpmap:"+t+".+\\s\\n","g"),o=new RegExp("a=rtcp-fb:"+t+".+\\s\\n","g"),s=new RegExp("a=fmtp:"+t+".+\\s\\n","g");e=(e=(e=e.replace(r,"")).replace(o,"")).replace(s,"")})),e=e.replace(o,n.arr.join(" "))},e}(),io=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},ro=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},no=function(){function e(){var e=this;this.iceconnectionstatechangeTimes=0,this.isCheckAll=!1;var t=Ie.createElement("canvas");t.getContext("2d").fillStyle="rgba(255, 255, 255, 0)";try{this.localStream=t.captureStream()}catch(e){console.error("canvas captureStream error",e)}this.timer=setTimeout((function(){e.resolve("Detection timeout"),e.hangup()}),5e3)}return e.prototype.checkSupportByType=function(e,t){return io(this,void 0,void 0,(function(){var t,i,r=this;return ro(this,(function(n){switch(n.label){case 0:return this.checkType=e,t={},this.localPc=new RTCPeerConnection(t),this.remotePc=new RTCPeerConnection(t),i=new we((function(e){return r.resolve=e})),this.localPc.addEventListener("icecandidate",(function(e){return r.onIceCandidate(r.localPc,e)})),this.remotePc.addEventListener("icecandidate",(function(e){return r.onIceCandidate(r.remotePc,e)})),this.remotePc.addEventListener("iceconnectionstatechange",(function(t){"connected"===r.remotePc.iceConnectionState&&(r.iceconnectionstatechangeResult=!0),2==++r.iceconnectionstatechangeTimes&&r.iceCandidate&&(clearTimeout(r.timer),r.resolve("connected"===r.remotePc.iceConnectionState||"The browser does not support ".concat(e," format")),r.hangup())})),this.localStream.getTracks().forEach((function(e){return r.localPc.addTrack(e,r.localStream)})),[4,this.check(e)];case 1:return n.sent(),[4,i];case 2:return[2,n.sent()]}}))}))},e.prototype.check=function(e,t){return io(this,void 0,void 0,(function(){var i,r;return ro(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),t&&fn(this.localPc.addTransceiver)&&(this.localPc.addTransceiver("video",{direction:"sendonly"}),this.localPc.addTransceiver("audio",{direction:"sendonly"})),[4,this.localPc.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0})];case 1:return(i=n.sent()).sdp=to.getSDPByVideDecodeType(i.sdp,e),this.onCreateOfferSuccess(i),[3,3];case 2:return r=n.sent(),this.onCreateSessionDescriptionError(r),[3,3];case 3:return[2]}}))}))},e.prototype.onCreateOfferSuccess=function(e){return io(this,void 0,void 0,(function(){var t,i,r,n;return ro(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.localPc.setLocalDescription(e)];case 1:return o.sent(),[3,3];case 2:return t=o.sent(),this.onSetSessionDescriptionError(t),[2];case 3:return o.trys.push([3,5,,6]),[4,this.remotePc.setRemoteDescription(e)];case 4:return o.sent(),[3,6];case 5:return i=o.sent(),this.onSetSessionDescriptionError(i),[2];case 6:return o.trys.push([6,9,,10]),[4,this.remotePc.createAnswer()];case 7:return r=o.sent(),[4,this.onCreateAnswerSuccess(r)];case 8:return o.sent(),[3,10];case 9:return n=o.sent(),this.onCreateSessionDescriptionError(n),[2];case 10:return[2]}}))}))},e.prototype.onCreateAnswerSuccess=function(e){return io(this,void 0,void 0,(function(){var t,i;return ro(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.remotePc.setLocalDescription(e)];case 1:return r.sent(),[3,3];case 2:return t=r.sent(),this.onSetSessionDescriptionError(t),[2];case 3:return r.trys.push([3,5,,6]),[4,this.localPc.setRemoteDescription(e)];case 4:return r.sent(),[3,6];case 5:return i=r.sent(),this.onSetSessionDescriptionError(i),[2];case 6:return[2]}}))}))},e.prototype.onIceCandidate=function(e,t){return io(this,void 0,void 0,(function(){var i;return ro(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getOtherPc(e).addIceCandidate(t.candidate)];case 1:return r.sent(),[3,3];case 2:return i=r.sent(),console.error(this.checkType,"".concat(this.getPcName(e)," addIceCandidate error"),i),clearTimeout(this.timer),this.hangup(),this.resolve(i),[3,3];case 3:return"remotePc"===this.getPcName(e)&&t.candidate&&(this.iceCandidate=!0),this.iceconnectionstatechangeResult&&"localPc"===this.getPcName(e)&&(clearTimeout(this.timer),this.hangup(),this.resolve(!0)),[2]}}))}))},e.prototype.getOtherPc=function(e){return e===this.localPc?this.remotePc:this.localPc},e.prototype.getPcName=function(e){return e===this.localPc?"localPc":"remotePc"},e.prototype.onCreateSessionDescriptionError=function(e){console.error("Failed to create session description: ".concat(e.toString())),clearTimeout(this.timer),this.hangup(),this.resolve(e)},e.prototype.onSetSessionDescriptionError=function(e){console.error("Failed to set session description: ".concat(e.toString())),clearTimeout(this.timer),this.hangup(),this.resolve(e)},e.prototype.hangup=function(){this.localPc.close(),this.remotePc.close(),this.iceconnectionstatechangeTimes=0,this.localStream.getTracks().forEach((function(e){return e.stop()}))},e}();function oo(e,t){if(e&&!gn(e)&&e.zegoStream){if(t.info("cu.gs type:zego"),gn(e.stream))return e.stream;throw new Error("The ZegoLocalStream type requires first calling the capture api to capture the stream")}return e}var so=function(){return so=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},so.apply(this,arguments)},ao=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},co=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};function uo(e,t){return ao(this,void 0,void 0,(function(){return co(this,(function(i){return t&&fn(e.addTransceiver)&&(e.addTransceiver("video",{direction:"sendonly"}),e.addTransceiver("audio",{direction:"sendonly"})),[2,e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0})]}))}))}function lo(e,t,i,r,n){return ao(this,void 0,void 0,(function(){var o,s,a,c,u,l,d,h;return co(this,(function(p){switch(p.label){case 0:return o={webRTC:!1,customCapture:!1,camera:!1,microphone:!1,videoCodec:{H264:!1,H265:!1,VP8:!1,VP9:!1},screenSharing:e,errInfo:{}},r&&"screenSharing"===r?(t({result:e,errInfo:o.errInfo}),[2]):r&&"customCapture"!==r||(((s=Ie.createElement("video")).captureStream||s.mozCaptureStream)&&(o.customCapture=!0),"customCapture"!==r)?(a=navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia,c=function(){var e="https:"!==window.location.protocol&&"file:"!==window.location.protocol&&-1==window.location.hostname.indexOf("127.0.0.1")&&-1==window.location.hostname.indexOf("localhost");if(e)throw console.error("webrtc requires https or localhost"),new Error("webrtc requires https or localhost");return!e}(),r&&"camera"!==r&&"microphone"!==r?[3,9]:a?c?[3,1]:(o.camera=!1,o.microphone=!1,console.error("webrtc requires https or localhost"),[3,9]):[3,9]):(t({result:o.customCapture,errInfo:o.errInfo}),[2]);case 1:if(r&&"camera"!==r)return[3,5];p.label=2;case 2:return p.trys.push([2,4,,5]),[4,yo({video:!0,audio:!1})];case 3:return(u=p.sent())&&(o.camera=!0)&&u.getTracks().forEach((function(e){e.stop()})),[3,5];case 4:return l=p.sent(),o.errInfo.camera={name:l.name,message:l.message},console.error("camera devices detect error: ",l.name,l.message),[3,5];case 5:if(r&&"microphone"!==r)return[3,9];p.label=6;case 6:return p.trys.push([6,8,,9]),[4,navigator.mediaDevices.getUserMedia({audio:!0,video:!1})];case 7:return(d=p.sent())&&(o.microphone=!0)&&d.getTracks().forEach((function(e){return e.stop()})),[3,9];case 8:return h=p.sent(),o.errInfo.microphone={name:h.name,message:h.message},console.error("microphone devices detect error: ",h.name,h.message),[3,9];case 9:return"camera"===r||"microphone"===r?(t({result:o[r],errInfo:o.errInfo}),[2]):(function(e,t,i,r){ao(this,void 0,void 0,(function(){var n,o,s,a,c,u,l,d,h,p;return co(this,(function(f){switch(f.label){case 0:return n={webRTC:!1,H264:!1,VP8:!1,VP9:!1,H265:!1},i?1!==t||"VP8"!==i&&"H264"!==i?[3,2]:[4,(p=new no).checkSupportByType(i,r)]:[3,2];case 1:return dn(o=f.sent())?(n[i]=o,[2,e(n)]):(n[i]=!1,[2,e(n,o)]);case 2:if("webRTC"!==i&&1!==t)return[3,7];f.label=3;case 3:return f.trys.push([3,5,,6]),[4,uo(new RTCPeerConnection,r)];case 4:return f.sent(),n.webRTC=!0,[3,6];case 5:return s=f.sent(),e&&e(n,s),[3,6];case 6:if("webRTC"===i)return[2,e(n)];f.label=7;case 7:if(1===t){for(a="",u=[],l=0,d=c=["VP8","H264"];l<d.length;l++)h=d[l],p=new no,u.push(p.checkSupportByType(h));return Promise.all(u).then((function(t){t.forEach((function(e,t){dn(e)?n[c[t]]=!0:(n[c[t]]=!1,a=e)})),a?e(n,a):e(n)})),[2]}try{uo(new RTCPeerConnection,r).then((function(t){if(n.webRTC=!0,t&&t.sdp){var r=t.sdp.split("\r\n");if(n.H264=r.some((function(e){return e.startsWith("a=rtpmap:")&&e.indexOf("H264/")>-1})),"H264"===i)return e(n);if(n.VP8=r.some((function(e){return e.startsWith("a=rtpmap:")&&e.indexOf("VP8/")>-1})),"VP8"===i)return e(n);n.VP9=r.some((function(e){return e.startsWith("a=rtpmap:")&&e.indexOf("VP9/")>-1})),n.H265=r.some((function(e){return e.startsWith("a=rtpmap:")&&e.indexOf("H265/")>-1})),e&&e(n)}}))}catch(t){e&&e(n,t)}return[2]}}))}))}((function(e,i){r||(o.videoCodec.H264=e.H264,o.videoCodec.H265=e.H265,o.videoCodec.VP8=e.VP8,o.videoCodec.VP9=e.VP9,o.webRTC=e.webRTC),i&&(ln(i)?o.errInfo.extendedDate=i:o.errInfo.webRTC={name:i.name,message:i.message},console.error("videoCodec detect error: "+i)),t&&t(r?{result:e[r],errInfo:o.errInfo}:o)}),i,r,n),[2])}}))}))}var ho={supportDetection:lo};function po(e){var t={};for(var i in e){var r=e[i];if(r instanceof Object){var n=r instanceof MediaStream||r instanceof HTMLElement;t[i]=n?r:po(r)}else void 0!==r&&(t[i]=r)}return t}function fo(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),r=new Uint8Array(i.length),n=0;n<i.length;++n)r[n]=i.charCodeAt(n);return r}function mo(e){return Uint8Array.from(Array.from(window.unescape(encodeURIComponent(e))).map((function(e){return e.charCodeAt(0)})))}function vo(e){var t=e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"})),i=[],r=[];return t.forEach((function(e,t){var n=function(e,t){return function(e){return e.trim().split("\n").map((function(e){return e.trim()}))}(e).filter((function(e){return 0===e.indexOf("a=candidate:")}))}(e).map((function(e){return r.push(e),function(e){for(var t,i={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":i.relatedAddress=t[r+1];break;case"rport":i.relatedPort=parseInt(t[r+1],10);break;case"tcptype":i.tcpType=t[r+1];break;case"ufrag":i.ufrag=t[r+1],i.usernameFragment=t[r+1];break;default:i[t[r]]=t[r+1]}return i}(e)}));i.push.apply(i,n)})),[i,r]}function go(e){var t="rtc";switch(e){case 0:case 3:default:t="rtc";break;case 1:t="cdn";break;case 2:t="l3"}return t}function yo(e){var t=this;return new we((function(i,r){return ao(t,void 0,void 0,(function(){var t,n,o,s,a,c;return co(this,(function(u){switch(u.label){case 0:t=[so({},e),so(so({},e),{video:{width:360}}),so(so({},e),{video:{width:640}}),so(so({},e),{video:{width:720}}),so(so({},e),{video:{width:854}}),so(so({},e),{video:{width:1280}})],n=null,o=null,s=0,u.label=1;case 1:if(!(s<t.length))return[3,6];a=t[s],u.label=2;case 2:return u.trys.push([2,4,,5]),[4,navigator.mediaDevices.getUserMedia(a)];case 3:return n=u.sent(),[3,6];case 4:return c=u.sent(),o=c,[3,5];case 5:return s++,[3,1];case 6:return n?i(n):r(o),[2]}}))}))}))}function bo(e,t,i){var r=JSON.parse(JSON.stringify(e));if(t.forEach((function(e){var t=r.indexOf(e);t>=0&&(r.splice(t,1),r.push(e))})),!i){var n=r.findIndex((function(t){return t===e[0]}));n>0&&(r.splice(n,1),r.unshift(e[0]))}return r}function _o(e,t){var i;if("chrome"===t||"safari"===t)switch(e){case 0:i="tls";break;case 1:i="tcp";break;case 2:i="udp"}else if("firefox"===t)switch(e){case 0:i="tcp";break;case 5:i="udp"}return i}function So(e,t){if(void 0===t&&(t="video"),!(e instanceof MediaStream))return null;for(var i="video"==t,r=document.querySelectorAll(t),n=null,o=0;o<r.length;o++){var s=r[o],a=s.srcObject;if(a&&(a===e||(i?a.getVideoTracks()[0]===e.getVideoTracks()[0]:a.getAudioTracks()[0]===e.getAudioTracks()[0]))){if(s.currentTime)return s;n=s}}return n}function To(e,t){void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices().then((function(t){for(var i=[],r=[],n=[],o=0;o<t.length;o++){var s=t[o];"audioinput"===s.kind&&i.push({deviceName:s.label,deviceID:s.deviceId}),"audiooutput"===s.kind&&r.push({deviceName:s.label,deviceID:s.deviceId}),"videoinput"===s.kind&&n.push({deviceName:s.label,deviceID:s.deviceId})}e&&e({microphones:i,speakers:r,cameras:n})})).catch((function(e){console.error("enumerate devices wrong "+e),t&&t(ki.Bn)})):t&&t(ki.Ai)}var Eo="zc.cs",Co="zc.ds",wo="zc.sps.0",Io="zc.sps.1",Ro="zc.sps.0.0",ko="zc.sps.1.0",Po="zc.smsi.0",Ao="zc.scsu",Do="zc.rdh.a",No="zc.rdh.hfwur",Oo="zc.psh.0",Mo="zc.psh.1",Lo="zc.tsh.rngn.0",xo="zc.tsh.rngn.1",Uo="zc.tsh.dgnb",Bo="zc.s.bwh",zo="zc.s.ut",qo="zc.s.smwc",Xo="zc.s.cs.0",Ho="zc.s.sct",Fo="zc.s.cs.1",Vo="zc.s.sm",Go="zc.s.hrd",jo="zc.s.hpd",Qo="zc.s.hprsd",Wo="zc.s.smd",Zo="zc.s.smda",Ko="zc.s.cmt",Jo="zc.s.sh",Yo="zc.s.sss",$o="zc.s.apas",es="zc.s.snp",ts="zc.s.dgn",is="zc.wcs.ml",rs="zc.wcs.csws.1",ns="zc.wcs.smd",os="zsc.ssgn",ss="zsc.ccns",as="zsc.ucgl",cs="zc.p.0.sp.0",us="zc.p.ps",ls="zc.p.0.ocpss",ds="zc.p.0.ocos",hs="zc.p.0.oslds",ps="zc.p.0.ogrd",fs="zc.p.0.ormd",ms="zc.p.0.orci.0",vs="zc.p.0.orci.1",gs="zc.p.0.oic",ys="zc.p.0.ocsc",bs="zc.p.0.oicsc",_s="zc.p.0.spqt",Ss="zc.p.0.cpqut.1",Ts="zc.p.0.upq",Es="zc.p.0.orrs",Cs="zc.p.0.orcs",ws="zc.p.0.sci",Is="zc.p.0.psr",Rs="zc.p.0.od",ks="zc.p.0.ssl.0",Ps="zc.p.0.orumd",As="zc.p.0.ss",Ds="zc.p.0.scd",Ns="zc.p.1.sp.0",Os="zc.p.ocpss.1",Ms="zc.p.hcsws.1",Ls="zc.p.ocos.1",xs="zc.p.oslds.1",Us="zc.p.ormd.1",Bs="zc.p.orci.1",zs="zc.p.orpe.1",qs="zc.p.oic.1",Xs="zc.p.oicsc.1",Hs="zc.p.spqt.1",Fs="zc.p.upq.1",Vs="zc.p.gs.1",Gs="zc.p.orrs.1",js="zc.p.orcs.1",Qs="zc.p.orss.1",Ws="zc.p.ogrs.1",Zs="zc.p.sci.1",Ks="zc.p.psr.1",Js="zc.p.ssl.1",Ys="zc.p.1.nqi",$s="zc.p.1.scd",ea="zc.p.1.oce",ta="zc.p.1.smsbpm",ia="zc.p.1.sms",ra="zc.p.1.mst",na="zc.p.1.spsf",oa="zc.uslq",sa="zc.sr.uud",aa="zc.hcid.pu",ca="zc.sr.sd",ua="zc.sr.chdtr",la="zc.sr.sprd",da="zc.sr.srptc.0",ha="zc.sr.cnia.0",pa="zc.p.scv",fa="zc.sh.msbss",ma="zc.sh.ms",va="zc.sh.psl",ga="zc.as.smss",ya="zc.as.sass",ba="zc.as.s.0",_a="zc.srs",Sa="zc.irs",Ta="zc.ssh",Ea="zc.wmh.db",Ca="zc.ups.0",wa="zc.crh.a.0",Ia="zc.hrh.smt.0",Ra="zc.vam.rv",ka="zc.vam.iwg",Pa="zc.vam.vam",Aa=function(){function e(e,t){this.Xn=e,this.$n=t,this.debug=!1,this.testEnvironment=!1,this.pullLimited=!0,this.useNetAgent=!0,this.configOK=!1,this.relateService=[],this.role=2,this.maxMemberCount=0,this.roomCreateFlag=1,this.netMode=K.Default,this.callbackList={},this.experimentalAPIList={onRecvRoomMuteVideoStream:0,onRecvRoomMuteAudioStream:0},this.publishStreamList={},this.waitPublishStreamList={},this.streamUrlMap={},this.cmdCallback={},this.customUrl=[],this.customPlayUrl=[],this.turnToTcp=!1,this.turnOverTcpOnly=void 0,this.audioEffectBuffer={},this.audioBitRate=48e3,this.cdnSeq=0,this.engineDestroy=!1,this.listenerList={roomStreamUpdate:[],streamExtraInfoUpdate:[],playerStateUpdate:[],publisherStateUpdate:[],screenSharingEnded:[],publishQualityUpdate:[],playQualityUpdate:[],remoteCameraStatusUpdate:[],remoteMicStatusUpdate:[],soundLevelUpdate:[],capturedSoundLevelUpdate:[],videoDeviceStateChanged:[],audioDeviceStateChanged:[],deviceError:[],_deviceError:[],_remoteCameraStatusUpdate:[],_remoteMicStatusUpdate:[],_streamUpdated:[],receiveRealTimeSequentialData:[],beautyEffectOverload:[],playerRecvSEI:[],beautyEffectError:[],_engineConfigUpdate:[],backgroundEffectError:[],exceptionUpdate:[],networkQuality:[],mixerSoundLevelUpdate:[],autoMixerSoundLevelUpdate:[],_engineDestroy:[],recvExperimentalAPI:[]},this.reportList={},this.reportSeqList={startPublish:{},rePublish:{},startPlay:{},rePlay:{},stopPublish:{},stopPlay:{}},this.streamTrigger={},this.audioStreamList={},this.deviceInfos=null,this.deviceChangeTimer=null,this.deviceStateOut=!1,this.customUa=!1,this.testNetPackageSize=!1,this.testSignalConnectCount=0,this.streamRetryTime=300,this.checkList=[],this.anchor_info={anchor_id:"",anchor_id_name:"",anchor_nick_name:""},this.streamConnectTime=0,this.defaultConnTime=5,this.clientIP="",this.accessClientIp="",this.isMultiOuter=!1,this.type="PUBLIC",this.roomList=[],this.tempRoomList=[],this.isMultiRoom=!1,this.browser="",this.unregisterSeiFilter="",this.isTestMode=!1,this.debugLog=!1,this.netAppConfigDelay=0,this.seiConfig={emulationPreventionByte:!1},this.playAccelerate=!0,this.connectChanged=!1,this.autoSwitchDeviceSetting={camera:!1,microphone:!1},this.unSendMessageList=[],this.scenario=H.Default,this.testStreamRetryMode=0,this.testStreamRetryCount=10,this.supportDispatchByPass=!1,this.testStreamStatusSeq=0,this.engineConfig={keepAudioTrack:!0,playClearLastFrame:!0,previewClearLastFrame:!0,mixingAudioDelay:0,baseMixingAudioDelay:0,adaptCustomUA:!1,allowReplaceEmptyTrack:!1,publishQualityInterval:0,playQualityInterval:0},this.te=!0,this.ie=!1,this.player265Validated=!1,this.player265ReceiverList=[],this.logReportCallback=In,this.unregisterCallback=kn,this.decodeServerError=Pn,this.getLiveRoomError=An,this.getServerError=Rn,this.mergeStreamList=Dn,this.actionSuccessCallback=wn,this.checkValidNumber=On,this.uint8arrayToBase64=Qn,this.getSeq=o.getSeq,this.getReportSeq=o.getReportSeq,this.cdnSeqV2=(new Date).getTime()}return Object.defineProperty(e.prototype,"networkState",{get:function(){var e;return null===(e=this.rtm)||void 0===e?void 0:e.stateCenter.networkState},set:function(e){var t;(null===(t=this.rtm)||void 0===t?void 0:t.stateCenter)&&!hn(e)&&(this.rtm.stateCenter.networkState=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMiniSdp",{get:function(){if(!this.te&&!this.ie)return!1;if(!window.WebAssembly||!window.Worker)return!1;var e=this.settingConfig.getSetting("open_mini_sdp");return!!dn(e)&&(this.Xn.info("zc.c.ims setting: "+e),e)},enumerable:!1,configurable:!0}),e.prototype.setIsMiniSdp=function(e){this.settingConfig.setUserValue("open_mini_sdp",e)},Object.defineProperty(e.prototype,"streamCenter",{get:function(){return this.ee},set:function(e){this.ee=e},enumerable:!1,configurable:!0}),e.prototype.getRequestId=function(){return this.idName+"-"+(0,o.getSeq)()},e.prototype.actionListener=function(e){for(var t=this,i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];if(!["playQualityUpdate","publishQualityUpdate","soundLevelUpdate","capturedSoundLevelUpdate","playerRecvSEI","_remoteCameraStatusUpdate","_remoteMicStatusUpdate","_streamUpdated","_deviceError","networkQuality","exceptionUpdate","mixerSoundLevelUpdate","autoMixerSoundLevelUpdate"].includes(e)&&this.listenerList[e]){var n=this.reporter.createSpan(F.H,{key:oi},{key:""},er);n.setAttributes({listener:e,listener_params:JSON.stringify(i)}),["deviceError","streamExtraInfoUpdate","publisherStateUpdate","playerStateUpdate","roomStreamUpdate"].includes(e)&&this.Xn.info("zc.al ".concat(e," ").concat(JSON.stringify(i))),n.end()}this.listenerList[e]&&this.listenerList[e].forEach((function(r){try{setTimeout((function(){r.apply(void 0,i)}),0)}catch(i){t.Xn.error("zc.sc.al "+e+" "+i)}}))},e.prototype.getRoomByRoomID=function(e){return this.roomList.find((function(t){return t.roomID==e}))},e.prototype.getPlayRoom=function(e){return this.roomList.find((function(t){return!!t.streamList.find((function(t){return t.stream_id==e}))}))},e.prototype.callExperimentalAPI=function(e){var t=this;return new Promise((function(i,r){var n=e.method;void 0!==t.experimentalAPIList[n]&&(t.experimentalAPIList[n]=1),i(void 0)}))},e.prototype.onExperimentalAPICallback=function(e,t){this.experimentalAPIList[e]&&this.actionListener("recvExperimentalAPI",t)},e.prototype.destroy=function(){this.ee=null},e}(),Da=Wi,Na="zb.sh.usi",Oa=function(){function e(e,t,i,r,n){this.Xn=e,this.re=t,this.rtm=i,this.ee=r,this.se=n,this.oe=0,this.ue=0,this.ae=0,this.he=!1,this.ce=null,this.fe=2e3,this.de=5e3,this.roomID=n,this.logger=e,this.stateCenter=t}return Object.defineProperty(e.prototype,"ve",{get:function(){return this.re.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reporter",{get:function(){return this.ve},enumerable:!1,configurable:!0}),e.prototype._setCDNInfo=function(e,t){var i=t.urls_flv,r=t.urls_m3u8,n=t.urls_flv_plus,o=t.urls_m3u8_plus,s=t.urls_https_flv,a=t.urls_https_m3u8,c=t.urls_rtmp;e.urlFlv=mn(i)?i[0]||"":ln(i)?i:"",e.urlHls=mn(r)?r[0]||"":ln(r)?r:"",e.urlFlvPlus=mn(n)?n[0]||"":ln(n)?n:"",e.urlHlsPlus=mn(o)?o[0]||"":ln(o)?o:"",e.urlHttpsFlv=mn(s)?s[0]||"":ln(s)?s:"",e.urlHttpsHls=mn(a)?a[0]||"":ln(a)?a:"",e.urlRtmp=mn(c)?c[0]||"":ln(c)?c:""},e.prototype.onStreamUpdated=function(e,t,i){},e.prototype.onStreamExtraInfoUpdated=function(e,t){},e.prototype.onStreamAttrUpdated=function(e,t){},e.prototype.handleStreamStart=function(e,t){var i="zb.sh.hss";Me(this.Xn,i,"stream update"),this.room=t,e.body?(this.fe=e.body.stream_list_hb_wait_merge_time||2e3,this.de=e.body.stream_list_push_merge_timeout||5e3,this.he=!1,this.handleFullUpdateStream(e.body.stream_seq,e.body.stream_info||[]),this._handleReconnectStream(e.body.stream_info),Le(this.Xn,i)):this.Xn.error(i+" server response wrong")},e.prototype.onPublishStateUpdate=function(e,t,i){},e.prototype._updateStreamInfo=function(e,t,i,r,n){var o,s,a=this;void 0===i&&(i=""),Me(this.Xn,Na);var c=i,u=null===(o=this.room)||void 0===o?void 0:o.streamList.find((function(t){return t.stream_id===e}));u||this.Xn.info(Na+" stream not in room cmd "+t);var l={stream_id:e,extra_info:c};2002!==t&&2003!==t||(l.stream_sid=(null==u?void 0:u.stream_sid)||"");var d=JSON.stringify(l),h={sub_cmd:t,stream_msg:d,third_token:null===(s=this.room)||void 0===s?void 0:s.token},p=this.room;if(this.re.useNetAgent){var f=this.rtm.liveRoomHandler.sendStreamUpdate(h,(function(i,n){a.handleStreamUpdateRsp(i,e,t),r&&r(i,n)}),(function(o,s){var c=a.room,u=a.rtm.stateCenter.roomModulesList.find((function(e){return e.roomID===(null==c?void 0:c.roomID)})),l=function(){return(null==u?void 0:u.isTryLogin())||"CONNECTING"===(null==u?void 0:u.roomState)},d=function(){a.Xn.warn(Na+" resend stream update "+t),a._updateStreamInfo(e,t,i,r,n)};if(c&&((null==u?void 0:u.isLogin())||l())&&o.code&&o.code==tt.code&&c.streamInfoList[e].seq==s)setTimeout((function(){if(2001==t&&a.re.publishStreamList[e]&&a.re.publishStreamList[e].state==T.update_info||2002==t)if(l()){a.rtm.stateCenter.onListener("_roomStateUpdate",(function e(t,i){var r=function(){a.rtm.stateCenter.offListener("_roomStateUpdate",e)};t===(null==c?void 0:c.roomID)&&"CONNECTED"===i?(d(),r()):t===(null==c?void 0:c.roomID)&&"DISCONNECTED"===i&&r()}))}else d();else n&&n(tt)}),0);else if(o.body&&o.body.err_code){var h=a.re.getServerError(o.body.err_code,a.re.useNetAgent,o.body.err_message);[1011,1000002002].includes(h.code)&&(h=ct),n&&n(h,s),t===E&&a.onPublishStateUpdate(1,e,h)}}),{sessionID:null==p?void 0:p.sessionID,roomID:null==p?void 0:p.roomID,roomSessionID:null==p?void 0:p.roomSessionID});[2001,2002].includes(t)&&(this.room.streamInfoList[e]={seq:f})}xe(this.Xn,Na,"cmd: "+t+", roomid: ".concat(null==p?void 0:p.roomID,", stream: ").concat(e))},e.prototype.updateStreamInfo=function(e,t,i,r,n){var o,s=this;(void 0===i&&(i=""),this.room)?(2001!==t&&2002!==t||(o=this.ve.createSpan(F.H,{key:ni,par:this.se},{key:""},"/liveroom/send_stream_update_info")).setAttributes({stream_update_type:Gi(2001===t?"stream added":2002===t?"stream deleted":""),stream_extra_info:ji(i),stream_id:Qi(e)}),this._updateStreamInfo(e,t,i,(function(e,i){[2001,2002].includes(t)&&(o.setAttributes({send_seq:i}),o&&o.end()),r&&r(e,i)}),(function(e,i){[2001,2002].includes(t)&&(o.setAttributes({send_seq:i}),s.ve.setError(o,e)),n&&n(e,i)}))):this.Xn.warn(Na+" "+He)},e.prototype.handleStreamUpdateRsp=function(e,t,i){var r,n,o,s;if(this.rtm.isDisConnect())this.Xn.warn("zb.sh.hsur not login");else if(0==e.body.err_code){this.Xn.info("zb.sh.hsur stream seq "+this.ue+" server seq "+e.body.stream_seq);var a=this.room;if(a){if((null===(r=null==e?void 0:e.body)||void 0===r?void 0:r.token_remain_time)&&(this.re.getRoomByRoomID(null===(n=null==e?void 0:e.header)||void 0===n?void 0:n.room_id)?this.rtm.resetRoomTokenTimer(e.header.room_id,e.body.token_remain_time):this.Xn.error("zb.sh.hsur room no found ignore "+JSON.stringify(null===(o=e.header)||void 0===o?void 0:o.room_id))),this.re.useNetAgent){this.handleStreamSync(e,t,i);var c=a.streamInfoList[t],u=null===(s=e.header)||void 0===s?void 0:s.seq;c&&c.seq===u?delete a.streamInfoList[t]:this.Xn.info("zb.sh.hsur ".concat(JSON.stringify(t)," udp stream info; rsp seq: ").concat(u,", cur seq: ").concat(null==c?void 0:c.seq," "))}}else this.Xn.info("hsur.0 room no found")}else this.Xn.error("zb.sh.hsur stream update error "+e.body.err_code)},e.prototype.handleStreamSync=function(e,t,i){if(this.handleStreamRsp(this.room,t,{stream_id:t,stream_sid:e.body.stream_sid,stream_ver:e.body.stream_ver,stream_nid:e.body.stream_nid,id_name:this.re.idName,nick_name:this.re.nickName},i),e.body.stream_seq>this.ue+1)return this.Xn.info("zb.sh.hss.1 seq diff server: "+e.body.stream_seq+" client "+this.ue),void this.fetchStreamList();this.ue=e.body.stream_seq;var r=this.room.streamList.find((function(e){return e.stream_id==t}));r&&e.body.stream_ver>r.stream_ver&&this.fetchStreamList(t)},e.prototype.handleStreamRsp=function(e,t,i,r){var n=this.re.publishStreamList[t],o=e.streamList.find((function(e){return e.stream_id==t}));if(this.Xn.info("hsur.0 cmd "+r+" "+!!o),o&&2002===r){var s=e.streamList.findIndex((function(e){return e.stream_id==t}));this.Xn.info("hsur.0 stream index "+s),s>-1&&e.streamList.splice(s,1)}n?(n.state==T.update_info&&(n.state=T.publishing,2001!==r||o||e.streamList.push(i),this.onPublishStateUpdate(0,t,{code:0,message:""})),o&&o.stream_sid!==i.stream_sid&&(this.Xn.info("hsur.0 update sid. "+t+" origin:"+o.stream_sid+", new:"+i.stream_sid),o.stream_sid=i.stream_sid)):this.Xn.info("hsur.0 stream is not exist")},e.prototype.handleFetchStreamListRsp=function(e,t){var i,r,n,o,s,a,c="zb.sh.hfslr";if(Me(this.Xn,c,t),this.he=!1,this.ve.spanEnd({key:Da.event,par:this.se},{stream_seq:Da.stream_seq(null===(i=e.body)||void 0===i?void 0:i.stream_seq),stream_size:Da.stream_size(null===(n=null===(r=e.body)||void 0===r?void 0:r.stream_info)||void 0===n?void 0:n.length),stream_list:Da.stream_list(null===(o=e.body)||void 0===o?void 0:o.stream_info),error:(null===(s=null==e?void 0:e.body)||void 0===s?void 0:s.err_code)||(null==e?void 0:e.code),message:(null===(a=null==e?void 0:e.body)||void 0===a?void 0:a.err_message)||(null==e?void 0:e.msg)}),0===e.body.err_code)if(this.ue!==e.body.stream_seq){if(this.ue>e.body.stream_seq)return this.Xn.error(c+" less seq"),void this.fetchStreamList(t);if(this.ae>e.body.stream_seq)this.Xn.info(c+" less than max fetch stream seq ");else{var u=e.body.stream_info;this.re.useNetAgent&&t&&(u=e.body.stream_info.filter((function(e){return e.stream_id===t}))),this.handleFullUpdateStream(e.body.stream_seq,u),xe(this.Xn,c)}}else this.Xn.info(c+" same seq");else this.Xn.info(c+" server error=",e.body.err_code)},e.prototype.syncPublishStreamList=function(){var e="zb.sh.spsl";Me(this.Xn,e);var t=function(e){var t=i.re.publishStreamList[e];if(t.state===T.publishing){var r=i.room.streamList.findIndex((function(t){return t.stream_id===e}));t.roomID===i.room.roomID&&-1===r&&(t.state=T.update_info,i.updateStreamInfo(e,E,t.extra_info,(function(e){})))}},i=this;for(var r in this.re.publishStreamList)t(r);xe(this.Xn,e)},e.prototype.handleFullUpdateStream=function(e,t){var i=this,r="zb.sh.hfus";Me(this.Xn,r),this.ue=e,this.ae<e&&(this.ae=e),this.Xn.debug(r+" server seq "+this.ue),t=t.filter((function(e){return 1!==e.stream_type})),this.re.mergeStreamList(this.re.idName,this.room.streamList,t,(function(e,t,n,o){0!==e.length&&(i.Xn.debug(r+" callback addstream"),i.onStreamUpdated(i.se,1,i.makeCallbackStreamList(e))),0!==t.length&&(i.Xn.debug(r+" callback delstream"),i.onStreamUpdated(i.se,0,i.makeCallbackStreamList(t))),0!==n.length&&(i.Xn.debug(r+" callback updatestream"),i.onStreamExtraInfoUpdated(i.se,i.makeCallbackStreamList(n))),0!==o.length&&(i.Xn.warn(r+" callback updateAttrstream"),i.onStreamAttrUpdated(i.se,i.makeCallbackStreamList(o)))})),this.syncPublishStreamList(),xe(this.Xn,r)},e.prototype.handlePushStreamUpdateMsg=function(e){var t="zb.sh.hpsum";Me(this.Xn,t,JSON.stringify(e));var i=e.body.stream_info;if(i&&0!==i.length){if(i=i.filter((function(e){return 1!==e.stream_type})),this.ue+1!==e.body.stream_seq)return Me(this.Xn,t,"updatestream 1"),void this.fetchStreamList();if(e.body.stream_seq<this.ae)return Me(this.Xn,t,"updatestream 2"),void this.fetchStreamList();switch(this.ue=e.body.stream_seq,e.body.stream_cmd){case k:this.me(i);break;case 12002:this.pe(i);break;case 12003:this._handleUpdatedStreamList(i)}xe(this.Xn,t)}else this.Xn.info(t+", emtpy list")},e.prototype.me=function(e){var t="zb.sh.hasl";Me(this.Xn,t);for(var i,r=[],n=0;n<e.length;n++)if(e[n].anchor_id_name!=this.re.idName&&e[n].id_name!=this.re.idName&&e[n].user_id!==this.re.idName){i=!1;for(var o=0;o<this.room.streamList.length;o++)if(e[n].stream_id===this.room.streamList[o].stream_id){i=!0;break}i||r.push(e[n])}else this.Xn.debug("hdsl.0 have self stream added");if(0!==r.length){this.Xn.debug(t+" callback addstream");for(var s=0;s<r.length;s++){this.room.streamList.push(r[s]);var a=this.ee.playerList[r[s].stream_id];null==a||a.player.setStreamAdd()}this.onStreamUpdated(this.se,1,this.makeCallbackStreamList(r))}xe(this.Xn,t)},e.prototype.pe=function(e){var t="zb.sh.hdsl";Me(this.Xn,t);for(var i=[],r=0;r<e.length;r++)if(e[r].anchor_id_name!=this.re.idName&&e[r].id_name!=this.re.idName&&e[r].user_id!==this.re.idName){for(var n=this.room.streamList.length-1;n>=0;n--)if(e[r].stream_id===this.room.streamList[n].stream_id){!this.re.connectChanged&&this.room.streamList.splice(n--,1),i.push(e[r]);break}}else this.Xn.debug(t+" have self stream deleted");0!==i.length&&(this.Xn.debug(t+" callback delstream"),this.onStreamUpdated(this.se,0,this.makeCallbackStreamList(i))),Le(this.Xn,t)},e.prototype._handleUpdatedStreamList=function(e){var t="zb.sh.husl";Me(this.Xn,t);for(var i=[],r=[],n=0;n<e.length;n++)if(e[n].anchor_id_name!=this.re.idName&&e[n].id_name!=this.re.idName&&e[n].user_id!==this.re.idName){for(var o=0;o<this.room.streamList.length;o++)if(e[n].stream_id===this.room.streamList[o].stream_id){e[n].extra_info!==this.room.streamList[o].extra_info&&(this.room.streamList[o]=e[n],i.push(e[n])),e[n].stream_attr_opts&&JSON.stringify(e[n].stream_attr_opts)!==JSON.stringify(this.room.streamList[o].stream_attr_opts)&&(this.room.streamList[o]=e[n],r.push(e[n]));break}}else this.Xn.debug("hsul.0 have self stream updated");0!==i.length&&(this.Xn.debug(t+" callback updatestream"),this.onStreamExtraInfoUpdated(this.se,this.makeCallbackStreamList(i))),0!==r.length&&(this.Xn.warn(t+" callback updateAttrStream"),this.onStreamAttrUpdated(this.se,this.makeCallbackStreamList(r))),xe(this.Xn,t)},e.prototype.fetchStreamList=function(e){var t,i,r,n=this,o="zb.sh.fsl";Me(this.Xn,o);var s=this.ve.createSpan(F.H,{key:ni,par:this.se},{key:Da.event,par:this.se},Da.event,!0);return this.rtm.isDisConnect()?(this.Xn.info(o+" state error"),void this.ve.setError(s,Da.error.NOT_LOGIN)):this.he?(this.Xn.info(o+" already doing"),void this.ve.setError(s,Da.error.ki," already doing")):(this.he=!0,this.Xn.info(o+" send fetch request"),this.re.useNetAgent&&this.rtm.liveRoomHandler.getStreamList({},(function(t){n.handleFetchStreamListRsp(t,e)}),(function(e){}),{roomID:null===(t=this.room)||void 0===t?void 0:t.roomID,sessionID:null===(i=this.room)||void 0===i?void 0:i.sessionID,roomSessionID:null===(r=this.room)||void 0===r?void 0:r.roomSessionID}),void xe(this.Xn,o))},e.prototype._handleReconnectStream=function(e){var t,i,r,n,o,s,a,c="zb.sh.hrs";Me(this.Xn,c);var u=this.ee.publisherList,l=this.ee.playerList;this.Xn.info(c+" publish "+Object.keys(this.ee.publisherList));var d=function(c){if((null===(i=null===(t=u[c])||void 0===t?void 0:t.room)||void 0===i?void 0:i.roomID)!==h.se)return"continue";var l=e.find((function(e){return e.stream_id==c})),d=l&&!(l.anchor_id_name===h.re.idName||l.id_name===h.re.idName||l.user_id===h.re.idName);if(h.Xn.info("zb.sh.hrs stream ".concat(c," ").concat(!!l," ").concat(d," ").concat(null===(r=u[c].publisher)||void 0===r?void 0:r.state)),6!=(null===(n=u[c].publisher)||void 0===n?void 0:n.state)&&1!==u[c].state||l&&!d){if((7==(null===(o=u[c].publisher)||void 0===o?void 0:o.state)||2===u[c].state)&&!(null===(a=null===(s=u[c])||void 0===s?void 0:s.retryStreamHandler)||void 0===a?void 0:a.maxTimer)&&e.find((function(e){return e.stream_id==c}))){h.updateStreamInfo(c,2002);for(var p=0;p<h.room.streamList.length;p++)if(h.room.streamList[p].stream_id==c){h.room.streamList.splice(p--,1);break}}}else h.updateStreamInfo(c,E,h.re.publishStreamList[c].extra_info)},h=this;for(var p in u)d(p);for(var p in u)u[p].room.roomID===this.se&&u[p].isReDispatch&&(this.Xn.info(c+" "+p+"retry dispatch"),(f=u[p].retryDispatchHandler).stopMaxTime(),f.invalid(),f.initStream(p,u[p].publishOption,!0),f.active(0),u[p].isReDispatch=!1);for(var p in l){var f;l[p].room.roomID===this.se&&l[p].isReDispatch&&(this.Xn.info(c+" "+p+"retry dispatch"),(f=l[p].retryDispatchHandler).stopMaxTime(),f.invalid(),f.initStream(p,l[p].playOption,!1),f.active(0),l[p].isReDispatch=!1)}var m=this.ee.stopedPlayerList,v=function(e){if(m[e].roomID!==g.se)return"continue";var t=g.ee,i=m[e],r=i.playOption,n=i.playStream;t.setPlayStateStart(e,r,i.isDataChannel);var o=t.playerList[e].retryDispatchHandler;t.playSuccessCallBackList[e]=m[e].sucCallBack?m[e].sucCallBack:function(e){for(var t=Ie.querySelectorAll("video, audio"),i=0;i<t.length;i++)n&&t[i].srcObject===n&&(n.getTracks().forEach((function(e){return n.removeTrack(e)})),e.clone().getTracks().forEach((function(e){return n.addTrack(e)})))},m[e].errCallBack&&(t.playErrorCallBackList[e]=m[e].errCallBack),t.onPlayStateUpdate(2,e,{code:0,message:""}),o.stopMaxTime(),o.invalid(),o.initStream(e,r,!1),o.startMaxTime(),o.active(0),delete m[e]},g=this;for(var p in m)v(p);Le(this.Xn,c)},e.prototype.makeCallbackStreamList=function(e){var t,i=[];if(this.re.useNetAgent&&this.re.appConfig&&(t=this.re.appConfig.media_config.play_config.resource_info.filter((function(e){return[c.CDN,c.DG].includes(e.resource_type)}))),e&&e.length>0)for(var r=0;r<e.length;r++){var n=e[r].stream_id;if(t&&t.length)for(var o=0;o<t.length;o++){for(var s=t[o].resource_type==c.DG?"_plus":"",a=[],l=[],d=[],h=0;h<t[o].service_info.length;h++){var p=t[o].service_info[h],f=p.protocol,m=p.url_template.replace("{STREAM_NAME}",n);switch(f){case u.FLV:a.push(m);break;case u.HLS:l.push(m);break;case u.RTMP:d.push(m)}}e[r]["urls_flv"+s]=a,e[r]["urls_m3u8"+s]=l,e[r]["urls_rtmp"+s]=d}var v={user:{userID:e[r].anchor_id_name||e[r].id_name,userName:e[r].anchor_nick_name||e[r].nick_name},extraInfo:e[r].extra_info,streamID:e[r].stream_id,roomID:"",urlFlv:"",urlFlvPlus:"",urlRtmp:"",urlHls:"",urlHlsPlus:"",urlHttpsFlv:"",urlHttpsHls:"",streamGID:e[r].stream_gid,closeType:e[r].close_type,stream_attr_opts:e[r].stream_attr_opts};this._setCDNInfo(v,e[r]),i.push(v)}return i},e.prototype.sendHttpPBRequest=function(e,t,i,r,n){var o,s;null===(o=this.rtm.netAgent)||void 0===o||o.startHttpRequest2({interfaceID:e.interfaceID,resID:e.resID||"",body:t,ack:!1,idName:this.re.idName,method:2,token:null===(s=this.room)||void 0===s?void 0:s.token,mode:this.re.testEnvironment?2:1,reduceRspHeaders:!0},(function(e,t){i&&i(e,t)}),(function(e){r&&r(e)}),null,{timeout:(null==n?void 0:n.timeout)||4e3,extras:{protoCmd:e.protoCmd}})},e.prototype.sendMixRequest=function(e,t,i,r,n){var o=this;void 0===n&&(n=2);var s=function(s,a){var c=s.status_code,u=s.body;if(200!==c)return n--,void(502===c&&n>0?o.sendMixRequest(e,t,i,r,n):r&&r(c,u));i&&i(u,a)};this.sendHttpPBRequest(e,t,(function(e,t){s(e,t)}),(function(e){s(e)}))},e.prototype.sendRTMPRequest=function(e,t,i){var r=this.rtm.netAgent,n=this.re.appid,o=e.streamID,s="/v1/jsrtmp/dispatch/".concat(n,"/").concat(o,"/").concat(e.actionType,"/").concat(r.clientIP),a=this.room;r.startHttpRequest({service:1,headers:[{name:"Token-Appid",val:n+""},{name:"Token-Str",val:(null==a?void 0:a.token)||""},{name:"Token-Userid",val:this.re.idName},{name:"Token-Biztype",val:"2"},{name:"Net-Mode",val:this.re.netMode+""}],body:{},idName:this.re.idName,method_no:1,ack:!1,location:s},(function(e){t(e)}),(function(e,t,r){i(e)}))},e.prototype._publishTarget=function(e,t,i){},e.prototype.updateStreamExtraInfo=function(e,t,i,r){Me(this.Xn,"zb.sh.usei");this.re.publishStreamList[e]&&this.re.publishStreamList[e].state>=T.update_info?(this.re.publishStreamList[e].extra_info=t,this.updateStreamInfo(e,2003,t,i,r)):this.re.publishStreamList[e]&&this.re.publishStreamList[e].state===T.tryPublish?(this.re.publishStreamList[e].extra_info=t,i({errorCode:0})):r(cn.error.Yn)},e.prototype.setStreamExtraInfo=function(e,t,i,r){this.updateStreamExtraInfo(e,t,i,r)},e.prototype._publishTargetWeb=function(e,t,i){},e.prototype.patchStreamList=function(e){var t=this;if(un(e.body.stream_refresh)&&0!==e.body.stream_refresh)return this.Xn.info(va+" stream refresh "),void this.fetchStreamList();this.Xn.info(va+" stream seq "+this.ue+" "+JSON.stringify(this.ce)),e.body.stream_seq>this.ue&&!this.ce&&(this.ce={},Me(this.Xn,va,"update stream "+this.ue+" server "+e.body.stream_seq),this.be&&clearTimeout(this.be),this.be=setTimeout((function(){t.handleMergeTimeout()}),this.fe)),this.oe=e.body.stream_seq},e.prototype.getStreamSeq=function(){return this.ue},e.prototype.mergeStreamByStreamSeq=function(e,t,i){var r=this;this.ce||(this.Xn.warn(fa+" new merge stream list "+this.ue+" server "+t),this.ce={},this.be&&clearTimeout(this.be),this.be=setTimeout((function(){r.handleMergeTimeout()}),this.de)),this.Xn.info(fa+" ".concat(this.ce," ").concat(e," ").concat(t," ").concat(i)),this.ce[t]={cmd:e,streamList:i}},e.prototype.handleMergeTimeout=function(){if(this.ce){var e=Object.keys(this.ce).map((function(e){return+e})).sort((function(e,t){return e-t}));e[e.length-1]-e[0]+1===e.length||e[e.length-1]>=this.oe?this.mergeStream(e):(this.ce=null,this.fetchStreamList())}},e.prototype.mergeStream=function(e){var t=this;this.Xn.info(ma+" merge streamList "+this.ue+" streamSeqList "+e.join(","));var i=e[e.length-1],r=[];e.forEach((function(e){if(t.ce&&t.ce[e])switch(t.ce[e].cmd){case k:t.ce[e].streamList.forEach((function(e){var t=r.findIndex((function(t){return t.stream_id==e.stream_id}));-1!==t&&r.splice(t),r.push(e)}));break;case 12002:t.ce[e].streamList.forEach((function(e){var t=r.findIndex((function(t){return t.stream_id==e.stream_id}));-1!==t&&r.splice(t)}));break;case 12003:t.ce[e].streamList.forEach((function(e){var t=r.findIndex((function(t){return t.stream_id==e.stream_id}));-1!==t&&r.splice(t),r.push(e)}))}})),this.ce=null,this.Xn.info(ma+" "+r),this.handleFullUpdateStream(i,r)},e.prototype.reset=function(){this.oe=0,this.ce=null,this.be&&(clearTimeout(this.be),this.be=void 0),this.fe=2e3,this.de=5e3},e}(),Ma=function(){function e(){this.handlerListMap={}}return e.prototype.addEventHandler=function(e,t){if(this.handlerListMap[e]||(this.handlerListMap[e]=[]),!fn(t))throw new Error("Params callBack is not a Function");return-1==this.handlerListMap[e].indexOf(t)&&this.handlerListMap[e].push(t),!0},e.prototype.removeEventHandler=function(e,t){return!!this.handlerListMap[e]&&(this.handlerListMap[e]=t?this.handlerListMap[e].filter((function(e){return e!==t})):[],!0)},e.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this.handlerListMap[e]&&this.handlerListMap[e].forEach((function(i){try{i.apply(void 0,t)}catch(t){console.error('Fail to execute callback of event "'.concat(e,'" : ').concat(t))}}))},e}(),La=Ma,xa="zg_autoplay_wrapper";function Ua(){return navigator.language.includes("zh")}var Ba,za,qa=function(){function e(){this.content='Media play failed. Click the "Resume"to resume.',this.dialogNode=null,this.bodyPosition="static";var e=Ie.createElement("style");e.innerHTML=".zg_autoplay_mask{position:fixed;top:0;left:0;right:0;bottom:0;width:100vw;height:100vh;display:flex;justify-content:center;align-items:center;background:rgba(0,0,0,0.5);z-index:1500;}.zg_autoplay_mask div:not(.zg_autoplay_action_wrapper){display:block !important;}.".concat(xa,"{padding:14px;background:#fff;border-radius:3px;box-shadow:1px 1px 10px #988e8d;border:1px solid #d1cfcf;max-width:500px;}.").concat(xa," a{color:#2473E8;}.zg_autoplay_header{overflow:hidden;text-overflow:ellipsis;font-size:16px;font-weight:600;}.zg_autoplay_content{margin:8px 0;}.zg_autoplay_action_wrapper{width:100%;display:flex !important;align-items:center;justify-content:right;float:right;}.zg_autoplay_collapse{margin-right:auto;cursor:pointer}.zg_autoplay_question{height:100%;line-height:16px;cursor:pointer;}.zg_autoplay_action_confirm{margin-left:8px;color:#fff;background:#0072ff;padding:4px 12px;outline:none;border:1px solid;border-radius:3px;font-weight:bold;}.zg_autoplay_action_confirm:hover{opacity:0.9;}.zg_autoplay_collapse,.zg_autoplay_action_confirm,.zg_autoplay_content,.zg_autoplay_question{font-size:14px;}@media screen and (max-width:750px){.").concat(xa,"{width:80vw;}}"),Ie.head.appendChild(e),Ua()&&(this.content="浏览器阻止音视频播放,请点击“恢复播放”。"),this.eManager=new La}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.prototype.createDialog=function(){var e=Ie.createElement("template");e.innerHTML="<div class='zg_autoplay_mask'><div class='".concat(xa,"'><div class='zg_autoplay_header'>").concat(location.host,"</div><div class='zg_autoplay_content'>").concat(this.content,"</div><div class='zg_autoplay_action_wrapper'></div></div></div>").trim();var t=Ie.createElement("button");t.className="zg_autoplay_action_confirm",t.innerText=Ua()?"恢复播放":"Resume",t.onclick=this.onConfirm.bind(this);var i=e.content.firstChild,r=i.querySelector(".zg_autoplay_action_wrapper");return r&&r.appendChild(t),i},e.prototype.onConfirm=function(e){e&&e.stopPropagation(),this.eManager.emit("allowPlay"),this.deleteDiaLog()},e.prototype.deleteDiaLog=function(){this.dialogNode&&(Ie.body.removeChild(this.dialogNode),this.dialogNode=null)},e.prototype.addDiaLog=function(){this.dialogNode=this.dialogNode||this.createDialog(),Ie.body.appendChild(this.dialogNode),this.dialogNode.onclick=this.onConfirm.bind(this)},e.prototype.on=function(e,t){return this.eManager.addEventHandler(e,t)},e.prototype.off=function(e,t){return this.eManager.removeEventHandler(e,t)},e.instance=null,e}(),Xa=function(){return Xa=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Xa.apply(this,arguments)},Ha=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Fa=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Va=Re(),Ga=/^(?=.*MicroMessenger)(?=.*HONOR).*$/.test(Va||""),ja=qa.getInstance(),Qa=function(){function e(e,t,i){var r,n,o,s=this;this.previewer=t,this._video=null,this._audio=null,this.inited=!1,this.container=null,this.srcNode=null,this.options={enableVideoAutoplayDialog:!0,enableAudioAutoplayDialog:!0,clearLastFrame:!0,useAudioElement:!0},this.emitPlayFailed=(r=function(e,t,i){s.eventManager.emit("autoplayFailed",t,i),(e?s.options.enableVideoAutoplayDialog:s.options.enableAudioAutoplayDialog)?ja.addDiaLog():Ie.body.addEventListener("mousedown",s.eventHandler.resumePlayByClickBody),s.Xn.warn("zc.zsv id:".concat(s.id," autoplay failed"))},void 0===(n=600)&&(n=100),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=this;clearTimeout(o),o=window.setTimeout((function(){r.apply(i,e)}),n)}),this.videoMuted=!1,this.audioMuted=!1,this.eventHandler={visibilitychange:function(){var e;Ie.hidden||s.audioMuted||!Ue()||(s.Xn.info("zc.zsv id:".concat(s.id," page show, recover audio")),s.options.useAudioElement&&s._audio?s._audio.srcObject=s._audio.srcObject:(s.Xn.info("zc.ac.rs id:".concat(s.id," page show")),s.ac.resume()),s._mountPlayer(s._audio,!0)),Ie.hidden||s.videoMuted||!Ue()||(null===(e=s._video)||void 0===e?void 0:e.paused)&&(s.Xn.info("zc.zsv id:".concat(s.id," page show, recover video")),s._mountPlayer(s._video,!0))},canPlayAudio:function(e){s.eventManager.emit("canPlayAudio",e)},canPlayVideo:function(e){s.eventManager.emit("canPlayVideo",e)},resumePlayByClickBody:function(){return Ha(s,void 0,void 0,(function(){return Fa(this,(function(e){switch(e.label){case 0:return this.Xn.info("zc.zsv id:".concat(this.id," resume by click dom_body")),[4,this.resume()];case 1:return e.sent(),Ie.body.removeEventListener("mousedown",this.eventHandler.resumePlayByClickBody),[2]}}))}))}},this.inited=!0,this.options=Xa(Xa({},this.options),i);var a=this.id="".concat(e.id),c=(null==t?void 0:t.streamId)||"";this.Xn.info("zc.sv.c id:".concat(a," streamID: ").concat(c," isLocal: ").concat(this.isLocal));var u=Ie.createElement("div");u.id="zg-rtc-player_".concat(a),u.setAttribute("style","width:100%;height:100%;position:relative;background-color:black;overflow:hidden;");var l=e.getVideoTracks()[0],d=e.getAudioTracks()[0],h=Ne(void 0,void 0,"safari"!==this.browser);h.id="zg-rtc-video_".concat(a),h.setAttribute("style","width:100%;height:100%;object-fit:contain;"),h.srcObject=new MediaStream,h.addEventListener("canplay",this.eventHandler.canPlayVideo),l&&h.srcObject.addTrack(l);var p=Ie.createElement("audio");p.id="zg-rtc-audio_".concat(a),p.setAttribute("autoplay",""),p.setAttribute("playsinline",""),p.setAttribute("muted",""),p.muted=!0,p.srcObject=this.audioStream=new MediaStream,p.addEventListener("canplay",this.eventHandler.canPlayAudio),d&&p.srcObject.addTrack(d),"object"==("undefined"===typeof WeixinJSBridge?"undefined":_typeof(WeixinJSBridge))&&"function"==typeof WeixinJSBridge.invoke&&WeixinJSBridge.invoke("getNetworkType",{},(function(){s.Xn.info("zc.zsv id:".concat(s.id," weixin load media")),p.load(),h.load()})),this._wrapper=u,this._video=h,this._audio=p,this.eventManager=new La,this.allowPlayListener=function(){s.resume()},ja.on("allowPlay",this.allowPlayListener),Ie.addEventListener("visibilitychange",this.eventHandler.visibilitychange)}return Object.defineProperty(e.prototype,"ac",{get:function(){return this.previewer.ac},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"browser",{get:function(){return this.previewer.re.browser},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Xn",{get:function(){return this.previewer.Xn},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isLocal",{get:function(){return this.previewer instanceof Gc},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_isMounted",{get:function(){return!!this._wrapper.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_hasAudio",{get:function(){var e,t;return"live"===(null===(t=null===(e=this.audioStream)||void 0===e?void 0:e.getTracks()[0])||void 0===t?void 0:t.readyState)&&!this.audioMuted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_hasVideo",{get:function(){var e,t,i;return!!(null===(e=this._video)||void 0===e?void 0:e.parentNode)&&"live"===(null===(i=null===(t=this._video.srcObject)||void 0===t?void 0:t.getTracks()[0])||void 0===i?void 0:i.readyState)},enumerable:!1,configurable:!0}),e.prototype.resume=function(e,t){return void 0===t&&(t=["audio","video"]),Ha(this,void 0,void 0,(function(){var i=this;return Fa(this,(function(r){return this.Xn.info("zc.zsv resume call: ".concat(e,", kindList: ").concat(t,", id:").concat(this.id,", isLocal: ").concat(this.isLocal)),t.forEach((function(t){return Ha(i,void 0,void 0,(function(){var i,r,n=this;return Fa(this,(function(o){switch(o.label){case 0:return r="audio"===t?this._audio:this._video,((i="audio"===t)?this._hasAudio:this._hasVideo)?!i||this.options.useAudioElement?[3,1]:(this.Xn.info("zc.zsv resume id:".concat(this.id," ac: ")+this.ac.state),this.ac.resume(),[3,5]):[3,5];case 1:return e&&r?(r.srcObject=r.srcObject,[4,new we((function(e){r.addEventListener("canplay",(function t(){r.removeEventListener("canplay",t),e(0)}))}))]):[3,3];case 2:o.sent(),o.label=3;case 3:return[4,null==r?void 0:r.play().catch((function(e){n.Xn.info("zc.zsv id:".concat(n.id," resume failed. err:")+e.message)}))];case 4:o.sent(),o.label=5;case 5:return[2]}}))}))})),[2]}))}))},e.prototype.checkIfClearLastFrame=function(){return Ha(this,void 0,void 0,(function(){return Fa(this,(function(e){switch(e.label){case 0:return this.options.clearLastFrame?[4,this.resume(!0,["video"])]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.play=function(e,t){void 0===t&&(t={}),this.Xn.info("zc.zsv play: ".concat(_typeof(e),", ").concat(JSON.stringify(t),", id:").concat(this.id," isLocal:").concat(this.isLocal?"1":"0 streamid:"+this.previewer.streamId,","));var i=(t=Xa({},t)).enableAutoplayDialog;dn(i)&&(t.enableVideoAutoplayDialog=i,t.enableAudioAutoplayDialog=i,delete t.enableAutoplayDialog),this.playVideo(e,t),this.playAudio(t,!this.isLocal)},e.prototype.playVideo=function(e,t){void 0===t&&(t={}),this.Xn.info("zc.zsv.pv id:".concat(this.id," play: ").concat(_typeof(e),", ").concat(JSON.stringify(t)," isLocal:").concat(this.isLocal));var i=null;if(ln(e)?i=Ie.getElementById(e):yn(e)&&(i=e),!i)throw"Execute `play` failed, container not exist";t&&"enableAutoplayDialog"in t&&(t.enableVideoAutoplayDialog=t.enableAutoplayDialog,delete t.enableAutoplayDialog),this.options=Xa(Xa({},this.options),t);var r=this.options,n=r.objectFit,o=r.mirror;this._video&&(void 0!==n&&(this._video.style.objectFit=n),dn(o)&&(this._video.style.transform=o?"rotateY(180deg)":"")),!i.contains(this._wrapper)&&i.appendChild(this._wrapper),this.container=i,this.videoMuted=!1,this._mountPlayer(this._video,!0)},e.prototype.playAudio=function(e,t){void 0===t&&(t=!0),this.Xn.info("zc.zsv.pa id:".concat(this.id," play: ").concat(JSON.stringify(e)," isLocal:").concat(this.isLocal)),e&&"enableAutoplayDialog"in e&&(e.enableAudioAutoplayDialog=e.enableAutoplayDialog,delete e.enableAutoplayDialog),this.options=Xa(Xa({},this.options),e);var i=!0;if("safari"===this.browser){var r=Va.match(/Version\/([\d\.]+)/);r&&("13.1.2"!==r[1]||this.options.useAudioElement||(i=!1))}i||(this.Xn.warn("zc.zsv.pa id:".concat(this.id," safari 13.1.2 cannot use audio ctx render.")),this.options.useAudioElement=!0);var n=t,o=this.options.muted;this._audio&&dn(o)&&(n=!o),this.audioMuted=!n,this._mountPlayer(this._audio,n)},e.prototype.stop=function(){this.Xn.info("zc.zsv stop id:".concat(this.id," isLocal:").concat(this.isLocal)),this.stopAudio(),this.stopVideo()},e.prototype.stopAudio=function(){this.Xn.info("zc.zsv.sa stop id:".concat(this.id," isLocal:").concat(this.isLocal)),this.audioMuted=!0,this._mountPlayer(this._audio,!1)},e.prototype.stopVideo=function(){var e;this.Xn.info("zc.zsv.sv stop id:".concat(this.id," isLocal:").concat(this.isLocal)),this._mountPlayer(this._video,!1);var t=null===(e=this._wrapper)||void 0===e?void 0:e.parentNode;t&&t.removeChild(this._wrapper)},e.prototype.setVideo=function(e,t){return void 0===t&&(t=!1),Ha(this,void 0,void 0,(function(){return Fa(this,(function(i){switch(i.label){case 0:return[4,this.setTrack(!0,e,t)];case 1:return i.sent(),[2]}}))}))},e.prototype.setAudio=function(e,t){return void 0===t&&(t=!1),Ha(this,void 0,void 0,(function(){return Fa(this,(function(i){switch(i.label){case 0:return[4,this.setTrack(!1,e,t)];case 1:return i.sent(),[2]}}))}))},e.prototype.setTrack=function(e,t,i){return void 0===i&&(i=!1),Ha(this,void 0,void 0,(function(){var r,n,o;return Fa(this,(function(s){switch(s.label){case 0:return this.Xn.info("zc.zsv set id:".concat(this.id," track: ").concat(e,", ").concat(_typeof(t),", ").concat(i,", ").concat(null==t?void 0:t.readyState," isLocal:").concat(this.isLocal)),(r=e?this._video:this._audio)&&(n=r.srcObject)?t?[3,1]:((o=n.getTracks()).forEach((function(e){null==n||n.removeTrack(e),r.srcObject=r.srcObject})),this.eventManager.emit("_trackChange",e?"video":"audio"),[3,5]):[2];case 1:if(!(t instanceof MediaStreamTrack))return[3,5];if((o=n.getTracks()).includes(t))return[3,5];if(o.forEach((function(e){null==n||n.removeTrack(e)})),n.addTrack(t),this.options.useAudioElement||this._initAC(!0),this.eventManager.emit("_trackChange",t.kind,t),this._mountPlayer(r,!(e?this.videoMuted:this.audioMuted)),!i)return[3,5];s.label=2;case 2:return s.trys.push([2,4,,5]),[4,this.resume(!0,[e?"video":"audio"])];case 3:return s.sent(),[3,5];case 4:return s.sent(),[3,5];case 5:return[2]}}))}))},e.prototype.setMirror=function(e){var t=this.options.mirror=!!e;this._video&&(this._video.style.transform=t?"rotateY(180deg)":"")},e.prototype.setVideoMuted=function(e){return this.Xn.info("zc.zsv id:".concat(this.id," mute video: ").concat(e," isLocal:").concat(this.isLocal)),this.videoMuted=e,this._mountPlayer(this._video,!e)},e.prototype.setAudioMuted=function(e){return this.Xn.info("zc.zsv id:".concat(this.id," mute audio: ").concat(e," isLocal:").concat(this.isLocal)),this.audioMuted=e,this._mountPlayer(this._audio,!e)},e.prototype.setVolume=function(e){if(this.Xn.info("zc.zsv id:".concat(this.id," volume: ").concat(e," isLocal:").concat(this.isLocal)),this._audio){var t=e>100?1:e/100;return this._audio.volume=t,this.gainNode&&(this.gainNode.gain.value=t),this._audio.volume==t}return!1},e.prototype.takeStreamSnapshot=function(e){var t=this._video;if(!t)return"";if(!t.srcObject)return"";var i=Oe(this._video.videoWidth,this._video.videoHeight),r=i.getContext("2d");r&&r.drawImage(this._video,0,0,i.width,i.height);var n=i.toDataURL("image/"+(null==e?void 0:e.imageType)||!1,null==e?void 0:e.quality),o="png";return(null==e?void 0:e.imageType)&&(o=["png","jpeg"].includes(null==e?void 0:e.imageType)?null==e?void 0:e.imageType:"png"),(null==e?void 0:e.save)&&i.toBlob((function(t){var i=window.URL.createObjectURL(t),r=Ie.createElement("a");r.style.display="none",r.href=i;var n=(null==e?void 0:e.fileName)||"snapshot"+Date.now();r.download=n+"."+o,Ie.body.appendChild(r),r.click(),setTimeout((function(){Ie.body.removeChild(r),window.URL.revokeObjectURL(i)}),100)})),n},e.prototype._initAC=function(e){if(void 0===e&&(e=!1),this.srcNode?e&&(this.srcNode.disconnect(),this.srcNode=this.ac.createMediaStreamSource(this.audioStream)):this.srcNode=this.ac.createMediaStreamSource(this.audioStream),!this.gainNode){var t=this.gainNode=this.ac.createGain();this._audio&&(t.gain.value=this._audio.volume)}return this.srcNode.connect(this.gainNode),{gainNode:this.gainNode,srcNode:this.srcNode}},e.prototype._mountPlayer=function(e,t){var i,r,n=this;if(!e||!this._wrapper)return!1;var o=!this.options.useAudioElement,s="VIDEO"===e.tagName;if(t){if(!s&&o){e.muted=!0,e.pause(),e.remove(),this._initAC().gainNode.connect(this.ac.destination);var a="running";this.Xn.info("zc.zsv id:".concat(this.id," render use audio context: ")+this.ac.state),this.ac.state!==a&&this.ac.resume().then((function(){n.ac.state!==a&&n.emitPlayFailed(s,e)}))}else if("live"===(null===(r=null===(i=null==e?void 0:e.srcObject)||void 0===i?void 0:i.getTracks()[0])||void 0===r?void 0:r.readyState)){var c=null,u=function(){e.oncanplay=null,c&&(clearTimeout(c),c=null),e.play().then((function(){Ga&&!s&&(n.Xn.info("zc.ac.rs id:".concat(n.id," honor suspend ac")),n.ac.resume()),n.Xn.info("zc.zsv id:".concat(n.id," render ").concat(e.tagName," use element success"))})).catch((function(t){n.Xn.warn("zc.zsv 2: id:".concat(n.id," ").concat(e.tagName," play() error: ").concat(t.message," isLocal:").concat(n.isLocal));var i=n._isMounted,r=n._hasVideo,o=n._hasAudio,a=(t.message||"").includes("interrupted");i&&!a&&(s&&r||!s&&o)&&n.emitPlayFailed(s,e,t)}))};e.muted=!0,s||(this.gainNode&&this.gainNode.disconnect(),e.muted=!1,e.srcObject=e.srcObject),Ga&&!s&&(this.Xn.info("zc.ac.rs id:".concat(this.id," honor resume ac")),this.ac.suspend()),e.play().catch((function(t){n.Xn.warn("zc.zsv 1: id:".concat(n.id," ").concat(e.tagName," play() error: ").concat(t.message," isLocal:").concat(n.isLocal))})),c=window.setTimeout((function(){u()}),1e3),e.oncanplay=function(){u()},!e.parentNode&&s&&this._wrapper.appendChild(e)}}else if(e.muted=!0,e.remove(),e.pause(),!s){o&&this.gainNode&&this.gainNode.disconnect();var l=5*Math.random()+4;setTimeout((function(){!s&&!e.parentNode&&e.readyState>3&&e.load()}),1e3*l)}return!0},e.prototype.on=function(e,t){return!!t&&this.eventManager.addEventHandler(e,t)},e.prototype.off=function(e,t){return this.eventManager.removeEventHandler(e,t)},e.prototype.useAudioOut=function(e){var t;return Ha(this,void 0,void 0,(function(){var i;return Fa(this,(function(r){switch(r.label){case 0:return i=null===(t=this._audio)||void 0===t?void 0:t.setSinkId,i?[4,i.call(this._audio,e)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},e.prototype.destroy=function(){this.stop(),this._video&&(this._video.removeEventListener("canplay",this.eventHandler.canPlayVideo),this._video=null),this._audio&&(this._audio.removeEventListener("canplay",this.eventHandler.canPlayAudio),this._audio=null),Ie.removeEventListener("visibilitychange",this.eventHandler.visibilitychange),Ie.body.removeEventListener("mousedown",this.eventHandler.resumePlayByClickBody),ja.off("allowPlay",this.allowPlayListener),this.inited=!1,this.allowPlayListener=null},e.prototype.getAudioNodeAndStopRender=function(){var e=this._audio,t=this.options;e&&(e.muted=!0,e.remove(),e.pause());var i=this._initAC(!0).gainNode;return t.useAudioContext&&i.disconnect(),i},e}(),Wa=function(){function e(e,t){this.source=e,this.destination=t,this.audioNodeList=[],this.source.disconnect(),this.source.connect(this.destination)}return Object.defineProperty(e.prototype,"destinationNode",{get:function(){return this.destination},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastNode",{get:function(){return this.isEmpty()?null:this.audioNodeList[this.audioNodeList.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"secondToLastNode",{get:function(){return this.audioNodeList.length<2?null:this.audioNodeList[this.audioNodeList.length-2]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstNode",{get:function(){return this.isEmpty()?null:this.audioNodeList[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"secondNode",{get:function(){return this.audioNodeList.length<2?null:this.audioNodeList[1]},enumerable:!1,configurable:!0}),e.prototype.pushBack=function(e){this.lastNode?(this.lastNode.disconnect(),this.lastNode.connect(e),e.connect(this.destination)):(this.source.disconnect(),this.source.connect(e),e.connect(this.destination)),this.audioNodeList.push(e)},e.prototype.popBack=function(){this.lastNode&&(this.lastNode.disconnect(),this.secondToLastNode?(this.secondToLastNode.disconnect(),this.secondToLastNode.connect(this.destination)):(this.source.disconnect(),this.source.connect(this.destination))),this.audioNodeList.pop()},e.prototype.pushFront=function(e){this.source.disconnect(),this.source.connect(e),e.connect(this.firstNode?this.firstNode:this.destination),this.audioNodeList.unshift(e)},e.prototype.popFront=function(){this.source.disconnect(),this.firstNode&&(this.firstNode.disconnect(),this.source.connect(this.secondNode?this.secondNode:this.destination)),this.audioNodeList.shift()},e.prototype.remove=function(e){var t=this.audioNodeList.indexOf(e);if(-1!==t){if(e.disconnect(),t-1>=0){var i=this.audioNodeList[t-1];i.disconnect(),i.connect(this.lastNode!=e?this.audioNodeList[t+1]:this.destination)}else this.source.disconnect(),this.source.connect(this.lastNode!=e?this.audioNodeList[t+1]:this.destination);this.audioNodeList.splice(t,1)}},e.prototype.isConnected=function(e){return-1!==this.audioNodeList.indexOf(e)},e.prototype.isEmpty=function(){return 0===this.audioNodeList.length},e.prototype.replaceSource=function(e){this.source.disconnect(),e.connect(this.firstNode?this.firstNode:this.destination),this.source=e},e.prototype.replaceDestination=function(e){this.lastNode?(this.lastNode.disconnect(),this.lastNode.connect(e)):(this.source.disconnect(),this.source.connect(e)),this.destination=e},e}(),Za=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Ka=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Ja=function(){function e(){this.isFirstNode=!0,this.isLastNode=!0,this.hasAnother=!1}return e.prototype.connect=function(e){return Za(this,void 0,void 0,(function(){return Ka(this,(function(t){switch(t.label){case 0:return this.next=e,this.output?[4,e.setInput(this.output)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2,e]}}))}))},e.prototype.disconnect=function(e){return Za(this,void 0,void 0,(function(){return Ka(this,(function(t){switch(t.label){case 0:return this.next?[4,this.next.setInput(null,e)]:[3,2];case 1:t.sent(),this.next=void 0,t.label=2;case 2:return[2]}}))}))},e.prototype.setNodePos=function(e,t,i){void 0!==e&&(this.isFirstNode=e),void 0!==t&&(this.isLastNode=t),"boolean"==typeof i&&(this.hasAnother=!i)},e}(),Ya=function(){function e(){}return e.createError=function(e,t){return{code:e.code,message:e.message+(t?" "+t:"")}},e}(),$a=(Ba=function(e,t){return Ba=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},Ba(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}Ba(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),ec=Ya.createError,tc=function(e){function t(t,i){var r=e.call(this)||this;return r.track=t,r.streamCenter=i,r.isFirstNode=!1,r.isLastNode=!1,r}return $a(t,e),Object.defineProperty(t.prototype,"output",{get:function(){return{track:this.track}},enumerable:!1,configurable:!0}),t.prototype.setInput=function(e){return function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){return function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}(this,(function(e){throw ec({code:-1,message:"Can not set track input to VideoSourceNode"})}))}))},t.prototype.process=function(){},t.prototype.destory=function(){this.track&&(this.streamCenter.trackUtils.stopTrack(this.track),this.track=null),this.next=null},t}(Ja),ic=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},rc=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},nc=function(){function e(e,t,i,r,n){this.source=e,this.destination=t,this.streamCenter=i,this.browser=r,this.preview=n,this.videoNodeList=[],this._vcMgr=void 0,this.source.connect(this.destination)}return Object.defineProperty(e.prototype,"vcMgr",{get:function(){return this._vcMgr},set:function(e){this._vcMgr||(this._vcMgr=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastNode",{get:function(){return this.isEmpty()?null:this.videoNodeList[this.videoNodeList.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"secondToLastNode",{get:function(){return this.videoNodeList.length<2?null:this.videoNodeList[this.videoNodeList.length-2]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstNode",{get:function(){return this.isEmpty()?null:this.videoNodeList[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"secondNode",{get:function(){return this.videoNodeList.length<2?null:this.videoNodeList[1]},enumerable:!1,configurable:!0}),e.prototype.pushBack=function(e){return ic(this,void 0,void 0,(function(){return rc(this,(function(t){switch(t.label){case 0:return this.lastNode?(this.lastNode.setNodePos(void 0,!1),[4,this.lastNode.connect(e)]):[3,3];case 1:return t.sent(),e.setNodePos(!1),[4,e.connect(this.destination)];case 2:return t.sent(),[3,6];case 3:return[4,this.source.connect(e)];case 4:return t.sent(),e.setNodePos(!0),[4,e.connect(this.destination)];case 5:t.sent(),t.label=6;case 6:return this.videoNodeList.push(e),[2]}}))}))},e.prototype.popBack=function(){return ic(this,void 0,void 0,(function(){return rc(this,(function(e){switch(e.label){case 0:return this.lastNode?[4,this.lastNode.disconnect()]:[3,7];case 1:return e.sent(),this.secondToLastNode?[4,this.secondToLastNode.disconnect()]:[3,4];case 2:return e.sent(),this.secondToLastNode.setNodePos(void 0,!0),[4,this.secondToLastNode.connect(this.destination)];case 3:return e.sent(),[3,7];case 4:return[4,this.source.disconnect()];case 5:return e.sent(),[4,this.source.connect(this.destination)];case 6:e.sent(),e.label=7;case 7:return this.videoNodeList.pop(),[2]}}))}))},e.prototype.pushFront=function(e){return ic(this,void 0,void 0,(function(){return rc(this,(function(t){switch(t.label){case 0:return[4,this.source.disconnect()];case 1:return t.sent(),this.firstNode&&e.setNodePos(void 0,void 0,!1),[4,this.source.connect(e)];case 2:return t.sent(),this.firstNode?(this.firstNode.setNodePos(!1),e.setNodePos(!0,!1),[4,e.connect(this.firstNode)]):[3,4];case 3:return t.sent(),[3,6];case 4:return e.setNodePos(!0,!0),[4,e.connect(this.destination)];case 5:t.sent(),t.label=6;case 6:return this.videoNodeList.unshift(e),[2]}}))}))},e.prototype.popFront=function(){return ic(this,void 0,void 0,(function(){return rc(this,(function(e){switch(e.label){case 0:return[4,this.source.disconnect()];case 1:return e.sent(),this.firstNode?[4,this.firstNode.disconnect()]:[3,6];case 2:return e.sent(),this.secondNode?(this.secondNode.setNodePos(!1),[4,this.source.connect(this.secondNode)]):[3,4];case 3:return e.sent(),[3,6];case 4:return[4,this.source.connect(this.destination)];case 5:e.sent(),e.label=6;case 6:return this.videoNodeList.shift(),[2]}}))}))},e.prototype.remove=function(e){return ic(this,void 0,void 0,(function(){var t,i,r;return rc(this,(function(n){switch(n.label){case 0:return-1===(t=this.videoNodeList.indexOf(e))?[3,13]:[4,e.disconnect()];case 1:return n.sent(),i=this.videoNodeList[t+1],t-1>=0?[4,(r=this.videoNodeList[t-1]).disconnect()]:[3,7];case 2:return n.sent(),this.lastNode==e?[3,4]:(r.setNodePos(void 0,!1),[4,r.connect(i)]);case 3:return n.sent(),[3,6];case 4:return r.setNodePos(void 0,!0),[4,r.connect(this.destination)];case 5:n.sent(),n.label=6;case 6:return[3,12];case 7:return[4,this.source.disconnect()];case 8:return n.sent(),this.lastNode==e?[3,10]:(i.setNodePos(!0),[4,this.source.connect(i)]);case 9:return n.sent(),[3,12];case 10:return[4,this.source.connect(this.destination)];case 11:n.sent(),n.label=12;case 12:this.videoNodeList.splice(t,1),n.label=13;case 13:return[2]}}))}))},e.prototype.isConnected=function(e){return-1!==this.videoNodeList.indexOf(e)},e.prototype.isEmpty=function(){return 0===this.videoNodeList.length},e.prototype.getSourceTrack=function(){var e;return null===(e=this.source.output)||void 0===e?void 0:e.track},e.prototype.getDestinationTrack=function(){var e;return null===(e=this.destination.output)||void 0===e?void 0:e.track},e.prototype.replaceNewSourceByTrack=function(e,t,i){var r,n,o,s;return void 0===t&&(t=!0),ic(this,void 0,void 0,(function(){var a;return rc(this,(function(c){switch(c.label){case 0:return(("firefox"===(a=this.browser)||"safari"===a)&&null!==(null===(r=this.vcMgr)||void 0===r?void 0:r.renderTrack)&&null!==e&&(null===(n=this.vcMgr)||void 0===n?void 0:n.renderTrack)!==e||"safari"===a&&(null==i?void 0:i.handleTrackType)===l.changeResolution)&&(null===(o=this.preview.backgroundProcessor)||void 0===o||o.pauseRender(!0)),[4,null===(s=this.vcMgr)||void 0===s?void 0:s.checkInit(e,i)];case 1:return c.sent(),[4,this.replaceSource(new tc(e,this.streamCenter),t)];case 2:return c.sent(),[2]}}))}))},e.prototype.replaceSource=function(e,t){return void 0===t&&(t=!0),ic(this,void 0,void 0,(function(){return rc(this,(function(i){switch(i.label){case 0:return this.destination.setReplaceRemote(t),this.firstNode?[4,e.connect(this.firstNode)]:[3,2];case 1:return i.sent(),[3,4];case 2:return[4,e.connect(this.destination)];case 3:i.sent(),i.label=4;case 4:return this.source=e,this.destination.setReplaceRemote(),[2]}}))}))},e.prototype.replaceDestination=function(e){return ic(this,void 0,void 0,(function(){return rc(this,(function(t){switch(t.label){case 0:return this.lastNode?[4,this.lastNode.disconnect()]:[3,3];case 1:return t.sent(),[4,this.lastNode.connect(e)];case 2:return t.sent(),[3,6];case 3:return[4,this.source.disconnect()];case 4:return t.sent(),[4,this.source.connect(e)];case 5:t.sent(),t.label=6;case 6:return this.destination=e,[2]}}))}))},e.prototype.destroy=function(){for(var e,t=0;t<this.videoNodeList.length;t++)this.videoNodeList[t].disconnect();this.videoNodeList=[],this.destination.destroy(),this.source.destory(),null===(e=this.vcMgr)||void 0===e||e.destroy()},e}(),oc=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sc=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},ac=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},cc=Ya.createError,uc=function(e){function t(t,i){var r=e.call(this)||this;return r.preview=t,r.browser=i,r.isFirstNode=!1,r.isLastNode=!1,r.track=null,r.replaceRemote=!0,r}return oc(t,e),t.prototype.setReplaceRemote=function(e){void 0===e&&(e=!0),this.replaceRemote=e},t.prototype.setInput=function(e){return sc(this,void 0,void 0,(function(){var t,i,r,n;return ac(this,(function(o){if(null==(null==e?void 0:e.track))return[2];if(!this.preview.localStream)throw cc({code:-1,message:"preview haven't been inited."});return this.track=t=null==e?void 0:e.track,this.preview.localStream.getVideoTracks()[0]!==t&&(i=this.preview.localStream,(null==(r=this.preview.zegoCaptureStream)?void 0:r.stream)&&(i=r.stream),n=this.preview.ee.getPublishList(i),this.replaceRemote&&0!==n.length?n.map((function(e){return e.publisher})).forEach((function(e){e&&e.previewer&&e.replacePublishedTrack(t,!0)})):this.preview.replacePreviewTrack(t,!0)),[2]}))}))},Object.defineProperty(t.prototype,"output",{get:function(){return{track:this.track}},enumerable:!1,configurable:!0}),t.prototype.connect=function(e){return sc(this,void 0,void 0,(function(){return ac(this,(function(e){throw cc({code:-1,message:"video destination node cann't connect any video node."})}))}))},t.prototype.disconnect=function(){return sc(this,void 0,void 0,(function(){return ac(this,(function(e){throw cc({code:-1,message:"video destination node cann't disconnect any video node."})}))}))},t.prototype.destroy=function(){this.track=null},t}(Ja),lc=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},dc=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},hc=function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))};!function(e){e[e.inited=0]="inited",e[e.noInit=1]="noInit",e[e.initing=2]="initing"}(za||(za={}));var pc=function(){function e(e,t,i){var r=this;this.Xn=e,this.ye=t,this.customVC=i,this.canvasTrack=null,this.gl=null,this.lastRenderTime=0,this.animationFrameId=0,this._initState=za.noInit,this.hasBeautyTask=!1,this.hasBackgroundTask=!1,this.backgroundLoop=null,this.eventHandler={visibilitychange:function(){if(Ie.hidden){(function e(){return lc(r,void 0,void 0,(function(){return dc(this,(function(t){switch(t.label){case 0:return this.backgroundLoop=window.setTimeout(e,Math.floor(1e3/this.fps)),!Ie.hidden&&this.backgroundLoop?(clearTimeout(this.backgroundLoop),this.backgroundLoop=null,[2]):[4,this.renderAFrame()];case 1:return t.sent(),[2]}}))}))})()}else r.backgroundLoop&&(clearTimeout(r.backgroundLoop),r.backgroundLoop=null)}},this.fps=15,this.renderEventManger=new La}return Object.defineProperty(e.prototype,"initState",{set:function(e){this._initState=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"inited",{get:function(){return this._initState===za.inited},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"beautyAndBackgroundProcess",{get:function(){return this.hasBackgroundTask&&this.hasBeautyTask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderTrack",{get:function(){return this._e},enumerable:!1,configurable:!0}),e.prototype.init=function(e,t){var i;return lc(this,void 0,void 0,(function(){var r;return dc(this,(function(n){switch(n.label){case 0:if(this._initState!=za.noInit)return[3,4];this._initState=za.initing,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.renderVideo(e,t)];case 2:return n.sent(),this._initState=za.inited,this.onInited(),[3,4];case 3:return r=n.sent(),this._initState=za.noInit,this.onRenderFail(r),r.code===Ut.code&&"ended"===(null===(i=this._e)||void 0===i?void 0:i.readyState)&&this.resetVideo(),[3,4];case 4:return[2]}}))}))},e.prototype.checkInit=function(e,t){return lc(this,void 0,void 0,(function(){return dc(this,(function(i){switch(i.label){case 0:return!e||"live"!==e.readyState||this._e===e&&(null==t?void 0:t.handleTrackType)!==l.changeResolution?[3,2]:(this._initState=za.noInit,[4,this.init(e,t)]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))},e.prototype.renderVideo=function(e,t){var i;return lc(this,void 0,void 0,(function(){var r,n,o;return dc(this,(function(s){switch(s.label){case 0:return this.Xn.info("".concat(Ra," call")),null===e?(this._e=e,[2]):this._e==e&&(null==t?void 0:t.handleTrackType)!==l.changeResolution?[2]:(this._e=e,this.videoEl||(this.videoEl=Ne(),null===(i=this.videoEl)||void 0===i||i.setAttribute("style","display:none")),[4,this.getPlayingVideo(this.videoEl,e,t)]);case 1:if(s.sent(),r=e.getSettings(),n=r.width||this.videoEl.videoWidth,o=r.height||this.videoEl.videoHeight,r.frameRate&&this.fps!==r.frameRate&&(this.fps=r.frameRate,this.Xn.info(Ra+" set target fps: "+this.fps)),this.Xn.info(Ra+" video canvas render: width "+r.width+" height "+r.height),!n||!o)throw this.Xn.error(Ra+" resolution of track is wrong"),Ut;return this.originWidth=n,this.originHeight=o,this.videoEl.setAttribute("width",n.toString()),this.videoEl.setAttribute("height",o.toString()),"safari"!==this.ye||(null==t?void 0:t.handleTrackType)!==l.replaceNew&&(null==t?void 0:t.handleTrackType)!==l.changeResolution||this.resetCanvas(),this.initWegGl(),[2]}}))}))},e.prototype.getPlayingVideo=function(e,t,i){return lc(this,void 0,void 0,(function(){var i,r,n=this;return dc(this,(function(o){switch(o.label){case 0:return e.srcObject?((i=e.srcObject).getTracks().forEach((function(e){return i.removeTrack(e)})),i.addTrack(t),"safari"!==(r=this.ye)&&"firefox"!==r||(e.srcObject=i)):e.srcObject=new MediaStream([t]),[4,new Promise((function(t,i){var r=function(){0==e.videoWidth||0==e.videoHeight?i(Ut):t(void 0)};if(null==e?void 0:e.paused){var o=null,s=function t(){r(),o&&(clearTimeout(o),o=null),e&&e.removeEventListener("playing",t)};o=window.setTimeout((function(){o&&(clearTimeout(o),o=null),o=window.setTimeout((function(){n.Xn.warn(Ra+" video track error"),e&&e.removeEventListener("playing",s),i(Ut)}),1e3),e.play().catch((function(e){console.error(e)}))}),1e3),e&&e.addEventListener("playing",s),e&&e.play()}else e&&e.play(),setTimeout((function(){r()}),1e3)}))];case 1:return o.sent(),[2]}}))}))},e.prototype.resetVideo=function(){var e;this.destroyVideo(),this.videoEl=Ne(),null===(e=this.videoEl)||void 0===e||e.setAttribute("style","display:none")},e.prototype.initWegGl=function(){var e;if(this.Xn.info("".concat(ka," call")),this.canvasEl||(this.Xn.info("".concat(ka," no canvas")),this.customVC?(this.canvasEl=document.getElementById("render_canvas"),this.canvasEl.width=this.originWidth,this.canvasEl.height=this.originHeight):this.canvasEl=Oe(this.originWidth,this.originHeight)),this.gl||(this.gl=null===(e=this.canvasEl)||void 0===e?void 0:e.getContext("webgl")),!this.gl)return this.Xn.warn("".concat(ka," no gl")),void this.handleInitError({code:1001});this.Xn.info("".concat(ka," end"))},e.prototype.resetCanvas=function(){this.canvasEl=null,this.gl=null,this.canvasTrack=null},e.prototype.getCanvasTrack=function(e){return this.Xn.info("".concat(Pa," get track")),this.canvasTrack&&!e||!this.canvasEl||(this.canvasTrack=this.canvasEl.captureStream(this.fps).getVideoTracks()[0]),this.canvasTrack},e.prototype.startRenderTask=function(){var e=this;this.Xn.info("".concat(Pa," start task"));this.animationFrameId=requestAnimationFrame((function t(){return lc(e,void 0,void 0,(function(){return dc(this,(function(e){switch(e.label){case 0:return this.animationFrameId=requestAnimationFrame(t),[4,this.renderAFrame()];case 1:return e.sent(),[2]}}))}))})),Ie.removeEventListener("visibilitychange",this.eventHandler.visibilitychange),Ie.addEventListener("visibilitychange",this.eventHandler.visibilitychange,!1)},e.prototype.stopRenderTask=function(){this.Xn.info("".concat(Pa," stop task")),this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=0),Ie.removeEventListener("visibilitychange",this.eventHandler.visibilitychange)},e.prototype.renderAFrame=function(){return lc(this,void 0,void 0,(function(){var e,t,i;return dc(this,(function(r){return e=Date.now(),t=1e3/this.fps,(i=this.lastRenderTime?e-this.lastRenderTime:t)>=t&&(this.lastRenderTime=e-(i-t),this.videoEl&&this.videoEl.paused&&this.videoEl.play(),this.videoEl&&this.videoEl.videoWidth>6&&this.videoEl.videoHeight>6&&this.renderEventManger.emit("renderFrame")),[2]}))}))},e.prototype.on=function(e,t){return!!t&&this.renderEventManger.addEventHandler(e,t)},e.prototype.off=function(e,t){return this.renderEventManger.removeEventHandler(e,t)},e.prototype.actionListener=function(e){for(var t,i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];(t=this.renderEventManger).emit.apply(t,hc([e],i,!1))},e.prototype.setRenderTask=function(e,t){this.Xn.info("".concat(Pa," set task ").concat(e," ").concat(t)),"beauty"===t&&(this.hasBeautyTask=e),"background"===t&&(this.hasBackgroundTask=e),this.hasBeautyTask&&!this.hasBackgroundTask?this.startRenderTask():this.stopRenderTask()},e.prototype.resetResolution=function(e,t){this.originWidth=e,this.originHeight=t},e.prototype.handleInitError=function(e){throw e},e.prototype.onInited=function(){},e.prototype.onRenderFail=function(e){},e.prototype.onRenderSuc=function(){},e.prototype.destroyVideo=function(){this.videoEl&&(this.videoEl.pause(),this.videoEl.remove(),this.videoEl.srcObject=null,this.videoEl=null)},e.prototype.destroy=function(){this.Xn.info("".concat(Pa," dt")),this.destroyVideo(),this.canvasEl&&(this.canvasEl.remove(),this.canvasEl=null),this.canvasTrack=null,this._e=null,this.gl=null,this.stopRenderTask(),this.hasBeautyTask=!1,this.hasBackgroundTask=!1,this.backgroundLoop&&clearTimeout(this.backgroundLoop),this.backgroundLoop=null},e}();function fc(e,t,i,r,n){void 0===i&&(i=1e3),void 0===r&&(r=200);var o=e.createAnalyser();o.fftSize=2048,t.connect(o);var s=null,a=0,c=o.fftSize,u=null,l=null,d=0;return i<100&&(i=100),r<100&&(r=100),i<r&&(r=i),r&&(s=window.setTimeout((function(){(function e(){var t=0;if(o.getFloatTimeDomainData){l||(l=new Float32Array(c)),o.getFloatTimeDomainData(l);for(var h=0;h<l.length;h++)t=Math.max(t,Math.abs(l[h]))}else{for(u||(u=new Uint8Array(c)),o.getByteTimeDomainData(u),h=0;h<u.length;h++)t=Math.max(t,Math.abs(u[h]-128));t/=128}var p=.005;r<=100?p=.5:r<=200?p=.3:r<=300?p=.15:r<=500?p=.07:r<=1e3&&(p=.05),t>(a*=p)&&(a=t),a>1&&(a=1);var f=Date.now();return 0==d&&(d=f),(f-d>=i||r>=i)&&(d=f,n&&n(a)),r&&(s=window.setTimeout((function(){s&&clearTimeout(s),e()}),r))})()}),r)),"running"!==e.state&&e.resume(),{analyzer:o,destroy:function(){o.disconnect(),null!==s&&(clearInterval(s),r=0,s=null),a=0,u=null,l=null},setInterval:function(e){e>30&&(i=e)}}}var mc,vc,gc,yc,bc,_c,Sc,Tc,Ec,Cc,wc,Ic,Rc,kc,Pc,Ac,Dc,Nc,Oc,Mc=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Lc=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},xc="zc.smw",Uc=new Blob(['\nclass VolumeMeter extends AudioWorkletProcessor {\n constructor() {\n super();\n this.volume = 0;\n this.intervalTime = 1000;\n this.tick = this.intervalTime;\n this.isStop = false;\n this.port.onmessage = event => {\n const { data } = event;\n switch (data.name) {\n case "setIntervalTime":\n this.intervalTime = data.intervalTime;\n break;\n case "stop":\n this.isStop = true;\n break;\n }\n };\n }\n process(inputs) {\n const input = inputs[0];\n if (this.isStop) {\n return false;\n }\n if (input.length > 0) {\n const buffer = input[0];\n let maxVal = this.volume;\n for (let i = 0; i < buffer.length; i++) {\n if (maxVal < buffer[i]) {\n maxVal = buffer[i];\n }\n }\n this.volume = maxVal;\n this.tick -= buffer.length;\n if (this.tick < 0) {\n this.tick += (this.intervalTime / 1000) * sampleRate;\n this.port.postMessage({ volume: this.volume });\n this.volume = 0;\n }\n }\n return true;\n }\n}\ntry {\n registerProcessor("meter", VolumeMeter);\n} catch (error) {\n \n} \n'],{type:"application/javascript"}),Bc=function(){function e(){}return e.addModuleToContext=function(e,t){return Mc(this,void 0,void 0,(function(){var i;return Lc(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t.info(xc+" worklet addModule call"),[4,e.audioWorklet.addModule(URL.createObjectURL(Uc))];case 1:return r.sent(),t.info(xc+" worklet addModule success"),this.isSuccess=!0,[2];case 2:return i=r.sent(),t.warn(xc+" worklet addModule catch error. ".concat(null==i?void 0:i.message)),[3,3];case 3:return[2]}}))}))},e.isSuccess=!1,e}(),zc=function(){function e(e,t,i,r){void 0===i&&(i=1e3),void 0===r&&(r=200),this.Xn=e,this.re=t,this._updateInterval=i,this._sampleInterval=r,this._worklet=null,this._processor=null,this._analyzer=null,this.volume=0,this.onSoundLevelUpdate=function(e){}}return e.prototype.preload=function(e){return Mc(this,void 0,void 0,(function(){return Lc(this,(function(t){switch(t.label){case 0:return Bc.isSuccess?[3,2]:[4,Bc.addModuleToContext(e,this.Xn)];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},e.prototype.initAudioWorklet=function(e,t){return Mc(this,void 0,void 0,(function(){var i,r,n=this;return Lc(this,(function(o){switch(o.label){case 0:if(this._worklet)return[3,5];o.label=1;case 1:if(o.trys.push([1,3,,4]),function(e){return!!fn(e.createAnalyser)}(e)&&this.re.settingConfig.getSetting("sound_level_api_type")!==j.useWorklet)throw"use analyzer";return this.Xn.info(xc+" use AudioWorklet. "),[4,this.preload(e)];case 2:return o.sent(),(i=this._worklet=new AudioWorkletNode(e,"meter")).port.onmessage=function(e){n.onSoundLevelUpdate&&n.onSoundLevelUpdate(e.data.volume||0)},t.connect(i).connect(e.destination),this.setInterval(this._updateInterval),[3,4];case 3:return r=o.sent(),this.Xn.info(xc+" not use AudioWorklet. "+r),this._analyzer=fc(e,t,this._updateInterval,this._sampleInterval,(function(e){n.onSoundLevelUpdate&&n.onSoundLevelUpdate(e||0)})),[3,4];case 4:return[3,6];case 5:t.connect(this._worklet).connect(e.destination),o.label=6;case 6:return[2]}}))}))},e.prototype.getSrcSource=function(t,i){var r=i.getAudioTracks()[0],n=i.id,o=e.sourceList[n]||{},s=o.source,a=o._ac,c=o.trackid;return s&&a===t&&c===(null==r?void 0:r.id)||(s&&s.disconnect(),s=t.createMediaStreamSource(i),e.sourceList[n]={source:s,_ac:a=t,trackid:c=r.id}),s},e.prototype.replaceSrcSource=function(t,i){var r;e.sourceDisConnect(i);var n=this.getSrcSource(t,i);return(null===(r=this._analyzer)||void 0===r?void 0:r.analyzer)&&n.connect(this._analyzer.analyzer),n},e.sourceDisConnect=function(t){var i=t.id,r=(e.sourceList[i]||{}).source;r&&(r.disconnect(),delete e.sourceList[i])},e.prototype.setInterval=function(e){var t=this._worklet;this._updateInterval=e,t&&t.port.postMessage({name:"setIntervalTime",intervalTime:e}),this._analyzer&&this._analyzer.setInterval(e)},e.prototype.destroy=function(){this._processor&&(this._processor.onaudioprocess=null,this._processor.disconnect()),this._analyzer&&(this._analyzer.destroy(),this._analyzer=null),this._worklet&&(this._worklet.port.postMessage({name:"stop"}),this._worklet.port.onmessage=null,this._worklet.port.close(),this._worklet.disconnect(),this.Xn.info(xc+" close worklet")),this._worklet=null,this._processor=null},e.sourceList={},e}(),qc=function(){return qc=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},qc.apply(this,arguments)},Xc=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Hc=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Fc=["videoInput","videoQuality","facingMode","width","height","frameRate","videoOptimizationMode"],Vc=["audioInput","channelCount","ANS","AGC","AEC"],Gc=function(){function e(e,t,i,r,n){var o=this;this.Xn=e,this.re=t,this.ee=i,this.previewType=r,this.onlyPreview=n,this.localStream=null,this.videoInfo={},this.rtcViewer=null,this.streamFromCanvas=!1,this.streamFromCanvasTrack=null,this.previewSuc=!1,this.soundLevel=0,this.hasEmptyAudioTrack=!1,this._emptyAudioTrack=null,this.voiceProccessor=null,this.lastTrackEndTime={audio:0,video:0},this.script=null,this.mic=null,this._audioTrack=null,this._videoTrack=null,this.cloneVideoTrack=null,this.originVideoTrack=null,this.originAudioTrack=null,this.activateSEIConfig=null,this.isAudioEnabled=!0,this.isVideoEnabled=!0,this.gainNode=null,this.cameraMaxResolution={},this.enableDualStream=!1,this.lowStreamConfig={width:160,height:120,frameRate:15,bitRate:50},this.muteImage=null,this.syncVideoEnabled=!1,this.syncAudioEnabled=!1,this.hasMicTrack=!0,this.enableMicrophoneOnly=function(e,t){return o.localStream?(o.updatePublisherStreamMicStatus(e),o.micTrack?(o.micTrack.enabled=o.isAudioEnabled&&e,o.Xn.debug("zp.emo.2 call success"),!0):(o.Xn.info("zp.emo.2 no micTrack"),!0)):(o.Xn.error("zp.em.2 no localStream"),!1)},this.soundMeterWorklet=null,this.audioMixManager=null,this.volume=100,this.volumeFactor=1,this.logger=e,this.stateCenter=t,this.streamCenter=i,r&&(this.videoPreviewType=r,this.audioPreviewType=r)}return e.prototype.getEmptyAudioTrack=function(){if(!this._emptyAudioTrack){var e=this.ee.ac.createMediaStreamDestination(),t=e?e.stream:null,i=this._emptyAudioTrack=t?t.getAudioTracks()[0]:null;this.Xn.info("zp.geat "+"empty audio id: ".concat(null==i?void 0:i.id))}return this._emptyAudioTrack},Object.defineProperty(e.prototype,"audioTrack",{get:function(){var e;return this._audioTrack||(null===(e=this.localStream)||void 0===e?void 0:e.getAudioTracks()[0])||null},set:function(e){this._audioTrack=e,this.bindAudioTrackEvent(e)},enumerable:!1,configurable:!0}),e.prototype.checkAudioExceptionEnded=function(e){e&&(this.ee.trackUtils.isTrackStopBySDK(e)||(this.re.actionListener("_deviceError",1106009,e.label,"micro"),this.re.actionListener("deviceError",1106009,e.label),this.ee.checkDeviceChange&&this.ee.checkDeviceChange()))},e.prototype.checkVideoExceptionEnded=function(e){e&&(this.ee.trackUtils.isTrackStopBySDK(e)||(this.re.actionListener("_deviceError",1106010,e.label,"camera"),this.re.actionListener("deviceError",1106010,e.label),this.ee.checkDeviceChange&&this.ee.checkDeviceChange()))},e.prototype.bindAudioTrackEvent=function(e){var t=this;null==e||e.addEventListener("ended",(function(){t.logger.info("zp.pv.adt audio track ended"),t.lastTrackEndTime.audio=performance.now(),"camera"===t.audioPreviewType&&t.checkAudioExceptionEnded(e)}))},e.prototype.bindVideoTrackEvent=function(e){var t=this;null==e||e.addEventListener("ended",(function(){t.logger.info("zp.pv.vdt video track ended"),t.lastTrackEndTime.video=performance.now(),"camera"===t.videoPreviewType&&t.checkVideoExceptionEnded(e)}))},Object.defineProperty(e.prototype,"videoTrack",{get:function(){var e;return this._videoTrack||(null===(e=this.localStream)||void 0===e?void 0:e.getVideoTracks()[0])||null},set:function(e){this._videoTrack=e,this.bindVideoTrackEvent(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"videoNodeQueue",{get:function(){if(!this._videoNodeQueue){if(!this._videoTrack)throw new Error("cannot use video node queue, because videoTrack of previewer haven't been inited.");var e=new tc(this._videoTrack,this.ee),t=new uc(this,this.stateCenter.browser);this._videoNodeQueue=new nc(e,t,this.ee,this.stateCenter.browser,this),this.vcMgr&&(this._videoNodeQueue.vcMgr=this.vcMgr)}return this._videoNodeQueue},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isVideoNodeQueueEnabled",{get:function(){return this._videoNodeQueue&&!this._videoNodeQueue.isEmpty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ac",{get:function(){return this.ee.ac},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"acMgr",{get:function(){return this.ee.acMgr},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vcMgr",{get:function(){if(!this._vcMgr){if(!this._videoTrack)throw new Error("cannot use video node queue, because videoTrack of previewer haven't been inited.");this._vcMgr=new pc(this.logger,this.stateCenter.browser,this.streamCenter.isCustomVC),this._videoNodeQueue&&(this._videoNodeQueue.vcMgr=this.vcMgr)}return this._vcMgr},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containBackgroundProcess",{get:function(){var e=this;if("compositing"===this.previewType){var t=this.inputStreamOptions.some((function(t){if(t.stream){var i=e.ee.checkPreview(t.stream);return null==i?void 0:i.isBackgroundBlur}}));return t}return!!this.isBackgroundBlur},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"micTrack",{get:function(){return this.hasMicTrack&&"camera"===this.audioPreviewType&&this.audioTrack||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isVideoEffectStarting",{get:function(){return!!this.videoEffect&&this.videoEffect.isStarting},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isVideoEffectEnabled",{get:function(){return!!this.videoEffect&&this.videoEffect.enabled},enumerable:!1,configurable:!0}),e.prototype.getMediaStreamConstraints=function(e,t){var i={audio:null,video:null},r=ze();if(r&&r.includes("11_4")||(e=mu(this.re,this.Xn,e)),i.audio=!0,i.video={width:this.re.settingConfig.getSetting("camera_width")||640,height:this.re.settingConfig.getSetting("camera_height")||480,frameRate:this.re.settingConfig.getSetting("camera_framerate")||15,bitRate:this.re.settingConfig.getSetting("camera_video_bitrate")},e.audio){var n=this.re.settingConfig.getCloudSettingScenario(this.re.scenario);this.logger.info("zp.gmsc.2 audio cloud config "+JSON.stringify(n));var o=n.ANS,s=n.AGC,a=n.AEC;i.audio={},e.audioInput&&"undefined"!==e.audioInput&&(i.audio.deviceId={exact:e.audioInput}),i.audio.noiseSuppression=o,i.audio.autoGainControl=s,i.audio.echoCancellation=a,dn(e.ANS)&&(i.audio.noiseSuppression=e.ANS),dn(e.AGC)&&(i.audio.autoGainControl=e.AGC),dn(e.AEC)&&(i.audio.echoCancellation=e.AEC),i.audio.channelCount=un(e.channelCount)?e.channelCount:1}else!1===e.audio&&(i.audio=!1);if(e.video){var c=640,u=480,l=15,f=this.re.settingConfig.getSetting("camera_video_bitrate");if(1===e.videoQuality?(c=d.width,u=d.height,l=d.frameRate,f=d.bitRate):2===e.videoQuality?(c=h.width,u=h.height,l=h.frameRate,f=h.bitRate):3===e.videoQuality?(c=p.width,u=p.height,l=p.frameRate,f=p.bitRate):(c=e.width||640,u=e.height||480,l=e.frameRate||15,f=e.bitRate||this.re.settingConfig.getSetting("camera_video_bitrate"),this.Xn.info("zp.gmsc.2 quality: ",e.videoQuality)),t&&!e.videoQuality&&(e.width&&(c=e.width),e.height&&(u=e.height),e.frameRate&&(l=e.frameRate),e.bitRate&&(f=e.bitRate)),!1===e.horizontal){var m=u;u=c,c=m}!0===e.isSwitch&&(m=u,u=c,c=m),i.video={width:c,height:u,frameRate:l,bitRate:f},null!=e.facingMode?i.video.facingMode=e.facingMode:e.videoInput&&"undefined"!=e.videoInput&&(i.video.deviceId={exact:e.videoInput}),this.Xn.info("zp.gmsc.2 width: "+c+" height: "+u+" rate: "+l)}else!1===e.video&&(i.video=!1);return{mediaStreamConstraints:i,mediaStreamConfig:e}},e.prototype.addTrackListener=function(e){var t=this;e.addEventListener("ended",(function(){Zn(e,t.Xn,"zc.tk.end")})),e.addEventListener("mute",(function(){Zn(e,t.Xn,"zc.tk.mute")})),e.addEventListener("unmute",(function(){Zn(e,t.Xn,"zc.tk.unmt")}))},e.prototype.startPreview=function(e,t,i,r){return Xc(this,void 0,void 0,(function(){var n,o,s;return Hc(this,(function(a){switch(a.label){case 0:if(this.Xn.info("zp.sv.2 called "+JSON.stringify(e)),this.mediaStreamConfig=qc({},e),!1===e.video&&this.deleteConstraints(this.mediaStreamConfig,Fc),!1===e.audio&&this.deleteConstraints(this.mediaStreamConfig,Vc),this.Xn.info("zp.sv.2 store "+JSON.stringify(this.mediaStreamConfig)),n=function(e){t(e)},gn(e.source)||bn(e.source)){try{o=this.we(e),n&&n(o)}catch(e){i(e)}return[2]}return void 0!==navigator.mediaDevices&&null!=navigator.mediaDevices.getUserMedia?[3,1]:(i&&i(ui.error.Ai),[2]);case 1:return a.trys.push([1,3,,4]),[4,this.Ee(e,r)];case 2:return o=a.sent(),n&&n(o),[3,4];case 3:return s=a.sent(),i(s),[3,4];case 4:return[2]}}))}))},Object.defineProperty(e.prototype,"hasUserSetBitrate",{get:function(){var e,t=this.mediaStreamConfig,i=t.bitRate;return void 0!==(null!==(e=null!=i?i:t.bitrate)&&void 0!==e?e:t.videoQuality)},enumerable:!1,configurable:!0}),e.prototype.Ee=function(e,t){var i,r;return Xc(this,void 0,void 0,(function(){var n,o,s,a,c,u,l,d,h,p,f,m,v,g,y,b,_,S,T,E,C,w,I=this;return Hc(this,(function(R){switch(R.label){case 0:n=this.getMediaStreamConstraints(e),s=n.mediaStreamConfig,a={},(o=n.mediaStreamConstraints).video?a=qc({},o.video):hn(s.bitRate)||(a.bitRate=s.bitRate),this.videoInfo=qc(qc({},a),{keyFrameInterval:s.keyFrameInterval}),this.videoInfo?(this.videoInfo.audioBitrate=1e3*s.audioBitrate||48e3,this.videoInfo.startBitrate=s.startBitrate||this.re.settingConfig.getSetting("bitrate_mode"),this.videoInfo.minBitrate=s.minBitrate,this.videoInfo.keyFrameInterval=s.keyFrameInterval):s.audioBitrate&&(this.videoInfo={audioBitrate:1e3*s.audioBitrate||48e3}),this.logger.info("zp.sv.2 update video info ".concat(JSON.stringify(this.videoInfo),", onlyPreview: ").concat(this.onlyPreview)),o.audio&&(c=this.re.settingConfig.getCloudSettingScenario(this.re.scenario,!0),l=c.channelCount,d=c.AEC,h=c.AGC,p=c.ANS,this.logger.info("zp.sv.2 scenario ".concat(u=c.audioBitrate," ").concat(l," ").concat(d," ").concat(h," ").concat(p)),u&&(this.videoInfo.audioBitrate=1e3*u),l&&(o.audio.channelCount=l,this.videoInfo.channelCount=l),dn(d)&&(this.logger.info("zp.sv.2 setting AEC "+d),this.mediaStreamConfig.AEC=o.audio.echoCancellation=d),dn(h)&&(this.logger.info("zp.sv.2 setting AGC "+h),this.mediaStreamConfig.AGC=o.audio.autoGainControl=h),dn(p)&&(this.logger.info("zp.sv.2 setting ANS "+p),this.mediaStreamConfig.ANS=o.audio.noiseSuppression=p)),o.video instanceof Object&&(o.video.width=this.re.settingConfig.getSetting("camera_width",!0)||o.video.width,o.video.height=this.re.settingConfig.getSetting("camera_height",!0)||o.video.height,o.video.frameRate=this.re.settingConfig.getSetting("camera_framerate",!0)||o.video.frameRate),this.mediaStreamConfig.video=!!o.video,this.mediaStreamConfig.audio=!!o.audio,s.unlimitedCaptureResolution&&o.video.width&&(o.video.width={ideal:4096},o.video.height={ideal:2160},this.Xn.info("zp.sv.2 ","capture max resolution of camera")),this.logger.info("zp.sv.2 constraints ",JSON.stringify(o)),t.setAttribute("preview_conf",ui.preview_conf(o)),f=function(e){var t=ui.error.Pi;return t.message=t.message+" "+e.name+" "+e.message,"NotAllowedError"===e.name||"SecurityError"===e.name?(t=qc({},ui.error.xi)).message=e.name+": "+t.message:"NotReadableError"===e.name?(t=qc({},ui.error.Mi)).message=e.name+": "+t.message:"OverconstrainedError"===e.name&&((t=qc({},ui.error.ji)).message=e.name+": "+t.message+(e.constraint?". such as "+e.constraint:"")),t},m=function(e,t){return new we((function(i){I.Xn.info("zp.sv.2 recapture call"),To((function(r){var n=r.cameras,o=r.microphones;if(I.Xn.info("zp.sv.2 recapture devices "+t+" "+n.length+" "+o.length),"video"===t){if(!(n.length>0))return void i(void 0);var s=n[0].deviceID;I.Xn.info("zp.sv.2 recapture video "+s),e.video.deviceId={exact:s}}else if("audio"===t){if(!(o.length>0))return void i(void 0);var a=o[0].deviceID;I.Xn.info("zp.sv.2 recapture audio "+a),e.audio.deviceId={exact:a}}navigator.mediaDevices.getUserMedia(e).then((function(e){I.Xn.info("zp.sv.2 recapture success"),i(e)})).catch((function(e){i(void 0)}))}),(function(e){I.Xn.warn("zp.sv.2 recapture getDevices err:",e.message),i(void 0)}))}))},v=null,R.label=1;case 1:return R.trys.push([1,3,,6]),[4,navigator.mediaDevices.getUserMedia(o)];case 2:return(v=R.sent()).getTracks().forEach((function(e){Zn(e,I.Xn,"zp.sv.2"),I.addTrackListener(e)})),this.Xn.info("zp.sv.2 success"),[3,6];case 3:return g=R.sent(),this.Xn.info("zp.sv.2 failed ",g.name," ",g.message),"NotFoundError"!==g.name?[3,5]:(b=!1===o.video,_=!1,S=!1,(y=!1===o.audio)&&(_=hn(null===(i=o.video)||void 0===i?void 0:i.videoInput)),b&&(S=hn(null===(r=o.audio)||void 0===r?void 0:r.audioInput)),this.Xn.info("zp.sv.2 failed "+(T=y&&_||b&&S)+" "+(E=y?"video":"audio")),T?[4,m(o,E)]:[3,5]);case 4:(C=R.sent())&&(v=C),R.label=5;case 5:if(!v)throw f(g);return[3,6];case 6:return this.localStream=v,this.previewSuc=!0,this.initMediaTrack(v),this.videoInfo&&(w=pn(o.audio)&&o.audio.channelCount,this.videoInfo.channelCount=w||(this.audioTrack&&this.audioTrack.getSettings?this.audioTrack.getSettings().channelCount:1)),[2,v]}}))}))},e.prototype.we=function(e){if(gn(e.source)){var t=e.source.getVideoTracks(),i=t.length>0?t[0].getSettings():{width:0,height:0,frameRate:0};return this.Xn.debug("zp.sv.2 use external media stream"),this.previewSuc=!0,this.localStream=e.source,this.initMediaTrack(e.source),this.videoInfo={width:i.width,height:i.height,frameRate:i.frameRate,bitRate:e.bitRate||this.re.settingConfig.getSetting("custom_video_bitrate"),startBitrate:e.startBitrate||this.re.settingConfig.getSetting("bitrate_mode"),minBitrate:e.minBitrate,keyFrameInterval:e.keyFrameInterval,channelCount:e.channelCount||(this.audioTrack&&this.audioTrack.getSettings?this.audioTrack.getSettings().channelCount:1),audioBitrate:1e3*e.audioBitrate||48e3},this.localStream}if(bn(e.source)){var r=this.captureStream(e.source,e);if(r)return this.videoInfo.bitRate=e.bitRate||this.re.settingConfig.getSetting("custom_video_bitrate"),this.previewSuc=!0,this.initMediaTrack(r),r;throw ui.error.Ai}return new MediaStream},e.prototype.captureStream=function(e,t){if(!e)return this.Xn.info("zp.cs.2 no local video"),null;var i;if(e.captureStream)i=e.captureStream(),this.Xn.debug("zp.cs.2 captureStream");else{if(!e.mozCaptureStream)return this.Xn.info("zp.cs.2 don't support"),null;i=e.mozCaptureStream(),this.Xn.debug("zp.cs.2 mozCaptureStream")}return 0==i.getTracks().length?(this.Xn.error("zp.cs.2 external capture tracks no found"),null):(this.localStream=i,this.videoInfo={width:e.videoWidth,height:e.videoHeight,frameRate:0,bitRate:t.bitRate||this.re.settingConfig.getSetting("custom_video_bitrate"),channelCount:t.channelCount||(this.audioTrack&&this.audioTrack.getSettings?this.audioTrack.getSettings().channelCount:1),audioBitrate:1e3*t.audioBitrate||48e3,startBitrate:t.startBitrate||this.re.settingConfig.getSetting("bitrate_mode"),minBitrate:t.minBitrate,keyFrameInterval:t.keyFrameInterval},this.Xn.debug("zp.cs.2 called success"),this.localStream)},e.prototype.stopPreview=function(){var e,t,i,r=this;if(this.Xn.info("zp.sv.2.1 called"),this.localStream){var n=this.rtcViewer;n&&n.destroy(),this.videoEffect&&(this.videoEffect.setBeautyEffectOptions(!1),this.videoEffect.destroy()),null===(e=this.re.backgroundBlurManager)||void 0===e||e.releaseMap(this.localStream),this.backgroundProcessor&&(this.backgroundProcessor.release(),this.backgroundProcessor=null),this.streamCompositor&&(this.streamCompositor=null),this._videoNodeQueue&&this.videoNodeQueue.destroy(),this.ee.trackUtils.stopTrack(this.cloneVideoTrack),this.cloneVideoTrack=null,this.muteImageAnID&&cancelAnimationFrame(this.muteImageAnID),this.stopSoundLevel(),this.ee.trackUtils.stopTrack(this.originVideoTrack),this.originVideoTrack=null,this.ee.trackUtils.stopTrack(this.originAudioTrack),this.originAudioTrack=null,this.ee.trackUtils.stopTrack(this.videoTrack),this.videoTrack=null,this.ee.trackUtils.stopTrack(this.audioTrack),this.audioTrack=null,zc.sourceDisConnect(this.localStream),null===(t=this.audioMixManager)||void 0===t||t.stopAudioManager(),!this.zegoCaptureStream&&this.localStream.getTracks().forEach((function(e){r.ee.trackUtils.stopTrack(e)})),this.localStream=null,!this.zegoCaptureStream&&(null===(i=this.lowStream)||void 0===i||i.getTracks().forEach((function(e){return r.ee.trackUtils.stopTrack(e)}))),this.lowStream=void 0,this.videoInfo={}}},e.prototype.enableMicrophone=function(e,t){return!1},e.prototype.updatePublisherStreamMicStatus=function(e){var t=this;if(this.localStream){var i=this.streamCenter.getPublishList(this.localStream).map((function(e){return e.publisher}));i.length&&i.forEach((function(i){i.sendStreamStatus(i.camera_status,t.isAudioEnabled&&e?0:2)}))}},e.prototype.updatePublisherStreamCameraStatus=function(e){if(this.localStream){var t=this.streamCenter.getPublishList(this.localStream).map((function(e){return e.publisher}));t.length&&t.forEach((function(t){t.sendStreamStatus(e?0:2,t.mic_status)}))}},e.prototype.enableCamera=function(e,t,i){return!1},e.prototype.enableCameraCapturing=function(e){return Xc(this,void 0,void 0,(function(){return Hc(this,(function(e){return[2,!1]}))}))},e.prototype.stopCaptureVideo=function(){return new we((function(e){return e()}))},e.prototype.startSoundLevel=function(){var e;if(this.localStream&&0!=this.localStream.getAudioTracks().length){null===(e=this.soundMeterWorklet)||void 0===e||e.destroy();var t=this.ee.getCloudSoundInterval();try{var i=this,r=this.ee.createSoundLevel(this.ac,this.localStream,this.ee.soundLevelInterval,t,(function(e){i.soundLevel=100*e})),n=r.mic;this.soundMeterWorklet=r.soundMeter,this.mic=n}catch(e){this.Xn.error(ks+" get sound level failed "+e)}}},e.prototype.stopSoundLevel=function(){var e;this.soundLevel=0,null===(e=this.soundMeterWorklet)||void 0===e||e.destroy(),this.soundMeterWorklet=null,this.mic=null},e.prototype.restartSoundLevel=function(){this.ee.soundLevelDelegate?(this.stopSoundLevel(),this.startSoundLevel()):this.stopSoundLevel()},e.prototype.setBeautyEffect=function(e,t){return Xc(this,void 0,void 0,(function(){return Hc(this,(function(e){return[2]}))}))},e.prototype.replacePreviewTrack=function(e,t,i){void 0===t&&(t=!1)},e.prototype.updateZegoStreamCaptureTrack=function(e){var t=this.zegoCaptureStream;if(t){var i="video"==e.kind?t.originVideoStream:t.originAudioStream;if(i){var r=this.ee.checkPreview(i);this.Xn.info("zsc.uzsct replace zego preivew"),null==r||r.replacePreviewTrack(e)}}},e.prototype.createLowStream=function(){var e,t,i,r,n,o=null===(e=this.localStream)||void 0===e?void 0:e.getVideoTracks()[0];if(o){var s=o.getSettings().height,a=o.getSettings().width,c=Re(),u=Be(),l=c.indexOf("Android")>-1||c.indexOf("Adr")>-1;this.Xn.info("zp.cls w: "+a+" h: "+s+" "+l+" "+u);var d=un(null===(t=this.videoInfo)||void 0===t?void 0:t.width)&&un(null===(i=this.videoInfo)||void 0===i?void 0:i.height)&&s==this.videoInfo.width&&a==this.videoInfo.height;if(u&&l&&d){var h=s;s=a,a=h}var p=s&&a?s/a:1;try{var f,m=this.lowStreamConfig,v=m.width,g=m.frameRate;if(f=Math.round(p*this.lowStreamConfig.width),this.Xn.info("zp.cls lw: "+v+" lh: "+f),"firefox"===this.re.browser)this.lowStream=this.getStreamThroughCanvas(this.localStream,{w:v,h:f,fps:g});else{this.lowStream=null===(r=this.localStream)||void 0===r?void 0:r.clone();var y=null===(n=this.lowStream)||void 0===n?void 0:n.getVideoTracks()[0];null==y||y.applyConstraints({width:v,height:f,frameRate:g})}}catch(e){this.Xn.error("zp.cls "+e)}}},e.prototype.initAudioNodeQueue=function(e){if(!this.audioTrack||!this.localStream)return!1;var t=this.createSrcNode(this.audioTrack),i=this.createDestNode(this.localStream);return this.audioNodeQueue=new Wa(t,i),!0},e.prototype.createSrcNode=function(e,t,i){var r;void 0===t&&(t=!1),void 0===i&&(i=!1);var n=e||this.audioTrack;if(n===(null===(r=this.destNode)||void 0===r?void 0:r.stream.getAudioTracks()[0])&&(this.Xn.info("zp.pv.csn use empty track"),n=this.getEmptyAudioTrack()),this.srcNode&&!i){if(!t)return this.srcNode;this.srcNode.disconnect(),this.Xn.info("zp.pv.csn recreate src")}var o=new MediaStream;n&&o.addTrack(n);var s=this.ac.createMediaStreamSource(o);return i||(this.srcNode=s),this.Xn.info("zp.pv.csn "+"create src audio id: ".concat(null==n?void 0:n.id,", ").concat(null==n?void 0:n.label,",i")),s},e.prototype.isOriginEmptyTrack=function(){return!this.audioTrack||this._emptyAudioTrack===this.audioTrack},e.prototype.createDestNode=function(e){var t;if(this.destNode)return this.destNode;var i=this.destNode=this.destNode||this.ac.createMediaStreamDestination(),r=i.stream.getAudioTracks()[0];this.Xn.info("zp.pv.cdn "+"create dest audio id: ".concat(null==r?void 0:r.id,", ").concat(null==r?void 0:r.label,",i"));var n=this.rtcViewer;for(var o in this.ee.publisherList){var s=this.ee.publisherList[o];if(s.localStream==e){var a=null===(t=s.publisher.peerConnection)||void 0===t?void 0:t.getSenders().find((function(e){return e.track&&"audio"===e.track.kind}));a&&(a.replaceTrack(r),this.Xn.info("zc.pv.cdn change sender audio track"));break}}var c=e.getAudioTracks()[0];return c&&(e.removeTrack(c),!this.isOriginEmptyTrack()&&r&&(r.enabled=c.enabled)),e.addTrack(r),n&&n.setAudio(r),i},e.prototype.initMediaTrack=function(e){e.getVideoTracks().length>0&&(this.videoTrack=e.getVideoTracks()[0],this.originVideoTrack=this.videoTrack),e.getAudioTracks().length>0&&(this.audioTrack=e.getAudioTracks()[0],this.originAudioTrack=this.audioTrack)},e.prototype.onAudioTrackChange=function(e){},e.prototype.getViewer=function(){return!this.localStream||this.rtcViewer&&this.rtcViewer.inited||(this.rtcViewer=new Qa(this.localStream,this,{clearLastFrame:this.re.engineConfig.previewClearLastFrame})),this.rtcViewer},e.prototype.getStreamThroughCanvas=function(e,t){var i,r=this;if(0==e.getVideoTracks().length)return e;var n=null===(i=e.getVideoTracks()[0])||void 0===i?void 0:i.getSettings(),o=n.width,s=n.height,a=n.frameRate;if(!o||!s||!a)return e;var c=Ne(),u=Ie.createElement("canvas"),l=u.getContext("2d");c.setAttribute("style","display:none"),u.setAttribute("style","display:none"),u.width=(null==t?void 0:t.w)||o,u.height=(null==t?void 0:t.h)||s,new we((function(e,t){var i=null;c&&c.addEventListener("playing",(function t(){i&&clearTimeout(i),c&&c.removeEventListener("playing",t),e(void 0)})),i=window.setTimeout((function(){t()}),1e3)})).then((function(){var i=(null==t?void 0:t.fps)||a||15;r.drawCanvasTimer&&(clearInterval(r.drawCanvasTimer),r.drawCanvasTimer=null),r.drawCanvasTimer=setInterval((function(){var i,r=null===(i=e.getVideoTracks()[0])||void 0===i?void 0:i.getSettings();u.width=(null==t?void 0:t.w)||r.width||c.videoWidth,u.height=(null==t?void 0:t.h)||r.height||c.videoHeight,null==l||l.drawImage(c,0,0,u.width,u.height)}),1e3/i)})),c.srcObject=e,c.play();var d=u.captureStream((null==t?void 0:t.fps)||15);if(d.getVideoTracks()[0].stop=function(){r.drawCanvasTimer&&(clearInterval(r.drawCanvasTimer),r.drawCanvasTimer=null),c.pause(),c.remove(),u.remove()},gn(e)&&e.getAudioTracks().length){var h=e.getAudioTracks()[0];d.addTrack(h)}return d},e.prototype.stopCanvasStreamTrack=function(){this.streamFromCanvas&&this.streamFromCanvasTrack&&(this.ee.trackUtils.stopTrack(this.streamFromCanvasTrack),this.streamFromCanvasTrack=null),this.drawCanvasTimer&&(clearInterval(this.drawCanvasTimer),this.drawCanvasTimer=null)},e.prototype.updateVideoInfo=function(e){var t={width:e.width,height:e.height,frameRate:e.frameRate,bitRate:e.bitRate,minBitrate:e.minBitrate,keyFrameInterval:e.keyFrameInterval};return this.Xn.info("zc.pv.uvi input video info: ".concat(JSON.stringify(t))),this.videoInfo=qc(qc(qc({},this.videoInfo),t),{bitRate:this.videoInfo.bitRate||t.bitRate,minBitrate:this.videoInfo.bitRate||t.bitRate}),qc({},this.videoInfo)},e.prototype.updateAudioInfo=function(e){var t={};return this.Xn.info("zc.pv.uai input audio info: ".concat(JSON.stringify(t))),this.videoInfo=qc(qc({},this.videoInfo),t),qc({},this.videoInfo)},e.prototype.updateMediaStreamConstraints=function(e,t){var i=this;this.Xn.info("zc.pv.umsc ".concat(JSON.stringify(e))),"video"===t?Fc.forEach((function(t){return i.mediaStreamConfig[t]=e[t]})):Vc.forEach((function(t){return i.mediaStreamConfig[t]=e[t]}))},e.prototype.deleteConstraints=function(e,t){t.forEach((function(t){return delete e[t]}))},e.prototype.setVolumeFactorByUserCount=function(e){var t,i=this.re.engineConfig.choirRole;if(this.localStream){this.Xn.info("zc.pv.svf ".concat(null===(t=this.localStream)||void 0===t?void 0:t.id," count: ").concat(e,", mic: ").concat(!!this.micTrack,", choir role: ").concat(i));var r=this.volumeFactor,n=[1,2].includes(i);if(this.micTrack&&n)for(var o=[[0,1],[3,1],[4,.9],[8,.7],[12,.5],[16,.45],[20,.4],[24,.35],[1/0,.3]],s=0;s<o.length;s++){var a=o[s][0],c=o[s+1];if(!c){this.Xn.error("zc.pv.svf error: no map factor");break}if(e>=a&&e<c[0]){r=c[1];break}}else r=1===i?.6:1;this.audioMixManager&&this.audioMixManager.setVolumeFactor(1===i?.6:1),this.Xn.info("zc.pv.svf factor: ".concat(r)),this.setVolume(void 0,r)}},e.prototype.setVolume=function(e,t){var i,r,n;this.Xn.info("zc.pv.scv volume: ".concat(e,", factor: ").concat(t,"; origin: ").concat(this.volume,", ").concat(this.volumeFactor)),void 0===e?e=this.volume:this.volume=e,void 0===t?t=this.volumeFactor:this.volumeFactor=t;var o=this.gainNode;o||(this.audioNodeQueue||this.initAudioNodeQueue(),o=this.ac.createGain(),null===(i=this.audioNodeQueue)||void 0===i||i.pushFront(o),this.gainNode=o);var s=e/100*this.volumeFactor;if(un(s)){var a=!1;o.gain.value!=s&&(a=!0,o.gain.value=s),this.Xn.info("zc.pv.scv ".concat(this.audioPreviewType," ").concat(null===(n=this.localStream)||void 0===n?void 0:n.id," volume: ").concat(s,". hasChanged: ").concat(a))}else this.Xn.error("zc.pv.scv ".concat(this.audioPreviewType," ").concat(null===(r=this.localStream)||void 0===r?void 0:r.id," volume error: ").concat(s))},e}();!function(e){e[e.Off=0]="Off",e[e.TurningOn=1]="TurningOn",e[e.On=2]="On"}(mc||(mc={})),function(e){e[e.World=0]="World",e[e.Team=1]="Team",e[e.SecretTeam=2]="SecretTeam"}(vc||(vc={})),function(e){e[e.All=0]="All",e[e.World=1]="World",e[e.Team=2]="Team"}(gc||(gc={})),function(e){e[e.All=0]="All",e[e.World=1]="World",e[e.Team=2]="Team"}(yc||(yc={})),function(e){e[e.Song=0]="Song",e[e.Accompaniment=1]="Accompaniment",e[e.AccompanimentClip=2]="AccompanimentClip",e[e.AccompanimentSegment=3]="AccompanimentSegment"}(bc||(bc={})),function(e){e[e.Count=0]="Count",e[e.User=1]="User",e[e.Room=2]="Room",e[e.Master=3]="Master"}(_c||(_c={})),function(e){e[e.VendorDefault=0]="VendorDefault",e[e.Vendor1=1]="Vendor1",e[e.Vendor2=2]="Vendor2",e[e.Vendor3=4]="Vendor3"}(Sc||(Sc={})),function(e){e[e.PortraitSegmentation=0]="PortraitSegmentation"}(Tc||(Tc={})),function(e){e[e.NONE=0]="NONE",e[e.MEN_TO_CHILD=1]="MEN_TO_CHILD",e[e.MEN_TO_WOMEN=2]="MEN_TO_WOMEN",e[e.WOMEN_TO_CHILD=3]="WOMEN_TO_CHILD",e[e.WOMEN_TO_MEN=4]="WOMEN_TO_MEN",e[e.FOREIGNER=5]="FOREIGNER",e[e.OPTIMUS_PRIME=6]="OPTIMUS_PRIME",e[e.ANDROID=7]="ANDROID",e[e.ETHEREAL=8]="ETHEREAL",e[e.MALE_MAGNETIC=9]="MALE_MAGNETIC",e[e.FEMALE_FRESH=10]="FEMALE_FRESH",e[e.MAJOR_C=11]="MAJOR_C",e[e.MINOR_A=12]="MINOR_A",e[e.HARMONIC_MINOR=13]="HARMONIC_MINOR",e[e.FEMALE_ENERGETIC=14]="FEMALE_ENERGETIC",e[e.RICHNESS=15]="RICHNESS",e[e.MUFFLED=16]="MUFFLED",e[e.ROUNDNESS=17]="ROUNDNESS",e[e.FALSETTO=18]="FALSETTO",e[e.FULLNESS=19]="FULLNESS",e[e.CLEAR=20]="CLEAR",e[e.HIGHLY_RESONANT=21]="HIGHLY_RESONANT",e[e.LOUD_CLEAR=22]="LOUD_CLEAR"}(Ec||(Ec={})),function(e){e[e.None=0]="None",e[e.SoftRoom=1]="SoftRoom",e[e.LargeRoom=2]="LargeRoom",e[e.ConcertHall=3]="ConcertHall",e[e.Valley=4]="Valley",e[e.RecordingStudio=5]="RecordingStudio",e[e.Basement=6]="Basement",e[e.KTV=7]="KTV",e[e.Popular=8]="Popular",e[e.Rock=9]="Rock",e[e.VocalConcert=10]="VocalConcert",e[e.GramoPhone=11]="GramoPhone",e[e.EnhancedKTV=12]="EnhancedKTV"}(Cc||(Cc={})),function(e){e[e.None=0]="None",e[e.Local=1]="Local",e[e.Publish=2]="Publish",e[e.All=3]="All"}(wc||(wc={})),function(e){e[e.AI=0]="AI",e[e.AIBalanced=1]="AIBalanced"}(Ic||(Ic={})),function(e){e[e.Off=0]="Off",e[e.On=1]="On"}(Rc||(Rc={})),function(e){e[e.PortraitSegmentation=0]="PortraitSegmentation"}(kc||(kc={})),function(e){e[e.ZegoGeoFenceTypeNone=0]="ZegoGeoFenceTypeNone",e[e.ZegoGeoFenceTypeInclude=1]="ZegoGeoFenceTypeInclude",e[e.ZegoGeoFenceTypeExclude=2]="ZegoGeoFenceTypeExclude"}(Pc||(Pc={})),function(e){e[e.AspectFill=0]="AspectFill",e[e.AspectFit=1]="AspectFit"}(Ac||(Ac={})),function(e){e[e.ZegoFontTypeSourceHanSans=0]="ZegoFontTypeSourceHanSans",e[e.ZegoFontTypeAlibabaSans=1]="ZegoFontTypeAlibabaSans",e[e.ZegoFontTypePangMenZhengDaoTitle=2]="ZegoFontTypePangMenZhengDaoTitle",e[e.ZegoFontTypeHappyZcool=3]="ZegoFontTypeHappyZcool"}(Dc||(Dc={})),function(e){e[e.ZegoDefined=0]="ZegoDefined",e[e.UserUnregister=1]="UserUnregister"}(Nc||(Nc={})),function(e){e[e.video=0]="video",e[e.audio=1]="audio",e[e.videoAndAudio=2]="videoAndAudio"}(Oc||(Oc={}));var jc=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Qc=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Wc=function(){function e(e){this.zegoStream=e}return Object.defineProperty(e.prototype,"active",{get:function(){return this.zegoStream.active},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.zegoStream.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"videoCaptureStream",{get:function(){return this.zegoStream.originVideoStream},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioCaptureStream",{get:function(){return this.zegoStream.originAudioStream},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stream",{get:function(){return this.zegoStream.stream},enumerable:!1,configurable:!0}),e.prototype.getAudioTracks=function(){return this.zegoStream.getAudioTracks()},e.prototype.getVideoTracks=function(){return this.zegoStream.getVideoTracks()},e.prototype.getTracks=function(){return this.zegoStream.getTracks()},Object.defineProperty(e.prototype,"videoDeviceId",{get:function(){return this.zegoStream.videoDeviceId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioDeviceId",{get:function(){return this.zegoStream.audioDeviceId},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){return this.zegoStream.on(e,t)},e.prototype.off=function(e,t){return this.zegoStream.off(e,t)},e.prototype.startCaptureMicrophone=function(e){return this.zegoStream.startCaptureMicrophone(e)},e.prototype.startCaptureCamera=function(e){return this.zegoStream.startCaptureCamera(e)},e.prototype.startCaptureCameraAndMicrophone=function(e,t){return this.zegoStream.startCaptureCameraAndMicrophone(e,t)},e.prototype.startCaptureCustomAudio=function(e){return this.zegoStream.startCaptureCustomAudio(e)},e.prototype.startCaptureCustomVideo=function(e){return this.zegoStream.startCaptureCustomVideo(e)},e.prototype.startCaptureCustomVideoAndAudio=function(e,t){return this.zegoStream.startCaptureCustomVideoAndAudio(e,t)},e.prototype.startCaptureScreen=function(e){return this.zegoStream.startCaptureScreen(e)},e.prototype.startCaptureScreenWithAudio=function(e,t){return this.zegoStream.startCaptureScreenWithAudio(e,t)},e.prototype.stopCaptureAudio=function(){return jc(this,void 0,void 0,(function(){return Qc(this,(function(e){return[2,this.zegoStream.stopCaptureAudio()]}))}))},e.prototype.stopCaptureVideo=function(){return jc(this,void 0,void 0,(function(){return Qc(this,(function(e){return[2,this.zegoStream.stopCaptureVideo()]}))}))},e.prototype.playAudio=function(e){this.zegoStream.playAudio(e)},e.prototype.playCaptureAudio=function(e){this.zegoStream.playCaptureAudio(e)},e.prototype.playVideo=function(e,t){this.zegoStream.playVideo(e,t)},e.prototype.playCaptureVideo=function(e,t){this.zegoStream.playCaptureVideo(e,t)},e.prototype.takeStreamSnapshot=function(e){return this.zegoStream.takeStreamSnapshot(e)},e.prototype.resumeVideo=function(){return this.zegoStream.resumeVideo()},e.prototype.resumeAudio=function(){return this.zegoStream.resumeAudio()},e.prototype.stopVideo=function(){this.zegoStream.stopVideo()},e.prototype.stopAudio=function(){this.zegoStream.stopAudio()},e.prototype.stopPlayCaptureVideo=function(){this.zegoStream.stopPlayCaptureVideo()},e.prototype.stopPlayCaptureAudio=function(){this.zegoStream.stopPlayCaptureAudio()},e.prototype.setVolume=function(e){return this.zegoStream.setVolume(e)},e}(),Zc=function(){return Zc=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Zc.apply(this,arguments)},Kc=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Jc=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Yc=function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},$c=function(){function e(e,t,i,r,n,o){var s=this;this.Se=e,this.Xn=t,this.ee=i,this.re=r,this.Oe=n,this.ke=o,this.id="zego-stream-"+Date.now().toString(16),this.originVideoStream=null,this.originAudioStream=null,this.audioMuted=!0,this.audioCaptureMuted=!0,this.stream=null,this.Re=[],this.Ie=[],this.eventHandler={autoplayFailed:function(e,t){s.eventManager.emit("autoplayFailed",e,t)},autoplayCaptureFailed:function(e,t){s.eventManager.emit("autoplayCaptureFailed",e,t)},canPlayAudio:function(e){s.eventManager.emit("canPlayAudio",e)},canPlayVideo:function(e){s.eventManager.emit("canPlayVideo",e)},canPlayCaptureVideo:function(e){s.eventManager.emit("canPlayCaptureVideo",e)},canPlayCaptureAudio:function(e){s.eventManager.emit("canPlayCaptureAudio",e)}},this.isPlayingVideo=!1,this.isPlayingCaptureVideo=!1,this.aCaptureViewer=null,this.vCaptureViewers=[],this.videoWrappers=[],this.viewer=null,this.Te=null,this.originStreamPreviewType="",this.streamPreviewType="",this.originVideoTrack=null,this.originAudioTrack=null,this.eventManager=new La,this.autoPlay&&!e.view&&this.Xn.error("zcs.c if you want to play the stream automatically, the view parameter is required.")}return Object.defineProperty(e.prototype,"active",{get:function(){var e,t;return(null===(e=this.originAudioStream)||void 0===e?void 0:e.active)||(null===(t=this.originVideoStream)||void 0===t?void 0:t.active)||!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"view",{get:function(){return this.Se.view||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoPlay",{get:function(){return!!dn(this.Se.autoPlay)&&this.Se.autoPlay},enumerable:!1,configurable:!0}),e.prototype.getAudioTracks=function(){var e;return this.Xn.info("zcs.gats call"),(null===(e=this.originAudioStream)||void 0===e?void 0:e.getAudioTracks())||[]},e.prototype.getVideoTracks=function(){var e;return this.Xn.info("zcs.gvts call"),(null===(e=this.originVideoStream)||void 0===e?void 0:e.getVideoTracks())||[]},e.prototype.getTracks=function(){return Yc(Yc([],this.getAudioTracks(),!0),this.getVideoTracks(),!0)},Object.defineProperty(e.prototype,"videoDeviceId",{get:function(){var e=this.originVideoStream&&this.originVideoStream.getVideoTracks()[0];return e&&this._getDeviceIdByTrack(e)||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioDeviceId",{get:function(){var e=this.originAudioStream&&this.originAudioStream.getAudioTracks()[0];return e&&this._getDeviceIdByTrack(e)||""},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){return!!t&&this.eventManager.addEventHandler(e,t)},e.prototype.off=function(e,t){return this.eventManager.removeEventHandler(e,t)},e.prototype.startPublish=function(){},e.prototype.resetPublish=function(){this.Ae()},e.prototype._getDeviceIdByTrack=function(e){return e&&e.getSettings().deviceId||""},e.prototype.Ne=function(e,t){var i=pn(e)?e:{};return t.call(this,i)},e.prototype.Ce=function(e,t){var i=this;if(this.Xn.info("zcs.uos call type:"+t),0==t){if(this.originVideoStream=e,this.autoPlay||this.isPlayingCaptureVideo){var r=this.vCaptureViewers.map((function(e){return{container:e.container,option:e.options}}));this.stopPlayCaptureVideo(),(null==r?void 0:r.length)||(r=[{container:this.Se.captureView||null,option:{}}]),r.forEach((function(e){return e.container&&i.playCaptureVideo(e.container,e.option)}))}}else this.originAudioStream=e,this.audioCaptureMuted||(this.stopPlayCaptureAudio(),this.playCaptureAudio())},Object.defineProperty(e.prototype,"isPublish",{get:function(){for(var e in this.ee.publisherList)if(this.ee.publisherList[e].localStream==this.stream)return!0;return!1},enumerable:!1,configurable:!0}),e.prototype.updateStreamAudioTrack=function(e,t,i){return void 0===e&&(e=function(){}),void 0===t&&(t=function(){}),void 0===i&&(i=0),Kc(this,void 0,void 0,(function(){var r,n,o,s,a,c,u=this;return Jc(this,(function(l){switch(l.label){case 0:if(this.Xn.info("zcs.uat call"),!this.originAudioStream||this.isPublish&&0==i||!this.stream)return[2];if(!(r=this.checkPreview(this.originAudioStream))||!r.audioTrack)return this.Xn.info("zcs.uat not preview"),[2];n=this.originAudioTrack,o=r.audioTrack,s=function(t){u.originAudioTrack=r.audioTrack,e(t)},l.label=1;case 1:return l.trys.push([1,3,,4]),this.stream&&this.De(this.stream,this.stream,this.originAudioStream,!0),[4,this._updateStreamTrack(n,o,s,t)];case 2:return a=l.sent(),this.Xn.info("zcs.uat success"),[2,a];case 3:return c=l.sent(),this.Xn.info("zcs.uat fail"),[2,c];case 4:return[2]}}))}))},e.prototype.updateStreamVideoTrack=function(e,t,i){return void 0===e&&(e=function(){}),void 0===t&&(t=function(){}),void 0===i&&(i=0),Kc(this,void 0,void 0,(function(){var r,n,o,s,a,c=this;return Jc(this,(function(u){switch(u.label){case 0:if(this.Xn.info("zcs.uvt call"),!this.originVideoStream||this.isPublish&&0==i||!this.stream)return this.Xn.info("zcs.uvt not capture"),[2];if(r=this.originVideoTrack,!(n=this.checkPreview(this.originVideoStream))||!n.videoTrack)return this.Xn.info("zcs.uvt not preview"),[2];o=n.videoTrack,s=function(t){c.originVideoTrack=n.videoTrack,e(t)},u.label=1;case 1:return u.trys.push([1,3,,4]),this.stream&&this.De(this.stream,this.originVideoStream,this.stream,!0),[4,this._updateStreamTrack(r,o,s,t)];case 2:return u.sent(),this.streamPreviewType=this.originStreamPreviewType,this.Xn.info("zcs.uvt success"),[3,4];case 3:return a=u.sent(),this.Xn.info("zcs.uvt fail"),[2,a];case 4:return[2]}}))}))},e.prototype.updateStreamVideoAndAudio=function(e,t,i){return void 0===e&&(e=function(){}),void 0===t&&(t=function(){}),void 0===i&&(i=0),Kc(this,void 0,void 0,(function(){var r,n,o,s,a;return Jc(this,(function(c){switch(c.label){case 0:this.Xn.info("zcs.uva call"),r=!this.originVideoStream,n=!this.originAudioStream,o=function(t){r=!0,n&&e(t)},s=function(t){n=!0,r&&e(t)},c.label=1;case 1:return c.trys.push([1,4,,5]),[4,this.updateStreamVideoTrack(o,t,i)];case 2:return c.sent(),[4,this.updateStreamAudioTrack(s,t,i)];case 3:return c.sent(),[3,5];case 4:return a=c.sent(),t(a),this.Xn.info("zcs.uva error:".concat(JSON.stringify(a))),[3,5];case 5:return[2]}}))}))},e.prototype._updateStreamTrack=function(e,t,i,r){return Kc(this,void 0,void 0,(function(){var n,o,s,a,c,u;return Jc(this,(function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),this.Xn.info("zcs.ut call"),n=this.stream&&this.checkPreview(this.stream),this.stream&&n?(o={errorCode:0,extendedData:""},e?[3,2]:(this.Xn.info("zcs.ut add"),[4,this.ke.handleTrack("ADD",this.stream,t,i,r)])):(this.Xn.info("zcs.ut stream:".concat(!this.stream,", previewer:").concat(!n)),[2]);case 1:return o=l.sent(),[3,5];case 2:return e.id==t.id?[3,5]:(this.Xn.info("zcs.ut replace"),s=!1,this.originStreamPreviewType&&this.streamPreviewType&&this.originStreamPreviewType!==this.streamPreviewType&&(s=!0),[4,this.ke.replaceTrack(this.stream,t,void 0,s)]);case 3:return o=l.sent(),this.ee.trackUtils.stopTrack(e),a=this.ee.getPublisher(this.stream),(c=null==a?void 0:a.previewer.videoInfo.bitRate)?[4,null==a?void 0:a.setBitrate(c)]:[3,5];case 4:l.sent(),l.label=5;case 5:return i(o),[3,7];case 6:return u=l.sent(),r(u),[3,7];case 7:return[2]}}))}))},e.prototype.ze=function(e,t){var i;if(!this.stream){var r=[];if(this.originAudioStream){var n=this.checkPreview(this.originAudioStream);n&&n.audioTrack&&(r.push(n.audioTrack),this.originAudioTrack=n.audioTrack)}if(this.originVideoStream){var o=this.checkPreview(this.originVideoStream);o&&o.videoTrack&&(r.push(o.videoTrack),this.originVideoTrack=o.videoTrack)}this.stream=new MediaStream(r)}var s=this.checkPreview(this.stream);if(!s){var a={},c=mu(this.re,this.Xn);if(hn(e.bitrate)||(a.bitRate=e.bitrate),hn(e.minBitrate)||(a.minBitrate=e.minBitrate),hn(e.startBitrate)||(a.startBitrate=e.startBitrate),a.audioBitrate=un(e.audioBitrate)?1e3*e.audioBitrate:1e3*(c.audioBitrate||48),"camera"===t){var u=this.re.settingConfig.getSetting("camera_audio_bitrate",!0),l=this.re.settingConfig.getSetting("camera_video_bitrate",!0);un(a.audioBitrate)&&un(u)&&(a.audioBitrate=1e3*u),un(a.bitRate)&&un(l)&&(a.bitRate=l)}a.channelCount=hn(e.channelCount)?c.channelCount||1:e.channelCount,s=this.createZegoStreamPreview(this.stream,!1,void 0,a),this.stream=this.Oe.getStreamByCanvas(this.stream)}this.stream&&this.De(this.stream,this.originVideoStream,this.originAudioStream,!0),s&&0===(null===(i=this.stream)||void 0===i?void 0:i.getAudioTracks().length)&&this.Oe.setEmptyAudioTrack(this.stream,s),this.Oe.initCopyMusic(this.stream),s.zegoCaptureStream=this,this.streamPreviewType=this.originStreamPreviewType,this.Te=s},e.prototype.createZegoStreamPreview=function(e,t,i,r){var n=new Gc(this.Xn,this.re,this.ee,i,t);return this.ee.previewStreamList.push(n),n.localStream=e,n.mediaStreamConfig={},r&&(n.videoInfo=Zc(Zc({},n.videoInfo),r),n.mediaStreamConfig.bitRate=r.bitRate),n.initMediaTrack(e),e.getTracks().forEach((function(e){return n.addTrackListener(e)})),"screen"==i&&this.Oe.addShareScreenEnd(e),n},e.prototype.checkPreview=function(e){return this.ee.checkPreview(e)},e.prototype.De=function(e,t,i,r){if(void 0===r&&(r=!1),e){var n=this.checkPreview(e);if(n){var o=t&&this.checkPreview(t),s=i&&this.checkPreview(i),a={},c={},u=!1;if(n.previewType=(null==o?void 0:o.previewType)||(null==s?void 0:s.previewType),o){var l=o.videoInfo,d=o.mediaStreamConfig;n.previewType=o.previewType,n.videoPreviewType=o.videoPreviewType,n.previewSuc=!0,a=Zc({videoQuality:n.mediaStreamConfig.videoQuality,bitRate:n.mediaStreamConfig.bitRate},d),u=d.video;var h=Zc({},l);if(Yc(Yc([],Vc,!0),["audioBitrate"],!1).forEach((function(e){delete h[e]})),r){["bitRate","startBitrate","minBitRate"].forEach((function(e){delete h[e]}));var p=n.videoInfo.bitRate,f=n.hasUserSetBitrate;this.Xn.info("zcs.up ".concat(n.previewType," hasUserSetBitrate: ").concat(f,", bitrate: ")+p),![1,2,3].includes(o.mediaStreamConfig.quality)&&p&&f||(this.Xn.info("zcs.up ".concat(n.previewType," videoBitrate changed ").concat(p," to ").concat(l.bitRate)),h.bitRate=l.bitRate)}c=Zc({},h)}if(s){l=s.videoInfo;var m=(d=s.mediaStreamConfig).audio,v=d.AEC,g=d.AGC,y=d.ANS,b=d.audioBitrate,_=d.channelCount,S=d.audioInput;n.audioPreviewType=s.audioPreviewType,n.previewSuc=!0,c.channelCount=l.channelCount;var T=n.videoInfo.audioBitrate;r&&T||(this.Xn.info("zcs.up ".concat(r," audioBitrate changed ").concat(T," to ").concat(l.audioBitrate)),c.audioBitrate=l.audioBitrate),a=Zc(Zc({},a),{audio:m,AEC:v,AGC:g,ANS:y,audioBitrate:b,channelCount:_,audioInput:S})}a.video=u,n.mediaStreamConfig=a,n.videoInfo=r?Zc(Zc({},n.videoInfo),c):c}}},e.prototype._getVideoBitrate=function(e){return un(this.Se.videoBitrate)?Zc(Zc({},e),{bitrate:this.Se.videoBitrate}):Zc(Zc({},e),this.Se.videoBitrate)},e.prototype._getAudioBitrate=function(e){return e.audioBitrate=this.Se.audioBitrate,e},e.prototype._createStream=function(e,t,i,r,n){return Kc(this,void 0,void 0,(function(){var o,s,a,c,u,l,d,h,p,f,m;return Jc(this,(function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),o=i==Oc.video||i==Oc.videoAndAudio,s=i==Oc.audio||i==Oc.videoAndAudio,e=this._getVideoBitrate(e),e=this._getAudioBitrate(e),this.Xn.info("zcs.cs config:",JSON.stringify(((f={})[t]=e,f))),[4,this.Oe.createStream((m={},m[t]=e,m))];case 1:return a=v.sent(),this.originStreamPreviewType=t,c=this.checkPreview(a),u=(null==c?void 0:c.originVideoTrack)||a.getVideoTracks()[0],l=(null==c?void 0:c.originAudioTrack)||a.getAudioTracks()[0],s&&o?(d=new MediaStream([u]),h=new MediaStream([l]),this.createZegoStreamPreview(d,!0,t),this.createZegoStreamPreview(h,!0,t),this.De(d,a,null),this.De(h,null,a),this.Ie.push(d),this.Re.push(h),this.Ce(d,0),this.Ce(h,1),!this.stream&&c?(this.stream=a,this.originAudioTrack=l,this.originVideoTrack=u,c.zegoCaptureStream=this,this.Te=c):this.updateStreamVideoAndAudio(r,n,0)):o?(this.Ce(a,0),this.Ie.push(a),this.stream?this.updateStreamVideoTrack(r,n,0):this.ze(e,t)):s&&(h=new MediaStream([l]),this.createZegoStreamPreview(h,!0,t),this.De(h,null,a),this.Ce(h,1),this.Re.push(h),this.Re.push(a),this.stream?this.updateStreamAudioTrack(r,n,0):this.ze(e,t)),this.isPublish||(this.autoPlay||this.isPlayingVideo)&&this.autoPlay&&this.playVideo(),this.Ae(),r({errorCode:0,extendedData:""}),[3,3];case 2:return p=v.sent(),n({errorCode:p.errorCode||p.code,extendedData:p.extendedData||p.msg}),[3,3];case 3:return[2]}}))}))},e.prototype.startCaptureMicrophone=function(e){var t=this;return void 0===e&&(e={}),new we((function(i){return Kc(t,void 0,void 0,(function(){var t;return Jc(this,(function(r){switch(r.label){case 0:this.Xn.info("zcs.scm call ".concat(JSON.stringify(e))),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._createStream(Zc({audio:!0,video:!1,audioInput:e.input},e),"camera",1,i,i)];case 2:return r.sent(),this.Xn.info("zcs.scm success"),[3,4];case 3:return t=r.sent(),i(t),this.Xn.info("zcs.scm fail"),[3,4];case 4:return[2]}}))}))}))},e.prototype.startCaptureCamera=function(e){var t=this;return void 0===e&&(e={}),new we((function(i){return Kc(t,void 0,void 0,(function(){var t,r;return Jc(this,(function(n){switch(n.label){case 0:this.Xn.info("zcs.scc call ".concat(JSON.stringify(e))),n.label=1;case 1:return n.trys.push([1,3,,4]),t=Zc({audio:!1,video:!0,videoInput:e.input,videoOptimizationMode:e.optimizationMode},e),void 0!==(null==e?void 0:e.quality)&&(t.videoQuality=e.quality),[4,this._createStream(t,"camera",0,i,i)];case 2:return n.sent(),this.Xn.info("zcs.scc success"),[3,4];case 3:return r=n.sent(),i(r),this.Xn.info("zcs.scc fail"),[3,4];case 4:return[2]}}))}))}))},e.prototype.startCaptureCameraAndMicrophone=function(e,t){var i=this;return void 0===e&&(e={}),void 0===t&&(t={}),new we((function(r){return Kc(i,void 0,void 0,(function(){var i,n;return Jc(this,(function(o){switch(o.label){case 0:this.Xn.info("zcs.sccm call c:".concat(JSON.stringify(e),", m:").concat(JSON.stringify(t))),o.label=1;case 1:return o.trys.push([1,3,,4]),i=Zc(Zc(Zc({audio:!0,video:!0,videoInput:null==e?void 0:e.input,videoOptimizationMode:null==e?void 0:e.optimizationMode},e),{audioInput:null==t?void 0:t.input}),t),(null==e?void 0:e.quality)&&(i.videoQuality=null==e?void 0:e.quality),[4,this._createStream(i,"camera",2,r,r)];case 2:return o.sent(),this.Xn.info("zcs.sccm success"),[3,4];case 3:return n=o.sent(),r(n),this.Xn.info("zcs.sccm fail"),[3,4];case 4:return[2]}}))}))}))},e.prototype.autoCapture=function(){var e=this;return new we((function(t,i){return Kc(e,void 0,void 0,(function(){var e,r,n,o,s,a,c,u,l,d,h,p;return Jc(this,(function(f){switch(f.label){case 0:this.Xn.info("zcs.ac call"),f.label=1;case 1:return f.trys.push([1,23,,24]),o=(r=this.Se).custom,s=r.screen,(n=r.camera)?(this.Xn.info("zcs.ac camera:".concat(JSON.stringify(n))),h=n.video,(d=n.audio)&&h?(a=pn(h)?h:void 0,c=pn(d)?d:void 0,[4,this.startCaptureCameraAndMicrophone(a,c)]):[3,3]):[3,8];case 2:return e=f.sent(),[3,7];case 3:return d?[4,this.Ne(d,this.startCaptureMicrophone)]:[3,5];case 4:return e=f.sent(),[3,7];case 5:return h?[4,this.Ne(h,this.startCaptureCamera)]:[3,7];case 6:e=f.sent(),f.label=7;case 7:return[3,22];case 8:return s?(this.Xn.info("zcs.ac screen:".concat(JSON.stringify(s))),h=s.video,(d=s.audio)?(u=h,l=d,dn(h)&&(u={}),dn(d)&&(l={}),[4,this.startCaptureScreenWithAudio(u,l)]):[3,10]):[3,13];case 9:return e=f.sent(),[3,12];case 10:return[4,this.Ne(h,this.startCaptureScreen)];case 11:e=f.sent(),f.label=12;case 12:return[3,22];case 13:return o?(this.Xn.info("zcs.ac custom:".concat(JSON.stringify(o))),h=o.video,(d=o.audio)&&h&&d.source===h.source?[4,this.startCaptureCustomVideoAndAudio(h,d)]:[3,15]):[3,20];case 14:return e=f.sent(),[3,19];case 15:return d?[4,this.Ne(d,this.startCaptureCustomAudio)]:[3,17];case 16:e=f.sent(),f.label=17;case 17:return h?[4,this.Ne(h,this.startCaptureCustomVideo)]:[3,19];case 18:e=f.sent(),f.label=19;case 19:return[3,22];case 20:return[4,this.startCaptureCameraAndMicrophone({},{})];case 21:e=f.sent(),f.label=22;case 22:return e||i({errorCode:bt.code,extendedData:bt.message}),0!==(null==e?void 0:e.errorCode)?i(e):t(e),[3,24];case 23:return p=f.sent(),i(p),[3,24];case 24:return[2]}}))}))}))},e.prototype.startCaptureCustomAudio=function(e){var t=this;return new we((function(i){return Kc(t,void 0,void 0,(function(){var t;return Jc(this,(function(r){switch(r.label){case 0:this.Xn.info("zcs.scca call ".concat(JSON.stringify(e))),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._createStream(Zc(Zc({},e),{audio:!0}),"custom",1,i,i)];case 2:return r.sent(),this.Xn.info("zcs.scca success"),[3,4];case 3:return t=r.sent(),i(t),this.Xn.info("zcs.scca fail"),[3,4];case 4:return[2]}}))}))}))},e.prototype.startCaptureCustomVideo=function(e){var t=this;return new we((function(i){return Kc(t,void 0,void 0,(function(){var t;return Jc(this,(function(r){switch(r.label){case 0:this.Xn.info("zcs.sccv call ".concat(JSON.stringify(e))),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._createStream(Zc({videoOptimizationMode:e.optimizationMode},e),"custom",0,i,i)];case 2:return r.sent(),this.Xn.info("zcs.sccv success"),[3,4];case 3:return t=r.sent(),i(t),this.Xn.info("zcs.sccv fail"),[3,4];case 4:return[2]}}))}))}))},e.prototype.startCaptureCustomVideoAndAudio=function(e,t){var i=this;return new we((function(r){return Kc(i,void 0,void 0,(function(){var i,n;return Jc(this,(function(o){switch(o.label){case 0:this.Xn.info("zcs.sccva call v:".concat(JSON.stringify(e)," a:").concat(JSON.stringify(t))),o.label=1;case 1:return o.trys.push([1,7,,8]),e.source!=t.source?[3,3]:[4,this._createStream(Zc(Zc(Zc({videoOptimizationMode:e.optimizationMode},e),t),{audio:!0}),"custom",2,r,r)];case 2:return o.sent(),[3,6];case 3:return i={video:!1,audio:!1},[4,this._createStream(Zc(Zc({videoOptimizationMode:e.optimizationMode},e),{audio:!0}),"custom",0,(function(e){i.video=!0,i.audio&&r(e)}),r)];case 4:return o.sent(),[4,this._createStream(Zc(Zc({},t),{audio:!0}),"custom",1,(function(e){i.audio=!0,i.video&&r(e)}),r)];case 5:o.sent(),o.label=6;case 6:return this.Xn.info("zcs.sccva success"),[3,8];case 7:return n=o.sent(),r(n),this.Xn.info("zcs.sccva fail"),[3,8];case 8:return[2]}}))}))}))},e.prototype.startCaptureScreen=function(e){var t=this;return void 0===e&&(e={}),new we((function(i,r){return Kc(t,void 0,void 0,(function(){var t,r;return Jc(this,(function(n){switch(n.label){case 0:this.Xn.info("zcs.scs call ".concat(JSON.stringify(e))),n.label=1;case 1:return n.trys.push([1,3,,4]),t=Zc(Zc({videoOptimizationMode:e.optimizationMode},e),{audio:!1}),(null==e?void 0:e.quality)&&(t.videoQuality=null==e?void 0:e.quality),[4,this._createStream(t,"screen",0,i,i)];case 2:return n.sent(),this.Xn.info("zcs.scs success"),[3,4];case 3:return r=n.sent(),i(r),this.Xn.info("zcs.scs fail"),[3,4];case 4:return[2]}}))}))}))},e.prototype.startCaptureScreenWithAudio=function(e,t){var i=this;return void 0===e&&(e={}),void 0===t&&(t={}),new we((function(r,n){return Kc(i,void 0,void 0,(function(){var i,n;return Jc(this,(function(o){switch(o.label){case 0:this.Xn.info("zcs.scs call v:".concat(JSON.stringify(e)," a:").concat(JSON.stringify(t))),o.label=1;case 1:return o.trys.push([1,3,,4]),i=Zc(Zc(Zc({videoOptimizationMode:e.optimizationMode},e),t),{audio:!0}),void 0!==(null==e?void 0:e.quality)&&(i.videoQuality=e.quality),[4,this._createStream(i,"screen",2,r,r)];case 2:return o.sent(),this.Xn.info("zcs.scs success"),[3,4];case 3:return n=o.sent(),r(n),this.Xn.info("zcs.scs fail"),[3,4];case 4:return[2]}}))}))}))},e.prototype.stopCaptureAudio=function(){var e=this;return new we((function(t){var i,r,n=!0;if(e.originAudioStream){e.Xn.info("zcs.sca call stop capture");var o=e.originAudioStream.getAudioTracks()[0];(null===(i=e.stream)||void 0===i?void 0:i.getAudioTracks()[0])&&e.isPublish&&e.stream&&(e.Xn.info("zcs.sca stop audio"),n="camera"===(null===(r=e.Te)||void 0===r?void 0:r.audioPreviewType)?e.Te.enableMicrophoneOnly(!1,e.ee):e.ke.enableStream(e.stream,{audio:!0}),e.Te&&(e.Te.syncAudioEnabled=!1)),e.Xn.info("zcs.sca stop result:"+n),n&&(o.stop(),e.originAudioStream=null,e.stopPlayCaptureAudio(),e.Ae())}t(n)}))},e.prototype.stopCaptureVideo=function(){var e;return Kc(this,void 0,void 0,(function(){var t,i,r,n,o=this;return Jc(this,(function(s){switch(s.label){case 0:if(t=!0,this.Xn.info("zcs.scv call stop capture"),!this.originVideoStream)return[3,7];i=this.originVideoStream.getVideoTracks()[0],r=null===(e=this.stream)||void 0===e?void 0:e.getVideoTracks()[0],s.label=1;case 1:return s.trys.push([1,6,,7]),r&&this.Te?(this.Xn.info("zcs.scv stop stream video"),"camera"!=this.Te.videoPreviewType?[3,3]:[4,this.Te.enableCameraCapturing(!1)]):[3,5];case 2:return t=s.sent(),[3,5];case 3:return[4,this.Te.stopCaptureVideo()];case 4:s.sent(),t=!0,s.label=5;case 5:return this.Xn.info("zcs.scv stop result:"+t),t&&(this.ee.trackUtils.stopTrack(i),this.originVideoStream=null,this.stopPlayCaptureVideo(),this.Ie.forEach((function(e){return o.Oe.destroyStream(e)})),this.Ie=[],this.Ae()),[3,7];case 6:return n=s.sent(),this.Xn.error("zcs.scv "+JSON.stringify(n)),t=!1,[3,7];case 7:return[2,t]}}))}))},e.prototype.Pe=function(e,t){void 0===t&&(t=!1);var i=e&&this.checkPreview(e);if(!i)throw new Error("The stream does not exist, you must first capture the stream");return t&&i?new Qa(e,i,{clearLastFrame:this.re.engineConfig.previewClearLastFrame}):(null==i?void 0:i.getViewer())||null},e.prototype.xe=function(){var e,t,i;this.viewer=this.Pe(this.stream),null===(e=this.viewer)||void 0===e||e.on("canPlayAudio",this.eventHandler.canPlayAudio),null===(t=this.viewer)||void 0===t||t.on("canPlayVideo",this.eventHandler.canPlayVideo),null===(i=this.viewer)||void 0===i||i.on("autoplayFailed",this.eventHandler.autoplayFailed)},e.prototype.playAudio=function(e){var t;if(this.Xn.info("zcs.pa call"),!this.stream)return this.Xn.warn("zcs.pa You need to capture the audio stream first");this.viewer||this.xe(),null===(t=this.viewer)||void 0===t||t.playAudio(e,!0),this.audioMuted=!1},e.prototype.playCaptureAudio=function(e){var t,i,r;if(this.Xn.info("zcs.pca call"),!this.originAudioStream)return this.Xn.warn("zcs.pca You need to capture the audio stream first");this.aCaptureViewer||(this.aCaptureViewer=this.Pe(this.originAudioStream),null===(t=this.aCaptureViewer)||void 0===t||t.on("canPlayAudio",this.eventHandler.canPlayCaptureAudio),null===(i=this.aCaptureViewer)||void 0===i||i.on("autoplayFailed",this.eventHandler.autoplayCaptureFailed)),this.audioCaptureMuted=!1,null===(r=this.aCaptureViewer)||void 0===r||r.playAudio(e,!0)},e.prototype.playVideo=function(e,t){var i;if(this.Xn.info("zcs.pv call"),this.stream){if(this.viewer&&this.viewer.inited||(this.xe(),null===(i=this.viewer)||void 0===i||i.setAudioMuted(this.audioMuted)),this.viewer){var r=e||this.view;r&&yn(r)?(this.viewer.playVideo(r,t),this.isPlayingVideo=!0):this.Xn.error("zcs.pv Execute `playVideo` failed, container not exist")}}else this.Xn.warn("zcs.pv You need to capture the video stream first")},e.prototype.playCaptureVideo=function(e,t){this.Xn.info("zcs.pcv call");var i=this.vCaptureViewers[0]||null;if(this.originVideoStream){if(!i||this.Se.multiplacePreview){if(!(i=this.Pe(this.originVideoStream,i&&this.Se.multiplacePreview)))return;i.on("canPlayVideo",this.eventHandler.canPlayCaptureVideo),i.on("autoplayFailed",this.eventHandler.autoplayCaptureFailed),this.vCaptureViewers.push(i)}var r=e||this.Se.captureView;r&&yn(r)?(i.playVideo(r,t),this.isPlayingCaptureVideo=!0):this.Xn.error("zcs.pcv Execute `playVideo` failed, container not exist")}else this.Xn.warn("zcs.pv You need to capture the video stream first")},e.prototype.updatePlayVideo=function(){this.viewer&&this.stream?this.viewer.setVideo(this.stream.getVideoTracks()[0]):this.autoPlay&&this.playVideo()},e.prototype.updatePlayAudio=function(){this.viewer&&this.stream&&this.viewer.setAudio(this.stream.getAudioTracks()[0])},e.prototype.takeStreamSnapshot=function(e){var t;return(null===(t=this.viewer)||void 0===t?void 0:t.takeStreamSnapshot(e))||""},e.prototype.resumeVideo=function(){var e;return null===(e=this.viewer)||void 0===e?void 0:e.resume(!0,["video"])},e.prototype.resumeAudio=function(){var e;return null===(e=this.viewer)||void 0===e?void 0:e.resume(!0,["audio"])},e.prototype.stopVideo=function(){var e;null===(e=this.viewer)||void 0===e||e.stopVideo(),this.isPlayingVideo=!1},e.prototype.stopAudio=function(){this.viewer&&(this.viewer.stopAudio(),this.audioMuted=!0)},e.prototype.stopPlayCaptureVideo=function(){this.vCaptureViewers.forEach((function(e){e.stopVideo(),e.destroy()})),this.vCaptureViewers=[],this.isPlayingCaptureVideo=!1},e.prototype.stopPlayCaptureAudio=function(){this.aCaptureViewer&&(this.aCaptureViewer.destroy(),this.aCaptureViewer=null,this.audioCaptureMuted=!0)},e.prototype.setVolume=function(e){return!!this.viewer&&this.viewer.setVolume(e)},e.prototype._destroyCacheStream=function(e){var t=this;return e.filter((function(e){return!!e.active||(t.Oe.destroyStream(e),!1)}))},e.prototype.Ae=function(){this.Re=this._destroyCacheStream(this.Re),this.Ie=this._destroyCacheStream(this.Ie)},e.prototype.destroy=function(){var e,t=this;this.originAudioStream&&(this.originAudioStream=null),this.originVideoStream&&(this.originVideoStream=null),this.stream&&(this.Oe.destroyStream(this.stream),this.stream=null),this.Re.forEach((function(e){return t.Oe.destroyStream(e)})),this.Ie.forEach((function(e){return t.Oe.destroyStream(e)})),this.Re=[],this.Ie=[],this.stopPlayCaptureVideo(),this.stopPlayCaptureAudio(),this.stopVideo(),this.stopAudio(),null===(e=this.viewer)||void 0===e||e.destroy(),this.viewer=null},e}(),eu="zsc.rd.qd",tu=function(){function e(e,t,i){this.logger=e,this.stateCenter=t,this.streamCenter=i,this.maxQuickDeviceChangeDelayMs=2e3,this.lastRecordDeviceTime=0}return e.prototype.getDetectionStreams=function(){var e=[];return this.streamCenter.previewStreamList.forEach((function(t){t.localStream&&e.push(t.localStream)})),e},e.prototype.actionMicDeviceQuickChangeException=function(e){this.logger.warn(eu+" DeviceError: ".concat(At," ").concat("the microphone may be loose, and audio data collection is abnormal.")),this.stateCenter.actionListener("_deviceError",At,e,"micro"),this.stateCenter.actionListener("deviceError",At,e)},e.prototype.getDeviceName=function(e){if(this.logger.info(eu+" get name of device id: ".concat(JSON.stringify(e))),!e.deviceID&&!this.devicesInfo&&""==e.trackLabel)return"unknown";if(!e.deviceID||"default"===e.deviceID)return e.trackLabel;for(var t in this.devicesInfo){var i=this.devicesInfo[t];if(i)for(var r=0,n=i;r<n.length;r++){var o=n[r];if(o.deviceID===e.deviceID)return o.deviceName}}return e.trackLabel},e.prototype.actionCameraDeviceQuickChangeException=function(e){this.logger.warn(eu+" DeviceError: ".concat(Dt," ").concat("the camera may be loose, and video data collection is abnormal.")),this.stateCenter.actionListener("_deviceError",Dt,e,"camera"),this.stateCenter.actionListener("deviceError",Dt,e)},e.prototype.updateDeviceInfo=function(e){this.devicesInfo=e},e.prototype.getTrackStatsSnapshot=function(e){return{trackID:e.id,trackLabel:e.label,readyState:e.readyState,deviceID:e.getSettings().deviceId}},e.prototype.includeExceptionDevices=function(e,t){return-1!==e.findIndex((function(e){return e.deviceName==t.deviceName&&e.preview==e.preview}))},e.prototype.checkAudioTrackStatsChange=function(e,t){if(e.audioTrack){var i=this.getTrackStatsSnapshot(e.audioTrack),r=performance.now()-e.lastTrackEndTime.audio;if("ended"==i.readyState&&r<this.maxQuickDeviceChangeDelayMs){this.logger.warn(eu+" mic device may loose.");var n={deviceName:this.getDeviceName(i),preview:e};this.includeExceptionDevices(t,n)||t.push(n)}}},e.prototype.checkVideoTrackStatsChange=function(e,t){if(e.videoTrack){var i=this.getTrackStatsSnapshot(e.videoTrack),r=performance.now()-e.lastTrackEndTime.video;if("ended"==i.readyState&&r<this.maxQuickDeviceChangeDelayMs){this.logger.warn(eu+" camera device may loose.");var n={deviceName:this.getDeviceName(i),preview:e};this.includeExceptionDevices(t,n)||t.push(n)}}},e.prototype.checkStreamStatesChanged=function(e,t,i){var r=this.streamCenter.getPreviewer(e);r&&(this.checkAudioTrackStatsChange(r,t),this.checkVideoTrackStatsChange(r,i))},e.prototype.isRecordQuickly=function(){return performance.now()-this.lastRecordDeviceTime<this.maxQuickDeviceChangeDelayMs},e.prototype.onDeviceNoChangeQuickly=function(e){var t=this;if(this.isRecordQuickly())this.logger.info(eu+" device no change because record device quickly");else{this.logger.info(eu+" device no change quickly"),this.updateDeviceInfo(e);var i=[],r=[];this.getDetectionStreams().forEach((function(e){t.checkStreamStatesChanged(e,i,r)})),i.forEach((function(e){t.actionMicDeviceQuickChangeException(e.deviceName),e.preview.updatePublisherStreamMicStatus(!1)})),r.forEach((function(e){t.actionCameraDeviceQuickChangeException(e.deviceName),e.preview.updatePublisherStreamCameraStatus(!1)}))}},e}();var iu=function(){return iu=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},iu.apply(this,arguments)},ru=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},nu=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},ou=li,su=li.event,au=li.error,cu=di,uu=_i,lu=ui.error,du=lu.ki,hu=lu.Ci,pu=lu.Ni,fu=Mn();if(navigator.mediaDevices&&"setCaptureHandleConfig"in navigator.mediaDevices)try{navigator.mediaDevices.setCaptureHandleConfig({handle:fu,exposeOrigin:!0,permittedOrigins:["*"]})}catch(e){}function mu(e,t,i){var r={width:960,height:540},n=iu(iu({video:!0,videoQuality:4,frameRate:15,bitRate:500},{width:640,height:360}),{audioBitrate:48,channelCount:1});switch(e.scenario){case H.UNKNOWN:n={};break;case H.StandardVideoCall:break;case H.HighVideoCall:n.frameRate=25,n.bitRate=1500,n=iu(iu({},n),r);break;case H.StandardChatroom:n.video=!1,n.audioBitrate=24;break;case H.HighQualityChatroom:n.video=!1;break;case H.Broadcast:n.frameRate=20,n.bitRate=1200,(n=iu(iu({},n),r)).audioBitrate=64,n.channelCount=2;break;default:n.bitRate=800,n=iu(iu({},n),{width:640,height:480})}t.info("".concat(Eo," scenario ").concat(e.scenario," ").concat(JSON.stringify(n)));var o=e.settingConfig.getCloudSettingScenario(e.scenario,!1,!0);return Object.assign(n,o||{},i||{})}var vu=function(){function e(e,t,i,r,n,o){var s=this;this.Xn=e,this.dataReport=t,this.re=i,this.ee=r,this.rtm=n,this.zegoWebRtc=o,this.quickDeviceChangeDetection=new tu(this.Xn,this.re,this.ee),this.recordDevices(),this.ee.checkDeviceChange=function(){s.Me(500)}}return Object.defineProperty(e.prototype,"ve",{get:function(){return this.re.reporter},enumerable:!1,configurable:!0}),e.prototype.createStream=function(e,t){var i=this;void 0===t&&(t=!1),this.Xn.info(Eo+" call. "+t);var r=void 0,n=void 0,o=void 0;if(e){var s=e.camera,a=e.screen,c=e.custom;s&&(r=iu({},s)),a&&(n=dn(a)?a:iu({},a)),c&&(o=iu({},c))}var u=0;if(r&&(u++,r.audioBitRate&&(r.audioBitrate=r.audioBitRate,delete r.audioBitRate),r.bitrate&&(r.bitRate=r.bitrate,delete r.bitrate)),n&&(u++,pn(n)&&n.bitrate&&(n.bitRate=n.bitrate)),o&&(u++,o.bitrate&&(o.bitRate=o.bitrate)),o=o&&po(o),r=r&&po(r),n=n&&po(n),u>1){var l="cannot set more than one type of source";throw this.Xn.error(Eo+" ".concat(l,". ").concat(JSON.stringify(e))),{code:et.code,msg:l}}return new we((function(e,t){var s=i.ve.createSpan(F.H,{key:ri},{key:""},ui.event),a=function(t){var r=i.ee.checkPreview(t),n=i.getStreamByCanvas(t);r&&i.setEmptyAudioTrack(n,r),i.initCopyMusic(t),s.setAttributes({media_stream_id:ui.media_stream_id(null==t?void 0:t.id)}),s.end(),!i.re.deviceInfos&&i.recordDevices(),e(n),i.ee.activeSoundLevel()},c=function(e,r){void 0===r&&(r=""),i.ve.setError(s,e,r),t({code:e.code,msg:e.message+r})};if("https:"!==window.location.protocol&&"file:"!==window.location.protocol&&-1==window.location.hostname.indexOf("127.0.0.1")&&-1==window.location.hostname.indexOf("localhost")){var u=" https or localhost required ";return i.Xn.error(Eo+u),void c({code:lu.Ai.code,message:lu.Ai.message+u})}var l=function(e){mn(e)?c(e[0],e[1]):c(e)};o?i.we(o,s).then(a).catch(l):n?i.je(n,s).then(a).catch(l):(r||null==r)&&i.Ee(r||{},s).then(a).catch(l)}))},e.prototype.Ee=function(e,t){return ru(this,void 0,void 0,(function(){var i,r,n=this;return nu(this,(function(o){if(!hn(e.videoQuality)&&!Nn(e.videoQuality))throw this.Xn.error(Eo+(i=" videoQuality must be integer number")),[du,i];if(e.audioBitrate){if(!Nn(e.audioBitrate))throw this.Xn.error(Eo+(i=" audioBitrate must be integer number")),[du,i];if(e.audioBitrate<6||e.audioBitrate>510)throw i=" audio bitrate cannot exceed the range [6,510]. current value: ".concat(e.audioBitrate,"."),this.Xn.error(Eo+i),[du,i];this.re.audioBitRate=1e3*e.audioBitrate}if(e.bitRate){if(!un(e.bitRate))throw this.Xn.error(Eo+(i=" bitrate must be integer number")),[du,i];if(e.bitRate>10240)throw this.Xn.error(Eo+(i=" bitrate cannot more than 10 Mbps")),[du,i]}if(void 0!==e.channelCount&&!Nn(e.channelCount))throw this.Xn.error(Eo+(i=" channelCount must be integer number")),[du,i];var s,a;return 4===e.videoQuality&&(!Un(s=e,a=function(e,t){throw[e,t]})||Bn(s.bitRate,a)),r={},this.Xn.info(Eo+" camera "+JSON.stringify(e)),r=e,t.setAttributes({stream_type:ui.stream_type("camera"),camera:ui.camera(e)}),dn(r.video)||(r.video=!0),dn(r.audio)||(r.audio=!0),[2,new we((function(e,i){n.Ue(r,"camera",e,i,t)}))]}))}))},e.prototype.je=function(e,t){return ru(this,void 0,void 0,(function(){var i,r,n,o=this;return nu(this,(function(s){return function(e,t){var i;if(pn(e)){if(void 0!==e.videoQuality&&!Nn(e.videoQuality))return t(Sn," videoQuality must be integer number"),!1;if(!hn(e.sourceID)&&!ln(e.sourceID))return t(Sn," sourceID must be string"),!1;if(4===e.videoQuality){if(!Bn(e.bitRate,t))return!1;if(!Un(e,t))return!1}var r=e.captureElement;if(!(hn(r)||r instanceof HTMLElement))return t(Sn," captureElement must be HTMLElement"),!1;if(r&&!("CropTarget"in window&&"fromElement"in CropTarget&&(null===(i=window.BrowserCaptureMediaStreamTrack)||void 0===i?void 0:i.prototype.cropTo)&&MediaStreamTrack.prototype.getCaptureHandle))t(ht," screen sharing to capture a DOM element of the tab")}}(e,(function(e,t){throw[e,t]})),i=this.re.browser,r=this.ee.getScreenConstrains(e),t.setAttributes({stream_type:ui.stream_type("screen"),screen:ui.screen(r)}),n=e&&e.captureElement,[2,new we((function(t,s){var a=function(e){s([e])},c=function(i){o.ee.createScreenPreviewer(i,r,e)&&t(i),o.addShareScreenEnd(i)};De()||pn(e)&&"firefox"==e.type?o.startScreenShotFirFox("screen",r,(function(e,t,i){e?t&&c(t):i&&a(i)})):!n&&Ae()&&ih.screenShotReady||pn(e)&&"shot"==e.type?o.startScreenShotChrome((function(t,i,n){t?(o.Xn.info(Eo+" using extension"),i&&c(i)):(n&&o.Xn.error(Eo+" extension "+n),"SS_DIALOG_CANCEL"===n||pn(e)&&"shot"==e.type?n&&a(lu.Ni):o.startScreenSharing(r,(function(e,t,i){e?t&&c(t):(o.Xn.error(Eo+" "+i),i&&a(i))})))})):"Electron"==i||pn(e)&&"Electron"==e.type?o.startScreenShotElectron(r,(function(e,t,i){e?t&&c(t):i&&a(i)})):o.startScreenSharing(r,(function(e,t,i){e?t&&c(t):i&&a(i)}))}))]}))}))},e.prototype.we=function(e,t){return ru(this,void 0,void 0,(function(){var i,r=this;return nu(this,(function(n){if(e.bitRate){if(!Nn(e.bitRate))throw this.Xn.error(Eo+" bitrate must be integer number"),[du," bitrate must be integer number"];if(e.bitRate>10240)throw this.Xn.error(Eo+" bitrate cannot greater than 10 Mbps"),[du," bitrate cannot greater than 10 Mbps"]}if(e.audioBitrate){if(!Nn(e.audioBitrate))throw this.Xn.error("ze.cs.0 audioBitrate must be integer number"),[du," audioBitrate must be integer number"];if(e.audioBitrate<6)throw this.Xn.error("ze.cs.0 audioBitrate cannot less 6 kbps"),[du," audioBitrate cannot less 6 kbps"];if(e.audioBitrate>510)throw this.Xn.error("ze.cs.0 audioBitrate cannot greater than 510 kbps"),[du," audioBitrate cannot greater than 510 kbps"]}if(void 0!==e.channelCount&&1!==e.channelCount&&2!==e.channelCount)throw this.Xn.error("ze.cs.0 channelCount must number 1 or 2"),[du," channelCount must number 1 or 2"];return i=gn(e.source)?"MediaStream":"HTMLElement",t.setAttributes({stream_type:ui.stream_type("custom"),custom:ui.custom(iu(iu({},e),{source_type:i}))}),[2,new we((function(i,n){r.Ue(e,"custom",i,n,t)}))]}))}))},e.prototype.getStreamByCanvas=function(e){var t=this.ee.checkPreview(e);if(t){var i=ze();if(i&&i.includes("15_1")&&!this.re.engineConfig.disableCanvasIOS15_1){var r=t.getStreamThroughCanvas(e);return t.localStream=r,t.streamFromCanvas=!0,t.streamFromCanvasTrack=r.getVideoTracks()[0],r}}return e},e.prototype.createZegoStream=function(e){var t=this;return void 0===e&&(e={}),new we((function(i,r){return ru(t,void 0,void 0,(function(){var t,n,o;return nu(this,(function(s){switch(s.label){case 0:if(this.Xn.info("ze.czs.0 call"),!this.zegoWebRtc.rtcModules.advancedModule)return[3,5];if(e&&!pn(e))return[2,r(et)];if([e.camera,e.screen,e.custom].reduce((function(e,t){return e+(t?1:0)}),0)>1)return this.Xn.error(Eo+" ".concat("cannot set more than one type of source",". ").concat(JSON.stringify(e))),[2,r({code:et.code,msg:"cannot set more than one type of source"})];if(t=new $c(e,this.Xn,this.ee,this.re,this,this.zegoWebRtc.rtcModules.advancedModule),n=new Wc(t),!e.autoCapture&&null!=e.autoCapture)return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,n.zegoStream.autoCapture()];case 2:return s.sent(),[3,4];case 3:return o=s.sent(),[2,r(o)];case 4:return this.Xn.info("ze.czs.0 success"),i(n),[3,6];case 5:throw this.Xn.info("ze.czs.0 fail"),new Error("should use advanced module first");case 6:return[2]}}))}))}))},e.prototype.destroyStream=function(e){this.Xn.info(Co+" call");var t=this.ve.createSpan(F.H,{key:ri},{key:""},qi.event);if(t.setAttributes({stop_reason:qi.stop_reason("destroyStream")}),!(gn(e)||pn(e)&&e.getTracks))return this.Xn.error(Co+" localStream is not mediaStream or tracks is null"),void this.ve.setError(t,qi.error.Gn);gn(e)?(gn(e)&&0==e.getTracks().length&&this.Xn.info(Co+" tracks is null"),this.stopPreview(e)):e.zegoStream&&e.zegoStream.destroy(),t.end()},e.prototype.startPublishingStream=function(e,t,i,r){var n,o,s,a=this,c=oo(t,this.Xn);this.Xn.info(wo+" call "+e+" publishOption: "+JSON.stringify(i)+" isDataChannel: "+JSON.stringify(!!r)+" ms_id: "+(null==c?void 0:c.id));var u,l=!0,d="",h=au,p=h.Ui,f=this.ve.createSpan(F.I,{key:ri},{key:su,par:e},su,!0);l&&void 0===e&&(this.Xn.error(wo+(d="stream id required")),l=!1,u=p),!l||e&&ln(e)||(this.Xn.error(wo+" "+(d="stream id type wrong")),l=!1,u=p),l&&e.length>256&&(this.Xn.error(wo+" "+(d="stream id length limit")),l=!1,u=p),l&&!Tn(e)&&(this.Xn.error(wo+" "+(d="stream ID contains illegal characters")),l=!1,u=p),f.setAttributes({stream_id:ou.stream_id(e)}),l&&(!c||gn(c)&&0==c.getTracks().length)?(this.Xn.error(wo+" "+(d="localStream wrong")),l=!1,u=p):c&&c.getTracks().forEach((function(e){Zn(e,a.Xn,wo)}));var m=this.ee.checkPreview(c);l&&!m&&(this.Xn.error(wo+" "+(d=Ve)),l=!1,u=h.Fi);var v=null==m?void 0:m.zegoCaptureStream;if(v&&(v.originAudioStream||v.originVideoStream||(this.Xn.error(wo+" "+(d="stream is not capturing")),l=!1,u=h.Hi)),(null==m?void 0:m.isVideoEffectStarting)&&(this.Xn.error(wo+" "+(d=(u=h.Ji).message)),l=!1),l&&i&&!pn(i)&&(l=!1,u=p,d="publishOption must be object"),l&&i&&!hn(i.streamParams)&&!ln(i.streamParams)&&(this.Xn.error(wo+" publishOption streamParams must be string"),l=!1,u=p,d=" publishOption streamParams must be string"),l&&i&&!hn(i.extraInfo)&&!ln(i.extraInfo)&&(this.Xn.error(wo+" publishOption extraInfo must be string"),l=!1,u=p,d=" publishOption extraInfo must be string"),l&&i&&!hn(i.videoCodec)&&!ln(i.videoCodec)&&(this.Xn.error(wo+" publishOption videoCodec must be string"),l=!1,u=p,d=" publishOption videoCodec must be string"),!l||!this.re.isMultiRoom||i&&ln(i.roomID)&&""!=i.roomID||(l=!1,u=p,d=" roomID is need if set multi room"),i&&i.videoCodec&&(i.videoCodec=i.videoCodec.toUpperCase()),l&&(this.re.waitPublishStreamList[e]={retryStart:!1,localStream:c,publishOption:i,isDataChannel:r}),this.re.useNetAgent&&this.re.roomList.length>0)this.Xn.info(wo+" publish quick");else if(l&&this.rtm.isDisConnect()){if(this.re.connectChanged)return this.re.waitPublishStreamList[e].retryStart=!0,this.Xn.info(wo+" connect changed"),!1;this.Xn.error(wo+" not login"),l=!1,u=h.Qi}if(!l)throw this.Xn.error(wo+" "+d),this.ve.setError(f,u),{errorCode:null==u?void 0:u.code,extendedData:d};i||(i={});var g=(null==m?void 0:m.videoPreviewType)||(null==m?void 0:m.previewType);!i.videoCodec&&function(){return!!navigator.userAgent.toLocaleLowerCase().match(/chrome/)&&!!navigator.userAgent.toLocaleLowerCase().match(/redmi\snote\s8/)}()&&"custom"==g&&(null===(o=null==m?void 0:m.mediaStreamConfig)||void 0===o?void 0:o.source)&&bn(null===(s=m.mediaStreamConfig)||void 0===s?void 0:s.source)&&(this.Xn.info(wo+" Redmi note 8 uesed custom stream. change to VP8"),i.videoCodec="VP8");var y=Kn(this.re.appid,this.re.idName,e),b=((n={})["_publish_"+e]={stream_sid:y},n);this.ve.setPublicPros(b),f.setAttributes({stream_sid:ou.stream_sid(y),publish_option:ou.publish_option(i),enable_camera:ou.enable_camera(!!(null==m?void 0:m.videoTrack)),enable_mic:ou.enable_mic(!!(null==m?void 0:m.audioTrack)),use_na:ou.use_na(this.re.useNetAgent?1:0)}),i.audioBitRate=this.re.audioBitRate;var _=i.roomID?i.roomID:this.re.roomList[0]?this.re.roomList[0].roomID:"",S=this.re.getRoomByRoomID(_);if(!S)return this.Xn.error("zc.p.sps.1 room no found"),!1;f.setAttributes({room_id:ou.room_id(_)});var E=this.ee.getSignalNodes();if(E)return this.re.publishStreamList[e]={state:T.tryPublish,extra_info:i.extraInfo,roomID:S.roomID},this.ee.setPublishStateStart(S,e,c,i,y,r)?(S.streamHandler.onPublishStateUpdate(2,e,{code:0,message:""}),this.ee.publisherList[e].serverUrls=E,this.ee.startPublishingStream(e)):(this.Xn.info("zc.p.sps.1 cannot start publish"),!1);if(!this.ee.setPublishStateStart(S,e,c,i,y,r))return this.Xn.error("zc.p.sps.1 cannot start publish"),!1;this.re.publishStreamList[e]={state:T.tryPublish,extra_info:i.extraInfo,roomID:S.roomID},this.Xn.info("zc.p.sps.1 start publish"),S.streamHandler.onPublishStateUpdate(2,e,{code:0,message:""});var C=this.re.useNetAgent;return this.ve.createSpan(F.H,{key:li.event,par:e},{key:cu.event,par:e},cu.event,!0).setAttributes({reason:cu.reason("StartPublish")}),this.ve.createSpan(F.I,{key:li.event,par:e},{key:_i.event,par:e},_i.event,!0).setAttributes({room_id:uu.room_id(null==S?void 0:S.roomID),room_sid_string:uu.room_sid_string(null==S?void 0:S.roomSessionID)}),!!C&&(this.re.appConfig?(null==m?void 0:m.containBackgroundProcess)&&!1===this.re.supportBg?(this.Xn.info("zc.p.sps.1 check not support background porcess"),S.streamHandler.onPublishStateUpdate(1,e,h.gn),!1):(this.ee.publisherList[e].serverUrls=["unified_rtc"],this.ee.startPublishingStream(e,C),!0):(this.ee.waitPublishList.push(e),!0))},e.prototype.updatePublishingStream=function(e,t){var i=this;return new we((function(r){var n=function(e,t){var n=un(e)?{errorCode:e,extendedData:JSON.stringify({fail_reason:t})}:e;i.Xn.error(Ca+" "+n.extendedData),r(n)};i.Xn.info(Ca+" call by user");var o=i.ee.checkPreview(e);if(o)if(o.zegoCaptureStream){var s=o.zegoCaptureStream;t!=Oc.audio&&t!=Oc.videoAndAudio||s.getAudioTracks().length?t!=Oc.video&&t!=Oc.videoAndAudio||s.getVideoTracks().length?t==Oc.audio?s.updateStreamAudioTrack(r,n,1):t==Oc.video?s.updateStreamVideoTrack(r,n,1):s.updateStreamVideoAndAudio(r,n,1):n(1103088,"the zego stream does not capture video"):n(1103087,"the zego stream does not capture audio")}else n(et.code,et.message+", stream type wrong");else n(1103086,"this publish stream id is not created by CreateZegoStream")}))},e.prototype.activateSEIInsert=function(e,t,i){return void 0===i&&(i=0),!1},e.prototype.sendSEI=function(e,t){if(!Gn())return this.Xn.warn(Po+" browser not support "),!1;if(!vn(t))return this.Xn.error(Po+" inData required Uint8Array"),!1;if(t.byteLength>4096)return this.Xn.error(Po+" inData length limit"),!1;var i=this.ee.publisherList[e];return i&&i.publisher?i.publisher.sendSEI(t):(this.Xn.warn(Po+" publish not exist"),!1)},e.prototype.stopPublishingStream=function(e,t,i,r){var n,o,s,a;this.Xn.info(Ro+" call ",e+(t?t.toString():"")+" "+i);var c=t||{code:0,message:""},u=this.ve.createSpan(F.I,{key:ri},{key:""},Si.event);if(!ln(e)||""==e)return this.Xn.error(Ro+" streamID must be string and not empty"),this.ve.setError(u,Si.error.ki,"stream id type error"),!1;var l=this.ee.publisherList[e];r&&!(null===(n=null==l?void 0:l.publisher)||void 0===n?void 0:n.Le)&&(c=au.bn),u.setAttributes({stream_id:Si.stream_id(e),stream_sid:Si.stream_sid(null==l?void 0:l.streamSid),room_id:Si.room_id(null===(s=null===(o=this.ee.publisherList[e])||void 0===o?void 0:o.room)||void 0===s?void 0:s.roomID),error:c.code,message:c.message});var d=this.ee.getRoomByStreamID(e),h=l&&l.publisher&&7!==l.publisher.state||(null===(a=null==l?void 0:l.retryStreamHandler)||void 0===a?void 0:a.isRetrying());if(this.ee.stopPublishingStream(e,c),i&&delete this.re.waitPublishStreamList[e],this.re.publishStreamList[e]){if(this.re.publishStreamList[e].state>=T.update_info&&d){t&&1102018===t.code||d.streamHandler.updateStreamInfo(e,2002);for(var p=0;p<d.streamList.length;p++)if(d.streamList[p].stream_id==e){!this.re.connectChanged&&d.streamList.splice(p--,1);break}}delete this.re.publishStreamList[e]}return u.end(),d&&h&&d.streamHandler.onPublishStateUpdate(1,e,c),!0},e.prototype.setCaptureVolume=function(e,t){var i=this;return new we((function(r){i.Xn.info(pa+" call");var n=oo(e,i.Xn),o=$i.error.ki,s=function(e){i.Xn.error(pa+" "+e),r({errorCode:o.code,extendedData:JSON.stringify({fail_reason:o.message+" "+e})})},a=i.ee.checkPreview(n);gn(n)&&a?0!=n.getAudioTracks().length?!un(t)||t<0||t>200?s(" volume must be number between 0 to 200"):(a.setVolume(t),r({errorCode:0,extendedData:""}),i.Xn.info(pa+" call success")):s(" stream audioTrack no found"):s(" stream must be created by zego")}))},e.prototype.getElectronScreenSources=function(){var e=this;return new we((function(t,i){var r=window.require("electron");r||(e.Xn.error("zc.gess.0 Electron is not exist"),i({message:"Electron is not exist"})),r.desktopCapturer.getSources({types:["window","screen"]}).then((function(e){var i=e.map((function(e){return{id:e.id,name:e.name,thumbnail:e.thumbnail}}));t(i)})).catch((function(t){e.Xn.error("zc.gess.0 "+t),i(t)}))}))},e.prototype.startScreenShotChrome=function(e){if(ih.screenShotReady)window.postMessage({type:"SS_UI_REQUEST",text:"start"},"*"),Cn("screenShare",{success:e},this.re.callbackList);else{var t='zc.b.ss Please install the extension:1. Go to chrome://extensions 2. Check: "Enable Developer mode 3. Click: "Load the unpacked extension... 4. Choose "extension" folder from the repository 5. Reload this page';this.Xn.error(t),e(!1,null,{code:hu.code,message:hu.message+" "+t})}},e.prototype.startScreenSharing=function(e,t){var i=this;if("getDisplayMedia"in navigator.mediaDevices){var r=navigator.mediaDevices,n=e.audio||!1,o=e.video,s="zc.b.sss";if(Pe()&&pn(o)){var a=o.width,c=o.height;pn(a)?o.width={max:a.max||a.ideal}:a&&(o.width={max:a}),pn(c)?o.height={max:c.max||c.ideal}:c&&(o.height={max:c})}var u={audio:n,video:o,preferCurrentTab:!!e.captureElement,systemAudio:"include",selfBrowserSurface:"include",surfaceSwitching:"include"};e.video=o,this.Xn.info("zc.b.sss config: "+JSON.stringify(u)),r.getDisplayMedia(u).then((function(r){return ru(i,void 0,void 0,(function(){var i,n,o,a,c;return nu(this,(function(u){switch(u.label){case 0:if(!(i=e.captureElement))return[3,5];if(n=r.getVideoTracks()[0],!("CropTarget"in window&&"fromElement"in CropTarget&&n.cropTo))return[3,5];u.label=1;case 1:return u.trys.push([1,4,,5]),(o=null==n?void 0:n.getCaptureHandle())&&o.handle===fu?[4,CropTarget.fromElement(i)]:(this.Xn.info("".concat(s," no current tap")),r.getVideoTracks().forEach((function(e){return e.stop()})),t(!1,null,{code:hu.code,message:hu.message+" captureElement must on current tab."}),[2]);case 2:return a=u.sent(),[4,n.cropTo(a)];case 3:return u.sent(),[3,5];case 4:return c=u.sent(),this.Xn.error("".concat(s," crop error:").concat(c)),r.getVideoTracks().forEach((function(e){return e.stop()})),t(!1,null,{code:hu.code,message:hu.message+" "+c}),[3,5];case 5:return t(!0,r),[2]}}))}))})).catch((function(e){i.Xn.error(s+" "+e),e.message&&"permission denied"==e.message.toLowerCase()?t(!1,null,pu):t(!1,null,{code:hu.code,message:hu.message+" "+e})}))}else this.Xn.error("zc.b.sss brower does not support getDisplayMedia"),t(!1,null,lu.Ai)},e.prototype.startScreenShotFirFox=function(e,t,i){var r=this,n={video:iu(iu({},t.video),{mediaSource:e}),audio:t.audio};navigator.mediaDevices.getUserMedia(n).then((function(e){e.getTracks().forEach((function(e){return Zn(e,r.Xn,"ze.ssf.1")})),i(!0,e)})).catch((function(e){r.Xn.error("ze.ssf.1 "+e),i(!1,null,{code:hu.code,message:hu.message+" "+e})}))},e.prototype.startScreenShotElectron=function(e,t){var i=this;if(!window.require("electron"))return this.Xn.error("ze.sse.1 Electron is not exist"),void t(!1,null,{code:hu.code,message:hu.message+" Electron is not exist"});var r={video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e.sourceID,maxWidth:window.screen.width,maxHeight:window.screen.height}},audio:!1};navigator.mediaDevices.getUserMedia(r).then((function(e){e.getTracks().forEach((function(e){return Zn(e,i.Xn,"ze.sse.1")})),t(!0,e)})).catch((function(e){i.Xn.error("ze.sse.1 "+e),t(!1,null,{code:hu.code,message:hu.message+" "+e})}))},e.prototype.Ue=function(e,t,i,r,n){var o=this,s=null;return s=new Gc(this.Xn,this.re,this.ee,t),this.ee.previewStreamList.push(s),s.startPreview(e,(function(r){o.ee.soundLevelDelegate&&(null==s||s.startSoundLevel()),"camera"===t&&(!1===(null==e?void 0:e.audio)&&s&&(s.hasMicTrack=!1),(null==s?void 0:s.micTrack)&&(s.micTrack.enabled=o.ee.isMicEnabled)),(null==e?void 0:e.videoOptimizationMode)&&o.ee.setVideoTrackContentHint(r,null==e?void 0:e.videoOptimizationMode),o.Xn.debug("zsc.sp.0 call success"),!o.re.deviceInfos&&o.recordDevices(),i&&i(r)}),(function(e){o.ee.previewStreamList=o.ee.previewStreamList.filter((function(e){return e!==s})),r&&r(e)}),n),!0},e.prototype.stopPreview=function(e){if(!e)return this.Xn.warn("zsc.sp.0 localStream null"),!1;for(var t in this.ee.publisherList)this.ee.publisherList[t].localStream===e&&(this.ee.publisherList[t].localStream=null);var i=this.ee.checkPreview(e);return i?(i.previewSuc&&(i.stopPreview(),this.ee.removePreview(i)),!0):(this.Xn.warn("zsc.sp.0 "+je),!1)},e.prototype.recordDevices=function(e,t){var i,r=this;this.Xn.info("zsc.rd.0 call"),this.Me(0).then((function(t){r.quickDeviceChangeDetection.lastRecordDeviceTime=performance.now(),e&&e(t)})).catch((function(e){r.Xn.warn("zsc.rd.0 getDevices err:",e),t&&t(e)})),void 0!==(null===(i=navigator.mediaDevices)||void 0===i?void 0:i.ondevicechange)&&(navigator.mediaDevices.ondevicechange=null,navigator.mediaDevices.ondevicechange=function(e){return ru(r,void 0,void 0,(function(){return nu(this,(function(e){return this.Xn.info("zsc.rd.0 devicechange"),this.Me(500),[2]}))}))})},e.prototype.Me=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=""),ru(this,void 0,void 0,(function(){var t,i,r,n=this;return nu(this,(function(o){switch(o.label){case 0:return this.Xn.info("zsc.rd.0 get and compare devices: "+e),t=!0,(i=this.re.deviceChangeTimer)?(clearTimeout(i),this.re.deviceChangeTimer=null):0===e&&(t=!1),r=function(){return ru(n,void 0,void 0,(function(){var e=this;return nu(this,(function(i){return this.Xn.info("zsc.rd.0 start get and compare devices"),[2,new Promise((function(i,r){To((function(r){var n,o,s,a,c,u;if(e.Xn.info("zsc.rd.0 get devices success. ".concat(JSON.stringify(r),"; need compare: ").concat(t)),!e.re.deviceInfos||!t)return e.re.deviceInfos={microphones:r.microphones,speakers:r.speakers,cameras:r.cameras},void i(JSON.parse(JSON.stringify(e.re.deviceInfos)));var l=!0,d=[],h=[];if(Pe()&&1===(null===(o=null===(n=e.re.deviceInfos)||void 0===n?void 0:n.cameras)||void 0===o?void 0:o.length)&&""===(null===(s=e.re.deviceInfos)||void 0===s?void 0:s.cameras[0].deviceID))e.Xn.info("zsc.rd.0 cameras not accurate");else{for(var p=function(t){var i=e.re.deviceInfos.cameras[t];r.cameras.find((function(e){return e.deviceID===i.deviceID}))||d.push(i)},f=0;f<e.re.deviceInfos.cameras.length;f++)p(f);e.re.deviceStateOut=!1;var m=!1;d.length>0&&(m=!0),d.forEach((function(t){for(var i in e.ee.publisherList){var r=e.ee.publisherList[i],n=r.publisher;r.localStream&&""!==r.cameraLabel&&r.cameraLabel===t.deviceName&&(m=!1,n.sendStreamStatus(-6,n.mic_status),l=!1,e.re.actionListener("_deviceError",Pt,t.deviceName,"camera"),e.re.actionListener("deviceError",Pt,t.deviceName)),r.localStream&&0===r.localStream.getAudioTracks().length&&(m=!1)}m&&(e.re.deviceStateOut=!0),e.deviceInterruptReport(0,t,"camera"),l=!1,e.re.actionListener("videoDeviceStateChanged","DELETE",t)})),r.cameras.filter((function(t){return!e.re.deviceInfos.cameras.find((function(e){return e.deviceID===t.deviceID}))})).forEach((function(t){e.deviceInterruptReport(1,t,"camera"),l=!1,e.re.actionListener("videoDeviceStateChanged","ADD",t)}))}Pe()&&1===(null===(c=null===(a=e.re.deviceInfos)||void 0===a?void 0:a.microphones)||void 0===c?void 0:c.length)&&""===(null===(u=e.re.deviceInfos)||void 0===u?void 0:u.microphones[0].deviceID)?e.Xn.info("zsc.rd.0 microphones not accurate"):((h=e.re.deviceInfos.microphones.filter((function(e){return!r.microphones.find((function(t){return t.deviceID===e.deviceID}))}))).forEach((function(t){for(var i in e.ee.publisherList){var r=e.ee.publisherList[i],n=r.publisher;r.localStream&&""!==r.microLabel&&(r.microLabel===t.deviceName||""!==r.microLabel&&r.microLabel.includes(t.deviceName))&&(n.sendStreamStatus(n.camera_status,-6),l=!1,e.re.actionListener("_deviceError",Pt,e.ee.publisherList[i].microLabel,"micro"),e.re.actionListener("deviceError",Pt,e.ee.publisherList[i].microLabel))}e.deviceInterruptReport(0,t,"micro"),l=!1,e.re.actionListener("audioDeviceStateChanged","DELETE","Input",t)})),r.microphones.filter((function(t){return!e.re.deviceInfos.microphones.find((function(e){return e.deviceID===t.deviceID}))})).forEach((function(t){e.deviceInterruptReport(1,t,"micro"),l=!1,e.re.actionListener("audioDeviceStateChanged","ADD","Input",t)})));var v=e.re.deviceInfos.speakers.filter((function(e){return!r.speakers.find((function(t){return t.deviceID===e.deviceID}))})),g=r.speakers.filter((function(t){return!e.re.deviceInfos.speakers.find((function(e){return e.deviceID===t.deviceID}))}));v.forEach((function(t){var i=e.ve.createSpan(F.H,{key:ri},{key:""},Xi);i.setAttributes({reason_type:Fi("delete"),device:Hi(t.deviceID),device_name:Hi(t.deviceName)}),i.end(),l=!1,e.re.actionListener("audioDeviceStateChanged","DELETE","Output",t)})),g.forEach((function(t){var i=e.ve.createSpan(F.H,{key:ri},{key:""},Xi);i.setAttributes({reason_type:Fi("add"),device:Hi(t.deviceID),device_name:Hi(t.deviceName)}),i.end(),l=!1,e.re.actionListener("audioDeviceStateChanged","ADD","Output",t)})),l&&e.quickDeviceChangeDetection.onDeviceNoChangeQuickly(r);var y=iu({},e.re.deviceInfos);if(e.re.deviceInfos={microphones:r.microphones,speakers:r.speakers,cameras:r.cameras},e.re.autoSwitchDeviceSetting.microphone){var b=e.re.deviceInfos.microphones;h&&0!==h.length&&0!=b.length&&e.ee.previewStreamList.forEach((function(t){return ru(e,void 0,void 0,(function(){var e,i,r,n,o,s,a;return nu(this,(function(c){switch(c.label){case 0:return e=t.localStream,i=b[0].deviceID,n=null==(r=t.audioTrack)?void 0:r.getSettings().deviceId,o=!1,n&&"default"===n?(s=y.microphones.find((function(e){return"default"===e.deviceID})).deviceName,a=b.find((function(e){return"default"===e.deviceID})).deviceName,o=a!==s):""!==n&&(o=h.some((function(e){return e.deviceID===n}))),e&&o&&""!==i?(this.Xn.info("zsc.rd.0 auto switch audio device. "+i),[4,this.zegoWebRtc.useAudioDevice(e,i)]):[3,2];case 1:c.sent(),c.label=2;case 2:return[2]}}))}))}))}if(e.re.autoSwitchDeviceSetting.camera){var _=e.re.deviceInfos.cameras;d&&0!==d.length&&0!=_.length&&e.ee.previewStreamList.forEach((function(t){return ru(e,void 0,void 0,(function(){var e,i,r,n,o,s,a;return nu(this,(function(c){switch(c.label){case 0:return e=t.localStream,i=_[0].deviceID,n=null==(r=t.videoTrack)?void 0:r.getSettings().deviceId,o=!1,n&&"default"===n?(s=y.cameras.find((function(e){return"default"===e.deviceID})).deviceName,a=_.find((function(e){return"default"===e.deviceID})).deviceName,o=a!==s):""!==n&&(o=d.some((function(e){return e.deviceID===n}))),e&&o&&""!==i?(this.Xn.info("zsc.rd.0 auto switch video device. "+i),[4,this.zegoWebRtc.useVideoDevice(e,i)]):[3,2];case 1:c.sent(),c.label=2;case 2:return[2]}}))}))}))}i(JSON.parse(JSON.stringify(e.re.deviceInfos)))}),(function(e){r(e)}))}))]}))}))},0!==e?[3,2]:[4,r()];case 1:case 3:return[2,o.sent()];case 2:return[4,new Promise((function(t,i){n.re.deviceChangeTimer=setTimeout((function(){return ru(n,void 0,void 0,(function(){var e,n;return nu(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,r()];case 1:return e=o.sent(),t(e),[3,3];case 2:return n=o.sent(),i(n),[3,3];case 3:return[2]}}))}))}),e)}))]}}))}))},e.prototype.getStreamStats=function(e){var t,i,r;return this.Xn.info("zc.p.0.gqs call"),gn(e)&&e.getTracks().length>0?r=null===(t=this.ee.checkPublish(e))||void 0===t?void 0:t.publisher:ln(e)&&(r=null===(i=this.ee.publisherList[e])||void 0===i?void 0:i.publisher),r?(null==r?void 0:r.qualityHandler.currentQuality)||null:(this.Xn.error("zsc.sp.0 stream is not publishing"),null)},e.prototype.startWaitPublish=function(){var e=this;this.ee.waitPublishList.forEach((function(t){e.re.useNetAgent&&(e.ee.publisherList[t].serverUrls=["unified_rtc"]),e.ee.startPublishingStream(t,e.re.useNetAgent)})),this.ee.waitPublishList=[]},e.prototype.deviceInterruptReport=function(e,t,i){var r="camera"===i?Ni:Di,n=this.ve.createSpan(F.H,{key:ri},{key:""},r.event);n.setAttributes({changed_type:r.interrupt(e),device:r.device(t.deviceID),device_name:r.device_name(t.deviceName)}),n.end()},e.prototype.initCopyMusic=function(e){if(this.ee.useCopyMusic&&!isNaN(this.re.engineConfig.choirRole)){var t=this.ee.checkPreview(e),i=this.re.roomList[0];if(i){var r=Array.from(new Set(i.streamList.map((function(e){return e.id_name})))),n=r.length+(r.includes(this.ee.userid)?0:1);t&&!t.onlyPreview&&t.setVolumeFactorByUserCount(n)}}},e.prototype.setEmptyAudioTrack=function(e,t){if(this.re.engineConfig.keepAudioTrack&&0==e.getAudioTracks().length){var i=t.getEmptyAudioTrack();i&&(i.enabled=!1,e.addTrack(i),t&&(t.hasEmptyAudioTrack=!0))}},e.prototype.addShareScreenEnd=function(e){var t=this,i=e.getVideoTracks()[0];i&&(i.onended=function(){var i=t.ve.createSpan(F.H,{key:ri},{key:""},qi.event);i.setAttributes({stop_reason:qi.stop_reason("screenSharingEnded")}),e&&t.stopPreview(e),i.end(),t.re.actionListener("screenSharingEnded",e)})},e}(),gu=function(){return gu=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},gu.apply(this,arguments)},yu=Ti,bu=Ii.event,_u=Ii,Su=function(){function e(e,t,i,r,n){this.Xn=e,this.dataReport=t,this.re=i,this.ee=r,this.rtm=n}return Object.defineProperty(e.prototype,"ve",{get:function(){return this.re.reporter},enumerable:!1,configurable:!0}),e.prototype.startPlayingStream=function(e,t,i){var r=this;return this.Xn.info(Io+" call ",e," playOption: ",JSON.stringify(function(e,t){var i={};if(e)for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];t.includes(o)||(i[o]=e[o])}return i}(t||{},["CDNVideo","CDNPlayer"]))," isDataChannel: ",JSON.stringify(!!i)),new we((function(n,o){return r._handlePlayStream(e,t,n,o,i)}))},e.prototype._handlePlayStream=function(e,t,i,r,n){var o,s,a=this,c=yu,u=this.ve.createSpan(F.I,{key:ri},{key:yu.event,par:e},yu.event,!0),l=function(e,t){a.Xn.error(Io+" "+(t||e.message)),a.ve.setError(u,e),r&&r(gu(gu({},e),{errorCode:e.code,extendedData:e.message+(t?" "+t:"")}))};if(void 0===e||!ln(e)||""===e)return l(c.error.wn,"stream id type error"),!1;if(e.length>256)return l(c.error.En,"stream id length limit 256"),!1;if(!Tn(e))return l(c.error.Sn),!1;if(!hn(t)&&!pn(t))return l(c.error.wn,"playOption must be object"),!1;var d=Kn(this.re.appid,this.re.idName,e),h=((o={})["_play_"+e]={stream_sid:d},o);this.ve.setPublicPros(h);var p,f=gu(gu({},t),{CDNVideo:void 0,CDNPlayer:void 0});if(u.setAttributes({stream_id:yu.stream_id(e),stream_sid:yu.stream_sid(d),play_option:yu.play_option(f),video_codec_id:yu.video_codec_id(null==t?void 0:t.videoCodec),use_na:yu.use_na(this.re.useNetAgent?1:0),biz_product:(null==t?void 0:t.resourceMode)==q.DG?1:0}),this.re.customUrl&&0!=this.re.customUrl.length)this.Xn.info("zc.p.sps.1 customUrl "+JSON.stringify(this.re.customUrl)),p=this.re.customUrl;else{var m=this.re.settingConfig.getSetting("signal_nodes",!0);m&&mn(m)&&m.length>0&&(p=m,this.Xn.info("zc.p.sps.1 setting config signal_nodes "+JSON.stringify(m)))}if(p){var v=this.ee.setPlayStateStart(e,t,d,n);return!0!==v?(l(JSON.parse(JSON.stringify(v)),"cannot start play"),!1):(this.ee.onPlayStateUpdate(2,e,{code:0,message:""}),this.ee.playerList[e].serverUrls=p,this.ee.startPlayingStream(e,!1,(function(e){i&&i(e)})))}if(this.re.useNetAgent&&this.re.playAccelerate&&this.re.roomList.length>0)this.Xn.info(Io+" play accelerate");else if(this.rtm.isDisConnect())return l(c.error.kn),!1;this.re.pullLimited||(e=NaN+e),t&&t.videoCodec&&(t.videoCodec=t.videoCodec.toUpperCase());var g=this.re.settingConfig.getSetting("resource_mode",!0);void 0!==g&&(this.Xn.info(Io," setting resource_mode "+g),!t&&(t={}),t.resourceMode=g);var y=this.ee.setPlayStateStart(e,t,d,n);if(!0!==y)return l(JSON.parse(JSON.stringify(y)),"cannot start play"),!1;if(this.ee.onPlayStateUpdate(2,e,{code:0,message:""}),this.ee.playSuccessCallBackList[e]=function(e){i&&i(e)},r&&(this.ee.playErrorCallBackList[e]=r),t&&t.resourceMode&&[1,3].includes(t.resourceMode)&&this.ee.playerList[e].playMode==z.CDN)return this.ee.startPlayingStream(e,this.re.useNetAgent,this.ee.playSuccessCallBackList[e],!0);var b=Ei;this.ve.createSpan(F.H,{key:yu.event,par:e},{key:b.event,par:e},b.event,!0).setAttributes({reason:b.reason("StartPlay")});var _=bu;(null==t?void 0:t.resourceMode)!==q.L3&&(null==t?void 0:t.resourceMode)!==q.DG||(_="/l3/play");var S=this.ve.createSpan(F.I,{key:yu.event,par:e},{key:_,par:e},_,!0),T=null===(s=this.ee.playerList[e])||void 0===s?void 0:s.room;S.setAttributes({room_id:_u.room_id(null==T?void 0:T.roomID),room_sid_string:_u.room_sid_string(null==T?void 0:T.roomSessionID),stream_id:_u.stream_id(e)});var E=this.re.useNetAgent;return!!E&&(this.re.appConfig?(this.ee.playerList[e].serverUrls=2===(null==t?void 0:t.resourceMode)?["unified_l3"]:["unified_rtc"],this.ee.startPlayingStream(e,E,this.ee.playSuccessCallBackList[e]),!0):(this.ee.waitPlayList.push(e),!0))},e.prototype.stopPlayingStream=function(e,t,i){var r,n,o;this.Xn.info(ko+" call ",e);var s=this.ve.createSpan(F.I,{key:ri},{key:""},Ri.event);if(!ln(e)||""===e)return this.Xn.error(ko+" streamid must be string and not empty"),this.ve.setError(s,Ri.error.ki,"stream id type error"),void delete this.re.reportSeqList.stopPlay[e];var a=this.ee.playerList[e],c=null==a?void 0:a.player;s.setAttributes({stream_id:Ri.stream_id(e),room_id:Ri.room_id(null===(r=this.ee.playerList[e])||void 0===r?void 0:r.room.roomID),webrtc_sid:Ri.webrtc_sid(null==c?void 0:c.sessionId),stream_sid:Ri.stream_sid(null==a?void 0:a.streamSid),biz_product:a&&(null===(n=a.playOption)||void 0===n?void 0:n.resourceMode)==q.DG?1:0});var u=a&&c&&7!==c.state||(null===(o=null==a?void 0:a.retryStreamHandler)||void 0===o?void 0:o.isRetrying());i&&!t&&6!==(null==c?void 0:c.state)&&(t=yu.error.qn);var l=[1,3].includes(null==c?void 0:c.resourceMode)&&(null==a?void 0:a.playMode)===z.CDN;for(var d in this.ee.stopPlayingStream(e,t),this.re.streamUrlMap)if(this.re.streamUrlMap[d]===e){delete this.re.streamUrlMap[d];break}t?this.ve.setError(s,t):s.end(),u&&this.ee.onPlayStateUpdate(1,e,t||{code:0,message:""},{isCDN:l}),this.Xn.debug(ko+" call success")},e.prototype.mutePlayStream=function(e,t,i,r){return new we((function(e,t){e(!1)}))},e.prototype.setStreamAudioOutput=function(e,t){return!1},e.prototype.setAudioFrameCallback=function(e,t,i){var r=this;return new Promise((function(n,o){return function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(r,void 0,void 0,(function(){var r,s,a,c;return function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}(this,(function(u){switch(u.label){case 0:return r=function(e){o({errorCode:e.errorCode||e.code,extendedData:e.extendedData||e.message})},ln(e)?(null==i?void 0:i.frameSize)&&![256,512,1024,2048,4096,8192,16384].includes(null==i?void 0:i.frameSize)?(this.Xn.error("zc.safc.0 option frameSize invalid"),r(et),[2]):(s=this.ee.playerList[e])&&(null==s?void 0:s.player)?0===(null===(c=(a=s.player).playStream)||void 0===c?void 0:c.getAudioTracks().length)?(this.Xn.error("zc.safc.0 no stream or no audio"),r(kt),[2]):[4,this.ee.acMgr.registerModule("audioPCMExporter",'class AudioPcmDataProcessor extends AudioWorkletProcessor {\n // 0. Determine the buffer size (this is the same as the 1st argument of ScriptProcessor)\n\n constructor(options) {\n super();\n // console.error("AudioPcmDataProcessor");\n this.bufferSize = 1024;\n // 1. Track the current buffer fill level\n this._bytesWritten = 0;\n\n // 2. Create a buffer of fixed size\n this.channelCount = 2;\n\n this.inputChannels = [];\n this.bufferSize = options.processorOptions.bufferSize || this.bufferSize;\n this.initBuffer();\n this.port.postMessage({\n type: "msg",\n msg: "init"\n });\n }\n\n initBuffer() {\n this._bytesWritten = 0;\n }\n\n process(inputList) {\n // console.warn("process", inputList[0]);\n this.port.postMessage({\n type: "proces",\n len: inputList[0].length\n });\n if (this.isBufferFull()) {\n this.flush();\n }\n\n const _inputChannels = inputList[0];\n this.channelCount = _inputChannels.length;\n if (_inputChannels && _inputChannels.length) {\n // 创建缓存输入\n if (!this.inputChannels[0]) {\n for (let i = 0; i < this.channelCount; i++) {\n this.inputChannels[i] = new Float32Array(this.bufferSize);\n }\n }\n\n const bufferLen = _inputChannels[0].length;\n for (let j = 0; j < bufferLen; j++) {\n for (let i = 0; i < _inputChannels.length; i++) {\n this.inputChannels[i][this._bytesWritten] = _inputChannels[i][j];\n }\n this._bytesWritten++;\n }\n }\n return true;\n }\n\n isBufferEmpty() {\n return this._bytesWritten === 0;\n }\n\n isBufferFull() {\n // console.warn(this._bytesWritten, this.bufferSize, this.channelCount);\n return this._bytesWritten === this.bufferSize;\n }\n\n flush() {\n this.port.postMessage({\n type: "process",\n channels: this.inputChannels,\n channelCount: this.inputChannels.length,\n sampleRate: sampleRate\n });\n this.initBuffer();\n }\n}\n\ntry {\n registerProcessor("audio-pcm-data-processor", AudioPcmDataProcessor);\n} catch (error) {\n console.error("registerProcessor", error);\n}\n')]:(this.Xn.error("zc.safc.0 player not found"),r(kt),[2]):(this.Xn.error("zc.zc.safc.0 streamID must be string"),r(et),[2]);case 1:return u.sent(),a.setAudioFrameCallback(t,i),n({errorCode:0,extendedData:""}),[2]}}))}))}))},e.prototype.startWaitPlay=function(){var e=this;this.ee.waitPlayList.forEach((function(t){var i,r=e.ee.playerList[t];r.serverUrls=2===(null===(i=r.playOption)||void 0===i?void 0:i.resourceMode)?["unified_l3"]:["unified_rtc"],e.ee.startPlayingStream(t,e.re.useNetAgent,e.ee.playSuccessCallBackList[t])})),this.ee.waitPlayList=[]},e.prototype.setPlayerListForbid=function(e){var t=this;e.forEach((function(e){var i=e.stream_attr_opts,r=t.ee.playerList[e.streamID];i&&(null==r||r.player.setMuteStreamByPlayMode(i))}))},e.prototype.getStreamStats=function(e){var t,i,r;return this.Xn.info("zc.p.1.gqs call"),ln(e)&&(r=null===(t=this.ee.playerList[e])||void 0===t?void 0:t.player),r&&(null===(i=null==r?void 0:r.qualityHandler)||void 0===i?void 0:i.currentQuality)?r.qualityHandler.currentQuality||null:(this.Xn.error("zsc.sp.0 stream is not playing"),null)},e}(),Tu=function(){function e(e,t,i,r){this.ee=e,this.re=t,this.Xn=i,this.rtm=r}return Object.defineProperty(e.prototype,"ve",{get:function(){return this.re.reporter},enumerable:!1,configurable:!0}),e.prototype.setStreamExtraInfo=function(e,t){var i=this;return new we((function(r,n){var o=i.ee.getRoomByStreamID(e),s=cn,a=i.ve.createSpan(F.H,o?{key:ni,par:null==o?void 0:o.roomID}:{key:ci},{key:""},s.event);a.setAttributes({stream_id:s.stream_id(e),stream_extra_info:s.stream_extra_info(t)});var c=function(e,t){void 0===t&&(t=""),i.Xn.error("zb.ssei "+t),i.ve.setError(a,e,t),n({errorCode:e.code,extendedData:e.message+" "+t})};ln(e)&&""!=e?ln(t)&&""!=t?i.rtm.isDisConnect()?c(s.error.Jn,"not login"):i.re.publishStreamList[e]?o?o.streamHandler.setStreamExtraInfo(e,t,(function(e,t){var o,c,u,l;if(0===(null===(o=null==e?void 0:e.body)||void 0===o?void 0:o.err_code)||0===(null==e?void 0:e.errorCode))a.setAttributes({send_seq:s.send_seq(t)}),a.end(),r({errorCode:0===(null===(c=null==e?void 0:e.body)||void 0===c?void 0:c.err_code)?null===(u=null==e?void 0:e.body)||void 0===u?void 0:u.err_code:null==e?void 0:e.errorCode,extendedData:""});else{var d={errorCode:(null===(l=null==e?void 0:e.body)||void 0===l?void 0:l.err_code)||(null==e?void 0:e.code)};i.ve.setError(a,d),n(d)}}),c):c(s.error.Jn,"not login"):c(s.error.Hn):c(s.error.ki,"extraInfo must be string and no empty"):c(s.error.ki,"streamID must be string and not empty")}))},e}(),Eu=Ei,Cu=Ti.event,wu=Ti.error,Iu=li.error,Ru=function(){function e(e,t,i,r,n,o,s){var a=this;this.Xn=e,this.dataReport=t,this.re=i,this.ee=r,this.rtm=n,this.ac=o,this.zegoWebRtc=s,this.beforeunloadListener=function(){for(var e=0;e<a.ee.previewStreamList.length;e++)a.ee.previewStreamList[e].stopPreview();a.ee.previewStreamList=[]},this.pagehideListener=function(){for(var e in window.event&&(window.event.cancelBubble=!0),a.ee.publisherList)a.publishModule.stopPublishingStream(e);for(var e in a.ee.playerList)a.playModule.stopPlayingStream(e)},this.messageListener=function(e){var t=e.data,i=t.type;"SS_DIALOG_SUCCESS"===i&&a.screenStreamFrom(t.streamId,t.canRequestAudioTrack,wn("screenShare",a.re.callbackList)),"SS_DIALOG_CANCEL"===i&&wn("screenShare",a.re.callbackList)(!1,null,i)},this.offlineListener=function(){for(var e in a.Xn.info("zc.off.0 "+Qe),a.re.networkState=_.offline,a.ee.publisherList){var t=a.ee.publisherList[e],i=t.publisher,r=t.retryStreamHandler;a.re.useNetAgent||(r.startMaxTime(),r.invalid()),a.ee.stopNetProbe(i)}for(var e in a.ee.playerList){var n=a.ee.playerList[e],o=(r=n.retryStreamHandler,n.player);n.playMode==z.CDN&&n.cdnPlayer&&!a.streamCenter.isZegoExpressPlayer(n.cdnPlayer)&&(n.cdnPlayer.canRetry=!1),a.re.useNetAgent||(r.startMaxTime(),r.invalid()),a.ee.stopNetProbe(o)}},this.onlineListener=function(e){for(var t in a.Xn.info("zc.on.0 network is online"),a.re.networkState=_.online,a.ee.publisherList){var i=a.ee.publisherList[t].publisher,r=a.ee.publisherList[t].retryStreamHandler;7==i.state||i.stateNego!==L.iceConnected?!r.isOverTime&&r.publishStateHandle(1,t,Iu.Gi):6==i.state&&r.stopMaxTime()}for(var t in a.ee.playerList){var n=a.ee.playerList[t],o=n.player,s=n.playMode,c=(r=n.retryStreamHandler,n.cdnPlayer);s==z.CDN&&c&&!a.streamCenter.isZegoExpressPlayer(c)&&(c.canRetry=!1),7==o.state||s!==z.CDN&&o.stateNego!==g.iceConnected?!r.isOverTime&&r.playStateHandle(1,t,wu.Nn):6==o.state&&r.stopMaxTime()}},this.visibilitychangeListener=function(e){var t;t="visible"===Ie.visibilityState?"foreground":"background";var i=a.ve.createSpan(F.H,{key:ri},{key:""},Ji);i.setAttribute("state",Yi(t)),i.end()},this.safariPagehideListener=function(e){var t=a.ve.createSpan(F.H,{key:ri},{key:""},Ji);t.setAttribute("state",Yi("background")),t.end()},this.safariPageshowListener=function(e){var t=a.ve.createSpan(F.H,{key:ri},{key:""},Ji);t.setAttribute("state",Yi("foreground")),t.end()},this.publishModule=new vu(this.Xn,this.dataReport,this.re,this.ee,this.rtm,this.zegoWebRtc),this.playModule=new Su(this.Xn,this.dataReport,this.re,this.ee,this.rtm),this.ee.playModule=this.playModule,this.initAdvance(),this.streamCommon=new Tu(r,i,e,n),this.initStreamCDN(),this.initAudioMix(),this.init()}return Object.defineProperty(e.prototype,"ve",{get:function(){return this.re.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"logger",{get:function(){return this.Xn},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stateCenter",{get:function(){return this.re},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"streamCenter",{get:function(){return this.ee},enumerable:!1,configurable:!0}),e.prototype.init=function(){var e=this;this.bindWindowListener(),this.bindRTMListener(),this.bindStreamCenterHandler(),this.bindEngineDestroyListener(),this.bindListener("_engineConfigUpdate",(function(t){isNaN(t.choirRole)||e.updatePreviewerVolumeFactor()}))},e.prototype.initAudioMix=function(){},e.prototype.initAdvance=function(){},e.prototype.initStreamCDN=function(){},e.prototype.bindWindowListener=function(){var e=Re(),t=e.match(/iPad/i)||e.match(/iPhone/i)?"pagehide":"firefox"===this.re.browser?"beforeunload":"unload";window.addEventListener("beforeunload",this.beforeunloadListener),window.addEventListener(t,this.pagehideListener),window.addEventListener("message",this.messageListener),window.addEventListener("offline",this.offlineListener),window.addEventListener("online",this.onlineListener),Ie.addEventListener("visibilitychange",this.visibilitychangeListener),Pe()&&(window.addEventListener("pagehide",this.safariPagehideListener),window.addEventListener("pageshow",this.safariPageshowListener))},e.prototype.offWindowListner=function(){var e=Re(),t=e.match(/iPad/i)||e.match(/iPhone/i)?"pagehide":"firefox"===this.re.browser?"beforeunload":"unload";window.removeEventListener("beforeunload",this.beforeunloadListener),window.removeEventListener(t,this.pagehideListener),window.removeEventListener("message",this.messageListener),window.removeEventListener("offline",this.offlineListener),window.removeEventListener("online",this.onlineListener),Ie.removeEventListener("visibilitychange",this.visibilitychangeListener),Pe()&&(window.removeEventListener("pagehide",this.safariPagehideListener),window.removeEventListener("pageshow",this.safariPageshowListener))},e.prototype.bindEngineDestroyListener=function(){var e=this;this.re.listenerList._engineDestroy.push((function(){e.offWindowListner()}))},e.prototype.bindRTMListener=function(){var e=this;this.rtm._on("_settingCanFetch",(function(t){return function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(e,void 0,void 0,(function(){var e,i,r,n;return function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}(this,(function(o){return this.Xn.info("zc.scf stream config "+JSON.stringify(t).length),e=["auto_to_tcp","udp_max_fail_num","probe_started_num","hardware_encode","camera_hard_encode","custom_hard_encode","camera_width","camera_height","camera_framerate","camera_audio_bitrate","camera_video_bitrate","sound_level_api_type","open_mini_sdp","sound_sample_interval","AEC","AGC","ANS","publish_video_codec","screen_video_bitrate","l3_play_buffer_ms","udp_or_tcp","resource_mode","bitrate_mode","bg_fps_stat"],t&&(this.re.settingConfig.setSetting(t.setting,e),(null===(r=t.setting)||void 0===r?void 0:r.open_mini_sdp)&&(i=this.re.settingConfig.getSetting("open_mini_sdp"),null===(n=this.ee)||void 0===n||n.initMiniSdpWorker(i))),[2]}))}))})),this.rtm._on("_appConfigRsp",(function(){e.Xn.info("zc.acr call "),e.re.appConfig=e.rtm.getAppConfig(),e.Xn.info("zc.acr appConfig ".concat(JSON.stringify(e.re.appConfig))),e.ee.reConnectSignals(),e.publishModule.startWaitPublish(),e.playModule.startWaitPlay()})),this.rtm._on("_netAppConfigRsp",(function(t){e.re.netAppConfig=t,e.re.supportBg=e.checkBackgroundCapacity()})),this.rtm._on("_roomLogin",(function(t,i){e.re.appid=e.rtm.getAppID(),e.re.idName=e.rtm.getUserID(),e.re.nickName=e.rtm.getUserName(),e.re.testEnvironment=e.rtm.isTestEnvironment(),e.re.isMultiRoom=e.rtm.getMultiRoom(),e.re.useNetAgent=e.rtm.isUseNetAgent,e.ee.setSessionInfo(e.re.appid,e.re.idName,e.re.testEnvironment);var r=e.re.getRoomByRoomID(t);if(!r){var n=new Oa(e.Xn,e.re,e.rtm,e.ee,t);e.bindStreamHandler(n),e.re.roomList.push(r={roomID:t,streamHandler:n,sessionID:"",roomSessionID:"",token:i,isResetRoom:!1,streamList:[],streamInfoList:[]}),e.ee.connectStreamSignal(t,i)}})),this.rtm._on("roomLoginResponse",(function(t){e.Xn.info("zc.rlr call "+JSON.stringify(t));var i=t.header.room_id||t.body.room_id;e.re.appConfig=e.rtm.getAppConfig();var r=e.rtm.getToken(i),n=e.rtm.getSessionId(i),o=e.rtm.getRoomSessionID(i),s=e.re.getRoomByRoomID(i);if(!s){var a=new Oa(e.Xn,e.re,e.rtm,e.ee,i);e.bindStreamHandler(a),e.re.roomList.push(s={roomID:i,streamHandler:a,sessionID:n,roomSessionID:o,token:r,isResetRoom:!1,streamList:[],streamInfoList:[]})}if(s.sessionID=n,s.roomSessionID=o,e.re.tempRoomList.length>0)for(var c=function(t){var i=e.re.tempRoomList[t],r=i.roomID,n=i.streamList,o=e.re.roomList.find((function(e){return e.roomID===r}));o&&(o.streamList=n.filter((function(t){var i=e.ee.stopedPlayerList[null==t?void 0:t.stream_id];return!!(i&&i.state<=6)})),e.re.tempRoomList[t].streamList=[])},u=0;u<e.re.tempRoomList.length;u++)c(u);if(1===t.body.stream_fetch_flag)return e.Xn.info("zc.rlr stream fetch "+i),s.streamHandler.room=s,void s.streamHandler.fetchStreamList();s.streamHandler.handleStreamStart(t,s),e.ee.checkStreamReport(),e.Xn.info("zc.rlr end "+i)})),this.rtm._on("_connectChanged",(function(t,i){e.Xn.info("zc.cc.0 "+t+" "+JSON.stringify(i)),"connecting"===t?e.re.connectChanged=!0:"connected"===t&&(e.re.connectChanged=!1,e.re.useNetAgent=e.rtm.isUseNetAgent,e.handleWaitPublishAndPlays(i))})),this.rtm._on("HBResponse",(function(t,i){var r,n=null===(r=null==t?void 0:t.header)||void 0===r?void 0:r.room_id,o=e.re.getRoomByRoomID(n||i);null==o||o.streamHandler.patchStreamList(t)})),this.rtm._on("_roomStateUpdate",(function(t,i,r,n,o){if("CONNECTED"===i&&e.ee.billingTimer.startChargeInfosUpload(),"DISCONNECTED"==i){e.Xn.info("zc.rsu "+t+" disconnected "+(r?r+" ":"")+(n||"")+o),e.ee.billingTimer.stopChargeInfosUpload();var s=e.re.getRoomByRoomID(t);if(s){var a=e.re.roomList.findIndex((function(e){return e.roomID==t}));s.isResetRoom=!0,s.streamHandler.reset(),e.ee.reset(t,r,o),e.re.roomList.splice(a,1),o?e.re.tempRoomList.push(s):e.re.tempRoomList=e.re.tempRoomList.filter((function(e){return e.roomID!==t}))}e.ee.disconnectStreamSignal()}else e.Xn.info("zc.rsu "+t+" state: "+i)})),this.rtm._on("_tokenRenewed",(function(t,i){e.Xn.info("zc.tr roomID:"+i),e.Xn.remoteReport("zc.tr token:"+t);var r=e.re.getRoomByRoomID(i);r&&(r.token=t)})),this.rtm._on("_tokenExpired",(function(t){var i,r;((null===(r=null===(i=null==t?void 0:t.body)||void 0===i?void 0:i.stop_stream_info)||void 0===r?void 0:r.stream_id_list)||[]).forEach((function(t){e.publishModule.stopPublishingStream(t,ct)}))})),this.rtm.liveRoomHandler&&(this.rtm.liveRoomHandler.handlePushStreamMsg=function(t){t.body.stream_cmd=t.header.sub_cmd,t.body.stream_info=t.body.stream_info_list,delete t.body.stream_info_list,e.handlePushStreamMsg(t)})},e.prototype.handleWaitPublishAndPlays=function(e){for(var t=Object.keys(this.re.waitPublishStreamList),i=0;i<t.length;i++){var r=t[i],n=this.re.waitPublishStreamList[r],o=n.localStream,s=n.publishOption,a=n.isDataChannel;if(n.retryStart){if(s.roomID&&s.roomID!==(null==e?void 0:e.roomID)){this.Xn.info("zc.hwpap.0 room not connect");continue}this.publishModule.startPublishingStream(r,o,s,a),delete this.re.waitPublishStreamList[r]}}},e.prototype.handlePushStreamMsg=function(e){var t,i=(null===(t=null==e?void 0:e.header)||void 0===t?void 0:t.room_id)||"",r=this.re.getRoomByRoomID(i),n=this.rtm.getMsgSpan(Vi.event,i);if(!r)return this.ve.setError(n,Vi.error.Fn),void this.Xn.error("zc.opsu room no found");var o="";switch(e.body.stream_cmd){case k:o="add";break;case 12002:o="delete";break;case 12003:o="update"}var s=e.body.stream_info.map((function(e){return{stream_id:e.stream_id,stream_extra_info:e.extra_info,id_name:e.id_name||e.anchor_id_name}}));n.setAttributes({stream_update_type:Vi.stream_update_type(o),stream_seq:e.body.stream_seq,stream_list:Vi.stream_list(s)}),n.end(),r.streamHandler.handlePushStreamUpdateMsg(e)},e.prototype.bindStreamCenterHandler=function(){var e=this;this.ee.onPlayStateUpdate=function(t,i,r,n){var o,s,a,c,u,l,d,h,p;e.Xn.info("zc.opsu.1 ".concat(i," ").concat(t));var f=e.ee.playerList[i];if(1==t&&f&&zn(r)){var m=f.player,v=f.retryDispatchHandler,g=f.playOption;return 0!=m.sessionId&&m.signal&&m.shouldSendCloseSession()&&(m.signal.sendCloseSession(e.re.getSeq(),m.sessionId,1),m.signal.removeSession(m.sessionId),m.closeSessionSignal=!0),m.resetPlay(),v.stopMaxTime(),v.invalid(),v.initStream(i,g,!1),void(e.rtm.isLogin()?(v.startMaxTime(),v.active(0)):e.ee.playerList[i].isReDispatch=!0)}var y=null==f?void 0:f.player;if(y){var b=f.player.isRePlay?Ci:Ei;0!=t&&1!=t||(f.retryStreamHandler.streamRetryStartTime=0,y.uploadPlayEvent(r)),[0,wu.qn.code].includes(null==r?void 0:r.code)||(y.latestPlayErrCode=r.code),1==t&&r&&e.ve.spanSetAttributes({key:b.event,par:i},{error:r.code,message:r.message}),e.ve.spanEnd({key:b.event,par:i},{url:Eu.url(null===(s=null===(o=null==f?void 0:f.player)||void 0===o?void 0:o.signal)||void 0===s?void 0:s.server),ip:Eu.ip(null===(a=null==f?void 0:f.player)||void 0===a?void 0:a.ip),peer_id:Eu.peer_id(null===(c=null==f?void 0:f.player)||void 0===c?void 0:c.peerID),source_type:Eu.source_type(go(null===(u=null==f?void 0:f.player)||void 0===u?void 0:u.resourceMode)),net_protocol:Eu.net_protocol(null===(l=null==f?void 0:f.player)||void 0===l?void 0:l.netProtocol),signal_consume:Eu.signal_consume(null===(d=null==f?void 0:f.player)||void 0===d?void 0:d.signalTime),is_center:Eu.is_center(null==f?void 0:f.isCenterNode)})}var _=e.ee.playEventKeys[i],S=Date.now();if(0!=t||(null==n?void 0:n.isCDN)){if(1==t&&!(null==n?void 0:n.isCDN)){null==y||y.uploadRTCPlayStats();var T=(null==y?void 0:y.Le)?0:null===(h=null==f?void 0:f.retryStreamHandler)||void 0===h?void 0:h.getTryTime(y);delete e.ee.playEventKeys[i],e.ve.spanEnd({key:_,par:i},{tryidx:Ii.tryidx(null==y?void 0:y.rtcPlayCount),url:Ii.url(null===(p=null==y?void 0:y.signal)||void 0===p?void 0:p.server),ip:Ii.ip(null==y?void 0:y.ip),resource_type:Ii.resource_type(go((null==y?void 0:y.resourceMode)||0)),protocol:Ii.protocol("webrtc"),dispatch_external_ip:Ii.dispatch_external_ip(e.re.clientIP),net_protocol:Ii.net_protocol(null==y?void 0:y.netProtocol),stop_reason:Ii.stop_reason(null==y?void 0:y.stopReason),try_time:Ii.try_time(T),error:r.code,message:r.message}),f&&f.player&&(f.player.stopReason="")}}else y.pulledTimeStamp=S,y.updateCDNValidTime();if(1===t&&e.ee.playErrorCallBackList[i]){if(!e.re.connectChanged){e.Xn.info("zc.opsu.1 connect changed");var E=r&&(r.code==wu.qn.code?0:r.code);e.ee.playErrorCallBackList[i]({errorCode:E||0,extendedData:E?r.message:""}),delete e.ee.playErrorCallBackList[i]}e.Xn.info("zc.opsu.1 stop play called by sdk"),e.playModule.stopPlayingStream(i,r)}else{var C=function(e){return 0==e||1==e?0==e?"PLAYING":"NO_PLAY":"PLAY_REQUESTING"}(t),w=1===t||(null==y?void 0:y.updateCBState({state:C,code:r.code}));0===t?0==y.firstPulledTimeStamp&&(y.firstPulledTimeStamp=S):y&&y.pulledTimeStamp&&y.updateValidTime(r),r.code===wu.qn.code&&(r={code:0,message:""}),w&&e.re.actionListener("playerStateUpdate",{state:C,streamID:i,errorCode:r&&r.code,extendedData:r&&r.message})}},this.ee.onPublishStateUpdate=function(t,i,r){e.onPublishStateUpdateHandle(t,i,r)},this.ee.onPublishQualityUpdate=function(t,i){e.re.actionListener("publishQualityUpdate",t,i)},this.ee.onPlayQualityUpdate=function(t,i){e.re.actionListener("playQualityUpdate",t,i)},this.ee.onRemoteCameraStatusUpdate=function(t,i,r){var n=e.ve.createSpan(F.H,{key:Cu,par:t},{key:""},"/sdk/remote_camera_update");n.setAttributes({stream_id:Mi(t),camera_status:Li(i),status_code:xi(r)}),n.end(),e.re.actionListener("remoteCameraStatusUpdate",t,i),e.re.actionListener("_remoteCameraStatusUpdate",t,r)},this.ee.onRemoteMicStatusUpdate=function(t,i,r){var n=e.ve.createSpan(F.H,{key:Cu,par:t},{key:""},"/sdk/remote_mic_update");n.setAttributes({stream_id:Ui(t),mic_status:Bi(i),status_code:zi(r)}),n.end(),e.re.actionListener("remoteMicStatusUpdate",t,i),e.re.actionListener("_remoteMicStatusUpdate",t,r)},this.ee.onSoundLevelUpdate=function(t){e.re.actionListener("soundLevelUpdate",t)},this.ee.onMicSoundLevelUpdate=function(t){e.re.actionListener("capturedSoundLevelUpdate",t)}},e.prototype.bindStreamHandler=function(e){var t=this;e.onStreamUpdated=function(e,i,r){var n=r.map((function(e){return{streamID:e.streamID,user:e.user,extraInfo:e.extraInfo,urlsFLV:e.urlFlv,urlsRTMP:e.urlRtmp,urlsHLS:e.urlHls,urlsHttpsFLV:e.urlHttpsFlv,urlsHttpsHLS:e.urlHttpsHls}})),o={};if(0===i){var s=r.map((function(e){return{stream_id:e.streamID,code:w[e.closeType]&&w[e.closeType].code||0,description:w[e.closeType]&&w[e.closeType].description||"unknown"}}));o.stream_delete_reason=s}if(0===i&&(n=n.filter((function(e){return!t.re.publishStreamList[e.streamID]}))),t.updatePreviewerVolumeFactor(e),n.length>0&&t.re.actionListener("roomStreamUpdate",e,function(e){return 0==e?"DELETE":"ADD"}(i),n,Object.keys(o).length>0?JSON.stringify(o):""),r.length>0&&t.re.actionListener("_streamUpdated",i,r),1===i){var a=[];n.forEach((function(e){e.extraInfo&&a.push({streamID:e.streamID,user:e.user,extraInfo:e.extraInfo})})),a.length>0&&t.re.actionListener("streamExtraInfoUpdate",e,a)}},e.onPublishStateUpdate=function(e,i,r){var n,o,s,a,c,u,l,d,h,p,f;t.Xn.info("zb.opsu "+i+" "+e);var m=t.ee.publisherList[i],v=m&&m.publisher;if(v){var g=m.publisher.isRePublish?hi:di,y=di;0!=e&&1!=e||(m.retryStreamHandler.streamRetryStartTime=0,v.uploadPublishEvent(r)),[0,Iu.bn.code].includes(null==r?void 0:r.code)||(v.latestPublishErrCode=r.code),t.ve.spanEnd({key:g.event,par:i},{error:r.code,message:r.message,url:y.url(null===(o=null===(n=null==m?void 0:m.publisher)||void 0===n?void 0:n.signal)||void 0===o?void 0:o.server),ip:y.ip(null===(s=null==m?void 0:m.publisher)||void 0===s?void 0:s.ip),peer_id:y.peer_id(null===(a=null==m?void 0:m.publisher)||void 0===a?void 0:a.peerID),source_type:y.source_type("rtc"),net_protocol:y.net_protocol(null===(c=null==m?void 0:m.publisher)||void 0===c?void 0:c.netProtocol),is_center:y.is_center(null==m?void 0:m.isCenterNode)})}var b=_i,_=Date.now();if(v){var S=v.publishedTimeStamp;0!=e&&S&&(r&&r.code&&r.code!==Iu.bn.code&&v.errorTimes++,v.validPublishedTime=_-S,v.publishedTimeStamp=0),0==e?(0==v.firstPublishedTimeStamp&&(v.firstPublishedTimeStamp=_),v.publishedTimeStamp=_):1==e&&(1012===r.code?t.ee.stopPublishingStream(i,r):2002===r.code&&(t.ee.stopPublishingStream(i,r),r.code=1102016),v.uploadRTCPublishStats(),t.ve.spanEnd({key:b.event,par:i},{tryidx:b.tryidx(v.rtcPublishCount),url:b.url(null===(u=null==v?void 0:v.signal)||void 0===u?void 0:u.server),ip:b.ip(null===(d=null===(l=null==v?void 0:v.gwNode)||void 0===l?void 0:l.split(":"))||void 0===d?void 0:d[0]),dispatch_external_ip:b.dispatch_external_ip(t.re.clientIP),room_id:b.room_id(null===(h=null==m?void 0:m.room)||void 0===h?void 0:h.roomID),room_sid_string:b.room_sid_string(null===(p=null==m?void 0:m.room)||void 0===p?void 0:p.roomSessionID),resource_type:b.resource_type("rtc"),protocol:b.protocol("webrtc"),net_protocol:b.net_protocol(v.netProtocol),stop_reason:b.stop_reason(v.stopReason),error:r.code,message:r.message}),m&&(v.stopReason=""))}r.code===Iu.bn.code&&(r={code:0,message:""});var T=function(e){return 0==e||1==e?0==e?"PUBLISHING":"NO_PUBLISH":"PUBLISH_REQUESTING"}(e);(1===e||(null===(f=null==m?void 0:m.publisher)||void 0===f?void 0:f.updateCBState({state:T,code:r.code})))&&t.re.actionListener("publisherStateUpdate",{state:T,streamID:i,errorCode:r.code,extendedData:r.message})},e.onStreamExtraInfoUpdated=function(e,i){var r=i.map((function(e){return{streamID:e.streamID,user:e.user,extraInfo:e.extraInfo}}));t.re.actionListener("streamExtraInfoUpdate",e,r)},e.onStreamAttrUpdated=function(e,i){t.playModule&&t.playModule.setPlayerListForbid(i)}},e.prototype.updatePreviewerVolumeFactor=function(e){var t=this;if(this.ee.useCopyMusic&&!isNaN(this.re.engineConfig.choirRole)){this.Xn.info("zc.rtc.upvf "+e);var i=[];if(e){var r=this.re.getRoomByRoomID(e);r&&i.push(r)}else i.push.apply(i,this.re.roomList);i.forEach((function(e){var i=Array.from(new Set(e.streamList.map((function(e){return e.id_name}))));t.ee.previewStreamList.forEach((function(e){e&&!e.onlyPreview&&e.setVolumeFactorByUserCount(i.length)}))}))}},e.prototype.screenStreamFrom=function(e,t,i){var r=this,n={};n.audio={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e}},n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,maxWidth:window.screen.width,maxHeight:window.screen.height}},!t&&(n.audio=!1),navigator.mediaDevices.getUserMedia(n).then((function(e){e.getTracks().forEach((function(e){return Zn(e,r.Xn,"zc.st.ssf")})),i(!0,e)})).catch((function(e){i(!1,null,e)}))},e.prototype.onPublishStateUpdateHandle=function(e,t,i){var r=this;this.Xn.info("zc.opsuh.0 call");var n=this.ee.publisherList[t],o=n.room;if(o)if(0==e){if(this.re.publishStreamList[t]){var s=!o.streamList.find((function(e){return e.stream_id==t&&(e.anchor_id_name==r.re.idName||e.id_name==r.re.idName||e.user_id===r.re.idName)}));this.Xn.info("zc.opsuh.0 room stream"+t+" "+s),[T.tryPublish,T.retryPublish].includes(this.re.publishStreamList[t].state)&&s?(this.re.publishStreamList[t].state=T.update_info,o.streamHandler.updateStreamInfo(t,E,this.re.publishStreamList[t].extra_info,(function(e){}))):(this.Xn.info("zc.opsuh.0 stream update "+t),this.re.publishStreamList[t].state=T.publishing,this.WebrtcOnPublishStateUpdateHandle(e,t,i))}}else{if(1==e&&n&&zn(i)){var a=n.publisher,c=n.retryDispatchHandler,u=n.publishOption;return 0!=a.sessionId&&a.signal&&a.shouldSendCloseSession()&&(a.signal.sendCloseSession(this.re.getSeq(),a.sessionId,1),a.signal.removeSession(a.sessionId),a.closeSessionSignal=!0),a.resetPublish(),c.stopMaxTime(),c.invalid(),c.initStream(t,u,!0),void(this.rtm.isLogin()?(c.startMaxTime(),c.active(0)):this.ee.publisherList[t].isReDispatch=!0)}o.streamHandler.onPublishStateUpdate(e,t,i),1==e&&(this.Xn.info("zc.opsuh.0 stop publish called by sdk"),this.publishModule.stopPublishingStream(t,i))}else this.Xn.error("zc.opsuh.0 "+He)},e.prototype.WebrtcOnPublishStateUpdateHandle=function(e,t,i){if(this.re.publishStreamList[t].state==T.publishing){var r=this.ee.getRoomByStreamID(t);r&&r.streamHandler.onPublishStateUpdate(e,t,i)}},e.prototype.bindListener=function(e,t){var i=this.ve.createSpan(F.H,{key:oi},{key:""},si.event);return i.setAttributes({listener:e}),this.re.listenerList[e]?fn(t)?(-1==this.re.listenerList[e].indexOf(t)&&this.re.listenerList[e].push(t),i.end(),!0):(this.Xn.error("zc.o.0 listener callBack must be funciton"),this.ve.setError(i,si.error.ki," listener callBack must be function"),!1):(this.Xn.error("zc.o.0 event "+e+" no found"),this.ve.setError(i,si.error.ki," event "+event+" no found"),!1)},e.prototype.deleteListener=function(e,t){var i=this.ve.createSpan(F.H,{key:oi},{key:""},ai.event);if(i.setAttributes({listener:e}),!this.re.listenerList[e])return this.Xn.error("zc.o.1 listener no found"),this.ve.setError(i,ai.error.ki," event "+event+" no found"),!1;this.Xn.info("dc.o.1 "+"".concat(e," cb:")+_typeof(t));var r=this.re.listenerList[e];if(t){var n=r.indexOf(t);n>=0&&r.splice(n,1)}else this.re.listenerList[e]=[];return i.end(),!0},e.prototype.checkBackgroundCapacity=function(){if(this.re.netAppConfig){var e=this.re.netAppConfig.media_config.publish_config.object_segmentation_platform;return!!e&&!!Jn(e,0)}return!0},e}();function ku(e){return[e>>24&255,e>>16&255,e>>8&255,255&e].join(".")}function Pu(e){var t=e.split(".");return(parseInt(t[0])<<24)+(parseInt(t[1])<<16)+(parseInt(t[2])<<8)+parseInt(t[3])}var Au,Du,Nu,Ou=function(){function e(e){this.view=e,this.offset=0,this.current_start_code_size=0,this.current_nalu_start=0,this.current_nalu_size=0,this.start_code_size=0,this.nalu_start=0,this.left_size=0,this.nalu_size=0,this.left_size=e.byteLength}return e.prototype.FindStartCode=function(){var e=this.view.byteLength-this.offset;for(this.current_start_code_size=0,this.current_nalu_start=-1;e>=3;){if(0==this.view.getUint8(this.offset)&&0==this.view.getUint8(this.offset+1)&&1==this.view.getUint8(this.offset+2))return this.current_start_code_size=3,this.current_nalu_start=this.offset,this.offset-1>=0&&0==this.view.getUint8(this.offset-1)&&(++this.current_start_code_size,--this.current_nalu_start),this.offset+=3,!0;--e,++this.offset}return!1},e.prototype.FindNalu=function(){return this.start_code_size=0,this.nalu_start=0,this.nalu_size=0,!(this.offset>=this.view.byteLength)&&!!this.FindStartCode()&&(this.start_code_size=this.current_start_code_size,this.nalu_start=this.current_nalu_start,!0)},e.prototype.NextNalu=function(e){return this.start_code_size=0,this.nalu_start=0,this.nalu_size=0,!(this.offset>=this.view.byteLength)&&(!!this.FindStartCode()&&(this.start_code_size=this.current_start_code_size,this.nalu_start=this.current_nalu_start,!(!e||6==(31&this.view.getUint8(this.nalu_start+this.start_code_size)))||(this.FindStartCode()?(this.offset=this.current_nalu_start,this.nalu_size=this.current_nalu_start-this.nalu_start,!0):(this.nalu_size=this.view.byteLength-this.nalu_start,!0))))},e}();function Mu(e,t,i){if(0===e)return"";var r=1,n=" Here are some explanations about the error code: ".concat(r++,". reason=").concat(e,": ").concat(function(e){switch(e){case Au.PEER_CLOSE_REASON_NORMAL:return"Client voluntarily exits.";case Au.PEER_CLOSE_REASON_STATE_ERROR:return"Status error; Reason: Repeatedly received offer/answer, etc.";case Au.PEER_CLOSE_REASON_VRS_PUBLISH_DENIED:return"Refuse to push the stream; Reason: The client retweeted the stream and was kicked or the agent's pubstart timed out, etc.";case Au.PEER_CLOSE_REASON_VRS_PLAY_DENIED:return"Refuse to pull stream; Reason: may pull empty stream, etc., refer to 'err' error code for details.";case Au.PEER_CLOSE_REASON_AUDIO_CODEC_NOT_MATCH:return"No matching audio codec; Reason: Client (Web) does not support OPUS, etc.";case Au.PEER_CLOSE_REASON_VIDEO_CODEC_NOT_MATCH:return"No matching video codec; Reason: Client (Web) does not support h264 and vp8 etc.";case Au.PEER_CLOSE_REASON_SDP_INVALID:return"SDP parsing error; Reason: SDP format error.";default:return"unknown"}}(e));return t&&(n+=" ".concat(r++,". action=").concat(t,": ").concat(function(e){switch(e){case Du.DENIED_ACTION_STOP:return"cancel pushing stream.";case Du.DENIED_ACTION_RETRY_NEXT_IP:return"Try the next ip, if there is no next ip, re-request the route.";case Du.DENIED_ACTION_REDIRECT:return"Redirect to the ip address specified by data.";case Du.DENIED_ACTION_REDISPATCH:return"re-request route.";case Du.DENIED_ACTION_RETRY:return"retry current gateway node.";default:return"unknown"}}(t))),i&&(n+=" ".concat(r++,". err=").concat(i,": ").concat(function(e){switch(e){case Nu.DENIED_ERROR_DISPATCH_FAILED:return"media scheduling failed.";case Nu.DENIED_ERROR_EMPTY_PUBLISH_IPS:return"empty publish ips error.";case Nu.DENIED_ERROR_EMPTY_PLAY_IPS:return"empty play ips error.";case Nu.DENIED_ERROR_STREAM_NOT_EXSIT:return"stream does not exist.";case Nu.DENIED_ERROR_APP_NOT_ONLINE:return"APP has been removed.";case Nu.DENIED_ERROR_INVALID_PARAMETERS:return"invalid parameter.";case Nu.DENIED_ERROR_NO_CLIENTIP_SET:return"client ip is not set.";case Nu.DENIED_ERROR_PERMISSION_DENIED:return"No permission, access denied.";case Nu.DENIED_ERROR_SET_STREAM_INFO_FAILED:return"Failed to set stream information.";case Nu.DENIED_ERROR_INTERNAL_ERROR:return"internal error / server busy.";case Nu.DENIED_ERROR_PUBLISH_FORBIDDEN:return"Streaming is banned.";case Nu.DENIED_ERROR_NEW_PUBLISH:return"new publish error.";case Nu.DENIED_ERROR_INNER_ERROR:return"inner error.";case Nu.DENIED_ERROR_MANAGER_STOP:return"manager stop error.";case Nu.DENIED_ERROR_PUBLISH_AUTH_FAILED:return"Stream push authentication failed.";case Nu.DENIED_ERROR_PLAY_AUTH_FAILED:return"Stream pull authentication failed.";case Nu.DENIED_ERROR_SERVER_STOP:return"server stoped error.";case Nu.DENIED_ERROR_SESSION_ID:return"session id error.";case Nu.DENIED_ERROR_MANAGER_TIMEOUT:return"manager timeout.";case Nu.DENIED_ERROR_NEW_PUBLISH_SRC:return"new publish src.";case Nu.DENIED_ERROR_PLAY_SESSION_LIMIT:return"Pull session limit.";case Nu.DENIED_ERROR_DISABLE_IP_PORT_FLEXIBLE:return"disable ip port flexible.";case Nu.DENIED_ERROR_PACKET_ILLEGAL_TS:return"packet illegal ts.";case Nu.DENIED_ERROR_PACKET_ILLEGAL_ADDR:return"packet illegal address.";case Nu.DENIED_ERROR_PACKET_ILLEGAL_FORMAT:return"packet illegal format.";case Nu.DENIED_ERROR_CHECK_ADDR_TIMEOUT:return"Check address timed out.";case Nu.DENIED_ERROR_CHECK_ADDR_ILLEGAL_SIGNATURE:return"Check Address Illegal Signature.";case Nu.DENIED_ERROR_CHECK_ADDR_INCONSTANT:return"Check for address changes.";case Nu.DENIED_ERROR_WEBRTC_NEGOTIATE_TIMEOUT:return"SDP negotiation timed out, check whether the SDP is sent successfully.";case Nu.DENIED_ERROR_WEBRTC_CANDIDATE_TIMEOUT:return"Address negotiation timed out, check whether the Candidate is sent successfully.";case Nu.DENIED_ERROR_WEBRTC_CONNECTIVITY_CHECK_FAILED:return"The connectivity check failed, probably due to firewall restrictions (protocol or port) that caused the network between the browser and the gateway to fail.";case Nu.DENIED_ERROR_WEBRTC_DTLS_HS_FAILED:return"The DTLS handshake fails, the verification of the certificate may fail, and the background checks whether the certificate has expired.";case Nu.DENIED_ERROR_WEBRTC_DTLS_HS_TIMEOUT:return"The DTLS handshake timed out, this mainly due to network link packet loss and other situations that caused the timeout. Please check your network status and try again.";case Nu.DENIED_ERROR_WEBRTC_SRTP_PROTECT_FAILED:return"Streaming encryption failed";case Nu.DENIED_ERROR_WEBRTC_HB_TIMEOUT:return"The heartbeat timed out, this mainly due to network link packet loss and other conditions that caused the timeout. Please check your network status and try again.";case Nu.DENIED_ERROR_WEBRTC_CONNECTION_LOST:return"The link is disconnected. In turn mode, if the turn link times out or has been released, the gateway will fail to send, and the gateway will think that the link has been lost.";case Nu.DENIED_ERROR_WEBRTC_NEW_SRC:return"After the stream pushing end pushes the stream again, the stream pulling end will receive this message.";default:return"unknown"}}(i))),n}!function(e){e[e.PEER_CLOSE_REASON_NORMAL=0]="PEER_CLOSE_REASON_NORMAL",e[e.PEER_CLOSE_REASON_STATE_ERROR=5]="PEER_CLOSE_REASON_STATE_ERROR",e[e.PEER_CLOSE_REASON_VRS_PUBLISH_DENIED=15]="PEER_CLOSE_REASON_VRS_PUBLISH_DENIED",e[e.PEER_CLOSE_REASON_VRS_PLAY_DENIED=18]="PEER_CLOSE_REASON_VRS_PLAY_DENIED",e[e.PEER_CLOSE_REASON_AUDIO_CODEC_NOT_MATCH=21]="PEER_CLOSE_REASON_AUDIO_CODEC_NOT_MATCH",e[e.PEER_CLOSE_REASON_VIDEO_CODEC_NOT_MATCH=22]="PEER_CLOSE_REASON_VIDEO_CODEC_NOT_MATCH",e[e.PEER_CLOSE_REASON_SDP_INVALID=23]="PEER_CLOSE_REASON_SDP_INVALID"}(Au||(Au={})),function(e){e[e.DENIED_ACTION_STOP=1]="DENIED_ACTION_STOP",e[e.DENIED_ACTION_RETRY_NEXT_IP=2]="DENIED_ACTION_RETRY_NEXT_IP",e[e.DENIED_ACTION_REDIRECT=3]="DENIED_ACTION_REDIRECT",e[e.DENIED_ACTION_REDISPATCH=4]="DENIED_ACTION_REDISPATCH",e[e.DENIED_ACTION_RETRY=5]="DENIED_ACTION_RETRY"}(Du||(Du={})),function(e){e[e.DENIED_ERROR_DISPATCH_FAILED=1001]="DENIED_ERROR_DISPATCH_FAILED",e[e.DENIED_ERROR_EMPTY_PUBLISH_IPS=1002]="DENIED_ERROR_EMPTY_PUBLISH_IPS",e[e.DENIED_ERROR_EMPTY_PLAY_IPS=1003]="DENIED_ERROR_EMPTY_PLAY_IPS",e[e.DENIED_ERROR_STREAM_NOT_EXSIT=1004]="DENIED_ERROR_STREAM_NOT_EXSIT",e[e.DENIED_ERROR_APP_NOT_ONLINE=1005]="DENIED_ERROR_APP_NOT_ONLINE",e[e.DENIED_ERROR_INVALID_PARAMETERS=1006]="DENIED_ERROR_INVALID_PARAMETERS",e[e.DENIED_ERROR_NO_CLIENTIP_SET=1007]="DENIED_ERROR_NO_CLIENTIP_SET",e[e.DENIED_ERROR_PERMISSION_DENIED=1008]="DENIED_ERROR_PERMISSION_DENIED",e[e.DENIED_ERROR_SET_STREAM_INFO_FAILED=1009]="DENIED_ERROR_SET_STREAM_INFO_FAILED",e[e.DENIED_ERROR_INTERNAL_ERROR=1010]="DENIED_ERROR_INTERNAL_ERROR",e[e.DENIED_ERROR_PUBLISH_FORBIDDEN=1011]="DENIED_ERROR_PUBLISH_FORBIDDEN",e[e.DENIED_ERROR_NEW_PUBLISH=1012]="DENIED_ERROR_NEW_PUBLISH",e[e.DENIED_ERROR_INNER_ERROR=1013]="DENIED_ERROR_INNER_ERROR",e[e.DENIED_ERROR_MANAGER_STOP=1014]="DENIED_ERROR_MANAGER_STOP",e[e.DENIED_ERROR_PUBLISH_AUTH_FAILED=1015]="DENIED_ERROR_PUBLISH_AUTH_FAILED",e[e.DENIED_ERROR_PLAY_AUTH_FAILED=1016]="DENIED_ERROR_PLAY_AUTH_FAILED",e[e.DENIED_ERROR_SERVER_STOP=2001]="DENIED_ERROR_SERVER_STOP",e[e.DENIED_ERROR_SESSION_ID=2002]="DENIED_ERROR_SESSION_ID",e[e.DENIED_ERROR_MANAGER_TIMEOUT=2003]="DENIED_ERROR_MANAGER_TIMEOUT",e[e.DENIED_ERROR_NEW_PUBLISH_SRC=2004]="DENIED_ERROR_NEW_PUBLISH_SRC",e[e.DENIED_ERROR_PLAY_SESSION_LIMIT=2005]="DENIED_ERROR_PLAY_SESSION_LIMIT",e[e.DENIED_ERROR_DISABLE_IP_PORT_FLEXIBLE=2006]="DENIED_ERROR_DISABLE_IP_PORT_FLEXIBLE",e[e.DENIED_ERROR_PACKET_ILLEGAL_TS=2007]="DENIED_ERROR_PACKET_ILLEGAL_TS",e[e.DENIED_ERROR_PACKET_ILLEGAL_ADDR=2008]="DENIED_ERROR_PACKET_ILLEGAL_ADDR",e[e.DENIED_ERROR_PACKET_ILLEGAL_FORMAT=2009]="DENIED_ERROR_PACKET_ILLEGAL_FORMAT",e[e.DENIED_ERROR_CHECK_ADDR_TIMEOUT=2010]="DENIED_ERROR_CHECK_ADDR_TIMEOUT",e[e.DENIED_ERROR_CHECK_ADDR_ILLEGAL_SIGNATURE=2011]="DENIED_ERROR_CHECK_ADDR_ILLEGAL_SIGNATURE",e[e.DENIED_ERROR_CHECK_ADDR_INCONSTANT=2012]="DENIED_ERROR_CHECK_ADDR_INCONSTANT",e[e.DENIED_ERROR_WEBRTC_NEGOTIATE_TIMEOUT=3e3]="DENIED_ERROR_WEBRTC_NEGOTIATE_TIMEOUT",e[e.DENIED_ERROR_WEBRTC_CANDIDATE_TIMEOUT=3001]="DENIED_ERROR_WEBRTC_CANDIDATE_TIMEOUT",e[e.DENIED_ERROR_WEBRTC_CONNECTIVITY_CHECK_FAILED=3002]="DENIED_ERROR_WEBRTC_CONNECTIVITY_CHECK_FAILED",e[e.DENIED_ERROR_WEBRTC_DTLS_HS_FAILED=3003]="DENIED_ERROR_WEBRTC_DTLS_HS_FAILED",e[e.DENIED_ERROR_WEBRTC_DTLS_HS_TIMEOUT=3004]="DENIED_ERROR_WEBRTC_DTLS_HS_TIMEOUT",e[e.DENIED_ERROR_WEBRTC_SRTP_PROTECT_FAILED=3005]="DENIED_ERROR_WEBRTC_SRTP_PROTECT_FAILED",e[e.DENIED_ERROR_WEBRTC_HB_TIMEOUT=3006]="DENIED_ERROR_WEBRTC_HB_TIMEOUT",e[e.DENIED_ERROR_WEBRTC_CONNECTION_LOST=3007]="DENIED_ERROR_WEBRTC_CONNECTION_LOST",e[e.DENIED_ERROR_WEBRTC_NEW_SRC=3008]="DENIED_ERROR_WEBRTC_NEW_SRC"}(Nu||(Nu={}));var Lu={FPS:{code:P.captureFpsToLow,message:"The video capture frame rate is too low."},VOLUME:{code:P.captureVolumeToLow,message:"The capture volume is too low."}},xu={V_BITRATE:{code:P.sendVideoBitrateToLow,message:"The video bit rate sent is too low."},FPS:{code:P.sendFpsToLow,message:"The video frame rate sent is too low."},A_BITRATE:{code:P.sendAudioBitrateToLow,message:"The audio bit rate sent is too low."}},Uu={A_VOLUME:{code:P.receiveVolumeToLow,message:"The volume of audio received is too low."},A_DECODE:{code:P.receiveAudioDecodedFail,message:"The received audio failed to be decoded."},V_DECODE:{code:P.receiveVideoDecodedFail,message:"The received video failed to be decoded."},V_DECODED_FPS:{code:P.receiveVideoFpsDecodedToLow,message:"Received video decode frame rate is too low."},RENDER_VIDEO_FPS:{code:P.renderVideoFpsToLow,message:"The rendered video frame rate is too low."}},Bu={FPS:{code:P.captureFpsNormal,message:"The video capture frame rate is normal."},VOLUME:{code:P.captureVolumeNormal,message:"The capture volume is normal."}},zu={V_BITRATE:{code:P.sendVideoBitrateNormal,message:"The video bit rate sent is normal."},FPS:{code:P.sendFpsNormal,message:"The video frame rate sent is normal."},A_BITRATE:{code:P.sendAudioBitrateNormal,message:"The audio bit rate sent is normal."}},qu={A_VOLUME:{code:P.receiveVolumeNormal,message:"The volume of audio received is normal."},A_DECODE:{code:P.receiveAudioDecodedNormal,message:"The received audio successed to be decoded."},V_DECODE:{code:P.receiveVideoDecodedNormal,message:"The received video successed to be decoded."},V_DECODED_FPS:{code:P.receiveVideoFpsDecodedNormal,message:"Received video decode frame rate is normal."},RENDER_VIDEO_FPS:{code:P.renderVideoFpsNormal,message:"The rendered video frame rate is normal."}},Xu=function(){function e(e,t,i,r){this.re=e,this.parentEvent=r,this.results={},this.preTime=Date.now(),this.preTotalFps=0,this.preIsNormal={},this.Xn=t,this.streamId=i,this.initPreIsNormal(Lu),this.initPreIsNormal(xu),this.initPreIsNormal(Uu)}return e.prototype.initPreIsNormal=function(e){for(var t in e)this.preIsNormal[e[t].code]=!0},e.prototype.recordData=function(e,t,i){var r=e.code,n=this.results[r]||[];if(n.push(i),n.length>=5){var o=n.includes(!1);this.preIsNormal[r]&&!o&&(this.uploadEventData(e),this.re.actionListener("exceptionUpdate",this.streamId,e)),!this.preIsNormal[r]&&o&&(this.uploadEventData(t),this.re.actionListener("exceptionUpdate",this.streamId,t)),this.preIsNormal[r]=o,n=[]}this.results[r]=n},e.prototype.uploadEventData=function(e){var t=this.re.reporter.createSpan(F.I,{key:this.parentEvent,par:this.streamId},{key:""},"/rtc/exception_update");t.setAttributes({code:nn(e.code),message:on(e.message)}),t.end()},e.prototype.checkRemoteStats=function(e,t){this.recordData(Uu.A_VOLUME,qu.A_VOLUME,this.recvAudioVolume(e)),this.recordData(Uu.A_DECODE,qu.A_DECODE,this.recvAudioDecode(e)),this.recordData(Uu.V_DECODE,qu.V_DECODE,this.recvVideoDecode(e)),this.recordData(Uu.V_DECODED_FPS,qu.V_DECODED_FPS,this.recvVideoDecodedFrameRate(e)),this.recordData(Uu.RENDER_VIDEO_FPS,qu.RENDER_VIDEO_FPS,this.renderVideoFrameRate(e,t))},e.prototype.checkLocalStats=function(e){this.recordData(Lu.FPS,Bu.FPS,this.captureVideoFrameRate(e)),this.recordData(xu.FPS,zu.FPS,this.sendVideoFrameRate(e)),this.recordData(Lu.VOLUME,Bu.VOLUME,this.sendAudioVolume(e)),this.recordData(xu.V_BITRATE,zu.V_BITRATE,this.sendVideoBitrate(e)),this.recordData(xu.A_BITRATE,zu.A_BITRATE,this.sendAudioBitrate(e))},e.prototype.sendVideoBitrate=function(e){return!("1"===e.videoMuteState||e.videoQuality>2)&&0===e.videoBitrate},e.prototype.sendVideoFrameRate=function(e){var t=e.videoTransferFPS,i=e.videoFPS;return"1"!==e.videoMuteState&&(i>=10&&t<5||i<10&&i>=5&&t<=1)},e.prototype.captureVideoFrameRate=function(e){var t=e.videoTargetFPS,i=e.videoFPS;return"1"!==e.videoMuteState&&(t>=10&&i<5||t<10&&t>=5&&i<=1)},e.prototype.sendAudioVolume=function(e){return"1"!==e.audioMuteState&&Math.floor(32767*e.audioLevel)<Math.floor(327.67)},e.prototype.sendAudioBitrate=function(e){var t=e.audioBitrate;return!("1"===e.audioMuteState||e.audioQuality>2)&&(0===t||e.audioTargetBitrate>=48&&t<22)},e.prototype.recvAudioVolume=function(e){return!("1"===e.audioMuteState||e.audioQuality>2)&&e.audioBitrate>0&&Math.floor(32767*e.audioLevel)<Math.floor(327.67)},e.prototype.recvAudioDecode=function(e){return!("1"===e.audioMuteState||e.audioQuality>2)&&e.audioBitrate>0&&0===e.audioFPS},e.prototype.recvVideoDecode=function(e){return!("1"===e.videoMuteState||e.videoQuality>2)&&e.videoBitrate>0&&0===e.videoTransferFPS},e.prototype.recvVideoDecodedFrameRate=function(e){var t=e.videoFPS,i=e.videoTransferFPS;return"1"!==e.videoMuteState&&(t>=10&&i<5||t<10&&t>=5&&i<=1)},e.prototype.renderVideoFrameRate=function(e,t){var i=e.videoTransferFPS,r=e.videoRenderFPS;return"1"!==e.videoMuteState&&-1!=r&&(i>10&&r<5||i<=10&&i>=5&&r<=1)},e}(),Hu=function(){return Hu=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Hu.apply(this,arguments)},Fu=function(){function e(e,t,i,r,n,o,s){this._qualityUpdateInterval=e,this._qualityUploadInterval=t,this.qe=i,this.Xn=r,this.$n=n,this.re=o,this.ee=s,this.qualityTimer=null,this.qualityUpdateTimer=null,this.qualityUploadTimer=null,this.lastPublishStats={},this.netQuality=0,this.poorQualityNum=0,this.probeState=a.probed,this.publishStat={},this.currentQuality={video:{videoBitrate:0,videoFPS:0,videoTransferFPS:0,frameHeight:0,frameWidth:0,muteState:"1",videoQuality:-1,videoPacketsLost:0,videoPacketsLostRate:0,googCodecName:""},audio:{audioBitrate:0,audioCodec:"",muteState:"1",audioQuality:-1,audioFPS:0,audioPacketsLost:0,audioPacketsLostRate:0,googCodecName:""}},this.qualityUploadLastTime=0,this.qualitySeq=0,this.timerType=0,this.webrtcProtocol="udp",this.candidateStats={},this._videoCodecName="",this._audioCodecName="";var c=Math.min(e,t);this.qualitySampleInterval=c>1e3?c:1e3,this.getTimerType(),this.exception=new Xu(this.re,this.Xn,this.streamId,li.event)}return Object.defineProperty(e.prototype,"streamId",{get:function(){return this.qe.streamId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this.qe.sessionId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"peerID",{get:function(){return this.qe.peerID},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Be",{get:function(){return this.qe.localStream},enumerable:!1,configurable:!0}),e.prototype.getTimerType=function(){this._qualityUpdateInterval===this._qualityUploadInterval?this.timerType=0:this.qualitySampleInterval===this._qualityUpdateInterval?this.timerType=1:this.qualitySampleInterval===this._qualityUploadInterval&&(this.timerType=2),this.Xn.info("zc.p.0.qgtt "+this.streamId+" timer type "+this.timerType+" "+this.qualitySampleInterval+" "+this._qualityUpdateInterval+" "+this._qualityUploadInterval)},e.prototype.setPublishQualityTimer=function(){var e=this;null==this.qualityTimer&&(this.Xn.info(_s+" "+this.streamId+" called "+this.qualitySampleInterval),this.clearPublishQualityTimer(),this.qualityTimer=setInterval((function(){e._peerConnectionGetStats()}),this.qualitySampleInterval),this.lastPublishStats={audioPacketsLost:0,videoPacketsLost:0,videoPacketsSent:0,audioPacketsSent:0,audioRetransmittedPacketsSent:0,videoTime:Date.now(),audioTime:Date.now(),time:Date.now(),audioBytesSent:0,videoBytesSent:0,framesEncoded:0,framesSent:0,videoRetransmittedPacketsSent:0,videoRetransmittedBytesSent:0,videoActualBytesSent:0,qpSum:0},this.qualitySeq=(0,o.getSeq)())},e.prototype.clearPublishQualityTimer=function(){this.clearPublishQualityUpdateTimer(),this.clearPublishQualityUploadTimer(),null!=this.qualityTimer&&(clearInterval(this.qualityTimer),this.qualityTimer=null),this.lastPublishStats={},this.poorQualityNum=0,this.qualityUploadLastTime=0},e.prototype._getConnectionStatsPromiseList=function(){var e=this,t=[];return this.qe.peerConnection?(this.qe.peerConnection.getSenders().filter((function(t){var i;return t.track&&("audio"===t.track.kind||!(null===(i=e.qe.lowStream)||void 0===i?void 0:i.getTracks().includes(t.track)))})).forEach((function(i){e.qe.peerConnection&&t.push(e.qe.peerConnection.getStats(i.track))})),t):t},e.prototype._peerConnectionGetStats=function(){var e=this;if(this.qe.peerConnection){var t=this._getConnectionStatsPromiseList();Promise.all(t).then((function(t){0!==t.length&&e.qualityTimer&&e._getPublishStats(t.filter((function(e){return e instanceof RTCStatsReport})),t[t.length-1]instanceof RTCStatsReport?null:t[t.length-1])})).catch((function(t){e.Xn.info(_s+" "+e.streamId+" getStats error "+t.toString())}))}},e.prototype._getPublishStats=function(e,t){var i,r,n,o=this;if(e){var s,a,c=this.ee.checkPreview(this.Be),u=c&&c.rtcViewer;u&&(s=u._video,a=u._audio),s&&s.currentTime||(s=So(this.Be,"video")||s),a&&a.currentTime||(a=So(this.Be,"audio")||a||s);var l=[],d="",h={scenario:this.re.scenario,sampleTimeWindow:this._qualityUploadInterval,audioCodec:"",audioTargetBitrate:this.qe.videoInfo.audioBitrate/1e3||0,audioBitrate:0,videoTargetBitrate:this.qe.videoInfo.bitRate||0,videoTargetFPS:this.qe.videoInfo.frameRate||0,videoBitrate:0,audioFPS:0,audioLevel:0,audioPacketsLost:0,totalAudioEnergy:0,totalSamplesDuration:0,echoReturnLossEnhancement:void 0,audioPacketsLostRate:0,videoFPS:0,nackCount:0,pliCount:0,audioQuality:0,videoQuality:0,frameHeight:0,frameWidth:0,videoTransferFPS:0,videoPacketsLost:0,videoPacketsLostRate:0,totalRoundTripTime:0,currentRoundTripTime:0,availableOutgoingBitrate:void 0,inputWidth:void 0,inputHeight:void 0,inputFPS:void 0,qualityLimitationReason:"",targetBitrate:void 0,retransmitBitrate:void 0,actualEncBitrate:void 0,frameQp:void 0,videoCodecName:void 0,videoMuteState:(null===(i=null==c?void 0:c.videoTrack)||void 0===i?void 0:i.enabled)?"0":"1",audioMuteState:this.Be.getAudioTracks().length>0&&this.Be.getAudioTracks()[0].enabled?"0":"1",soundLevel:null==c?void 0:c.soundLevel,muted:a?a.muted:void 0,audioPaused:a?a.paused:void 0,videoPaused:s?s.paused:void 0,volume:a?a.volume:void 0,sinkId:a?a.sinkId:void 0},p=this.lastPublishStats.time,f=0,m=0,v=0,g=0,y=0,b=0;if(e.forEach((function(e){var t=!1;e.forEach((function(e){"track"==e.type&&(t=!0)})),e.forEach((function(i){var r=i.kind||i.mediaType;if(("outbound-rtp"==i.type||"ssrc"==i.type&&null!=i.bytesSent)&&"audio"==r){var n="";(s=e.get(i.codecId))&&s.mimeType&&(n=s.mimeType.split("/")[1]),o._audioCodecName!==n&&(o._audioCodecName=n),h.audioCodec=o._audioCodecName,0!=p&&(h.audioBitrate=8*(i.bytesSent-o.lastPublishStats.audioBytesSent)/(i.timestamp-p),i.retransmittedPacketsSent=i.retransmittedPacketsSent||0,i.packetsSent=i.packetsSent||0,h.audioFPS=(i.packetsSent-(i.retransmittedPacketsSent-o.lastPublishStats.audioRetransmittedPacketsSent)-o.lastPublishStats.audioPacketsSent)/(i.timestamp-p)*1e3||0,v=(i.retransmittedPacketsSent-o.lastPublishStats.audioRetransmittedPacketsSent)/(i.packetsSent-o.lastPublishStats.audioPacketsSent)),h.audioBitrate<0&&(h.audioBitrate=0),o.lastPublishStats.audioBytesSent=i.bytesSent,o.lastPublishStats.time=i.timestamp,o.lastPublishStats.audioPacketsSentTimeStamp=i.packetsSent-o.lastPublishStats.audioPacketsSent,o.lastPublishStats.audioPacketsSent=i.packetsSent,o.lastPublishStats.audioRetransmittedPacketsSent=i.retransmittedPacketsSent}else if(("outbound-rtp"==i.type||"ssrc"==i.type&&null!=i.bytesSent)&&"video"==r){var s,a="";(s=e.get(i.codecId))&&s.mimeType&&(a=s.mimeType.split("/")[1]),o._videoCodecName!==a&&(o._videoCodecName=a),h.videoCodecName=o._videoCodecName,h.isHardwareEncode=function(e){if(e){var t=null==e?void 0:e.toLocaleLowerCase();if("unknown"!==t)return"openh264"!==t&&"libvpx"!==t}}(i.encoderImplementation),h.codecImplementationName=i.encoderImplementation;var c=0;if(void 0!==i.retransmittedBytesSent&&(c=i.bytesSent-i.retransmittedBytesSent),0!=p){var u=i.timestamp-p;h.videoBitrate=8*(i.bytesSent-o.lastPublishStats.videoBytesSent)/u,h.videoFPS=1e3*(i.framesEncoded-o.lastPublishStats.framesEncoded)/u,g=(i.retransmittedPacketsSent-o.lastPublishStats.videoRetransmittedPacketsSent)/(i.packetsSent-o.lastPublishStats.videoPacketsSent),void 0!==i.retransmittedBytesSent&&(h.retransmitBitrate=8*(i.retransmittedBytesSent-o.lastPublishStats.videoRetransmittedBytesSent)/u,h.actualEncBitrate=8*(c-o.lastPublishStats.videoActualBytesSent)/u),void 0!==i.qpSum&&(h.frameQp=(i.qpSum-o.lastPublishStats.qpSum)/(i.framesEncoded-o.lastPublishStats.framesEncoded))}h.videoBitrate<0&&(h.videoBitrate=0),h.videoFPS<0&&(h.videoFPS=0),h.nackCount=i.nackCount,h.pliCount=i.pliCount,h.qualityLimitationReason=i.qualityLimitationReason,h.targetBitrate=i.targetBitrate,o.lastPublishStats.videoBytesSent=i.bytesSent,o.lastPublishStats.framesEncoded=i.framesEncoded,o.lastPublishStats.time=i.timestamp,o.lastPublishStats.videoPacketsSentTimeStamp=i.packetsSent-o.lastPublishStats.videoPacketsSent,o.lastPublishStats.videoPacketsSent=i.packetsSent,o.lastPublishStats.videoRetransmittedPacketsSent=i.retransmittedPacketsSent,o.lastPublishStats.videoRetransmittedBytesSent=i.retransmittedBytesSent,o.lastPublishStats.videoActualBytesSent=c,o.lastPublishStats.qpSum=i.qpSum,t||o._vTrackStats(p,h,i)}else if("remote-inbound-rtp"==i.type&&"video"==r){i.packetsLost>0&&(h.videoPacketsLost=i.packetsLost);var _=i.packetsLost-o.lastPublishStats.videoPacketsLost;h.videoPacketsLostRate=_>0?_/o.lastPublishStats.videoPacketsSentTimeStamp:0,i.packetsLost>0&&(o.lastPublishStats.videoPacketsLost=i.packetsLost),o.lastPublishStats.videoTime=i.timestamp,m=1e3*i.roundTripTime,b=i.jitter}else if("remote-inbound-rtp"==i.type&&"audio"==r){i.packetsLost>0&&(h.audioPacketsLost=i.packetsLost);var S=i.packetsLost-o.lastPublishStats.audioPacketsLost;h.audioPacketsLostRate=S>0?S/o.lastPublishStats.audioPacketsSentTimeStamp:0,i.packetsLost>0&&(o.lastPublishStats.audioPacketsLost=i.packetsLost),o.lastPublishStats.audioTime=i.timestamp,f=1e3*i.roundTripTime,y=i.jitter}else"media-source"==i.type&&("audio"==r||i.id.toLowerCase().indexOf("audio")>=0)?(h.audioLevel=i.audioLevel||0,h.totalAudioEnergy=i.totalAudioEnergy,h.totalSamplesDuration=i.totalSamplesDuration,h.echoReturnLossEnhancement=i.echoReturnLossEnhancement):"media-source"==i.type&&("video"==r||i.id.toLowerCase().indexOf("video")>=0)?(h.inputWidth=i.width,h.inputHeight=i.height,h.inputFPS=i.framesPerSecond):"track"==i.type&&("video"==r||i.id.indexOf("video")>=0||i.frameWidth)?o._vTrackStats(p,h,i):"candidate-pair"==i.type?(null!=i.totalRoundTripTime&&(h.totalRoundTripTime=i.totalRoundTripTime),null!=i.currentRoundTripTime&&(h.currentRoundTripTime=i.currentRoundTripTime),void 0!==i.availableOutgoingBitrate&&(h.availableOutgoingBitrate=i.availableOutgoingBitrate),"succeeded"===i.state&&(d=i.localCandidateId)):"local-candidate"===i.type&&l.push(i)}))})),d){var S=l.find((function(e){return e.id==d}));if(S){var T=void 0;if(void 0!==S.relayProtocol)T=S.relayProtocol;else if(S.priority){var E=S.priority>>24;void 0!==E&&(T=_o(E,this.re.browser))}void 0!==T&&this.webrtcProtocol!==T&&(this.Xn.info(_s+" "+this.streamId+" pro "+T),this.webrtcProtocol=T)}var C=!1,w=S.candidateType,I=S.relayProtocol,R=S.relatedAddress,k=S.url;C=this.Ge([{key:"candidateType",value:w},{key:"networkType",value:S.networkType}]),"relay"===w&&(C=this.Ge([{key:"relayProtocol",value:I},{key:"relatedAddress",value:R},{key:"url",value:k}])),C&&this.Xn.warn(Ts+" "+this.streamId+" upload candidate change "+JSON.stringify(this.candidateStats))}if("chrome"===this.re.browser){var P=null===(r=Re())||void 0===r?void 0:r.match(/Chrome\/(\d+)/);parseInt(P&&P[1]||"100")<=91&&h.isHardwareEncode&&this.qe.handleEncBitrate(Number.parseInt(h.targetBitrate),Number.parseInt(h.actualEncBitrate),Number.parseInt(h.retransmitBitrate))}m=isNaN(m)||m<0?0:m,g=isNaN(g)||g<0?0:g,b=isNaN(b)||b<0?0:b,f=isNaN(f)||f<0?0:f,v=isNaN(v)||v<0?0:v,y=isNaN(y)||y<0?0:y;var A=Fn(m,g,b),D=Fn(f,v,y);if(h.videoQuality=p>0?Vn(A):0,h.audioQuality=p>0?Vn(D):0,this.re.networkState!==_.offline&&"disconnected"!==(null===(n=this.qe.peerConnection)||void 0===n?void 0:n.connectionState)||(h.videoQuality=x.Die,h.audioQuality=x.Die),!h.frameHeight||!h.frameWidth){var N=this.Be.getVideoTracks()[0];N&&(h.frameHeight=N.getSettings().height||0,h.frameWidth=N.getSettings().width||0)}var O=Math.min(A,D);this.netQuality=O,this._updateCurrentQualityStats(h),this.publishStat=h,0===this.timerType?0!==p&&(this.checkProbe(),this._uploadPublishQuality(h),this.qe.onPublishQualityUpdate(this.streamId,this.currentQuality),this.exception.checkLocalStats(h),this.ee.changeTxQuality(Vn(this.netQuality),this.sessionId,this.peerID)):1===this.timerType?0!==p?this.qe.onPublishQualityUpdate(this.streamId,this.currentQuality):this.qualityTimer&&this.setPublishQualityUploadTimer():0!==p?(this.checkProbe(),this._uploadPublishQuality(h),this.exception.checkLocalStats(h),this.ee.changeTxQuality(Vn(this.netQuality),this.sessionId,this.peerID)):this.qualityTimer&&this.setPublishQualityUpdateTimer()}},e.prototype.setPublishQualityUpdateTimer=function(){var e=this;null==this.qualityUpdateTimer&&(this.Xn.info("zc.p.0.spqut.1 "+this.streamId+" called "+this._qualityUpdateInterval),this.clearPublishQualityUpdateTimer(),this.qualityUpdateTimer=setInterval((function(){e.qe.onPublishQualityUpdate(e.streamId,e.currentQuality)}),this._qualityUpdateInterval))},e.prototype.clearPublishQualityUpdateTimer=function(){this.Xn.info(Ss+" "+this.streamId+" called "+!!this.qualityUpdateTimer),null!=this.qualityUpdateTimer&&(clearInterval(this.qualityUpdateTimer),this.qualityUpdateTimer=null)},e.prototype.setPublishQualityUploadTimer=function(){var e=this;null==this.qualityUploadTimer&&(this.Xn.info("zc.p.0.spqut.2 "+this.streamId+" called "+this._qualityUploadInterval),this.qualityUploadTimer=setInterval((function(){e.checkProbe(),e._uploadPublishQuality(e.publishStat),e.exception.checkLocalStats(e.publishStat),e.ee.changeTxQuality(Vn(e.netQuality),e.sessionId,e.peerID)}),this._qualityUploadInterval))},e.prototype.clearPublishQualityUploadTimer=function(){this.Xn.info(Ss+" "+this.streamId+" called "+!!this.qualityUpdateTimer),null!=this.qualityUploadTimer&&(clearInterval(this.qualityUploadTimer),this.qualityUploadTimer=null)},e.prototype.checkProbe=function(){var e=this.netQuality,t=this.lastPublishStats.time;this.Xn.info(_s+this.streamId+" netQuality "+e+" "+t),e<=this.ee.targetQuality?this.poorQualityNum++:this.poorQualityNum=0,t>0&&this.poorQualityNum>=this.ee.probeStartedNum&&Date.now()>this.qe.probeTime+this.ee.probeInterval&&(this.Xn.info(_s+" netQuality "+e+" start net probe"),this.probeState=a.tryProbe,this.qe.poorQualityRetryCnt++,this.ee.startNetProbe(!0,this.qe,this.qe.gwNodeList))},e.prototype._vTrackStats=function(e,t,i){var r=i.frameHeight,n=i.frameWidth,o=i.framesSent,s=i.timestamp;if(t.frameHeight=r,t.frameWidth=n,0===e||this.lastPublishStats.frameHeight===r&&this.lastPublishStats.frameWidth===n)0===e&&(this.lastPublishStats.frameHeight=r,this.lastPublishStats.frameWidth=n);else{var a=this.re.reporter.createSpan(F.H,{key:li.event,par:this.streamId},{key:""},"/sdk/api/publish_video_c_size");a.setAttributes({webrtc_sid:fi(this.sessionId),w:mi(n),h:vi(r)}),a.end(),this.lastPublishStats.frameHeight=r,this.lastPublishStats.frameWidth=n}0!=e&&(t.videoTransferFPS=1e3*(o-this.lastPublishStats.framesSent)/(s-e)),t.videoTransferFPS<0&&(t.videoTransferFPS=0),this.lastPublishStats.framesSent=o},e.prototype._updateCurrentQualityStats=function(e){var t=e.videoBitrate,i=e.videoFPS,r=e.videoTransferFPS,n=e.frameHeight,o=e.frameWidth,s=e.videoMuteState,a=e.videoQuality,c=e.isHardwareEncode,u=e.audioBitrate,l=e.audioCodec,d=e.audioMuteState,h=e.audioQuality,p=e.audioFPS,f={video:Hu(Hu({},this.currentQuality.video),{videoBitrate:t,videoFPS:i,videoTransferFPS:r,frameHeight:n,frameWidth:o,muteState:s,videoQuality:a,isHardwareEncode:c}),audio:Hu(Hu({},this.currentQuality.audio),{audioBitrate:u,audioCodec:l,muteState:d,audioQuality:h,audioFPS:p}),nackCount:e.nackCount,pliCount:e.pliCount,totalRoundTripTime:e.totalRoundTripTime,currentRoundTripTime:e.currentRoundTripTime};if(void 0!==e.qualityLimitationReason&&(f.qualityLimitationReason=e.qualityLimitationReason),void 0!==e.videoPacketsLost){var m=e.videoPacketsLostRate;f.video.videoPacketsLost=e.videoPacketsLost,f.video.videoPacketsLostRate=m}if(void 0!==e.audioPacketsLost){var v=e.audioPacketsLostRate;f.audio.audioPacketsLost=e.audioPacketsLost,f.audio.audioPacketsLostRate=v}void 0!==e.codecImplementationName&&(f.codecImplementationName=e.codecImplementationName),void 0!==e.videoCodecName&&(f.video.googCodecName=e.videoCodecName),""!==e.audioCodec&&(f.audio.googCodecName=e.audioCodec),this.currentQuality=f},e.prototype._uploadPublishQuality=function(e){if(this.qe.signal.isServerConnected){var t=Date.now();(0==this.qualityUploadLastTime||t-this.qualityUploadLastTime>=2e3)&&(e.stream_type="publish",e.stream_id=this.streamId,e.timeStamp=t,this.Xn.info(Ts+" "+this.streamId+" upload"+JSON.stringify(e)),this.Be&&this.Xn.info(Ts+" "+Wn(this.Be)),this.ee.updateQuality(I.publish_quality,e),this.qualityUploadLastTime=t)}},e.prototype.Ge=function(e){for(var t=!1,i=0;i<e.length;i++){var r=e[i],n=r.key,o=r.value;this.candidateStats[n]!==o&&(this.candidateStats[n]=o,t=!0)}return t},e}(),Vu=function(){return Vu=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Vu.apply(this,arguments)},Gu=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},ju=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Qu=new Uint8Array([0,0,0,1,101,184,0,4,0,0,9,255,254,222,35,192,166,30,73,128]),Wu=new Uint8Array([0,0,0,1,103,77,64,51,140,141,78,64,60,34,17,168,0,0,0,1,104,238,60,128]),Zu=li,Ku=pi,Ju=di,Yu=Zu.error,$u=_i,el=function(){function e(e,t,i,r,n,s,a,c){var u,l=this;this.curCBState={state:"NO_PUBLISH",code:0},this.isProbeDispatch=!1,this.supportTransceiver=!0,this.useTransceiver=!1,this.te=!1,this.publishedTimeStamp=0,this.firstPublishedTimeStamp=0,this.validPublishedTime=0,this.errorTimes=0,this.hasSucceed=!1,this.lastFailTimeLen=0,this._state=7,this.lastState=7,this.sessionId=0,this.sessionToken="",this.candidateInfo=[],this.qualityUpdateInterval=3e3,this.publishQualityList=[],this.maxQualityListCount=10,this.canvasTimer=null,this.canvas=null,this.ctx=null,this.canvasImage=null,this.reportSeq=NaN,this.parentSpanKey="",this.streamReportSeq=(0,o.getSeq)(),this.videoInfo={width:0,height:0,frameRate:0,bitRate:0,minBitrate:0,keyFrameInterval:2,channelCount:1,audioBitrate:48e3},this.mediaStreamConfig=null,this.offerSeq=0,this.peerConnection=null,this.qualityCount=0,this.closeSessionSignal=!1,this.channelCount=1,this.localSdpOrder=[],this.remoteSdpOrder=[],this.videoCodec="H264",this.stateNego=L.stop,this.isExternal=!1,this.negoInterval=25e3,this.publishEvent=!1,this.cameraState="on",this.microState="on",this.gwNode="",this.gwNodeList=[],this.gwNodesTTL=0,this.retryFailGwNodes=[],this.dispatchedGwNodes=[],this.needIncMax=!1,this.probeCount=0,this.gotMax=!1,this.initFitCnt=0,this.targetRate=0,this.totalBitrateArray=[],this.totalTargetRateArray=[],this.totalRetransRateArray=[],this.isPeer=!0,this.peerFailCount=0,this.peerID=0,this.probeQuality=0,this.probeTime=0,this.probeNodeList=[],this.probedList=[],this.probeTimer=null,this.probeIpCnt=0,this.validProbeIpCnt=0,this.poorQualityRetryCnt=0,this.probeNotRetryInfos=[],this.continuousFailCnt=0,this.iceDisconnectedMaxTime=15e3,this.isUpdateSDP=!1,this.isUdpSuccess=!1,this.toBeReplacedTracks={},this.send_seq=0,this.dataChannelState=0,this.first_pkt=!0,this.next_sn=[],this.pkt_list=[],this.answerSdpTime=0,this.streamConnectIP="",this.mediaSideInfos=[],this.lowMediaSideInfos=[],this.mixConfig={forceSynchronousNetworkTime:0,alignment:0},this.sideMediaConfig={isSEIStart:!1,SEIType:B.ZegoDefined,unregisterSeiFilter:"",uuidSend:!1,track:null},this.reportBeginTime=0,this.reportPublishingTime=0,this.reportPublishStateTime=0,this.isRePublish=!1,this.cachedGwNodesMode=Nd.TheSameReUse,this.rtcPublishCount=0,this.stopReason="",this.signalTime=0,this.pushCmdSeqMap=((u={}).MediaDescPush={seq:-1,time:0},u.MediaDescUpdatePush={seq:-1,time:0},u.PublishEventPush={seq:-1,time:0},u.ClientInfoPush={seq:-1,time:0},u.CandidateInfoPush={seq:-1,time:0},u),this._autoTcp=!0,this._turnToTcp=!1,this.proxyVrs={lanIP:"",wanIP:"",intranet:!1},this.encodeLowVideoFrame=function(e,t){l.encodeFrame(e,t,!0)},this.encodeVideoFrame=function(e,t){l.sideMediaConfig.track?l.encodeFrameAudioOnly(e,t,!1):l.encodeFrame(e,t,!1)},this.recvLastKeyFrameTime=0,this.camera_status=2,this.mic_status=2,this.streamId=e,this.Xn=t,this.dataReport=i,this.qualityTimeInterval=r,this.ee=s,this.re=a,this.videoCodec=this.Fe("publish_video_codec"),this.previewer=c,this.localStream=c.localStream,this.zegoCaptureStream=c.zegoCaptureStream,this.te=this.re.isMiniSdp,this.zegoCaptureStream&&this.zegoCaptureStream.startPublish(),c.onAudioTrackChange=function(e){var t=l.peerConnection&&l.peerConnection.getSenders().find((function(t){var i;return(null===(i=t.track)||void 0===i?void 0:i.kind)===e.kind}));t?(t.replaceTrack(e),l.Xn.info("zc.oatc remote audio track change success")):l.Xn.warn("zc.oatc stream has not sender")},this.initStreamReport(),this.qualityHandler=new Fu(this.qualityTimeInterval,n,this,this.Xn,this.dataReport,this.re,this.ee)}return e.prototype.updateCBState=function(e){var t=this,i=Object.keys(e).some((function(i){return e[i]!==t.curCBState[i]}));return i&&(this.curCBState=e),i},Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(e){this.lastState=this._state,this._state=e},enumerable:!1,configurable:!0}),e.prototype.createSEIWorker=function(){return this.ee.createSEIWorker()},Object.defineProperty(e.prototype,"seiWorker",{get:function(){return this.ee.seiWorker},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"publishStat",{get:function(){return this.qualityHandler.publishStat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"probeState",{get:function(){return this.qualityHandler.probeState},set:function(e){this.qualityHandler.probeState=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"netQuality",{get:function(){return this.qualityHandler.netQuality},set:function(e){this.qualityHandler.netQuality=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastPublishStats",{get:function(){return this.qualityHandler.lastPublishStats},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ve",{get:function(){return this.re.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"webrtcProtocol",{get:function(){return this.qualityHandler.webrtcProtocol},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lowStream",{get:function(){var e;return null===(e=this.previewer)||void 0===e?void 0:e.lowStream},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"iceStateDisConnect",{get:function(){return[L.iceClosed,L.iceDisconnected,L.iceFailed].includes(this.stateNego)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isLastConnected",{get:function(){return 6===this.lastState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"netProtocol",{get:function(){return this._turnToTcp?"tcp":this._autoTcp?this.webrtcProtocol:"udp"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ip",{get:function(){var e,t;return null===(t=null===(e=this.gwNode)||void 0===e?void 0:e.split(":"))||void 0===t?void 0:t[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"He",{get:function(){return this.re.useNetAgent},enumerable:!1,configurable:!0}),e.prototype.Fe=function(e,t){return void 0===t&&(t=!1),this.re.settingConfig.getSetting(e,t)},Object.defineProperty(e.prototype,"Le",{get:function(){return 6===this.state},enumerable:!1,configurable:!0}),e.prototype.initStreamReport=function(){this.reportSpan=this.ve.createSpan(F.I,{key:li.event,par:this.streamId},{key:Ku.event,par:this.streamId},Ku.event,!0),this.reportBeginTime=(new Date).getTime()},e.prototype.checkAutoTcp=function(){var e=jn();this.Xn.info("zc.p.0.cat ".concat(this.He," ").concat(e," ").concat(this.isPeer)),this._autoTcp=!!(this.He&&e&&this.isPeer)},e.prototype.publishStateUpdateError=function(e,t,i,r){this.Xn.error(Is+" call ",this.streamId+" "+JSON.stringify(e));var n=this.ve.createSpan(F.H,{key:li.event,par:this.streamId},{key:""},"/rtc/publish_stream_state_error");n.setAttributes({error:null==e?void 0:e.code,message:null==e?void 0:e.message}),n.end(),this.streamId&&this.onPublishStateUpdate(1,this.streamId,e,t,i,r),this.Xn.info(Is+" ended")},e.prototype.netProbeToReDispatch=function(e,t){var i;void 0===e&&(e=function(){}),void 0===t&&(t=function(){}),this.isProbeDispatch=!0;var r=null===(i=this.ee.publisherList[this.streamId])||void 0===i?void 0:i.retryStreamHandler;r&&r.dispatchGwNodesBypass(this,e,t)},e.prototype.resetPublish=function(){this.Xn.info("zc.p.0.rp "+this.streamId+" call"),this.state=7,this.publishEvent=!1,null==this.peerConnection&&null==this.peerConnection||(this.peerConnection.close(),this.peerConnection=null),this.localDesc&&(this.localDesc=null),null!=this.negoTimer&&(clearTimeout(this.negoTimer),this.negoTimer=null),null!=this.iceDisconnectedTimer&&(clearTimeout(this.iceDisconnectedTimer),this.iceDisconnectedTimer=null),this.qualityHandler.clearPublishQualityTimer(),this._clearCanvasTimer(),this.signal&&(this.signal.unregisterPushCallback("CandidateInfoPush",this.sessionId),this.signal.unregisterPushCallback("MediaDescPush",this.sessionId),this.signal.unregisterPushCallback("CloseSessionPush",this.sessionId),this.signal.unregisterPushCallback("SessionResetPush",this.sessionId),this.signal.unregisterPushCallback("PublishEventPush",this.sessionId),this.signal.unregisterPushCallback("ClientInfoPush",this.sessionId),this.signal.unregisterPushCallback("MediaDescUpdatePush",this.sessionId)),this.sessionSeq=0,this.offerSeq=0,this.candidateInfo=[],this.publishQualityList=[],this.resetEncBitrate(),this.isUpdateSDP=!1},e.prototype._clearCanvasTimer=function(){null!=this.canvasTimer&&(clearInterval(this.canvasTimer),this.sideMediaConfig.track=null,this.canvasTimer=null,this.canvas=null,this.ctx=null,this.canvasImage=null)},e.prototype.shouldSendCloseSession=function(){return 7!=this.state&&1!=this.state},e.prototype.resetPushCmdSeqMap=function(){var e;this.pushCmdSeqMap=((e={}).MediaDescPush={seq:-1,time:0},e.MediaDescUpdatePush={seq:-1,time:0},e.PublishEventPush={seq:-1,time:0},e.ClientInfoPush={seq:-1,time:0},e.CandidateInfoPush={seq:-1,time:0},e)},e.prototype.startPublish=function(e,t,i,r,n){var o,s,a,c,u,l,d,h,p,f,m,v,g,y=this;if(this.Xn.info(cs+" "+e+" called"),this.signal&&this.signal.negoInterval&&(this.negoInterval=this.signal.negoInterval),e){if(this.checkAutoTcp(),this.state=0,this.localStream=t,this.mediaStreamConfig=r,this.channelCount=r.channelCount,this.publishOption=n||{},dn(this.publishOption.enableDTX)){var b=this.Fe("dtx",!0);this.publishOption.enableDTX=void 0!==b?!!b:this.publishOption.enableDTX}else this.publishOption.enableDTX=!!this.Fe("dtx");var _;(null==n?void 0:n.SEIType)&&(this.sideMediaConfig.SEIType=n.SEIType),this.qualityHandler.currentQuality.video.muteState=(null===(s=null===(o=this.previewer)||void 0===o?void 0:o.videoTrack)||void 0===s?void 0:s.enabled)?"0":"1",this.qualityHandler.currentQuality.audio.muteState=this.localStream.getAudioTracks().length>0&&this.localStream.getAudioTracks()[0].enabled?"0":"1",De()&&r&&(r.externalCapture||r.externalMediaStream)&&(this.localStream.onaddtrack=function(){var e,i,r,n;y.Xn.info(cs+" "+y.streamId+" Track added"),t&&t.getTracks().forEach((function(e){Zn(e,y.Xn,cs)}));var o=[];(null===(e=y.previewer)||void 0===e?void 0:e.videoTrack)&&o.push(null===(i=y.previewer)||void 0===i?void 0:i.videoTrack);var s=y.localStream.getAudioTracks();if(o.length>1){var a=null===(r=y.peerConnection)||void 0===r?void 0:r.getSenders().find((function(e){var t;return(null===(t=e.track)||void 0===t?void 0:t.id)===y.localStream.getVideoTracks()[0].id}));null==a||a.replaceTrack(o[1]),y.localStream.removeTrack(o[0])}else s.length>1&&(a=null===(n=y.peerConnection)||void 0===n?void 0:n.getSenders().find((function(e){var t;return(null===(t=e.track)||void 0===t?void 0:t.kind)===s[1].kind})),null==a||a.replaceTrack(s[1]),y.localStream.removeTrack(s[0]))}),i&&(this.videoInfo=i),n&&n.videoCodec&&(this.videoCodec=n.videoCodec);var S=null===(a=this.previewer)||void 0===a?void 0:a.videoPreviewType;switch(S){case"camera":_=this.Fe("camera_video_bitrate",!0);break;case"screen":_=this.Fe("screen_video_bitrate",!0);break;case"custom":_=this.Fe("custom_video_bitrate",!0)}void 0!==_&&(this.Xn.info(cs+" setting "+S+" "+_),this.videoInfo.bitRate=_);var T=this.Fe("bitrate_mode",!0);T&&(this.Xn.info(cs+" setting bitrate_mode "+T),this.videoInfo.startBitrate=T);var E=this.Fe("publish_video_codec",!0);if(E&&(this.Xn.info(cs+" setting publish_video_codec "+E),this.videoCodec=E),n&&dn(n.isSEIStart)&&(this.sideMediaConfig.isSEIStart=null==n?void 0:n.isSEIStart),this.sideMediaConfig.isSEIStart){var C=Gn();"H264"===this.videoCodec&&C||(this.Xn.warn(cs+" not use sei; support: ".concat(C,", codec: ").concat(this.videoCodec," ")),this.sideMediaConfig.isSEIStart=!1)}(null===(c=this.re.seiConfig)||void 0===c?void 0:c.unregisterSEIFilter)&&(this.sideMediaConfig.unregisterSeiFilter=null===(u=this.re.seiConfig)||void 0===u?void 0:u.unregisterSEIFilter),[0,1].includes(null==n?void 0:n.forceSynchronousNetworkTime)&&(this.mixConfig.forceSynchronousNetworkTime=null==n?void 0:n.forceSynchronousNetworkTime),this.ve.spanSetAttributes({key:Zu.event,par:this.streamId},{video_en_codec_id:Zu.video_en_codec_id("VP8"==this.videoCodec?2:0),audio_c_channel_count:Zu.audio_c_channel_count(2==this.channelCount?2:1),audio_en_bps:Zu.audio_en_bps(this.videoInfo.audioBitrate),aec_level:Zu.aec_level(1==r.AEC?2:0==r.AEC?0:2),ans_level:Zu.ans_level(1==r.ANS?2:0==r.ANS?0:2),agc:Zu.agc(1==r.AGC||0!=r.AGC),video_activate:Zu.video_activate(!!(null===(d=null===(l=this.previewer)||void 0===l?void 0:l.videoTrack)||void 0===d?void 0:d.enabled)),audio_activate:Zu.audio_activate(!!(null===(p=null===(h=this.previewer)||void 0===h?void 0:h.audioTrack)||void 0===p?void 0:p.enabled)),scenario:this.re.scenario}),this.reportSpan.setAttributes({room_id:Ku.room_id(null===(m=null===(f=this.ee.publisherList[this.streamId])||void 0===f?void 0:f.room)||void 0===m?void 0:m.roomID),room_sid_string:Ku.room_sid_string(null===(g=null===(v=this.ee.publisherList[this.streamId])||void 0===v?void 0:v.room)||void 0===g?void 0:g.roomSessionID),max_retry_interval:Ku.max_retry_interval(this.re.streamRetryTime),scenario:this.re.scenario,use_resource_type:Ku.use_resource_type(["rtc"])}),this.isPeer?this._createOffer({encodedInsertableStreams:this.sideMediaConfig.isSEIStart}):this.Je(),null!=this.negoTimer&&(clearTimeout(this.negoTimer),this.negoTimer=null),this.negoTimer=setTimeout((function(){y.Xn.error(cs+" waiting timeout"),y.publishStateUpdateError(Yu.Yi)}),this.negoInterval)}else this.Xn.error(cs+" "+e+" streamId is null")},e.prototype.activateSEIInsert=function(e,t){return new we((function(e,t){e(!1)}))},e.prototype.Je=function(e,t){var i,r,n,s=this;this.sessionSeq=(0,o.getSeq)();var a=this.streamId;1==this.ee.testEnvironment&&(a="zegotest-"+this.ee.appid+"-"+this.streamId),this.ee.gwNode&&(this.gwNode=this.ee.gwNode);var c=this.Fe("gw_nodes");c&&mn(c)&&c.length>0&&(this.Xn.info(cs+" setting "+JSON.stringify(c)),this.gwNodeList=c,this.gwNode=this.gwNodeList[0]||this.gwNode),this.setTurnTcp();var u=this.Fe("udp_or_tcp",!0);u&&(this.Xn.info(cs+" setting udp_or_tcp "+u),this._turnToTcp="tcp"===u),this._turnToTcp&&(this.isPeer=!1,this._autoTcp=!1);var l=(null===(r=null===(i=this.ee.publisherList[this.streamId])||void 0===i?void 0:i.room)||void 0===r?void 0:r.roomID)||(null===(n=this.re.roomList[0])||void 0===n?void 0:n.roomID),d=this.getSessionParams(l),h=d.params,p=d.paramsExt;this.paramsExt=p;var f=Sr;if(this.isPeer){var m=(new Date).getTime(),v=this.getSpan(Sr.event,this.parentSpanKey);this.signal.createSessionWithSdp({seq:this.sessionSeq,type:0,mode:0,streamId:a,videoInfo:this.videoInfo,strAuthParam:this.publishOption&&this.publishOption.streamParams||"",sdp:t||e.sdp,serverHost:this.gwNode,params:h,paramsExt:p,roomID:l,geo:{type:this.ee.geo.type,areaList:this.ee.geo.areaList},player:this},(function(e,t,i){return Gu(s,void 0,void 0,(function(){var r;return ju(this,(function(n){return r=(new Date).getTime(),this.Xn.info(cs+" create session time "+(r-m)),v.setAttributes({webrtc_sid:t,sdp:f.sdp(i.sdp),is_mini:f.is_mini(this.te),gw_nodes:f.gw_nodes(i.gw_nodes),gw_nodes_ttl:f.gw_nodes(i.gw_nodes_ttl),gw_version:f.gw_version(i.gw_version)}),v.end(),this.ve.spanSetAttributes({key:Zu.event,par:this.streamId},{gw_version:Zu.gw_version(i.gw_version)}),this.stateNego!==L.iceConnected&&this.getSpan(wr,this.parentSpanKey,"",!0),this._handleCreateSessionWithSdpResp(e,t,i),[2]}))}))}),(function(e,t){var i;if(s.sessionSeq==t){var r=1==e?Yu.tn:Yu.nn;s.Xn.info(cs+" ".concat(s.streamId," create session fail. signal: ").concat(s.signal.state,"; ws: ").concat(null===(i=s.signal.websocket)||void 0===i?void 0:i.readyState," ")),v.setAttributes({try_cnt:s.peerFailCount}),s.ve.setError(v,r),s.publishStateUpdateError(r)}else s.Xn.warn(cs+" seq is not match.")}))}else{var g=this.getSpan(Sr.event,this.parentSpanKey);this.signal.createSession(this.sessionSeq,0,0,a,this.publishOption&&this.publishOption.streamParams,this.gwNode,h,l,{type:this.ee.geo.type,areaList:this.ee.geo.areaList},(function(e,t,i){return Gu(s,void 0,void 0,(function(){return ju(this,(function(r){return g.setAttributes({webrtc_sid:f.webrtc_sid(t),gw_nodes:f.gw_nodes(i.gw_nodes),gw_nodes_ttl:f.gw_nodes(i.gw_nodes_ttl),gw_version:f.gw_version(i.gw_version)}),g.end(),this.ve.spanSetAttributes({key:Zu.event,par:this.streamId},{gw_version:Zu.gw_version(i.gw_version)}),this._handleCreateSessionResp(e,t,i),[2]}))}))}),(function(e,t){if(s.sessionSeq==t){var i=1==e?Yu.tn:Yu.nn;s.ve.setError(g,i),s.publishStateUpdateError(i)}else s.Xn.warn(cs+" seq is not match.")}))}this.state=1,this.Xn.info(cs+" "+this.streamId+" called success"),this.stateNego=L.start},e.prototype._handleCreateSessionResp=function(e,t,i){var r=i.turn_server,n=r.split("?")[0]&&r.split("?")[0].slice(5),o=this.ee.server.split("?"),s=o[1]&&o[1].slice(2),a="webrtc://".concat(n,"/").concat(s,"/").concat(this.streamId);if(this.ve.spanSetAttributes({key:this.parentSpanKey,par:this.streamId},{webrtc_sid:i.session_id,url:a}),this.Xn.info(cs+" "+this.streamId+" sessionId:"+i.session_id),this.sessionSeq==e){this.resetPushCmdSeqMap();var c=i.client_ip||i.clientip;c&&(this.re.clientIP=c);var u=0,l=(new Date).getTime();if(this.reportBeginTime&&(this.Xn.info(cs+" "+this.streamId+" create signal time "+(u=l-this.reportBeginTime)),this.signalTime=u),this.answerSdpTime=l,0!==i.result){if(this.Xn.error(cs+" "+this.streamId+" create session failed "+i.result),1021===(null==i?void 0:i.result))return void this.publishStateUpdateError($e,!0);this.publishStateUpdateError(Yu.nn)}else this.sessionId=i.session_id,this.sessionToken=i.session_token,this.Xn.info(cs+" "+this.streamId+" create session success "+this.sessionId),this.setGwNodes(i,!1),this._onCreatePublishSessionSuccess(i)}else this.Xn.error(cs+" "+this.streamId+" seq is not match.")},e.prototype._handleCreateSessionWithSdpResp=function(e,t,i){var r=this;if(this.Xn.info(cs+" sessionId:"+t),this.sessionSeq==e){this.resetPushCmdSeqMap();var n=i.client_ip||i.clientip;n&&(this.re.clientIP=n);var o=0,s=(new Date).getTime();if(this.reportBeginTime&&(this.Xn.info(cs+" "+this.streamId+" create signal time "+(o=s-this.reportBeginTime)),this.signalTime=o),this.answerSdpTime=s,0!==i.result){if(110===i.result&&(this.te=!1,this.re.te=!1),this.Xn.error(cs+" create session failed "+i.result),1021===(null==i?void 0:i.result))return void this.publishStateUpdateError($e,!0);this.publishStateUpdateError({code:Yu.nn.code,message:Yu.nn.message+" result:"+i.result})}else{this.sessionId=t,this.sessionToken=i.session_token,this.setGwNodes(i,!1),this.Xn.info(cs+" get remote session success "+this.streamId);var a=performance.now();this.signal.registerPushCallback("CloseSessionPush",this.sessionId,(function(e,t,i){if(a){var n=(performance.now()-a).toFixed(0);a=void 0,r.Xn.info(cs+" ".concat(r.streamId,", cmd: CloseSessionPush, cost_time: ").concat(n))}r.onRecvCloseSession(e,t,i)})),this.signal.registerPushCallback("SessionResetPush",this.sessionId,(function(e,t,i){r.onRecvResetSession(e,t,i)})),this.signal.registerPushCallback("PublishEventPush",this.sessionId,(function(e,t,i){if(r.Qe("PublishEventPush",e)){if(a){var n=(performance.now()-a).toFixed(0);a=void 0,r.Xn.info(cs+" ".concat(r.streamId,", cmd: PublishEventPush, cost_time: ").concat(n))}r._onRecvPublishEvent(e,t,i)}})),this.signal.registerPushCallback("ClientInfoPush",this.sessionId,(function(e,t,i){r.Qe("ClientInfoPush",e)&&r._onRecvClientInfo(e,t,i)})),this.signal.registerPushCallback("MediaDescUpdatePush",this.sessionId,(function(e,t,i){return Gu(r,void 0,void 0,(function(){return ju(this,(function(r){switch(r.label){case 0:return this.Qe("MediaDescUpdatePush",e)?[4,this._onRecvUpdateMediaDescription(e,t,i)]:[2];case 1:return r.sent(),[2]}}))}))})),this._autoTcp&&(this.Xn.info(cs+" ".concat(this.streamId,", fully auto tcp")),this.setConfiguration(i.sdp,i.params_ext),this.setLocalSdp(this.localDesc)),this.Ve(i.sdp,void 0,i.params_ext)}}else this.Xn.error(cs+" seq is not match.")},e.prototype.setCandidate=function(e){var t,i=this;if(this.Xn.info(Ds+" ".concat(this.streamId,", set candidate ").concat(JSON.stringify(e))),e){var r=e.candidate,n=e.sdpMid,o=e.sdpMLineIndex;r&&(this.Xn.info(Ds+" ".concat(this.streamId,", addIceCandidate")),null===(t=this.peerConnection)||void 0===t||t.addIceCandidate(new RTCIceCandidate({sdpMid:n,sdpMLineIndex:o,candidate:r})).then((function(){i.Xn.info(Ds+" ".concat(i.streamId,", add can suc"))})).catch((function(e){i.Xn.info(Ds+" ".concat(i.streamId,", add can fail, ").concat(e.message))})))}},e.prototype.getSessionParams=function(e){var t="",i=[],r={},n=this.re.seiConfig.SEIPass;if(dn(n)){var o=n?1:0;this.He?r.sei_filter_pass=o:i.push("zgseipass="+o)}this.He&&(r.auto_switch_turn_type="firefox"===this.re.browser?2:1),this.te&&!this.He&&i.push("sdp_fmt_type=1"),this.re.idName&&i.push("zguid="+this.re.idName),e&&i.push("zgrid="+e),this.ee.isProxy&&(this.re.useNetAgent?r.zg_proxy=1:i.push("zg_proxy=1")),1===this.mixConfig.forceSynchronousNetworkTime&&(this.He?r.sync_ntp=1:i.push("sync_ntp=1"));var s=this.publishOption.setDeviceDelayByUser;return isNaN(s)||(this.He?r.ktv_device_delay=s:i.push("ktv_device_delay="+s)),i.length>0&&(t=i.join("&")),{params:t,paramsExt:r}},e.prototype.setGwNodes=function(e,t){var i;if(this.Xn.info("zc.p.0.sgn "+this.streamId+" "+JSON.stringify(null==e?void 0:e.gw_nodes)+" "+JSON.stringify(this.retryFailGwNodes)),(null===(i=e.gw_nodes)||void 0===i?void 0:i.length)>0){var r=bo(e.gw_nodes,this.retryFailGwNodes,t);this.retryFailGwNodes=[],this.handleDispatchedGwNodes(r,e.gw_nodes_ttl)}},e.prototype.resetGwNodes=function(){this.Xn.info("zc.p.0.rgn "+this.streamId),this.gwNode="",this.gwNodeList=[],this.gwNodesTTL=0},e.prototype.handleDispatchedGwNodes=function(e,t){if(this.Xn.info("zc.p.0.hdgn "+this.streamId+" "+JSON.stringify(e)),Array.isArray(e)){this.gwNodeList=e.length>0?e:this.gwNodeList,this.gwNode=e.length>0?this.gwNodeList[0]:this.gwNode;var i=0===t?60:t;this.gwNodesTTL=i?(new Date).getTime()+1e3*i:this.gwNodesTTL,e.length>0&&this.ee.updateCachedGwNodesList(this,!0,e,i)}},e.prototype.dispatchGwNodes=function(e,t){var i,r=this.streamId;1==this.ee.testEnvironment&&(r="zegotest-"+this.ee.appid+"-"+this.streamId),null===(i=this.signal)||void 0===i||i.dispatchGwNodes((0,o.getSeq)(),0,r,{type:this.ee.geo.type,areaList:this.ee.geo.areaList},(function(t,i,r){e&&e(r)}),(function(e,i){t&&t(e)}))},e.prototype._onCreatePublishSessionSuccess=function(e){var t;return Gu(this,void 0,void 0,(function(){var i,r,n,s,a,c,u,l,d,h,p,f,m,v,g,y,b,_,S,T,E,C,w,I,R,k,P,A,D,N=this;return ju(this,(function(O){switch(O.label){case 0:return this.Xn.info((i=ls)+" "+this.streamId+" called"),r=[],this.ee.autoSwitchProtocol=this.Fe("auto_to_tcp")||!1,n=this.Fe("udp_max_fail_num"),!isNaN(n)&&(this.ee.maxUdpFailNum=n),c=(s=this.ee).maxUdpFailNum,u=s.udpFailNum,this.Xn.info(i+" autoToTcp: ".concat(a=s.autoSwitchProtocol,", udpFailNum: ").concat(u,", maxUdpFailNum: ").concat(c,".")),a&&!this._turnToTcp&&u>=c&&(this.Xn.info(i+" switch to tcp. "),this._turnToTcp=!0,this._autoTcp=!1),(l=this.Fe("udp_or_tcp",!0))&&(this.Xn.info(i+" setting udp_or_tcp "+l),this._turnToTcp="tcp"===l),d=void 0,h=this.proxyVrs.wanIP=(e.gw_nodes[0]||this.gwNode).split(":")[0],!this.ee.isProxy||this.ee.isLocalProxy?[3,2]:(p=null==o.ZegoExpressWebRTM?void 0:o.ZegoExpressWebRTM.proxyCtrl,[4,Promise.all([p.getTurnInfo(),p.intranetCheck(Pu(h),void 0)])]);case 1:return f=O.sent(),v=f[1],(m=f[0]).code?this.Xn.warn(i+" "+this.streamId+" use proxy failed."+JSON.stringify(m)):(y=(g=m.data).password,b=g.turn_ipv4,_=g.turn_port,S=g.username,(T=g.turn_internal_ipv4)&&(this.paramsExt.coturn_internal=T),E=ku(b),C="turn:".concat(E,":").concat(_,"?transport=").concat(this._turnToTcp?"tcp":"udp"),this.Xn.info(i+" turn server: ".concat(C," ; intranet: ").concat(JSON.stringify(null===(t=null==v?void 0:v.data)||void 0===t?void 0:t.intranet),"; turn internal ip: ").concat(ku(T))),d=[{credential:y,urls:[C],username:S}]),v.code?this.Xn.warn(i+" "+this.streamId+" use intranetCheck failed."+JSON.stringify(v)):this.proxyVrs.intranet=v.data.intranet||!1,[3,3];case 2:this.ee.isLocalProxy&&this.ee.turnServers?(d=(I=this.ee.turnServers).map((function(e){return{credential:e.credential,urls:[e.url],username:e.username}})),this.Xn.info(i+" "+this.streamId+" use local proxy: "+JSON.stringify(I)),this.proxyVrs.intranet=!1):e.turn_server&&(w=e.turn_server.split(";"),this.setTurnTcp(),I=void 0,R=w.filter((function(e){return e.indexOf("udp")>-1})),k=w.filter((function(e){return e.indexOf("tcp")>-1})),I=this._turnToTcp?k.length>0?k:R.map((function(e){return e.replace("udp","tcp")})):R,this.Xn.info(i+" over tcp "+JSON.stringify(I)),r.push.apply(r,I)),O.label=3;case 3:return e.stun_server&&r.push(e.stun_server),P={iceTransportPolicy:"all",iceServers:[{urls:r,username:e.turn_username,credential:e.turn_auth_key}],encodedInsertableStreams:this.sideMediaConfig.isSEIStart},d&&(P.iceServers=d,P.iceTransportPolicy="relay",P.rtcpMuxPolicy="require"),this.Xn.info(i+" "+this.streamId+" username: "+(A=P.iceServers[0]).username+", credential: "+A.credential),this._createOffer(P),D=performance.now(),this.signal.registerPushCallback("CandidateInfoPush",this.sessionId,(function(e,t,i){if(N.Qe("CandidateInfoPush",e))var r=setTimeout((function(){N.onRecvCandidateInfo(e,t,i),clearTimeout(r)}),0)})),this.signal.registerPushCallback("CloseSessionPush",this.sessionId,(function(e,t,r){if(D){var n=(performance.now()-D).toFixed(0);D=void 0,N.Xn.info(i+" ".concat(N.streamId,", cmd: CloseSessionPush, cost_time: ").concat(n))}32===r.reason&&(N.te=!1,N.re.te=!1),N.onRecvCloseSession(e,t,r)})),this.signal.registerPushCallback("MediaDescPush",this.sessionId,(function(e,t,i){return Gu(N,void 0,void 0,(function(){return ju(this,(function(r){switch(r.label){case 0:return this.Qe("MediaDescPush",e)?[4,this._onRecvMediaDescription(e,t,i)]:[2];case 1:return r.sent(),[2]}}))}))})),this.signal.registerPushCallback("SessionResetPush",this.sessionId,(function(e,t,i){N.onRecvResetSession(e,t,i)})),this.signal.registerPushCallback("PublishEventPush",this.sessionId,(function(e,t,r){if(N.Qe("PublishEventPush",e)){if(D){var n=(performance.now()-D).toFixed(0);D=void 0,N.Xn.info(i+" ".concat(N.streamId,", cmd: PublishEventPush, cost_time: ").concat(n))}N._onRecvPublishEvent(e,t,r)}})),this.signal.registerPushCallback("ClientInfoPush",this.sessionId,(function(e,t,i){N.Qe("ClientInfoPush",e)&&N._onRecvClientInfo(e,t,i)})),this.signal.registerPushCallback("MediaDescUpdatePush",this.sessionId,(function(e,t,i){return Gu(N,void 0,void 0,(function(){return ju(this,(function(r){switch(r.label){case 0:return this.Qe("MediaDescUpdatePush",e)?[4,this._onRecvUpdateMediaDescription(e,t,i)]:[2];case 1:return r.sent(),[2]}}))}))})),this.Xn.info(i+" "+this.streamId+" call success"),[2]}}))}))},e.prototype.Qe=function(e,t){var i=this.pushCmdSeqMap[e],r=i.seq,n=i.time,o=performance.now();return-1!==r&&r>=t&&o-n<6e3?(this.Xn.warn("zc.p.cps.0"+" ".concat(this.streamId,", push ").concat(e,", seq ").concat(t," local ").concat(JSON.stringify(this.pushCmdSeqMap[e]))),!1):(this.pushCmdSeqMap[e]={seq:t,time:o},!0)},e.prototype._createOffer=function(e){var t,i,r,n=this,o=ls;this.peerConnection=new RTCPeerConnection(e),this.peerConnection.onicecandidate=function(e){n.onIceCandidate(e)},this.peerConnection.onsignalingstatechange=function(e){n.onSignalStateChange(e)},this.peerConnection.connectionState?this.peerConnection.onconnectionstatechange=function(e){n.onConnectionStateChange(e)}:this.Xn.info("".concat(o," not support connectionState")),this.peerConnection.oniceconnectionstatechange=function(e){n.onIceConnectionStateChange(e)},this.ee.isDataChannelEnabled&&(this.dataChannel=this.peerConnection.createDataChannel(this.streamId),this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=function(e){n.Xn.info(o+" "+n.streamId+" data channel open"),n.dataChannelState=1},this.dataChannel.onclose=function(e){n.Xn.error(o+" "+n.streamId+" data channel close ")});var s=[],a=[],c=Gn();if(this.lowStream&&this.lowStream.getVideoTracks().forEach((function(e){var t,i=null===(t=n.peerConnection)||void 0===t?void 0:t.addTrack(e,n.lowStream);n.sideMediaConfig.isSEIStart&&i&&c&&n.createVideoSenderTransform(i,!0)})),this.localStream){if(this.localStream.getTracks().forEach((function(e){var t,i=null===(t=n.peerConnection)||void 0===t?void 0:t.addTrack(e,n.localStream);n.sideMediaConfig.isSEIStart&&i&&c&&("video"===e.kind?n.createVideoSenderTransform(i):"audio"===e.kind&&n._createAudioSenderTransform(i),Zn(e,n.Xn,o))})),!(null===(t=this.previewer)||void 0===t?void 0:t.videoTrack)&&this.sideMediaConfig.isSEIStart){this.videoInfo.bitRate||(this.videoInfo.bitRate=50);var u=this.sideMediaConfig.track=this._addCanvasStreamVideoTrack(),l=this.peerConnection.addTrack(u,this.localStream);l&&"video"==u.kind&&c&&this.createVideoSenderTransform(l)}(null===(i=this.previewer)||void 0===i?void 0:i.videoTrack)&&(s=[null===(r=this.previewer)||void 0===r?void 0:r.videoTrack]),a=this.localStream.getAudioTracks();var d,h=!1,p=!1;s.length>0&&(this.Xn.info(o+" "+this.streamId+" video device: "+(d=s[0]).label+" ; set: "+JSON.stringify(d.getSettings())),h=!0),a.length>0&&(this.Xn.info(o+" "+this.streamId+" audio device: "+(d=a[0]).label+" ; set: "+JSON.stringify(d.getSettings())),p=!0),"function"==typeof RTCPeerConnection.prototype.addTransceiver?(this.supportTransceiver=!0,h||this.sideMediaConfig.isSEIStart||(this.peerConnection.addTransceiver("video",{direction:"sendrecv"}),this.useTransceiver=!0),p||(this.peerConnection.addTransceiver("audio",{direction:"sendrecv"}),this.useTransceiver=!0)):this.supportTransceiver=!1}var f={offerToReceiveAudio:a.length>0?1:0,offerToReceiveVideo:s.length>0?1:0};!0===this.publishOption.enableDTX&&(f.voiceActivityDetection=!0),this.Xn.info(o+" "+this.streamId+" createOffer: "+JSON.stringify(f));var m=this.getSpan("/publish/create_offer",this.parentSpanKey);this.peerConnection.createOffer(f).then((function(e){m.setAttributes({sdp:gr(e.sdp),is_mini:yr(n.te)}),m.end(),n.onCreateOfferSuccess(e)}),(function(e){n.Xn.error(o+" "+n.streamId+" create offer error "+e.toString()),n.ve.setError(m,{code:Yu.Xi.code,message:e.toString()}),n.publishStateUpdateError(Yu.Xi,!0)}))},e.prototype.sendSEI=function(e){var t=this;if("H264"!==this.videoCodec)return this.Xn.error(As+" code not support"),!1;if(!this.sideMediaConfig.isSEIStart)return this.Xn.error(As+" not enable to send sei"),!1;if(this.sideMediaConfig.SEIType==B.UserUnregister&&e.byteLength<=16)return this.Xn.error(As+" inData size should greater than 16"),!1;if(this.mediaSideInfos.length>=10)return this.Xn.error(As+" side info count limit"),!1;this.mediaSideInfos.push(e.buffer);var i=this.seiWorker;return i&&(this.mediaSideInfos.forEach((function(e){i.postMessage({cmd:"pushSideInfo",buffer:e,hasLowStream:!!t.lowStream,streamID:t.streamId,maxLength:10},[e])})),this.mediaSideInfos=[]),!0},e.prototype._createAudioSenderTransform=function(e){var t={cmd:"encode",streamID:this.streamId,kind:"audio"},i=this.createSEIWorker();if(window.RTCRtpScriptTransform)e.transform=new RTCRtpScriptTransform(i,t);else{var r=e.createEncodedStreams(),n=r.readable,o=r.writable,s=!i;try{i&&i.postMessage(Vu({readable:n,writable:o},t),[n,o])}catch(e){s=!0}if(s){this.Xn.warn("zc.p.cart The current browser version is too low.");var a=new TransformStream({transform:this.encodeAudioFrame});n.pipeThrough(a).pipeTo(o),this.ee.handleSeiRollBack()}}},e.prototype.createVideoSenderTransform=function(e,t){void 0===t&&(t=!1);var i=this.createSEIWorker(),r={cmd:"encode",streamID:this.streamId,type:this.sideMediaConfig.SEIType,isLowStream:t,emulationPreventionByte:this.re.seiConfig.emulationPreventionByte,onlyAudio:!!this.sideMediaConfig.track};if(window.RTCRtpScriptTransform)e.transform=new RTCRtpScriptTransform(i,r);else{var n=e.createEncodedStreams(),o=n.readable,s=n.writable,a=!i;try{i&&i.postMessage(Vu({readable:o,writable:s},r),[o,s])}catch(e){a=!0}if(a){this.Xn.warn("zc.p.cvrt The current browser version is too low.");var c=new TransformStream({transform:this.encodeVideoFrame});o.pipeThrough(c).pipeTo(s),this.ee.handleSeiRollBack()}}},e.prototype.encodeAudioFrame=function(e,t){t.enqueue(e)},e.prototype.encodeSEINalu=function(e){var t=e.byteLength,i=parseInt(t/255),r=t%255,n=new ArrayBuffer(1+(i+1)+t+1),o=new DataView(n),s=0;o.setUint8(s++,this.sideMediaConfig.SEIType===B.UserUnregister?5:243);for(var a=0;a<i;a++)o.setUint8(s++,255);o.setUint8(s++,r);var c=new DataView(e);for(a=0;a<(null==e?void 0:e.byteLength);a++)o.setInt8(s++,c.getInt8(a));o.setInt8(s++,128);var u=new Uint8Array(n),l=u;if(this.re.seiConfig.emulationPreventionByte){var d=function(e){for(var t=[],i=e.length,r=0,n=0;n<i;++n){var o=e[n];o<=3&&r>=2&&(t.push(3),r=0),t.push(e[n]),0==o?++r:r=0}var s=new Uint8Array(t);return{output:s,outLength:s.length}}(u).output;l=d}return{rbspView:l,ebspLength:l.length}},e.prototype.encodeFrame=function(e,t,i){var r=i?this.lowMediaSideInfos:this.mediaSideInfos;if(r.length>0){for(var n=new DataView(e.data),o=[],s=0,a=0;a<r.length;a++){var c=this.encodeSEINalu(r[a]);s+=5+(E=c.ebspLength),o.push(c)}i?this.lowMediaSideInfos=[]:this.mediaSideInfos=[];for(var u=new ArrayBuffer(s+e.data.byteLength),l=new DataView(u),d=0,h=new Ou(n),p=0,f=!1,m=!1,v=0;h.NextNalu();){v++;var g=31&n.getUint8(h.nalu_start+h.start_code_size);if(7==g)f=!0,p+=h.nalu_size;else if(8==g)m=!0,p+=h.nalu_size;else if(9==g)continue;if(f&&m)break}for(var y=0;y<p;y++)l.setInt8(d++,n.getInt8(y));var b=10-v,_=o.length>=(b=b>0?b:0)?b:o.length;for(a=0;a<_;a++){var S=o[a],T=S.rbspView,E=S.ebspLength;l.setUint8(d++,0),l.setUint8(d++,0),l.setUint8(d++,0),l.setUint8(d++,1),l.setUint8(d++,6);for(var C=0;C<E;C++)l.setInt8(d++,T[C-0])}for(y=p;y<e.data.byteLength;y++)l.setInt8(d++,n.getInt8(y));new Uint8Array(u),e.data=u}t.enqueue(e)},e.prototype.encodeFrameAudioOnly=function(e,t,i){var r=i?this.lowMediaSideInfos:this.mediaSideInfos,n=0,o="key"===e.type,s=performance.now(),a=0,c=[];if(r.length>0){for(var u=r.length>=9?9:r.length,l=0;l<u;l++){var d=this.encodeSEINalu(r[l]);a+=5+(b=d.ebspLength),c.push(d)}i?this.lowMediaSideInfos=[]:this.mediaSideInfos=[],s-this.recvLastKeyFrameTime>2e3&&(o=!0)}o&&(n=Wu.length+Qu.length);var h=new ArrayBuffer(a+n),p=new DataView(h),f=0;if(o)for(var m=new DataView(Wu.buffer),v=0;v<Wu.length;v++)p.setInt8(f++,m.getInt8(v));for(l=0;l<c.length;l++){var g=c[l],y=g.rbspView,b=g.ebspLength;p.setUint8(f++,0),p.setUint8(f++,0),p.setUint8(f++,0),p.setUint8(f++,1),p.setUint8(f++,6);for(var _=0;_<b;_++)p.setInt8(f++,y[_-0])}if(o){var S=new DataView(Qu.buffer);for(v=0;v<Qu.length;v++)p.setInt8(f++,S.getInt8(v))}e.data=h,o&&(this.recvLastKeyFrameTime=s),t.enqueue(e)},e.prototype.onCreateOfferSuccess=function(e,t,i,r){var n=this;t&&(this.isUpdateSDP=!0,r&&(this.updateSDPCallBack=r)),this.localStream&&this.localStream.getTracks().forEach((function(e){Zn(e,n.Xn,ds)})),this.videoInfo.bitRate>0&&(e.sdp=this._updateBandwidthRestriction(e.sdp,this.videoInfo.bitRate)),e.sdp=e.sdp.replace(/sendrecv/g,"sendonly");var o=e.sdp.match(/m=application[\s\S]+datachannel[\s\S]+/)?e.sdp.match(/m=application[\s\S]+datachannel[\s\S]+/)[0]:null;if(o){var s=o.replace(/sendonly/,"sendrecv");e.sdp=e.sdp.replace(o,s)}var a=[];isNaN(this.videoInfo.audioBitrate)||a.push("maxaveragebitrate="+this.videoInfo.audioBitrate);var c=/stereo=\d+/,u=e.sdp.match(c),l="stereo="+(2===this.videoInfo.channelCount?1:0);if(u&&u[0]?e.sdp=e.sdp.replace(c,l):a.push(l),!0===this.publishOption.enableDTX){var d=/usedtx=\d+/,h=e.sdp.match(d),p="usedtx="+(this.publishOption.enableDTX?1:0);h&&h[0]?e.sdp=e.sdp.replace(d,p):a.push(p)}var f=/useinbandfec=\d+/,m=e.sdp.match(f);if(m&&m[0]&&a.push(m[0]),e.sdp=e.sdp.replace(f,a.join(";")),this.localSdpOrder=e.sdp.match(/m=(.\w*)\s/g)||[],this.Xn.info(ds+" "+this.streamId+" local sdp revert "+this.localSdpOrder.join("")),e.sdp=to.getSDPByVideDecodeType(e.sdp,this.videoCodec),this.Xn.info(ds+" "+this.streamId+" localSdp1 "+e.sdp.substr(0,e.sdp.length/2)),this.Xn.info(ds+" "+this.streamId+" localSdp2 "+e.sdp.substr(e.sdp.length/2)),this._autoTcp){this.localDesc=e;var v=this.setSdpHardCode(e);this.Je(e,v)}else this.setLocalSdp(e,i)},e.prototype.setLocalSdp=function(e,t){var i,r=this;this.Xn.info(ds+" "+this.streamId+" set local sdp");var n=this.getSpan("/publish/set_local_sdp",this.parentSpanKey);n.setAttributes({sdp:br(e.sdp),is_mini:_r(this.te)}),null===(i=this.peerConnection)||void 0===i||i.setLocalDescription(e).then((function(){return Gu(r,void 0,void 0,(function(){return ju(this,(function(i){switch(i.label){case 0:return n.end(),[4,this.onSetLocalDescriptionSuccess(e,t)];case 1:return i.sent(),[2]}}))}))}),(function(e){r.Xn.error(ds+" "+r.streamId+" error "+e.toString()),r.ve.setError(n,{code:Yu.$i.code,message:e.toString()}),r.publishStateUpdateError(Yu.$i,!0)}))},e.prototype._updateBandwidthRestriction=function(e,t){var i="AS";return"firefox"===this.re.browser&&(t=1e3*(t>>>0),i="TIAS"),-1===e.indexOf("b="+i+":")?e.replace(/(m=video.*\r\nc=IN.*\r\n)/g,"$1b="+i+":"+t+"\r\n"):(e=e.replace(new RegExp("b="+i+":.*\r\n","g"),"b="+i+":"+t+"\r\n")).replace("b="+i+":"+t+"\r\n","")},e.prototype.setSdpHardCode=function(e){var t,i,r=!1,n=null===(t=this.previewer)||void 0===t?void 0:t.previewType,o=this.re.settingConfig;"camera"===n?r=o.getSetting("camera_hard_encode"):"screen"===n?r=o.getSetting("hardware_encode"):"custom"===n&&(r=o.getSetting("custom_hard_encode"));var s=!r;return this.Xn.info(hs+" "+this.streamId+" ".concat(null===(i=this.previewer)||void 0===i?void 0:i.previewType," software encode: ").concat(s,", ")),to.getSDPByVideDecodeType(e.sdp,this.videoCodec,s,this.re.engineConfig.encodecSelectionMode)},e.prototype.onSetLocalDescriptionSuccess=function(e,t){var i,r;return Gu(this,void 0,void 0,(function(){var n,s,a,c,u,l,d,h,p=this;return ju(this,(function(f){return this.Xn.info(hs+" "+this.streamId+" success"),this.localStream&&this.localStream.getTracks().forEach((function(e){Zn(e,p.Xn,hs)})),!this.isUpdateSDP&&(this.state=2),t&&(this.videoInfo=Vu(Vu({},this.videoInfo),t)),n=this.setSdpHardCode(e),s=null===(i=this.previewer.videoTrack)||void 0===i?void 0:i.getSettings(),a=(null==s?void 0:s.width)||this.videoInfo.width,c=(null==s?void 0:s.height)||this.videoInfo.height,u=(null==s?void 0:s.frameRate)||this.videoInfo.frameRate,l={sdp:n,width:isNaN(a)?100:a,height:isNaN(c)?100:c,frameRate:isNaN(u)?15:u,video_min_kpbs:this.videoInfo.bitRate,video_max_kpbs:this.videoInfo.bitRate,audio_kpbs:48,keyframe_intv:Math.floor((null===(r=this.videoInfo)||void 0===r?void 0:r.keyFrameInterval)||2),paramsExt:this.paramsExt},this.offerSeq=(0,o.getSeq)(),this.isUpdateSDP?(this.Xn.info(hs+" "+this.streamId+" update sdp"),d=Vu(Vu({},l),{seq:this.sessionSeq,peerID:this.peerID,type:0}),this.signal.sendMediaDescUpdateReq(this,this.offerSeq,this.sessionId,d,(function(e,t,i){0==(null==i?void 0:i.result)&&(null==i?void 0:i.sdp)&&p.Ve(null==i?void 0:i.sdp)}),(function(e,t){p.Xn.error(hs+" "+p.streamId+" update sdp failed"),p.updateSDPCallBack&&p.updateSDPCallBack(-1),p.publishStateUpdateError(1==e?Yu.vn:Yu.mn)})),[2]):this.isPeer?this._autoTcp?(this.Xn.info(hs+" "+this.streamId+" fully auto tcp"),[2]):(this.Je(e,n),[2]):(h=this.getSpan("/publish/send_media_desc",this.parentSpanKey),this.signal.sendMediaDesc(this,this.offerSeq,this.sessionId,0,l,(function(e,t,i){h.setAttributes({webrtc_sid:Nr(t),mediaDescription:{width:l.width,height:l.height,frameRate:l.frameRate,video_min_kpbs:l.video_min_kpbs,video_max_kpbs:l.video_max_kpbs,audio_kpbs:l.audio_kpbs,keyframe_intv:l.keyframe_intv},sdp:l.sdp}),h.end(),p.offerSeq==e&&p.sessionId==t?(p.Xn.info(hs+" "+p.streamId+" send success stateNego:waiterAnswer"),p.stateNego=L.waiterAnswer,p.state=3,ln(null==i?void 0:i.sdp)&&(null==i?void 0:i.sdp)&&p.Ve(i.sdp,!0)):p.Xn.error(hs+" "+p.streamId+" seq or sessionId is not equal")}),(function(e,t){p.ve.setError(h,{code:Yu.an.code,message:e.toString()}),p.publishStateUpdateError(Yu.an)})),this.Xn.info(hs+" "+this.streamId+" call success"),[2])}))}))},e.prototype._onRecvUpdateMediaDescription=function(e,t,i){return Gu(this,void 0,void 0,(function(){var t,r,n;return ju(this,(function(o){switch(o.label){case 0:if(this.Xn.info(Ps+" "+this.streamId+" received"),this.Xn.info(Ps+" "+this.streamId+" received stateNego:waitingCandidate"),this.signal.sendUpdateMediaDescAck(e,this.sessionId,0,this.peerID),t=i.sdp,this.Xn.info("".concat(Ps," ").concat(this.streamId," rSdp:").concat(t.length," ").concat(this.te)),!this.te||!t)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.signal.webrtcCenterSvr.parseRecSdp(t,!0,this)];case 2:return r=o.sent(),[3,4];case 3:return n=o.sent(),this.Xn.info(Ps+" "+this.streamId+" parse sdp err "+JSON.stringify(n)),[2,this.publishStateUpdateError(Zu.error.yn)];case 4:return r=r||i.sdp,1==i.type?this.Ve(r):this.publishStateUpdateError(Yu.an),[2]}}))}))},e.prototype._onRecvMediaDescription=function(e,t,i){return Gu(this,void 0,void 0,(function(){var t,r,n,o;return ju(this,(function(s){switch(s.label){case 0:if(this.Xn.info(fs+" "+this.streamId+" received"),t=i.sdp,this.Xn.info("".concat(fs," ").concat(this.streamId," rSdp:").concat(t.length," ").concat(this.te)),!this.te||!t)return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.signal.webrtcCenterSvr.parseRecSdp(t,!0,this)];case 2:return r=s.sent(),[3,4];case 3:return n=s.sent(),this.Xn.info(fs+" "+this.streamId+" parse sdp err "+JSON.stringify(n)),[2,this.publishStateUpdateError(Zu.error.yn)];case 4:return r=r||i.sdp,(o=this.getSpan("/publish/recv_media_desc",this.parentSpanKey)).setAttributes({sdp:Or(i.sdp),is_mini:Mr(this.te)}),o.end(),3!=this.state?(this.Xn.info(fs+" "+this.streamId+" current state "+this.state+" not allowed"),[2]):(this.stateNego=L.waitingCandidate,this.Xn.info(fs+" "+this.streamId+" received stateNego:waitingCandidate"),this.signal.sendMediaDescAck(e,this.sessionId,0),1==i.type?this.Ve(r):this.publishStateUpdateError(Yu.an),[2])}}))}))},e.prototype.getVideoSenders=function(){var e;return null===(e=this.peerConnection)||void 0===e?void 0:e.getSenders().filter((function(e){return e.track&&"video"===e.track.kind}))},e.prototype.canSetBandWidthBySender=function(){var e=this.re.browserInfo.name.toLowerCase(),t=function(e){return ln(e)&&Number(e.split(".")[0])||0}(this.re.browserInfo.version);return("chrome"===e||"safari"===e||"firefox"===e&&t>=64)&&"RTCRtpSender"in window&&"setParameters"in window.RTCRtpSender.prototype},e.prototype.Ke=function(e,t){return void 0===t&&(t=""),Gu(this,void 0,void 0,(function(){var i=this;return ju(this,(function(r){return[2,new we((function(r){var n,o=function(t){i.Xn.info("zc.p.sbw set band width by sdp.");var r="AS";return"firefox"===i.re.browser&&(e=1e3*(e>>>0),r="TIAS"),/b=AS.*(\r\n|\n)/.test(t)?t.replace(/AS:(\d+)/,r+":"+e):t.replace(/m=video.*(\r\n|\n)c=.*(\r\n|\n)/,"$&b=".concat(r,":").concat(e,"\n"))},s=null===(n=i.getVideoSenders())||void 0===n?void 0:n.filter((function(e){var t,r;return(null===(t=e.track)||void 0===t?void 0:t.id)!==(null===(r=i.lowStream)||void 0===r?void 0:r.getVideoTracks()[0].id)}));i.canSetBandWidthBySender()&&(null==s?void 0:s.length)?(i.Xn.info("zc.p.sbw set band width by sender parameter."),null==s||s.forEach((function(n){return Gu(i,void 0,void 0,(function(){var i,s,a,c,u=this;return ju(this,(function(l){return(i=n.getParameters()).encodings||(i.encodings=[{}]),s=1e3*e,a=i.encodings[0].maxBitrate,c=JSON.stringify(i.encodings[0]),i.encodings[0].maxBitrate=s,n.setParameters(i).then((function(){u.Xn.info("zc.p.sbw update maxBitrate success. origin: ".concat(a,", new: ").concat(s," , ").concat(c,",").concat(n.getParameters().encodings[0]," ")),r(t)})).catch((function(e){u.Xn.warn("zc.p.sbw set band width by sender parameter fail, fall back to sdp parse."+e),t&&(t=o(t)),r(t)})),[2]}))}))}))):(t&&(t=o(t)),r(t))}))]}))}))},e.prototype.Ve=function(e,t,i){var r,n;return void 0===t&&(t=!1),Gu(this,void 0,void 0,(function(){var o,s,a,c,u,l,d,h,p,f,m,v,g,y,b,_,S,T,E,C,w,I,R,k,P,A,D,N,O=this;return ju(this,(function(M){switch(M.label){case 0:if(this.Xn.info(ps+" "+this.streamId+" call"),this.videoInfo.audioBitrate&&48e3!==this.videoInfo.audioBitrate&&(e=e.replace(/maxaveragebitrate=(\d+)/,"maxaveragebitrate="+this.videoInfo.audioBitrate)),this.remoteSdpOrder=e.match(/m=(.\w*)\s/g)||[],this.Xn.info(ps+" "+this.streamId+" sdp revert "+this.remoteSdpOrder.join("")),this.setTurnTcp(),this.ee.autoSwitchProtocol=this.Fe("auto_to_tcp")||!1,o=this.Fe("udp_max_fail_num"),!isNaN(o)&&(this.ee.maxUdpFailNum=o),c=(s=this.ee).maxUdpFailNum,u=s.udpFailNum,this.Xn.info("zp.oro.0 autoToTcp: ".concat(a=s.autoSwitchProtocol,", udpFailNum: ").concat(u,", maxUdpFailNum: ").concat(c,".")),a&&!this._turnToTcp&&u>=c&&(this.Xn.info("zp.oro.0 switch to tcp."),this._turnToTcp=!0,this._autoTcp=!1),(l=this.Fe("udp_or_tcp",!0))&&(this.Xn.info("zp.oro.0 setting udp_or_tcp "+l),this._turnToTcp="tcp"===l),this._turnToTcp&&!this.ee.isProxy&&"firefox"!==this.re.browser&&(null===(r=e.match(/candidate.*/g))||void 0===r||r.forEach((function(t){var i=t.replace(/udp/,"tcp");i.includes(" tcptype ")||(i=i.replace(" typ host "," typ host tcptype passive ")),e=e.replace(t,i)}))),this.ee.isProxy)if(d=vo(e),h=d[0],p=d[1],f=e.match(/a=mid:[^(\n|\r)]+/g),p&&f)if(this.proxyVrs.intranet)setTimeout((function(){p.forEach((function(e,t){var i,r={sdpMLineIndex:t,candidate:e.replace(h[t].ip,O.proxyVrs.wanIP).replace("a=",""),sdpMid:f[t].replace("a=mid:","")};O.Xn.info("zp.oro.0 add wan candidate:"+JSON.stringify(r)),null===(i=O.peerConnection)||void 0===i||i.addIceCandidate(new RTCIceCandidate(r))}))}),1e3);else for(this.Xn.info("zp.oro.0 change candidate ip from lan to wan: "+(m=this.proxyVrs.wanIP)),v=0;v<p.length;v++)y=(g=p[v]).replace(h[v].ip,m),e=e.replace(g,y);else this.Xn.warn("zp.oro.0 candidate not found");if(this.Xn.info("zp.oro.0 "+this.streamId+" sdp revert "+this.localSdpOrder.join("")+" "+this.remoteSdpOrder.join("")),this.localSdpOrder.join()!==this.remoteSdpOrder.join()&&this.localSdpOrder.length==this.remoteSdpOrder.length&&(b=new RegExp("[\\s\\S]*"+this.remoteSdpOrder[0]).exec(e)[0].replace(this.remoteSdpOrder[0],""),_=[],S="",this.localSdpOrder.forEach((function(t){var i=O.remoteSdpOrder.findIndex((function(e){return e==t})),r=new RegExp(t+"[\\s\\S]*"+(O.remoteSdpOrder[i+1]||"")).exec(e)[0].replace(O.remoteSdpOrder[i+1],""),n=/a=mid:(\w)/.exec(r)[1];_.push(n),S+=r||""})),e=b.replace(/a=group:BUNDLE.*/,"a=group:BUNDLE "+_.join(" "))+S,this.localSdpOrder=[],this.remoteSdpOrder=[]),T=e.match(/m=video(.|\r|\n)*a=rtpmap(.|\r|\n)*(a=fmtp:(\d+).*)/),Ae()&&(E=0,C=0,this.videoInfo.bitRate&&"target"===this.videoInfo.startBitrate&&(E=this.videoInfo.bitRate),this.videoInfo.minBitrate?C=this.videoInfo.minBitrate:"screen"===this.previewer.previewType&&(w=function(e){var t=0,i=e.frameRate,r=e.width*e.height*(i<=30?i:30);return un(r)?(t=r<=3888e3?200:r<=6912e3?400:r<=15552e3?700:r<=27648e3?1e3:2e3)>e.bitRate&&(t=e.bitRate):t=parseInt(.6*e.bitRate+""),{minBitrate:t,resolution:r}}(this.videoInfo),C=w.minBitrate,this.Xn.info(ps+" "+this.streamId+" resolution: ".concat(w.resolution,", min bitrate: ").concat(C))),I=[],C&&I.push("x-google-min-bitrate=".concat(C)),E&&I.push("x-google-start-bitrate=".concat(E)),null!==T&&I.length&&(R=T[3],k="".concat(R,";").concat(I.join(";")),e=e.replace(R,k))),!(this.videoInfo.bitRate>0))return[3,5];M.label=1;case 1:return M.trys.push([1,3,,4]),[4,this.Ke(this.videoInfo.bitRate,e)];case 2:return e=M.sent(),[3,4];case 3:return P=M.sent(),this.Xn.error(ps+JSON.stringify(P)),[3,4];case 4:null==(A=this.getVideoSenders())||A.forEach((function(e){var t,i,r,n,o,s;if(e&&e.getParameters&&e.setParameters){var a=e.getParameters();if(a.encodings&&0!=a.encodings.length||(a.encodings=[{}]),(null===(t=e.track)||void 0===t?void 0:t.id)==(null===(i=O.lowStream)||void 0===i?void 0:i.getVideoTracks()[0].id)){var c=null===(r=O.previewer)||void 0===r?void 0:r.lowStreamConfig.bitRate;c&&(a.encodings[0].maxBitrate=1e3*c)}else{var u=O.lastPublishStats.frameWidth,l=(null===(o=null===(n=O.previewer)||void 0===n?void 0:n.cameraMaxResolution)||void 0===o?void 0:o.maxWidth)||0,d=null===(s=O.previewer.videoTrack)||void 0===s?void 0:s.getSettings().width,h=u?Math.min(l,u):l;if(l&&d){var p=Math.max(h/d,1);a.encodings[0].scaleResolutionDownBy=p}}e.setParameters(a)}})),M.label=5;case 5:return this.Xn.info(ps+" "+this.streamId+" remoteSdp:",e),D={type:"answer",sdp:e,toJSON:function(){}},(N=this.getSpan("/publish/set_remote_sdp",this.parentSpanKey)).setAttributes({sdp:Tr(D.sdp),is_mini:Er(this.te),webrtc_sid:Cr(this.sessionId)}),this.remoteDesc=D.sdp,null===(n=this.peerConnection)||void 0===n||n.setRemoteDescription(new RTCSessionDescription(D)).then((function(){O.Xn.info(ps+" "+O.streamId+" set success"),O.localStream&&O.localStream.getTracks().forEach((function(e){Zn(e,O.Xn,ps)})),N.end(),O.stateNego==L.iceConnected&&O.updateSDPCallBack&&(O.Xn.info(ps+" "+O.streamId+" update sdp success"),O.updateSDPCallBack(0),O.updateSDPCallBack=void 0,O.isUpdateSDP=!1)}),(function(e){O.Xn.error(ps+" "+O.streamId+" failed: "+e.toString()),N.setAttributes({error:Yu.en.code,message:e.toString()}),N.end();var t=!0;O.te&&(t=!1,O.te=!1),O.publishStateUpdateError(Yu.en,t)})),this.state=4,t&&e.indexOf("candidate")>-1&&(this.We(this.candidateInfo),this.candidateInfo=[],this.state=5),this._autoTcp&&this.setCandidate(i),this.Xn.info(ps+" "+this.streamId+" call success"),[2]}}))}))},e.prototype.setBitrate=function(e){return Gu(this,void 0,void 0,(function(){var t;return ju(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.Ke(e,this.remoteDesc)];case 1:return i.sent(),this.videoInfo.bitRate=e,[3,3];case 2:return t=i.sent(),this.Xn.error("zc.p.0.sb.0"+JSON.stringify(t)),[3,3];case 3:return[2]}}))}))},e.prototype.setConfiguration=function(e,t){var i,r=this.getIceServers(e);this.Xn.info("zc.p.0.scg "+this.streamId+" ".concat(JSON.stringify(r)," ").concat(JSON.stringify(t))),r.length>0&&t&&(null===(i=this.peerConnection)||void 0===i||i.setConfiguration({iceTransportPolicy:"all",rtcpMuxPolicy:"require",iceServers:[{urls:r,username:t.turn_username,credential:t.turn_auth_key}],encodedInsertableStreams:this.sideMediaConfig.isSEIStart}))},e.prototype.getIceServers=function(e){var t=vo(e)[0];if(t.length>0){var i=t[0].ip;return["turn:".concat(i,":3478?transport=udp"),"turns:".concat(i,":443?transport=tcp"),"turn:".concat(i,":3478?transport=tcp")]}return[]},e.prototype.onIceConnectionStateChange=function(e){var t,i=this;if(7!=this.state&&null!=this.peerConnection){this.Xn.info(bs+" "+this.streamId+" ice state: "+this.peerConnection.iceConnectionState);var r=this.getSpan(Ar,this.parentSpanKey,_i.event);if(r.setAttributes({ice_state:Dr(this.peerConnection.iceConnectionState)}),"connected"===this.peerConnection.iceConnectionState){if(this.Xn.info(bs+" "+this.streamId+" connected state "+this.state+" ?"+(null===(t=this.peerConnection)||void 0===t?void 0:t.connectionState)),this.reportBeginTime){var n=(new Date).getTime()-this.reportBeginTime;this.reportSpan.setAttributes({publish_begin_time:Ku.publish_begin_time(n)}),this.reportBeginTime=0}if(this.ve.spanEnd({key:wr,par:this.streamId},{webrtc_sid:this.sessionId}),this.stateNego=L.iceConnected,this.answerSdpTime){var o=(new Date).getTime()-this.answerSdpTime;this.Xn.info(bs+" "+this.streamId+" ice time "+o)}this.isProbeDispatch=!1,this.Xn.info(bs+" "+this.streamId+" stateNego:iceConnected"),this.negoTimer&&(clearTimeout(this.negoTimer),this.negoTimer=null),null!=this.iceDisconnectedTimer&&(clearTimeout(this.iceDisconnectedTimer),this.iceDisconnectedTimer=null),this.peerConnection.connectionState||(this.publishEvent?this.publishSuccess():(this.firstGetStatsTimer&&clearTimeout(this.firstGetStatsTimer),this.firstGetStatsTimer=null,this.firstGetStatsTimer=setTimeout((function(){var e;i.Xn.info(bs+" get first stats state "+i.state),6!==i.state&&(null===(e=i.peerConnection)||void 0===e||e.getStats().then((function(e){i.Xn.info(bs+" get first stats suc"),e.size>0&&i.publishSuccess()})))}),1e3)))}else"closed"===this.peerConnection.iceConnectionState?(r.end(),this.stateNego=L.iceClosed,this.checkPublishConnectionFailedState(this.peerConnection.iceConnectionState)):"failed"===this.peerConnection.iceConnectionState?(r.end(),this.stateNego=L.iceFailed,this.checkPublishConnectionFailedState(this.peerConnection.iceConnectionState)):"disconnected"===this.peerConnection.iceConnectionState&&(r.end(),this.Xn.warn(bs+" ice disconnected "),this.stateNego=L.iceDisconnected,this.iceDisconnectedTimer||(this.iceDisconnectedTimer=setTimeout((function(){i.checkPublishConnectionFailedState("disconnected")}),this.iceDisconnectedMaxTime)))}},e.prototype.onIceCandidate=function(e){var t,i=this;if(this.Xn.info(gs+" "+this.streamId+" candidate "+JSON.stringify(e.candidate)),e.candidate)if(-1!=(null===(t=e.candidate.candidate)||void 0===t?void 0:t.indexOf("relay"))){this.Xn.info(gs+" "+this.streamId+" candidate "+e.candidate.candidate+" state "+this.state+" autotcp "+this._autoTcp);var r=function(e){i.We([{candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid,sdpMLineIndex:e.candidate.sdpMLineIndex}])};this._autoTcp?r(e):this.state<5||7==this.state?this.candidateInfo.push({candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid,sdpMLineIndex:e.candidate.sdpMLineIndex}):r(e)}else this.Xn.info(gs+" "+this.streamId+" candidate not relay")},e.prototype.We=function(e){var t=this;if(this.Xn.info(ws+" "+this.streamId+" called"),!(e=e.filter((function(e){return e.candidate.indexOf("relay")>0})))||e.length<1)this.Xn.info(ws+" "+this.streamId+" cancelled");else{var i=this.getSpan("/publish/send_ice_candidate",this.parentSpanKey);i.setAttributes({candidate_info:Lr(e)}),this.stateNego!==L.iceConnected&&(this.stateNego=L.sendCandidate),this.Xn.info(ws+" "+this.streamId+" stateNego:sendCandidate"),this.signal.sendCandidateInfo((0,o.getSeq)(),this.sessionId,e,(function(e,r,n){t.Xn.info(ws+" "+t.streamId+" send success"),i.end()}),(function(e,r){t.Xn.error(ws+" "+t.streamId+" failed to send: "+e.toString()),t.ve.setError(i,{code:Yu.hn.code,message:e.toString()}),t.publishStateUpdateError(Yu.hn)}))}},e.prototype.onConnectionStateChange=function(e){var t,i=null===(t=this.peerConnection)||void 0===t?void 0:t.connectionState;this.Xn.info(ys+" "+this.streamId+" conn state: "+i),Date.now(),"connected"===i&&6!==this.state&&this.publishSuccess()},e.prototype.onSignalStateChange=function(e){this.Xn.info(ys+" "+this.streamId+" signal state: "+e.target.signalingState),7!=this.state&&null!=this.peerConnection&&"closed"===e.target.signalingState&&(this.dataReport.addEvent(this.reportSeq,"IceClosed"),this.stateNego=L.iceClosed,this.checkPublishConnectionFailedState(this.peerConnection.iceConnectionState))},e.prototype.onRecvCandidateInfo=function(e,t,i){var r,n=this;this.Xn.info(ms+" "+this.streamId+" received "+JSON.stringify(i.infos));var o=this.getSpan("/publish/recv_ice_candidate",this.parentSpanKey);if(o.setAttributes({candidate_info:xr(i.infos)}),o.end(),4==this.state){this.signal.sendCandidateInfoAck(e,this.sessionId,0),this.We(this.candidateInfo),this.candidateInfo=[];for(var s=0;s<i.infos.length;s++){var a={sdpMid:i.infos[s].sdpMid,sdpMLineIndex:i.infos[s].sdpMLineIndex,candidate:i.infos[s].candidate};this.Xn.debug(ms+""+this.streamId+" candidate "+a.candidate),null===(r=this.peerConnection)||void 0===r||r.addIceCandidate(new RTCIceCandidate(a)).then((function(){n.Xn.info(ms+" "+n.streamId+" add success")}),(function(e){n.Xn.error(ms+" "+n.streamId+" add error "+e.toString()),n.publishStateUpdateError(Yu.hn,!0)}))}this.state=5,this.getSpan(wr,this.parentSpanKey,"",!0).setAttributes({webrtc_sid:this.sessionId})}else this.Xn.info(ms+" "+this.streamId+" current state "+this.state+" not allowed")},e.prototype.onRecvCloseSession=function(e,t,i){var r=this;this.Xn.info(Cs+" "+this.streamId+" "+JSON.stringify(i));var n=this.getSpan("/rtc/recv_close_session",_i.event);n.setAttributes({err_info:kr(i.err_info||""),reason_info:null==i?void 0:i.reason}),n.end(),this.ve.spanSetAttributes({key:_i.event,par:this.streamId},{denied_info:_i.denied_info(i.err_info),stop_reason:_i.stop_reason("DenyStop")}),this.signal.sendCloseSessionAck(e,this.sessionId,0);var o=i.err_info?JSON.parse(i.err_info.toLowerCase()):{},s=o.action?o.action:null,a=1*i.reason,c=JSON.parse(JSON.stringify(Yu.Zi));c.message+=" reason:".concat(a," ").concat(s?" action:"+s:""," ").concat((null==o?void 0:o.err)?" err:"+(null==o?void 0:o.err):""),c.message+=";".concat(Mu(a,s,null==o?void 0:o.err)),1011===o.err&&(c=Yu.Ki),1014===o.err&&(c=Yu.Wi),this.negoTimer&&clearTimeout(this.negoTimer);var u=!([4,8,10,11,12,14,18,24,26,27,28,32].includes(a)||[2,3,4,5,6].includes(s)),l=!1;if(!this._turnToTcp){if([8,10].includes(a)||[18,15].includes(a)&&2===s&&[3001,3002].includes(o.err)){this.ee.udpFailNum++;var d=this.ee;d.autoSwitchProtocol&&d.udpFailNum>=d.maxUdpFailNum&&(this.isPeer=!1,this.ee.setIsPeer(!1),l=!0)}else this._turnToTcp||(this.ee.udpFailNum=0);var h=this.gwNodeList.findIndex((function(e){return e==r.gwNode}))===this.gwNodeList.length-1,p=[3001,3002,3003,3004,3005,3006,3007,3008].includes(o.err);h&&p&&(this.Xn.info(Cs+" "+this.streamId+" switch tcp by all fail"),this.re.turnToTcp=!0,this._autoTcp=!1,this.isPeer=!1,this.ee.setIsPeer(!1))}this.publishStateUpdateError(c,u,o,l)},e.prototype.onRecvResetSession=function(e,t,i){if(this.Xn.info(Es+" "+this.streamId+" received "),this.getSpan(Pr,_i.event).end(),t==this.sessionId){this.signal.sendCloseSessionAck(e,this.sessionId,0);var r=Yu.Zi;this.negoTimer&&clearTimeout(this.negoTimer),this.publishStateUpdateError(r)}else this.Xn.error(Es+" "+this.streamId+" cannot find session")},e.prototype._onRecvPublishEvent=function(e,t,i){var r;this.Xn.info("zc.p.0.orpe "+this.streamId+" received");var n=this.getSpan("/publish/rtc_publish_event",this.parentSpanKey,_i.event);n.setAttributes({event_state:Ir(i.event),webrtc_sid:t}),n.end(),this.firstGetStatsTimer&&(clearTimeout(this.firstGetStatsTimer),this.firstGetStatsTimer=null);var o=null===(r=this.peerConnection)||void 0===r?void 0:r.connectionState;this.publishEvent=!0,(o?"connected"===o:this.stateNego===L.iceConnected)&&6!=this.state&&0==i.event&&this.publishSuccess()},e.prototype._onRecvClientInfo=function(e,t,i){this.re.clientIP!==i.clientip&&this.Xn.info(vs+" client ip changed "+this.re.clientIP+" "+i.clientip),this.signal.sendClientInfoAck(e,this.sessionId,0),this.re.clientIP=i.clientip,this.peerID=i.peer_id,this.streamConnectIP=i.clientip,this.re.isMultiOuter=this.isMultiOuter(),this.sideMediaConfig.isSEIStart&&this.sideMediaConfig.SEIType==B.UserUnregister&&this.sideMediaConfig.unregisterSeiFilter&&this.sendSEIUUID();var r=this.previewer;if(r&&null!==r.activateSEIConfig){var n=null==r?void 0:r.activateSEIConfig;this.activateSEIInsert(n.action,n.infoType)}},e.prototype.sendSEIUUID=function(){var e=this;this.Xn.info("zc.ssuid call: "+this.sideMediaConfig.unregisterSeiFilter),this.signal.gw.mediaStreamSEIUUIDReq(this.sessionId,this.peerID,this.sideMediaConfig.unregisterSeiFilter).then((function(t){var i;e.Xn.info("zc.ssuid success"),0==(null===(i=null==t?void 0:t.usr_sei_filter)||void 0===i?void 0:i.result)&&(e.sideMediaConfig.uuidSend=!0)})).catch((function(t){e.Xn.error("zc.ssuid failed")}))},e.prototype.checkPublishConnectionFailedState=function(e){this.Xn.info(bs+" streamID "+this.streamId," state "+this.state+" connectionState "+e),this.publishStateUpdateError(Yu.rn)},e.prototype.getStopReason=function(e){var t="StopPublish";return e&&e.code&&(t=1103051===e.code?"ReachMaxAVRetryTime":"StopPublish"),t},e.prototype.stopPublish=function(e){var t,i,r,n,s,a;this.Xn.info("zc.p.0.sp.1 .1 "+this.streamId+" called "+this.state+" "+JSON.stringify(e));var c=this.getStopReason(e);if(Object.keys(this.ee.publisherList).length=1){var u=this.ee.playerList;for(var l in u){var d=u[l].player;6==d.state&&d.broadcasterStatus==D.start&&(this.signal&&this.signal.sendBroadcasterStatus((0,o.getSeq)(),d.sessionId,0),d.broadcasterStatus=D.stop)}}this.sessionId&&!this.closeSessionSignal&&(this.signal.sendCloseSession((0,o.getSeq)(),this.sessionId,0),this.resetPushCmdSeqMap());var h=Date.now();this.reportSpan.setAttributes({publish_state_time:Ku.publish_state_time(h-this.reportPublishStateTime)}),this.uploadRTCPublishStats();var p=this.Le?0:this.lastFailTimeLen;this.ve.spanEnd({key:_i.event,par:this.streamId},{tryidx:$u.tryidx(this.rtcPublishCount),url:$u.url(null===(t=this.signal)||void 0===t?void 0:t.server),ip:$u.ip(null===(r=null===(i=this.gwNode)||void 0===i?void 0:i.split(":"))||void 0===r?void 0:r[0]),dispatch_external_ip:$u.dispatch_external_ip(this.re.clientIP),resource_type:$u.resource_type("rtc"),protocol:$u.protocol("webrtc"),net_protocol:Ju.net_protocol(this.netProtocol),stop_reason:_i.stop_reason(c),try_time:$u.try_time(p),error:(null==e?void 0:e.code)||0,message:(null==e?void 0:e.message)||""}),this.Le||this.ve.spanEnd({key:(this.isRePublish?hi:di).event,par:this.streamId},{error:(null==e?void 0:e.code)||0,message:(null==e?void 0:e.message)||"",url:Ju.url(null===(n=this.signal)||void 0===n?void 0:n.server),ip:Ju.ip(this.ip),peer_id:Ju.peer_id(this.peerID),source_type:Ju.source_type("rtc"),net_protocol:Ju.net_protocol(this.netProtocol),is_center:Ju.is_center(null===(s=this.ee.publisherList[this.streamId])||void 0===s?void 0:s.isCenterNode)});var f=0!==(null==e?void 0:e.code)&&this.latestPublishErrCode?this.latestPublishErrCode:0,m=this.publishedTimeStamp;this.reportSpan.setAttributes({stream_id:Ku.stream_id(this.streamId),webrtc_sid:Ku.webrtc_sid(this.sessionId),probe_ip_cnt:Ku.probe_ip_cnt(this.probeIpCnt),valid_probe_ip_cnt:Ku.valid_probe_ip_cnt(this.validProbeIpCnt),poor_quality_retry_cnt:Ku.poor_quality_retry_cnt(this.poorQualityRetryCnt),probe_not_trigger_retry_info:Ku.probe_not_trigger_retry_info(this.probeNotRetryInfos.length>0?this.probeNotRetryInfos:void 0),bitrate:Ku.bitrate(1e3*this.videoInfo.bitRate),h:Ku.h(this.videoInfo.height),w:Ku.w(this.videoInfo.width),cap_w:Ku.w(this.videoInfo.width),cap_h:Ku.h(this.videoInfo.height),fps:Ku.h(this.videoInfo.frameRate),env:Ku.env(this.re.testEnvironment?3:1),fail_cnt:Ku.fail_cnt(Math.max(this.rtcPublishCount-1,0)),continuous_fail_cnt:Ku.continuous_fail_cnt(Math.max(this.continuousFailCnt-1,0)),stop_reason:Ku.stop_reason(c),error:(null==e?void 0:e.code)||0,message:(null==e?void 0:e.message)||"",last_error:f,try_time:$u.try_time(p),valid_d:this.validPublishedTime+(m?h-m:0),total_d:h-this.firstPublishedTimeStamp,tempbroken_cnt:this.errorTimes,is_mini:this.te}),(null==e?void 0:e.code)===Yu.bn.code&&this.uploadPublishEvent(e),this.reportSpan.end(),this.ee.stopToReport(0),this.ee.stopNetProbe(this),this.retryFailGwNodes=[],this.resetPublish(),this.hasSucceed=!1,this.isRePublish=!1,this.rtcPublishCount=0,this.isProbeDispatch=!1,this.probeIpCnt=0,this.validProbeIpCnt=0,this.poorQualityRetryCnt=0,this.probeNotRetryInfos=[],this.continuousFailCnt=0,null===(a=this.zegoCaptureStream)||void 0===a||a.resetPublish(),this.seiWorker&&this.seiWorker.postMessage({cmd:"clear",type:"push",streamID:this.streamId})},e.prototype.uploadRTCPublishStats=function(){var e,t,i,r,n,o,s,a,c,u,l,d,h,p;this.lastPublishStats.time&&this.ve.spanSetAttributes({key:_i.event,par:this.streamId},{lsttime:_i.lsttime(parseInt(this.lastPublishStats.time)),total_stat:_i.total_stat({afc:null===(e=this.lastPublishStats)||void 0===e?void 0:e.audioPacketsSent,vfc:null===(t=this.lastPublishStats)||void 0===t?void 0:t.framesSent,tfc:(null===(i=this.lastPublishStats)||void 0===i?void 0:i.audioPacketsSent)+(null===(r=this.lastPublishStats)||void 0===r?void 0:r.framesSent),vb:null===(n=this.lastPublishStats)||void 0===n?void 0:n.videoBytesSent,ab:null===(o=this.lastPublishStats)||void 0===o?void 0:o.audioBytesSent,tb:(null===(s=this.lastPublishStats)||void 0===s?void 0:s.videoBytesSent)+(null===(a=this.lastPublishStats)||void 0===a?void 0:a.audioBytesSent),rtp_rtt:Math.round(1e3*(null===(c=this.publishStat)||void 0===c?void 0:c.currentRoundTripTime))||0,w:null===(u=this.publishStat)||void 0===u?void 0:u.frameWidth,rtp_plr:null===(l=this.publishStat)||void 0===l?void 0:l.videoPacketsLostRate,h:null===(d=this.publishStat)||void 0===d?void 0:d.frameHeight,rtp_bw:(null===(h=this.publishStat)||void 0===h?void 0:h.googAvailableSendBandwidth)?null===(p=this.publishStat)||void 0===p?void 0:p.googAvailableSendBandwidth:void 0})})},e.prototype.onPublishStateUpdate=function(e,t,i,r,n,o){},e.prototype.onPublishQualityUpdate=function(e,t){},e.prototype.onDisconnect=function(e){this.Xn.info(Rs+" "+this.streamId+" call"),this.Xn.info(Rs+" "+this.streamId+" websocket disconnect"),this.publishStateUpdateError(e||Ti.error.un,!!e)},e.prototype.publishSuccess=function(){var e,t,i,r,n,s=this;if(this.Xn.info(us+" call"),this._turnToTcp||(this.ee.udpFailNum=0),this.isUpdateSDP&&this.updateSDPCallBack)return this.Xn.info(us+" "+this.streamId+" update sdp success"),this.updateSDPCallBack(0),this.updateSDPCallBack=void 0,void(this.isUpdateSDP=!1);var a=this.isRePublish?hi:di,c=null===(e=this.ee.publisherList[this.streamId])||void 0===e?void 0:e.retryStreamHandler;for(var u in null==c||c.getTryTime(this,!0),this.ve.spanEnd({key:a.event,par:this.streamId},{url:Ju.url(null===(t=this.signal)||void 0===t?void 0:t.server),ip:Ju.ip(this.ip),source_type:Ju.source_type("rtc"),is_center:Ju.is_center(null===(i=this.ee.publisherList[this.streamId])||void 0===i?void 0:i.isCenterNode),signal_consume:Ju.signal_consume(this.signalTime),is_peer:Ju.is_peer(this.isPeer)}),6!=this.state&&this.onPublishStateUpdate(0,this.streamId,{code:0,message:""},!0),this.isPeer&&(this.peerFailCount=0),this.state=6,this.hasSucceed=!0,this.continuousFailCnt=0,this.reportPublishStateTime=Date.now(),this.ee.playerList){var l=this.ee.playerList[u].player;6==l.state&&l.broadcasterStatus==D.stop&&(this.signal&&this.signal.sendBroadcasterStatus((0,o.getSeq)(),l.sessionId,1),l.broadcasterStatus=D.start)}var d=this.Fe("probe_started_num");!isNaN(d)&&(this.ee.probeStartedNum=d),this.qualityHandler.setPublishQualityTimer();var h=2,p=2,f=null===(r=this.previewer)||void 0===r?void 0:r.videoTrack,m=0!==this.localStream.getAudioTracks().length&&this.localStream.getAudioTracks()[0];this.localStream&&this.localStream.getTracks().forEach((function(e){Zn(e,s.Xn,us)})),(f&&"live"===f.readyState&&!0===f.enabled||(null===(n=this.previewer)||void 0===n?void 0:n.muteImage))&&(h=0),m&&"live"===m.readyState&&!0===m.enabled&&(p=0),this.sendStreamStatus(h,p,!0),this.ee.soundLevelDelegate&&this.previewer&&this.previewer.startSoundLevel(),this.Xn.info(us+" call success")},e.prototype.startSoundLevel=function(){var e;if(this.Xn.info(ks+" call streamID: "+this.streamId),this.localStream&&0!=this.localStream.getAudioTracks().length)try{null===(e=this.previewer)||void 0===e||e.startSoundLevel()}catch(e){this.Xn.error(ks+" "+this.streamId+" get sound level failed "+e)}else this.Xn.info(ks+" "+this.streamId+" local stream no found")},e.prototype.stopSoundLevel=function(){var e;this.Xn.info("zc.p.0.ssl.1 call streamID: "+this.streamId),null===(e=this.previewer)||void 0===e||e.stopSoundLevel()},e.prototype.handleEncBitrate=function(e,t,i){var r,n=this,o=1e3*this.videoInfo.bitRate,s=0;if(t>0){this.needIncMax||this.gotMax||(this.probeCount++,t>=.75*e?(this.probeCount>=10&&this.initFitCnt>=.6*this.probeCount&&(this.gotMax=!0,this.targetRate=o),this.initFitCnt++):this.probeCount>=10&&this.initFitCnt/this.probeCount<.3&&(this.needIncMax=!0));var a=qn(this.totalBitrateArray,t,10);this.needIncMax&&(a>=1.05*o?this.targetRate>o&&(this.targetRate-=a>e?a-e:a-o,this.targetRate=Math.max(this.targetRate,o),this.targetRate=Math.min(this.targetRate,2*o),s=this.targetRate):a<.8*o&&(0===this.targetRate&&(this.targetRate=e),this.targetRate=this.targetRate>=o?this.targetRate+.08*o:1.05*this.targetRate,this.targetRate=Math.min(this.targetRate,2*o),s=this.targetRate))}if(i>0&&i<o){var c=qn(this.totalRetransRateArray,i,5);this.needIncMax?c+t>1.05*o&&(this.targetRate-=c+t-o,this.targetRate=Math.max(this.targetRate,o-c),s=this.targetRate):s=this.targetRate-c}else this.targetRate<o&&(this.targetRate=o,s=this.targetRate);if(s>0){s=qn(this.totalTargetRateArray,s,5);var u=null===(r=this.peerConnection)||void 0===r?void 0:r.getSenders().filter((function(e){return e.track&&"video"===e.track.kind}));if(!u)return;var l=u.length>1?u[1]:u[0]?u[0]:null;if(!l)return;var d=l.getParameters();d.encodings||(d.encodings=[{}]),d.encodings[0].maxBitrate=s,l.setParameters(d).catch((function(e){n.Xn.error("zc.p.0.heb "+e)}))}},e.prototype.resetEncBitrate=function(){this.needIncMax=!1,this.probeCount=0,this.gotMax=!1,this.initFitCnt=0,this.targetRate=0,this.totalBitrateArray=[],this.totalTargetRateArray=[],this.totalRetransRateArray=[]},e.prototype.replacePublishedTrack=function(e,t,i){return void 0===t&&(t=!1),{errorCode:-1,extendedData:"should install advanced module first"}},e.prototype.sendStreamStatus=function(e,t,i,r){var n=this;void 0===i&&(i=!1),void 0===r&&(r=0),(i||this.camera_status!==e||this.mic_status!==t)&&this.signal&&(this.camera_status=e,this.mic_status=t,r++,this.signal.sendStreamStatus((0,o.getSeq)(),this.sessionId,e,t,this.streamId,(function(){n.camera_status===e&&n.mic_status===t&&r<=1&&n.sendStreamStatus(e,t,!0,r)})))},e.prototype.handleSEIVideoTrack=function(e){"add"==e&&this.sideMediaConfig.track?this._clearCanvasTimer():"remove"!=e||this.sideMediaConfig.track||(this.sideMediaConfig.track=this._addCanvasStreamVideoTrack()),this.seiWorker&&this.seiWorker.postMessage({cmd:"publishStreamType",streamID:this.streamId,onlyAudio:!!this.sideMediaConfig.track})},e.prototype._addCanvasStreamVideoTrack=function(){var e=this;this.canvas=Oe(16,16),this.ctx=this.canvas.getContext("2d"),this.canvasImage=new Image,this.canvasImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAFFJREFUOE9jZGBgaGBgYLBnYGBwYCANHGBgYDjIyMDAcIWBgUGbNL1w1VdBBvwnUzNY26gBo2EwjNLBfjJyIiz7HADlBVB2DiEjR15lYGBYAwAypRSY53SYoAAAAABJRU5ErkJggg==";var t=this.re.engineConfig.blankVideoTrackFrameInterval||100;return this.Xn.info("zc.acsvt frame interval: "+t),this.canvasTimer=setInterval((function(){var t;null===(t=e.ctx)||void 0===t||t.drawImage(e.canvasImage,0,0,16,16)}),t),this.canvas.captureStream().getVideoTracks()[0]},e.prototype.getSpan=function(e,t,i,r){void 0===r&&(r=!1);var n=Yn(this.ve,F.H,this.streamId,e,t,i,r);return n.setAttribute("is_mini",this.te),n},e.prototype.isMultiOuter=function(){return!(!this.re.accessClientIp||!this.streamConnectIP||this.re.accessClientIp===this.streamConnectIP)},e.prototype.isCustomCdn=function(){var e,t;return void 0!==(null===(e=this.publishOption)||void 0===e?void 0:e.cdnUrl)&&""!==(null===(t=this.publishOption)||void 0===t?void 0:t.cdnUrl)},e.prototype.setTurnTcp=function(){this._turnToTcp=this.re.turnToTcp,void 0!==this.re.turnOverTcpOnly&&(this._turnToTcp=this.re.turnOverTcpOnly)},e.prototype.setStreamAlignmentProperty=function(e){var t=this;return new we((function(i){t.signal.gw.streamPropertyUpdate(t.sessionId,t.peerID,e).then((function(r){t.Xn.info("zc.zsap succsess. ".concat(r)),t.mixConfig.alignment=e,i(!0)})).catch((function(e){t.Xn.error("zc.zsap failed. ".concat(e)),i(!1)}))}))},e.prototype.uploadPublishEvent=function(e){this.ve.spanEnd({key:li.event,par:this.streamId},Vu({error:e.code},e),!0)},e}(),tl=__webpack_require__(2100),il=__webpack_require__(1583);tl.util.Long=il,tl.util.Long.fromBits=tl.util.Long?tl.util.Long.fromBits:function(){return 0};for(var rl=tl.roots,nl=tl.types?tl.types.basic:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0,string:2,bytes:2},ol=tl.types?tl.types.packed:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0},sl=Object.keys(nl),al={$:function(e){return al[e]?al[e].call(this):rl[e].decode?rl[e].decode(this,this.uint32()):al.$.call(this,"int32")}},cl={$:function(e,t,i){var r=nl[e];return void 0===r?rl[e].encode?(this.uint32(i<<3|2).fork(),rl[e].encode(t,this).ldelim()):cl.$.call(this,"int32",t,i):cl[e].call(this.uint32(i<<3|r),t)}},ul=0;ul<sl.length;ul++)al[sl[ul]]=tl.Reader.prototype[sl[ul]],cl[sl[ul]]=tl.Writer.prototype[sl[ul]];!function e(t,i,r,n){for(var o=0,s=Object.keys(t);o<s.length;o++){var a=s[o];if(t[a].$m&&Object.keys(t[a].$m).every((function(e){return Number(e)}))){if(r[a])throw Error("nested type ".concat(r,".").concat(a," has already exist"));r[a]=function(t,r){function n(e){for(var i in t){var r=t[i];"{"===r[1].charAt(0)?this[r[0]]={}:"["!==r[1].charAt(0)&&"<"!==r[1].charAt(0)||(this[r[0]]=[])}if(e)for(var n=Object.keys(e),o=0;o<n.length;++o)null!=e[n[o]]&&(this[n[o]]=e[n[o]])}var o={};for(var s in t){var a=t[s],c=a[1];"{"===c.charAt(0)?(n.prototype[a[0]]=tl.util.emptyObject,o[c]={$m:c.substring(1).split(",").map((function(e,t){return["$".concat(t+1),e,null]})).reduce((function(e,t,i){return e[i+1]=t,e}),{})}):n.prototype[a[0]]="["===c.charAt(0)||"<"===c.charAt(0)?tl.util.emptyArray:"bytes"===c?tl.util.newBuffer([]):a[2]&&a[2].hasOwnProperty("low")&&a[2].hasOwnProperty("high")?tl.util.Long.fromBits(a[2].low,a[2].high,a[2].unsigned):a[2]}return n.create=function(e){return new n(e)},n.decode=function(e,i){e instanceof tl.Reader||(e=tl.Reader.create(e));for(var r=void 0===i?e.len:e.pos+i,o=new n;e.pos<r;){var s=e.uint32(),a=s>>>3;if(a>0&&t[a]){var c=t[a][0],u=t[a][1];if("{"===u.charAt(0)){o[c]===tl.util.emptyObject&&(o[c]={});var l=n.$namespace[u].decode(e,e.uint32());o[c][l.$1]=l.$2}else if("["===u.charAt(0)||"<"===u.charAt(0))if(u=u.substring(1),o[c]&&o[c].length||(o[c]=[]),void 0!==ol[u=al[u]||rl[u].decode?u:"int32"]&&2==(7&s))for(var d=e.uint32()+e.pos;e.pos<d;)o[c].push(al.$.call(e,u));else o[c].push(al.$.call(e,u));else o[c]=al.$.call(e,u)}else e.skipType(7&s)}return o},n.encode=function(e,i){for(var r in i||(i=tl.Writer.create()),t){var o=t[r][0],s=t[r][1];if("{"===s.charAt(0)){if(null!=e[o]&&e.hasOwnProperty(o))for(var a=0,c=Object.keys(e[o]);a<c.length;++a)i.uint32(r<<3|2).fork(),n.$namespace[s].encode({$1:c[a],$2:e[o][c[a]]},i).ldelim()}else if("["===s.charAt(0)||"<"===s.charAt(0)){var u="<"===s.charAt(0);s=s.substring(1);var l=e[o];if(null!=l&&l.length)if(s=void 0!==nl[s]||rl[s].encode?s:"int32",u&&void 0!==ol[s]){for(i.uint32(r<<3|2).fork(),a=0;a<l.length;a++)cl[s].call(i,l[a]);i.ldelim()}else for(a=0;a<l.length;a++)cl.$.call(i,s,l[a],r)}else null!=e[o]&&e.hasOwnProperty(o)&&cl.$.call(i,s,e[o],r)}return i},Object.keys(o).length&&(n.$namespace=e(o,i+"."+r,n.$namespace||{},!0)),n}(t[a].$m,a)}else t[a].$s?r[a]=function(e,t){function r(e,t,i){tl.rpc.Service.call(this,e,t,i)}return(r.prototype=Object.create(tl.rpc.Service.prototype)).constructor=r,r.create=function(e,t,i){return new r(e,t,i)},Object.keys(e).forEach((function(n){var o=e[n];function s(e,t){return this.rpcCall(s,rl[o[0]],rl[o[1]],e,t)}Object.defineProperty(s,"name",{value:n}),Object.defineProperty(s,"path",{value:"".concat(i,".").concat(t)}),r.prototype[n]=s})),r}(t[a].$s,a):t[a].$e&&Object.values(t[a].$e).every((function(e){return Number(e)===e}))&&(r[a]=function(e,t){for(var i=Object.keys(e),r={},n=0;n<i.length;n++)r[r[i[n]]=e[i[n]]]=i[n];return r}(t[a].$e));r[a]&&!n&&(rl["".concat(i,".").concat(a)]=r[a]),delete t[a].$m,delete t[a].$s,delete t[a].$e,r[a]=e(t[a],i?"".concat(i,".").concat(a):a,r[a]||{})}return r}({webrtc:{generalpclib:{CmbType:{$e:{CMD_TYPE_BUSINESS_REQUEST:100,CMD_TYPE_BUSINESS_RESPONSE:101}},Header:{$m:{1:["cmd","uint32",0]}}},logreport:{ChargeInfo:{$m:{1:["is_publishing","uint32",0],2:["play_stream_resolution_infos","<webrtc.logreport.ResolutionInfo",null],3:["play_max_audio_bitrate","uint32",0],4:["no_playing","uint32",0],5:["p2p_charge_info","webrtc.logreport.P2PChargeInfo",null],6:["sample_time_offset","uint32",0]}},ChargeInfos:{$m:{1:["timestamp_offset_begin","uint32",0],2:["timestamp_offset_end","uint32",0],3:["timestamp_diff_flag","uint32",0],4:["timestamp_diff","uint32",0],5:["room_id","string",""],100:["infos","<webrtc.logreport.ChargeInfo",null]}},DynQualityEvent:{$m:{1:["seq_no","string",""],2:["num","uint32",0],3:["dyn_quality_infos","<webrtc.logreport.DynQualityInfos",null],4:["device_id","string",""],5:["latitude","uint32",0],6:["longitude","uint32",0],7:["country","string",""],8:["region","string",""],9:["city","string",""],10:["isp","string",""],11:["ve_mode","uint32",0]}},DynQualityInfo:{$m:{1:["time","uint64",{low:0,high:0,unsigned:!0}],2:["plr","uint32",0],3:["rtt","uint32",0],4:["score","uint32",0],5:["sample_time","uint32",0]}},DynQualityInfos:{$m:{1:["timestamp_offset_begin","uint64",{low:0,high:0,unsigned:!0}],2:["timestamp_offset_end","uint64",{low:0,high:0,unsigned:!0}],3:["server_ip","string",""],4:["infos","<webrtc.logreport.DynQualityInfo",null],5:["network_type","uint32",0],6:["stream_id","string",""]}},HardwareInfo:{$m:{1:["sys_cpu_used","uint32",0],2:["app_cpu_used","uint32",0],3:["sys_mem_used","uint32",0],4:["app_mem_used","uint32",0],5:["sample_time_offset","uint32",0]}},HardwareInfos:{$m:{1:["timestamp_offset_begin","uint32",0],2:["timestamp_offset_end","uint32",0],3:["infos","<webrtc.logreport.HardwareInfo",null],4:["sys_mem_total","uint32",0]}},NoBillingEvent:{$m:{1:["platform_info","string",""],2:["room_id","string",""]}},P2PChargeInfo:{$m:{1:["media_inc","uint64",{low:0,high:0,unsigned:!0}],2:["data_inc","uint64",{low:0,high:0,unsigned:!0}]}},PlayQualityInfo:{$m:{1:["audio_bitrate","uint32",0],2:["video_bitrate","uint32",0],3:["video_network_fps","uint32",0],4:["audio_break_count","uint32",0],5:["video_break_count","uint32",0],6:["downlink_plr","uint32",0],7:["peer_to_peer_plr","uint32",0],8:["peer_to_peer_delay","uint32",0],9:["audio_network_fps","uint32",0],10:["audio_break_duration","uint32",0],11:["video_break_duration","uint32",0],12:["audio_break_rate","uint32",0],13:["video_break_rate","uint32",0],14:["audio_break_cancel","uint32",0],15:["video_break_cancel","uint32",0],16:["rtt","uint32",0],17:["rendered_sound_level","uint32",0],18:["audio_break_cancel_duration","uint32",0],19:["video_break_cancel_duration","uint32",0],20:["audio_decode_time","uint32",0],21:["video_decode_time","uint32",0],22:["real_sampling_interval","uint32",0],23:["mos","int32",0],24:["audio_decode_fps","uint32",0],25:["video_decode_fps","uint32",0],26:["video_frames_decoded","uint32",0],27:["video_frames_dropped","uint32",0],28:["quality","int32",0],29:["evaluation_quality","int32",0],30:["break_stat_duration","uint32",0],31:["sample_time_offset","uint32",0],32:["peer_to_peer_net_delay","uint32",0],33:["audio_render_fps","uint32",0],100:["sample_time_window","uint32",0]}},PlayQualityInfos:{$m:{1:["timestamp_offset_begin","uint32",0],2:["timestamp_offset_end","uint32",0],3:["stream_id","string",""],4:["session_id","uint32",0],5:["video_width","uint32",0],6:["video_height","uint32",0],7:["ipv4","uint32",0],8:["ipv6","string",""],9:["resource_type","uint32",0],10:["infos","<webrtc.logreport.PlayQualityInfo",null],11:["room_id","string",""],13:["session","string",""],14:["room_session_id","uint64",{low:0,high:0,unsigned:!0}],15:["protocol_type","uint32",0],16:["product","uint32",0],17:["resource_flag","uint32",0]}},PublishQualityInfo:{$m:{1:["audio_bitrate","uint32",0],2:["video_bitrate","uint32",0],3:["video_capture_fps","uint32",0],4:["video_network_fps","uint32",0],5:["uplink_plr","uint32",0],6:["rtt","uint32",0],7:["audio_network_fps","uint32",0],8:["captured_sound_level","uint32",0],9:["quality","uint32",0],10:["sample_time_offset","uint32",0],11:["tc_setting_audio_bitrate","uint32",0],12:["tc_setting_video_bitrate","uint32",0],13:["audio_capture_fps","uint32",0],100:["sample_time_window","uint32",0]}},PublishQualityInfos:{$m:{1:["timestamp_offset_begin","uint32",0],2:["timestamp_offset_end","uint32",0],3:["stream_id","string",""],4:["session_id","uint32",0],5:["video_width","uint32",0],6:["video_height","uint32",0],7:["ipv4","uint32",0],8:["ipv6","string",""],9:["resource_type","uint32",0],10:["infos","<webrtc.logreport.PublishQualityInfo",null],11:["room_id","string",""],13:["evnvironment","uint32",0],14:["ap","string",""],15:["session","string",""],16:["room_session_id","uint64",{low:0,high:0,unsigned:!0}],17:["protocol_type","uint32",0],18:["setting_video_bitrate","uint32",0],19:["setting_audio_bitrate","uint32",0],20:["setting_video_fps","uint32",0],21:["resource_flag","uint32",0]}},QualityEvent:{$m:{1:["hardware_infos","webrtc.logreport.HardwareInfos",null],2:["publish_quality_infos","<webrtc.logreport.PublishQualityInfos",null],3:["play_quality_infos","<webrtc.logreport.PlayQualityInfos",null],4:["network_type","uint32",0],5:["charge_infos","webrtc.logreport.ChargeInfos",null],6:["server_time","int64",{low:0,high:0,unsigned:!1}],100:["client_type","uint32",0]},ResourceType:{$e:{UNKNOWN:0,CDN:1,RTC:2,L3:3,P2P:4}}},ResolutionInfo:{$m:{1:["video_width","uint32",0],2:["video_height","uint32",0],3:["count","uint32",0]}},SpeedLogHead:{$m:{1:["version","uint32",0],2:["signature","bytes",[]],3:["timestamp","uint32",0],4:["event","uint32",0],5:["app_id","uint32",0],6:["user_id","string",""],7:["biz_type","uint32",0],8:["device_id","string",""],9:["lite_sign","bytes",[]],10:["token","bytes",[]],11:["os_type","string",""],12:["sdk_version","string",""],13:["time_offset","int64",{low:0,high:0,unsigned:!1}],14:["scenario","uint32",0],15:["report_version","uint32",0]},BizType:{$e:{UNKNOWN:0,LIVE:1,RTV:2}},Event:{$e:{QUALITY_EVENT:0,NO_BILLING_EVENT:100,DETECT_QUALITY_EVENT:300}},ProtoVersion:{$e:{PROTO_VERSION:0,PROTO_VERSION1:1,PROTO_VERSION2:2,PROTO_VERSION3:3,PROTO_VERSION4:4,PROTO_VERSION5:5,PROTO_VERSION6:6,PROTO_VERSION7:7,PROTO_VERSION8:8,PROTO_VERSION9:9,PROTO_VERSION10:10,PROTO_VERSION11:11,PROTO_VERSION12:12,PROTO_VERSION13:13,PROTO_VERSION14:14,PROTO_VERSION15:15,PROTO_VERSION16:16,PROTO_VERSION17:17,PROTO_VERSION18:18,PROTO_VERSION19:19}},ZegoScenario:{$e:{ZEGO_SCENARIO_GENERAL:0,ZEGO_SCENARIO_COMMUNICATION:1,ZEGO_SCENARIO_LIVE:2,ZEGO_SCENARIO_DEFAULT:3,ZEGO_SCENARIO_STANDARD_VIDEO_CALL:4,ZEGO_SCENARIO_HIGH_QUALITY_VIDEO_CALL:5,ZEGO_SCENARIO_STANDARD_CHATROOM:6,ZEGO_SCENARIO_HIGH_QUALITY_CHATROOM:7,ZEGO_SCENARIO_BROADCAST:8,ZEGO_SCENARIO_KARAOKE:9,ZEGO_SCENARIO_STANDARD_VOICE_CALL:10,ZEGO_SCENARIO_UNDEFINED:99}}},SpeedLogRsp:{$m:{1:["code","uint32",0],2:["message","string",""]}}},webrtc_cmd:{MediaCodecErrorAck:{$m:{1:["result","sint32",0]}},MediaCodecErrorNotify:{$m:{1:["media_type","sint32",0],2:["error_type","sint32",0]}},MetadataAck:{$m:{1:["result","sint32",0]}},MetadataPush:{$m:{1:["width","uint32",0],2:["height","uint32",0]}},NetQualityGradeAck:{$m:{1:["result","sint32",0]}},NetQualityGradePush:{$m:{1:["tx_quality","sint32",0],2:["rx_quality","sint32",0]}},NetQualityGradeReq:{$m:{1:["tx_quality","sint32",0],2:["rx_quality","sint32",0]}},NetQualityGradeRsp:{$m:{1:["result","sint32",0]}},PeerExtendParamPush:{$m:{1:["turn_username","string",""],2:["turn_auth_key","string",""],3:["candidate","string",""],4:["sdpMid","string",""],5:["sdpMLineIndex","sint32",0]}},PeerExtendParams:{$m:{1:["keyframe_intv","sint32",0],2:["min_play_buf_level_ms","sint32",0],3:["tc_type","sint32",0],4:["video_content_type","sint32",0],5:["sei_filter_pass","sint32",0],6:["client_class_type","sint32",0],7:["video_stream_type","sint32",0],8:["ktv_device_delay","sint32",0],9:["sync_ntp","sint32",0],10:["auto_switch_turn_type","sint32",0],11:["zg_proxy","sint32",0],12:["coturn_internal","uint32",0]}},StreamPropertyUpdate:{$m:{1:["enable_stream_alignment_when_mix","sint32",0]}},StreamPropertyUpdateAck:{$m:{1:["result","sint32",0]}},UserUnregisteredSEIFilterReq:{$m:{1:["sei_filter","string",""]}},UserUnregisteredSEIFilterRsp:{$m:{1:["result","sint32",0]}},VideoStreamChangeAck:{$m:{1:["result","sint32",0]}},VideoStreamChangePush:{$m:{1:["change_type","uint32",0],2:["video_type","uint32",0]}},VideoStreamFallbackTypeReq:{$m:{1:["type","uint32",0]}},VideoStreamFallbackTypeRsp:{$m:{1:["result","sint32",0]}},VideoStreamSubscribeReq:{$m:{1:["type","uint32",0]}},VideoStreamSubscribeRsp:{$m:{1:["result","sint32",0]}},WebrtcCmdReqMsg:{$m:{1:["meta_data_push","webrtc.webrtc_cmd.MetadataPush",null],2:["video_stream_sub","webrtc.webrtc_cmd.VideoStreamSubscribeReq",null],3:["video_fallback_type","webrtc.webrtc_cmd.VideoStreamFallbackTypeReq",null],4:["video_change_push","webrtc.webrtc_cmd.VideoStreamChangePush",null],5:["usr_sei_filter","webrtc.webrtc_cmd.UserUnregisteredSEIFilterReq",null],6:["net_quality_grade","webrtc.webrtc_cmd.NetQualityGradeReq",null],7:["net_quality_grade_push","webrtc.webrtc_cmd.NetQualityGradePush",null],8:["peer_extend_param","webrtc.webrtc_cmd.PeerExtendParams",null],9:["stream_property_update","webrtc.webrtc_cmd.StreamPropertyUpdate",null],10:["peer_ext_params_push","webrtc.webrtc_cmd.PeerExtendParamPush",null],11:["codec_error_notify","webrtc.webrtc_cmd.MediaCodecErrorNotify",null]}},WebrtcCmdRspMsg:{$m:{1:["meta_data_ack","webrtc.webrtc_cmd.MetadataAck",null],2:["video_stream_sub","webrtc.webrtc_cmd.VideoStreamSubscribeRsp",null],3:["video_fallback_type","webrtc.webrtc_cmd.VideoStreamFallbackTypeRsp",null],4:["video_change_ack","webrtc.webrtc_cmd.VideoStreamChangeAck",null],5:["usr_sei_filter","webrtc.webrtc_cmd.UserUnregisteredSEIFilterRsp",null],6:["net_quality_grade","webrtc.webrtc_cmd.NetQualityGradeRsp",null],7:["net_quality_grade_ack","webrtc.webrtc_cmd.NetQualityGradeAck",null],8:["stream_property_update_ack","webrtc.webrtc_cmd.StreamPropertyUpdateAck",null],9:["codec_error_notify_ack","webrtc.webrtc_cmd.MediaCodecErrorAck",null]}}},webrtc_proto_v2:{ActivateAudioPlayStreamReq:{$m:{1:["active","sint32",0]}},ActivateAudioPlayStreamRsp:{$m:{1:["result","sint32",0]}},ActivateSEIInsertReq:{$m:{1:["peer_id","uint32",0],2:["action","sint32",0],3:["info_type","uint32",0]}},ActivateSEIInsertRsp:{$m:{1:["peer_id","uint32",0],2:["result","sint32",0]}},ActivateVideoPlayStreamReq:{$m:{1:["active","sint32",0],2:["layer","sint32",0]}},ActivateVideoPlayStreamRsp:{$m:{1:["result","sint32",0]}},BroadcasterStatusAck:{$m:{1:["result","sint32",0]}},BroadcasterStatusNotify:{$m:{1:["status","uint32",0]}},CandidateInfoAck:{$m:{1:["result","sint32",0]}},CandidateInfoPush:{$m:{1:["infos","<webrtc.webrtc_proto_v2.OneCandidateInfo",null]}},CandidateInfoReq:{$m:{1:["infos","<webrtc.webrtc_proto_v2.OneCandidateInfo",null]}},CandidateInfoRsp:{$m:{1:["result","sint32",0]}},ClientInfoAck:{$m:{1:["result","sint32",0]}},ClientInfoPush:{$m:{1:["peer_id","uint32",0],2:["client_ip","string",""]}},CloseSessionAck:{$m:{1:["result","sint32",0]}},CloseSessionPush:{$m:{1:["reason","sint32",0],2:["err_info","string",""]}},CloseSessionReq:{$m:{1:["reason","sint32",0]}},CloseSessionRsp:{$m:{1:["result","sint32",0]}},CmdAck:{$m:{1:["peer_id","uint32",0],2:["cmd_id","uint32",0],3:["body","bytes",[]]}},CmdPush:{$m:{1:["peer_id","uint32",0],2:["cmd_id","uint32",0],3:["body","bytes",[]]}},CmdReq:{$m:{1:["peer_id","uint32",0],2:["cmd_id","uint32",0],3:["body","bytes",[]]}},CmdRsp:{$m:{1:["peer_id","uint32",0],2:["cmd_id","uint32",0],3:["body","bytes",[]]}},CmdType:{$e:{NONE:0,LOGIN_REQ:1,LOGIN_RSP:2,CREATE_SESSION_REQ:3,CREATE_SESSION_RSP:4,CREATE_SESSION_WITH_SDP_REQ:5,CREATE_SESSION_WITH_SDP_RSP:6,SESSION_RESET_PUSH:7,SESSION_RESET_ACK:8,PUBLISH_EVENT_PUSH:9,PLAY_EVENT_PUSH:10,MEDIA_DESC_REQ:11,MEDIA_DESC_RSP:12,CANDIDATE_INFO_REQ:13,CANDIDATE_INFO_RSP:14,CLOSE_SESSION_REQ:15,CLOSE_SESSION_RSP:16,MEDIA_DESC_PUSH:17,MEDIA_DESC_ACK:18,CANDIDATE_INFO_PUSH:19,CANDIDATE_INFO_ACK:20,CLOSE_SESSION_PUSH:21,CLOSE_SESSION_ACK:22,STREAM_STATUS_NOTIFY:23,STREAM_STATUS_NOTIFY_ACK:24,STREAM_STATUS_NOTIFY_PUSH:25,STREAM_STATUS_NOTIFY_PUSH_ACK:26,BROADCASTER_STATUS_NOTIFY:27,BROADCASTER_STATUS_ACK:28,ACTIVATE_AUDIO_PLAY_STREAM_REQ:29,ACTIVATE_AUDIO_PLAY_STREAM_RSP:30,ACTIVATE_VIDEO_PLAY_STREAM_REQ:31,ACTIVATE_VIDEO_PLAY_STREAM_RSP:32,CLIENT_INFO_PUSH:33,CLIENT_INFO_ACK:34,NET_QUALITY_PROBE_REQ:35,NET_QUALITY_PROBE_RSP:36,NET_QUALITY_INFO_PUSH:37,NET_QUALITY_INFO_ACK:38,ACTIVATE_SEI_INSERT_REQ:39,ACTIVATE_SEI_INSERT_RSP:40,PEER2_PEER_NET_STATS_GET_REQ:41,PEER2_PEER_NET_STATS_GET_RSP:42,CMD_REQ:43,CMD_RSP:44,CMD_PUSH:45,CMD_ACK:46,WEBRTC_DISPATCH_REQ:47,WEBRTC_DISPATCH_RSP:48}},CreateSessionReq:{$m:{1:["type","sint32",0],2:["stream_id","string",""],3:["turn_server_host","string",""],4:["roomid","string",""],5:["strAuthParam","string",""],6:["params","string",""],7:["area_type","int32",0],8:["area_id_list","<int32",null]}},CreateSessionRsp:{$m:{1:["result","sint32",0],2:["turn_server","string",""],3:["turn_username","string",""],4:["turn_auth_key","string",""],5:["session_id","uint32",0],6:["session_token","string",""],7:["gw_version","uint32",0],8:["gw_nodes","<string",null],9:["gw_nodes_ttl","uint32",0],10:["client_ip","string",""]}},CreateSessionWithSdpReq:{$m:{1:["type","sint32",0],2:["stream_id","string",""],3:["sdp","string",""],4:["mini_sdp","bytes",[]],5:["media_server_host","string",""],6:["strAuthParam","string",""],7:["roomid","string",""],8:["params","string",""],9:["params_ext","bytes",[]],10:["area_type","int32",0],11:["area_id_list","<int32",null]}},CreateSessionWithSdpRsp:{$m:{1:["result","sint32",0],2:["gw_version","uint32",0],3:["sdp","string",""],4:["mini_sdp","bytes",[]],5:["session_token","string",""],6:["gw_nodes","<string",null],7:["gw_nodes_ttl","uint32",0],8:["client_ip","string",""],9:["params_ext","bytes",[]]}},DenyInfo:{$m:{1:["action","uint32",0],2:["err","uint32",0],3:["ins","<webrtc.webrtc_proto_v2.IpPort",null],4:["action_delay","uint32",0]}},Head:{$m:{1:["cmd","uint32",0],2:["seq","uint32",0],3:["session_id","uint32",0]}},IpPort:{$m:{1:["Ip","string",""],2:["Port","uint32",0]}},LoginReq:{$m:{1:["appid","uint32",0],2:["user_id","string",""],3:["tokenType","int32",0],4:["token","string",""],5:["sessions","<webrtc.webrtc_proto_v2.SessionInfo",null],6:["roomid","string",""],7:["sdk_version","uint32",0],8:["app","string",""],9:["net_mode","int32",0]}},LoginRsp:{$m:{1:["result","int32",0],2:["tokenType","int32",0],3:["token","string",""]}},MediaDescAck:{$m:{1:["result","sint32",0]}},MediaDescPush:{$m:{1:["type","uint32",0],2:["sdp","string",""],3:["mini_sdp","bytes",[]]}},MediaDescReq:{$m:{1:["type","uint32",0],2:["update","uint32",0],3:["sdp","string",""],4:["mini_sdp","bytes",[]],5:["params_ext","bytes",[]]}},MediaDescRsp:{$m:{1:["result","sint32",0],2:["sdp","string",""],3:["mini_sdp","bytes",[]]}},NetQualityInfoAck:{$m:{1:["peer_id","uint32",0],2:["result","sint32",0]}},NetQualityInfoPush:{$m:{1:["peer_id","uint32",0],2:["lossrate","uint32",0],3:["rtt","uint32",0]}},NetQualityProbeReq:{$m:{1:["peer_id","uint32",0],2:["action","sint32",0]}},NetQualityProbeRsp:{$m:{1:["peer_id","uint32",0],2:["result","sint32",0]}},OneCandidateInfo:{$m:{1:["candidate","string",""],2:["sdpMid","string",""],3:["sdpMLineIndex","sint32",0]}},Peer2PeerNetStatsGetReq:{$m:{1:["peer_id","uint32",0]}},Peer2PeerNetStatsGetRsp:{$m:{1:["result","sint32",0],2:["peer_id","uint32",0],3:["p2p_lost_rate","uint32",0],4:["p2p_rtt","uint32",0]}},PlayEventPush:{$m:{1:["event","sint32",0]}},PublishEventPush:{$m:{1:["event","sint32",0]}},SessionInfo:{$m:{1:["session_id","uint32",0],2:["session_token","string",""]}},SessionResetAck:{$m:{1:["result","sint32",0]}},SessionResetPush:{$m:{1:["dwTimeStamp","uint32",0],2:["cResetType","uint32",0],3:["session_ids","<uint32",null]}},StreamStatusNotify:{$m:{1:["mic_status","sint32",0],2:["camera_status","sint32",0]}},StreamStatusNotifyAck:{$m:{1:["result","sint32",0]}},StreamStatusNotifyPush:{$m:{1:["mic_status","sint32",0],2:["camera_status","sint32",0]}},StreamStatusNotifyPushAck:{$m:{1:["result","sint32",0]}},WebRTCDispatchReq:{$m:{1:["type","sint32",0],2:["stream_id","string",""],10:["area_type","int32",0],11:["area_id_list","<int32",null]}},WebRTCDispatchRsp:{$m:{1:["gw_nodes","<string",null],2:["gw_nodes_ttl","uint32",0],3:["client_ip","string",""],4:["result","sint32",0]}}}}},"",rl,!1);var ll,dl,hl,pl=rl.webrtc,fl=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},ml=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},vl=pl.webrtc_cmd,gl=function(){function e(e,t,i){this.Xn=e,this.streamSignal=t,this.re=i,this.callbackMap={},this.pushCmdSeqs={}}return e.prototype.streamPropertyUpdate=function(e,t,i){return fl(this,void 0,void 0,(function(){var r=this;return ml(this,(function(n){return[2,new we((function(n,o){var s=vl.WebrtcCmdReqMsg.encode({stream_property_update:{enable_stream_alignment_when_mix:i}}).finish();r.streamSignal.sendGWCmd(e,{peer_id:t,cmd_id:9},s,(function(e,t,i){var r=vl.WebrtcCmdRspMsg.decode(i.body);r.stream_property_update_ack?n(r.stream_property_update_ack.result):o(r)}),(function(e){o(e)}))}))]}))}))},e.prototype.mediaStreamSEIUUIDReq=function(e,t,i){return fl(this,void 0,void 0,(function(){var r=this;return ml(this,(function(n){return[2,new we((function(n,o){var s=vl.WebrtcCmdReqMsg.encode({usr_sei_filter:{sei_filter:i}}).finish();r.streamSignal.sendGWCmd(e,{peer_id:t,cmd_id:5},s,(function(e,t,i){var r=vl.WebrtcCmdRspMsg.decode(i.body);$n(r[Object.keys(r)[0]]),n(r)}),(function(e){o(e)}))}))]}))}))},e.prototype.sendGWAck=function(e,t,i,r,n){var o;void 0===n&&(n=0);var s=vl.WebrtcCmdRspMsg.encode((o={},o[i]={result:n},o)).finish();this.streamSignal.sendGWAck(e,{peer_id:t,cmd_id:r},s)},e.prototype.registerPushCallback=function(e,t,i){var r,n=this,o=this.callbackMap[t];o?o[e]=i:(this.callbackMap[t]=((r={})[e]=i,r),this.pushCmdSeqs[t]={},this.streamSignal.registerPushCallback("CmdPush",t,(function(t,i,r){var o=performance.now();if(n.pushCmdSeqs[i][r.cmd_id]){var s=n.pushCmdSeqs[i][r.cmd_id],a=s.seq;if(void 0!==a&&a>=t&&o-s.time<6e3)return void n.Xn.warn("zc.gs.rpc"+" ".concat(i," CdmPush order ").concat(e," ").concat(r.cmd_id," local: ").concat(a," seq ").concat(t))}n.pushCmdSeqs[i][r.cmd_id]={seq:t,time:o};var c=n.re.useNetAgent?r.body:fo(r.body),u=vl.WebrtcCmdReqMsg.decode(c),l=Object.keys(u)[0];$n(u[l=l||"meta_data_push"]);var d=n.callbackMap[i];if(d){var h=d[l];h&&h(t,i,u)}})))},e.prototype.unregisterPushCallback=function(e,t){var i=this.callbackMap[t];i&&(delete i[e],0===Object.keys(i).length&&(this.streamSignal.unregisterPushCallback("CmdPush",t),delete this.callbackMap[t],delete this.pushCmdSeqs[t]))},e}();!function(e){e[e.Connected=0]="Connected",e[e.Disconnected=1]="Disconnected",e[e.Broken=2]="Broken"}(ll||(ll={})),function(e){e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL"}(dl||(dl={})),function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(hl||(hl={}));var yl,bl=function(){function e(e,t,i,r,n){var s=this;this.server=e,this.netAgent=t,this.signalConfig=i,this.Xn=r,this.re=n,this.readyState=hl.CLOSED,this.isActive=!1,this.accessServerState=ll.Disconnected,this.originAccessServerState=ll.Disconnected,this.mediaServerState=ll.Disconnected,this.originMediaServerState=ll.Disconnected,this.eventHandler={accessDisconnect:function(){s.setAccessServerState(ll.Disconnected)},accessConnect:function(){s.setAccessServerState(ll.Connected)},accessBroken:function(){s.setAccessServerState(ll.Broken)},mediaDisconnect:function(){s.setMediaServerState(ll.Disconnected)},mediaConnect:function(e){s.setMediaServerState(ll.Connected,e)},mediaBroken:function(){s.setMediaServerState(ll.Broken)}},this.wsHandler=t.getPCRequest("unified_rtc"===e?o.BusinessService.SERVICE_WEBRTC_SIGNAL:o.BusinessService.SERVICE_L3_WEBRTC_SIGNAL,{path:i.path,query:i.query,encode:i.encode,messageType:i.messageType,isMsgCache:!1}),this.setAccessServerState(t.isConnect()?ll.Connected:ll.Disconnected),this.setMediaServerState(0===this.wsHandler.connectState?ll.Connected:ll.Disconnected)}return e.prototype.updateAccessReadyState=function(){this.isActive&&this.accessServerState===ll.Connected&&this.mediaServerState!==ll.Connected?this.onreconnnecting&&this.onreconnnecting():this.accessServerState===ll.Disconnected&&this.Xn.warn("zc.as.uars access timeout")},e.prototype.updateMediaReadyState=function(e){return this.Xn.info("zc.as.umrs "+e),this.mediaServerState===ll.Connected?(this.originMediaServerState===ll.Broken&&e===dl.AUTO&&this.onreconnnecting&&this.onreconnnecting(),void(this.readyState!==hl.OPEN&&(this.readyState=hl.OPEN,this.onopen&&this.onopen()))):this.mediaServerState===ll.Disconnected?(this.wsHandler.off("connected",this.eventHandler.mediaConnect),this.wsHandler.off("disconnected",this.eventHandler.mediaDisconnect),this.wsHandler.off("broken",this.eventHandler.mediaBroken),this.wsHandler.off("downLoadMessage"),this.netAgent.off("connected",this.eventHandler.accessConnect),this.netAgent.off("disconnected",this.eventHandler.accessDisconnect),this.netAgent.off("broken",this.eventHandler.accessBroken),void(this.readyState!==hl.CLOSED&&(this.readyState=hl.CLOSED,this.onclose&&this.onclose()))):void(this.mediaServerState===ll.Broken&&(this.readyState=hl.CONNECTING,this.onerror&&this.onerror(new Event("signal connecting"))))},Object.defineProperty(e.prototype,"ve",{get:function(){return this.re.reporter},enumerable:!1,configurable:!0}),e.prototype.setMediaServerState=function(e,t){this.Xn.info(ga+" "+e+" "+t),this.mediaServerState!==e?(this.originMediaServerState=this.mediaServerState,this.mediaServerState=e,this.updateMediaReadyState(t)):this.Xn.info(ga+" same state")},e.prototype.setAccessServerState=function(e){this.Xn.info(ya+" "+e),this.accessServerState!==e?(this.originAccessServerState=this.accessServerState,this.accessServerState=e,this.updateAccessReadyState()):this.Xn.info(ya+" same state")},e.prototype.open=function(){var e=this;this.isActive=!0,this.Xn.info("zc.as.op state "+this.mediaServerState),this.mediaServerState===ll.Disconnected&&(this.wsHandler.on("connected",this.eventHandler.mediaConnect),this.wsHandler.on("disconnected",this.eventHandler.mediaDisconnect),this.wsHandler.on("broken",this.eventHandler.mediaBroken),this.netAgent.on("connected",this.eventHandler.accessConnect),this.netAgent.on("disconnected",this.eventHandler.accessDisconnect),this.netAgent.on("broken",this.eventHandler.accessBroken),this.wsHandler.on("downLoadMessage",(function(t,i){e.onmessage({data:t,extras:i})})),this.wsHandler.off("pcBrokenEvent"),this.wsHandler.on("pcBrokenEvent",(function(t){var i=tn,r=e.ve.createSpan(F.H,{key:$r},{key:""},i.event);r.setAttributes({service_no:i.service_no(null==t?void 0:t.service_no)}),r.end()})),this.wsHandler.off("pcDisconnectedEvent"),this.wsHandler.on("pcDisconnectedEvent",(function(t){var i=rn,r=e.ve.createSpan(F.H,{key:$r},{key:""},i.event);r.setAttributes({service_no:i.service_no(null==t?void 0:t.service_no)}),r.end()})),this.wsHandler.off("pcConnectedEvent"),this.wsHandler.on("pcConnectedEvent",(function(t){var i=en,r=e.ve.createSpan(F.H,{key:$r},{key:""},i.event);r.setAttributes({service_no:i.service_no(t.service_no),recv_time:i.recv_time((new Date).getTime()),proxy_link_sources:i.proxy_link_sources(t.proxy_link_sources),connect_stream:i.connect_stream(t.connect_stream)}),r.end()})))},e.prototype.close=function(){this.Xn.info("zc.as.c call"),this.isActive=!1,this.wsHandler.off("connected",this.eventHandler.mediaConnect),this.wsHandler.off("disconnected",this.eventHandler.mediaDisconnect),this.wsHandler.off("broken",this.eventHandler.mediaBroken),this.wsHandler.off("downLoadMessage"),this.netAgent.off("connected",this.eventHandler.accessConnect),this.netAgent.off("disconnected",this.eventHandler.accessDisconnect),this.netAgent.off("broken",this.eventHandler.accessBroken),this.wsHandler.closeRequest()},e.prototype.send=function(e,t,i,r){var n=this;this.wsHandler.sendRequest({payload:e,ack:t,isInSendMap:i},(function(e){n.Xn.info(ba+" fail "+e),n.onerror&&n.onerror(e)}),(function(e){n.Xn.info(ba+" suc "+e)}),r)},e.prototype.onopen=function(){},e.prototype.onclose=function(e){},e.prototype.onerror=function(e){},e.prototype.onmessage=function(e){},e.prototype.onreconnnecting=function(){},e}();!function(e){e[e.LoginReq=1]="LoginReq",e[e.LoginRsp=2]="LoginRsp",e[e.CreateSessionReq=3]="CreateSessionReq",e[e.CreateSessionRsp=4]="CreateSessionRsp",e[e.CreateSessionWithSdpReq=5]="CreateSessionWithSdpReq",e[e.CreateSessionWithSdpRsp=6]="CreateSessionWithSdpRsp",e[e.SessionResetPush=7]="SessionResetPush",e[e.SessionResetAck=8]="SessionResetAck",e[e.PublishEventPush=9]="PublishEventPush",e[e.PlayEventPush=10]="PlayEventPush",e[e.MediaDescReq=11]="MediaDescReq",e[e.MediaDescRsp=12]="MediaDescRsp",e[e.CandidateInfoReq=13]="CandidateInfoReq",e[e.CandidateInfoRsp=14]="CandidateInfoRsp",e[e.CloseSessionReq=15]="CloseSessionReq",e[e.CloseSessionRsp=16]="CloseSessionRsp",e[e.MediaDescPush=17]="MediaDescPush",e[e.MediaDescAck=18]="MediaDescAck",e[e.CandidateInfoPush=19]="CandidateInfoPush",e[e.CandidateInfoAck=20]="CandidateInfoAck",e[e.CloseSessionPush=21]="CloseSessionPush",e[e.CloseSessionAck=22]="CloseSessionAck",e[e.StreamStatusNotify=23]="StreamStatusNotify",e[e.StreamStatusNotifyAck=24]="StreamStatusNotifyAck",e[e.StreamStatusNotifyPush=25]="StreamStatusNotifyPush",e[e.StreamStatusNotifyPushAck=26]="StreamStatusNotifyPushAck",e[e.BroadcasterStatusNotify=27]="BroadcasterStatusNotify",e[e.BroadcasterStatusAck=28]="BroadcasterStatusAck",e[e.ActivateAudioPlayStreamReq=29]="ActivateAudioPlayStreamReq",e[e.ActivateAudioPlayStreamRsp=30]="ActivateAudioPlayStreamRsp",e[e.ActivateVideoPlayStreamReq=31]="ActivateVideoPlayStreamReq",e[e.ActivateVideoPlayStreamRsp=32]="ActivateVideoPlayStreamRsp",e[e.ClientInfoPush=33]="ClientInfoPush",e[e.ClientInfoAck=34]="ClientInfoAck",e[e.NetQualityProbeReq=35]="NetQualityProbeReq",e[e.NetQualityProbeRsp=36]="NetQualityProbeRsp",e[e.NetQualityInfoPush=37]="NetQualityInfoPush",e[e.NetQualityInfoAck=38]="NetQualityInfoAck",e[e.ActivateSEIInsertReq=39]="ActivateSEIInsertReq",e[e.ActivateSEIInsertRsp=40]="ActivateSEIInsertRsp",e[e.Peer2PeerNetStatsGetReq=41]="Peer2PeerNetStatsGetReq",e[e.Peer2PeerNetStatsGetRsp=42]="Peer2PeerNetStatsGetRsp",e[e.CmdReq=43]="CmdReq",e[e.CmdRsp=44]="CmdRsp",e[e.CmdPush=45]="CmdPush",e[e.CmdAck=46]="CmdAck",e[e.WebRTCDispatchReq=47]="WebRTCDispatchReq",e[e.WebRTCDispatchRsp=48]="WebRTCDispatchRsp"}(yl||(yl={}));var _l={1:"LoginReq",2:"LoginRsp",3:"CreateSessionReq",4:"CreateSessionRsp",5:"CreateSessionWithSdpReq",6:"CreateSessionWithSdpRsp",7:"SessionResetPush",8:"SessionResetAck",9:"PublishEventPush",10:"PlayEventPush",11:"MediaDescReq",12:"MediaDescRsp",13:"CandidateInfoReq",14:"CandidateInfoRsp",15:"CloseSessionReq",16:"CloseSessionRsp",17:"MediaDescPush",18:"MediaDescAck",19:"CandidateInfoPush",20:"CandidateInfoAck",21:"CloseSessionPush",22:"CloseSessionAck",23:"StreamStatusNotify",24:"StreamStatusNotifyAck",25:"StreamStatusNotifyPush",26:"StreamStatusNotifyPushAck",27:"BroadcasterStatusNotify",28:"BroadcasterStatusAck",29:"ActivateAudioPlayStreamReq",30:"ActivateAudioPlayStreamRsp",31:"ActivateVideoPlayStreamReq",32:"ActivateVideoPlayStreamRsp",33:"ClientInfoPush",34:"ClientInfoAck",35:"NetQualityProbeReq",36:"NetQualityProbeRsp",37:"NetQualityInfoPush",38:"NetQualityInfoAck",39:"ActivateSEIInsertReq",40:"ActivateSEIInsertRsp",41:"Peer2PeerNetStatsGetReq",42:"Peer2PeerNetStatsGetRsp",43:"CmdReq",44:"CmdRsp",45:"CmdPush",46:"CmdAck",47:"WebRTCDispatchReq",48:"WebRTCDispatchRsp"},Sl=function(){return Sl=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Sl.apply(this,arguments)},Tl=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},El=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Cl=pl.webrtc_proto_v2,wl=pl.webrtc_cmd,Il=pl.generalpclib,Rl=function(){function e(e,t,i){this.re=e,this.Xn=t,this.isV2=!1,this.isV2=i}return e.prototype.mediaLogin=function(e,t){var i;if(this.isV2){var r=e.token,n={appid:this.re.appid,user_id:this.re.idName,token:r,tokenType:e.tokenType,sessions:e.sessions,roomid:e.roomid,sdk_version:this.re.sdkVerNum,app:t,net_mode:this.re.netMode};this.Xn.info("".concat(is," LoginReq ").concat(JSON.stringify(Sl(Sl({},n),{token:void 0}))," ")),this.Xn.remoteReport("".concat(is," token ").concat(r,")} ")),i=this.encodePBBody("LoginReq",n)}else i=e;return i},e.prototype.createSession=function(e,t,i,r,n,o,a,c,u){var l;if(void 0===n&&(n=""),void 0===o&&(o=""),this.isV2){var d={type:t,stream_id:r,turn_server_host:ln(o)?o:"",strAuthParam:n,params:a,area_type:u.type,area_id_list:u.areaList};this.re.isMultiRoom&&(d.roomid=c),this.Xn.info("".concat("zc.wcs.cs.1"," ").concat(r," ").concat(e," ").concat(JSON.stringify(d)," ")),l=this.encodePBBody(e,d)}else{var h="";s.split(".").forEach((function(e,t){return h+=1==e.length&&1==t?"0"+e:e}));var p=this.re.browserInfo;l={type:t,stream_id:r,platform:navigator.platform,browser:p.name,version:p.version,app_id:this.re.appid+"",negotiate_mode:i,strAuthParam:n,sdk_version:1*h,turn_server_host:ln(o)?o:"",params:a}}return l},e.prototype.createSessionWithSdp=function(e,t,i,r){var n=this,o=t.type,a=t.streamId,c=t.strAuthParam,u=t.sdp,l=t.serverHost,d=t.playBufLevel,h=t.params,p=t.paramsExt,f=t.roomID,m=t.geo,v=t.player,g=function(i){var r,v,g=(null===(r=t.videoInfo)||void 0===r?void 0:r.keyFrameInterval)||2;if(n.isV2){var y=n.getParamsExt(p,d,g),b={type:o,stream_id:a,media_server_host:ln(l)?l:"",strAuthParam:c,params:h,params_ext:y,area_type:m.type,area_id_list:m.areaList};i?b.mini_sdp=i:b.sdp=u,n.re.isMultiRoom&&(b.roomid=f),n.Xn.info(rs+" "+a+" "+e+" params: "+JSON.stringify(Sl(Sl({},b),{sdp:void 0,mini_sdp:void 0,params_ext:y.toString()}))),performance.now(),v=n.encodePBBody(e,b)}else{var _="";s.split(".").forEach((function(e,t){return _+=1==e.length&&1==t?"0"+e:e}));var S={type:o,app_id:n.re.appid+"",stream_id:a,sdp:i.length?i:u,user_id:n.re.idName,platform:navigator.platform,browser:n.re.browserInfo.name,sdk_vers:parseInt(_),clientIp:"",media_server_host:ln(l)?l:"",strAuthParam:c,params:h,keyframe_intv:parseInt(g)};d&&(S.min_play_buf_level_ms=d),n.Xn.info(rs+" "+a+" "+e+" params: "+JSON.stringify(Sl(Sl({},S),{sdp:void 0}))),v=S}return v},y=v.te;if(this.Xn.info("".concat(rs," ").concat(a," ").concat(y)),y&&u)this.getMiniSdp(u,!this.isV2,v).then((function(e){var t=g(e);i(t)})).catch((function(){var e=g();i(e)}));else{var b=g();i(b)}},e.prototype.getParamsExt=function(e,t,i){return t&&(e.min_play_buf_level_ms=t),i&&(e.keyframe_intv=i),this.Xn.info("".concat("zc.wcs.gpe"," ").concat(JSON.stringify(e))),wl.WebrtcCmdReqMsg.encode({peer_extend_param:e}).finish()},e.prototype.decodeParamsExt=function(e){return wl.WebrtcCmdReqMsg.decode(e).peer_ext_params_push},e.prototype.sendMediaDesc=function(e,t,i,r){return Tl(this,void 0,void 0,(function(){var n=this;return El(this,(function(o){return[2,new we((function(o,s){var a=function(e){var o,s=e||r.sdp;if(n.isV2){var a=n.getParamsExt(r.paramsExt,r.min_play_buf_level_ms,r.keyframe_intv),c={type:i,update:0,params_ext:a};e?c.mini_sdp=e:c.sdp=s,n.Xn.info(ns+" params: "+JSON.stringify(Sl(Sl({},c),{sdp:void 0}))),o=n.encodePBBody(t,c)}else{var u={type:i,sdp:s};null!=r.width&&(u.width=r.width),null!=r.height&&(u.height=r.height),null!=r.frameRate&&(u.framerate=r.frameRate),null!=r.video_min_kpbs&&(u.video_min_kpbs=r.video_min_kpbs),null!=r.video_max_kpbs&&(u.video_max_kpbs=r.video_max_kpbs),null!=r.audio_kpbs&&(u.audio_kpbs=r.audio_kpbs),null!=r.keyframe_intv&&(u.keyframe_intv=r.keyframe_intv),null!=r.min_play_buf_level_ms&&(u.min_play_buf_level_ms=r.min_play_buf_level_ms),n.Xn.info(ns+" params: "+JSON.stringify(Sl(Sl({},u),{sdp:void 0}))),o=u}return o},c=e.te,u=e.streamId;if(n.Xn.info("".concat(ns," ").concat(u," ").concat(c)),c&&r.sdp)n.getMiniSdp(r.sdp,!n.isV2,e).then((function(e){var t=a(e);o(t)})).catch((function(){var e=a();o(e)}));else{var l=a();o(l)}}))]}))}))},e.prototype.sendCandidateInfo=function(e,t){for(var i=[],r=0;r<t.length;r++)i.push({candidate:t[r].candidate,sdpMid:t[r].sdpMid,sdpMLineIndex:t[r].sdpMLineIndex});return this.getBodyData(e,{infos:i})},e.prototype.sendCloseSession=function(e,t){return this.getBodyData(e,{reason:t})},e.prototype.sendAckMessage=function(e,t){return this.getBodyData(e,{result:t})},e.prototype.sendActivatePlayStream=function(e,t,i){var r={active:t?0:1,layer:0};return this.Xn.info($o+" activate "+i+" "+JSON.stringify(r)),this.getBodyData(e,r)},e.prototype.sendMediaDescUpdateReq=function(e,t){return Tl(this,void 0,void 0,(function(){var i=this;return El(this,(function(r){return[2,new we((function(r,n){var o=e.peerID,s=e.type,a=e.sdp,c=e.width,u=e.height,l=e.frameRate,d=e.video_min_kpbs,h=e.video_max_kpbs,p=e.audio_kpbs,f=e.keyframe_intv,m=function(e){var t;if(i.isV2){var r={type:s,update:1};e?r.mini_sdp=e:r.sdp=a,i.Xn.info("zc.wcs.smdu "+JSON.stringify(r)),t=i.encodePBBody("MediaDescReq",r)}else t={peer_id:o,type:s,sdp:e||a,width:c,height:u,framerate:l,video_min_kpbs:d,video_max_kpbs:h,audio_kpbs:p,keyframe_intv:f};return t},v=t.te;if(i.Xn.info("zc.wcs.smdur ".concat(t.streamId," ").concat(v)),v&&a)i.getMiniSdp(a,!i.isV2,t).then((function(e){var t=m(e);r(t)})).catch((function(){var e=m();r(e)}));else{var g=m();r(g)}}))]}))}))},e.prototype.getBodyData=function(e,t){return this.isV2?this.encodePBBody(e,t):t},e.prototype.getMiniSdp=function(e,t,i){var r=this,n="zc.s.gmsdp",o=i.streamId;return this.Xn.warn("".concat(n," ").concat(o," sdp:").concat(e.length," isMini")),new we((function(s,a){var c=r.re.streamCenter.miniSdpWorker,u=function(e){r.Xn.error("".concat(n," ").concat(o," error:").concat(JSON.stringify(e))),i.te=!1,a(e)};return e?c?void c.parseToMiniSdp(e).then((function(e){var i,o;if(r.Xn.warn("".concat(n," parse sdp success buffer:").concat(null==e?void 0:e.byteLength)),!e||!e.byteLength)return r.re.te=!1,u(Wt);o=t?null===(i=Qn(e))||void 0===i?void 0:i.trim():e,s(o)})).catch((function(e){return r.re.te=!1,u(e)})):u(Kt):u({code:Wt.code,message:"sdp error"})}))},e.prototype.parseRecSdp=function(e,t,i){var r=this,n="zc.s.prsdp",o=i.streamId;return this.Xn.warn("".concat(n," ").concat(o," rSDP:").concat(e.length," isMini")),new we((function(s,a){var c=t?fo(e):e,u=r.re.streamCenter.miniSdpWorker,l=function(e){r.Xn.error("".concat(n," ").concat(o," error:").concat(JSON.stringify(e))),i.te=!1,a(e)};if(!c||!c.byteLength)return l({code:Zt.code,message:"buffer error"});u?u.loadMiniSdpToOriginSdp(c).then((function(e){r.Xn.warn("".concat(n," parse minisdp success sdp:").concat(e.length)),e?s(e):l(Zt)})).catch((function(e){l(e)})):l(Kt)}))},e.prototype.headerData=function(e){var t=yl[e.cmd];if(void 0!==t){var i=Cl.Head.create({cmd:t,seq:e.seq,session_id:e.session_id});return Cl.Head.encode(i).finish()}this.Xn.error("zc.wmh.hd cmd not exist")},e.prototype.encodePBMsg=function(e,t,i){void 0===i&&(i=!0);var r=new Uint8Array(Array.from(this.getWebRTCHead(e.length,t.length)).concat(Array.from(e)).concat(Array.from(t))),n=Il.Header.create({cmd:i?100:101}),o=Il.Header.encode(n).finish(),s=new Uint8Array(8);s[0]=181,s[1]=0;var a=o.length,c=r.length;return s[2]=a>>8,s[3]=a-(s[2]<<8),s.set(new Uint8Array(Int32Array.from([c]).buffer).reverse(),4),new Uint8Array(Array.from(s).concat(Array.from(o)).concat(Array.from(r)))},e.prototype.getWebRTCHead=function(e,t){var i=new Uint8Array(7);return i[0]=17,i[1]=e>>8,i[2]=e-(i[1]<<8),i.set(new Uint8Array(Int32Array.from([t]).buffer).reverse(),3),i},e.prototype.encodePBBody=function(e,t){var i=Cl[e].create(t),r=Cl[e].encode(i).finish();return Cl[e].decode(r),r},e.prototype.decodePBBody=function(e,t){var i=_l[e.cmd];if(i)return Cl[i].decode(t);this.Xn.info(Ea+" cmd is not rtc")},e.prototype.handlePushMsg=function(e,t){var i=e[0];if(181===i){var r=(e[2]<<8)+e[3],n=Il.Header.decode(e.slice(8,8+r));if(101===n.cmd){var o=e.slice(8+r),s=o[0];if(17===s){var a=(o[1]<<8)+o[2],c=Cl.Head.decode(o.slice(7,7+a)),u=o.slice(7+a);return{header:c,body:this.decodePBBody(c,u)}}this.Xn.error(Ea+" webrtc tag error "+s)}else this.Xn.error(Ea+" cmd error "+n.cmd)}else this.Xn.error(Ea+" type error "+i)},e}(),kl=function(){return kl=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},kl.apply(this,arguments)},Pl=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Al=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Dl=["LoginReq","CreateSessionWithSdpReq","CreateSessionReq"],Nl=["Peer2PeerNetStatsGetReq","Peer2PeerNetStatsGetRsp"],Ol=function(){function e(e,t,i,r){void 0===r&&(r=!1),this.netAgent=i,this.useNetAgent=r,this.sendDataMap={},this.sendDataList=new Y,this.sendDataCheckOnceCount=100,this.signalSeq=0,this.pushCallback={},this.sessionInfos={},this.tryHeartbeatCount=0,this.heartbeatInterval=1e4,this.sendDataTimeout=5e3,this.sendDataDropTimeout=1e4,this.sendDataCheckTimer=null,this.sendDataCheckInterval=2e3,this.loginTimer=null,this.loginTimeout=1e4,this.successConnectedCallback=null,this.isNoAppConfig=!1,this.checkMessageList=["ActivateVideoPlayStreamReq","ActivateAudioPlayStreamReq","CreateSessionReq","CreateSessionWithSdpReq","ActivateSEIInsertReq","StreamStatusNotify","MediaDescUpdateReq"],this.tryConnectCount=1,this.tryConnectTimer=null,this.tryConnectInterval=3e3,this.state=0,this.tokenType=0,this.platform=navigator.platform,this.testStreamStatusMsgs=[],this.unCheckCmds=["LoginReq","CreateSessionReq","CreateSessionWithSdpReq"],this._websocket=null,this.negoInterval=25e3,this.negoTryCount=1,this.negoTryMaxCount=2,this.isV2=!0,this.Xn=e,this.re=t,this.re.streamConnectTime&&(this.tryConnectInterval=this.re.streamConnectTime),this.isV2=!!this.re.useNetAgent,this.webrtcCenterSvr=new Rl(t,e,this.isV2),this.gw=new gl(e,this,t)}return Object.defineProperty(e.prototype,"wsReadyState",{get:function(){var e;return null===(e=this.websocket)||void 0===e?void 0:e.readyState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"websocket",{get:function(){return this._websocket},set:function(e){null===e&&this.useNetAgent||(this._websocket=e)},enumerable:!1,configurable:!0}),e.prototype.setSessionInfo=function(e,t){this.Xn.debug("zc.s.ssi call"),this.appid=e+"",this.userid=t},e.prototype.onDisconnect=function(e,t){},e.prototype.onReConnect=function(e){},e.prototype.onUpdateHeartBeatInterval=function(e){},e.prototype.resetConnectTimer=function(){this.Xn.info("zc.s.rct call"),clearTimeout(this.tryConnectTimer),this.tryConnectTimer=null,this.tryConnectCount=0},e.prototype.resetLoginTimer=function(){this.Xn.info("zc.s.rlt call"),clearTimeout(this.loginTimer),this.loginTimer=null},e.prototype.handleWsPBMsg=function(e,t){var i,r=this.webrtcCenterSvr.handlePushMsg(e,t);if((null==r?void 0:r.header)&&(null==r?void 0:r.body))return r&&(r.header.cmd=_l[r.header.cmd],$n(r.body),i={header:kl(kl({},r.header),{appid:this.appid,user_id:this.userid}),body:r.body}),i;this.Xn.error("zc.s.dwpm no header or body")},e.prototype.handleWsMessage=function(e){var t;(null==(t=this.isV2?this.handleWsPBMsg(e.data,e.extras):JSON.parse(e.data))?void 0:t.header)&&t.header.appid==this.appid&&t.header.user_id===this.userid?(Nl.includes(t.header.cmd)||(this.Xn.info(Bo+" signmsg= ",t.header.cmd),this.Xn.info(Bo+" signmsg= "+JSON.stringify(t.header)+" "+JSON.stringify(kl(kl({},t.body),{mini_sdp:void 0})))),this.handleServerPush(t)):this.Xn.warn(Bo+" check header failed")},e.prototype.bindWebSocketEvents=function(){var e=this;this.tryHeartbeatCount=0,this.tryConnectInterval=this.re.streamConnectTime?this.re.streamConnectTime:3e3,this.websocket&&(this.websocket.onclose=function(t){var i=t||{},r=i.reason,n=i.wasClean;if(e.Xn.info(Bo+" close msg = ".concat(i.code,", ").concat(r,", ").concat(n)),0!=e.state){if(e.useNetAgent)return void e.disconnectCallback();e.resetCheckMessage()}},this.websocket.onerror=function(t){var i=t||{},r=i.code,n=i.reason,o=i.wasClean;e.Xn.info(Bo+" msg = ".concat(JSON.stringify(t),", ").concat(r,", ").concat(n,", ").concat(o))})},e.prototype.resetCheckMessage=function(){this.Xn.info("zc.s.rcm call"),clearTimeout(this.sendDataCheckTimer),this.sendDataCheckTimer=null;for(var e=this.sendDataList.getFirst();null!=e;)this.sendDataList.remove(e),e._data.error&&e._data.error(2,e._data.seq),e=this.sendDataList.getFirst();this.sendDataMap={}},e.prototype.handleServerPush=function(e){switch(e.header.cmd){case"LoginRsp":this.handleRespondData("LoginReq",e);break;case"CreateSessionRsp":this.handleRespondData("CreateSessionReq",e),0===e.body.result&&this.addSession(e.header.session_id,e.body.session_token);break;case"CreateSessionWithSdpRsp":this.handleRespondData("CreateSessionWithSdpReq",e),0===e.body.result&&this.addSession(e.header.session_id,e.body.session_token);break;case"MediaDescRsp":this.handleRespondData("MediaDescReq",e);break;case"CandidateInfoRsp":this.handleRespondData("CandidateInfoReq",e);break;case"CloseSessionRsp":this.handleRespondData("CloseSessionReq",e),this.removeSession(e.header.session_id);break;case"ClientHBRsp":this.handleRespondData("ClientHBReq",e);break;case"MediaDescPush":case"CandidateInfoPush":case"StreamStatusNotifyPush":case"PublishEventPush":case"PlayEventPush":case"ClientInfoPush":case"NetQualityInfoPush":case"MediaDescUpdatePush":case"CmdPush":this.handlePushData(e);break;case"CloseSessionPush":this.handlePushData(e),this.removeSession(e.header.session_id);break;case"QualityReportRsp":this.handleRespondData("QualityReportReq",e);break;case"SessionResetPush":this.handlePushResetSessionData(e);break;case"ActivateVideoPlayStreamRsp":this.handleRespondData("ActivateVideoPlayStreamReq",e);break;case"ActivateAudioPlayStreamRsp":this.handleRespondData("ActivateAudioPlayStreamReq",e);break;case"NetQualityProbeRsp":this.handleRespondData("NetQualityProbeReq",e);break;case"ActivateSEIInsertRsp":this.handleRespondData("ActivateSEIInsertReq",e);break;case"StreamStatusNotifyAck":this.handleRespondData("StreamStatusNotify",e);break;case"Peer2PeerNetStatsGetRsp":this.handleRespondData("Peer2PeerNetStatsGetReq",e);break;case"MediaDescUpdateRsp":this.handleRespondData("MediaDescUpdateReq",e);break;case"CmdRsp":this.handleRespondData("CmdReq",e);break;case"WebRTCDispatchRsp":this.handleRespondData("WebRTCDispatchReq",e)}},e.prototype.disconnectCallback=function(e,t){this.Xn.info("zc.s.dcb "+JSON.stringify(e)+" "+t),this.connectCallback&&(this.connectCallback(t||-1,this.server,void 0),this.connectCallback=null);var i=this.server;this.disconnectServer(),this.onDisconnect(i,e)},e.prototype.updateToken=function(){var e=this;this.Xn.info(zo+" call");var t={token:this.token,tokenType:this.tokenType,roomid:this.roomID,anchorname:this.re.anchor_info.anchor_id,sdkversion:s,osinfo:navigator.appVersion};if(this.Xn.info(zo+" osinfo "+Re()),0!=Object.keys(this.sessionInfos).length){var i=[];for(var r in this.sessionInfos){var n=parseInt(r);i.push({session_id:n,session_token:this.sessionInfos[n].token})}t.sessions=i}var o=this.webrtcCenterSvr.mediaLogin(t,this.app);this.sendMessageWithCallback("LoginReq",this.re.getSeq(),0,o,(function(t,i,r){0==r.result?(e.token=r.token,e.tokenType=r.tokenType,e.resetLoginTimer(),e.Xn.info(zo+" callback "+!!e.connectCallback),null!=e.connectCallback?(e.connectCallback(0,e.server,{}),e.connectCallback=null):e.useNetAgent&&e.onReConnect(e.server),e.checkMessageTimeout()):null!=e.connectCallback&&(e.connectCallback(r.result,e.server,{error:r.strError}),e.connectCallback=null)}),(function(){null!=e.connectCallback&&(e.connectCallback(-1,e.server,void 0),e.connectCallback=null)})),this.resetLoginTimer(),this.loginTimer=setTimeout((function(){e.Xn.info(zo+" set login timer"),null!=e.connectCallback&&(e.connectCallback(-1,e.server,void 0),e.connectCallback=null)}),this.loginTimeout)},e.prototype.sendMessageWithCallback=function(e,t,i,r,n,o){var s,a=this;void 0===n&&(n=null),void 0===o&&(o=null),Nl.includes(e)||this.Xn.info(qo+" call "+e+" "+t+" "+(null===(s=this.websocket)||void 0===s?void 0:s.readyState));var c=performance.now();if(!this.websocket||!this.unCheckCmds.includes(e)&&this.websocket.readyState!==hl.OPEN)return this.Xn.error(qo+" connect not establish"),void(o&&o(1,t));var u={seq:t,deleted:!1,cmd:e,time:(new Date).getTime(),success:function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];if(Dl.includes(e)){var o=(performance.now()-c).toFixed(0);a.Xn.info(qo+" seq: ".concat(t,", cmd: ").concat(e,", cost_time: ").concat(o))}n&&n.apply(void 0,i)},error:o},l=this.sendDataList.push(u);this.sendDataMap[u.seq]=l;var d,h=this.getHeader(e,t,i);d=this.isV2?this.webrtcCenterSvr.encodePBMsg(h,r):JSON.stringify({header:h,body:r}),Nl.includes(e)||this.isV2||this.Xn.info(qo+" "+d);var p={};this.useNetAgent&&"LoginReq"===e?this.websocket.send(d,!0,!0,p):this.websocket.send(d,void 0,void 0,p),this.Xn.debug(qo+" success")},e.prototype.getHeader=function(e,t,i){var r={version:"1.0.1",cmd:e,appid:this.appid+"",seq:t,user_id:this.userid,session_id:i};return this.isV2?this.webrtcCenterSvr.headerData(r):r},e.prototype.connectServer=function(e,t,i,r){var n,o,s=this;if(this.Xn.info(Xo+" "+i),this.roomID=e,this.token=t,this.server=i,this.state=1,this.connectCallback=r,this.isServerConnected)this.Xn.info(Xo+" websocket is connected"),this.resetConnectTimer(),this.state=2;else try{if(this.useNetAgent){if(!this.re.appConfig)return this.Xn.info(Xo+" no app config "),void(this.isNoAppConfig=!0);var a=this.re.appConfig.media_config.publish_config.resource_info.find((function(e){return e.resource_type===c.RTC}));if(!a)return void(r&&r(nt));var l=null===(n=null==a?void 0:a.service_info)||void 0===n?void 0:n.find((function(e){return e.protocol===u.WEBRTC}));if(!l)return void(r&&r(nt));var d=l.url_template.split("{IP}")[1].split("?"),h=d[0],p=d[1];this.app=null===(o=p.split("="))||void 0===o?void 0:o[1];var f;f=this.isV2?{path:"wsv2",query:"",encode:!1,messageType:2}:{path:h,query:p,encode:!0,messageType:1},this.Xn.info(Xo+" signal "+JSON.stringify(f)),this.websocket instanceof WebSocket&&(this.websocket.onclose=null,this.websocket.onerror=null,this.websocket.close(),this.websocket=null),!this.websocket&&(this.websocket=new bl(this.server,this.netAgent,f,this.Xn,this.re)),this.websocket.open()}if(!this.websocket)return void this.Xn.error("the socket is disconect");this.websocket.onclose=function(e){var t=e||{},i=t.code,r=t.reason,n=t.wasClean;s.Xn.info(Xo+" websocket close call. msg = ".concat(JSON.stringify(e),", ").concat(i,", ").concat(r,", ").concat(n)),s.useNetAgent&&0!=s.state&&(s.successConnectedCallback=s.connectCallback,s.resetConnectTimer(),s.startConnectTimer((function(e){1008===e&&s.disconnectCallback(ct)})))},this.websocket.onerror=function(e){var t=e||{},i=t.code,r=t.reason,n=t.wasClean;s.Xn.info(Xo+" websocket onerror call. msg = ".concat(JSON.stringify(e),", ").concat(i,", ").concat(r,", ").concat(n)),s.re.useNetAgent&&(null==e?void 0:e.code)&&s.disconnectCallback(void 0,null==e?void 0:e.code)},this.useNetAgent&&this.websocket instanceof bl?(this.websocket.onopen=function(){s.Xn.info(Xo+" websocket open call"),s.bindWebSocketEvents(),s.state=2,s.websocket&&(s.websocket.onmessage=s.handleWsMessage.bind(s))},this.websocket.onreconnnecting=function(){s.Xn.info(Xo+" websocket reconnecting "+!!s.successConnectedCallback+" "+!!s.loginTimer),s.successConnectedCallback&&(s.connectCallback=s.successConnectedCallback),s.updateToken()},this.websocket.onmessage=this.handleWsMessage.bind(this),this.updateToken()):this.websocket.onopen=function(){s.resetConnectTimer(),s.Xn.info(Xo+" websocket open call"),s.websocket&&(s.websocket.onmessage=s.handleWsMessage.bind(s)),s.bindWebSocketEvents(),s.updateToken(),s.state=2}}catch(e){this.Xn.error(Xo+" websocket error "+e)}},e.prototype.startConnectTimer=function(e){if(this.Xn.info(Ho+" call"),this.tryConnectCount>=3)return this.Xn.info(Ho+" beyond "+this.server+"max limit"),void this.disconnectCallback();this.websocket&&this.websocket.readyState===hl.OPEN?(this.Xn.info(Ho+" websocket is connected"),this.resetConnectTimer()):(this.tryConnectCount+=1,this.connectServer(this.roomID,this.token,this.server,e))},e.prototype.disconnectServer=function(){this.Xn.info("zc.s.dc call"),this.connectCallback=null,this.resetCheckMessage(),this.resetConnectTimer(),this.resetLoginTimer(),this.websocket&&(this.websocket.onclose=null,this.websocket.onerror=null,this.websocket.close(),this.websocket=null),this.token="",this.sessionInfos={},this.tokenType=0,this.tryHeartbeatCount=0,this.tryConnectCount=0,this.state=0},Object.defineProperty(e.prototype,"isServerConnected",{get:function(){var e;return(null===(e=this.websocket)||void 0===e?void 0:e.readyState)===hl.OPEN},enumerable:!1,configurable:!0}),e.prototype.createSession=function(e,t,i,r,n,o,s,a,c,u,l){void 0===n&&(n=""),void 0===o&&(o=""),this.Xn.info(Fo+" call: "+r);var d="CreateSessionReq",h=this.webrtcCenterSvr.createSession(d,t,i,r,n,o,s,a,c);this.sendMessageWithCallback(d,e,0,h,u,l)},e.prototype.createSessionWithSdp=function(e,t,i){var r=this,n=e.seq,o=e.streamId;this.Xn.info(Fo+" call: "+o+" seq:"+n);var s="CreateSessionWithSdpReq";this.webrtcCenterSvr.createSessionWithSdp(s,e,(function(a){r.sendMessageWithCallback(s,n,0,a,(function(n,s,a){return Pl(r,void 0,void 0,(function(){var r,c,u,l=this;return Al(this,(function(d){return a.params_ext&&(a.params_ext=this.webrtcCenterSvr.decodeParamsExt(a.params_ext),$n(a.params_ext)),r=a.sdp||a.mini_sdp,u=(c=e.player).te,this.Xn.info("".concat(Fo," ").concat(o," rSDP:").concat(r.length," ").concat(u)),u&&r?this.setRspBodySdp(a,c).then((function(){l.Xn.info(Fo+" sdp "+o),t&&t(n,s,a)})).catch((function(e){i&&i(e,n)})):(this.Xn.info(Fo+" sdp "+o),t&&t(n,s,a)),[2]}))}))}),i)}),(function(){}))},e.prototype.dispatchGwNodes=function(e,t,i,r,n,o){this.Xn.info(ts+" call: "+i);var s="WebRTCDispatchReq",a={type:t,stream_id:i,area_type:r.type,area_id_list:r.areaList};this.Xn.info(ts+" "+i+" "+JSON.stringify(a));var c=this.webrtcCenterSvr.getBodyData(s,a);this.sendMessageWithCallback(s,e,0,c,n,o)},e.prototype.sendMediaDescUpdateReq=function(e,t,i,r,n,o){var s=this,a=this.isV2?"MediaDescReq":"MediaDescUpdateReq";this.webrtcCenterSvr.sendMediaDescUpdateReq(r,e).then((function(r){s.sendMessageWithCallback(a,t,i,r,(function(t,i,r){return Pl(s,void 0,void 0,(function(){var s,a;return Al(this,(function(c){return s=r.sdp||r.mini_sdp,a=e.te,this.Xn.info("zc.ss.smdur ".concat(e.streamId," rSDP:").concat(s.length," ").concat(a)),a&&s?this.setRspBodySdp(r,e).then((function(){n&&n(t,i,r)})).catch((function(e){o&&o(e,t)})):n&&n(t,i,r),[2]}))}))}),o)})).catch((function(e){o&&o(e)}))},e.prototype.removeSession=function(e){this.Xn.info("zc.s.rs call "+e),this.sessionInfos[e]&&delete this.sessionInfos[e]},e.prototype.sendCloseSession=function(e,t,i,r,n){this.Xn.info("zc.s.srs call: "+t);var o="CloseSessionReq",s=this.webrtcCenterSvr.sendCloseSession(o,i);this.removeSession(t),this.sendMessageWithCallback(o,e,t,s,r,n)},e.prototype.sendMessage=function(e,t,i,r){if(this.Xn.info(Vo+" call "+e),this.websocket&&this.websocket.readyState===hl.OPEN){var n,o=this.getHeader(e,t,i);n=this.isV2?this.webrtcCenterSvr.encodePBMsg(o,r):JSON.stringify({header:o,body:r}),this.websocket.send(n,void 0,void 0,{}),this.Xn.info(Vo+" success")}else this.Xn.error(Vo+" connect not establish")},e.prototype.handleRespondData=function(e,t){this.Xn.debug(Go+" call");var i=this.sendDataMap[t.header.seq];if(null!=i){delete this.sendDataMap[t.header.seq],this.sendDataList.remove(i);var r=i._data;r.cmd!==e?this.Xn.error(Go+" command is not match"):r.success&&r.success(t.header.seq,t.header.session_id,t.body)}else{if("CloseSessionRsp"==t.header.cmd)return;this.Xn.error(Go+" cannot find data "+e)}},e.prototype.addSession=function(e,t){this.Xn.info("zc.s.as call "+e),this.sessionInfos[e]={token:t}},e.prototype.handlePushData=function(e){this.Xn.info(jo+" call "+e.header.cmd+" session "+e.header.session_id);var t=this.pushCallback[e.header.cmd+e.header.session_id];t?t.callback&&t.callback(e.header.seq,e.header.session_id,e.body):this.Xn.info(jo+" no callbackData "+e.header.cmd+" session: "+e.header.session_id)},e.prototype.handlePushResetSessionData=function(e){this.Xn.debug(Qo+" call ");var t=[];if(0==e.body.cResetType)t=Object.keys(this.sessionInfos);else if(1==e.body.cResetType)for(var i=0;i<e.body.session_ids.length;i++)t.push(e.body.session_ids[i]);if(this.sendResetSessionAck(e.header.seq,0,0),0!=t.length)for(var r=0;r<t.length;r++){var n=this.pushCallback[e.header.cmd+t[r]];null==n?this.Xn.info(Qo+" no callbackData "+t[r]):n.callback&&n.callback(e.header.seq,t[r],e.body)}else this.Xn.info(Qo+" no session to callback")},e.prototype.sendMediaDesc=function(e,t,i,r,n,o,s){return Pl(this,void 0,void 0,(function(){var a,c=this;return Al(this,(function(u){return this.Xn.info(Wo+" call: "+i),this.webrtcCenterSvr.sendMediaDesc(e,a="MediaDescReq",r,n).then((function(r){c.sendMessageWithCallback(a,t,i,r,(function(t,i,r){return Pl(c,void 0,void 0,(function(){var n,a,c;return Al(this,(function(u){return n=r.sdp||r.mini_sdp,a=e.te,c=e.streamId,this.Xn.info("".concat(Wo," ").concat(c," rSDP:").concat(n.length," ").concat(a)),a&&n?this.setRspBodySdp(r,e).then((function(){o&&o(t,i,r)})).catch((function(e){s&&s(e,t)})):o&&o(t,i,r),[2]}))}))}),s)})).catch((function(){})),[2]}))}))},e.prototype.sendCandidateInfo=function(e,t,i,r,n){this.Xn.info("zc.s.sci call: "+t);var o="CandidateInfoReq",s=this.webrtcCenterSvr.sendCandidateInfo(o,i);this.sendMessageWithCallback(o,e,t,s,r,n)},e.prototype.sendMediaDescAck=function(e,t,i){this.Xn.info(Zo+" call: "+t);var r="MediaDescAck",n=this.webrtcCenterSvr.sendAckMessage(r,i);this.sendMessage(r,e,t,n)},e.prototype.sendUpdateMediaDescAck=function(e,t,i,r){this.Xn.info(Zo+" call: "+t),this.sendMessage("MediaDescUpdateAck",e,t,{peer_id:r,result:i})},e.prototype.sendCandidateInfoAck=function(e,t,i){this.Xn.info("zc.s.scia call: "+t);var r="CandidateInfoAck",n=this.webrtcCenterSvr.sendAckMessage(r,i);this.sendMessage(r,e,t,n)},e.prototype.sendCloseSessionAck=function(e,t,i){this.Xn.info("zc.s.scsa call: "+t);var r="CloseSessionAck",n=this.webrtcCenterSvr.sendAckMessage(r,i);this.sendMessage(r,e,t,n)},e.prototype.sendResetSessionAck=function(e,t,i){this.Xn.debug("zc.s.srsa call: "+t);var r="SessionResetAck",n=this.webrtcCenterSvr.sendAckMessage(r,i);this.sendMessage(r,e,t,n)},e.prototype.sendStreamStatusNotifyAck=function(e,t,i){this.Xn.debug("zc.s.sssna call: "+t);var r="StreamStatusNotifyPushAck",n=this.webrtcCenterSvr.sendAckMessage(r,i);this.sendMessage(r,e,t,n)},e.prototype.sendClientInfoAck=function(e,t,i){this.Xn.debug("zc.s.scia call: "+t);var r="ClientInfoAck",n=this.webrtcCenterSvr.sendAckMessage(r,i);this.sendMessage(r,e,t,n)},e.prototype.registerPushCallback=function(e,t,i){i&&fn(i)&&(this.Xn.info("zc.s.rpc set callback "+t+" "+e),this.pushCallback[e+t]={callback:i})},e.prototype.unregisterPushCallback=function(e,t){delete this.pushCallback[e+t]},e.prototype.checkMessageTimeout=function(){for(var e,t,i=this,r=this.sendDataList.getFirst(),n=(new Date).getTime(),o=0,s=0,a=0;null!=r&&!(r._data.time+this.sendDataTimeout>n);)if(delete this.sendDataMap[r._data.seq],this.sendDataList.remove(r),++s,-1!=this.checkMessageList.indexOf(r._data.cmd)){if(null==r._data.error||this.sendDataDropTimeout>0&&r._data.time+this.sendDataDropTimeout<n?++a:(this.Xn.warn(Ko+" error cmd = "+r._data.cmd+" seq ="+(null===(e=r._data)||void 0===e?void 0:e.seq)+" start time ="+(null===(t=r._data)||void 0===t?void 0:t.time)),r._data.error&&r._data.error(1,r._data.seq)),++o>=this.sendDataCheckOnceCount)break;r=this.sendDataList.getFirst()}else r=this.sendDataList.getFirst();this.sendDataCheckTimer=setTimeout((function(){i.checkMessageTimeout()}),this.sendDataCheckInterval),0==s&&0==a||this.Xn.info(Ko+" call success, state: timeout="+s+" drop="+a)},e.prototype.sendHeartbeat=function(){var e=this;if(this.Xn.debug(Jo+"call tryHeartbeatCount:"+this.tryHeartbeatCount),0!=Object.keys(this.sessionInfos).length)if(2===this.state){if(++this.tryHeartbeatCount>5)return this.Xn.error(Jo+" heartbeat try limit"),void this.disconnectCallback();var t=[];for(var i in this.sessionInfos)t.push(parseInt(i));var r={session_ids:t},n=(new Date).getTime();this.sendMessageWithCallback("ClientHBReq",this.re.getSeq(),0,r,(function(t,i,r){e.Xn.info(Jo+" hb time "+((new Date).getTime()-n)),e.heartbeatInterval!=r.hb_interval&&(e.heartbeatInterval=r.hb_interval,e.onUpdateHeartBeatInterval(r.hb_interval)),e.tryHeartbeatCount=0}),(function(e,t){}))}else this.Xn.warn(Jo+" state error");else this.Xn.info(Jo+" no need to heartbeat")},e.prototype.sendStreamStatus=function(e,t,i,r,n,o){this.Xn.info(Yo+" call "+t);var s="StreamStatusNotify",a={mic_status:r,camera_status:i};this.Xn.info("".concat(Yo," stream ").concat(n||""," status ").concat(JSON.stringify(a)));var c=this.webrtcCenterSvr.getBodyData(s,a);this.sendMessageWithCallback(s,e,t,c,(function(){}),(function(e){1===e&&o&&o()}))},e.prototype.ActivatePlayVideoStream=function(e,t,i,r,n){this.Xn.info("zc.s.apvs call");var o="ActivateVideoPlayStreamReq",s=this.webrtcCenterSvr.sendActivatePlayStream(o,i,"video");this.sendMessageWithCallback(o,e,t,s,r,n)},e.prototype.ActivatePlayAudioStream=function(e,t,i,r,n){this.Xn.info($o+" call");var o="ActivateAudioPlayStreamReq",s=this.webrtcCenterSvr.sendActivatePlayStream(o,i,"audio");this.sendMessageWithCallback(o,e,t,s,r,n)},e.prototype.sendBroadcasterStatus=function(e,t,i){this.Xn.info("zc.s.sbs call "+t);var r="BroadcasterStatusNotify",n=this.webrtcCenterSvr.getBodyData(r,{status:i});this.sendMessage(r,e,t,n)},e.prototype.sendNetProbe=function(e,t,i,r,n){this.Xn.info(es+" call "+t);var o="NetQualityProbeReq",s=this.webrtcCenterSvr.getBodyData(o,{peer_id:i,action:1});this.sendMessageWithCallback(o,e,t,s,r,n)},e.prototype.sendNetQualityInfoPushAck=function(e,t,i,r){this.Xn.info(es+" call "+t);var n="NetQualityInfoAck",o=this.webrtcCenterSvr.getBodyData(n,{peer_id:i,result:r});this.sendMessage(n,e,t,o)},e.prototype.activateSEIInsert=function(e,t,i,r,n,o,s){},e.prototype.getP2PNetStats=function(e,t,i,r,n){var o="Peer2PeerNetStatsGetReq",s=this.webrtcCenterSvr.getBodyData(o,{peer_id:i});this.sendMessageWithCallback(o,e,t,s,r,n)},e.prototype.sendGWCmd=function(e,t,i,r,n){var o=this,s="CmdReq";t.body=this.isV2?i:Qn(i);var a=this.webrtcCenterSvr.getBodyData(s,t);this.sendMessageWithCallback(s,this.re.getSeq(),e,a,(function(e,t,i){var n=o.isV2?i.body:fo(i.body);i.body=n,r(e,t,i)}),n)},e.prototype.sendGWAck=function(e,t,i){var r="CmdAck";t.body=this.isV2?i:Qn(i);var n=this.webrtcCenterSvr.getBodyData(r,t);this.sendMessage(r,this.re.getSeq(),e,n)},e.prototype.setRspBodySdp=function(e,t){return Pl(this,void 0,void 0,(function(){var i=this;return Al(this,(function(r){return[2,new we((function(r,n){var o=e.sdp||e.mini_sdp;i.Xn.info("zc.srbsdp ".concat(t.streamId," rSdp:").concat(o.length)),i.webrtcCenterSvr.parseRecSdp(o,!e.mini_sdp,t).then((function(t){e.sdp=t,delete e.mini_sdp,r()})).catch((function(e){n(e)}))}))]}))}))},e}(),Ml=function(e,t,i,r,n){if(void 0===n&&(n="video"),t.breakStartTime){var o=e-t.breakStartTime;o>=r&&(t.cumulativeBreakDuration+=o,i.breakDuration+=o),t.breakStartTime=void 0}},Ll=function(e,t,i,r,n,o,s,a,c,u){if(void 0===c&&(c=a),void 0===u&&(u="video"),n>1e3&&(n=1e3),r.breakStartTime)if(i)0===t?(e-r.breakStartTime>=22e3&&Ml(e,r,s,n,u),o.breakDuration+=1e3):a>=n?a<500?a+c<1e3?(Ml(e-(1e3-c),r,s,n,u),r.breakStartTime=e-a,o.breakDuration+=c+a,o.decodeTime+=1e3-(c+a)):(Ml(e-1e3+c,r,s,n,u),r.breakStartTime=e-1e3+c,o.breakDuration+=1e3):a>=500&&(Ml(e-a,r,s,n,u),r.breakStartTime=e-a,o.breakDuration+=1e3):c<=n?(Ml(e-1e3+c,r,s,n,u),r.breakStartTime=void 0,o.breakDuration+=c,o.decodeTime+=1e3-c,s.decodeDuration+=1e3-c):o.breakDuration+=1e3;else{r.resumeRecv=!1;var l=e-1e3-r.breakStartTime;l<=0&&(l=0),r.breakStartTime=void 0,r.noBreakNoDecodeDuration+=l,o.breakCancelDuration+=l,s.blankDuration+=l}else i?0===t?r.resumeRecv?(r.breakStartTime=e-1e3,o.breakDuration+=1e3):(r.noBreakNoDecodeDuration+=1e3,s.blankDuration+=1e3):c>n?r.resumeRecv?(r.breakStartTime=e-c,r.cumulativeBreakDuration+=c,o.breakDuration+=c,o.decodeTime+=1e3-c,s.breakDuration+=c,s.decodeDuration+=1e3-c):(r.noBreakNoDecodeDuration+=1e3,s.blankDuration+=1e3):(o.decodeTime+=1e3,s.decodeDuration+=1e3):r.decodeStartTime&&(0===t?(r.resumeRecv=!1,r.noBreakNoDecodeDuration+=1e3,s.blankDuration+=1e3):(o.decodeTime+=1e3,s.decodeDuration+=1e3));i&&t&&(r.resumeRecv=!0)},xl=function(e,t,i,r,n,o,s){if(void 0===s&&(s="video"),r=r>1e3?1e3:r,t.breakDuration=0,t.breakCancelDuration=0,t.decodeTime=0,i.decodeDuration=0,i.breakDuration=0,i.blankDuration=0,e.decodeStartTime){var a=o,c=a-e.decodeStartTime;if(e.decodeStartTime=void 0,e.totalDuration+=c,e.breakStartTime){var u=a-e.breakStartTime;e.breakStartTime=void 0,n?u>r&&(e.cumulativeBreakDuration+=u):e.noBreakNoDecodeDuration+=u}var l=e.cumulativeBreakDuration,d=e.totalDuration-e.cumulativeBreakDuration-e.noBreakNoDecodeDuration;return e.cumulativeDecodeDuration=d,{cumulativeBreakDuration:l,cumulativeDecodeDuration:d}}return{cumulativeBreakDuration:0,cumulativeDecodeDuration:0}},Ul=function(){return Ul=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Ul.apply(this,arguments)},Bl=function(){function e(e,t,i,r,n,o){this.qualityUpdateInterval=e,this.qualityUploadInterval=t,this.player=i,this.Xn=r,this.dataReport=n,this.re=o,this.playQualityList=[],this.qualityTimer=null,this.qualityUpdateTimer=null,this.qualityUploadTimer=null,this.lastPlayStats={audioPacketsLost:0,videoPacketsLost:0,time:0,audioTime:0,videoTime:0,audioBytesReceived:0,videoBytesReceived:0,audioPacketsReceived:0,videoPacketsReceived:0,framesDecoded:0,framesReceived:0,framesDropped:0,audioBitrate:0,totalRenderFrames:0,renderTime:0,paintedFrames:0,lastTimestamp:0,videoElem:null,audioJitterBufferDelay:0,audioJitterBufferEmittedCount:0,videoJitterBufferDelay:0,videoJitterBufferEmittedCount:0,jitterBufferDelayMs:0},this.currentQuality={video:{videoBitrate:0,videoFPS:0,videoRenderFPS:-1,videoTransferFPS:0,frameHeight:0,frameWidth:0,muteState:"1",videoQuality:-1,googCodecName:"",videoPacketsLost:0,videoPacketsLostRate:0,videoFramesDecoded:0,videoFramesDropped:0,videoCumulativeDecodeTime:0,videoCumulativeBreakTime:0,videoCumulativeBreakRate:0},audio:{audioBitrate:0,audioCodec:"",muteState:"1",audioQuality:-1,audioFPS:0,audioJitter:0,audioLevel:0,audioPacketsLost:0,audioPacketsLostRate:0,audioSamplingRate:0,audioSendLevel:0,googCodecName:"",audioCumulativeDecodeTime:0,audioCumulativeBreakTime:0,audioCumulativeBreakRate:0},peerToPeerDelay:0,peerToPeerPacketLostRate:0},this.decodeStartTime=0,this.netQuality=0,this.probeState=a.probed,this.probeTimer=null,this.probeTimeoutInterval=1e4,this.qualityUploadLastTime=0,this.playStat={},this.cumulativeQuality={},this.audioBreakThreshold=200,this.videoBreakThreshold=500,this.videoBreak={breakStartTime:void 0,cumulativeBreakDuration:0,cumulativeDecodeDuration:0,decodeStartTime:void 0,decodeEndTime:void 0,totalDuration:0,noBreakNoDecodeDuration:0,resumeRecv:!0},this.audioBreak={breakStartTime:void 0,cumulativeBreakDuration:0,cumulativeDecodeDuration:0,decodeStartTime:void 0,decodeEndTime:void 0,totalDuration:0,noBreakNoDecodeDuration:0,resumeRecv:!0},this.lastSampleTime=0,this.videoBreakReport={breakDuration:0,breakCancelDuration:0,decodeTime:0},this.audioBreakReport={breakDuration:0,breakCancelDuration:0,decodeTime:0},this.videoReliableBreak={decodeDuration:0,breakDuration:0,blankDuration:0},this.audioReliableBreak={decodeDuration:0,breakDuration:0,blankDuration:0},this.totalQuality={totalSquaredInterFrameDelay:0,totalInterFrameDelay:0,framesDecode:0,totalSamplesReceived:0,concealedSamples:0,audioBytesReceived:0},this.currentSecondQuality={totalSquaredInterFrameDelay:0,totalInterFrameDelay:0,framesDecode:0,totalSamplesReceived:0,concealedSamples:0},this.poorQualityNum=0,this.sampleTimes=0,this.qualitySampleInterval=1e3,this.timerType=0,this.webrtcProtocol="udp",this.candidateStats={},this._videoCodecName="",this._audioCodecName="",this.hasRecvMediaData=!1,this.onRecvMediaData=function(){},this.p2pNetStats={p2pLostRate:0,p2pRTT:0},this.currentQuality.video.muteState=this.player.videoMuteState,this.currentQuality.audio.muteState=this.player.audioMuteState,this.getTimerType(),this.exception=new Xu(this.re,this.Xn,this.streamId,Ti.event)}return Object.defineProperty(e.prototype,"_playStream",{get:function(){return this.player.playStream},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ve",{get:function(){return this.re.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ee",{get:function(){return this.player.ee},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"streamId",{get:function(){return this.player.streamId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this.player.sessionId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"peerID",{get:function(){return this.player.peerID},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioMuted",{get:function(){if(!this.player.remoteStream||this.player.remoteStream.getAudioTracks().length<=0)return!0;var e=this.player.remoteStream.getAudioTracks()[0];return!(!e||!e.muted&&"ended"!==e.readyState&&e.enabled)||"1"==this.player.audioMuteState||!this.player.playMediaStatus.audio},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"videoMuted",{get:function(){if(!this.player.remoteStream||this.player.remoteStream.getVideoTracks().length<=0)return!0;var e=this.player.remoteStream.getVideoTracks()[0];return!(!e||!e.muted&&"ended"!==e.readyState&&e.enabled)||"1"==this.player.videoMuteState||!this.player.playMediaStatus.video},enumerable:!1,configurable:!0}),e.prototype.getPlayStats=function(e,t){var i,r=this;if(null!=e){var n,o,s=this.sampleTimes%parseInt((this.qualityUploadInterval/this.qualitySampleInterval).toString())==0;s&&this.getP2PNetStats();var a=this.player.rtcViewer;a&&(n=a._video,o=a._audio),n&&n.currentTime||(n=So(this._playStream,"video")||n),o&&o.currentTime||(o=So(this._playStream,"audio")||o||n);var c={sampleTimeWindow:this.qualityUploadInterval,audioPacketsLost:0,audioPacketsLostRate:0,audioBitrate:0,audioLevel:0,audioSendLevel:0,audioSamplingRate:0,audioCodec:"",audioQuality:0,audioFPS:0,videoQuality:0,videoPacketsLost:0,videoPacketsLostRate:0,videoBitrate:0,videoFPS:0,videoRenderFPS:-1,nackCount:0,pliCount:0,audioJitter:0,videoJitter:0,videoFramesDecoded:0,keyFramesDecoded:0,totalFreezesDuration:0,frameHeight:0,frameWidth:0,videoTransferFPS:0,videoFramesDropped:0,totalRoundTripTime:0,currentRoundTripTime:0,availableOutgoingBitrate:void 0,videoCodecName:void 0,audioCodecName:void 0,audioJitterBufferDelayMs:0,videoJitterBufferDelayMs:0,jitterBufferDelayMs:0,googBandwidthLimitedResolution:void 0,googCpuLimitedResolution:void 0,googAvailableSendBandwidth:void 0,codecImplementationName:void 0,qualityLimitationReason:void 0,audioMuteState:this.audioMuted?"1":"0",videoMuteState:this.videoMuted?"1":"0",soundLevel:this.player.soundLevel,muted:o?o.muted:void 0,videoPaused:n?n.paused:void 0,audioPaused:o?o.paused:void 0,videoReadyState:n?n.readyState:void 0,audioReadyState:o?o.readyState:void 0,videoEnded:n?n.ended:void 0,audioEnded:o?o.ended:void 0,volume:o?o.volume:void 0,sinkId:o?o.sinkId:void 0,streamTracks:this._playStream?Wn(this._playStream):void 0},u=this.lastPlayStats.time,l=0,d=0,h=0,p=0,f=0,m=0,v=0,g=null,y=null;e.forEach((function(e){var t=e.kind||e.mediaType;["ssrc","inbound-rtp"].includes(e.type)&&("video"==t||e.id.indexOf("VideoStream")>=0)&&(g=e),("inbound-rtp"==e.type||"ssrc"==e.type&&null!=e.bytesReceived)&&("audio"==t||e.id.indexOf("AudioStream")>=0)&&(y=e)}));var b=(new Date).getTime(),S=function(e,t){return e>t?e-t:0};if(this.lastSampleTime||(this.lastSampleTime=b-1e3),g){var T=g.totalInterFrameDelay,E=g.framesDecoded,C=g.totalSquaredInterFrameDelay,w=S(E,this.totalQuality.framesDecode);this.totalQuality.framesDecode=E;var I=S(T,this.totalQuality.totalInterFrameDelay);this.totalQuality.totalInterFrameDelay=T;var R=S(C,this.totalQuality.totalSquaredInterFrameDelay);this.totalQuality.totalSquaredInterFrameDelay=C;var k=(R-Math.pow(I,2)/(w||1))/(w||1);k=k>0?k:-k;var P=parseInt((1e3/(w+1)).toString()),A=1e3*Math.sqrt(k),D=I/(w||1)*1e3||P,N=(D=parseInt((D>1e3?1e3:D).toString()))+A;N=parseInt((N>1e3?1e3:N).toString()),w>0&&0===this.player.cameraStatus&&!this.videoBreak.decodeStartTime&&(this.videoBreak.decodeStartTime=b-1e3),this.videoBreak.decodeStartTime&&Ll(b,w,0===this.player.cameraStatus&&this.player.playMediaStatus.video,this.videoBreak,this.videoBreakThreshold,this.videoBreakReport,this.videoReliableBreak,D,N)}if(y){var O=y.totalSamplesReceived,M=y.concealedSamples,L=y.bytesReceived,U=S(O,this.totalQuality.totalSamplesReceived);this.totalQuality.totalSamplesReceived=O;var B=S(M,this.totalQuality.concealedSamples);this.totalQuality.concealedSamples=M;var z=S(L,this.totalQuality.audioBytesReceived);this.totalQuality.audioBytesReceived=L;var q=parseInt((B/(U||1)*1e3).toString());z>0&&0===this.player.micStatus&&!this.audioBreak.decodeStartTime&&(this.audioBreak.decodeStartTime=b-1e3),this.audioBreak.decodeStartTime&&Ll(b,z,0===this.player.micStatus&&this.player.playMediaStatus.audio,this.audioBreak,this.audioBreakThreshold,this.audioBreakReport,this.audioReliableBreak,q,q,"audio")}var X=[],H="",F=!1;if(e.forEach((function(e){"track"==e.type&&(F=!0)})),e.forEach((function(t){var i=t.kind||t.mediaType;if(("inbound-rtp"==t.type||"ssrc"==t.type&&null!=t.bytesReceived)&&("audio"==i||t.id.indexOf("AudioStream")>=0)){var o="";if((b=e.get(t.codecId))&&b.mimeType&&(o=b.mimeType.split("/")[1]),r._audioCodecName!==o&&(r._audioCodecName=o),c.audioCodec=r._audioCodecName,0!=u&&(c.audioBitrate=8*(t.bytesReceived-r.lastPlayStats.audioBytesReceived)/(t.timestamp-u),(y=t.packetsLost-r.lastPlayStats.audioPacketsLost)>0&&(d=y/(y+t.packetsReceived-r.lastPlayStats.audioPacketsReceived))),c.audioBitrate<0&&(c.audioBitrate=0),t.jitterBufferDelay){var s=t.jitterBufferDelay,a=t.jitterBufferEmittedCount;m=Math.floor((s-r.lastPlayStats.audioJitterBufferDelay)/(a-r.lastPlayStats.audioJitterBufferEmittedCount)*1e3),(m=isNaN(m)||m<0?0:m)>1e4&&r.Xn.info("".concat(Vs," ").concat(r.streamId," audio jitterDelay ").concat(s," ").concat(r.lastPlayStats.audioJitterBufferDelay," ").concat(a," ").concat(r.lastPlayStats.audioJitterBufferEmittedCount)),r.lastPlayStats.audioJitterBufferDelay=s,r.lastPlayStats.audioJitterBufferEmittedCount=a,c.audioJitterBufferDelayMs=m}c.audioJitter=t.jitter,t.packetsLost>0&&(c.audioPacketsLost=t.packetsLost);var g=t.packetsLost-r.lastPlayStats.audioPacketsLost;c.audioFPS=(t.packetsReceived-r.lastPlayStats.audioPacketsReceived)/(t.timestamp-u)*1e3,c.audioPacketsLostRate=g>0?g/(t.packetsReceived-r.lastPlayStats.audioPacketsReceived+g):0,r.lastPlayStats.audioBytesReceived=t.bytesReceived,t.packetsLost>0&&(r.lastPlayStats.audioPacketsLost=t.packetsLost),r.lastPlayStats.audioPacketsReceived=t.packetsReceived,r.lastPlayStats.audioTime=t.timestamp,r.lastPlayStats.time=t.timestamp,r.lastPlayStats.audioBitrate=c.audioBitrate,p=t.jitter,F||r.aTrackStats(c,t)}else if(("inbound-rtp"==t.type||"ssrc"==t.type&&null!=t.bytesReceived)&&("video"==i||t.id.indexOf("VideoStream")>=0)){var y;0!=u?(c.videoBitrate=8*(t.bytesReceived-r.lastPlayStats.videoBytesReceived)/(t.timestamp-u),c.videoFPS=1e3*(t.framesDecoded-r.lastPlayStats.framesDecoded)/(t.timestamp-u),(y=t.packetsLost-r.lastPlayStats.videoPacketsLost)>0&&(h=y/(y+t.packetsReceived-r.lastPlayStats.videoPacketsReceived))):un(t.framesPerSecond)&&(c.videoFPS=t.framesPerSecond),c.videoBitrate<0&&(c.videoBitrate=0),c.videoFPS<0&&(c.videoFPS=0);var b,_="";(b=e.get(t.codecId))&&b.mimeType&&(_=b.mimeType.split("/")[1]),r._videoCodecName!==_&&(r._videoCodecName=_),c.videoCodecName=r._videoCodecName,t.jitterBufferDelay&&(s=t.jitterBufferDelay,a=t.jitterBufferEmittedCount,v=Math.floor((s-r.lastPlayStats.videoJitterBufferDelay)/(a-r.lastPlayStats.videoJitterBufferEmittedCount)*1e3),(v=isNaN(v)||v<0?0:v)>1e4&&r.Xn.info("".concat(Vs," ").concat(r.streamId," video jitterDelay ").concat(s," ").concat(r.lastPlayStats.videoJitterBufferDelay," ").concat(a," ").concat(r.lastPlayStats.videoJitterBufferEmittedCount)),r.lastPlayStats.videoJitterBufferDelay=s,r.lastPlayStats.videoJitterBufferEmittedCount=a,c.videoJitterBufferDelayMs=v),c.videoRenderFPS=r.getVideoRenderFps(n),c.codecImplementationName=t.decoderImplementation,c.videoJitter=t.jitter,c.nackCount=t.nackCount,c.pliCount=t.pliCount,c.videoFramesDecoded=t.framesDecoded,c.keyFramesDecoded=t.keyFramesDecoded,c.totalFreezesDuration=t.totalFreezesDuration,t.packetsLost>0&&(c.videoPacketsLost=t.packetsLost),c.videoPacketsLostRate=(g=t.packetsLost-r.lastPlayStats.videoPacketsLost)>0?g/(t.packetsReceived-r.lastPlayStats.videoPacketsReceived+g):0,r.lastPlayStats.videoBytesReceived=t.bytesReceived,r.lastPlayStats.framesDecoded=t.framesDecoded,t.packetsLost>0&&(r.lastPlayStats.videoPacketsLost=t.packetsLost),r.lastPlayStats.videoPacketsReceived=t.packetsReceived,r.lastPlayStats.videoTime=t.timestamp,r.lastPlayStats.time=t.timestamp,f=t.jitter,F||r.vTrackStats(c,t,u)}else"track"==t.type&&("video"==i||t.id.indexOf("video")>=0)||t.frameWidth?r.vTrackStats(c,t,u):"track"==t.type&&("audio"==i||t.id.indexOf("audio")>=0)?r.aTrackStats(c,t):"candidate-pair"==t.type?(null!=t.totalRoundTripTime&&(c.totalRoundTripTime=t.totalRoundTripTime),null!=t.currentRoundTripTime&&(c.currentRoundTripTime=t.currentRoundTripTime,l=1e3*c.currentRoundTripTime),void 0!==t.availableOutgoingBitrate&&(c.availableOutgoingBitrate=t.availableOutgoingBitrate),"succeeded"===t.state&&(H=t.localCandidateId)):"local-candidate"===t.type&&X.push(t)})),H){var V=X.find((function(e){return e.id==H}));if(V){var G=void 0;if(void 0!==V.relayProtocol)G=V.relayProtocol;else if(V.priority){var j=V.priority>>24;void 0!==j&&(G=_o(j,this.re.browser))}void 0!==G&&this.webrtcProtocol!==G&&(this.Xn.info(Hs+" "+this.streamId+" pro "+G),this.webrtcProtocol=G);var Q=!1,W=V.candidateType,Z=V.relayProtocol,K=V.relatedAddress,J=V.url;Q=this.Ge([{key:"candidateType",value:W},{key:"networkType",value:V.networkType}]),"relay"===W&&(Q=this.Ge([{key:"relayProtocol",value:Z},{key:"relatedAddress",value:K},{key:"url",value:J}])),Q&&this.Xn.warn(Fs+" "+this.streamId+" upload candidate change "+JSON.stringify(this.candidateStats))}}var Y;Y=m>0&&v>0?Math.max(m,v):m>0?m:v>0?v:0,c.jitterBufferDelayMs=this.lastPlayStats.jitterBufferDelayMs=Y,h=isNaN(h)||h<0?0:h,f=isNaN(f)||f<0?0:f,d=isNaN(d)||d<0?0:d,p=isNaN(p)||p<0?0:p;var $=Fn(l,h,f),ee=Fn(l,d,p);c.audioQuality=u>0?Vn(ee):0,c.videoQuality=u>0?Vn($):0,this.player.re.networkState!==_.offline&&"disconnected"!==(null===(i=this.player.peerConnection)||void 0===i?void 0:i.connectionState)||(c.videoQuality=x.Die,c.audioQuality=x.Die);var te=Math.min($,ee);this.netQuality=te,c.peerToPeerDelay=isNaN(this.p2pNetStats.p2pRTT)?0:parseInt((this.p2pNetStats.p2pRTT/2+this.lastPlayStats.jitterBufferDelayMs).toString()),c.peerToPeerPacketLostRate=this.p2pNetStats.p2pLostRate,this.playStat=c,this.updateCurrentQualityStats(c),(!this.hasRecvMediaData&&c.videoBitrate>0||c.audioBitrate>0)&&(this.hasRecvMediaData=!0,this.onRecvMediaData&&this.onRecvMediaData()),1===this.timerType&&0!=u&&this.player.onPlayQualityUpdate(this.streamId,this.currentQuality),s&&(this.checkProbe(b),this.uploadPlayQuality(c,b),0!=u&&(0===this.timerType&&this.player.onPlayQualityUpdate(this.streamId,this.currentQuality),this.exception.checkRemoteStats(c,this._playStream),this.ee.changeRxQuality(Vn(this.netQuality)))),2==this.timerType&&0===u&&this.qualityTimer&&this.setPlayQualityUpdateTimer()}},e.prototype.getVideoRenderFps=function(e){var t;if(!e||!e||!e.getVideoPlaybackQuality&&!e.requestVideoFrameCallback&&void 0===e.mozPaintedFrames)return-1;var i=this.lastPlayStats.videoElem,r=e.currentTime,n=e.getVideoPlaybackQuality();e.requestVideoFrameCallback&&!n.totalVideoFrames?i&&i==e||(this.lastPlayStats.videoElem=e,this.lastPlayStats.lastTimestamp=r,!i&&e.requestVideoFrameCallback(this.videoFramesRender.bind(this))):this.lastPlayStats.videoElem=null,i=this.lastPlayStats.videoElem;var o,s=Date.now(),a=this.lastPlayStats,c=a.renderTime;return o="firefox"!=this.player.re.browser||n.totalVideoFrames||i||void 0===e.mozPaintedFrames?i?a.paintedFrames:n.totalVideoFrames-n.droppedVideoFrames:e.mozPaintedFrames,t=0!=c?1e3*(o-a.totalRenderFrames)/(s-c):o/n.creationTime,this.lastPlayStats.renderTime=s,this.lastPlayStats.totalRenderFrames=o,t},e.prototype.videoFramesRender=function(e,t){var i=this.lastPlayStats,r=i.videoElem;if(r&&r.requestVideoFrameCallback){var n=r.currentTime;i.lastTimestamp!=n&&(this.lastPlayStats.paintedFrames++,this.lastPlayStats.lastTimestamp=n),r.requestVideoFrameCallback(this.videoFramesRender.bind(this))}},e.prototype.vTrackStats=function(e,t,i){var r=t.frameWidth,n=t.framesReceived,o=t.framesDropped,s=t.timestamp;if(e.frameHeight=t.frameHeight,e.frameWidth=r,!e.frameHeight||!e.frameWidth){var a=this.lastPlayStats.videoElem||So(this.player.playStream);a&&(e.frameHeight=a.videoHeight||0,e.frameWidth=a.videoWidth||0)}0!==this.player.cameraStatus&&0===e.videoBitrate&&0===e.videoFPS&&(e.frameHeight=0,e.frameWidth=0);var c=e.frameWidth,u=e.frameHeight;if(0===i||this.lastPlayStats.frameHeight===u&&this.lastPlayStats.frameWidth===c)0===i&&(this.lastPlayStats.frameHeight=u,this.lastPlayStats.frameWidth=c,this.player.isProbe||(this.ve.spanAppendAttribute({key:this.player.Ze,par:this.streamId},"vinfo",{h:u,fft:Date.now(),w:c}),this.ve.spanAppendAttribute({key:wi.event,par:this.streamId},"vinfo",{h:u,fft:Date.now(),w:c})));else{if(!this.player.isProbe){var l=this.ve.createSpan(F.H,{key:Ti.event,par:this.streamId},{key:""},"/sdk/play_video_size_changed");l.setAttributes({webrtc_sid:gi(this.sessionId),w:yi(c),h:bi(u)}),l.end(),this.ve.spanAppendAttribute({key:this.player.Ze,par:this.streamId},"vinfo",{h:u,fft:Date.now(),w:c}),this.ve.spanAppendAttribute({key:wi.event,par:this.streamId},"vinfo",{h:u,fft:Date.now(),w:c})}this.lastPlayStats.frameHeight=u,this.lastPlayStats.frameWidth=c}0!=i&&(isNaN(n)||isNaN(o)||(e.videoTransferFPS=1e3*(n-this.lastPlayStats.framesReceived)/(s-i),e.videoFramesDropped=o-this.lastPlayStats.framesDropped)),e.videoTransferFPS<0&&(e.videoTransferFPS=0),e.videoFramesDropped<0&&(e.videoFramesDropped=0),n&&(this.lastPlayStats.framesReceived=n),o&&(this.lastPlayStats.framesDropped=o)},e.prototype.aTrackStats=function(e,t){e.audioLevel=t.audioLevel||0,e.audioSendLevel=t.totalAudioEnergy,e.audioSamplingRate=t.totalSamplesDuration},e.prototype.updateCurrentQualityStats=function(e){var t=e.videoBitrate,i=e.videoFPS,r=e.videoTransferFPS,n=e.frameHeight,o=e.frameWidth,s=e.videoMuteState,a=e.videoQuality,c=e.videoFramesDecoded,u=e.videoFramesDropped,l=e.videoPacketsLost,d=e.videoPacketsLostRate,h=e.audioBitrate,p=e.audioCodec,f=e.audioMuteState,m=e.audioQuality,v=e.audioFPS,g=e.audioJitter,y=e.audioLevel,b=e.audioPacketsLost,_=e.audioPacketsLostRate,S=e.audioSamplingRate,T=e.audioSendLevel,E=e.nackCount,C=e.pliCount,w=e.totalRoundTripTime,I=e.currentRoundTripTime,R=e.peerToPeerDelay,k=e.peerToPeerPacketLostRate,P=e.sampleTimeWindow,A=e.videoRenderFPS,D={video:Ul(Ul({},this.currentQuality.video),{videoBitrate:t,videoFPS:i,videoTransferFPS:r,frameHeight:n,frameWidth:o,videoQuality:a,videoFramesDecoded:c,videoFramesDropped:u,videoPacketsLost:l,videoPacketsLostRate:d,muteState:s,videoCumulativeDecodeTime:this.videoReliableBreak.decodeDuration,videoCumulativeBreakTime:this.videoReliableBreak.breakDuration,videoCumulativeBreakRate:this.videoReliableBreak.breakDuration/(this.videoReliableBreak.decodeDuration+this.videoReliableBreak.breakDuration||1),videoRenderFPS:A}),audio:Ul(Ul({},this.currentQuality.audio),{audioBitrate:h,audioCodec:p,audioQuality:m,audioFPS:v,audioJitter:g,audioLevel:y,audioPacketsLost:b,audioPacketsLostRate:_,audioSamplingRate:S,audioSendLevel:T,muteState:f,audioCumulativeDecodeTime:this.audioReliableBreak.decodeDuration,audioCumulativeBreakTime:this.audioReliableBreak.breakDuration,audioCumulativeBreakRate:this.audioReliableBreak.breakDuration/(this.audioReliableBreak.decodeDuration+this.audioReliableBreak.breakDuration||1)}),nackCount:E,pliCount:C,totalRoundTripTime:w,currentRoundTripTime:I,peerToPeerDelay:R,peerToPeerPacketLostRate:(k||0)/255,sampleTimeWindow:P};void 0!==e.codecImplementationName&&(D.codecImplementationName=e.codecImplementationName),void 0!==e.videoCodecName&&(D.video.googCodecName=e.videoCodecName),""!==e.audioCodec&&(D.audio.googCodecName=e.audioCodec),this.currentQuality=D},e.prototype.uploadPlayQuality=function(e,t){if(this.player.signal.isServerConnected){var i=t;(0==this.qualityUploadLastTime||i-this.qualityUploadLastTime>=2e3)&&(e.stream_type="play",e.stream_id=this.streamId,e.timeStamp=i,e.video_break_duration=this.videoBreakReport.breakDuration,e.video_break_cancel_duration=this.videoBreakReport.breakCancelDuration,e.video_decode_time=this.videoBreakReport.decodeTime,this.videoBreakReport.breakCancelDuration=0,this.videoBreakReport.breakDuration=0,this.videoBreakReport.decodeTime=0,e.audio_break_duration=this.audioBreakReport.breakDuration,e.audio_break_cancel_duration=this.audioBreakReport.breakCancelDuration,e.audio_decode_time=this.audioBreakReport.decodeTime,this.audioBreakReport.breakCancelDuration=0,this.audioBreakReport.breakDuration=0,this.audioBreakReport.decodeTime=0,e.real_sampling_interval=i-this.lastSampleTime,this.lastSampleTime=i,this.Xn.info(Fs+" "+this.streamId+" upload"+JSON.stringify(e)),this.ee.updateQuality(I.play_quality,e),this.qualityUploadLastTime=i)}},e.prototype.getP2PNetStats=function(){var e=this;this.player.signal.getP2PNetStats((0,o.getSeq)(),this.sessionId,this.peerID,(function(t,i,r){var n=r.p2p_rtt;e.p2pNetStats.p2pLostRate=r.p2p_lost_rate||0,e.p2pNetStats.p2pRTT=n||0}),(function(e){}))},e.prototype.getTimerType=function(){this.timerType=this.qualityUpdateInterval===this.qualityUploadInterval?0:this.qualitySampleInterval===this.qualityUpdateInterval?1:2,this.Xn.info("zc.p.0.qgtt "+this.streamId+" timer type "+this.timerType+" "+this.qualitySampleInterval+" "+this.qualityUpdateInterval+" "+this.qualityUploadInterval)},e.prototype.setPlayQualityTimer=function(){var e=this;null==this.qualityTimer&&(this.Xn.info(Hs+" "+this.streamId+" startTimer"),this.clearPlayQualityTimer(),this.getP2PNetStats(),this.qualityTimer=setInterval((function(){e.sampleTimes++;var t=e.player.peerConnection;if(t){var i=[t.getStats(null)];Promise.all(i).then((function(t){e.qualityTimer&&e.getPlayStats(t[0],t[1])})).catch((function(t){e.Xn.error(Hs+" "+e.streamId+" getStats error "+t.toString())}))}}),this.qualitySampleInterval),this.lastPlayStats={audioPacketsLost:0,videoPacketsLost:0,time:Date.now(),audioTime:0,videoTime:0,audioBytesReceived:0,videoBytesReceived:0,videoPacketsReceived:0,audioPacketsReceived:0,framesDecoded:0,framesReceived:0,framesDropped:0,audioBitrate:0,totalRenderFrames:0,renderTime:0,paintedFrames:this.lastPlayStats.paintedFrames,lastTimestamp:0,videoElem:this.lastPlayStats.videoElem,audioJitterBufferDelay:0,audioJitterBufferEmittedCount:0,videoJitterBufferDelay:0,videoJitterBufferEmittedCount:0,jitterBufferDelayMs:0})},e.prototype.clearPlayQualityTimer=function(){if(this.clearPlayQualityUpdateTimer(),null!=this.qualityTimer){clearInterval(this.qualityTimer),this.qualityTimer=null;var e=(new Date).getTime();this.lastSampleTime=0,this.sampleTimes=0,this.totalQuality={totalSquaredInterFrameDelay:0,totalInterFrameDelay:0,framesDecode:0,totalSamplesReceived:0,concealedSamples:0,audioBytesReceived:0},xl(this.videoBreak,this.videoBreakReport,this.videoReliableBreak,this.videoBreakThreshold,0===this.player.cameraStatus&&this.player.playMediaStatus.video,e),xl(this.audioBreak,this.audioBreakReport,this.audioReliableBreak,this.audioBreakThreshold,0===this.player.micStatus&&this.player.playMediaStatus.audio,e,"audio")}this.poorQualityNum=0,this.lastPlayStats={audioPacketsLost:0,videoPacketsLost:0,time:0,audioTime:0,videoTime:0,audioBytesReceived:0,videoBytesReceived:0,videoPacketsReceived:0,audioPacketsReceived:0,framesDecoded:0,framesDropped:0,framesReceived:0,audioBitrate:0,totalRenderFrames:0,renderTime:0,paintedFrames:0,lastTimestamp:0,videoElem:null,audioJitterBufferDelay:0,audioJitterBufferEmittedCount:0,videoJitterBufferDelay:0,videoJitterBufferEmittedCount:0,jitterBufferDelayMs:0}},e.prototype.setPlayQualityUpdateTimer=function(){var e=this;null==this.qualityUpdateTimer&&(this.Xn.info("zc.p.1.spqt.1 "+this.streamId+" called "+this.qualityUpdateInterval),this.clearPlayQualityUpdateTimer(),this.qualityUpdateTimer=setInterval((function(){e.player.onPlayQualityUpdate(e.streamId,e.currentQuality)}),this.qualityUpdateInterval))},e.prototype.clearPlayQualityUpdateTimer=function(){this.Xn.info("zc.p.1.cpqt.1 "+this.streamId+" called "+!!this.qualityUpdateTimer),null!=this.qualityUpdateTimer&&(clearInterval(this.qualityUpdateTimer),this.qualityUpdateTimer=null)},e.prototype.checkProbe=function(e){var t=this.netQuality,i=this.lastPlayStats.time;if(this.Xn.info(Hs+this.streamId+" netQuality "+t+" "+i),t<=this.ee.targetQuality?this.poorQualityNum++:this.poorQualityNum=0,t<=this.ee.l3BadQualityScore&&this.ee.handleQualityBad(this.streamId,this.player.resourceMode,z.L3)?this.Xn.info(Hs+"check cdn mode"):i>0&&this.poorQualityNum>=this.ee.probeStartedNum&&e>this.player.probeTime+this.ee.probeInterval&&(this.Xn.info(Hs+" netQuality "+t+" start net probe"),this.probeState=a.tryProbe,this.player.poorQualityRetryCnt++,this.ee.startNetProbe(!1,this.player,this.player.gwNodeList)),t>this.ee.l3BadQualityScore){var r=this.ee.playerList[this.streamId];r?r.qualityBadCount=0:this.Xn.warn(Hs+" ".concat(this.streamId," play info not exist.")),this.ee.l3ProtocolBadTimestamp=0,this.ee.lastHandleL3BadTimestamp=0}},e.prototype.startProbeTimeout=function(){var e=this;this.probeTimer=setTimeout((function(){e.Xn.error(Ns+" probe timeout"),e.player.playStateUpdateError(Ti.error.Un)}),this.probeTimeoutInterval)},e.prototype.stopProbeTimeout=function(){this.probeTimer&&(clearTimeout(this.probeTimer),this.probeTimer=null)},e.prototype.Ge=function(e){for(var t=!1,i=0;i<e.length;i++){var r=e[i],n=r.key,o=r.value;this.candidateStats[n]!==o&&(this.candidateStats[n]=o,t=!0)}return t},e}(),zl=function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))};var ql=function(){function e(e,t){this.ac=e,this.Xn=t,this.useScript=!1,this.scriptNode=null,this.workletNode=null,this.bufferSize=4096}return e.prototype.setAudioFrameCallback=function(e,t,i,r){var n,o,s,a=this;this.Xn.info("zc.apdp.safc.0 ".concat(e.id," ").concat(t," ").concat(JSON.stringify(r)));var c=(null==r?void 0:r.frameSize)||this.bufferSize;if(t)if(this.srcNode||(this.srcNode=this.ac.createMediaStreamSource(e)),this.useScript)this.scriptNode||(this.scriptNode=this.ac.createScriptProcessor(c),this.scriptNode.onaudioprocess=function(e){for(var t=0;t<e.outputBuffer.numberOfChannels;t+=1)for(var r=e.outputBuffer.getChannelData(t),n=0;n<r.length;n+=1)r[n]=0;var o=e.inputBuffer.numberOfChannels,s=[];try{if(o>0)for(var c=0;c<o;c++){var u=e.inputBuffer.getChannelData(c);s.push(u)}i&&i({channels:s,channelCount:o,sampleRate:e.inputBuffer.sampleRate})}catch(e){a.Xn.info("zc.apdp.safc.0 script fail ".concat(e.toString()))}},this.Xn.info("zc.apdp.safc.0 create scriptNode")),this.srcNode.connect(this.scriptNode),this.scriptNode.connect(this.ac.destination);else{if(!this.workletNode){try{this.workletNode=new AudioWorkletNode(this.ac,"audio-pcm-data-processor",{processorOptions:{bufferSize:c}})}catch(e){this.Xn.error("zc.apdp.safc.0 create worklet fail ".concat(e.toString()))}this.workletNode&&(this.workletNode.port.onmessage=function(e){if("process"===e.data.type)try{var t=e.data;i&&i({channels:t.channels,channelCount:t.channelCount,sampleRate:t.sampleRate})}catch(e){}},this.Xn.info("zc.apdp.safc.0 init worklet"))}this.workletNode&&this.srcNode.connect(this.workletNode),null===(n=this.workletNode)||void 0===n||n.connect(this.ac.destination)}else{try{this.workletNode&&(null===(o=this.srcNode)||void 0===o||o.disconnect(this.workletNode)),this.scriptNode&&(null===(s=this.srcNode)||void 0===s||s.disconnect(this.scriptNode))}catch(e){this.Xn.info("zc.apdp.safc.0 ".concat(JSON.stringify(e)))}this.srcNode=null}},e.prototype.replaceSource=function(e){var t,i;if(this.Xn.info("zc.apdp.rs.0 ".concat(e.id)),this.srcNode){var r=this.ac.createMediaStreamSource(e);this.workletNode&&(null===(t=this.srcNode)||void 0===t||t.disconnect(this.workletNode),r.connect(this.workletNode)),this.scriptNode&&(null===(i=this.srcNode)||void 0===i||i.disconnect(this.scriptNode),r.connect(this.scriptNode)),this.srcNode=null,this.srcNode=r}},e.prototype.destroy=function(){var e,t;this.Xn.info("zc.apdp.ds.0 call"),this.workletNode&&(this.workletNode.port.close(),null===(e=this.srcNode)||void 0===e||e.disconnect(this.workletNode),this.workletNode.disconnect(),this.Xn.info("zc.apdp.ds.0 destroy worklet")),this.scriptNode&&(this.scriptNode.onaudioprocess=null,null===(t=this.srcNode)||void 0===t||t.disconnect(this.scriptNode),this.scriptNode.disconnect(),this.Xn.info("zc.apdp.ds.0 close script processor")),this.workletNode=null,this.scriptNode=null,this.srcNode=null,this.Xn.info("zc.apdp.ds.0 end")},e}(),Xl=function(){return Xl=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Xl.apply(this,arguments)},Hl=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Fl=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Vl=Ti,Gl=Vl.event,jl=Vl.error,Ql=wi,Wl=Ei;function Zl(e){var t=0,i=0;return t=e[i++]<<24,t|=e[i++]<<16,t|=e[i++]<<8,t|e[i++]}function Kl(e,t){void 0===t&&(t=0);for(var i=e.length,r=[],n=0;n<i;)n>=t&&i-n>=3&&!e[n]&&!e[n+1]&&3==e[n+2]?(r.push(e[n++]),r.push(e[n++]),n++):r.push(e[n++]);var o=new Uint8Array(r);return{output:o,outLength:o.length}}var Jl=Ii.event,Yl=function(){function e(e,t,i,r,n,s,a,c,u){var l,d=this;this.curCBState={state:"NO_PLAY",code:0},this.probedList=[],this.probeTime=0,this.probeTimer=null,this.probeNodeList=[],this._autoTcp=!0,this.hasSucceed=!1,this.rtcValidTime=0,this.l3ValidTime=0,this.cdnValidTime=0,this.cdnPlayTime=0,this.pulledTimeStamp=0,this.firstPulledTimeStamp=0,this.validPulledTime=0,this.rtcBrokenCnt=0,this.l3BrokenCnt=0,this.CDNBrokenCnt=0,this._state=7,this.lastState=7,this.candidateInfo=[],this.broadcasterStatus=D.stop,this.isExternal=!1,this.reportSeq=NaN,this.parentSpanKey="",this.streamReportSeq=(0,o.getSeq)(),this.reportBeginTime=0,this.reportPlayingTime=0,this.reportPlayStateTime=0,this.streamInRoom=!0,this.playStartTime=0,this.streamRoomPushConsumed=0,this.probeIpCnt=0,this.validProbeIpCnt=0,this.poorQualityRetryCnt=0,this.probeNotRetryInfos=[],this.continuousFailCnt=0,this.playStateCount=0,this.isRePlay=!1,this.videoSizeCallback=!1,this.remoteStream=null,this.playStream=null,this.rtcViewer=null,this.playOption={},this.playMediaServerMode={video:!0,audio:!0,expireTime:0},this.isServerMuteVideo=!1,this.isServerMuteAudio=!1,this.playMediaModeTimer=null,this.closeSessionSignal=!1,this.stateNego=g.stop,this.negoTimer=null,this.negoInterval=25e3,this.cameraStatus=0,this.micStatus=0,this.hasSentStreamStatus=!1,this.playEvent=!1,this.gotStreamStatus=!1,this.soundLevel=0,this.mic=null,this.beginTime=0,this.firstFrameTime=0,this.resourceMode=0,this.gwNode="",this.gwNodeList=[],this.gwNodesTTL=0,this.isPeer=!0,this.peerFailCount=0,this.isProbe=!1,this.probeType="audio",this.peerID=0,this.isRecvClientInfo=!1,this.videoCodec="",this.videoCodecTimes=0,this.answerSdpTime=0,this.streamConnectIP="",this.initPoster="",this.initVideoStyle="",this.firstPlay=!0,this.isProbeByDG=!1,this.useResourceTypes=[],this.tryidx=0,this._CDNPlayerClone=null,this.retryFailGwNodes=[],this.dispatchedGwNodes=[],this.rtcPlayCount=0,this.signalTime=0,this.stopReason="",this.isProbeDispatch=!1,this.Ze=Jl,this.streamNotFoundTime=0,this.pushCmdSeqMap=((l={}).MediaDescPush={seq:-1,time:0},l.StreamStatusNotifyPush={seq:-1,time:0},l.PlayEventPush={seq:-1,time:0},l.ClientInfoPush={seq:-1,time:0},l.NetQualityInfoPush={seq:-1,time:0},l.CandidateInfoPush={seq:-1,time:0},l),this.probeQuality=0,this.audioMuteState="0",this.videoMuteState="0",this.first_pkt=!0,this.next_sn=[],this.pkt_list=[],this.onDataChannelList=[],this.sideMediaConfig={isSEIStart:!1,unregisterSeiFilter:"",filterSize:0},this.cachedGwNodesMode=Nd.DiffReUse,this.iceDisconnectedMaxTime=15e3,this.te=!1,this.netTimer=null,this.lostQualityTime=0,this.userID="",this.proxyVrs={lanIP:"",wanIP:"",intranet:!1},this._turnToTcp=!1,this.decodeVideoFrame=function(e,t){var i,r,n="VP8"!==d.videoCodec;if(n){var o=d.Ye;if(o){if(o.buffer)if(e.timestamp-o.time<20){var s=function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var i=0;i<e.byteLength;i++)if(e[i]!==t[i])return!1;return!0}(new Uint8Array(e.data),o.buffer);s&&(n=!1)}else o.buffer=void 0}else d.Ye={buffer:new Uint8Array(e.data),time:e.timestamp}}if(n){for(var a=new DataView(e.data),c=0,u=new Ou(a),l=0,h=!1;u.NextNalu(h);)if(7!=(l=31&a.getUint8(u.nalu_start+u.start_code_size))&&8!=l&&9!=l){if(6!=l)break;var p=new Uint8Array(e.data).slice(u.nalu_start+u.start_code_size,u.nalu_start+u.start_code_size+u.nalu_size);d.re.seiConfig.emulationPreventionByte&&(p=Kl(p).output),c=1,h=!0;for(var f=0;255===p[c];)f+=255,c++;if(243===(f+=p[c++])||5===f||100===f){for(var m=0;255===p[c];)m+=255,c++;if(m+=p[c++],e.data.byteLength-c<m)break;var v=new Uint8Array(4+m);switch(v[0]=0,v[1]=0,f){case 100:v[2]=3,v[3]=235;break;case 5:v[2]=3,v[3]=236;break;case 243:v[2]=3,v[3]=237}for(var g=0;g<m;g++)v[4+g-0]=p[c++];var y=!1;if(243===f)y=!0;else if(5===f){var b=d.sideMediaConfig.unregisterSeiFilter;if(b){var _,S=v.slice(4,4+d.sideMediaConfig.filterSize),T=!0;if(0===(_="string"==typeof b?mo(b):b).length)T=!1;else for(var E=0;E<_.length;E++)if(_[E]!==S[E]){T=!1;break}y=T}else y=!0}y&&d.re.actionListener("playerRecvSEI",d.streamId,v)}else if(244===f){for(m=0;255===p[c];)m+=255,c++;if(m+=p[c++],e.data.byteLength-c<m)break;var C=parseInt(m/5+""),w=p.slice(c,c+=m),I=[],R=function(e){var t=5*e,n=w.slice(t,t+4),o=w.slice(t+4,t+5),s=Zl(n),a=o[0],c=(null===(r=null===(i=d.room.streamList)||void 0===i?void 0:i.find((function(e){return e.stream_nid===s})))||void 0===r?void 0:r.stream_id)||"";I.push({soundLevelID:s,value:a,streamID:c})};for(E=0;E<C;E++)R(E);var k=new Map(I.map((function(e){return[e.soundLevelID,e.value]}))),P=I.filter((function(e){return e.streamID})).map((function(e){return[e.streamID,e.value]})),A=new Map(P);d.re.actionListener("mixerSoundLevelUpdate",k,d.streamId),A.size&&d.re.actionListener("autoMixerSoundLevelUpdate",A,d.streamId)}}t.enqueue(e)}else t.enqueue(e)},this.decodeAudioFrame=function(e,t){t.enqueue(e)},this._eventHandler={seiMessage:function(e){var t=e.data,i=t.streamID;if(i===d.streamId)switch(t.cmd){case"recvSEI":d.re.actionListener("playerRecvSEI",i,new Uint8Array(t.buffer));break;case"mixSoundLevel":d._handleMixSoundLevels(t.soundLevelList)}}},this.soundMeterWorklet=null,this.streamId=e,this.Xn=t,this.signal=i,this.dataReport=r,this.ee=a,this.ac=c,this.re=u,this.te=this.re.isMiniSdp,this.qualityHandler=new Bl(n,s,this,this.Xn,this.dataReport,this.re),this.qualityHandler.onRecvMediaData=function(){d.streamNotFoundTime&&(d.streamNotFoundTime=0,d.Xn.info("zc.p.ormd.1 "+d.streamId+" reset streamNotFoundTime"))},this.playMediaStatus={video:!this.ee.defaultVideoMuted,audio:!this.ee.defaultAudioMuted},this.Xn.info("zc.p.1 "+this.streamId+" set playMediaStatus ".concat(JSON.stringify(this.playMediaStatus))),this.resourceMode=this.Fe("resource_mode"),this.initStreamReport()}return e.prototype.updateCBState=function(e){var t=this,i=Object.keys(e).some((function(i){return e[i]!==t.curCBState[i]}));return i&&(this.curCBState=e),i},Object.defineProperty(e.prototype,"room",{get:function(){var e;return null===(e=this.ee.playerList[this.streamId])||void 0===e?void 0:e.room},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(e){this.lastState=this._state,this._state=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Le",{get:function(){return 6===this.state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"probeState",{get:function(){return this.qualityHandler.probeState},set:function(e){this.qualityHandler.probeState=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"netQuality",{get:function(){return this.qualityHandler.netQuality},set:function(e){this.qualityHandler.netQuality=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastPlayStats",{get:function(){return this.qualityHandler.lastPlayStats},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"iceStateDisConnect",{get:function(){return[g.iceClosed,g.iceDisconnected,g.iceFailed].includes(this.stateNego)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isLastConnected",{get:function(){return 6===this.lastState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playStat",{get:function(){return this.qualityHandler.playStat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"webrtcProtocol",{get:function(){return this.qualityHandler.webrtcProtocol},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ip",{get:function(){var e,t;return null===(t=null===(e=this.gwNode)||void 0===e?void 0:e.split(":"))||void 0===t?void 0:t[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"netProtocol",{get:function(){return this._turnToTcp?"tcp":this._autoTcp?this.webrtcProtocol:"udp"},enumerable:!1,configurable:!0}),e.prototype.createSEIWorker=function(){return this.ee.createSEIWorker()},Object.defineProperty(e.prototype,"seiWorker",{get:function(){return this.ee.seiWorker},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"He",{get:function(){return this.re.useNetAgent},enumerable:!1,configurable:!0}),e.prototype.Fe=function(e,t){return void 0===t&&(t=!1),this.re.settingConfig.getSetting(e,t)},Object.defineProperty(e.prototype,"ve",{get:function(){return this.re.reporter},enumerable:!1,configurable:!0}),e.prototype.netProbeToReDispatch=function(e,t){var i;void 0===e&&(e=function(){}),void 0===t&&(t=function(){}),this.isProbeDispatch=!0;var r=null===(i=this.ee.playerList[this.streamId])||void 0===i?void 0:i.retryStreamHandler;r&&r.dispatchGwNodesBypass(this,e,t)},e.prototype.initStreamReport=function(){this.reportSpan=this.ve.createSpan(F.I,{key:Gl,par:this.streamId},{key:Ql.event,par:this.streamId},Ql.event,!0),this.playStartTime=this.reportBeginTime=(new Date).getTime()},e.prototype.checkAutoTcp=function(){var e=jn();this.Xn.info("zc.p.1.cat ".concat(this.He," ").concat(e," ").concat(this.isPeer)),this._autoTcp=!!(this.He&&e&&this.isPeer)},e.prototype.startPlay=function(e,t,i){var r,n,o,s,a,c,u,l,d=this;if(this.Xn.info(Ns+" called ",e),this.playEvent=!1,this.signal&&this.signal.negoInterval&&(this.negoInterval=this.signal.negoInterval),e){if(this.checkAutoTcp(),this.state=0,this.getRemoteStreamSuc=t,this.playOption=i||{},this.playMediaStatus={video:this.playMediaStatus.video&&(void 0===this.playOption.video||!!this.playOption.video),audio:this.playMediaStatus.audio&&(void 0===this.playOption.audio||!!this.playOption.audio)},i&&i.videoCodec&&(this.playOption.videoCodec=i.videoCodec),i&&dn(i.isSEIStart)&&(this.sideMediaConfig.isSEIStart=null==i?void 0:i.isSEIStart),this.sideMediaConfig.isSEIStart){var h=Gn(),p=null===(r=this.playOption)||void 0===r?void 0:r.videoCodec;(p&&"H264"!==p||!h)&&(this.Xn.warn(Ns+" not use sei; support: ".concat(h,", codec: ").concat(p," ")),this.sideMediaConfig.isSEIStart=!1)}if(null===(n=this.re.seiConfig)||void 0===n?void 0:n.unregisterSEIFilter){var f=this.sideMediaConfig.unregisterSeiFilter=null===(o=this.re.seiConfig)||void 0===o?void 0:o.unregisterSEIFilter;this.sideMediaConfig.filterSize=mo(f).byteLength}null==(null==i?void 0:i.streamType)&&void 0!==this.re.streamType&&(this.playOption.streamType=this.re.streamType),this.ve.spanSetAttributes({key:Gl,par:e},{video_layer:Vl.video_layer(2===this.playOption.streamType?-1:this.playOption.streamType||1)});var m=this.Fe("play_video_codec",!0);m&&(this.Xn.info(Ns+" setting play_video_codec "+m),this.playOption.videoCodec=m);var v=(null===(s=this.playOption)||void 0===s?void 0:s.resourceMode)==q.DG?1:0;if(this.ve.spanSetAttributes({key:(this.isRePlay?Ci:Wl).event,par:this.streamId},{is_peer:Wl.is_peer(this.isPeer)}),this.ve.spanSetAttributes({key:Gl,par:this.streamId},{audio_activate:Vl.audio_activate(1==this.playOption.audio||0!=this.playOption.audio),video_activate:Vl.video_activate(1==this.playOption.video||0!=this.playOption.video),biz_product:Vl.biz_product(v)}),this.reportSpan.setAttributes({room_id:Ql.room_id(null===(c=null===(a=this.ee.playerList[this.streamId])||void 0===a?void 0:a.room)||void 0===c?void 0:c.roomID),room_sid_string:Ql.room_sid_string(null===(l=null===(u=this.ee.playerList[this.streamId])||void 0===u?void 0:u.room)||void 0===l?void 0:l.roomSessionID)}),this.isPeer?this.createOffer({encodedInsertableStreams:this.sideMediaConfig.isSEIStart}):this.createSession(),!this.isProbe){var g=null==i?void 0:i.resourceMode,y=Jl;(g===q.L3||g===q.DG&&this.playMode==z.L3)&&(y="/l3/play"),this.ee.playEventKeys[e]=y,this.Ze=y}null!=this.negoTimer&&(clearTimeout(this.negoTimer),this.negoTimer=null),this.negoTimer=setTimeout((function(){d.Xn.error(Ns+" waiting timeout"),d.playStateUpdateError(jl.Mn)}),this.negoInterval),this.isProbe&&this.qualityHandler.startProbeTimeout()}else this.Xn.warn(Ns+" streamId is null")},e.prototype.onCreatePlaySessionSuccess=function(e){var t;return Hl(this,void 0,void 0,(function(){var i,r,n,s,a,c,u,l,d,h,p,f,m,v,g,y,b,_,S,T,E,C,w,I,R,k,P,A,D,N=this;return Fl(this,(function(O){switch(O.label){case 0:return this.Xn.info((i=Os)+" "+this.streamId+" success"),this.setTurnTcp(),this.ee.autoSwitchProtocol=this.Fe("auto_to_tcp")||!1,r=this.Fe("udp_max_fail_num"),!isNaN(r)&&(this.ee.maxUdpFailNum=r),a=(n=this.ee).maxUdpFailNum,c=n.udpFailNum,this.Xn.info(i+" autoToTcp: ".concat(s=n.autoSwitchProtocol,", udpFailNum: ").concat(c,", maxUdpFailNum: ").concat(a,".")),s&&!this._turnToTcp&&c>=a&&(this.Xn.info(i+" switch to tcp."),this._turnToTcp=!0,this._autoTcp=!1),(u=this.Fe("udp_or_tcp",!0))&&(this.Xn.info(i+" setting udp_or_tcp "+u),this._turnToTcp="tcp"===u),l=[],d=void 0,h=this.proxyVrs.wanIP=(e.gw_nodes[0]||this.gwNode).split(":")[0],!this.ee.isProxy||this.ee.isLocalProxy?[3,2]:(p=null==o.ZegoExpressWebRTM?void 0:o.ZegoExpressWebRTM.proxyCtrl,[4,Promise.all([p.getTurnInfo(),p.intranetCheck(Pu(h),void 0)])]);case 1:return f=O.sent(),v=f[1],(m=f[0]).code?this.Xn.warn(i+" "+this.streamId+" use proxy failed."+JSON.stringify(m)):(y=(g=m.data).password,b=g.turn_ipv4,_=g.turn_port,S=g.username,(T=g.turn_internal_ipv4)&&(this.paramsExt.coturn_internal=T),E=ku(b),C="turn:".concat(E,":").concat(_,"?transport=").concat(this._turnToTcp?"tcp":"udp"),this.Xn.info(i+" turn server: ".concat(C," ; intranet: ").concat(JSON.stringify(null===(t=null==v?void 0:v.data)||void 0===t?void 0:t.intranet),"; turn internal ip: ").concat(ku(T))),d=[{credential:y,urls:[C],username:S}]),v.code?this.Xn.warn(i+" "+this.streamId+" use intranetCheck failed."+JSON.stringify(v)):this.proxyVrs.intranet=v.data.intranet||!1,[3,3];case 2:this.ee.isLocalProxy&&this.ee.turnServers?(d=(I=this.ee.turnServers).map((function(e){return{credential:e.credential,urls:[e.url],username:e.username}})),this.Xn.info(i+" "+this.streamId+" use local proxy: "+JSON.stringify(I)),this.proxyVrs.intranet=!1):e.turn_server&&(w=e.turn_server.split(";"),I=void 0,R=w.filter((function(e){return e.indexOf("udp")>-1})),k=w.filter((function(e){return e.indexOf("tcp")>-1})),I=this._turnToTcp?k.length>0?k:R.map((function(e){return e.replace("udp","tcp")})):R,this.Xn.info(i+" over tcp "+JSON.stringify(I)),l.push.apply(l,I)),O.label=3;case 3:return e.stun_server&&l.push(e.stun_server),P={iceTransportPolicy:"all",iceServers:[{urls:l,username:e.turn_username,credential:e.turn_auth_key}],encodedInsertableStreams:this.sideMediaConfig.isSEIStart},d&&(P.iceServers=d,P.iceTransportPolicy="relay",P.rtcpMuxPolicy="require"),this.Xn.info(i+" "+this.streamId+" username: "+(A=P.iceServers[0]).username+", credential: "+A.credential),this.createOffer(P),D=performance.now(),this.signal.registerPushCallback("MediaDescPush",this.sessionId,(function(e,t,i){return Hl(N,void 0,void 0,(function(){return Fl(this,(function(r){switch(r.label){case 0:return this.compareSeqs("MediaDescPush",e)?[4,this.onRecvMediaDesc(e,t,i)]:[2];case 1:return r.sent(),[2]}}))}))})),this.signal.registerPushCallback("CandidateInfoPush",this.sessionId,(function(e,t,i){if(N.compareSeqs("CandidateInfoPush",e))var r=setTimeout((function(){N.onRecvCandidateInfo(e,t,i),clearTimeout(r)}),0)})),this.signal.registerPushCallback("CloseSessionPush",this.sessionId,(function(e,t,r){if(D){var n=(performance.now()-D).toFixed(0);D=void 0,N.Xn.info(i+" ".concat(N.streamId,", cmd: CloseSessionPush, cost_time: ").concat(n))}32===r.reason&&(N.te=!1,N.re.te=!1),N.onRecvCloseSession(e,t,r)})),this.signal.registerPushCallback("SessionResetPush",this.sessionId,(function(e,t,i){N.onRecvResetSession(e,t,i)})),this.signal.registerPushCallback("StreamStatusNotifyPush",this.sessionId,(function(e,t,i){N.compareSeqs("StreamStatusNotifyPush",e)&&(N.gotStreamStatus=!0,N.streamStatus=i,N.statusSeq=e,N.playStream&&N.onRecvStreamStatus(e,i))})),this.signal.registerPushCallback("PlayEventPush",this.sessionId,(function(e,t,r){if(N.compareSeqs("PlayEventPush",e)){if(D){var n=(performance.now()-D).toFixed(0);N.Xn.info(i+" ".concat(N.streamId,", cmd: PlayEventPush, cost_time: ").concat(n))}N.onRecvPlayEvent(e,t,r)}})),this.signal.registerPushCallback("ClientInfoPush",this.sessionId,(function(e,t,i){N.compareSeqs("ClientInfoPush",e)&&N.onRecvClientInfo(e,t,i)})),this.signal.gw.registerPushCallback("net_quality_grade_push",this.sessionId,(function(e,t,i){N.onRecvNetQualityGrade(e,t,i)})),this.Xn.info(i+" "+this.streamId+" call success"),[2]}}))}))},e.prototype.compareSeqs=function(e,t){var i=this.pushCmdSeqMap[e],r=i.seq,n=i.time,o=performance.now();return-1!==r&&r>=t&&o-n<6e3?(this.Xn.warn("zc.p.cps.1"+" ".concat(this.streamId,", push ").concat(e,", seq ").concat(t," local ").concat(JSON.stringify(this.pushCmdSeqMap[e]))),!1):(this.pushCmdSeqMap[e]={seq:t,time:o},!0)},e.prototype.createOffer=function(e){var t=this,i=Os;if(this.peerConnection=new RTCPeerConnection(e),this.peerConnection.onicecandidate=function(e){t.onIceCandidate(e)},this.peerConnection.onsignalingstatechange=function(e){t.onConnectionStateChange(e)},this.peerConnection.oniceconnectionstatechange=function(e){t.onIceConnectionStateChange(e)},this.peerConnection.onconnectionstatechange=function(e){t.onPeerConnectionStateChange(e)},this.peerConnection.ontrack=function(e){t.onGotRemoteStream(e.streams[0],e.receiver)},this.ee.isDataChannelEnabled&&(this.dataChannel=this.peerConnection.createDataChannel(this.streamId),this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=function(e){t.Xn.info(i+" "+t.streamId+" data channel open")},this.dataChannel.onmessage=function(e){if(t.Xn.info(i+" "+t.streamId+" data channel onmessage"),e.data instanceof Blob){var r=new FileReader,n={};r.readAsArrayBuffer(e.data),r.onload=function(){n.data=r.result,t.onReceivedDataChannel(n)}}else t.onReceivedDataChannel(e)}),this.re.customUa){var r=fn(this.peerConnection.addTransceiver);this.Xn.info(i+" "+this.streamId+" custom ua ios "+r),r&&(this.peerConnection.addTransceiver("video",{direction:"recvonly"}),this.peerConnection.addTransceiver("audio",{direction:"recvonly"}))}var n={offerToReceiveAudio:1,offerToReceiveVideo:1};this.isProbe?"audio"===this.probeType&&(n.offerToReceiveVideo=0):(this.playOption&&!1===this.playOption.video&&(n.offerToReceiveVideo=0),this.playOption&&!1===this.playOption.audio&&(n.offerToReceiveAudio=0)),this.Xn.info(i+" "+this.streamId+" createOffer: "+JSON.stringify(n));var o=this.getSpan("/play/create_offer",this.parentSpanKey);this.peerConnection.createOffer(n).then((function(e){if(o&&(o.setAttributes({sdp:zr(e.sdp),is_mini:qr(t.te)}),o.end()),!t.checkProbeSDP(e.sdp||""))return t.resetPlay(),void t.startPlay(t.streamId,t.getRemoteStreamSuc,t.playOption);t.onCreateOfferSuccess(e)}),(function(e){t.Xn.error(i+" "+t.streamId+" create offer error "+e.toString()),o&&t.ve.setError(o,{code:jl.Xi.code,message:e.toString()}),t.playStateUpdateError(jl.Xi,!0)}))},e.prototype.checkProbeSDP=function(e){return this.Xn.info(Os+" is probe "+this.isProbe),!this.isProbe||!("audio"===this.probeType&&!e.includes("m=audio"))||(this.Xn.warn(Os+" no audio"),this.probeType="all",!1)},e.prototype.createSession=function(e){var t,i,r,n=this;this.sessionSeq=(0,o.getSeq)();var s=this.streamId;1==this.ee.testEnvironment&&(s="zegotest-"+this.ee.appid+"-"+this.streamId),this.ee.gwNode&&(this.gwNode=this.ee.gwNode);var a=this.Fe("gw_nodes");a&&mn(a)&&a.length>0&&(this.Xn.info(Ns+" setting "+JSON.stringify(a)),this.gwNodeList=a,this.gwNode=this.gwNodeList[0]||this.gwNode),this.setTurnTcp();var c=this.Fe("udp_or_tcp",!0);c&&(this.Xn.info(Us+" setting udp_or_tcp "+c),this._turnToTcp="tcp"===c),this._turnToTcp&&(this.isPeer=!1,this._autoTcp=!1);var u=(null===(i=null===(t=this.ee.publisherList[this.streamId])||void 0===t?void 0:t.room)||void 0===i?void 0:i.roomID)||(null===(r=this.re.roomList[0])||void 0===r?void 0:r.roomID),l=this.getSessionParams(u),d=l.params,h=l.paramsExt;this.paramsExt=h;var p=Fr;if(this.isPeer){var f=this.getSpan(Fr.event,this.parentSpanKey),m=this.Fe("l3_play_buffer_ms"),v=(new Date).getTime();this.signal.createSessionWithSdp({seq:this.sessionSeq,type:this.isProbe?2:1,mode:0,streamId:s,strAuthParam:this.playOption&&this.playOption.streamParams||"",sdp:e.sdp,serverHost:this.gwNode,playBufLevel:[q.L3,q.DG].includes(this.resourceMode)?m:void 0,params:d,paramsExt:h,roomID:u,geo:{type:this.ee.geo.type,areaList:this.ee.geo.areaList},player:this},(function(e,t,i){return Hl(n,void 0,void 0,(function(){var r;return Fl(this,(function(n){return r=(new Date).getTime(),this.Xn.info(Ns+" create session time "+(r-v)),f&&(f.setAttributes({webrtc_sid:t,sdp:p.sdp(i.sdp),gw_nodes:p.gw_nodes(i.gw_nodes),gw_nodes_ttl:p.gw_nodes(i.gw_nodes_ttl),gw_version:p.gw_version(i.gw_version)}),f.end()),this.stateNego!==g.iceConnected&&this.getSpan(Qr,this.parentSpanKey,"",!0),this.ve.spanSetAttributes({key:Gl,par:this.streamId},{gw_version:Vl.gw_version(i.gw_version)}),this.handleCreateSessionWithSdpResp(e,t,i),[2]}))}))}),(function(e,t){if(n.sessionSeq==t){var i=1==e?jl.tn:jl.nn;f&&(f.setAttributes({try_cnt:n.peerFailCount}),n.ve.setError(f,i)),n.playStateUpdateError(i)}else n.Xn.warn(Ns+" seq is not match.")}))}else{var y=this.getSpan(Fr.event,this.parentSpanKey);this.signal.createSession(this.sessionSeq,1,0,s,this.playOption&&this.playOption.streamParams,this.gwNode,d,u,{type:this.ee.geo.type,areaList:this.ee.geo.areaList},(function(e,t,i){return Hl(n,void 0,void 0,(function(){return Fl(this,(function(r){return y&&(y.setAttributes({webrtc_sid:Fr.webrtc_sid(t),sdp:p.sdp(i.sdp),is_mini:p.is_mini(this.te),gw_nodes:p.gw_nodes(i.gw_nodes),gw_nodes_ttl:p.gw_nodes(i.gw_nodes_ttl),gw_version:p.gw_version(i.gw_version)}),y.end(),this.ve.spanSetAttributes({key:Gl,par:this.streamId},{gw_version:Vl.gw_version(i.gw_version)})),this.handleCreateSessionResp(e,t,i),[2]}))}))}),(function(e,t){if(n.sessionSeq==t){var i=1==e?jl.tn:jl.nn;y&&n.ve.setError(y,i),n.playStateUpdateError(i)}else n.Xn.warn(Ns+" seq is not match.")}))}this.state=1,this.Xn.info(Ns+" "+this.streamId+" called success"),this.stateNego=g.start},e.prototype.getSessionParams=function(e){var t="",i=[],r={},n=this.re.seiConfig.SEIPass;if(dn(n)){var o=n?1:0;this.He?r.sei_filter_pass=o:i.push("zgseipass="+o)}return this.He&&(r.auto_switch_turn_type="firefox"===this.re.browser?2:1),this.te&&!this.He&&i.push("sdp_fmt_type=1"),2===this.resourceMode&&(r.client_class_type=1),un(this.playOption.streamType)&&(this.He?r.video_stream_type=this.playOption.streamType:i.push("video_stream_type="+this.playOption.streamType)),this.re.idName&&i.push("zguid="+this.re.idName),e&&i.push("zgrid="+e),this.ee.isProxy&&(this.re.useNetAgent?r.zg_proxy=1:i.push("zg_proxy=1")),i.length>0&&(t=i.join("&")),{params:t,paramsExt:r}},e.prototype.setGwNodes=function(e,t){var i;if(this.Xn.info("zc.p.1.sgn "+this.streamId+" "+JSON.stringify(null==e?void 0:e.gw_nodes)+" "+JSON.stringify(this.retryFailGwNodes)),(null===(i=e.gw_nodes)||void 0===i?void 0:i.length)>0){var r=bo(e.gw_nodes,this.retryFailGwNodes,t);this.retryFailGwNodes=[],this.handleDispatchedGwNodes(r,e.gw_nodes_ttl)}},e.prototype.resetGwNodes=function(){this.Xn.info("zc.p.1.rgn "+this.streamId),this.gwNode="",this.gwNodeList=[],this.gwNodesTTL=0},e.prototype.handleDispatchedGwNodes=function(e,t){if(this.Xn.info("zc.p.1.hdgn "+this.streamId+" "+JSON.stringify(e)),Array.isArray(e)){this.gwNodeList=e.length>0?e:this.gwNodeList,this.gwNode=e.length>0?this.gwNodeList[0]:this.gwNode;var i=0===t?60:t;this.gwNodesTTL=i?(new Date).getTime()+1e3*i:this.gwNodesTTL,e.length>0&&this.ee.updateCachedGwNodesList(this,!1,e,i)}},e.prototype.dispatchGwNodes=function(e,t){var i,r=this.streamId;1==this.ee.testEnvironment&&(r="zegotest-"+this.ee.appid+"-"+this.streamId),null===(i=this.signal)||void 0===i||i.dispatchGwNodes((0,o.getSeq)(),1,r,{type:this.ee.geo.type,areaList:this.ee.geo.areaList},(function(t,i,r){e&&e(r)}),(function(e,i){t&&t(e)}))},e.prototype.handleCreateSessionResp=function(e,t,i){var r=i.turn_server,n=r.split("?")[0]&&r.split("?")[0].slice(5),o=this.ee.server.split("?"),s=o[1]&&o[1].slice(2);if(this.ve.spanSetAttributes({key:this.parentSpanKey,par:this.streamId},{webrtc_sid:i.session_id,url:"webrtc://".concat(n,"/").concat(s,"/").concat(this.streamId)}),this.Xn.info(Ns+" "+this.streamId+" sessionId:"+i.session_id),this.sessionSeq==e){this.resetPushCmdSeqMap();var a=i.client_ip||i.clientip;a&&(this.re.clientIP=a);var c=0,u=(new Date).getTime();if(this.reportBeginTime&&(this.Xn.info(Ms+" "+this.streamId+" create signal time "+(c=u-this.reportBeginTime)),this.signalTime=c),this.answerSdpTime=u,0!==i.result){if(this.Xn.error(Ns+" "+this.streamId+" create error"),1021===(null==i?void 0:i.result))return void this.playStateUpdateError($e,!0);this.playStateUpdateError(jl.nn)}else this.sessionId=i.session_id,this.sessionToken=i.session_token,this.setGwNodes(i,!1),this.onCreatePlaySessionSuccess(i)}else this.Xn.error(Ns+" seq is not match.")},e.prototype.handleCreateSessionWithSdpResp=function(e,t,i){var r=this;if(this.Xn.info(Ms+" sessionId:"+t),this.sessionSeq==e){this.resetPushCmdSeqMap();var n=i.client_ip||i.clientip;n&&(this.re.clientIP=n);var o=0,s=(new Date).getTime();if(this.reportBeginTime&&(this.Xn.info(Ms+" "+this.streamId+" create signal time "+(o=s-this.reportBeginTime)),this.signalTime=o),this.answerSdpTime=s,0!==i.result){if(110===i.result&&(this.te=!1,this.re.te=!1),this.Xn.error(Ms+" create session failed "+i.result),1021===(null==i?void 0:i.result))return void this.playStateUpdateError($e,!0);if(this.He&&1004===(null==i?void 0:i.result)&&this.checkTryEmptyStreamTimeout())return void this.playStateUpdateError(jl.Dn,!0);this.playStateUpdateError(jl.nn)}else{this.sessionId=t,this.sessionToken=i.session_token,this.Xn.info(Ms+" create session success ",this.streamId),this.setGwNodes(i,!1);var a=performance.now();this.signal.registerPushCallback("CloseSessionPush",this.sessionId,(function(e,t,i){if(a){var n=(performance.now()-a).toFixed(0);a=void 0,r.Xn.info(Ms+" ".concat(r.streamId,", cmd: CloseSessionPush, cost_time: ").concat(n))}r.onRecvCloseSession(e,t,i)})),this.signal.registerPushCallback("SessionResetPush",this.sessionId,(function(e,t,i){r.onRecvResetSession(e,t,i)})),this.signal.registerPushCallback("StreamStatusNotifyPush",this.sessionId,(function(e,t,i){r.compareSeqs("StreamStatusNotifyPush",e)&&(r.gotStreamStatus=!0,r.streamStatus=i,r.statusSeq=e,r.playStream&&r.onRecvStreamStatus(e,i))})),this.signal.registerPushCallback("PlayEventPush",this.sessionId,(function(e,t,i){if(r.compareSeqs("PlayEventPush",e)){if(a){var n=(performance.now()-a).toFixed(0);a=void 0,r.Xn.info(Ns+" ".concat(r.streamId,", cmd: PlayEventPush, cost_time: ").concat(n))}r.onRecvPlayEvent(e,t,i)}})),this.signal.registerPushCallback("ClientInfoPush",this.sessionId,(function(e,t,i){r.compareSeqs("ClientInfoPush",e)&&r.onRecvClientInfo(e,t,i)})),this.signal.registerPushCallback("NetQualityProbeRsp",this.sessionId,(function(e,t,i){r.onRecvPlayEvent(e,t,i)})),this.signal.registerPushCallback("NetQualityInfoPush",this.sessionId,(function(e,t,i){r.compareSeqs("NetQualityInfoPush",e)&&r.onRecvNetQualityInfo(e,t,i)})),this.signal.gw.registerPushCallback("net_quality_grade_push",this.sessionId,(function(e,t,i){r.onRecvNetQualityGrade(e,t,i)})),this.signal.gw.registerPushCallback("codec_error_notify",this.sessionId,(function(e,t,i){r.signal.gw.sendGWAck(t,r.peerID,"codec_error_notify_ack",9);var n=i.codec_error_notify,o=n.error_type;if(0!==o){var s=n.media_type?"video":"audio";r.Xn.warn(ea+" ".concat(r.streamId," ").concat(s," codec error: ").concat(JSON.stringify(n),", codec: ").concat(r.videoCodec)),1===o&&(r.Xn.warn(ea+" ".concat(r.streamId," remove ").concat(s," track.")),r.isProbe||6!==r.state||r.onPlayStateUpdate(0,r.streamId,{code:1003080,message:"browser dose not support current ".concat(s," codec")},!0))}})),this._autoTcp&&(this.Xn.info(Ns+" ".concat(this.streamId,", fully auto tcp")),this.setConfiguration(i.sdp,i.params_ext),this.setLocalSdp(this.localDesc)),this.Ve(i.sdp,void 0,i.params_ext)}}else this.Xn.error(Ms+" seq is not match.")},e.prototype.setCandidate=function(e){var t,i=this;if(this.Xn.info($s+" ".concat(this.streamId,", set candidate ").concat(JSON.stringify(e))),e){var r=e.candidate,n=e.sdpMid,o=e.sdpMLineIndex;r&&(this.Xn.info($s+" ".concat(this.streamId,", addIceCandidate")),null===(t=this.peerConnection)||void 0===t||t.addIceCandidate(new RTCIceCandidate({sdpMid:n,sdpMLineIndex:o,candidate:r})).then((function(){i.Xn.info($s+" ".concat(i.streamId,", add can suc"))})).catch((function(e){i.Xn.info($s+" ".concat(i.streamId,", add can fail, ").concat(e.message))})))}},e.prototype.onCreateOfferSuccess=function(e){this.Xn.info(Ls+" "+this.streamId+" localSdp1 "+e.sdp.substr(0,e.sdp.length/2)),this.Xn.info(Ls+" "+this.streamId+" localSdp2 "+e.sdp.substr(e.sdp.length/2)),e.sdp=e.sdp.replace(/sendrecv/g,"recvonly"),e.sdp=e.sdp.replace(/useinbandfec=/,"stereo=1;useinbandfec=");var t=e.sdp.match(/m=application[\s\S]+datachannel[\s\S]+/)?e.sdp.match(/m=application[\s\S]+datachannel[\s\S]+/)[0]:null;if(t){var i=t.replace(/recvonly/,"sendrecv");e.sdp=e.sdp.replace(t,i)}if(e.sdp=function(e){var t,i=e,r=function(e){var t={m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"}]};function i(e,t,i){var r=function(e){return String(Number(e))===e?Number(e):e},n=e.name&&e.names;e.push&&!t[e.push]?t[e.push]=[]:n&&!t[e.name]&&(t[e.name]={});var o=e.push?{}:n?t[e.name]:t;(function(e,t,i,n){if(n&&!i)t[n]=r(e[1]);else for(var o=0;o<i.length;o+=1)null!=e[o+1]&&(t[i[o]]=r(e[o+1]))})(i.match(e.reg),o,e.names,e.name),e.push&&t[e.push].push(o)}var r=RegExp.prototype.test.bind(/^([a-z])=(.*)/),n=[],o={},s=o;return e.split(/(\r\n|\r|\n)/).filter(r).forEach((function(e){var r=e[0],o=e.slice(2);"m"===r&&(n.push({rtp:[],fmtp:[]}),s=n[n.length-1]);for(var a=0;a<(t[r]||[]).length;a+=1){var c=t[r][a];if(c.reg&&c.reg.test(o))return i(c,s,o)}})),o.media=n,o}(e),n=[];return r.media.forEach((function(e){"video"===e.type&&e.fmtp.forEach((function(e){t="a=fmtp:"+e.payload+" "+e.config,-1===e.config.indexOf("sps-pps-idr-in-keyframe")&&-1===n.indexOf(t)&&n.push(t)}))})),n.forEach((function(e){i=i.replace(new RegExp(e,"g"),e+";sps-pps-idr-in-keyframe=1")})),i}(e.sdp),e.sdp=function(e){var t=e.split("\r\n"),i=new Map;t.forEach((function(e,r){if(/^a=rtcp-fb:/.test(e)&&t[r+1]&&!/^a=rtcp-fb:/.test(t[r+1])){var n=e.match(/^a=rtcp-fb:\d+/);n&&i.set(r+1,n[0]+" rrtr")}}));for(var r=Array.from(i),n=0;n<r.length;n++){var o=zl([],r[n],!0);t.splice(o[0]+n,0,o[1])}return t.join("\r\n")}(e.sdp),this.playOption.videoCodec&&(e.sdp=to.getSDPByVideDecodeType(e.sdp,this.playOption.videoCodec)),this._autoTcp)return this.localDesc=e,void this.createSession(e);this.setLocalSdp(e)},e.prototype.setLocalSdp=function(e){var t=this;this.Xn.info(Ls+" "+this.streamId+" set local sdp");var i=this.getSpan("/play/set_local_sdp",this.parentSpanKey);i&&i.setAttributes({sdp:Xr(e.sdp),is_mini:Hr(this.te)}),this.peerConnection.setLocalDescription(e).then((function(){i&&i.end(),t.onSetLocalDescriptionSuccess(e)}),(function(e){t.Xn.error(Ls+" "+t.streamId+" set error "+e.toString()),i&&t.ve.setError(i,{code:jl.$i.code,message:e.toString()}),t.playStateUpdateError(jl.$i,!0)}))},e.prototype.onSetLocalDescriptionSuccess=function(e){var t=this;if(this.Xn.info(xs+" "+this.streamId+" success"),this.isPeer)return this._autoTcp?void this.Xn.info(xs+" "+this.streamId+" fully auto tcp"):void this.createSession(e);var i={sdp:e.sdp,paramsExt:this.paramsExt};2==this.resourceMode&&(i.min_play_buf_level_ms=500),this.answerSeq=(0,o.getSeq)();var r=this.getSpan("/play/send_media_desc",this.parentSpanKey);this.signal.sendMediaDesc(this,this.answerSeq,this.sessionId,0,i,(function(e,n,o){t.Xn.info(xs+" "+t.streamId+" sendMediaDesc resp"),r&&(r.setAttributes({webrtc_sid:Wr(n),sdp:i.sdp}),r.end()),t.answerSeq==e&&t.sessionId==n?(t.Xn.info(xs+" "+t.streamId+" send success stateNego:waiterAnswer"),t.stateNego=g.waiterAnswer,t.state=3,ln(null==o?void 0:o.sdp)&&(null==o?void 0:o.sdp)&&t.Ve(o.sdp,!0)):t.Xn.error(xs+" "+t.streamId+" seq or sessionId is not equal "+t.answerSeq+" "+e,0+t.sessionId+" "+n)}),(function(e,i){t.Xn.error(xs+" "+t.streamId+" failed to send "+e),r&&t.ve.setError(r,{code:jl.an.code,message:e.toString()}),t.playStateUpdateError(jl.an)})),this.state=2},e.prototype.onRecvMediaDesc=function(e,t,i){return Hl(this,void 0,void 0,(function(){var t,r,n,o;return Fl(this,(function(s){switch(s.label){case 0:if(this.Xn.info(Us+" "+this.streamId+" received ",i),t=i.sdp,this.Xn.info("".concat(Us," ").concat(this.streamId," rSdp:").concat(t.length," ").concat(this.te)),!this.te||!t)return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.signal.webrtcCenterSvr.parseRecSdp(t,!0,this)];case 2:return r=s.sent(),[3,4];case 3:return n=s.sent(),this.Xn.warn(Us+" "+this.streamId+" parse sdp err "+JSON.stringify(n)),[2,this.playStateUpdateError(Vl.error.yn)];case 4:return r=r||i.sdp,(o=this.getSpan("/play/recv_media_desc",this.parentSpanKey))&&(o.setAttributes({sdp:Zr(r),is_mini:Kr(this.te)}),o.end()),this.stateNego=g.waitingCandidate,this.Xn.info(Us+" "+this.streamId+" received stateNego:waitingCandidate"),3!==this.state?(this.Xn.error(Us+" "+this.streamId+" current state "+this.state+" not allowed"),[2]):(this.signal.sendMediaDescAck(e,this.sessionId,0),this.Ve(r),[2])}}))}))},e.prototype.Ve=function(e,t,i){var r,n=this;void 0===t&&(t=!1);var o={type:"answer",sdp:e,toJSON:function(){}},s=this.getSpan("/play/set_remote_sdp",this.parentSpanKey);this.setTurnTcp(),this.ee.autoSwitchProtocol=this.Fe("auto_to_tcp")||!1;var a=this.Fe("udp_max_fail_num");!isNaN(a)&&(this.ee.maxUdpFailNum=a);var c=this.ee,u=c.autoSwitchProtocol,l=c.maxUdpFailNum,d=c.udpFailNum;this.Xn.info(Us+" autoToTcp: ".concat(u,", udpFailNum: ").concat(d,", maxUdpFailNum: ").concat(l,".")),u&&!this._turnToTcp&&d>=l&&(this.Xn.info(Us+" switch to tcp."),this._turnToTcp=!0,this._autoTcp=!1);var h=this.Fe("udp_or_tcp",!0);if(h&&(this.Xn.info(Us+" setting udp_or_tcp "+h),this._turnToTcp="tcp"===h),this._turnToTcp&&!this.ee.isProxy&&"firefox"!==this.re.browser&&(null===(r=o.sdp.match(/candidate.*/g))||void 0===r||r.forEach((function(e){var t=e.replace(/udp/,"tcp");t.includes(" tcptype ")||(t=t.replace(" typ host "," typ host tcptype passive ")),o.sdp=o.sdp.replace(e,t)}))),this.ee.isProxy){var p=Us,f=o.sdp,m=vo(f),v=m[0],g=m[1],y=f.match(/a=mid:[^(\n|\r)]+/g);if(g&&y)if(this.proxyVrs.intranet)setTimeout((function(){g.forEach((function(e,t){var i,r={sdpMLineIndex:t,candidate:e.replace(v[t].ip,n.proxyVrs.wanIP).replace("a=",""),sdpMid:y[t].replace("a=mid:","")};n.Xn.info(p+" add wan candidate:"+JSON.stringify(r)),null===(i=n.peerConnection)||void 0===i||i.addIceCandidate(new RTCIceCandidate(r))}))}),1e3);else{var b=this.proxyVrs.wanIP;this.Xn.info(p+" change candidate ip from lan to wan: "+b);for(var _=0;_<g.length;_++){var S=g[_],T=S.replace(v[_].ip,b);o.sdp=f.replace(S,T)}}else this.Xn.warn(p+" candidate not found")}this.Xn.info(Us+" "+this.streamId+" remoteSdp ",o.sdp),s&&s.setAttributes({sdp:Vr(o.sdp),webrtc_sid:jr(this.sessionId),is_mini:Gr(this.te)}),this.peerConnection.setRemoteDescription(new RTCSessionDescription(o)).then((function(){s&&s.end(),n.Xn.info(Us+" "+n.streamId+" set success")}),(function(e){n.Xn.error(Us+" "+n.streamId+" set remote error "+e.toString()),s&&(s.setAttributes({error:jl.en.code,message:e.toString()}),s.end());var t=!0;n.te&&(t=!1,n.te=!1),n.playStateUpdateError(jl.en,t)})),this.state=4,t&&e.indexOf("candidate")>-1&&(this.sendCandidateInfo(this.candidateInfo),this.candidateInfo=[],this.state=5),this._autoTcp&&this.setCandidate(i),this.Xn.info(Us+" "+this.streamId+" call success")},e.prototype.setConfiguration=function(e,t){var i,r=this.getIceServers(e);this.Xn.info("zc.p.1.scg "+this.streamId+" ".concat(JSON.stringify(r)," ").concat(JSON.stringify(t))),r.length>0&&t&&(null===(i=this.peerConnection)||void 0===i||i.setConfiguration({iceTransportPolicy:"all",rtcpMuxPolicy:"require",iceServers:[{urls:r,username:t.turn_username,credential:t.turn_auth_key}],encodedInsertableStreams:this.sideMediaConfig.isSEIStart}))},e.prototype.getIceServers=function(e){var t=vo(e)[0];if(t.length>0){var i=t[0].ip;return["turn:".concat(i,":3478?transport=udp"),"turns:".concat(i,":443?transport=tcp"),"turn:".concat(i,":3478?transport=tcp")]}return[]},e.prototype.onRecvCandidateInfo=function(e,t,i){var r=this;this.Xn.info(Bs+" "+this.streamId+" received ");var n=this.getSpan("/play/recv_ice_candidate",this.parentSpanKey);if(n&&(n.setAttributes({candidate_info:Yr(i.infos)}),n.end()),4==this.state){this.signal.sendCandidateInfoAck(e,this.sessionId,0),this.sendCandidateInfo(this.candidateInfo),this.candidateInfo=[];for(var o=0;o<i.infos.length;o++){var s={sdpMid:i.infos[o].sdpMid,sdpMLineIndex:i.infos[o].sdpMLineIndex,candidate:i.infos[o].candidate};this.Xn.info(Bs+" "+this.streamId+" candidate "+s.candidate),this.peerConnection.addIceCandidate(new RTCIceCandidate(s)).then((function(){r.Xn.debug(Bs+" "+r.streamId+" add success")}),(function(e){r.Xn.error(Bs+" "+r.streamId+" add error "+e.toString()),r.playStateUpdateError(jl.hn,!0)}))}this.state=5;var a=this.getSpan(Qr,this.parentSpanKey,"",!0);null==a||a.setAttributes({webrtc_sid:this.sessionId}),this.Xn.info(Bs+" "+this.streamId+" call success")}else this.Xn.warn(Bs+" "+this.streamId+" current state "+this.state+" not allowed")},e.prototype.onRecvPlayEvent=function(e,t,i){if(this.Xn.info(zs+" "+this.streamId+" received"),!this.isProbe){var r=this.ve.createSpan(F.H,{key:Gl,par:this.streamId},{key:""},"/rtc/play_event_message");r.setAttributes({event_state:Rr(i.event),webrtc_sid:t}),r.end()}if(!0===this.playEvent&&0==i.event){this.Xn.info(zs+" "+this.streamId+" retry: "+this.streamId);var n=this.streamId,s=this.playOption;this.signal.sendCloseSession((0,o.getSeq)(),this.sessionId,1),this.resetPlay(),this.startPlay(n,this.getRemoteStreamSuc,s)}else this.playEvent=!0},e.prototype.onRecvClientInfo=function(e,t,i){this.re.clientIP!==i.clientip&&this.Xn.info("zc.p.orci.1.1 client ip changed "+this.re.clientIP+" "+i.clientip),this.signal.sendClientInfoAck(e,this.sessionId,0),this.re.clientIP=i.clientip,this.peerID=i.peer_id,this.streamConnectIP=i.clientip,this.re.isMultiOuter=this.isMultiOuter(),this.isProbe&&this.stateNego==g.iceConnected&&this.signal.sendNetProbe((0,o.getSeq)(),this.sessionId,this.peerID,(function(){}),(function(){})),this.isRecvClientInfo=!0},e.prototype.onRecvNetQualityInfo=function(e,t,i){this.Xn.info(Ys+" call"),this.qualityHandler.stopProbeTimeout();var r=0,n=i.lossrate,s=i.rtt;(this.peerID!==i.peer_id&&!this.isProbeByDG||hn(n)||hn(s))&&(this.Xn.info(Ys+" local peerID:"+this.peerID+" remote peerID:"+i.peer_id+" lossrate:"+n+" rtt:"+s),r=1),this.signal.sendNetQualityInfoPushAck((0,o.getSeq)(),this.sessionId,this.peerID,r),0==r&&un(n)&&un(s)?(this.isProbeByDG=!1,this.onCalNetQualityResult(0,Fn(s,n))):this.onCalNetQualityResult(1)},e.prototype.onRecvNetQualityGrade=function(e,t,i){var r,n,o=this,s=i.net_quality_grade_push;this.userID=this.userID||(null===(n=null===(r=this.ee.playerList[this.streamId])||void 0===r?void 0:r.room.streamList.find((function(e){return e.stream_id==o.streamId})))||void 0===n?void 0:n.id_name),this.Xn.info("zc.s.nqga call: "+t),this.signal.gw.sendGWAck(this.sessionId,this.peerID,"net_quality_grade_ack",7),this.userID&&(this.re.actionListener("networkQuality",this.userID,null==s?void 0:s.tx_quality,null==s?void 0:s.rx_quality),!this.netTimer&&this.startPollNetworkQuality(),this.lostQualityTime=0)},e.prototype.onIceCandidate=function(e){var t=this;if(this.Xn.info(qs+" "+this.streamId+" called"),null!=e.candidate){this.Xn.info(qs+" "+this.streamId+" candidate "+e.candidate.candidate+" state "+this.state+" autotcp "+this._autoTcp);var i=function(e){t.sendCandidateInfo([{candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid,sdpMLineIndex:e.candidate.sdpMLineIndex}])};this._autoTcp?i(e):this.state<5||7==this.state?(this.Xn.info(qs+" "+this.streamId+" cached"),this.candidateInfo.push({candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid,sdpMLineIndex:e.candidate.sdpMLineIndex})):(this.Xn.info(qs+" "+this.streamId+" send"),i(e))}},e.prototype.onConnectionStateChange=function(e){this.Xn.info("zc.p.ocsc.1 "+this.streamId+" called "+e.target.signalingState),7!=this.state&&null!=this.peerConnection&&"closed"===e.target.signalingState&&(this.dataReport.addEvent(this.reportSeq,"IceClosed"),this.stateNego=g.iceClosed,this.checkPlayConnectionFailedState(this.peerConnection.iceConnectionState))},e.prototype.onIceConnectionStateChange=function(e){var t,i=this;if(7!=this.state&&null!=this.peerConnection){this.Xn.info(Xs+" "+this.streamId+" stateChanged "+this.peerConnection.iceConnectionState);var r=this.getSpan(Ar,this.parentSpanKey,this.Ze);if(r&&r.setAttributes({ice_state:Dr(this.peerConnection.iceConnectionState)}),"connected"===this.peerConnection.iceConnectionState){if(this.stateNego=g.iceConnected,this.isProbe&&this.isPeer&&(this.isRecvClientInfo||this.isProbeByDG))return this.signal.sendNetProbe((0,o.getSeq)(),this.sessionId,this.peerID,(function(){}),(function(){})),void(null!=this.negoTimer&&(clearTimeout(this.negoTimer),this.negoTimer=null));if(null!=this.negoTimer&&(clearTimeout(this.negoTimer),this.negoTimer=null),null!=this.iceDisconnectedTimer&&(clearTimeout(this.iceDisconnectedTimer),this.iceDisconnectedTimer=null),!this.isProbe&&this.reportBeginTime){var n=(new Date).getTime()-this.reportBeginTime;this.reportSpan.setAttributes({play_begin_time:Ql.play_begin_time(n)}),this.reportBeginTime=0}if(this.ve.spanEnd({key:Qr,par:this.streamId},{webrtc_sid:this.sessionId}),this.answerSdpTime){var s=(new Date).getTime()-this.answerSdpTime;this.Xn.info(Xs+" "+this.streamId+" ice time "+s)}var a=null===(t=this.ee.playerList[this.streamId])||void 0===t?void 0:t.retryStreamHandler;null==a||a.getTryTime(this,!0),this.isProbe||6==this.state||(this.onPlayStateUpdate(0,this.streamId,{code:0,message:""},!0),this.getRemoteStreamSuc&&this.getRemoteStreamSuc(this.playOption.resourceMode==q.DG&&this.firstPlay?null:this.playStream),this.ee.playModule&&this.Xe(),this.ee.supplementPlayingChargeTime()),this.state=6,this.hasSucceed=!0;var c=this.isRePlay?Ci:Wl;for(var u in this.ve.spanEnd({key:c.event,par:this.streamId},{signal_consume:Wl.signal_consume(this.signalTime),is_peer:Wl.is_peer(this.isPeer)}),this.playStateCount++,this.continuousFailCnt=0,this.reportPlayStateTime=Date.now(),this.isProbeDispatch=!1,this.ee.publisherList)if(6==this.ee.publisherList[u].publisher.state&&this.broadcasterStatus==D.stop){this.signal&&this.signal.sendBroadcasterStatus((0,o.getSeq)(),this.sessionId,1),this.broadcasterStatus=D.start;break}if(!this.isProbe){this.qualityHandler.setPlayQualityTimer();var l=this.Fe("probe_started_num");!isNaN(l)&&(this.ee.probeStartedNum=l)}this.Xn.info(Xs+" "+this.streamId+" stateNego:iceConnected"),this.isPeer&&(this.peerFailCount=0),!this.hasConnectionChange()&&this.recordFirstFrameData(),this._turnToTcp||(this.ee.udpFailNum=0)}else"closed"===this.peerConnection.iceConnectionState?(null==r||r.end(),this.stateNego=g.iceClosed,this.checkPlayConnectionFailedState(this.peerConnection.iceConnectionState)):"failed"===this.peerConnection.iceConnectionState?(null==r||r.end(),this.stateNego=g.iceFailed,this.checkPlayConnectionFailedState(this.peerConnection.iceConnectionState)):"disconnected"===this.peerConnection.iceConnectionState&&(null==r||r.end(),this.stateNego=g.iceDisconnected,this.Xn.warn(Xs+" ice disconnected"),this.iceDisconnectedTimer||(this.iceDisconnectedTimer=setTimeout((function(){i.checkPlayConnectionFailedState("disconnected")}),this.iceDisconnectedMaxTime)))}},e.prototype.onPeerConnectionStateChange=function(e){this.Xn.info("zc.p.opcsc.1 "+this.streamId+" connectionChanged "+this.peerConnection.connectionState),"connected"===this.peerConnection.connectionState&&this.recordFirstFrameData()},e.prototype.hasConnectionChange=function(){var e,t,i=this.re.browser;return!("firefox"===i||"chrome"===i&&(e=0,t=(Re().toLowerCase().match(/chrome\/([\d.]+)/)||[])[1],t&&(e=parseInt(t.split(",")[0])),e<72))},e.prototype.checkPlayConnectionFailedState=function(e){this.Xn.info(Xs+" state "+this.state+" connectionState "+e),this.playStateUpdateError(jl.rn)},e.prototype.resetPlay=function(){this.Xn.info("zc.p.rp.1 "+this.streamId+" call"),this.state=7,this.playEvent=!1,this.isRecvClientInfo=!1,null!=this.peerConnection&&(this.peerConnection.close(),this.peerConnection=null),this.localDesc&&(this.localDesc=null);var e=this.seiWorker;e&&e.removeEventListener("message",this._eventHandler.seiMessage),null!=this.negoTimer&&(clearTimeout(this.negoTimer),this.negoTimer=null),null!=this.iceDisconnectedTimer&&(clearTimeout(this.iceDisconnectedTimer),this.iceDisconnectedTimer=null),this.stopVideocTimer(),this.qualityHandler.stopProbeTimeout(),this.qualityHandler.clearPlayQualityTimer(),this.signal&&(this.signal.unregisterPushCallback("MediaDescPush",this.sessionId),this.signal.unregisterPushCallback("CandidateInfoPush",this.sessionId),this.signal.unregisterPushCallback("CloseSessionPush",this.sessionId),this.signal.unregisterPushCallback("SessionResetPush",this.sessionId),this.signal.unregisterPushCallback("PlayEventPush",this.sessionId),this.signal.unregisterPushCallback("ClientInfoPush",this.sessionId),this.signal.unregisterPushCallback("NetQualityProbeRsp",this.sessionId),this.signal.unregisterPushCallback("NetQualityInfoPush",this.sessionId),this.signal.gw.unregisterPushCallback("net_quality_grade_push",this.sessionId)),this.sessionSeq=0,this.answerSeq=0,this.videoSizeCallback=!1,this.stopSoundLevel()},e.prototype.onRecvResetSession=function(e,t,i){this.Xn.info(Gs+" "+this.streamId+" received ");var r=this.getSpan(Pr,this.Ze);if(r&&r.end(),t==this.sessionId){this.signal.sendCloseSessionAck(e,this.sessionId,0);var n=JSON.parse(JSON.stringify(jl.Pn));this.negoTimer&&clearTimeout(this.negoTimer),this.playStateUpdateError(n)}else this.Xn.info(Gs+" "+this.streamId+" cannot find session")},e.prototype.onRecvCloseSession=function(e,t,i){var r=this;this.Xn.info(js+" "+this.streamId+" "+JSON.stringify(i)),this.ve.spanSetAttributes({key:this.Ze,par:this.streamId},{denied_info:Ii.denied_info(i.err_info),stop_reason:Ii.stop_reason("DenyStop")}),this.signal.sendCloseSessionAck(e,this.sessionId,0);var n=i.err_info?JSON.parse(i.err_info.toLowerCase()):{},o=n.action?n.action:null,s=1*i.reason,a=JSON.parse(JSON.stringify(1004===(null==n?void 0:n.err)?jl.Dn:jl.Pn));a.message+=" reason:".concat(s," ").concat(o?" action:"+o:""," ").concat((null==n?void 0:n.err)?" err:"+(null==n?void 0:n.err):""),a.message+=";".concat(Mu(s,o,null==n?void 0:n.err)),this.negoTimer&&clearTimeout(this.negoTimer);var c=!([4,8,10,11,12,14,24,26,27,28,32].includes(s)||[2,3,4,5,6].includes(o));1004===(null==n?void 0:n.err)&&this.checkTryEmptyStreamTimeout()&&(c=!0);var u=!1;if(!this._turnToTcp){if([8,10].includes(s)||[18,15].includes(s)&&2===o&&[3001,3002].includes(n.err)){this.ee.udpFailNum++;var l=this.ee;l.autoSwitchProtocol&&l.udpFailNum>=l.maxUdpFailNum&&(this.isPeer=!1,this.ee.setIsPeer(!1),u=!0)}else this._turnToTcp||(this.ee.udpFailNum=0);var d=this.gwNodeList.findIndex((function(e){return e==r.gwNode}))===this.gwNodeList.length-1,h=[3001,3002,3003,3004,3005,3006,3007,3008].includes(n.err);d&&h&&(this.Xn.info(js+" "+this.streamId+" switch tcp by all fail"),this.re.turnToTcp=!0,this._autoTcp=!1,this.isPeer=!1,this.ee.setIsPeer(!1))}this.playStateUpdateError(a,c,n,u)},e.prototype.checkTryEmptyStreamTimeout=function(){var e=Date.now(),t=this.re.streamRetryTime,i=this.streamNotFoundTime;if(i){if(e-i>1e3*t)return this.streamNotFoundTime=0,this.Xn.info("zc.p.ctest.1 "+this.streamId+" stream not found. retry over time: ".concat(t,"s")),!0}else this.streamNotFoundTime=e;return!1},e.prototype.onRecvStreamStatus=function(e,t,i){var r=this;void 0===i&&(i=!1),this.Xn.info(Qs+" "+this.streamId+" call"),this.Xn.info("".concat(Qs," ").concat(this.streamId," status camera_status: ").concat(t.camera_status," mic_status: ").concat(t.mic_status)),this.signal.sendStreamStatusNotifyAck(e,this.sessionId,0),this.reportFirstFrameData(t.camera_status,t.mic_status),(!this.hasSentStreamStatus||this.cameraStatus!==t.camera_status)&&this.onRemoteCameraStatusUpdate(this.streamId,this.getCameraMicStatus(t.camera_status),t.camera_status),(!this.hasSentStreamStatus||this.micStatus!==t.mic_status)&&this.onRemoteMicStatusUpdate(this.streamId,this.getCameraMicStatus(t.mic_status),t.mic_status),this.hasSentStreamStatus=!0;var n=this.cameraStatus!==t.camera_status;if(this.cameraStatus=t.camera_status,this.micStatus=t.mic_status,this.videoMuteState=0===t.camera_status?"0":"1",this.audioMuteState=0===t.mic_status?"0":"1",dn(this.playOption.video))this.Xn.info(Qs+" "+this.streamId+" has set video option, ignore stream status");else{var o=this.playStream,s=this.rtcViewer;if(0!==t.camera_status&&20!==t.camera_status)s?n&&(this.Xn.info(Qs+" "+this.streamId+" viewer clear last frame"),s.checkIfClearLastFrame()):o.getVideoTracks().forEach((function(e){e.enabled=!1,r.ee.trackUtils.stopTrack(e),o.removeTrack(e)}));else if(0===o.getVideoTracks().length){var a=this.remoteStream.clone().getVideoTracks()[0];o.addTrack(a),s&&s.setVideo(a,"safari"===this.re.browser)}if("safari"===this.re.browser&&i)for(var c=Ie.querySelectorAll("video, audio"),u=0;u<c.length;u++){var l=c[u];l.srcObject===this.playStream&&(this.Xn.info(Qs+" track changed. rerender stream"),l.srcObject=this.playStream)}}this.Xn.info(Qs+" "+this.streamId+" call success")},e.prototype.onGotRemoteStream=function(e,t){var i=this;if(this.Xn.info(Ws+" "+this.streamId+" called "+e),e){var r=this.playOption.playoutDelayHint;if(!isNaN(r)&&t)try{this.Xn.info(Ws+" "+this.streamId+" playoutDelayHint: ".concat(r,", origin delay: ").concat(t.playoutDelayHint)),t.playoutDelayHint=r,this.Xn.info(Ws+" "+this.streamId+" playoutDelayHint result: ".concat(t.playoutDelayHint))}catch(e){this.Xn.warn(Ws+" set playoutDelayHint failed. ".concat(e))}if(this.sideMediaConfig.isSEIStart&&Gn()&&("video"===t.track.kind?this.createVideoReceiverTransform(t):"audio"===t.track.kind&&this.createAudioReceiverTransform(t)),this.playStream){this.playStream.getTracks().forEach((function(e){return i.playStream.removeTrack(e)}));var n=this.rtcViewer;e.clone().getTracks().forEach((function(e){return Hl(i,void 0,void 0,(function(){return Fl(this,(function(t){return this.playStream.addTrack(e),n&&n.setTrack("video"===e.kind,e,"safari"===this.re.browser),"audio"===e.kind&&this.tr(),[2]}))}))}))}else this.playStream=e.clone();this.audioMuteState=this.playStream.getAudioTracks().length>0?"0":"1",this.videoMuteState=this.playStream.getVideoTracks().length>0?"0":"1",this.remoteStream=e,this.getVideoCodec(),this.gotStreamStatus&&this.onRecvStreamStatus(this.statusSeq,this.streamStatus,!0),this.ee.soundLevelDelegate&&!this.isProbe&&this.startSoundLevel()}else this.Xn.warn(Ws+" "+this.streamId+" remote stream is empty")},e.prototype.createVideoReceiverTransform=function(e){var t=this.createSEIWorker();t&&t.addEventListener("message",this._eventHandler.seiMessage);var i=this.sideMediaConfig,r={cmd:"decode",streamID:this.streamId,emulationPreventionByte:this.re.seiConfig.emulationPreventionByte,codec:this.videoCodec,unregisterSeiFilter:i.unregisterSeiFilter,filterSize:i.filterSize};if(window.RTCRtpScriptTransform)e.transform=new RTCRtpScriptTransform(t,r);else{var n=e.createEncodedStreams(),o=n.readable,s=n.writable,a=!t;try{t&&t.postMessage(Xl({readable:o,writable:s},r),[o,s])}catch(e){a=!0}if(a){this.Xn.warn("zc.cvrt The current browser version is too low.");var c=new TransformStream({transform:this.decodeVideoFrame});this.receiverStreams=n,o.pipeThrough(c).pipeTo(s),this.ee.handleSeiRollBack()}}},e.prototype._handleMixSoundLevels=function(e){var t=this,i=e.map((function(e){var i,r,n=(null===(r=null===(i=t.room.streamList)||void 0===i?void 0:i.find((function(t){return t.stream_nid===e.soundLevelID})))||void 0===r?void 0:r.stream_id)||"";return Xl(Xl({},e),{streamID:n})})),r=new Map(i.map((function(e){return[e.soundLevelID,e.value]}))),n=i.filter((function(e){return e.streamID})).map((function(e){return[e.streamID,e.value]})),o=new Map(n);this.re.actionListener("mixerSoundLevelUpdate",r,this.streamId),o.size&&this.re.actionListener("autoMixerSoundLevelUpdate",o,this.streamId)},e.prototype.createAudioReceiverTransform=function(e){var t={cmd:"decode",streamID:this.streamId,kind:"audio"},i=this.createSEIWorker();if(window.RTCRtpScriptTransform)e.transform=new RTCRtpScriptTransform(i,t);else{var r=e.createEncodedStreams(),n=r.readable,o=r.writable,s=!i;try{i&&i.postMessage(Xl({readable:n,writable:o},t),[n,o])}catch(e){s=!0}if(s){this.Xn.warn("zc.cart The current browser version is too low.");var a=new TransformStream({transform:this.decodeAudioFrame});n.pipeThrough(a).pipeTo(o),this.ee.handleSeiRollBack()}}},e.prototype.sendCandidateInfo=function(e){var t=this;if(this.Xn.info(Zs+" "+this.streamId+" called"),!(e=e.filter((function(e){return!!(e&&e.candidate.indexOf("relay")>0)})))||e.length<1)this.Xn.info(Zs+" "+this.streamId+" cancelled");else{var i=this.getSpan("/play/send_ice_candidate",this.parentSpanKey);i&&i.setAttributes({candidate_info:Jr(e)}),this.stateNego!==g.iceConnected&&(this.stateNego=g.sendCandidate),this.Xn.info(Zs+" "+this.streamId+" stateNego:sendCandidate"),this.signal.sendCandidateInfo((0,o.getSeq)(),this.sessionId,e,(function(e,r,n){t.Xn.debug(Zs+" "+t.streamId+" send success"),i&&i.end()}),(function(e,r){t.Xn.error(Zs+" "+t.streamId+" failed to send: "+e.toString()),i&&t.ve.setError(i,{code:jl.hn.code,message:e.toString()}),t.playStateUpdateError(jl.hn)}))}},e.prototype.shouldSendCloseSession=function(){return 3!=this.state&&1!=this.state},e.prototype.resetPushCmdSeqMap=function(){var e;this.pushCmdSeqMap=((e={}).MediaDescPush={seq:-1,time:0},e.StreamStatusNotifyPush={seq:-1,time:0},e.PlayEventPush={seq:-1,time:0},e.ClientInfoPush={seq:-1,time:0},e.NetQualityInfoPush={seq:-1,time:0},e.CandidateInfoPush={seq:-1,time:0},e)},e.prototype.playStateUpdateError=function(e,t,i,r){if(this.Xn.error(Ks+" call ",this.streamId,JSON.stringify(e)),!this.isProbe){var n=this.ve.createSpan(F.H,{key:Gl,par:this.streamId},{key:""},"/rtc/play_stream_state_error");n.setAttributes({error:null==e?void 0:e.code,message:null==e?void 0:e.message}),n.end()}this.isProbe?this.onCalNetQualityResult(1):this.streamId&&this.onPlayStateUpdate(1,this.streamId,e,t,i,r),this.Xn.info(Ks+" "+this.streamId+" ended")},e.prototype.getCameraMicStatus=function(e){return 0==e?"OPEN":"MUTE"},e.prototype.onPlayStateUpdate=function(e,t,i,r,n,o){},e.prototype.onPlayQualityUpdate=function(e,t){},e.prototype.onRemoteCameraStatusUpdate=function(e,t,i){},e.prototype.onRemoteMicStatusUpdate=function(e,t,i){},e.prototype.getStopReason=function(e){var t="StopPlay";return e&&e.code&&(t=1104031===e.code?"ReachMaxAVRetryTime":"StopPlay"),t},e.prototype.stopPlay=function(e,t){var i,r,n,s,a;this.Xn.info("zc.p.1.sp.1 "+this.streamId+" called");var c=this.getStopReason(e);for(var u in this.ee.publisherList)if(6==this.ee.publisherList[u].publisher.state&&this.broadcasterStatus==D.start){this.signal&&this.signal.sendBroadcasterStatus((0,o.getSeq)(),this.sessionId,0),this.broadcasterStatus=D.stop;break}this.sessionId&&!this.closeSessionSignal&&(this.signal.sendCloseSession((0,o.getSeq)(),this.sessionId,0),this.resetPushCmdSeqMap());var l=this.Le?0:this.lastFailTimeLen;if(!this.isProbe){var d=Date.now()-this.reportPlayStateTime;[0,2].includes(this.resourceMode)&&this.reportSpan.setAttributes({play_state_time:Ql.play_state_time(d||0)}),this.uploadRTCPlayStats(),this.ve.spanEnd({key:this.Ze,par:this.streamId},{tryidx:Ii.tryidx(this.rtcPlayCount),url:Ii.url(null===(r=this.signal)||void 0===r?void 0:r.server),ip:Ii.ip(null==this?void 0:this.ip),resource_type:Ii.resource_type(go(this.resourceMode||0)),protocol:Ii.protocol("webrtc"),dispatch_external_ip:Ii.dispatch_external_ip(this.re.clientIP),net_protocol:Ii.net_protocol(this.netProtocol),stop_reason:Ii.stop_reason(c),try_time:Ii.try_time(l)}),(null==e?void 0:e.code)==jl.qn.code&&this.uploadPlayEvent(e),this.seiWorker&&this.seiWorker.postMessage({cmd:"clear",type:"pull",streamID:this.streamId})}if(this.stopPollNetworkQuality(),this.resetPlay(),this.ir(),!this.isProbe&&!t){var h=this.qualityHandler,p=h.videoBreak,f=h.audioBreak,m=2===this.resourceMode?"l3":"rtc",v=((i={})["".concat(m,"_a_break_time")]=f.cumulativeBreakDuration,i["".concat(m,"_a_decode_time")]=f.cumulativeDecodeDuration,i["".concat(m,"_v_break_time")]=p.cumulativeBreakDuration,i["".concat(m,"_v_decode_time")]=p.cumulativeDecodeDuration,i.audio_cumulative_break_time=f.cumulativeBreakDuration,i.audio_cumulative_decode_time=f.cumulativeDecodeDuration,i.video_cumulative_break_time=p.cumulativeBreakDuration,i.video_cumulative_decode_time=p.cumulativeDecodeDuration,i),g=Date.now(),y=this.firstPulledTimeStamp;this.updateValidTime(e);var b=0!==(null==e?void 0:e.code)&&this.latestPlayErrCode?this.latestPlayErrCode:0;this.reportSpan.setAttributes(Xl(Xl({biz_product:(null===(n=this.playOption)||void 0===n?void 0:n.resourceMode)==q.DG?1:0,webrtc_sid:Ql.webrtc_sid(this.sessionId),max_retry_interval:Ql.max_retry_interval(this.re.streamRetryTime),probe_ip_cnt:Ql.probe_ip_cnt(this.probeIpCnt),valid_probe_ip_cnt:Ql.valid_probe_ip_cnt(this.validProbeIpCnt),poor_quality_retry_cnt:Ql.poor_quality_retry_cnt(this.poorQualityRetryCnt),probe_not_trigger_retry_info:Ql.probe_not_trigger_retry_info(this.probeNotRetryInfos.length>0?this.probeNotRetryInfos:void 0),fail_cnt:Ql.fail_cnt(Math.max(this.rtcPlayCount-1,0)),continuous_fail_cnt:Ql.continuous_fail_cnt(Math.max(this.continuousFailCnt-1,0)),try_time:Ql.try_time(l),use_resource_type:Ql.use_resource_type(this.resourceMode===q.DG?this.useResourceTypes:[go(this.resourceMode)]),use_na:wi.use_na(this.He?1:0),play_state_cnt:Ql.first_frame_time(this.playStateCount),protocol:Ql.protocol("webrtc"),dispatch_external_ip:Ql.dispatch_external_ip(this.re.clientIP),w:Ql.w(null===(s=this.playStat)||void 0===s?void 0:s.frameWidth),h:Ql.h(null===(a=this.playStat)||void 0===a?void 0:a.frameHeight),stop_reason:Ql.stop_reason(c),error:(null==e?void 0:e.code)||0,last_error:b,message:(null==e?void 0:e.message)||"",cdn_a_break_time:0,cdn_a_decode_time:0,cdn_v_break_time:0,cdn_v_decode_time:0,l3_a_break_time:0,l3_a_decode_time:0,l3_v_break_time:0,l3_v_decode_time:0,rtc_a_break_time:0,rtc_a_decode_time:0,rtc_v_break_time:0,rtc_v_decode_time:0},v),{total_d:y?g-y:0,valid_d:this.rtcValidTime+this.l3ValidTime+this.cdnValidTime,tempbroken_cnt:this.rtcBrokenCnt+this.l3BrokenCnt+this.CDNBrokenCnt,is_mini:this.te})),this.reportSpan.end()}this.ee.stopToReport(1),this.ee.stopNetProbe(this),this.retryFailGwNodes=[],this.resetPlayMediaServerMode(),this.nr(),this.isRePlay=!1,this.hasSucceed=!1,this.rtcPlayCount=0,this.isProbeDispatch=!1,this.probeIpCnt=0,this.validProbeIpCnt=0,this.poorQualityRetryCnt=0,this.continuousFailCnt=0;var _=this.rtcViewer;_&&_.destroy()},e.prototype.uploadPlayEvent=function(e){this.ve.spanEnd({key:Gl,par:this.streamId},{error:e.code,message:e.message},!0)},e.prototype.onDisconnect=function(e){this.Xn.info("zc.p.od.1 "+this.streamId+" call"),this.playStateUpdateError(e||jl.un,!!e)},e.prototype.startSoundLevel=function(){var e,t=this;if(this.Xn.info(Js+" call streamID: "+this.streamId),!this.isProbe)if(this.remoteStream&&0!=this.remoteStream.getAudioTracks().length){null===(e=this.soundMeterWorklet)||void 0===e||e.destroy(),this.mic=null;var i=this.ee.getCloudSoundInterval();try{var r=this,n=this.ee.createSoundLevel(this.ac,this.remoteStream,this.ee.soundLevelInterval,i,(function(e){r.soundLevel=0===t.micStatus?100*e:0})),o=n.mic;this.soundMeterWorklet=n.soundMeter,this.mic=o}catch(e){this.Xn.error(Js+" get sound level failed "+e)}}else this.Xn.info(Js+" "+this.streamId+" remote stream no found")},e.prototype.stopSoundLevel=function(){var e;this.Xn.info("zc.p.ssl.1.1 call streamID: "+this.streamId),null===(e=this.soundMeterWorklet)||void 0===e||e.destroy(),this.mic=null},e.prototype.onCalNetQualityResult=function(e,t){},e.prototype.onReceivedDataChannel=function(e){var t,i,r=this,n=new Uint8Array(e.data,0,10),o=e.data.byteLength-10,s=new Uint8Array(e.data,10,o);if(1==n[0]){var a=n[1],c=n[2]<<8|n[3],u=n[4]<<8|n[5],l=(new Date).getTime();if(this.first_pkt&&(this.next_sn[0]=c==u?c:u,this.first_pkt=!1),this.pkt_list.push({sn:c,sn0:u,recv_ts:l,flags:a,payload_len:o,payloadArray:s}),this.pkt_list.sort(this.compareShort),c==this.next_sn[0]){var d=this.pkt_list.filter((function(e){return e.sn0==u}));if(d.sort(this.compareShort),null!=d.find((function(e){return 1&e.flags}))&&d.length==this.compareShort(c,u)+1){for(var h=0,p=new ArrayBuffer(65536),f=0;f<d.length;f++)new Uint8Array(p).set(d[f].payloadArray,h),h+=d[f].payload_len;null===(t=this.onDataChannelList)||void 0===t||t.forEach((function(e){e(p,h,r.streamId)})),this.pkt_list=[],this.first_pkt=!0}this.next_sn[0]++}else for(var m=function(){var e=v.pkt_list.filter((function(e){return e.sn0==r.pkt_list[0].sn0}));if(e.sort(v.compareShort),null!=e.find((function(e){return 1&e.flags}))&&e.length==v.compareShort(e[e.length-1].sn,e[0].sn0)+1){for(var t=0,n=new ArrayBuffer(65536),o=0;o<e.length;o++)new Uint8Array(n).set(e[o].payloadArray,t),t+=e[o].payload_len;v.next_sn[0]=e[0].sn0+e.length,null===(i=v.onDataChannelList)||void 0===i||i.forEach((function(e){e(n,t,r.streamId)})),v.pkt_list=[],v.first_pkt=!0}else if(l-e[0].ts<4e3){var s=e[0].sn0;for(o=0;o<e.length&&s==e[o].sn;o++)s++;return v.next_sn[0]=s,"break"}for(o=0;o<e.length;o++)v.pkt_list.shift()},v=this;this.pkt_list.length>0;)if("break"===m())break}},e.prototype.compareShort=function(e,t){var i=new Uint16Array(1);i[0]=e-t;var r=new Int16Array(1);return r[0]=i[0],r[0]},e.prototype.uploadRTCPlayStats=function(){var e,t,i,r,n,o,s,a,c,u,l,d,h,p,f;this.lastPlayStats.time&&this.ve.spanSetAttributes({key:this.Ze,par:this.streamId},{lsttime:Ii.lsttime(parseInt(this.lastPlayStats.time)),total_stat:_i.total_stat({afc:null===(e=this.lastPlayStats)||void 0===e?void 0:e.audioPacketsReceived,vfc:null===(t=this.lastPlayStats)||void 0===t?void 0:t.framesReceived,tfc:(null===(i=this.lastPlayStats)||void 0===i?void 0:i.audioPacketsReceived)+(null===(r=this.lastPlayStats)||void 0===r?void 0:r.framesReceived),vb:null===(n=this.lastPlayStats)||void 0===n?void 0:n.videoBytesReceived,ab:null===(o=this.lastPlayStats)||void 0===o?void 0:o.audioBytesReceived,tb:(null===(s=this.lastPlayStats)||void 0===s?void 0:s.videoBytesReceived)+(null===(a=this.lastPlayStats)||void 0===a?void 0:a.audioBytesReceived),rtp_rtt:Math.round(1e3*(null===(c=this.playStat)||void 0===c?void 0:c.currentRoundTripTime))||0,w:null===(u=this.playStat)||void 0===u?void 0:u.frameWidth,rtp_plr:null===(l=this.playStat)||void 0===l?void 0:l.videoPacketsLostRate,h:null===(d=this.playStat)||void 0===d?void 0:d.frameHeight,rtp_bw:(null===(h=this.playStat)||void 0===h?void 0:h.googAvailableSendBandwidth)?null===(p=this.playStat)||void 0===p?void 0:p.googAvailableSendBandwidth:void 0,p2p_delay:null===(f=this.playStat)||void 0===f?void 0:f.peerToPeerDelay})})},e.prototype.getVideoCodec=function(){var e=this;this.peerConnection&&(this.peerConnection.getStats().then((function(t){t.forEach((function(i){if("inbound-rtp"===i.type&&"video"===i.kind&&i.codecId){var r=t.get(i.codecId).mimeType.toLowerCase();if(r.indexOf("h264")>-1)e.videoCodec="H264";else if(r.indexOf("vp8")>-1){e.videoCodec="VP8",e.sideMediaConfig.isSEIStart&&e.Xn.error("zc.p.gvc video code VP8 is not support SEI");var n=e.seiWorker;n&&n.postMessage({cmd:"updatePlayer",codec:e.videoCodec,streamID:e.streamId})}}}))})),this.videoCodecTimes++,this.videoCodec||this.videoCodecTimes>=5)?this.stopVideocTimer():this.videoCodecTimer=setTimeout((function(){e.getVideoCodec()}),100)},e.prototype.stopVideocTimer=function(){this.videoCodecTimer&&(clearTimeout(this.videoCodecTimer),this.videoCodecTimer=null)},e.prototype.getViewer=function(){return this.playStream&&!this.rtcViewer&&(this.rtcViewer=new Qa(this.playStream,this,{clearLastFrame:this.re.engineConfig.playClearLastFrame})),this.rtcViewer},e.prototype.isMultiOuter=function(){return!(!this.re.accessClientIp||!this.streamConnectIP||this.re.accessClientIp===this.streamConnectIP)},e.prototype.isCustomCdn=function(){return!1},e.prototype.getSpan=function(e,t,i,r){if(void 0===r&&(r=!1),this.isProbe)return null;var n=Yn(this.ve,F.H,this.streamId,e,t,i,r);return n.setAttribute("is_mini",this.te),n},e.prototype.setTurnTcp=function(){this._turnToTcp=this.re.turnToTcp,void 0!==this.re.turnOverTcpOnly&&(this._turnToTcp=this.re.turnOverTcpOnly)},e.prototype.recordFirstFrameData=function(){var e;this.isProbe||0!=this.firstFrameTime||(this.firstFrameTime=(new Date).getTime()-this.beginTime,this.reportSpan.setAttributes({first_frame_time:Ql.first_frame_time(this.firstFrameTime),fft_video:Ql.fft_video(this.firstFrameTime),fft_audio:Ql.fft_audio(this.firstFrameTime),biz_product:Zi.biz_product((null===(e=this.playOption)||void 0===e?void 0:e.resourceMode)==q.DG?1:0)}),this.firstVideoSpan=this.firstFrameSpan("video"),this.firstAudioSpan=this.firstFrameSpan("audio"))},e.prototype.reportFirstFrameData=function(e,t){0===e&&this.firstVideoSpan&&(this.firstVideoSpan.setAttributes({dev_changed:Zi.dev_changed(0!==this.cameraStatus)}),this.firstVideoSpan.spanReport(),this.firstVideoSpan=null),0===t&&this.firstAudioSpan&&(this.firstAudioSpan.setAttributes({dev_changed:Ki.dev_changed(0!==this.micStatus)}),this.firstAudioSpan.spanReport(),this.firstAudioSpan=null)},e.prototype.firstFrameSpan=function(e){var t,i="video"===e?Zi:Ki,r=this.ve.createSpan(F.H,{key:Gl,par:this.streamId},{key:""},i.event),n=this.streamInRoom?2:0===this.streamRoomPushConsumed?0:1,o=(new Date).getTime()-this.answerSdpTime;return r.setAttributes({webrtc_sid:i.webrtc_sid(this.sessionId),resource_type:i.resource_type(go(this.resourceMode)),fft_consumed:i.fft_consumed(this.firstFrameTime),protocol:i.protocol("webrtc"),push_consumed:i.push_consumed(this.streamRoomPushConsumed),prepare_recv_consumed:i.prepare_recv_consumed(this.signalTime),connected_consumed:i.connected_consumed(o),reliability:i.reliability(n),biz_product:i.biz_product((null===(t=this.playOption)||void 0===t?void 0:t.resourceMode)==q.DG?1:0)}),null==r||r.end(!1),r},e.prototype.setStreamAdd=function(){this.streamInRoom||0!==this.streamRoomPushConsumed||5===this.state||(this.streamRoomPushConsumed=(new Date).getTime()-this.playStartTime)},e.prototype.startPollNetworkQuality=function(){var e=this;clearTimeout(this.netTimer),this.netTimer=setTimeout((function(){e.lostQualityTime++;var t=x.Unknown,i=x.Unknown;e.userID&&e.lostQualityTime>1&&(e.lostQualityTime>3&&(t=x.Die,i=x.Die),e.re.actionListener("networkQuality",e.userID,t,i)),e.startPollNetworkQuality()}),3e3)},e.prototype.stopPollNetworkQuality=function(){clearTimeout(this.netTimer),this.lostQualityTime=0},e.prototype.setAudioFrameCallback=function(e,t){this.playStream?(this.er||(this.er=new ql(this.ac,this.Xn)),this.er.setAudioFrameCallback(this.playStream,null!==e,(function(t){e&&e(t)}),t)):this.Xn.warn("zc.p.safc.0 "+this.streamId+" no play stream")},e.prototype.ir=function(){this.er&&(this.er.destroy(),this.er=null)},e.prototype.tr=function(){var e;null===(e=this.er)||void 0===e||e.replaceSource(this.playStream)},e.prototype.updateValidTime=function(e){if(this.pulledTimeStamp){var t=0;(null==e?void 0:e.code)&&e.code!==It.code&&(t=1);var i=Date.now(),r=this,n=r.resourceMode,o=r.playMode,s=i-r.pulledTimeStamp;n==q.RTC?(this.rtcValidTime=s,this.rtcBrokenCnt+=t):(n==q.L3||n==q.DG&&o==z.L3)&&(this.l3ValidTime=s,this.l3BrokenCnt+=t),this.pulledTimeStamp=0}},e.prototype.updateCDNValidTime=function(){this.cdnPlayTime&&(this.cdnValidTime+=Date.now()-this.cdnPlayTime,this.cdnPlayTime=0)},e.prototype.setMuteStreamByPlayMode=function(e){this.Xn.info(ta+" ".concat(this.streamId," call: ").concat(JSON.stringify(e)));var t,i=e.play_mode,r=void 0===i?0:i,n=e.forbid_play_expire_time,o=1e3*(Ce.isLong(t=void 0===n?0:n)?t.toNumber():0),s=!Jn(r,0),a=!Jn(r,1);this.Xn.info(ta+" ".concat(this.streamId," mode: ").concat(a,",\n ").concat(s,",\n ").concat(o,",\n ").concat(JSON.stringify(this.playMediaServerMode))),a!==this.playMediaServerMode.video||s!==this.playMediaServerMode.audio||o!==this.playMediaServerMode.expireTime?(dn(a)&&(this.playMediaServerMode.lastVideo=this.playMediaServerMode.video,this.playMediaServerMode.video=a),dn(s)&&(this.playMediaServerMode.lastAudio=this.playMediaServerMode.audio,this.playMediaServerMode.audio=s),o&&(this.playMediaServerMode.expireTime=o),this.ee.playModule&&this.Le&&this.Xe()):this.Xn.info(ta+" ".concat(this.streamId," mode not change"))},e.prototype.Xe=function(){var e=[void 0,!0].includes(this.playOption.video),t=[void 0,!0].includes(this.playOption.audio),i=this.playMediaServerMode,r=i.video,n=i.audio,o=i.lastVideo,s=i.lastAudio,a=i.expireTime;this.Xn.info("".concat(ia," ").concat(this.streamId," ").concat(JSON.stringify(this.playMediaServerMode)));var c=this.playMediaStatus,u=c.video,l=c.audio,d=a-((new Date).getTime()+this.re.clientTimeOffset);this.Xn.info("".concat(ia," ").concat(this.streamId," remainTime ").concat(d));var h=!1,p=!1,f=!1,m=!1;this.rr();var v=!1;this.isServerMuteVideo||!1===o&&!0===r?(h=!0,p=!r,v=!0):(h=!u,p=!u),this.isServerMuteAudio||!1===s&&!0===n?(f=!0,m=!n,v=!0):(f=!l,m=!l),e&&h&&this.sr("video",p,v),t&&f&&this.sr("audio",m,v),this.nr(),(!1===r||!1===n)&&d>0&&this.ur(d)},e.prototype.sr=function(e,t,i,r){var n=this;this.Xn.info("".concat(ra," ").concat(this.streamId," ").concat(e," ").concat(t));var o=this.ee.playModule;o&&o.mutePlayStream(this.streamId,e,t,!1).then((function(t){n.Xn.info("".concat(ra," ").concat(n.streamId," mute ").concat(e,": ").concat(t));var o=function(e,t){var i={method:e,content:JSON.stringify({roomID:n.room.roomID,streamID:n.streamId,mute:t})};n.re.onExperimentalAPICallback(e,i)},s=!n.playMediaStatus.video,a=!n.playMediaStatus.audio;"video"===e&&i&&n.roomMuteVideoState!==s&&(o("onRecvRoomMuteVideoStream",s),n.roomMuteVideoState=s),"audio"===e&&i&&n.roomMuteAudioState!==a&&(o("onRecvRoomMuteAudioStream",a),n.roomMuteAudioState=a),r&&r()}))},e.prototype.ur=function(e){var t=this;this.Xn.info("".concat(na," ").concat(this.streamId," ").concat(e)),this.playMediaModeTimer=setTimeout((function(){var e=t.ee.playModule;if(t.Xn.info("".concat(na," ").concat(t.streamId," ").concat(!!e)),e){var i=t.playMediaServerMode,r=i.audio;!1===i.video&&t.sr("video",!1,!0,(function(){t.rr()})),!1===r&&t.sr("audio",!1,!0,(function(){t.rr()})),t.resetPlayMediaServerMode()}}),e)},e.prototype.rr=function(){var e=this.playMediaServerMode,t=e.video,i=e.audio,r=e.expireTime-((new Date).getTime()+this.re.clientTimeOffset);this.isServerMuteVideo=r>0&&!1===t,this.isServerMuteAudio=r>0&&!1===i},e.prototype.nr=function(){this.playMediaModeTimer&&(clearTimeout(this.playMediaModeTimer),this.playMediaModeTimer=null)},e.prototype.resetPlayMediaServerMode=function(){this.playMediaServerMode={video:!0,audio:!0,expireTime:0,lastVideo:!0,lastAudio:!0}},e}(),$l=function(){function e(){this.RETRY_MAX_TIME=300,this.RETRY_START_TIME_INTERVAL=4,this.RETRY_CONTINUE_COUNT=2,this.RETRY_MAX_TIME_INTERVAL=32,this.retryStartTime=0,this.retryActiveCount=1,this.retryNetCount=0,this.retryNetMaxTimes=3,this.isOverTime=!1}return e.prototype.init=function(e,t,i,r){this.invalid(),this.stopMaxTime(),this.isOverTime=!1,un(e)&&e<3600&&(this.RETRY_MAX_TIME=e),un(t)&&(this.RETRY_START_TIME_INTERVAL=t),un(i)&&(this.RETRY_CONTINUE_COUNT=i),un(r)&&(this.RETRY_MAX_TIME_INTERVAL=r)},e.prototype.invalid=function(){this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=null,this.startRetryTimer&&clearTimeout(this.startRetryTimer),this.startRetryTimer=null,this.retryStartTime=0,this.retryActiveCount=1,this.retryNetCount=0},e.prototype.isRetrying=function(){return null!==this.retryTimer||null!==this.startRetryTimer||null!==this.maxTimer},e}(),ed=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),td=pi,id=wi,rd="zc.tsh.a ",nd=Ti.error,od=li.error,sd=_i,ad=Ii,cd=function(e){function t(t,i,r,n){var o=e.call(this)||this;return o.Xn=t,o.re=i,o.ee=r,o.isPublish=n,o.serverUrls=[],o.streamRetryStartTime=0,o}return ed(t,e),Object.defineProperty(t.prototype,"ve",{get:function(){return this.re.reporter},enumerable:!1,configurable:!0}),t.prototype.initStream=function(e,t){this.streamID=e,this.serverUrls=t},t.prototype.activePublish=function(e){var t=this;if(this.Xn.info(rd+"retry call "+this.streamID),this.retryTimer)return this.Xn.info(rd+"has active, ignore"),!1;var i=this.re.networkState==_.offline;if(i){if(this.Xn.info(rd+"check if really offline. "+this.retryNetCount),this.retryNetCount>=this.retryNetMaxTimes)return this.Xn.warn(rd+Qe+", "+We),!1}else this.retryNetCount=0;if(this.isOverTime)return this.Xn.warn(rd+"retry over time, "+We),!1;if(1==this.retryActiveCount)this.retryActiveInterval=Math.floor(Math.random()*(1-this.RETRY_START_TIME_INTERVAL)+this.RETRY_START_TIME_INTERVAL);else{var r=Math.pow(2,Math.floor(this.retryActiveCount/this.RETRY_CONTINUE_COUNT+1)-1);this.retryActiveInterval=r>this.RETRY_MAX_TIME_INTERVAL?this.RETRY_MAX_TIME_INTERVAL:r}var n=this.ee.publisherList[this.streamID].publisher,o=this.serverUrls[0],s=["unified_rtc","unified_l3"].includes(o);if(!s){var a=this.serverUrls,c=n.signal?n.signal.server:"";a.forEach((function(e,i){return i<=a.indexOf(c)&&t.serverUrls.push(e)})),a.splice(0,a.indexOf(c)+1),o=this.serverUrls[this.retryActiveCount%this.serverUrls.length==0?this.serverUrls.length-1:this.retryActiveCount%this.serverUrls.length-1]}var u=un(e)?e:1e3*this.retryActiveInterval;this.ve.spanSetAttributes({key:n.parentSpanKey,par:this.streamID},{wait_consume:di.wait_consume(u)});var l=function(){t.Xn.info("".concat(rd," stream ").concat(t.streamID," : connect to ").concat(s?"unified signal server":"signal server "+o)),t.retryTimer&&clearTimeout(t.retryTimer),t.retryTimer=null,i?t.retryNetCount++:t.retryActiveCount++,t.ee.connectPublishServer(t.streamID,o)};return 0!==u?this.retryTimer=setTimeout(l,u):l(),this.Xn.info(rd+"call success. delay: "+u),!0},t.prototype.activePull=function(e,t){var i=this;if(this.Xn.info(rd+"retry call "+this.streamID),t&&(this.playStreamSuccess=t),this.retryTimer)return this.Xn.info(rd+"has active, ignore"),!1;var r=this.re.networkState==_.offline;if(r){if(this.Xn.info(rd+"check if really offline. "+this.retryNetCount),this.retryNetCount>=this.retryNetMaxTimes)return this.Xn.warn(rd+Qe+", "+We),!1}else this.retryNetCount=0;if(this.isOverTime)return this.Xn.warn(rd+"retry over time, "+We),!1;if(1==this.retryActiveCount)this.retryActiveInterval=Math.floor(Math.random()*(1-this.RETRY_START_TIME_INTERVAL)+this.RETRY_START_TIME_INTERVAL);else{var n=Math.pow(2,Math.floor(this.retryActiveCount/this.RETRY_CONTINUE_COUNT+1)-1);this.retryActiveInterval=n>this.RETRY_MAX_TIME_INTERVAL?this.RETRY_MAX_TIME_INTERVAL:n}var o=this.ee.playerList[this.streamID].player,s=this.serverUrls,a=o.signal?o.signal.server:"",c=this.serverUrls[0],u=["unified_rtc","unified_l3"].includes(c);u||(s.forEach((function(e,t){return t<=s.indexOf(a)&&i.serverUrls.push(e)})),s.splice(0,s.indexOf(a)+1),c=this.serverUrls[this.retryActiveCount%this.serverUrls.length==0?this.serverUrls.length-1:this.retryActiveCount%this.serverUrls.length-1]);var l=un(e)?e:1e3*this.retryActiveInterval;return this.ve.spanSetAttributes({key:o.parentSpanKey,par:this.streamID},{wait_consume:Ei.wait_consume(l)}),this.retryTimer=setTimeout((function(){i.Xn.info("".concat(rd," stream ").concat(i.streamID," : connect to ").concat(u?"unified signal server":"signal server "+c)),i.retryTimer&&clearTimeout(i.retryTimer),i.retryTimer=null,r?i.retryNetCount++:i.retryActiveCount++,i.ee.connectPlayServer(i.streamID,i.playStreamSuccess,c)}),l),this.Xn.info(rd+"call success. delay: "+l),!0},t.prototype.startMaxTime=function(){var e=this;this.Xn.info("zc.tsh.smt ".concat(this.streamID," call")),this.maxTimer?this.Xn.warn("zc.tsh.smt max timer"):(0===this.streamRetryStartTime&&(this.streamRetryStartTime=(new Date).getTime()),this.maxTimer=setTimeout((function(){if(e.Xn.warn("zc.tsh.smt ".concat(e.streamID," over max time ").concat(e.RETRY_MAX_TIME,"s, stop retry")),e.isOverTime=!0,e.invalid(),e.isPublish){if(!e.ee.publisherList[e.streamID])return void e.Xn.info("zc.tsh.smt streamID "+e.streamID+" publish no found");e.publishStateHandle(1,e.streamID,od.Vi,!0)}else{if(!e.ee.playerList[e.streamID])return void e.Xn.info("zc.tsh.smt streamID "+e.streamID+" play no found");e.playStateHandle(1,e.streamID,nd.zn,!0)}}),1e3*this.RETRY_MAX_TIME),this.Xn.info("zc.tsh.smt maxTimer=".concat(this.maxTimer)))},t.prototype.stopMaxTime=function(){this.Xn.info("zc.tsh.stmt streamID "+this.streamID+" maxTimer="+this.maxTimer),this.maxTimer&&clearTimeout(this.maxTimer),this.maxTimer=null},t.prototype.onactive=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},t.prototype.retryNextSignal=function(e){var t,i,r,n;if(this.re.networkState==_.offline)return this.Xn.info("zc.tsh.rns "+this.streamID+" offline"),!0;if(this.isPublish){var o=this.ee.publisherList[this.streamID];if(7==o.publisher.state&&[od.Yi.code].includes(e.code))return!0;if(this.Xn.info("zc.tsh.rns "+this.streamID+" publish ws state "+(null===(t=o.publisher.signal)||void 0===t?void 0:t.wsReadyState)),this.Xn.info("zc.tsh.rns "+this.streamID+" offline"),o.isCenterNode&&(null===(i=o.publisher.signal)||void 0===i?void 0:i.wsReadyState)==hl.OPEN)return!1;if(!o.isCenterNode&&[od.Zi.code].includes(e.code)){var s=e.message.match(/reason:(\d+)/);return!["26"].includes(s?s[1]:"")}return!0}var a=this.ee.playerList[this.streamID];return!(7!=a.player.state||![nd.Mn.code].includes(e.code))||(this.Xn.info("zc.tsh.rns "+this.streamID+" play ws state "+(null===(r=a.player.signal)||void 0===r?void 0:r.wsReadyState)),(!a.isCenterNode||(null===(n=a.player.signal)||void 0===n?void 0:n.wsReadyState)!=hl.OPEN)&&(!(!a.isCenterNode&&[nd.Pn.code].includes(e.code))||(s=e.message.match(/reason:(\d+)/),!["24","26","28"].includes(s?s[1]:""))))},t.prototype.publishStateHandle=function(e,t,i,r,n,s){var a=this;this.Xn.info(Oo+" call "+t+" "+(i?i.code+"":"")+" "+r+" "+JSON.stringify(n)+" "+s);var c=r||this.RETRY_MAX_TIME<3,u=this.ee.publisherList[t],l=u.publisher;if(!c&&i&&(zn(i)||0==this.serverUrls.length))return this.Xn.info(Oo+" stop "+c+" "+JSON.stringify(this.serverUrls)),this.stopMaxTime(),this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=null,void this.ee.onPublishStateUpdate(e,t,i);if(!c&&i&&0!==i.code){if(this.maxTimer||c||this.startMaxTime(),this.re.useNetAgent&&i.code===lt.code)return this.Xn.info(Oo+" connect fail"),void(this.activePublish()&&(this.rtcPublishSpan(t,i,l),this.ee.onPublishStateUpdate(2,t,i),this.publishStartSpan(t,i,u)));this.re.publishStreamList[t].state=T.retryPublish;var d=l.localStream,h=l.videoInfo,p=l.mediaStreamConfig,f=l.publishOption;if(0!=l.sessionId&&l.signal&&l.shouldSendCloseSession()&&(l.signal.sendCloseSession((0,o.getSeq)(),l.sessionId,1),l.signal.removeSession(l.sessionId),l.closeSessionSignal=!0),l.resetPublish(),!c&&!this.retryNextSignal(i)){if(this.Xn.info(Oo+" retry current signal "),this.rtcPublishSpan(t,i,l),u.isCenterNode){this.Xn.info(Oo+" current node "+l.gwNode+" failed "+JSON.stringify(l.retryFailGwNodes));var m=l.retryFailGwNodes.findIndex((function(e){return e===l.gwNode}));m>=0&&l.retryFailGwNodes.splice(m,1),l.retryFailGwNodes.push(l.gwNode),this.retryNewGwNode(l,i,n,s)}this.startRetryTimer&&clearTimeout(this.startRetryTimer),this.startRetryTimer=null;var v=[od.Gi.code,od.rn.code].includes(i.code)?0:1e3;return this.Xn.info(Oo+" "+t+" delay "+v),this.startRetryTimer=setTimeout((function(){a.Xn.info(Oo+" "+t+" retry publish "+l.state),7==l.state&&l.startPublish(t,d,h,p,f)}),v),i&&0!==i.code&&this.ee.onPublishStateUpdate(2,t,i),void this.publishStartSpan(t,i,u)}this.ee.removeStreamFromSignal(!0,t)}if(c)return this.stopMaxTime(),this.invalid(),1===e&&l.resetPublish(),(null==i?void 0:i.code)&&this.ve.spanSetAttributes({key:l.parentSpanKey,par:t},i),void this.ee.onPublishStateUpdate(e,t,i);i&&0!==i.code&&this.activePublish(void 0)&&(l&&(l.isExternal=!1),this.rtcPublishSpan(t,i,l),this.ee.onPublishStateUpdate(2,t,i),this.publishStartSpan(t,i,u)),this.Xn.info(Oo+" end "+t)},t.prototype.needReDispatchError=function(e){return[od.pn.code,nd.Ln.code].includes(e.code)},t.prototype.playStateHandle=function(e,t,i,r,n,s){var a=this;this.Xn.info(Mo+" call "+t+" "+(i?i.code+"":"")+" "+r+" "+JSON.stringify(n)+" "+s);var c=r||this.RETRY_MAX_TIME<3;if(!c&&i&&(zn(i)||0==this.serverUrls.length))return this.Xn.info(Mo+" stop "+c+" "+JSON.stringify(this.serverUrls)),this.stopMaxTime(),this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=null,void this.ee.onPlayStateUpdate(e,t,i);var u=this.ee.playerList[t],l=u.player;if(!c&&i&&0!==i.code){!this.maxTimer&&!c&&this.startMaxTime();var d=l.playOption;if(0!=l.sessionId&&l.signal&&l.shouldSendCloseSession()&&(l.signal.sendCloseSession((0,o.getSeq)(),l.sessionId,1),l.signal.removeSession(l.sessionId),l.closeSessionSignal=!0),l.resetPlay(),!c&&!this.retryNextSignal(i)){if(this.Xn.info(Mo+" retry current signal "),this.rtcPlaySpan(t,i,l),u.isCenterNode){this.Xn.info(Mo+" current node "+l.gwNode+" "+JSON.stringify(l.retryFailGwNodes));var h=l.retryFailGwNodes.findIndex((function(e){return e===l.gwNode}));h>=0&&l.retryFailGwNodes.splice(h,1),l.retryFailGwNodes.push(l.gwNode),this.retryNewGwNode(l,i,n,s)}this.startRetryTimer&&clearTimeout(this.startRetryTimer),this.startRetryTimer=null;var p=Ti.error,f=[p.Nn.code,p.rn.code].includes(i.code)?0:1e3;return this.Xn.info(Mo+" "+t+" delay "+f),this.startRetryTimer=setTimeout((function(){a.Xn.info(Mo+" "+t+" retry state "+l.state),7===l.state&&l.startPlay(t,l.getRemoteStreamSuc,d)}),f),i&&0!==i.code&&this.ee.onPlayStateUpdate(2,t,i),void this.playStartSpan(t,i,l)}this.ee.removeStreamFromSignal(!1,t)}if(c)return this.stopMaxTime(),this.invalid(),(null==i?void 0:i.code)&&this.ve.spanSetAttributes({key:l.parentSpanKey,par:t},{error:null==i?void 0:i.code}),void this.ee.onPlayStateUpdate(e,t,i);i&&0!==i.code&&this.activePull(void 0)&&(l&&(l.isExternal=!1),this.rtcPlaySpan(t,i,l),this.ee.onPlayStateUpdate(2,t,i),this.playStartSpan(t,i,l)),this.Xn.info(Mo+" end "+t)},t.prototype.retryNewGwNode=function(e,t,i,r){var n,o,s,a;if(this.Xn.info(Lo+" call "+e.streamId),t&&t.code&&this.needReDispatchError(t))this.retryNextGwNode(e,!0,r);else if(null==i?void 0:i.action)switch(null==i?void 0:i.action){case 1:case 5:break;case 2:default:this.retryNextGwNode(e,!1,r);break;case 3:this.Xn.info(Lo+" "+e.streamId+" redirect");var c=null==i?void 0:i.ins;c&&c.length>0&&(e.gwNode=((null===(n=c[0])||void 0===n?void 0:n.IP)||(null===(o=c[0])||void 0===o?void 0:o.ip))+":"+((null===(s=c[0])||void 0===s?void 0:s.Port)||(null===(a=c[0])||void 0===a?void 0:a.port)));break;case 4:e.resetGwNodes(),this.ee.clearCachedGwNodesList(e,this.isPublish)}else this.retryNextGwNode(e,!1,r);this.Xn.info(Lo+" "+e.streamId+" new node "+e.gwNode)},t.prototype.retryNextGwNode=function(e,t,i){var r;if(this.Xn.info(xo+" call "+e.streamId+" "+e.gwNode),0!==(null===(r=e.gwNodeList)||void 0===r?void 0:r.length)||e.gwNode){var n=e.gwNodesTTL<(new Date).getTime(),o=e.iceStateDisConnect&&this.re.isMultiOuter,s=e.gwNodeList.findIndex((function(t){return t==e.gwNode})),a=s===e.gwNodeList.length-1;this.Xn.info(xo+" "+e.streamId+" ttl: "+n+" ice: "+o+" last: "+a),t||n||e.isLastConnected&&o||a?this.re.useNetAgent&&(e.gwNode=e.gwNodeList[++s%e.gwNodeList.length],this.dispatchGwNodesBypass(e)):e.gwNode=i?e.gwNodeList[0]:e.gwNodeList[++s%e.gwNodeList.length]}else this.Xn.info(xo+" call "+e.streamId+" gwNodeList is empty")},t.prototype.dispatchGwNodesBypass=function(e,t,i){var r=this;void 0===t&&(t=function(){}),void 0===i&&(i=function(){}),e.dispatchGwNodes((function(i){r.Xn.info(Uo+" suc "+JSON.stringify(i)),e.setGwNodes(i,!0),t()}),(function(e){r.Xn.info(Uo+" fail "+JSON.stringify(e)),i()}))},t.prototype.rtcPublishSpan=function(e,t,i){var r,n,o;null==i||i.uploadRTCPublishStats();var s=(null==i?void 0:i.isLastConnected)?0:this.getTryTime(i);this.ve.spanEnd({key:_i.event,par:e},{tryidx:sd.tryidx(null==i?void 0:i.rtcPublishCount),url:sd.url(null===(r=null==i?void 0:i.signal)||void 0===r?void 0:r.server),ip:sd.ip(null===(o=null===(n=null==i?void 0:i.gwNode)||void 0===n?void 0:n.split(":"))||void 0===o?void 0:o[0]),dispatch_external_ip:sd.dispatch_external_ip(this.re.clientIP),resource_type:sd.resource_type("rtc"),protocol:sd.protocol("webrtc"),try_time:sd.try_time(s),error:null==t?void 0:t.code,message:null==t?void 0:t.message})},t.prototype.publishStartSpan=function(e,t,i){var r,n,o=null==i?void 0:i.publisher,s=(null==o?void 0:o.hasSucceed)?hi:di;this.ve.createSpan(F.H,{key:li.event,par:e},{key:s.event,par:e},s.event,!0),!1===(null==o?void 0:o.isRePublish)&&this.ve.spanSetAttributes({key:td.event,par:e},{retry_btime:td.retry_btime((new Date).getTime())}),(null==o?void 0:o.hasSucceed)&&(o.isRePublish=!0,o.parentSpanKey=hi.event),this.ve.createSpan(F.I,{key:li.event,par:e},{key:_i.event,par:e},_i.event,!0).setAttributes({room_id:sd.room_id(null===(r=null==i?void 0:i.room)||void 0===r?void 0:r.roomID),room_sid_string:sd.room_sid_string(null===(n=null==i?void 0:i.room)||void 0===n?void 0:n.roomSessionID)}),o&&(o.rtcPublishCount++,o.continuousFailCnt++)},t.prototype.rtcPlaySpan=function(e,t,i){var r;null==i||i.uploadRTCPlayStats();var n=(null==i?void 0:i.isLastConnected)?0:this.getTryTime(i);this.ve.spanEnd({key:(null==i?void 0:i.Ze)||Ii.event,par:e},{tryidx:ad.tryidx(null==i?void 0:i.rtcPlayCount),url:ad.url(null===(r=null==i?void 0:i.signal)||void 0===r?void 0:r.server),ip:ad.ip(null==i?void 0:i.ip),resource_type:ad.resource_type(go((null==i?void 0:i.resourceMode)||0)),protocol:ad.protocol("webrtc"),dispatch_external_ip:ad.dispatch_external_ip(this.re.clientIP),try_time:sd.try_time(n),error:null==t?void 0:t.code,message:null==t?void 0:t.message})},t.prototype.playStartSpan=function(e,t,i){var r,n=(null==i?void 0:i.hasSucceed)?Ci:Ei;this.ve.createSpan(F.H,{key:Ti.event,par:e},{key:n.event,par:e},n.event,!0),!1===(null==i?void 0:i.isRePlay)&&this.ve.spanSetAttributes({key:id.event,par:e},{retry_btime:id.retry_btime((new Date).getTime())}),(null==i?void 0:i.hasSucceed)&&(i.isRePlay=!0,i.parentSpanKey=Ci.event);var o=(null==i?void 0:i.Ze)||Ii.event,s=this.ve.createSpan(F.I,{key:Ti.event,par:e},{key:o,par:e},o,!0),a=null===(r=this.ee.playerList[e])||void 0===r?void 0:r.room;s.setAttributes({room_id:ad.room_id(null==a?void 0:a.roomID),room_sid_string:ad.room_sid_string(null==a?void 0:a.roomSessionID),stream_id:ad.stream_id(e)}),i&&(i.rtcPlayCount++,i.continuousFailCnt++)},t.prototype.getTryTime=function(e,t){var i=void 0;return e&&this.streamRetryStartTime>0&&(i=(new Date).getTime()-this.streamRetryStartTime,e.lastFailTimeLen=i=i>0?i:void 0,t&&(this.streamRetryStartTime=0)),i},t}($l),ud=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ld=fr,dd=Ur,hd=function(e){function t(t,i,r,n){var o=e.call(this)||this;return o.retryActiveCount=1,o.RETRY_MAX_TIME=90,o.Xn=t,o.re=i,o.rtm=r,o.ee=n,o}return ud(t,e),Object.defineProperty(t.prototype,"ve",{get:function(){return this.re.reporter},enumerable:!1,configurable:!0}),t.prototype.initStream=function(e,t,i){this.streamID=e,this.playOption=t,this.isPublish=i},t.prototype.active=function(e){var t,i,r,n,o,s,a=this;if(this.Xn.info(Do+" retry call "+this.streamID),this.isPublish){var c=null===(i=null===(t=this.ee)||void 0===t?void 0:t.publisherList[this.streamID])||void 0===i?void 0:i.publisher;o=(null==c?void 0:c.isRePublish)?hi:di,s=fr}else{var u=null===(n=null===(r=this.ee)||void 0===r?void 0:r.playerList[this.streamID])||void 0===n?void 0:n.player;o=(null==u?void 0:u.isRePlay)?Ci:Ei,s=Ur}var l=this.ve.createSpan(F.H,{key:o.event,par:this.streamID},{key:""},s.event);if(this.retryTimer)return this.Xn.info(Do+" has active, ignore"),this.ve.setError(l,at,"has active, ignore"),!1;var d=this.rtm.isDisConnect()&&this.re.networkState==_.offline;if(d){if(this.Xn.info(Do+" check if really offline"),this.retryNetCount>=this.retryNetMaxTimes)return this.Xn.warn(Do+" "+Qe+", stop retry"),!1}else this.retryNetCount=0;if(this.isOverTime)return this.Xn.warn(Do+" retry over time, stop retry"),this.ve.setError(l,at,"retry over time, stop retry"),!1;if(!this.rtm.isLogin()){this.stopMaxTime(),this.invalid();var h=this.isPublish?this.ee.publisherList[this.streamID]:this.ee.playerList[this.streamID];h&&(h.isReDispatch=!0)}var p=this.retryActiveCount-1;this.retryDispatchSpan||(this.retryDispatchSpan=l,this.ve.setSpanInMap(l,{key:s.event,par:this.streamID}));var f=this.playOption&&2==this.playOption.resourceMode?1:0,m={stream_id:this.streamID,ptype:this.isPublish?"push":"pull",signals:this.ee.getAllInUseUrl(),header_kvs:[{key:"grpc-metadata-push",value:this.playOption&&this.playOption.cdnUrl||""}],retry:p,center_ability:!0,dispatch_type:f};return this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout((function(){a.retryTimer=null,d?a.retryNetCount++:a.retryActiveCount++;var e=a.ee.getRoomByStreamID(a.streamID),t=a.rtm.service.sendMessage("webrtc_url",m,(function(e,t){a.handleFetchWebRtcUrlRsp(e)}),(function(e,t){a.handleFetchWebRtcUrlRsp(e)}),void 0,{sessionID:null==e?void 0:e.sessionID,roomID:null==e?void 0:e.roomID,roomSessionID:null==e?void 0:e.roomSessionID});a.isPublish&&t?a.ee.publisherList[a.streamID]&&(a.ee.publisherList[a.streamID].seq=t):t&&a.ee.playerList[a.streamID]&&(a.ee.playerList[a.streamID].seq=t)}),un(e)?e:1e3*this.retryActiveInterval),this.Xn.info(Do+" call success"),!0},t.prototype.startMaxTime=function(){var e=this;this.Xn.info("zc.tdh.smt ".concat(this.streamID," call")),this.maxTimer||(this.maxTimer=setTimeout((function(){e.Xn.warn("".concat("zc.rdh.m"," ").concat(e.streamID," dispatch over max time ").concat(e.RETRY_MAX_TIME,"s stop retry")),e.isOverTime=!0,e.invalid();var t=Ti.error.An;t.message=t.message+" try max limit",e.isPublish?e.ee.onPublishStateUpdate(1,e.streamID,t):e.ee.onPlayStateUpdate(1,e.streamID,t)}),1e3*this.RETRY_MAX_TIME),this.Xn.info("zc.tdh.smt ".concat(this.streamID," maxTimer=").concat(this.maxTimer)))},t.prototype.stopMaxTime=function(){this.Xn.info("zc.tdh.stmt ".concat(this.streamID," maxTimer=").concat(this.maxTimer)),this.maxTimer&&clearTimeout(this.maxTimer),this.maxTimer=null},t.prototype.onactive=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},t.prototype.handleFetchWebRtcUrlRsp=function(e){var t,i,r,n,o,s,a,c,u,l,d;if(e.code&&[tt.code].includes(e.code))this.active();else{if(e.code&&[it.code].includes(e.code))return this.stopMaxTime(),this.invalid(),void(this.isPublish?this.ee.publisherList[this.streamID].isReDispatch=!0:this.ee.playerList[this.streamID].isReDispatch=!0);var h=e,p=h.body.stream_id,f=!1,m=Ti.error;if(this.isPublish&&(!this.ee.publisherList[p]||h.header.seq!==this.ee.publisherList[this.streamID].seq))return this.Xn.warn(No+" seq is not match, ignore "+this.streamID),this.stopMaxTime(),void this.invalid();if(!(this.isPublish||this.ee.playerList[this.streamID]&&h.header.seq===this.ee.playerList[this.streamID].seq))return this.Xn.warn(No+" seq is not match, ignore "+this.streamID),this.stopMaxTime(),void this.invalid();if(this.re.clientIP=h.body.clientip||"",0===h.body.err_code||2!=h.body.need_action)if(0===h.body.err_code||1===h.body.need_action||[3102].includes(h.body.err_code)){this.stopMaxTime(),this.invalid();var v=h.body.is_center_node;if(h.body.urls&&Array.isArray(h.body.urls)&&h.body.urls.length>0?f=!0:this.Xn.error(No+" signal url is empty"),"push"===h.body.ptype&&this.ee.publisherList[p]){if(!f)return null===(o=this.retryDispatchSpan)||void 0===o||o.setAttributes({try_cnt:ld.try_cnt(this.retryActiveCount)}),this.ve.setError(this.retryDispatchSpan,li.error.Bi),this.retryDispatchSpan=null,void this.ee.onPublishStateUpdate(1,p,li.error.Bi);var g=this.ee.publisherList[p];this.re.publishStreamList[p]?(g.ttl=h.body.hosts_ttl?(new Date).getTime()+1e3*h.body.hosts_ttl:0,g.isCenterNode=!!dn(v)&&v,g.serverUrls=h.body.urls,null===(s=this.retryDispatchSpan)||void 0===s||s.setAttributes({urls:ld.urls(g.serverUrls),is_center:ld.is_center(g.isCenterNode),try_cnt:ld.try_cnt(this.retryActiveCount)}),null===(a=this.retryDispatchSpan)||void 0===a||a.end(),this.retryDispatchSpan=null,this.ee.startPublishingStream(p)):this.Xn.error(No+" no streamid to publish")}else if("pull"==h.body.ptype&&this.ee.playerList[p]){if(!f)return(b=JSON.parse(JSON.stringify(1900001004===(null===(c=h.body)||void 0===c?void 0:c.err_code)?m.Dn:m.An))).message=b.message+(h.body.err_code?" server error:"+h.body.err_code:""),3102===h.body.err_code&&(b=Ti.error.Cn),null===(u=this.retryDispatchSpan)||void 0===u||u.setAttributes({try_cnt:dd.try_cnt(this.retryActiveCount)}),this.ve.setError(this.retryDispatchSpan,b),void this.ee.onPlayStateUpdate(1,p,b);var y=this.ee.playerList[p];y.ttl=h.body.hosts_ttl?(new Date).getTime()+1e3*h.body.hosts_ttl:0,y.isCenterNode=!!dn(v)&&v,y.serverUrls=h.body.urls,null===(l=this.retryDispatchSpan)||void 0===l||l.setAttributes({urls:dd.urls(y.serverUrls),is_center:dd.is_center(y.isCenterNode),try_cnt:dd.try_cnt(this.retryActiveCount)}),null===(d=this.retryDispatchSpan)||void 0===d||d.end(),this.retryDispatchSpan=null,this.ee.startPlayingStream(p,this.re.useNetAgent,this.ee.playSuccessCallBackList[p])}}else{var b;this.retryActiveInterval=Math.floor(3*Math.random())+3,2==this.retryActiveCount&&((b=JSON.parse(JSON.stringify("pull"===(null===(r=h.body)||void 0===r?void 0:r.ptype)&&1900001004===(null===(n=h.body)||void 0===n?void 0:n.err_code)?m.Dn:m.An))).message=b.message+(h.body.err_code?" server error:"+h.body.err_code:""),"push"===h.body.ptype?this.ee.onPublishStateUpdate(2,p,b):this.ee.onPlayStateUpdate(2,p,b)),this.active()}else this.retryActiveInterval=h.body.action_delay/1e3||Math.floor(3*Math.random())+3,2==this.retryActiveCount&&((b=JSON.parse(JSON.stringify("pull"===(null===(t=h.body)||void 0===t?void 0:t.ptype)&&1900001004===(null===(i=h.body)||void 0===i?void 0:i.err_code)?m.Dn:m.An))).message=b.message+(h.body.err_code?" server error:"+h.body.err_code:""),"push"===h.body.ptype?this.ee.onPublishStateUpdate(2,p,b):this.ee.onPlayStateUpdate(2,p,b)),this.active()}},t}($l),pd=__webpack_require__(9483),fd=__webpack_require__.n(pd),md=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},vd=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},gd=function(){function e(e,t){this.name=e,this.Xn=t,this.storeName=e+":"+Mn(6),this.store=fd().createInstance({name:this.storeName}),this.Xn.info(Ta+" constructor ".concat(e," ").concat(this.storeName)),this.recordStoresInStorage(e,this.storeName)}return e.prototype.recordStoresInStorage=function(e,t){try{var i=localStorage.getItem(e);this.Xn.info(Ta+" record storage storeNames ".concat(i));var r=i?i.split(","):[];r.push(t+"-1"),localStorage.setItem(e,null==r?void 0:r.join(","))}catch(e){}},e.prototype.getStoresFromStorage=function(){return this.refreshStores("1")},e.prototype.resetStorageStores=function(){this.Xn.info(Ta+" resetStorageStores"),this.refreshStores("0",this.storeName)},e.prototype.removeStoreFromStorage=function(e){this.Xn.info(Ta+" removeStore ".concat(e)),this.refreshStores("2",e)},e.prototype.refreshStores=function(e,t){var i=this;if(this.Xn.info(Ta+" refreshStores ".concat(e," ").concat(t)),!localStorage)return[];var r=localStorage.getItem(this.name),n=r?r.split(","):[],o=[];if(n.length>0){var s=[];n.forEach((function(r){var n=r.split("-"),a=n[0],c=n[1];i.Xn.info(Ta+" refreshStores stores: ".concat(a," ").concat(c)),"2"==e?(a!==t&&s.push(a+"-"+c),t&&i.dropInstance(t)):"0"==e?(a!==t&&s.push(a+"-"+c),a===t&&s.push(a+"-"+e)):s.push(a+"-"+e),-1===a.indexOf(i.storeName)&&"0"==c&&o.push(a)})),localStorage.setItem(this.name,s.join(","))}return o},e.prototype.dropInstance=function(e){return md(this,void 0,void 0,(function(){return vd(this,(function(t){switch(t.label){case 0:this.Xn.info(Ta+" dropInstance ".concat(e)),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,fd().dropInstance({name:e})];case 2:return t.sent(),[3,4];case 3:return t.sent(),[3,4];case 4:return[2]}}))}))},e.prototype.getCacheStoreData=function(e){return md(this,void 0,void 0,(function(){var t,i,r,n;return vd(this,(function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),[4,(t=fd().createInstance({name:e})).keys()];case 1:return i=o.sent(),r=i.filter((function(e){return e.indexOf("_head")>-1})),n=[],r.length>0?[4,this.readStoreDatas(r,i,t)]:[3,3];case 2:return n=o.sent(),[3,4];case 3:this.removeStoreFromStorage(e),o.label=4;case 4:return[2,n];case 5:return o.sent(),[3,6];case 6:return[2]}}))}))},e.prototype.readStoreDatas=function(e,t,i){return md(this,void 0,void 0,(function(){var r,n,o,s;return vd(this,(function(a){switch(a.label){case 0:r=[],n=function(n){var s,a,c,u,l,d,h,p,f,m,v;return vd(this,(function(g){switch(g.label){case 0:a=(s=e[n]).replace("_head",""),c=t.filter((function(e){return e.indexOf(a)>-1})),u=null,l=[],d=[],h=void 0,p=0,g.label=1;case 1:return p<c.length?[4,i.getItem(f=c[p])]:[3,4];case 2:m=g.sent(),f.startsWith(a+"_head")?u=m:f.startsWith(a+"_publish")?l.push(m):f.startsWith(a+"_play")?d.push(m):f.startsWith("qec_"+a)&&(h=m),g.label=3;case 3:return p++,[3,1];case 4:return v=(new Date).getTime()-parseInt(a),u?l.length>0||d.length>0||h?(r.push({timestamp:parseInt(a),head:u,publishInfos:l,playInfos:d,chargeInfos:h}),[3,7]):[3,5]:[3,7];case 5:return 0===l.length&&0===d.length&&!h&&v>6e4?(o.Xn.info(Ta+" readStoreDatas remove ".concat(s)),[4,i.removeItem(s)]):[3,7];case 6:g.sent(),g.label=7;case 7:return[2]}}))},o=this,s=0,a.label=1;case 1:return s<e.length?[5,n(s)]:[3,4];case 2:a.sent(),a.label=3;case 3:return s++,[3,1];case 4:return[2,r]}}))}))},e.prototype.saveItem=function(e,t){return md(this,void 0,void 0,(function(){var i;return vd(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.store.setItem(e,t)];case 1:return r.sent(),[3,3];case 2:return i=r.sent(),this.Xn.warn(Ta+" save "+JSON.stringify(i)),[3,3];case 3:return[2]}}))}))},e.prototype.getItem=function(e){return md(this,void 0,void 0,(function(){var t;return vd(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.store.getItem(e)];case 1:return[2,i.sent()];case 2:return t=i.sent(),this.Xn.warn(Ta+" get "+JSON.stringify(t)),[3,3];case 3:return[2]}}))}))},e.prototype.removeItem=function(e){return md(this,void 0,void 0,(function(){var t;return vd(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.store.removeItem(e)];case 1:return i.sent(),this.Xn.info(Ta+"removeItem ".concat(JSON.stringify(e))),[3,3];case 2:return t=i.sent(),this.Xn.warn(Ta+" remove "+JSON.stringify(t)),[3,3];case 3:return[2]}}))}))},e.prototype.clearItems=function(e){return md(this,void 0,void 0,(function(){var t,i,r,n=this;return vd(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.store.keys()];case 1:return t=o.sent(),i=t.filter((function(t){return t.indexOf(e)>-1})),this.Xn.info(Ta+"clearItems ".concat(JSON.stringify(i))),i.forEach((function(e){return md(n,void 0,void 0,(function(){return vd(this,(function(t){switch(t.label){case 0:return[4,this.removeItem(e)];case 1:return t.sent(),[2]}}))}))})),[3,3];case 2:return r=o.sent(),this.Xn.warn(Ta+" clear "+JSON.stringify(r)),[3,3];case 3:return[2]}}))}))},e.prototype.getUnReportCachedDatas=function(e){return md(this,void 0,void 0,(function(){var t,i,r;return vd(this,(function(n){switch(n.label){case 0:return[4,this.filterItems(e)];case 1:return t=n.sent(),i=[],t&&t.length>0?(r=t.filter((function(e){return e.indexOf("_head")>-1})),[4,this.readStoreDatas(r,t,this.store)]):[3,3];case 2:i=n.sent(),n.label=3;case 3:return[2,i]}}))}))},e.prototype.filterItems=function(e){return md(this,void 0,void 0,(function(){var t,i;return vd(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.store.keys()];case 1:return t=r.sent(),[2,""!==e?t.filter((function(t){return-1===t.indexOf(e)})):t];case 2:return i=r.sent(),this.Xn.warn(Ta+" filter "+JSON.stringify(i)),[3,3];case 3:return[2]}}))}))},e}(),yd=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},bd=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},_d=pl.logreport,Sd=function(){function e(e,t,i){var r=this;this.Xn=e,this.re=t,this.ee=i,this.publishQualityInfos=[],this.playQualityInfos=[],this.ar=0,this.hr=0,this.updateChargeTime=0,this.cacheReportPackets=[],this.retryInterval=6e4,this.qualityEventSending=!1,this.uploadInterval=6e4,this.cachePacketsSize=20,this._useNTP=!1,this.beforeunloadListener=function(){r.Xn.info("".concat(ca," beforeunload")),r.streamStoreHandler.resetStorageStores()},this.streamStoreHandler=new gd(this.CacheKey,e),this.bindListener(),this.bindDestroyListener()}return Object.defineProperty(e.prototype,"uploadCreateTime",{get:function(){return Math.round(this.hr/1e3)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CacheKey",{get:function(){return"z_s_c_"+this.re.appid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"billingTimer",{get:function(){return this.re.streamCenter.billingTimer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasPublishingStream",{get:function(){var e,t=this.ee.publisherList,i=!1;for(var r in t)if(null===(e=t[r].publisher)||void 0===e?void 0:e.Le){i=!0;break}return i},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasPlayingStream",{get:function(){var e,t=this.ee.playerList,i=!1;for(var r in t)if(null===(e=t[r].player)||void 0===e?void 0:e.Le){i=!0;break}return i},enumerable:!1,configurable:!0}),e.prototype.checkIfSupportNTP=function(){var e,t=null===(e=this.re.rtm)||void 0===e?void 0:e.getNetworkInfo().timestamp;t&&(this.Xn.info("zc.sr.cisn use ntp. gap: "+(t-Date.now())),this._useNTP=!0)},e.prototype.bindListener=function(){window.addEventListener("beforeunload",this.beforeunloadListener)},e.prototype.offListener=function(){window.removeEventListener("beforeunload",this.beforeunloadListener)},e.prototype.bindDestroyListener=function(){var e=this;this.re.listenerList._engineDestroy.push((function(){e.Xn.info("".concat(ca," _engineDestroy")),e.streamStoreHandler.resetStorageStores(),e.offListener()}))},e.prototype.updateQualityOrChargeInfo=function(e,t,i){var r,n;this.Xn.info(oa+" update info ".concat(e," ").concat(!!t));var o=this._now();!t||0!==this.publishQualityInfos.length||0!==this.playQualityInfos.length||this.cr&&0!==(null===(r=this.cr)||void 0===r?void 0:r.infos.length)||(this.hr=o,this._saveSpeedLogHead(),0===this.ar&&(this.ar=o)),t&&(e==I.publish_quality?this.handlePublishQualityData(t):e==I.play_quality?this.handlePlayQualityData(t):e==I.charge&&this.handleChargeInfoData(t));var s=this.cr&&this.cr.infos.length>0?JSON.stringify(this.cr).length:0,a=JSON.stringify(this.publishQualityInfos).length+JSON.stringify(this.playQualityInfos).length+s,c=this.publishQualityInfos.length>0||this.playQualityInfos.length>0||(null===(n=this.cr)||void 0===n?void 0:n.infos.length)>0,u=i&&c,l=a>65536,d=0!==this.ar&&o-this.ar>this.uploadInterval;(c&&d||l||u)&&(this.Xn.info(oa+" start upload fire ".concat(l,",").concat(d,",").concat(u)),this.streamQualityUpload(this.hr,u),this.publishQualityInfos=[],this.playQualityInfos=[],this.resetCharges(),this.hr=0,this.ar=o,this.checkHasDataToReport())},e.prototype.checkHasDataToReport=function(){this.Xn.info(ua+" call"),0===Object.keys(this.ee.publisherList).length&&0===Object.keys(this.ee.playerList).length&&!1===this.billingTimer.isReporting&&(this.Xn.warn(ua+" no stream or charge to report"),this.ar=0),this.hasPublishingStream||this.hasPlayingStream||this.billingTimer.shouldSampleCharge()||(this.Xn.warn(ua+" no data to report"),this.ar=0)},e.prototype.streamQualityUpload=function(e,t){var i,r,n,s=(null===(r=null===(i=this.cr)||void 0===i?void 0:i.infos)||void 0===r?void 0:r.length)>0;if(Object.keys(this.ee.publisherList).length>0||Object.keys(this.ee.playerList).length>0||s||t){var a=this._getSpeedLogHead(),c={publish_quality_infos:this.publishQualityInfos,play_quality_infos:this.playQualityInfos,network_type:(0,o.getNetTypeNum)(),client_type:2};this.cr&&(null===(n=this.cr)||void 0===n?void 0:n.infos.length)>0&&(c.charge_infos=JSON.parse(JSON.stringify(this.cr)),this.Xn.info(oa+" upload charges ".concat(JSON.stringify({timestamp:e,chargeInfos:c.charge_infos})))),this.uploadQuality(e,a,c)}},e.prototype._getStreamReportSocket=function(e){var t=this;return new we((function(i,r){var n,s,a,c,u=!1,l=function e(){var r;t.Xn.info(oa+" speed log socket open"),u=!0,t.qualityWebsocket&&i(t.qualityWebsocket),null===(r=t.qualityWebsocket)||void 0===r||r.removeEventListener("open",e)},d=function e(){var i;t.Xn.info(oa+" speed log socket close"),u||r("not open, socket closed"),null===(i=t.qualityWebsocket)||void 0===i||i.removeEventListener("close",e)},h=function e(){var i;t.Xn.info(oa+" speed log socket error"),u||r("not open, socket error"),null===(i=t.qualityWebsocket)||void 0===i||i.removeEventListener("error",e)},p=function(){!function(){var e;null===(e=t.qualityWebsocket)||void 0===e||e.addEventListener("open",l)}(),function(){var e,i;null===(e=t.qualityWebsocket)||void 0===e||e.addEventListener("close",d),null===(i=t.qualityWebsocket)||void 0===i||i.addEventListener("error",h)}()};if(t.qualityWebsocket&&2!=t.qualityWebsocket.readyState&&3!=t.qualityWebsocket.readyState)1==t.qualityWebsocket.readyState?(u=!0,i(t.qualityWebsocket)):p();else{var f=t.re.appid,m=t.re.idName,v=null===(n=t.re.roomList[0])||void 0===n?void 0:n.token;if(!f||!m||!v)return t.Xn.error(oa+" appid userid token not exist"),void r("appid userid token not exist");var g="wss://".concat(e,"/ws/report/stream?appid=").concat(f,"&product=rtc&token=").concat(encodeURIComponent(v),"&id_name=").concat(m);t.qualityWebsocket=(s=g,void 0===(c=1)&&(c=1),(a=o.ZegoExpressWebRTM.proxyCtrl)?a.createSocket(s,c):new WebSocket(s)),p()}setTimeout((function(){u||t.re.engineDestroy||r("not open, timeout, socket closed")}),1e4)}))},e.prototype._createStreamQualityPacket=function(e,t){var i=_d.SpeedLogHead.create(e),r=_d.QualityEvent.create(t),n=_d.SpeedLogHead.encode(i).finish(),o=_d.QualityEvent.encode(r).finish(),s=this.getQualityHead(n,o),a=new Uint8Array(12+n.length+o.length);return a.set(s),a.set(n,12),a.set(o,12+n.length),a},e.prototype._sendMessageWithCallback=function(e,t,i,r,n,o){var s=this,a=!1,c=!1;1!==e.readyState&&!c&&r&&r(),e.onmessage=function(t){var n=t.data;s.Xn.info(oa+" onmessage ".concat(n)),(n+"").includes("success")?(s.Xn.info(oa+" quality (".concat(o||"",") upload success")),!c&&i&&i(),a=!0):(!c&&r&&r(),a=!0),e.onmessage=null},e.send(t),setTimeout((function(){a||(n&&n(),c=!0)}),15e3)},e.prototype.uploadQuality=function(e,t,i,r){this.sendPacketReportData(e,t,i,r)},e.prototype.sendPacketReportData=function(e,t,i,r){var n,o=this,s=null===(n=this.Xn.url)||void 0===n?void 0:n.split("/")[2];if(s){if(this.checkNetworkIsAbnormal())return this.Xn.warn(la+" ".concat(e," network is abnormal")),void this.saveReportPacketsToCache(e,t,i,r);o._getStreamReportSocket(s).then((function(n){if(o.qualityEventSending)return o.Xn.warn(la+" ".concat(e," is sending")),void o.saveReportPacketsToCache(e,t,i,r);var s=Date.now()%1e4;o.qualityEventSending=!0,o.Xn.info(la+" ".concat(e," send message ").concat(s," ").concat(r));var a=o._createStreamQualityPacket(t,i);o._sendMessageWithCallback(n,a,(function(){o.qualityEventSending=!1,o.delStreamData(e),r&&o.streamStoreHandler.removeStoreFromStorage(r),o.checkCachePacketsToReport(!0)}),(function(){o.Xn.info(la+" send message error"),o.qualityEventSending=!1,o.retryReportPackets(e,t,i,r)}),(function(){o.Xn.info(la+" send message timeout"),o.qualityEventSending=!1,o.retryReportPackets(e,t,i,r)}),s),o.Xn.info(la+" upload quality (".concat(s,"), length: ")+a.length+".")})).catch((function(n){"appid userid token not exist"!==n?(o.Xn.info(la+" open socket error, retry upload quality event"),o.retryReportPackets(e,t,i,r)):o.Xn.info(la+" stop retry upload quality event.")}))}},e.prototype.retryReportPackets=function(e,t,i,r){this.Xn.info("zc.sr.rrp.0 retry packets"),this.saveReportPacketsToCache(e,t,i,r),this.checkCachePacketsToReport(!1)},e.prototype.checkCachePacketsToReport=function(e){var t=this;this.packetsSendTimer&&clearTimeout(this.packetsSendTimer),this.retryInterval=e?5e3:6e4,this.packetsSendTimer=setTimeout((function(){var e=t.cacheReportPackets.shift();if(e){var i=e.timeStampKey,r=e._SpeedLogHead,n=e._QualityEvent,o=e.storeName;t.Xn.info("zc.sr.ccptr"+" ".concat(i," ").concat(o)),t.sendPacketReportData(i,r,n,o)}else t.checkStorageDataToReport()}),this.retryInterval)},e.prototype.saveReportPacketsToCache=function(e,t,i,r){this.Xn.info(da+" call ".concat(e)),this.cacheReportPackets.length>=this.cachePacketsSize?this.Xn.info(da+" ".concat(this.cacheReportPackets.length)):this.cacheReportPackets.find((function(t){return t.timeStampKey===e}))||this.cacheReportPackets.push({timeStampKey:e,_SpeedLogHead:t,_QualityEvent:i,storeName:r})},e.prototype.checkStorageDataToReport=function(){return yd(this,void 0,void 0,(function(){var e;return bd(this,(function(t){switch(t.label){case 0:return[4,this.streamStoreHandler.getUnReportCachedDatas(0===this.hr?"":this.hr+"")];case 1:return e=t.sent(),this.uploadUnReportDatas(e),[2]}}))}))},e.prototype.getQualityHead=function(e,t){var i=new Uint8Array(12);i[0]=0,i[1]=12,i[2]=e.length>>8,i[3]=e.length-(i[2]<<8),i[4]=t.length>>24,i[5]=t.length-(i[4]<<24)>>16,i[6]=t.length-(i[4]<<24)-(i[5]<<16)>>8,i[7]=t.length-(i[4]<<24)-(i[5]<<16)-(i[6]<<8);var r=Math.ceil(this._now()/1e3);return i[8]=r>>24,i[9]=r-(i[8]<<24)>>16,i[10]=r-(i[8]<<24)-(i[9]<<16)>>8,i[11]=r-(i[8]<<24)-(i[9]<<16)-(i[10]<<8),i},e.prototype.handlePublishQualityData=function(e){var t=this.publishQualityInfos.find((function(t){return t.stream_id==e.stream_id&&t.video_width==e.frameWidth&&t.video_height==e.frameHeight})),i=this.ee.getRoomByStreamID(e.stream_id);i?(t||(t={stream_id:e.stream_id,session_id:i?Number(i.sessionID):0,video_width:e.frameWidth,video_height:e.frameHeight,infos:[],room_id:i?i.roomID:"",evnvironment:1,room_session_id:i?Number(i.roomSessionID):0,resource_type:2},this.publishQualityInfos.push(t)),t.infos.push({audio_bitrate:Math.round(e.audioBitrate)||0,video_bitrate:Math.round(e.videoBitrate)||0,video_capture_fps:Math.round(10*e.videoFPS)||0,video_network_fps:Math.round(10*e.videoTransferFPS)||0,uplink_plr:e.audioPacketsLostRate,rtt:Math.round(1e3*e.currentRoundTripTime)||0,audio_network_fps:Math.round(10*e.audioFPS),captured_sound_level:Math.round(100*e.audioLevel),sample_time_offset:Math.round((this._now()-this.hr)/10)}),this.saveStreamInfo("publish",t)):this.Xn.info("".concat("zc.hpqd.pu"," room not exist. ").concat(!!i," "))},e.prototype.handlePlayQualityData=function(e){var t,i=this.playQualityInfos.find((function(t){return t.stream_id==e.stream_id&&t.video_width==e.frameWidth&&t.video_height==e.frameHeight})),r=this.ee.getRoomByStreamID(e.stream_id),n=null===(t=this.ee.playerList[e.stream_id])||void 0===t?void 0:t.player;n&&r?(i||(i={stream_id:e.stream_id,session_id:r?Number(r.sessionID):0,video_width:e.frameWidth,video_height:e.frameHeight,infos:[],room_id:r?r.roomID:"",room_session_id:r?Number(r.roomSessionID):0,resource_type:0===(null==n?void 0:n.resourceMode)?2:3},this.playQualityInfos.push(i)),i.infos.push({audio_bitrate:Math.round(e.audioBitrate)||0,video_bitrate:Math.round(e.videoBitrate)||0,video_network_fps:Math.round(10*e.videoFPS)||0,downlink_plr:Math.round(e.audioPacketsLostRate)||0,audio_network_fps:Math.round(10*e.audioFPS)||0,audio_break_duration:Math.round(e.audio_break_duration/10),video_break_duration:Math.round(e.video_break_duration/10),rtt:Math.round(1e3*e.currentRoundTripTime)||0,rendered_sound_level:Math.round(100*e.audioLevel),audio_break_cancel_duration:Math.round(e.audio_break_cancel_duration/10),video_break_cancel_duration:Math.round(e.video_break_cancel_duration/10),audio_decode_time:Math.round(e.audio_decode_time/10),video_decode_time:Math.round(e.video_decode_time/10),real_sampling_interval:Math.round(e.real_sampling_interval/10),video_frames_decoded:Math.round(e.videoFramesDecoded)||0,video_frames_dropped:Math.round(e.videoFramesDropped)||0,sample_time_offset:Math.round((this._now()-this.hr)/10),peer_to_peer_plr:e.peerToPeerPacketLostRate,peer_to_peer_delay:e.peerToPeerDelay}),this.saveStreamInfo("play",i)):this.Xn.info("".concat("zc.hpqd.pl"," player or room not exist. ").concat(!!n," ").concat(!!r," "))},e.prototype.handleChargeInfoData=function(e){var t,i;this.cr||(this.cr={room_id:"",timestamp_offset_begin:0,timestamp_offset_end:0,timestamp_diff_flag:0,timestamp_diff:0,infos:[]}),(null===(t=this.re.roomList[0])||void 0===t?void 0:t.roomID)&&(this.cr.room_id=null===(i=this.re.roomList[0])||void 0===i?void 0:i.roomID);var r=this._now(),n=this.hr;this.Xn.info("".concat(aa," charge ").concat(r," ").concat(n," ").concat(JSON.stringify(e))),0===this.cr.infos.length&&(this.cr.timestamp_offset_begin=Math.round((r-n)/1e3),0!==this.updateChargeTime&&(this.cr.timestamp_diff=Math.round((r-this.updateChargeTime)/1e3),this.cr.timestamp_diff_flag=1,this.Xn.info("".concat(aa," charge time diff ").concat(this.updateChargeTime," ").concat(this.cr.timestamp_diff)))),this.updateChargeTime=r,this.cr.timestamp_offset_end=Math.round((r-n)/1e3),this.cr.infos.push(e),this.saveChargeInfos(this.cr)},e.prototype.supplementChargeTime=function(){0===this.updateChargeTime&&(this.updateChargeTime=this._now(),this.Xn.info("".concat("zc.sr.sct.0"," charge time ").concat(this.updateChargeTime," ")))},e.prototype.resetCharges=function(){this.cr&&(this.cr={room_id:"",timestamp_offset_begin:0,timestamp_offset_end:0,timestamp_diff_flag:0,timestamp_diff:0,infos:[]})},e.prototype.resetChargeTime=function(){this.updateChargeTime=0},e.prototype.stopSampleCharge=function(){this.resetChargeTime(),this.checkHasDataToReport()},e.prototype._saveSpeedLogHead=function(){if(0!==this.hr){var e=this._getSpeedLogHead();this.streamStoreHandler.saveItem(this.hr+"_head",e)}},e.prototype.saveStreamInfo=function(e,t){0!==this.hr&&this.streamStoreHandler.saveItem("".concat(this.hr,"_").concat(e).concat(t.stream_id),t)},e.prototype.saveChargeInfos=function(e){0!==this.hr&&this.streamStoreHandler.saveItem("qec_".concat(this.hr),e)},e.prototype.delStreamData=function(e){var t=this.cacheReportPackets.findIndex((function(t){return t.timeStampKey===e}));t>-1&&(this.Xn.warn("".concat(ca," del cache ").concat(t," ").concat(e)),this.Xn.info("".concat("zc.sr.dsd.0"," ").concat(t," ").concat(e)),this.cacheReportPackets.splice(t,1)),this.clearStoreItems(e+"")},e.prototype.clearStoreItems=function(e){var t=this;this.Xn.info("".concat("zc.sr.csi.0"," clearStoreItems ").concat(e)),this.streamStoreHandler.clearItems(e),setTimeout((function(){t.streamStoreHandler.clearItems(e)}),3e3)},e.prototype._getSpeedLogHead=function(e){var t={version:19,timestamp:e||Math.round(this.hr/1e3),event:0,app_id:this.re.appid,user_id:this.re.idName,biz_type:1,time_offset:Ce.MAX_VALUE,os_type:(0,o.getOsType)(),scenario:100===this.re.scenario?void 0:this.re.scenario,sdk_version:s,report_version:this.re.sdkVerNum};return this.Xn.info("".concat(ca," getSpeedLogHead ").concat(t.timestamp)),t},e.prototype.checkStreamReport=function(){var e=this;this.Xn.info("".concat(ca," check un report call")),this.streamStoreHandler.getStoresFromStorage().forEach((function(t){return yd(e,void 0,void 0,(function(){var e;return bd(this,(function(i){switch(i.label){case 0:return[4,this.streamStoreHandler.getCacheStoreData(t)];case 1:return e=i.sent(),this.Xn.info("".concat(ca," check un report ").concat(t)),this.uploadUnReportDatas(e,t),[2]}}))}))}))},e.prototype.uploadUnReportDatas=function(e,t){var i=this;this.re.roomList.length<=0?this.Xn.warn(sa+" no room"):(null==e?void 0:e.length)>0&&(e.forEach((function(e){var r,n,s=e.timestamp,a=e.head,c=e.publishInfos,u=e.playInfos,l=e.chargeInfos;i.Xn.info("".concat(sa," cacheData ").concat(s," ").concat(JSON.stringify(e)));var d={publish_quality_infos:c,play_quality_infos:u,network_type:(0,o.getNetTypeNum)(),client_type:2};(null===(r=null==l?void 0:l.infos)||void 0===r?void 0:r.length)>0&&(d.charge_infos=JSON.parse(JSON.stringify(l))),t&&(i.Xn.info("".concat(sa," save ").concat(s," ").concat(t)),i.streamStoreHandler.saveItem(s+"_head",a),c.forEach((function(e){i.streamStoreHandler.saveItem("".concat(s,"_publish").concat(e.stream_id),e)})),u.forEach((function(e){i.streamStoreHandler.saveItem("".concat(s,"_play").concat(e.stream_id),e)})),(null===(n=null==l?void 0:l.infos)||void 0===n?void 0:n.length)>0&&i.streamStoreHandler.saveItem("qec_".concat(s),l)),i.Xn.info(oa+" start upload cache quality. ".concat(s)),i.saveReportPacketsToCache(s,a,d)})),t&&this.streamStoreHandler.removeStoreFromStorage(t),this.checkCachePacketsToReport(!0))},e.prototype._now=function(e){var t;return void 0===e&&(e=0),t=this._useNTP?this.re.rtm.getNetworkInfo().timestamp:Date.now(),1===e&&(t=Math.round(t/1e3)),t},e.prototype.checkNetworkIsAbnormal=function(){var e;return(null===(e=this.re.rtm)||void 0===e?void 0:e.isDisConnect())&&this.re.networkState==_.offline?(this.Xn.warn(ha+" offline. "),!0):!this.ee.isNetAgentConnect()&&(this.Xn.warn(ha+" netAgent disconnect. "),!0)},e.prototype.resetReport=function(){var e=this;this.publishQualityInfos=[],this.playQualityInfos=[],this.hr=0,this.ar=0,this.packetsSendTimer&&(clearTimeout(this.packetsSendTimer),this.packetsSendTimer=null),setTimeout((function(){e.qualityWebsocket&&(e.qualityWebsocket.close(),e.qualityWebsocket=void 0,e.qualityEventSending=!1)}),2e4)},e}();function Td(){var e={},t=this,i={init:function(i){importScripts(i),t._ModuleFn(e)},parseToMiniSdp:function(i,r){var n=e._parseToMiniSdp,o=e._getBuffer,s=e.HEAPU8,a=e._free,c=(0,e.allocateUTF8)(i),u=n(c);if(u<0)return t.postMessage({code:u,eventId:r});var l=o(),d=new Uint8Array(s.subarray(l,l+u-1))||new Uint8Array;t.postMessage({code:0,data:d,eventId:r});try{a(c),a(u),a(l)}catch(e){console.error(e)}},loadMiniSdpToOriginSdp:function(i,r){var n,o,s,a=e._loadMiniSdpToSdp,c=e.UTF8ToString,u=e.HEAPU8,l=e._free,d=(0,e._malloc)(i.length);u.set(i,d);for(var h=c(a(d,i.byteLength))||"",p=h.split("\r\n")||[],f=["ice-ufrag","ice-pwd","ice-options","fingerprint","setup","mid","extmap","sendrecv","sendonly","recvonly","inactive","rtpmap","rtcp-fb","fmtp","ssrc","candidate","msid"];p.length;){var m=p.length,v=null===(o=null===(n=p[m-1])||void 0===n?void 0:n.split("=")[1])||void 0===o?void 0:o.split(":")[0];if(-1!=(null===(s=p[m-1])||void 0===s?void 0:s.indexOf("="))&&f.includes(v))break;p.pop()}h=p.join("\r\n"),t.postMessage({code:0,data:h+="\r\n",eventId:r});try{l(d)}catch(e){console.error(e)}}};onmessage=function(e){i[e.data.command]?i[e.data.command](e.data.val,e.data.eventId):console.error("the command is invalid")}}var Ed,Cd=__webpack_require__(6531).G,wd=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Id=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Rd=function(){function e(){var e=this;this.msgSuccessCallBack={},this.seq=1;var t=Td.toString().trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1],i=URL.createObjectURL(new window.Blob([t],{type:"text/javascript"}));this.worker=new Worker(i);var r=fo("XQAAgAB1lQUAAAAAAAA7GEqmJp5C8XSHNxuPdDQkJ0d7U73umXLRdac4qETE5iPCTjoSE73i771hoPk5TOB/XoLJ2Mr9bf8R9bqBM3VKmrHUoYXNcNe1C9E+84UuU3hACbZVn6eHVws3j2YGVj8ZsSv0+O33aof+oXDSuPgBA6LzXd9odr3PrAdr/wu3npZRkHtWTlzD7n3xT4UkcrgXW9A/z1FvO7r63ejHh9xDcTN+bx12nPXB6+O0MG6agODXmgxb+e7VLShr3ekChGKjOQ1cWZyxOYIJVjnWuh5Y0rQdJBEV6ubDWz+ACSC0eZqJll4WMMazHZwpqq5Xf+7e+EirgP8zqOA4NHK2wGjnHmHtn0jiRY/0YEeHmTnU68q8x/3S9t9n5kYiXtaxQmjcoqK4e1zO78z102YXZ+fa3V9x56/bjf4xW47bGmnT1jcCl+E5p6J2LOzTQ890p72lsKpec3OzBreZwJlX1+NHQq0R9Y4jD8QaorZtcnGb53iP6u90lB1NNasUSqwJv0+HN+WfcvVvPHnp25ytGqXvEk099Wf3cFKMTuh92yRajMVGjP/3rxdL7KRy+lZ5W8OyXt4mgTbvF9fYeb8PHK+XkvBujFD22nA0dmU0ZaJMjX4+XSv6G9ltBdmmtmGZbVWzCuZxmab4LYyaacK1MUVPSe92FBNo9mhnA9AYn03AGkXeP9srt47TTF7OhZZb/2w3aoxZgyw3j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h9Lz2BFCmzFd+MIrkBpPgHd/ZaD7gv9OL6x7cS4tpI/jreUP3U8YZ++YBIka8iJqe+JKmgzigWXJYd+BC3gozKv9tZ8ApSNK8hnYMm8I2r2dEqqqsf3RwofnB5bPueqfcjg38DmwBMg/kt3lQc4n2qfizU/FMNajABkH5lKQ6/7oS/dyuRJ+QrEdbKBJUfEi4bkIeQ2fdXDjts6mlv35YTny8jL9Up/nMoF7Z4ULVHEU2mAM/LDNhiWBxZCJafcgXB64h14YjbupQjFrOBownExuKFm6da0XOkMDwpL5Id8Xf2jqu9muVshuPN3dLlciS/An3VvRiSg/xfTx0j5wNQaPA6L/tgJ4AfdnLgAC6FS9nyExikgT7tKSb/y7zEjvCub2HwmS1a03A1EjpdSRvn8YT7LYDkIsR/ePH98nEFlCV3vroD+PGUvG3m/sq9seQqmoOJWWRl/s9BM8MjfgKnIOV1nm4SOioSR617sebdzp++PGSD7RlIfuvxfFGCK3U3jlU3wMkePdm1ZnQSQj+yD1707A+aEFogfxrknNCBL066z2vjQYRLCOBL9f//6YVR+g=="),n=Cd.decompress(Array.from(r)),o=URL.createObjectURL(new window.Blob([n],{type:"text/javascript"}));this.worker.postMessage({command:"init",val:o}),this.worker.onmessage=function(t){var i=t.data;i.eventId&&fn(e.msgSuccessCallBack[i.eventId])&&(e.msgSuccessCallBack[i.eventId]({code:i.code,data:i.data}),delete e.msgSuccessCallBack[i.eventId])},this.worker.onmessageerror=function(e){console.error("Error receiving message from worker: ".concat(e))},this.worker.onerror=function(e){console.error(e)}}return e.prototype.messageHandler=function(e){var t=this;return new we((function(i){Math.floor(10*Math.random()),e.eventId="".concat(e.command,"_ \n ").concat(t.seq++),t.worker.postMessage(e),t.msgSuccessCallBack[e.eventId]=function(e){i(e)}}))},e.prototype.parseToMiniSdp=function(e){return wd(this,void 0,void 0,(function(){var t=this;return Id(this,(function(i){return[2,new we((function(i,r){return wd(t,void 0,void 0,(function(){var t,n;return Id(this,(function(o){switch(o.label){case 0:return ln(e)&&e?[4,this.messageHandler({command:"parseToMiniSdp",val:e})]:(r(et),[2]);case 1:if(0===(t=o.sent()).code)i(t.data);else{switch(n=void 0,t.code){case-1:n=Ot;break;case-2:n=Mt;break;case-3:n=Lt}r(n)}return[2]}}))}))}))]}))}))},e.prototype.loadMiniSdpToOriginSdp=function(e){return wd(this,void 0,void 0,(function(){var t=this;return Id(this,(function(i){return[2,new we((function(i,r){return wd(t,void 0,void 0,(function(){var t;return Id(this,(function(n){switch(n.label){case 0:return vn(e)?[4,this.messageHandler({command:"loadMiniSdpToOriginSdp",val:e})]:(r(et),[2]);case 1:return 0==(t=n.sent()).code&&i(t.data),[2]}}))}))}))]}))}))},Object.defineProperty(e,"isSupported",{get:function(){return!(!window.WebAssembly||!window.Worker)},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){this.worker.terminate()},e}();!function(e){e.SAVED_CHARGEINFO_REPORT="zc.bill.scir",e.CHARGEINFO_SAVING_LOCALSTORAGE="zc.bill.cisl",e.CHARGEINFO_GET_AND_REMOVE_LOCALSTORAGE="zc.bill.cigrl",e.START_CHARGE_INFO_TIMER="zc.bill.tm.scit"}(Ed||(Ed={}));var kd=function(){function e(e,t){this.Xn=e,this.re=t,this._chargeInfosSampleInterval=5e3,this.reporting=!1}return Object.defineProperty(e.prototype,"ee",{get:function(){return this.re.streamCenter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"streamReport",{get:function(){var e;return null===(e=this.ee)||void 0===e?void 0:e.streamReport},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasPublishingStream",{get:function(){var e,t=this.ee.publisherList,i=!1;for(var r in t)if(null===(e=t[r].publisher)||void 0===e?void 0:e.Le){i=!0;break}return i},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasPlayingRTCStream",{get:function(){var e,t=this.ee.playerList,i=!1;for(var r in t)if((null===(e=t[r].player)||void 0===e?void 0:e.Le)&&0===t[r].player.resourceMode){i=!0;break}return i},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shouldEndSampleCharge",{get:function(){var e,t,i,r;return!this.ee||!!this.reporting&&(this.shouldReportRoomTime?0===(null===(e=this.re.rtm)||void 0===e?void 0:e.stateCenter.roomModulesList.filter((function(e){return!e.isLogout()||!e.isDisConnect()})).length):0===(null===(t=this.re.appConfig.speedlog_config)||void 0===t?void 0:t.charge_info_report_mode)?0===Object.keys(null===(i=this.ee)||void 0===i?void 0:i.publisherList).length:0===Object.keys(null===(r=this.ee)||void 0===r?void 0:r.playerList).length)},enumerable:!1,configurable:!0}),e.prototype.report=function(e){var t,i,r;if(void 0===e&&(e=!1),this.Xn.info("zc.bill.tm.r.0 call"),this.ee){if(e)return this.Xn.info("zc.bill.tm.r.0 stop"),void(null===(t=this.streamReport)||void 0===t||t.updateQualityOrChargeInfo(I.charge,void 0,!0));if(!this.shouldSampleCharge())return this.Xn.info("zc.bill.tm.r.0 not sample charge"),null===(i=this.streamReport)||void 0===i||i.updateQualityOrChargeInfo(I.charge,void 0),void this.streamReport.resetChargeTime();var n=this.samplingChargeInfos();null===(r=this.streamReport)||void 0===r||r.updateQualityOrChargeInfo(I.charge,n)}else this.Xn.info("zc.bill.tm.r.0 no stream center")},e.prototype.shouldStartReportCharge=function(){if(!this.re.appConfig)return this.Xn.info("zc.bill.ssrc.0 no app config"),!1;var e=this.re.appConfig.speedlog_config.charge_info_report_cycle;return this.Xn.info("zc.bill.ssrc.0 speedlog config ".concat(JSON.stringify(this.re.appConfig.speedlog_config))),!(!un(e)||0===e)&&(this._chargeInfosSampleInterval=1e3*e,!0)},e.prototype.shouldSampleCharge=function(){var e,t,i=this;if(!this.re.appConfig)return this.Xn.info("zc.bill.ssc.0 no app config"),!1;var r=this.re.appConfig.speedlog_config,n=r.charge_info_report_mode,o=r.charge_info_report_no_playing,s=!1,a=null===(e=this.re.rtm)||void 0===e?void 0:e.stateCenter.roomModulesList.filter((function(e){return!e.isLogout()})),c=function(e){return 1===e||i.hasPublishingStream};return 1===o?0!==(null==a?void 0:a.length)&&(this.hasPlayingRTCStream||0===Object.keys(null===(t=this.ee)||void 0===t?void 0:t.playerList).length)&&(s=c(n)):0!==o&&void 0!==o||!this.hasPlayingRTCStream||(s=c(n)),s},Object.defineProperty(e.prototype,"shouldReportRoomTime",{get:function(){var e,t,i,r;return!(!(null===(e=this.re.rtm)||void 0===e?void 0:e.stateCenter.appConfig)||!(null===(t=this.re.rtm)||void 0===t?void 0:t.stateCenter.appConfig.speedlog_config)||0===(null===(i=this.re.rtm)||void 0===i?void 0:i.stateCenter.appConfig.speedlog_config.charge_info_report_cycle)||1!==(null===(r=this.re.rtm)||void 0===r?void 0:r.stateCenter.appConfig.speedlog_config.charge_info_report_no_playing))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isReporting",{get:function(){return this.reporting},enumerable:!1,configurable:!0}),e.prototype.startChargeInfoTimer=function(){var e=this;if(this._chargeInfosTimer&&(clearTimeout(Number(this._chargeInfosTimer)),this._chargeInfosTimer=null,this.shouldEndSampleCharge))return this.Xn.info(Ed.START_CHARGE_INFO_TIMER+" chargeinfos timer report ended"),void(this.reporting=!1);this._chargeInfosTimer=setTimeout((function(){e.report(),e.startChargeInfoTimer()}),this._chargeInfosSampleInterval)},e.prototype.supplementPlayingChargeTime=function(){this.reporting&&this.streamReport.supplementChargeTime()},e.prototype.startChargeInfosUpload=function(){this.shouldStartReportCharge()&&(this.reporting||(this.reporting=!0,this.shouldReportRoomTime&&this.report(),this.startChargeInfoTimer(),this.Xn.info("zsc.sciu.0 call")))},e.prototype.stopChargeInfosUpload=function(){this.Xn.info("zsc.sciu.1 call"),this._chargeInfosTimer&&this.shouldEndSampleCharge&&(this.Xn.info("zsc.sciu.1 stop"),clearTimeout(Number(this._chargeInfosTimer)),this._chargeInfosTimer=null,this.shouldReportRoomTime&&this.report(!0),this.reporting=!1,this.streamReport.stopSampleCharge(),this.Xn.info("zsc.sciu.1 chargeinfos timer report ended"))},e.prototype.destroy=function(){this.Xn.info("zsc.ds.0 call"),this._chargeInfosTimer&&(clearTimeout(Number(this._chargeInfosTimer)),this._chargeInfosTimer=null),this.reporting=!1},e.prototype.samplingChargeInfos=function(){this.Xn.info("zsc.cci.0 call");var e={is_publishing:0,play_max_audio_bitrate:0,play_stream_resolution_infos:[]};this.shouldReportRoomTime&&(e.no_playing=1);var t=this.ee,i=t.publisherList,r=t.playerList;for(var n in i){6===i[n].publisher.state&&(e.is_publishing=1);break}e.play_max_audio_bitrate=0;var o=function(t){var i={width:r[t].player.qualityHandler.lastPlayStats.frameWidth,height:r[t].player.qualityHandler.lastPlayStats.frameHeight},n={video_width:i&&i.width?i.width:0,video_height:i&&i.height?i.height:0,count:1};if(!e.play_stream_resolution_infos.find((function(e){return e.video_width==n.video_width&&e.video_height==n.video_height&&(e.count++,!0)}))&&e.play_stream_resolution_infos.push(n),0==n.video_width&&0==n.video_height){var o=r[t].player.qualityHandler.lastPlayStats.audioBitrate;o>e.play_max_audio_bitrate&&(e.play_max_audio_bitrate=Math.round(o))}};for(var s in r)o(s);return 0!==e.play_stream_resolution_infos.length&&this.shouldReportRoomTime&&(e.no_playing=0),e},e}(),Pd=function(){function e(){this.trackStopTimeMap={},this.trackMaxStop2EndedDelayMs=500}return e.prototype.isTrackStopBySDK=function(e){return void 0!==this.trackStopTimeMap[e.id]&&performance.now()-this.trackStopTimeMap[e.id]<=this.trackMaxStop2EndedDelayMs},e.prototype.recordStopTrack=function(e){e&&(this.trackStopTimeMap[e.id]=performance.now())},e}(),Ad=function(){function e(e){this.logger=e,this.deviceCaptureExceptionDetection=new Pd}return e.prototype.isTrackStopBySDK=function(e){return this.deviceCaptureExceptionDetection.isTrackStopBySDK(e)},e.prototype.stopTrack=function(e){e&&(this.logger.info("zc.tk.ut track "+e.id+" stop"),this.deviceCaptureExceptionDetection.recordStopTrack(e),e.stop())},e}();function Dd(){var e=this,t=243,i=new Uint8Array([0,0,0,1,101,184,0,4,0,0,9,255,254,222,35,192,166,30,73,128]),r=new Uint8Array([0,0,0,1,103,77,64,51,140,141,78,64,60,34,17,168,0,0,0,1,104,238,60,128]),n={},o={},s={},a={},c=function(){function e(e){this.view=e,this.offset=0,this.current_start_code_size=0,this.current_nalu_start=0,this.current_nalu_size=0,this.start_code_size=0,this.nalu_start=0,this.left_size=0,this.nalu_size=0,this.left_size=e.byteLength}return e.prototype.FindStartCode=function(){var e=this.view.byteLength-this.offset;for(this.current_start_code_size=0,this.current_nalu_start=-1;e>=3;){if(0==this.view.getUint8(this.offset)&&0==this.view.getUint8(this.offset+1)&&1==this.view.getUint8(this.offset+2))return this.current_start_code_size=3,this.current_nalu_start=this.offset,this.offset-1>=0&&0==this.view.getUint8(this.offset-1)&&(++this.current_start_code_size,--this.current_nalu_start),this.offset+=3,!0;--e,++this.offset}return!1},e.prototype.FindNalu=function(){return this.start_code_size=0,this.nalu_start=0,this.nalu_size=0,!(this.offset>=this.view.byteLength)&&!!this.FindStartCode()&&(this.start_code_size=this.current_start_code_size,this.nalu_start=this.current_nalu_start,!0)},e.prototype.NextNalu=function(e){return this.start_code_size=0,this.nalu_start=0,this.nalu_size=0,!(this.offset>=this.view.byteLength)&&(!!this.FindStartCode()&&(this.start_code_size=this.current_start_code_size,this.nalu_start=this.current_nalu_start,!(!e||6==(31&this.view.getUint8(this.nalu_start+this.start_code_size)))||(this.FindStartCode()?(this.offset=this.current_nalu_start,this.nalu_size=this.current_nalu_start-this.nalu_start,!0):(this.nalu_size=this.view.byteLength-this.nalu_start,!0))))},e}();function u(e,t){void 0===t&&(t=0);for(var i=e.length,r=[],n=0;n<i;)n>=t&&i-n>=3&&!e[n]&&!e[n+1]&&3==e[n+2]?(r.push(e[n++]),r.push(e[n++]),n++):r.push(e[n++]);var o=new Uint8Array(r);return{output:o,outLength:o.length}}function l(e){var t=0,i=0;return t=e[i++]<<24,t|=e[i++]<<16,t|=e[i++]<<8,t|e[i++]}function d(e,i,r){var n=e.byteLength,o=parseInt(n/255),s=n%255,a=new ArrayBuffer(1+(o+1)+n+1),c=new DataView(a),u=0;c.setUint8(u++,1===i?5:t);for(var l=0;l<o;l++)c.setUint8(u++,255);c.setUint8(u++,s);var d=new DataView(e);for(l=0;l<(null==e?void 0:e.byteLength);l++)c.setInt8(u++,d.getInt8(l));c.setInt8(u++,128);var h=new Uint8Array(a),p=h;if(r){var f=function(e){for(var t=[],i=e.length,r=0,n=0;n<i;++n){var o=e[n];o<=3&&r>=2&&(t.push(3),r=0),t.push(e[n]),0==o?++r:r=0}var s=new Uint8Array(t);return{output:s,outLength:s.length}}(h).output;p=f}return{rbspView:p,ebspLength:p.length}}function h(s,a,h,p,f){var m=void 0,v=f[p],g=v.isLowStream,y=v.kind;if(y=y||"video",g=g||!1,"encode"===s?m=function(e,t){"audio"===y?t.enqueue(e):v.onlyAudio?function(e,t,o,s){var a=n[o];if(a){var c=s?a.lowStreamSideInfos:a.sideInfos,u=0,l="key"===e.type,h=performance.now(),p=0,f=[];if(c.length>0){for(var m=c.length>=9?9:c.length,v=0;v<m;v++){var g=d(c[v],a.type,a.emulationPreventionByte);p+=5+(w=g.ebspLength),f.push(g)}s?a.lowStreamSideInfos=[]:a.sideInfos=[],h-a.recvLastKeyFrameTime>2e3&&(l=!0)}l&&(u=r.length+i.length);var y=new ArrayBuffer(p+u),b=new DataView(y),_=0;if(l)for(var S=new DataView(r.buffer),T=0;T<r.length;T++)b.setInt8(_++,S.getInt8(T));for(v=0;v<f.length;v++){var E=f[v],C=E.rbspView,w=E.ebspLength;b.setUint8(_++,0),b.setUint8(_++,0),b.setUint8(_++,0),b.setUint8(_++,1),b.setUint8(_++,6);for(var I=0;I<w;I++)b.setInt8(_++,C[I-0])}if(l){var R=new DataView(i.buffer);for(T=0;T<i.length;T++)b.setInt8(_++,R.getInt8(T))}e.data=y,l&&(a.recvLastKeyFrameTime=h),t.enqueue(e)}else t.enqueue(e)}(e,t,p,g):function(e,t,i,r){var o=n[i];if(o){var s=r?o.lowStreamSideInfos:o.sideInfos;if(s.length>0){for(var a=new DataView(e.data),u=[],l=0,h=0;h<s.length;h++){var p=d(s[h],o.type,o.emulationPreventionByte);l+=5+(k=p.ebspLength),u.push(p)}r?o.lowStreamSideInfos=[]:o.sideInfos=[];for(var f=new ArrayBuffer(l+e.data.byteLength),m=new DataView(f),v=0,g=new c(a),y=0,b=!1,_=!1,S=0;g.NextNalu();){S++;var T=31&a.getUint8(g.nalu_start+g.start_code_size);if(7==T)b=!0,y+=g.nalu_size;else if(8==T)_=!0,y+=g.nalu_size;else if(9==T)continue;if(b&&_)break}for(var E=0;E<y;E++)m.setInt8(v++,a.getInt8(E));var C=10-S,w=u.length>=(C=C>0?C:0)?C:u.length;for(h=0;h<w;h++){var I=u[h],R=I.rbspView,k=I.ebspLength;m.setUint8(v++,0),m.setUint8(v++,0),m.setUint8(v++,0),m.setUint8(v++,1),m.setUint8(v++,6);for(var P=0;P<k;P++)m.setInt8(v++,R[P-0])}for(E=y;E<e.data.byteLength;E++)m.setInt8(v++,a.getInt8(E));new Uint8Array(f),e.data=f}t.enqueue(e)}else t.enqueue(e)}(e,t,p,g)}:"decode"===s&&(m=function(i,r){"audio"===y?r.enqueue(i):function(i,r,n){var s=o[n],a=s&&"VP8"!==s.codec;if(a){var d=s.firstFrame;if(d){if(d.buffer)if(i.timestamp-d.time<20){var h=function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var i=0;i<e.byteLength;i++)if(e[i]!==t[i])return!1;return!0}(new Uint8Array(i.data),d.buffer);h&&(a=!1)}else d.buffer=void 0}else s.firstFrame={buffer:new Uint8Array(i.data),time:i.timestamp}}if(a){for(var p=new DataView(i.data),f=0,m=new c(p),v=0,g=!1;m.NextNalu(g);)if(7!=(v=31&p.getUint8(m.nalu_start+m.start_code_size))&&8!=v&&9!=v){if(6!=v)break;var y=new Uint8Array(i.data).slice(m.nalu_start+m.start_code_size,m.nalu_start+m.start_code_size+m.nalu_size);s.emulationPreventionByte&&(y=u(y).output),f=1,g=!0;for(var b=0;255===y[f];)b+=255,f++;if((b+=y[f++])===t||5===b||100===b){for(var _=0;255===y[f];)_+=255,f++;if(_+=y[f++],i.data.byteLength-f<_)break;var S=new Uint8Array(4+_);switch(S[0]=0,S[1]=0,b){case 100:S[2]=3,S[3]=235;break;case 5:S[2]=3,S[3]=236;break;case t:S[2]=3,S[3]=237}for(var T=0;T<_;T++)S[4+T-0]=y[f++];var E=!1;if(b===t)E=!0;else if(5===b){var C=s.unregisterSeiFilter;if(C){var w,I=S.slice(4,4+s.filterSize),R=!0;if(0===(w="string"==typeof C?Uint8Array.from(Array.from(unescape(encodeURIComponent(C))).map((function(e){return e.charCodeAt(0)}))):C).length)R=!1;else for(var k=0;k<w.length;k++)if(w[k]!==I[k]){R=!1;break}E=R}else E=!0}E&&e.postMessage({cmd:"recvSEI",streamID:n,buffer:Array.from(S)})}else if(244===b){for(_=0;255===y[f];)_+=255,f++;if(_+=y[f++],i.data.byteLength-f<_)break;var P=parseInt(_/5+""),A=y.slice(f,f+=_),D=[];for(k=0;k<P;k++){var N=5*k,O=A.slice(N,N+4),M=A.slice(N+4,N+5),L=l(O);D.push({soundLevelID:L,value:M[0]})}e.postMessage({cmd:"mixSoundLevel",soundLevelList:D,streamID:s.streamID})}}r.enqueue(i)}else r.enqueue(i)}(i,r,p)}),m){var b=new TransformStream({transform:m});a.pipeThrough(b).pipeTo(h)}}function p(e){var t=n[e];return t||(n[e]={streamID:e,sideInfos:[],lowStreamSideInfos:[],type:243,emulationPreventionByte:!1,recvLastKeyFrameTime:0},n[e])}function f(e){var t=o[e];return t||(o[e]={streamID:e,emulationPreventionByte:!1,codec:"",unregisterSeiFilter:"",filterSize:0},o[e])}function m(e){var t=e.cmd;if("encode"===t){var i=e.readable,r=e.writable,n=e.streamID,o=e.type,c=e.isLowStream,u=e.emulationPreventionByte,l=e.onlyAudio;if("audio"!==(m=e.kind)){var d=p(n);d.type=o,d.emulationPreventionByte=u}s[n]={isLowStream:c,kind:m,onlyAudio:l},h(t,i,r,n,s)}else if("decode"===t){i=e.readable,r=e.writable,n=e.streamID,u=e.emulationPreventionByte;var m,v=e.codec,g=e.unregisterSeiFilter,y=e.filterSize;if("audio"!==(m=e.kind)){var b=f(n);b.emulationPreventionByte=u,b.codec=v,b.unregisterSeiFilter=g,b.filterSize=y}a[n]={isLowStream:!1,kind:m},h(t,i,r,n,a)}}onmessage=function(t){var i=t.data,r=i.cmd;try{switch(r){case"encode":case"decode":m(i);break;case"updatePlayer":var c=i.codec;f(g=i.streamID).codec=c;break;case"pushSideInfo":var u=i.buffer,l=i.hasLowStream,d=i.maxLength,h=p(g=i.streamID);h.sideInfos.length>d?console.error("Send SEI Failed. The number of inserted sei exceeds the limit."):(h.sideInfos.push(u),l&&h.lowStreamSideInfos.push(u));break;case"publishStreamType":var v=s[g=i.streamID];v&&(v.onlyAudio=i.onlyAudio);break;case"clear":var g=i.streamID;"push"==i.type?(delete n[g],delete s[g]):(delete a[g],delete o[g])}}catch(t){e.postMessage({cmd:"error",error:t})}},e.RTCTransformEvent&&(e.onrtctransform=function(e){var t=e.transformer;m(Object.assign({readable:t.readable,writable:t.writable},t.options))})}var Nd,Od=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Md=function(){return Md=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Md.apply(this,arguments)},Ld=pl.webrtc_cmd;!function(e){e[e.NotReUse=0]="NotReUse",e[e.TheSameReUse=1]="TheSameReUse",e[e.DiffReUse=2]="DiffReUse",e[e.AllReUse=3]="AllReUse"}(Nd||(Nd={}));var xd=li,Ud=xd.event,Bd=xd.error,zd=Ti,qd=zd.event,Xd=zd.error,Hd=m.frameRate,Fd=m.bitRate,Vd=function(e){function t(t,i,r,n,o,s){var a,c,u=this;return(u=e.call(this)||this).Xn=t,u.re=i,u.dataReport=r,u.rtm=n,u.acMgr=o,u.geo=s,u.testEnvironment=!1,u.playModule=null,u.heartbeatTimer=null,u.heartbeatInterval=1e4,u.trackUtils=new Ad(u.Xn),u.qualityTimerInterval=3e3,u.qualityUploadInterval=3e3,u.previewStreamList=[],u.signalList={},u.soundLevelDelegate=!1,u.soundLevelInterval=1e3,u.enableInBackground=!1,u.isPeer=!0,u.probeList={},u.probingList={},u.isMicEnabled=!0,u.isDataChannelEnabled=!1,u.targetQuality=U.MiddleMinQuality,u.probeInterval=6e4,u.nodeProbeInterval=3e5,u.gwNode="",u.playerList={},u.stopedPlayerList={},u.publisherList={},u.playSuccessCallBackList={},u.playErrorCallBackList={},u.waitPublishList=[],u.waitPlayList=[],u.autoSwitchProtocol=!0,u.udpFailNum=0,u.maxUdpFailNum=2,u.qualityInterval=3e3,u.switchScore=60,u.defaultBadQualityTime=3e4,u.l3BadQualityTime=1e4,u.switchDetectResultScore=60,u.cdnBadQualityScore=60,u.l3BadQualityScore=60,u.multiPlaySwitchRate=.8,u.protocolBadQualityCount=3,u.protocolBadQualityTime=12e3,u.protocolQualityCacheExpiredTime=18e4,u.fallbackInhibitionTime=18e4,u.probeExpiredTime=3e4,u.minProbeInterval=15e3,u.l3DetectedTimestamp=0,u.l3DetectResult=0,u.isL3Fallback=!1,u.cdnProtocolBadTimestamp=0,u.l3ProtocolBadTimestamp=0,u.lastHandleCDNBadTimestamp=0,u.lastHandleL3BadTimestamp=0,u.cdnProtocolBadTime=0,u.l3ProtocolBadTime=0,u.probeStartedNum=3,u.cachedGwNodesList={},u.cachedGwNodesMode=Nd.TheSameReUse,u.txQuality=-1,u.rxQuality=-1,u.isRegisterQualityPush=!1,u.netTimer=null,u.maxProbeNum=3,u.useCopyMusic=!1,u.playEventKeys={},u.isCustomVC=!1,u.defaultVideoMuted=!1,u.defaultAudioMuted=!1,u.lazyEndSignalHandler=(c={},{isLazyEnd:function(){return!0},startLazyEndTimer:function(e,t){c[e]&&clearTimeout(c[e].timer),c[e]={},c[e].callback=t,c[e].timer=setTimeout((function(){t(),delete c[e]}),9e4)},clearLazyEndTimer:function(e){c[e]&&(clearTimeout(c[e].timer),delete c[e])},endAll:function(){for(var e in c)clearTimeout(c[e].timer),c[e].callback(),delete c[e]},hasEndTask:function(e){return!!c[e]},end:function(e){c[e]&&(clearTimeout(c[e].timer),c[e].callback(),delete c[e])}}),u.miniSdpWorker=null,u.tryCountConnectInterval=3e3,u.checkMessageTimeout=function(){for(var e in u.signalList)u.signalList[e].signal&&u.signalList[e].signal.checkMessageTimeout()},u.getAllInUseUrl=function(){var e=[];for(var t in u.signalList)e.push(t);return e},u.onDisconnectHandle=function(e,t){if(u.Xn.info("zsc.od.0 call"),u.signalList[e]){for(var i=u.signalList[e],r=0;r<i.publishConnectedList.length;r++){var n=u.publisherList[i.publishConnectedList[r]];n&&n.publisher&&n.publisher.onDisconnect(t)}for(r=0;r<i.playConnectedList.length;r++){var o=u.playerList[i.playConnectedList[r]];o&&o.player&&o.player.onDisconnect(t)}delete u.signalList[e],u.stopSignalHeartbeat(),u.billingTimer.stopChargeInfosUpload(),u.stopSoundLevel()}},u.onReconnectHandle=function(e){var t;for(var i in u.Xn.info("zsc.orh.0 call"),u.publisherList){var r=u.publisherList[i].publisher,n=u.publisherList[i].retryStreamHandler;7==r.state||r.stateNego!==L.iceConnected?!n.isOverTime&&n.publishStateHandle(1,i,Bd.Gi):6==r.state&&n.stopMaxTime()}for(var i in u.playerList){var o=u.playerList[i],s=o.player;n=o.retryStreamHandler,(null===(t=s.signal)||void 0===t?void 0:t.server)===e&&(7==s.state||o.playMode!==z.CDN&&s.stateNego!==g.iceConnected?!n.isOverTime&&n.playStateHandle(1,i,Xd.Nn):6==s.state&&n.stopMaxTime())}},u.eventHandler={visibilitychange:function(){!u.enableInBackground&&u.soundLevelDelegate&&(Ie.hidden?(u.soundLevelTimer&&clearTimeout(u.soundLevelTimer),u.soundLevelTimer=null,u.enableSoundLevelProcessor(!1)):(u.enableSoundLevelProcessor(!0),u.activeSoundLevel(),"suspended"===u.ac.state&&u.ac.resume()))}},u.isNotSupportSeiWorker=!1,u.turnServers=void 0,u.checkDeviceChange=void 0,u.rtm._on("_roomStateUpdate",(function(e,t){for(var i in u.playerList){var r=u.playerList[i],n=r.cdnPlayer,o=r.player;r.room.roomID==e&&n&&6===o.state&&r.playMode==z.CDN&&("CONNECTED"==t?(o.CDNBrokenCnt++,u.isZegoExpressPlayer(n)?n.resume():(n.canRetry=!0,n.retry())):"DISCONNECTED"===t&&u.stopPlayingStream(i))}})),Ie.addEventListener("visibilitychange",u.eventHandler.visibilitychange),u.streamReport=new Sd(t,i,u),null===(a=u.rtm.netAgent)||void 0===a||a.on("clientInfo",(function(e){var t;u.re.accessClientIp&&(null==e?void 0:e.clientIP)&&u.re.accessClientIp!==e.clientIP&&(u.Xn.info(vs+" client ip changed "+u.re.accessClientIp+" "+e.clientIP),u.lr(u.publisherList,!0),u.lr(u.playerList,!1),u.probeList={}),u.re.accessClientIp=e.clientIP,un(null==e?void 0:e.timeOffset)&&(u.re.clientTimeOffset=null==e?void 0:e.timeOffset),u.updateTimeOffsetInterval(),u.re.accessClientIp=e.clientIP,null===(t=u.streamReport)||void 0===t||t.checkIfSupportNTP()})),u}return Od(t,e),Object.defineProperty(t.prototype,"ac",{get:function(){return this.acMgr.ac},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isProxy",{get:function(){return!!(o.ZegoExpressWebRTM.proxyCtrl&&!0!==this.re.engineConfig.notProxyRTC||this.isLocalProxy)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLocalProxy",{get:function(){return!!this.turnServers},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ve",{get:function(){return this.re.reporter},enumerable:!1,configurable:!0}),t.setCloseNetProbe=function(e){t.closeNetProbe=e},t.prototype.lr=function(e,t){var i=this,r="zc.rgnds";Me(this.Xn,r);var n=null;for(var o in e)n=t?e[o].publisher:e[o].player;n&&(n.resetGwNodes(),this.clearCachedGwNodesList(n,t),Object.keys(this.probingList).forEach((function(e){return i.probingList[e].ipChange=!0})),this.stopNetProbe(n),xe(this.Xn,r))},Object.defineProperty(t.prototype,"billingTimer",{get:function(){return this._billingTimer||(this._billingTimer=new kd(this.Xn,this.re)),this._billingTimer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraPreviewStream",{get:function(){return this.previewStreamList.find((function(e){return"camera"===e.previewType}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"microphonePreviews",{get:function(){return this.previewStreamList.filter((function(e){return"camera"===e.previewType&&e.micTrack}))},enumerable:!1,configurable:!0}),t.prototype.initMiniSdpWorker=function(e){var t;e&&Rd.isSupported?this.miniSdpWorker=this.miniSdpWorker||new Rd:(null===(t=this.miniSdpWorker)||void 0===t||t.destroy(),this.miniSdpWorker=null)},t.prototype.onSignalDisconnected=function(e){},t.prototype.setQualityMonitorCycle=function(e){var t=this;return this.Xn.debug("zsc.qmc.0 timeInterval "+e),0==Object.keys(this.publisherList).length?this.qualityTimerInterval=e:Object.keys(this.publisherList).forEach((function(i){t.publisherList[i].publisher.qualityTimeInterval=e,t.publisherList[i].publisher.qualityHandler.setPublishQualityTimer()})),!0},t.prototype.setSessionInfo=function(e,t,i){this.Xn.debug("zsc.ssi.0 called"),this.appid=e,this.userid=t,this.testEnvironment=i},t.prototype.onPlayStateUpdate=function(e,t,i,r){},t.prototype.onPlayQualityUpdate=function(e,t){},t.prototype.onPublishStateUpdate=function(e,t,i){},t.prototype.onPublishQualityUpdate=function(e,t){},t.prototype.onUpdateHeartBeatIntervalHandle=function(e){e!=this.heartbeatInterval&&(this.Xn.debug("zsc.uhb.0 update "+e),this.heartbeatTimer&&(clearTimeout(this.heartbeatTimer),this.heartbeatTimer=null),this.heartbeatInterval=e,this.startSignalHeartbeat())},t.prototype.setPublishStateStart=function(e,t,i,r,n,o){var s,a,c=this;this.Xn.info("zsc.pss.0 call "+t);var u=this.checkPreview(i);if(!u)return this.Xn.error("zsc.pss.0 stream not found"),!1;if(this.publisherList[t])return this.Xn.error("zsc.pss.0 publisher already exist"),this.ve.spanSetAttributes({key:Ud,par:t},{error:Bd.cn.code,message:Bd.cn.message}),!1;var l=new el(t,this.Xn,this.dataReport,this.re.engineConfig.publishQualityInterval||this.qualityTimerInterval,this.qualityUploadInterval,this,this.re,u);this.isProxy&&this.isPeer&&this.setIsPeer(!1),l.isPeer=this.isPeer,l.reportSeq=this.re.reportSeqList.startPublish[t],l.isExternal=!0,l.cachedGwNodesMode=this.cachedGwNodesMode,l.parentSpanKey=di.event;var d=null===(s=null==u?void 0:u.videoTrack)||void 0===s?void 0:s.label,h="",p="",f=i.getAudioTracks()[0]&&i.getAudioTracks()[0].label;try{h=null===(a=null==u?void 0:u.videoTrack)||void 0===a?void 0:a.getSettings().deviceId,p=i.getAudioTracks()[0]&&i.getAudioTracks()[0].getSettings().deviceId}catch(e){this.Xn.warn("zsc.pss.0 get device id failed. error: "+e)}var m=new cd(this.Xn,this.re,this,!0);return this.publisherList[t]={seq:0,room:e,localStream:i,publisher:l,serverUrls:[],ttl:0,isCenterNode:!0,streamID:t,publishOption:r,cameraLabel:d||"",microLabel:f||"",cameraDeviceId:h||"",microDeviceId:p||"",deviceStateCount:0,retryStreamHandler:m,retryDispatchHandler:new hd(this.Xn,this.re,this.rtm,this),isDataChannel:o,streamSid:n,isRetweetCDN:!1},l.onPublishStateUpdate=function(e,i,r,n,o,s){var a=c.publisherList[i];a?a.retryStreamHandler.publishStateHandle(e,a.streamID,r,n,o,s):c.Xn.error("zsc.psuh.0 cannot find publish "+t)},l.onPublishQualityUpdate=function(e,i){var r=c.publisherList[e];r?(c.re.deviceStateOut&&0===i.audio.audioBitrate?(r.deviceStateCount++,r.deviceStateCount>=2&&(r.deviceStateCount=0,c.re.deviceStateOut=!1,c.Xn.warn("zsc.pss.0 publish audio error by device"))):r.deviceStateCount=0,c.onPublishQualityUpdate(r.streamID,i)):c.Xn.error("zsc.psuh.0 cannot find publish "+t)},!0},t.prototype.retweetCDN=function(e,t,i){var r=this;return new Promise((function(n,o){r.Xn.info("zsc.rwc.0 call ".concat(t," ").concat(e," ").concat(i));var s=r.getRoomByStreamID(t);s?s.streamHandler._publishTarget({type:"add"===e?"addpush":"delpush",streamID:t,pushUrl:i},(function(){r.Xn.info("zsc.rwc.0 suc "+t),n(void 0)}),(function(e){r.Xn.warn("zsc.rwc.0 fail "+t+" "+JSON.stringify(e)),o(e)})):r.Xn.info("zsc.rwc.0 no room")}))},t.prototype.startPublishingStream=function(e,t){var i,r=this;void 0===t&&(t=!1),this.Xn.info("zsc.sps.0 call");var n=this.publisherList[e];if(!n)return this.Xn.error("zsc.sps.0 publisher don't exist"),!1;(null===(i=n.publishOption)||void 0===i?void 0:i.cdnUrl)&&!n.isRetweetCDN&&this.retweetCDN("add",e,n.publishOption.cdnUrl).then((function(){r.Xn.info("zsc.sps.0 add cdn suc"),n.isRetweetCDN=!0})).catch((function(e){r.Xn.warn("zsc.sps.0 add cdn fail "+JSON.stringify(e))}));var o=n.retryStreamHandler;return o.invalid(),o.init(this.re.streamRetryTime),o.initStream(e,n.serverUrls),o.startMaxTime(),o.activePublish(0)},t.prototype.updateWaitingList=function(e,t,i,r,n){var o={streamID:i,success:r,error:n};t?e.publishWaitingList.push(o):e.playWaitingList.push(o)},t.prototype.publishStream=function(e){var t=this;this.Xn.info("zsc.ps.0 ".concat(e," call"));var i=this.publisherList[e].publisher;if(i)if(this.Xn.info("zsc.ps.0 ".concat(e," state ").concat(i.state)),7===i.state){var r=null,n=null,o=this.publisherList[e].publishOption,s=this.checkPreview(this.publisherList[e].localStream);s?(n=s.videoInfo,(r=s.localStream)&&r.getTracks().forEach((function(e){Zn(e,t.Xn,"zsc.ps.0")})),this.ve.spanSetAttributes({key:Ud,par:e},{cap_w:xd.cap_w(s.videoInfo.width),cap_h:xd.cap_h(s.videoInfo.height),w:xd.w(s.videoInfo.width),h:xd.h(s.videoInfo.height),video_en_fps:xd.video_en_fps(s.videoInfo.frameRate),video_en_bps:xd.video_en_bps(1e3*s.videoInfo.bitRate)}),r?(this.Xn.info("zsc.ps.0 call success"),this.setStreamGwNode(i,!0),i.startPublish(e,r,n,s.mediaStreamConfig,o)):this.Xn.error("zsc.ps.0 no localStream found")):this.Xn.error("zsc.ps.0 no preview found")}else this.Xn.warn("zsc.ps.0 ".concat(e," publisher is progress"));else this.Xn.info("zsc.ps.0 publisher don't exist")},t.prototype.connectPublishServer=function(e,t){var i=this,r=this.publisherList[e];if(!r)return this.Xn.error("zsc.cps.0 publisher don't exist"),!1;var n=Date.now();return this.ve.createSpan(F.H,{key:r.publisher.parentSpanKey,par:e},{key:mr,par:e},mr,!0),this.connectWithReuseSignalServer(e,!0,t,(function(e,t,r){var o=i.publisherList[e];if(o){var s=o.publisher;if(s){var a=Date.now()-n;i.ve.spanSetAttributes({key:s.parentSpanKey,par:e},{dispatch_consume:Ei.dispatch_consume(a)}),s.reportSpan.setAttributes({server_url:pi.server_url(r)}),i.ve.spanSetAttributes({key:Ud,par:e},{server_url:xd.server_url(r)}),i.ve.spanEnd({key:mr,par:e},{result:0,server_url:vr(r)}),i.Xn.info("zsc.cps.0 update token success"),s.signal=t.signal,i.server=r}else i.Xn.info("zsc.cps.1 check publisher don't exist")}else i.Xn.info("zsc.cps.0 after connect publisher don't exist")}),(function(e,t){i.Xn.error("zsc.cps.0 "+e+" connect fail "+JSON.stringify(t));var r=i.publisherList[e];if(r)if(r.publisher){var n,o=!1;t&&t.code===nt.code?(n=Md({},nt),o=!0):((n=Md({},lt)).message=n.message+" "+t,1008===t&&(n=ct,o=!0),20010===t&&(o=!0,n=JSON.parse(JSON.stringify(mt)))),i.ve.spanEnd({key:mr,par:e},{result:t,error:n.code,message:n.message}),r.retryStreamHandler.publishStateHandle(1,e,n,o)}else i.Xn.info("zsc.cps.1 check publisher don't exist");else i.Xn.info("zsc.cps.0 after connect publisher don't exist")}),(function(t,r){i.Xn.info("zsc.cps.0 "+e+" connect complete");var n=i.publisherList[e];if(n){var o=n.publisher;o?(o.signal=r.signal,i.re.useNetAgent&&i.startPublishingTask(t)):i.Xn.info("zsc.cps.1 check publisher don't exist")}else i.Xn.info("zsc.cps.0 after connect publisher don't exist")})),!0},t.prototype.startPublishingTask=function(e){this.Xn.info("zsc.spt.0 call "+e),this.publishStream(e),this.billingTimer.startChargeInfosUpload(),this.activeSoundLevel()},t.prototype.startPlayingTask=function(e,t){this.Xn.info("zsc.spt.1 call "+e),this.playStream(e,t),this.billingTimer.startChargeInfosUpload(),this.activeSoundLevel()},t.prototype.stopPublishingStream=function(e,t){var i=this;this.Xn.info("zsc.sps.0.1 call "+e+" "+JSON.stringify(t));var r=this.publisherList[e];if(r){var n=r.retryStreamHandler;for(var o in n&&(n.stopMaxTime(),n.invalid()),this.signalList)this.signalList[o].publishWaitingList=this.signalList[o].publishWaitingList.filter((function(t){return t.streamID!==e}));r.isRetweetCDN&&r.publishOption.cdnUrl&&this.retweetCDN("del",e,r.publishOption.cdnUrl).then((function(){r.isRetweetCDN=!1,i.Xn.info("zsc.sps.0.1 del cdn suc")})).catch((function(e){i.Xn.warn("zsc.sps.0.1 del cdn fail "+JSON.stringify(e))})),delete this.publisherList[e],this.resetNetworkData();var s=r.publisher;s&&(n.getTryTime(s),s.stopPublish(t),delete r.publisher),this.removeStreamFromSignal(!0,e),this.stopSignalHeartbeat(),this.billingTimer.stopChargeInfosUpload(),this.stopSoundLevel(),this.Xn.info("zsc.sps.0.1 call success")}else this.Xn.warn("zsc.sps.0.1 publisher don't exist")},t.prototype.getSignalNodes=function(){var e;if(this.re.customUrl&&0!=this.re.customUrl.length)this.Xn.info("zsc.gsn customUrl "+JSON.stringify(this.re.customUrl)),e=this.re.customUrl;else{var t=this.re.settingConfig.getSetting("signal_nodes",!0);t&&mn(t)&&t.length>0&&(e=t,this.Xn.info("zsc.gsn setting config signal_nodes "+JSON.stringify(t)))}return e},t.prototype.isUseAgentByServerURL=function(e){return["unified_rtc","unified_l3"].includes(e)},t.prototype.createStreamSignal=function(e,t){var i=this.isUseAgentByServerURL(e),r=new Ol(this.Xn,this.re,this.rtm.netAgent,i);if(this.re.clientIP=this.rtm.netAgent.clientIP,r.setSessionInfo(this.appid,this.userid),r.onDisconnect=this.onDisconnectHandle,r.onReConnect=this.onReconnectHandle,t){var o=this.publisherList[t]||this.playerList[t]||null,s=null==o?void 0:o.retryStreamHandler;if(this.re.streamConnectTime)r.tryConnectInterval=this.re.streamConnectTime;else if(s&&s.retryActiveCount){var a=s.retryActiveCount*(s.retryActiveCount-1)/2+2;r.tryConnectInterval=1e3*(a=a>12?12:a)}}else r.tryConnectInterval=1e3*this.re.defaultConnTime;return this.signalList[e]={signal:r,state:n.connecting,publishWaitingList:[],playWaitingList:[],publishConnectedList:[],playConnectedList:[],tokenInfo:null},r},t.prototype.onSignalConnSuccess=function(e,t,i){this.Xn.info("zsc.crss.0 connected success "+t),e.state=n.connected,e.tokenInfo=i,e.publishWaitingList.forEach((function(i){i.success&&i.success(i.streamID,e,t),e&&e.publishConnectedList.push(i.streamID)})),e.playWaitingList.forEach((function(i){i.success&&i.success(i.streamID,e,t),e&&e.playConnectedList.push(i.streamID)})),e.publishWaitingList=[],e.playWaitingList=[],this.re.useNetAgent||null!=this.heartbeatTimer||this.startSignalHeartbeat()},t.prototype.onSignalConnFailed=function(e,t,i,r){this.Xn.info("zsc.crss.0 connect failed "+i);for(var n=e.publishWaitingList,o=n.length-1;o>=0;o--)(a=n[o]).error&&a.error(a.streamID,t);var s=e.playWaitingList;for(o=s.length-1;o>=0;o--){var a;(a=s[o]).error&&a.error(a.streamID,t)}var c=e.signal;c&&c.disconnectServer(),delete this.signalList[r]},t.prototype.connectWithReuseSignalServer=function(e,t,i,r,o,s){var a=this;this.Xn.info("zsc.crss.0 begin "+i),this.lazyEndSignalHandler.isLazyEnd()&&this.lazyEndSignalHandler.clearLazyEndTimer(i);var c=null;if(this.signalList[i])(c=this.signalList[i]).state==n.connected?(this.Xn.info("zsc.crss.0 already connected "+i+" streamId: "+e),t?c.publishConnectedList.push(e):c.playConnectedList.push(e),s(e,c),r(e,c,i)):c.state==n.connecting&&(this.Xn.info("zsc.crss.0 signal is connecting "+i+" streamId: "+e),s(e,c),this.updateWaitingList(c,t,e,r,o));else{this.Xn.info("zsc.crss.0 new signal "+i+", streamId: "+e);var u=this.createStreamSignal(i,e);this.updateWaitingList(this.signalList[i],t,e,r,o);var l=this.publisherList[e]||this.playerList[e]||null,d=null==l?void 0:l.room.token,h=null==l?void 0:l.room.roomID;this.Xn.remoteReport("zsc.crss.0 "+d),u.connectServer(h||this.re.roomList[0].roomID,d||this.re.roomList[0].token,i,(function(e,t,r){c=a.signalList[i],0!=e?a.onSignalConnFailed(c,e,t,i):(a.onSignalConnSuccess(c,t,r),a.billingTimer.startChargeInfosUpload(),a.activeSoundLevel())})),s(e,this.signalList[i])}},t.prototype.connectStreamSignal=function(e,t){var i=this;this.Xn.info("zsc.cnss.0 call");var r,n=this.getSignalNodes();if(n?r=n[0]:this.re.useNetAgent&&(r="unified_rtc"),r&&this.isUseAgentByServerURL(r)&&!this.signalList[r]){this.Xn.info("zsc.cnss.0 create signal");var o=this.createStreamSignal(r),s=t||this.rtm.getToken(e);o.connectServer(e||this.re.roomList[0].roomID,s||this.re.roomList[0].token,r,(function(e,t,n){var o=i.signalList[r];0!=e?(i.Xn.info("zsc.cnss.0 signal conn fail"),i.onSignalConnFailed(o,e,t,r)):(i.Xn.info("zsc.cnss.0 signal conn success"),i.onSignalConnSuccess(o,t,n),o&&0==o.publishConnectedList.length&&0==o.playConnectedList.length&&0==o.publishWaitingList.length&&0==o.playWaitingList.length&&(i.Xn.info("zsc.cnss.0 no publishing and playing stream"),i.disconnectSignalURL(r,!0)))}))}this.Xn.info("zsc.cnss.0 call success")},t.prototype.disconnectStreamSignal=function(){var e,t=this.getSignalNodes();t?e=t[0]:this.re.useNetAgent&&(e="unified_rtc"),!this.rtm.stateCenter.roomModulesList.some((function(e){return"DISCONNECTED"!==e.roomState}))&&this.disconnectSignalURL(e,!1)},t.prototype.disconnectSignalURL=function(e,t){var i=this;this.Xn.info("zsc.dcsu.0 "+e+" "+t+" call");var r=this.signalList[e];if(null==r?void 0:r.signal){var n=r.signal;t&&this.lazyEndSignalHandler.isLazyEnd()?(this.Xn.info("zsc.dcsu.0 lazy end"),this.lazyEndSignalHandler.startLazyEndTimer(e,(function(){i.Xn.info("zsc.dcsu.0 lazy end start"),n&&n.disconnectServer(),i.stopSignalHeartbeat(),delete i.signalList[e],i.Xn.info("zsc.dcsu.0 lazy end signal")}))):this.lazyEndSignalHandler.isLazyEnd()&&this.lazyEndSignalHandler.hasEndTask(e)?(this.Xn.info("zsc.dcsu.0 has task to end"),this.lazyEndSignalHandler.end(e)):(this.Xn.info("zsc.dcsu.0 direct disconnect"),n&&n.disconnectServer(),delete this.signalList[e]),this.Xn.info("zsc.dcsu.0 call success")}else this.Xn.info("zsc.dcsu.0 "+e+" already disconnect.")},t.prototype.reConnectSignals=function(){var e=this;this.Xn.info("zsc.rcs.0 call");var t=function(t){var r=i.signalList[t],o=r.signal;o&&r.state===n.connecting&&o.connectServer(o.roomID||i.re.roomList[0].roomID,o.token||i.re.roomList[0].token,t,(function(i,n,o){0!=i?e.onSignalConnFailed(r,i,n,t):e.onSignalConnSuccess(r,n,o)}))},i=this;for(var r in this.signalList)t(r)},t.prototype.isNetAgentConnect=function(){var e,t;return null===(t=null===(e=this.rtm)||void 0===e?void 0:e.netAgent)||void 0===t?void 0:t.isConnect()},t.prototype.setPlayStateStart=function(e,t,i,r){var n=this;if(this.Xn.info("zsc.pss.1 call "+e),this.rtm.isDisConnect()&&this.re.networkState==_.offline)return this.Xn.error("zsc.pss.1 network offline"),Xd.Nn;if(this.playerList[e])return this.Xn.error("zsc.pss.1 player already exist"),this.ve.spanEnd({key:qd,par:e},{error:Xd.jn.code,message:Xd.jn.message}),Xd.Rn;var o=this.getPlayRoom(e)||this.re.roomList[0];if(!o)return this.Xn.error("zsc.pss.1 not login room"),this.ve.spanEnd({key:qd,par:e},{error:Xd.kn.code,message:Xd.kn.message}),Xd.kn;var s=new Yl(e,this.Xn,null,this.dataReport,this.re.engineConfig.playQualityInterval||this.qualityTimerInterval,this.qualityUploadInterval,this,this.ac,this.re);!this.getStream(o,e)&&(s.streamInRoom=!1),t&&[0,1,2,3].includes(t.resourceMode)&&(s.resourceMode=t.resourceMode),this.isProxy&&this.isPeer&&this.setIsPeer(!1),s.isPeer=this.isPeer,s.reportSeq=this.re.reportSeqList.startPlay[e],s.isExternal=!0,s.cachedGwNodesMode=this.cachedGwNodesMode,s.parentSpanKey=Ei.event,s.beginTime=(new Date).getTime();var a=new cd(this.Xn,this.re,this,!1),c=z.CDN,u="cdn",l=(new Date).getTime();for(var d in this.playerList)if(this.playerList[d].playMode==z.L3){c=z.L3,u="l3";break}this.cdnProtocolBadTimestamp&&this.cdnProtocolBadTimestamp+this.protocolQualityCacheExpiredTime>l&&0==this.l3ProtocolBadTimestamp&&(c=z.L3,u="l3"),this.ve.spanSetAttributes({key:qd,par:e},{resource_mode:zd.resource_mode(s.resourceMode),src:zd.src(s.resourceMode===q.DG?u:go(s.resourceMode)),room_id:zd.room_id(null==o?void 0:o.roomID),room_sid_string:zd.room_sid_string(null==o?void 0:o.roomSessionID),is_multi:zd.is_multi(this.re.isMultiRoom)}),s.playMode=c;var h=this.ve;this.playerList[e]={seq:0,room:o,player:s,signal:null,serverUrls:[],ttl:0,isCenterNode:!0,streamID:e,playOption:t,retryStreamHandler:a,retryDispatchHandler:new hd(this.Xn,this.re,this.rtm,this),isDataChannel:r,cdnPlayer:null==t?void 0:t.CDNPlayer,playMode:c,streamSid:i,stopCDNPlayer:function(){this.cdnPlayer&&(this.cdnPlayer.stop(),h.spanEnd({key:or,par:this.streamID}),this.player.updateCDNValidTime())}};var p=o.streamList.find((function(t){return t.stream_id==e}));if(p){var f=p.stream_attr_opts;f&&s.setMuteStreamByPlayMode(f)}return s.onPlayStateUpdate=function(e,t,i,r,o,s){var c=n.playerList[t];c?a.playStateHandle(e,c.streamID,i,r,o,s):n.Xn.error("zsc.pss.1 cannot find play "+t)},s.onPlayQualityUpdate=function(e,t){var i=n.playerList[e];i?n.onPlayQualityUpdate(i.streamID,t):n.Xn.error("zsc.pss.1 cannot find play "+e)},s.onRemoteCameraStatusUpdate=function(e,t,i){var r=n.playerList[e];r?n.onRemoteCameraStatusUpdate(r.streamID,t,i):n.Xn.error("zsc.pss.1 cannot find play "+e)},s.onRemoteMicStatusUpdate=function(e,t,i){var r=n.playerList[e];r?n.onRemoteMicStatusUpdate(r.streamID,t,i):n.Xn.error("zsc.pss.1 cannot find play "+e)},!0},t.prototype.onRemoteMicStatusUpdate=function(e,t,i){},t.prototype.onRemoteCameraStatusUpdate=function(e,t,i){},t.prototype.startPlayingStream=function(e,t,i,r){var n,o;void 0===t&&(t=!1),this.Xn.info("zsc.sps.1 start play called");var s=this.playerList[e];if((null===(n=s.playOption)||void 0===n?void 0:n.CDNVideo)&&s.player.firstPlay){var a=s.playOption.CDNVideo;s.player._CDNPlayerClone=a.cloneNode(),s.player.initPoster=(null==a?void 0:a.getAttribute("poster"))||"",s.player.initVideoStyle=(null==a?void 0:a.getAttribute("style"))||"",s.player.firstPlay=!1}else this.isZegoExpressPlayer(null===(o=s.playOption)||void 0===o?void 0:o.CDNPlayer)&&s.player.firstPlay&&(s.player.firstPlay=!1);if(r)return this.playCDN(e,this.playerList[e].playOption,this.playSuccessCallBackList[e],this.playErrorCallBackList[e]),!0;if(!s)return this.Xn.error("zsc.sps.1 player don't exist"),!1;var c=s.player;-1==e.indexOf("zegoprobe-")&&s.playMode==z.L3&&this.ve.createSpan(F.H,{key:Ti.event,par:e},{key:ur,par:e},ur).setAttributes({tryidx:lr(c.tryidx),biz_product:dr(s.playOption.resourceMode==q.DG?1:0)}),this.ve.spanSetAttributes({key:qd,par:e},{urls:zd.urls(s.serverUrls),is_center:zd.is_center(s.isCenterNode)});var u=s.retryStreamHandler;return u.invalid(),u.init(this.re.streamRetryTime),u.initStream(e,s.serverUrls),u.startMaxTime(),u.activePull(0,i)},t.prototype.connectPlayServer=function(e,t,i){var r=this,n=this.playerList[e];if(!n)return this.Xn.error("zsc.cps.1 player don't exist"),!1;this.ve.createSpan(F.H,{key:n.player.parentSpanKey,par:e},{key:Br,par:e},Br,!0);var o=Date.now();return this.connectWithReuseSignalServer(e,!1,i,(function(e,t,i){var n=r.playerList[e];if(n){var s=n.player;if(s){s.reportSpan.setAttributes({server_url:wi.server_url(i)});var a=Date.now()-o;r.ve.spanSetAttributes({key:s.parentSpanKey,par:e},{dispatch_consume:Ei.dispatch_consume(a)}),r.ve.spanSetAttributes({key:qd,par:e},{server_url:zd.server_url(i)}),r.ve.spanEnd({key:Br,par:e},{result:0,server_url:i}),r.Xn.info("zsc.cps.1 update token success"),s.signal=t.signal,r.server=i}else r.Xn.error("zsc.cps.1 checkplayer don't exist")}else r.Xn.error("zsc.cps.1 after connect player don't exist")}),(function(e,t){var n=r.playerList[e];if(n){var o=Md({},lt);o.message=o.message+" "+t,1008===t&&(o=ct),r.ve.spanEnd({key:Br,par:e},{result:t,error:o.code,message:o.message});var s=1008==t;20010===t&&(s=!0,o="unified_l3"===i?wt:Et),n.retryStreamHandler.playStateHandle(1,e,o,s)}else r.Xn.error("zsc.cps.1 after connect player don't exist")}),(function(i,n){var o=r.playerList[i];if(o){var s=o.player;s?(s.signal=n.signal,r.re.useNetAgent&&r.startPlayingTask(e,t)):r.Xn.error("zsc.cps.1 checkplayer don't exist")}else r.Xn.error("zsc.cps.1 after connect player don't exist")})),!0},t.prototype.playStream=function(e,t){this.Xn.info("zsc.ps.1 ".concat(e," call"));var i=this.playerList[e].player;i?(this.Xn.info("zsc.ps.1 ".concat(e," state ").concat(i.state)),7===i.state?(this.Xn.info("zsc.ps.1 call success"),this.setStreamGwNode(i,!1),i.startPlay(e,t,this.playerList[e].playOption)):this.Xn.warn("zsc.ps.1 ".concat(e," player is progress"))):this.Xn.warn("zsc.ps.1 player don't exist")},t.prototype.stopSignalHeartbeat=function(){this.Xn.debug("zsc.ssh.1 call");var e=0;for(var t in this.signalList)e+=1;this.heartbeatTimer&&0==e&&(this.Xn.info("zsc.ssh.1 stop"),clearTimeout(this.heartbeatTimer),this.heartbeatTimer=null)},t.prototype.removeStreamFromSignal=function(e,t){var i=this;this.Xn.info("zsc.rsfs.0 call "+e+" "+t);var r=[],n=function(n){var s=o.signalList[n];if(e){for(var a=0;a<s.publishConnectedList.length;a++)if(s.publishConnectedList[a]===t){o.Xn.debug("zsc.rsfs.0 found from publish"),s.publishConnectedList.splice(a,1);break}for(a=0;a<s.publishWaitingList.length;a++)if(s.publishWaitingList[a].streamID===t){o.Xn.debug("zsc.rsfs.0 found from publish"),s.publishWaitingList.splice(a,1);break}}else{for(var c=0;c<s.playConnectedList.length;c++)if(s.playConnectedList[c]===t){o.Xn.debug("zsc.rsfs.0 found from play"),s.playConnectedList.splice(c,1);break}for(c=0;c<s.playWaitingList.length;c++)if(s.playWaitingList[c].streamID===t){o.Xn.debug("zsc.rsfs.0 found from play"),s.playWaitingList.splice(c,1);break}}var u=function(){for(var e=0;e<r.length;e++)delete i.signalList[r[e]],i.server==r[e]&&(i.server="")};0==s.publishConnectedList.length&&0==s.playConnectedList.length&&0==s.publishWaitingList.length&&0==s.playWaitingList.length&&(o.lazyEndSignalHandler.isLazyEnd()?(o.Xn.info("zsc.rsfs.0 lazy end "),o.lazyEndSignalHandler.startLazyEndTimer(n,(function(){i.Xn.info("zsc.rsfs.0 lazy end start"),s.signal.disconnectServer(),r.push(n),u(),i.stopSignalHeartbeat()}))):(s.signal.disconnectServer(),r.push(n))),u()},o=this;for(var s in this.signalList)n(s)},t.prototype.stopPlayingStream=function(e,t,i){var r=this.playerList[e];if(r){var n=r.retryStreamHandler,o=r.cdnPlayer;for(var s in n&&(n.stopMaxTime(),n.invalid()),this.signalList)this.signalList[s].playWaitingList=this.signalList[s].playWaitingList.filter((function(t){return t.streamID!==e}));r.playMode==z.CDN&&o&&r.stopCDNPlayer();var a=r.player;if(a.playStream&&zc.sourceDisConnect(a.playStream),delete this.playerList[e],this.resetNetworkData(),a){n.getTryTime(a),a.stopPlay(t,i);var c=a.rtcViewer;c&&c.stop()}this.removeStreamFromSignal(!1,e),this.stopSignalHeartbeat(),this.billingTimer.stopChargeInfosUpload(),this.stopSoundLevel(),delete this.playSuccessCallBackList[e],delete this.playErrorCallBackList[e],this.Xn.debug("zsc.sps.1.1 call success")}else this.Xn.info("zsc.sps.1.1 player don't exist")},t.prototype.reset=function(e,t,i){var r,n;for(var o in this.Xn.info("zsc.rs call "+e+" "+t+" "+i),this.publisherList){var s=this.publisherList[o];if(s.room.roomID==e||!e){var a=s.publisher,c=!1;0===t?(c=!0,a.stopReason="Logout"):1002031==t&&(a.stopReason="ReachMaxAVRetryTime");var u=1002031==t?Bd.Vi:{code:t||0,message:""};c&&!a.Le&&(u=Bd.bn),null===(n=null===(r=s.room)||void 0===r?void 0:r.streamHandler)||void 0===n||n.onPublishStateUpdate(1,o,u),i&&this.re.waitPublishStreamList[o]?this.re.waitPublishStreamList[o].retryStart=!0:i||delete this.re.waitPublishStreamList[o],this.stopPublishingStream(o,u),delete this.re.publishStreamList[o]}}for(var l in this.playerList){c=!1;var d=this.playerList[l],h=null==d?void 0:d.player,p=null==h?void 0:h.state;0===t?(c=!0,d.player.stopReason="Logout"):d.player.stopReason="ReachMaxAVRetryTime";var f=d.room;i&&void 0!==p&&p<=6&&(this.stopedPlayerList[l]={streamID:l,playStream:h.playStream,roomID:f.roomID,playOption:d.playOption,state:p,sucCallBack:6!==p?this.playSuccessCallBackList[l]:void 0,errCallBack:6!==p?this.playErrorCallBackList[l]:void 0});var m=f&&f.roomID==e,v=this.re.roomList.length;if(u=1002031==t?Xd.zn:{code:t||0,message:""},c&&void 0!==p&&6!==p&&(u=Xd.qn),m&&(this.getStream(f,l)||1==v))this.onPlayStateUpdate(1,l,u),this.stopPlayingStream(l,u);else if(m&&v>1){var g=this.re.roomList.find((function(t){return t.roomID!==e}));g?this.playerList[l].room=g:(this.stopPlayingStream(l,u),this.onPlayStateUpdate(1,l,u))}}0==Object.keys(this.publisherList).length&&0==Object.keys(this.playerList).length&&(this.probeList={},this.destroySEIWorker()),this.waitPublishList=[],this.waitPlayList=[],this.l3DetectedTimestamp=0,this.l3DetectResult=0,this.isL3Fallback=!1,this.cdnProtocolBadTimestamp=0,this.l3ProtocolBadTimestamp=0,this.lastHandleCDNBadTimestamp=0,this.lastHandleL3BadTimestamp=0,this.cdnProtocolBadTime=0,this.l3ProtocolBadTime=0,this.streamReport.resetReport(),this.Xn.info("zsc.rs call success")},t.prototype.startSignalHeartbeat=function(){var e=this;this.Xn.debug("zsc.ssh.0 call"),this.heartbeatTimer&&(clearTimeout(this.heartbeatTimer),this.heartbeatTimer=null),this.heartbeatTimer=setTimeout((function(){e.checkSignalHeartbeat()}),this.heartbeatInterval)},t.prototype.checkSignalHeartbeat=function(){for(var e in this.Xn.debug("zsc.csh.0 call"),this.signalList)this.signalList[e].signal&&this.signalList[e].signal.sendHeartbeat();this.heartbeatTimer&&this.startSignalHeartbeat()},t.prototype.getPublisher=function(e){var t=null;if(ln(e)&&this.publisherList[e]&&this.publisherList[e].publisher)t=this.publisherList[e].publisher;else if(gn(e)){var i=this.checkPublish(e);i&&(t=null==i?void 0:i.publisher)}return t},t.prototype.getPreviewer=function(e){var t,i=null;return ln(e)&&this.publisherList[e]&&this.publisherList[e].publisher?i=null===(t=this.publisherList[e].publisher)||void 0===t?void 0:t.previewer:gn(e)&&(i=this.checkPreview(e)),i},t.prototype.checkPlayer=function(e){var t=Object.values(this.playerList).find((function(t){return t.player.playStream===e}));return(null==t?void 0:t.player)||null},t.prototype.checkPreview=function(e){for(var t=0;t<this.previewStreamList.length;t++)if(this.previewStreamList[t].localStream===e||e&&!gn(e)&&e.zegoStream&&this.previewStreamList[t].zegoCaptureStream==e.zegoStream)return this.previewStreamList[t];return null},t.prototype.checkPublish=function(e){for(var t in this.publisherList)if(this.publisherList[t].localStream==e)return this.publisherList[t];return null},t.prototype.getPublishList=function(e,t){var i;void 0===t&&(t=!0);var r=[],n=this.checkPreview(e);for(var o in t&&(null==n?void 0:n.zegoCaptureStream)&&(null===(i=n.zegoCaptureStream)||void 0===i?void 0:i.stream)&&(e=n.zegoCaptureStream.stream),this.publisherList)this.publisherList[o].localStream==e&&r.push(this.publisherList[o]);return r},t.prototype.removePreview=function(e){for(var t=0;t<this.previewStreamList.length;t++)if(this.previewStreamList[t]===e){this.previewStreamList.splice(t,1);break}},t.prototype.onPlayerStreamUrlUpdate=function(e,t,i){},t.prototype.getScreenConstrains=function(e){var t={};if(dn(e)&&e)t={audio:!1,video:{frameRate:Hd},bitRate:this.re.settingConfig.getSetting("screen_video_bitrate")||Fd};else if(pn(e)){switch(e.videoQuality){case 1:t={video:{frameRate:f.frameRate},bitRate:f.bitRate};break;case 3:t={video:{frameRate:v.frameRate},bitRate:v.bitRate};break;case 4:t={video:{frameRate:e.frameRate,width:e.width,height:e.height},bitRate:e.bitRate};break;case 2:t={video:{frameRate:Hd},bitRate:Fd};break;default:t={video:{frameRate:Hd},bitRate:this.re.settingConfig.getSetting("screen_video_bitrate")||Fd}}if(t.audio=!!dn(e.audio)&&e.audio,t.audio){var i={noiseSuppression:!1,autoGainControl:!1,echoCancellation:!0},r=e.ANS,n=e.AGC,o=e.AEC;void 0!==r&&(i.noiseSuppression=r),void 0!==n&&(i.autoGainControl=n),void 0!==o&&(i.echoCancellation=o),t.audio=i}t.video&&(t.captureElement=e.captureElement),t=Md(Md({},e),t)}return t},t.prototype.createScreenPreviewer=function(e,t,i){var r=new Gc(this.Xn,this.re,this,"screen"),n=e.getVideoTracks()[0].getSettings();return this.previewStreamList.push(r),r.mediaStreamConfig=i,r.localStream=e,r.initMediaTrack(e),r.videoInfo={width:n.width,height:n.height,frameRate:n.frameRate||15,bitRate:(null==t?void 0:t.bitRate)||1e3,startBitrate:(null==t?void 0:t.startBitrate)||this.re.settingConfig.getSetting("bitrate_mode"),minBitrate:null==t?void 0:t.minBitrate,keyFrameInterval:null==t?void 0:t.keyFrameInterval,channelCount:null==t?void 0:t.channelCount,audioBitrate:1e3*((null==i?void 0:i.audioBitrate)||48)},r.previewSuc=!0,r.previewType="screen",r.videoPreviewType="screen",r.audioPreviewType="screen",(null==t?void 0:t.videoOptimizationMode)&&this.setVideoTrackContentHint(e,null==t?void 0:t.videoOptimizationMode),r},t.prototype.createCompositingPreviewer=function(e,t,i){var r=new Gc(this.Xn,this.re,this,"compositing"),n=e.getVideoTracks()[0].getSettings();return this.previewStreamList.push(r),r.mediaStreamConfig=t,e.getAudioTracks().length>0&&(r.audioTrack=e.getAudioTracks()[0]),r.localStream=e,r.videoInfo={width:(null==t?void 0:t.width)||n.width,height:(null==t?void 0:t.height)||n.height,frameRate:(null==t?void 0:t.frameRate)||n.frameRate||15,bitRate:null==t?void 0:t.bitrate},r.previewSuc=!0,r.inputStreamOptions=i,r},t.prototype.setSoundLevelDelegate=function(e,t,i){void 0===i&&(i=!1),this.Xn.info("zsc.ssd.0 call"),this.soundLevelDelegate=e,this.enableInBackground=i,t&&this.setSoundLevelInterval(t),this.enableSoundLevelProcessor(e),e?(this.Xn.info("zsc.ssd.0 start getting sound"),this.activeSoundLevel()):(this.Xn.info("zsc.ssd.0 stop getting sound"),this.soundLevelTimer&&clearTimeout(this.soundLevelTimer),this.soundLevelTimer=null,this.soundLevelInterval=1e3)},t.prototype.setSoundLevelInterval=function(e){var t,i;if(e&&this.soundLevelDelegate){for(var r in this.soundLevelInterval=e,this.previewStreamList)null===(t=this.previewStreamList[r].soundMeterWorklet)||void 0===t||t.setInterval(e);for(var r in this.playerList)null===(i=this.playerList[r].player.soundMeterWorklet)||void 0===i||i.setInterval(e)}},t.prototype.enableSoundLevelProcessor=function(e){for(var t in this.previewStreamList){var i=this.previewStreamList[t];e?i.startSoundLevel():i.stopSoundLevel()}for(var t in this.playerList){var r=this.playerList[t].player;e?r.startSoundLevel():r.stopSoundLevel()}},Object.defineProperty(t.prototype,"hasRemoteStream",{get:function(){return Object.keys(this.signalList).length>0},enumerable:!1,configurable:!0}),t.prototype.activeSoundLevel=function(){!this.soundLevelTimer&&this.soundLevelDelegate&&this.startSoundLevel()},t.prototype.startSoundLevel=function(){var e=this;this.soundLevelTimer&&(clearTimeout(this.soundLevelTimer),this.soundLevelTimer=null),this.soundLevelDelegate&&(this.hasRemoteStream&&this.checkSoundLevel(),this.checkMicSoundLevel(),this.soundLevelTimer=setTimeout((function(){e.startSoundLevel()}),this.soundLevelInterval))},t.prototype.checkSoundLevel=function(){this.Xn.debug("zsc.csl.0 call");var e=[];for(var t in this.publisherList){var i=0,r=this.publisherList[t].publisher,n=r.previewer;n&&(i=n.soundLevel),e.push({streamID:this.getBackStreamId(r.streamId),soundLevel:i,type:"push"})}for(var t in this.playerList){var o=this.playerList[t].player;o.streamId&&!o.isProbe&&e.push({streamID:this.getBackStreamId(o.streamId),soundLevel:o.soundLevel,type:"pull"})}this.soundLevelDelegate&&e.length>0&&this.onSoundLevelUpdate(e)},t.prototype.checkMicSoundLevel=function(){if(this.microphonePreviews.length&&this.soundLevelDelegate){var e=this.microphonePreviews.reduce((function(e,t){return t.soundLevel>e?t.soundLevel:e}),0);this.onMicSoundLevelUpdate(e)}},t.prototype.getBackStreamId=function(e){return this.testEnvironment&&e?e.replace("zegotest-"+this.appid+"-",""):e},t.prototype.onSoundLevelUpdate=function(e){},t.prototype.onMicSoundLevelUpdate=function(e){},t.prototype.stopSoundLevel=function(){this.soundLevelTimer&&!this.hasRemoteStream&&0===this.previewStreamList.length&&(this.Xn.info("zsc.ssl.0 stop"),clearTimeout(this.soundLevelTimer),this.soundLevelTimer=null)},t.prototype.dr=function(){return this.ve.createSpan(F.H,{key:ri},{key:""},"/sdk/net_probe")},t.prototype.startNetProbe=function(e,t,i,r){t&&(t.probeTime=Date.now()),t&&!t.isPeer||!this.isPeer?this.ve.setError(this.dr(),{code:-1,message:"not support peer"}):r?this.vr():this.mr(e,t,i)},t.prototype.stopNetProbe=function(e){var t=this;this.probingList&&e&&e.probeState!=a.probed&&(this.Xn.info("zc.stnp.0 call ".concat(e.streamId)),Object.keys(this.probingList).forEach((function(e){var i;(null===(i=t.probingList[e])||void 0===i?void 0:i.isProbed)||(t.stopPlayingStream(t.probingList[e].streamID),delete t.probingList[e])})),e.probeState=a.probed,this.pr(e))},t.prototype.pr=function(e){e.probeTimer&&clearTimeout(e.probeTimer),e.probeTimer=null},t.prototype.gr=function(){var e="zegoprobe-"+(new Date).getTime();return this.setPlayStateStart(e),{prober:this.playerList[e]?this.playerList[e].player:null,streamID:e}},t.prototype.vr=function(){var e=this,t="zc.sp.cdn";Me(this.Xn,t);var i=this.gr(),r=i.prober,n=i.streamID;r&&(r.isProbe=!0,this.playerList[n].serverUrls=["unified_l3"],this.startPlayingStream(n,!0,(function(){})),this.playerList[n].player.isProbeByDG=!0,r.onCalNetQualityResult=function(i,r){e.Xn.info("zc.ocnqr.0 l3 detect "+i+" "+r),e.stopPlayingStream(n),e.l3DetectResult=r,e.l3DetectedTimestamp=(new Date).getTime(),xe(e.Xn,t)})},t.prototype.br=function(e,t,i,r){void 0===r&&(r=-1);var n={result:i,probeQuality:r,timeStamp:(new Date).getTime()};this.probingList[t]&&(this.probingList[t].isProbed=!0),this.probeList[t]=n,e.probedList.push(Md(Md({},n),{gwNode:t}))},t.prototype.mr=function(e,t,i){var r=this,n=!0,o="zc.psp.0";if(Me(this.Xn,o),t&&i){var s=t.streamId,c=this.dr();0==i.length&&(n=!1,i=e?this.publisherList[s].serverUrls:this.playerList[s].serverUrls),t.probeNodeList=i;var u=(new Date).getTime(),l=i.filter((function(e){return!(r.probeList[e]&&r.probeList[e].timeStamp+r.nodeProbeInterval>u||t.probeState==a.probed||r.probingList[e]&&!r.probingList[e].isProbed)&&(delete r.probeList[e],!0)})),d={};this.Xn.info("".concat(o," ").concat(s," nodes:").concat(JSON.stringify(l)));for(var h=l.length>this.maxProbeNum?this.maxProbeNum:l.length,p=function(s){var u=l[s];if(0==h)return"break";h--,f.probeList[u]={};var p=f.gr(),m=p.prober,v=p.streamID;if(f.probingList[u]={ipChange:!1,isProbed:!1,streamID:v},d[u]=!0,!m)return{value:void 0};m.isProbe=!0,n?(m.gwNode=u,m.signal=t.signal,m.startPlay(v,(function(){}))):f.connectPlayServer(v,(function(){}),u),m.onCalNetQualityResult=function(e,n){var o;void 0===n&&(n=-1);var s="zc.ocnqr.0";r.Xn.info(s+" "+m.gwNode+" "+e+" "+n),delete d[u];var l=0==Object.keys(d).length;if(null===(o=r.probingList[u])||void 0===o?void 0:o.ipChange)return r.Xn.info("".concat(s," ipChange:").concat(u)),r.stopPlayingStream(r.probingList[u].streamID),void delete r.probingList[u];var h=a.tryProbe;for(var p in r.publisherList){var f=r.publisherList[p].publisher;f.probeNodeList.includes(u)&&f.probeState==h&&r.handleProbeQuality(!0,f,u,e,n,l)}for(var p in r.playerList){var v=r.playerList[p].player;-1==p.indexOf("zegoprobe-")&&v.probeNodeList.includes(u)&&v.probeState==h&&r.handleProbeQuality(!1,v,u,e,n,l)}c.setAttributes({net_quality:tr(parseInt(t.netQuality+"")),node_list:ir(i)}),c.end()},t.probeTimer||(t.probeTimer=setTimeout((function(){r.Xn.info("zc.snp.0 call probeTimer"),r.handleProbedList(e,t,!1,i)}),6e3)),xe(f.Xn,o)},f=this,m=0;m<(null==l?void 0:l.length);m++){var v=p(m);if("object"==_typeof(v))return v.value;if("break"===v)break}}Le(this.Xn,o)},t.prototype.handleProbeQuality=function(e,t,i,r,n,o){Me(this.Xn,"zc.hpq.0","".concat(t.streamId," ").concat(n," ").concat(i," ").concat(o," ")),this.br(t,i,r,n),t.gwNode!=i&&t.signal.server!=i||(t.probeQuality=n),o&&this.handleProbedList(e,t,o,t.probeNodeList)},t.prototype.handleProbedList=function(e,t,i,r){var n=this;this.pr(t);var o,s=t.probedList,c=t.probeState==a.probed,u="zc.hpl.0";Me(this.Xn,u,"".concat(t.streamId," ").concat(JSON.stringify(s)," ").concat(c)),s.length&&!c?(s.length>1&&s.forEach((function(e){if(o){if(o.probeQuality<=e.probeQuality-20){var i=n.gwNodeNetQuality(e.gwNode);if(n.Xn.info("".concat(u," 1: {netQuality} ").concat(e.gwNode," current:").concat(JSON.stringify(o))),-1==i||i>=o.probeQuality+20)o=e;else{var r=n.gwNodeNetQuality(o.gwNode);n.Xn.info("".concat(u," 2: {_netQuality} ").concat(o.gwNode)),-1!==r&&r<=Math.max(40,t.netQuality+20)&&(o=e)}}}else e.probeQuality>Math.max(40,t.netQuality+20)&&(o=e)})),o||(o=s[0]),s.forEach((function(e){var t,i=null===(t=n.probingList[e.gwNode])||void 0===t?void 0:t.streamID;i&&(n.stopPlayingStream(i),delete n.probingList[e.gwNode])})),this.handleCalNetQualityResult(e,o,t,i,r),t.probedList=[]):this.Xn.info("".concat(u," pbLength:").concat(s.length," probed:").concat(c))},t.prototype.gwNodeNetQuality=function(e){var t=-1;for(var i in this.publisherList){var r=this.publisherList[i].publisher;r.gwNode!=e&&r.signal.server!=e||(t=r.netQuality)}for(var i in this.playerList)if(!i.includes("zegoprobe")){var n=this.playerList[i].player;n.gwNode!=e&&n.signal.server!=e||(t=n.netQuality)}return t},t.prototype.handleCalNetQualityResult=function(e,t,i,r,n){var o=this,s=t.gwNode,c=t.result,u=t.probeQuality,l="zc.hcqr.0 ",d=!1,h=!0;null==n||n.forEach((function(e){var t;(null===(t=o.probeList[e])||void 0===t?void 0:t.probeQuality)||(h=!1)})),this.Xn.info("".concat(l," ").concat(null==i?void 0:i.streamId," t:").concat(i.netQuality," probe:").concat(u,", gw:").concat(s,",r:").concat(c,", last:").concat(h));var p=this.ve.createSpan(F.H,{key:ri},{key:""},rr.event);if(0==c&&(u>Math.max(40,i.netQuality+20)?(this.Xn.info(l+i.streamId+" switch "+s),d=!0,this.retryStream(i,e,s),i.probeState=a.probed):d=!1),!d)if(h){if(this.Xn.info(l+i.streamId+" last "),!i.isProbeDispatch)for(var f in i.netProbeToReDispatch((function(){i.isProbeDispatch=!1,o.Xn.info("".concat(l," ").concat(i.streamId," gw redispatch success")),o.startNetProbe(e,i,i.gwNodeList)}),(function(){o.Xn.info("".concat(l," ").concat(i.streamId," gw redispatch fail")),i.isProbeDispatch=!1})),this.probeList)-1===this.probeList[f].netQuality&&(this.probeList[f]={})}else r&&this.startNetProbe(e,i,n);var m=rr;p.setAttributes({is_switch:m.is_switch(d),is_publish:m.is_publish(e),stream_id:m.stream_id(i.streamId),result:m.result(c),node:m.node(s),net_quality:m.net_quality(parseInt(i.netQuality+"")),probe_net_quality:m.probe_net_quality(parseInt(u+""))}),p.end()},t.prototype.retryStream=function(e,t,i){if(t){var r=e,n=r.streamId,o=r.localStream,s=r.videoInfo,a=r.mediaStreamConfig,c=r.publishOption;0!=r.sessionId&&r.signal&&r.shouldSendCloseSession()&&(r.signal.sendCloseSession(this.re.getSeq(),r.sessionId,1),r.signal.removeSession(r.sessionId),r.closeSessionSignal=!0),r.resetPublish(),this.publisherList[n].isCenterNode?(r.gwNode=i,r.startPublish(n,o,s,a,c)):(r.isExternal=!1,this.connectPublishServer(n,i))}else{var u=e,l=(n=u.streamId,u.getRemoteStreamSuc),d=u.playOption;0!=u.sessionId&&u.signal&&u.shouldSendCloseSession()&&(u.signal.sendCloseSession(this.re.getSeq(),u.sessionId,1),u.signal.removeSession(u.sessionId),u.closeSessionSignal=!0),u.resetPlay(),this.onPlayStateUpdate(2,n,{code:Ct.code,message:Ct.message}),this.playerList[n].isCenterNode?(u.gwNode=i,u.startPlay(n,l,d)):(u.isExternal=!1,this.connectPlayServer(n,l,i))}},t.prototype.getRoomByStreamID=function(e){return this.publisherList[e]?this.publisherList[e].room:this.playerList[e]?this.playerList[e].room:void 0},t.prototype.setVideoTrackContentHint=function(e,t){if(ln(t)){var i=t.toLowerCase();if(["default","motion","detail","text"].includes(i)){var r=e.getVideoTracks()[0];r?"contentHint"in r?(this.Xn.info("zc.svtch "+i),r.contentHint="default"==i?"":i):this.Xn.warn("zc.svtch mediaStreamTrack contentHint attribute not supported"):this.Xn.warn("zc.svtch video track no found")}else this.Xn.warn("zc.svtch videoOptimizationMode wrong")}else this.Xn.warn("zc.svtch videoOptimizationMode type wrong")},t.prototype.getPlayRoom=function(e){var t=this;return this.re.roomList.find((function(i){return!!t.getStream(i,e)}))},t.prototype.getStream=function(e,t){return e.streamList.find((function(e){return e.stream_id==t}))},t.prototype.updateQuality=function(e,t){this.streamReport.updateQualityOrChargeInfo(e,t)},t.prototype.checkStreamReport=function(){this.streamReport.checkStreamReport()},t.prototype.stopToReport=function(e){this.streamReport.updateQualityOrChargeInfo(e,void 0,!0)},t.prototype.setIsPeer=function(e){this.isPeer=e,Object.values(this.publisherList).forEach((function(t){t.publisher.isPeer=e})),Object.values(this.playerList).forEach((function(t){t.player.isPeer=e}))},t.prototype.getCDNUrl=function(e,t){var i,r,n,o=((i={})[q.RTC]=1,i[q.CDN]=0,i[q.L3]=2,i[q.DG]=3,i),s=this.re.appConfig.media_config.play_config.resource_info;if(s.length){var a=s.find((function(e){return e.resource_type==o[t]}));if(a)for(var c=0;c<a.service_info.length;c++){var l=a.service_info[c],d=l.protocol,h=l.url_template.replace("{STREAM_NAME}",e);switch(d){case u.FLV:r=h;break;case u.HLS:n=h}}}return{flv:r,hls:n}},t.prototype.bindZegoExpressPlayerEvents=function(e,t,i,r,n){var o=this,s=t.player,a=!1;e._extApi.off("canplay"),e._extApi.on("canplay",(function(){a||(o.Xn.info("zsc.pc.1 start playing cdn source"),a=!0,o.onCDNPlayerCanplay(s,i,r))}));var c=null,u=0;e._extApi.off("error"),e._extApi.on("error",(function(t){var i=t.code,r=t.msg;o.Xn.error("zsc.pc.1 error occur ".concat(i," ").concat(r)),[100003,100004,100005].includes(i)?(c&&(clearTimeout(c),c=null),u>3?(o.Xn.error("zsc.pc.1 retryCount ".concat(u," greater than ").concat(3,". end play cdn source")),s.updateCDNValidTime(),n.setAttributes({stop_reason:cr(r)})):c=setTimeout((function(){u++,e.resume(),s.CDNBrokenCnt++}),3e3)):100006!==i&&(n.setAttributes({stop_reason:cr(r)}),o.Xn.error("zsc.pc.1 stop play cdn source."))})),e._extApi.off("loaded"),e._extApi.on("loaded",(function(){t.playMode==z.CDN&&6==s.state?s.CDNBrokenCnt++:(o.Xn.info("zsc.pc.1 ended play cdn"),s.updateCDNValidTime())})),e._extApi.off("netQualityScoreUpdate"),e._extApi.on("netQualityScoreUpdate",(function(e){o.onCDNPlayerQualityUpdate(e,i,r,t)}))},t.prototype.onCDNPlayerQualityUpdate=function(e,t,i,r){e<=this.cdnBadQualityScore?this.handleQualityBad(t,i.resourceMode,z.CDN):(r.qualityBadCount=0,this.cdnProtocolBadTimestamp=0,this.lastHandleCDNBadTimestamp=0)},t.prototype.onCDNPlayerCanplay=function(e,t,i){if(6!=e.state&&(e.state=6,0==e.firstFrameTime)){e.firstFrameTime=Date.now()-e.beginTime;var r=this.ve.createSpan(F.H,{key:Ti.event,par:t},{key:""},Zi.event);r.setAttributes({fft_consumed:Zi.fft_consumed(e.firstFrameTime),biz_product:Zi.biz_product(i.resourceMode==q.DG?1:0)}),r.end()}0==e.cdnPlayTime&&e.playMode==z.CDN&&(e.cdnPlayTime=Date.now())},t.prototype.bindZegoCDNPlayerEvents=function(e,t,i,r,n){var o=this,s=t.player;e.onQualityUpdate=function(e,n){o.onCDNPlayerQualityUpdate(n,i,r,t)},e.onComplete=function(){if(t.playMode==z.CDN&&6==s.state)e.retry(),s.CDNBrokenCnt++;else var i=s.initPoster,r=s.initVideoStyle,n=t.playOption.CDNVideo,o=setTimeout((function(){clearTimeout(o),n&&n.setAttribute("style",r),n&&n.setAttribute("poster",i)}),1e3);s.updateCDNValidTime()},e.onError=function(t){o.re.networkState==_.offline&&(e.canRetry=!1),n.setAttributes({stop_reason:cr(t)}),s.updateCDNValidTime()},e.onCanplay=function(){o.onCDNPlayerCanplay(s,i,r)}},t.prototype.selectCDNSource=function(e,t,i,r,n,o){var s=this.isZegoExpressPlayer(e),a=r.player,c="";if(s)c=t[0],n.setAttributes({protocol:sr("flv")});else if(e.isSupportFLV()&&(null==t?void 0:t.length)>0)c=t[0],n.setAttributes({protocol:sr("flv")});else if(e.isSupportHLS()&&(null==i?void 0:i.length)>0)c=i[0],n.setAttributes({protocol:sr("hls")});else if(!r.cdnUrl)return null;if(!c)return null;if((c=c.replace("http://","https://"))!==r.cdnUrl&&a.tryidx>1){var u=this.ve.createSpan(F.H,{key:Ti.event,par:o},{key:""},"/sdk/play_src_changed");u.setAttributes({src:pr(c),last_src:hr(r.cdnUrl)}),u.end()}return c},t.prototype.isZegoExpressPlayer=function(e){return!(!e||!e._extApi)},t.prototype.playCDN=function(e,t,i,r){var n,o=this.ve.createSpan(F.H,{key:Ti.event,par:e},{key:or,par:e},or,!0),s=function(e){o.setAttributes({stop_reason:cr(e)}),r&&r()},a=this.playerList[e],c=a.cdnPlayer,u=this.isZegoExpressPlayer(c);if(!u&&!t.CDNVideo)return this.Xn.error("zsc.pc.1 cdn video no found"),s("cdn video no found"),!1;var l=null===(n=this.getPlayRoom(e))||void 0===n?void 0:n.streamList.find((function(t){return t.stream_id==e})),d=a.playOption.resourceMode,h=a.player;h.streamId=e,h.playOption=a.playOption,h.tryidx++,o.setAttributes({tryidx:lr(h.tryidx),biz_product:dr(d==q.DG?1:0)});var p=l||{},f=p.urls_flv,m=p.urls_flv_plus,v=p.urls_m3u8,g=p.urls_m3u8_plus;if(!(l&&(d!=q.CDN||f&&v)&&(d!=q.DG||m&&g))){if(!this.re.appConfig||!d)return this.Xn.error("zsc.pss.1 stream info no found"),s("stream info no found"),!1;var y=this.getCDNUrl(e,d),b=y.flv,_=y.hls;d==q.DG?(m=b?[b]:[],g=_?[_]:[]):(f=b?[b]:[],v=_?[_]:[])}if(!a||!c)return s("no cdn player"),!1;d===q.DG&&(h.useResourceTypes.push("cdn"),h.useResourceTypes=Array.from(new Set(h.useResourceTypes)));var S=this.selectCDNSource(c,d==q.DG?m:f,d==q.DG?g:v,a,o,e);return S||a.cdnUrl?(a.cdnUrl=S||a.cdnUrl,o.setAttributes({url:ar(a.cdnUrl)}),a.playMode==z.CDN&&(this.onPlayStateUpdate(0,e,{code:0,message:"success"},{isCDN:!0}),!u&&t.CDNVideo?(c.play(a.cdnUrl,t.CDNVideo),t.CDNVideo.srcObject=null,this.bindZegoCDNPlayerEvents(c,a,e,t,o)):(c.src=a.cdnUrl,c.play(),this.bindZegoExpressPlayerEvents(c,a,e,t,o)),i&&i(),!0)):(this.Xn.error("zsc.pc.1 can not find cdn urls"),s("cdn protocol not support."),!1)},t.prototype.handleQualityBad=function(e,t,i){var r=this;if(this.Xn.info("zsc.hqb.0 call ".concat(e," ").concat(t," ").concat(i)),t!==q.DG)return!1;this.fetchL3CDNCloudSetting();var n=(new Date).getTime(),o=0;for(var s in this.playerList)this.playerList[s].isQualityBad&&o++;i==z.CDN?(this.cdnProtocolBadTime=this.cdnProtocolBadTime+(0==this.lastHandleCDNBadTimestamp?this.qualityInterval:n-this.lastHandleCDNBadTimestamp),(o>=this.protocolBadQualityCount||this.cdnProtocolBadTime>=this.protocolBadQualityTime)&&(this.cdnProtocolBadTime=0,this.cdnProtocolBadTimestamp=(new Date).getTime())):i==z.L3&&(this.l3ProtocolBadTime=this.l3ProtocolBadTime+(0==this.lastHandleL3BadTimestamp?this.qualityInterval:n-this.lastHandleL3BadTimestamp),(o>=this.protocolBadQualityCount||this.l3ProtocolBadTime>=this.protocolBadQualityTime)&&(this.l3ProtocolBadTime=0,this.l3ProtocolBadTimestamp=(new Date).getTime()));var a=!1,c=this.playerList[e],u=c.qualityBadCount?c.qualityBadCount*this.qualityInterval:0;if((i==z.L3&&u>this.l3BadQualityTime||i==z.CDN&&this.isL3Fallback&&u>this.fallbackInhibitionTime||i==z.CDN&&!this.isL3Fallback&&u>this.defaultBadQualityTime)&&(a=!0),a){for(var l in c.isQualityBad=!0,o=0,this.playerList)this.playerList[l].isQualityBad&&o++;if(i==z.CDN&&(0==this.l3DetectedTimestamp||this.l3DetectedTimestamp+this.probeExpiredTime<n&&this.l3DetectedTimestamp+this.minProbeInterval<n)&&(this.l3DetectedTimestamp=(new Date).getTime(),this.startNetProbe(!1,void 0,void 0,!0)),o/Object.keys(this.playerList).filter((function(e){return!e.includes("zegoprobe")})).length>this.multiPlaySwitchRate){this.Xn.error("zsc.hqb.0 low quality "+(0==i?"CDN":"L3"));var d=Object.keys(this.playerList).filter((function(e){return!e.includes("zegoprobe")}));return d.forEach((function(e,t){var n=r.playerList[e],o=n.player;i==z.L3?(r.stopPlayingStream(e,void 0,!0),o.updateValidTime(),r.playerList[e]=n,n.isQualityBad=!1,n.playMode=o.playMode=z.CDN,n.qualityBadCount=0,r.playCDN(e,n.playOption,r.playSuccessCallBackList[e],r.playErrorCallBackList[e])):r.l3DetectResult>r.switchDetectResultScore&&(n.qualityBadCount=0,r.l3DetectedTimestamp=0,t==d.length-1&&(r.l3DetectResult=0),r.cdnSwitchL3(n))})),i==z.L3&&(this.isL3Fallback=!0),!0}}return un(c.qualityBadCount)?c.qualityBadCount++:c.qualityBadCount=1,!1},t.prototype.cdnSwitchL3=function(e){var t,i=this,r=e.streamID,n=this.re.useNetAgent,o=e.player;if(e.playMode=o.playMode=z.L3,this.stopPlayingStream(r,void 0,!0),this.playerList[r]=e,e.isQualityBad=!1,(null===(t=e.playOption)||void 0===t?void 0:t.resourceMode)==q.DG&&(o.useResourceTypes.push("l3"),o.useResourceTypes=Array.from(new Set(o.useResourceTypes))),n)this.re.appConfig?(e.serverUrls=["unified_l3"],this.startPlayingStream(r,n,(function(t){i.Xn.info("zsc.cqi.1 switch l3 success");var r=o.initPoster,n=o.initVideoStyle,s=e.playOption.CDNPlayer,a=e.playOption.CDNVideo,c=i.isZegoExpressPlayer(s);if("safari"===i.re.browser&&!c&&a&&o._CDNPlayerClone){var u=a.parentElement;if(u){var l=Ie.createElement("style"),d=a.cloneNode(!0),h=Date.now().toString(16);l.innerText=".zego_cdn_video_".concat(h," .zego_clone_video_").concat(h,"{width:").concat(a.offsetWidth,"px;height:").concat(a.offsetHeight,"px;}")+".zego_cdn_video_".concat(h," .hide_").concat(h,"{display:none!important;width:0;height:0}"),Ie.head.append(l),d.classList.add("zego_clone_video_".concat(h)),d.id=e.streamID+"_clone",d.src="",d.srcObject=t,d.classList.add("hide_".concat(h)),a.before(d),u.classList.add("zego_cdn_video_".concat(h));var p=setTimeout((function(){clearTimeout(p),a.classList.add("hide_".concat(h)),d.classList.remove("hide_".concat(h))}),2e3),f=setTimeout((function(){clearTimeout(f),e.playOption.CDNVideo=d,e.stopCDNPlayer(),u.classList.remove("zego_cdn_video_".concat(h)),a.classList.remove("zego_cdn_video_".concat(h)),d.classList.remove("zego_clone_video_".concat(h)),d.id=a.id,l.remove(),a.remove()}),4e3)}}else if(e.stopCDNPlayer(),c&&t)i.Xn.info("zsc.cqi.1 express player switch to play L3"),s._extApi.srcObject=t;else{var m=setTimeout((function(){clearTimeout(m),a&&a.setAttribute("style",n),a&&a.setAttribute("poster",r)}),1e3);t&&a&&(a.srcObject=t)}}))):this.waitPlayList.push(r);else{var s=this.playerList[r].retryDispatchHandler;s.stopMaxTime(),s.invalid(),s.initStream(r,e.playOption,!1),s.startMaxTime(),s.active(0)}},t.prototype.fetchL3CDNCloudSetting=function(){this.switchScore=this.re.settingConfig.getSetting("switch_score")||60,this.defaultBadQualityTime=this.re.settingConfig.getSetting("default_bad_quality_time")||3e4,this.l3BadQualityTime=this.re.settingConfig.getSetting("l3_bad_quality_time")||1e4,this.switchDetectResultScore=this.re.settingConfig.getSetting("switch_detect_result_score")||60,this.cdnBadQualityScore=this.re.settingConfig.getSetting("cdn_bad_quality_score")||60,this.l3BadQualityScore=this.re.settingConfig.getSetting("l3_bad_quality_score")||60,this.multiPlaySwitchRate=this.re.settingConfig.getSetting("multi_play_switch_rate")||.8,this.protocolBadQualityCount=this.re.settingConfig.getSetting("protocol_bad_quality_count")||3,this.protocolBadQualityTime=this.re.settingConfig.getSetting("protocol_bad_quality_time")||12e3,this.protocolQualityCacheExpiredTime=this.re.settingConfig.getSetting("protocol_quality_cache_expired_time\t")||18e4,this.fallbackInhibitionTime=this.re.settingConfig.getSetting("fallback_inhibition_time")||18e4,this.probeExpiredTime=this.re.settingConfig.getSetting("probe_expired_time")||3e4,this.minProbeInterval=this.re.settingConfig.getSetting("min_probe_interval")||15e3},t.prototype.setStreamGwNode=function(e,t){this.Xn.info(os+" call "+e.streamId),this.checkCachedNodesUse(e,t),e.gwNodesTTL&&e.gwNodesTTL<(new Date).getTime()&&(this.Xn.info(os+" call "+e.streamId+" ttl timeout, reset gw"),e.gwNode="",e.gwNodeList=[],e.gwNodesTTL=0),this.gwNode&&(e.gwNode=this.gwNode);var i=this.re.settingConfig.getSetting("gw_nodes");i&&mn(i)&&i.length>0&&(this.Xn.info(cs+" setting "+JSON.stringify(i)),e.gwNodeList=i,e.gwNode=e.gwNodeList[0]||e.gwNode),this.Xn.info(os+" end "+e.streamId+" "+e.gwNode)},t.prototype.getNodeIndex=function(e,t){var i="",r=t?"publish":"play",n="";switch(t||(0==e.resourceMode?n="_rtc":[2,3].includes(e.resourceMode)&&(n="_l3")),e.cachedGwNodesMode){case Nd.NotReUse:break;case Nd.TheSameReUse:i=r+"_"+e.streamId+n;break;case Nd.DiffReUse:i=r;break;case Nd.AllReUse:i="stream"}return i},t.prototype.checkCachedNodesUse=function(e,t){if(this.Xn.info(ss+" call "+e.streamId+" "+e.cachedGwNodesMode),e.isExternal)if(t&&e.isCustomCdn())this.Xn.info(ss+" call "+e.streamId+" custom cdn");else if(this.re.useNetAgent&&this.re.isMultiOuter)this.Xn.info(ss+" call "+e.streamId+" multi outer");else{var i=this.getNodeIndex(e,t);if(this.Xn.info(ss+" "+e.streamId+" "+i),i){var r=this.cachedGwNodesList[i];r&&r.gwNodesTTL>(new Date).getTime()&&(null==r?void 0:r.gwNodes.length)>0&&(this.Xn.info(ss+" "+e.streamId+" use cache gwnodes"),e.gwNodeList=r.gwNodes,e.gwNodesTTL=r.gwNodesTTL,e.gwNode=e.gwNodeList[0])}this.Xn.info(ss+" end "+e.streamId+" "+e.gwNode)}else this.Xn.info(ss+" "+e.streamId+" retry internal")},t.prototype.updateCachedGwNodesList=function(e,t,i,r){if(this.Xn.info(as+" call "+e.streamId),0===r)this.setCachedGwNodesMode(Nd.NotReUse);else if(r>0){var n=this.getNodeIndex(e,t);this.Xn.info(as+" "+e.streamId+" nodeIndex "+n),n&&(this.cachedGwNodesList[n]={gwNodes:i,gwNodesTTL:(new Date).getTime()+1e3*r})}},t.prototype.clearCachedGwNodesList=function(e,t){var i=this.getNodeIndex(e,t);this.Xn.info("zsc.ccgl "+e.streamId+" nodeIndex "+i),i&&delete this.cachedGwNodesList[i]},t.prototype.setCachedGwNodesMode=function(e){this.cachedGwNodesMode=e,Object.values(this.publisherList).forEach((function(t){t.publisher.cachedGwNodesMode=e})),Object.values(this.playerList).forEach((function(t){t.player.cachedGwNodesMode=e}))},t.prototype.updateTimeOffsetInterval=function(){var e,t,i=this;un(null===(e=this.rtm)||void 0===e?void 0:e.netAgent.timeOffset)&&(this.re.clientTimeOffset=null===(t=this.rtm)||void 0===t?void 0:t.netAgent.timeOffset),this.timeOffsetUpdateTimer=setTimeout((function(){i.updateTimeOffsetInterval()}),9e5)},t.prototype.changeRxQuality=function(e){this.rxQuality=e,this.startPublishNetWorkQuality()},t.prototype.changeTxQuality=function(e,t,i){this.txQuality=e,this.sendNetQuality(t,i),this.startPublishNetWorkQuality()},t.prototype.sendNetQuality=function(e,t){var i;this.Xn.info("zc.sc.snq call");var r=Ld.WebrtcCmdReqMsg.encode({net_quality_grade:{rx_quality:this.rxQuality,tx_quality:this.txQuality}}).finish();null===(i=this.signalList[this.server])||void 0===i||i.signal.sendGWCmd(e,{peer_id:t,cmd_id:6},r,(function(e,t,i){var r=Ld.WebrtcCmdRspMsg.decode(i.body);$n(r[Object.keys(r)[0]])}),(function(e){}))},t.prototype.startPublishNetWorkQuality=function(){var e=this;null===this.netTimer&&(this.netTimer=setInterval((function(){e.re.actionListener("networkQuality","",e.txQuality,e.rxQuality)}),3e3))},t.prototype.resetNetworkData=function(){Object.keys(this.playerList).length<1&&(this.rxQuality=-1),Object.keys(this.publisherList).length<1&&(this.txQuality=-1),Object.keys(this.playerList).length<1&&Object.keys(this.publisherList).length<1&&(clearInterval(this.netTimer),this.netTimer=null)},t.prototype.getCloudSoundInterval=function(){var e=this.re.settingConfig.getSetting("sound_sample_interval");return e&&(e<100&&(e=100),e>3e3&&(e=3e3),this.Xn.info("zc.gsl setting sound_sample_interval "+e)),e},t.prototype.createSoundLevel=function(e,t,i,r,n){void 0===i&&(i=this.soundLevelInterval),void 0===n&&(n=function(e){});var o=new zc(this.Xn,this.re,i,r),s=o.getSrcSource(e,t);return o.initAudioWorklet(e,s),o.onSoundLevelUpdate=function(e){n(e)},{mic:s,soundMeter:o}},t.prototype.createSEIWorker=function(){if(this.isNotSupportSeiWorker)return null;var e=this.seiWorker;if(e)return e;var t=Dd.toString().trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1],i=URL.createObjectURL(new window.Blob([t],{type:"text/javascript"}));return e=this.seiWorker=new Worker(i),this.Xn.info("zsc.gseiw init sei"),e},t.prototype.handleSeiRollBack=function(){this.isNotSupportSeiWorker=!0,this.destroySEIWorker()},t.prototype.destroySEIWorker=function(){var e;null===(e=this.seiWorker)||void 0===e||e.terminate(),this.seiWorker=void 0},t.prototype.destroy=function(){var e;this.heartbeatTimer&&clearTimeout(this.heartbeatTimer),this.soundLevelTimer&&clearTimeout(this.soundLevelTimer),this.timeOffsetUpdateTimer&&clearTimeout(this.timeOffsetUpdateTimer),this.netTimer&&clearInterval(this.netTimer),null===(e=this._billingTimer)||void 0===e||e.destroy(),this.checkDeviceChange=void 0,Ie.removeEventListener("visibilitychange",this.eventHandler.visibilitychange)},t.prototype.supplementPlayingChargeTime=function(){this.billingTimer.supplementPlayingChargeTime()},t.closeNetProbe=!1,t}((function(){this.publisherList={},this.playerList={},this.stopedPlayerList={}})),Gd=__webpack_require__(5515),jd=function(){function e(e){this.v=e}return e.prototype.takeStreamSnapshot=function(e){return this.v.takeStreamSnapshot(e)},e.prototype.play=function(e,t){return this.v.play(e,t)},e.prototype.stop=function(){return this.v.stop()},e.prototype.resume=function(){this.v.resume()},e.prototype.setAudioMuted=function(e){return this.v.setAudioMuted(e)},e.prototype.setVideoMuted=function(e){return this.v.setVideoMuted(e)},e.prototype.useAudioOutputDevice=function(e){return this.v.useAudioOut(e)},e.prototype.setVolume=function(e){return this.v.setVolume(e)},e.prototype.on=function(e,t){return this.v.on(e,t)},e.prototype.off=function(e,t){return this.v.off(e,t)},e}(),Qd=function(){function e(e){this.close=e,this.defaultSetting={publish_video_codec:"H264",camera_video_bitrate:800,screen_video_bitrate:1500,custom_video_bitrate:0,l3_play_buffer_ms:500,AEC:void 0,AGC:void 0,ANS:void 0,resource_mode:0,bitrate_mode:"default",auto_to_tcp:!1,udp_max_fail_num:2,probe_started_num:3,udp_or_tcp:"udp",hardware_encode:!1,camera_hard_encode:!1,custom_hard_encode:!1,bg_fps_stat:0,camera_width:720,camera_height:480,camera_framerate:15,camera_audio_bitrate:48,open_mini_sdp:!1,sound_level_api_type:j.useAnalyzer,sound_sample_interval:200,scenario_configs:[],dtx:0},this.userChangedKey={},this.arrObjKeys=["scenario"],this.arrObjItemKeys=["scenario_configs"],this.setting=JSON.parse(JSON.stringify(this.defaultSetting))}return e.prototype.setSetting=function(e,t){var i=Array.isArray(t)&&t.length>0;for(var r in e)if(this.arrObjKeys.includes(r))for(var n in e[r])this.setting[r+"_"+n]=e[r][n];else for(var n in e[r])if(!n.endsWith("_ctrlmode")){if(i&&-1==t.indexOf(n))continue;var o=e[r][n+"_ctrlmode"];1===o?this.userChangedKey[n]||(this.setting[n]=e[r][n]):2===o?this.setting[n]=e[r][n]:this.defaultSetting[n]&&(this.setting[n]=this.defaultSetting[n]),"number"==typeof o&&(this.setting[n+"_ctrlmode"]=e[r][n+"_ctrlmode"])}},e.prototype.getSetting=function(e,t){if(void 0===t&&(t=!1),!this.close)return this.arrObjItemKeys.includes(e)?this.setting[e]:t?2==this.setting[e+"_ctrlmode"]?this.setting[e]:void 0:this.setting[e]},e.prototype.setUserValue=function(e,t){2!==this.setting[e+"_ctrlmode"]&&(this.userChangedKey[e]=!0,this.setting[e]=t)},e.prototype.getCloudSettingScenario=function(e,t,i){var r=this;void 0===t&&(t=!1),void 0===i&&(i=!1);var n=(this.getSetting("scenario_configs")||[]).find((function(t){return t.scenario===e})),o={};if(n){var s=n.a_chn_count,a=n.a_bitrate,c=n.ctrlmode;[["ANS","ANS",n.ans_status,!0],["AGC","AGC",n.agc_status,!0],["AEC","AEC",n.aec_status,!0],["audioBitrate","camera_audio_bitrate",isNaN(a)?void 0:a/1e3,!1],["channelCount","",s,!1]].forEach((function(e){var n,s,a,u,l;n=e[0],s=e[1],u=e[3],l=c,"number"==typeof(a=e[2])?(t&&2===l||!t&&[1,2].includes(l))&&(u?(1===a&&(o[n]=!0),0===a&&(o[n]=!1)):o[n]=a):!i&&s&&(o[n]=r.getSetting(s,t))}))}else{if(i)return{};var u=this.getSetting("ANS",t);dn(u)&&(o.ANS=u);var l=this.getSetting("AGC",t);dn(l)&&(o.AGC=l);var d=this.getSetting("AEC",t);dn(d)&&(o.AEC=d);var h=this.getSetting("camera_audio_bitrate",t);un(h)&&(o.audioBitrate=h)}return o},e}(),Wd=function(){return Wd=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Wd.apply(this,arguments)},Zd=function(){function e(e,t,i){this.yr=e,this._r=t,this.ee=i,this._initTime=Date.now()}return Object.defineProperty(e.prototype,"appid",{get:function(){return this._r.appid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"device_id",{get:function(){return this.yr.deviceID},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"product",{get:function(){return this.yr.roomServer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sdk_version",{get:function(){return s},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sys_info",{get:function(){return navigator.userAgent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"report_version",{get:function(){return this._r.sdkVerNum},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"browser",{get:function(){return this._r.browser},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id_name",{get:function(){return this.yr.idName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nick_name",{get:function(){return this.yr.nickName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"use_na",{get:function(){return this._r.useNetAgent?1:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userid",{get:function(){return this.yr.userid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"network_state",{get:function(){return this._r.networkState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"init_time",{get:function(){return this._initTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"net_type",{get:function(){var e;return(null===(e=navigator.connection)||void 0===e?void 0:e.effectiveType)||"unknown"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"room_server",{get:function(){return this.yr.roomServer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"device_infos",{get:function(){return this._r.deviceInfos},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"room_list",{get:function(){var e=this,t={};return this._r.roomList.forEach((function(i){var r,n,o,s=e.yr.roomModulesList.find((function(e){return e.roomID===i.roomID})),a={roomSessionID:i.roomSessionID,sessionID:i.sessionID,streamList:i.streamList,token:i.token,role:e.yr.role,roomCreateFlag:e.yr.roomCreateFlag,loginTime:null==s?void 0:s.loginTime,heartbeatInterval:null===(r=null==s?void 0:s.heartBeatHandler)||void 0===r?void 0:r.heartbeatInterval,roomExtraInfos:null===(n=null==s?void 0:s.messageHandler)||void 0===n?void 0:n.transSeqMap,roomRetryTime:null===(o=null==s?void 0:s.roomTryHandler)||void 0===o?void 0:o.RETRY_MAX_TIME};t[i.roomID]=a})),t},enumerable:!1,configurable:!0}),e.prototype.getRoomList=function(e,t){var i=this;return this.room_id_list.slice(e,t).map((function(e){return Wd({roomID:e},i.room_list[e])}))},Object.defineProperty(e.prototype,"room_id_list",{get:function(){return this._r.roomList.map((function(e){return e.roomID}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roomListSize",{get:function(){return this.room_id_list.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userLoginState",{get:function(){var e,t=this.yr.roomModulesList[0],i=t.runState,r=t.lastRunState;return i===y.logout?e=b.logout:i===y.login?e=b.login:r===y.logout?e=b.trylogin:r===y.login&&(e=b.reconnect),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"publishStreamList",{get:function(){return Object.keys(this.ee.publisherList)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"publishList",{get:function(){var e=this,t={};return this.publishStreamList.forEach((function(i){var r,n,o,s=e.ee.publisherList[i],a=null==s?void 0:s.publisher,c=null==a?void 0:a.publishStat;t[i]={streamSid:null==s?void 0:s.streamSid,roomID:null===(r=null==s?void 0:s.room)||void 0===r?void 0:r.roomID,roomSessionID:null===(n=null==s?void 0:s.room)||void 0===n?void 0:n.roomSessionID,cameraLabel:null==s?void 0:s.cameraLabel,microLabel:null==s?void 0:s.microLabel,cameraStatus:null==a?void 0:a.camera_status,micStatus:null==a?void 0:a.mic_status,sessionId:null==a?void 0:a.sessionId,publishBeginTime:null==a?void 0:a.reportPublishStateTime,serverUrl:null===(o=null==a?void 0:a.signal)||void 0===o?void 0:o.server,gwNode:null==a?void 0:a.gwNode,proto:"webrtc",frameWidth:null==c?void 0:c.frameWidth,frameHeight:null==c?void 0:c.frameHeight,rtt:null==c?void 0:c.currentRoundTripTime,videoPacketsLostRate:null==c?void 0:c.videoPacketsLostRate,audioPacketsLostRate:null==c?void 0:c.audioPacketsLostRate,videoTargetBitrate:null==c?void 0:c.videoTargetBitrate,videoBitrate:null==c?void 0:c.videoBitrate,audioTargetBitrate:null==c?void 0:c.audioTargetBitrate,audioBitrate:null==c?void 0:c.audioBitrate,videoTargetFPS:null==c?void 0:c.videoTargetFPS,videoFPS:null==c?void 0:c.videoFPS,audioFPS:null==c?void 0:c.audioFPS,videoCodecName:null==c?void 0:c.videoCodecName,audioCodecName:null==c?void 0:c.audioCodecName}})),t},enumerable:!1,configurable:!0}),e.prototype.getPublishList=function(e,t){var i=this;return this.publishStreamList.slice(e,t).map((function(e){return Wd({streamID:e},i.publishList[e])}))},Object.defineProperty(e.prototype,"publishListSize",{get:function(){return this.publishStreamList.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playStreamList",{get:function(){return Object.keys(this.ee.playerList)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playList",{get:function(){var e=this,t={};return this.playStreamList.forEach((function(i){var r,n,o,s=e.ee.playerList[i],a=null==s?void 0:s.player,c=null==a?void 0:a.playStat;t[i]={streamSid:null==s?void 0:s.streamSid,roomID:null===(r=null==s?void 0:s.room)||void 0===r?void 0:r.roomID,roomSessionID:null===(n=null==s?void 0:s.room)||void 0===n?void 0:n.roomSessionID,cameraStatus:null==a?void 0:a.cameraStatus,micStatus:null==a?void 0:a.micStatus,sessionId:null==a?void 0:a.sessionId,playBeginTime:null==a?void 0:a.reportPlayStateTime,serverUrl:null===(o=null==a?void 0:a.signal)||void 0===o?void 0:o.server,gwNode:null==a?void 0:a.gwNode,proto:"webrtc",frameWidth:null==c?void 0:c.frameWidth,frameHeight:null==c?void 0:c.frameHeight,rtt:null==c?void 0:c.currentRoundTripTime,videoPacketsLostRate:null==c?void 0:c.videoPacketsLostRate,audioPacketsLostRate:null==c?void 0:c.audioPacketsLostRate,videoBitrate:null==c?void 0:c.videoBitrate,audioBitrate:null==c?void 0:c.audioBitrate,videoFPS:null==c?void 0:c.videoFPS,audioFPS:null==c?void 0:c.audioFPS,videoCodecName:null==c?void 0:c.videoCodecName,audioCodecName:null==c?void 0:c.audioCodecName,peerToPeerDelay:null==c?void 0:c.peerToPeerDelay,firstFrameTime:null==c?void 0:c.firstFrameTime,videoJitter:null==c?void 0:c.videoJitter,audioJitter:null==c?void 0:c.audioJitter}})),t},enumerable:!1,configurable:!0}),e.prototype.getPlayList=function(e,t){var i=this;return this.playStreamList.slice(e,t).map((function(e){return Wd({streamID:e},i.playList[e])}))},Object.defineProperty(e.prototype,"playListSize",{get:function(){return this.playStreamList.length},enumerable:!1,configurable:!0}),e}(),Kd="zc.ac.mer",Jd=function(){function e(e,t,i){var r=this;this.Xn=e,this.ac=t,this.audio=i,this.error=!1,this.effectMode=1,this.eventHandler={volumechange:function(e){var t=e.target;t&&r.localOutPutNode&&(t.muted||t.paused?(r.Xn.info(Kd+" local audio muted disconnect"),r.localOutPutNode.disconnect()):(r.Xn.info(Kd+" local audio is connected"),r.localOutPutNode.connect(r.ac.destination)))}},this.Xn.info(Kd+" create audio renderer"),this.error=!this.init(),this.error||(i.addEventListener("volumechange",this.eventHandler.volumechange),i.addEventListener("pause",this.eventHandler.volumechange),i.addEventListener("play",this.eventHandler.volumechange))}return e.prototype.init=function(){var e=this.ac;try{var t=Re().match(/iPhone\sOS\s(\d+)_(\d+)_?(\d+)?/);if(t&&17==+t[1]&&0==+t[2]&&+t[3]<4)throw" iOS 17 not suppot createMediaElementSource.";"anonymous"!==this.audio.crossOrigin&&this.Xn.info(Kd+" Media element does not support cross-origin. Maybe no sound can be played"),this.srcNode=e.createMediaElementSource(this.audio),(this.localOutPutNode=e.createGain()).connect(e.destination),"suspended"===this.ac.state&&this.ac.resume()}catch(e){return this.Xn.warn(Kd+" create src failed."+e),!1}return!0},e.prototype.getMixNode=function(){var e=this.mixOutputNode;return e||(e=this.mixOutputNode=this.ac.createGain()),this.setVoiceChangeNode(this.effectMode,this.voiceChangerNode,!0),{mixOutputNode:e}},Object.defineProperty(e.prototype,"effectOnLocal",{get:function(){return[wc.Local,wc.All].includes(this.effectMode)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"effectOnMix",{get:function(){return[wc.Publish,wc.All].includes(this.effectMode)},enumerable:!1,configurable:!0}),e.prototype.setVoiceChangeNode=function(e,t,i){if(void 0===i&&(i=!1),this.localOutPutNode&&this.srcNode&&(i||this.voiceChangerNode!==t||this.effectMode!==e)){this.effectMode=e,this.srcNode.disconnect();var r=this,n=r.mixOutputNode,o=r.effectOnLocal,s=r.effectOnMix;if(this.Xn.info(Kd+" set voice changer render. ".concat(JSON.stringify({mode:e,node:!!t,force:i,effectOnLocal:o,effectOnMix:s}))),t)t.disconnect(),this.srcNode.connect(t),o?t.connect(this.localOutPutNode):this.srcNode.connect(this.localOutPutNode),n&&(s?t.connect(n):this.srcNode.connect(n)),this.voiceChangerNode=t;else{var a=this.srcNode;a.connect(this.localOutPutNode),this.mixOutputNode&&a.connect(this.mixOutputNode),this.voiceChangerNode=void 0}}},e.prototype.destroy=function(){var e;null===(e=this.localOutPutNode)||void 0===e||e.connect(this.ac.destination),this.audio.removeEventListener("volumechange",this.eventHandler.volumechange),this.audio.removeEventListener("pause",this.eventHandler.volumechange),this.audio.removeEventListener("play",this.eventHandler.volumechange)},e}(),Yd=function(){function e(e){var t=this;this.Xn=e,this.isResuming=!1,this.elementNodeMap=new Map,this.workletMap=new Map,this.eventHandler={resumeAudioContext:function(e){var i=t.ac.state;if("running"!==i){var r=null==e?void 0:e.type;t.Xn.info("zc.ac.rs call "+i+", "+r),t.ac.resume().then((function(){t.Xn.info("zc.ac.rs end "+t.ac.state+", "+r)}))}else t.offCheckAudioContextListener()}},this.id=Date.now();var i=window.AudioContext||window.webkitAudioContext;this.ac=new i,this.Xn.info("zc.ac.0 ".concat(this.id," ").concat(this.ac.state,", ").concat(this.ac.sampleRate)),this.ac.addEventListener("statechange",(function(){var e,i=null===(e=t.ac)||void 0===e?void 0:e.state;t.Xn.info("zc.ac.sc ".concat(t.id," ").concat(i)),"running"!==i&&t.checkAudioContext()})),this.checkAudioContext()}return e.create=function(t){return e.mgr?e.mgr.Xn=t:e.mgr=new e(t),e.mgr},e.prototype.getMediaElementRenderer=function(e){var t=this.elementNodeMap.get(e);return t||((t=new Jd(this.Xn,this.ac,e)).error?null:(this.elementNodeMap.set(e,t),t))},e.prototype.checkAudioContext=function(){if(this.Xn.info("zc.ac.cac call"),this.ac&&"suspended"===this.ac.state){var e=this.eventHandler.resumeAudioContext;Pe()&&e(),window.addEventListener("mousedown",e)}},e.prototype.offCheckAudioContextListener=function(){this.Xn.info("zc.ac.ocac call"),window.removeEventListener("mousedown",this.eventHandler.resumeAudioContext)},e.prototype.registerModule=function(e,t){return function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var i,r,n;return function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}(this,(function(o){switch(o.label){case 0:if(this.workletMap.get(e))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),i=new Blob([t],{type:"text/javascript"}),r=URL.createObjectURL(i),[4,this.ac.audioWorklet.addModule(r)];case 2:return o.sent(),this.workletMap.set(e,!0),[3,4];case 3:return n=o.sent(),this.Xn.error("zc.ac.rm.0 ".concat(e," fail ").concat(n.toString())),[3,4];case 4:return[2]}}))}))},e.prototype.destroy=function(){this.offCheckAudioContextListener()},e}(),$d=function(){return $d=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},$d.apply(this,arguments)},eh=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},th=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},ih=function(){function e(t,i,r,n,o,a){void 0===o&&(o=0),void 0===a&&(a=H.Default);var c,u,l=this;if(this.logger=t,this.reporter=r,this.recordedBlobs=[],this.mediaRecorder=null,e.isInstantiated=!0,this.Xn=t,this.dataReport=i,this.acMgr=Yd.create(this.Xn),this.stateCenter=new Aa(this.Xn,this.dataReport),this.re=this.stateCenter,this.re.clientType="webrtc",this.re.settingConfig=new Qd(null===(c=e.engineOptions)||void 0===c?void 0:c.closeCloudSetting),!0===(null===(u=e.engineOptions)||void 0===u?void 0:u.pri)){var d=e.engineOptions.netMode;d!==K.Extranet&&d!==K.Intranet||(this.re.netMode=e.engineOptions.netMode)}this.RTM=n,this.re.appid=n.getAppID(),this.streamCenter=new Vd(this.Xn,this.re,this.dataReport,this.RTM,this.acMgr,{type:e.geoFenceType,areaList:e.geoFenceAreaList}),this.ee=this.streamCenter,this.re.browser=Gd.browserDetails.browser,this.re.browserInfo=ke(),this.getSDKVersionNum(),this.RTM.cloudSetting.setEnvVariable("sdk_version",s),this.initTracer(r),this.rtcModules=new Ru(this.Xn,this.dataReport,this.re,this.ee,this.RTM,this.ac,this),this.RTM.cloudSetting.getSettingCache("rtc").then((function(e){var t,i;l.Xn.info("zc.0 streamConfig "+JSON.stringify(e));var r=l.ve.createSpan(F.H,{key:ci},{key:""},"/cloud_setting/cache");if(r.setAttributes({files:nr([{name:"rtc",content:JSON.stringify(null==e?void 0:e.setting),versions:JSON.stringify(null==e?void 0:e.versions),code:0,message:""}])}),r.end(),l.re.settingConfig.setSetting(null==e?void 0:e.setting),null===(t=null==e?void 0:e.setting)||void 0===t?void 0:t.open_mini_sdp){var n=l.re.settingConfig.getSetting("open_mini_sdp");null===(i=l.ee)||void 0===i||i.initMiniSdpWorker(n)}})).catch((function(e){l.Xn.warn("zc.0 streamConfig "+JSON.stringify(e))})),this.re.rtm=this.RTM,this.re.streamCenter=this.ee,[3,4,5,6,7,8].includes(a)?(this.re.scenario=a,this.Xn.info(Sa+" "+a+" success")):100===a?(this.stateCenter.scenario=a,this.Xn.info(Sa+" "+a+" liveroom set")):(this.re.scenario=H.Default,this.Xn.error(Sa+" "+a+" please use valid scenario"))}return Object.defineProperty(e.prototype,"ac",{get:function(){return this.acMgr.ac},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ve",{get:function(){return this.re.reporter},enumerable:!1,configurable:!0}),e.setGeoFence=function(t,i){if(e.isInstantiated)throw $e;e.geoFenceType=t,e.geoFenceAreaList=i},e.setEngineOptions=function(t){e.engineOptions=t,t.geoFenceType&&(e.geoFenceType=t.geoFenceType),t.geoFenceAreaList&&(e.geoFenceAreaList=t.geoFenceAreaList),"boolean"==typeof t.closeNetProbe&&Vd.setCloseNetProbe(t.closeNetProbe)},e.prototype.destroyEngineHandler=function(){var e=this;this.Xn.info("zc.1 call");var t=function(){return!e.RTM.stateCenter.roomModulesList.some((function(e){return!(e.isLogout()||"DISCONNECTED"===e.roomState)}))},i=function(){e.RTM.destroyRTM();for(var t=0,i=e.ee.previewStreamList;t<i.length;t++){var r=i[t];r.localStream&&e.destroyStream(r.localStream)}e.RTM.netAgent.destroy(),e.re.actionListener("_engineDestroy"),e.acMgr.destroy(),e.ee.destroy(),e.re.destroy(),e.Xn.info("zc.1 call success"),e.Xn.destroy()};t()?i():(this.RTM.stateCenter.onListener("_roomStateUpdate",(function(e,r){"DISCONNECTED"===r&&t()&&i()})),this.RTM.logoutRoom())},e.prototype.mutePublishStreamVideo=function(e,t,i){return!1},e.prototype.mutePublishStreamAudio=function(e,t){return!1},e.prototype.mutePlayStreamVideo=function(e,t){throw qe(["advanced"])},e.prototype.mutePlayStreamAudio=function(e,t){throw qe(["advanced"])},e.prototype.muteMicrophone=function(e){return!1},e.prototype.isMicrophoneMuted=function(){return!this.ee.isMicEnabled},e.prototype.setAudioOutput=function(e,t){return this.Xn.info("zc.sao call"),ln(t)?this.rtcModules.playModule.setStreamAudioOutput(e,t):(this.Xn.error("audiooutput is not string"),!1)},e.prototype.setCustomSignalUrl=function(e){if(this.Xn.info(Ao+" call: "+e),e&&0!=e.length){var t=!0;e.forEach((function(e){return 0!=e.indexOf("wss://")&&(t=!1)})),t?this.re.customUrl=e:this.Xn.error(Ao+" url is not correct")}else this.Xn.error(Ao+" param error")},e.prototype.setGWNode=function(e){ln(e)&&e.length>0&&(this.ee.gwNode=e)},e.prototype.setQualityMonitorCycle=function(e){return un(e)&&e>=1e3?(this.ee.setQualityMonitorCycle(e),!0):(this.Xn.error("zc.sqmc.0 time must be number and bigger than 1000"),!1)},e.prototype.startPlayingStream=function(e,t,i){return this.Xn.info(Io+" call by user"),this.rtcModules.playModule.startPlayingStream(e,t,i)},e.prototype.stopPlayingStream=function(e){this.Xn.info(ko+" call by user"),this.rtcModules.playModule.stopPlayingStream(e,void 0,!0)},e.prototype.setPlayAccelerate=function(e){this.re.playAccelerate=e},e.prototype.setTurnOverTcpOnly=function(e){this.Xn.info("zc.stoto call "+e),dn(e)?this.re.turnOverTcpOnly=e:this.Xn.error("zc.p.stoto.0 param must be param")},e.prototype.createStream=function(e){return this.rtcModules.publishModule.createStream(e,!0)},e.prototype.createZegoStream=function(e){return this.rtcModules.publishModule.createZegoStream(e)},e.prototype.setRoomScenario=function(e){return[3,4,5,6,7,8].includes(e)?(this.Xn.info(_a+" "+e+" called"),this.re.roomList.length?(this.Xn.error(_a+" "+JSON.stringify(Nt)),!1):(this.re.scenario=e,this.Xn.info(_a+" "+e+" called success"),!0)):(this.Xn.error(_a+" "+e+" please use valid scenario"),!1)},e.prototype.destroyStream=function(e){this.rtcModules.publishModule.destroyStream(e)},e.prototype.startPublishingStream=function(e,t,i,r){return this.Xn.info(wo+" call by user"),this.rtcModules.publishModule.startPublishingStream(e,t,i?$d({},i):i,r)},e.prototype.updatePublishingStream=function(e,t){return this.Xn.info(Ca+" call by user"),this.rtcModules.publishModule.updatePublishingStream(e,t)},e.prototype.activateSEIInsert=function(e){throw qe(["advanced"])},e.prototype.setSEIConfig=function(e){this.Xn.info("zc.ssc "+JSON.stringify(e)),this.re.seiConfig=$d($d({},this.re.seiConfig),e),this.re.player265ReceiverList.forEach((function(e){e.sendMsg({type:"SEIConfigUpdate"})}))},e.prototype.sendSEI=function(e,t){return this.rtcModules.publishModule.sendSEI(e,t)},e.prototype.stopPublishingStream=function(e){return this.Xn.info(Ro+" call by user"),this.rtcModules.publishModule.stopPublishingStream(e,void 0,!0,!0)},e.prototype.setVideoConfig=function(e,t){return this.rtcModules.advancedModule?this.rtcModules.advancedModule.setVideoConfig(e,t):Xe(["advanced"])},e.prototype.setAudioConfig=function(e,t){return this.rtcModules.advancedModule?this.rtcModules.advancedModule.setAudioConfig(e,t):Xe(["advanced"])},e.prototype.replaceTrack=function(e,t,i){return this.rtcModules.advancedModule?this.rtcModules.advancedModule.replaceTrack(e,t,i):Xe(["advanced"])},e.prototype.preloadEffect=function(e,t,i){if(void 0===this.rtcModules.audioMixModule)throw qe(["audio mix"]);this.rtcModules.audioMixModule.preloadEffect(e,t,i)},e.prototype.getEffectDuration=function(e){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.getEffectDuration(e);throw qe(["audio mix"])},e.prototype.getEffectCurrentProgress=function(e,t){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.getEffectProgress(e,t);throw qe(["audio mix"])},e.prototype.seekAudioEffect=function(e,t,i){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.seekAudioEffect(e,t,i);throw qe(["audio mix"])},e.prototype.playEffect=function(e,t,i){if(void 0===this.rtcModules.audioMixModule)throw qe(["audio mix"]);this.rtcModules.audioMixModule.playEffect(e,t,i)},e.prototype.pauseEffect=function(e,t){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.pauseEffect(e,t);throw qe(["audio mix"])},e.prototype.resumeEffect=function(e,t){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.resumeEffect(e,t);throw qe(["audio mix"])},e.prototype.stopEffect=function(e,t){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.stopEffect(e,t);throw qe(["audio mix"])},e.prototype.unloadEffect=function(e){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.unloadEffect(e);throw qe(["audio mix"])},e.prototype.setEffectVolume=function(e,t,i,r){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.setEffectVolume(e,t,i,r);throw qe(["audio mix"])},e.prototype.startMixingAudio=function(e,t){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.startMixingAudio(e,t);throw qe(["audio mix"])},e.prototype.stopMixingAudio=function(e,t){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.stopMixingAudio(e,t);throw qe(["audio mix"])},e.prototype.mixingBuffer=function(e,t,i,r){if(void 0===this.rtcModules.audioMixModule)throw qe(["audio mix"]);this.rtcModules.audioMixModule.mixingBuffer(e,t,i,r)},e.prototype.stopMixingBuffer=function(e,t){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.stopMixingBuffer(e,t);throw qe(["audio mix"])},e.prototype.setMixingAudioVolume=function(e,t,i){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.setMixingAudioVolume(e,t,i);throw qe(["audio mix"])},e.prototype.checkSystemRequirements=function(t,i){var r=this,n=navigator&&navigator.mediaDevices&&(e.screenShotReady||"getDisplayMedia"in navigator.mediaDevices);return this.Xn.info("zc.csr call"+Re()),new we((function(e){var o=r.ve.createSpan(F.H,{key:ci},{key:""},"/sdk/check_system"),s=i||"all",a=function(t){o.setAttributes({capability:Oi(t)}),o.end();var i=r.re.checkList.indexOf(s);r.re.checkList.splice(i,1),e(t)};return["webRTC","customCapture","camera","microphone","screenSharing","H264","VP8","all"].includes(s)&&[0,1].includes(t)?r.re.checkList.includes(s)||r.re.checkList.includes("all")?a({result:!1,errInfo:{extendedDate:"The last test of the same type has not returned a result "}}):(r.re.checkList.push(s),void lo(n,a,t,i,r.re.customUa)):a({result:!1,errInfo:{extendedDate:"param error"}})}))},e.prototype.enumDevices=function(e,t){return eh(this,void 0,void 0,(function(){var i,r,n,o,s,a,c,u,l,d,h,p,f,m=this;return th(this,(function(v){switch(v.label){case 0:return this.Xn.info("zc.ed.0 call"),i=function(){return new we((function(e,i){var r=m.ve.createSpan(F.H,{key:ri},{key:""},"/device/list");m.rtcModules.publishModule.recordDevices((function(i){var n=[],o=!0,s=!0;i.cameras.forEach((function(e){""===e.deviceID&&(o=!1),n.push({device:e.deviceID,device_name:e.deviceName,type:0})})),i.microphones.forEach((function(e){""===e.deviceID&&(s=!1),n.push({device:e.deviceID,device_name:e.deviceName,type:1})})),i.speakers.forEach((function(e){return n.push({device:e.deviceID,device_name:e.deviceName,type:2})})),r.setAttributes({dev_list:Pi(n),dev_kind:Ai(t||"all")}),r.end(),e({devices:i,enableCamera:o,enableMic:s})}),(function(e){m.ve.setError(r,e),i(e)}))}))},[4,i()];case 1:return r=v.sent(),n=r.enableCamera,o=r.enableMic,s=r.devices,e?(this.Xn.info("zc.ed.0 check permission"),a={video:!0,audio:!0},"videoinput"===t?a.audio=!1:"audioinput"!==t&&"audiooutput"!==t||(a.video=!1),u=a.audio&&!o,(c=a.video&&!n)||u?(this.Xn.info("zc.ed.0 need to get device permission. needCamera: ".concat(c,", needMic: ").concat(u)),[4,yo(a).catch((function(){}))]):[3,4]):[3,4];case 2:return(l=v.sent())&&l.getTracks().forEach((function(e){e.stop()})),[4,i()];case 3:d=v.sent(),h=d.devices,p=d.enableCamera,f=d.enableMic,a.video&&!p&&this.Xn.warn("zc.ed.0 get video device permission failed."),a.audio&&!f&&this.Xn.warn("zc.ed.0 get audio device permission failed."),s=h,v.label=4;case 4:return[2,s]}}))}))},e.prototype.getCameras=function(){return eh(this,void 0,void 0,(function(){return th(this,(function(e){switch(e.label){case 0:return[4,this.enumDevices(!0,"videoinput")];case 1:return[2,e.sent().cameras]}}))}))},e.prototype.getMicrophones=function(){return eh(this,void 0,void 0,(function(){return th(this,(function(e){switch(e.label){case 0:return[4,this.enumDevices(!0,"audioinput")];case 1:return[2,e.sent().microphones]}}))}))},e.prototype.getSpeakers=function(){return eh(this,void 0,void 0,(function(){return th(this,(function(e){switch(e.label){case 0:return[4,this.enumDevices(!0,"audiooutput")];case 1:return[2,e.sent().speakers]}}))}))},e.prototype.getAudioInfo=function(e,t,i){},e.prototype.getSoundLevel=function(e,t,i){if(!this.rtcModules.audioMixModule)throw qe(["audio mix"]);this.rtcModules.audioMixModule.getSoundLevel(e,t,i)},e.prototype.stopSoundLevel=function(e){if(!this.rtcModules.audioMixModule)throw qe(["audio mix"]);this.rtcModules.audioMixModule.stopSoundLevel(e)},e.prototype.handleDataAvailable=function(t){t.data&&t.data.size>0&&e.recordedBlobs.push(t.data)},e.prototype.setAudioFrameCallback=function(e,t,i){return this.rtcModules.playModule.setAudioFrameCallback(e,t,i)},e.prototype.startRecord=function(e){var t=this,i=this.ee.checkPreview(e);if(!i)throw"start record failed. streamNotFromZegoStr.";var r=e.clone(),n=r.getAudioTracks();n.length>0&&i.hasEmptyAudioTrack&&n.forEach((function(e){r.removeTrack(e)})),this.recordedBlobs=[];var o={mimeType:"video/webm;codecs=vp9"};console.log("MediaRecorder",MediaRecorder),MediaRecorder.isTypeSupported(o.mimeType)||(o={mimeType:"video/webm;codecs=vp8,opus"},MediaRecorder.isTypeSupported(o.mimeType)||(o={mimeType:"video/webm;codecs=vp8"},MediaRecorder.isTypeSupported(o.mimeType)||(o={mimeType:"video/webm"},MediaRecorder.isTypeSupported(o.mimeType)||(o={mimeType:""}))));try{this.mediaRecorder=new MediaRecorder(r,o)}catch(e){return void this.Xn.error("zc.mdrcd Exception while creating ZegoMediaRecorder:",e)}this.mediaRecorder.onstop=function(e){t.Xn.warn("zc.mdrcd Recorder stopped: "+e)},this.mediaRecorder.ondataavailable=this.handleDataAvailable.bind(this),this.mediaRecorder.start(10)},e.prototype.stopRecord=function(){this.mediaRecorder?this.mediaRecorder.stop():this.Xn.warn("zc.mdrcd please invoke startRecord first")},e.prototype.resumeRecord=function(){this.mediaRecorder?this.mediaRecorder.resume():this.Xn.warn("zc.mdrcd please invoke startRecord first")},e.prototype.pauseRecord=function(){this.mediaRecorder?this.mediaRecorder.pause():this.Xn.warn("zc.mdrcd please invoke startRecord first")},e.prototype.saveRecord=function(e){if(this.mediaRecorder&&this.recordedBlobs){var t=new Blob(this.recordedBlobs,{type:"video/webm"}),i=window.URL.createObjectURL(t),r=Ie.createElement("a");r.style.display="none",r.href=i,r.download=e+".webm",Ie.body.appendChild(r),r.click(),setTimeout((function(){Ie.body.removeChild(r),window.URL.revokeObjectURL(i)}),100)}else this.Xn.warn("please invoke startRecord first")},e.prototype.useVideoDevice=function(e,t){return this.rtcModules.advancedModule?this.rtcModules.advancedModule.useVideoDevice(e,t):Xe(["advanced"])},e.prototype.useAudioDevice=function(e,t){return this.rtcModules.advancedModule?this.rtcModules.advancedModule.useAudioDevice(e,t):Xe(["advanced"])},e.prototype.useFrontCamera=function(e,t){if(this.rtcModules.advancedModule)return this.rtcModules.advancedModule.useFrontCamera(e,t);throw qe(["advanced"])},e.prototype.getElectronScreenSources=function(){return this.rtcModules.publishModule.getElectronScreenSources()},e.prototype.setSoundLevelDelegate=function(e,t,i){this.Xn.info("zc.ssd.0 call"),dn(e)?t&&(!Nn(t)||t<100||t>3e3)?this.Xn.error("zc.ssd.0 soundLevel interval must be integer number which is between 100 and 3000"):this.ee.setSoundLevelDelegate(e,t,i):this.Xn.error("zc.ssd.0 param 1 must be boolean")},e.prototype.on=function(e,t){return this.rtcModules.bindListener(e,t)},e.prototype.off=function(e,t){return this.rtcModules.deleteListener(e,t)},e.prototype.getVersion=function(){return s},e.prototype.setStreamExtraInfo=function(e,t){return this.rtcModules.streamCommon.setStreamExtraInfo(e,t)},e.prototype.addPublishCdnUrl=function(e,t){return this.Xn.info("zg.cm.apu call "+e+" "+t),this.rtcModules.streamCDNModule?this.rtcModules.streamCDNModule.publishTarget({type:"addpush",streamID:e,pushUrl:t}):Xe(["stream CDN"])},e.prototype.removePublishCdnUrl=function(e,t){return this.Xn.info("zg.cm.apu call "+e+" "+t),this.rtcModules.streamCDNModule?this.rtcModules.streamCDNModule.publishTarget({type:"delpush",streamID:e,pushUrl:t}):Xe(["stream CDN"])},e.prototype.startMixerTask=function(e){return Xe(["mix stream"])},e.prototype.setMixerTaskConfig=function(e){return Xe(["mix stream"])},e.prototype.stopMixerTask=function(e){return Xe(["mix stream"])},e.prototype.setCaptureVolume=function(e,t){return this.rtcModules.publishModule.setCaptureVolume(e,t)},e.use=function(t){switch(t.type){case"AudioMix":t.install(Ru,el);break;case"MixStream":t.install(e,Oa,Ru);break;case"StreamCDN":t.install(e,Ru,Oa);break;case"Advance":t.install(e,Ru,Oa,Gc,Su,vu,el,Ol);break;case"BeautyEffect":case"VoiceChanger":t.install(e,Gc);break;case"RangeAudio":case"DataChannel":case"AiDenoise":case"BackgroundProcess":case"CopyrightedMusic":case"StreamCompositor":t.install(e)}},e.prototype.createRangeAudioInstance=function(){throw qe(["range audio"])},e.prototype.createCopyrightedMusic=function(){throw qe(["copyrighted music"])},e.prototype.destroyCopyrightedMusic=function(){throw qe(["copyrighted music"])},e.prototype.createRealTimeSequentialDataManager=function(e){throw qe(["data channel"])},e.prototype.destroyRealTimeSequentialDataManager=function(e){throw qe(["data channel"])},e.prototype.enableDataChannel=function(e){dn(e)&&(this.ee.isDataChannelEnabled=e)},e.prototype.addTrack=function(e,t){return Xe(["advanced"])},e.prototype.removeTrack=function(e,t){return Xe(["advanced"])},e.prototype.setBeautyEffect=function(e,t,i){return Xe(["beauty effect"])},e.prototype.setLowlightEnhance=function(e,t){return Xe(["beauty effect"])},e.prototype.getPublishingStreamQuality=function(e){return this.rtcModules.publishModule.getStreamStats(e)},e.prototype.getPlayingStreamQuality=function(e){return this.rtcModules.playModule.getStreamStats(e)},e.prototype.checkAudioTrackIsActive=function(e){var t=this;return this.Xn.info("zc.caia.0 call"),new we((function(i,r){if(e=oo(e,t.Xn),!t.checkTrackParam(e,1))return t.Xn.info("zc.caia.0 param active: false"),i(!1);var n=0;try{var o=0,s=t.ee.createSoundLevel(t.ac,e,50,50,(function(e){e*=100;var r=!1;o>=4?(a.destroy(),(e>0||n>0)&&(r=!0),t.Xn.info("zc.caia.0 active: "+r),i(r)):n=Math.max(e,n),o++})),a=s.soundMeter;a&&s.mic||(t.Xn.error("zc.cvia.1 checkVideoTrackIsActive not supported"),i(!1))}catch(e){t.Xn.error("zc.cvia.1 "+e),i(!1)}}))},e.prototype.checkVideoTrackIsActive=function(e){var t=this;this.Xn.info("zc.cvia.0 call");var i=this;return new we((function(r,n){if(e=oo(e,t.Xn),!t.checkTrackParam(e,0))return t.Xn.info("zc.cvia.1 param active: false"),r(!1);var o=Ne(1,1),s=Oe(160,120).getContext("2d");s&&(null==s?void 0:s.drawImage)&&(null==s?void 0:s.getImageData)||(i.Xn.error("zc.cvia.1 checkVideoTrackIsActive not supported"),r(!1)),o.style.position="fixed",o.style.left="-1000px",o.style.opacity="0.01",Ie.body.appendChild(o),o.srcObject=e;var a=null;function c(){s=null;try{o.pause(),o.remove(),o.srcObject=null}catch(e){}}function u(){o.play();var e=setTimeout((function(){clearTimeout(e),e=null,o.removeEventListener("canplay",u),null==s||s.drawImage(o,0,0,160,120);var t=setTimeout((function(){clearTimeout(t),t=null;var e=null==s?void 0:s.getImageData(0,0,160,120),n=(null==e?void 0:e.data)&&Math.floor(e.data.length/3);if(n){for(var o=3;o<n;o+=4)if(0!==e.data[o-1]||0!==e.data[o-2]||0!==e.data[o-3])return i.Xn.info("zc.cvia.0 active: true"),r(!0),void c();c(),i.Xn.info("zc.cvia.1 active: false"),r(!1)}}),20)}),200)}o.addEventListener("canplay",u),a=setTimeout((function(){clearTimeout(a),o.removeEventListener("canplay",u),c(),r(!1)}),1e3)}))},e.prototype.checkTrackParam=function(e,t){var i,r=this;if(this.Xn.info("zc.ctp.0 call type:"+t),!gn(e))return this.Xn.error("zc.ctp.1 param 1 must be MediaStream"),!1;var n=this.ee.checkPreview(e),o=Object.keys(this.ee.playerList).find((function(t){var i,n;return(null===(n=null===(i=r.ee.playerList[t])||void 0===i?void 0:i.player)||void 0===n?void 0:n.playStream)===e}));if(!n&&!o)return this.Xn.error("zc.ctp.1 "+Ve),!1;var s=e[0==t?"getVideoTracks":"getAudioTracks"]()[0];return s?"live"!==s.readyState||!s.enabled||s.muted?(this.Xn.info("zc.ctp.0 type:".concat(t," state:").concat(s.readyState," enabled:").concat(s.enabled," muted:").concat(s.muted)),!1):!o||0===(null===(i=this.ee.playerList[o])||void 0===i?void 0:i.player.micStatus):(this.Xn.error("zc.cvia.1 the stream has not track"),!1)},e.prototype.setDummyCaptureImagePath=function(e,t){if(this.rtcModules.advancedModule)return this.rtcModules.advancedModule.setDummyCaptureImagePath(e,t);throw qe(["advanced"])},e.prototype.setAccess=function(e){this.RTM.setAccess(e),this.re.useNetAgent=this.RTM.getSettingUnify(!0),this.RTM.setAccess(this.re.useNetAgent),this.re.useNetAgent=this.RTM.isUseNetAgent},e.prototype.setTestPackageSize=function(e){this.RTM.setTestPackageSize(!0),this.re.testNetPackageSize=e},e.prototype.setAudioOutputDevice=function(e,t){return eh(this,void 0,void 0,(function(){var i,r=this;return th(this,(function(n){return i=null==e?void 0:e.setSinkId,this.Xn.info("zc.saopd call:"+t),[2,new we((function(n,o){return eh(r,void 0,void 0,(function(){var r,s,a,c=this;return th(this,(function(u){switch(u.label){case 0:if(r=function(e){c.Xn.info("zc.saopd error"+JSON.stringify(e)),o({errorCode:e.code,extendedData:e.message})},!i)return[3,5];if(e.setsinkid&&(e.setsinkid.enabled=!0),!t||!ln(t))return[2,r({code:Tt.code,message:"the 'deviceID' is invalid"})];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,i.call(e,t)];case 2:return u.sent(),[3,4];case 3:return s=u.sent(),(a=e.srcObject)&&!a.getAudioTracks()[0]?[2,r(Qt)]:[2,r({code:1103093,message:s})];case 4:return[2,n(!0)];case 5:throw Error("Browser not support set audio output.")}}))}))}))]}))}))},e.prototype.enableCameraCapturing=function(e,t){return void 0===t&&(t=!0),eh(this,void 0,void 0,(function(){return th(this,(function(e){throw qe(["advanced"])}))}))},e.prototype.enableDualStream=function(e){if(!this.rtcModules.advancedModule)throw qe(["advanced"]);this.rtcModules.advancedModule.enableDualStream(e)},e.prototype.setLowStreamParameter=function(e,t){if(!this.rtcModules.advancedModule)throw qe(["advanced"]);this.rtcModules.advancedModule.setLowStreamParameter(e,t)},e.prototype.setRemoteDefaultVideoStreamType=function(e){this.Xn.info("zc.srdvs call"),[0,1,2].includes(e)?this.re.streamType=e:this.Xn.error("zc.srdvs streamType must be number 0 or 1 or 2")},e.prototype.enableVideoHardwareEncoder=function(e){if(dn(e)){var t=this.re.settingConfig;t.setUserValue("hardware_encode",e),t.setUserValue("camera_hard_encode",e),t.setUserValue("custom_hard_encode",e)}},e.prototype.createLocalViewer=function(e){var t=this.ee.checkPreview(e),i=null==t?void 0:t.getViewer();if(!i)throw Error("create viewer failed.");return new jd(i)},e.prototype.createRemoteViewer=function(e){var t=this.ee.checkPlayer(e),i=null==t?void 0:t.getViewer();if(!i)throw Error("create viewer failed.");return new jd(i)},e.prototype.createStreamCompositor=function(){throw qe(["stream compositor"])},e.prototype._enableAiDenoise=function(e,t,i){return i==Ic.AIBalanced||i==Ic.AI?this.setVoiceChangerPreset(e,{ANS:{enable:t,mode:i}}):this.enableAiDenoise(e,t)},e.prototype.enableAiDenoise=function(e,t){return Xe(["ai denoise"])},e.prototype.setAiDenoiseMode=function(e,t){return Xe(["voice changer with AIBalance"])},e.prototype.muteAllPlayAudioStreams=function(e){throw qe(["advanced"])},e.prototype.muteAllPlayVideoStreams=function(e){throw qe(["advanced"])},e.prototype.setVoiceChangerPreset=function(e,t){return Xe(["voice changer","advanced"])},e.prototype.enableLiveAudioEffect=function(e,t,i){return Xe(["voice changer","advanced"])},e.prototype.loadBackgroundBlurModule=function(){return Xe(["blur background","advanced"],-1)},e.prototype.initBackgroundModule=function(e,t){return Xe(["blur background","advanced"],-1)},e.prototype.setBackgroundBlurOptions=function(e,t){throw qe(["blur background","advanced"])},e.prototype.setVirtualBackgroundOptions=function(e,t){throw qe(["blur background","advanced"])},e.prototype.setTransparentBackgroundOptions=function(e){throw qe(["blur background","advanced"])},e.prototype.enableBackgroundProcess=function(e,t,i){return Xe(["advanced"])},e.prototype.enableAutoSwitchDevice=function(e){if(this.rtcModules.advancedModule)return this.rtcModules.advancedModule.enableAutoSwitchDevice(e);throw qe(["advanced"])},e.prototype.getSDKVersionNum=function(){var e=this.getReporterVersion(r.SDKProject_ZegoWebRTC,s);this.re.sdkVerNum=e},e.prototype.initTracer=function(e){this.re.reporter=e;var t=new Zd(this.RTM.stateCenter,this.re,this.ee);this.ve.setCommonStates(t),this.ve.setResource({sdk_version:s,report_version:this.re.sdkVerNum})},e.prototype.getReporterVersion=function(e,t){var i=t.split(".").map((function(e){return parseInt(e)}));return e<<28|i[0]<<20|i[1]<<8|i[2]},e.prototype.setEngineConfig=function(e){if(this.re.engineConfig=$d($d({},this.re.engineConfig),e),this.checkQualityInterval(),this.re.actionListener("_engineConfigUpdate",this.re.engineConfig),e.adaptCustomUA){var t=Re();this.re.customUa=t.includes("iOS"),this.Xn.info("zc.sec.0 custom ua ".concat(t))}pn(e.setUserInfo)&&this.wr(e.setUserInfo)},e.prototype.wr=function(e){this.logger.info("zc.sui "+JSON.stringify(e));var t=e.token,i=e.userID;this.logger.setTokenInfo(t||"",i,e.userName),i&&t&&this.re.reporter.setReporterInfo(i,t)},e.prototype.checkQualityInterval=function(){var e=this.re.engineConfig,t=e.publishQualityInterval,i=e.playQualityInterval;un(t)&&0!==t&&t<S&&(this.re.engineConfig.publishQualityInterval=S),un(i)&&0!==i&&i<S&&(this.re.engineConfig.playQualityInterval=S)},e.prototype.inject=function(e,t){var i=this;if("ZegoExpressPlayer"!==e)throw new Error("You are not authorized to use 'inject' method!");t({appid:this.re.appid,logger:this.Xn,validateToken:function(e,t){return eh(i,void 0,void 0,(function(){return th(this,(function(i){switch(i.label){case 0:return this.re.player265Validated?[2,!0]:[4,this.RTM.fetchAppConfigByTargetToken(e,t)];case 1:return i.sent()&&(this.re.player265Validated=!0),[2,!!this.re.player265Validated]}}))}))},isLogin:function(){return i.re.rtm&&i.re.rtm.stateCenter.roomModulesList.some((function(e){return e.isLogin()}))},seiConfig:function(){return i.re.seiConfig},addReceiver:function(e){i.re.player265ReceiverList.push(e)},removeReceiver:function(e){i.re.player265ReceiverList=i.re.player265ReceiverList.filter((function(t){return t!=e}))}})},e.prototype.setStreamAlignmentProperty=function(e,t){return eh(this,void 0,void 0,(function(){var i,r,n,o;return th(this,(function(s){switch(s.label){case 0:return i="zc.ssap",r=ln(e),this.Xn.info(i+" call. "+(r?e:null==e?void 0:e.id)+" alignment: ".concat(t)),n=null,(n=r?this.ee.publisherList[e]:this.ee.checkPublish(e))&&6===n.publisher.state?[4,n.publisher.setStreamAlignmentProperty(t)]:(this.Xn.error(i+" failed. setStreamAlignmentProperty failed, stream not published."),[2,!1]);case 1:return o=s.sent(),this.Xn.info(i+" end. "+o),[2,o]}}))}))},e.prototype.setTurnServer=function(e){if(!mn(e))throw"'setTurnServer' failed. param error.";this.streamCenter.turnServers=function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}([],e,!0)},e.prototype.destroyEngine=function(){if(this.re.engineDestroy)throw new Error("ZegoExpressEngine has been destroyed.");this.destroyEngineHandler(),this.re.engineDestroy=!0},e.prototype.uploadLog=function(){return this.RTM.uploadLog()},e.prototype.callExperimentalAPI=function(e){return this.stateCenter.callExperimentalAPI(e)},e.screenShotReady=!1,e.isInstantiated=!1,e}();window.addEventListener("message",(function(e){"SS_PING"===e.data.type&&(ih.screenShotReady=!0)}));var rh,nh=function(){return nh=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},nh.apply(this,arguments)},oh=function(){function e(e,t){this.Er=e,this.Sr=t}return e.prototype.start=function(e,t,i,r){this.Er.playEffect(nh({stream:this.Sr,effectID:e},t||{}),i,r)},e.prototype.stop=function(e){return this.Er.stopEffect(this.Sr,e)},e.prototype.pause=function(e){return this.Er.pauseEffect(this.Sr,e)},e.prototype.resume=function(e){return this.Er.resumeEffect(this.Sr,e)},e.prototype.setVolume=function(e,t,i){return this.Er.setEffectVolume(this.Sr,t,e,i)},e.prototype.getTotalDuration=function(e){return this.Er.getEffectDuration(e)},e.prototype.getCurrentProgress=function(e){return this.Er.getEffectCurrentProgress(this.Sr,e)},e.prototype.seekTo=function(e,t){return this.Er.seekAudioEffect(this.Sr,e,t)},e}(),sh=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ah=function(e){function t(t,i,r){var n=this;return o.ZegoExpressWebRTMEngine.version="3.4.0",(n=e.call(this,t,i,0,arguments[2])||this).zegoWebRTC=new ih(n.logger,n.dataReport,n.reporter,n.zegoWebRTM,0,null==r?void 0:r.scenario),n}return sh(t,e),t.prototype.setEngineConfig=function(e){this.zegoWebRTC.setEngineConfig(e)},t.setEngineOptions=function(e){o.ZegoExpressWebRTMEngine.setEngineOptions(e),ih.setEngineOptions(e)},t.setGeoFence=function(e,t){ih.setGeoFence(e,t),o.ZegoExpressWebRTMEngine.setGeoFence(e,t)},t.prototype.setRoomScenario=function(e){return this.zegoWebRTC.setRoomScenario(e)},t.prototype.setSEIConfig=function(e){this.zegoWebRTC.setSEIConfig(e)},t.use=function(e){o.ZegoExpressWebRTMEngine.use(e),ih.use(e)},t.prototype.checkSystemRequirements=function(e,t){return void 0===t&&(t=0),this.zegoWebRTC.checkSystemRequirements(t,e)},t.prototype.off=function(e,t){return this.zegoWebRTM.stateCenter.listenerList[e]?this.zegoWebRTM.off(e,t):!!this.zegoWebRTC.stateCenter.listenerList[e]&&this.zegoWebRTC.off(e,t)},t.prototype.on=function(e,t){return this.zegoWebRTM.stateCenter.listenerList[e]?this.zegoWebRTM.on(e,t):!!this.zegoWebRTC.stateCenter.listenerList[e]&&this.zegoWebRTC.on(e,t)},t.prototype.createStream=function(e){return this.zegoWebRTC.createStream(e)},t.prototype.createZegoStream=function(e){return this.zegoWebRTC.createZegoStream(e)},t.prototype.getPublishingStreamQuality=function(e){return this.zegoWebRTC.getPublishingStreamQuality(e)},t.prototype.getElectronScreenSources=function(){return this.zegoWebRTC.getElectronScreenSources()},t.prototype.destroyStream=function(e){return this.zegoWebRTC.destroyStream(e)},t.prototype.startPublishingStream=function(e,t,i){return this.zegoWebRTC.startPublishingStream(e,t,i)},t.prototype.updatePublishingStream=function(e,t){return this.zegoWebRTC.updatePublishingStream(e,t)},t.prototype.stopPublishingStream=function(e){return this.zegoWebRTC.stopPublishingStream(e)},t.prototype.sendSEI=function(e,t){return this.zegoWebRTC.sendSEI(e,t)},t.prototype.setVideoConfig=function(e,t){return this.zegoWebRTC.setVideoConfig(e,t)},t.prototype.setAudioConfig=function(e,t){return this.zegoWebRTC.setAudioConfig(e,t)},t.prototype.replaceTrack=function(e,t){return this.zegoWebRTC.replaceTrack(e,t)},t.prototype.addTrack=function(e,t){return this.zegoWebRTC.addTrack(e,t)},t.prototype.removeTrack=function(e,t){return this.zegoWebRTC.removeTrack(e,t)},t.prototype.setCaptureVolume=function(e,t){return this.zegoWebRTC.setCaptureVolume(e,t)},t.prototype.setDummyCaptureImagePath=function(e,t){return this.zegoWebRTC.setDummyCaptureImagePath(e,t)},t.prototype.setStreamExtraInfo=function(e,t){return this.zegoWebRTC.setStreamExtraInfo(e,t)},t.prototype.enableVideoCaptureDevice=function(e,t){return this.zegoWebRTC.enableCameraCapturing(e,t)},t.prototype.addPublishCdnUrl=function(e,t){return 3===arguments.length?this.zegoWebRTC.addPublishCdnUrl(arguments[0],arguments[2]):this.zegoWebRTC.addPublishCdnUrl(e,t)},t.prototype.removePublishCdnUrl=function(e,t){return 3===arguments.length?this.zegoWebRTC.removePublishCdnUrl(arguments[0],arguments[2]):this.zegoWebRTC.removePublishCdnUrl(e,t)},t.prototype.mutePublishStreamVideo=function(e,t,i){return this.zegoWebRTC.mutePublishStreamVideo(e,t,i)},t.prototype.mutePublishStreamAudio=function(e,t){return this.zegoWebRTC.mutePublishStreamAudio(e,t)},t.prototype.setEffectsBeauty=function(e,t,i){return this.zegoWebRTC.setBeautyEffect(e,t,i)},t.prototype.setLowlightEnhancement=function(e,t){return this.zegoWebRTC.setLowlightEnhance(e,t)},t.prototype.enableDualStream=function(e){return this.zegoWebRTC.enableDualStream(e)},t.prototype.setLowStreamParameter=function(e,t){return this.zegoWebRTC.setLowStreamParameter(e,t)},t.prototype.enableHardwareEncoder=function(e){this.zegoWebRTC.enableVideoHardwareEncoder(e)},t.prototype.enableAutoSwitchDevice=function(e){return this.zegoWebRTC.enableAutoSwitchDevice(e)},t.prototype.initBackgroundModule=function(e,t){return this.zegoWebRTC.initBackgroundModule(e,t)},t.prototype.setBackgroundBlurOptions=function(e,t){return this.zegoWebRTC.setBackgroundBlurOptions(e,t)},t.prototype.setTransparentBackgroundOptions=function(e){return this.zegoWebRTC.setTransparentBackgroundOptions(e)},t.prototype.setVirtualBackgroundOptions=function(e,t){return this.zegoWebRTC.setVirtualBackgroundOptions(e,t)},t.prototype.enableBackgroundProcess=function(e,t,i){return this.zegoWebRTC.enableBackgroundProcess(e,t,i)},t.prototype.setVoiceChangerPreset=function(e,t){return this.zegoWebRTC.setVoiceChangerPreset(t,{voiceChanger:e})},t.prototype.setVoiceChangerParam=function(e,t){return this.zegoWebRTC.setVoiceChangerPreset(e,{voiceParam:t})},t.prototype.setReverbPreset=function(e,t){return this.zegoWebRTC.setVoiceChangerPreset(e,{reverb:t})},t.prototype.enableVirtualStereo=function(e,t,i){return this.zegoWebRTC.setVoiceChangerPreset(e,{stereo:{enable:t,angle:i}})},t.prototype.enableLiveAudioEffect=function(e,t,i){return this.zegoWebRTC.enableLiveAudioEffect(e,i,{liveEffect:t})},t.prototype.setAudioChangerParam=function(e,t,i){return this.zegoWebRTC.enableLiveAudioEffect(e,i,{pitch:t})},t.prototype.enableAiDenoise=function(e,t){return this.zegoWebRTC.enableAiDenoise(e,t)},t.prototype.setAiDenoiseMode=function(e,t){return this.zegoWebRTC.setAiDenoiseMode(e,t)},t.prototype.startPlayingStream=function(e,t){return this.zegoWebRTC.startPlayingStream(e,t)},t.prototype.stopPlayingStream=function(e){return this.zegoWebRTC.stopPlayingStream(e)},t.prototype.mutePlayStreamVideo=function(e,t){return this.zegoWebRTC.mutePlayStreamVideo(e,t)},t.prototype.mutePlayStreamAudio=function(e,t){return this.zegoWebRTC.mutePlayStreamAudio(e,t)},t.prototype.setAudioFrameCallback=function(e,t,i){return this.zegoWebRTC.setAudioFrameCallback(e,t,i)},t.prototype.getPlayingStreamQuality=function(e){return this.zegoWebRTC.getPlayingStreamQuality(e)},t.prototype.createLocalStreamView=function(e){return this.zegoWebRTC.createLocalViewer(e)},t.prototype.createRemoteStreamView=function(e){return this.zegoWebRTC.createRemoteViewer(e)},t.prototype.startMixerTask=function(e){return this.zegoWebRTC.startMixerTask(e)},t.prototype.stopMixerTask=function(e){return this.zegoWebRTC.stopMixerTask(e)},t.prototype.setMixerTaskConfig=function(e){return this.zegoWebRTC.setMixerTaskConfig(e)},t.prototype.startMixingAudio=function(e,t){return this.zegoWebRTC.startMixingAudio(e,t)},t.prototype.stopMixingAudio=function(e,t){return this.zegoWebRTC.stopMixingAudio(e,t)},t.prototype.setMixingAudioVolume=function(e,t,i){return this.zegoWebRTC.setMixingAudioVolume(e,t,i)},t.prototype.createAudioEffectPlayer=function(e){if(e instanceof MediaStream||e.getTracks)return new oh(this.zegoWebRTC,e);throw Error("Param localStream is not instance of MediaStream or ZegoLocalStream.")},t.prototype.loadAudioEffect=function(e,t){var i=this;return new Promise((function(r,n){i.zegoWebRTC.preloadEffect(e,t,(function(t){t&&n(t),r(e)}))}))},t.prototype.unloadAudioEffect=function(e){return this.zegoWebRTC.unloadEffect(e)},t.prototype.enumDevices=function(){return this.zegoWebRTC.enumDevices()},t.prototype.getCameras=function(){return this.zegoWebRTC.getCameras()},t.prototype.getMicrophones=function(){return this.zegoWebRTC.getMicrophones()},t.prototype.getSpeakers=function(){return this.zegoWebRTC.getSpeakers()},t.prototype.useVideoDevice=function(e,t){return this.zegoWebRTC.useVideoDevice(e,t)},t.prototype.useAudioDevice=function(e,t){return this.zegoWebRTC.useAudioDevice(e,t)},t.prototype.useAudioOutputDevice=function(e,t){return this.zegoWebRTC.setAudioOutputDevice(e,t)},t.prototype.useFrontCamera=function(e,t){return this.zegoWebRTC.useFrontCamera(e,t)},t.prototype.setSoundLevelDelegate=function(e,t,i){return this.zegoWebRTC.setSoundLevelDelegate(e,t,null==i?void 0:i.enableInBackground)},t.prototype.isMicrophoneMuted=function(){return this.zegoWebRTC.isMicrophoneMuted()},t.prototype.muteMicrophone=function(e){return this.zegoWebRTC.muteMicrophone(e)},t.prototype.createRangeAudioInstance=function(){return this.zegoWebRTC.createRangeAudioInstance()},t.prototype.createRealTimeSequentialDataManager=function(e){return this.zegoWebRTC.createRealTimeSequentialDataManager(e)},t.prototype.destroyRealTimeSequentialDataManager=function(e){this.zegoWebRTC.destroyRealTimeSequentialDataManager(e)},t.prototype.createCopyrightedMusic=function(){return this.zegoWebRTC.createCopyrightedMusic()},t.prototype.checkVideoTrackIsActive=function(e){return this.zegoWebRTC.checkVideoTrackIsActive(e)},t.prototype.checkAudioTrackIsActive=function(e){return this.zegoWebRTC.checkAudioTrackIsActive(e)},t.prototype.destroyCopyrightedMusic=function(){return this.zegoWebRTC.destroyCopyrightedMusic()},t.prototype.getNetworkTimeInfo=function(){return this.zegoWebRTC.RTM.getNetworkInfo()},t.prototype.setStreamAlignmentProperty=function(e,t){return this.zegoWebRTC.setStreamAlignmentProperty(e,t)},t.prototype.destroyEngine=function(){return this.zegoWebRTC.destroyEngine()},t.prototype.uploadLog=function(){return this.zegoWebRTC.uploadLog()},t.prototype.createStreamCompositor=function(){return this.zegoWebRTC.createStreamCompositor()},t.prototype.setTurnServer=function(e){this.zegoWebRTC.setTurnServer(e)},t.prototype.muteAllPlayAudioStreams=function(e){return this.zegoWebRTC.muteAllPlayAudioStreams(e)},t.prototype.muteAllPlayVideoStreams=function(e){return this.zegoWebRTC.muteAllPlayVideoStreams(e)},t.prototype.callExperimentalAPI=function(e){return this.zegoWebRTC.callExperimentalAPI(e)},t}(o.ZegoExpressWebRTMEngine),ch=__webpack_require__(7368),uh=__webpack_require__.n(ch),lh=__webpack_require__(812),dh=__webpack_require__.n(lh),hh="zc.svc",ph="zc.sac",fh="zc.rp",mh="zc.asi",vh="zc.mpsv.0",gh="zc.mpsa.0",yh="zc.mm",bh="zc.mpsv.1",_h="zc.mpsa.1",Sh="zc.mapa.1",Th="zc.mapv.1",Eh="zc.ht",Ch="/sdk/start_publish",wh="/sdk/start_play",Ih={event:"/sdk/set_video_config",error:{ki:et,Gn:Ye},video_params:Jt,video_conf:Jt},Rh={event:"/sdk/set_audio_config",error:{ki:et,Gn:Ye},audio_params:Jt,audio_conf:Jt},kh=ei,Ph=ei,Ah=ei,Dh=ei,Nh={event:"/sdk/replace_track",error:{ki:et},track_kind:Yt},Oh={event:"/device/api/video_c",error:{ki:et,Or:qt,Gn:Ye,kr:ft},device:Yt,device_name:Yt,facing_mode:Yt},Mh={event:"/device/api/audio_c",error:{ki:et,Or:qt,Gn:Ye},device:Yt,device_name:Yt},Lh={event:"/sdk/play_content_changed",webrtc_sid:ei,video_activate:ti,audio_activate:ti,video_layer:ei},xh=ei,Uh=ti,Bh=ei,zh=ti,qh=Jt,Xh=ti,Hh=Jt,Fh=ei,Vh=ei,Gh=ei,jh=ei,Qh=function(){return Qh=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Qh.apply(this,arguments)},Wh=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Zh=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};!function(e){e[e.I=0]="I",e[e.H=10]="H",e[e.M=100]="M",e[e.L=1e3]="L"}(rh||(rh={}));var Kh,Jh=function(){function e(e,t,i,r){this.Xn=e,this.$n=t,this.ee=i,this.re=r,this.screenShotReady=!1}return Object.defineProperty(e.prototype,"ve",{get:function(){return this.re.reporter},enumerable:!1,configurable:!0}),e.prototype.setVideoConfig=function(e,t){var i=this;return Me(this.Xn,hh),new we((function(r,n){var o=oo(e,i.Xn),s=Ih.error,a=s.Gn,c=s.ki,u=i._getSpan(o,Ih.event),l=Qh({},t);for(var d in l)l[d]instanceof Object&&(l[d]=JSON.stringify(l[d]));u.setAttributes({video_params:l});var h=function(e){i.ve.setError(u,a,e)};if(!gn(o))return i.Xn.error(hh+" localStream not found"),h("localStream not found"),void n({errorCode:c.code,extendedData:c.message+" localStream no found"});if(!t||!pn(t)||0==Object.keys(t).length)return i.Xn.error(hh+" constraints wrong"),h("constraints wrong"),void n({errorCode:c.code,extendedData:c.message+" constraints wrong"});var p,f,m=t.width,v=t.height,g=t.maxBitrate,y=t.frameRate;if(m&&un(m)&&!i.re.checkValidNumber(m,0,7680))return i.Xn.error(hh+" constraints width integer number, range[0, 7680]"),h("constraints width integer number, range[1, 7680]"),void n({errorCode:c.code,extendedData:c.message+" constraints wrong"});if(m&&pn(m)){if(!(f=Ln(m,"width",0,7680)).result)return i.Xn.error(hh+" constraints width: "+f.message),h("constraints width: "+f.message),void n({errorCode:c.code,extendedData:c.message+" constraints wrong"})}else if(m&&!un(m)&&!pn(m))return i.Xn.error(hh+" constraints width must be a number or an object. "),h("constraints width must be a number or an object."),void n({errorCode:c.code,extendedData:c.message+" constraints wrong"});if(v&&un(v)&&!i.re.checkValidNumber(v,0,4320))return i.Xn.error(hh+" constraints height integer number, range[0, 4320]"),h(" constraints height integer number, range[0, 4320]"),void n({errorCode:c.code,extendedData:c.message+" constraints wrong"});if(v&&pn(v)){if(!(f=Ln(t.height,"height",0,4320)).result)return i.Xn.error(hh+" constraints height: "+f.message),h("constraints height: "+f.message),void n({errorCode:c.code,extendedData:c.message+" constraints wrong"})}else if(v&&!un(v)&&!pn(v))return i.Xn.error(hh+" constraints height must be a number or an object. "),h(" constraints height must be a number or an object."),void n({errorCode:c.code,extendedData:c.message+" constraints wrong"});return g&&!un(g)?(i.Xn.error(hh+(p=" constraints maxBitrate is not a number")),h(p),void n({errorCode:c.code,extendedData:c.message+p})):hn(y)||un(y)||pn(y)?!un(y)||y>0&&y%1==0?y&&pn(y)&&!(f=Ln(y,"frameRate")).result?(i.Xn.error(hh+" constraints frameRate: "+f.message),h("constraints frameRate: "+f.message),void n({errorCode:c.code,extendedData:c.message+" constraints wrong"})):void i._setPublishStreamConstraints(o,t,u,"video",(function(e){u.setAttributes({error:e.errorCode,message:e.extendedData}),u.end(),r(e)})):(i.Xn.error(hh+" constraints frameRate must be positive integer number"),h("constraints frameRate must be positive integer number"),void n({errorCode:c.code,extendedData:c.message+" constraints wrong"})):(i.Xn.error(hh+(p=" constraints frameRate is not a number or an object")),h(p),void n({errorCode:c.code,extendedData:c.message+p}))}))},e.prototype.setAudioConfig=function(e,t){var i=this;return Me(this.Xn,ph),new we((function(r){var n=oo(e,i.Xn),o=i._getSpan(n,Rh.event);return o.setAttributes({audio_params:Rh.audio_params(t)}),gn(n)?t&&pn(t)&&0!=Object.keys(t).length&&(hn(t.AEC)||dn(t.AEC))&&(hn(t.AGC)||dn(t.AGC))&&(hn(t.ANS)||dn(t.ANS))?void i._setPublishStreamConstraints(n,t,o,"audio",(function(e){o.end(),r(e)})):(i.Xn.error(ph+" constraints wrong"),i.ve.setError(o,Rh.error.ki," constraints wrong"),void r({errorCode:Rh.error.ki.code,extendedData:Rh.error.ki.message+" constraints wrong"})):(i.Xn.error(ph+" localStream not found"),i.ve.setError(o,Rh.error.Gn),void r({errorCode:Rh.error.ki.code,extendedData:Rh.error.ki.message+" localStream no found"}))}))},e.prototype.enableStream=function(e,t){if(Me(this.Xn,"zc.es"),!dn(t.video)&&!dn(t.audio))return this.Xn.error("zc.es option error"),!1;var i=!0,r=!0,n=t.video,o=t.audio;return dn(n)&&(i=this._enableCamera(e,n,t.retain)),dn(o)&&(r=this._enableMicrophone(e,o)),i&&r},e.prototype.enableMicrophoneOnly=function(e){if(Me(this.Xn,"zc.emo"),!dn(e))return!1;for(var t=0;t<this.ee.previewStreamList.length;t++)if(!this.ee.previewStreamList[t].enableMicrophoneOnly(e,this.ee))return this.Xn.error("".concat("zc.emo",".0 previewer ").concat(t," change mic mute state failed")),!1;return this.ee.isMicEnabled=e,!0},e.prototype.replaceTrack=function(e,t,i,r){return Wh(this,void 0,void 0,(function(){var n,o,s,a,c;return Zh(this,(function(u){return n=this._getSpan(e,Nh.event),o=Nh.error.ki,gn(e)?t&&t instanceof MediaStreamTrack?(s={id:t.id,muted:t.muted,enabled:t.enabled,kind:t.kind,readyState:t.readyState,label:t.label},Me(this.Xn,fh,". ".concat(e.id," track: ")+JSON.stringify(s)),a=!0,"safari"===this.re.browser&&void 0!==r&&(a=r),c=this._replaceTrack(e,t,i,void 0,a),n.setAttributes({track_kind:Nh.track_kind(t.kind)}),n.end(),[2,c]):(this.Xn.error(fh+" mediastream track no found"),this.ve.setError(n,o,"mediastream track no found"),[2,{errorCode:o.code,extendedData:o.message+" mediastream track no found"}]):(this.Xn.error(fh+" localStream not found"),this.ve.setError(n,o,"localStream not found"),[2,{errorCode:o.code,extendedData:o.message+" localStream no found"}])}))}))},e.prototype._setPublishStreamConstraints=function(e,t,i,r,n){var o,s,a,c,u=this,d="zsc.spsc.0";this.Xn.info(d+" constraints",JSON.stringify(t));var h=this.ee.checkPreview(e);if(!h)return this.Xn.error(d+" preview no found"),void(n&&n({errorCode:gt.code,extendedData:gt.message}));var p=h.previewType,f=h.videoTrack,m=h.audioTrack,v=null==f?void 0:f.getSettings(),g="video"==r,y="audio"==r,b=h.mediaStreamConfig;if(t.video=b.video,t.audio=b.audio,t=po(t),g){if(!f)return this.Xn.error(d+" video track not found"),void(n&&n({errorCode:Bt,extendedData:zt}));t.videoQuality||(h.mediaStreamConfig.videoQuality=4),p=h.videoPreviewType||p}else p=h.audioPreviewType||p;if(y&&(!m||h.hasEmptyAudioTrack))return this.Xn.error(d+" audio track not found"),void(n&&n({errorCode:Bt,extendedData:zt}));var _,S=JSON.parse(JSON.stringify(h.mediaStreamConfig)),T=!1,E=Object.assign(h.mediaStreamConfig,t);if(t.maxBitrate&&(E.bitRate=t.maxBitrate),"screen"==p)(_=this.ee.getScreenConstrains(E)).bitRate!==S.bitRate&&(t.maxBitrate=_.bitRate);else{var C=h.getMediaStreamConstraints(E,!0).mediaStreamConstraints;h.videoInfo.width===(null===(o=(_=C).video)||void 0===o?void 0:o.width)&&h.videoInfo.height===(null===(s=_.video)||void 0===s?void 0:s.height)||(this.Xn.info(d+" resolution change"),T=!0)}this.Xn.info(d+" applyConstraints ",JSON.stringify(_));var w=[];if(g&&f){var I={};Object.keys(_.video).forEach((function(e){I[e]=JSON.stringify(_.video[e])})),i.setAttributes({video_conf:Ih.video_conf(I)}),w.push(f.applyConstraints(Qh(Qh({},_.video),{deviceId:void 0})))}var R=!0;y&&(R=(null==m?void 0:m.enabled)||!1,i.setAttributes({audio_conf:Rh.audio_conf(_.audio)}),this.ee.trackUtils.stopTrack(m),w.push(navigator.mediaDevices.getUserMedia({video:!1,audio:_.audio})));var k=this.ee.getPreviewer(e);k&&_.video instanceof Object&&(k.videoInfo.width=_.video.width,k.videoInfo.height=_.video.height,k.videoInfo.frameRate=_.video.frameRate);var P=(null===(a=_.video)||void 0===a?void 0:a.maxBitrate)||(null===(c=_.video)||void 0===c?void 0:c.bitRate)||t.maxBitrate,A=un(P)?this.ee.getPublishList(e):[];A.forEach((function(e){var t,i=null==e?void 0:e.publisher,r=(null===(t=null==i?void 0:i.peerConnection)||void 0===t?void 0:t.getSenders())||[];if(i.videoInfo.bitRate=P,h.videoInfo.bitRate=P,r.length>0&&P){var n=r.filter((function(e){return e.track&&"video"===e.track.kind}));n||u.Xn.error(d+" video sender no found");var o=n.length>1?n[1]:n[0]?n[0]:null;if(o){var s=o.getParameters();s.encodings||(s.encodings=[{}]),s.encodings[0].maxBitrate=1e3*P,w.push(o.setParameters(s))}else u.Xn.error(d+" video sender no found")}else P&&(h.videoInfo.bitRate=P)})),w.length>0?Promise.all(w).then((function(e){var t,i,r,o=e[1];if(y){var s=(r=g?e[1]:e[0]).getVideoTracks()[0];u.ee.trackUtils.stopTrack(s);var a=r.getAudioTracks()[0];a.enabled=R,o=JSON.stringify(a.getSettings()),h.replacePreviewTrack(a),h.updateZegoStreamCaptureTrack(a);var c=a;h.insertableaudio&&h.localStream&&(c=h.localStream.getAudioTracks()[0]),h.destNode||h.onAudioTrackChange(c)}if(P){var p=h.videoInfo.bitRate!==P;h.videoInfo.bitRate=P,A.forEach((function(e){var t=null==e?void 0:e.publisher;t&&(p&&u.enVideoSpan(e.streamID,"/sdk/api/publish_video_en_bps",{bitrate:Ah(P)}),t.videoInfo.bitRate=P)}))}if(null===(t=null==_?void 0:_.video)||void 0===t?void 0:t.frameRate){var m=_.video.frameRate;h.videoInfo.frameRate=m,A.forEach((function(e){var t=null==e?void 0:e.publisher;t&&(t.videoInfo.frameRate=m)}))}A.forEach((function(e){var t,i,r=null===(i=null===(t=e.localStream)||void 0===t?void 0:t.getVideoTracks()[0])||void 0===i?void 0:i.getSettings();(null==v?void 0:v.width)===(null==r?void 0:r.width)&&(null==v?void 0:v.height)===(null==r?void 0:r.height)||u.enVideoSpan(e.streamID,"/sdk/api/publish_video_en_size",{w:kh(null==r?void 0:r.width),h:Ph(null==r?void 0:r.height)}),(null==v?void 0:v.frameRate)!==(null==r?void 0:r.frameRate)&&u.enVideoSpan(e.streamID,"/sdk/api/publish_video_en_fps",{fps:Dh(null==r?void 0:r.frameRate)})})),g&&T&&"safari"===u.re.browser&&(null===(i=h.videoNodeQueue)||void 0===i||i.replaceNewSourceByTrack(f,void 0,{handleTrackType:l.changeResolution})),u.Xn.info(d+" set constraints success",o),n&&n({errorCode:0,extendedData:""})})).catch((function(t){return Wh(u,void 0,void 0,(function(){var i,r,o,s,a=this;return Zh(this,(function(c){switch(c.label){case 0:return this.Xn.error(d+" fail reason ",t.name,t.toString()),y?(i=h.getMediaStreamConstraints(S).mediaStreamConstraints,this.Xn.info(d+" oldMediaStreamConstraints ",JSON.stringify(i)),[4,navigator.mediaDevices.getUserMedia({video:!1,audio:i.audio}).catch((function(e){a.Xn.error(d+".1 setbackup fail "+e.name)}))]):[3,2];case 1:(r=c.sent())&&(r.getTracks().forEach((function(e){Zn(e,a.Xn,d+".1")})),o=e.getVideoTracks()[0],this.ee.trackUtils.stopTrack(o),s=r.getAudioTracks()[0],h.replacePreviewTrack(s),h.updateZegoStreamCaptureTrack(s),h.destNode||h.onAudioTrackChange(s)),this.Xn.info(d+".1 setbackup suc "),c.label=2;case 2:return n&&n({errorCode:1103029,extendedData:"".concat(t.name," ").concat(t.constraint?"constraint:"+t.constraint:"")}),[2]}}))}))})):(this.Xn.warn(d+" constaints is no changes"),n&&n({errorCode:1103029,extendedData:"constraints is no changes"}))},e.prototype.useVideoDevice=function(e,t){var i=this,r="zc.uvd.0";return Me(this.Xn,r),new we((function(n){var o=oo(e,i.Xn),s=i._getSpan(o,Oh.event);if(s.setAttributes({device:Oh.device(t)}),!gn(o))return i.Xn.error(r+" localStream not found"),i.ve.setError(s,Oh.error.Gn),void n({errorCode:Oh.error.ki.code,extendedData:Oh.error.ki.message});if(!ln(t))return i.Xn.error(r+" deviceID must be string"),i.ve.setError(s,Oh.error.ki," deviceID must be string"),void n({errorCode:Oh.error.ki.code,extendedData:Oh.error.ki.message});var a=function(e){s.setAttributes({error:e.errorCode,message:e.extendedData}),s.end(),i.ee.getPublishList(o).forEach((function(e){var t,i;e.cameraLabel=(null===(i=null===(t=e.publisher.previewer)||void 0===t?void 0:t.videoTrack)||void 0===i?void 0:i.label)||e.cameraLabel})),n(e)};To((function(e){var n=e.cameras.find((function(e){return e.deviceID==t}));if(!n)return i.Xn.error(r+" "+Fe),void a({errorCode:Oh.error.Or.code,extendedData:Oh.error.Or.message});s.setAttributes({device_name:Oh.device_name(null==n?void 0:n.deviceName)}),i.Rr("video",o,t,a)}),(function(e){i.Xn.warn(r+" getDevices err:",e),i.Rr("video",o,t,a)}))}))},e.prototype.useFrontCamera=function(e,t){var i=this,r="zc.ufc.0";return Me(this.Xn,r),new we((function(n,s){var a=oo(e,i.Xn),c=i._getSpan(a,Oh.event);if(!gn(a))return i.Xn.error(r+" localStream not found"),i.ve.setError(c,Oh.error.Gn),void s({errorCode:Oh.error.ki.code,extendedData:Oh.error.ki.message});if(!dn(t))return i.Xn.error(r+" enable must be boolean"),i.ve.setError(c,Oh.error.ki," enable must be boolean"),void s({errorCode:Oh.error.ki.code,extendedData:Oh.error.ki.message});var u=(0,o.isAndroid)(),l=(0,o.isIos)();if(!u&&!l)return i.Xn.error(r+" must use in mobile"),i.ve.setError(c,Oh.error.kr," must use in mobile"),void s({errorCode:Oh.error.kr.code,extendedData:Oh.error.kr.message});var d=t?"user":"environment";c.setAttributes({facing_mode:Oh.facing_mode(d)}),i.Rr("video",a,"",(function(e){c.setAttributes({error:e.errorCode,message:e.extendedData}),c.end(),i.ee.getPublishList(a).forEach((function(e){var t,i;e.cameraLabel=(null===(i=null===(t=e.publisher.previewer)||void 0===t?void 0:t.videoTrack)||void 0===i?void 0:i.label)||e.cameraLabel})),0===(null==e?void 0:e.errorCode)?n(e):s(e)}),{facingMode:d})}))},e.prototype.useAudioDevice=function(e,t){var i=this,r="zc.uad.1";return Me(this.Xn,r),new we((function(n){var o=oo(e,i.Xn),s=i._getSpan(o,Mh.event);s.setAttributes({device:Mh.device(t)});var a=function(e,t){i.Xn.error(r+" "+t);var o=e;o.message=o.message+(t?" "+t:""),i.ve.setError(s,e,t),n({errorCode:o.code,extendedData:o.message})},c=function(e){s.setAttributes({error:e.errorCode,message:e.extendedData}),s.end(),i.ee.getPublishList(o).forEach((function(e){var t;e.microLabel=(null===(t=o.getAudioTracks()[0])||void 0===t?void 0:t.label)||e.microLabel}));var t=i.ee.checkPreview(o);0===e.errorCode&&t&&(t.hasMicTrack=!0),n(e)};gn(o)?ln(t)?To((function(e){var n=e.microphones.find((function(e){return e.deviceID==t}));if(!n)return i.Xn.error(r+" "+Fe),void c({errorCode:Mh.error.Or.code,extendedData:Mh.error.Or.message});s.setAttributes({device_name:Mh.device_name(null==n?void 0:n.deviceName)}),i.Rr("audio",o,t,c)}),(function(e){i.Xn.warn(r+" getDevices err:",e),i.Rr("audio",o,t,c)})):a(Mh.error.ki,"deviceID must be string"):a(Mh.error.Gn,"localStream not found")}))},e.prototype.enableDualStream=function(e){var t="zsc.eds";Me(this.Xn,t);var i=oo(e,this.Xn),r=this.ee.checkPreview(i);if(r)if(null==r?void 0:r.lowStream)this.Xn.error(t+" low stream already exists");else{var n=r.videoPreviewType||r.previewType;De()&&"custom"==n?this.Xn.error(t+" can not support firefox"):this.ee.checkPublish(i)?this.Xn.error(t+" is publishing"):(r.enableDualStream=!0,r.createLowStream())}else this.Xn.error(t+" preview no found")},e.prototype.setLowStreamParameter=function(e,t){var i=oo(e,this.Xn),r=this.ee.checkPreview(i);if(r){var n=r.videoInfo,o=[];for(var s in t)isNaN(+t[s])&&o.push(s);if(o.length)throw new Error('param "'.concat(o.join(","),' type error"'));t.width&&n.width&&t.width>n.width?this.Xn.error("zsc.slsp.0 low stream width can not larger than high stream"):t.height&&n.height&&t.height>n.height?this.Xn.error("zsc.slsp.0 low stream height can not larger than high stream"):t.frameRate&&n.frameRate&&t.frameRate>n.frameRate||t.height&&n.bitRate&&t.bitRate>n.bitRate||(r.lowStreamConfig=Object.assign(r.lowStreamConfig,t))}else this.Xn.error("zsc.slsp.0 preview no found")},e.prototype.handleTrack=function(e,t,i,r,n){var o,s,a,c;return Wh(this,void 0,void 0,(function(){var u,l,d,h,p,f,m,v,g,y,b,_,S,T,E,C,w,I,R,k,P,A,D,N=this;return Zh(this,(function(O){switch(O.label){case 0:if(Me(this.Xn,Eh,". ms id: ".concat(null==t?void 0:t.id,", kind: ").concat(null==i?void 0:i.kind,", track id: ").concat(null==i?void 0:i.id)),u="ADD"===e,l={errorCode:0,extendedData:""},!gn(t))return this.Xn.error(Eh+" stream wrong"),n({errorCode:et.code,extendedData:et.message}),[2];if(!(i instanceof MediaStreamTrack))return this.Xn.error(Eh+" parameter 2 type error"),n({errorCode:et.code,extendedData:et.message}),[2];if(!(d=this.ee.checkPreview(t)))return this.Xn.error(Eh+" stream no found"),n&&n({errorCode:gt.code,extendedData:gt.message}),[2];if("video"===i.kind){if(null===(o=d.videoEffect)||void 0===o?void 0:o.enabled)return this.Xn.error(Eh+" need to disable video beauty effect first"),n&&n({errorCode:1103071,extendedData:"need to disable video beauty effect before add or remove track"}),[2];if(d.enableDualStream)return this.Xn.error(Eh+" "+" can not add/remove track while dual stream enabled."),n&&n({errorCode:1103071,extendedData:" can not add/remove track while dual stream enabled."}),[2];if(d.isBackgroundBlur)return this.Xn.error(Eh+" need to disable background process first"),n&&n({errorCode:1103071,extendedData:"need to disable video background process before add or remove track"}),[2]}return d.streamFromCanvas&&"video"===i.kind?(this.Xn.error(Eh+" browser not support"),n&&n({errorCode:Ft,extendedData:Vt}),[2]):(h="audio"===i.kind&&this.re.engineConfig.keepAudioTrack&&d.hasEmptyAudioTrack,p=t.getTracks().length>=2||t.getTracks().find((function(e){return e.kind==i.kind})),u&&p&&!h?(this.Xn.error(Eh+" only stream which have one track and kind no exist can add track"),n&&n({errorCode:1103101,extendedData:"only stream which have one track and kind no exist can add track"}),[2]):"REMOVE"==e&&(t.getTracks().length<=1||"video"===i.kind&&d.hasEmptyAudioTrack||!t.getTracks().find((function(e){return e.kind===i.kind})))?(this.Xn.error(Eh+" can not remove track"),n({errorCode:Ft,extendedData:Vt}),[2]):!(f=this.ee.checkPublish(t))||f.publisher.supportTransceiver||5===f.publisher.stateNego&&1!=f.publisher.isUpdateSDP?(m=function(e){var t=N.ee.previewStreamList.find((function(t){return t.originVideoTrack===e||t.originAudioTrack===e}));if(t=t||N.ee.previewStreamList.find((function(t){return t.localStream.getTracks().find((function(t){return t==e}))})),t)return N.Xn.info(Eh+" video info: ".concat(JSON.stringify(t.videoInfo))),t;N.Xn.warn(Eh+" ".concat(e.kind," track is not created by sdk"))},this.re.engineConfig.keepAudioTrack&&"audio"===i.kind?(u?((D=null===(s=m(i))||void 0===s?void 0:s.videoInfo)&&d.updateAudioInfo(D),this._replaceTrack(t,i,!1,!0),d.hasEmptyAudioTrack=!1):((v=d.getEmptyAudioTrack())&&this._replaceTrack(t,v,!1,!0),d.hasEmptyAudioTrack=!0),this.Xn.info(Eh+" end"),r(l),[2]):(g=d.rtcViewer,y=d,b="video"==i.kind?"videoTrack":"audioTrack",u&&(_=m(i))&&("video"===i.kind?(y.updateMediaStreamConstraints(_.mediaStreamConfig,"video"),d.mediaStreamConfig.video=!0):(y.updateMediaStreamConstraints(_.mediaStreamConfig,"audio"),d.mediaStreamConfig.audio=!0)),f?(S=f.publisher,(T=f.publisher.peerConnection)?(S.supportTransceiver?this.Xn.info(Eh+" support transceiver"):S.isUpdateSDP=!0,S.sideMediaConfig.isSEIStart&&"video"===i.kind?(this.Xn.info(Eh+" replace sei blank track."),E=void 0,u?[4,S.replacePublishedTrack(i,!1,{handleTrack:e})]:[3,2]):[3,5]):(this.Xn.error(Eh+" pc has not created."),[2])):[3,15])):(this.Xn.error(Eh+" publish state wrong. "+"".concat(f.publisher.stateNego)),n&&n({errorCode:1103069,extendedData:"publisher state wrong"}),[2]));case 1:return E=O.sent(),S.handleSEIVideoTrack("add"),[3,4];case 2:return S.handleSEIVideoTrack("remove"),[4,S.replacePublishedTrack(S.sideMediaConfig.track,!1,{handleTrack:e})];case 3:E=O.sent(),O.label=4;case 4:return 0===(null==E?void 0:E.errorCode)||this.Xn.warn(Eh+" enable sei but not found video sender. error: ".concat(JSON.stringify(E))),[3,11];case 5:return"audio"!==i.kind?[3,6]:(S.isUpdateSDP=!1,u?(y.replacePreviewTrack(i),C=y.audioNodeQueue?null===(c=null===(a=y.audioNodeQueue)||void 0===a?void 0:a.destinationNode)||void 0===c?void 0:c.stream.getAudioTracks()[0]:i,(w=T.getSenders().find((function(e){return e.track&&"audio"===e.track.kind})))?w.replaceTrack(C):T.addTrack(C,t),this.Xn.info(Eh+" add audio track. ")):(t.removeTrack(i),y[b]=null,g&&g.setTrack(!1,null),(w=T.getSenders().find((function(e){return e.track&&"audio"===e.track.kind})))&&w.replaceTrack(null),this.Xn.info(Eh+" remove audio track. ")),this.Xn.info(Eh+" end"),r(l),[2]);case 6:return w=T.getSenders().find((function(e){return e.track&&e.track.kind==i.kind||null===e.track})),I=i,y.zegoCaptureStream&&(R=y.getStreamThroughCanvas(new MediaStream([i])),I=R.getVideoTracks()[0]),u?w?[4,w.replaceTrack(i)]:[3,8]:[3,10];case 7:return O.sent(),this.Xn.info(Eh+" sender replace track "+I.kind),[3,9];case 8:T.addTrack(I,t),this.Xn.info(Eh+" pc add track "+I.kind),O.label=9;case 9:return[3,11];case 10:if(!w)return this.Xn.error(Eh+" sender no found"),n&&n({errorCode:Bt,extendedData:zt}),[2];try{w.replaceTrack(null),this.Xn.info(Eh+" sender replace null.")}catch(e){this.Xn.error(Eh+" "+e),n&&n({errorCode:1103079,extendedData:"replace track fail "+e})}O.label=11;case 11:return k=y.updateVideoInfo(D=u?null==_?void 0:_.videoInfo:{}),P=function(){"ADD"==e?(t.addTrack(i),y[b]=i,g&&g.setTrack("video"==i.kind,i,"safari"===N.re.browser),"video"==i.kind&&1==i.enabled?S.sendStreamStatus(0,S.mic_status,!0):1==i.enabled&&S.sendStreamStatus(S.camera_status,0,!0),N.Xn.info(Eh+" add track completely")):("video"==i.kind?S.sendStreamStatus(2,S.mic_status,!0):S.sendStreamStatus(S.camera_status,2,!0),t.removeTrack(i),y[b]=null,g&&g.setTrack("video"==i.kind,null),N.Xn.info(Eh+" remove track completely")),d.mediaStreamConfig.video="ADD"==e},A=function(){return Wh(N,void 0,void 0,(function(){var e,t,i,o=this;return Zh(this,(function(s){switch(s.label){case 0:e={},s.label=1;case 1:return s.trys.push([1,3,,4]),[4,T.createOffer(e)];case 2:return t=s.sent(),S.onCreateOfferSuccess(t,!0,Qh(Qh({},k),{bitRate:u?k.bitRate:50}),(function(e){return Wh(o,void 0,void 0,(function(){return Zh(this,(function(t){return 0!==e?n&&n({errorCode:_t.code,extendedData:_t.message}):(P(),r(l),this.Xn.info(Eh+" end")),[2]}))}))})),[3,4];case 3:return i=s.sent(),this.Xn.error(Eh+" "+i),n&&n({errorCode:vt.code,extendedData:vt.message+" "+i}),[3,4];case 4:return[2]}}))}))},S.isUpdateSDP?(this.Xn.info(Eh+" need to update sdp"),[4,A()]):[3,13];case 12:return O.sent(),[3,14];case 13:this.Xn.info(Eh+" only update track"),P(),u&&"video"===i.kind&&k.bitRate&&S.setBitrate(k.bitRate),r(l),O.label=14;case 14:return[3,16];case 15:u?((D=null==_?void 0:_.videoInfo)&&("video"===i.kind?(y.updateVideoInfo(D),d.mediaStreamConfig.video=!0):y.updateAudioInfo(D)),t.addTrack(i),y[b]=i,g&&g.setTrack("video"==i.kind,i)):(t.removeTrack(i),y[b]=null,"video"===i.kind&&(d.mediaStreamConfig.video=!1),g&&g.setTrack("video"==i.kind,null)),this.Xn.info(Eh+" end"),r(l),O.label=16;case 16:return[2]}}))}))},e.prototype.Rr=function(e,t,i,r,n){return Wh(this,void 0,void 0,(function(){var s,a,c,u,l,d,h,p,f,m,v,g=this;return Zh(this,(function(y){switch(y.label){case 0:return s=this.ee.checkPreview(t),a="audio"===e,s?"video"===e&&"camera"!==s.previewType?(this.Xn.error("zsc.sd.0 stream type cannot set device"),r&&r({errorCode:ft.code,extendedData:ft.message}),[2]):"video"===e&&0==s.mediaStreamConfig.video?(this.Xn.error("zsc.sd.0 camera can not be changed when video is false"),r&&r({errorCode:Xt.code,extendedData:Xt.message}),[2]):a&&0==s.mediaStreamConfig.audio?(this.Xn.error("zsc.sd.0 microphone can not be changed when audio is false"),r&&r({errorCode:Ht.code,extendedData:Ht.message}),[2]):(i&&delete s.mediaStreamConfig.facingMode,c={},"video"===e?((null==n?void 0:n.facingMode)?c.facingMode=n.facingMode:i&&(c.videoInput=i),u=s.videoTrack):(c.audio=!0,c.audioInput=i,u=s.audioTrack),l=(0,o.isAndroid)(),De()||Be()&&l&&Re().indexOf("Oriole 64-bit")>-1?(this.ee.trackUtils.stopTrack(u),l&&De()?[4,new Promise((function(e){setTimeout((function(){e(void 0)}),100)}))]:[3,2]):[3,2]):(this.Xn.error("zsc.sd.0 preview no found"),r&&r({errorCode:gt.code,extendedData:gt.message}),[2]);case 1:y.sent(),y.label=2;case 2:return d=Qh(Qh({},s.mediaStreamConfig),c),a&&"default"===i&&(this.Xn.warn("zsc.sd.0 stop preview audio track"),s.audioTrack&&s.audioTrack.stop()),h=s.getMediaStreamConstraints(d).mediaStreamConstraints,p=function(i,r){r.getTracks().forEach((function(i){if(i.kind===e){var r="video"===e,n=r?"videoTrack":"audioTrack",o=s[n];r&&s.streamFromCanvas&&s.stopCanvasStreamTrack(),o&&(i.enabled=o.enabled),r&&s.lowStream&&s.lowStream.getTracks().forEach((function(e){g.ee.trackUtils.stopTrack(e)}));var a=g.ee.getPublishList(t);a.length>0&&(!s.muteImage||i.enabled||!r)?a.map((function(e){return e.publisher})).forEach((function(e){e.replacePublishedTrack(i,!1,{isCamera:!0})})):s&&s.muteImage&&!i.enabled&&r?s[n]=i:s&&s.replacePreviewTrack(i,!1,{isCamera:!0}),g.ee.trackUtils.stopTrack(o),s.updateZegoStreamCaptureTrack(i)}})),s.restartSoundLevel()},a?h.video=!1:h.audio=!1,this.Xn.info("zsc.sd.0 mediaStreamConstraints "+JSON.stringify(h)),f=Xt,"audio"===e&&(f=Ht),m=function(e){for(var t=0,i=e.getTracks();t<i.length;t++)if("ended"==i[t].readyState)return!0;return!1},v=function(t){g.ee.trackUtils.stopTrack("video"==e?s.videoTrack:s.audioTrack),g.Xn.warn("zsc.sd.0 switch "+e+" device failed, stop last device and retry. ",t+""),navigator.mediaDevices.getUserMedia(h).then((function(t){Object.assign(s.mediaStreamConfig,c),p(0,t),g.Xn.info("zsc.sd.0 swtich "+e+" device success"),r&&r({errorCode:0,extendedData:""})}),(function(t){g.Xn.warn("zsc.sd.0 swtich "+e+" device failed and recover last device. ",t+"");var i=s.getMediaStreamConstraints(s.mediaStreamConfig).mediaStreamConstraints;navigator.mediaDevices.getUserMedia(i).then((function(i){p(0,i),g.Xn.info("zsc.sd.0 recover last "+e+" device success"),r&&r({errorCode:f.code,extendedData:f.message+" "+JSON.stringify(t)})}),(function(t){g.Xn.error("zsc.sd.0 swtich "+e+" device and recover failed, please recreate stream. ",t+""),r&&r({errorCode:f.code,extendedData:f.message+" "+JSON.stringify(t)})}))}))},navigator.mediaDevices.getUserMedia(h).then((function(t){m(t)&&g.Xn.error("zsc.sd.0 switch"+e+" device fail, has track ended."),Object.assign(s.mediaStreamConfig,c),p(0,t),g.Xn.info("zsc.sd.0 switch "+e+" device success"),r&&r({errorCode:0,extendedData:""})}),v),[2]}}))}))},e.prototype._replaceTrack=function(e,t,i,r,n){void 0===r&&(r=!1),void 0===n&&(n=!1);var o=this.ee.checkPreview(e),s=this.ee.getPublishList(e,!1);if(!o)return this.Xn.error("zc.rt.0 preview no found"),{errorCode:gt.code,extendedData:gt.message};if(o.streamFromCanvas&&"video"===t.kind)return this.Xn.error("zc.rt.0 browser not support"),{errorCode:Ft,extendedData:Vt};var a=e.getTracks().find((function(e){return e.kind===t.kind})),c="audio"===t.kind,u={errorCode:Bt,extendedData:zt};if(!r&&!a)return this.Xn.error("zc.rt.0 track no found"),u;if(!r&&c&&o.hasEmptyAudioTrack&&(this.Xn.warn("zc.rt.0 replace empty audio track"),!this.re.engineConfig.allowReplaceEmptyTrack))return u;if(r&&c&&!o.mediaStreamConfig.audio){var d=o.mediaStreamConfig;o.mediaStreamConfig.audio=!0;var h=t.getSettings(),p=h||{},f=p.deviceId,m=p.echoCancellation,v=p.noiseSuppression,g=p.autoGainControl,y=p.channelCount;this.Xn.info("zc.rt.0 add audio: "+JSON.stringify(h)),f&&(d.audioInput=f),y&&(d.channelCount=y),m&&(d.AEC=m),v&&(d.ANS=v),g&&(d.AGC=g)}var b=this.ee.soundLevelDelegate&&c,_=n?{handleTrackType:l.replaceNew}:{};if(s.length){var S=null;return b&&o.stopSoundLevel(),s.forEach((function(e){var r;S=null===(r=e.publisher)||void 0===r?void 0:r.replacePublishedTrack(t,!1,Qh({isTrackProcessedFromOriginalStream:i},_))})),b&&o.startSoundLevel(),S}return b&&o.stopSoundLevel(),o.replacePreviewTrack(t,!1,Qh({isTrackProcessedFromOriginalStream:i},_)),b&&o.startSoundLevel(),{errorCode:0,extendedData:""}},e.prototype._enableMicrophone=function(e,t){var i=this.ee.checkPreview(e);return i?i.enableMicrophone(t,this.ee):(this.Xn.error("zsc.em.0 "+je),!1)},e.prototype._enableCamera=function(e,t,i){var r=this.ee.checkPreview(e);return r?r.enableCamera(t,this.ee,i):(this.Xn.error("zsc.ec.0 "+je),!1)},e.prototype.setDummyCaptureImagePath=function(e,t){var i=this;return new we((function(r,n){var o=oo(t,i.Xn),s=i.ee.checkPreview(o);if(!s)return i.Xn.error("zc.sdcp.0 preview no found"),void r(!1);if(!ln(e))return i.Xn.error("zc.sdcp.0 filePath type error"),void r(!1);var a=new Image;a.src=e,a.crossOrigin="anonymous",a.onload=function(){s.loadImgTimer&&clearTimeout(s.loadImgTimer),s.loadImgTimer=void 0,i.Xn.info("zc.sdcp.0 load file path success"),s.muteImage=a,r(!0)},s.loadImgTimer=setTimeout((function(){i.Xn.error("zc.sdcp.0 load img timeout"),r(!1)}),5e3)}))},e.prototype.enableAutoSwitchDevice=function(e){this.Xn.info("zc.easw call. "+JSON.stringify(e)),this.re.autoSwitchDeviceSetting=Qh({},e)},e.prototype._getSpan=function(e,t){var i=this.ee.checkPublish(e);return this.ve.createSpan(rh.H,i?{key:Ch,par:i.streamID}:{key:"stream"},{key:""},t)},e.prototype.enVideoSpan=function(e,t,i){var r=this.ve.createSpan(rh.H,{key:Ch,par:e},{key:""},t);r.setAttributes(i),r.end()},e}(),Yh=function(){function e(e,t){var i=t.type,r=t.channels,n=void 0===r?1:r,o=t.bufferSize,s=void 0===o?0:o,a=t.sampleBit,c=void 0===a?16:a,u=t.sampleRate,l=void 0===u?44100:u,d=this;this.instant=0,this.slow=0,this.clip=0,this.context=e,this.type=i,this.channels=n,this.bufferSize=s,this.sampleBit=c,this.sampleRate=l,this.script=e.createScriptProcessor(s,n,n),(new Date).getTime(),this.script.addEventListener("audioprocess",(function(e){var t,r=e.inputBuffer.getChannelData(0),n=0,o=0;for(t=0;t<r.length;++t)n+=r[t]*r[t],Math.abs(r[t])>.99&&(o+=1);if(d.instant=Math.sqrt(n/r.length),d.slow=.95*d.slow+.05*d.instant,d.clip=o/r.length,"pcm"===i||"wav"===i){for(var s=[],a=0;a<d.channels;a++)s.push(e.inputBuffer.getChannelData(a));d.recorderBuffer(s)}})),"pcm"!==i&&"wav"!==i||this.initRecorderBuffer(i)}return e.prototype.connectToSource=function(e,t){try{this.mic=this.context.createMediaStreamSource(e),this.mic.connect(this.script),this.script.connect(this.context.destination),hn(t)||t(null)}catch(e){console.error(e),hn(t)||t(e)}return this},e.prototype.recorderBuffer=function(e){this.worker.postMessage({command:"record",val:e})},e.prototype.initRecorderBuffer=function(e){var t=this;this.worker=this.inlineWorker((function(){var e,t,i,r,n,o,s=[];function a(e,t,i){for(var r=0;r<i.length;r++,t+=2){var n=Math.max(-1,Math.min(1,i[r]));e.setInt16(t,n<0?32768*n:32767*n,!0)}}function c(e,t,i){for(var r=0;r<i.length;r++,t++){var n=Math.max(-1,Math.min(1,i[r])),o=n<0?128*n:127*n;e.setInt8(t,o+=128)}}function u(e,t,i){for(var r=0;r<i.length;r++)e.setUint8(t+r,i.charCodeAt(r))}function l(e,t){for(var i=new Float32Array(t.length/e),r=0,n=0;r<i.length;)i[r]=t[n],n+=e,r++;return i}function d(e,t,i){for(var r=new Float32Array(t*e.length),n=0,o=0;o<i[0].length;o++)r.set(i[0][o],n),n+=i[0][o].length;return r}function h(e,t){for(var i=new Float32Array(e.length+t.length),r=0;r<e.length+t.length;r+=2)i[r]=e[r/2|0],i[r+1]=t[r/2|0];return i}function p(t){var i,r;if(1==e)i=d(s[0],n,s),1!=t&&(r=l(t,i));else if(2==e){var o=d(s[0],n,s),a=d(s[1],n,s);1!=t?r=h(l(t,o),l(t,a)):i=h(o,a)}return 1!=t?r:i}function f(e){var i=function(e,i){var r;8==i?r=e.length:16==i&&(r=e.length,r*=2);var n=new ArrayBuffer(r),o=new DataView(n);return 8==i?c(o,0,e):16==t&&a(o,0,e),o}(p(e),t);self.postMessage({command:"exportPcmLive",val:i})}function m(r){var n=function(r,n){var o;8==n?o=r.length:16==t&&(o=r.length,o*=2);var s=new ArrayBuffer(o+44),l=new DataView(s),d=i,h=t,p=e;return u(l,0,"RIFF"),l.setUint32(4,36+o,!0),u(l,8,"WAVE"),u(l,12,"fmt "),l.setUint32(16,16,!0),l.setUint16(20,1,!0),l.setUint16(22,p,!0),l.setUint32(24,d,!0),l.setUint32(28,d*p*(h/8),!0),l.setUint16(32,p*(h/8),!0),l.setUint16(34,h,!0),u(l,36,"data"),l.setUint32(40,o,!0),8==t?c(l,44,r):16==t&&a(l,44,r),l}(p(r),t);self.postMessage({command:"exportWav",val:n})}this.onmessage=function(a){switch(a.data.command){case"init":e=(c=a.data.val).sampleChannel,t=c.sampleBit,i=c.sampleRate,r=c.oldSampleRate,n=c.bufferSize,o=c.type;break;case"record":!function(t){for(var n=0;n<e;n++)s[n]||(s[n]=[]),s[n].push(t[n]);var a=Math.round(r/i);"pcm"===o?f(a):"wav"===o&&m(a),s=[]}(a.data.val)}var c}})),this.worker.postMessage({command:"init",val:{sampleChannel:this.channels,sampleBit:this.sampleBit,sampleRate:this.sampleRate,oldSampleRate:this.context.sampleRate,bufferSize:this.bufferSize,type:e}}),this.worker.onmessage=function(e){switch(e.data.command){case"exportPcmLive":t.onReceiveBuffer(e.data.val);break;case"exportWav":t.onReceiveWav(e.data.val)}}},e.prototype.onReceiveBuffer=function(e){},e.prototype.onReceiveWav=function(e){},e.prototype.writeString=function(e,t,i){for(var r=0;r<i.length;r++)e.setUint8(t+r,i.charCodeAt(r))},e.prototype.writeBuffer=function(e,t,i){for(var r=0;r<i.byteLength;r++)e.setUint8(t+r,i[r])},e.prototype.concatenation=function(e){for(var t=0,i=0;i<e.length;++i)t+=e[i].buffer.byteLength;var r=new Uint8Array(t),n=0;for(i=0;i<e.length;++i)r.set(new Uint8Array(e[i].buffer),n),n+=e[i].buffer.byteLength;return r},e.prototype.encodeWave=function(e){var t=this.concatenation(e),i=t.byteLength,r=new ArrayBuffer(i+44),n=new DataView(r),o=this.sampleRate,s=this.sampleBit,a=this.channels;return this.writeString(n,0,"RIFF"),n.setUint32(4,36+i,!0),this.writeString(n,8,"WAVE"),this.writeString(n,12,"fmt "),n.setUint32(16,16,!0),n.setUint16(20,1,!0),n.setUint16(22,a,!0),n.setUint32(24,o,!0),n.setUint32(28,o*a*(s/8),!0),n.setUint16(32,a*(s/8),!0),n.setUint16(34,s,!0),this.writeString(n,36,"data"),n.setUint32(40,i,!0),this.writeBuffer(n,44,t),n},e.prototype.stop=function(){this.mic.disconnect(),this.script.disconnect()},e.prototype.inlineWorker=function(e){if(Worker&&e){var t=e.toString().trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1],i=URL.createObjectURL(new window.Blob([t],{type:"text/javascript"}));return new Worker(i)}return null},e}(),$h=function(){return $h=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},$h.apply(this,arguments)},ep=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},tp=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};function ip(e,t){return e&&"live"===e.readyState?!0===e.enabled?0:"video"===e.kind&&"firefox"===t?2:20:2}!function(e){e[e.I=0]="I",e[e.H=10]="H",e[e.M=100]="M",e[e.L=1e3]="L"}(Kh||(Kh={}));var rp,np,op,sp={mutePublishStreamVideo:function(e,t,i){var r=oo(e,this.Xn);Me(this.Xn,vh,". "+(null==r?void 0:r.id)+" mute: ".concat(t,", retain: ").concat(i));var n=this.rtcModules.advancedModule,o=n._getSpan(r,"/sdk/mute_publish_video"),s=this.ee.checkPreview(r);if(!s)return this.Xn.error(vh+" localStream error"),!1;if(!dn(t)||!hn(i)&&!dn(i))return this.Xn.error(vh+" option error"),!1;var a=n.enableStream(r,{video:!t,retain:i});return s.syncVideoEnabled=a&&t,o.setAttributes({mute_type:xh(t?1:0),retain:Uh(i)}),o.end(),Le(this.Xn,vh),a},mutePublishStreamAudio:function(e,t){var i=oo(e,this.Xn);Me(this.Xn,gh,(null==i?void 0:i.id)+" mute: ".concat(t));var r=this.ee.checkPreview(i);if(!r)return this.Xn.error(gh+" localStream error"),!1;var n=this.rtcModules.advancedModule,o=n._getSpan(i,"/sdk/mute_publish_audio");if(!dn(t))return this.Xn.error(gh+" option error"),!1;var s=n.enableStream(i,{audio:!t});return r.syncAudioEnabled=s&&t,o.setAttributes({mute_type:Bh(t?1:0)}),o.end(),Le(this.Xn,gh),s},mutePlayStreamVideo:function(e,t){Me(this.Xn,bh,e+" "+t);var i=this.ve.createSpan(Kh.H,{key:wh,par:e},{key:""},"/sdk/mute_play_video");i.setAttributes({mute_type:Fh(t?1:0)});var r=this.rtcModules.playModule.mutePlayStream(e,"video",t);return i.end(),this.Xn.info(bh+" end"),r},mutePlayStreamAudio:function(e,t){Me(this.Xn,_h,e+" "+t);var i=this.ve.createSpan(Kh.H,{key:wh,par:e},{key:""},"/sdk/mute_play_audio");i.setAttributes({mute_type:Vh(t?1:0)});var r=this.rtcModules.playModule.mutePlayStream(e,"audio",t);return i.end(),this.Xn.info(_h+" end"),r},muteAllPlayAudioStreams:function(e){var t=this;return Me(this.Xn,Sh," "+e),new Promise((function(i,r){if("boolean"!=typeof e)return t.Xn.error(Sh+" mute should be a boolean type"),void r(!1);var n=Object.keys(t.ee.playerList),o=[];if(!t.ee.playModule)return t.Xn.info(Sh+" cannot find play module."),void r(!1);t.ee.defaultAudioMuted=e,t.Xn.info(Sh+" "+"mute ".concat(e," streamid ").concat(JSON.stringify(n)));for(var s=0,a=n;s<a.length;s++)o.push(t.mutePlayStreamAudio(a[s],e));Promise.all(o).then((function(r){t.Xn.info(Sh+" "+"mute ".concat(e," all audio success")),i(!0)})).catch((function(i){t.Xn.error(Sh+" mute: "+e+" error catch: "+i),r(!1)}))}))},muteAllPlayVideoStreams:function(e){var t=this;return Me(this.Xn,Th," "+e),new Promise((function(i,r){if("boolean"!=typeof e)return t.Xn.error(Th+" mute should be a boolean type"),void r(!1);var n=Object.keys(t.ee.playerList),o=[];if(!t.ee.playModule)return t.Xn.info(Th+" cannot find play module."),void r(!1);t.ee.defaultVideoMuted=e,t.Xn.info(Th+" "+"mute ".concat(e," streamid ").concat(JSON.stringify(n)));for(var s=0,a=n;s<a.length;s++)o.push(t.mutePlayStreamVideo(a[s],e));Promise.all(o).then((function(r){t.Xn.info(Th+" "+"mute ".concat(e," all audio success")),i(!0)})).catch((function(i){t.Xn.error(Th+" mute: "+e+" error catch: "+i),r(!1)}))}))},muteMicrophone:function(e){this.Xn.info(yh+" call");var t=this.ve.createSpan(Kh.H,{key:ci},{key:""},"/device/enable_mic");if(!dn(e))return this.Xn.error(yh+" option error"),this.ve.setError(t),!1;var i=this.rtcModules.advancedModule.enableMicrophoneOnly(!e),r=Object.keys(this.ee.publisherList).map((function(e){return{stream_id:e}}));return t.setAttributes({enable:zh(!e),stream_list:qh(r)}),t.end(),this.Xn.info(yh+" end"),i},activateSEIInsert:function(e){var t=e.stream,i=e.action,r=e.infoType,n=this.rtcModules.advancedModule._getSpan(e.stream,"/active/sei");n.setAttributes({action:Gh(e.action),info_type:jh(e.infoType)});var o=this.rtcModules.publishModule.activateSEIInsert(t,i,r);return n.end(),o},getAudioInfo:function(e,t,i){if(!e)return this.Xn.error("localStream is empty!"),!1;var r=$h({},i);return new Yh(this.ac,r).connectToSource(e,(function(e){t(e)}))},handleDataAvailable:function(e){e.data&&e.data.size>0&&this.recordedBlobs.push(e.data)},addTrack:function(e,t){var i=this;return new we((function(r,n){var o={id:t.id,muted:t.muted,enabled:t.enabled,kind:t.kind,readyState:t.readyState,label:t.label};i.Xn.info("zc.at"+" call. ".concat(null==e?void 0:e.id," track: ")+JSON.stringify(o)),i.rtcModules.advancedModule.handleTrack("ADD",e,t,r,n)}))},removeTrack:function(e,t){var i=this;return new we((function(r,n){i.Xn.info("zc.rt call"),i.rtcModules.advancedModule.handleTrack("REMOVE",e,t,r,n)}))},enableCameraCapturing:function(e,t){return void 0===t&&(t=!0),ep(this,void 0,void 0,(function(){var i,r,n,o,s;return tp(this,(function(a){return i=this.ve.createSpan(Kh.H,{key:ci},{key:""},"/device/enable_camera"),r=oo(e,this.Xn),(n=this.ee.checkPreview(r))?(o=this.ee.getPublishList(r),s=o.map((function(e){return{stream_id:e.streamID}})),i.setAttributes({enable:Xh(t),stream_list:Hh(s)}),i.end(),[2,n.enableCameraCapturing(t)]):(this.Xn.error("zsc.ecc "+je),this.ve.setError(i,gt),[2,!1])}))}))}},ap={},cp={enableCamera:function(e,t,i){var r;return ep(this,void 0,void 0,(function(){var n,o,s,a,c,u,l,d,h,p,f,m,v,g,y,b,_=this;return tp(this,(function(S){switch(S.label){case 0:return this.localStream&&0!=this.localStream.getVideoTracks().length?(n=this.videoTrack,a=this.lowStream,!e&&this.muteImage?(c=Oe(this.muteImage.width,this.muteImage.height),u=c.getContext("2d"),this.muteImageAnID=setInterval((function(){u.drawImage(_.muteImage,0,0)}),100),o=c.captureStream().getVideoTracks()[0],this.localStream.removeTrack(this.localStream.getVideoTracks()[0]),this.localStream.addTrack(o),this.rtcViewer&&this.rtcViewer.setVideo(o),a&&(s=o.clone())):e&&this.muteImage&&(this.isVideoNodeQueueEnabled?setTimeout((function(){_.replacePreviewTrack(_.videoNodeQueue.getDestinationTrack(),!0)}),800):this.replacePreviewTrack(this.videoTrack,!1)),l=this.re.browser,i&&!e||!n?i&&!e&&((null===(r=this.videoEffect)||void 0===r?void 0:r.enabled)||this.isVideoNodeQueueEnabled?this.Xn.warn("zp.ec.2 Unable to keep the preview screen when beauty is turned on"):(g=this.cloneVideoTrack,this.cloneVideoTrack=this.videoTrack.clone(),this.cloneVideoTrack.enabled=!0,this.replacePreviewTrack(this.cloneVideoTrack,!1,{retainTrack:!0}),t.trackUtils.stopTrack(g))):(n.enabled=e,"chrome"===l&&e&&!hn(n.getSettings().width)&&n.getSettings().width>0&&(d=Re())&&(h=0,(p=(d.toLowerCase().match(/chrome\/([\d.]+)/)||[])[1])&&(h=parseInt(p.split(",")[0])),h&&h>=87&&h<92&&(f=n.getSettings().width-1,m=n.getSettings().height-1,v=n.getSettings().frameRate,n.applyConstraints({width:f,height:m,frameRate:v}).then((function(){n.applyConstraints({width:_.videoInfo.width,height:_.videoInfo.height,frameRate:v})}))))),n&&(n.enabled=e),this.isVideoNodeQueueEnabled?(this.videoNodeQueue.getDestinationTrack().enabled=e,e?[3,2]:[4,this.videoNodeQueue.replaceNewSourceByTrack(null,!1)]):[3,5]):(this.Xn.error("zp.ec.2 video track no found"),[2,!1]);case 1:S.sent(),S.label=2;case 2:return e&&n?[4,this.videoNodeQueue.replaceNewSourceByTrack(n,!1)]:[3,4];case 3:S.sent(),S.label=4;case 4:S.label=5;case 5:return null==a||a.getVideoTracks().forEach((function(t){t.enabled=e})),y=t.checkPreview(this.localStream),(b=t.getPublishList(this.localStream).map((function(e){return e.publisher}))).length&&b.forEach((function(t){var i,r=null===(i=t.peerConnection)||void 0===i?void 0:i.getSenders().filter((function(e){var t;return"video"===(null===(t=e.track)||void 0===t?void 0:t.kind)}));r&&r.forEach((function(t,i){if(!e&&_.muteImage)r.length>1&&0===i&&s?null==t||t.replaceTrack(s):o&&(null==t||t.replaceTrack(o));else if(e){var n=0;_.isVideoNodeQueueEnabled?(n=800,t.track!==_.videoNodeQueue.getDestinationTrack()&&(null==t||t.replaceTrack(_.videoNodeQueue.getDestinationTrack()))):t.track!==_.videoTrack&&((null==y?void 0:y.streamFromCanvas)?null==t||t.replaceTrack(y.streamFromCanvasTrack):r.length>1&&0===i?null==t||t.replaceTrack(a.getVideoTracks()[0]):null==t||t.replaceTrack(_.videoTrack)),n?setTimeout((function(){_.muteImageAnID&&clearInterval(_.muteImageAnID)}),n):_.muteImageAnID&&clearInterval(_.muteImageAnID)}}));var n=_.muteImage&&!e?0:ip(_.videoTrack,l);t.sendStreamStatus(n,t.mic_status)})),this.isVideoEnabled=e,this.Xn.info("zp.ec.2 call success"),[2,!0]}}))}))},enableMicrophone:function(e,t){if(!this.localStream)return this.Xn.error("zp.em.2 no localStream"),!1;this.localStream.getAudioTracks().forEach((function(t){t.enabled=e})),this.audioTrack&&(this.audioTrack.enabled=e&&t.isMicEnabled);var i=t.getPublishList(this.localStream).map((function(e){return e.publisher}));return i.length&&i.forEach((function(i){i.signal&&i.sendStreamStatus(i.camera_status,e&&t.isMicEnabled?0:2)})),this.isAudioEnabled=e,this.Xn.debug("zp.em.2 call success. "+e),!0},syncTrackState:function(e,t){t.enabled=e.enabled},replacePreviewTrack:function(e,t,i){return void 0===t&&(t=!1),void 0===i&&(i={}),ep(this,void 0,void 0,(function(){var r,n,o,s,a,c,u;return tp(this,(function(l){return this.Xn.info("zsc.rpt.0 call"),e&&e.kind&&this.localStream?(r=!0===(null==i?void 0:i.retainTrack),o=!(n="audio"===e.kind),s=n?"audioTrack":"videoTrack",this.syncAudioEnabled&&n&&this.syncTrackState(this.audioTrack,e),o&&this.syncVideoEnabled&&this.syncTrackState(this.videoTrack,e),n&&this.insertableaudio&&this.insertableaudio.track.id!==e.id&&(e=this.insertableaudio.getInsertableStreamTrack(e)),!r&&o&&!t&&this.isVideoNodeQueueEnabled?(this.Xn.info("zsc.rpt.0 videoNodeQueue replaceNewSource"),this._videoNodeQueue.replaceNewSourceByTrack(e,void 0,$h({},i))):n&&this.audioNodeQueue&&!i.isTrackProcessedFromOriginalStream?((a=new MediaStream).addTrack(e),c=this.ac.createMediaStreamSource(a),this.audioNodeQueue.replaceSource(c),this.voiceProccessor&&Pe()&&e!==this._emptyAudioTrack&&this.voiceProccessor.resetWorklet()):n&&!this.audioNodeQueue&&this.destNode&&!i.isTrackProcessedFromOriginalStream?(this.createSrcNode(e,!0).connect(this.destNode),this.Xn.info("zsc.rpt.0 replace audio track with audio mix.")):(this.Xn.info("zsc.rpt.0 replace local track"),(u=this.localStream.getTracks().find((function(t){return t.kind===e.kind})))!==e&&(u&&this.localStream.removeTrack(u),this.localStream.addTrack(e)),this.rtcViewer&&(this.rtcViewer.setTrack(o,e),"safari"===this.re.browser&&this.rtcViewer.resume(!0)),!r&&o&&this.enableDualStream&&this.createLowStream()),t||r||i.isTrackProcessedFromOriginalStream||(this[s]=e,"REMOVE"===i.handleTrack&&o&&(this.localStream.removeTrack(e),this.rtcViewer&&this.rtcViewer.setTrack(!0,null),this[s]=null)),this.ee.soundLevelDelegate&&this.soundMeterWorklet&&(this.mic=this.soundMeterWorklet.replaceSrcSource(this.ac,this.localStream)),n&&this.streamCompositor&&this.streamCompositor.replaceSource(this.localStream),i.isCamera&&(n?this.audioPreviewType="camera":this.videoPreviewType="camera"),this.Xn.info("zsc.rpt.0 end"),[2]):[2]}))}))},enableCameraCapturing:function(e){return ep(this,void 0,void 0,(function(){var t,i,r,n,o,s,a,c,u,l,d=this;return tp(this,(function(h){switch(h.label){case 0:return t=this.videoPreviewType||this.previewType,this.localStream&&this.videoTrack&&"camera"===t?(i=this.ee.getPublishList(this.localStream).map((function(e){return e.publisher})),e?"live"!==this.videoTrack.readyState?[3,1]:(this.Xn.warn("zp.ecc camera is already capturing"),[3,12]):[3,13]):(this.Xn.error("zp.ecc not camera stream"),[2,!1]);case 1:r=this.getMediaStreamConstraints($h($h({},this.mediaStreamConfig),{audio:!1})).mediaStreamConstraints,h.label=2;case 2:return h.trys.push([2,11,,12]),[4,navigator.mediaDevices.getUserMedia(r)];case 3:return(n=h.sent()).getTracks().forEach((function(e){return Zn(e,d.Xn,"zsc.ecc")})),(o=n.getVideoTracks()[0]).enabled=this.isVideoEnabled,!1===o.enabled&&this.Xn.warn("zp.ecc video is not enabled"),!this.muteImage||this.isVideoEnabled?[3,4]:(this.videoTrack=o,o.enabled=!this.isVideoEnabled,[3,10]);case 4:if(!i.length)return[3,9];s=0,h.label=5;case 5:return s<i.length?[4,i[s].replacePublishedTrack(o)]:[3,8];case 6:if(0!==(null==(a=h.sent())?void 0:a.errorCode))throw a;h.label=7;case 7:return s++,[3,5];case 8:return[3,10];case 9:this.replacePreviewTrack(o),h.label=10;case 10:return this.updateZegoStreamCaptureTrack(o),[3,12];case 11:return c=h.sent(),this.Xn.error("zsc.ecc resume camera capturing failed. "+JSON.stringify(c)),[2,!1];case 12:return[3,15];case 13:return u=this.re.browser,[4,this.stopCaptureVideo()];case 14:h.sent(),i.length&&(l=this.muteImage&&!this.isVideoEnabled?0:ip(this.videoTrack,u),i.forEach((function(e){e.sendStreamStatus(l,e.mic_status)}))),h.label=15;case 15:return[2,!0]}}))}))},stopCaptureVideo:function(){return ep(this,void 0,void 0,(function(){var e,t,i,r,n=this;return tp(this,(function(o){switch(o.label){case 0:return e=this.lowStream,t=this.videoTrack.enabled,i="safari"===this.re.browser,r=function(){return ep(n,void 0,void 0,(function(){return tp(this,(function(t){switch(t.label){case 0:return this.videoTrack.enabled=!1,null==e||(e.getVideoTracks()[0].enabled=!1),[4,new Promise((function(e){setTimeout((function(){e(void 0)}),1e3)}))];case 1:return t.sent(),[2]}}))}))},this.re.engineConfig.previewClearLastFrame?i?[3,2]:(this.videoTrack.enabled=!1,e&&(e.getVideoTracks()[0].enabled=!1),[4,new we((function(e){setTimeout((function(){e(void 0)}),200)}))]):[3,7];case 1:o.sent(),o.label=2;case 2:return this.isVideoNodeQueueEnabled?i?[4,r()]:[3,4]:[3,6];case 3:o.sent(),o.label=4;case 4:return[4,this.videoNodeQueue.replaceNewSourceByTrack(null,!1)];case 5:o.sent(),o.label=6;case 6:return this.ee.trackUtils.stopTrack(this.videoTrack),this.ee.trackUtils.stopTrack(null==e?void 0:e.getVideoTracks()[0]),this.stopCanvasStreamTrack(),this.videoTrack.enabled=t,[3,12];case 7:return this.isVideoNodeQueueEnabled?i?[4,r()]:[3,9]:[3,11];case 8:o.sent(),o.label=9;case 9:return[4,this.videoNodeQueue.replaceNewSourceByTrack(null,!1)];case 10:o.sent(),o.label=11;case 11:this.ee.trackUtils.stopTrack(this.videoTrack),this.ee.trackUtils.stopTrack(null==e?void 0:e.getVideoTracks()[0]),this.stopCanvasStreamTrack(),o.label=12;case 12:return[2]}}))}))}},up={mutePlayStream:function(e,t,i,r){var n=this;return void 0===r&&(r=!0),this.Xn.info("zsc.mps.0 call "+t+" "+i),new we((function(o,s){var a,c;if(!ln(e)||""==e)return n.Xn.error("zsc.mps.0 streamID must be string and not empty"),void s(!1);if(!dn(i))return n.Xn.error("zsc.mps.0 mute must be boolean"),void s(!1);var u=n.ee.playerList[e];if(!u)return n.Xn.error("zsc.mps.0 player not found"),void s(!1);if("video"===t){if(u.playOption&&!1===u.playOption.video||u.player&&0!==u.player.cameraStatus)return n.Xn.error("zsc.mps.0 stream no contain video"),void s(!1);if(r&&(null===(a=u.player)||void 0===a?void 0:a.isServerMuteVideo))return n.Xn.error("zsc.mps.0 stream ".concat(e," has forbid video")),void s(!1);u.player.signal.ActivatePlayVideoStream(n.re.getSeq(),u.player.sessionId,i,(function(){var t,r,s,a;n.Xn.info("zsc.mps.0 suc"),u.player.playMediaStatus.video=!i;var c=Lh,l=n.ve.createSpan(Kh.H,{key:wh,par:e},{key:""},c.event);l.setAttributes({webrtc_sid:c.webrtc_sid(u.player.sessionId),video_activate:c.video_activate(!!u.player.playMediaStatus.video),audio_activate:c.audio_activate(!!u.player.playMediaStatus.audio),video_layer:c.video_layer(2===(null===(r=null===(t=u.player)||void 0===t?void 0:t.playOption)||void 0===r?void 0:r.streamType)?-1:null===(a=null===(s=u.player)||void 0===s?void 0:s.playOption)||void 0===a?void 0:a.streamType)}),l.end(),o(!0)}),(function(){n.Xn.error("zsc.mps.0 fail"),s(!1)}))}else if("audio"===t){if(u.playOption&&!1===u.playOption.audio||u.player&&0!==u.player.micStatus)return n.Xn.error("zsc.mps.0 stream no contain audio"),void s(!1);if(r&&(null===(c=u.player)||void 0===c?void 0:c.isServerMuteAudio))return n.Xn.error("zsc.mps.0 stream ".concat(e," has forbid audio")),void s(!1);u.player.signal.ActivatePlayAudioStream(n.re.getSeq(),u.player.sessionId,i,(function(){n.Xn.info("zsc.mps.0 suc"),u.player.playMediaStatus.audio=!i;var t=Lh,r=n.ve.createSpan(Kh.H,{key:wh,par:e},{key:""},t.event);r.setAttributes({webrtc_sid:t.webrtc_sid(u.player.sessionId),video_activate:t.video_activate(!!u.player.playMediaStatus.video),audio_activate:t.audio_activate(!!u.player.playMediaStatus.audio)}),r.end(),o(!0)}),(function(){n.Xn.error("zsc.mps.0 fail"),s(!1)}))}else s(!1)}))},setStreamAudioOutput:function(e,t){var i=this;return!(null==t||0==t.length||!e)&&(this.Xn.debug("zsc.ssao.0 device "+t),e?"undefined"!==e.sinkId?(e.setSinkId(t).then((function(){i.Xn.info("zsc.ssao.0 success device: "+t)})).catch((function(e){i.Xn.info("zsc.ssao.0 "+e.name)})),!0):(this.Xn.error("zsc.ssao.0 browser does not suppport"),!1):(this.Xn.error("zsc.ssao.0 no localVideo"),!1))}},lp={activateSEIInsert:function(e,t,i){void 0===i&&(i=0);var r=this.ee.checkPreview(e);return r?0!==t&&1!==t?(this.Xn.error(mh+" value of “action” should be 0 or 1"),!1):(r.activatesSEIConfig={action:t,infoType:i},this.ee.getPublishList(e).map((function(e){return e.publisher})).forEach((function(e){e.activateSEIInsert(t,i)})),!0):(this.Xn.error(mh+" stream is not created"),!1)}},dp={activateSEIInsert:function(e,t){var i=this;return new we((function(r,n){return i.signal?(i.signal&&i.signal.activateSEIInsert(i.re.getSeq(),i.sessionId,i.peerID,e,t,(function(e,t,n){var o=!1;0===n.result?(i.Xn.info(mh+" called success"),o=!0):1===n.result?(i.Xn.error(mh+" "+n.peer_id+" invalid param."),o=!1):2===n.result&&(i.Xn.error(mh+" peer not exist"),o=!1),r(o)}),(function(e){1===e&&i.Xn.error(mh+" request timeout")})),!1):r(!1)}))},replacePublishedTrack:function(e,t,i){var r;return void 0===t&&(t=!1),void 0===i&&(i={}),ep(this,void 0,void 0,(function(){var n,o,s,a,c,u,l,d,h=this;return tp(this,(function(p){switch(p.label){case 0:return null==(n=this.previewer)||n.videoEffect,s=n["".concat(o=e.kind,"Track")],a=null===(r=this.peerConnection)||void 0===r?void 0:r.getSenders().filter((function(e){var t;return(null===(t=e.track)||void 0===t?void 0:t.kind)===o})),c=this.re.browser,s||i.handleTrack?(u=0,l=0,"video"===o?(u=ip(t?s:e,c),l=this.mic_status):"audio"===o&&(l=ip(e,c),u=this.camera_status),[4,n.replacePreviewTrack(e,t,i)]):[3,2];case 1:return p.sent(),d=e,"audio"==e.kind&&n.insertableaudio&&(d=n.localStream.getAudioTracks()[0]),a?(a.forEach((function(e,i){return ep(h,void 0,void 0,(function(){var r,s,c;return tp(this,(function(u){switch(u.label){case 0:return r="audio"===o&&n.destNode,s=!1,("video"!==o||!t&&n.isVideoNodeQueueEnabled)&&("audio"!==o||r)||(s=!0),s?"video"==o&&n.lowStream&&a.length>1&&0==i?[4,e.replaceTrack(n.lowStream.getVideoTracks()[0])]:[3,2]:[3,6];case 1:return u.sent(),[3,6];case 2:return"video"==o&&n.streamFromCanvas?(n.streamFromCanvasTrack&&!n.zegoCaptureStream||(c=n.getStreamThroughCanvas(n.localStream),n.streamFromCanvasTrack=c.getVideoTracks()[0]),[4,e.replaceTrack(n.streamFromCanvas?n.streamFromCanvasTrack:d)]):[3,4];case 3:return u.sent(),[3,6];case 4:return[4,e.replaceTrack(d)];case 5:u.sent(),u.label=6;case 6:return[2]}}))}))})),this.sendStreamStatus(u,l)):this.Xn.info("zc.rt.1 replace remote track will work after stream published"),this.Xn.info("zc.rt.1 replace remote track success"),[2,{errorCode:0,extendedData:""}];case 2:return this.Xn.error("zc.rt.1 publisher track no found"),[2,{errorCode:Bt,extendedData:zt}]}}))}))}},hp={activateSEIInsert:function(e,t,i,r,n,o,s){this.Xn.info(mh+" call "+t);var a="ActivateSEIInsertReq",c=this.webrtcCenterSvr.getBodyData(a,{peer_id:i,action:r,info_type:n});this.sendMessageWithCallback(a,e,t,c,o,s)}},pp={type:"Advance",install:function(e,t,i,r,n,o,s,a){for(var c in Object.defineProperty(t.prototype,"initAdvance",{value:function(){this.advancedModule=new Jh(this.Xn,this.dataReport,this.ee,this.re)},writable:!1}),sp)Object.defineProperty(e.prototype,c,{value:sp[c],writable:!1});for(var c in ap)Object.defineProperty(i.prototype,c,{value:ap[c],writable:!1});for(var c in cp)Object.defineProperty(r.prototype,c,{value:cp[c],writable:!1});for(var c in up)Object.defineProperty(n.prototype,c,{value:up[c],writable:!1});for(var c in lp)Object.defineProperty(o.prototype,c,{value:lp[c],writable:!1});for(var c in dp)Object.defineProperty(s.prototype,c,{value:dp[c],writable:!1});for(var c in hp)Object.defineProperty(a.prototype,c,{value:hp[c],writable:!1})}},fp=function(){function e(e,t){this.Xn=e,this.re=t,this.attempt=0,this.baseInterval=.3,this.capInterval=4.8,this.retryRule=0,this.retryTimer=null,this.maxTimer=null,this.isOverTime=!1,this.RETRY_MAX_TIME=60}return e.prototype.setRetryRule=function(e){switch(this.retryRule=e,e){case 1:this.baseInterval=.3,this.capInterval=32;break;case 0:this.baseInterval=.3,this.capInterval=4.8}},e.prototype.getRetryDelayByCount=function(e){var t;t=1===this.retryRule?e+2:e<2?0:e;var i,r=Math.min(this.capInterval,this.baseInterval*Math.pow(2,t)),n=(0,i=1e3*r,Math.floor(Math.random()*(i-0+1))+0);return this.Xn.info("".concat("zc.hrh.grdbc"," ").concat(this.attempt," ").concat(r," ").concat(n)),n},e.prototype.initCallback=function(e,t){this.sucCallBack=e,this.failCallBack=t},e.prototype.startMaxTime=function(){var e,t=this;this.Xn.info("".concat(Ia," ").concat(null===(e=this.requestInfo)||void 0===e?void 0:e.streamID," call")),this.maxTimer?this.Xn.warn("".concat(Ia," max timer")):(this.maxTimer=setTimeout((function(){var e;t.Xn.warn("".concat(Ia," ").concat(null===(e=t.requestInfo)||void 0===e?void 0:e.streamID," over max time ").concat(t.RETRY_MAX_TIME,"s, stop retry")),t.isOverTime=!0,t.requestFail(t._err)}),1e3*this.RETRY_MAX_TIME),this.Xn.info("".concat(Ia," maxTimer=").concat(this.maxTimer)))},e.prototype.invalid=function(){this.clearRetryTimer(),this.attempt=0},e.prototype.clearRetryTimer=function(){this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null)},e.prototype.requestFail=function(e){this.invalid(),this.stopMaxTime(),this.failCallBack&&(this.failCallBack(e),this.resetCallback())},e.prototype.stopMaxTime=function(){this.Xn.info("".concat("zc.hrh.smt.1"," stop max timer")),this.maxTimer&&clearTimeout(this.maxTimer),this.maxTimer=null},e.prototype.resetCallback=function(){this.sucCallBack=void 0,this.failCallBack=void 0},e}(),mp=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vp=function(e){function t(t,i,r){var n=e.call(this,t,i)||this;return n.Xn=t,n.re=i,n.Ir=r,n.RETRY_MAX_TIME=8,n}return mp(t,e),t.prototype.initReqParams=function(e,t){this.streamId=e,this.cdnPushConfig=t},t.prototype.active=function(e){var t=this;if(void 0===e&&(e=!1),this.retryTimer)this.Xn.warn("".concat(wa," was actived, ignore"));else if(this.isOverTime)this.Xn.warn("".concat(wa," retry over time, stop retry"));else{var i=function(){t.clearRetryTimer(),t.Ir.sendCDNRequest(t.streamId,t.cdnPushConfig,(function(e,i){var r=e.body;t.invalid(),t.stopMaxTime(),t.sucCallBack&&(t.sucCallBack&&t.sucCallBack(r,i),t.resetCallback())}),(function(e){t._err=e;var i=e.status_code;t.isOverTime?t.requestFail(e):((429===i||i>=500&&i<600)&&t.setRetryRule(1),t.active())})),e||t.attempt++};if(e)i();else{var r=this.getRetryDelayByCount(this.attempt);this.retryTimer=setTimeout(i,r)}}},t}(fp);rp=__webpack_require__(1054).proto_media,np=__webpack_require__(2100),op=__webpack_require__(1583),np.util.Long=op,np.configure();var gp,yp=function(){function e(){}return e.prototype.encodeRelayPublishCdnReq=function(e){var t=rp.RelayPublishCdnRequest.create(e);return rp.RelayPublishCdnRequest.encode(t).finish()},e.prototype.decodeRelayPublishCdnRsp=function(e){var t=rp.RelayPublishCdnResponse.decode(e);return t.request_seq_v2&&op.isLong(t.request_seq_v2)&&(t.request_seq_v2=t.request_seq_v2.toNumber()),t},e}();!function(e){e[e.I=0]="I",e[e.H=10]="H",e[e.M=100]="M",e[e.L=1e3]="L"}(gp||(gp={}));var bp,_p,Sp,Tp={},Ep={_sendCDNPublishByAccessHub:function(e,t,i,r){var n=this;this.mediaProtoBuf||(this.mediaProtoBuf=new yp);var o=new vp(this.logger,this.stateCenter,this);o.initReqParams(e,t);var s=function(e,t){try{var i=n.mediaProtoBuf.decodeRelayPublishCdnRsp(e);n.logger.info("zb.sh.pt rsp decode ".concat(JSON.stringify(i)));var r=(null==i?void 0:i.response)||{};return{code:r.code,msg:r.message}}catch(e){return{code:-1}}};o.initCallback((function(e,o){var a=s(e),c=a.code,u=a.msg;c&&0!=c?(n.logger.error("zb.sh.pt "+t.type+" error code: "+c+" "+u),r(5004===c?Gt:rt," cmd: ".concat(t.type," ").concat(c," ").concat(u))):(n.logger.info("zb.sh.pt "+t.type+" success"),i&&i({errorCode:0,extendedData:""}))}),(function(e){var i=e.status_code,o=e.body,a=e.code,c=e.msg,u=JSON.parse(JSON.stringify(sn.error.Wn)),l="";if(a)u={code:a,msg:c},l=c;else if(200===i)n.logger.info("zb.sh.pt error: "),u=sn.error.Wn,l="cmd: ".concat(t.type);else{var d="";if(ln(o))d=o;else{var h=s(o);d=h.code+" "+h.msg}l="request media server fail, error: "+i+" "+d}n.logger.error("zb.sh.pt "+l),r&&r(u,l)})),o.startMaxTime(),o.active(!0)},sendCDNRequest:function(e,t,i,r){var n=this,o="addpush"===t.type?1:2,s={request_seq:this.stateCenter.cdnSeq++,request_cmd:o,streamid:e,cdn_server:t.pushUrl,request_seq_v2:this.stateCenter.cdnSeqV2++};this.logger.info("zb.sh.scpba "+JSON.stringify(s));var a=this.mediaProtoBuf.encodeRelayPublishCdnReq(s);this.sendHttpPBRequest({interfaceID:6,resID:this.stateCenter.appid+"/"+e},a,(function(e,t){n.logger.info("zb.sh.pt receive message "+(null==e?void 0:e.status_code)),i&&i(e,t)}),(function(e){r&&r(e)}),{timeout:4e3})},_publishTarget:function(e,t,i){this.logger.info("zb.sh.pt call");var r=e.streamID;this.stateCenter.testEnvironment&&(r="zegotest-"+this.stateCenter.appid+"-"+e.streamID),this.stateCenter.useNetAgent&&this._sendCDNPublishByAccessHub(r,e,t,i)}},Cp=function(){function e(e,t,i,r){this.Xn=e,this.dataReport=t,this.ee=i,this.re=r,this.screenShotReady=!1}return Object.defineProperty(e.prototype,"ve",{get:function(){return this.re.reporter},enumerable:!1,configurable:!0}),e.prototype.publishTarget=function(e){var t=this,i="";switch(e.type){case"addpush":i="/mss/pushadd";break;case"delpush":case"clearpush":i="/mss/pushdel"}var r=this.ve.createSpan(gp.H,{key:li.event,par:e.streamID},{key:""},i);return r.setAttributes({url:an(e.pushUrl)}),new we((function(i,n){var o=function(e,i){t.Xn.error("zb.pt "+(i||e.message)),t.ve.setError(r,e,i),n({errorCode:e.code,extendedData:e.message+(i?" "+i:"")})};if(-1==["addpush","delpush","clearpush"].indexOf(e.type))return t.Xn.error("zb.sh.pt cdn push type error"),void o(xt,"type error");if(e.streamID&&ln(e.streamID))if(e.pushUrl&&ln(e.pushUrl))if(t.re.publishStreamList[e.streamID]){var s=t.ee.getRoomByStreamID(e.streamID);s?s.streamHandler._publishTarget(e,(function(e){r.end(),i(e)}),o):o(sn.error.Jn)}else o(sn.error.Hn);else o(sn.error.ki,"push url error");else o(sn.error.ki,"stream id type error")}))},e}(),wp={type:"StreamCDN",install:function(e,t,i){for(var r in Object.defineProperty(t.prototype,"initStreamCDN",{value:function(){this.streamCDNModule=new Cp(this.logger,this.dataReport,this.streamCenter,this.stateCenter)},writable:!1}),Tp)Object.defineProperty(e.prototype,r,{value:Tp[r],writable:!1});for(var r in Ep)Object.defineProperty(i.prototype,r,{value:Ep[r],writable:!1})}},Ip="zc.pe.0",Rp="zc.pe.1",kp="zc.aep",Pp="zc.sma.0",Ap="zc.sma.1",Dp="zc.mb",Np="zc.p.0.pe.0",Op="zc.p.0.pe.1",Mp="zc.p.0.re",Lp="zc.p.0.se",xp="zc.p.0.sma.0",Up="zc.smav",Bp="zc.p.0.mb",zp="zc.p.0.smav",qp=function(){function e(e,t,i,r,n){this.Xn=e,this.ac=t,this.localStream=i,this.destination=r,this.rtcViewer=n,this.audioBufferList=[],this.replace=!1,this.effectEndedCallBack=null,this.effectEndedListener=null,this.startTimes=0,this.startOffset=0,this.pauseTimes=0,this.resumeOffset=0,this.paused=!1,this.isMixAudio=!1,this.isMixingBuffer=!1,this.loop=!1}return e.prototype.playEffect=function(e,t,i,r,n){var o=this;!0!==this.isMixAudio?this.audioBuffer?(this.startOffset=e||0,this.loop=t||!1,this.replace=i||!1,this.effectEndedCallBack=n,this.mixEffect(this.audioBuffer,(function(){o.buffSource.loop=!!t,e?o.buffSource.start(0,e/1e3):o.buffSource.start(0),o.startTimes=Date.now(),o.effectEndedListener=o.effectEndedHandler.bind(o),o.buffSource.addEventListener("ended",o.effectEndedListener),r&&r()}))):this.Xn.error("amu.pe.1 no audio buffer found"):this.Xn.warn("amu.pe.1 audio is mixing")},e.prototype.stopMixingBuffer=function(){return this.isMixingBuffer=!1,this.stopMixingAudio()},e.prototype.playRealTimeEffect=function(e){var t=this;this.mixEffect(e,(function(){t.buffSource&&t.buffSource.start(0),t.buffSource&&t.buffSource.addEventListener("ended",(function(){t.audioBufferList.shift(),t.audioBufferList.length>0&&t.isMixAudio&&t.playRealTimeEffect(t.audioBufferList[0])}))}))},e.prototype.pauseEffect=function(){this.audioBufferList.length>0?this.Xn.error("amu.pe.0 real time buffer can not be paused"):(this.stopMixingAudio(!0),this.resumeOffset=(this.pauseTimes-this.startTimes+this.startOffset)%(1e3*this.audioBuffer.duration),this.paused=!0)},e.prototype.resumeEffect=function(){return this.audioBufferList.length>0?(this.Xn.error("amu.pe.0 real time buffer can not be resume"),!1):(this.playEffect(this.resumeOffset,this.loop,this.replace,void 0,this.effectEndedCallBack),this.startOffset=this.resumeOffset,this.paused=!1,!0)},e.prototype.mixEffect=function(e,t){this.localStream?(this.ac.resume(),this.gainNode=this.ac.createGain(),this.delayNode=this.ac.createDelay(1),this.delayNode.delayTime.value=0,this.buffSource=this.ac.createBufferSource(),this.buffSource.buffer=e,this.buffSource.connect(this.gainNode),this.gainNode.connect(this.ac.destination),this.replaceTrack()&&t()):this.Xn.error("amu.me.0 localStream can not be found")},e.prototype.replaceTrack=function(){if(!this.destination)return!1;this.gainNode.connect(this.delayNode),this.delayNode.connect(this.destination);var e=this.destination.stream.getAudioTracks()[0],t=this.localStream.getTracks();return this.micTrack=this.localStream.getAudioTracks()[0],this.micTrack!==e&&(this.micTrack?t.includes(this.micTrack)&&this.localStream.removeTrack(this.micTrack):this.Xn.warn("amu.rt.0 origin track not fonud"),t.includes(e)||(this.localStream.addTrack(e),this.rtcViewer&&this.rtcViewer.setAudio(e))),this.isMixAudio=!0,!0},e.prototype.effectEndedHandler=function(){this.stopMixingAudio(),this.effectEndedCallBack&&this.effectEndedCallBack(),this.effectEndedCallBack=null},e.prototype.stopMixingAudio=function(e){return void 0===e&&(e=!1),this.paused?(this.Xn.info("amu.sma.1 audioEffect is paused"),!e&&this.effectEndedListener&&(this.effectEndedCallBack&&this.effectEndedCallBack(),this.effectEndedCallBack=null),!0):this.isMixAudio?this.localStream?(this.buffSource&&(this.buffSource.removeEventListener("ended",this.effectEndedListener),this.buffSource.stop(),this.pauseTimes=Date.now(),this.buffSource.disconnect(this.gainNode),this.buffSource=null),this.gainNode.disconnect(),this.delayNode.disconnect(),this.isMixAudio=!1,this.audioBufferList=[],!e&&this.effectEndedListener&&(this.effectEndedCallBack&&this.effectEndedCallBack(),this.effectEndedCallBack=null),!0):(this.Xn.error("amu.sma.1 localStream can not be found"),!1):(this.Xn.warn("amu.sma.1 no mixing audio found"),!0)},e.prototype.getProcess=function(){var e=Date.now();return this.paused&&(e=this.pauseTimes),(e-this.startTimes+this.startOffset)%(1e3*this.audioBuffer.duration)},e.prototype.seekTo=function(e){void 0===e&&(e=0),this.startOffset=e,this.paused?this.resumeOffset=e:(this.stopMixingAudio(!0),this.playEffect(e,this.loop,this.replace,void 0,this.effectEndedCallBack))},e.prototype.mixingBuffer=function(e,t){var i=this;!0!==this.isMixAudio||0!=this.audioBufferList.length||0!=this.isMixingBuffer?(this.ac.resume(),this.ac.decodeAudioData(e,(function(e){i.audioBufferList.push(e),1==i.audioBufferList.length&&i.playRealTimeEffect(i.audioBufferList[0]),i.isMixingBuffer=!0,t&&t()}),(function(e){i.Xn.error("amu.mb.0 "+e),t&&t({code:1103057,message:"decode audio data fail "+e})}))):this.Xn.error("amu.mb.0 audio is mixing")},e.prototype.setMixingAudioVolume=function(e){return this.gainNode?(console.error("ktv setVolume",e),this.gainNode.gain.value=e,!0):(this.Xn.error("amu.sma.2 no mixing audio found"),!1)},e.prototype.setDelay=function(e){return this.delayNode?(this.Xn.info("amu.sma.2 set delay: "+e),this.delayNode.delayTime.value=e,!0):(this.Xn.warn("amu.sma.2 no mixing audio found"),!1)},e}(),Xp=function(){function e(e,t,i,r,n,o,s){void 0===s&&(s=1);var a=this;this.Xn=e,this.acMgr=t,this.localStream=i,this.browser=r,this.destination=n,this.rtcViewer=o,this.volumeFactor=s,this.isMixAudio=!1,this.maxDelay=1,this.audioCurrentTimer=null,this.audioResumedTimer=null,this.audioEl=null,this.eventHandler={volumechange:function(e){var t=e.target;t&&a.audioNode&&a.isMediaElSrc&&(t.muted||t.paused?(a.Xn.info("amu.sma.0 ".concat(a.id," audio muted disconnect")),a.audioNode.disconnect()):(a.Xn.info("amu.sma.0 ".concat(a.id," audio is connected")),a.audioNode.connect(a.gainNode)))},canplay:function(e){var t=e.target;t&&!a.isMediaElSrc&&a.isMixAudio&&(a.Xn.info("amu.sma.1 ".concat(a.id," canplay, remixing audio")),a.stopMixingAudio(),a.startMixingAudio(t))}},this.isMediaElSrc=!1,this.volume=1,this.delay=0,this.id=Date.now()%1e5+Math.floor(10*Math.random()),e.info("amu.sma.0 ".concat(this.id," init audio mix"))}return Object.defineProperty(e.prototype,"ac",{get:function(){return this.acMgr.ac},enumerable:!1,configurable:!0}),e.prototype.startMixingAudio=function(e){if(this.isMixAudio)return this.Xn.error("amu.sma.0 audio is mixing"),!1;if(!this.localStream)return this.Xn.error("amu.sma.0 localStream can not be found"),!1;var t;e.captureStream=e.captureStream||e.mozCaptureStream||e.webkitCaptureStream,this.isMixAudio=!0,this.gainNode||(this.gainNode=this.ac.createGain(),this.setMixingAudioVolume()),this.delayNode||(this.delayNode=this.ac.createDelay(this.maxDelay),this.Xn.info("amu.sma.1 ".concat(this.id," init set delay: ")+this.delay),this.delayNode.delayTime.value=this.delay);var i="safari"===this.browser;this.isMediaElSrc=!0;try{var r=this.acMgr.getMediaElementRenderer(e);if(!r)return!1;this.audioNode=r.getMixNode().mixOutputNode,this.audioEl=e}catch(e){t=e}e.addEventListener("volumechange",this.eventHandler.volumechange),e.addEventListener("pause",this.eventHandler.volumechange),e.addEventListener("play",this.eventHandler.volumechange);var n=this.getBrowserInfo(),o=!1;return i&&"10.15.6"===(null==n?void 0:n.sysVer)&&"13.1.2"===(null==n?void 0:n.ver)&&(o=!0),o&&(this.audioResumedTimer=setInterval((function(){e.currentTime=e.currentTime+.45}),6e3)),t?(this.Xn.info("amu.sma.1 ".concat(this.id," create source failed: ")+t),!0):(this.audioNode.connect(this.gainNode),this.Xn.info("amu.sma.1 ".concat(this.id," mix audio success.")),this.replaceTrack())},e.prototype.getBrowserInfo=function(){var e,t={},i=Re().toLowerCase();e=(i.match(/x [\d._]+/gi)+"").replace(/[^0-9|_.]/gi,"").replace(/_/gi,"."),t.sysVer=e;var r=i.match(/(msie|firefox|chrome|opera|version).*?([\d.]+)/);return r&&(t.browser=r[1].replace(/version/,"'safari"),t.ver=r[2]),t},e.prototype.replaceTrack=function(){if(!this.destination)return!1;this.gainNode.connect(this.delayNode),this.delayNode.connect(this.destination);var e=this.destination.stream.getAudioTracks()[0],t=this.localStream.getTracks();return this.micTrack=this.localStream.getAudioTracks()[0],this.micTrack!==e&&(this.micTrack?t.includes(this.micTrack)&&this.localStream.removeTrack(this.micTrack):this.Xn.warn("amu.rt.1 origin track not fonud"),t.includes(e)||(this.localStream.addTrack(e),this.rtcViewer&&this.rtcViewer.setAudio(e))),!0},e.prototype.stopMixingAudio=function(){return this.isMixAudio?this.localStream?(this.audioEl&&(this.audioEl.removeEventListener("volumechange",this.eventHandler.volumechange),this.audioEl.removeEventListener("pause",this.eventHandler.volumechange),this.audioEl.removeEventListener("play",this.eventHandler.volumechange),this.audioEl.removeEventListener("canplay",this.eventHandler.canplay),this.audioEl=null),this.audioNode&&(this.audioNode.disconnect(),this.audioNode=null,this.audioCurrentTimer&&(clearInterval(this.audioCurrentTimer),this.audioCurrentTimer=null),this.audioResumedTimer&&(clearInterval(this.audioResumedTimer),this.audioResumedTimer=null)),this.gainNode.disconnect(),this.delayNode.disconnect(),this.isMixAudio=!1,this.Xn.info("amu.sma.1 ".concat(this.id," stop mix audio success.")),!0):(this.Xn.error("amu.sma.1 localStream can not be found"),!1):(this.Xn.warn("amu.sma.1 no mixing audio found"),!0)},e.prototype.setMixingAudioVolume=function(e,t){if(void 0===e?e=this.volume:this.volume=e,void 0===t?t=this.volumeFactor:this.volumeFactor=t,!this.gainNode)return this.Xn.error("amu.sma.2 no mixing audio found"),!1;var i=e*this.volumeFactor;return this.Xn.info("amu.sma.2 "+this.id+" set volume: "+i),this.gainNode.gain.value=i,!0},e.prototype.setDelay=function(e){return this.delayNode?(e/=1e3,!isNaN(e)&&(e>this.maxDelay&&(e=this.maxDelay),e<0&&(e=0),this.Xn.info("amu.sma.1 ".concat(this.id," set delay: ")+e),this.delayNode.delayTime.value=e,this.delay=e,!0)):(this.Xn.warn("amu.sma.1 no mixing audio found"),!1)},e}(),Hp=function(){function e(e){this.Te=e,this.audioDestNode=void 0,this._audioMixList=[],this._arrayBufferMap={},this._effectList=[],this.volumeFactor=1}return Object.defineProperty(e.prototype,"delay",{get:function(){return this.re.engineConfig.mixingAudioDelay+this.re.engineConfig.baseMixingAudioDelay},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Xn",{get:function(){return this.Te.logger},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_localStream",{get:function(){return this.Te.localStream},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ee",{get:function(){return this.Te.streamCenter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"re",{get:function(){return this.Te.stateCenter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ac",{get:function(){return this.acMgr.ac},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"acMgr",{get:function(){return this.Te.acMgr},enumerable:!1,configurable:!0}),e.prototype.startMixingAudio=function(e){var t=this;if(this.Xn.info(xp+" call"),!this._localStream)return this.Xn.error(xp+" localStream not found"),!1;var i=!0;return e.forEach((function(e){if(t._audioMixList.find((function(t){return t.media==e})))t.Xn.warn(xp+" mix audio already exist");else if(t._localStream){t.ee.soundLevelDelegate&&t.Te.stopSoundLevel();var r=t.createDestNode(),n=new Xp(t.Xn,t.acMgr,t._localStream,t.re.browser,r,t.Te.rtcViewer,t.volumeFactor);t._audioMixList.push({audioMix:n,media:e}),n.startMixingAudio(e)||(i=!1),n.setDelay(t.delay),t.ee.soundLevelDelegate&&t.Te.startSoundLevel()}})),i},e.prototype.stopMixingAudio=function(e){var t=this;return this.Xn.info("zc.p.0.sma.1 call"),e?e.forEach((function(e){for(var i=0;i<t._audioMixList.length;i++)if(t._audioMixList[i].media==e){t._audioMixList[i].audioMix.stopMixingAudio()&&t._audioMixList.splice(i--,1);break}})):(this._audioMixList.forEach((function(e){return e.audioMix.stopMixingAudio()})),this._audioMixList=[]),!0},e.prototype.setVolumeFactor=function(e){this.Xn.info(zp+" set factor: "+e),isNaN(e)&&this.Xn.error(zp+" set factor failed"),this.volumeFactor=e,this._audioMixList.forEach((function(t){t.audioMix.setMixingAudioVolume(void 0,e)}))},e.prototype.setMixingAudioVolume=function(e,t){this.Xn.info(zp+" call");var i=this._audioMixList.find((function(e){return e.media===t}));return i?(i.audioMix.setMixingAudioVolume(e),this.Xn.info(zp+" call success"),!0):(this.Xn.error(zp+" audio is not mixing"),!1)},e.prototype.playEffect=function(e,t,i,r){var n=this;if(this.Xn.info(Np+" call"),this._localStream)if(this._effectList.find((function(i){return i.effectID==e.effectID&&i.audioBuffer==t})))this.Xn.warn(Np+" effect already exist ");else{this.ee.soundLevelDelegate&&this.Te.stopSoundLevel();var o=this.createDestNode(),s=new qp(this.Xn,this.ac,this._localStream,o,this.Te.rtcViewer);s.audioBuffer=t;var a={processor:s,effectID:e.effectID,audioBuffer:t};this._effectList.push(a),s.playEffect(e.playTime,e.loop,!1,(function(){i&&i()}),(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n._effectList=n._effectList.filter((function(e){return e!==a})),r&&r.apply(void 0,e)})),this.ee.soundLevelDelegate&&this.Te.startSoundLevel(),this.Xn.info(Np+" play effect "+e.effectID+" success")}else this.Xn.warn(Np+" stream not found")},e.prototype.pauseEffect=function(e){var t=this._effectList.find((function(t){return t.effectID==e}));if(t)this.ee.soundLevelDelegate&&this.Te.stopSoundLevel(),t.processor.pauseEffect(),this.ee.soundLevelDelegate&&this.Te.startSoundLevel(),this.Xn.info(Op+" pause "+e+" success");else{if(!hn(e))return this.Xn.error(Op+" effect not found"),!1;this.ee.soundLevelDelegate&&this.Te.stopSoundLevel(),this._effectList.forEach((function(e){return e.processor.pauseEffect()})),this.ee.soundLevelDelegate&&this.Te.startSoundLevel()}return!0},e.prototype.resumeEffect=function(e){var t=this._effectList.find((function(t){return t.effectID==e}));if(t){this.ee.soundLevelDelegate&&this.Te.stopSoundLevel();var i=t.processor.resumeEffect();return this.ee.soundLevelDelegate&&this.Te.startSoundLevel(),this.Xn.info(Mp+" resume "+e+" success"),i}return hn(e)?(this.ee.soundLevelDelegate&&this.Te.stopSoundLevel(),this._effectList.forEach((function(e){return e.processor.resumeEffect()})),this.ee.soundLevelDelegate&&this.Te.startSoundLevel(),!0):(this.Xn.error(Mp+" no effect found"),!1)},e.prototype.stopEffect=function(e){var t=this._effectList.find((function(t){return t.effectID==e}));if(t)this.ee.soundLevelDelegate&&this.Te.stopSoundLevel(),t.processor.stopMixingAudio(),this._effectList=this._effectList.filter((function(e){return e!==t})),this.ee.soundLevelDelegate&&this.Te.startSoundLevel(),this.Xn.info(Lp+" pause "+e+" success");else{if(!hn(e))return this.Xn.error(Lp+" effect not found"),!1;this.ee.soundLevelDelegate&&this.Te.stopSoundLevel(),this._effectList.forEach((function(e){return e.processor.stopMixingAudio()})),this._effectList=[],this.ee.soundLevelDelegate&&this.Te.startSoundLevel()}return!0},e.prototype.setEffectVolume=function(e,t,i){var r=this._effectList.find((function(e){return e.effectID==t}));if(r)r.processor.setMixingAudioVolume(e),r.processor.setDelay(i||1e-7),this.Xn.info("zp.sev.0 set volume "+t+" success");else{if(!hn(t))return this.Xn.error("zp.sev.0 effect not found"),!1;this._effectList.forEach((function(t){return t.processor.setMixingAudioVolume(e)}))}return!0},e.prototype.mixingBuffer=function(e,t,i){var r=this;if(this.Xn.info(Bp+" call"),this._localStream)if(this._arrayBufferMap[e])this.ee.soundLevelDelegate&&this.Te.stopSoundLevel(),this._arrayBufferMap[e].mixingBuffer(t,(function(){r.ee.soundLevelDelegate&&r.Te.startSoundLevel(),i&&i()}));else{this.ee.soundLevelDelegate&&this.Te.stopSoundLevel();var n=this.createDestNode(),o=new qp(this.Xn,this.ac,this._localStream,n,this.Te.rtcViewer);this._arrayBufferMap[e]=o,o.mixingBuffer(t,(function(){r.ee.soundLevelDelegate&&r.Te.startSoundLevel(),i&&i()}))}},e.prototype.stopMixingBuffer=function(e){if(e&&this._arrayBufferMap[e])return this.ee.soundLevelDelegate&&this.Te.stopSoundLevel(),this._arrayBufferMap[e].stopMixingBuffer(),delete this._arrayBufferMap[e],this.ee.soundLevelDelegate&&this.Te.startSoundLevel(),!0;if(hn(e)){for(var t in this.ee.soundLevelDelegate&&this.Te.stopSoundLevel(),this._arrayBufferMap)this._arrayBufferMap[t].stopMixingBuffer();return this.ee.soundLevelDelegate&&this.Te.startSoundLevel(),!0}return this.Xn.warn(Bp+" arrayBuffer no found"),!1},e.prototype.getEffectProgress=function(e){var t=this._effectList.find((function(t){return t.effectID==e}));return t?t.processor.getProcess():(this.Xn.error(kp+" effect not found"),0)},e.prototype.seekAudioEffect=function(e,t){var i=this._effectList.find((function(t){return t.effectID==e}));return i?(this.ee.soundLevelDelegate&&this.Te.stopSoundLevel(),i.processor.seekTo(t),this.ee.soundLevelDelegate&&this.Te.startSoundLevel(),!0):(this.Xn.error(kp+" effect not found"),!1)},e.prototype.stopAudioManager=function(){this.stopMixingAudio(),this.stopMixingBuffer(),this.stopEffect()},e.prototype.createDestNode=function(){var e=null,t=this.Te.createDestNode(this._localStream);return this.Te.audioNodeQueue||((e=this.Te.createSrcNode()).disconnect(),e.connect(t)),t},e.prototype.setMixingDelay=function(e){this._audioMixList.forEach((function(t){t.audioMix.setDelay(e)}))},e}(),Fp=function(){function e(e,t,i,r,n,o){var s=this;this.Xn=e,this.dataReport=t,this.re=i,this.ee=r,this.ac=n,this.rtcModules=o,this.buffer=null,this.blank=null,this.mixingDelay=0,Pe()&&null==this.blank&&null==this.buffer&&(this.buffer=this.ac.createBuffer(1,1,this.ac.sampleRate),this.blank=this.ac.createBufferSource(),this.blank.buffer=this.buffer,this.blank.connect(this.ac.destination),this.blank.start()),this.rtcModules.bindListener("_engineConfigUpdate",(function(e){var t=e.mixingAudioDelay+e.baseMixingAudioDelay;isNaN(t)||t===s.mixingDelay||(s.Xn.info("zc.am.mdu delay update:"+t+", origin:"+s.mixingDelay),s.mixingDelay=t,s.ee.previewStreamList.forEach((function(e){e.audioMixManager&&e.audioMixManager.setMixingDelay(t)})))}))}return e.prototype.preloadEffect=function(e,t,i){if(this.checkPreviewer(Ip,{effectID:e},{effectID:!0}))if(t&&ln(t)){if(this.re.audioEffectBuffer[e])return this.Xn.warn(Ip+" audio buffer already exists"),void(i&&i());this.Xn.info(Ip+" start preload effect"),this._preloadEffect(this.ac,e,t,i)}else this.Xn.error(Ip+" params error")},e.prototype.checkPreviewer=function(e,t,i){void 0===t&&(t={});var r=!!(null==i?void 0:i.effectID),n=!!(null==i?void 0:i.streamID),o=!!(null==i?void 0:i.previewer),s=t.effectID,a=t.streamID,c=a&&(ln(a)?a:oo(a,this.Xn));if((n||c)&&!ln(c)&&!gn(c))return this.Xn.error(e+" stream type error"),!1;if(r&&!s)return this.Xn.error(e+" effectID required"),!1;if(s&&!ln(s))return this.Xn.error(e+" effectID type error"),!1;if(o){var u=this.ee.getPreviewer(c);return u||(ln(c)?this.Xn.error(e+" "+c+" stream is not publishing"):this.Xn.error(e+" stream doesn't exist"),!1)}return!0},e.prototype.getEffectDuration=function(e){if(!this.checkPreviewer(kp,{effectID:e},{effectID:!0}))return 0;var t=this.re.audioEffectBuffer[e];return t?t.duration?Math.floor(1e3*t.duration):0:(this.Xn.error(kp+" effect not found"),0)},e.prototype.getEffectProgress=function(e,t){var i=this.checkPreviewer(kp,{streamID:e,effectID:t},{effectID:!0,streamID:!0,previewer:!0});return dn(i)?0:this.getAudioManager(i).getEffectProgress(t)},e.prototype.seekAudioEffect=function(e,t,i){if(i<0)return this.Xn.error(kp+" param time error "),!1;var r=this.checkPreviewer(kp,{streamID:e,effectID:t},{effectID:!0,streamID:!0,previewer:!0});return!dn(r)&&this.getAudioManager(r).seekAudioEffect(t,i)},e.prototype.playEffect=function(e,t,i){return function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var r,n,o,s,a=this;return function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}(this,(function(c){switch(c.label){case 0:return r=oo(e.stream,this.Xn)||e.streamID,n=e.path,this.checkPreviewer(Rp,{streamID:r,effectID:o=e.effectID},{streamID:!0,effectID:!0})?(s=this.re.audioEffectBuffer[o],n?s?(this.Xn.warn(Rp+" audio effect already exists"),[3,3]):[3,1]:[3,4]):[2];case 1:return[4,new we((function(e,t){a.preloadEffect(o,n,(function(i){i?(a.Xn.error(Rp+" preload audio effect failed"),t(i)):e(void 0)}))}))];case 2:c.sent(),c.label=3;case 3:return[3,5];case 4:if(!s)return this.Xn.error(Rp+" audio effect doesn't exists"),[2];c.label=5;case 5:return this._playEffect(e,t,i),[2]}}))}))},e.prototype.pauseEffect=function(e,t){var i=ln(e)?e:oo(e,this.Xn);return this._pauseEffect(i,t)},e.prototype.resumeEffect=function(e,t){var i=ln(e)?e:oo(e,this.Xn);return this._resumeEffect(i,t)},e.prototype.stopEffect=function(e,t){var i=ln(e)?e:oo(e,this.Xn);return this._stopEffect(i,t)},e.prototype.unloadEffect=function(e){return!!this.checkPreviewer("zc.ue",{effectID:e},{effectID:!0})&&(delete this.re.audioEffectBuffer[e],!0)},e.prototype.setEffectVolume=function(e,t,i,r){if(!un(t)||t<0||t>200)return this.Xn.error("zc.sev volume must be a number between 0 and 200"),!1;var n=ln(e)?e:oo(e,this.Xn),o=this.checkPreviewer("zc.sev",{streamID:n,effectID:i},{streamID:!0,previewer:!0});return!dn(o)&&this.getAudioManager(o).setEffectVolume(t/100,i,r)},e.prototype.startMixingAudio=function(e,t){var i=ln(e)?e:oo(e,this.Xn);return this.Xn.info(Pp+" call "+i),i?t?(this.Xn.info(Pp+" end "+i),Array.isArray(t)&&0!==t.length&&t.every((function(e){return bn(e)}))?this.Tr(i,t):(this.Xn.error(Pp+" audio list param type error"),!1)):(this.Xn.error(Pp+" no audio"),!1):(this.Xn.error(Pp+" stream not found"),!1)},e.prototype.stopMixingAudio=function(e,t){var i=ln(e)?e:oo(e,this.Xn);return i?Array.isArray(t)&&0!==t.length||hn(t)?this._stopMixingAudio(i,t):(this.Xn.error(Ap+" audio param type error"),!1):(this.Xn.error(Ap+" stream not found"),!1)},e.prototype.mixingBuffer=function(e,t,i,r){var n=ln(e)?e:oo(e,this.Xn);this.Xn.info(Dp+" call streamID: "+JSON.stringify(n)+" sourceID:"+t),n?t&&ln(t)?(this._mixingBuffer(n,t,i,r),this.Xn.info(Dp+" end")):this.Xn.error(Dp+" param source id format error"):this.Xn.error(Dp+" param streamid format error")},e.prototype.stopMixingBuffer=function(e,t){var i=ln(e)?e:oo(e,this.Xn);return this._stopMixingBuffer(i,t)},e.prototype.setMixingAudioVolume=function(e,t,i){if(this.Xn.info(Up+" call"),!e)return this.Xn.error(Up+" stream not found"),!1;if(!un(t)||t<0||t>200)return this.Xn.error(Up+" volume must be a number between 0 and 200"),!1;if(!i||!bn(i))return this.Xn.error(Up+" no audio"),!1;var r=ln(e)?e:oo(e,this.Xn);return this._setMixingAudioVolume(r,t,i)},e.prototype.getSoundLevel=function(e,t,i){var r="zc.gsl";Me(this.Xn,r);var n=this.ee.getCloudSoundInterval();try{var o=this.ee.createSoundLevel(this.ac,e,this.ee.soundLevelInterval,n,(function(e){t(e)}));this.re.audioStreamList[e.id]={mic:o.mic,script:o.soundMeter}}catch(e){i(e)}xe(this.Xn,r)},e.prototype.stopSoundLevel=function(e){this.Xn.info("zc.ssl call");var t=this.re.audioStreamList[e.id];t.mic.disconnect(),t.script.destroy(),delete this.re.audioStreamList[e.id]},e.prototype._preloadEffect=function(e,t,i,r){var n=this,o=new XMLHttpRequest;o.open("GET",i,!0),o.setRequestHeader("Range","none"),o.responseType="arraybuffer",o.onload=function(){if(200==o.status||304==o.status)e.decodeAudioData(o.response,(function(e){n.Xn.info("zc.pe.0 effect '".concat(t,"' preload success")),n.re.audioEffectBuffer[t]=e,r&&r()}),(function(e){n.Xn.error("zc.pe.0 effect '".concat(t,"' preload fail. ")+e),r&&r(e)}));else{var i=o.statusText;n.Xn.error("zc.pe.0 effect '".concat(t,"' preload fail.")+i),r&&r(i)}},o.send()},e.prototype._playEffect=function(e,t,i){var r=oo(e.stream,this.Xn)||e.streamID,n=this.re.audioEffectBuffer[e.effectID];if(n){var o=this.checkPreviewer(Rp,{streamID:r,effectID:e.effectID},{streamID:!0,effectID:!0,previewer:!0});dn(o)||this.getAudioManager(o).playEffect(e,n,t,i)}else this.Xn.error(Rp+" no audio buffer found")},e.prototype._pauseEffect=function(e,t){var i=this.checkPreviewer("zc.pe.2",{streamID:e,effectID:t},{streamID:!0,previewer:!0});return!dn(i)&&this.getAudioManager(i).pauseEffect(t)},e.prototype._resumeEffect=function(e,t){var i=this.checkPreviewer("zc.re",{streamID:e,effectID:t},{streamID:!0,previewer:!0});return!dn(i)&&this.getAudioManager(i).resumeEffect(t)},e.prototype._stopEffect=function(e,t){var i=this.checkPreviewer("zc.se",{streamID:e,effectID:t},{streamID:!0,previewer:!0});return!dn(i)&&this.getAudioManager(i).stopEffect(t)},e.prototype._setMixingAudioVolume=function(e,t,i){var r=this.ee.getPreviewer(e);return r?this.getAudioManager(r).setMixingAudioVolume(t/100,i):(this.Xn.error("zc.sma.2 publisher doesn't exist"),!1)},e.prototype.Tr=function(e,t){var i=this.ee.getPreviewer(e);return i?this.getAudioManager(i).startMixingAudio(t):(ln(e)?this.Xn.error("zc.sma.0 "+e+" stream is not publishing"):this.Xn.error("zc.sma.0 stream doesn't exist"),!1)},e.prototype._stopMixingAudio=function(e,t){var i=this.ee.getPreviewer(e);return i?this.getAudioManager(i).stopMixingAudio(t):(this.Xn.error("zc.sma.0 stream doesn't exist"),!1)},e.prototype._mixingBuffer=function(e,t,i,r){var n=this.checkPreviewer("zc.smb",{streamID:e,effectID:t},{effectID:!0,streamID:!0,previewer:!0});dn(n)||(_n(i)?this.getAudioManager(n).mixingBuffer(t,i,r):this.Xn.error("zc.mb.0 array buffer not found"))},e.prototype._stopMixingBuffer=function(e,t){var i=this.checkPreviewer("zc.smb",{streamID:e,effectID:t},{effectID:!0,streamID:!0,previewer:!0});return!dn(i)&&this.getAudioManager(i).stopMixingBuffer(t)},e.prototype.getAudioManager=function(e){var t=e.audioMixManager;return t||(t=new Hp(e),1===this.re.engineConfig.choirRole&&t.setVolumeFactor(.6),e.audioMixManager=t),t},e}(),Vp={type:"AudioMix",install:function(e){Object.defineProperty(e.prototype,"initAudioMix",{value:function(){this.audioMixModule=new Fp(this.logger,this.dataReport,this.stateCenter,this.streamCenter,this.ac,this)}})}},Gp={NOT_LOGIN:Ke,INPUT_PARAM:et,TIMEOUT:tt,MIXER_NO_SERVICES:{code:1005e3,message:"no mix stream service"},MIXER_TASK_ID_NULL:{code:1005001,message:"mixer task is null"},MIXER_TASK_ID_TOO_LONG:{code:1005002,message:"task ID is too long"},MIXER_TASK_ID_INVALID_CHARACTER:{code:1005003,message:"task ID contains illegal characters"},MIXER_NO_OUTPUT_TARGET:{code:1005005,message:"task configuration does not specify output"},MIXER_OUTPUT_TARGET_INVALID:{code:1005006,message:"stream output target is incorrect"},MIXER_START_REQUEST_ERROR:{code:1005010,message:"start mixer task fail, possibly due to network reasons"},MIXER_STOP_REQUEST_ERROR:{code:1005011,message:"stop mixer task fail, possibly due to network reasons"},MIXER_NOT_OWNER_STOP_MIXER:{code:1005012,message:" maxed task must be stopped by the start user of the task"},MIXER_INPUTLIST_NULL:{code:1005020,message:"Mixed stream task input list is null"},MIXER_OUTPUTLIST_NULL:{code:1005021,message:"Mixed stream task output list is null"},MIXER_VIDEO_CONFIG_INVALID:{code:1005023,message:"invalid mixed stream task video configuration"},MIXER_EXCEED_MAX_INPUT_COUNT:{code:1005025,message:"more than the maximum number of input streams"},MIXER_INPUT_STREAM_NOT_EXISTS:{code:1005026,message:"Input stream does not exist"},MIXER_INPUT_PARAMETERS_ERROR:{code:1005027,message:"mix stream input parameters are wrong"},MIXER_INPUT_LABEL_TOO_LONG:{code:1005028,message:"Input stream label text is too long"},MIXER_EXCEED_MAX_OUTPUT_COUNT:{code:1005030,message:"more than the maximum number of output streams"},MIXER_INPUT_IMAGE_URL_TOO_LONG:{code:1005034,message:"Input stream image url too long"},MIXER_INPUT_IMAGE_FORMAT_WRONG:{code:1005035,message:"Input stream image format wrong"},MIXER_INPUT_IMAGE_GET_FAIL:{code:1005036,message:"Input stream image get fail"},MIXER_AUTHENTICATION_FAILED:{code:1005050,message:"mixed stream authentication failed"},MIXER_WATERMARK_NULL:{code:1005061,mag:"input watermark is null"},MIXER_WATERMARK_PARAMETERS_ERROR:{code:1005062,message:"input watermark parameter is wrong"},MIXER_WATERMARK_URL_INVALID:{code:1005063,message:"illegal input watermark URL"},MIXER_BACKGROUND_IMAGE_URL_INVALID:{code:1005067,message:"illegal input background image URL"},MIXER_REPEAT_INPUT:{code:1005099,message:"mix stream input repeat"},MIXER_INNER_ERROR:{code:1005099,message:"mixer internal error"}};bp=__webpack_require__(8413).Z.proto_mixstream,_p=__webpack_require__(2100),Sp=__webpack_require__(1583),_p.util.Long=Sp,_p.configure();var jp,Qp,Wp=function(){function e(){}return e.prototype.encodeMixStreamStartReq=function(e){var t=bp.MixStreamStartRequest.create(e);return bp.MixStreamStartRequest.encode(t).finish()},e.prototype.decodeMixStreamStartRsp=function(e){return bp.MixStreamStartResponse.decode(e)},e.prototype.encodeMixStreamStopReq=function(e){var t=bp.MixStreamStopRequest.create(e);return bp.MixStreamStopRequest.encode(t).finish()},e.prototype.decodeMixStreamStopRsp=function(e){return bp.MixStreamStopResponse.decode(e)},e}(),Zp={event:"/mix/start_mix",error:{ki:Gp.INPUT_PARAM,Ar:Gp.MIXER_TASK_ID_NULL,Nr:Gp.MIXER_TASK_ID_TOO_LONG,Cr:Gp.MIXER_TASK_ID_INVALID_CHARACTER,Dr:Gp.MIXER_INPUTLIST_NULL,zr:Gp.MIXER_OUTPUTLIST_NULL,Pr:Gp.MIXER_OUTPUT_TARGET_INVALID,Mr:Gp.MIXER_NO_OUTPUT_TARGET,jr:Gp.MIXER_START_REQUEST_ERROR,Ur:Gp.MIXER_INNER_ERROR,Lr:Gp.MIXER_INPUT_LABEL_TOO_LONG,qr:Gp.MIXER_INPUT_IMAGE_URL_TOO_LONG,Br:Gp.MIXER_INPUT_IMAGE_FORMAT_WRONG,Gr:Gp.MIXER_WATERMARK_URL_INVALID,Jn:Gp.NOT_LOGIN},mix_stream_conf:Jt,stop_reason:Yt},Kp={event:"/mix/stop_mix",error:{ki:Gp.INPUT_PARAM,Ar:Gp.MIXER_TASK_ID_NULL,jr:Gp.MIXER_STOP_REQUEST_ERROR,Ur:Gp.MIXER_INNER_ERROR,Jn:Gp.NOT_LOGIN}},Jp={event:"/mix/config_mix",error:{ki:Gp.INPUT_PARAM,Fr:Gp.MIXER_VIDEO_CONFIG_INVALID,Hr:Gp.MIXER_BACKGROUND_IMAGE_URL_INVALID,Jn:Gp.NOT_LOGIN},mix_params:Jt},Yp=function(){return Yp=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Yp.apply(this,arguments)};function $p(e,t){var i,r="",n=Gp;return t.errorCode<2e9&&t.errorCode>1e9?(r=function(e){var t={1:"MIXER_START_REQUEST_ERROR",2:"MIXER_START_REQUEST_ERROR",3:"MIXER_AUTHENTICATION_FAILED",141:"MIXER_INPUT_IMAGE_FORMAT_WRONG",142:"MIXER_INPUT_IMAGE_GET_FAIL",150:"MIXER_INPUT_STREAM_NOT_EXISTS",151:"MIXER_START_REQUEST_ERROR",152:"MIXER_STOP_REQUEST_ERROR",153:"MIXER_INPUT_PARAMETERS_ERROR",154:"MIXER_EXCEED_MAX_OUTPUT_COUNT",155:"MIXER_INPUT_PARAMETERS_ERROR",156:"MIXER_VIDEO_CONFIG_INVALID",157:"MIXER_NO_SERVICES",158:"MIXER_EXCEED_MAX_INPUT_COUNT",159:"MIXER_START_REQUEST_ERROR",160:"MIXER_NOT_OWNER_STOPMIXER",170:"MIXER_WATERMARK_PARAMETERS_ERROR",171:"MIXER_WATERMARK_NULL",175:"MIXER_REPEAT_INPUT",179:"MIXER_INPUT_LABEL_TOO_LONG",190:"MIXER_START_REQUEST_ERROR"},i="MIXER_INNER_ERROR";return e>1e9&&t[e-1e9]&&(i=t[e-1e9]),i}(t.errorCode-1e4),i=n[r]):t.errorCode<1e6&&(i=e.decodeServerError(t.errorCode,t.extendedData),r=e.getLiveRoomError(t.errorCode,e.useNetAgent)),{reportErr:i,actualError:n[r]}}jp=__webpack_require__(1583),function(e){e[e.I=0]="I",e[e.H=10]="H",e[e.M=100]="M",e[e.L=1e3]="L"}(Qp||(Qp={}));var ef,tf={},rf={startMixerTask:function(e){var t=this;return new we((function(i,r){var n,o,s,a,c,u,l,d,h,p,f,m=t.reporter.createSpan(Qp.H,{key:ci},{key:Zp.event,par:e.taskID},Zp.event,!0),v={errorCode:Gp.MIXER_INPUT_PARAMETERS_ERROR.code,extendedData:Gp.MIXER_INPUT_PARAMETERS_ERROR.message};if(null==e?void 0:e.inputList.find((function(e){return null==e.streamID&&(v.extendedData=v.extendedData+". streamID should be of string type",!0)})))return t.reporter.setError(m,Gp.MIXER_INPUT_PARAMETERS_ERROR),void r(v);var g=e.outputConfig;g&&g.outputFps&&(g.outputFPS=g.outputFps);var y=function(i){var n=$p(t.stateCenter,i),o=n.reportErr,s=n.actualError;1000010150===i.errorCode&&m.setAttributes({stop_reason:"UnmatchStreamId"}),t.reporter.setError(m,o||i),t.reporter.spanEnd({key:Zp.event,par:e.taskID}),s&&(i.errorCode=null==s?void 0:s.code,i.extendedData=(null==s?void 0:s.message)||""),r(i)},b=t.stateCenter.roomList[0];if(b){var _,S,T=[];if(!e.noTaskID&&!e.taskID)return t.logger.error("zb.sh.ums no taskId found"),void y({errorCode:Zp.error.Ar.code,extendedData:Zp.error.Ar.message});if(!e.noTaskID&&!ln(e.taskID))return t.logger.error("zb.rh.lg taskId must be string"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});if(!e.noTaskID&&e.taskID.length>256)return t.logger.error("zb.sh.ums taskId is too long"),void y({errorCode:Zp.error.Nr.code,extendedData:Zp.error.Nr.message});if(!e.noTaskID&&!Tn(e.taskID))return t.logger.error("zb.sh.ums task ID contains illegal characters"),void y({errorCode:Zp.error.Cr.code,extendedData:Zp.error.Cr.message});if(!e.inputList||0==e.inputList.length)return t.logger.error("zb.sh.ums input list wrong"),void y({errorCode:Zp.error.Dr.code,extendedData:Zp.error.Dr.message});e.inputList.forEach((function(e){"AUDIO"===e.contentType&&(!e.layout&&(e.layout={top:0,left:0,bottom:0,right:0}),e.layout.top=0,e.layout.left=0,e.layout.bottom=1,e.layout.right=1)}));for(var E=0;E<e.inputList.length;E++){var C=e.inputList[E],w={errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message};if(!pn(C.layout))return t.logger.error("zb.sh.ums input layout must be object"),void y(w);var I=C.layout,R=I.bottom,k=I.left,P=I.right;if(!(Nn(I.top,!1)&&Nn(R,!1)&&Nn(k,!1)&&Nn(P,!1)))return t.logger.error("zb.sh.ums top、left、bottom、right must be integer number"),void y(w);if(void 0!==C.renderMode&&![0,1].includes(C.renderMode))return t.logger.error("zb.sh.ums render_mode is wrong"),void y(w);if(void 0!==C.imageInfo){if(!ln(C.imageInfo.url))return t.logger.error("zb.sh.ums image url is require string"),void y(w);if(C.imageInfo.url.length>1024)return t.logger.error("zb.sh.ums input image url length too long"),void y({errorCode:Zp.error.qr.code,extendedData:Zp.error.qr.message})}if(!hn(C.label)){if(!ln(null===(n=C.label)||void 0===n?void 0:n.text)||(null===(o=C.label)||void 0===o?void 0:o.text.length)>=300)return t.logger.error("zb.sh.ums input label text is not string or too long"),void y({errorCode:Zp.error.Lr.code,extendedData:Zp.error.Lr.message});var A=C.label,D=A.left,N=A.top;if(void 0!==D&&!Nn(D,!1)||void 0!==N&&!Nn(N,!1))return t.logger.error("zb.sh.ums input label left and top should be integer"),void y(w)}if(void 0!==C.cornerRadius&&!Nn(C.cornerRadius,!1))return t.logger.error("zb.sh.ums cornerRadius is wrong"),void y(w);if(void 0!==C.soundLevelID&&!Nn(C.soundLevelID,!1))return t.logger.error("zb.sh.ums soundLevelID is wrong"),void y(w)}if(!e.outputList||0==e.outputList.length)return t.logger.error("zb.sh.ums no output list found"),void y({errorCode:Zp.error.zr.code,extendedData:Zp.error.zr.message});if(e.outputList.some((function(e){return ln(e)&&!En(e)&&!Tn(e)||pn(e)&&e.target&&!En(e.target)&&!Tn(e.target)})))return t.logger.error("zb.sh.ums stream output target is incorrect"),void y({errorCode:Zp.error.Pr.code,extendedData:Zp.error.Pr.message});if(!((_=e.inputList.every((function(e){return"AUDIO"===e.contentType})))||g&&pn(g)))return t.logger.error("zb.sh.ums no output config found"),void y({errorCode:Zp.error.Mr.code,extendedData:Zp.error.Mr.message});if(_&&(e.outputConfig=g=Yp(Yp({},g||{}),{outputBitrate:.001,outputFPS:1,outputWidth:1,outputHeight:1})),!(_||g.outputBitrate&&Nn(g.outputBitrate)))return t.logger.error("zb.sh.ums bitrate param is required and must be integer number"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});if(!g.outputFPS||!Nn(g.outputFPS))return t.logger.error("zb.sh.ums fps param is required and must be integer number"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});if(!g.outputWidth||!Nn(g.outputWidth))return t.logger.error("zb.sh.ums width param is required and must be integer number"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});if(!g.outputHeight||!Nn(g.outputHeight))return t.logger.error("zb.sh.ums height param is required and must be integer number"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});if(void 0!==g.outputAudioCodecID&&!Nn(g.outputAudioCodecID,!1))return t.logger.error("zb.sh.ums AudioCodecID param must be integer number"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});if(void 0!==g.outputAudioBitrate&&!Nn(g.outputAudioBitrate))return t.logger.error("zb.sh.ums AudioBitrate param must be integer number"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});if(void 0!==g.outputAudioChannels&&!Nn(g.outputAudioChannels,!1))return t.logger.error("zb.sh.ums AudioChannels param must be integer number"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});if(!hn(e.watermark)){if(!ln(null===(s=e.watermark)||void 0===s?void 0:s.imageURL))return t.logger.error("zb.sh.ums watermark image type error"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});if(!((S=null===(a=e.watermark)||void 0===a?void 0:a.imageURL).startsWith("preset-id://")||S.startsWith("http")||S.startsWith("https"))||!(S.endsWith(".jpg")||S.endsWith(".jpeg")||S.endsWith(".png")))return t.logger.error("zb.sh.ums watermark image url invalid"),void y({errorCode:Zp.error.Gr.code,extendedData:Zp.error.Gr.message})}if(!hn(e.whiteboard)){if(!ln(null===(c=e.whiteboard)||void 0===c?void 0:c.whiteboardID))return t.logger.error("zb.sh.ums whiteboard is required and must be string"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});if(!pn(null===(u=e.whiteboard)||void 0===u?void 0:u.layout))return t.logger.error("zb.sh.ums whiteboard layout must be object"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});var O=null===(l=e.whiteboard)||void 0===l?void 0:l.layout;if(R=O.bottom,k=O.left,P=O.right,!(Nn(O.top,!1)&&Nn(R,!1)&&Nn(k,!1)&&Nn(P,!1)))return t.logger.error("zb.sh.ums whiteboard top、left、bottom、right must be integer number"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});var M=e.whiteboard,L=M.horizontalRatio,x=M.verticalRatio,U=M.isPPTAnimation,B=M.zOrder,z=M.backgroundColor;if(!hn(L)&&!Nn(L))return t.logger.error("zb.sh.ums horizontalRatio must be integer number"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});if(!hn(x)&&!Nn(x))return t.logger.error("zb.sh.ums verticalRatio must be integer number"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});if(!hn(U)&&!dn(U))return t.logger.error("zb.sh.ums isPPTAnimation must be boolean"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});if(!hn(B)&&!Nn(B,!1))return t.logger.error("zb.sh.ums zOrder must be integer number"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});if(!hn(z)&&!Nn(z,!1))return t.logger.error("zb.sh.ums backgroundColor must be integer number"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message})}if(!hn(e.enableSoundLevel)&&!dn(e.enableSoundLevel))return t.logger.error("zb.sh.ums enableSoundLevel is not bool"),void y({errorCode:Zp.error.ki.code,extendedData:Zp.error.ki.message});for(E=0;E<e.inputList.length;E++){var q=e.inputList[E],X=q.streamID;t.stateCenter.testEnvironment&&(X="zegotest-"+t.stateCenter.appid+"-"+q.streamID),T.push({stream_id:X,content_control:"AUDIO"===q.contentType?1:0,top:null===(d=q.layout)||void 0===d?void 0:d.top,left:null===(h=q.layout)||void 0===h?void 0:h.left,bottom:null===(p=q.layout)||void 0===p?void 0:p.bottom,right:null===(f=q.layout)||void 0===f?void 0:f.right,render_mode:q.renderMode,image:q.imageInfo,label:q.label})}var H=[];e.outputList.forEach((function(e){var t="";ln(e)?t=e:pn(e)&&e.target&&(t=e.target);var i=0;(t.startsWith("rtmp://")||t.startsWith("https://")&&t.endsWith(".flv")||t.startsWith("https://")&&t.endsWith(".m3u8"))&&(i=1),H.push({target:t,is_url:i?"true":"false"})})),t.reporter.spanSetAttributes({key:Zp.event,par:e.taskID},{mix_stream_conf:Zp.mix_stream_conf({fps:g.outputFPS,bitrate:g.outputBitrate,w:g.outputWidth,h:g.outputHeight,stream_cnt:T.length,mix_task_id:e.taskID,input_stream_list:T,output_target_list:H})}),b.streamHandler.updateMixStream(e,tf,(function(r){t.reporter.spanEnd({key:Zp.event,par:e.taskID}),i(r)}),y)}else y({errorCode:Zp.error.Jn.code,extendedData:Zp.error.Jn.message})}))},setMixerTaskConfig:function(e){var t=this;return new we((function(i,r){var n,o=t.reporter.createSpan(Qp.H,{key:ci},{key:""},Jp.event),s={},a=function(e){t.reporter.setError(o,e),r(e)};if(e&&e.videoCodec){var c=e.videoCodec.toLowerCase();if(-1==["vp8","h264"].indexOf(c))return t.logger.error("zb.sh.ums param videoCode error"),a({errorCode:Jp.error.Fr.code,extendedData:Jp.error.Fr.message}),!1;s.videoCodec=c}if(e.backgroundColor){if(!Nn(e.backgroundColor))return t.logger.error("zb.sh.ums param backgroundColor must be integer number"),a({errorCode:Jp.error.ki.code,extendedData:Jp.error.ki.message}),!1;s.backgroundColor=e.backgroundColor}var u=e.backgroundImage;if(u){if(!ln(u))return t.logger.error("zb.sh.ums param outputBgImage error"),a({errorCode:Jp.error.ki.code,extendedData:Jp.error.ki.message}),!1;if(!u.startsWith("preset-id://")||!u.endsWith(".jpg")&&!u.endsWith(".png"))return t.logger.error("zb.sh.ums illegal input background image URL"),a({errorCode:Jp.error.Hr.code,extendedData:Jp.error.Hr.message}),!1;s.backgroundImage=u}var l=e&&e.userData;if(l){if(!vn(l))return t.logger.error("zb.sh.ums param userData required Uint8Array"),a({errorCode:Jp.error.ki.code,extendedData:Jp.error.ki.message}),!1;if(l.byteLength>1e3)return t.logger.error("zb.sh.ums param userData should shorter than 1000"),a({errorCode:Jp.error.ki.code,extendedData:Jp.error.ki.message}),!1;s.userData=l}e.extraParams&&(s.extraParams||(s.extraParams=[]),(n=s.extraParams).push.apply(n,e.extraParams)),tf=s,o.setAttributes({mix_params:Jp.mix_params(e)}),t.stateCenter.roomList[0]?(o.end(),i({errorCode:0,extendedData:""})):a({errorCode:Jp.error.Jn.code,extendedData:Jp.error.Jn.message})}))},stopMixerTask:function(e){var t=this;return new we((function(i,r){var n=t.reporter.createSpan(Qp.H,{key:ci},{key:""},Kp.event);if(!e||!ln(e)||e.length>256||!Tn(e))return t.logger.error("zb.rh.lg taskID must be string less 256"),t.reporter.setError(n,Kp.error.ki," param taskID error"),void r({errorCode:Kp.error.ki.code,extendedData:Kp.error.ki.message+" param taskID error"});n.setAttributes({mix_task_id:e});var o=function(e){var i=$p(t.stateCenter,e),o=i.actualError;t.reporter.setError(n,i.reportErr||e),o&&(e.errorCode=null==o?void 0:o.code,e.extendedData=(null==o?void 0:o.message)||""),r(e)},s=t.stateCenter.roomList[0];s?s.streamHandler.stopMixStream(e,(function(e){n.end(),i(e)}),o):o({errorCode:Kp.error.Jn.code,extendedData:Kp.error.Jn.message})}))}},nf={_sendMixStopReqByAccessHub:function(e,t,i){var r=this;this.mixStreamProtoBuf||(this.mixStreamProtoBuf=new Wp),e.timestamp=jp.fromInt(Math.ceil((new Date).getTime()/1e3)),this.logger.info("zb.sh.smseba.1 req "+JSON.stringify(e));var n=this.mixStreamProtoBuf.encodeMixStreamStopReq(e),o=function(t,i){try{var n=r.mixStreamProtoBuf.decodeMixStreamStopRsp(t);$n(n),r.logger.info("zb.sh.smseba.1 rsp "+JSON.stringify(e));var o=(null==n?void 0:n.common_response)||{};return{code:o.code,msg:o.message}}catch(e){return{code:-1}}};this.sendMixRequest({interfaceID:16},n,(function(e,r){var n=o(e),s=n.code,a=n.msg;0!=s&&null!=s||!fn(t)?i&&i({errorCode:s,extendedData:a||""}):t({errorCode:s,extendedData:a})}),(function(e,t,n){var s="";if(n)return n==Gp.TIMEOUT&&(n=Zp.error.jr),n.code&&20010===n.code&&(n=JSON.parse(JSON.stringify(Gp.MIXER_NO_SERVICES))),void(i&&i(n,s));n=Zp.error.Ur;var a="";if(ln(t))a=t;else{var c=o(t);a=c.code+" "+c.msg}r.logger.error("zb.sh.pt "+(s="request media server fail, error: "+e+" "+a)),i&&i(n,s)}))},stopMixStream:function(e,t,i,r,n){this.logger.info("zb.sh.sms call");var o=this.getStopMixStreamParams(e,r,n);this.stateCenter.useNetAgent&&this._sendMixStopReqByAccessHub(o.mixStopReq,t,i)},_sendMixStartReqByAccessHub:function(e,t,i,r){var n=this;this.mixStreamProtoBuf||(this.mixStreamProtoBuf=new Wp),e.timestamp=jp.fromInt(Math.ceil((new Date).getTime()/1e3)),this.logger.info("zb.sh.smseba.0 req "+JSON.stringify(e));var o=this.mixStreamProtoBuf.encodeMixStreamStartReq(e),s=function(e,t){try{var i=n.mixStreamProtoBuf.decodeMixStreamStartRsp(e);$n(i),n.logger.info("zb.sh.smseba.0 rsp "+JSON.stringify(i));var r=i.common_response;return{code:r.code,msg:r.message,data:i.data,errStreamList:i.error_streamid_list}}catch(e){return{code:-1}}};this.sendMixRequest({interfaceID:15},o,(function(e,o){var a=s(e),c=a.code,u=a.errStreamList;if(void 0===c||0==c){var l=a.data.play_infos.map((function(e){var i={rtmpURL:"",hlsURL:"",flvURL:""},r=e.stream_alias||"";return n.stateCenter.testEnvironment&&r&&r.startsWith(t)&&(r=r.slice(t.length)),i.streamID=r,e.rtmp_url&&e.rtmp_url.length>0&&(i.rtmpURL=e.rtmp_url),e.hls_url&&e.hls_url.length>0&&(i.hlsURL=e.hls_url),e.hdl_url&&e.hdl_url.length>0&&(i.flvURL=e.hdl_url),i}));i&&i({errorCode:0,extendedData:JSON.stringify({mixerOutputList:l})})}else{var d="",h=c+1e9;if(1000000150==h&&u){var p=u.map((function(e){return n.stateCenter.testEnvironment&&e.startsWith(t)?e.slice(t.length):e}))||[];p.length>0&&(n.logger.debug("zb.sh.ums not exist streams: "+p),d=p.join(","))}r&&r({errorCode:n.stateCenter.getServerError(1e4+h,n.stateCenter.useNetAgent).code,extendedData:d})}}),(function(e,t,i){var o="";if(i)return i==Gp.TIMEOUT&&(i=Zp.error.jr),i.code&&20010===i.code&&(i=JSON.parse(JSON.stringify(Gp.MIXER_NO_SERVICES))),void(r&&r(i,o));i=Zp.error.Ur;var a="";if(ln(t))a=t;else{var c=s(t);a=c.code+" "+c.msg}n.logger.error("zb.sh.pt "+(o="request media server fail, error: "+e+" "+a)),r&&r(i,o)}))},getStartMixStreamParams:function(e,t){var i,r,n=this,o={request_seq:this.stateCenter.getSeq(),mix_protocol_version:1,task_id:e.taskID,room_id:this.roomID,mix_stream_common:{},input_stream:[],advance_config:[],output_stream:[]},s=e.outputConfig||{};s.singleStreamPassThrough&&dn(s.singleStreamPassThrough)&&(o.mix_stream_common.single_stream_pass_through=s.singleStreamPassThrough?1:0);var a=t;if(a&&(a.videoCodec&&(null===(i=o.advance_config)||void 0===i||i.push({key:"video_encode",value:a.videoCodec})),a.backgroundColor&&(o.mix_stream_common.output_bg_color=a.backgroundColor),a.backgroundImage&&(o.mix_stream_common.output_bg_image=a.backgroundImage),a.userData&&(o.mix_stream_common.user_data=this.stateCenter.uint8arrayToBase64(a.userData)),a.extraParams&&(null===(r=o.advance_config)||void 0===r||r.push.apply(r,a.extraParams))),void 0!==e.enableSoundLevel&&(o.mix_stream_common.with_sound_level=e.enableSoundLevel?1:0),e.inputList.forEach((function(e,t){var i,r,s,a,c,u,l,d,h,p,f,m,v,g,y,b,_,S,T,E,C,w=e.streamID;n.stateCenter.testEnvironment&&(w="zegotest-"+n.stateCenter.appid+"-"+e.streamID);var I={stream_input_common:{stream_id:w,content_control:"AUDIO"===e.contentType?1:0,layer_rect:{layer:null===(i=e.layout)||void 0===i?void 0:i.layer,top:null===(r=e.layout)||void 0===r?void 0:r.top,left:null===(s=e.layout)||void 0===s?void 0:s.left,bottom:null===(a=e.layout)||void 0===a?void 0:a.bottom,right:null===(c=e.layout)||void 0===c?void 0:c.right}},volume:100,audio_h_angle:-1,render_mode:e.renderMode,corner_radius:e.cornerRadius};if(null===(u=e.label)||void 0===u?void 0:u.text){var R={font_type:(null===(d=null===(l=e.label)||void 0===l?void 0:l.font)||void 0===d?void 0:d.type)||0,font_size:(null===(p=null===(h=e.label)||void 0===h?void 0:h.font)||void 0===p?void 0:p.size)||24,font_color:(null===(m=null===(f=e.label)||void 0===f?void 0:f.font)||void 0===m?void 0:m.color)||16777215,font_transparency:(null===(g=null===(v=e.label)||void 0===v?void 0:v.font)||void 0===g?void 0:g.transparency)||0};R.font_border_color=(null===(b=null===(y=e.label)||void 0===y?void 0:y.font)||void 0===b?void 0:b.border)?null===(S=null===(_=e.label)||void 0===_?void 0:_.font)||void 0===S?void 0:S.borderColor:-1;var k={text:null===(T=e.label)||void 0===T?void 0:T.text,text_left:(null===(E=e.label)||void 0===E?void 0:E.left)||0,text_top:(null===(C=e.label)||void 0===C?void 0:C.top)||0,font:R};I.label=k}e.imageInfo&&(I.image=e.imageInfo),e.soundLevelID&&(I.stream_input_common.sound_level_id=e.soundLevelID),o.input_stream.push(I)})),e.outputList.forEach((function(e){var t,i,r="";ln(e)?r=e:pn(e)&&e.target?r=e.target:n.logger.error("zb.sh.ums output target required"),En(r)?(t=1,i=r):(t=0,i=n.stateCenter.testEnvironment?"zegotest-"+n.stateCenter.appid+"-"+r:r);var c={is_url:t,target:i,video_bitrate:1e3*s.outputBitrate,video_fps:s.outputFPS,video_width:s.outputWidth,video_height:s.outputHeight,output_quality:23};s.outputAudioCodecID&&(c.audio_enc_id=s.outputAudioCodecID),"vp8"===a.videoCodec?c.audio_enc_id=3:"h264"===a.videoCodec&&(c.audio_enc_id=0),s.outputAudioBitrate&&(c.audio_bitrate=1e3*s.outputAudioBitrate),o.output_stream.push({output_stream_common:c})})),e.watermark&&(o.water_mark={image:e.watermark.imageURL,layout_rect:e.watermark.layout}),e.whiteboard){var c=e.whiteboard,u=c.horizontalRatio,l=c.verticalRatio,d=c.layout,h=c.zOrder,p=c.isPPTAnimation,f=c.backgroundColor;o.white_board={whiteboard_id:jp.fromString(c.whiteboardID),horizontal_ratio:u||16,vertical_ratio:l||9,is_ppt_animation:!0===p?1:0,layout_rect:Yp(Yp({},d),{layer:h||0}),background_color:f||4059296768}}return isNaN(e.streamAlignmentMode)||(o.alignment_type=e.streamAlignmentMode),o.audio_channel_cnt=s.outputAudioChannels?s.outputAudioChannels:1,{mixStartReq:o}},updateMixStream:function(e,t,i,r){this.logger.info("zb.sh.ums call"),this.logger.info("zb.sh.ums send command");var n=this.getStartMixStreamParams(e,t).mixStartReq;return this.stateCenter.useNetAgent&&this._sendMixStartReqByAccessHub(n,"zegotest-"+this.stateCenter.appid+"-",i,r),!0},getStopMixStreamParams:function(e,t,i){var r={id_name:this.stateCenter.idName,live_channel:this.roomID,appid:this.stateCenter.appid,version:"3.4.0"},n={request_seq:this.stateCenter.getSeq(),room_id:this.roomID};if(ln(e)&&(r.task_id=e,n.task_id=e),null!=t){var o;r.stream_id=o=this.stateCenter.testEnvironment?"zegotest-"+this.stateCenter.appid+"-"+t:t,n.is_url=0,n.target=o}else null!=i&&(r.mixurl=i,n.is_url=1,n.target=i);return{req_body:r,mixStopReq:n}}},of={type:"MixStream",install:function(e,t){for(var i in rf)Object.defineProperty(e.prototype,i,{value:rf[i],writable:!1});for(var i in nf)Object.defineProperty(t.prototype,i,{value:nf[i],writable:!1})}},sf=function(){function e(){}return e.generateEls=function(e){if(void 0===e&&(e=30),this.elements.length>=e)this.elements.forEach((function(e){e.dom.play().catch((function(e){}))}));else{var t=Array(e-this.elements.length).fill(0).map((function(e,t){var i=Ie.createElement("audio");return i.muted=!0,i.setAttribute("autoplay","autoplay"),i.setAttribute("playsInline","playsInline"),i.id="audio"+t,{dom:i,id:t,used:!1}}));this.elements=this.elements.concat(t)}},e.useAudioEl=function(){0===this.elements.length&&this.generateEls();var e=this.elements.find((function(e){return!e.used}));return e&&(e.used=!0),e},e.stopUsingAudioEl=function(e){var t=this.elements[e];t&&(t.dom.onpause=null,t.dom.onerror=null,t.dom.muted=!0,t.used=!1)},e.elements=[],e}(),af="zc.ra.3",cf=function(){function e(e,t){this.Jr=e,this.Xn=t,this.rtcConn=null,this.loopbackConn=null,this.destStream=new MediaStream,this.onError=null}return e.prototype.bindStream=function(e,t){var i,r;return function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var n,o,s,a,c,u,l=this;return function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}(this,(function(d){switch(d.label){case 0:return t&&(this.Jr=t),n=["completed","connected"],this.rtcConn&&this.loopbackConn&&n.includes(this.rtcConn.connectionState)?(o=null===(i=this.rtcConn)||void 0===i?void 0:i.getSenders().find((function(e){var t;return"audio"===(null===(t=e.track)||void 0===t?void 0:t.kind)})),e.getTracks().forEach((function(e){"audio"===e.kind&&(null==o||o.replaceTrack(e))})),[3,10]):[3,1];case 1:this.rtcConn=new RTCPeerConnection,this.loopbackConn=new RTCPeerConnection,s={offerVideo:!0,offerAudio:!0,offerToReceiveAudio:!1,offerToReceiveVideo:!1},this.rtcConn.onicecandidateerror=function(e){l.Xn.warn(af+" ".concat(l.Jr," loopback in ice error: ").concat(JSON.stringify(e)))},this.loopbackConn.onicecandidateerror=function(e){l.Xn.warn(af+" ".concat(l.Jr," loopback out ice error: ").concat(JSON.stringify(e)))},this.rtcConn.onicecandidate=function(e){var t,i=e.candidate;i&&(l.Xn.info(af+" ".concat(l.Jr," loopback add out candidate: ").concat(i)),null===(t=l.loopbackConn)||void 0===t||t.addIceCandidate(new RTCIceCandidate(i)))},this.loopbackConn.onicecandidate=function(e){var t,i=e.candidate;i&&(l.Xn.info(af+" ".concat(l.Jr," loopback add in candidate: ").concat(i)),null===(t=l.rtcConn)||void 0===t||t.addIceCandidate(new RTCIceCandidate(i)))},window.setTimeout((function(){l.rtcConn&&l.loopbackConn&&(n.includes(l.rtcConn.iceConnectionState)&&n.includes(l.loopbackConn.iceConnectionState)?l.Xn.info(af+" ".concat(l.Jr," loopback connect ok.")):(l.Xn.warn(af+" ".concat(l.Jr," loopback connect failed. in state: ").concat(l.rtcConn.iceConnectionState,", out state: ").concat(l.loopbackConn.iceConnectionState)),l.close(),l.onError&&l.onError("time out")))}),2e3),this.loopbackConn.ontrack=function(e){var t=e.track;l.Xn.info(af+" ".concat(l.Jr," loopback receive track")),l.replaceTrack(t)},e.getTracks().find((function(t){var i;if("audio"===t.kind)return null===(i=l.rtcConn)||void 0===i||i.addTrack(t,e),!0})),d.label=2;case 2:return d.trys.push([2,9,,10]),[4,this.rtcConn.createOffer(s)];case 3:return a=d.sent(),[4,this.rtcConn.setLocalDescription(a)];case 4:return d.sent(),[4,this.loopbackConn.setRemoteDescription(a)];case 5:return d.sent(),[4,this.loopbackConn.createAnswer()];case 6:return(c=d.sent()).sdp=null===(r=c.sdp)||void 0===r?void 0:r.replace(/useinbandfec=/,"stereo=1;useinbandfec="),[4,this.loopbackConn.setLocalDescription(c)];case 7:return d.sent(),[4,this.rtcConn.setRemoteDescription(c)];case 8:return d.sent(),this.Xn.info(af+" ".concat(this.Jr," loopback set sdp completed.")),[3,10];case 9:return u=d.sent(),this.Xn.error(af+" ".concat(this.Jr," loopback connect failed.").concat(u)),this.close(),this.onError&&this.onError("connect failed"),this.onError=null,[3,10];case 10:return[2,this.destStream]}}))}))},e.prototype.replaceTrack=function(e){var t=this;"audio"===e.kind&&(this.destStream.getTracks().forEach((function(e){t.destStream.removeTrack(e)})),this.destStream.addTrack(e))},e.prototype.close=function(){var e=this,t=this.rtcConn,i=this.loopbackConn;this.destStream.getTracks().forEach((function(t){e.destStream.removeTrack(t)})),null==t||t.close(),null==i||i.close(),this.rtcConn=null,this.loopbackConn=null},e}(),uf=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},lf=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},df="zc.ra.5",hf=function(){function e(e,t){this.Xn=e,this.userID="base"+(new Date).getTime(),this.isHide=!1,this.distance=null,this.maxDistance=1e3,this.position=null,this.speaker="",this.audioEl=null,this.sourceNode=null,this.isPlaying=!1,this.config={needLoopback:!0,useGain:!0,playOnAudioContext:!1,useWebAudio:!0},this.volume=1,this.gainNode=null,this.isSpatial=!1,this.panner=null,this.audioCtx=t.audioCtx,this.isSpatial=t.isSpatial,this.setMaxDistance(un(t.maxDistance)?t.maxDistance:1e5),this.destNode=this.audioCtx.createMediaStreamDestination(),this.setVolume(t.volume),this.setSpeaker(t.speaker).catch((function(e){})),this.inBackground(t.isHide)}return e.prototype.setPosition=function(e){this.Xn.info(df+" ".concat(this.userID," set position: ")+e),this.position=e,this.panner&&(void 0!==this.panner.positionX?(this.panner.positionX.value=e[1],this.panner.positionY.value=e[2],this.panner.positionZ.value=-e[0]):this.panner.setPosition(e[1],e[2],-e[0]))},e.prototype.getDistanceFromListener=function(e){return this.distance=function(e,t){if(!t||!e)return null;var i=[e[0]-t[0],e[1]-t[1],e[2]-t[2]];return Math.sqrt(Math.pow(i[0],2)+Math.pow(i[1],2)+Math.pow(i[2],2))}(this.position,e.position),this.distance},e.prototype.setMaxDistance=function(e){this.maxDistance=e,this.panner&&(e<10&&(e=10),this.panner.maxDistance=2.6*e)},e.prototype.setVolume=function(e){isNaN(e)||(this.volume=e,this.gainNode&&(this.gainNode.gain.value=this.volume))},e.prototype.setSpeaker=function(e){var t;return uf(this,void 0,void 0,(function(){var i,r,n;return lf(this,(function(o){switch(o.label){case 0:if(!ln(e))return[2];if(this.speaker=e,!(i=null===(t=this.audioEl)||void 0===t?void 0:t.dom))return[3,10];if(!(r=i.setSinkId))return[3,8];o.label=1;case 1:return o.trys.push([1,6,,7]),this.config.playOnAudioContext?[3,3]:[4,r.call(i,e||"")];case 2:return o.sent(),[3,5];case 3:return[4,r.call(i,"")];case 4:o.sent(),o.label=5;case 5:return this.Xn.info(df+" ".concat(this.userID," set speaker success. id: ").concat(e,".")),[3,7];case 6:throw n=o.sent(),this.Xn.error(df+" ".concat(this.userID," set speaker failed. id: ").concat(e," error: ").concat(n,".")),n;case 7:return[3,9];case 8:throw"setting speaker not support.";case 9:return[3,11];case 10:this.Xn.info(df+" ".concat(this.userID," no element for set speaker.")),o.label=11;case 11:return[2]}}))}))},e.prototype.initPanner=function(){if(!this.panner){var e=function(e,t,i){var r=i||[0,0,0],n=e.createPanner(),o=e.createGain();return n.panningModel="HRTF",n.distanceModel="linear",n.refDistance=1,n.maxDistance=2.6*t||1,n.rolloffFactor=1,n.coneOuterGain=.4,void 0!==n.positionX?(n.positionX.value=r[1],n.positionY.value=r[2],n.positionZ.value=-r[0]):n.setPosition(r[1],r[2],-r[0]),{panner:n,gainNode:o}}(this.audioCtx,this.maxDistance,this.position),t=e.gainNode;this.panner=e.panner,this.gainNode=t,t.gain.value=this.volume}},e.prototype.changeRenderConfig=function(e,t,i,r){var n,o,s,a,c;return void 0===t&&(t=!1),void 0===i&&(i=!1),void 0===r&&(r=!0),uf(this,void 0,void 0,(function(){var u,l,d,h,p,f,m,v,g,y,b,_,S=this;return lf(this,(function(T){switch(T.label){case 0:return t||this.isSpatial!==e?(this.isSpatial=e,u=Ae()&&Ue(),[4,qf()]):[2];case 1:return l=T.sent(),d="Windows"===l.platform&&l.majorPlatformVersion>=13,h=this.isHide&&(d||u),p="running"!==this.audioCtx.state,r&&(h||p)&&(this.Xn.warn("".concat(df," ").concat(this.userID," stop web audio. system: ").concat(l.platform," ").concat(l.majorPlatformVersion)),r=!1),this.config.useWebAudio=r,f=Re(),m=f.includes("safari")&&!f.includes("chrome"),v=f.includes("micromessenger")&&new RegExp(/(iphone|ipad|ipod|ios)/i).test(f),r||this.stream||(i=!0),this.config.playOnAudioContext=i,this.initPanner(),this.isPlaying&&this.sourceNode?(this.lastNode&&this.lastNode.disconnect(),g=this.sourceNode,this.sourceNode.disconnect(),null===(n=this.panner)||void 0===n||n.disconnect(),null===(o=this.gainNode)||void 0===o||o.disconnect(),this.gainNode?(r&&(this.config.useGain&&(g=this.sourceNode.connect(this.gainNode)),this.panner&&e&&(g=g.connect(this.panner))),g.connect(i?this.audioCtx.destination:this.destNode),this.lastNode=g,this.position&&this.setPosition(this.position),this.Xn.info(df+" '".concat(this.userID,"' play ").concat(e?"3d":"normal"," stream on ").concat(i?"audio ctx":"element")),(y=null===(s=this.audioEl)||void 0===s?void 0:s.dom)?(y.onpause=function(){S.Xn.warn(df+" ".concat(S.streamID," audio paused"))},y.onerror=function(e){S.Xn.warn(df+" ".concat(S.streamID," audio error, ").concat(e))},i?(this.stream&&y.srcObject!==this.stream&&(y.srcObject=this.stream,y.muted=!0,y.oncanplay=function(){y.play().then((function(){S.Xn.info(df+" ".concat(S.userID," ctx autoplay success.")),S.checkPlayStatus()})).catch((function(e){S.Xn.warn(df+" ".concat(S.userID," ctx autoplay failed."))}))}),[3,6]):[3,2]):[3,6]):[3,6]):[3,6];case 2:return b=this.destNode.stream,(_=this.config.needLoopback&&!v&&!m)&&this.loopbackConn&&(this.loopbackConn.close(),this.loopbackConn.onError=null),r||!this.stream?[3,3]:(this.Xn.info("".concat(df," ").concat(this.userID," stop audio api")),this.sourceNode.disconnect(),null===(a=this.panner)||void 0===a||a.disconnect(),null===(c=this.gainNode)||void 0===c||c.disconnect(),b=this.stream,[3,5]);case 3:return _&&b?(this.loopbackConn=this.loopbackConn||new cf(this.streamID||"",this.Xn),this.loopbackConn.onError=function(e){S.Xn.warn(df+" ".concat(S.userID," loopback failed! ").concat(e)),S.changeRenderConfig(S.isSpatial,!0,!0)},[4,this.loopbackConn.bindStream(b,this.streamID||void 0)]):[3,5];case 4:return b=T.sent(),[3,5];case 5:y.muted=!0,y.srcObject=b,this.setSpeaker(this.speaker).catch((function(e){})),y.oncanplay=function(){if(y){y.muted=!1;var e=function(e){S.Xn.error(df+" ".concat(S.userID," autoplay failed. error: ").concat(e)),S.changeRenderConfig(S.isSpatial,!0,!0)};y.play().then((function(){(null==y?void 0:y.paused)?e("audio paused"):(S.Xn.info(df+" ".concat(S.userID," element autoplay success.")),S.checkPlayStatus())})).catch((function(t){e(t)}))}},T.label=6;case 6:return[2]}}))}))},e.prototype.checkPlayStatus=function(){var e=this;setTimeout((function(){var t;if(e.isPlaying){var i=null===(t=e.audioEl)||void 0===t?void 0:t.dom,r=e.audioCtx.state;!i||i.paused||i.muted&&!e.config.playOnAudioContext||"running"!==r?(e.Xn.warn("".concat(df," ").concat(e.userID," play detection is abnormal. audio ctx:").concat(r,", paused:").concat(null==i?void 0:i.paused,", muted:").concat(null==i?void 0:i.muted)),"running"!==r&&(e.audioCtx.resume(),setTimeout((function(){e.Xn.warn("".concat(df," ").concat(e.userID," play resume. audio ctx:").concat(r,", paused:").concat(null==i?void 0:i.paused,", muted:").concat(null==i?void 0:i.muted))}),1e3))):e.Xn.info("".concat(df," ").concat(e.userID," play detection is fine"))}}),2e3)},e.prototype.inBackground=function(e,t){void 0===e&&(e=!1),void 0===t&&(t=!1),this.isHide!==e&&(this.isHide=e,e||this.config.useWebAudio||this.changeRenderConfig(this.isSpatial,!0))},e}(),pf=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ff="zc.ra.1",mf=function(e){function t(t,i,r){var n=e.call(this,t,r)||this;return n.Xn=t,n.audioTrack=null,n.zegoRTC=r.zegoRTC,n.userID=i.userID,n.teamID=i.teamID,n.raMode=void 0!==i.raMode?i.raMode:vc.World,i.position&&(n.position=i.position),n}return pf(t,e),Object.defineProperty(t.prototype,"sendMode",{get:function(){return void 0!==this._sendMode?this._sendMode:this.raMode===vc.World?gc.All:gc.Team},set:function(e){this._sendMode=e},enumerable:!1,configurable:!0}),t.prototype.checkTrackChanged=function(){var e;if(this.stream){var t=this.stream.getAudioTracks()[0];t&&t!==this.audioTrack&&(this.Xn.info(ff+" retry play success, render stream."),null===(e=this.sourceNode)||void 0===e||e.disconnect(),this.sourceNode=this.audioCtx.createMediaStreamSource(this.stream),this.changeRenderConfig(this.isSpatial,!0),this.audioTrack=t)}},t.prototype.startPlayingAudio=function(e){var t,i;return function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var r,n,o;return function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}(this,(function(s){switch(s.label){case 0:if(!this.streamID)return[2];s.label=1;case 1:return s.trys.push([1,3,,4]),e&&this.Xn.info(ff+" ".concat(this.streamID," ")+e),this.isPlaying=!0,r=this,[4,this.zegoRTC.startPlayingStream(this.streamID)];case 2:return r.stream=s.sent(),this.audioTrack=this.stream.getAudioTracks()[0],[3,4];case 3:if(n=s.sent(),this.isPlaying=!1,1103049===n.code)return[2];throw n;case 4:return this.audioEl=this.audioEl||sf.useAudioEl()||null,this.Xn.info(ff+" ".concat(this.streamID," start using audio el ").concat(null===(t=this.audioEl)||void 0===t?void 0:t.id)),(o=null===(i=this.audioEl)||void 0===i?void 0:i.dom)||(this.Xn.error(ff+" not enough audio elements"),o=Ie.createElement("audio"),this.audioEl={id:-1,dom:o,used:!0},o.setAttribute("autoplay","autoplay")),o.muted=!0,this.stream&&(this.sourceNode=this.audioCtx.createMediaStreamSource(this.stream)),this.sourceNode?[4,this.changeRenderConfig(this.isSpatial,!0)]:[3,6];case 5:s.sent(),s.label=6;case 6:return"suspended"===this.audioCtx.state&&this.audioCtx.resume(),[2]}}))}))},t.prototype.stopPlayingAudio=function(e){this.isPlaying&&this.streamID?(this.Xn.info(ff+" ".concat(this.streamID," ")+e),this.zegoRTC.stopPlayingStream(this.streamID),this.isPlaying=!1):this.streamID&&this.Xn.info(ff+" ".concat(this.streamID," not playing, ")+e),this.stream=void 0,this.sourceNode&&(this.sourceNode.disconnect(),this.sourceNode=null);var t=this.audioEl,i=null==t?void 0:t.dom;i&&(i.srcObject=null,i.parentNode&&i.parentNode.removeChild(i));var r=(null==t?void 0:t.id)||-1;t&&r>=0&&(sf.stopUsingAudioEl(r),this.Xn.info(ff+" ".concat(this.streamID," stop using audio el ").concat(r))),this.audioEl=null,this.loopbackConn&&(this.loopbackConn.close(),this.loopbackConn.onError=null)},t.prototype.isSpeakInTeam=function(e){var t=![this.teamID,e].includes(void 0)&&""!==this.teamID&&this.teamID===e,i=[gc.Team,gc.All].includes(this.sendMode);return t&&i},t}(hf),vf=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gf=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},yf=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},bf="zc.ra.4",_f=function(e){function t(t,i,r){var n=e.call(this,t,r)||this;return n.Xn=t,n.media=i.media,n.position=i.position||null,n.createSource(),n.userID="custom"+(new Date).getTime(),n.config={needLoopback:!1,useGain:!1,playOnAudioContext:!1,useWebAudio:!0},n}return vf(t,e),t.prototype.createSource=function(){var e=this;if(Ue())return this.Xn.info("".concat(Ue()," ").concat(this.userID," not create src.")),void(this.changeRenderConfig=function(){return gf(e,void 0,void 0,(function(){return yf(this,(function(e){return[2]}))}))});this.media&&(this.Xn.info(bf+" create el source."),this.sourceNode||(this.sourceNode=this.audioCtx.createMediaElementSource(this.media)),null!==this.distance&&this.distance<this.maxDistance&&this.startPlayingAudio("in range"))},t.prototype.startPlayingAudio=function(e){var t,i;return gf(this,void 0,void 0,(function(){var r;return yf(this,(function(n){switch(n.label){case 0:return this.isPlaying?(this.Xn.info(bf+" ".concat(this.userID," is already playing")),[2]):(e&&this.Xn.info(bf+" vocal ".concat(this.userID," play for ").concat(e)),this.isPlaying=!0,Ue()?(this.media.muted=!1,[2]):(this.audioEl=this.audioEl||sf.useAudioEl()||null,this.Xn.info(bf+" ".concat(this.userID," start using audio el ").concat(null===(t=this.audioEl)||void 0===t?void 0:t.id)),(r=null===(i=this.audioEl)||void 0===i?void 0:i.dom)||(this.Xn.error(bf+" ".concat(this.userID," not enough audio elements")),r=Ie.createElement("audio"),this.audioEl={id:-1,dom:r,used:!0},r.setAttribute("autoplay","autoplay")),r.muted=!0,r.setAttribute("autoplay","autoplay"),r.setAttribute("id","zg-audio-source-"+this.userID),this.sourceNode?[4,this.changeRenderConfig(this.isSpatial,!0)]:[3,2]));case 1:n.sent(),n.label=2;case 2:return"suspended"===this.audioCtx.state&&this.audioCtx.resume(),[2]}}))}))},t.prototype.stopPlayingAudio=function(e){if(void 0===e&&(e=""),this.isPlaying&&(this.Xn.info(bf+" vocal ".concat(this.userID," stop for ")+e),this.isPlaying=!1),Ue())this.media.muted=!0;else{this.sourceNode&&this.sourceNode.disconnect();var t=this.audioEl,i=null==t?void 0:t.dom;i&&(i.srcObject=null,i.parentNode&&i.parentNode.removeChild(i));var r=(null==t?void 0:t.id)||-1;t&&r>=0&&(sf.stopUsingAudioEl(r),this.Xn.info(bf+" ".concat(this.userID," stop using audio el ").concat(r))),this.audioEl=null}},t.prototype.checkIfCanPlay=function(e){var t=this.distance=this.getDistanceFromListener(e);null===t||t>this.maxDistance||0===this.maxDistance?this.stopPlayingAudio("out of range. ".concat(t," > ").concat(this.maxDistance)):this.startPlayingAudio("in range")},t}(hf),Sf=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tf=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Ef=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Cf="zc.ra.4",wf=function(e){function t(t,i,r){var n=e.call(this,t,r)||this;return n.Xn=t,n.streamView=i.streamView,n.position=i.position||null,n.createSource(),n.userID="stream"+(new Date).getTime(),n.config={needLoopback:!1,useGain:!1,playOnAudioContext:!1,useWebAudio:!0},n.streamView.on("_trackChange",(function(e,t){"audio"===e&&(t?n.createSource(!0):n.Xn.error("".concat(Cf," ").concat(n.userID," audio track lost")))})),n}return Sf(t,e),t.prototype.createSource=function(e){var t=this;if(void 0===e&&(e=!1),Ue())return this.Xn.info("".concat(Cf," ").concat(this.userID," not create src.")),this.changeRenderConfig=function(){return Tf(t,void 0,void 0,(function(){return Ef(this,(function(e){return[2]}))}))},!1;if(!this.streamView)return!1;if(this.Xn.info(Cf+" create view source. trackChanged: "+e),!this.sourceNode||e){var i=this.streamView.v.getAudioNodeAndStopRender();if(!i)return this.Xn.error(Cf+" create view source failed."),!1;this.sourceNode&&this.sourceNode.disconnect(),this.sourceNode=i,this.changeRenderConfig(this.isSpatial,!0)}return null!==this.distance&&this.distance<this.maxDistance&&this.startPlayingAudio("in range"),!0},t.prototype.startPlayingAudio=function(e){var t,i;return Tf(this,void 0,void 0,(function(){var r;return Ef(this,(function(n){switch(n.label){case 0:return this.isPlaying?(this.Xn.info(Cf+" ".concat(this.userID," is already playing")),[2]):(e&&this.Xn.info(Cf+" vocal ".concat(this.userID," play for ").concat(e)),this.isPlaying=!0,Ue()?(this.streamView.setAudioMuted(!1),[2]):(this.audioEl=this.audioEl||sf.useAudioEl()||null,this.Xn.info(Cf+" ".concat(this.userID," start using audio el ").concat(null===(t=this.audioEl)||void 0===t?void 0:t.id)),(r=null===(i=this.audioEl)||void 0===i?void 0:i.dom)||(this.Xn.error(Cf+" ".concat(this.userID," not enough audio elements")),r=Ie.createElement("audio"),this.audioEl={id:-1,dom:r,used:!0},r.setAttribute("autoplay","autoplay")),r.muted=!0,r.setAttribute("autoplay","autoplay"),r.setAttribute("id","zg-audio-source-"+this.userID),this.sourceNode?[4,this.changeRenderConfig(this.isSpatial,!0)]:[3,2]));case 1:n.sent(),n.label=2;case 2:return"suspended"===this.audioCtx.state&&this.audioCtx.resume(),[2]}}))}))},t.prototype.stopPlayingAudio=function(e){if(void 0===e&&(e=""),this.isPlaying&&(this.Xn.info(Cf+" vocal ".concat(this.userID," stop for ")+e),this.isPlaying=!1),Ue())this.streamView.setAudioMuted(!0);else{this.sourceNode&&this.sourceNode.disconnect();var t=this.audioEl,i=null==t?void 0:t.dom;i&&(i.srcObject=null,i.parentNode&&i.parentNode.removeChild(i));var r=(null==t?void 0:t.id)||-1;t&&r>=0&&(sf.stopUsingAudioEl(r),this.Xn.info(Cf+" ".concat(this.userID," stop using audio el ").concat(r))),this.audioEl=null}},t.prototype.checkIfCanPlay=function(e){var t=this.distance=this.getDistanceFromListener(e);null===t||t>this.maxDistance||0===this.maxDistance?this.stopPlayingAudio("out of range. ".concat(t," > ").concat(this.maxDistance)):this.startPlayingAudio("in range")},t}(hf),If=function(){function e(){this.Qr={}}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.prototype.addEventHandler=function(e,t){if(this.Qr[e]||(this.Qr[e]=[]),!fn(t))throw new Error("Params callBack is not a Function");return-1==this.Qr[e].indexOf(t)&&this.Qr[e].push(t),!0},e.prototype.removeEventHandler=function(e,t){return!!this.Qr[e]&&(this.Qr[e]=t?this.Qr[e].filter((function(e){return e!==t})):[],!0)},e.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this.Qr[e]&&this.Qr[e].forEach((function(i){try{setTimeout((function(){i.apply(void 0,t)}),0)}catch(t){console.error('Fail to execute callback of event "'.concat(e,'" : ').concat(t))}}))},e.prototype.reset=function(){this.Qr={}},e}(),Rf=If,kf=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Pf=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Af=function(){function e(e,t){var i=this;this.raMode=vc.World,this.recvRange=null,this.position=null,this.forwardAxis=[1,0,0],this.upAxis=[0,0,1],this.audioStream=null,this.enableMic=!1,this.isPublishing=!1,this.streamID=null,this.isDenoise=!1,this.denoiseMode=Ic.AI,this.voiceChanger=null,this.voiceParam=null,this.isUpdated=!0,this.zegoRTC=t,this.audioCtx=e,this.audioListener=this.audioCtx.listener,this.eventHandler=Rf.getInstance(),this.zegoRTC.on("publisherStateUpdate",(function(e){var t=e.state,r=e.errorCode,n=e.extendedData,o=e.streamID.match(/(.*)_(.*)/);if(3===(null==o?void 0:o.length)){if(i.userID!==o[1])return;"NO_PUBLISH"===t?(i.isPublishing=!1,i.stopPublishingStream()):(i.isPublishing=!0,i.isUpdated||(i.Xn.info(ff+" resend stream info"),i.updateSteamExtraInfo())),i.eventHandler.emit("microphoneStateUpdate",{NO_PUBLISH:mc.Off,PUBLISH_REQUESTING:mc.TurningOn,PUBLISHING:mc.On}[t],r,n)}})),this.zegoRTC.on("deviceError",(function(e,t){return kf(i,void 0,void 0,(function(){var i,r;return Pf(this,(function(n){switch(n.label){case 0:return this.Xn.info(ff+" device fail ".concat(e," ").concat(t," ").concat(!!this.audioStream," ").concat(this.micID)),this.audioStream?[4,this.zegoRTC.enumDevices()]:[2];case 1:return i=n.sent(),r=i.microphones,this.micID||0!==r.length?1106009!==e?[3,3]:[4,this.zegoRTC.useAudioDevice(this.audioStream,this.micID||r[0].deviceID)]:[2];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))}))}return Object.defineProperty(e.prototype,"recvMode",{get:function(){return void 0!==this._recvMode?this._recvMode:[vc.World,vc.SecretTeam].includes(this.raMode)?yc.All:yc.Team},set:function(e){this._recvMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sendMode",{get:function(){return void 0!==this._sendMode?this._sendMode:this.raMode===vc.World?gc.All:gc.Team},set:function(e){this._sendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Xn",{get:function(){return this.zegoRTC.logger},enumerable:!1,configurable:!0}),e.getInstance=function(t,i){return e.instance||(e.instance=new e(t,i)),e.instance},e.prototype.updateSelfPosition=function(e,t,i){this.position=e,this.forwardAxis=t,Array.isArray(i)&&(this.upAxis=i),this.updateListenerEffect()},e.prototype.updateListenerEffect=function(){this.position&&(this.audioListener.positionX?(this.audioListener.positionX.value=this.position[1],this.audioListener.positionY.value=this.position[2],this.audioListener.positionZ.value=-this.position[0]):this.audioListener.setPosition(this.position[1],this.position[2],-this.position[0]),this.audioListener.forwardX?(this.audioListener.forwardX.value=this.forwardAxis[1],this.audioListener.forwardY.value=this.forwardAxis[2],this.audioListener.forwardZ.value=-this.forwardAxis[0],this.audioListener.upX.value=this.upAxis[1],this.audioListener.upY.value=this.upAxis[2],this.audioListener.upZ.value=-this.upAxis[0]):this.audioListener.setOrientation(this.forwardAxis[1],this.forwardAxis[2],-this.forwardAxis[0],this.upAxis[1],this.upAxis[2],-this.upAxis[0]))},e.prototype.startPublishingStream=function(){var e=this;this.enableMic?this.Xn.warn(ff+" mic is already enabled"):(this.enableMic=!0,this.zegoRTC.createStream({camera:{video:!1,audio:!0,audioInput:this.micID||void 0,audioBitrate:30}}).then((function(t){return kf(e,void 0,void 0,(function(){return Pf(this,(function(e){if(!this.userID)throw this.zegoRTC.destroyStream(t),this.enableMic=!1,Error("Enable mic failed. Please log in room first.");return this.audioStream&&this.audioStream!==t&&this.zegoRTC.destroyStream(this.audioStream),this.audioStream=t,this.isDenoise&&(this.enableDenoise(this.isDenoise),this.denoiseMode===Ic.AIBalanced&&this.setAiDenoiseMode(this.denoiseMode)),null!==this.voiceChanger&&this.setVoiceChangerPreset({voiceChanger:this.voiceChanger}),null!==this.voiceParam&&this.setVoiceChangerPreset({voiceParam:this.voiceParam}),this.streamID=this.userID+"_"+Date.now(),this.zegoRTC.startPublishingStream(this.streamID,t,{extraInfo:JSON.stringify(this.getExtraInfo())}),[2]}))}))})).catch((function(t){throw e.audioStream=null,e.enableMic=!1,t})))},e.prototype.stopPublishingStream=function(){this.isPublishing&&this.streamID&&this.zegoRTC.stopPublishingStream(this.streamID),this.isPublishing=!1,this.audioStream&&(this.zegoRTC.destroyStream(this.audioStream),this.audioStream=null),this.enableMic=!1},e.prototype.setCustomMode=function(e,t){var i=!1,r=!1,n=!1;return t!==this.recvMode&&(this.recvMode=t,n=!0),e!==this.sendMode&&(this.sendMode=e,i=!0,r=!0),i&&this.updateSteamExtraInfo(),{sendChange:r,recvChange:n}},e.prototype.setNormalMode=function(e){this.raMode=e,this.updateSteamExtraInfo()},e.prototype.setTeamID=function(e){this.teamID=e,this.updateSteamExtraInfo()},e.prototype.updateSteamExtraInfo=function(){var e=this;this.streamID&&this.isPublishing&&(this.isUpdated=!1,this.Xn.info(ff+" update stream info"),this.zegoRTC.setStreamExtraInfo(this.streamID,JSON.stringify(this.getExtraInfo())).then((function(t){0===t.errorCode&&(e.Xn.info(ff+" update stream info success"),e.isUpdated=!0)})))},e.prototype.getExtraInfo=function(){var e,t={range_audio_team_id:this.teamID||"",range_audio_mode:(e=this.raMode,{0:1,1:2,2:3}[e]),r_a_s_flag:1};return void 0===this._sendMode&&this.raMode!==vc.World||(t.r_a_speak=this.sendMode),t},e.prototype.reset=function(){this.audioStream&&this.stopPublishingStream(),this.userID=void 0,this.streamID=null},e.prototype.enableDenoise=function(e){var t=this;return this.audioStream&&this.zegoRTC._enableAiDenoise(this.audioStream,e).catch((function(e){t.isDenoise=!1;var i=e||{};t.eventHandler.emit("aiDenoiseError",i.errorCode,i.extendedData)})),this.isDenoise=e,!0},e.prototype.setAiDenoiseMode=function(e){var t=this;return this.audioStream&&this.zegoRTC.setAiDenoiseMode(this.audioStream,e).catch((function(e){t.denoiseMode=Ic.AI;var i=e||{};t.eventHandler.emit("aiDenoiseError",i.errorCode,i.extendedData)})),this.denoiseMode=e,!0},e.prototype.setVoiceChangerPreset=function(e){var t=this;return this.audioStream&&this.zegoRTC.setVoiceChangerPreset(this.audioStream,e).catch((function(e){t.voiceChanger=null;var i=e||{};t.eventHandler.emit("voiceChangerError",i.errorCode,i.extendedData)})),"voiceChanger"in e&&void 0!==e.voiceChanger?(this.voiceChanger=e.voiceChanger,this.voiceParam=null):"voiceParam"in e&&void 0!==e.voiceParam&&(this.voiceParam=e.voiceParam,this.voiceChanger=null),!0},e}(),Df="zc.ra.2",Nf=function(){function e(e,t){this.Xn=e,this.isEnable=!1,this.interval=100,this.timer=null,this.audioSourceList=[],this.hasChanged=!1,this.userChanged=!1,this.updateUserInterval=1e3,this.updateUserTimer=null,this.audioSourceUpdate=!1,this._maxPlayingQuantity=20,this.allAudioSourceList=[],this.audioSourceWithinRangeList=[],this.localUserList=[],this.Vr=t}return e.getInstance=function(t,i){return e.instance||(e.instance=new e(t,i)),e.instance},e.prototype.setAudioSourceUpdate=function(e){this.audioSourceUpdate=e},e.prototype.setListener=function(e){this.Vr=e,this.hasChanged=!0,this.userChanged=!0},e.prototype.setAudioSourceList=function(e){this.audioSourceList=e,this.Xn.info("".concat(Df," set src list: [").concat(e.map((function(e){return e.userID})).join(","),"]")),this.hasChanged=!0},e.prototype.setAllAudioSourceList=function(e){e&&(this.allAudioSourceList=e),this.userChanged=!0},e.prototype.startPlayingAudioStream=function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.hasChanged=!0,this.playAudioTask()},e.prototype.playAudioTask=function(){var e=this;this.hasChanged&&(this.hasChanged=!1,this.handlePlayAudioTask()),this.timer=window.setTimeout((function(){e.playAudioTask()}),this.interval)},e.prototype.handlePlayAudioTask=function(){var e=this;if(this.isEnable){this.Xn.info("".concat(Df," handler task start"));var t=function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}([],this.audioSourceList,!0),i=0,r=this.Vr.recvMode;if([yc.Team,yc.All].includes(r)){var n=this.getTeamAudioSourceGroup();t=n.otherList,n.teamList.forEach((function(t){i<e._maxPlayingQuantity&&(t.isPlaying||t.startPlayingAudio("play for team"),i++)}))}var o=[yc.World,yc.All].includes(r);o&&(t.forEach((function(t){t.distance=t.getDistanceFromListener(e.Vr)})),t.sort((function(e,t){return null===e.distance?1:null===t.distance||e.distance<t.distance?-1:e.distance>t.distance?1:0}))),t.forEach((function(t){var r=[gc.All,gc.World].includes(t.sendMode)&&null!==t.distance&&(null===e.Vr.recvRange||t.distance<=e.Vr.recvRange);if(o&&i<e._maxPlayingQuantity&&r)t.isPlaying||t.startPlayingAudio("play for range"),i++;else{var n="stop for mode or range. mode: ".concat(t.sendMode,", range: ").concat(t.distance," > ").concat(e.Vr.recvRange);t.stopPlayingAudio(n)}})),this.Xn.info(Df+" playing quantity: ".concat(i,"."))}else this.stopPlayingAudioStream()},e.prototype.startCheckUserInRange=function(){this.Xn.info(Df+" start user check"),this.updateUserTimer&&(clearTimeout(this.updateUserTimer),this.updateUserTimer=null),this.userChanged=!0,this.userCheckTask()},e.prototype.stopCheckUserInRange=function(){this.Xn.info(Df+" stop user check"),this.updateUserTimer&&(clearTimeout(this.updateUserTimer),this.updateUserTimer=null)},e.prototype.userCheckTask=function(){var e=this;this.userChanged&&(this.userChanged=!1,this.handleUserCheckTask()),this.updateUserTimer=window.setTimeout((function(){e.userCheckTask()}),this.updateUserInterval)},e.prototype.handleUserCheckTask=function(){var e=this;if(this.audioSourceUpdate){var t=[];this.allAudioSourceList.forEach((function(i){i.distance=i.getDistanceFromListener(e.Vr);var r=null!==i.distance&&(null===e.Vr.recvRange||i.distance<=e.Vr.recvRange),n=!!e.localUserList.find((function(e){return e.userID===i.userID}));r&&n&&t.push({userID:i.userID,position:i.position})})),this.checkAudioSourceListDiff(t,this.audioSourceWithinRangeList)&&this.Vr.eventHandler.emit("audioSourceWithinRangeUpdate",t),this.audioSourceWithinRangeList=t}},e.prototype.getTeamAudioSourceGroup=function(){var e=this,t=[],i=[];return this.audioSourceList.forEach((function(r){r.isSpeakInTeam(e.Vr.teamID)?t.push(r):i.push(r)})),{teamList:t,otherList:i}},e.prototype.stopPlayingAudioStream=function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.audioSourceList.forEach((function(e){e.stopPlayingAudio("stop for all stream")}))},e.prototype.setLocalUserList=function(e){this.localUserList=e,this.userChanged=!0},e.prototype.checkAudioSourceListDiff=function(e,t){for(var i,r=0;r<e.length;r++){i=!1;for(var n=0;n<t.length;n++)if(e[r].userID===t[n].userID){i=!0;break}if(!i)return!0}for(var o=0;o<t.length;o++){i=!1;for(var s=0;s<e.length;s++)if(t[o].userID===e[s].userID){i=!0;break}if(!i)return!0}return!1},e}(),Of=Nf;function Mf(e){return!isNaN(Number(e))&&""!==e&&Number.MAX_SAFE_INTEGER>=Number(e)&&Number(e)>=-Number.MAX_SAFE_INTEGER}function Lf(e){if(Array.isArray(e)){for(var t=0;t<3;t++)if(!Mf(e[t]))return!1;return!0}return!1}!function(e){e[e.Normal=0]="Normal",e[e.Custom=1]="Custom"}(ef||(ef={}));var xf=function(){return xf=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},xf.apply(this,arguments)},Uf=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Bf=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},zf=function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))};function qf(){var e;return Uf(this,void 0,void 0,(function(){var t,i,r;return Bf(this,(function(n){switch(n.label){case 0:return(t=null===navigator||void 0===navigator?void 0:navigator.userAgentData)?[4,t.getHighEntropyValues(["platformVersion"]).catch((function(){}))]:[2,{platform:"",majorPlatformVersion:0}];case 1:return i=n.sent()||{},r=parseInt(null===(e=i.platformVersion)||void 0===e?void 0:e.split(".")[0]),[2,{platform:i.platform,majorPlatformVersion:r}]}}))}))}var Xf="zc.ra.0",Hf=function(){function e(e,t){var i=this;this.Xn=t,this.isSpatial=!1,this.audioSourceList=[],this.audioSourceUpdate=!1,this.localUserList=[],this.speakingUserIdList=[],this.vocalSourceMap=new Map,this.volume=1,this.speaker="",this.Kr=null,this.supportSpeakerSet=!1,this.isHide=!1,this.eventHandler={visibilitychange:function(){return Uf(i,void 0,void 0,(function(){var e,t,i,r,n,o=this;return Bf(this,(function(s){switch(s.label){case 0:return zf(zf([],this.vocalSourceList,!0),this.audioSourceList,!0).forEach((function(e){e.inBackground(Ie.hidden),o.isHide=Ie.hidden})),e=function(){zf(zf([],o.vocalSourceList,!0),o.audioSourceList,!0).forEach((function(e){e.changeRenderConfig(o.isOpen3D(e),!0,!1,!1)}))},Ie.hidden?(t=Ae()&&Ue(),[4,qf()]):[3,2];case 1:return i=s.sent(),r="Windows"===i.platform&&i.majorPlatformVersion>=13,t||r?(this.Xn.warn("".concat(Xf," mobile chrome hide page and stop web audio.")),e(),[2]):("running"!==(n=this.audioCtx.state)?(this.Xn.info("".concat(Xf," hidden ctx: ").concat(n,", resume ctx")),this.audioCtx.resume(),setTimeout((function(){var t=o.audioCtx.state;o.isHide&&("running"===t?o.Xn.info("".concat(Xf," hidden ctx: ").concat(t,".")):(o.Xn.warn("".concat(Xf," hidden ctx: ").concat(t,", ctx resume failed. stop web audio.")),e()))}),2e3)):this.Xn.info("".concat(Xf," hidden ctx: ").concat(n,".")),[3,3]);case 2:this.audioCtx.resume(),this.audioSourceList.forEach((function(e){var t,i;e.isPlaying&&(null===(t=e.audioEl)||void 0===t||t.dom.pause(),null===(i=e.audioEl)||void 0===i||i.dom.play().catch((function(){o.Xn.warn("".concat(Xf," show page and ").concat(e.userID," replay failed."))})))})),s.label=3;case 3:return[2]}}))}))}},this.zegoRTC=e,Ie.addEventListener("visibilitychange",this.eventHandler.visibilitychange,!1),this.zegoRTC.on("roomStreamUpdate",(function(e,t,r){var n=r.map((function(e){var t=i.getStreamInfo(e.extraInfo,e.streamID),r=t.isRangeAudioStream,n=t.teamID,o=t.raMode,s=t.sendMode;return xf(xf({},e),{isRangeAudioStream:r,teamID:n,raMode:o,sendMode:s})})).filter((function(e){return e.isRangeAudioStream})),o=n.map((function(e){return e.user.userID}));"DELETE"===t?i.speakingUserIdList=i.speakingUserIdList.filter((function(e){var t=!o.includes(e);if(!t){var r=i.audioSourceMap[e];r&&r.stopPlayingAudio("stop for stream delete")}return t})):"ADD"===t&&(i.speakingUserIdList=i.speakingUserIdList.concat(o),n.forEach((function(e){var t=e.user.userID,r=i.audioSourceMap[t],n=e.teamID,o=e.raMode,s=e.sendMode;if(r)r.streamID!==e.streamID&&(r.stopPlayingAudio("stop for old stream"),r.streamID=e.streamID),void 0!==o&&(r.raMode=o),n!==r.teamID&&(r.teamID=n),r.changeRenderConfig(i.isOpen3D(r));else{var a=new mf(i.Xn,{userID:t,teamID:n,raMode:o,sendMode:s},{audioCtx:i.audioCtx,zegoRTC:i.zegoRTC,isSpatial:i.isSpatial,maxDistance:i.Vr.recvRange,volume:i.volume,speaker:i.speaker,isHide:i.isHide});a.streamID=e.streamID,i.audioSourceList.push(a),i.playStreamHandler.hasChanged=!0}}))),i.playStreamHandler.setAudioSourceList(i.speakingAudioSourceList)})),this.zegoRTC.on("playerStateUpdate",(function(e){var t=i.audioSourceList.find((function(t){return t.streamID===e.streamID}));t&&("NO_PLAY"===e.state?t.isPlaying=!1:("PLAYING"===e.state&&t.checkTrackChanged(),t.isPlaying=!0))})),this.zegoRTC.on("streamExtraInfoUpdate",(function(e,t){i.Xn.info(Xf+" recv extra info: "+JSON.stringify(t));var r=!1;t.forEach((function(e){var t=i.audioSourceMap[e.user.userID];if(t&&t.streamID){var n=i.getStreamInfo(e.extraInfo,e.streamID),o=n.teamID,s=n.raMode,a=n.sendMode;o!==t.teamID&&(t.teamID=o,r=!0),void 0!==s&&(t.raMode=s,r=!0),t.sendMode!==a&&(t.sendMode=a,r=!0),i.playStreamHandler.hasChanged=!0}})),r&&i.enableSpatializer(i.isSpatial)})),this.zegoRTC.RTM._on("_roomStateUpdate",(function(e,t){"CONNECTED"===t?(i.roomID=e,i.Vr.userID=i.zegoRTC.RTM.getUserID(),i.playStreamHandler.hasChanged=!0,i.playStreamHandler.userChanged=!0):"DISCONNECTED"===t&&(i.roomID=void 0,i.Vr.reset(),i.enableSpeaker(!1),i.audioSourceList=[],i.playStreamHandler.setAudioSourceList([]),i.localUserList=[],i.playStreamHandler.setLocalUserList([]))})),this.zegoRTC.RTM.on("roomUserUpdate",(function(e,t,r){var n;i.Xn.info(Xf+" roomUserUpdate: ",e,t,JSON.stringify(r)),"ADD"===t?(n=i.localUserList).push.apply(n,r):"DELETE"===t&&r.forEach((function(e){i.localUserList=i.localUserList.filter((function(t){return t.userID!==e.userID}))})),i.playStreamHandler.setLocalUserList(i.localUserList)})),this.zegoRTC.on("publishQualityUpdate",(function(e,t){var r=e.match(/(.*)_(.*)/);if(3===(null==r?void 0:r.length)){var n=r[1];if(i.Vr.userID!==n)return;var o=xf({},t.audio);i.eventManager.emit("publishQualityUpdate",n,o)}})),this.zegoRTC.on("playQualityUpdate",(function(e,t){var r,n=e.match(/(.*)_(.*)/);if(3===(null==n?void 0:n.length)){var o=n[1],s=t.audio,a=t.peerToPeerDelay,c=t.peerToPeerPacketLostRate;if(!(null===(r=i.audioSourceList)||void 0===r?void 0:r.some((function(e){return e.userID===o}))))return;var u=xf(xf({},s),{peerToPeerDelay:a,peerToPeerPacketLostRate:c});i.eventManager.emit("playQualityUpdate",o,u)}})),this.Kr=this.Wr(),this.Vr=Af.getInstance(this.audioCtx,this.zegoRTC),this.playStreamHandler=Of.getInstance(this.Xn,this.Vr),this.eventManager=Rf.getInstance()}return Object.defineProperty(e.prototype,"audioSourceMap",{get:function(){return this.audioSourceList.reduce((function(e,t){return t.userID&&(e[t.userID]=t),e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"speakingAudioSourceList",{get:function(){var e=this;return this.audioSourceList.filter((function(t){return e.speakingUserIdList.includes(t.userID)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vocalSourceList",{get:function(){for(var e=[],t=this.vocalSourceMap.values(),i=0;i<this.vocalSourceMap.size;i++)e.push(t.next().value);return e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playingAudioSourceList",{get:function(){return this.audioSourceList.filter((function(e){return e.isPlaying}))},enumerable:!1,configurable:!0}),e.prototype.Wr=function(){var e=this,t=new(window.AudioContext||window.webkitAudioContext);return t.addEventListener("statechange",(function(){"suspended"===t.state&&(e.Xn.info(Xf+" audio context suspended"),t.resume())})),t},Object.defineProperty(e.prototype,"audioCtx",{get:function(){return this.Kr||(this.Kr=this.Wr()),this.Kr},enumerable:!1,configurable:!0}),e.getInstance=function(t,i){return e.instance||(e.instance=new e(t,i)),e.instance},e.prototype.resumeAudioContext=function(){return Uf(this,void 0,void 0,(function(){var e=this;return Bf(this,(function(t){return[2,new we((function(t){sf.generateEls(),"running"===e.audioCtx.state&&t(!0),e.audioCtx.onstatechange=function(){"running"===e.audioCtx.state&&t(!0)},e.audioCtx.resume(),e.Xn.info(Xf+" resume audio ctx"),setTimeout((function(){t(!1)}),3e3)}))]}))}))},e.prototype.getAudioContextState=function(){return this.audioCtx.state},e.prototype.getStreamInfo=function(e,t){var i,r=null;try{r=JSON.parse(e)}catch(e){return this.Xn.warn(Xf+" parse room extra info failed. ".concat(t," is not ra stream.")),{isRangeAudioStream:!1}}if(!r.hasOwnProperty("range_audio_team_id")||!r.hasOwnProperty("range_audio_mode"))return this.Xn.warn(Xf+" extra info has no mode. ".concat(t," is not ra stream.")),{isRangeAudioStream:!1};i={1:0,2:1,3:2}[r.range_audio_mode];var n=r.r_a_s_flag,o={teamID:r.range_audio_team_id||void 0,raMode:i,isRangeAudioStream:void 0===n||1===n};return r.hasOwnProperty("r_a_speak")&&(o.sendMode=r.r_a_speak),this.Xn.info("".concat(Xf," ").concat(t," parse extra info: ").concat(JSON.stringify(o),".")),o},e.prototype.setAudioReceiveRange=function(e){if(!Mf(e))throw Error("Failed to execute 'setAudioReceiveRange': Argument 'range' requires to be type number.");if(e=Number(e),(e=Number(e))<0)throw Error("Failed to execute 'setAudioReceiveRange': Argument 'range' can not be less than 0.");this.Xn.info(Xf+" set receive range: "+e),this.Vr.recvRange=e,this.audioSourceList.forEach((function(t){t.setMaxDistance(e)})),this.playStreamHandler.hasChanged=!0,this.playStreamHandler.userChanged=!0},e.prototype.updateSelfPosition=function(e,t,i,r){var n=this,o=function(e){return"Failed to execute 'updateSelfPosition': Argument '".concat(e,"' requires an array of type number.\"")};if(!Lf(e))throw new Error(o("position"));if(!Lf(t))throw new Error(o("axisForward"));if(!Lf(i))throw new Error(o("axisRight"));if(!Lf(r))throw new Error(o("axisUp"));this.Xn.info(Xf+" set self position [".concat(e,"]")),this.Vr&&(this.Vr.updateSelfPosition(e,t,r),this.vocalSourceMap.forEach((function(e){e.checkIfCanPlay(n.Vr)}))),this.playStreamHandler.setListener(this.Vr)},e.prototype.updateAudioSource=function(e,t){if(e=String(e),!Lf(t))throw new Error("Failed to execute 'updateAudioSource': parameter 'position' must be an array of type number.");var i=this.audioSourceMap[e];i?i.setPosition(t):(i=new mf(this.Xn,{userID:e,position:t},{audioCtx:this.audioCtx,zegoRTC:this.zegoRTC,isSpatial:this.isSpatial,maxDistance:this.Vr.recvRange,volume:this.volume,speaker:this.speaker,isHide:this.isHide}),this.enableSpatializer(this.isSpatial),this.audioSourceList.push(i)),this.playStreamHandler.setAudioSourceList(this.speakingAudioSourceList),this.playStreamHandler.setAllAudioSourceList(this.audioSourceList)},e.prototype.enableMicrophone=function(e){if(void 0===e&&(e=!0),!this.Vr.userID)throw new Error("Enable mic failed. Please log in room first.");return e?this.Vr.startPublishingStream():this.Vr.stopPublishingStream()},e.prototype.selectMic=function(e){return Uf(this,void 0,void 0,(function(){var t,i,r,n;return Bf(this,(function(o){switch(o.label){case 0:if(!ln(e)&&!hn(e))throw new Error("Select mic failed. DeviceID error.");if(i=(t=this.Vr).audioStream,r=t.isPublishing,this.Xn.info(Xf+" select mic: "+e),!i||!r)return[3,5];n={errorCode:0},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.zegoRTC.useAudioDevice(i,e||"")];case 2:return n=o.sent(),[3,4];case 3:return o.sent(),[2,!1];case 4:return 0===n.errorCode?(this.Vr.micID=e,[2,!0]):[2,!1];case 5:return this.Vr.micID=e,[2,!0];case 6:return[2]}}))}))},e.prototype.enableSpeaker=function(e){if(void 0===e&&(e=!0),e&&!this.roomID)throw new Error("Enable speaker failed. Please log in room first.");this.playStreamHandler.isEnable=e,this.Xn.info(Xf+" enable speaker: "+e),e?(sf.generateEls(),this.playStreamHandler.startPlayingAudioStream()):this.playStreamHandler.stopPlayingAudioStream()},e.prototype.enableSpatializer=function(e){var t=this;void 0===e&&(e=!0),this.Xn.info(Xf+" set spatializer: "+e),this.isSpatial=!!e,this.audioSourceList.forEach((function(e){e.changeRenderConfig(t.isOpen3D(e))})),this.vocalSourceList.forEach((function(t){t.changeRenderConfig(e)})),e&&this.Vr.updateListenerEffect()},e.prototype.enableAiDenoise=function(e){if(this.Xn.info(Xf+" set ai denoise: "+e),!dn(e))return!1;var t=Ue();return(t||window.AudioWorklet)&&window.WebAssembly&&(window.AudioContext||(null===window||void 0===window?void 0:window.webkitAudioContext)).prototype.createScriptProcessor?this.Vr.enableDenoise(!!e):(this.Xn.error(Xf+"".concat(t&&" mobile"," browser dose not support ai denoise.")),!1)},e.prototype.setAiDenoiseMode=function(e){return void 0===e&&(e=Ic.AI),this.Vr.setAiDenoiseMode(e)},e.prototype.setVoiceChangerPreset=function(e){this.Xn.info(Xf+" set voice changer preset: "+JSON.stringify(e));var t=Ue();return(t||window.AudioWorklet)&&window.WebAssembly&&(window.AudioContext||(null===window||void 0===window?void 0:window.webkitAudioContext)).prototype.createScriptProcessor?this.Vr.setVoiceChangerPreset(e):(this.Xn.error(Xf+"".concat(t&&" mobile"," browser dose not support voice changer.")),!1)},e.prototype.setRangeAudioTeamID=function(e){this.Xn.info(Xf+" set team id: "+e),this.Vr.setTeamID(e),this.enableSpatializer(this.isSpatial),this.playStreamHandler.hasChanged=!0},e.prototype.setRangeAudioMode=function(e){if(this.modeType===ef.Custom)throw new Error("Failed to execute 'setRangeAudioMode': already use 'setRangeAudioCustomMode'.");this.modeType=ef.Normal,this.Xn.info(Xf+" set mode "+e),this.Vr.setNormalMode(e),this.playStreamHandler.hasChanged=!0},e.prototype.setCustomMode=function(e,t){if(this.modeType===ef.Normal)throw new Error("Failed to execute 'setRangeAudioCustomMode': already use 'setRangeAudioMode'.");this.modeType=ef.Custom,this.Xn.info(Xf+" set custom mode: ".concat(e,", ").concat(t));var i=this.Vr.setCustomMode(e,t).recvChange;this.playStreamHandler.hasChanged=!0,i&&this.enableSpatializer(this.isSpatial)},e.prototype.setAudioVolume=function(e){var t=this;if(this.Xn.info(Xf+" set volume ".concat(e)),e<0)throw new Error("Failed to execute 'setVolume': The volume provided is outside the range [0, 200].");this.volume=e/100,this.audioSourceList.forEach((function(e){e.setVolume(t.volume)}))},e.prototype.selectSpeaker=function(e){var t=this;if(void 0===e&&(e=""),!ln(e))throw new Error("Select speaker failed. Device ID error.");if(!this.supportSpeakerSet){if(!Ie.createElement("audio").setSinkId)throw new Error("Failed to execute 'selectSpeaker': browser not support.");this.supportSpeakerSet=!0}this.speaker=e,this.Xn.info(Xf+" set speaker: "+e),""===e&&this.Xn.warn(Xf+" set speaker to be default. "),this.audioSourceList.find((function(i){return Uf(t,void 0,void 0,(function(){var t;return Bf(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,i.setSpeaker(e)];case 1:return r.sent(),[3,3];case 2:return t=r.sent(),this.Xn.warn(Xf+" set speaker failed. id: ".concat(e,", error: ").concat(t)),[2,!0];case 3:return[2,!1]}}))}))}))},e.prototype.setPositionUpdateFrequency=function(e){if(!(e>=15))throw new Error("Failed to execute 'setPositionUpdateFrequency': The frequency provided is outside the range [15, +].");this.playStreamHandler.interval=Number(e)||100,this.Xn.info(Xf+" set interval: "+e)},e.prototype.on=function(e,t){return this.eventManager.addEventHandler(e,t)},e.prototype.off=function(e,t){return this.eventManager.removeEventHandler(e,t)},e.prototype.enableAudioSourceUpdateChecker=function(e,t){if(this.Xn.info(Xf+" set source update: "+e),this.audioSourceUpdate=e,this.playStreamHandler.setAudioSourceUpdate(e),t&&un(t.frequency)){if(t.frequency<50)throw new Error("Failed to execute 'enableAudioSourceUpdateChecker': The frequency provided is outside the range [50, +].");this.playStreamHandler.updateUserInterval=Number(t.frequency)||1e3,this.Xn.info(Xf+" set interval: "+t.frequency)}e?this.playStreamHandler.startCheckUserInRange():this.playStreamHandler.stopCheckUserInRange()},e.prototype.getVocalSource=function(e,t){var i=this.vocalSourceMap.get(e);if(!i){var r={audioCtx:this.audioCtx,isSpatial:this.isSpatial,maxDistance:t||0,volume:this.volume,speaker:this.speaker,isHide:this.isHide};i=bn(e)?new _f(this.Xn,{media:e},r):new wf(this.Xn,{streamView:e},r)}return this.vocalSourceMap.set(e,i),i},e.prototype.setStreamVocalRange=function(e,t){var i=bn(e);if(!i&&!(null==e?void 0:e.v))throw new Error("Failed to execute 'setVocalRange': type of parameter 1 error.");if(!Mf(t))throw Error("Failed to execute 'setVocalRange': parameter 2 requires to be type number.");t=Number(t),this.Xn.info(Xf+" ".concat(i?"custom":"stream"," set range: ")+t);var r=this.getVocalSource(e,t);r.setMaxDistance(t),r.checkIfCanPlay(this.Vr)},e.prototype.updateStreamPosition=function(e,t){if(!bn(e)&&!(null==e?void 0:e.v))throw new Error("Failed to execute 'updatePosition': type of parameter 1 error.");if(!Lf(t))throw new Error("Failed to execute 'updatePosition': parameter 'position' must be an array of type number.");var i=this.getVocalSource(e);i.setPosition(t),i.checkIfCanPlay(this.Vr)},e.prototype.isOpen3D=function(e){return e instanceof mf?(!(this.Vr.recvMode!==yc.World)||!e.isSpeakInTeam(this.Vr.teamID))&&this.isSpatial:this.isSpatial},e}(),Ff=Hf,Vf=function(){function e(e,t){this.Zr=Ff.getInstance(e,t)}return e.getInstance=function(t,i){if(!e.instance){if(!t)throw Error("create instance failed.");e.instance=new e(t,i)}return e.instance},e.prototype.enableAiDenoise=function(e){return this.Zr.enableAiDenoise(e)},e.prototype.setAiDenoiseMode=function(e){return this.Zr.setAiDenoiseMode(e)},e.prototype.enableAudioSourceUpdateChecker=function(e,t){this.Zr.enableAudioSourceUpdateChecker(e,t)},e.prototype.on=function(e,t){return this.Zr.on(e,t)},e.prototype.off=function(e,t){return this.Zr.off(e,t)},e.prototype.setAudioReceiveRange=function(e){this.Zr.setAudioReceiveRange(e)},e.prototype.updateSelfPosition=function(e,t,i,r){this.Zr.updateSelfPosition(e,t,i,r)},e.prototype.updateAudioSource=function(e,t){this.Zr.updateAudioSource(e,t)},e.prototype.enableSpatializer=function(e){return this.Zr.enableSpatializer(e)},e.prototype.enableMicrophone=function(e){return this.Zr.enableMicrophone(e)},e.prototype.selectMicrophone=function(e){return function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){return function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}(this,(function(t){switch(t.label){case 0:return[4,this.Zr.selectMic(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.selectSpeaker=function(e){return this.Zr.selectSpeaker(e)},e.prototype.enableSpeaker=function(e){return this.Zr.enableSpeaker(e)},e.prototype.setRangeAudioCustomMode=function(e,t){this.Zr.setCustomMode(e,t)},e.prototype.setRangeAudioMode=function(e){this.Zr.setRangeAudioMode(e)},e.prototype.setTeamID=function(e){this.Zr.setRangeAudioTeamID(e)},e.prototype.setPositionUpdateFrequency=function(e){return this.Zr.setPositionUpdateFrequency(e)},e.prototype.setRangeAudioVolume=function(e){return this.Zr.setAudioVolume(e)},e.prototype.setVoiceChangerPreset=function(e){return this.Zr.setVoiceChangerPreset({voiceChanger:e})},e.prototype.setVoiceChangerParam=function(e){return this.Zr.setVoiceChangerPreset({voiceParam:e})},e.prototype.isAudioContextRunning=function(){return"running"===this.Zr.getAudioContextState()},e.prototype.resumeAudioContext=function(){return this.Zr.resumeAudioContext()},e.prototype.setStreamVocalRange=function(e,t){this.Zr.setStreamVocalRange(e,t)},e.prototype.updateStreamPosition=function(e,t){this.Zr.updateStreamPosition(e,t)},e.prototype.setCustomSourceVocalRange=function(e,t){this.Zr.setStreamVocalRange(e,t)},e.prototype.updateCustomSourcePosition=function(e,t){this.Zr.updateStreamPosition(e,t)},e}(),Gf={type:"RangeAudio",install:function(e){Object.defineProperty(e.prototype,"createRangeAudioInstance",{value:function(){return this.rangeAudio||(this.rangeAudio=Vf.getInstance(this,this.logger)),this.rangeAudio},writable:!1})}},jf=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Qf=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Wf=function(){function e(e,t){this.zegoWebRTC=e,this.roomID=t,this.pubDataChannelList=[],this.subDataChannelList=[],this.listenerList={receiveRealTimeSequentialData:[]},this.Xn=e.logger}return e.prototype.startBroadcasting=function(e,t){return jf(this,void 0,void 0,(function(){var t,i,r,n,o;return Qf(this,(function(s){switch(s.label){case 0:return Me(this.Xn,t="dc.sb.0"),this.pubDataChannelList.includes(e)?(this.Xn.error(t+" datachannel already exist"),[2,!1]):(i=this.zegoWebRTC.streamCenter.publisherList[e])&&i.publisher.dataChannel?(this.pubDataChannelList.push(e),[2,!0]):i&&!i.publisher.dataChannel?(this.Xn.error(t+" publish datachannel no exist, try other stream ID"),[2,!1]):this.broadcastStream?[3,2]:(r=Ie.createElement("canvas"),n=this,[4,this.zegoWebRTC.createStream({custom:{source:r}})]);case 1:n.broadcastStream=s.sent(),s.label=2;case 2:return(o=this.zegoWebRTC.startPublishingStream(e,this.broadcastStream,{roomID:this.roomID},!0))&&this.pubDataChannelList.push(e),Le(this.Xn,t),[2,o]}}))}))},e.prototype.stopBroadcasting=function(e){var t="dc.sb.1";Me(this.Xn,t),this.pubDataChannelList=this.pubDataChannelList.filter((function(t){return t!==e}));var i=this.zegoWebRTC.streamCenter.publisherList[e];return i?(i.room.roomID==this.roomID&&i.isDataChannel&&this.zegoWebRTC.stopPublishingStream(e),Le(this.Xn,t),!0):(this.Xn.error(t+" datachannel no found"),!1)},e.prototype.sendRealTimeSequentialData=function(e,t){if(!_n(t))return this.Xn.error("dc.srsd data type wrong"),!1;var i=this.zegoWebRTC.streamCenter.publisherList[e];return i&&this.pubDataChannelList.includes(e)?this.sendBCMessage(i.publisher,t):(this.Xn.error("dc.srsd datachannel no found"),!1)},e.prototype.sendBCMessage=function(e,t){var i;if(!e.dataChannelState)return!1;for(var r=new Uint8Array(t),n=0,o=t.byteLength,s=e.send_seq,a=0,c=(new Date).getTime(),u=0;o>0;){o>1151?u=1141:(u=o,a=1);var l=new Uint8Array(u+10);l[0]=1,l[1]=a,l[2]=e.send_seq>>8&255,l[3]=255&e.send_seq,l[4]=s>>8&255,l[5]=255&s,l[6]=c>>24&255,l[7]=c>>16&255,l[8]=c>>8&255,l[9]=255&c;for(var d=0;d<u;d++)l[d+10]=r[d+n];o-=u,n+=u,e.send_seq++,e.send_seq>=65536&&(e.send_seq=0),null===(i=e.dataChannel)||void 0===i||i.send(l)}return!0},e.prototype.startSubscribing=function(e,t){var i,r;return jf(this,void 0,void 0,(function(){var t,n,o;return Qf(this,(function(s){switch(s.label){case 0:return Me(this.Xn,t="dc.ss.0"),this.subDataChannelList.includes(e)?(this.Xn.error(t+" datachannel already exist"),[2,!1]):(n=this.zegoWebRTC.streamCenter.playerList[e])?[3,2]:[4,this.zegoWebRTC.startPlayingStream(e,void 0,!0)];case 1:s.sent(),n=this.zegoWebRTC.streamCenter.playerList[e],s.label=2;case 2:return(o=n.player).dataChannel?(!(null===(i=o.onDataChannelList)||void 0===i?void 0:i.includes(this.onReceivedDataChannel.bind(this)))&&(null===(r=o.onDataChannelList)||void 0===r||r.push(this.onReceivedDataChannel.bind(this))),this.subDataChannelList.push(e),Le(this.Xn,t),[2,!0]):(this.Xn.error(t+" datachannel no exist, try other stream ID"),[2,!1])}}))}))},e.prototype.stopSubscribing=function(e){var t="dc.ss.1";Me(this.Xn,t),this.subDataChannelList=this.subDataChannelList.filter((function(t){return t!==e}));var i=this.zegoWebRTC.streamCenter.playerList[e];return i?(i.room.roomID==this.roomID&&i.isDataChannel&&this.zegoWebRTC.stopPlayingStream(e),Le(this.Xn,t),!0):(this.Xn.error(t+" datachannel no subscribe"),!1)},e.prototype.on=function(e,t){this.bindListener(e,t)},e.prototype.off=function(e,t){this.deleteListener(e,t)},e.prototype.bindListener=function(e,t){return this.listenerList[e]?fn(t)?(-1==this.listenerList[e].indexOf(t)&&this.listenerList[e].push(t),!0):(this.Xn.error("zc.o.0 listener callBack must be funciton"),!1):(this.Xn.error("dc.o.0 event "+e+" no found"),!1)},e.prototype.deleteListener=function(e,t){if(!this.listenerList[e])return this.Xn.error("dc.o.1 listener no found"),!1;var i=this.listenerList[e];return t?i.splice(i.indexOf(t),1):this.listenerList[e]=[],!0},e.prototype.actionListener=function(e){for(var t=this,i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];this.listenerList[e]&&this.listenerList[e].forEach((function(r){try{setTimeout((function(){r.apply(void 0,i)}),0)}catch(i){t.Xn.error("dc.al "+e+" "+i)}}))},e.prototype.onReceivedDataChannel=function(e,t,i){this.actionListener("receiveRealTimeSequentialData",e,t,i)},e.prototype.reset=function(){var e=this;for(var t in this.Xn.info("dc.rs call"),this.pubDataChannelList.forEach((function(t){var i=e.zegoWebRTC.streamCenter.publisherList[t];i&&i.room.roomID==e.roomID&&i.isDataChannel&&e.zegoWebRTC.stopPublishingStream(t)})),this.subDataChannelList.forEach((function(t){var i=e.zegoWebRTC.streamCenter.playerList[t];i&&i.room.roomID==e.roomID&&i.isDataChannel&&e.zegoWebRTC.stopPlayingStream(t)})),this.listenerList)this.listenerList[t]=[];this.broadcastStream&&this.zegoWebRTC.destroyStream(this.broadcastStream),this.broadcastStream=void 0,this.Xn.info("dc.rs end")},e}(),Zf=function(){function e(e,t){this.Yr=new Wf(e,t)}return e.prototype.startBroadcasting=function(e){return this.Yr.startBroadcasting(e)},e.prototype.stopBroadcasting=function(e){return this.Yr.stopBroadcasting(e)},e.prototype.sendRealTimeSequentialData=function(e,t){return this.Yr.sendRealTimeSequentialData(e,t)},e.prototype.startSubscribing=function(e){return this.Yr.startSubscribing(e)},e.prototype.stopSubscribing=function(e){return this.Yr.stopSubscribing(e)},e.prototype.on=function(e,t){this.Yr.on(e,t)},e.prototype.off=function(e,t){this.Yr.off(e,t)},e}(),Kf={type:"DataChannel",install:function(e){Object.defineProperty(e.prototype,"createRealTimeSequentialDataManager",{value:function(e){this.enableDataChannel(!0);var t=this.stateCenter.getRoomByRoomID(e);return t?t.dataChannelManager?null:(t.dataChannelManager=new Zf(this,e),t.dataChannelManager):(this.logger.error("zc.crsdm room no exist"),null)},writable:!1}),Object.defineProperty(e.prototype,"destroyRealTimeSequentialDataManager",{value:function(e){var t=this.stateCenter.roomList.find((function(t){return t.dataChannelManager==e}));t&&(e.Yr.reset(),t.dataChannelManager=null)},writable:!1})}},Jf="zc.p.0.sbe.3",Yf=function(){function e(e){this.Xn=e,this.recordedFrameCount=0,this.targetFrameRate=0,this.recordingDuration=0}return e.prototype.startRecordBeautyEffectOutput=function(e){return function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var t,i,r,n=this;return function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}(this,(function(o){switch(o.label){case 0:return t=6,this.recordID?(this.Xn.warn(Jf+" detector is already recording"),[2,{result:!0}]):(i=(new Date).getTime(),this.recordID=i,this.targetFrameRate=e,this.recordedFrameCount=0,this.recordingDuration=t,[4,new we((function(e){window.setTimeout(e,1e3*n.recordingDuration)}))]);case 1:return o.sent(),this.recordID!==i?(this.recordID=void 0,[2,{result:!0}]):(this.recordID=void 0,r=this.recordedFrameCount/t,this.recordedFrameCount<this.targetFrameRate*this.recordingDuration/2?(this.Xn.warn(Jf+" detect effect overload: current fps: "+r),[2,{result:!1,targetFPS:this.targetFrameRate,currentFPS:r}]):(this.Xn.info(Jf+" detect effect current fps: "+r),[2,{result:!0}]))}}))}))},e.prototype.stopRecordBeautyEffectOutput=function(){this.recordedFrameCount=this.targetFrameRate=0,this.recordID=void 0},e.prototype.addFrame=function(){this.recordID&&(this.recordedFrameCount+=1)},e}();function $f(e){for(var t=e,i="",r=0;r<t.length;r++){var n=t.charCodeAt(r),o=n;n>=65&&n<=90&&(o=(n-65-13+26)%26+65),n>=97&&n<=122&&(o=(n-97-13+26)%26+97),i+=String.fromCharCode(o)}return i}var em=function(){function e(e,t,i){this.gl=e,this.width=t,this.height=i,this.type="baseShader",this.program=null,this.program=null}return e.prototype.setEffectConfig=function(e){},e.prototype.setConstUniforms=function(){},e.prototype.resetResolution=function(e,t){this.width=e||this.width,this.height=t||this.height},e.prototype.render=function(){},e.prototype.renderPreTextures=function(e,t,i){},e.prototype.makeProgram=function(e,t){var i=this.gl,r=$f(e),n=$f(t),o=this.makeShader(r,i.VERTEX_SHADER),s=this.makeShader(n,i.FRAGMENT_SHADER),a=i.createProgram();return i.attachShader(a,o),i.attachShader(a,s),i.linkProgram(a),i.getProgramParameter(a,i.LINK_STATUS),a},e.prototype.release=function(){},e.prototype.makeShader=function(e,t){var i=this.gl,r=i.createShader(t);return i.shaderSource(r,e),i.compileShader(r),i.getShaderParameter(r,i.COMPILE_STATUS),r},e}(),tm="nggevohgr irp4 nCbfvgvba;\nnggevohgr irp4 nGrkPbbeqvangr;\nhavsbez uvtuc sybng grkOyheJvqguBssfrg;\nhavsbez uvtuc sybng grkOyheUrvtugBssfrg;\ninelvat irp2 i_grkpbbeq0;\ninelvat irp4 grkgherFuvsg_1;\ninelvat irp4 grkgherFuvsg_2;\ninelvat irp4 grkgherFuvsg_3;\ninelvat irp4 grkgherFuvsg_4;\nibvq znva()\n{\n ty_Cbfvgvba = nCbfvgvba;\n i_grkpbbeq0 = nGrkPbbeqvangr.kl;\n\n irp2 fvatyrFgrcBssfrg = irp2(grkOyheJvqguBssfrg, grkOyheUrvtugBssfrg)*2.5;\n\n grkgherFuvsg_1 = irp4(nGrkPbbeqvangr.kl - fvatyrFgrcBssfrg, nGrkPbbeqvangr.kl + fvatyrFgrcBssfrg);\n grkgherFuvsg_2 = irp4(nGrkPbbeqvangr.kl - 2.0 * fvatyrFgrcBssfrg, nGrkPbbeqvangr.kl + 2.0 * fvatyrFgrcBssfrg);\n grkgherFuvsg_3 = irp4(nGrkPbbeqvangr.kl - 3.0 * fvatyrFgrcBssfrg, nGrkPbbeqvangr.kl + 3.0 * fvatyrFgrcBssfrg);\n grkgherFuvsg_4 = irp4(nGrkPbbeqvangr.kl - 4.0 * fvatyrFgrcBssfrg, nGrkPbbeqvangr.kl + 4.0 * fvatyrFgrcBssfrg);\n}",im="cerpvfvba zrqvhzc sybng;\nhavsbez fnzcyre2Q hGrkgher;\ninelvat irp2 i_grkpbbeq0;\ninelvat uvtuc irp4 grkgherFuvsg_1;\ninelvat uvtuc irp4 grkgherFuvsg_2;\ninelvat uvtuc irp4 grkgherFuvsg_3;\ninelvat uvtuc irp4 grkgherFuvsg_4;\nibvq znva(ibvq) { \n zrqvhzc irp3 fhz = grkgher2Q(hGrkgher, i_grkpbbeq0).eto;\n fhz += grkgher2Q(hGrkgher, grkgherFuvsg_1.kl).eto;\n fhz += grkgher2Q(hGrkgher, grkgherFuvsg_1.mj).eto;\n fhz += grkgher2Q(hGrkgher, grkgherFuvsg_2.kl).eto;\n fhz += grkgher2Q(hGrkgher, grkgherFuvsg_2.mj).eto;\n fhz += grkgher2Q(hGrkgher, grkgherFuvsg_3.kl).eto;\n fhz += grkgher2Q(hGrkgher, grkgherFuvsg_3.mj).eto;\n fhz += grkgher2Q(hGrkgher, grkgherFuvsg_4.kl).eto;\n fhz += grkgher2Q(hGrkgher, grkgherFuvsg_4.mj).eto;\n ty_SentPbybe = irp4(fhz * 0.1111, 1.0); \n}",rm=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nm=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.width=i,n.height=r,n.type="BlurShader",n.blurXProgram=null,n.blurYProgram=null,n.diffProgram=null,n.uIntensity=null,n.smoothIntensity=.5,n.blurTextureList=[],n.blurBufferList=[],n.blurXProgram=n.makeProgram(tm,im),n.setBorderBlurProgram(n.blurXProgram,1/(i||1),0),n.blurYProgram=n.makeProgram(tm,im),n.setBorderBlurProgram(n.blurYProgram,0,1/(r||1)),n.diffProgram=n.makeProgram("nggevohgr irp4 nCbfvgvba;\nnggevohgr irp4 nGrkPbbeqvangr;\nhavsbez zng4 hCZIZngevk;\ninelvat irp2 i_grkpbbeq0;\nibvq znva()\n{\n // ty_Cbfvgvba = hCZIZngevk * nCbfvgvba;\n ty_Cbfvgvba = nCbfvgvba;\n i_grkpbbeq0 = nGrkPbbeqvangr.kl;\n}","cerpvfvba zrqvhzc sybng;\nhavsbez fnzcyre2Q hGrkgher;\ninelvat irp2 i_grkpbbeq0;\nhavsbez fnzcyre2Q oyheGrkgher;\nibvq znva(ibvq) {\n irp4 vPbybe = grkgher2Q(oyheGrkgher, i_grkpbbeq0);\n irp4 zrnaPbybe = grkgher2Q(hGrkgher, i_grkpbbeq0);\n irp4 qvssPbybe = vPbybe - zrnaPbybe;\n qvssPbybe.e = zva(qvssPbybe.e * 50.0 * qvssPbybe.e, 1.0);\n qvssPbybe.t = zva(qvssPbybe.t * 50.0 * qvssPbybe.t, 1.0);\n qvssPbybe.o = zva(qvssPbybe.o * 50.0 * qvssPbybe.o, 1.0);\n ty_SentPbybe = irp4(qvssPbybe.eto, 1.0);\n}"),n.setDiffBlurProgram(n.diffProgram),n.program=n.makeProgram("\nnggevohgr irp4 nCbfvgvba;\nnggevohgr irp4 nGrkPbbeqvangr;\ninelvat irp2 i_grkpbbeq0;\nhavsbez sybng jvqguBssfrg;\nhavsbez sybng urvtugBssfrg;\ninelvat irp2 grkgherFuvsg_1;\ninelvat irp2 grkgherFuvsg_2;\ninelvat irp2 grkgherFuvsg_3;\ninelvat irp2 grkgherFuvsg_4;\nibvq znva()\n{\n ty_Cbfvgvba = nCbfvgvba;\n i_grkpbbeq0 = nGrkPbbeqvangr.kl;\n grkgherFuvsg_1 = irp2(i_grkpbbeq0 + 0.5 * irp2(jvqguBssfrg,urvtugBssfrg));\n grkgherFuvsg_2 = irp2(i_grkpbbeq0 + 0.5 * irp2(-jvqguBssfrg,-urvtugBssfrg));\n grkgherFuvsg_3 = irp2(i_grkpbbeq0 + 0.5 * irp2(-jvqguBssfrg,urvtugBssfrg));\n grkgherFuvsg_4 = irp2(i_grkpbbeq0 + 0.5 * irp2(jvqguBssfrg,-urvtugBssfrg));\n}\n","\ncerpvfvba zrqvhzc sybng;\nhavsbez fnzcyre2Q hGrkgher;\ninelvat irp2 i_grkpbbeq0;\nhavsbez fnzcyre2Q oyheGrkgher;\nhavsbez fnzcyre2Q oyheQvssGrkgher;\nhavsbez ybjc sybng oyheNycun;\nibvq znva(ibvq) {\n ybjc irp4 vPbybe = grkgher2Q(hGrkgher, i_grkpbbeq0);\n ybjc irp4 zrnaPbybe = grkgher2Q(oyheGrkgher, i_grkpbbeq0);\n ybjc irp4 inePbybe = grkgher2Q(oyheQvssGrkgher, i_grkpbbeq0);\n ybjc sybng nycun = oyheNycun * 1.0;\n ybjc sybng gurgn = 0.1;\n zrqvhzc sybng c = pynzc((zva(vPbybe.e, zrnaPbybe.e - 0.1) - 0.2) * 4.0, 0.0, 1.0);\n zrqvhzc sybng zrnaIne = znk(znk(inePbybe.e, inePbybe.t), inePbybe.o);\n zrqvhzc sybng xZva = 0.1;\n ybjc irp3 erfhygPbybe;\n xZva = (1.0 - zrnaIne / (zrnaIne + gurgn)) * c * nycun;\n erfhygPbybe = zvk(vPbybe.eto, zrnaPbybe.eto, xZva);\n erfhygPbybe = zvk(vPbybe.eto, erfhygPbybe, zva(1.0,nycun));\n ty_SentPbybe = irp4(erfhygPbybe,1.0);\n}"),n.initBlurBuffer(),n}return rm(t,e),t.prototype.setEffectConfig=function(e){isNaN(e.smoothIntensity)||(this.smoothIntensity=e.smoothIntensity/100)},t.prototype.render=function(){this.gl.uniform1f(this.uIntensity,this.smoothIntensity)},t.prototype.initBlurBuffer=function(){var e=this,t=this.gl;this.blurTextureList.forEach((function(t){var i;t&&(null===(i=e.gl)||void 0===i||i.deleteTexture(t))})),this.blurBufferList.forEach((function(t){var i;t&&(null===(i=e.gl)||void 0===i||i.deleteFramebuffer(t))})),this.blurTextureList=[],this.blurBufferList=[];for(var i=0;i<3;i++){var r=t.createTexture();if(!r)return;t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null);var n=t.createFramebuffer();if(!n)return;t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),this.blurTextureList.push(r),this.blurBufferList.push(n)}},t.prototype.renderPreTextures=function(e,t,i){var r=this,n=this.gl,o=[0,1,0],s=[1,1,2];[this.blurXProgram,this.blurYProgram,this.diffProgram].forEach((function(a,c){if(a){n.useProgram(a);var u=n.getUniformLocation(a,"uTexture");n.uniform1i(u,o[c]);var l=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,l),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e),n.STATIC_DRAW);var d=n.createBuffer();n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,d),n.bufferData(n.ELEMENT_ARRAY_BUFFER,new Uint16Array(t),n.STATIC_DRAW);var h=n.getAttribLocation(a,"aPosition");n.enableVertexAttribArray(h),n.vertexAttribPointer(h,3,n.FLOAT,!1,0,0);var p=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,p),n.bufferData(n.ARRAY_BUFFER,new Float32Array(i),n.STATIC_DRAW);var f=n.getAttribLocation(a,"aTexCoordinate");n.enableVertexAttribArray(f),n.vertexAttribPointer(f,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.FRAMEBUFFER,r.blurBufferList[c]),n.clearColor(0,0,0,1),n.clear(n.COLOR_BUFFER_BIT),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0),n.activeTexture(n.TEXTURE0+s[c]),n.bindTexture(n.TEXTURE_2D,r.blurTextureList[c])}}))},t.prototype.setConstUniforms=function(){var e=this.width,t=this.height,i=this.program;if(i){var r=this.gl;r.useProgram(i);var n=r.getUniformLocation(i,"widthOffset");r.uniform1f(n,1/e);var o=r.getUniformLocation(i,"heightOffset");r.uniform1f(o,1/t),this.uIntensity=r.getUniformLocation(i,"blurAlpha"),r.uniform1f(this.uIntensity,this.smoothIntensity);var s=r.getUniformLocation(i,"blurTexture");r.uniform1i(s,1);var a=r.getUniformLocation(i,"blurDiffTexture");r.uniform1i(a,2)}},t.prototype.resetResolution=function(e,t){this.width=e||this.width,this.height=t||this.height,this.blurXProgram&&this.setBorderBlurProgram(this.blurXProgram,1/(e||1),0),this.blurYProgram&&this.setBorderBlurProgram(this.blurYProgram,0,1/(t||1)),this.setConstUniforms(),this.initBlurBuffer()},t.prototype.setBorderBlurProgram=function(e,t,i){var r=this.gl;r.useProgram(e);var n=r.getUniformLocation(e,"texBlurWidthOffset");r.uniform1f(n,t);var o=r.getUniformLocation(e,"texBlurHeightOffset");r.uniform1f(o,i)},t.prototype.setDiffBlurProgram=function(e){var t=this.gl;t.useProgram(e);var i=t.getUniformLocation(e,"blurTexture");t.uniform1i(i,1)},t}(em),om=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sm=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.width=i,n.height=r,n.type="LightShader",n.uLightIntensity=null,n.uRedIntensity=null,n.whitenIntensity=.5,n.rosyIntensity=.5,n.program=n.makeProgram("cerpvfvba uvtuc sybng;\nnggevohgr irp2 nGrkPbbeqvangr;\nnggevohgr irp4 nCbfvgvba;\nhavsbez zng4 hCZIZngevk;\ninelvat irp2 iGrkPbbeq;\nibvq znva() {\n ty_Cbfvgvba = hCZIZngevk * nCbfvgvba;\n iGrkPbbeq = nGrkPbbeqvangr;\n}","cerpvfvba uvtuc sybng;\ninelvat irp2 iGrkPbbeq;\nhavsbez fnzcyre2Q hGrkgher;\nhavsbez sybng vagrafvgl;\nhavsbez sybng ebflVagrafvgl;\nirp3 oevtugarffNaqPbagenfg(irp3 pbybe){\n sybng v = vagrafvgl * 1.0;\n sybng CV = 3.1415926;\n sybng O = 0.12 * v;\n sybng p = 0.1 * v;\n sybng x = gna((45. + 44. * p) / 180.0 * CV);\n pbybe = ((pbybe*255.0 - 127.5 * (1.0 - O)) * x + 127.5 * (1.0 + O)) / 255.0;\n erghea pbybe;\n}\nibvq znva() {\n irp4 grkgherPbybe = grkgher2Q(hGrkgher, iGrkPbbeq);\n grkgherPbybe = irp4(oevtugarffNaqPbagenfg(grkgherPbybe.eto), grkgherPbybe.j);\n grkgherPbybe.e = zva(grkgherPbybe.e + 0.06 * ebflVagrafvgl, 1.0);\n ty_SentPbybe = grkgherPbybe;\n}"),n}return om(t,e),t.prototype.setEffectConfig=function(e){isNaN(e.whitenIntensity)||(this.whitenIntensity=e.whitenIntensity/100),isNaN(e.rosyIntensity)||(this.rosyIntensity=e.rosyIntensity/100)},t.prototype.render=function(){var e=this.gl;e.uniform1f(this.uLightIntensity,this.whitenIntensity),e.uniform1f(this.uRedIntensity,this.rosyIntensity)},t.prototype.setConstUniforms=function(){var e=this.program;if(e){var t=this.gl;t.useProgram(e),this.uLightIntensity=t.getUniformLocation(e,"intensity"),t.uniform1f(this.uLightIntensity,this.whitenIntensity),this.uRedIntensity=t.getUniformLocation(e,"rosyIntensity"),t.uniform1f(this.uRedIntensity,this.rosyIntensity);var i=t.getUniformLocation(e,"uPMVMatrix");t.uniformMatrix4fv(i,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}},t}(em),am=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cm=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.width=i,n.height=r,n.type="LowLightShader",n.uIntensity=null,n.lowlightEnhancement=!1,n.lutTex=null,n.lutImg=null,n.lutTexIdx=10,n.uLutTex=null,n.program=n.makeProgram("\nnggevohgr irp4 nCbfvgvba;\nnggevohgr irp4 nGrkPbbeqvangr;\nhavsbez sybng grkryJvqgu;\nhavsbez sybng grkryUrvtug;\ninelvat irp2 grkgherPbbeqvangr[9];\ninelvat irp2 grkgherPbbeqvangr2;\nhavsbez zng4 hCZIZngevk;\nibvq znva(){\n ty_Cbfvgvba = hCZIZngevk * nCbfvgvba;\n grkgherPbbeqvangr2 = nGrkPbbeqvangr.kl;\n grkgherPbbeqvangr[0] = nGrkPbbeqvangr.kl;\n irp2 jvqguFgrc = irp2(grkryJvqgu, 0.0);\n irp2 urvtugFgrc = irp2(0.0, grkryUrvtug);\n irp2 jvqguUrvtugFgrc = irp2(grkryJvqgu, grkryUrvtug);\n irp2 jvqguArtngvirUrvtugFgrc = irp2(grkryJvqgu, -grkryUrvtug);\n \n grkgherPbbeqvangr[0] = nGrkPbbeqvangr.kl;\n grkgherPbbeqvangr[1] = nGrkPbbeqvangr.kl - jvqguFgrc;\n grkgherPbbeqvangr[2] = nGrkPbbeqvangr.kl + jvqguFgrc;\n \n grkgherPbbeqvangr[3] = nGrkPbbeqvangr.kl - urvtugFgrc;\n grkgherPbbeqvangr[4] = nGrkPbbeqvangr.kl - jvqguUrvtugFgrc;\n grkgherPbbeqvangr[5] = nGrkPbbeqvangr.kl + jvqguArtngvirUrvtugFgrc;\n \n grkgherPbbeqvangr[6] = nGrkPbbeqvangr.kl + urvtugFgrc;\n grkgherPbbeqvangr[7] = nGrkPbbeqvangr.kl - jvqguArtngvirUrvtugFgrc;\n grkgherPbbeqvangr[8] = nGrkPbbeqvangr.kl + jvqguUrvtugFgrc;\n}\n","cerpvfvba uvtuc sybng;\ninelvat uvtuc irp2 grkgherPbbeqvangr[9];\ninelvat uvtuc irp2 grkgherPbbeqvangr2;\nhavsbez fnzcyre2Q hGrkgher;\nhavsbez fnzcyre2Q vachgVzntrGrkgher2;\nhavsbez uvtuc zng3 zngLHIgbETO;\nhavsbez uvtuc zng3 zngETOgbLHI;\nhavsbez sybng hVagrafvgl;\npbafg irp3 pbzcIrp = irp3(-0.0/255.0, -128.0/255.0, -128.0/255.0);\nirp4 eto2lhi(irp4 vachgETO) {\n irp3 bhgchgLHI;\n bhgchgLHI = zngETOgbLHI * vachgETO.eto;\n bhgchgLHI -= pbzcIrp;\n erghea irp4(pynzc(bhgchgLHI,\n irp3(0.0, 0.0, 0.0),\n irp3(1.0, 1.0, 1.0)),\n vachgETO.n);\n}\nirp2 fnghengvba(irp2 bet, sybng snpgbe) {\n irp2 zbq = irp2((bet.k - 128.0/255.0) * snpgbe + 128.0/255.0,\n (bet.l - 128.0/255.0) * snpgbe + 128.0/255.0);\n erghea pynzc(zbq, irp2(0.0, 0.0), irp2(1.0, 1.0));\n}\nirp4 lhi2eto(irp4 vachgLHI) {\n irp3 bhgchgETO;\n vachgLHI.eto += pbzcIrp;\n bhgchgETO = zngLHIgbETO * vachgLHI.eto;\n erghea irp4(pynzc(bhgchgETO,\n irp3(0.0, 0.0, 0.0),\n irp3(1.0, 1.0, 1.0)),\n vachgLHI.n);\n}\nibvq znva(){\n irp4 lhi[9];\n sbe(vag v = 0; v < 9; v++){\n lhi[v] = eto2lhi(grkgher2Q(hGrkgher, grkgherPbbeqvangr[v]));\n }\n sybng fzbbguL = 0.0;\n fzbbguL += 1.0*lhi[4].e + 2.0*lhi[3].e + 1.0*lhi[5].e;\n fzbbguL += 2.0*lhi[1].e + 4.0*lhi[0].e + 2.0*lhi[2].e;\n fzbbguL += 1.0*lhi[7].e + 2.0*lhi[6].e + 1.0*lhi[8].e;\n fzbbguL = fzbbguL / 16.0;\n sybng bhgchgL = grkgher2Q(vachgVzntrGrkgher2, irp2(fzbbguL, lhi[0].e)).e;\n irp3 arjLHI = irp3(zvk(fzbbguL, bhgchgL, hVagrafvgl), lhi[0].to);\n ty_SentPbybe = lhi2eto(irp4(arjLHI.eto, lhi[0].n));\n}\n"),n}return am(t,e),t.prototype.setEffectConfig=function(e){this.lowlightEnhancement=1===e.lowlightEnhancement},t.prototype.release=function(){this.gl.deleteTexture(this.lutTex)},t.prototype.render=function(){var e=this.gl;e.uniform1f(this.uIntensity,this.lowlightEnhancement?.6:0);var t=this,i=t.program,r=t.width,n=t.height,o=t.lutTex;if(i){var s=e.getUniformLocation(i,"texelWidth");e.uniform1f(s,1/r);var a=e.getUniformLocation(i,"texelHeight");e.uniform1f(a,1/n),e.activeTexture(e.TEXTURE0+this.lutTexIdx),e.bindTexture(e.TEXTURE_2D,o)}},t.prototype.setConstUniforms=function(){return function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var e,t,i,r,n,o,s,a,c,u,l=this;return function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}(this,(function(d){switch(d.label){case 0:return e=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t=[1,1,1,0,-.344,1.772,1.402,-.714,0],i=[.298973,-.168721,.500019,.58706,-.331298,-.41873,.113967,.500019,-.081289],(r=this.program)?((n=this.gl).useProgram(r),this.uIntensity=n.getUniformLocation(r,"uIntensity"),o=n.getUniformLocation(r,"matYUVtoRGB"),n.uniformMatrix3fv(o,!1,t),s=n.getUniformLocation(r,"matRGBtoYUV"),n.uniformMatrix3fv(s,!1,i),a=n.getUniformLocation(r,"uPMVMatrix"),n.uniformMatrix4fv(a,!1,e),c=n.getUniformLocation(r,"inputImageTexture2"),u=this,[4,new we((function(e){var t=n.createTexture(),i=l.lutTexIdx,o=l.lutImg;o||(o=new Image),o.onload=function(){n.useProgram(r),l.lutImg=o,n.activeTexture(n.TEXTURE0+i),n.bindTexture(n.TEXTURE_2D,t),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),n.texImage2D(n.TEXTURE_2D,0,n.LUMINANCE,n.LUMINANCE,n.UNSIGNED_BYTE,o),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST),n.uniform1i(c,i),t&&e(t)},o.src="\ndata:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAM3mlDQ1BJQ0MgUHJvZmlsZQAAWIWlVwdYU8kWnluS0BJ6lRI60gwoXUqkBpBeBFGJIZBACDEFAbEhiyu4dhHBsqKiKIsdgcWGBQtrB7sLuigo6+IqNixvEopYdt/7vnfzzb3/nXPOnDpnbgBQ5TAFAh4KAMjki4WBUfSEKQmJVNJdIA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96PuiRAHQq1GCcbeDOW5eBwtwQIQyBXEvnV0eQV5CHe0dkGcQg6JkChgIFA8tBtwM1YWXi0awJEBfxUFvOQ04BtoJXgWOcEcAX4C2N9ORIQ1NrgePcEgAJZK1QQIA9LG5zooABlGCgIJA9RC4MNTnZSALcBu8AeUAUEnIcxDU51U4CggIFAinHFBqc7KoApgB9b8AzopxTIw2iDM10VoEShgKBqg7OdFSBHYSUPLQ3OdVgAswEVggwEmQ3Od1kAV8A6kYAAeWhpcKHTAqgC/oQcQMC1kG1wsdsC5CiMIOA85DS41HEBBs/CtTRuyAwC2KDrAoQw0OUogQA26L4AhkLrRAAB9kPYoAcC5CgUEKAYwwZ9ECBDYQAB5+GVXghACvjDkXQigICL8WQ/BEgo1E7kILjaFwFyFCYQXOuNAKKAvp8mEFzvjwARhQkEN3okQEChdCIGwc0+CZB6MVAIENzqlQAWBrIeAgS3eyZARCFAcKdvAgQUAgR/906AhEIBQf8EcBRiPbzbQwEyFN7rpQABhff7KUBC4YOeCuAofNhXAQyFj3orgKJwqscCCAj6LAAr8KTXAjAK+y0AobDnAgwG/wCbrnNMhT0MDgAAAABJRU5ErkJggg=="}))]):[2];case 1:return u.lutTex=d.sent(),[2]}}))}))},t}(em),um=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lm=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.width=i,n.height=r,n.type="SharpnessShader",n.uIntensity=null,n.sharpenIntensity=.5,n.program=n.makeProgram("\nnggevohgr irp4 nCbfvgvba;\nnggevohgr irp4 nGrkPbbeqvangr;\nhavsbez sybng vzntrJvqguSnpgbe;\nhavsbez sybng vzntrUrvtugSnpgbe;\nhavsbez sybng funecarff; \ninelvat irp2 iGrkPbbeq;\ninelvat irp2 yrsgGrkgherPbbeqvangr;\ninelvat irp2 evtugGrkgherPbbeqvangr;\ninelvat irp2 gbcGrkgherPbbeqvangr;\ninelvat irp2 obggbzGrkgherPbbeqvangr;\ninelvat sybng pragreZhygvcyvre;\ninelvat sybng rqtrZhygvcyvre;\nibvq znva() {\n ty_Cbfvgvba = nCbfvgvba;\n irp2 jvqguFgrc = irp2(vzntrJvqguSnpgbe, 0.0);\n irp2 urvtugFgrc = irp2(0.0, vzntrUrvtugSnpgbe);\n iGrkPbbeq = nGrkPbbeqvangr.kl;\n yrsgGrkgherPbbeqvangr = nGrkPbbeqvangr.kl - jvqguFgrc;\n evtugGrkgherPbbeqvangr = nGrkPbbeqvangr.kl + jvqguFgrc;\n gbcGrkgherPbbeqvangr = nGrkPbbeqvangr.kl + urvtugFgrc;\n obggbzGrkgherPbbeqvangr = nGrkPbbeqvangr.kl - urvtugFgrc;\n pragreZhygvcyvre = 1.0 + 4.0 * funecarff;\n rqtrZhygvcyvre = funecarff;\n}\n","\ncerpvfvba uvtuc sybng;\ninelvat uvtuc irp2 iGrkPbbeq;\ninelvat uvtuc irp2 yrsgGrkgherPbbeqvangr;\ninelvat uvtuc irp2 evtugGrkgherPbbeqvangr;\ninelvat uvtuc irp2 gbcGrkgherPbbeqvangr;\ninelvat uvtuc irp2 obggbzGrkgherPbbeqvangr;\ninelvat uvtuc sybng pragreZhygvcyvre;\ninelvat uvtuc sybng rqtrZhygvcyvre;\nhavsbez fnzcyre2Q hGrkgher;\nibvq znva() {\n zrqvhzc irp4 nPbybe = grkgher2Q(hGrkgher, iGrkPbbeq);\n zrqvhzc irp3 grkgherPbybe = nPbybe.eto;\n zrqvhzc irp3 yrsgGrkgherPbybe = grkgher2Q(hGrkgher, yrsgGrkgherPbbeqvangr).eto;\n zrqvhzc irp3 evtugGrkgherPbybe = grkgher2Q(hGrkgher, evtugGrkgherPbbeqvangr).eto;\n zrqvhzc irp3 gbcGrkgherPbybe = grkgher2Q(hGrkgher, gbcGrkgherPbbeqvangr).eto;\n zrqvhzc irp3 obggbzGrkgherPbybe = grkgher2Q(hGrkgher, obggbzGrkgherPbbeqvangr).eto;\n ty_SentPbybe = irp4((grkgherPbybe * pragreZhygvcyvre - (yrsgGrkgherPbybe * rqtrZhygvcyvre + evtugGrkgherPbybe * rqtrZhygvcyvre + gbcGrkgherPbybe * rqtrZhygvcyvre + obggbzGrkgherPbybe * rqtrZhygvcyvre)), nPbybe.n);\n}"),n}return um(t,e),t.prototype.setEffectConfig=function(e){isNaN(e.sharpenIntensity)||(this.sharpenIntensity=e.sharpenIntensity/100)},t.prototype.render=function(){this.gl.uniform1f(this.uIntensity,.5*this.sharpenIntensity)},t.prototype.resetResolution=function(e,t){this.width=e||this.width,this.height=t||this.height,this.setConstUniforms()},t.prototype.setConstUniforms=function(){var e=this.width,t=this.height,i=this.program;if(i){var r=this.gl;r.useProgram(i);var n=r.getUniformLocation(i,"imageWidthFactor");r.uniform1f(n,1/e);var o=r.getUniformLocation(i,"imageHeightFactor");r.uniform1f(o,1/t),this.uIntensity=r.getUniformLocation(i,"sharpness"),r.uniform1f(this.uIntensity,.5*this.sharpenIntensity)}},t}(em),dm=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},hm=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},pm="zc.p.0.sbe.2",fm={errorCode:1103072,extendedData:jt},mm=function(){function e(e,t){this.Xn=e,this.vcMgr=t,this.gl=null,this.shouldClear=!0,this.effectConfig={sharpenIntensity:.5,whitenIntensity:.5,rosyIntensity:.5,smoothIntensity:.5,lowlightEnhancement:0},this._originResolution={width:0,height:0},this._shaderList=[],this._frameBufferList=[],this.Xr=[],this.$r=null,this.isNoInput=!0,this.failedTimes=0,this.onRenderError=function(e){},this.enableBeauty=!1}return e.prototype.setEnableBeauty=function(e){this.enableBeauty=!!e},e.prototype.handleInitError=function(){this.failedTimes++,this.failedTimes>30&&(this.failedTimes=0,this.Xn.error(pm+" get webgl context failed"),this.onRenderError(fm))},e.prototype.init=function(e,t){return dm(this,void 0,void 0,(function(){var i,r,n,o,s,a,c,u,l;return hm(this,(function(d){switch(d.label){case 0:return this.vcMgr?(n=(i=this.vcMgr).gl,o=i.originWidth,s=i.originHeight,(r=i.canvasEl)&&n&&o&&s?(this._canvasEl=r,this.gl=n,this.initGL(e=e||o,t=t||s),this.$r?[4,(a=new cm(this.gl,e,t)).setConstUniforms()]:(this.Xn.error(pm+" input texture not found"),this.handleInitError(),[2])):(this.handleInitError(),[2])):(this.handleInitError(),[2]);case 1:return d.sent(),(c=new nm(this.gl,e,t)).setConstUniforms(),(u=new sm(this.gl,e,t)).setConstUniforms(),(l=new lm(this.gl,e,t)).setConstUniforms(),this._shaderList=[a,c,u,l],this.setEffectConfig(this.effectConfig),[2]}}))}))},e.prototype.render=function(e){return dm(this,void 0,void 0,(function(){var t,i,r,n,o=this;return hm(this,(function(s){switch(s.label){case 0:return(t=this.gl)&&this._canvasEl&&!t.isContextLost()?[3,4]:this._canvasEl?(this.Xn.warn(pm+" gl lost, restart effect"),this.release(),[4,this.init(e.videoWidth,e.videoHeight)]):[3,2];case 1:return s.sent(),[3,3];case 2:this.Xn.error(pm+" canvas lost"),this.onRenderError(fm),s.label=3;case 3:return[2];case 4:return this._originResolution.height===e.videoHeight&&this._originResolution.width===e.videoWidth||!(Math.abs(this._originResolution.height-e.videoHeight)>2||Math.abs(this._originResolution.width-e.videoWidth)>2)?[3,7]:0===e.videoHeight||0===e.videoWidth?[2]:(this._canvasEl.width=e.videoWidth,this._canvasEl.height=e.videoHeight,e.setAttribute("width",e.videoWidth.toString()),e.setAttribute("height",e.videoHeight.toString()),!this.gl||this.gl.isContextLost()?[3,5]:(this.Xn.info(pm+" resolution changed to ".concat(e.videoWidth,"x").concat(e.videoHeight,", reset resolution.")),this.resetResolution(e.videoWidth,e.videoHeight),this._shaderList.forEach((function(t){t.resetResolution(e.videoWidth,e.videoHeight)})),[3,7]));case 5:return this.Xn.warn(pm+" resolution changed and gl context lost, restart effect"),this.release(),[4,this.init(e.videoWidth,e.videoHeight)];case 6:s.sent(),s.label=7;case 7:return i=[-1,-1,0,1,-1,0,1,1,0,-1,1,0],r=[0,1,2,0,2,3],n=[0,0,1,0,1,1,0,1],t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,this.$r),this.isNoInput&&t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),this._shaderList.forEach((function(e,s){var a=e.program;if(a){e.renderPreTextures&&e.renderPreTextures(i,r,n),t.useProgram(a),e.render();var c=t.getUniformLocation(a,"uTexture"),u=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,new Float32Array(i),t.STATIC_DRAW);var l=t.createBuffer();t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,l),t.bufferData(t.ELEMENT_ARRAY_BUFFER,new Uint16Array(r),t.STATIC_DRAW);var d=t.getAttribLocation(a,"aPosition");t.enableVertexAttribArray(d),t.vertexAttribPointer(d,3,t.FLOAT,!1,0,0);var h=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,h),t.bufferData(t.ARRAY_BUFFER,new Float32Array(n),t.STATIC_DRAW);var p=t.getAttribLocation(a,"aTexCoordinate");t.enableVertexAttribArray(p),t.vertexAttribPointer(p,2,t.FLOAT,!1,0,0);var f=s===o._shaderList.length-1?null:o.Xr[s];t.bindFramebuffer(t.FRAMEBUFFER,s===o._shaderList.length-1?null:o._frameBufferList[s]),o.shouldClear&&(t.clearColor(0,0,0,1),t.clear(t.COLOR_BUFFER_BIT)),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),t.activeTexture(t.TEXTURE0),f&&t.bindTexture(t.TEXTURE_2D,f),t.uniform1i(c,0)}})),[2]}}))}))},e.prototype.setEffectConfig=function(e){var t=this;isNaN(e.sharpenIntensity)||(this.effectConfig.sharpenIntensity=e.sharpenIntensity),isNaN(e.whitenIntensity)||(this.effectConfig.whitenIntensity=e.whitenIntensity),isNaN(e.rosyIntensity)||(this.effectConfig.rosyIntensity=e.rosyIntensity),isNaN(e.smoothIntensity)||(this.effectConfig.smoothIntensity=e.smoothIntensity),isNaN(e.lowlightEnhancement)||(this.effectConfig.lowlightEnhancement=e.lowlightEnhancement),this._shaderList.forEach((function(e){e.setEffectConfig(t.effectConfig)}))},e.prototype.release=function(){var e=this;this._shaderList.forEach((function(t){var i;t.program&&(null===(i=e.gl)||void 0===i||i.deleteProgram(t.program))})),this.Xr.forEach((function(t){var i;t&&(null===(i=e.gl)||void 0===i||i.deleteTexture(t))})),this._frameBufferList.forEach((function(t){var i;t&&(null===(i=e.gl)||void 0===i||i.deleteFramebuffer(t))})),this._shaderList.forEach((function(e){e.release()})),this._shaderList=[],this.Xr=[],this._frameBufferList=[]},e.prototype.initGL=function(e,t){var i=this.gl;if(!i)return this.Xn.error(pm+" webgl context not found");this.isNoInput&&(this.$r=i.createTexture(),i.bindTexture(i.TEXTURE_2D,this.$r),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR));for(var r=0;4>r;r++){var n=i.createTexture();if(!n)return this.Xn.warn(pm+" create texture failed");i.bindTexture(i.TEXTURE_2D,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e,t,0,i.RGBA,i.UNSIGNED_BYTE,null);var o=i.createFramebuffer();if(!o)return this.Xn.warn(pm+" create frame buffer failed");i.bindFramebuffer(i.FRAMEBUFFER,o),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,n,0),this.Xr.push(n),this._frameBufferList.push(o)}i.viewport(0,0,e,t),this._originResolution.width=e,this._originResolution.height=t},e.prototype.setInputInfo=function(e,t){if(this.isNoInput=e,t){var i=t.texture;i&&(this.$r=i)}},e.prototype.resetResolution=function(e,t){var i,r=this.gl;if(!r)return this.Xn.warn(pm+" can not find webgl context");for(var n=0;n<this.Xr.length;n++)r.bindTexture(r.TEXTURE_2D,this.Xr[n]),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e,t,0,r.RGBA,r.UNSIGNED_BYTE,null);null===(i=this.vcMgr)||void 0===i||i.resetResolution(e,t),this.onResolutionChange(),r.viewport(0,0,e,t),this._originResolution.width=e,this._originResolution.height=t},e.prototype.onResolutionChange=function(){},e}(),vm=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gm=function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},ym=function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},bm={errorCode:1103075,extendedData:"beauty effect overload"},_m="zc.p.0.sbe.1",Sm=function(e){function t(t,i,r,n){var o=e.call(this)||this;return o.Xn=t,o.preview=r,o.re=n,o.kind="video",o._enabled=!1,o.effectTrack=null,o.lastRenderTime=0,o.renderCount=0,o.ns=0,o.stateFlag={base:!1,lowLight:!1},o.isStarting=!1,o.animationFrameId=0,o.fps=15,o.detector=new Yf(t),o.lastRenderTime=0,o.manager=new mm(t,o.vcMgr),o.manager.onRenderError=function(e){1103072===e.errorCode&&o.stopEffect(),o.onError(e)},o.manager.onResolutionChange=function(){},o.setVcMgrInfo(),o}return vm(t,e),Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled},set:function(e){this._enabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return{track:this._output||this.input||null}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vcMgr",{get:function(){return this.preview.vcMgr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ye",{get:function(){return this.re.browser},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.manager.effectConfig||{}},enumerable:!1,configurable:!0}),t.prototype.setBeautyEffectOptions=function(e,t){return void 0===t&&(t={}),gm(this,void 0,void 0,(function(){return ym(this,(function(i){switch(i.label){case 0:return e&&this.manager.setEffectConfig(t),this.enabled===e?[3,5]:(this.manager.setEnableBeauty(e),this.enabled!==e&&this.Xn.info(_m+" effect enabled "+e+"; options: "+JSON.stringify(t)),this.enabled=e,e?[4,this.startEffect()]:[3,2]);case 1:return i.sent(),[3,4];case 2:return[4,this.stopEffect()];case 3:i.sent(),i.label=4;case 4:i.label=5;case 5:return[2]}}))}))},t.prototype.startEffect=function(e){return void 0===e&&(e=!0),gm(this,void 0,void 0,(function(){var t,i=this;return ym(this,(function(r){switch(r.label){case 0:return this.isStarting=!0,this.Xn.info(_m+" call start effect"),this.input?(t=this,[4,this.startWebGLProcessor().catch((function(e){throw i.stopEffect(),e}))]):(this.Xn.error(_m+" start effect failed, input track is null"),[2]);case 1:return t.effectTrack=r.sent(),this.startEffectTask(e),this.Xn.info(_m+" start effect success"),[2]}}))}))},t.prototype.startEffectTask=function(e){var t,i=this;void 0===e&&(e=!0),this.enabled=!0,this.detector.startRecordBeautyEffectOutput(this.fps).then((function(e){!e.result&&i.onError&&i.onError(bm,{targetFPS:e.targetFPS,currentFPS:e.currentFPS})})),e&&(null===(t=this.vcMgr)||void 0===t||t.setRenderTask(!0,"beauty")),this.isStarting=!1},t.prototype.stopEffect=function(e){var t,i;return void 0===e&&(e=!0),gm(this,void 0,void 0,(function(){var r=this;return ym(this,(function(n){return this.enabled=!1,this.Xn.info(_m+" call stop effect"),e&&(null===(t=this.vcMgr)||void 0===t||t.setRenderTask(!1,"beauty")),null===(i=this.vcMgr)||void 0===i||i.off("renderFrame"),this.detector.stopRecordBeautyEffectOutput(),this.manager.release(),this.renderCount=0,void 0===this.removeDomTimer&&(this.removeDomTimer=window.setTimeout((function(){!1===r.enabled&&r.destroy()}),18e4)),[2]}))}))},t.prototype.destroy=function(){this.Xn.info(_m+" destroy hidden elements"),this.canvasEl&&this.canvasEl.remove(),this.videoEl&&this.videoEl.remove(),this.videoEl=this.canvasEl=void 0,this.removeDomTimer&&(clearTimeout(this.removeDomTimer),this.removeDomTimer=void 0)},t.prototype.startWebGLProcessor=function(){var e;return gm(this,void 0,void 0,(function(){return ym(this,(function(t){switch(t.label){case 0:return this.Xn.info(_m+" start webgl processor"),this.removeDomTimer&&(clearTimeout(this.removeDomTimer),this.removeDomTimer=void 0),[4,this.videoRendering()];case 1:return t.sent(),this.setVcMgrInfo(),[2,null===(e=this.vcMgr)||void 0===e?void 0:e.getCanvasTrack()]}}))}))},t.prototype.setInput=function(e,t){var i,r,n,o,s,a;return gm(this,void 0,void 0,(function(){var t,c,u=this;return ym(this,(function(l){return this.Xn.info(_m+" input call"),t=!1,(null==e?void 0:e.track)&&(c=!1,this.trackWidth===(null===(i=this.vcMgr)||void 0===i?void 0:i.originWidth)&&this.trackHeight===(null===(r=this.vcMgr)||void 0===r?void 0:r.originHeight)||(c=!0,this.Xn.info(_m+" input track wh change")),!c&&this.input===(null==e?void 0:e.track)||"safari"!==this.ye||(this.Xn.info(_m+" input track change"),this.effectTrack=null,this.stopEffect(!1),t=!0),this.input=null==e?void 0:e.track,this.trackWidth=null===(n=this.vcMgr)||void 0===n?void 0:n.originWidth,this.trackHeight=null===(o=this.vcMgr)||void 0===o?void 0:o.originHeight),e&&(this.manager.setInputInfo(this.isFirstNode,e.frameInfo),null===(s=this.vcMgr)||void 0===s||s.off("renderFrame"),null===(a=this.vcMgr)||void 0===a||a.on("renderFrame",(function(){u.renderOutput()})),t&&this.startEffect()),1==this.ns&&(this.setVcMgrInfo(),this.ns=0,this.startEffect()),[2]}))}))},t.prototype.renderOutput=function(){this.renderCount++,this.manager.render(this.videoEl),this.detector.addFrame(),this.renderCount>=3&&this.updateOutput(this.effectTrack)},t.prototype.setVcMgrInfo=function(){var e;if(this.vcMgr&&(null===(e=this.vcMgr)||void 0===e?void 0:e.inited)){var t=this.vcMgr,i=t.canvasEl,r=t.videoEl,n=t.originWidth,o=t.originHeight;r&&(this.videoEl=r),i&&(this.canvasEl=i,this.manager.setInputInfo(this.isFirstNode),this.manager.init(n,o))}},t.prototype.videoRendering=function(){return gm(this,void 0,void 0,(function(){var e=this;return ym(this,(function(t){return[2,new Promise((function(t,i){var r;e.vcMgr&&!(null===(r=e.vcMgr)||void 0===r?void 0:r.inited)?(e.vcMgr.onInited=function(){t()},e.vcMgr.onRenderFail=function(t){e.ns=1,i(t)}):t()}))]}))}))},t.prototype.removeInput=function(){return gm(this,void 0,void 0,(function(){return ym(this,(function(e){switch(e.label){case 0:return this.input=void 0,[4,this.stopEffect()];case 1:return e.sent(),[2]}}))}))},t.prototype.updateOutput=function(e){return gm(this,void 0,void 0,(function(){return ym(this,(function(t){switch(t.label){case 0:return this._output===e?[3,3]:(this._output=e,this.onOutputChange?[4,this.onOutputChange(this._output)]:[3,2]);case 1:t.sent(),t.label=2;case 2:t.label=3;case 3:return[2]}}))}))},t.prototype.onOutputChange=function(e){var t;return gm(this,void 0,void 0,(function(){return ym(this,(function(i){switch(i.label){case 0:return[4,null===(t=this.next)||void 0===t?void 0:t.setInput({track:e||this.input||null})];case 1:return i.sent(),[2]}}))}))},t.prototype.onError=function(e,t){},t}(Ja),Tm=Sm,Em=function(){return Em=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Em.apply(this,arguments)},Cm="zc.p.0.sbe.0",wm={setBeautyEffect:function(e,t,i,r){var n=this;return void 0===r&&(r=!0),new we((function(o,s){var a,c,u=oo(e,n.logger);if(!gn(u))return n.logger.error(Cm+" localStream not found"),void s({errorCode:1100001,extendedData:" localStream no found"});var l=function(e){o(e)},d=n.streamCenter.checkPreview(u);if(!d)return n.logger.error("zc.sbe.0 preview no found"),void l({errorCode:gt.code,extendedData:gt.message});var h=(null===(a=d.videoEffect)||void 0===a?void 0:a.stateFlag)||{base:!1,lowLight:!1};if(r)!(t=!!t)&&h.lowLight?i={sharpenIntensity:0,whitenIntensity:0,rosyIntensity:0,smoothIntensity:0,lowlightEnhancement:h.lowLight?1:0}:t&&(i=Em({lowlightEnhancement:h.lowLight?1:0},i)),h.base=t;else{var p=i.lowlightEnhancement;i=(null===(c=d.videoEffect)||void 0===c?void 0:c.enabled)||1!==p?{lowlightEnhancement:p}:{sharpenIntensity:0,whitenIntensity:0,rosyIntensity:0,smoothIntensity:0,lowlightEnhancement:p},h.lowLight=1===p}d.setBeautyEffect(h.base||h.lowLight,i,h).then((function(){l({errorCode:0,extendedData:""})})).catch((function(e){s({errorCode:e.errorCode||e.code||-1,extendedData:e.extendedData||e.message||e.toString()})}))}))},setLowlightEnhance:function(e,t){return this.setBeautyEffect(e,!0,{lowlightEnhancement:t},!1)}},Im={setBeautyEffect:function(e,t,i){var r;return function(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var n,o,s,a=this;return function(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}(this,(function(c){switch(c.label){case 0:if(!this.videoTrack)return this.logger.error(Cm+" video track no found"),[2];if(hn(WebGLRenderingContext))throw{errorCode:n=1103072,extendedData:o=jt};return s=function(){var e;try{null===(e=a.vcMgr)||void 0===e||e.init(a.videoTrack)}catch(e){if(1001==e.code)throw{errorCode:n,extendedData:o}}},Tm?(this.videoEffect||(s(),this.videoEffect=new Tm(this.logger,this.videoTrack,this,this.stateCenter),this.videoEffect.onError=function(e,t){a.stateCenter.actionListener("beautyEffectError",a.localStream,e.errorCode,e.extendedData,t)}),e?this.videoNodeQueue.isConnected(this.videoEffect)?[3,4]:this.videoTrack&&(null===(r=this.vcMgr)||void 0===r?void 0:r.renderTrack)!==this.videoTrack?[4,this.videoNodeQueue.replaceNewSourceByTrack(this.videoTrack)]:[3,2]:[3,5]):[3,9];case 1:c.sent(),c.label=2;case 2:return[4,this.videoNodeQueue.pushBack(this.videoEffect)];case 3:c.sent(),c.label=4;case 4:return[3,7];case 5:return[4,this.videoNodeQueue.remove(this.videoEffect)];case 6:c.sent(),c.label=7;case 7:return[4,this.videoEffect.setBeautyEffectOptions(e,t)];case 8:return c.sent(),this.videoEffect.stateFlag=i,[3,10];case 9:this.logger.error(Cm+" beauty effect module no found"),c.label=10;case 10:return[2]}}))}))}},Rm={type:"BeautyEffect",install:function(e,t){for(var i in Im)Object.defineProperty(t.prototype,i,{value:Im[i],writable:!1});for(var i in wm)Object.defineProperty(e.prototype,i,{value:wm[i],writable:!1})}},km=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();ah.use(uh()),ah.use(dh()),ah.use(pp),ah.use(wp),ah.use(Vp),ah.use(of),ah.use(Gf),ah.use(Kf),ah.use(Rm);var Pm=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return km(t,e),t}(ah)}(),__webpack_exports__}()}))}).call(this,__webpack_require__("dc84")(module))},"46f5":function(e,t,i){"use strict";i("6a54");var r=i("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(i("2634")),o=r(i("2fdc")),s=r(i("bfe5")),a=(r(i("af29")),r(i("a2f6"))),c=r(i("8d3a")),u=r(i("8881")),l=null,d={isUserStatusNotify:!0},h={appID:267111980,appSign:"afcaa90a7750ee556e450ca62287c5f9a362e9ed711789717cda0e18f088858e",scenario:0},p={components:{ZegoLocalView:u.default,ZegoRemoteView:c.default},data:function(){return{isYuyin:!0,isGuaduan:!0,isYangshengqi:!0,isShexiang:!0,isJieshou:!0,isToggle:!0,winWidth:0,winHeight:0,userInfo:{},playStreamId:"",title:"",count:0,balanceInfo:{},background:{background:"url(https://api.lyiyuan.cn/profile/upload/static/yuyin-bg.png) center top no-repeat",backgroundSize:"100 auto"},engine:null,roomId:"",type:2,statusBarHeight:0,sellerStreamId:"",viewModeIndex:0,isCamera:!0}},onLoad:function(e){this.id=e.id,this.type=e.type,this.title=2==this.type||4==this.type?"语音通话":"视频通话",this.isShexiang=2==this.type||4==this.type,this.winWidth=uni.getSystemInfoSync().windowWidth,this.statusBarHeight=uni.getSystemInfoSync().statusBarHeight,this.winHeight=uni.getSystemInfoSync().windowHeight},onReady:function(){var e=this;return(0,o.default)((0,n.default)().mark((function t(){var i;return(0,n.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:i=e,uni.onSocketMessage((function(e){var t=e.data?JSON.parse(e.data):{};console.log(t),"message"==t.topic&&12==t.type&&uni.getStorageSync("userInfo").id==t.sellerId&&i.toGuaduan(1)})),e.type<=2&&e.toPermission();case 3:case"end":return t.stop()}}),t)})))()},methods:{onBack:function(){var e=this;uni.showModal({title:"温馨提示",content:"是否要退出房间?",confirmColor:"#000000",success:function(t){t.confirm&&(e.isGuaduan=!1,e.toGuaduan())}})},toGuaduan:function(e){var t,i,r,n;1!=e&&uni.$emit("duanYinship",{userId:uni.getStorageSync("userInfo").id,sellerId:this.id,type:12,topic:"message"}),this.socialConsumption(),clearInterval(l),this.isGuaduan=!1,null===(t=this.engine)||void 0===t||t.stopPublishingStream(),null===(i=this.engine)||void 0===i||i.stopPreview(),null===(r=this.engine)||void 0===r||r.stopPlayingStream(this.sellerStreamId),null===(n=this.engine)||void 0===n||n.logoutRoom(this.roomId),a.default.destroyEngine(),uni.navigateBack({delta:1})},toJieshou:function(){this.toPermission()},toggleYuyin:function(){this.isYuyin=!this.isYuyin,this.engine.muteMicrophone(this.isYuyin)},toggleShexiang:function(){this.isShexiang=!this.isShexiang,this.engine.enableCamera(this.isShexiang)},toggleHuamian:function(){this.isCamera=!this.isCamera,this.engine.useFrontCamera(this.isCamera)},toggleYangsheng:function(){this.isYangshengqi=!this.isYangshengqi,this.engine.setAudioRouteToSpeaker(this.isCamera)},toPermission:function(){var e=this;return(0,o.default)((0,n.default)().mark((function t(){return(0,n.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.getUserInfo();case 1:case"end":return t.stop()}}),t)})))()},getUserInfo:function(){var e=this;return(0,o.default)((0,n.default)().mark((function t(){var i,r,o,a;return(0,n.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,s.default.findUserInfo({userId:uni.getStorageSync("userInfo").id});case 2:i=t.sent,r=i.code,o=i.data,a=i.msg,200==r?(e.userInfo=o,e.userBalance(),e.loginRoom()):uni.showToast({title:a,position:"bottom",icon:"none"});case 7:case"end":return t.stop()}}),t)})))()},loginRoom:function(){var e=this;return(0,o.default)((0,n.default)().mark((function t(){var i,r,o;return(0,n.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i=e,t.next=3,s.default.findZegoToken({userId:uni.getStorageSync("userInfo").id,sellerId:e.id});case 3:if(r=t.sent,200!=r.code){t.next=36;break}return d.token=r.data.token,e.playStreamId=r.data.userStreamId,e.sellerStreamId=r.data.sellerStreamId,e.roomId=r.data.roomId,console.log("loginRoom11",r.data),t.next=12,a.default.createEngineWithProfile(h);case 12:e.engine=t.sent,e.engine.enableCamera(e.isShexiang),e.engine.enableEffectsBeauty(!0),o={},o.whitenIntensity=e.userInfo.reserved5,o.rosyIntensity=e.userInfo.reserved6,o.smoothIntensity=e.userInfo.reserved7,o.sharpenIntensity=e.userInfo.reserved8,e.engine.setEffectsBeautyParam(o),e.engine.useFrontCamera(e.isCamera),e.engine.on("roomStateUpdate",(function(e,t,i,r){console.log("roomStateUpdate",e)})),e.engine.on("roomUserUpdate",(function(e,t,i){console.log("roomUserUpdate",e,t,i)})),e.engine.on("playerStateUpdate",(function(e,t,i){console.log("playerStateUpdate",e)})),e.engine.on("roomStreamUpdate",(function(e,t,i){console.log("roomStreamUpdate",t,i)})),i.engine.on("publisherStateUpdate",(function(e,t,i,r){console.log("publisherStateUpdate",e)})),e.engine.loginRoom(r.data.roomId,{userID:uni.getStorageSync("userInfo").id,userName:uni.getStorageSync("userInfo").nickname},d),e.engine.startPreview(),e.engine.startPublishingStream(e.playStreamId),e.isJieshou=!0,clearInterval(l),i.title=i.formatFun(i.count),l=setInterval((function(){if(1==uni.getStorageSync("userInfo").sex)if(1==i.type){if(60*i.balanceInfo.voiceCoins<i.count)return clearInterval(l),i.toGuaduan(),void(i.title=i.formatFun(i.count))}else if(2==i.type&&60*i.balanceInfo.videoCoins<i.count)return clearInterval(l),i.toGuaduan(),void(i.title=i.formatFun(i.count));i.count++,i.title=i.formatFun(i.count)}),1e3),setTimeout((function(){e.toTuiliu()}),100);case 36:case"end":return t.stop()}}),t)})))()},userBalance:function(){var e=this;return(0,o.default)((0,n.default)().mark((function t(){var i,r,o;return(0,n.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.userBalance({userId:uni.getStorageSync("userInfo").id});case 2:i=t.sent,r=i.code,o=i.data,200==r&&(e.balanceInfo=o);case 6:case"end":return t.stop()}}),t)})))()},socialConsumption:function(e){var t=this;return(0,o.default)((0,n.default)().mark((function e(){return(0,n.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$api.socialConsumption({userId:uni.getStorageSync("userInfo").id,sellerId:t.id,type:t.type,duration:t.count+1});case 2:t.userBalance();case 3:case"end":return e.stop()}}),e)})))()},formatFun:function(e){var t,i,r,n;return i=Math.floor(e/3600),r=Math.floor((e-3600*i)/60),n=e-3600*i-60*r,t=(i<=9?"0"+i:i)+":"+(r<=9?"0"+r:r)+":"+(n<=9?"0"+n:n),t},toTuiliu:function(){console.log("toTuiliu",this.sellerStreamId),this.engine.startPlayingStream(this.sellerStreamId),a.default.instance().on("playerStateUpdate",(function(e,t,i,r){console.log("playerStateUpdate",e)}))}},onBackPress:function(){this.isGuaduan&&this.toGuaduan()}};t.default=p},"4ea4":function(e,t,i){"use strict";var r=i("437f");r("Array")},"4f9b":function(e,t,i){"use strict";var r=i("6a50");r("Float32",(function(e){return function(t,i,r){return e(this,t,i,r)}}))},5075:function(e,t,i){"use strict";var r=i("ae5c"),n=i("71e9"),o=i("e7e3"),s=i("52df"),a=i("81a7"),c=i("1fc1"),u=i("1297"),l=i("d67c"),d=i("5112"),h=i("7e91"),p=TypeError,f=function(e,t){this.stopped=e,this.result=t},m=f.prototype;e.exports=function(e,t,i){var v,g,y,b,_,S,T,E=i&&i.that,C=!(!i||!i.AS_ENTRIES),w=!(!i||!i.IS_RECORD),I=!(!i||!i.IS_ITERATOR),R=!(!i||!i.INTERRUPTED),k=r(t,E),P=function(e){return v&&h(v,"normal",e),new f(!0,e)},A=function(e){return C?(o(e),R?k(e[0],e[1],P):k(e[0],e[1])):R?k(e,P):k(e)};if(w)v=e.iterator;else if(I)v=e;else{if(g=d(e),!g)throw new p(s(e)+" is not iterable");if(a(g)){for(y=0,b=c(e);b>y;y++)if(_=A(e[y]),_&&u(m,_))return _;return new f(!1)}v=l(e,g)}S=w?e.next:v.next;while(!(T=n(S,v)).done){try{_=A(T.value)}catch(D){h(v,"throw",D)}if("object"==typeof _&&_&&u(m,_))return _}return new f(!1)}},"53f7":function(e,t,i){"use strict";var r=i("7658"),n=i("57e7");r("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),n)},"57e7":function(e,t,i){"use strict";var r=i("e37c"),n=i("e4ca"),o=i("a74c"),s=i("ae5c"),a=i("b720"),c=i("1eb8"),u=i("5075"),l=i("0cc2"),d=i("97ed"),h=i("437f"),p=i("ab4a"),f=i("d0b1").fastKey,m=i("235c"),v=m.set,g=m.getterFor;e.exports={getConstructor:function(e,t,i,l){var d=e((function(e,n){a(e,h),v(e,{type:t,index:r(null),first:void 0,last:void 0,size:0}),p||(e.size=0),c(n)||u(n,e[l],{that:e,AS_ENTRIES:i})})),h=d.prototype,m=g(t),y=function(e,t,i){var r,n,o=m(e),s=b(e,t);return s?s.value=i:(o.last=s={index:n=f(t,!0),key:t,value:i,previous:r=o.last,next:void 0,removed:!1},o.first||(o.first=s),r&&(r.next=s),p?o.size++:e.size++,"F"!==n&&(o.index[n]=s)),e},b=function(e,t){var i,r=m(e),n=f(t);if("F"!==n)return r.index[n];for(i=r.first;i;i=i.next)if(i.key===t)return i};return o(h,{clear:function(){var e=m(this),t=e.first;while(t)t.removed=!0,t.previous&&(t.previous=t.previous.next=void 0),t=t.next;e.first=e.last=void 0,e.index=r(null),p?e.size=0:this.size=0},delete:function(e){var t=m(this),i=b(this,e);if(i){var r=i.next,n=i.previous;delete t.index[i.index],i.removed=!0,n&&(n.next=r),r&&(r.previous=n),t.first===i&&(t.first=r),t.last===i&&(t.last=n),p?t.size--:this.size--}return!!i},forEach:function(e){var t,i=m(this),r=s(e,arguments.length>1?arguments[1]:void 0);while(t=t?t.next:i.first){r(t.value,t.key,this);while(t&&t.removed)t=t.previous}},has:function(e){return!!b(this,e)}}),o(h,i?{get:function(e){var t=b(this,e);return t&&t.value},set:function(e,t){return y(this,0===e?0:e,t)}}:{add:function(e){return y(this,e=0===e?0:e,e)}}),p&&n(h,"size",{configurable:!0,get:function(){return m(this).size}}),d},setStrong:function(e,t,i){var r=t+" Iterator",n=g(t),o=g(r);l(e,t,(function(e,t){v(this,{type:r,target:e,state:n(e),kind:t,last:void 0})}),(function(){var e=o(this),t=e.kind,i=e.last;while(i&&i.removed)i=i.previous;return e.target&&(e.last=i=i?i.next:e.state.first)?d("keys"===t?i.key:"values"===t?i.value:[i.key,i.value],!1):(e.target=void 0,d(void 0,!0))}),i?"entries":"values",!i,!0),h(t)}}},"5bf5":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAsCAYAAADM1FBZAAAAAXNSR0IArs4c6QAABFpJREFUaEPtmXvonmMYxz9f50Nhc8wpZcaiFC2tyB8OmcM/ljJkJf4Qykxbmf2j8cdGKwoRGZESCdNECRtLhpyVVnJmNUXOXJ7v635/Pd799r7PfT/P7/ebctdbbz3XfV3X537u+zrcj2gxImIP4DHgtDZqgPslXVWqQ6UTPS8ingLOa6OjNne5pGUluoohImIRcGuJ0SFz5kpam6uzCCIijgPeAHbNNThC/ivg+GprfZejNxsiInYH3gKOzjGUIbtW0twMeUog7gMuyzFSILtY0sqm8/4FERHTgBlpm8SAkr+AeYDPwmSMJVXUewXYYcCYff4Z+FjSj37Wg4iIPYHbgAXAbpPhYQc2DHAHcKMiwqQvASd3oHgqVKw2xLXAqqmw3pVNQzhUntiVwnH0/An4t8tE2TDEN8ABHRpwrH8IWAd8BHwL/A7sDzi/nAVcABzYlU1DbK4OyL4dKNxSRZKbgLsl/TJMX8o1V1dRxhGote2uID4D5kj6ou58RDj67QPsBGyR9MfA8yOAJ52l2yxiVxCPSprfdyQiLgQuAU5KEI6AflOvAw8Aj1fFns9JP7y/CMwuBekK4qeUxX9IW2pUoHgHuEjS+wlkenVWNgBHlYB0BVFi28nqDEl23m/Eb633P3e0gXgQuDTX4IC8g4qr1i8TyCNVOTG2LZvqLoXwdjghJclrmhrbhtyzks5JEN6GzltZowTCheFsSRtTzfVB1V4enmV1a+FZkpxTvK3eq1reY3P0lUCslLS4FonOrMLrczlGx5Eda00j4l7g8hx9uRCbvEqDySwinKEdUkvHBklz0pswgEEajxwIJ6pTJb06qD31Ie9Wxg9pbPkfQW9NJ8RNko5MEOc7jyQ9/edD1eZCODM7+86XtD4Z9SHfOyW1vTIhPNe1FJJcc/lMuG93nXUM4EuDHUfpzIGo65on6Ylk1Ad71ihDQ54vkbSi/jz1OG82LUdKIZZKuiVBuIxwR1g6fnV1K+mTvoKIuAG4uanCUog1ks5NEGdXIXdNU4PbkFsn6ZSkz9vo7ZzroFIIr96hkjanStWHOiu2jwPj0vzOqhTxWetFqqajFML6l0lanlbPFajrnsGbiaZ+WM7F4+1VA7U0Z1IvKLRoilzAzZDkztBR5QrgnlwHupBvA2H7z1Tlx9iFckT4XuquFCKH+fc14Ih0MHB9W5C2ELa/StJ1tcjifn0hcDFwWM1BJ64Pq57hYe99Sd+nN/gy0DvUpaMLCNv2gVwo6bcajM+HbxMNZYBPJX1edzQinBwdFFoVkF1B2DdXn1dK8i3HyBER/jBj+JkjhUcIdAnRN/UCsBp4LdVEvTvdlIXt8OmpmSruqQeZJgKibsN3Tv1vDb5n2q/tqo83f6IhJsLnrXT+DzEpy9zAiN+E6/iDGshutyKGeD5FjO3WyVGOGcJlg79H/2dH/3OXP/K1rmGmaBUWjX14jAjf5rmmd6u58xQ51NSs+xn35yskPf03NGWlw1s3q0sAAAAASUVORK5CYII="},"5c8e":function(e,t,i){e.exports=i.p+"static/yuyin-01-on.png"},"5d6e":function(e,t,i){"use strict";var r=i("af9e");e.exports=r((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},"5f25":function(e,t,i){"use strict";i.r(t);var r=i("d0e8"),n=i.n(r);for(var o in r)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(o);t["default"]=n.a},"66a6":function(e,t,i){"use strict";var r=i("8bdb"),n=i("bb80"),o=i("862c"),s=i("497b"),a=i("9e70"),c=i("af9e"),u=n("".charAt),l=c((function(){return"\ud842"!=="𠮷".at(-2)}));r({target:"String",proto:!0,forced:l},{at:function(e){var t=a(o(this)),i=t.length,r=s(e),n=r>=0?r:i+r;return n<0||n>=i?void 0:u(t,n)}})},6730:function(e,t,i){"use strict";var r=i("8bdb"),n=i("71e9");r({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return n(URL.prototype.toString,this)}})},"6fdb":function(e,t,i){"use strict";i.r(t);var r=i("0594"),n=i.n(r);for(var o in r)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(o);t["default"]=n.a},7200:function(e,t,i){"use strict";var r=i("8bdb"),n=i("f221");r({target:"Number",stat:!0},{isInteger:n})},7627:function(e,t,i){"use strict";i("35fd9"),i("855b")},7658:function(e,t,i){"use strict";var r=i("8bdb"),n=i("85c1"),o=i("bb80"),s=i("8466"),a=i("81a9"),c=i("d0b1"),u=i("5075"),l=i("b720"),d=i("474f"),h=i("1eb8"),p=i("1c06"),f=i("af9e"),m=i("29ba"),v=i("181d"),g=i("dcda");e.exports=function(e,t,i){var y=-1!==e.indexOf("Map"),b=-1!==e.indexOf("Weak"),_=y?"set":"add",S=n[e],T=S&&S.prototype,E=S,C={},w=function(e){var t=o(T[e]);a(T,e,"add"===e?function(e){return t(this,0===e?0:e),this}:"delete"===e?function(e){return!(b&&!p(e))&&t(this,0===e?0:e)}:"get"===e?function(e){return b&&!p(e)?void 0:t(this,0===e?0:e)}:"has"===e?function(e){return!(b&&!p(e))&&t(this,0===e?0:e)}:function(e,i){return t(this,0===e?0:e,i),this})},I=s(e,!d(S)||!(b||T.forEach&&!f((function(){(new S).entries().next()}))));if(I)E=i.getConstructor(t,e,y,_),c.enable();else if(s(e,!0)){var R=new E,k=R[_](b?{}:-0,1)!==R,P=f((function(){R.has(1)})),A=m((function(e){new S(e)})),D=!b&&f((function(){var e=new S,t=5;while(t--)e[_](t,t);return!e.has(-0)}));A||(E=t((function(e,t){l(e,T);var i=g(new S,e,E);return h(t)||u(t,i[_],{that:i,AS_ENTRIES:y}),i})),E.prototype=T,T.constructor=E),(P||D)&&(w("delete"),w("has"),y&&w("get")),(D||k)&&w(_),b&&T.clear&&delete T.clear}return C[e]=E,r({global:!0,constructor:!0,forced:E!==S},C),v(E,e),b||i.setStrong(E,e,y),E}},"77bb":function(e,t,i){e.exports=i.p+"static/yuyin-04-on.png"},"7ef7":function(e,t,i){e.exports=i.p+"static/yuyin-03-on.png"},"825c":function(e,t,i){"use strict";var r=i("6a50");r("Float64",(function(e){return function(t,i,r){return e(this,t,i,r)}}))},"82c1":function(e,t,i){var r=i("c86c");t=r(!1),t.push([e.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.room-navbar[data-v-ce12d862]{height:44px;position:fixed;left:0;top:0;z-index:22;display:flex;flex-direction:row}.room-navbar .navbar[data-v-ce12d862]{flex-direction:row;height:44px;line-height:44px;position:relative;text-align:center;font-size:30px}.room-navbar .navbar .txt[data-v-ce12d862]{font-size:20px;color:#fff}.room-navbar .navbar .title[data-v-ce12d862]{display:flex;align-items:center;justify-content:center}.room-navbar .navbar .back[data-v-ce12d862]{width:50px;height:44px;position:absolute;left:15px;top:10px;z-index:1}.room-navbar .navbar .back .img[data-v-ce12d862]{width:20px;height:20px}.room-hd[data-v-ce12d862]{flex-direction:column;position:relative}.room-hd .shitu[data-v-ce12d862]{width:%?300?%;height:%?300?%;border-radius:%?10?%;overflow:hidden;position:absolute;right:%?20?%;top:%?120?%;z-index:12}.room-bd[data-v-ce12d862]{position:relative}.room-bd .pic[data-v-ce12d862]{width:100%;height:100%;display:block}.room-bd .dian-on[data-v-ce12d862]{width:%?648?%;min-height:%?648?%;position:absolute;left:50%;margin-left:%?-324?%;top:%?250?%;z-index:1}.room-bd .dian-on .tag[data-v-ce12d862]{width:%?660?%;height:%?330?%;background:rgba(35,32,48,.36);border-radius:%?20?%;margin:0 auto;padding:%?30?%;box-sizing:border-box;text-align:left;margin-top:%?30?%}.room-bd .dian-on .tag .titles[data-v-ce12d862]{font-weight:700;font-size:%?30?%;color:#fff}.room-bd .dian-on .tag .descs[data-v-ce12d862]{line-height:%?45?%;font-weight:400;font-size:%?24?%;color:#b8b7bc;margin-top:%?20?%}.room-bd .dian-on .info[data-v-ce12d862]{text-align:center;overflow:hidden}.room-bd .dian-on .info .avatar[data-v-ce12d862]{width:%?180?%;height:%?180?%;border-radius:50%;display:block;margin:0 auto}.room-bd .dian-on .info .name[data-v-ce12d862]{font-weight:500;font-size:%?28?%;color:#fff;margin-top:%?10?%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow:hidden;text-align:center;margin-top:%?10?%}.room-bd .dian-on .info .btn[data-v-ce12d862]{width:%?170?%;line-height:%?56?%;background:linear-gradient(0deg,#ff9124,#bd4700);border-radius:%?56?%;font-weight:700;font-size:%?30?%;color:#fff;margin:0 auto;margin-top:%?20?%}.room-bd .dian-on .info .txt[data-v-ce12d862]{font-weight:500;font-size:%?26?%;color:#fff;margin-top:%?20?%;opacity:.3}.room-fd[data-v-ce12d862]{height:%?220?%;position:fixed;left:0;bottom:%?180?%;z-index:44;flex-direction:row}.room-fd .item[data-v-ce12d862]{flex:1;text-align:center;font-size:%?30?%;font-weight:400;display:flex;justify-content:center;align-items:center}.room-fd .item .txt[data-v-ce12d862]{margin-top:%?20?%}.room-fd .item .txt uni-text[data-v-ce12d862]{font-size:%?30?%;color:#fff}.room-fd .item .pic[data-v-ce12d862]{width:%?130?%;height:%?130?%;border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto;margin-bottom:%?10?%}.room-fd .item .pic .pimg[data-v-ce12d862]{width:%?130?%;height:%?130?%}.room-fd1[data-v-ce12d862]{height:%?220?%;position:fixed;left:0;bottom:%?40?%;z-index:44;flex-direction:row;flex-wrap:wrap}.room-fd1 .items[data-v-ce12d862]{flex:1;margin-top:%?70?%;position:relative;flex-direction:row;display:flex;justify-content:center;align-items:center}.room-fd1 .items .pic[data-v-ce12d862]{width:%?130?%;height:%?130?%;border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto;margin-bottom:%?10?%}.room-fd1 .items .pic .pimg[data-v-ce12d862]{width:%?130?%;height:%?130?%}.room-fd1 .items .off[data-v-ce12d862]{width:%?49?%;height:%?44?%;position:absolute;right:%?200?%;z-index:2;top:%?50?%}',""]),e.exports=t},"855b":function(e,t,i){"use strict";var r=i("8bdb"),n=i("85c1"),o=i("2c61").set,s=i("caba"),a=n.setImmediate?s(o,!1):o;r({global:!0,bind:!0,enumerable:!0,forced:n.setImmediate!==a},{setImmediate:a})},8881:function(e,t,i){"use strict";i.r(t);var r=i("b65a"),n=i("6fdb");for(var o in n)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(o);var s=i("828b"),a=Object(s["a"])(n["default"],r["b"],r["c"],!1,null,"447dc87a",null,!1,r["a"],void 0);t["default"]=a.exports},"8d3a":function(e,t,i){"use strict";i.r(t);var r=i("acd4"),n=i("5f25");for(var o in n)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(o);var s=i("828b"),a=Object(s["a"])(n["default"],r["b"],r["c"],!1,null,"53ac0a73",null,!1,r["a"],void 0);t["default"]=a.exports},"92c9":function(e,t,i){"use strict";i.r(t);var r=i("ad9d"),n=i("e5e3");for(var o in n)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(o);i("f9b2");var s=i("828b"),a=Object(s["a"])(n["default"],r["b"],r["c"],!1,null,"ce12d862",null,!1,r["a"],void 0);t["default"]=a.exports},9327:function(e,t,i){"use strict";var r=i("8bdb"),n=i("9f69"),o=i("1ded").f,s=i("c435"),a=i("9e70"),c=i("b6a1"),u=i("862c"),l=i("0931"),d=i("a734"),h=n("".slice),p=Math.min,f=l("endsWith"),m=!d&&!f&&!!function(){var e=o(String.prototype,"endsWith");return e&&!e.writable}();r({target:"String",proto:!0,forced:!m&&!f},{endsWith:function(e){var t=a(u(this));c(e);var i=arguments.length>1?arguments[1]:void 0,r=t.length,n=void 0===i?r:p(s(i),r),o=a(e);return h(t,n-o.length,n)===o}})},9370:function(e,t,i){"use strict";var r=i("8bdb"),n=i("af9e"),o=i("1099"),s=i("c215"),a=n((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}));r({target:"Date",proto:!0,arity:1,forced:a},{toJSON:function(e){var t=o(this),i=s(t,"number");return"number"!=typeof i||isFinite(i)?t.toISOString():null}})},a2f6:function(e,t,i){"use strict";i("6a54");var r=i("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.pluginVersion=t.default=void 0;var n,o=r(i("0111"));n=o.default;var s=n;t.default=s;t.pluginVersion="3.16.0"},a565:function(e,t,i){e.exports=i.p+"static/yuyin-03.png"},a578:function(e,t,i){"use strict";var r=i("8bdb"),n=i("f298");r({target:"String",proto:!0},{repeat:n})},ab3c:function(e,t,i){"use strict";i("6a54"),Object.defineProperty(t,"__esModule",{value:!0}),t.formatObjString=function(e){try{return JSON.parse(e)}catch(t){return e||{}}},t.getPromiseInstance=function(e){return new Promise((function(t){return t(e)}))},t.isNotSupported=function(e){return console.warn('The "'.concat(e,'" is not supported.'))},i("bf0f")},acd4:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"c",(function(){return n})),i.d(t,"a",(function(){}));var r=function(){var e=this.$createElement,t=this._self._c||e;return t("ZegoExpress-Remote-View",{attrs:{viewMode:this.viewMode,streamID:this.streamID,canvasType:this.canvasType}})},n=[]},ad9d:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"c",(function(){return n})),i.d(t,"a",(function(){}));var r=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-uni-view",{staticClass:"room",style:{width:e.winWidth+"px",height:e.winHeight+"px"}},[r("v-uni-view",{staticClass:"room-navbar",style:{width:e.winWidth+"px",height:e.statusBarHeight+44+"px"}},[r("v-uni-view",{staticClass:"navbar",style:{width:e.winWidth+"px","margin-top":e.statusBarHeight+"px"}},[r("v-uni-view",{staticClass:"back",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.onBack()}}},[r("v-uni-image",{staticClass:"img",attrs:{src:i("b2a0")}})],1),r("v-uni-view",{staticClass:"title",style:{width:e.winWidth+"px"}},[r("v-uni-text",{staticClass:"txt"},[e._v(e._s(e.title))])],1)],1)],1),2==e.type||4==e.type?r("v-uni-view",[e.isToggle?r("v-uni-view",{staticClass:"room-hd"},[r("zego-local-view",{staticClass:"video-view",style:{width:e.winWidth+"px",height:e.winHeight+"px"}}),r("zego-remote-view",{staticClass:"shitu",style:{top:e.statusBarHeight+60+"px"},attrs:{streamID:e.sellerStreamId}})],1):r("v-uni-view",{staticClass:"room-hd"},[r("zego-remote-view",{staticClass:"video-view",style:{width:e.winWidth+"px",height:e.winHeight+"px"},attrs:{streamID:e.sellerStreamId}}),r("zego-local-view",{staticClass:"shitu",style:{top:e.statusBarHeight+60+"px"}})],1)],1):e._e(),1==e.type||3==e.type?r("v-uni-view",{staticClass:"room-bd",style:{width:e.winWidth+"px",height:e.winHeight+"px"}},[r("v-uni-image",{staticClass:"pic",style:{width:e.winWidth+"px",height:e.winHeight+"px"},attrs:{src:i("ae72")}}),r("v-uni-view",{staticClass:"dian-on"},[r("v-uni-view",{staticClass:"info"},[r("v-uni-image",{staticClass:"avatar",attrs:{src:e.userInfo.faceImage?e.userInfo.faceImage:e.userInfo.img}}),r("v-uni-view",{staticClass:"name"},[e._v(e._s(e.userInfo.nickname))]),r("v-uni-view",{staticClass:"txt"},[e._v(e._s(e.userInfo.age)+"/"+e._s(e.userInfo.height))])],1),r("v-uni-view",{staticClass:"tag"},[r("v-uni-view",{staticClass:"titles"},[e._v("个性签名:")]),r("v-uni-view",{staticClass:"descs"},[r("v-uni-text",[e._v(e._s(e.userInfo.declaration))])],1)],1)],1)],1):e._e(),1==e.type||3==e.type?r("v-uni-view",{staticClass:"room-fd",style:{width:e.winWidth+"px"}},[r("v-uni-view",{staticClass:"item"},[r("v-uni-view",{staticClass:"pic",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.toggleYuyin()}}},[e.isYuyin?r("v-uni-image",{staticClass:"pimg",attrs:{src:i("01e0")}}):r("v-uni-image",{staticClass:"pimg",attrs:{src:i("5c8e")}})],1)],1),r("v-uni-view",{staticClass:"item"},[r("v-uni-view",{staticClass:"pic"},[e.isJieshou?r("v-uni-image",{staticClass:"pimg",attrs:{src:i("dc8c")},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.toGuaduan()}}}):r("v-uni-image",{staticClass:"pimg",attrs:{src:i("dbf1")},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.toJieshou()}}})],1)],1),r("v-uni-view",{staticClass:"item"},[r("v-uni-view",{staticClass:"pic",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.toggleYangsheng()}}},[e.isYangshengqi?r("v-uni-image",{staticClass:"pimg",attrs:{src:i("a565")}}):r("v-uni-image",{staticClass:"pimg",attrs:{src:i("7ef7")}})],1)],1)],1):e._e(),2==e.type||4==e.type?r("v-uni-view",{staticClass:"room-fd",style:{width:e.winWidth+"px"}},[r("v-uni-view",{staticClass:"item"},[r("v-uni-view",{staticClass:"pic",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.toggleYuyin()}}},[e.isYuyin?r("v-uni-image",{staticClass:"pimg",attrs:{src:i("01e0")}}):r("v-uni-image",{staticClass:"pimg",attrs:{src:i("5c8e")}})],1)],1),r("v-uni-view",{staticClass:"item"},[r("v-uni-view",{staticClass:"pic",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.toggleYangsheng()}}},[e.isYangshengqi?r("v-uni-image",{staticClass:"pimg",attrs:{src:i("a565")}}):r("v-uni-image",{staticClass:"pimg",attrs:{src:i("7ef7")}})],1)],1),r("v-uni-view",{staticClass:"item"},[r("v-uni-view",{staticClass:"pic",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.toggleShexiang()}}},[e.isShexiang?r("v-uni-image",{staticClass:"pimg",attrs:{src:i("b323")}}):r("v-uni-image",{staticClass:"pimg",attrs:{src:i("77bb")}})],1)],1)],1):e._e(),2==e.type||4==e.type?r("v-uni-view",{staticClass:"room-fd1",style:{width:e.winWidth+"px"}},[r("v-uni-view",{staticClass:"items"},[r("v-uni-view",{staticClass:"pic"},[e.isJieshou?r("v-uni-image",{staticClass:"pimg",attrs:{src:i("dc8c")},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.toGuaduan()}}}):r("v-uni-image",{staticClass:"pimg",attrs:{src:i("dbf1")},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.toJieshou()}}})],1),r("v-uni-image",{staticClass:"off",attrs:{src:i("5bf5")},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.toggleHuamian()}}})],1)],1):e._e()],1)},n=[]},ae72:function(e,t,i){e.exports=i.p+"static/yuyin-bg.png"},af29:function(e,t,i){i("bf0f"),e.exports={judgeIosPermission:function(e){return"location"==e?function(){var e,t=plus.ios.import("CLLocationManager"),i=t.authorizationStatus();return e=2!=i,console.log("定位权限开启:"+e),plus.ios.deleteObject(t),e}():"camera"==e?function(){var e=!1,t=plus.ios.import("AVCaptureDevice"),i=t.authorizationStatusForMediaType("vide");return console.log("authStatus:"+i),3==i?(e=!0,console.log("相机权限已经开启")):console.log("相机权限没有开启"),plus.ios.deleteObject(t),e}():"photoLibrary"==e?function(){var e=!1,t=plus.ios.import("PHPhotoLibrary"),i=t.authorizationStatus();return console.log("authStatus:"+i),3==i?(e=!0,console.log("相册权限已经开启")):console.log("相册权限没有开启"),plus.ios.deleteObject(t),e}():"record"==e?function(){var e=!1,t=plus.ios.import("AVAudioSession"),i=t.sharedInstance(),r=i.recordPermission();return console.log("permissionStatus:"+r),1684369017==r||1970168948==r?console.log("麦克风权限没有开启"):(e=!0,console.log("麦克风权限已经开启")),plus.ios.deleteObject(t),e}():"push"==e?function(){var e=!1,t=plus.ios.import("UIApplication"),i=t.sharedApplication(),r=0;if(i.currentUserNotificationSettings){var n=i.currentUserNotificationSettings();r=n.plusGetAttribute("types"),console.log("enabledTypes1:"+r),0==r?console.log("推送权限没有开启"):(e=!0,console.log("已经开启推送功能!")),plus.ios.deleteObject(n)}else r=i.enabledRemoteNotificationTypes(),0==r?console.log("推送权限没有开启!"):(e=!0,console.log("已经开启推送功能!")),console.log("enabledTypes2:"+r);return plus.ios.deleteObject(i),plus.ios.deleteObject(t),e}():"contact"==e?function(){var e=!1,t=plus.ios.import("CNContactStore"),i=t.authorizationStatusForEntityType(0);return 3==i?(e=!0,console.log("通讯录权限已经开启")):console.log("通讯录权限没有开启"),plus.ios.deleteObject(t),e}():"calendar"==e?function(){var e=!1,t=plus.ios.import("EKEventStore"),i=t.authorizationStatusForEntityType(0);return 3==i?(e=!0,console.log("日历权限已经开启")):console.log("日历权限没有开启"),plus.ios.deleteObject(t),e}():"memo"==e&&function(){var e=!1,t=plus.ios.import("EKEventStore"),i=t.authorizationStatusForEntityType(1);return 3==i?(e=!0,console.log("备忘录权限已经开启")):console.log("备忘录权限没有开启"),plus.ios.deleteObject(t),e}()},requestAndroidPermission:function(e){return new Promise((function(t,i){plus.android.requestPermissions([e],(function(e){console.log(1111,e);for(var i=0,r=0;r<e.granted.length;r++){var n=e.granted[r];console.log("已获取的权限:"+n),i=1}for(r=0;r<e.deniedPresent.length;r++){var o=e.deniedPresent[r];console.log("拒绝本次申请的权限:"+o),i=0}for(r=0;r<e.deniedAlways.length;r++){var s=e.deniedAlways[r];console.log("永久拒绝申请的权限:"+s),i=-1}uni.$emit("onPopup",i),t(i)}),(function(e){console.log(2222,1),console.log("申请权限错误:"+e.code+" = "+e.message),t({code:e.code,message:e.message})}))}))},checkSystemEnableLocation:function(){var e=plus.android.importClass("android.content.Context"),t=plus.android.importClass("android.location.LocationManager"),i=plus.android.runtimeMainActivity(),r=i.getSystemService(e.LOCATION_SERVICE),n=r.isProviderEnabled(t.GPS_PROVIDER);return console.log("系统定位开启:"+n),n},gotoAppPermissionSetting:function(){var e=plus.android.importClass("android.content.Intent"),t=plus.android.importClass("android.provider.Settings"),i=plus.android.importClass("android.net.Uri"),r=plus.android.runtimeMainActivity(),n=new e;n.setAction(t.ACTION_APPLICATION_DETAILS_SETTINGS);var o=i.fromParts("package",r.getPackageName(),null);n.setData(o),r.startActivity(n)}}},b2a0:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAACDFJREFUeF7t3OGNIzcMhuFRJ5tOsqWkk6SybCfZThz44EXunB0PJZGUSL73NxI5+sgHBu6AtIM/JEACpwk0siEBEjhPACBsR1cCt9vtrbX22XUp8GGABB6e96ffbre/j+N4O47jvQoSgHhvWdB+Dxy/Pz7//gtSAglAgi6s52c/4fhqXQIJQDw3LWCvExxlkAAk4NJ6ffIFjhJIAOK1bcH6CHGk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Di74XN1plJiAYGHil8P2V0VONNs6/X1cDjK2fICLzs9BTZiBUwEAPGD8zZDE6tcvgTHB7VhCwmkxBMDDcyKwyfs2QGwlcE9wiIuluGK3RrMxBMDDw2HOF7fumc1O9OwVzd0AvZLoFZCq5gGBgOB8AG+ztDNkMGe0EowPfgheyKa5jKbmBYGCg0Ynx994C2djo0WLYktZYFKfqXEEwMNAczd2EP5uIMyKdn+G2nLuDxGbjJNXlDkJ7Y1T1hwaIE5M0sAs/y/UAAbBy0msNBDM7nAVgmXduicSbTiU8So7tTxBZYsQDVkEwMDDXzMTA1jC1iPsmG1VYzu+3BYlwpwQpcX8pIodzrqtD8dZBqPhUcHbg2uEKmx12uK415lNgNd9luz4KA6ECCLrJzwzsDt9weJDybNrfAdwtIqvyrCSq7MJBMJ+LLwEYD+DnRVxYHqWknP6fKYqmAWCuw45ZN3OqsF6xToBQMTscG+RwYrzlXQBKnbKsjtKZZXRWADzT1zDFnRPiFAgVQNC34ZrgHok7AdD5pRmETiP3AXi8XgxiUR11EoRKZajqRSa5F8GwfmNtgwNDt3LeotcqIrwTw1lxHoSKWYKJDbmw/D6AkUxd7KhWD5ig4d8EsxnjDj92tJ0dmlUaEI6YJTgzDA+cZ0cBYLT2mQUrmylp1gXOo88EXsS/FxHOBKWSUoJwpIZVlUG6l5i/QQC+leMROH/hfzURX88CeDZOkKnrVDQFCFXAoIfU1wH0B3C2mTFOA3BKYMT6ahDMe7IBhbsUbl0p3MJxFc+B5o1cewG8FxyWvQmAv/jXATCf/s648YSuD35l+/4PM0ore0exBjoAAAAASUVORK5CYII="},b65a:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"c",(function(){return n})),i.d(t,"a",(function(){}));var r=function(){var e=this.$createElement,t=this._self._c||e;return t("ZegoExpress-Local-View",{attrs:{viewMode:this.viewMode,channel:this.channel,canvasType:this.canvasType}})},n=[]},c02e:function(e,t,i){"use strict";var r=i("6a50");r("Int32",(function(e){return function(t,i,r){return e(this,t,i,r)}}))},c1a3:function(e,t,i){"use strict";i("15ab")},c238:function(e,t,i){"use strict";var r=i("af9e");e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},c24b:function(e,t,i){"use strict";var r=i("8bdb"),n=i("c238"),o=i("af9e"),s=i("1c06"),a=i("d0b1").onFreeze,c=Object.freeze,u=o((function(){c(1)}));r({target:"Object",stat:!0,forced:u,sham:!n},{freeze:function(e){return c&&s(e)?c(a(e)):e}})},c6c6:function(e,t,i){"use strict";var r=i("8bdb"),n=i("1099"),o=i("1fc1"),s=i("497b"),a=i("1cb5");r({target:"Array",proto:!0},{at:function(e){var t=n(this),i=o(t),r=s(e),a=r>=0?r:i+r;return a<0||a>=i?void 0:t[a]}}),a("at")},c753:function(e,t,i){"use strict";var r=i("8bdb"),n=i("7ddb"),o=n.NATIVE_ARRAY_BUFFER_VIEWS;r({target:"ArrayBuffer",stat:!0,forced:!o},{isView:n.isView})},caba:function(e,t,i){"use strict";var r=i("85c1"),n=i("9f9e"),o=i("474f"),s=i("030a"),a=i("29d8"),c=i("37ad"),u=i("7f28"),l=r.Function,d=/MSIE .\./.test(a)||s&&function(){var e=r.Bun.version.split(".");return e.length<3||"0"===e[0]&&(e[1]<3||"3"===e[1]&&"0"===e[2])}();e.exports=function(e,t){var i=t?2:1;return d?function(r,s){var a=u(arguments.length,1)>i,d=o(r)?r:l(r),h=a?c(arguments,i):[],p=a?function(){n(d,this,h)}:d;return t?e(p,s):e(p)}:e}},ccbe:function(e,t,i){"use strict";var r=i("8bdb"),n=i("f221"),o=Math.abs;r({target:"Number",stat:!0},{isSafeInteger:function(e){return n(e)&&o(e)<=9007199254740991}})},cf80:function(e,t,i){"use strict";var r=i("8bdb"),n=i("1aad");r({target:"Math",stat:!0},{trunc:n})},d0b1:function(e,t,i){"use strict";var r=i("8bdb"),n=i("bb80"),o=i("11bf"),s=i("1c06"),a=i("338c"),c=i("d6b1").f,u=i("80bb"),l=i("8449"),d=i("1ea2"),h=i("d7b4"),p=i("c238"),f=!1,m=h("meta"),v=0,g=function(e){c(e,m,{value:{objectID:"O"+v++,weakData:{}}})},y=e.exports={enable:function(){y.enable=function(){},f=!0;var e=u.f,t=n([].splice),i={};i[m]=1,e(i).length&&(u.f=function(i){for(var r=e(i),n=0,o=r.length;n<o;n++)if(r[n]===m){t(r,n,1);break}return r},r({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:l.f}))},fastKey:function(e,t){if(!s(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,m)){if(!d(e))return"F";if(!t)return"E";g(e)}return e[m].objectID},getWeakData:function(e,t){if(!a(e,m)){if(!d(e))return!0;if(!t)return!1;g(e)}return e[m].weakData},onFreeze:function(e){return p&&f&&d(e)&&!a(e,m)&&g(e),e}};o[m]=!0},d0e8:function(e,t,i){"use strict";i("6a54"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("64aa");var r=i("3436"),n={name:"ZegoRemoteView",props:{viewMode:{type:Number,default:r.ZegoViewMode.ScaleToFill},canvasType:{type:Number,default:0},streamID:{type:String,default:""}}};t.default=n},d154:function(e,t,i){"use strict";i("6a54");var r=i("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.MediaPlayer=void 0,i("bf0f"),i("4626"),i("5ef2");var n=r(i("2634")),o=r(i("2fdc")),s=r(i("80b1")),a=r(i("efe5")),c=i("ab3c"),u=function(){function e(t){(0,s.default)(this,e),this.duration=0,this.src="",this.startPosition=0,this.mixing=!1,this.arrts={mute:!1,loop:!1,volume:.3,playbackRate:1},this.index=t}return(0,a.default)(e,[{key:"setWebRtcInstance",value:function(e){this.zegoWebrtcInstance=e}},{key:"getIndex",value:function(){return this.index}},{key:"setPlayerCanvas",value:function(){var e=(0,o.default)((0,n.default)().mark((function e(t){return(0,n.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.viewElem=t;case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"loadResource",value:function(e){var t=this;if(this.src=e,e)return new Promise((function(i,r){var n,o;t.checkViewElem||r("you should be to use 'SetPlayerCanvas' first!");var s=(e.split("?")[0]||"").split("/")||"",a=(null===(n=s[s.length-1])||void 0===n?void 0:n.split(".")[1])||"";t.viewElem?o=t.viewElem:(o=["mp3","wav"].includes(a.toLowerCase())||-1!==e.indexOf("data:audio/wav;base64")?document.createElement("audio"):document.createElement("video"),o.style.position="fixed",o.style.top="-1000px",o.style.width="20px;",o.style.height="20px;"),o.src=e,o.load(),o.currentTime=t.startPosition,t.viewElem=o,o.addEventListener("loadeddata",(function(){t.duration=o.duration,i({errorcode:0})})),o.addEventListener("error",(function(e){r({errorcode:1})})),t.startPosition=0}))}},{key:"setPlayerView",value:function(e){var t=this;return new Promise((function(i){t.viewElem=document.querySelector("#zego_player_".concat(e," video")),t.viewElem&&(t.viewElem.src=t.src),i()}))}},{key:"enableRepeat",value:function(e){this.arrts.loop=e,this.viewElem&&(!1===e?this.viewElem.removeAttribute("loop"):this.viewElem.setAttribute("loop",""))}},{key:"enableAux",value:function(){var e=(0,o.default)((0,n.default)().mark((function e(t,i){var r,o,s,a,c;return(0,n.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r=this.zegoWebrtcInstance.channelData.get(0),o=r.get("streamID"),!t){e.next=17;break}if(!o){e.next=15;break}return s=this.viewElem.volume,this.setVolume(200*s),e.prev=6,e.next=9,null===(a=this.zegoWebrtcInstance)||void 0===a?void 0:a.zegoWebRTC.startMixingAudio(o,[this.viewElem]);case 9:this.mixing=!0,this.setVolume(200*s),e.next=15;break;case 13:e.prev=13,e.t0=e["catch"](6);case 15:e.next=22;break;case 17:if(!o){e.next=22;break}return e.next=20,null===(c=this.zegoWebrtcInstance)||void 0===c?void 0:c.zegoWebRTC.stopMixingAudio(o,[this.viewElem]);case 20:this.mixing=!1,this.resume();case 22:case"end":return e.stop()}}),e,this,[[6,13]])})));return function(t,i){return e.apply(this,arguments)}}()},{key:"setVolume",value:function(e){var t,i=this.zegoWebrtcInstance.channelData.get(0),r=i.get("streamID");(this.setElemVolume(e),r&&this.viewElem&&this.mixing)&&(null===(t=this.zegoWebrtcInstance)||void 0===t||t.zegoWebRTC.setMixingAudioVolume(r,e/2,this.viewElem))}},{key:"start",value:function(){if(this.checkViewElem()){var e=this.arrts,t=(e.mute,e.loop),i=e.volume,r=e.playbackRate;this.enableRepeat(t),this.viewElem.volume=i,this.viewElem.playbackRate=r,this.viewElem.currentTime=0,this.viewElem.play()}}},{key:"pause",value:function(){var e;this.checkViewElem()&&(null===(e=this.viewElem)||void 0===e||e.pause())}},{key:"stop",value:function(){this.checkViewElem()&&(this.pause(),this.viewElem.currentTime=0)}},{key:"resume",value:function(){this.checkViewElem()&&this.viewElem.play()}},{key:"setPlaySpeed",value:function(e){this.arrts.playbackRate=e}},{key:"checkViewElem",value:function(){return!!this.viewElem||(console.error("you should be to use 'SetPlayerCanvas' first!"),!1)}},{key:"destroy",value:function(){this.stop(),this.viewElem.src=""}},{key:"setElemVolume",value:function(e){this.arrts.volume=e/200,this.viewElem&&(this.viewElem.volume=e/200)}},{key:"getTotalDuration",value:function(){var e;return Math.floor((null===(e=this.viewElem)||void 0===e?void 0:e.duration)||this.duration)||0}},{key:"enableAccurateSeek",value:function(){(0,c.isNotSupported)("enableAccurateSeek")}},{key:"getAudioTrackCount",value:function(){(0,c.isNotSupported)("getAudioTrackCount")}},{key:"getCurrentProgress",value:function(){(0,c.isNotSupported)("getCurrentProgress")}},{key:"getCurrentState",value:function(){(0,c.isNotSupported)("getCurrentState")}},{key:"getNetworkResourceCache",value:function(){(0,c.isNotSupported)("getNetworkResourceCache")}},{key:"getPlayVolume",value:function(){(0,c.isNotSupported)("getPlayVolume")}},{key:"muteLocal",value:function(){(0,c.isNotSupported)("muteLocal")}},{key:"off",value:function(){(0,c.isNotSupported)("off")}},{key:"on",value:function(){(0,c.isNotSupported)("on")}},{key:"seekTo",value:function(){(0,c.isNotSupported)("seekTo")}},{key:"setAudioTrackIndex",value:function(){(0,c.isNotSupported)("setAudioTrackIndex")}},{key:"setNetworkBufferThreshold",value:function(){(0,c.isNotSupported)("setNetworkBufferThreshold")}},{key:"setNetworkResourceMaxCache",value:function(){(0,c.isNotSupported)("setNetworkResourceMaxCache")}},{key:"setProgressInterval",value:function(){(0,c.isNotSupported)("setProgressInterval")}},{key:"setPublishVolume",value:function(){(0,c.isNotSupported)("setPublishVolume")}},{key:"setPlayVolume",value:function(){(0,c.isNotSupported)("setPlayVolume")}},{key:"setVoiceChangerParam",value:function(){(0,c.isNotSupported)("setVoiceChangerParam")}},{key:"takeSnapshot",value:function(){(0,c.isNotSupported)("takeSnapshot")}}]),e}();t.MediaPlayer=u},d1aa:function(e,t,i){"use strict";i("d942")},d871c:function(e,t,i){"use strict";var r=i("bb80"),n=i("a74c"),o=i("d0b1").getWeakData,s=i("b720"),a=i("e7e3"),c=i("1eb8"),u=i("1c06"),l=i("5075"),d=i("4d16"),h=i("338c"),p=i("235c"),f=p.set,m=p.getterFor,v=d.find,g=d.findIndex,y=r([].splice),b=0,_=function(e){return e.frozen||(e.frozen=new S)},S=function(){this.entries=[]},T=function(e,t){return v(e.entries,(function(e){return e[0]===t}))};S.prototype={get:function(e){var t=T(this,e);if(t)return t[1]},has:function(e){return!!T(this,e)},set:function(e,t){var i=T(this,e);i?i[1]=t:this.entries.push([e,t])},delete:function(e){var t=g(this.entries,(function(t){return t[0]===e}));return~t&&y(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,i,r){var d=e((function(e,n){s(e,p),f(e,{type:t,id:b++,frozen:void 0}),c(n)||l(n,e[r],{that:e,AS_ENTRIES:i})})),p=d.prototype,v=m(t),g=function(e,t,i){var r=v(e),n=o(a(t),!0);return!0===n?_(r).set(t,i):n[r.id]=i,e};return n(p,{delete:function(e){var t=v(this);if(!u(e))return!1;var i=o(e);return!0===i?_(t)["delete"](e):i&&h(i,t.id)&&delete i[t.id]},has:function(e){var t=v(this);if(!u(e))return!1;var i=o(e);return!0===i?_(t).has(e):i&&h(i,t.id)}}),n(p,i?{get:function(e){var t=v(this);if(u(e)){var i=o(e);return!0===i?_(t).get(e):i?i[t.id]:void 0}},set:function(e,t){return g(this,e,t)}}:{add:function(e){return g(this,e,!0)}}),d}}},d942:function(e,t,i){"use strict";var r=i("7658"),n=i("d871c");r("WeakSet",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),n)},dbf1:function(e,t,i){e.exports=i.p+"static/yuyin-05.png"},dc8c:function(e,t,i){e.exports=i.p+"static/yuyin-02.png"},e062:function(e,t,i){"use strict";var r=i("8bdb");r({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})},e5e3:function(e,t,i){"use strict";i.r(t);var r=i("46f5"),n=i.n(r);for(var o in r)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(o);t["default"]=n.a},f3f7:function(e,t,i){"use strict";i("53f7")},f555:function(e,t,i){"use strict";var r=i("85c1"),n=i("ab4a"),o=i("e4ca"),s=i("471d"),a=i("af9e"),c=r.RegExp,u=c.prototype,l=n&&a((function(){var e=!0;try{c(".","d")}catch(l){e=!1}var t={},i="",r=e?"dgimsy":"gimsy",n=function(e,r){Object.defineProperty(t,e,{get:function(){return i+=r,!0}})},o={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var s in e&&(o.hasIndices="d"),o)n(s,o[s]);var a=Object.getOwnPropertyDescriptor(u,"flags").get.call(t);return a!==r||i!==r}));l&&o(u,"flags",{configurable:!0,get:s})},f771:function(e,t,i){"use strict";var r=i("8bdb"),n=Math.floor,o=Math.log,s=Math.LOG2E;r({target:"Math",stat:!0},{clz32:function(e){var t=e>>>0;return t?31-n(o(t+.5)*s):32}})},f9b2:function(e,t,i){"use strict";var r=i("3be4"),n=i.n(r);n.a},fe6b:function(e,t,i){"use strict";var r=i("8bdb"),n=i("2c57");r({target:"Number",stat:!0,forced:Number.parseInt!==n},{parseInt:n})}}]); |