sudmgp-sdk-js 0.1.10 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +6 -3
- package/type.d.ts +1 -0
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SudMGP=t():e.SudMGP=t()}(this,(()=>(()=>{var e={560:function(e,t,n){var o;!function(i){"use strict";function a(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function s(e,t,n,o,i,s){return a((r=a(a(t,e),a(o,s)))<<(d=i)|r>>>32-d,n);var r,d}function r(e,t,n,o,i,a,r){return s(t&n|~t&o,e,t,i,a,r)}function d(e,t,n,o,i,a,r){return s(t&o|n&~o,e,t,i,a,r)}function u(e,t,n,o,i,a,r){return s(t^n^o,e,t,i,a,r)}function c(e,t,n,o,i,a,r){return s(n^(t|~o),e,t,i,a,r)}function g(e,t){var n,o,i,s,g;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var l=1732584193,f=-271733879,A=-1732584194,p=271733878;for(n=0;n<e.length;n+=16)o=l,i=f,s=A,g=p,l=r(l,f,A,p,e[n],7,-680876936),p=r(p,l,f,A,e[n+1],12,-389564586),A=r(A,p,l,f,e[n+2],17,606105819),f=r(f,A,p,l,e[n+3],22,-1044525330),l=r(l,f,A,p,e[n+4],7,-176418897),p=r(p,l,f,A,e[n+5],12,1200080426),A=r(A,p,l,f,e[n+6],17,-1473231341),f=r(f,A,p,l,e[n+7],22,-45705983),l=r(l,f,A,p,e[n+8],7,1770035416),p=r(p,l,f,A,e[n+9],12,-1958414417),A=r(A,p,l,f,e[n+10],17,-42063),f=r(f,A,p,l,e[n+11],22,-1990404162),l=r(l,f,A,p,e[n+12],7,1804603682),p=r(p,l,f,A,e[n+13],12,-40341101),A=r(A,p,l,f,e[n+14],17,-1502002290),l=d(l,f=r(f,A,p,l,e[n+15],22,1236535329),A,p,e[n+1],5,-165796510),p=d(p,l,f,A,e[n+6],9,-1069501632),A=d(A,p,l,f,e[n+11],14,643717713),f=d(f,A,p,l,e[n],20,-373897302),l=d(l,f,A,p,e[n+5],5,-701558691),p=d(p,l,f,A,e[n+10],9,38016083),A=d(A,p,l,f,e[n+15],14,-660478335),f=d(f,A,p,l,e[n+4],20,-405537848),l=d(l,f,A,p,e[n+9],5,568446438),p=d(p,l,f,A,e[n+14],9,-1019803690),A=d(A,p,l,f,e[n+3],14,-187363961),f=d(f,A,p,l,e[n+8],20,1163531501),l=d(l,f,A,p,e[n+13],5,-1444681467),p=d(p,l,f,A,e[n+2],9,-51403784),A=d(A,p,l,f,e[n+7],14,1735328473),l=u(l,f=d(f,A,p,l,e[n+12],20,-1926607734),A,p,e[n+5],4,-378558),p=u(p,l,f,A,e[n+8],11,-2022574463),A=u(A,p,l,f,e[n+11],16,1839030562),f=u(f,A,p,l,e[n+14],23,-35309556),l=u(l,f,A,p,e[n+1],4,-1530992060),p=u(p,l,f,A,e[n+4],11,1272893353),A=u(A,p,l,f,e[n+7],16,-155497632),f=u(f,A,p,l,e[n+10],23,-1094730640),l=u(l,f,A,p,e[n+13],4,681279174),p=u(p,l,f,A,e[n],11,-358537222),A=u(A,p,l,f,e[n+3],16,-722521979),f=u(f,A,p,l,e[n+6],23,76029189),l=u(l,f,A,p,e[n+9],4,-640364487),p=u(p,l,f,A,e[n+12],11,-421815835),A=u(A,p,l,f,e[n+15],16,530742520),l=c(l,f=u(f,A,p,l,e[n+2],23,-995338651),A,p,e[n],6,-198630844),p=c(p,l,f,A,e[n+7],10,1126891415),A=c(A,p,l,f,e[n+14],15,-1416354905),f=c(f,A,p,l,e[n+5],21,-57434055),l=c(l,f,A,p,e[n+12],6,1700485571),p=c(p,l,f,A,e[n+3],10,-1894986606),A=c(A,p,l,f,e[n+10],15,-1051523),f=c(f,A,p,l,e[n+1],21,-2054922799),l=c(l,f,A,p,e[n+8],6,1873313359),p=c(p,l,f,A,e[n+15],10,-30611744),A=c(A,p,l,f,e[n+6],15,-1560198380),f=c(f,A,p,l,e[n+13],21,1309151649),l=c(l,f,A,p,e[n+4],6,-145523070),p=c(p,l,f,A,e[n+11],10,-1120210379),A=c(A,p,l,f,e[n+2],15,718787259),f=c(f,A,p,l,e[n+9],21,-343485551),l=a(l,o),f=a(f,i),A=a(A,s),p=a(p,g);return[l,f,A,p]}function l(e){var t,n="",o=32*e.length;for(t=0;t<o;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n}function f(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;var o=8*e.length;for(t=0;t<o;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function A(e){var t,n,o="0123456789abcdef",i="";for(n=0;n<e.length;n+=1)t=e.charCodeAt(n),i+=o.charAt(t>>>4&15)+o.charAt(15&t);return i}function p(e){return unescape(encodeURIComponent(e))}function m(e){return function(e){return l(g(f(e),8*e.length))}(p(e))}function h(e,t){return function(e,t){var n,o,i=f(e),a=[],s=[];for(a[15]=s[15]=void 0,i.length>16&&(i=g(i,8*e.length)),n=0;n<16;n+=1)a[n]=909522486^i[n],s[n]=1549556828^i[n];return o=g(a.concat(f(t)),512+8*t.length),l(g(s.concat(o),640))}(p(e),p(t))}function S(e,t,n){return t?n?h(t,e):A(h(t,e)):n?m(e):A(m(e))}void 0===(o=function(){return S}.call(t,n,t,e))||(e.exports=o)}()}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";n.r(o),n.d(o,{ISudAPPD:()=>G,SudMGP:()=>M});var e,t=function(){function e(){this._showLoadingGameBg=!0,this._showCustomLoading=!1}return e.prototype.getShowLoadingGameBg=function(){return this._showLoadingGameBg},e.prototype.setShowLoadingGameBg=function(e){this._showLoadingGameBg=e},e.prototype.getShowCustomLoading=function(){return this._showCustomLoading},e.prototype.setShowCustomLoading=function(e){this._showCustomLoading=e},e}(),i=function(){function e(){}return e.getCfg=function(){return e._impl},e._impl=new t,e}(),a=function(){function e(){this._curId=0}return e.prototype.genId=function(){return++this._curId},e}(),s=n(560),r=n.n(s),d=function(){return d=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},d.apply(this,arguments)},u=function(e){var t=e.url,n=e.method,o=e.data,i=e.params,a=e.success,s=e.fail,r=e.beforeSend,d=n.toLowerCase(),u=t,c=new XMLHttpRequest;if(c=new XMLHttpRequest){if(c){if(c.addHeader=function(e,t){c.setRequestHeader(e,t)},"get"===d&&i){var g=function(e){var t="",n=Object.keys(e).length,o=0;for(var i in e){t+=i+"="+e[i];var a=o<n-1?"&":"";console.log(a),t+=a,o++}return t}(i);u+="?"+g}c.open(d,u,!0),c.setRequestHeader("content-type","application/json"),r&&r(c),"post"===d&&o?c.send(JSON.stringify(o)):c.send(),c.onreadystatechange=function(){var e=null==c?void 0:c.responseText;4===c.readyState&&(200===c.status?a&&a(e):s&&s(e))}}}else console.error("浏览器不支持XMLHttpRequest")},c=new Uint8Array(16);function g(){if(!e&&!(e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(c)}const l=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,f=function(e){return"string"==typeof e&&l.test(e)};for(var A=[],p=0;p<256;++p)A.push((p+256).toString(16).substr(1));const m=function(e,t,n){var o=(e=e||{}).random||(e.rng||g)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=o[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(A[e[t+0]]+A[e[t+1]]+A[e[t+2]]+A[e[t+3]]+"-"+A[e[t+4]]+A[e[t+5]]+"-"+A[e[t+6]]+A[e[t+7]]+"-"+A[e[t+8]]+A[e[t+9]]+"-"+A[e[t+10]]+A[e[t+11]]+A[e[t+12]]+A[e[t+13]]+A[e[t+14]]+A[e[t+15]]).toLowerCase();if(!f(n))throw TypeError("Stringified UUID is invalid");return n}(o)};var h=function(){function e(){}return e.kVersion="0.0.0.0",e.kVersionAlias="0.0.0.0-h5",e}(),S=function(){function e(){}return e.getUserId=function(){return e.userId},e.setUserId=function(t){e.userId=t},e.userId="",e}(),y=function(){function e(){}return e.toJson=function(e,t){return JSON.stringify({retCode:e,retMsg:t})},e.kSuccessJson='{"retCode":0, "retMsg":"success"}',e.kFailNotImplementJson='{"retCode":-1, "retMsg":"not implement"}',e.kSuccess=0,e.kFail=-1,e.EngineNotSupported=-10100,e}(),v=function(){function e(){this.kTag="HttpService",this.isInitSdkOk=!1,this.getSDKTokenUrl="",this.getMGListUrl="",this.getMGInfoUrl="",this.sdkToken="",this.mgIdGameInfoMap=new Map}return e.prototype.getSDKToken=function(e,t,n,o){var i=this;this.getFQSInfo(e,n,1,{onSuccess:function(a){i.getSDKTokenUrl=a,i.getSDKTokenInternal(e,t,n,o)},onFailure:function(e,t){o.onFailure(e,t)}})},e.prototype.getMGList=function(e){if(this.isInitSdkOk)e&&e.onFailure(-1,"请先调用initSDK成功");else{var t={sdk_token:this.sdkToken,platform:I.getPlatform()};this.doSudPost(this.getMGListUrl,t,{onSuccess:function(t){var n=JSON.parse(t),o=n.ret_code,i=n.ret_msg,a=t;e&&a&&o&&i&&(y.kSuccess===o?e.onSuccess(a):e.onFailure(o,i))},onFailure:function(t){var n=y.kFail,o=t.toString();e.onFailure(n,o)}})}},e.prototype.getMGInfo=function(e,t){if(this.isInitSdkOk){var n=this.getCacheMGInfo(e),o=0;n||(o=n.clientVersion);var i={sdk_token:this.sdkToken,mg_id:Number(e),mg_id_str:e,client_version:o,platform:I.getPlatform()},a=this;this.doSudPost(this.getMGInfoUrl,i,{onSuccess:function(n){var o=JSON.parse(n),i=o.ret_code,s=o.ret_msg,r=o.data.mg_info,d={mgId:r.mg_id,name:I.getLocalizationData(r.name,I.getLanguage()),version:r.version,orientation:r.orientation,screenMode:r.screen_mode,url:r.url,h5url:r.h5url,appID:r.game_app_id,hash:r.hash,h5engine:r.h5engine,engine:r.engine,bigLoadingPic:I.getLocalizationData(r.big_loading_pic,I.getLanguage()),clientVersion:r.client_version,dynamic_config:r.dynamic_config};if(t)if(y.kSuccess===i)a.setCacheMGInfo(e,d),t.onSuccess(d);else{var u=a.getCacheMGInfo(e);u?t.onSuccess(u):t.onFailure(i,s)}},onFailure:function(n){var o=y.kFail,i=n.toString();if(t){var s=a.getCacheMGInfo(e);s?t.onSuccess(s):t.onFailure(o,i)}}})}else t&&t.onFailure(-1,"请先调用initSDK成功")},e.prototype.doSudPost=function(t,n,o){var i=r()(m());u(d({method:"post"},{data:n,url:t,beforeSend:function(t){t.addHeader(e.kHeaderSudMGPSDKVersion,h.kVersion),t.addHeader(e.kHeaderSudMGPSDKVersionAlias,h.kVersionAlias),t.addHeader(e.kHeaderSudMGPSDKPlatform,I.getPlatform()),t.addHeader(e.kHeaderSudMGPSDKAppId,I.getAppId()),t.addHeader(e.kHeaderSudMGPSDKBundleId,I.getBundleID()),t.addHeader(e.kHeaderSudMGPSDKTraceId,I.getTraceId()),t.addHeader(e.kHeaderSudMGPSDKRequestId,i),t.addHeader(e.kHeaderSudMGPSDKUserId,S.getUserId()),t.addHeader(e.kHeaderSudMGPSDKEtIsDynamic,!0)},success:function(e){console.log("success",e),o.onSuccess(e)},fail:function(e){console.log("fail",e),o.onFailure(e)}}))},e.prototype.doSudGet=function(t,n){var o=r()(m());u(d({method:"get"},{url:t,beforeSend:function(t){t.addHeader(e.kHeaderSudMGPSDKVersion,h.kVersion),t.addHeader(e.kHeaderSudMGPSDKVersionAlias,h.kVersionAlias),t.addHeader(e.kHeaderSudMGPSDKPlatform,I.getPlatform()),t.addHeader(e.kHeaderSudMGPSDKAppId,I.getAppId()),t.addHeader(e.kHeaderSudMGPSDKBundleId,I.getBundleID()),t.addHeader(e.kHeaderSudMGPSDKTraceId,I.getTraceId()),t.addHeader(e.kHeaderSudMGPSDKRequestId,o),t.addHeader(e.kHeaderSudMGPSDKUserId,S.getUserId()),t.addHeader(e.kHeaderSudMGPSDKEtIsDynamic,!0)},success:function(e){console.log("success",e),n.onSuccess(e)},fail:function(e){console.log("fail",e),n.onFailure(e)}}))},e.prototype.clearCache=function(){this.isInitSdkOk=!1,this.getSDKTokenUrl="",this.getMGListUrl="",this.getMGInfoUrl="",this.sdkToken="",this.mgIdGameInfoMap.clear()},e.prototype.getFQSInfo=function(e,t,n,o){if(this.getSDKTokenUrl.length>0)o.onSuccess(this.getSDKTokenUrl);else{I.genTraceId();var i=this.getFQSInfoBaseUrl(n)+r()(e);console.log(i);var a=this;this.doSudGet(i,{onSuccess:function(e){var t={ret_code:y.kSuccess,ret_msg:"success",url:JSON.parse(e).url};a.handleGetFQSInfoResp(t,t.url,o)},onFailure:function(e){var t={ret_code:y.kFail,ret_msg:e.toString()};a.handleGetFQSInfoResp(t,"",o)}})}},e.prototype.handleGetFQSInfoResp=function(e,t,n){if(void 0!==n)if(t.length>0)n.onSuccess(t);else{var o="getFQSInfo fail appId=".concat(I.getAppId()," isTestEnv=",I.getIsTestEnv().toString()," ret_code=",e.ret_code.toString()," null == getSDKTokenUrl || getSDKTokenUrl.isEmpty() ",e.ret_msg);n.onFailure(e.ret_code,o)}},e.prototype.getFQSInfoBaseUrl=function(t){var n=e.kGetFQSInfoProBaseUrl;return I.getEnvType()===I.kEnvTypeDev?n=e.kGetFQSInfoDevBaseUrl:I.getEnvType()===I.kEnvTypeFat?n=e.kGetFQSInfoFatBaseUrl:I.getEnvType()===I.kEnvTypeSim?n=e.kGetFQSInfoSimBaseUrl:I.getEnvType()===I.kEnvTypePro&&(1===t?n=e.kGetFQSInfoProBaseUrl:2===t&&(n=e.kGetFQSInfoProBaseUrl2)),n},e.prototype.getSDKTokenInternal=function(e,t,n,o){if(this.isInitSdkOk)o&&o.onSuccess();else{var i=this.getSDKTokenUrl,a={app_id:e,app_key:t,bundle_id:I.getBundleID(),platform:I.getPlatform(),is_test_env:n,sdk_version:h.kVersion};console.debug(a);var s=this;this.doSudPost(i,a,{onSuccess:function(e){var t=JSON.parse(e);s.handleInitSDKCb(t,o)},onFailure:function(e){var t={ret_code:y.kFail,ret_msg:e.toString()};s.handleInitSDKCb(t,o)}})}},e.prototype.handleInitSDKCb=function(e,t){if(t)if(0===e.ret_code)this.sdkToken=e.data.sdk_token,this.getMGListUrl=e.data.sdk_api_cfg.mg_list_url,this.getMGInfoUrl=e.data.sdk_api_cfg.mg_info_url,I.setGetSDKTokenResp(e),this.isInitSdkOk=!0,t.onSuccess();else{var n="getSDKToken fail appId=".concat(I.getAppId()," isTestEnv=",I.getIsTestEnv().toString()," ret_code=",e.ret_code.toString()," ",e.ret_msg);t.onFailure(e.ret_code,n)}},e.prototype.getCacheMGInfo=function(e){return this.mgIdGameInfoMap.get(e)||{}},e.prototype.setCacheMGInfo=function(e,t){this.mgIdGameInfoMap.set(e,t)},e.kGetFQSInfoDevBaseUrl="https://dev-fqs.sudden.ltd/",e.kGetFQSInfoFatBaseUrl="https://fat-fqs.sudden.ltd/",e.kGetFQSInfoSimBaseUrl="https://sim-fqs.sudden.ltd/",e.kGetFQSInfoProBaseUrl="https://fqs.sudden.ltd/",e.kGetFQSInfoProBaseUrl2="https://fqs.sudden.ltd/",e.kHeaderSudMGPSDKVersion="sud-sdk-version",e.kHeaderSudMGPSDKVersionAlias="sud-sdk-version-alias",e.kHeaderSudMGPSDKPlatform="sud-sdk-platform",e.kHeaderSudMGPSDKAppId="sud-sdk-app-id",e.kHeaderSudMGPSDKBundleId="sud-sdk-bundle-id",e.kHeaderSudMGPSDKRequestId="sud-sdk-request-id",e.kHeaderSudMGPSDKTraceId="sud-sdk-trace-id",e.kHeaderSudMGPSDKUserId="sud-sdk-user-id",e.kHeaderSudMGPSDKEtIsDynamic="sud-sdk-et-is-dynamic",e}(),G=function(){function e(){}return e.e=function(e){I.getEnvType()!==e&&I.clearCache(),I.setEnvType(e)},e}(),I=function(){function e(){}return e.initSDK=function(t,n,o,i,a){if(t&&0!==t.length&&n&&0!==n.length){var s=e.getEnvType(),r=e.getIsTestEnv();e.setIsTestEnv(i);var d=e.getEnvType();e.sAppId===t&&e.sAppKey===n&&s===d&&r===i||e.httpService.clearCache(),e.sAppId=t,e.sAppKey=n,e.sBundleId=o,e.sBundleId||(e.sBundleId=""),e.httpService.getSDKToken(t,n,i,a)}else a&&a.onFailure(1,"Parameters cannot be null or empty")},e.uninitSDK=function(t){e.httpService.clearCache(),t&&t.onSuccess()},e.clearCache=function(){e.httpService.clearCache()},e.getMGList=function(t){e.httpService.getMGList(t)},e.getMGInfo=function(t,n){e.httpService.getMGInfo(t,n)},e.getIsTestEnv=function(){return e.sIsTestEnv},e.setIsTestEnv=function(t){e.sIsTestEnv=t,(e.getEnvType()===e.kEnvTypePro||e.getEnvType()===e.kEnvTypeSim)&&(t?e.setEnvType(e.kEnvTypeSim):e.setEnvType(e.kEnvTypePro))},e.getEnvType=function(){return e.sEnvType},e.setEnvType=function(t){e.sEnvType=t},e.setLanguage=function(t){e.sLangCountryCode=t},e.getLanguage=function(){return e.sLangCountryCode},e.getAppId=function(){return e.sAppId},e.getPlatform=function(){return e.kPlatformH5},e.getBundleID=function(){return e.sBundleId},e.setGetSDKTokenResp=function(t){e.sGetSDKTokenResp=t},e.getSdkLocalizationCfg=function(){return e.sGetSDKTokenResp.data.sdk_localization_cfg},e.getMgApiCfg=function(){return e.sGetSDKTokenResp.data.mg_api_cfg},e.getMgApiCfgJson=function(){return JSON.stringify(e.sGetSDKTokenResp.data.mg_api_cfg)},e.getOnlyTestText=function(){return null!=this.sLangCountryCode&&"zh"===this.sLangCountryCode.substring(0,2)?"zh-CN"===this.sLangCountryCode?"仅供测试":"僅供測試":"Only Test"},e.genTraceId=function(){e.sTraceId=r()(m())},e.getTraceId=function(){return e.sTraceId},e.getLocalizationData=function(e,t){if(void 0===t&&(t="default"),!e.hasOwnProperty(t))return"";var n=e[t];return void 0!==n?n:""},e.httpService=new v,e.sIsTestEnv=!1,e.sLangCountryCode="zh-CN",e.kEnvTypePro=1,e.kEnvTypeSim=2,e.kEnvTypeFat=3,e.kEnvTypeDev=4,e.kPlatformIOS=1,e.kPlatformAndroid=2,e.kPlatformH5=3,e.sEnvType=e.kEnvTypePro,e.sAppId="",e.sAppKey="",e.sBundleId="",e.sTraceId="",e}(),k=function(){function e(){}return e.VERBOSE=2,e.DEBUG=3,e.INFO=4,e.WARN=5,e.ERROR=6,e.ASSERT=7,e}(),P=function(){function e(){this.kTag="SudMGP",this._logLevel=k.DEBUG}return e.prototype.setLogLevel=function(e){this._logLevel=e},e.prototype.log=function(e,t,n){for(var o=[],i=3;i<arguments.length;i++)o[i-3]=arguments[i];var a=this.kTag;k.VERBOSE===e&&this._logLevel<=k.VERBOSE?console.log(a+" "+t+" "+n,o):k.DEBUG===e&&this._logLevel<=k.DEBUG?console.debug(a+" "+t+" "+n,o):k.INFO===e&&this._logLevel<=k.INFO?console.info(a+" "+t+" "+n,o):k.WARN===e&&this._logLevel<=k.WARN?console.warn(a+" "+t+" "+n,o):k.ERROR===e&&this._logLevel<=k.ERROR?console.error(a+" "+t+" "+n,o):k.ASSERT===e&&this._logLevel<=k.ASSERT&&console.assert(a+" "+t,n,o)},e}(),C=function(){function e(){}return e.setLogLevel=function(t){e._impl.setLogLevel(t)},e.setLogger=function(t){null!=t&&(e._impl=t)},e.v=function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e._impl.log(k.VERBOSE,t,n,o)},e.d=function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e._impl.log(k.DEBUG,t,n,o)},e.i=function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e._impl.log(k.INFO,t,n,o)},e.w=function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e._impl.log(k.WARN,t,n,o)},e.e=function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e._impl.log(k.ERROR,t,n,o)},e._impl=new P,e}(),T=function(){function e(e,t,n,o,i){this.kTag="SudFSMMGStateHandlerImpl",this._fsmMG=e,this._userId=t,this._roomId=n,this._code=o,this._mgId=i,this._dynamicConfig="",this._GameCustomStateListener={onGameLoadStarted:function(){},onGameLoadCompleted:function(){},onGameStarted:function(){},onGameASR:function(){}},this._gameStateMap=new Map,this._playerStateMap=new Map,this._appStateMap=new Map}return e.prototype.putState=function(e,t){},e.prototype.getGameState=function(e){return""},e.prototype.getPlayerState=function(e,t){return""},e.prototype.setCode=function(e){},e.prototype.setParams=function(e,t,n,o,i){},e.prototype.setGameCustomStateListener=function(e){this._GameCustomStateListener=e},e.prototype.setDynamicConfig=function(e){this._dynamicConfig=e},e.prototype.handleCmd=function(e,t,n,o,i){null!=e?null!=t?"game"===e?"m2as-set-debug"===n?this.handleSetDebug(i,n,o):"m2as-mg-log"===n?this.handleMgLog(i,n,o):"m2as-get-net-status"===n?this.handleGetNetStatus(i,n,o):"m2as-get-game-view-info"===n?this.handleGetGameViewInfo(i,n,o):"m2as-get-game-cfg"===n?this.handleGetGameCfg(i,n,o):"m2as-vibrate"===n?this.handleVibrate(i,n,o):"m2as-get-sdk-info"===n?this.handleGetSDKInfo(i,n,o):"m2as-get-state"===n?this.handleGetState(i,n,o):"m2as-notify-game-load-started"===n?this.handleNotifyGameLoadStarted(i,n,o):"m2as-notify-game-load-completed"===n?this.handleNotifyGameLoadCompleted(i,n,o):"m2as-notify-game-started"===n?this.handleNotifyGameStarted(i,n,o):"m2as-expire-code"===n?this.handleExpireCode(i,n,o):"mg_common_game_asr"===n?this.handleGameASR(i,n,o):"m2as-login"===n?this.handleLogin(i,n,o):this.handleGameNotifyStateChange(i,n,o):"player"===e?this.handlePlayerNotifyStateChange(i,t,n,o):i.fail(y.toJson(y.kFail,"param invalid cmd is not game or player")):i.fail(y.toJson(y.kFail,"param invalid param is null")):i.fail(y.toJson(y.kFail,"param invalid cmd is null"))},e.prototype.handleSetDebug=function(e,t,n){C.d(this.kTag,"handleSetDebug {0} = {1}",t,n),e.success(y.kSuccessJson)},e.prototype.handleMgLog=function(e,t,n){var o;null===(o=this._fsmMG)||void 0===o||o.onGameLog(n),e.success(y.kSuccessJson)},e.prototype.handleGetNetStatus=function(e,t,n){C.d(this.kTag,"handleGetNetStatus {0} = {1}",t,n),e.success('{"retCode":0, "retMsg":"success", "net_type":1}')},e.prototype.handleGetGameViewInfo=function(e,t,n){var o;null===(o=this._fsmMG)||void 0===o||o.onGetGameViewInfo(e,n)},e.prototype.handleGetGameCfg=function(e,t,n){var o;null===(o=this._fsmMG)||void 0===o||o.onGetGameCfg(e,n)},e.prototype.handleVibrate=function(e,t,n){C.d(this.kTag,"handleGetNetStatus {0} = {1}",t,n),e.success(y.kSuccessJson)},e.prototype.handleGetSDKInfo=function(e,t,n){var o={ret_code:y.kSuccess,ret_msg:"success",env_type:I.getEnvType(),language:I.getLanguage(),wordLanguage:I.getLanguage(),sdk_version:h.kVersion,app_id:I.getAppId(),platform:I.getPlatform(),bundle_id:I.getBundleID(),sud_sdk_trace_id:I.genTraceId(),mg_id:Number(this._mgId),mg_id_str:this._mgId,mg_api_cfg:I.getMgApiCfgJson(),app_server_info_url:"",game_login_url:"",dynamic_config:this._dynamicConfig},i=I.getMgApiCfg();o.app_server_info_url=i.app_server_info_url,o.game_login_url=i.game_login_url,C.d(this.kTag,JSON.stringify(o)),e.success(JSON.stringify(o))},e.prototype.handleGetState=function(e,t,n){C.d(this.kTag,"handleGetState {0} = {1}",t,n),e.success("{}")},e.prototype.handleNotifyGameLoadStarted=function(e,t,n){var o;C.d(this.kTag,"onGameLoadStarted {0} = {1}",t,n),this._GameCustomStateListener.onGameLoadStarted(),null===(o=this._fsmMG)||void 0===o||o.onGameLoadingProgress(2,y.kSuccess,99),e.success(y.kSuccessJson)},e.prototype.handleNotifyGameLoadCompleted=function(e,t,n){C.d(this.kTag,"onGameLoadCompleted {0} = {1}",t,n),this._GameCustomStateListener.onGameLoadCompleted(),e.success(y.kSuccessJson)},e.prototype.handleNotifyGameStarted=function(e,t,n){var o,i;C.d(this.kTag,"onGameStarted {0} = {1}",t,n),this._GameCustomStateListener.onGameStarted(),(null===(o=this._fsmMG)||void 0===o?void 0:o.onGameStarted)&&(null===(i=this._fsmMG)||void 0===i||i.onGameStarted()),e.success(y.kSuccessJson)},e.prototype.handleLogin=function(e,t,n){C.d(this.kTag,"handleLogin {0} = {1}",t,n);var o={ret_code:y.kSuccess,ret_msg:"success",user_id:this._userId,room_id:this._roomId,mg_id:Number(this._mgId),mg_id_str:this._mgId,code:this._code,app_id:I.getAppId(),platform:I.getPlatform(),bundle_id:I.getBundleID(),sud_sdk_trace_id:I.genTraceId()};e.success(JSON.stringify(o))},e.prototype.handleExpireCode=function(e,t,n){var o,i;(null===(o=this._fsmMG)||void 0===o?void 0:o.onExpireCode)&&(null===(i=this._fsmMG)||void 0===i||i.onExpireCode(e,n))},e.prototype.handleGameASR=function(e,t,n){C.d(this.kTag,"onGameASR {0} = {1}",t,n),this._GameCustomStateListener.onGameASR(n)},e.prototype.handleGameNotifyStateChange=function(e,t,n){var o,i;(null===(o=this._fsmMG)||void 0===o?void 0:o.onGameStateChange)&&(null===(i=this._fsmMG)||void 0===i||i.onGameStateChange(e,t,n))},e.prototype.handlePlayerNotifyStateChange=function(e,t,n,o){var i,a;(null===(i=this._fsmMG)||void 0===i?void 0:i.onPlayerStateChange)&&(null===(a=this._fsmMG)||void 0===a||a.onPlayerStateChange(e,t,n,o))},e}(),L="SudMGP",D=function(){function e(){}return e.sendAppCustomCommandEvent=function(e,t,n,o){e.contentWindow&&e.contentWindow.postMessage({msgTag:L,msgType:11,ctxId:t,state:n,dataJson:o},"*")},e.sendGameCustomCommandCallback=function(e,t,n,o,i){e.contentWindow&&e.contentWindow.postMessage({msgTag:L,msgType:12,ctxId:t,isSuccess:n,state:o,dataJson:i},"*")},e}(),H=function(){function e(e,t,n){this._isCalled=!1,this._window=e,this._ctxId=t,this._state=n}return e.prototype.success=function(e){console.log("success",this._isCalled),this._isCalled||(D.sendGameCustomCommandCallback(this._window,this._ctxId,!0,this._state,e),this._isCalled=!0)},e.prototype.fail=function(e){this._isCalled||(D.sendGameCustomCommandCallback(this._window,this._ctxId,!1,this._state,e),this._isCalled=!0)},e}(),E=function(){function e(e,t,n,o,i,s,r){this._kTag="H5SudFSTAPPImpl",this._fstAppCtxId=t,this._userId=n,this._roomId=o,this._code=i,this._mgId=s,this._fsmMg=r,this._loadingFailed=!1,this._isCalledDestroyMG=!1,this._gameLayerView={},this._window=null,this._iframeUrl="",this._rootElm=e,this._gameCompeleted=!1,this._bigLoadingPicUrl="",this._ctxIdListenerNotifyStateChangeMap=new Map,this._idIDGenerator=new a,this._sudFSMMGStateHandler=function(e,t,n,o,i){return new T(e,t,n,o,i)}(r,n,o,i,s),this.initGameCustomStateListener(),this.loadGame(e)}return e.prototype.initGameCustomStateListener=function(){var e=this;this._sudFSMMGStateHandler.setGameCustomStateListener({onGameLoadStarted:function(){},onGameLoadCompleted:function(){e._loading(e._rootElm,3,y.kSuccess,100),I.getEnvType()===I.kEnvTypeSim&&e._createSimInfo(e._rootElm)},onGameStarted:function(){e._loadingFailed=!1},onGameASR:function(e){}})},e.prototype._createSimInfo=function(e){var t=document.createDocumentFragment(),n=document.createElement("div"),o=document.createElement("span"),i=document.createElement("img");i.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAL4AAAA9CAYAAAATUNPrAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAvqADAAQAAAABAAAAPQAAAADYD5vDAAAqeElEQVR4Ae2dCbhUxbWo+wzM86AiqBzFEUXBIaKggonRaBxv1OdAnJOY3KjJzVOTlyh6kxhjBqPXJE7EecBoMBpfPo3oNYIi4IA4IKiIgiLIPHOG+/9FV7tP031Od58+iO+lvq96T1Wr1lSrVq2qvbsiVcb0pz/9qX1tbW235cuX9+7atevAbt267dSuXbt+nTt37rHlllt27NGjR6p79+51HTp0qK+oqKim6cqGhoba9evX169Zs6YduW41iXvz161b90FdXd0bq1atmsFxSVVV1bJ99913fRnR/Reo/485UFEI7Xfcccd2KOouKPGzKOQe1NmG63pSg/Wrq6tTKPzWXA/r2LHjUJR+p169eqVQ9lTPnj1TnTp1KqSZTJm1a9emzLSVQvFX0yFeozNMoc3nOb5GR5i2++67r8tU+NdJURy48cYbu2GM9oOX7ZXjVlttVYlRad+2bdsAB/6qF5XFAMUwBV1IHz2vB04DelGHYVtHXo8s1y1ZsmQ195fT9tKFCxcuPvLII9cW0065ymp1m00o/DAI+AGKeCyM+ib5OCp1hlHtICDU15r3798/1bdv31SXLl1Sbdq0aRZuvgK0lzKb6EwdYNS+tL3v0qVLv8Vo8kllZeX0N95441HwuGfXXXedlw9Ovvt33313D/BrB00B+SFDhnQDZhA09zztEK+TMBBqPXSupm699+mcDQsWLFjWv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BHEhYmPv1wVByL5E/Dr5evI4mLSMmHkGCSY+FezVrxs5cuSnpqIEBHmNbU9g+WHV4+joXVzPMMYv3Zui46sEri2YpRvL/CEd+loU4naOvsyfSdJM5/QNqw37CDJP8p+wkvsscIYlLb4rrZ9FQmHt3A3IdgV65kslE+HxWGh9gQXOBXT6nHQl6UYX1IFq/l3dP5pucrKbUZZCiEUR+sGo4yn7ZY7+k0mNltBlfldfC13uLqQtyzjcKXyF7mQOBXDH4asI90GiTvcWuPW30ObyliPqdQhCOAPGHogB2MUtBi7H2xHc7lDORBuBZq2dVg9/XtftZdp4gjyGies75WoPxX8Ouoaq+EbyMBTxK8PlaqIRnLQ862lvHXJdhYKvgM6lKPVCrudB+3RkOwmap+b7+6BGAFtwUZTiJ9uhE+wMortCzJ4wbSj7XAahBNu59dSlePf3lNIR7PkquoKHIas5OqRPpq1JtPUyc43pSTw25TkdYDsUfwiC249294fmIdDaS3rt/NJcyhxIxZNeXRppJ89BKSarBLQzhTanEr3YELQvI8H333//MBSuN3xtcBsFb3+1hY5K8UknP81RsI6AZyYEmDhX0Q2210FjLXSto0P7N0UruV5B20uYQ/l/ADktekSk3MeCiWqqYd6n7UyoqQvDTncUfyDHAbhAfVH83ljFTihIJXk919UwRNcIPQ7//uG/dujHVcCI1VoAGDQfZryH0s/gfDZwlhNZWdZSt6Up/Et55h84MDR3pW5faNyVEW97lL4Pk6tu8KATnaAKQ1ABL/xMnh9zkmYVScWqt4OT16LsK6Hbf0WZB70zuTeD60/Y1LaUvNHW6lJw/VedjTnwPylTiR6yTo9wAAAAAElFTkSuQmCC",i.setAttribute("style","width: 40px;height: 12.842px"),o.innerHTML=I.getOnlyTestText(),o.setAttribute("style","font-size: 12px;color: #fff;margin-left: 4px;"),n.append(i),n.append(o),n.setAttribute("style","position: absolute;bottom: 0;right: 0"),t.append(n),e.append(t)},e.prototype.loadGame=function(e){e.style.setProperty("position","relative"),e.innerHTML="",this._loading(e,1,y.kSuccess,10);var t=this;I.getMGInfo(this._mgId,{onSuccess:function(n){if(t._loading(e,1,y.kSuccess,20),1===n.h5engine){if(!n.h5url)return C.w(t._kTag,"gameInfo no h5url",""),void t._loading(e,2,y.kFail,20);t._iframeUrl="".concat(n.h5url,"?fstAppCtxId=").concat(t._fstAppCtxId),t._bigLoadingPicUrl=n.bigLoadingPic,t._initIframe(e),t._sudFSMMGStateHandler.setDynamicConfig(JSON.stringify(n.dynamic_config))}else t._loading(e,1,y.kFail,20,(function(e){var t=document.createElement("div");t.setAttribute("style","\n position: absolute;\n top: 42%;\n left: 50%;\n color: #000;\n width: 200px;\n height: 30px;\n line-height: 30px;\n text-align: center;\n transform: translateX(-50%);\n background-color: #fff;\n border-radius: 4px;\n "),t.innerHTML="Please upgrade",e.append(t)}))},onFailure:function(n,o){t._loading(e,2,y.kFail,20)}})},e.prototype._loading=function(e,t,n,o,a){this._loadingFailed=n===y.kFail,i.getCfg().getShowCustomLoading()?this.fsmMgOnGameLoadingProgress(t,n,o):this._createDefaultLoading(e,n,o,a)},e.prototype.fsmMgOnGameLoadingProgress=function(e,t,n){this._fsmMg.onGameLoadingProgress&&this._fsmMg.onGameLoadingProgress(e,t,n)},e.prototype._createDefaultLoading=function(e,t,n,o){var a,s="".concat(this._kTag,"_wrap_parent_loading"),r="".concat(this._kTag,"_wrap_loading"),d="".concat(this._kTag,"_loading"),u="".concat(this._kTag,"_loading_text"),c="".concat(this._kTag,"_bgloading"),g=I.getLocalizationData(I.getSdkLocalizationCfg().load_tip_loading,I.getLanguage()),l=document.getElementById(s);if(l){var f=document.getElementById(d),A=document.getElementById(u),p=document.getElementById(r);if(o&&o(l),t===y.kFail){if(A){var m=I.getLocalizationData(I.getSdkLocalizationCfg().load_tip_fail,I.getLanguage());A.style.color="#ff1a1a",A&&(A.innerHTML="".concat(m," (").concat(n,"%)").concat(y.kFail))}return void(p&&this._createReloadButton(p))}if(100===n)return void(null===(a=l.parentNode)||void 0===a||a.removeChild(l));if(i.getCfg().getShowLoadingGameBg()&&this._bigLoadingPicUrl&&!document.getElementById(c)){var h=document.createElement("img");h.id=c,h.src=this._bigLoadingPicUrl,h.setAttribute("style","\n width: 100%;\n height: 100%;\n object-fit: cover;\n z-index: 1;\n "),l.append(h)}f&&(f.style.left=-(100-n)+"%"),A&&(A.innerHTML="".concat(g,"(").concat(n,"%)"))}else{if(100===n)return;var S=document.createDocumentFragment();l=document.createElement("div");var v=document.createElement("div"),G=document.createElement("img"),k=document.createElement("img"),P=(A=document.createElement("div"),document.createElement("div"));v.id=r,G.id=d,l.id=s,l.setAttribute("style","\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n -webkit-transform:translateZ(1px);\n -moz-transform:translateZ(1px);\n -o-transform:translateZ(1px);\n transform:translateZ(1px);\n "),v.setAttribute("style","\n z-index: 100000;\n position: absolute;\n top: 50%; \n left: 50%;\n transform: translate(-50%, -50%);\n width: 270px;\n height: 56px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n "),P.setAttribute("style","\n z-index: 100001;\n position: absolute;\n height: 22px;\n top: 50%; \n transform: translateY(-50%);\n left: 17px;\n right: 17px;\n border-radius: 26px;\n overflow: hidden;\n "),P.append(G),k.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAwwAAAC0CAMAAAAO0FvMAAAC/VBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzMzOjn34AAAAAAAAAAABLSELTzIeemna1spoAAADKw4Li26+bl3EAAADWzYjg15WcmXTZ0YlhX0hiX0kbGhkAAAABAQDWz4jYz4mdmXMZGRfg2ZYaGhkAAADa0YsAAAAAAADi3K3KwYIAAACblXGdl3MAAADe15UAAAAaGRgZGRjb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Uazj3XtzqCwfm8oAaBo4BjgbOAXeDpPD/ehZorOschLodcB3oIEEmCKrKjc090zpZLJyxCSuDZ/IsCz4WSe0Ea7twN8YlV4wAOOQ+IE9FaTotzdZ0CgRxQwi0FWljN+UYagkEcNA78rJQesA+XgSAKsnCusrdsjQiBEkhBLySdC52FUg1cB3LAOtBDgggRaYIunKtpzYggHBCCJIBCWEgKsiAKhRj0t72rhuTAfYgXUxOh1s5VRAJkgPBDSwlJgbOgc0EUyjAoaUgOXIfmgSBIIlmEDOdq+ohIgAwIAe1yFXQsdBaIoXwbxCHnQR4IIkw4N6gXOiAEbEKTkMeCLFQOgzj0HqAhIgd6AAiICBJEES6cK+8dbckA4XGUEtDUIoVeQjmG1JAc5OEiYkcR6t25gra3BYPDFQJqq5ASxsyCNPQcUHKI0kN0aO2cK+/Q2kerCA6ijSj0EmhhMAftw4Yg0ErtnStulUGBHOSl0FkQhWIMqtNADgkCIpwb2Gtr1iZEPQVhqK3nIBASgWb16lxxswIDOZAEUegsDNcgDgKBZudGtWGTJNDCeAzS0HsQCDbJRJ+duH+3edTE/nQgCGM1yINAqMm5McmAJIy30Hcfg0CYhBvZXQakUIChaB1kwv20TwcnAINAAAQV0n/NgTyUIII+Yg6dqWGXL12tvPaE+kPrgjXCjFBucAQR5IcZ4P8ZXj84g6XqABFGKDJEk8aYgf2lCY5gVymKDKP23cAOzNj/BGfQd17/ZqDj8BkAAAAAAAAAAIDD3bPYHKSsGOBgAAAAAElFTkSuQmCC",k.setAttribute("style","z-index: 1;width: 100%; height: 56px; position: absolute;top: 0;left: 0;bottom: 0;right: 0"),A.setAttribute("style","z-index: 100002;font-family: PingFangSC-Medium, PingFang SC;\n width: 100%; font-size: 14px; height: 34px;line-height: 34px; position: absolute;top: 50%; left: 50%; transform: translate(-50%, -50%);text-align: center;color: #fff;"),A.innerHTML="".concat(g,"(").concat(n,"%)"),A.id=u,G.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqMAAABACAMAAAAZD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5/mpzCeHqOIUQ3je/+8TXPMe11v3PNt/9cbbcRwgWLMgAAAABJRU5ErkJggg==",G.setAttribute("style","position: absolute;top: 50%; transform: translateY(-50%); left: -".concat(100-n,"%;border-radius: 26px;")),G.style.width="100%",S.append(A),S.append(k),S.append(P),v.append(S),l.append(v),e.append(l)}},e.prototype._createReloadButton=function(e){var t=this,n=document.createElement("button");n.setAttribute("style","\n cursor: pointer;\n border: 2px solid #000;\n font-family: PingFangSC-Medium, PingFang SC;\n background-color: #fff;\n border-radius: 36px;\n z-index: 100002;\n width: 104px;\n height: 36px;\n color: #1A1A1A;\n position: absolute;\n bottom: -60px;\n left: 50%;\n transform: translateX(-50%);\n touch-action: manipulation;\n outline: none;\n -webkit-tap-highlight-color:rgba(0,0,0,0);\n ");var o=I.getLocalizationData(I.getSdkLocalizationCfg().load_reload,I.getLanguage());n.onclick=function(){t.loadGame(t._rootElm)},n.innerHTML=o,e.append(n)},e.prototype._initIframe=function(e){var t=this;if(this._loading(e,1,y.kSuccess,20),e&&e instanceof HTMLElement){var n=document.createElement("iframe");n.src=this._iframeUrl,n.width="100%",n.height="100%",n.setAttribute("referrerpolicy","origin-when-cross-origin"),n.onerror=function(){i._loading(e,2,y.kFail,99)};var o=20,i=this,a=setInterval((function(){var t=Math.floor(5*(Math.random()+1));(o+=t)>=90&&(o=99,clearTimeout(a)),i._loading(e,2,y.kSuccess,o)}),100),s=setTimeout((function(){clearTimeout(s),e.appendChild(n),t._window=n}),1500)}else C.w(this._kTag,"不存在挂载元素,请传入挂载元素","")},e.prototype._getFstAppCtxId=function(){return this._fstAppCtxId},e.prototype._onGameCustomCommand=function(e,t,n,o,i){if(this._window){var a=new H(this._window,e,o);this._sudFSMMGStateHandler.handleCmd(t,n,o,i,a)}else C.w(this._kTag,"H5SudFSTAPPImpl游戏iframe对象不存在","")},e.prototype._onAppCustomCommandEventCallback=function(e,t,n){var o=this._ctxIdListenerNotifyStateChangeMap.get(e);null!=o&&(o.onSuccess(n),this._ctxIdListenerNotifyStateChangeMap.delete(e))},e.prototype.getGameView=function(){return this._gameLayerView},e.prototype.destroyMG=function(){return this.notifyStateChange("a2ms-notify-destroy-game","{}",{onSuccess:function(e){},onFailure:function(e,t){}}),!0},e.prototype.updateCode=function(e,t){this.notifyStateChange("a2ms-update-code",JSON.stringify({code:e}),{onSuccess:function(e){},onFailure:function(e,t){}})},e.prototype.notifyStateChange=function(e,t,n){var o=this._idIDGenerator.genId();this._ctxIdListenerNotifyStateChangeMap.set(o,n),this._window&&D.sendAppCustomCommandEvent(this._window,o,e,t)},e.prototype.reloadMG=function(){i.getCfg().getShowCustomLoading()&&!0===this._loadingFailed&&this.loadGame(this._rootElm)},e}(),z=function(){function e(){}return e.create=function(e,t,n,o,i,a,s){return function(e,t,n,o,i,a,s){return new E(e,t,n,o,i,a,s)}(e,t,n,o,i,a,s)},e}(),M=function(){function e(){}return e._registerCustomCommandEvent=function(){var e=this;window.onmessage&&e.appSelfOnMeessage.push(window.onmessage),window.onmessage=function(t){if(null!=t&&null!=t.data){var n=t.data;e.broadcastWindowOnMessage(n)}else e.appSelfOnMeessage&&e.appSelfOnMeessage.length&&e.appSelfOnMeessage.map((function(e){return e(t)}))}},e.getVersion=function(){return h.kVersion},e.getVersionAlias=function(){return h.kVersionAlias},e.getSudCfg=function(){return i.getCfg()},e.initSDK=function(e,t,n,o,i){I.initSDK(e,t,n,o,i)},e.uninitSDK=function(e){I.uninitSDK(e)},e.getMGList=function(e){I.getMGList(e)},e.loadMG=function(e,t,n,o,i,a,s){if(null==e||null==t||null==n||null==o||null==a)return C.w(this.kTag,"Parameters cannot be null"),null;if(""===e||""===t||""===n||""===o)return C.w(this.kTag,"Parameters cannot be empty string"),null;S.setUserId(e),I.setLanguage(i);var r=this._idIDGenerator.genId().toString(),d=z.create(s,r,e,t,n,o,a);return this._ctxIdFSTAPPMap.set(r,d),this._registerCustomCommandEvent(),d},e.destroyMG=function(e){if(null==e)return C.w(this.kTag,"destroyMG fstApp is invalid"),!1;var t=e._getFstAppCtxId();return this._ctxIdFSTAPPMap.delete(t),e.destroyMG(),!0},e.prototype.setUserId=function(e){S.setUserId(e)},e.setLogLevel=function(e){C.setLogLevel(e)},e.setLogger=function(e){C.setLogger(e)},e.broadcastWindowOnMessage=function(e){if(e.msgTag===L){var t=e.fstAppCtxId,n=this._ctxIdFSTAPPMap.get(t);null!=n?1===e.msgType?n._onGameCustomCommand(e.ctxId,e.cmd,e.param,e.state,e.dataJson):2===e.msgType&&n._onAppCustomCommandEventCallback(e.ctxId,e.state,e.dataJson):C.e(this.kTag,"No fstAPP")}else this.appSelfOnMeessage&&this.appSelfOnMeessage.length&&this.appSelfOnMeessage.map((function(t){return t(e)}))},e.kTag="SudMGP",e._idIDGenerator=new a,e._ctxIdFSTAPPMap=new Map,e.appSelfOnMeessage=[],e}();window.SudMGP=M})(),o})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SudMGP=t():e.SudMGP=t()}(this,(()=>(()=>{var e={560:function(e,t,i){var n;!function(r){"use strict";function s(e,t){var i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}function o(e,t,i,n,r,o){return s((a=s(s(t,e),s(n,o)))<<(c=r)|a>>>32-c,i);var a,c}function a(e,t,i,n,r,s,a){return o(t&i|~t&n,e,t,r,s,a)}function c(e,t,i,n,r,s,a){return o(t&n|i&~n,e,t,r,s,a)}function p(e,t,i,n,r,s,a){return o(t^i^n,e,t,r,s,a)}function u(e,t,i,n,r,s,a){return o(i^(t|~n),e,t,r,s,a)}function h(e,t){var i,n,r,o,h;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var d=1732584193,l=-271733879,v=-1732584194,g=271733878;for(i=0;i<e.length;i+=16)n=d,r=l,o=v,h=g,d=a(d,l,v,g,e[i],7,-680876936),g=a(g,d,l,v,e[i+1],12,-389564586),v=a(v,g,d,l,e[i+2],17,606105819),l=a(l,v,g,d,e[i+3],22,-1044525330),d=a(d,l,v,g,e[i+4],7,-176418897),g=a(g,d,l,v,e[i+5],12,1200080426),v=a(v,g,d,l,e[i+6],17,-1473231341),l=a(l,v,g,d,e[i+7],22,-45705983),d=a(d,l,v,g,e[i+8],7,1770035416),g=a(g,d,l,v,e[i+9],12,-1958414417),v=a(v,g,d,l,e[i+10],17,-42063),l=a(l,v,g,d,e[i+11],22,-1990404162),d=a(d,l,v,g,e[i+12],7,1804603682),g=a(g,d,l,v,e[i+13],12,-40341101),v=a(v,g,d,l,e[i+14],17,-1502002290),d=c(d,l=a(l,v,g,d,e[i+15],22,1236535329),v,g,e[i+1],5,-165796510),g=c(g,d,l,v,e[i+6],9,-1069501632),v=c(v,g,d,l,e[i+11],14,643717713),l=c(l,v,g,d,e[i],20,-373897302),d=c(d,l,v,g,e[i+5],5,-701558691),g=c(g,d,l,v,e[i+10],9,38016083),v=c(v,g,d,l,e[i+15],14,-660478335),l=c(l,v,g,d,e[i+4],20,-405537848),d=c(d,l,v,g,e[i+9],5,568446438),g=c(g,d,l,v,e[i+14],9,-1019803690),v=c(v,g,d,l,e[i+3],14,-187363961),l=c(l,v,g,d,e[i+8],20,1163531501),d=c(d,l,v,g,e[i+13],5,-1444681467),g=c(g,d,l,v,e[i+2],9,-51403784),v=c(v,g,d,l,e[i+7],14,1735328473),d=p(d,l=c(l,v,g,d,e[i+12],20,-1926607734),v,g,e[i+5],4,-378558),g=p(g,d,l,v,e[i+8],11,-2022574463),v=p(v,g,d,l,e[i+11],16,1839030562),l=p(l,v,g,d,e[i+14],23,-35309556),d=p(d,l,v,g,e[i+1],4,-1530992060),g=p(g,d,l,v,e[i+4],11,1272893353),v=p(v,g,d,l,e[i+7],16,-155497632),l=p(l,v,g,d,e[i+10],23,-1094730640),d=p(d,l,v,g,e[i+13],4,681279174),g=p(g,d,l,v,e[i],11,-358537222),v=p(v,g,d,l,e[i+3],16,-722521979),l=p(l,v,g,d,e[i+6],23,76029189),d=p(d,l,v,g,e[i+9],4,-640364487),g=p(g,d,l,v,e[i+12],11,-421815835),v=p(v,g,d,l,e[i+15],16,530742520),d=u(d,l=p(l,v,g,d,e[i+2],23,-995338651),v,g,e[i],6,-198630844),g=u(g,d,l,v,e[i+7],10,1126891415),v=u(v,g,d,l,e[i+14],15,-1416354905),l=u(l,v,g,d,e[i+5],21,-57434055),d=u(d,l,v,g,e[i+12],6,1700485571),g=u(g,d,l,v,e[i+3],10,-1894986606),v=u(v,g,d,l,e[i+10],15,-1051523),l=u(l,v,g,d,e[i+1],21,-2054922799),d=u(d,l,v,g,e[i+8],6,1873313359),g=u(g,d,l,v,e[i+15],10,-30611744),v=u(v,g,d,l,e[i+6],15,-1560198380),l=u(l,v,g,d,e[i+13],21,1309151649),d=u(d,l,v,g,e[i+4],6,-145523070),g=u(g,d,l,v,e[i+11],10,-1120210379),v=u(v,g,d,l,e[i+2],15,718787259),l=u(l,v,g,d,e[i+9],21,-343485551),d=s(d,n),l=s(l,r),v=s(v,o),g=s(g,h);return[d,l,v,g]}function d(e){var t,i="",n=32*e.length;for(t=0;t<n;t+=8)i+=String.fromCharCode(e[t>>5]>>>t%32&255);return i}function l(e){var t,i=[];for(i[(e.length>>2)-1]=void 0,t=0;t<i.length;t+=1)i[t]=0;var n=8*e.length;for(t=0;t<n;t+=8)i[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return i}function v(e){var t,i,n="0123456789abcdef",r="";for(i=0;i<e.length;i+=1)t=e.charCodeAt(i),r+=n.charAt(t>>>4&15)+n.charAt(15&t);return r}function g(e){return unescape(encodeURIComponent(e))}function f(e){return function(e){return d(h(l(e),8*e.length))}(g(e))}function m(e,t){return function(e,t){var i,n,r=l(e),s=[],o=[];for(s[15]=o[15]=void 0,r.length>16&&(r=h(r,8*e.length)),i=0;i<16;i+=1)s[i]=909522486^r[i],o[i]=1549556828^r[i];return n=h(s.concat(l(t)),512+8*t.length),d(h(o.concat(n),640))}(g(e),g(t))}function _(e,t,i){return t?i?m(t,e):v(m(t,e)):i?f(e):v(f(e))}void 0===(n=function(){return _}.call(t,i,t,e))||(e.exports=n)}()},339:()=>{},108:()=>{},275:()=>{},505:()=>{},146:()=>{},173:()=>{},137:()=>{},592:()=>{}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,i),s.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";i.r(n),i.d(n,{ISudAPPD:()=>I,SudMGP:()=>yn});var e,t=function(){function e(){this._showLoadingGameBg=!0,this._showCustomLoading=!1}return e.prototype.getShowLoadingGameBg=function(){return this._showLoadingGameBg},e.prototype.setShowLoadingGameBg=function(e){this._showLoadingGameBg=e},e.prototype.getShowCustomLoading=function(){return this._showCustomLoading},e.prototype.setShowCustomLoading=function(e){this._showCustomLoading=e},e}(),r=function(){function e(){}return e.getCfg=function(){return e._impl},e._impl=new t,e}(),s=function(){function e(){this._curId=0}return e.prototype.genId=function(){return++this._curId},e}(),o=function(){function e(){}return e.VERBOSE=2,e.DEBUG=3,e.INFO=4,e.WARN=5,e.ERROR=6,e.ASSERT=7,e}(),a=function(e,t,i){if(i||2===arguments.length)for(var n,r=0,s=t.length;r<s;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))},c=function(){function e(){this.kTag="SudMGP",this._logLevel=o.DEBUG}return e.prototype.setLogLevel=function(e){this._logLevel=e},e.prototype.log=function(e,t,i){for(var n=[],r=3;r<arguments.length;r++)n[r-3]=arguments[r];var s=this.kTag;o.VERBOSE===e&&this._logLevel<=o.VERBOSE||o.DEBUG===e&&this._logLevel<=o.DEBUG?console.log.apply(console,a([s+" "+t+" "+i],n,!1)):o.INFO===e&&this._logLevel<=o.INFO?console.info(s+" "+t+" "+i,n):o.WARN===e&&this._logLevel<=o.WARN?console.warn(s+" "+t+" "+i,n):o.ERROR===e&&this._logLevel<=o.ERROR?console.error(s+" "+t+" "+i,n):o.ASSERT===e&&this._logLevel<=o.ASSERT&&console.assert(s+" "+t,i,n)},e}(),p=function(){function e(){}return e.setLogLevel=function(t){e._impl.setLogLevel(t)},e.setLogger=function(t){null!=t&&(e._impl=t)},e.v=function(t,i){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];e._impl.log(o.VERBOSE,t,i,n)},e.d=function(t,i){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];e._impl.log(o.DEBUG,t,i,n)},e.i=function(t,i){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];e._impl.log(o.INFO,t,i,n)},e.w=function(t,i){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];e._impl.log(o.WARN,t,i,n)},e.e=function(t,i){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];e._impl.log(o.ERROR,t,i,n)},e._impl=new c,e}(),u=i(560),h=i.n(u),d=function(){return d=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},d.apply(this,arguments)},l=function(e){var t=e.url,i=e.method,n=e.data,r=e.params,s=e.success,o=e.fail,a=e.beforeSend,c=i.toLowerCase(),p=t,u=new XMLHttpRequest;if(u=new XMLHttpRequest){if(u){if(u.addHeader=function(e,t){u.setRequestHeader(e,t)},"get"===c&&r){var h=function(e){var t="",i=Object.keys(e).length,n=0;for(var r in e)t+=r+"="+e[r],t+=n<i-1?"&":"",n++;return t}(r);p+="?"+h}u.open(c,p,!0),u.setRequestHeader("content-type","application/json"),a&&a(u),"post"===c&&n?u.send(JSON.stringify(n)):u.send(),u.onreadystatechange=function(){var e=null==u?void 0:u.responseText;4===u.readyState&&(200===u.status?s&&s(e):o&&o(e))}}}else console.error("浏览器不支持XMLHttpRequest")},v=new Uint8Array(16);function g(){if(!e&&!(e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(v)}const f=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,m=function(e){return"string"==typeof e&&f.test(e)};for(var _=[],S=0;S<256;++S)_.push((S+256).toString(16).substr(1));const y=function(e,t,i){var n=(e=e||{}).random||(e.rng||g)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(var r=0;r<16;++r)t[i+r]=n[r];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(_[e[t+0]]+_[e[t+1]]+_[e[t+2]]+_[e[t+3]]+"-"+_[e[t+4]]+_[e[t+5]]+"-"+_[e[t+6]]+_[e[t+7]]+"-"+_[e[t+8]]+_[e[t+9]]+"-"+_[e[t+10]]+_[e[t+11]]+_[e[t+12]]+_[e[t+13]]+_[e[t+14]]+_[e[t+15]]).toLowerCase();if(!m(i))throw TypeError("Stringified UUID is invalid");return i}(n)};var A=function(){function e(){}return e.kVersion="1.0.1",e.kVersionAlias="0.0.0.0-h5",e}(),C=function(){function e(){}return e.getUserId=function(){return e.userId},e.setUserId=function(t){e.userId=t},e.userId="",e}(),w=function(){function e(){}return e.toJson=function(e,t){return JSON.stringify({retCode:e,retMsg:t})},e.kSuccessJson='{"retCode":0, "retMsg":"success"}',e.kFailNotImplementJson='{"retCode":-1, "retMsg":"not implement"}',e.kSuccess=0,e.kFail=-1,e.EngineNotSupported=-10100,e}(),b=function(){function e(){this.kTag="HttpService",this.isInitSdkOk=!1,this.getSDKTokenUrl="",this.getMGListUrl="",this.getMGInfoUrl="",this.sdkToken="",this.mgIdGameInfoMap=new Map}return e.prototype.getFQSInfoSize=function(){var t=R.getEnvType();return t===R.kEnvTypeDev?e.kGetFQSInfoDevBaseUrls.length:t===R.kEnvTypeFat?e.kGetFQSInfoFatBaseUrls.length:t===R.kEnvTypeSim?e.kGetFQSInfoSimBaseUrls.length:e.kGetFQSInfoProBaseUrls.length},e.prototype.getSDKToken=function(e,t,i,n){var r=this.getFQSInfoSize();this.getSDKTokenStepGetFQSInfo(e,t,i,n,1,r)},e.prototype.getSDKTokenStepGetFQSInfo=function(e,t,i,n,r,s){var o=this;this.getFQSInfo(e,i,r,{onSuccess:function(r){o.getSDKTokenUrl=r,o.getSDKTokenInternal(e,t,i,n)},onFailure:function(a,c){console.log("[ fqsInfo ] >"),s>0&&r<s?o.getSDKTokenStepGetFQSInfo(e,t,i,n,r+1,s):n.onFailure(a,c)}})},e.prototype.getMGList=function(e){if(this.isInitSdkOk){var t={sdk_token:this.sdkToken,platform:R.getPlatform()};this.doSudPost(this.getMGListUrl,t,{onSuccess:function(t){var i=JSON.parse(t),n=i.ret_code,r=i.ret_msg,s=t;e&&s&&n&&r&&(w.kSuccess===n?e.onSuccess(s):e.onFailure(n,r))},onFailure:function(t){var i=w.kFail,n=t.toString();e.onFailure(i,n)}})}else e&&e.onFailure(-1,"请先调用initSDK成功")},e.prototype.getMGInfo=function(e,t){if(this.isInitSdkOk){var i=this.getCacheMGInfo(e),n=0;i||(n=i.clientVersion);var r={sdk_token:this.sdkToken,mg_id:Number(e),mg_id_str:e,client_version:n,platform:R.getPlatform()},s=this;this.doSudPost(this.getMGInfoUrl,r,{onSuccess:function(i){var n=JSON.parse(i),r=n.ret_code,o=n.ret_msg,a=n.data.mg_info,c={mgId:a.mg_id,name:R.getLocalizationData(a.name,R.getLanguage()),version:a.version,orientation:a.orientation,screenMode:a.screen_mode,url:a.url,h5url:a.h5url,appID:a.game_app_id,hash:a.hash,h5engine:a.h5engine,engine:a.engine,bigLoadingPic:R.getLocalizationData(a.big_loading_pic,R.getLanguage()),clientVersion:a.client_version,dynamic_config:a.dynamic_config};if(t)if(w.kSuccess===r)s.setCacheMGInfo(e,c),t.onSuccess(c);else{var p=s.getCacheMGInfo(e);p?t.onSuccess(p):t.onFailure(r,o)}},onFailure:function(i){var n=w.kFail,r=i.toString();if(t){var o=s.getCacheMGInfo(e);o?t.onSuccess(o):t.onFailure(n,r)}}})}else t&&t.onFailure(-1,"请先调用initSDK成功")},e.prototype.doSudPost=function(t,i,n){var r=h()(y());l(d({method:"post"},{data:i,url:t,beforeSend:function(t){t.addHeader(e.kHeaderSudMGPSDKVersion,A.kVersion),t.addHeader(e.kHeaderSudMGPSDKVersionAlias,A.kVersionAlias),t.addHeader(e.kHeaderSudMGPSDKPlatform,R.getPlatform()),t.addHeader(e.kHeaderSudMGPSDKAppId,R.getAppId()),t.addHeader(e.kHeaderSudMGPSDKBundleId,R.getBundleID()),t.addHeader(e.kHeaderSudMGPSDKTraceId,R.getTraceId()),t.addHeader(e.kHeaderSudMGPSDKRequestId,r),t.addHeader(e.kHeaderSudMGPSDKUserId,C.getUserId()),t.addHeader(e.kHeaderSudMGPSDKEtIsDynamic,!0)},success:function(e){console.log("success",e),n.onSuccess(e)},fail:function(e){console.log("fail",e),n.onFailure(e)}}))},e.prototype.doSudGet=function(t,i){var n=h()(y());l(d({method:"get"},{url:t,beforeSend:function(t){t.addHeader(e.kHeaderSudMGPSDKVersion,A.kVersion),t.addHeader(e.kHeaderSudMGPSDKVersionAlias,A.kVersionAlias),t.addHeader(e.kHeaderSudMGPSDKPlatform,R.getPlatform()),t.addHeader(e.kHeaderSudMGPSDKAppId,R.getAppId()),t.addHeader(e.kHeaderSudMGPSDKBundleId,R.getBundleID()),t.addHeader(e.kHeaderSudMGPSDKTraceId,R.getTraceId()),t.addHeader(e.kHeaderSudMGPSDKRequestId,n),t.addHeader(e.kHeaderSudMGPSDKUserId,C.getUserId()),t.addHeader(e.kHeaderSudMGPSDKEtIsDynamic,!0)},success:function(e){console.log("success",e),i.onSuccess(e)},fail:function(e){console.log("fail",e),i.onFailure(e)}}))},e.prototype.clearCache=function(){this.isInitSdkOk=!1,this.getSDKTokenUrl="",this.getMGListUrl="",this.getMGInfoUrl="",this.sdkToken="",this.mgIdGameInfoMap.clear()},e.prototype.getFQSInfoBaseUrl=function(t){var i=R.getEnvType();return i===R.kEnvTypeDev?this.getFQSInfoBaseUrlByArray(e.kGetFQSInfoDevBaseUrls,t):i===R.kEnvTypeFat?this.getFQSInfoBaseUrlByArray(e.kGetFQSInfoFatBaseUrls,t):i===R.kEnvTypeSim?this.getFQSInfoBaseUrlByArray(e.kGetFQSInfoSimBaseUrls,t):this.getFQSInfoBaseUrlByArray(e.kGetFQSInfoProBaseUrls,t)},e.prototype.getFQSInfoBaseUrlByArray=function(e,t){if(null==e||0===e.length)return null;var i=0;return t>0&&(i=t-1),i<e.length?e[i]:null},e.prototype.getFQSInfo=function(e,t,i,n){if(this.getSDKTokenUrl.length>0)n.onSuccess(this.getSDKTokenUrl);else{R.genTraceId();var r=this.getFQSInfoBaseUrl(i)+h()(e),s=this;this.doSudGet(r,{onSuccess:function(e){var t={ret_code:w.kSuccess,ret_msg:"success",url:JSON.parse(e).url};s.handleGetFQSInfoResp(t,t.url,n)},onFailure:function(e){var t={ret_code:w.kFail,ret_msg:e.toString()};s.handleGetFQSInfoResp(t,"",n)}})}},e.prototype.handleGetFQSInfoResp=function(e,t,i){if(void 0!==i)if(t.length>0)i.onSuccess(t);else{var n="getFQSInfo fail appId=".concat(R.getAppId()," isTestEnv=",R.getIsTestEnv().toString()," ret_code=",e.ret_code.toString()," null == getSDKTokenUrl || getSDKTokenUrl.isEmpty() ",e.ret_msg);i.onFailure(e.ret_code,n)}},e.prototype.getSDKTokenInternal=function(e,t,i,n){if(this.isInitSdkOk)n&&n.onSuccess();else{var r=this.getSDKTokenUrl,s={app_id:e,app_key:t,bundle_id:R.getBundleID(),platform:R.getPlatform(),is_test_env:i,sdk_version:A.kVersion};console.debug(s);var o=this;this.doSudPost(r,s,{onSuccess:function(e){var t=JSON.parse(e);o.handleInitSDKCb(t,n)},onFailure:function(e){var t={ret_code:w.kFail,ret_msg:e.toString()};o.handleInitSDKCb(t,n)}})}},e.prototype.handleInitSDKCb=function(e,t){if(t)if(0===e.ret_code)this.sdkToken=e.data.sdk_token,this.getMGListUrl=e.data.sdk_api_cfg.mg_list_url,this.getMGInfoUrl=e.data.sdk_api_cfg.mg_info_url,R.setGetSDKTokenResp(e),this.isInitSdkOk=!0,t.onSuccess();else{var i="getSDKToken fail appId=".concat(R.getAppId()," isTestEnv=",R.getIsTestEnv().toString()," ret_code=",e.ret_code.toString()," ",e.ret_msg);t.onFailure(e.ret_code,i)}},e.prototype.getCacheMGInfo=function(e){return this.mgIdGameInfoMap.get(e)||{}},e.prototype.setCacheMGInfo=function(e,t){this.mgIdGameInfoMap.set(e,t)},e.kGetFQSInfoDevBaseUrls=["https://dev-fqs.sudden.ltd/","https://dev-fqs.sud.ltd/"],e.kGetFQSInfoFatBaseUrls=["https://fat-fqs.sudden.ltd/","https://fat-fqs.sud.ltd/"],e.kGetFQSInfoSimBaseUrls=["https://sim-fqs.sudden.ltd/","https://sim-fqs.sud.ltd/"],e.kGetFQSInfoProBaseUrls=["https://fqs.sudden.ltd/","https://fqs.sud.ltd/"],e.kHeaderSudMGPSDKVersion="sud-sdk-version",e.kHeaderSudMGPSDKVersionAlias="sud-sdk-version-alias",e.kHeaderSudMGPSDKPlatform="sud-sdk-platform",e.kHeaderSudMGPSDKAppId="sud-sdk-app-id",e.kHeaderSudMGPSDKBundleId="sud-sdk-bundle-id",e.kHeaderSudMGPSDKRequestId="sud-sdk-request-id",e.kHeaderSudMGPSDKTraceId="sud-sdk-trace-id",e.kHeaderSudMGPSDKUserId="sud-sdk-user-id",e.kHeaderSudMGPSDKEtIsDynamic="sud-sdk-et-is-dynamic",e}(),I=function(){function e(){}return e.e=function(e){R.getEnvType()!==e&&R.clearCache(),R.setEnvType(e)},e}(),R=function(){function e(){}return e.initSDK=function(t,i,n,r,s){if(t&&0!==t.length&&i&&0!==i.length){var o=e.getEnvType(),a=e.getIsTestEnv();e.setIsTestEnv(r);var c=e.getEnvType();e.sAppId===t&&e.sAppKey===i&&o===c&&a===r||e.httpService.clearCache(),e.sAppId=t,e.sAppKey=i,e.sBundleId=n,e.sBundleId||(e.sBundleId=""),e.httpService.getSDKToken(t,i,r,s)}else s&&s.onFailure(1,"Parameters cannot be null or empty")},e.uninitSDK=function(t){e.httpService.clearCache(),t&&t.onSuccess()},e.clearCache=function(){e.httpService.clearCache()},e.getMGList=function(t){e.httpService.getMGList(t)},e.getMGInfo=function(t,i){e.httpService.getMGInfo(t,i)},e.getIsTestEnv=function(){return e.sIsTestEnv},e.setIsTestEnv=function(t){e.sIsTestEnv=t,(e.getEnvType()===e.kEnvTypePro||e.getEnvType()===e.kEnvTypeSim)&&(t?e.setEnvType(e.kEnvTypeSim):e.setEnvType(e.kEnvTypePro))},e.getEnvType=function(){return e.sEnvType},e.setEnvType=function(t){e.sEnvType=t},e.setLanguage=function(t){e.sLangCountryCode=t},e.getLanguage=function(){return e.sLangCountryCode},e.getAppId=function(){return e.sAppId},e.getPlatform=function(){return e.kPlatformH5},e.getBundleID=function(){return e.sBundleId},e.setGetSDKTokenResp=function(t){e.sGetSDKTokenResp=t},e.getSdkLocalizationCfg=function(){return e.sGetSDKTokenResp.data.sdk_localization_cfg},e.getMgApiCfg=function(){return e.sGetSDKTokenResp.data.mg_api_cfg},e.getMgApiCfgJson=function(){return JSON.stringify(e.sGetSDKTokenResp.data.mg_api_cfg)},e.getOnlyTestText=function(){return null!=this.sLangCountryCode&&"zh"===this.sLangCountryCode.substring(0,2)?"zh-CN"===this.sLangCountryCode?"仅供测试":"僅供測試":"Only Test"},e.genTraceId=function(){e.sTraceId=h()(y())},e.getTraceId=function(){return e.sTraceId},e.getLocalizationData=function(e,t){if(void 0===t&&(t="default"),!e.hasOwnProperty(t))return"";var i=e[t];return void 0!==i?i:""},e.getAsrLoadList=function(){return null!=this.sGetSDKTokenResp&&null!=this.sGetSDKTokenResp.data&&null!=this.sGetSDKTokenResp.data.sdk_rtss_cfg&&null!=this.sGetSDKTokenResp.data.sdk_rtss_cfg.asr_load_list?this.sGetSDKTokenResp.data.sdk_rtss_cfg.asr_load_list:[]},e.getAzureASRTextLanguageList=function(){var e=this.sGetSDKTokenResp;return null!=e&&null!=e.data&&null!=e.data.sdk_rtss_cfg&&null!=e.data.sdk_rtss_cfg.microsoft_rtss_cfg?e.data.sdk_rtss_cfg.microsoft_rtss_cfg.asr_text_language_list:["zh-CN"]},e.getAzureASRNumberLanguageList=function(){var e=this.sGetSDKTokenResp;return null!=e&&null!=e.data&&null!=e.data.sdk_rtss_cfg&&null!=e.data.sdk_rtss_cfg.microsoft_rtss_cfg?e.data.sdk_rtss_cfg.microsoft_rtss_cfg.asr_number_language_list:["zh-CN"]},e.getSdkRtssCfg=function(){var e=this.sGetSDKTokenResp;return null!=e&&null!=e.data?e.data.sdk_rtss_cfg:null},e.httpService=new b,e.sIsTestEnv=!1,e.sLangCountryCode="zh-CN",e.kEnvTypePro=1,e.kEnvTypeSim=2,e.kEnvTypeFat=3,e.kEnvTypeDev=4,e.kPlatformIOS=1,e.kPlatformAndroid=2,e.kPlatformH5=3,e.sEnvType=e.kEnvTypePro,e.sAppId="",e.sAppKey="",e.sBundleId="",e.sTraceId="",e}(),k=function(){function e(e,t,i,n,r,s){this.isHit=e,this.keyWord=t,this.text=i,this.wordType=n,this.keyWordList=r,this.numberList=s}return e.prototype.toJson=function(){return JSON.stringify({isHit:this.isHit,keyWord:this.keyWord,text:this.text,wordType:this.wordType,keyWordList:this.keyWordList,numberList:this.numberList})},e.getState=function(){return"app_common_self_text_hit"},e}(),E=function(){return E=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},E.apply(this,arguments)},P=function(){function e(e,t){this.WORD_TYPE_TEXT="text",this.WORD_TYPE_NUMBER="number",this.mgCommonGameASR={WORD_TYPE_TEXT:this.WORD_TYPE_TEXT,WORD_TYPE_NUMBER:this.WORD_TYPE_NUMBER,isOpen:!1,wordList:[],wordLanguage:"",wordType:this.WORD_TYPE_TEXT,isCloseConnHitted:!0,enableIsHit:!0,enableIsReturnText:!0},this.hitKeywordSet=new Set,this.paramModel=e,this.context=t}return e.prototype.startASR=function(e){this.hitKeywordSet.clear(),this.context&&this.context.startASR(e)},e.prototype.stopASR=function(){this.hitKeywordSet.clear(),this.context&&this.context.stopASR()},e.prototype.handleGameASR=function(t){var i;if(p.d(e._TAG,"handleGameASR:",t),!t)return this.mgCommonGameASR=null,void this.stopASR();var n=JSON.parse(t);if(t)if(this.mgCommonGameASR=E(E({},this.mgCommonGameASR),n),null===(i=this.mgCommonGameASR)||void 0===i?void 0:i.isOpen){if(!this.isSupportWordType(n.wordType))return;if(n.wordType===this.WORD_TYPE_TEXT&&!this.isValidLanguage(this.paramModel.supportTextLanguageList,n.wordLanguage))return;if(n.wordType===this.WORD_TYPE_NUMBER&&!this.isValidLanguage(this.paramModel.supportNumberLanguageList,n.wordLanguage))return;this.startASR(n.wordLanguage)}else this.stopASR();else this.stopASR()},e.prototype.isSupportWordType=function(e){return this.WORD_TYPE_TEXT===e||this.WORD_TYPE_NUMBER===e},e.prototype.isValidLanguage=function(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(n&&n===t)return!0}return!1},e.prototype.onRecognizedResult=function(e){if(e){var t=this.mgCommonGameASR;null!==t&&t.isOpen&&(t.wordType===this.WORD_TYPE_TEXT?(t.enableIsHit&&this.textMatch(e,t),t.enableIsReturnText&&this.notifyAppCommonSelfTextHit(!1,null,e,t.wordType,null,null)):t.wordType===this.WORD_TYPE_NUMBER&&(t.enableIsHit&&this.numberMatch(e,t),t.enableIsReturnText&&this.numberConver(e,t)))}},e.prototype.numberConver=function(e,t){var i=e.match(/[0-9]+/g),n=null==i?void 0:i.map(Number);n&&(null==n?void 0:n.length)&&this.notifyAppCommonSelfTextHit(!1,null,null,t.wordType,null,n)},e.prototype.textMatch=function(e,t){var i=this;if(null!==t.wordList&&0!==t.wordList.length&&null!=e){var n=e.toLowerCase();t.wordList.map((function(e){if(null!==e&&n.includes(e.toLowerCase())){i.hitKeywordSet.add(e);var r=[e];i.notifyAppCommonSelfTextHit(!0,e,null,t.wordType,r,null)}}));for(var r=!0,s=0;s<t.wordList.length;s++){var o=t.wordList[s];if(!this.hitKeywordSet.has(o)){r=!1;break}}r&&this.stopASR()}},e.prototype.numberMatch=function(e,t){var i=this;if(null!==t.wordList&&0!==t.wordList.length&&null!=e){t.wordList.map((function(n){if(null!==n&&e.includes(n)){i.hitKeywordSet.add(n);var r=[n],s=[parseInt(n)];i.notifyAppCommonSelfTextHit(!0,n,null,t.wordType,r,s)}}));for(var n=!0,r=0;r<t.wordList.length;r++){var s=t.wordList[r];if(!this.hitKeywordSet.has(s)){n=!1;break}}n&&this.stopASR()}},e.prototype.notifyAppCommonSelfTextHit=function(t,i,n,r,s,o){var a=new k(t,i,n,r,s,o),c=this.paramModel.iSudFSTAPP;null!==c&&(c.notifyStateChange(k.getState(),a.toJson(),{onSuccess:function(){},onFailure:function(){}}),p.d(e._TAG,"notifyAppCommonSelfTextHit: ",a.toJson()))},e._TAG="BaseRealSudASRImpl",e}();const T="OutputFormat",D="CancellationErrorCode",M="ServiceProperties",O="ForceDictation";class L{static throwIfNullOrUndefined(e,t){if(null==e)throw new Error("throwIfNullOrUndefined:"+t)}static throwIfNull(e,t){if(null===e)throw new Error("throwIfNull:"+t)}static throwIfNullOrWhitespace(e,t){if(L.throwIfNullOrUndefined(e,t),(""+e).trim().length<1)throw new Error("throwIfNullOrWhitespace:"+t)}static throwIfNullOrTooLong(e,t,i){if(L.throwIfNullOrUndefined(e,t),(""+e).length>i)throw new Error("throwIfNullOrTooLong:"+t+" (more than "+i.toString()+" characters)")}static throwIfNullOrTooShort(e,t,i){if(L.throwIfNullOrUndefined(e,t),(""+e).length<i)throw new Error("throwIfNullOrTooShort:"+t+" (less than "+i.toString()+" characters)")}static throwIfDisposed(e){if(e)throw new Error("the object is already disposed")}static throwIfArrayEmptyOrWhitespace(e,t){if(L.throwIfNullOrUndefined(e,t),0===e.length)throw new Error("throwIfArrayEmptyOrWhitespace:"+t);for(const i of e)L.throwIfNullOrWhitespace(i,t)}static throwIfFileDoesNotExist(e,t){L.throwIfNullOrWhitespace(e,t)}static throwIfNotUndefined(e,t){if(void 0!==e)throw new Error("throwIfNotUndefined:"+t)}}var x,z,B,N,G,F,H,U;!function(e){e[e.SpeechServiceConnection_Key=0]="SpeechServiceConnection_Key",e[e.SpeechServiceConnection_Endpoint=1]="SpeechServiceConnection_Endpoint",e[e.SpeechServiceConnection_Region=2]="SpeechServiceConnection_Region",e[e.SpeechServiceAuthorization_Token=3]="SpeechServiceAuthorization_Token",e[e.SpeechServiceAuthorization_Type=4]="SpeechServiceAuthorization_Type",e[e.SpeechServiceConnection_EndpointId=5]="SpeechServiceConnection_EndpointId",e[e.SpeechServiceConnection_TranslationToLanguages=6]="SpeechServiceConnection_TranslationToLanguages",e[e.SpeechServiceConnection_TranslationVoice=7]="SpeechServiceConnection_TranslationVoice",e[e.SpeechServiceConnection_TranslationFeatures=8]="SpeechServiceConnection_TranslationFeatures",e[e.SpeechServiceConnection_IntentRegion=9]="SpeechServiceConnection_IntentRegion",e[e.SpeechServiceConnection_ProxyHostName=10]="SpeechServiceConnection_ProxyHostName",e[e.SpeechServiceConnection_ProxyPort=11]="SpeechServiceConnection_ProxyPort",e[e.SpeechServiceConnection_ProxyUserName=12]="SpeechServiceConnection_ProxyUserName",e[e.SpeechServiceConnection_ProxyPassword=13]="SpeechServiceConnection_ProxyPassword",e[e.SpeechServiceConnection_RecoMode=14]="SpeechServiceConnection_RecoMode",e[e.SpeechServiceConnection_RecoLanguage=15]="SpeechServiceConnection_RecoLanguage",e[e.Speech_SessionId=16]="Speech_SessionId",e[e.SpeechServiceConnection_SynthLanguage=17]="SpeechServiceConnection_SynthLanguage",e[e.SpeechServiceConnection_SynthVoice=18]="SpeechServiceConnection_SynthVoice",e[e.SpeechServiceConnection_SynthOutputFormat=19]="SpeechServiceConnection_SynthOutputFormat",e[e.SpeechServiceConnection_AutoDetectSourceLanguages=20]="SpeechServiceConnection_AutoDetectSourceLanguages",e[e.SpeechServiceResponse_RequestDetailedResultTrueFalse=21]="SpeechServiceResponse_RequestDetailedResultTrueFalse",e[e.SpeechServiceResponse_RequestProfanityFilterTrueFalse=22]="SpeechServiceResponse_RequestProfanityFilterTrueFalse",e[e.SpeechServiceResponse_JsonResult=23]="SpeechServiceResponse_JsonResult",e[e.SpeechServiceResponse_JsonErrorDetails=24]="SpeechServiceResponse_JsonErrorDetails",e[e.CancellationDetails_Reason=25]="CancellationDetails_Reason",e[e.CancellationDetails_ReasonText=26]="CancellationDetails_ReasonText",e[e.CancellationDetails_ReasonDetailedText=27]="CancellationDetails_ReasonDetailedText",e[e.LanguageUnderstandingServiceResponse_JsonResult=28]="LanguageUnderstandingServiceResponse_JsonResult",e[e.SpeechServiceConnection_Url=29]="SpeechServiceConnection_Url",e[e.SpeechServiceConnection_InitialSilenceTimeoutMs=30]="SpeechServiceConnection_InitialSilenceTimeoutMs",e[e.SpeechServiceConnection_EndSilenceTimeoutMs=31]="SpeechServiceConnection_EndSilenceTimeoutMs",e[e.Speech_SegmentationSilenceTimeoutMs=32]="Speech_SegmentationSilenceTimeoutMs",e[e.SpeechServiceConnection_EnableAudioLogging=33]="SpeechServiceConnection_EnableAudioLogging",e[e.SpeechServiceConnection_LanguageIdMode=34]="SpeechServiceConnection_LanguageIdMode",e[e.SpeechServiceConnection_RecognitionEndpointVersion=35]="SpeechServiceConnection_RecognitionEndpointVersion",e[e.SpeechServiceConnection_SpeakerIdMode=36]="SpeechServiceConnection_SpeakerIdMode",e[e.SpeechServiceResponse_ProfanityOption=37]="SpeechServiceResponse_ProfanityOption",e[e.SpeechServiceResponse_PostProcessingOption=38]="SpeechServiceResponse_PostProcessingOption",e[e.SpeechServiceResponse_RequestWordLevelTimestamps=39]="SpeechServiceResponse_RequestWordLevelTimestamps",e[e.SpeechServiceResponse_StablePartialResultThreshold=40]="SpeechServiceResponse_StablePartialResultThreshold",e[e.SpeechServiceResponse_OutputFormatOption=41]="SpeechServiceResponse_OutputFormatOption",e[e.SpeechServiceResponse_TranslationRequestStablePartialResult=42]="SpeechServiceResponse_TranslationRequestStablePartialResult",e[e.SpeechServiceResponse_RequestWordBoundary=43]="SpeechServiceResponse_RequestWordBoundary",e[e.SpeechServiceResponse_RequestPunctuationBoundary=44]="SpeechServiceResponse_RequestPunctuationBoundary",e[e.SpeechServiceResponse_RequestSentenceBoundary=45]="SpeechServiceResponse_RequestSentenceBoundary",e[e.Conversation_ApplicationId=46]="Conversation_ApplicationId",e[e.Conversation_DialogType=47]="Conversation_DialogType",e[e.Conversation_Initial_Silence_Timeout=48]="Conversation_Initial_Silence_Timeout",e[e.Conversation_From_Id=49]="Conversation_From_Id",e[e.Conversation_Conversation_Id=50]="Conversation_Conversation_Id",e[e.Conversation_Custom_Voice_Deployment_Ids=51]="Conversation_Custom_Voice_Deployment_Ids",e[e.Conversation_Speech_Activity_Template=52]="Conversation_Speech_Activity_Template",e[e.Conversation_Request_Bot_Status_Messages=53]="Conversation_Request_Bot_Status_Messages",e[e.Conversation_Agent_Connection_Id=54]="Conversation_Agent_Connection_Id",e[e.SpeechServiceConnection_Host=55]="SpeechServiceConnection_Host",e[e.ConversationTranslator_Host=56]="ConversationTranslator_Host",e[e.ConversationTranslator_Name=57]="ConversationTranslator_Name",e[e.ConversationTranslator_CorrelationId=58]="ConversationTranslator_CorrelationId",e[e.ConversationTranslator_Token=59]="ConversationTranslator_Token",e[e.PronunciationAssessment_ReferenceText=60]="PronunciationAssessment_ReferenceText",e[e.PronunciationAssessment_GradingSystem=61]="PronunciationAssessment_GradingSystem",e[e.PronunciationAssessment_Granularity=62]="PronunciationAssessment_Granularity",e[e.PronunciationAssessment_EnableMiscue=63]="PronunciationAssessment_EnableMiscue",e[e.PronunciationAssessment_Json=64]="PronunciationAssessment_Json",e[e.PronunciationAssessment_Params=65]="PronunciationAssessment_Params",e[e.SpeakerRecognition_Api_Version=66]="SpeakerRecognition_Api_Version"}(x||(x={}));class K{constructor(){this.privKeys=[],this.privValues=[]}getProperty(e,t){let i;i="string"==typeof e?e:x[e];for(let e=0;e<this.privKeys.length;e++)if(this.privKeys[e]===i)return this.privValues[e];if(void 0!==t)return String(t)}setProperty(e,t){let i;i="string"==typeof e?e:x[e];for(let e=0;e<this.privKeys.length;e++)if(this.privKeys[e]===i)return void(this.privValues[e]=t);this.privKeys.push(i),this.privValues.push(t)}clone(){const e=new K;for(let t=0;t<this.privKeys.length;t++)e.privKeys.push(this.privKeys[t]),e.privValues.push(this.privValues[t]);return e}mergeTo(e){this.privKeys.forEach((t=>{if(void 0===e.getProperty(t,void 0)){const i=this.getProperty(t);e.setProperty(t,i)}}))}get keys(){return this.privKeys}}!function(e){e[e.Simple=0]="Simple",e[e.Detailed=1]="Detailed"}(z||(z={})),function(e){e[e.Masked=0]="Masked",e[e.Removed=1]="Removed",e[e.Raw=2]="Raw"}(B||(B={})),function(e){e[e.Raw8Khz8BitMonoMULaw=0]="Raw8Khz8BitMonoMULaw",e[e.Riff16Khz16KbpsMonoSiren=1]="Riff16Khz16KbpsMonoSiren",e[e.Audio16Khz16KbpsMonoSiren=2]="Audio16Khz16KbpsMonoSiren",e[e.Audio16Khz32KBitRateMonoMp3=3]="Audio16Khz32KBitRateMonoMp3",e[e.Audio16Khz128KBitRateMonoMp3=4]="Audio16Khz128KBitRateMonoMp3",e[e.Audio16Khz64KBitRateMonoMp3=5]="Audio16Khz64KBitRateMonoMp3",e[e.Audio24Khz48KBitRateMonoMp3=6]="Audio24Khz48KBitRateMonoMp3",e[e.Audio24Khz96KBitRateMonoMp3=7]="Audio24Khz96KBitRateMonoMp3",e[e.Audio24Khz160KBitRateMonoMp3=8]="Audio24Khz160KBitRateMonoMp3",e[e.Raw16Khz16BitMonoTrueSilk=9]="Raw16Khz16BitMonoTrueSilk",e[e.Riff16Khz16BitMonoPcm=10]="Riff16Khz16BitMonoPcm",e[e.Riff8Khz16BitMonoPcm=11]="Riff8Khz16BitMonoPcm",e[e.Riff24Khz16BitMonoPcm=12]="Riff24Khz16BitMonoPcm",e[e.Riff8Khz8BitMonoMULaw=13]="Riff8Khz8BitMonoMULaw",e[e.Raw16Khz16BitMonoPcm=14]="Raw16Khz16BitMonoPcm",e[e.Raw24Khz16BitMonoPcm=15]="Raw24Khz16BitMonoPcm",e[e.Raw8Khz16BitMonoPcm=16]="Raw8Khz16BitMonoPcm",e[e.Ogg16Khz16BitMonoOpus=17]="Ogg16Khz16BitMonoOpus",e[e.Ogg24Khz16BitMonoOpus=18]="Ogg24Khz16BitMonoOpus",e[e.Raw48Khz16BitMonoPcm=19]="Raw48Khz16BitMonoPcm",e[e.Riff48Khz16BitMonoPcm=20]="Riff48Khz16BitMonoPcm",e[e.Audio48Khz96KBitRateMonoMp3=21]="Audio48Khz96KBitRateMonoMp3",e[e.Audio48Khz192KBitRateMonoMp3=22]="Audio48Khz192KBitRateMonoMp3",e[e.Ogg48Khz16BitMonoOpus=23]="Ogg48Khz16BitMonoOpus",e[e.Webm16Khz16BitMonoOpus=24]="Webm16Khz16BitMonoOpus",e[e.Webm24Khz16BitMonoOpus=25]="Webm24Khz16BitMonoOpus",e[e.Raw24Khz16BitMonoTrueSilk=26]="Raw24Khz16BitMonoTrueSilk",e[e.Raw8Khz8BitMonoALaw=27]="Raw8Khz8BitMonoALaw",e[e.Riff8Khz8BitMonoALaw=28]="Riff8Khz8BitMonoALaw",e[e.Webm24Khz16Bit24KbpsMonoOpus=29]="Webm24Khz16Bit24KbpsMonoOpus",e[e.Audio16Khz16Bit32KbpsMonoOpus=30]="Audio16Khz16Bit32KbpsMonoOpus",e[e.Audio24Khz16Bit48KbpsMonoOpus=31]="Audio24Khz16Bit48KbpsMonoOpus",e[e.Audio24Khz16Bit24KbpsMonoOpus=32]="Audio24Khz16Bit24KbpsMonoOpus",e[e.Raw22050Hz16BitMonoPcm=33]="Raw22050Hz16BitMonoPcm",e[e.Riff22050Hz16BitMonoPcm=34]="Riff22050Hz16BitMonoPcm",e[e.Raw44100Hz16BitMonoPcm=35]="Raw44100Hz16BitMonoPcm",e[e.Riff44100Hz16BitMonoPcm=36]="Riff44100Hz16BitMonoPcm"}(N||(N={}));class q{constructor(){}static fromSubscription(e,t){L.throwIfNullOrWhitespace(e,"subscriptionKey"),L.throwIfNullOrWhitespace(t,"region");const i=new j;return i.setProperty(x.SpeechServiceConnection_Region,t),i.setProperty(x.SpeechServiceConnection_IntentRegion,t),i.setProperty(x.SpeechServiceConnection_Key,e),i}static fromEndpoint(e,t){L.throwIfNull(e,"endpoint");const i=new j;return i.setProperty(x.SpeechServiceConnection_Endpoint,e.href),void 0!==t&&i.setProperty(x.SpeechServiceConnection_Key,t),i}static fromHost(e,t){L.throwIfNull(e,"hostName");const i=new j;return i.setProperty(x.SpeechServiceConnection_Host,e.protocol+"//"+e.hostname+(""===e.port?"":":"+e.port)),void 0!==t&&i.setProperty(x.SpeechServiceConnection_Key,t),i}static fromAuthorizationToken(e,t){L.throwIfNull(e,"authorizationToken"),L.throwIfNullOrWhitespace(t,"region");const i=new j;return i.setProperty(x.SpeechServiceConnection_Region,t),i.setProperty(x.SpeechServiceConnection_IntentRegion,t),i.authorizationToken=e,i}close(){}}class j extends q{constructor(){super(),this.privProperties=new K,this.speechRecognitionLanguage="en-US",this.outputFormat=z.Simple}get properties(){return this.privProperties}get endPoint(){return new URL(this.privProperties.getProperty(x.SpeechServiceConnection_Endpoint))}get subscriptionKey(){return this.privProperties.getProperty(x.SpeechServiceConnection_Key)}get region(){return this.privProperties.getProperty(x.SpeechServiceConnection_Region)}get authorizationToken(){return this.privProperties.getProperty(x.SpeechServiceAuthorization_Token)}set authorizationToken(e){this.privProperties.setProperty(x.SpeechServiceAuthorization_Token,e)}get speechRecognitionLanguage(){return this.privProperties.getProperty(x.SpeechServiceConnection_RecoLanguage)}set speechRecognitionLanguage(e){this.privProperties.setProperty(x.SpeechServiceConnection_RecoLanguage,e)}get autoDetectSourceLanguages(){return this.privProperties.getProperty(x.SpeechServiceConnection_AutoDetectSourceLanguages)}set autoDetectSourceLanguages(e){this.privProperties.setProperty(x.SpeechServiceConnection_AutoDetectSourceLanguages,e)}get outputFormat(){return z[this.privProperties.getProperty(T,void 0)]}set outputFormat(e){this.privProperties.setProperty(T,z[e])}get endpointId(){return this.privProperties.getProperty(x.SpeechServiceConnection_EndpointId)}set endpointId(e){this.privProperties.setProperty(x.SpeechServiceConnection_EndpointId,e)}setProperty(e,t){L.throwIfNull(t,"value"),this.privProperties.setProperty(e,t)}getProperty(e,t){return this.privProperties.getProperty(e,t)}setProxy(e,t,i,n){this.setProperty(x[x.SpeechServiceConnection_ProxyHostName],e),this.setProperty(x[x.SpeechServiceConnection_ProxyPort],t),this.setProperty(x[x.SpeechServiceConnection_ProxyUserName],i),this.setProperty(x[x.SpeechServiceConnection_ProxyPassword],n)}setServiceProperty(e,t){const i=JSON.parse(this.privProperties.getProperty(M,"{}"));i[e]=t,this.privProperties.setProperty(M,JSON.stringify(i))}setProfanity(e){this.privProperties.setProperty(x.SpeechServiceResponse_ProfanityOption,B[e])}enableAudioLogging(){this.privProperties.setProperty(x.SpeechServiceConnection_EnableAudioLogging,"true")}requestWordLevelTimestamps(){this.privProperties.setProperty(x.SpeechServiceResponse_RequestWordLevelTimestamps,"true")}enableDictation(){this.privProperties.setProperty(O,"true")}clone(){const e=new j;return e.privProperties=this.privProperties.clone(),e}get speechSynthesisLanguage(){return this.privProperties.getProperty(x.SpeechServiceConnection_SynthLanguage)}set speechSynthesisLanguage(e){this.privProperties.setProperty(x.SpeechServiceConnection_SynthLanguage,e)}get speechSynthesisVoiceName(){return this.privProperties.getProperty(x.SpeechServiceConnection_SynthVoice)}set speechSynthesisVoiceName(e){this.privProperties.setProperty(x.SpeechServiceConnection_SynthVoice,e)}get speechSynthesisOutputFormat(){return N[this.privProperties.getProperty(x.SpeechServiceConnection_SynthOutputFormat,void 0)]}set speechSynthesisOutputFormat(e){this.privProperties.setProperty(x.SpeechServiceConnection_SynthOutputFormat,N[e])}}class V{constructor(e,t){this.privActualSampleRate=e,this.privDesiredSampleRate=t}encode(e){const t=this.downSampleAudioFrame(e,this.privActualSampleRate,this.privDesiredSampleRate);if(!t)return null;const i=2*t.length,n=new ArrayBuffer(i),r=new DataView(n);return this.floatTo16BitPCM(r,0,t),n}setString(e,t,i){for(let n=0;n<i.length;n++)e.setUint8(t+n,i.charCodeAt(n))}floatTo16BitPCM(e,t,i){for(let n=0;n<i.length;n++,t+=2){const r=Math.max(-1,Math.min(1,i[n]));e.setInt16(t,r<0?32768*r:32767*r,!0)}}downSampleAudioFrame(e,t,i){if(!e)return null;if(i===t||i>t)return e;const n=t/i,r=Math.round(e.length/n),s=new Float32Array(r);let o=0,a=0;for(;a<r;){const t=Math.round((a+1)*n);let i=0,r=0;for(;o<t&&o<e.length;)i+=e[o++],r++;s[a++]=i/r}return s}}class X{constructor(e){this.privStopInputOnRelease=e}record(e,t,i){const n=new V(e.sampleRate,16e3),r=e.createMediaStreamSource(t),s=()=>{const s=(()=>{let t=0;try{return e.createScriptProcessor(t,1,1)}catch(i){t=2048;let n=e.sampleRate;for(;t<16384&&n>=32e3;)t<<=1,n>>=1;return e.createScriptProcessor(t,1,1)}})();s.onaudioprocess=e=>{const t=e.inputBuffer.getChannelData(0);if(i&&!i.isClosed){const e=n.encode(t);e&&i.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}},r.connect(s),s.connect(e.destination),this.privMediaResources={scriptProcessorNode:s,source:r,stream:t}};if(e.audioWorklet){if(!this.privSpeechProcessorScript){const e=new Blob(["class SP extends AudioWorkletProcessor {\n constructor(options) {\n super(options);\n }\n process(inputs, outputs) {\n const input = inputs[0];\n const output = [];\n for (let channel = 0; channel < input.length; channel += 1) {\n output[channel] = input[channel];\n }\n this.port.postMessage(output[0]);\n return true;\n }\n }\n registerProcessor('speech-processor', SP);"],{type:"application/javascript; charset=utf-8"});this.privSpeechProcessorScript=URL.createObjectURL(e)}e.audioWorklet.addModule(this.privSpeechProcessorScript).then((()=>{const s=new AudioWorkletNode(e,"speech-processor");s.port.onmessage=e=>{const t=e.data;if(i&&!i.isClosed){const e=n.encode(t);e&&i.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}},r.connect(s),s.connect(e.destination),this.privMediaResources={scriptProcessorNode:s,source:r,stream:t}})).catch((()=>{s()}))}else try{s()}catch(e){throw new Error(`Unable to start audio worklet node for PCMRecorder: ${e}`)}}releaseMediaResources(e){this.privMediaResources&&(this.privMediaResources.scriptProcessorNode&&(this.privMediaResources.scriptProcessorNode.disconnect(e.destination),this.privMediaResources.scriptProcessorNode=null),this.privMediaResources.source&&(this.privMediaResources.source.disconnect(),this.privStopInputOnRelease&&this.privMediaResources.stream.getTracks().forEach((e=>e.stop())),this.privMediaResources.source=null))}setWorkletUrl(e){this.privSpeechProcessorScript=e}}!function(e){e[e.Interactive=0]="Interactive",e[e.Conversation=1]="Conversation",e[e.Dictation=2]="Dictation"}(G||(G={})),function(e){e[e.Simple=0]="Simple",e[e.Detailed=1]="Detailed"}(F||(F={}));class W{constructor(e,t){this.privSpeechServiceConfig=e||new Q(new J(null)),this.privParameters=t,this.privMaxRetryCount=parseInt(t.getProperty("SPEECH-Error-MaxRetryCount","4"),10),this.privLanguageIdMode=t.getProperty(x.SpeechServiceConnection_LanguageIdMode,void 0)}get parameters(){return this.privParameters}get recognitionMode(){return this.privRecognitionMode}set recognitionMode(e){this.privRecognitionMode=e,this.privRecognitionActivityTimeout=e===G.Interactive?8e3:25e3,this.privSpeechServiceConfig.Recognition=G[e]}get SpeechServiceConfig(){return this.privSpeechServiceConfig}get recognitionActivityTimeout(){return this.privRecognitionActivityTimeout}get isContinuousRecognition(){return this.privRecognitionMode!==G.Interactive}get languageIdMode(){return this.privLanguageIdMode}get autoDetectSourceLanguages(){return this.parameters.getProperty(x.SpeechServiceConnection_AutoDetectSourceLanguages,void 0)}get recognitionEndpointVersion(){return this.parameters.getProperty(x.SpeechServiceConnection_RecognitionEndpointVersion,void 0)}get sourceLanguageModels(){const e=[];let t=!1;if(void 0!==this.autoDetectSourceLanguages)for(const i of this.autoDetectSourceLanguages.split(",")){const n=i+x.SpeechServiceConnection_EndpointId.toString(),r=this.parameters.getProperty(n,void 0);void 0!==r?(e.push({language:i,endpoint:r}),t=!0):e.push({language:i,endpoint:""})}return t?e:void 0}get maxRetryCount(){return this.privMaxRetryCount}}class Q{constructor(e){this.context=e}serialize(){return JSON.stringify(this,((e,t)=>{if(t&&"object"==typeof t){const e={};for(const i in t)Object.hasOwnProperty.call(t,i)&&(e[i&&i.charAt(0).toLowerCase()+i.substring(1)]=t[i]);return e}return t}))}get Context(){return this.context}get Recognition(){return this.recognition}set Recognition(e){this.recognition=e.toLowerCase()}}class J{constructor(e){this.system=new Z,this.os=e}}class Z{constructor(){this.name="SpeechSDK",this.version="1.27.0",this.build="JavaScript",this.lang="JavaScript"}}class Y{constructor(e,t,i){this.platform=e,this.name=t,this.version=i}}!function(e){e.Bluetooth="Bluetooth",e.Wired="Wired",e.WiFi="WiFi",e.Cellular="Cellular",e.InBuilt="InBuilt",e.Unknown="Unknown"}(H||(H={})),function(e){e.Phone="Phone",e.Speaker="Speaker",e.Car="Car",e.Headset="Headset",e.Thermostat="Thermostat",e.Microphones="Microphones",e.Deskphone="Deskphone",e.RemoteControl="RemoteControl",e.Unknown="Unknown",e.File="File",e.Stream="Stream"}(U||(U={}));const $={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let ee;const te=new Uint8Array(16);function ie(){if(!ee&&(ee="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ee))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ee(te)}const ne=[];for(let e=0;e<256;++e)ne.push((e+256).toString(16).slice(1));const re=function(e,t,i){if($.randomUUID&&!t&&!e)return $.randomUUID();const n=(e=e||{}).random||(e.rng||ie)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(let e=0;e<16;++e)t[i+e]=n[e];return t}return function(e,t=0){return(ne[e[t+0]]+ne[e[t+1]]+ne[e[t+2]]+ne[e[t+3]]+"-"+ne[e[t+4]]+ne[e[t+5]]+"-"+ne[e[t+6]]+ne[e[t+7]]+"-"+ne[e[t+8]]+ne[e[t+9]]+"-"+ne[e[t+10]]+ne[e[t+11]]+ne[e[t+12]]+ne[e[t+13]]+ne[e[t+14]]+ne[e[t+15]]).toLowerCase()}(n)},se=()=>re().replace(new RegExp("-","g"),"").toUpperCase();class oe extends Error{constructor(e){super(e),this.name="ArgumentNull",this.message=e}}class ae extends Error{constructor(e){super(e),this.name="InvalidOperation",this.message=e}}class ce extends Error{constructor(e,t){super(t),this.name=e+"ObjectDisposed",this.message=t}}class pe{constructor(e){this.privEventListeners={},this.privIsDisposed=!1,this.privConsoleListener=void 0,this.privMetadata=e}onEvent(e){if(this.isDisposed())throw new ce("EventSource");if(this.metadata)for(const t in this.metadata)t&&e.metadata&&(e.metadata[t]||(e.metadata[t]=this.metadata[t]));for(const t in this.privEventListeners)t&&this.privEventListeners[t]&&this.privEventListeners[t](e)}attach(e){const t=se();return this.privEventListeners[t]=e,{detach:()=>(delete this.privEventListeners[t],Promise.resolve())}}attachListener(e){return this.attach((t=>e.onEvent(t)))}attachConsoleListener(e){return this.privConsoleListener&&this.privConsoleListener.detach(),this.privConsoleListener=this.attach((t=>e.onEvent(t))),this.privConsoleListener}isDisposed(){return this.privIsDisposed}dispose(){this.privEventListeners=null,this.privIsDisposed=!0}get metadata(){return this.privMetadata}}var ue,he,de;!function(e){e[e.None=0]="None",e[e.Resolved=1]="Resolved",e[e.Rejected=2]="Rejected"}(ue||(ue={}));class le{constructor(){this.resolve=e=>(this.privResolve(e),this),this.reject=e=>(this.privReject(e),this),this.privPromise=new Promise(((e,t)=>{this.privResolve=e,this.privReject=t}))}get promise(){return this.privPromise}}function ve(e,t,i){e.then((e=>{try{t&&t(e)}catch(e){if(i)try{if(e instanceof Error){const t=e;i(t.name+": "+t.message)}else i(e)}catch(e){}}}),(e=>{if(i)try{if(e instanceof Error){const t=e;i(t.name+": "+t.message)}else i(e)}catch(e){}}))}(de=he||(he={}))[de.Debug=0]="Debug",de[de.Info=1]="Info",de[de.Warning=2]="Warning",de[de.Error=3]="Error",de[de.None=4]="None";class ge{constructor(e,t){this.privName=e,this.privEventId=se(),this.privEventTime=(new Date).toISOString(),this.privEventType=t,this.privMetadata={}}get name(){return this.privName}get eventId(){return this.privEventId}get eventTime(){return this.privEventTime}get eventType(){return this.privEventType}get metadata(){return this.privMetadata}}class fe extends ge{constructor(e,t,i=he.Info){super(e,i),this.privAudioSourceId=t}get audioSourceId(){return this.privAudioSourceId}}class me extends fe{constructor(e){super("AudioSourceInitializingEvent",e)}}class _e extends fe{constructor(e){super("AudioSourceReadyEvent",e)}}class Se extends fe{constructor(e){super("AudioSourceOffEvent",e)}}class ye extends fe{constructor(e,t){super("AudioSourceErrorEvent",e,he.Error),this.privError=t}get error(){return this.privError}}class Ae extends fe{constructor(e,t,i){super(e,t),this.privAudioNodeId=i}get audioNodeId(){return this.privAudioNodeId}}class Ce extends Ae{constructor(e,t){super("AudioStreamNodeAttachingEvent",e,t)}}class we extends Ae{constructor(e,t){super("AudioStreamNodeAttachedEvent",e,t)}}class be extends Ae{constructor(e,t){super("AudioStreamNodeDetachedEvent",e,t)}}class Ie extends Ae{constructor(e,t,i){super("AudioStreamNodeErrorEvent",e,t),this.privError=i}get error(){return this.privError}}class Re{constructor(e){if(this.privSubscriptionIdCounter=0,this.privAddSubscriptions={},this.privRemoveSubscriptions={},this.privDisposedSubscriptions={},this.privDisposeReason=null,this.privList=[],e)for(const t of e)this.privList.push(t)}get(e){return this.throwIfDisposed(),this.privList[e]}first(){return this.get(0)}last(){return this.get(this.length()-1)}add(e){this.throwIfDisposed(),this.insertAt(this.privList.length,e)}insertAt(e,t){this.throwIfDisposed(),0===e?this.privList.unshift(t):e===this.privList.length?this.privList.push(t):this.privList.splice(e,0,t),this.triggerSubscriptions(this.privAddSubscriptions)}removeFirst(){return this.throwIfDisposed(),this.removeAt(0)}removeLast(){return this.throwIfDisposed(),this.removeAt(this.length()-1)}removeAt(e){return this.throwIfDisposed(),this.remove(e,1)[0]}remove(e,t){this.throwIfDisposed();const i=this.privList.splice(e,t);return this.triggerSubscriptions(this.privRemoveSubscriptions),i}clear(){this.throwIfDisposed(),this.remove(0,this.length())}length(){return this.throwIfDisposed(),this.privList.length}onAdded(e){this.throwIfDisposed();const t=this.privSubscriptionIdCounter++;return this.privAddSubscriptions[t]=e,{detach:()=>(delete this.privAddSubscriptions[t],Promise.resolve())}}onRemoved(e){this.throwIfDisposed();const t=this.privSubscriptionIdCounter++;return this.privRemoveSubscriptions[t]=e,{detach:()=>(delete this.privRemoveSubscriptions[t],Promise.resolve())}}onDisposed(e){this.throwIfDisposed();const t=this.privSubscriptionIdCounter++;return this.privDisposedSubscriptions[t]=e,{detach:()=>(delete this.privDisposedSubscriptions[t],Promise.resolve())}}join(e){return this.throwIfDisposed(),this.privList.join(e)}toArray(){const e=Array();return this.privList.forEach((t=>{e.push(t)})),e}any(e){return this.throwIfDisposed(),e?this.where(e).length()>0:this.length()>0}all(e){return this.throwIfDisposed(),this.where(e).length()===this.length()}forEach(e){this.throwIfDisposed();for(let t=0;t<this.length();t++)e(this.privList[t],t)}select(e){this.throwIfDisposed();const t=[];for(let i=0;i<this.privList.length;i++)t.push(e(this.privList[i],i));return new Re(t)}where(e){this.throwIfDisposed();const t=new Re;for(let i=0;i<this.privList.length;i++)e(this.privList[i],i)&&t.add(this.privList[i]);return t}orderBy(e){this.throwIfDisposed();const t=this.toArray().sort(e);return new Re(t)}orderByDesc(e){return this.throwIfDisposed(),this.orderBy(((t,i)=>e(i,t)))}clone(){return this.throwIfDisposed(),new Re(this.toArray())}concat(e){return this.throwIfDisposed(),new Re(this.privList.concat(e.toArray()))}concatArray(e){return this.throwIfDisposed(),new Re(this.privList.concat(e))}isDisposed(){return null==this.privList}dispose(e){this.isDisposed()||(this.privDisposeReason=e,this.privList=null,this.privAddSubscriptions=null,this.privRemoveSubscriptions=null,this.triggerSubscriptions(this.privDisposedSubscriptions))}throwIfDisposed(){if(this.isDisposed())throw new ce("List",this.privDisposeReason)}triggerSubscriptions(e){if(e)for(const t in e)t&&e[t]()}}var ke,Ee=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};!function(e){e[e.Dequeue=0]="Dequeue",e[e.Peek=1]="Peek"}(ke||(ke={}));class Pe{constructor(e){this.privPromiseStore=new Re,this.privIsDrainInProgress=!1,this.privIsDisposing=!1,this.privDisposeReason=null,this.privList=e||new Re,this.privDetachables=[],this.privSubscribers=new Re,this.privDetachables.push(this.privList.onAdded((()=>this.drain())))}enqueue(e){this.throwIfDispose(),this.enqueueFromPromise(new Promise((t=>t(e))))}enqueueFromPromise(e){this.throwIfDispose(),e.then((e=>{this.privList.add(e)}),(()=>{}))}dequeue(){this.throwIfDispose();const e=new le;return this.privSubscribers&&(this.privSubscribers.add({deferral:e,type:ke.Dequeue}),this.drain()),e.promise}peek(){this.throwIfDispose();const e=new le;return this.privSubscribers&&(this.privSubscribers.add({deferral:e,type:ke.Peek}),this.drain()),e.promise}length(){return this.throwIfDispose(),this.privList.length()}isDisposed(){return null==this.privSubscribers}drainAndDispose(e,t){return Ee(this,void 0,void 0,(function*(){if(!this.isDisposed()&&!this.privIsDisposing){this.privDisposeReason=t,this.privIsDisposing=!0;const i=this.privSubscribers;if(i){for(;i.length()>0;)i.removeFirst().deferral.resolve(void 0);this.privSubscribers===i&&(this.privSubscribers=i)}for(const e of this.privDetachables)yield e.detach();if(this.privPromiseStore.length()>0&&e){const t=[];return this.privPromiseStore.toArray().forEach((e=>{t.push(e)})),Promise.all(t).finally((()=>{this.privSubscribers=null,this.privList.forEach((t=>{e(t)})),this.privList=null})).then()}this.privSubscribers=null,this.privList=null}}))}dispose(e){return Ee(this,void 0,void 0,(function*(){yield this.drainAndDispose(null,e)}))}drain(){if(!this.privIsDrainInProgress&&!this.privIsDisposing){this.privIsDrainInProgress=!0;const e=this.privSubscribers,t=this.privList;if(e&&t){for(;t.length()>0&&e.length()>0&&!this.privIsDisposing;){const i=e.removeFirst();if(i.type===ke.Peek)i.deferral.resolve(t.first());else{const e=t.removeFirst();i.deferral.resolve(e)}}this.privSubscribers===e&&(this.privSubscribers=e),this.privList===t&&(this.privList=t)}this.privIsDrainInProgress=!1}}throwIfDispose(){if(this.isDisposed()){if(this.privDisposeReason)throw new ae(this.privDisposeReason);throw new ce("Queue")}if(this.privIsDisposing)throw new ae("Queue disposing")}}var Te;class De{constructor(e){this.privIsWriteEnded=!1,this.privIsReadEnded=!1,this.privId=e||se(),this.privReaderQueue=new Pe}get isClosed(){return this.privIsWriteEnded}get isReadEnded(){return this.privIsReadEnded}get id(){return this.privId}close(){this.privIsWriteEnded||(this.writeStreamChunk({buffer:null,isEnd:!0,timeReceived:Date.now()}),this.privIsWriteEnded=!0)}writeStreamChunk(e){if(this.throwIfClosed(),!this.privReaderQueue.isDisposed())try{this.privReaderQueue.enqueue(e)}catch(e){}}read(){if(this.privIsReadEnded)throw new ae("Stream read has already finished");return this.privReaderQueue.dequeue().then((e=>{return t=this,i=void 0,r=function*(){return(void 0===e||e.isEnd)&&(yield this.privReaderQueue.dispose("End of stream reached")),e},new((n=void 0)||(n=Promise))((function(e,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}c((r=r.apply(t,i||[])).next())}));var t,i,n,r}))}readEnded(){this.privIsReadEnded||(this.privIsReadEnded=!0,this.privReaderQueue=new Pe)}throwIfClosed(){if(this.privIsWriteEnded)throw new ae("Stream closed")}}class Me extends De{constructor(e,t){super(t),this.privTargetChunkSize=e,this.privNextBufferReadyBytes=0}writeStreamChunk(e){if(e.isEnd||0===this.privNextBufferReadyBytes&&e.buffer.byteLength===this.privTargetChunkSize)return void super.writeStreamChunk(e);let t=0;for(;t<e.buffer.byteLength;){void 0===this.privNextBufferToWrite&&(this.privNextBufferToWrite=new ArrayBuffer(this.privTargetChunkSize),this.privNextBufferStartTime=e.timeReceived);const i=Math.min(e.buffer.byteLength-t,this.privTargetChunkSize-this.privNextBufferReadyBytes),n=new Uint8Array(this.privNextBufferToWrite),r=new Uint8Array(e.buffer.slice(t,i+t));n.set(r,this.privNextBufferReadyBytes),this.privNextBufferReadyBytes+=i,t+=i,this.privNextBufferReadyBytes===this.privTargetChunkSize&&(super.writeStreamChunk({buffer:this.privNextBufferToWrite,isEnd:!1,timeReceived:this.privNextBufferStartTime}),this.privNextBufferReadyBytes=0,this.privNextBufferToWrite=void 0)}}close(){0===this.privNextBufferReadyBytes||this.isClosed||super.writeStreamChunk({buffer:this.privNextBufferToWrite.slice(0,this.privNextBufferReadyBytes),isEnd:!1,timeReceived:this.privNextBufferStartTime}),super.close()}}class Oe{static setEventSource(e){if(!e)throw new oe("eventSource");Oe.privInstance=e}static get instance(){return Oe.privInstance}}Oe.privInstance=new pe,function(e){e[e.PCM=1]="PCM",e[e.MuLaw=2]="MuLaw",e[e.Siren=3]="Siren",e[e.MP3=4]="MP3",e[e.SILKSkype=5]="SILKSkype",e[e.OGG_OPUS=6]="OGG_OPUS",e[e.WEBM_OPUS=7]="WEBM_OPUS",e[e.ALaw=8]="ALaw",e[e.FLAC=9]="FLAC",e[e.OPUS=10]="OPUS"}(Te||(Te={}));class Le{static getDefaultInputFormat(){return xe.getDefaultInputFormat()}static getWaveFormat(e,t,i,n){return new xe(e,t,i,n)}static getWaveFormatPCM(e,t,i){return new xe(e,t,i)}}class xe extends Le{constructor(e=16e3,t=16,i=1,n=Te.PCM){super();let r=!0;switch(n){case Te.PCM:this.formatTag=1;break;case Te.ALaw:this.formatTag=6;break;case Te.MuLaw:this.formatTag=7;break;default:r=!1}if(this.bitsPerSample=t,this.samplesPerSec=e,this.channels=i,this.avgBytesPerSec=this.samplesPerSec*this.channels*(this.bitsPerSample/8),this.blockAlign=this.channels*Math.max(this.bitsPerSample,8),r){this.privHeader=new ArrayBuffer(44);const e=new DataView(this.privHeader);this.setString(e,0,"RIFF"),e.setUint32(4,0,!0),this.setString(e,8,"WAVEfmt "),e.setUint32(16,16,!0),e.setUint16(20,this.formatTag,!0),e.setUint16(22,this.channels,!0),e.setUint32(24,this.samplesPerSec,!0),e.setUint32(28,this.avgBytesPerSec,!0),e.setUint16(32,this.channels*(this.bitsPerSample/8),!0),e.setUint16(34,this.bitsPerSample,!0),this.setString(e,36,"data"),e.setUint32(40,0,!0)}}static getDefaultInputFormat(){return new xe}static getAudioContext(e){const t=window.AudioContext||window.webkitAudioContext||!1;if(t)return void 0!==e&&navigator.mediaDevices.getSupportedConstraints().sampleRate?new t({sampleRate:e}):new t;throw new Error("Browser does not support Web Audio API (AudioContext is not available).")}close(){}get header(){return this.privHeader}setString(e,t,i){for(let n=0;n<i.length;n++)e.setUint8(t+n,i.charCodeAt(n))}}var ze=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class Be{constructor(e,t,i,n){this.privRecorder=e,this.deviceId=t,this.privStreams={},this.privOutputChunkSize=Be.AUDIOFORMAT.avgBytesPerSec/10,this.privId=i||se(),this.privEvents=new pe,this.privMediaStream=n||null,this.privIsClosing=!1}get format(){return Promise.resolve(Be.AUDIOFORMAT)}turnOn(){if(this.privInitializeDeferral)return this.privInitializeDeferral.promise;this.privInitializeDeferral=new le;try{this.createAudioContext()}catch(e){if(e instanceof Error){const t=e;this.privInitializeDeferral.reject(t.name+": "+t.message)}else this.privInitializeDeferral.reject(e);return this.privInitializeDeferral.promise}const e=window.navigator;let t=e.getUserMedia||e.webkitGetUserMedia||e.mozGetUserMedia||e.msGetUserMedia;if(e.mediaDevices&&(t=(t,i,n)=>{e.mediaDevices.getUserMedia(t).then(i).catch(n)}),t){const e=()=>{this.onEvent(new me(this.privId)),this.privMediaStream&&this.privMediaStream.active?(this.onEvent(new _e(this.privId)),this.privInitializeDeferral.resolve()):t({audio:!this.deviceId||{deviceId:this.deviceId},video:!1},(e=>{this.privMediaStream=e,this.onEvent(new _e(this.privId)),this.privInitializeDeferral.resolve()}),(e=>{const t=`Error occurred during microphone initialization: ${e}`;this.privInitializeDeferral.reject(t),this.onEvent(new ye(this.privId,t))}))};"suspended"===this.privContext.state?this.privContext.resume().then(e).catch((e=>{this.privInitializeDeferral.reject(`Failed to initialize audio context: ${e}`)})):e()}else{const e="Browser does not support getUserMedia.";this.privInitializeDeferral.reject(e),this.onEvent(new ye(e,""))}return this.privInitializeDeferral.promise}id(){return this.privId}attach(e){return this.onEvent(new Ce(this.privId,e)),this.listen(e).then((t=>(this.onEvent(new we(this.privId,e)),{detach:()=>ze(this,void 0,void 0,(function*(){return t.readEnded(),delete this.privStreams[e],this.onEvent(new be(this.privId,e)),this.turnOff()})),id:()=>e,read:()=>t.read()})))}detach(e){e&&this.privStreams[e]&&(this.privStreams[e].close(),delete this.privStreams[e],this.onEvent(new be(this.privId,e)))}turnOff(){return ze(this,void 0,void 0,(function*(){for(const e in this.privStreams)if(e){const t=this.privStreams[e];t&&t.close()}this.onEvent(new Se(this.privId)),this.privInitializeDeferral&&(yield this.privInitializeDeferral,this.privInitializeDeferral=null),yield this.destroyAudioContext()}))}get events(){return this.privEvents}get deviceInfo(){return this.getMicrophoneLabel().then((e=>({bitspersample:Be.AUDIOFORMAT.bitsPerSample,channelcount:Be.AUDIOFORMAT.channels,connectivity:H.Unknown,manufacturer:"Speech SDK",model:e,samplerate:Be.AUDIOFORMAT.samplesPerSec,type:U.Microphones})))}setProperty(e,t){if("MICROPHONE-WorkletSourceUrl"!==e)throw new Error("Property '"+e+"' is not supported on Microphone.");this.privRecorder.setWorkletUrl(t)}getMicrophoneLabel(){const e="microphone";if(void 0!==this.privMicrophoneLabel)return Promise.resolve(this.privMicrophoneLabel);if(void 0===this.privMediaStream||!this.privMediaStream.active)return Promise.resolve(e);this.privMicrophoneLabel=e;const t=this.privMediaStream.getTracks()[0].getSettings().deviceId;if(void 0===t)return Promise.resolve(this.privMicrophoneLabel);const i=new le;return navigator.mediaDevices.enumerateDevices().then((e=>{for(const i of e)if(i.deviceId===t){this.privMicrophoneLabel=i.label;break}i.resolve(this.privMicrophoneLabel)}),(()=>i.resolve(this.privMicrophoneLabel))),i.promise}listen(e){return ze(this,void 0,void 0,(function*(){yield this.turnOn();const t=new Me(this.privOutputChunkSize,e);this.privStreams[e]=t;try{this.privRecorder.record(this.privContext,this.privMediaStream,t)}catch(t){throw this.onEvent(new Ie(this.privId,e,t)),t}return t}))}onEvent(e){this.privEvents.onEvent(e),Oe.instance.onEvent(e)}createAudioContext(){this.privContext||(this.privContext=xe.getAudioContext(Be.AUDIOFORMAT.samplesPerSec))}destroyAudioContext(){return ze(this,void 0,void 0,(function*(){if(!this.privContext)return;this.privRecorder.releaseMediaResources(this.privContext);let e=!1;"close"in this.privContext&&(e=!0),e?this.privIsClosing||(this.privIsClosing=!0,yield this.privContext.close(),this.privContext=null,this.privIsClosing=!1):null!==this.privContext&&"running"===this.privContext.state&&(yield this.privContext.suspend())}))}}Be.AUDIOFORMAT=Le.getDefaultInputFormat();var Ne=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class Ge{constructor(e,t,i){this.privStreams={},this.privHeaderEnd=44,this.privId=i||se(),this.privEvents=new pe,this.privSource=e,"undefined"!=typeof window&&"undefined"!=typeof Blob&&this.privSource instanceof Blob?this.privFilename=e.name:this.privFilename=t||"unknown.wav",this.privAudioFormatPromise=this.readHeader()}get format(){return this.privAudioFormatPromise}turnOn(){if(this.privFilename.lastIndexOf(".wav")!==this.privFilename.length-4){const e=this.privFilename+" is not supported. Only WAVE files are allowed at the moment.";return this.onEvent(new ye(e,"")),Promise.reject(e)}this.onEvent(new me(this.privId)),this.onEvent(new _e(this.privId))}id(){return this.privId}attach(e){return Ne(this,void 0,void 0,(function*(){this.onEvent(new Ce(this.privId,e));const t=yield this.upload(e);return this.onEvent(new we(this.privId,e)),Promise.resolve({detach:()=>Ne(this,void 0,void 0,(function*(){t.readEnded(),delete this.privStreams[e],this.onEvent(new be(this.privId,e)),yield this.turnOff()})),id:()=>e,read:()=>t.read()})}))}detach(e){e&&this.privStreams[e]&&(this.privStreams[e].close(),delete this.privStreams[e],this.onEvent(new be(this.privId,e)))}turnOff(){for(const e in this.privStreams)if(e){const t=this.privStreams[e];t&&!t.isClosed&&t.close()}return this.onEvent(new Se(this.privId)),Promise.resolve()}get events(){return this.privEvents}get deviceInfo(){return this.privAudioFormatPromise.then((e=>Promise.resolve({bitspersample:e.bitsPerSample,channelcount:e.channels,connectivity:H.Unknown,manufacturer:"Speech SDK",model:"File",samplerate:e.samplesPerSec,type:U.File})))}readHeader(){const e=this.privSource.slice(0,4296),t=new le,i=e=>{const i=new DataView(e),n=e=>String.fromCharCode(i.getUint8(e),i.getUint8(e+1),i.getUint8(e+2),i.getUint8(e+3));if("RIFF"!==n(0))return void t.reject("Invalid WAV header in file, RIFF was not found");if("WAVE"!==n(8)||"fmt "!==n(12))return void t.reject("Invalid WAV header in file, WAVEfmt was not found");const r=i.getInt32(16,!0),s=i.getUint16(22,!0),o=i.getUint32(24,!0),a=i.getUint16(34,!0);let c=36+Math.max(r-16,0);for(;"data"!==n(c);c+=2)if(c>4288)return void t.reject("Invalid WAV header in file, data block was not found");this.privHeaderEnd=c+8,t.resolve(Le.getWaveFormatPCM(o,a,s))};if("undefined"!=typeof window&&"undefined"!=typeof Blob&&e instanceof Blob){const t=new FileReader;t.onload=e=>{const t=e.target.result;i(t)},t.readAsArrayBuffer(e)}else{const t=e;i(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength))}return t.promise}upload(e){return Ne(this,void 0,void 0,(function*(){const t=t=>{const i=`Error occurred while processing '${this.privFilename}'. ${t}`;throw this.onEvent(new Ie(this.privId,e,i)),new Error(i)};try{yield this.turnOn();const i=yield this.privAudioFormatPromise,n=new Me(i.avgBytesPerSec/10,e);this.privStreams[e]=n;const r=this.privSource.slice(this.privHeaderEnd),s=e=>{n.isClosed||(n.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()}),n.close())};if("undefined"!=typeof window&&"undefined"!=typeof Blob&&r instanceof Blob){const e=new FileReader;e.onerror=e=>t(e.toString()),e.onload=e=>{const t=e.target.result;s(t)},e.readAsArrayBuffer(r)}else{const e=r;s(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}return n}catch(e){t(e)}}))}onEvent(e){this.privEvents.onEvent(e),Oe.instance.onEvent(e)}}var Fe,He,Ue,Ke,qe,je=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class Ve{constructor(){}static createPushStream(e){return Xe.create(e)}static createPullStream(e,t){return Qe.create(e,t)}}class Xe extends Ve{static create(e){return new We(e)}}class We extends Xe{constructor(e){super(),this.privFormat=void 0===e?xe.getDefaultInputFormat():e,this.privEvents=new pe,this.privId=se(),this.privStream=new Me(this.privFormat.avgBytesPerSec/10)}get format(){return Promise.resolve(this.privFormat)}write(e){this.privStream.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}close(){this.privStream.close()}id(){return this.privId}turnOn(){this.onEvent(new me(this.privId)),this.onEvent(new _e(this.privId))}attach(e){return je(this,void 0,void 0,(function*(){this.onEvent(new Ce(this.privId,e)),yield this.turnOn();const t=this.privStream;return this.onEvent(new we(this.privId,e)),{detach:()=>je(this,void 0,void 0,(function*(){return this.onEvent(new be(this.privId,e)),this.turnOff()})),id:()=>e,read:()=>t.read()}}))}detach(e){this.onEvent(new be(this.privId,e))}turnOff(){}get events(){return this.privEvents}get deviceInfo(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:H.Unknown,manufacturer:"Speech SDK",model:"PushStream",samplerate:this.privFormat.samplesPerSec,type:U.Stream})}onEvent(e){this.privEvents.onEvent(e),Oe.instance.onEvent(e)}toBuffer(e){const t=Buffer.alloc(e.byteLength),i=new Uint8Array(e);for(let e=0;e<t.length;++e)t[e]=i[e];return t}}class Qe extends Ve{constructor(){super()}static create(e,t){return new Je(e,t)}}class Je extends Qe{constructor(e,t){super(),this.privFormat=void 0===t?Le.getDefaultInputFormat():t,this.privEvents=new pe,this.privId=se(),this.privCallback=e,this.privIsClosed=!1,this.privBufferSize=this.privFormat.avgBytesPerSec/10}get format(){return Promise.resolve(this.privFormat)}close(){this.privIsClosed=!0,this.privCallback.close()}id(){return this.privId}turnOn(){this.onEvent(new me(this.privId)),this.onEvent(new _e(this.privId))}attach(e){return je(this,void 0,void 0,(function*(){return this.onEvent(new Ce(this.privId,e)),yield this.turnOn(),this.onEvent(new we(this.privId,e)),{detach:()=>(this.privCallback.close(),this.onEvent(new be(this.privId,e)),this.turnOff()),id:()=>e,read:()=>{let e,t=0;for(;t<this.privBufferSize;){const i=new ArrayBuffer(this.privBufferSize-t),n=this.privCallback.read(i);if(void 0===e?e=i:new Int8Array(e).set(new Int8Array(i),t),0===n)break;t+=n}return Promise.resolve({buffer:e.slice(0,t),isEnd:this.privIsClosed||0===t,timeReceived:Date.now()})}}}))}detach(e){this.onEvent(new be(this.privId,e))}turnOff(){}get events(){return this.privEvents}get deviceInfo(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:H.Unknown,manufacturer:"Speech SDK",model:"PullStream",samplerate:this.privFormat.samplesPerSec,type:U.Stream})}onEvent(e){this.privEvents.onEvent(e),Oe.instance.onEvent(e)}}!function(e){e[e.Text=0]="Text",e[e.Binary=1]="Binary"}(Fe||(Fe={}));class Ze{constructor(e,t,i,n){if(this.privBody=null,e===Fe.Text&&t&&"string"!=typeof t)throw new ae("Payload must be a string");if(e===Fe.Binary&&t&&!(t instanceof ArrayBuffer))throw new ae("Payload must be ArrayBuffer");switch(this.privMessageType=e,this.privBody=t,this.privHeaders=i||{},this.privId=n||se(),this.messageType){case Fe.Binary:this.privSize=null!==this.binaryBody?this.binaryBody.byteLength:0;break;case Fe.Text:this.privSize=this.textBody.length}}get messageType(){return this.privMessageType}get headers(){return this.privHeaders}get body(){return this.privBody}get textBody(){if(this.privMessageType===Fe.Binary)throw new ae("Not supported for binary message");return this.privBody}get binaryBody(){if(this.privMessageType===Fe.Text)throw new ae("Not supported for text message");return this.privBody}get id(){return this.privId}}class Ye extends ge{constructor(e,t,i=he.Info){super(e,i),this.privJsonResult=t}get jsonString(){return this.privJsonResult}}class $e extends ge{constructor(e,t,i=he.Info){super(e,i),this.privConnectionId=t}get connectionId(){return this.privConnectionId}}class et extends $e{constructor(e,t,i){super("ConnectionStartEvent",e),this.privUri=t,this.privHeaders=i}get uri(){return this.privUri}get headers(){return this.privHeaders}}class tt extends $e{constructor(e){super("ConnectionEstablishedEvent",e)}}class it extends $e{constructor(e,t,i){super("ConnectionClosedEvent",e,he.Debug),this.privReason=i,this.privStatusCode=t}get reason(){return this.privReason}get statusCode(){return this.privStatusCode}}class nt extends $e{constructor(e,t,i){super("ConnectionErrorEvent",e,he.Debug),this.privMessage=t,this.privType=i}get message(){return this.privMessage}get type(){return this.privType}}class rt extends $e{constructor(e,t,i){super("ConnectionEstablishErrorEvent",e,he.Error),this.privStatusCode=t,this.privReason=i}get reason(){return this.privReason}get statusCode(){return this.privStatusCode}}class st extends $e{constructor(e,t,i){super("ConnectionMessageReceivedEvent",e),this.privNetworkReceivedTime=t,this.privMessage=i}get networkReceivedTime(){return this.privNetworkReceivedTime}get message(){return this.privMessage}}class ot extends $e{constructor(e,t,i){super("ConnectionMessageSentEvent",e),this.privNetworkSentTime=t,this.privMessage=i}get networkSentTime(){return this.privNetworkSentTime}get message(){return this.privMessage}}!function(e){e[e.None=0]="None",e[e.Connected=1]="Connected",e[e.Connecting=2]="Connecting",e[e.Disconnected=3]="Disconnected"}(He||(He={})),function(e){e[e.Error=0]="Error",e[e.EndOfStream=1]="EndOfStream"}(Ue||(Ue={})),function(e){e[e.NoError=0]="NoError",e[e.AuthenticationFailure=1]="AuthenticationFailure",e[e.BadRequestParameters=2]="BadRequestParameters",e[e.TooManyRequests=3]="TooManyRequests",e[e.ConnectionFailure=4]="ConnectionFailure",e[e.ServiceTimeout=5]="ServiceTimeout",e[e.ServiceError=6]="ServiceError",e[e.RuntimeError=7]="RuntimeError",e[e.Forbidden=8]="Forbidden"}(Ke||(Ke={}));class at{constructor(e){this.privResult=e}get result(){return this.privResult}}class ct extends class{constructor(e,t,i,n){this.privResultId=e,this.privReason=t,this.privErrorDetails=i,this.privProperties=n}get resultId(){return this.privResultId}get reason(){return this.privReason}get errorDetails(){return this.privErrorDetails}get properties(){return this.privProperties}}{constructor(e,t,i,n,r,s){super(e,t,n,r),this.privAudioData=i,this.privAudioDuration=s}get audioData(){return this.privAudioData}get audioDuration(){return this.privAudioDuration}}!function(e){e[e.NoMatch=0]="NoMatch",e[e.Canceled=1]="Canceled",e[e.RecognizingSpeech=2]="RecognizingSpeech",e[e.RecognizedSpeech=3]="RecognizedSpeech",e[e.RecognizedKeyword=4]="RecognizedKeyword",e[e.RecognizingIntent=5]="RecognizingIntent",e[e.RecognizedIntent=6]="RecognizedIntent",e[e.TranslatingSpeech=7]="TranslatingSpeech",e[e.TranslatedSpeech=8]="TranslatedSpeech",e[e.SynthesizingAudio=9]="SynthesizingAudio",e[e.SynthesizingAudioCompleted=10]="SynthesizingAudioCompleted",e[e.SynthesizingAudioStarted=11]="SynthesizingAudioStarted",e[e.EnrollingVoiceProfile=12]="EnrollingVoiceProfile",e[e.EnrolledVoiceProfile=13]="EnrolledVoiceProfile",e[e.RecognizedSpeakers=14]="RecognizedSpeakers",e[e.RecognizedSpeaker=15]="RecognizedSpeaker",e[e.ResetVoiceProfile=16]="ResetVoiceProfile",e[e.DeletedVoiceProfile=17]="DeletedVoiceProfile",e[e.VoicesListRetrieved=18]="VoicesListRetrieved"}(qe||(qe={}));class pt{constructor(e,t,i,n,r,s){this.privAudioOffset=e,this.privDuration=t,this.privText=i,this.privWordLength=n,this.privTextOffset=r,this.privBoundaryType=s}get audioOffset(){return this.privAudioOffset}get duration(){return this.privDuration}get text(){return this.privText}get wordLength(){return this.privWordLength}get textOffset(){return this.privTextOffset}get boundaryType(){return this.privBoundaryType}}class ut{constructor(e,t){this.privAudioOffset=e,this.privText=t}get audioOffset(){return this.privAudioOffset}get text(){return this.privText}}class ht{constructor(e,t,i){this.privAudioOffset=e,this.privVisemeId=t,this.privAnimation=i}get audioOffset(){return this.privAudioOffset}get visemeId(){return this.privVisemeId}get animation(){return this.privAnimation}}class dt extends xe{constructor(e,t,i,n,r,s,o,a,c){super(i,s,t,e),this.formatTag=e,this.avgBytesPerSec=n,this.blockAlign=r,this.priAudioFormatString=o,this.priRequestAudioFormatString=a,this.priHasHeader=c}static fromSpeechSynthesisOutputFormat(e){return void 0===e?dt.getDefaultOutputFormat():dt.fromSpeechSynthesisOutputFormatString(dt.SpeechSynthesisOutputFormatToString[e])}static fromSpeechSynthesisOutputFormatString(e){switch(e){case"raw-8khz-8bit-mono-mulaw":return new dt(Te.MuLaw,1,8e3,8e3,1,8,e,e,!1);case"riff-16khz-16kbps-mono-siren":return new dt(Te.Siren,1,16e3,2e3,40,0,e,"audio-16khz-16kbps-mono-siren",!0);case"audio-16khz-16kbps-mono-siren":return new dt(Te.Siren,1,16e3,2e3,40,0,e,e,!1);case"audio-16khz-32kbitrate-mono-mp3":return new dt(Te.MP3,1,16e3,4096,2,16,e,e,!1);case"audio-16khz-128kbitrate-mono-mp3":return new dt(Te.MP3,1,16e3,16384,2,16,e,e,!1);case"audio-16khz-64kbitrate-mono-mp3":return new dt(Te.MP3,1,16e3,8192,2,16,e,e,!1);case"audio-24khz-48kbitrate-mono-mp3":return new dt(Te.MP3,1,24e3,6144,2,16,e,e,!1);case"audio-24khz-96kbitrate-mono-mp3":return new dt(Te.MP3,1,24e3,12288,2,16,e,e,!1);case"audio-24khz-160kbitrate-mono-mp3":return new dt(Te.MP3,1,24e3,20480,2,16,e,e,!1);case"raw-16khz-16bit-mono-truesilk":return new dt(Te.SILKSkype,1,16e3,32e3,2,16,e,e,!1);case"riff-8khz-16bit-mono-pcm":return new dt(Te.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!0);case"riff-24khz-16bit-mono-pcm":return new dt(Te.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!0);case"riff-8khz-8bit-mono-mulaw":return new dt(Te.MuLaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-mulaw",!0);case"raw-16khz-16bit-mono-pcm":return new dt(Te.PCM,1,16e3,32e3,2,16,e,"raw-16khz-16bit-mono-pcm",!1);case"raw-24khz-16bit-mono-pcm":return new dt(Te.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!1);case"raw-8khz-16bit-mono-pcm":return new dt(Te.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!1);case"ogg-16khz-16bit-mono-opus":return new dt(Te.OGG_OPUS,1,16e3,8192,2,16,e,e,!1);case"ogg-24khz-16bit-mono-opus":return new dt(Te.OGG_OPUS,1,24e3,8192,2,16,e,e,!1);case"raw-48khz-16bit-mono-pcm":return new dt(Te.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!1);case"riff-48khz-16bit-mono-pcm":return new dt(Te.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!0);case"audio-48khz-96kbitrate-mono-mp3":return new dt(Te.MP3,1,48e3,12288,2,16,e,e,!1);case"audio-48khz-192kbitrate-mono-mp3":return new dt(Te.MP3,1,48e3,24576,2,16,e,e,!1);case"ogg-48khz-16bit-mono-opus":return new dt(Te.OGG_OPUS,1,48e3,12e3,2,16,e,e,!1);case"webm-16khz-16bit-mono-opus":return new dt(Te.WEBM_OPUS,1,16e3,4e3,2,16,e,e,!1);case"webm-24khz-16bit-mono-opus":return new dt(Te.WEBM_OPUS,1,24e3,6e3,2,16,e,e,!1);case"webm-24khz-16bit-24kbps-mono-opus":return new dt(Te.WEBM_OPUS,1,24e3,3e3,2,16,e,e,!1);case"audio-16khz-16bit-32kbps-mono-opus":return new dt(Te.OPUS,1,16e3,4e3,2,16,e,e,!1);case"audio-24khz-16bit-48kbps-mono-opus":return new dt(Te.OPUS,1,24e3,6e3,2,16,e,e,!1);case"audio-24khz-16bit-24kbps-mono-opus":return new dt(Te.OPUS,1,24e3,3e3,2,16,e,e,!1);case"audio-24khz-16bit-mono-flac":return new dt(Te.FLAC,1,24e3,24e3,2,16,e,e,!1);case"audio-48khz-16bit-mono-flac":return new dt(Te.FLAC,1,48e3,3e4,2,16,e,e,!1);case"raw-24khz-16bit-mono-truesilk":return new dt(Te.SILKSkype,1,24e3,48e3,2,16,e,e,!1);case"raw-8khz-8bit-mono-alaw":return new dt(Te.ALaw,1,8e3,8e3,1,8,e,e,!1);case"riff-8khz-8bit-mono-alaw":return new dt(Te.ALaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-alaw",!0);case"raw-22050hz-16bit-mono-pcm":return new dt(Te.PCM,1,22050,44100,2,16,e,e,!1);case"riff-22050hz-16bit-mono-pcm":return new dt(Te.PCM,1,22050,44100,2,16,e,"raw-22050hz-16bit-mono-pcm",!0);case"raw-44100hz-16bit-mono-pcm":return new dt(Te.PCM,1,44100,88200,2,16,e,e,!1);case"riff-44100hz-16bit-mono-pcm":return new dt(Te.PCM,1,44100,88200,2,16,e,"raw-44100hz-16bit-mono-pcm",!0);default:return new dt(Te.PCM,1,16e3,32e3,2,16,"riff-16khz-16bit-mono-pcm","raw-16khz-16bit-mono-pcm",!0)}}static getDefaultOutputFormat(){return dt.fromSpeechSynthesisOutputFormatString("undefined"!=typeof window?"audio-24khz-48kbitrate-mono-mp3":"riff-16khz-16bit-mono-pcm")}get hasHeader(){return this.priHasHeader}get header(){if(this.hasHeader)return this.privHeader}updateHeader(e){if(this.priHasHeader){const t=new DataView(this.privHeader);t.setUint32(4,e+this.privHeader.byteLength-8,!0),t.setUint32(40,e,!0)}}get requestAudioFormatString(){return this.priRequestAudioFormatString}}dt.SpeechSynthesisOutputFormatToString={[N.Raw8Khz8BitMonoMULaw]:"raw-8khz-8bit-mono-mulaw",[N.Riff16Khz16KbpsMonoSiren]:"riff-16khz-16kbps-mono-siren",[N.Audio16Khz16KbpsMonoSiren]:"audio-16khz-16kbps-mono-siren",[N.Audio16Khz32KBitRateMonoMp3]:"audio-16khz-32kbitrate-mono-mp3",[N.Audio16Khz128KBitRateMonoMp3]:"audio-16khz-128kbitrate-mono-mp3",[N.Audio16Khz64KBitRateMonoMp3]:"audio-16khz-64kbitrate-mono-mp3",[N.Audio24Khz48KBitRateMonoMp3]:"audio-24khz-48kbitrate-mono-mp3",[N.Audio24Khz96KBitRateMonoMp3]:"audio-24khz-96kbitrate-mono-mp3",[N.Audio24Khz160KBitRateMonoMp3]:"audio-24khz-160kbitrate-mono-mp3",[N.Raw16Khz16BitMonoTrueSilk]:"raw-16khz-16bit-mono-truesilk",[N.Riff16Khz16BitMonoPcm]:"riff-16khz-16bit-mono-pcm",[N.Riff8Khz16BitMonoPcm]:"riff-8khz-16bit-mono-pcm",[N.Riff24Khz16BitMonoPcm]:"riff-24khz-16bit-mono-pcm",[N.Riff8Khz8BitMonoMULaw]:"riff-8khz-8bit-mono-mulaw",[N.Raw16Khz16BitMonoPcm]:"raw-16khz-16bit-mono-pcm",[N.Raw24Khz16BitMonoPcm]:"raw-24khz-16bit-mono-pcm",[N.Raw8Khz16BitMonoPcm]:"raw-8khz-16bit-mono-pcm",[N.Ogg16Khz16BitMonoOpus]:"ogg-16khz-16bit-mono-opus",[N.Ogg24Khz16BitMonoOpus]:"ogg-24khz-16bit-mono-opus",[N.Raw48Khz16BitMonoPcm]:"raw-48khz-16bit-mono-pcm",[N.Riff48Khz16BitMonoPcm]:"riff-48khz-16bit-mono-pcm",[N.Audio48Khz96KBitRateMonoMp3]:"audio-48khz-96kbitrate-mono-mp3",[N.Audio48Khz192KBitRateMonoMp3]:"audio-48khz-192kbitrate-mono-mp3",[N.Ogg48Khz16BitMonoOpus]:"ogg-48khz-16bit-mono-opus",[N.Webm16Khz16BitMonoOpus]:"webm-16khz-16bit-mono-opus",[N.Webm24Khz16BitMonoOpus]:"webm-24khz-16bit-mono-opus",[N.Webm24Khz16Bit24KbpsMonoOpus]:"webm-24khz-16bit-24kbps-mono-opus",[N.Raw24Khz16BitMonoTrueSilk]:"raw-24khz-16bit-mono-truesilk",[N.Raw8Khz8BitMonoALaw]:"raw-8khz-8bit-mono-alaw",[N.Riff8Khz8BitMonoALaw]:"riff-8khz-8bit-mono-alaw",[N.Audio16Khz16Bit32KbpsMonoOpus]:"audio-16khz-16bit-32kbps-mono-opus",[N.Audio24Khz16Bit48KbpsMonoOpus]:"audio-24khz-16bit-48kbps-mono-opus",[N.Audio24Khz16Bit24KbpsMonoOpus]:"audio-24khz-16bit-24kbps-mono-opus",[N.Raw22050Hz16BitMonoPcm]:"raw-22050hz-16bit-mono-pcm",[N.Riff22050Hz16BitMonoPcm]:"riff-22050hz-16bit-mono-pcm",[N.Raw44100Hz16BitMonoPcm]:"raw-44100hz-16bit-mono-pcm",[N.Riff44100Hz16BitMonoPcm]:"riff-44100hz-16bit-mono-pcm"};var lt;class vt{constructor(){}static createPullStream(){return gt.create()}}class gt extends vt{static create(){return new ft}}class ft extends gt{constructor(){super(),this.privId=se(),this.privStream=new De}set format(e){null==e&&(this.privFormat=dt.getDefaultOutputFormat()),this.privFormat=e}get format(){return this.privFormat}get isClosed(){return this.privStream.isClosed}id(){return this.privId}read(e){return t=this,i=void 0,r=function*(){const t=new Int8Array(e);let i=0;if(void 0!==this.privLastChunkView){if(this.privLastChunkView.length>e.byteLength)return t.set(this.privLastChunkView.slice(0,e.byteLength)),this.privLastChunkView=this.privLastChunkView.slice(e.byteLength),Promise.resolve(e.byteLength);t.set(this.privLastChunkView),i=this.privLastChunkView.length,this.privLastChunkView=void 0}for(;i<e.byteLength&&!this.privStream.isReadEnded;){const n=yield this.privStream.read();if(void 0===n||n.isEnd)this.privStream.readEnded();else{let r;n.buffer.byteLength>e.byteLength-i?(r=n.buffer.slice(0,e.byteLength-i),this.privLastChunkView=new Int8Array(n.buffer.slice(e.byteLength-i))):r=n.buffer,t.set(new Int8Array(r),i),i+=r.byteLength}}return i},new((n=void 0)||(n=Promise))((function(e,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}c((r=r.apply(t,i||[])).next())}));var t,i,n,r}write(e){L.throwIfNullOrUndefined(this.privStream,"must set format before writing"),this.privStream.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}close(){this.privStream.close()}}class mt extends vt{constructor(){super()}static create(e){return new _t(e)}}class _t extends mt{constructor(e){super(),this.privId=se(),this.privCallback=e}set format(e){}write(e){this.privCallback.write&&this.privCallback.write(e)}close(){this.privCallback.close&&this.privCallback.close()}id(){return this.privId}}!function(e){e.WordBoundary="WordBoundary",e.Bookmark="Bookmark",e.Viseme="Viseme",e.SentenceBoundary="SentenceBoundary",e.SessionEnd="SessionEnd"}(lt||(lt={}));class St{constructor(e){this.privSynthesisAudioMetadata=JSON.parse(e)}static fromJSON(e){return new St(e)}get Metadata(){return this.privSynthesisAudioMetadata.Metadata}}class yt extends ge{constructor(e,t,i=he.Info){super(e,i),this.privRequestId=t}get requestId(){return this.privRequestId}}class At extends yt{constructor(e,t,i){super("SynthesisTriggeredEvent",e),this.privSessionAudioDestinationId=t,this.privTurnAudioDestinationId=i}get audioSessionDestinationId(){return this.privSessionAudioDestinationId}get audioTurnDestinationId(){return this.privTurnAudioDestinationId}}class Ct extends yt{constructor(e,t){super("ConnectingToSynthesisServiceEvent",e),this.privAuthFetchEventId=t}get authFetchEventId(){return this.privAuthFetchEventId}}class wt extends yt{constructor(e,t){super("SynthesisStartedEvent",e),this.privAuthFetchEventId=t}get authFetchEventId(){return this.privAuthFetchEventId}}var bt=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class It{constructor(){this.privIsDisposed=!1,this.privIsSynthesizing=!1,this.privIsSynthesisEnded=!1,this.privBytesReceived=0,this.privInTurn=!1,this.privTextOffset=0,this.privNextSearchTextIndex=0,this.privSentenceOffset=0,this.privNextSearchSentenceIndex=0,this.privRequestId=se(),this.privTurnDeferral=new le,this.privTurnDeferral.resolve()}get requestId(){return this.privRequestId}get streamId(){return this.privStreamId}set streamId(e){this.privStreamId=e}get audioOutputFormat(){return this.privAudioOutputFormat}set audioOutputFormat(e){this.privAudioOutputFormat=e}get turnCompletionPromise(){return this.privTurnDeferral.promise}get isSynthesisEnded(){return this.privIsSynthesisEnded}get isSynthesizing(){return this.privIsSynthesizing}get currentTextOffset(){return this.privTextOffset}get currentSentenceOffset(){return this.privSentenceOffset}get bytesReceived(){return this.privBytesReceived}get audioDuration(){return this.privAudioDuration}getAllReceivedAudio(){return bt(this,void 0,void 0,(function*(){return this.privReceivedAudio?Promise.resolve(this.privReceivedAudio):this.privIsSynthesisEnded?(yield this.readAllAudioFromStream(),Promise.resolve(this.privReceivedAudio)):null}))}getAllReceivedAudioWithHeader(){return bt(this,void 0,void 0,(function*(){if(this.privReceivedAudioWithHeader)return this.privReceivedAudioWithHeader;if(!this.privIsSynthesisEnded)return null;if(this.audioOutputFormat.hasHeader){const e=yield this.getAllReceivedAudio();return this.privReceivedAudioWithHeader=Dt.addHeader(e,this.audioOutputFormat),this.privReceivedAudioWithHeader}return this.getAllReceivedAudio()}))}startNewSynthesis(e,t,i,n){this.privIsSynthesisEnded=!1,this.privIsSynthesizing=!0,this.privRequestId=e,this.privRawText=t,this.privIsSSML=i,this.privAudioOutputStream=new ft,this.privAudioOutputStream.format=this.privAudioOutputFormat,this.privReceivedAudio=null,this.privReceivedAudioWithHeader=null,this.privBytesReceived=0,this.privTextOffset=0,this.privNextSearchTextIndex=0,this.privSentenceOffset=0,this.privNextSearchSentenceIndex=0,this.privPartialVisemeAnimation="",void 0!==n&&(this.privTurnAudioDestination=n,this.privTurnAudioDestination.format=this.privAudioOutputFormat),this.onEvent(new At(this.requestId,void 0,void 0===n?void 0:n.id()))}onPreConnectionStart(e){this.privAuthFetchEventId=e,this.onEvent(new Ct(this.privRequestId,this.privAuthFetchEventId))}onAuthCompleted(e){e&&this.onComplete()}onConnectionEstablishCompleted(e){if(200===e)return this.onEvent(new wt(this.requestId,this.privAuthFetchEventId)),void(this.privBytesReceived=0);403===e&&this.onComplete()}onServiceResponseMessage(e){const t=JSON.parse(e);this.streamId=t.audio.streamId}onServiceTurnEndResponse(){this.privInTurn=!1,this.privTurnDeferral.resolve(),this.onComplete()}onServiceTurnStartResponse(){this.privTurnDeferral&&this.privInTurn&&(this.privTurnDeferral.reject("Another turn started before current completed."),this.privTurnDeferral.promise.then().catch((()=>{}))),this.privInTurn=!0,this.privTurnDeferral=new le}onAudioChunkReceived(e){this.isSynthesizing&&(this.privAudioOutputStream.write(e),this.privBytesReceived+=e.byteLength,void 0!==this.privTurnAudioDestination&&this.privTurnAudioDestination.write(e))}onTextBoundaryEvent(e){this.updateTextOffset(e.Data.text.Text,e.Type)}onVisemeMetadataReceived(e){void 0!==e.Data.AnimationChunk&&(this.privPartialVisemeAnimation+=e.Data.AnimationChunk)}onSessionEnd(e){this.privAudioDuration=e.Data.Offset}dispose(){this.privIsDisposed||(this.privIsDisposed=!0)}onStopSynthesizing(){this.onComplete()}getAndClearVisemeAnimation(){const e=this.privPartialVisemeAnimation;return this.privPartialVisemeAnimation="",e}onEvent(e){Oe.instance.onEvent(e)}static isXmlTag(e){return e.length>=2&&"<"===e[0]&&">"===e[e.length-1]}updateTextOffset(e,t){t===lt.WordBoundary?(this.privTextOffset=this.privRawText.indexOf(e,this.privNextSearchTextIndex),this.privTextOffset>=0&&(this.privNextSearchTextIndex=this.privTextOffset+e.length,this.privIsSSML&&this.withinXmlTag(this.privTextOffset)&&!It.isXmlTag(e)&&this.updateTextOffset(e,t))):(this.privSentenceOffset=this.privRawText.indexOf(e,this.privNextSearchSentenceIndex),this.privSentenceOffset>=0&&(this.privNextSearchSentenceIndex=this.privSentenceOffset+e.length,this.privIsSSML&&this.withinXmlTag(this.privSentenceOffset)&&!It.isXmlTag(e)&&this.updateTextOffset(e,t)))}onComplete(){this.privIsSynthesizing&&(this.privIsSynthesizing=!1,this.privIsSynthesisEnded=!0,this.privAudioOutputStream.close(),this.privInTurn=!1,void 0!==this.privTurnAudioDestination&&(this.privTurnAudioDestination.close(),this.privTurnAudioDestination=void 0))}readAllAudioFromStream(){return bt(this,void 0,void 0,(function*(){if(this.privIsSynthesisEnded){this.privReceivedAudio=new ArrayBuffer(this.bytesReceived);try{yield this.privAudioOutputStream.read(this.privReceivedAudio)}catch(e){this.privReceivedAudio=new ArrayBuffer(0)}}}))}withinXmlTag(e){return this.privRawText.indexOf("<",e+1)>this.privRawText.indexOf(">",e+1)}}class Rt{constructor(e){this.privContext={},this.privSpeechSynthesizer=e}setSection(e,t){this.privContext[e]=t}set audioOutputFormat(e){this.privAudioOutputFormat=e}toJSON(){const e=this.buildSynthesisContext();return this.setSection("synthesis",e),JSON.stringify(this.privContext)}buildSynthesisContext(){return{audio:{metadataOptions:{bookmarkEnabled:!!this.privSpeechSynthesizer.bookmarkReached,punctuationBoundaryEnabled:this.privSpeechSynthesizer.properties.getProperty(x.SpeechServiceResponse_RequestPunctuationBoundary,!!this.privSpeechSynthesizer.wordBoundary),sentenceBoundaryEnabled:this.privSpeechSynthesizer.properties.getProperty(x.SpeechServiceResponse_RequestSentenceBoundary,!1),sessionEndEnabled:!0,visemeEnabled:!!this.privSpeechSynthesizer.visemeReceived,wordBoundaryEnabled:this.privSpeechSynthesizer.properties.getProperty(x.SpeechServiceResponse_RequestWordBoundary,!!this.privSpeechSynthesizer.wordBoundary)},outputFormat:this.privAudioOutputFormat.requestAudioFormatString},language:{autoDetection:this.privSpeechSynthesizer.autoDetectSourceLanguage}}}}class kt{toJsonString(){return JSON.stringify(this.iPrivConfig)}get(){return this.iPrivConfig}set(e){this.iPrivConfig=e}}class Et{}Et.AuthKey="Ocp-Apim-Subscription-Key",Et.Authorization="Authorization",Et.SpIDAuthKey="Apim-Subscription-Id",Et.ConnectionId="X-ConnectionId",Et.ContentType="Content-Type",Et.CustomCommandsAppId="X-CommandsAppId",Et.Path="Path",Et.RequestId="X-RequestId",Et.RequestStreamId="X-StreamId",Et.RequestTimestamp="X-Timestamp";class Pt extends Ze{constructor(e,t,i,n,r,s,o,a){if(!t)throw new oe("path");if(!i)throw new oe("requestId");const c={};if(c[Et.Path]=t,c[Et.RequestId]=i,c[Et.RequestTimestamp]=(new Date).toISOString(),n&&(c[Et.ContentType]=n),s&&(c[Et.RequestStreamId]=s),o)for(const e in o)e&&(c[e]=o[e]);a?super(e,r,c,a):super(e,r,c),this.privPath=t,this.privRequestId=i,this.privContentType=n,this.privStreamId=s,this.privAdditionalHeaders=o}get path(){return this.privPath}get requestId(){return this.privRequestId}get contentType(){return this.privContentType}get streamId(){return this.privStreamId}get additionalHeaders(){return this.privAdditionalHeaders}static fromConnectionMessage(e){let t=null,i=null,n=null,r=null;const s={};if(e.headers)for(const o in e.headers)o&&(o.toLowerCase()===Et.Path.toLowerCase()?t=e.headers[o]:o.toLowerCase()===Et.RequestId.toLowerCase()?i=e.headers[o]:o.toLowerCase()===Et.ContentType.toLowerCase()?n=e.headers[o]:o.toLowerCase()===Et.RequestStreamId.toLowerCase()?r=e.headers[o]:s[o]=e.headers[o]);return new Pt(e.messageType,t,i,n,e.body,r,s,e.id)}}var Tt=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class Dt{constructor(e,t,i,n,r){if(this.speakOverride=void 0,this.receiveMessageOverride=void 0,this.connectImplOverride=void 0,this.configConnectionOverride=void 0,this.privConnectionConfigurationPromise=void 0,!e)throw new oe("authentication");if(!t)throw new oe("connectionFactory");if(!i)throw new oe("synthesizerConfig");this.privAuthentication=e,this.privConnectionFactory=t,this.privSynthesizerConfig=i,this.privIsDisposed=!1,this.privSpeechSynthesizer=n,this.privSessionAudioDestination=r,this.privSynthesisTurn=new It,this.privConnectionEvents=new pe,this.privServiceEvents=new pe,this.privSynthesisContext=new Rt(this.privSpeechSynthesizer),this.privAgentConfig=new kt,this.connectionEvents.attach((e=>{if("ConnectionClosedEvent"===e.name){const t=e;1e3!==t.statusCode&&this.cancelSynthesisLocal(Ue.Error,1007===t.statusCode?Ke.BadRequestParameters:Ke.ConnectionFailure,`${t.reason} websocket error code: ${t.statusCode}`)}}))}get synthesisContext(){return this.privSynthesisContext}get agentConfig(){return this.privAgentConfig}get connectionEvents(){return this.privConnectionEvents}get serviceEvents(){return this.privServiceEvents}set activityTemplate(e){this.privActivityTemplate=e}get activityTemplate(){return this.privActivityTemplate}set audioOutputFormat(e){this.privAudioOutputFormat=e,this.privSynthesisTurn.audioOutputFormat=e,void 0!==this.privSessionAudioDestination&&(this.privSessionAudioDestination.format=e),void 0!==this.synthesisContext&&(this.synthesisContext.audioOutputFormat=e)}static addHeader(e,t){if(!t.hasHeader)return e;t.updateHeader(e.byteLength);const i=new Uint8Array(e.byteLength+t.header.byteLength);return i.set(new Uint8Array(t.header),0),i.set(new Uint8Array(e),t.header.byteLength),i.buffer}isDisposed(){return this.privIsDisposed}dispose(e){return Tt(this,void 0,void 0,(function*(){if(this.privIsDisposed=!0,void 0!==this.privSessionAudioDestination&&this.privSessionAudioDestination.close(),void 0!==this.privConnectionConfigurationPromise){const t=yield this.privConnectionConfigurationPromise;yield t.dispose(e)}}))}connect(){return Tt(this,void 0,void 0,(function*(){yield this.connectImpl()}))}sendNetworkMessage(e,t){return Tt(this,void 0,void 0,(function*(){const i="string"==typeof t?Fe.Text:Fe.Binary,n="string"==typeof t?"application/json":"";return(yield this.fetchConnection()).send(new Pt(i,e,this.privSynthesisTurn.requestId,n,t))}))}Speak(e,t,i,n,r,s){return Tt(this,void 0,void 0,(function*(){let o;if(o=t?e:this.privSpeechSynthesizer.buildSsml(e),void 0!==this.speakOverride)return this.speakOverride(o,i,n,r);this.privSuccessCallback=n,this.privErrorCallback=r,this.privSynthesisTurn.startNewSynthesis(i,e,t,s);try{yield this.connectImpl();const e=yield this.fetchConnection();yield this.sendSynthesisContext(e),yield this.sendSsmlMessage(e,o,i);const t=new at(new ct(i,qe.SynthesizingAudioStarted));this.privSpeechSynthesizer.synthesisStarted&&this.privSpeechSynthesizer.synthesisStarted(this.privSpeechSynthesizer,t),this.receiveMessage()}catch(e){return this.cancelSynthesisLocal(Ue.Error,Ke.ConnectionFailure,e),Promise.reject(e)}}))}cancelSynthesis(e,t,i,n){const r=new K;r.setProperty(D,Ke[i]);const s=new ct(e,qe.Canceled,void 0,n,r);if(this.privSpeechSynthesizer.SynthesisCanceled){const e=new at(s);try{this.privSpeechSynthesizer.SynthesisCanceled(this.privSpeechSynthesizer,e)}catch(e){}}if(this.privSuccessCallback)try{this.privSuccessCallback(s)}catch(e){}}cancelSynthesisLocal(e,t,i){this.privSynthesisTurn.isSynthesizing&&(this.privSynthesisTurn.onStopSynthesizing(),this.cancelSynthesis(this.privSynthesisTurn.requestId,e,t,i))}processTypeSpecificMessages(e){return!0}receiveMessage(){return Tt(this,void 0,void 0,(function*(){try{const e=yield this.fetchConnection(),t=yield e.read();if(void 0!==this.receiveMessageOverride)return this.receiveMessageOverride();if(this.privIsDisposed)return;if(!t)return this.privSynthesisTurn.isSynthesizing?this.receiveMessage():void 0;const i=Pt.fromConnectionMessage(t);if(i.requestId.toLowerCase()===this.privSynthesisTurn.requestId.toLowerCase())switch(i.path.toLowerCase()){case"turn.start":this.privSynthesisTurn.onServiceTurnStartResponse();break;case"response":this.privSynthesisTurn.onServiceResponseMessage(i.textBody);break;case"audio":if(this.privSynthesisTurn.streamId.toLowerCase()===i.streamId.toLowerCase()&&i.binaryBody){if(this.privSynthesisTurn.onAudioChunkReceived(i.binaryBody),this.privSpeechSynthesizer.synthesizing)try{const e=Dt.addHeader(i.binaryBody,this.privSynthesisTurn.audioOutputFormat),t=new at(new ct(this.privSynthesisTurn.requestId,qe.SynthesizingAudio,e));this.privSpeechSynthesizer.synthesizing(this.privSpeechSynthesizer,t)}catch(e){}void 0!==this.privSessionAudioDestination&&this.privSessionAudioDestination.write(i.binaryBody)}break;case"audio.metadata":const e=St.fromJSON(i.textBody).Metadata;for(const t of e)switch(t.Type){case lt.WordBoundary:case lt.SentenceBoundary:this.privSynthesisTurn.onTextBoundaryEvent(t);const e=new pt(t.Data.Offset,t.Data.Duration,t.Data.text.Text,t.Data.text.Length,t.Type===lt.WordBoundary?this.privSynthesisTurn.currentTextOffset:this.privSynthesisTurn.currentSentenceOffset,t.Data.text.BoundaryType);if(this.privSpeechSynthesizer.wordBoundary)try{this.privSpeechSynthesizer.wordBoundary(this.privSpeechSynthesizer,e)}catch(e){}break;case lt.Bookmark:const i=new ut(t.Data.Offset,t.Data.Bookmark);if(this.privSpeechSynthesizer.bookmarkReached)try{this.privSpeechSynthesizer.bookmarkReached(this.privSpeechSynthesizer,i)}catch(e){}break;case lt.Viseme:if(this.privSynthesisTurn.onVisemeMetadataReceived(t),t.Data.IsLastAnimation){const e=new ht(t.Data.Offset,t.Data.VisemeId,this.privSynthesisTurn.getAndClearVisemeAnimation());if(this.privSpeechSynthesizer.visemeReceived)try{this.privSpeechSynthesizer.visemeReceived(this.privSpeechSynthesizer,e)}catch(e){}}break;case lt.SessionEnd:this.privSynthesisTurn.onSessionEnd(t)}break;case"turn.end":let t;this.privSynthesisTurn.onServiceTurnEndResponse();try{const e=yield this.privSynthesisTurn.getAllReceivedAudioWithHeader();t=new ct(this.privSynthesisTurn.requestId,qe.SynthesizingAudioCompleted,e,void 0,void 0,this.privSynthesisTurn.audioDuration),this.privSuccessCallback&&this.privSuccessCallback(t)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}if(this.privSpeechSynthesizer.synthesisCompleted)try{this.privSpeechSynthesizer.synthesisCompleted(this.privSpeechSynthesizer,new at(t))}catch(e){}break;default:this.processTypeSpecificMessages(i)||this.privServiceEvents&&this.serviceEvents.onEvent(new Ye(i.path.toLowerCase(),i.textBody))}return this.receiveMessage()}catch(e){}}))}sendSynthesisContext(e){const t=this.synthesisContext.toJSON();if(t)return e.send(new Pt(Fe.Text,"synthesis.context",this.privSynthesisTurn.requestId,"application/json",t))}connectImpl(e=!1){if(null!=this.privConnectionPromise)return this.privConnectionPromise.then((e=>e.state()===He.Disconnected?(this.privConnectionId=null,this.privConnectionPromise=null,this.connectImpl()):this.privConnectionPromise),(()=>(this.privConnectionId=null,this.privConnectionPromise=null,this.connectImpl())));this.privAuthFetchEventId=se(),this.privConnectionId=se(),this.privSynthesisTurn.onPreConnectionStart(this.privAuthFetchEventId);const t=e?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId);return this.privConnectionPromise=t.then((t=>Tt(this,void 0,void 0,(function*(){this.privSynthesisTurn.onAuthCompleted(!1);const i=this.privConnectionFactory.create(this.privSynthesizerConfig,t,this.privConnectionId);i.events.attach((e=>{this.connectionEvents.onEvent(e)}));const n=yield i.open();return 200===n.statusCode?(this.privSynthesisTurn.onConnectionEstablishCompleted(n.statusCode),Promise.resolve(i)):403!==n.statusCode||e?(this.privSynthesisTurn.onConnectionEstablishCompleted(n.statusCode),Promise.reject(`Unable to contact server. StatusCode: ${n.statusCode}, ${this.privSynthesizerConfig.parameters.getProperty(x.SpeechServiceConnection_Endpoint)} Reason: ${n.reason}`)):this.connectImpl(!0)}))),(e=>{throw this.privSynthesisTurn.onAuthCompleted(!0),new Error(e)})),this.privConnectionPromise.catch((()=>{})),this.privConnectionPromise}sendSpeechServiceConfig(e,t){if(t)return e.send(new Pt(Fe.Text,"speech.config",this.privSynthesisTurn.requestId,"application/json",t))}sendSsmlMessage(e,t,i){return e.send(new Pt(Fe.Text,"ssml",i,"application/ssml+xml",t))}fetchConnection(){return Tt(this,void 0,void 0,(function*(){return void 0!==this.privConnectionConfigurationPromise?this.privConnectionConfigurationPromise.then((e=>e.state()===He.Disconnected?(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.fetchConnection()):this.privConnectionConfigurationPromise),(()=>(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.fetchConnection()))):(this.privConnectionConfigurationPromise=this.configureConnection(),yield this.privConnectionConfigurationPromise)}))}configureConnection(){return Tt(this,void 0,void 0,(function*(){const e=yield this.connectImpl();return void 0!==this.configConnectionOverride?this.configConnectionOverride(e):(yield this.sendSpeechServiceConfig(e,this.privSynthesizerConfig.SpeechServiceConfig.serialize()),e)}))}}Dt.telemetryDataEnabled=!0;class Mt extends ge{constructor(e){super("BackgroundEvent",he.Error),this.privError=e}get error(){return this.privError}}var Ot=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};const Lt={[Te.PCM]:"audio/wav",[Te.MuLaw]:"audio/x-wav",[Te.MP3]:"audio/mpeg",[Te.OGG_OPUS]:"audio/ogg",[Te.WEBM_OPUS]:"audio/webm; codecs=opus",[Te.ALaw]:"audio/x-wav",[Te.FLAC]:"audio/flac"};class xt{constructor(e){this.privPlaybackStarted=!1,this.privAppendingToBuffer=!1,this.privMediaSourceOpened=!1,this.privBytesReceived=0,this.privId=e||se(),this.privIsPaused=!1,this.privIsClosed=!1}id(){return this.privId}write(e,t,i){void 0!==this.privAudioBuffer?(this.privAudioBuffer.push(e),this.updateSourceBuffer().then((()=>{t&&t()}),(e=>{i&&i(e)}))):void 0!==this.privAudioOutputStream&&(this.privAudioOutputStream.write(e),this.privBytesReceived+=e.byteLength)}close(e,t){if(this.privIsClosed=!0,void 0!==this.privSourceBuffer)this.handleSourceBufferUpdateEnd().then((()=>{e&&e()}),(e=>{t&&t(e)}));else if(void 0!==this.privAudioOutputStream&&"undefined"!=typeof window)if(this.privFormat.formatTag!==Te.PCM&&this.privFormat.formatTag!==Te.MuLaw&&this.privFormat.formatTag!==Te.ALaw||!1!==this.privFormat.hasHeader){let i=new ArrayBuffer(this.privBytesReceived);this.privAudioOutputStream.read(i).then((()=>{i=Dt.addHeader(i,this.privFormat);const n=new Blob([i],{type:Lt[this.privFormat.formatTag]});this.privAudio.src=window.URL.createObjectURL(n),this.notifyPlayback().then((()=>{e&&e()}),(e=>{t&&t(e)}))}),(e=>{t&&t(e)}))}else console.warn("Play back is not supported for raw PCM, mulaw or alaw format without header."),this.onAudioEnd&&this.onAudioEnd(this);else this.onAudioEnd&&this.onAudioEnd(this)}set format(e){if("undefined"!=typeof AudioContext||"undefined"!=typeof window&&void 0!==window.webkitAudioContext){this.privFormat=e;const t=Lt[this.privFormat.formatTag];void 0===t?console.warn(`Unknown mimeType for format ${Te[this.privFormat.formatTag]}; playback is not supported.`):"undefined"!=typeof MediaSource&&MediaSource.isTypeSupported(t)?(this.privAudio=new Audio,this.privAudioBuffer=[],this.privMediaSource=new MediaSource,this.privAudio.src=URL.createObjectURL(this.privMediaSource),this.privAudio.load(),this.privMediaSource.onsourceopen=()=>{this.privMediaSourceOpened=!0,this.privMediaSource.duration=1800,this.privSourceBuffer=this.privMediaSource.addSourceBuffer(t),this.privSourceBuffer.onupdate=()=>{this.updateSourceBuffer().catch((e=>{Oe.instance.onEvent(new Mt(e))}))},this.privSourceBuffer.onupdateend=()=>{this.handleSourceBufferUpdateEnd().catch((e=>{Oe.instance.onEvent(new Mt(e))}))},this.privSourceBuffer.onupdatestart=()=>{this.privAppendingToBuffer=!1}},this.updateSourceBuffer().catch((e=>{Oe.instance.onEvent(new Mt(e))}))):(console.warn(`Format ${Te[this.privFormat.formatTag]} could not be played by MSE, streaming playback is not enabled.`),this.privAudioOutputStream=new ft,this.privAudioOutputStream.format=this.privFormat,this.privAudio=new Audio)}}get volume(){var e,t;return null!==(t=null===(e=this.privAudio)||void 0===e?void 0:e.volume)&&void 0!==t?t:-1}set volume(e){this.privAudio&&(this.privAudio.volume=e)}mute(){this.privAudio&&(this.privAudio.muted=!0)}unmute(){this.privAudio&&(this.privAudio.muted=!1)}get isClosed(){return this.privIsClosed}get currentTime(){return void 0!==this.privAudio?this.privAudio.currentTime:-1}pause(){this.privIsPaused||void 0===this.privAudio||(this.privAudio.pause(),this.privIsPaused=!0)}resume(e,t){this.privIsPaused&&void 0!==this.privAudio&&(this.privAudio.play().then((()=>{e&&e()}),(e=>{t&&t(e)})),this.privIsPaused=!1)}get internalAudio(){return this.privAudio}updateSourceBuffer(){return Ot(this,void 0,void 0,(function*(){if(void 0!==this.privAudioBuffer&&this.privAudioBuffer.length>0&&this.sourceBufferAvailable()){this.privAppendingToBuffer=!0;const e=this.privAudioBuffer.shift();try{this.privSourceBuffer.appendBuffer(e)}catch(t){return this.privAudioBuffer.unshift(e),void console.log("buffer filled, pausing addition of binaries until space is made")}yield this.notifyPlayback()}else this.canEndStream()&&(yield this.handleSourceBufferUpdateEnd())}))}handleSourceBufferUpdateEnd(){return Ot(this,void 0,void 0,(function*(){this.canEndStream()&&this.sourceBufferAvailable()&&(this.privMediaSource.endOfStream(),yield this.notifyPlayback())}))}notifyPlayback(){return Ot(this,void 0,void 0,(function*(){this.privPlaybackStarted||void 0===this.privAudio||(this.privPlaybackStarted=!0,this.onAudioStart&&this.onAudioStart(this),this.privAudio.onended=()=>{this.onAudioEnd&&this.onAudioEnd(this)},this.privIsPaused||(yield this.privAudio.play()))}))}canEndStream(){return this.isClosed&&void 0!==this.privSourceBuffer&&0===this.privAudioBuffer.length&&this.privMediaSourceOpened&&!this.privAppendingToBuffer&&"open"===this.privMediaSource.readyState}sourceBufferAvailable(){return void 0!==this.privSourceBuffer&&!this.privSourceBuffer.updating}}var zt=i(592);class Bt{constructor(e){L.throwIfNullOrUndefined(zt.openSync,"\nFile System access not available, please use Push or PullAudioOutputStream"),this.privFd=zt.openSync(e,"w")}set format(e){L.throwIfNotUndefined(this.privAudioFormat,"format is already set"),this.privAudioFormat=e;let t=0;this.privAudioFormat.hasHeader&&(t=this.privAudioFormat.header.byteLength),void 0!==this.privFd&&(this.privWriteStream=zt.createWriteStream("",{fd:this.privFd,start:t,autoClose:!1}))}write(e){L.throwIfNullOrUndefined(this.privAudioFormat,"must set format before writing."),void 0!==this.privWriteStream&&this.privWriteStream.write(new Uint8Array(e.slice(0)))}close(){void 0!==this.privFd&&(this.privWriteStream.on("finish",(()=>{this.privAudioFormat.hasHeader&&(this.privAudioFormat.updateHeader(this.privWriteStream.bytesWritten),zt.writeSync(this.privFd,new Int8Array(this.privAudioFormat.header),0,this.privAudioFormat.header.byteLength,0)),zt.closeSync(this.privFd),this.privFd=void 0})),this.privWriteStream.end())}id(){return this.privId}}class Nt{static fromDefaultMicrophoneInput(){const e=new X(!0);return new Gt(new Be(e))}static fromMicrophoneInput(e){const t=new X(!0);return new Gt(new Be(t,e))}static fromWavFileInput(e,t="unnamedBuffer.wav"){return new Gt(new Ge(e,t))}static fromStreamInput(e){if(e instanceof class{})return new Gt(new Je(e));if(e instanceof Ve)return new Gt(e);if("undefined"!=typeof MediaStream&&e instanceof MediaStream){const t=new X(!1);return new Gt(new Be(t,null,null,e))}throw new Error("Not Supported Type")}static fromDefaultSpeakerOutput(){return new Ft(new xt)}static fromSpeakerOutput(e){if(void 0===e)return Nt.fromDefaultSpeakerOutput();if(e instanceof xt)return new Ft(e);throw new Error("Not Supported Type")}static fromAudioFileOutput(e){return new Ft(new Bt(e))}static fromStreamOutput(e){if(e instanceof class{})return new Ft(new _t(e));if(e instanceof mt)return new Ft(e);if(e instanceof gt)return new Ft(e);throw new Error("Not Supported Type")}}class Gt extends Nt{constructor(e){super(),this.privSource=e}get format(){return this.privSource.format}close(e,t){this.privSource.turnOff().then((()=>{e&&e()}),(e=>{t&&t(e)}))}id(){return this.privSource.id()}turnOn(){return this.privSource.turnOn()}attach(e){return this.privSource.attach(e)}detach(e){return this.privSource.detach(e)}turnOff(){return this.privSource.turnOff()}get events(){return this.privSource.events}setProperty(e,t){if(L.throwIfNull(t,"value"),void 0===this.privSource.setProperty)throw new Error("This AudioConfig instance does not support setting properties.");this.privSource.setProperty(e,t)}getProperty(e,t){if(void 0!==this.privSource.getProperty)return this.privSource.getProperty(e,t);throw new Error("This AudioConfig instance does not support getting properties.")}get deviceInfo(){return this.privSource.deviceInfo}}class Ft extends Nt{constructor(e){super(),this.privDestination=e}set format(e){this.privDestination.format=e}write(e){this.privDestination.write(e)}close(){this.privDestination.close()}id(){return this.privDestination.id()}setProperty(){throw new Error("This AudioConfig instance does not support setting properties.")}getProperty(){throw new Error("This AudioConfig instance does not support getting properties.")}}var Ht=i(137),Ut=i.n(Ht);class Kt{constructor(e,t){this.privStatusCode=e,this.privReason=t}get statusCode(){return this.privStatusCode}get reason(){return this.privReason}}class qt{constructor(e,t,i){if(this.privPayload=null,!t)throw new oe("payload");if(e===Fe.Binary&&"ArrayBuffer"!==t.__proto__.constructor.name)throw new ae("Payload must be ArrayBuffer");if(e===Fe.Text&&"string"!=typeof t)throw new ae("Payload must be a string");this.privMessageType=e,this.privPayload=t,this.privId=i||se()}get messageType(){return this.privMessageType}get payload(){return this.privPayload}get textContent(){if(this.privMessageType===Fe.Binary)throw new ae("Not supported for binary message");return this.privPayload}get binaryContent(){if(this.privMessageType===Fe.Text)throw new ae("Not supported for text message");return this.privPayload}get id(){return this.privId}}var jt=i(173),Vt=i(339);class Xt extends ge{constructor(e,t,i){super(e,t),this.privSignature=i}}class Wt extends Xt{constructor(e){super("OCSPMemoryCacheHitEvent",he.Debug,e)}}class Qt extends Xt{constructor(e){super("OCSPCacheMissEvent",he.Debug,e)}}class Jt extends Xt{constructor(e){super("OCSPDiskCacheHitEvent",he.Debug,e)}}class Zt extends Xt{constructor(e){super("OCSPCacheUpdateNeededEvent",he.Debug,e)}}class Yt extends Xt{constructor(e){super("OCSPMemoryCacheStoreEvent",he.Debug,e)}}class $t extends Xt{constructor(e){super("OCSPDiskCacheStoreEvent",he.Debug,e)}}class ei extends Xt{constructor(e){super("OCSPCacheUpdateCompleteEvent",he.Debug,e)}}class ti extends Xt{constructor(){super("OCSPStapleReceivedEvent",he.Debug,"")}}class ii extends Xt{constructor(e,t){super("OCSPCacheEntryExpiredEvent",he.Debug,e),this.privExpireTime=t}}class ni extends Xt{constructor(e,t,i){super("OCSPCacheEntryNeedsRefreshEvent",he.Debug,e),this.privExpireTime=i,this.privStartTime=t}}class ri extends Xt{constructor(e,t,i){super("OCSPCacheHitEvent",he.Debug,e),this.privExpireTime=i,this.privExpireTimeString=new Date(i).toLocaleDateString(),this.privStartTime=t,this.privStartTimeString=new Date(t).toLocaleTimeString()}}class si extends Xt{constructor(e,t){super("OCSPVerificationFailedEvent",he.Debug,e),this.privError=t}}class oi extends Xt{constructor(e,t){super("OCSPCacheFetchErrorEvent",he.Debug,e),this.privError=t}}class ai extends Xt{constructor(e){super("OCSPResponseRetrievedEvent",he.Debug,e)}}class ci extends Xt{constructor(e,t){super("OCSPCacheUpdateErrorEvent",he.Debug,e),this.privError=t}}var pi=i(108),ui=i.n(pi),hi=i(275),di=i.n(hi),li=i(505),vi=i.n(li),gi=i(146),fi=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class mi{constructor(e){e&&(this.privProxyInfo=e),mi.privDiskCache||(mi.privDiskCache=new(di())("microsoft-cognitiveservices-speech-sdk-cache",{supportBuffer:!0,location:"undefined"!=typeof process&&{npm_config_save_dev:"",npm_config_legacy_bundling:"",npm_config_dry_run:"",npm_config_viewer:"man",npm_config_only:"",npm_config_commit_hooks:"true",npm_config_browser:"",npm_package_gitHead:"53d745704067bd2fc43cdb3015b644ea71168058",MANPATH:"/opt/homebrew/share/man:/usr/share/man:/usr/local/share/man:/opt/homebrew/share/man:",npm_config_also:"",npm_package_dependencies_microsoft_cognitiveservices_speech_sdk:"^1.27.0",npm_config_sign_git_commit:"",npm_config_rollback:"true",TERM_PROGRAM:"vscode",NODE:"/usr/local/bin/node",npm_config_usage:"",npm_config_audit:"true",INIT_CWD:"/Users/reber/project/sudmgp-web-sdk",npm_package_devDependencies_typescript:"^4.7.4",npm_config_globalignorefile:"/usr/local/etc/npmignore",TERM:"xterm-256color",SHELL:"/bin/zsh",npm_config_shell:"/bin/zsh",npm_config_maxsockets:"50",npm_config_init_author_url:"",npm_config_shrinkwrap:"true",npm_config_parseable:"",npm_config_metrics_registry:"https://registry.npmjs.org/",npm_package_devDependencies_webpack_merge:"^5.8.0",npm_package_devDependencies_eslint_config_standard:"^17.0.0",HOMEBREW_REPOSITORY:"/opt/homebrew",TMPDIR:"/var/folders/g5/9m38hlpj0kz8txb2h14w5bmh0000gn/T/",npm_config_timing:"",npm_config_init_license:"ISC",npm_package_scripts_lint:"eslint --ext .js,.ts,.tsx src/",npm_config_if_present:"",TERM_PROGRAM_VERSION:"1.80.1",npm_config_sign_git_tag:"",npm_config_init_author_email:"",npm_config_cache_max:"Infinity",ZDOTDIR:"/Users/reber",ORIGINAL_XDG_CURRENT_DESKTOP:"undefined",MallocNanoZone:"0",npm_config_preid:"",npm_config_long:"",npm_config_local_address:"",npm_config_git_tag_version:"true",npm_config_cert:"",TERM_SESSION_ID:"w0t0p0:76C741C8-A98E-4BC0-AFF2-66AF134EC084",npm_config_noproxy:"",npm_config_fetch_retries:"2",npm_config_home:"https://www.npmjs.org",npm_config_registry:"https://registry.npmjs.org/",npm_package_devDependencies_clean_webpack_plugin:"^4.0.0",npm_config_versions:"",npm_config_message:"%s",npm_config_key:"",npm_package_readmeFilename:"README.md",npm_package_devDependencies_ignore_loader:"^0.1.2",npm_package_devDependencies_webpack:"^5.73.0",npm_package_description:"",USER:"reber",npm_package_devDependencies_webpack_cli:"^4.10.0",npm_package_license:"ISC",COMMAND_MODE:"unix2003",npm_config_globalconfig:"/usr/local/etc/npmrc",npm_config_prefer_online:"",npm_config_logs_max:"10",npm_config_always_auth:"",npm_package_devDependencies_webpack_dev_server:"^4.9.2",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.q7bBvHiyOv/Listeners",npm_package_devDependencies_eslint:"^8.18.0",__CF_USER_TEXT_ENCODING:"0x1F5:0x19:0x34",npm_execpath:"/usr/local/lib/node_modules/npm/bin/npm-cli.js",npm_config_global_style:"",npm_config_cache_lock_retries:"10",npm_package_devDependencies__typescript_eslint_eslint_plugin:"^5.29.0",npm_config_update_notifier:"true",npm_config_cafile:"",npm_package_author_name:"SudMGP",npm_config_heading:"npm",npm_config_audit_level:"low",npm_package_devDependencies_copy_webpack_plugin:"^11.0.0",npm_config_searchlimit:"20",npm_config_read_only:"",npm_config_offline:"",npm_config_fetch_retry_mintimeout:"10000",npm_package_devDependencies__typescript_eslint_parser:"^5.29.0",npm_config_json:"",npm_config_access:"",npm_config_argv:'{"remain":[],"cooked":["run","build"],"original":["run","build"]}',npm_package_devDependencies_uuid:"^8.3.2",PATH:"/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/reber/project/sudmgp-web-sdk/node_modules/.bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/opt/homebrew/bin:/opt/homebrew/sbin",npm_config_allow_same_version:"",npm_config_https_proxy:"",npm_config_engine_strict:"",npm_config_description:"true",_:"/Users/reber/project/sudmgp-web-sdk/node_modules/.bin/webpack",npm_config_userconfig:"/Users/reber/.npmrc",npm_config_init_module:"/Users/reber/.npm-init.js",USER_ZDOTDIR:"/Users/reber",__CFBundleIdentifier:"com.microsoft.VSCode",npm_config_cidr:"",PWD:"/Users/reber/project/sudmgp-web-sdk",npm_config_user:"",npm_config_node_version:"16.19.0",npm_lifecycle_event:"build",npm_package_scripts_pub:"npm publish ./lib",npm_config_save:"true",npm_config_ignore_prepublish:"",npm_config_editor:"vi",npm_config_auth_type:"legacy",npm_package_keywords_0:"SudMGP",npm_package_name:"sudmgp-sdk-js",LANG:"zh_CN.UTF-8",npm_config_tag:"latest",npm_config_script_shell:"",npm_package_devDependencies_eslint_plugin_import:"^2.26.0",npm_package_devDependencies__babel_preset_env:"^7.18.6",npm_package_devDependencies__babel_plugin_transform_modules_umd:"^7.18.6",npm_package_keywords_1:"sdk",ITERM_PROFILE:"Default",npm_config_progress:"true",npm_config_global:"",npm_config_before:"",npm_package_scripts_build:"webpack --mode production",npm_package_scripts_start:"webpack-dev-server --mode development --open --config webpack.config.demo.js",npm_config_searchstaleness:"900",npm_config_optional:"true",npm_config_ham_it_up:"",npm_package_devDependencies_ts_loader:"^9.3.0",npm_package_devDependencies_blueimp_md5:"^2.19.0",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"--ms-enable-electron-run-as-node",XPC_FLAGS:"0x0",npm_config_save_prod:"",npm_config_force:"",npm_config_bin_links:"true",npm_config_searchopts:"",npm_config_node_gyp:"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",npm_config_depth:"Infinity",npm_package_devDependencies_eslint_plugin_node:"^11.1.0",npm_package_main:"index.js",npm_config_sso_poll_frequency:"500",npm_config_rebuild_bundle:"true",npm_package_version:"1.0.1",XPC_SERVICE_NAME:"0",npm_config_unicode:"true",npm_package_devDependencies_eslint_plugin_n:"^15.2.3",VSCODE_INJECTION:"1",COLORFGBG:"15;0",SHLVL:"4",HOME:"/Users/reber",npm_config_fetch_retry_maxtimeout:"60000",VSCODE_GIT_ASKPASS_MAIN:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass-main.js",npm_config_tag_version_prefix:"v",npm_config_strict_ssl:"true",npm_config_sso_type:"oauth",npm_config_scripts_prepend_node_path:"warn-only",npm_config_save_prefix:"^",npm_config_loglevel:"notice",npm_config_ca:"",LC_TERMINAL_VERSION:"3.4.19",npm_config_save_exact:"",npm_config_group:"20",npm_config_fetch_retry_factor:"10",npm_config_dev:"",HOMEBREW_PREFIX:"/opt/homebrew",npm_config_version:"",npm_config_prefer_offline:"",npm_config_cache_lock_stale:"60000",npm_package_devDependencies_eslint_plugin_promise:"^6.0.0",npm_config_otp:"",npm_config_cache_min:"10",ITERM_SESSION_ID:"w0t0p0:76C741C8-A98E-4BC0-AFF2-66AF134EC084",npm_config_searchexclude:"",npm_config_cache:"/Users/reber/.npm",npm_package_devDependencies_html_webpack_plugin:"^5.5.0",LOGNAME:"reber",npm_lifecycle_script:"webpack --mode production",npm_config_color:"true",npm_package_devDependencies__types_blueimp_md5:"^2.18.0",npm_config_package_lock:"true",npm_config_proxy:"",VSCODE_GIT_IPC_HANDLE:"/var/folders/g5/9m38hlpj0kz8txb2h14w5bmh0000gn/T/vscode-git-2e49c0b36d.sock",npm_config_package_lock_only:"",npm_config_fund:"true",npm_config_save_optional:"",npm_package_eslintConfig_extends_0:"prettier",npm_config_ignore_scripts:"",npm_config_user_agent:"npm/6.14.18 node/v16.19.0 darwin arm64",npm_package_devDependencies__types_uuid:"^8.3.4",npm_config_cache_lock_wait:"10000",VSCODE_GIT_ASKPASS_NODE:"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)",GIT_ASKPASS:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass.sh",HOMEBREW_CELLAR:"/opt/homebrew/Cellar",INFOPATH:"/opt/homebrew/share/info:/opt/homebrew/share/info:",npm_config_production:"",LC_TERMINAL:"iTerm2",npm_config_send_metrics:"",npm_config_save_bundle:"",npm_package_scripts_local:"webpack --mode development",npm_config_umask:"0022",npm_config_node_options:"",npm_config_init_version:"1.0.0",npm_config_init_author_name:"",npm_config_git:"git",npm_config_scope:"",npm_config_unsafe_perm:"true",npm_config_tmp:"/var/folders/g5/9m38hlpj0kz8txb2h14w5bmh0000gn/T",npm_config_onload_script:"",npm_package_scripts_check:"npm pack",npm_node_execpath:"/usr/local/bin/node",npm_config_prefix:"/usr/local",npm_config_link:"",npm_config_format_package_lock:"true",COLORTERM:"truecolor",SDK_VERSION:"1.0.1"}.SPEECH_OCSP_CACHE_ROOT?{npm_config_save_dev:"",npm_config_legacy_bundling:"",npm_config_dry_run:"",npm_config_viewer:"man",npm_config_only:"",npm_config_commit_hooks:"true",npm_config_browser:"",npm_package_gitHead:"53d745704067bd2fc43cdb3015b644ea71168058",MANPATH:"/opt/homebrew/share/man:/usr/share/man:/usr/local/share/man:/opt/homebrew/share/man:",npm_config_also:"",npm_package_dependencies_microsoft_cognitiveservices_speech_sdk:"^1.27.0",npm_config_sign_git_commit:"",npm_config_rollback:"true",TERM_PROGRAM:"vscode",NODE:"/usr/local/bin/node",npm_config_usage:"",npm_config_audit:"true",INIT_CWD:"/Users/reber/project/sudmgp-web-sdk",npm_package_devDependencies_typescript:"^4.7.4",npm_config_globalignorefile:"/usr/local/etc/npmignore",TERM:"xterm-256color",SHELL:"/bin/zsh",npm_config_shell:"/bin/zsh",npm_config_maxsockets:"50",npm_config_init_author_url:"",npm_config_shrinkwrap:"true",npm_config_parseable:"",npm_config_metrics_registry:"https://registry.npmjs.org/",npm_package_devDependencies_webpack_merge:"^5.8.0",npm_package_devDependencies_eslint_config_standard:"^17.0.0",HOMEBREW_REPOSITORY:"/opt/homebrew",TMPDIR:"/var/folders/g5/9m38hlpj0kz8txb2h14w5bmh0000gn/T/",npm_config_timing:"",npm_config_init_license:"ISC",npm_package_scripts_lint:"eslint --ext .js,.ts,.tsx src/",npm_config_if_present:"",TERM_PROGRAM_VERSION:"1.80.1",npm_config_sign_git_tag:"",npm_config_init_author_email:"",npm_config_cache_max:"Infinity",ZDOTDIR:"/Users/reber",ORIGINAL_XDG_CURRENT_DESKTOP:"undefined",MallocNanoZone:"0",npm_config_preid:"",npm_config_long:"",npm_config_local_address:"",npm_config_git_tag_version:"true",npm_config_cert:"",TERM_SESSION_ID:"w0t0p0:76C741C8-A98E-4BC0-AFF2-66AF134EC084",npm_config_noproxy:"",npm_config_fetch_retries:"2",npm_config_home:"https://www.npmjs.org",npm_config_registry:"https://registry.npmjs.org/",npm_package_devDependencies_clean_webpack_plugin:"^4.0.0",npm_config_versions:"",npm_config_message:"%s",npm_config_key:"",npm_package_readmeFilename:"README.md",npm_package_devDependencies_ignore_loader:"^0.1.2",npm_package_devDependencies_webpack:"^5.73.0",npm_package_description:"",USER:"reber",npm_package_devDependencies_webpack_cli:"^4.10.0",npm_package_license:"ISC",COMMAND_MODE:"unix2003",npm_config_globalconfig:"/usr/local/etc/npmrc",npm_config_prefer_online:"",npm_config_logs_max:"10",npm_config_always_auth:"",npm_package_devDependencies_webpack_dev_server:"^4.9.2",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.q7bBvHiyOv/Listeners",npm_package_devDependencies_eslint:"^8.18.0",__CF_USER_TEXT_ENCODING:"0x1F5:0x19:0x34",npm_execpath:"/usr/local/lib/node_modules/npm/bin/npm-cli.js",npm_config_global_style:"",npm_config_cache_lock_retries:"10",npm_package_devDependencies__typescript_eslint_eslint_plugin:"^5.29.0",npm_config_update_notifier:"true",npm_config_cafile:"",npm_package_author_name:"SudMGP",npm_config_heading:"npm",npm_config_audit_level:"low",npm_package_devDependencies_copy_webpack_plugin:"^11.0.0",npm_config_searchlimit:"20",npm_config_read_only:"",npm_config_offline:"",npm_config_fetch_retry_mintimeout:"10000",npm_package_devDependencies__typescript_eslint_parser:"^5.29.0",npm_config_json:"",npm_config_access:"",npm_config_argv:'{"remain":[],"cooked":["run","build"],"original":["run","build"]}',npm_package_devDependencies_uuid:"^8.3.2",PATH:"/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/reber/project/sudmgp-web-sdk/node_modules/.bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/opt/homebrew/bin:/opt/homebrew/sbin",npm_config_allow_same_version:"",npm_config_https_proxy:"",npm_config_engine_strict:"",npm_config_description:"true",_:"/Users/reber/project/sudmgp-web-sdk/node_modules/.bin/webpack",npm_config_userconfig:"/Users/reber/.npmrc",npm_config_init_module:"/Users/reber/.npm-init.js",USER_ZDOTDIR:"/Users/reber",__CFBundleIdentifier:"com.microsoft.VSCode",npm_config_cidr:"",PWD:"/Users/reber/project/sudmgp-web-sdk",npm_config_user:"",npm_config_node_version:"16.19.0",npm_lifecycle_event:"build",npm_package_scripts_pub:"npm publish ./lib",npm_config_save:"true",npm_config_ignore_prepublish:"",npm_config_editor:"vi",npm_config_auth_type:"legacy",npm_package_keywords_0:"SudMGP",npm_package_name:"sudmgp-sdk-js",LANG:"zh_CN.UTF-8",npm_config_tag:"latest",npm_config_script_shell:"",npm_package_devDependencies_eslint_plugin_import:"^2.26.0",npm_package_devDependencies__babel_preset_env:"^7.18.6",npm_package_devDependencies__babel_plugin_transform_modules_umd:"^7.18.6",npm_package_keywords_1:"sdk",ITERM_PROFILE:"Default",npm_config_progress:"true",npm_config_global:"",npm_config_before:"",npm_package_scripts_build:"webpack --mode production",npm_package_scripts_start:"webpack-dev-server --mode development --open --config webpack.config.demo.js",npm_config_searchstaleness:"900",npm_config_optional:"true",npm_config_ham_it_up:"",npm_package_devDependencies_ts_loader:"^9.3.0",npm_package_devDependencies_blueimp_md5:"^2.19.0",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"--ms-enable-electron-run-as-node",XPC_FLAGS:"0x0",npm_config_save_prod:"",npm_config_force:"",npm_config_bin_links:"true",npm_config_searchopts:"",npm_config_node_gyp:"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",npm_config_depth:"Infinity",npm_package_devDependencies_eslint_plugin_node:"^11.1.0",npm_package_main:"index.js",npm_config_sso_poll_frequency:"500",npm_config_rebuild_bundle:"true",npm_package_version:"1.0.1",XPC_SERVICE_NAME:"0",npm_config_unicode:"true",npm_package_devDependencies_eslint_plugin_n:"^15.2.3",VSCODE_INJECTION:"1",COLORFGBG:"15;0",SHLVL:"4",HOME:"/Users/reber",npm_config_fetch_retry_maxtimeout:"60000",VSCODE_GIT_ASKPASS_MAIN:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass-main.js",npm_config_tag_version_prefix:"v",npm_config_strict_ssl:"true",npm_config_sso_type:"oauth",npm_config_scripts_prepend_node_path:"warn-only",npm_config_save_prefix:"^",npm_config_loglevel:"notice",npm_config_ca:"",LC_TERMINAL_VERSION:"3.4.19",npm_config_save_exact:"",npm_config_group:"20",npm_config_fetch_retry_factor:"10",npm_config_dev:"",HOMEBREW_PREFIX:"/opt/homebrew",npm_config_version:"",npm_config_prefer_offline:"",npm_config_cache_lock_stale:"60000",npm_package_devDependencies_eslint_plugin_promise:"^6.0.0",npm_config_otp:"",npm_config_cache_min:"10",ITERM_SESSION_ID:"w0t0p0:76C741C8-A98E-4BC0-AFF2-66AF134EC084",npm_config_searchexclude:"",npm_config_cache:"/Users/reber/.npm",npm_package_devDependencies_html_webpack_plugin:"^5.5.0",LOGNAME:"reber",npm_lifecycle_script:"webpack --mode production",npm_config_color:"true",npm_package_devDependencies__types_blueimp_md5:"^2.18.0",npm_config_package_lock:"true",npm_config_proxy:"",VSCODE_GIT_IPC_HANDLE:"/var/folders/g5/9m38hlpj0kz8txb2h14w5bmh0000gn/T/vscode-git-2e49c0b36d.sock",npm_config_package_lock_only:"",npm_config_fund:"true",npm_config_save_optional:"",npm_package_eslintConfig_extends_0:"prettier",npm_config_ignore_scripts:"",npm_config_user_agent:"npm/6.14.18 node/v16.19.0 darwin arm64",npm_package_devDependencies__types_uuid:"^8.3.4",npm_config_cache_lock_wait:"10000",VSCODE_GIT_ASKPASS_NODE:"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)",GIT_ASKPASS:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass.sh",HOMEBREW_CELLAR:"/opt/homebrew/Cellar",INFOPATH:"/opt/homebrew/share/info:/opt/homebrew/share/info:",npm_config_production:"",LC_TERMINAL:"iTerm2",npm_config_send_metrics:"",npm_config_save_bundle:"",npm_package_scripts_local:"webpack --mode development",npm_config_umask:"0022",npm_config_node_options:"",npm_config_init_version:"1.0.0",npm_config_init_author_name:"",npm_config_git:"git",npm_config_scope:"",npm_config_unsafe_perm:"true",npm_config_tmp:"/var/folders/g5/9m38hlpj0kz8txb2h14w5bmh0000gn/T",npm_config_onload_script:"",npm_package_scripts_check:"npm pack",npm_node_execpath:"/usr/local/bin/node",npm_config_prefix:"/usr/local",npm_config_link:"",npm_config_format_package_lock:"true",COLORTERM:"truecolor",SDK_VERSION:"1.0.1"}.SPEECH_OCSP_CACHE_ROOT:void 0}))}static forceReinitDiskCache(){mi.privDiskCache=void 0,mi.privMemCache={}}GetAgent(e){const t=new(ui().Agent)(this.CreateConnection);return void 0!==this.privProxyInfo&&void 0!==this.privProxyInfo.HostName&&this.privProxyInfo.Port>0&&(t.privProxyInfo=this.privProxyInfo),t}static GetProxyAgent(e){const t={host:e.HostName,port:e.Port};return e.UserName?t.headers={"Proxy-Authentication":"Basic "+new Buffer(`${e.UserName}:${void 0===e.Password?"":e.Password}`).toString("base64")}:t.headers={},t.headers.requestOCSP="true",new(vi())(t)}static OCSPCheck(e,t){return fi(this,void 0,void 0,(function*(){let i,n,r=!1;const s=yield e;s.cork();const o=s;return new Promise(((e,a)=>{s.on("OCSPResponse",(e=>{e&&(this.onEvent(new ti),n=e)})),s.on("error",(e=>{r||(r=!0,s.destroy(),a(e))})),o.on("secure",(()=>fi(this,void 0,void 0,(function*(){const c=o.getPeerCertificate(!0);try{const o=yield this.GetIssuer(c);i=Vt.request.generate(c.raw,o.raw);const a=i.id.toString("hex");if(!n){const e=yield mi.GetResponseFromCache(a,i,t);n=e}yield this.VerifyOCSPResponse(n,i,t),s.uncork(),r=!0,e(s)}catch(e){s.destroy(),r=!0,a(e)}}))))}))}))}static GetIssuer(e){return e.issuerCertificate?Promise.resolve(e.issuerCertificate):new Promise(((t,i)=>{new Vt.Agent({}).fetchIssuer(e,null,((e,n)=>{e?i(e):t(n)}))}))}static GetResponseFromCache(e,t,i){return fi(this,void 0,void 0,(function*(){let n=mi.privMemCache[e];if(n&&this.onEvent(new Wt(e)),!n)try{const t=yield mi.privDiskCache.get(e);t.isCached&&(mi.onEvent(new Jt(e)),mi.StoreMemoryCacheEntry(e,t.value),n=t.value)}catch(e){n=null}if(!n)return n;try{const r=Vt.utils.parseResponse(n).value.tbsResponseData;if(r.responses.length<1)return void this.onEvent(new oi(e,"Not enough data in cached response"));const s=r.responses[0].thisUpdate,o=r.responses[0].nextUpdate;if(o<Date.now()+this.testTimeOffset-6e4)this.onEvent(new ii(e,o)),n=null;else{const n=Math.min(864e5,(o-s)/2);o-(Date.now()+this.testTimeOffset)<n?(this.onEvent(new ni(e,s,o)),this.UpdateCache(t,i).catch((t=>{this.onEvent(new ci(e,t.toString()))}))):this.onEvent(new ri(e,s,o))}}catch(t){this.onEvent(new oi(e,t)),n=null}return n||this.onEvent(new Qt(e)),n}))}static VerifyOCSPResponse(e,t,i){return fi(this,void 0,void 0,(function*(){let n=e;return n||(n=yield mi.GetOCSPResponse(t,i)),new Promise(((r,s)=>{Vt.verify({request:t,response:n},(o=>{o?(mi.onEvent(new si(t.id.toString("hex"),o)),e?this.VerifyOCSPResponse(null,t,i).then((()=>{r()}),(e=>{s(e)})):s(o)):(e||mi.StoreCacheEntry(t.id.toString("hex"),n),r())}))}))}))}static UpdateCache(e,t){return fi(this,void 0,void 0,(function*(){const i=e.id.toString("hex");this.onEvent(new Zt(i));const n=yield this.GetOCSPResponse(e,t);this.StoreCacheEntry(i,n),this.onEvent(new ei(e.id.toString("hex")))}))}static StoreCacheEntry(e,t){this.StoreMemoryCacheEntry(e,t),this.StoreDiskCacheEntry(e,t)}static StoreMemoryCacheEntry(e,t){this.privMemCache[e]=t,this.onEvent(new Yt(e))}static StoreDiskCacheEntry(e,t){this.privDiskCache.set(e,t).then((()=>{this.onEvent(new $t(e))}))}static GetOCSPResponse(e,t){let i={};if(t){const e=mi.GetProxyAgent(t);i.agent=e}return new Promise(((t,n)=>{Vt.utils.getAuthorityInfo(e.cert,"1.3.6.1.5.5.7.48.1",((r,s)=>{if(r)return void n(r);const o=new URL(s);i=Object.assign(Object.assign({},i),{host:o.host,protocol:o.protocol,port:o.port,path:o.pathname,hostname:o.host}),Vt.utils.getResponse(i,e.data,((i,r)=>{if(i)return void n(i);const s=e.certID;this.onEvent(new ai(s.toString("hex"))),t(r)}))}))}))}static onEvent(e){Oe.instance.onEvent(e)}CreateConnection(e,t){const i="undefined"!=typeof process&&"0"!=={npm_config_save_dev:"",npm_config_legacy_bundling:"",npm_config_dry_run:"",npm_config_viewer:"man",npm_config_only:"",npm_config_commit_hooks:"true",npm_config_browser:"",npm_package_gitHead:"53d745704067bd2fc43cdb3015b644ea71168058",MANPATH:"/opt/homebrew/share/man:/usr/share/man:/usr/local/share/man:/opt/homebrew/share/man:",npm_config_also:"",npm_package_dependencies_microsoft_cognitiveservices_speech_sdk:"^1.27.0",npm_config_sign_git_commit:"",npm_config_rollback:"true",TERM_PROGRAM:"vscode",NODE:"/usr/local/bin/node",npm_config_usage:"",npm_config_audit:"true",INIT_CWD:"/Users/reber/project/sudmgp-web-sdk",npm_package_devDependencies_typescript:"^4.7.4",npm_config_globalignorefile:"/usr/local/etc/npmignore",TERM:"xterm-256color",SHELL:"/bin/zsh",npm_config_shell:"/bin/zsh",npm_config_maxsockets:"50",npm_config_init_author_url:"",npm_config_shrinkwrap:"true",npm_config_parseable:"",npm_config_metrics_registry:"https://registry.npmjs.org/",npm_package_devDependencies_webpack_merge:"^5.8.0",npm_package_devDependencies_eslint_config_standard:"^17.0.0",HOMEBREW_REPOSITORY:"/opt/homebrew",TMPDIR:"/var/folders/g5/9m38hlpj0kz8txb2h14w5bmh0000gn/T/",npm_config_timing:"",npm_config_init_license:"ISC",npm_package_scripts_lint:"eslint --ext .js,.ts,.tsx src/",npm_config_if_present:"",TERM_PROGRAM_VERSION:"1.80.1",npm_config_sign_git_tag:"",npm_config_init_author_email:"",npm_config_cache_max:"Infinity",ZDOTDIR:"/Users/reber",ORIGINAL_XDG_CURRENT_DESKTOP:"undefined",MallocNanoZone:"0",npm_config_preid:"",npm_config_long:"",npm_config_local_address:"",npm_config_git_tag_version:"true",npm_config_cert:"",TERM_SESSION_ID:"w0t0p0:76C741C8-A98E-4BC0-AFF2-66AF134EC084",npm_config_noproxy:"",npm_config_fetch_retries:"2",npm_config_home:"https://www.npmjs.org",npm_config_registry:"https://registry.npmjs.org/",npm_package_devDependencies_clean_webpack_plugin:"^4.0.0",npm_config_versions:"",npm_config_message:"%s",npm_config_key:"",npm_package_readmeFilename:"README.md",npm_package_devDependencies_ignore_loader:"^0.1.2",npm_package_devDependencies_webpack:"^5.73.0",npm_package_description:"",USER:"reber",npm_package_devDependencies_webpack_cli:"^4.10.0",npm_package_license:"ISC",COMMAND_MODE:"unix2003",npm_config_globalconfig:"/usr/local/etc/npmrc",npm_config_prefer_online:"",npm_config_logs_max:"10",npm_config_always_auth:"",npm_package_devDependencies_webpack_dev_server:"^4.9.2",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.q7bBvHiyOv/Listeners",npm_package_devDependencies_eslint:"^8.18.0",__CF_USER_TEXT_ENCODING:"0x1F5:0x19:0x34",npm_execpath:"/usr/local/lib/node_modules/npm/bin/npm-cli.js",npm_config_global_style:"",npm_config_cache_lock_retries:"10",npm_package_devDependencies__typescript_eslint_eslint_plugin:"^5.29.0",npm_config_update_notifier:"true",npm_config_cafile:"",npm_package_author_name:"SudMGP",npm_config_heading:"npm",npm_config_audit_level:"low",npm_package_devDependencies_copy_webpack_plugin:"^11.0.0",npm_config_searchlimit:"20",npm_config_read_only:"",npm_config_offline:"",npm_config_fetch_retry_mintimeout:"10000",npm_package_devDependencies__typescript_eslint_parser:"^5.29.0",npm_config_json:"",npm_config_access:"",npm_config_argv:'{"remain":[],"cooked":["run","build"],"original":["run","build"]}',npm_package_devDependencies_uuid:"^8.3.2",PATH:"/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/reber/project/sudmgp-web-sdk/node_modules/.bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/opt/homebrew/bin:/opt/homebrew/sbin",npm_config_allow_same_version:"",npm_config_https_proxy:"",npm_config_engine_strict:"",npm_config_description:"true",_:"/Users/reber/project/sudmgp-web-sdk/node_modules/.bin/webpack",npm_config_userconfig:"/Users/reber/.npmrc",npm_config_init_module:"/Users/reber/.npm-init.js",USER_ZDOTDIR:"/Users/reber",__CFBundleIdentifier:"com.microsoft.VSCode",npm_config_cidr:"",PWD:"/Users/reber/project/sudmgp-web-sdk",npm_config_user:"",npm_config_node_version:"16.19.0",npm_lifecycle_event:"build",npm_package_scripts_pub:"npm publish ./lib",npm_config_save:"true",npm_config_ignore_prepublish:"",npm_config_editor:"vi",npm_config_auth_type:"legacy",npm_package_keywords_0:"SudMGP",npm_package_name:"sudmgp-sdk-js",LANG:"zh_CN.UTF-8",npm_config_tag:"latest",npm_config_script_shell:"",npm_package_devDependencies_eslint_plugin_import:"^2.26.0",npm_package_devDependencies__babel_preset_env:"^7.18.6",npm_package_devDependencies__babel_plugin_transform_modules_umd:"^7.18.6",npm_package_keywords_1:"sdk",ITERM_PROFILE:"Default",npm_config_progress:"true",npm_config_global:"",npm_config_before:"",npm_package_scripts_build:"webpack --mode production",npm_package_scripts_start:"webpack-dev-server --mode development --open --config webpack.config.demo.js",npm_config_searchstaleness:"900",npm_config_optional:"true",npm_config_ham_it_up:"",npm_package_devDependencies_ts_loader:"^9.3.0",npm_package_devDependencies_blueimp_md5:"^2.19.0",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"--ms-enable-electron-run-as-node",XPC_FLAGS:"0x0",npm_config_save_prod:"",npm_config_force:"",npm_config_bin_links:"true",npm_config_searchopts:"",npm_config_node_gyp:"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",npm_config_depth:"Infinity",npm_package_devDependencies_eslint_plugin_node:"^11.1.0",npm_package_main:"index.js",npm_config_sso_poll_frequency:"500",npm_config_rebuild_bundle:"true",npm_package_version:"1.0.1",XPC_SERVICE_NAME:"0",npm_config_unicode:"true",npm_package_devDependencies_eslint_plugin_n:"^15.2.3",VSCODE_INJECTION:"1",COLORFGBG:"15;0",SHLVL:"4",HOME:"/Users/reber",npm_config_fetch_retry_maxtimeout:"60000",VSCODE_GIT_ASKPASS_MAIN:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass-main.js",npm_config_tag_version_prefix:"v",npm_config_strict_ssl:"true",npm_config_sso_type:"oauth",npm_config_scripts_prepend_node_path:"warn-only",npm_config_save_prefix:"^",npm_config_loglevel:"notice",npm_config_ca:"",LC_TERMINAL_VERSION:"3.4.19",npm_config_save_exact:"",npm_config_group:"20",npm_config_fetch_retry_factor:"10",npm_config_dev:"",HOMEBREW_PREFIX:"/opt/homebrew",npm_config_version:"",npm_config_prefer_offline:"",npm_config_cache_lock_stale:"60000",npm_package_devDependencies_eslint_plugin_promise:"^6.0.0",npm_config_otp:"",npm_config_cache_min:"10",ITERM_SESSION_ID:"w0t0p0:76C741C8-A98E-4BC0-AFF2-66AF134EC084",npm_config_searchexclude:"",npm_config_cache:"/Users/reber/.npm",npm_package_devDependencies_html_webpack_plugin:"^5.5.0",LOGNAME:"reber",npm_lifecycle_script:"webpack --mode production",npm_config_color:"true",npm_package_devDependencies__types_blueimp_md5:"^2.18.0",npm_config_package_lock:"true",npm_config_proxy:"",VSCODE_GIT_IPC_HANDLE:"/var/folders/g5/9m38hlpj0kz8txb2h14w5bmh0000gn/T/vscode-git-2e49c0b36d.sock",npm_config_package_lock_only:"",npm_config_fund:"true",npm_config_save_optional:"",npm_package_eslintConfig_extends_0:"prettier",npm_config_ignore_scripts:"",npm_config_user_agent:"npm/6.14.18 node/v16.19.0 darwin arm64",npm_package_devDependencies__types_uuid:"^8.3.4",npm_config_cache_lock_wait:"10000",VSCODE_GIT_ASKPASS_NODE:"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)",GIT_ASKPASS:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass.sh",HOMEBREW_CELLAR:"/opt/homebrew/Cellar",INFOPATH:"/opt/homebrew/share/info:/opt/homebrew/share/info:",npm_config_production:"",LC_TERMINAL:"iTerm2",npm_config_send_metrics:"",npm_config_save_bundle:"",npm_package_scripts_local:"webpack --mode development",npm_config_umask:"0022",npm_config_node_options:"",npm_config_init_version:"1.0.0",npm_config_init_author_name:"",npm_config_git:"git",npm_config_scope:"",npm_config_unsafe_perm:"true",npm_config_tmp:"/var/folders/g5/9m38hlpj0kz8txb2h14w5bmh0000gn/T",npm_config_onload_script:"",npm_package_scripts_check:"npm pack",npm_node_execpath:"/usr/local/bin/node",npm_config_prefix:"/usr/local",npm_config_link:"",npm_config_format_package_lock:"true",COLORTERM:"truecolor",SDK_VERSION:"1.0.1"}.NODE_TLS_REJECT_UNAUTHORIZED&&"0"!=={npm_config_save_dev:"",npm_config_legacy_bundling:"",npm_config_dry_run:"",npm_config_viewer:"man",npm_config_only:"",npm_config_commit_hooks:"true",npm_config_browser:"",npm_package_gitHead:"53d745704067bd2fc43cdb3015b644ea71168058",MANPATH:"/opt/homebrew/share/man:/usr/share/man:/usr/local/share/man:/opt/homebrew/share/man:",npm_config_also:"",npm_package_dependencies_microsoft_cognitiveservices_speech_sdk:"^1.27.0",npm_config_sign_git_commit:"",npm_config_rollback:"true",TERM_PROGRAM:"vscode",NODE:"/usr/local/bin/node",npm_config_usage:"",npm_config_audit:"true",INIT_CWD:"/Users/reber/project/sudmgp-web-sdk",npm_package_devDependencies_typescript:"^4.7.4",npm_config_globalignorefile:"/usr/local/etc/npmignore",TERM:"xterm-256color",SHELL:"/bin/zsh",npm_config_shell:"/bin/zsh",npm_config_maxsockets:"50",npm_config_init_author_url:"",npm_config_shrinkwrap:"true",npm_config_parseable:"",npm_config_metrics_registry:"https://registry.npmjs.org/",npm_package_devDependencies_webpack_merge:"^5.8.0",npm_package_devDependencies_eslint_config_standard:"^17.0.0",HOMEBREW_REPOSITORY:"/opt/homebrew",TMPDIR:"/var/folders/g5/9m38hlpj0kz8txb2h14w5bmh0000gn/T/",npm_config_timing:"",npm_config_init_license:"ISC",npm_package_scripts_lint:"eslint --ext .js,.ts,.tsx src/",npm_config_if_present:"",TERM_PROGRAM_VERSION:"1.80.1",npm_config_sign_git_tag:"",npm_config_init_author_email:"",npm_config_cache_max:"Infinity",ZDOTDIR:"/Users/reber",ORIGINAL_XDG_CURRENT_DESKTOP:"undefined",MallocNanoZone:"0",npm_config_preid:"",npm_config_long:"",npm_config_local_address:"",npm_config_git_tag_version:"true",npm_config_cert:"",TERM_SESSION_ID:"w0t0p0:76C741C8-A98E-4BC0-AFF2-66AF134EC084",npm_config_noproxy:"",npm_config_fetch_retries:"2",npm_config_home:"https://www.npmjs.org",npm_config_registry:"https://registry.npmjs.org/",npm_package_devDependencies_clean_webpack_plugin:"^4.0.0",npm_config_versions:"",npm_config_message:"%s",npm_config_key:"",npm_package_readmeFilename:"README.md",npm_package_devDependencies_ignore_loader:"^0.1.2",npm_package_devDependencies_webpack:"^5.73.0",npm_package_description:"",USER:"reber",npm_package_devDependencies_webpack_cli:"^4.10.0",npm_package_license:"ISC",COMMAND_MODE:"unix2003",npm_config_globalconfig:"/usr/local/etc/npmrc",npm_config_prefer_online:"",npm_config_logs_max:"10",npm_config_always_auth:"",npm_package_devDependencies_webpack_dev_server:"^4.9.2",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.q7bBvHiyOv/Listeners",npm_package_devDependencies_eslint:"^8.18.0",__CF_USER_TEXT_ENCODING:"0x1F5:0x19:0x34",npm_execpath:"/usr/local/lib/node_modules/npm/bin/npm-cli.js",npm_config_global_style:"",npm_config_cache_lock_retries:"10",npm_package_devDependencies__typescript_eslint_eslint_plugin:"^5.29.0",npm_config_update_notifier:"true",npm_config_cafile:"",npm_package_author_name:"SudMGP",npm_config_heading:"npm",npm_config_audit_level:"low",npm_package_devDependencies_copy_webpack_plugin:"^11.0.0",npm_config_searchlimit:"20",npm_config_read_only:"",npm_config_offline:"",npm_config_fetch_retry_mintimeout:"10000",npm_package_devDependencies__typescript_eslint_parser:"^5.29.0",npm_config_json:"",npm_config_access:"",npm_config_argv:'{"remain":[],"cooked":["run","build"],"original":["run","build"]}',npm_package_devDependencies_uuid:"^8.3.2",PATH:"/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/reber/project/sudmgp-web-sdk/node_modules/.bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/opt/homebrew/bin:/opt/homebrew/sbin",npm_config_allow_same_version:"",npm_config_https_proxy:"",npm_config_engine_strict:"",npm_config_description:"true",_:"/Users/reber/project/sudmgp-web-sdk/node_modules/.bin/webpack",npm_config_userconfig:"/Users/reber/.npmrc",npm_config_init_module:"/Users/reber/.npm-init.js",USER_ZDOTDIR:"/Users/reber",__CFBundleIdentifier:"com.microsoft.VSCode",npm_config_cidr:"",PWD:"/Users/reber/project/sudmgp-web-sdk",npm_config_user:"",npm_config_node_version:"16.19.0",npm_lifecycle_event:"build",npm_package_scripts_pub:"npm publish ./lib",npm_config_save:"true",npm_config_ignore_prepublish:"",npm_config_editor:"vi",npm_config_auth_type:"legacy",npm_package_keywords_0:"SudMGP",npm_package_name:"sudmgp-sdk-js",LANG:"zh_CN.UTF-8",npm_config_tag:"latest",npm_config_script_shell:"",npm_package_devDependencies_eslint_plugin_import:"^2.26.0",npm_package_devDependencies__babel_preset_env:"^7.18.6",npm_package_devDependencies__babel_plugin_transform_modules_umd:"^7.18.6",npm_package_keywords_1:"sdk",ITERM_PROFILE:"Default",npm_config_progress:"true",npm_config_global:"",npm_config_before:"",npm_package_scripts_build:"webpack --mode production",npm_package_scripts_start:"webpack-dev-server --mode development --open --config webpack.config.demo.js",npm_config_searchstaleness:"900",npm_config_optional:"true",npm_config_ham_it_up:"",npm_package_devDependencies_ts_loader:"^9.3.0",npm_package_devDependencies_blueimp_md5:"^2.19.0",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"--ms-enable-electron-run-as-node",XPC_FLAGS:"0x0",npm_config_save_prod:"",npm_config_force:"",npm_config_bin_links:"true",npm_config_searchopts:"",npm_config_node_gyp:"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",npm_config_depth:"Infinity",npm_package_devDependencies_eslint_plugin_node:"^11.1.0",npm_package_main:"index.js",npm_config_sso_poll_frequency:"500",npm_config_rebuild_bundle:"true",npm_package_version:"1.0.1",XPC_SERVICE_NAME:"0",npm_config_unicode:"true",npm_package_devDependencies_eslint_plugin_n:"^15.2.3",VSCODE_INJECTION:"1",COLORFGBG:"15;0",SHLVL:"4",HOME:"/Users/reber",npm_config_fetch_retry_maxtimeout:"60000",VSCODE_GIT_ASKPASS_MAIN:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass-main.js",npm_config_tag_version_prefix:"v",npm_config_strict_ssl:"true",npm_config_sso_type:"oauth",npm_config_scripts_prepend_node_path:"warn-only",npm_config_save_prefix:"^",npm_config_loglevel:"notice",npm_config_ca:"",LC_TERMINAL_VERSION:"3.4.19",npm_config_save_exact:"",npm_config_group:"20",npm_config_fetch_retry_factor:"10",npm_config_dev:"",HOMEBREW_PREFIX:"/opt/homebrew",npm_config_version:"",npm_config_prefer_offline:"",npm_config_cache_lock_stale:"60000",npm_package_devDependencies_eslint_plugin_promise:"^6.0.0",npm_config_otp:"",npm_config_cache_min:"10",ITERM_SESSION_ID:"w0t0p0:76C741C8-A98E-4BC0-AFF2-66AF134EC084",npm_config_searchexclude:"",npm_config_cache:"/Users/reber/.npm",npm_package_devDependencies_html_webpack_plugin:"^5.5.0",LOGNAME:"reber",npm_lifecycle_script:"webpack --mode production",npm_config_color:"true",npm_package_devDependencies__types_blueimp_md5:"^2.18.0",npm_config_package_lock:"true",npm_config_proxy:"",VSCODE_GIT_IPC_HANDLE:"/var/folders/g5/9m38hlpj0kz8txb2h14w5bmh0000gn/T/vscode-git-2e49c0b36d.sock",npm_config_package_lock_only:"",npm_config_fund:"true",npm_config_save_optional:"",npm_package_eslintConfig_extends_0:"prettier",npm_config_ignore_scripts:"",npm_config_user_agent:"npm/6.14.18 node/v16.19.0 darwin arm64",npm_package_devDependencies__types_uuid:"^8.3.4",npm_config_cache_lock_wait:"10000",VSCODE_GIT_ASKPASS_NODE:"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)",GIT_ASKPASS:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass.sh",HOMEBREW_CELLAR:"/opt/homebrew/Cellar",INFOPATH:"/opt/homebrew/share/info:/opt/homebrew/share/info:",npm_config_production:"",LC_TERMINAL:"iTerm2",npm_config_send_metrics:"",npm_config_save_bundle:"",npm_package_scripts_local:"webpack --mode development",npm_config_umask:"0022",npm_config_node_options:"",npm_config_init_version:"1.0.0",npm_config_init_author_name:"",npm_config_git:"git",npm_config_scope:"",npm_config_unsafe_perm:"true",npm_config_tmp:"/var/folders/g5/9m38hlpj0kz8txb2h14w5bmh0000gn/T",npm_config_onload_script:"",npm_package_scripts_check:"npm pack",npm_node_execpath:"/usr/local/bin/node",npm_config_prefix:"/usr/local",npm_config_link:"",npm_config_format_package_lock:"true",COLORTERM:"truecolor",SDK_VERSION:"1.0.1"}.SPEECH_CONDUCT_OCSP_CHECK&&t.secureEndpoint;let n;if(t=Object.assign(Object.assign({},t),{requestOCSP:!mi.forceDisableOCSPStapling,servername:t.host}),this.privProxyInfo){const i=mi.GetProxyAgent(this.privProxyInfo);n=new Promise(((n,r)=>{i.callback(e,t,((e,t)=>{e?r(e):n(t)}))}))}else n=t.secureEndpoint?Promise.resolve(jt.connect(t)):Promise.resolve(gi.connect(t));return i?mi.OCSPCheck(n,this.privProxyInfo):n}}mi.testTimeOffset=0,mi.forceDisableOCSPStapling=!1,mi.privMemCache={};var _i=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class Si{constructor(e,t,i,n,r,s){if(!e)throw new oe("uri");if(!i)throw new oe("messageFormatter");this.proxyInfo=n,this.privConnectionEvents=new pe,this.privConnectionId=t,this.privMessageFormatter=i,this.privConnectionState=He.None,this.privUri=e,this.privHeaders=r,this.privEnableCompression=s,this.privHeaders[Et.ConnectionId]=this.privConnectionId,this.privLastErrorReceived=""}get state(){return this.privConnectionState}open(){if(this.privConnectionState===He.Disconnected)return Promise.reject(`Cannot open a connection that is in ${this.privConnectionState} state`);if(this.privConnectionEstablishDeferral)return this.privConnectionEstablishDeferral.promise;this.privConnectionEstablishDeferral=new le,this.privCertificateValidatedDeferral=new le,this.privConnectionState=He.Connecting;try{if("undefined"==typeof WebSocket||Si.forceNpmWebSocket){const e={headers:this.privHeaders,perMessageDeflate:this.privEnableCompression};this.privCertificateValidatedDeferral.resolve();const t=new mi(this.proxyInfo);e.agent=t.GetAgent();let i=new URL(this.privUri).protocol;"wss:"===(null==i?void 0:i.toLocaleLowerCase())?i="https:":"ws:"===(null==i?void 0:i.toLocaleLowerCase())&&(i="http:"),e.agent.protocol=i,this.privWebsocketClient=new(Ut())(this.privUri,e)}else this.privCertificateValidatedDeferral.resolve(),this.privWebsocketClient=new WebSocket(this.privUri);this.privWebsocketClient.binaryType="arraybuffer",this.privReceivingMessageQueue=new Pe,this.privDisconnectDeferral=new le,this.privSendMessageQueue=new Pe,this.processSendQueue().catch((e=>{Oe.instance.onEvent(new Mt(e))}))}catch(e){return this.privConnectionEstablishDeferral.resolve(new Kt(500,e)),this.privConnectionEstablishDeferral.promise}return this.onEvent(new et(this.privConnectionId,this.privUri)),this.privWebsocketClient.onopen=()=>{this.privCertificateValidatedDeferral.promise.then((()=>{this.privConnectionState=He.Connected,this.onEvent(new tt(this.privConnectionId)),this.privConnectionEstablishDeferral.resolve(new Kt(200,""))}),(e=>{this.privConnectionEstablishDeferral.reject(e)}))},this.privWebsocketClient.onerror=e=>{this.onEvent(new nt(this.privConnectionId,e.message,e.type)),this.privLastErrorReceived=e.message},this.privWebsocketClient.onclose=e=>{this.privConnectionState===He.Connecting?(this.privConnectionState=He.Disconnected,this.privConnectionEstablishDeferral.resolve(new Kt(e.code,e.reason+" "+this.privLastErrorReceived))):(this.privConnectionState=He.Disconnected,this.privWebsocketClient=null,this.onEvent(new it(this.privConnectionId,e.code,e.reason))),this.onClose(e.code,e.reason).catch((e=>{Oe.instance.onEvent(new Mt(e))}))},this.privWebsocketClient.onmessage=e=>{const t=(new Date).toISOString();if(this.privConnectionState===He.Connected){const i=new le;if(this.privReceivingMessageQueue.enqueueFromPromise(i.promise),e.data instanceof ArrayBuffer){const n=new qt(Fe.Binary,e.data);this.privMessageFormatter.toConnectionMessage(n).then((e=>{this.onEvent(new st(this.privConnectionId,t,e)),i.resolve(e)}),(e=>{i.reject(`Invalid binary message format. Error: ${e}`)}))}else{const n=new qt(Fe.Text,e.data);this.privMessageFormatter.toConnectionMessage(n).then((e=>{this.onEvent(new st(this.privConnectionId,t,e)),i.resolve(e)}),(e=>{i.reject(`Invalid text message format. Error: ${e}`)}))}}},this.privConnectionEstablishDeferral.promise}send(e){if(this.privConnectionState!==He.Connected)return Promise.reject(`Cannot send on connection that is in ${He[this.privConnectionState]} state`);const t=new le,i=new le;return this.privSendMessageQueue.enqueueFromPromise(i.promise),this.privMessageFormatter.fromConnectionMessage(e).then((n=>{i.resolve({Message:e,RawWebsocketMessage:n,sendStatusDeferral:t})}),(e=>{i.reject(`Error formatting the message. ${e}`)})),t.promise}read(){return this.privConnectionState!==He.Connected?Promise.reject(`Cannot read on connection that is in ${this.privConnectionState} state`):this.privReceivingMessageQueue.dequeue()}close(e){return this.privWebsocketClient?(this.privConnectionState!==He.Disconnected&&this.privWebsocketClient.close(1e3,e||"Normal closure by client"),this.privDisconnectDeferral.promise):Promise.resolve()}get events(){return this.privConnectionEvents}sendRawMessage(e){try{return e?(this.onEvent(new ot(this.privConnectionId,(new Date).toISOString(),e.Message)),this.isWebsocketOpen?(this.privWebsocketClient.send(e.RawWebsocketMessage.payload),Promise.resolve()):Promise.reject("websocket send error: Websocket not ready "+this.privConnectionId+" "+e.Message.id+" "+(new Error).stack)):Promise.resolve()}catch(e){return Promise.reject(`websocket send error: ${e}`)}}onClose(e,t){return _i(this,void 0,void 0,(function*(){const i=`Connection closed. ${e}: ${t}`;this.privConnectionState=He.Disconnected,this.privDisconnectDeferral.resolve(),yield this.privReceivingMessageQueue.drainAndDispose((()=>{}),i),yield this.privSendMessageQueue.drainAndDispose((e=>{e.sendStatusDeferral.reject(i)}),i)}))}processSendQueue(){return _i(this,void 0,void 0,(function*(){for(;;){const e=this.privSendMessageQueue.dequeue(),t=yield e;if(!t)return;try{yield this.sendRawMessage(t),t.sendStatusDeferral.resolve()}catch(e){t.sendStatusDeferral.reject(e)}}}))}onEvent(e){this.privConnectionEvents.onEvent(e),Oe.instance.onEvent(e)}get isWebsocketOpen(){return this.privWebsocketClient&&this.privWebsocketClient.readyState===this.privWebsocketClient.OPEN}}Si.forceNpmWebSocket=!1;var yi;class Ai{constructor(e,t,i,n,r,s=!1,o){if(this.privIsDisposed=!1,!e)throw new oe("uri");if(!n)throw new oe("messageFormatter");this.privMessageFormatter=n;let a="",c=0;if(t)for(const i in t)if(i){a+=0===c&&-1===e.indexOf("?")?"?":"&",a+=encodeURIComponent(i);let n=t[i];n&&(n=encodeURIComponent(n),a+=`=${n}`),c++}if(i)for(const t in i)t&&(a+=0===c&&-1===e.indexOf("?")?"?":"&",a+=`${t}=${encodeURIComponent(i[t])}`,c++);this.privUri=e+a,this.privId=o||se(),this.privConnectionMessageAdapter=new Si(this.privUri,this.id,this.privMessageFormatter,r,i,s)}dispose(){return e=this,t=void 0,n=function*(){this.privIsDisposed=!0,this.privConnectionMessageAdapter&&(yield this.privConnectionMessageAdapter.close())},new((i=void 0)||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}));var e,t,i,n}isDisposed(){return this.privIsDisposed}get id(){return this.privId}get uri(){return this.privUri}state(){return this.privConnectionMessageAdapter.state}open(){return this.privConnectionMessageAdapter.open()}send(e){return this.privConnectionMessageAdapter.send(e)}read(){return this.privConnectionMessageAdapter.read()}get events(){return this.privConnectionMessageAdapter.events}}class Ci{constructor(e,t,i,n){this.privProxyHostName=e,this.privProxyPort=t,this.privProxyUserName=i,this.privProxyPassword=n}static fromParameters(e){return new Ci(e.getProperty(x.SpeechServiceConnection_ProxyHostName),parseInt(e.getProperty(x.SpeechServiceConnection_ProxyPort),10),e.getProperty(x.SpeechServiceConnection_ProxyUserName),e.getProperty(x.SpeechServiceConnection_ProxyPassword))}static fromRecognizerConfig(e){return this.fromParameters(e.parameters)}get HostName(){return this.privProxyHostName}get Port(){return this.privProxyPort}get UserName(){return this.privProxyUserName}get Password(){return this.privProxyPassword}}class wi{}wi.BotId="botid",wi.CustomSpeechDeploymentId="cid",wi.CustomVoiceDeploymentId="deploymentId",wi.EnableAudioLogging="storeAudio",wi.EnableLanguageId="lidEnabled",wi.EnableWordLevelTimestamps="wordLevelTimestamps",wi.EndSilenceTimeoutMs="endSilenceTimeoutMs",wi.SegmentationSilenceTimeoutMs="segmentationSilenceTimeoutMs",wi.Format="format",wi.InitialSilenceTimeoutMs="initialSilenceTimeoutMs",wi.Language="language",wi.Profanity="profanity",wi.RequestBotStatusMessages="enableBotMessageStatus",wi.StableIntermediateThreshold="stableIntermediateThreshold",wi.StableTranslation="stableTranslation",wi.TestHooks="testhooks",wi.Postprocessing="postprocessing",wi.CtsMeetingId="meetingId",wi.CtsDeviceId="deviceId",wi.CtsIsParticipant="isParticipant";class bi{static getHostSuffix(e){if(e){if(e.toLowerCase().startsWith("china"))return".azure.cn";if(e.toLowerCase().startsWith("usgov"))return".azure.us"}return".microsoft.com"}setCommonUrlParams(e,t,i){new Map([[x.Speech_SegmentationSilenceTimeoutMs,wi.SegmentationSilenceTimeoutMs],[x.SpeechServiceConnection_EnableAudioLogging,wi.EnableAudioLogging],[x.SpeechServiceConnection_EndSilenceTimeoutMs,wi.EndSilenceTimeoutMs],[x.SpeechServiceConnection_InitialSilenceTimeoutMs,wi.InitialSilenceTimeoutMs],[x.SpeechServiceResponse_PostProcessingOption,wi.Postprocessing],[x.SpeechServiceResponse_ProfanityOption,wi.Profanity],[x.SpeechServiceResponse_RequestWordLevelTimestamps,wi.EnableWordLevelTimestamps],[x.SpeechServiceResponse_StablePartialResultThreshold,wi.StableIntermediateThreshold]]).forEach(((n,r)=>{this.setUrlParameter(r,n,e,t,i)}));const n=JSON.parse(e.parameters.getProperty(M,"{}"));Object.keys(n).forEach((e=>{t[e]=n[e]}))}setUrlParameter(e,t,i,n,r){const s=i.parameters.getProperty(e,void 0);!s||r&&-1!==r.search(t)||(n[t]=s.toLocaleLowerCase())}}class Ii{toConnectionMessage(e){const t=new le;try{if(e.messageType===Fe.Text){const i=e.textContent;let n={},r=null;if(i){const e=i.split("\r\n\r\n");e&&e.length>0&&(n=this.parseHeaders(e[0]),e.length>1&&(r=e[1]))}t.resolve(new Ze(e.messageType,r,n,e.id))}else if(e.messageType===Fe.Binary){const i=e.binaryContent;let n={},r=null;if(!i||i.byteLength<2)throw new Error("Invalid binary message format. Header length missing.");const s=new DataView(i),o=s.getInt16(0);if(i.byteLength<o+2)throw new Error("Invalid binary message format. Header content missing.");let a="";for(let e=0;e<o;e++)a+=String.fromCharCode(s.getInt8(e+2));n=this.parseHeaders(a),i.byteLength>o+2&&(r=i.slice(2+o)),t.resolve(new Ze(e.messageType,r,n,e.id))}}catch(e){t.reject(`Error formatting the message. Error: ${e}`)}return t.promise}fromConnectionMessage(e){const t=new le;try{if(e.messageType===Fe.Text){const i=`${this.makeHeaders(e)}\r\n${e.textBody?e.textBody:""}`;t.resolve(new qt(Fe.Text,i,e.id))}else if(e.messageType===Fe.Binary){const i=this.makeHeaders(e),n=e.binaryBody,r=this.stringToArrayBuffer(i),s=new Int8Array(r),o=s.byteLength,a=new Int8Array(2+o+(n?n.byteLength:0));if(a[0]=o>>8&255,a[1]=255&o,a.set(s,2),n){const e=new Int8Array(n);a.set(e,2+o)}const c=a.buffer;t.resolve(new qt(Fe.Binary,c,e.id))}}catch(e){t.reject(`Error formatting the message. ${e}`)}return t.promise}makeHeaders(e){let t="";if(e.headers)for(const i in e.headers)i&&(t+=`${i}: ${e.headers[i]}\r\n`);return t}parseHeaders(e){const t={};if(e){const i=e.match(/[^\r\n]+/g);if(t)for(const e of i)if(e){const i=e.indexOf(":"),n=i>0?e.substr(0,i).trim().toLowerCase():e,r=i>0&&e.length>i+1?e.substr(i+1).trim():"";t[n]=r}}return t}stringToArrayBuffer(e){const t=new ArrayBuffer(e.length),i=new DataView(t);for(let t=0;t<e.length;t++)i.setUint8(t,e.charCodeAt(t));return t}}class Ri extends bi{constructor(){super(...arguments),this.interactiveRelativeUri="/speech/recognition/interactive/cognitiveservices/v1",this.conversationRelativeUri="/speech/recognition/conversation/cognitiveservices/v1",this.dictationRelativeUri="/speech/recognition/dictation/cognitiveservices/v1",this.universalUri="/speech/universal/v"}create(e,t,i){let n=e.parameters.getProperty(x.SpeechServiceConnection_Endpoint,void 0);const r=e.parameters.getProperty(x.SpeechServiceConnection_Region,void 0),s=bi.getHostSuffix(r),o=e.parameters.getProperty(x.SpeechServiceConnection_Host,"wss://"+r+".stt.speech"+s),a={},c=e.parameters.getProperty(x.SpeechServiceConnection_EndpointId,void 0),p=e.parameters.getProperty(x.SpeechServiceConnection_RecoLanguage,void 0);if(c?n&&-1!==n.search(wi.CustomSpeechDeploymentId)||(a[wi.CustomSpeechDeploymentId]=c):p&&(n&&-1!==n.search(wi.Language)||(a[wi.Language]=p)),n&&-1!==n.search(wi.Format)||(a[wi.Format]=e.parameters.getProperty(T,z[z.Simple]).toLowerCase()),void 0!==e.autoDetectSourceLanguages&&(a[wi.EnableLanguageId]="true"),this.setCommonUrlParams(e,a,n),!n)switch(e.recognitionMode){case G.Conversation:n="true"===e.parameters.getProperty(O,"false")?o+this.dictationRelativeUri:void 0!==e.recognitionEndpointVersion&&parseInt(e.recognitionEndpointVersion,10)>1?`${o}${this.universalUri}${e.recognitionEndpointVersion}`:o+this.conversationRelativeUri;break;case G.Dictation:n=o+this.dictationRelativeUri;break;default:n=void 0!==e.recognitionEndpointVersion&&parseInt(e.recognitionEndpointVersion,10)>1?`${o}${this.universalUri}${e.recognitionEndpointVersion}`:o+this.interactiveRelativeUri}const u={};void 0!==t.token&&""!==t.token&&(u[t.headerName]=t.token),u[Et.ConnectionId]=i;const h="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false"),d=new Ai(n,a,u,new Ii,Ci.fromRecognizerConfig(e),h,i),l=d.uri;return e.parameters.setProperty(x.SpeechServiceConnection_Url,l),d}}class ki extends class{constructor(e,t,i,n,r,s,o,a,c,p){this.privResultId=e,this.privReason=t,this.privText=i,this.privDuration=n,this.privOffset=r,this.privLanguage=s,this.privLanguageDetectionConfidence=o,this.privErrorDetails=a,this.privJson=c,this.privProperties=p}get resultId(){return this.privResultId}get reason(){return this.privReason}get text(){return this.privText}get duration(){return this.privDuration}get offset(){return this.privOffset}get language(){return this.privLanguage}get languageDetectionConfidence(){return this.privLanguageDetectionConfidence}get errorDetails(){return this.privErrorDetails}get json(){return this.privJson}get properties(){return this.privProperties}}{constructor(e,t,i,n,r,s,o,a,c,p,u){super(e,t,i,n,r,s,o,c,p,u),this.privSpeakerId=a}get speakerId(){return this.privSpeakerId}}class Ei{constructor(e){this.privSessionId=e}get sessionId(){return this.privSessionId}}class Pi extends Ei{constructor(e,t){super(t),this.privOffset=e}get offset(){return this.privOffset}}class Ti extends Pi{constructor(e,t,i){super(t,i),this.privResult=e}get result(){return this.privResult}}class Di extends Pi{constructor(e,t,i,n,r){super(n,r),this.privReason=e,this.privErrorDetails=t,this.privErrorCode=i}get reason(){return this.privReason}get errorCode(){return this.privErrorCode}get errorDetails(){return this.privErrorDetails}}class Mi extends Di{}class Oi{constructor(e,t){this.privBuffers=[],this.privReplayOffset=0,this.privLastShrinkOffset=0,this.privBufferStartOffset=0,this.privBufferSerial=0,this.privBufferedBytes=0,this.privReplay=!1,this.privLastChunkAcquiredTime=0,this.privAudioNode=e,this.privBytesPerSecond=t}id(){return this.privAudioNode.id()}read(){if(this.privReplay&&0!==this.privBuffers.length){const e=this.privReplayOffset-this.privBufferStartOffset;let t=Math.round(e*this.privBytesPerSecond*1e-7);0!=t%2&&t++;let i=0;for(;i<this.privBuffers.length&&t>=this.privBuffers[i].chunk.buffer.byteLength;)t-=this.privBuffers[i++].chunk.buffer.byteLength;if(i<this.privBuffers.length){const e=this.privBuffers[i].chunk.buffer.slice(t);return this.privReplayOffset+=e.byteLength/this.privBytesPerSecond*1e7,i===this.privBuffers.length-1&&(this.privReplay=!1),Promise.resolve({buffer:e,isEnd:!1,timeReceived:this.privBuffers[i].chunk.timeReceived})}}return this.privAudioNode.read().then((e=>(e&&e.buffer&&(this.privBuffers.push(new Li(e,this.privBufferSerial++,this.privBufferedBytes)),this.privBufferedBytes+=e.buffer.byteLength),e)))}detach(){return this.privBuffers=void 0,this.privAudioNode.detach()}replay(){this.privBuffers&&0!==this.privBuffers.length&&(this.privReplay=!0,this.privReplayOffset=this.privLastShrinkOffset)}shrinkBuffers(e){if(void 0===this.privBuffers||0===this.privBuffers.length)return;this.privLastShrinkOffset=e;const t=e-this.privBufferStartOffset;let i=Math.round(t*this.privBytesPerSecond*1e-7),n=0;for(;n<this.privBuffers.length&&i>=this.privBuffers[n].chunk.buffer.byteLength;)i-=this.privBuffers[n++].chunk.buffer.byteLength;this.privBufferStartOffset=Math.round(e-i/this.privBytesPerSecond*1e7),this.privBuffers=this.privBuffers.slice(n)}findTimeAtOffset(e){if(e<this.privBufferStartOffset||void 0===this.privBuffers)return 0;for(const t of this.privBuffers){const i=t.byteOffset/this.privBytesPerSecond*1e7,n=i+t.chunk.buffer.byteLength/this.privBytesPerSecond*1e7;if(e>=i&&e<=n)return t.chunk.timeReceived}return 0}}class Li{constructor(e,t,i){this.chunk=e,this.serial=t,this.byteOffset=i}}class xi{static load(){const e=new Map([[0,()=>{}]]),t=new Map,i="data:text/javascript;base64,"+btoa('!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}([function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return d}));const r=new Map,o=new Map,i=e=>{const t=r.get(e);if(void 0===t)throw new Error(\'There is no interval scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),r.delete(e)},u=e=>{const t=o.get(e);if(void 0===t)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),o.delete(e)},f=(e,t)=>{let n,r;if("performance"in self){const o=performance.now();n=o,r=e-Math.max(0,o-t)}else n=Date.now(),r=e;return{expected:n+r,remainingDelay:r}},c=(e,t,n,r)=>{const o="performance"in self?performance.now():Date.now();o>n?postMessage({id:null,method:"call",params:{timerId:t}}):e.set(t,setTimeout(c,n-o,e,t,n))},a=(e,t,n)=>{const{expected:o,remainingDelay:i}=f(e,n);r.set(t,setTimeout(c,i,r,t,o))},d=(e,t,n)=>{const{expected:r,remainingDelay:i}=f(e,n);o.set(t,setTimeout(c,i,o,t,r))}},function(e,t,n){"use strict";n.r(t);var r=n(2);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(3);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(4);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o);var f=n(5);for(var o in f)"default"!==o&&function(e){n.d(t,e,(function(){return f[e]}))}(o);var c=n(6);for(var o in c)"default"!==o&&function(e){n.d(t,e,(function(){return c[e]}))}(o);var a=n(7);for(var o in a)"default"!==o&&function(e){n.d(t,e,(function(){return a[e]}))}(o);var d=n(8);for(var o in d)"default"!==o&&function(e){n.d(t,e,(function(){return d[e]}))}(o);var s=n(9);for(var o in s)"default"!==o&&function(e){n.d(t,e,(function(){return s[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(11);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(12);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(13);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(1);for(var i in o)"default"!==i&&function(e){n.d(t,e,(function(){return o[e]}))}(i);var u=n(10);for(var i in u)"default"!==i&&function(e){n.d(t,e,(function(){return u[e]}))}(i);addEventListener("message",({data:e})=>{try{if("clear"===e.method){const{id:t,params:{timerId:n}}=e;Object(r.b)(n),postMessage({error:null,id:t})}else{if("set"!==e.method)throw new Error(\'The given method "\'.concat(e.method,\'" is not supported\'));{const{params:{delay:t,now:n,timerId:o}}=e;Object(r.d)(t,o,n)}}}catch(t){postMessage({error:{message:t.message},id:e.id,result:null})}})}]);'),n=new Worker(i);return n.addEventListener("message",(({data:i})=>{if(xi.isCallNotification(i)){const{params:{timerId:n}}=i,r=e.get(n);if("number"==typeof r){const e=t.get(r);if(void 0===e||e!==n)throw new Error("The timer is in an undefined state.")}else{if(void 0===r)throw new Error("The timer is in an undefined state.");r(),e.delete(n)}}else{if(!xi.isClearResponse(i)){const{error:{message:e}}=i;throw new Error(e)}{const{id:n}=i,r=t.get(n);if(void 0===r)throw new Error("The timer is in an undefined state.");t.delete(n),e.delete(r)}}})),{clearTimeout:i=>{const r=Math.random();t.set(r,i),e.set(i,r),n.postMessage({id:r,method:"clear",params:{timerId:i}})},setTimeout:(t,i)=>{const r=Math.random();return e.set(r,t),n.postMessage({id:null,method:"set",params:{delay:i,now:performance.now(),timerId:r}}),r}}}static loadWorkerTimers(){return()=>(null!==xi.workerTimers||(xi.workerTimers=xi.load()),xi.workerTimers)}static isCallNotification(e){return void 0!==e.method&&"call"===e.method}static isClearResponse(e){return null===e.error&&"number"==typeof e.id}}xi.workerTimers=null,xi.clearTimeout=e=>xi.timers().clearTimeout(e),xi.setTimeout=(e,t)=>xi.timers().setTimeout(e,t),xi.timers=xi.loadWorkerTimers();class zi extends ge{constructor(e,t,i,n=he.Info){super(e,n),this.privRequestId=t,this.privSessionId=i}get requestId(){return this.privRequestId}get sessionId(){return this.privSessionId}}class Bi extends zi{constructor(e,t,i,n){super("RecognitionTriggeredEvent",e,t),this.privAudioSourceId=i,this.privAudioNodeId=n}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}}class Ni extends zi{constructor(e,t,i,n){super("ListeningStartedEvent",e,t),this.privAudioSourceId=i,this.privAudioNodeId=n}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}}class Gi extends zi{constructor(e,t,i){super("ConnectingToServiceEvent",e,i),this.privAuthFetchEventid=t}get authFetchEventid(){return this.privAuthFetchEventid}}class Fi extends zi{constructor(e,t,i,n,r){super("RecognitionStartedEvent",e,r),this.privAudioSourceId=t,this.privAudioNodeId=i,this.privAuthFetchEventId=n}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}get authFetchEventId(){return this.privAuthFetchEventId}}!function(e){e[e.Success=0]="Success",e[e.AudioSourceError=1]="AudioSourceError",e[e.AudioSourceTimeout=2]="AudioSourceTimeout",e[e.AuthTokenFetchError=3]="AuthTokenFetchError",e[e.AuthTokenFetchTimeout=4]="AuthTokenFetchTimeout",e[e.UnAuthorized=5]="UnAuthorized",e[e.ConnectTimeout=6]="ConnectTimeout",e[e.ConnectError=7]="ConnectError",e[e.ClientRecognitionActivityTimeout=8]="ClientRecognitionActivityTimeout",e[e.UnknownError=9]="UnknownError"}(yi||(yi={}));class Hi{constructor(e,t,i){this.privIsDisposed=!1,this.privListeningTriggerMetric=null,this.privMicMetric=null,this.privConnectionEstablishMetric=null,this.privRequestId=e,this.privAudioSourceId=t,this.privAudioNodeId=i,this.privReceivedMessages={},this.privPhraseLatencies=[],this.privHypothesisLatencies=[]}phraseReceived(e){e>0&&this.privPhraseLatencies.push(Date.now()-e)}hypothesisReceived(e){e>0&&this.privHypothesisLatencies.push(Date.now()-e)}onEvent(e){if(!this.privIsDisposed&&(e instanceof Bi&&e.requestId===this.privRequestId&&(this.privListeningTriggerMetric={End:e.eventTime,Name:"ListeningTrigger",Start:e.eventTime}),e instanceof Ce&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicStartTime=e.eventTime),e instanceof we&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicStartTime=e.eventTime),e instanceof ye&&e.audioSourceId===this.privAudioSourceId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Error:e.error,Name:"Microphone",Start:this.privMicStartTime})),e instanceof Ie&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Error:e.error,Name:"Microphone",Start:this.privMicStartTime})),e instanceof be&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Name:"Microphone",Start:this.privMicStartTime})),e instanceof Gi&&e.requestId===this.privRequestId&&(this.privConnectionId=e.sessionId),e instanceof et&&e.connectionId===this.privConnectionId&&(this.privConnectionStartTime=e.eventTime),e instanceof tt&&e.connectionId===this.privConnectionId&&(this.privConnectionEstablishMetric||(this.privConnectionEstablishMetric={End:e.eventTime,Id:this.privConnectionId,Name:"Connection",Start:this.privConnectionStartTime})),e instanceof rt&&e.connectionId===this.privConnectionId&&(this.privConnectionEstablishMetric||(this.privConnectionEstablishMetric={End:e.eventTime,Error:this.getConnectionError(e.statusCode),Id:this.privConnectionId,Name:"Connection",Start:this.privConnectionStartTime})),e instanceof st&&e.connectionId===this.privConnectionId&&e.message&&e.message.headers&&e.message.headers.path)){this.privReceivedMessages[e.message.headers.path]||(this.privReceivedMessages[e.message.headers.path]=new Array);const t=50;this.privReceivedMessages[e.message.headers.path].length<t&&this.privReceivedMessages[e.message.headers.path].push(e.networkReceivedTime)}}getTelemetry(){const e=new Array;this.privListeningTriggerMetric&&e.push(this.privListeningTriggerMetric),this.privMicMetric&&e.push(this.privMicMetric),this.privConnectionEstablishMetric&&e.push(this.privConnectionEstablishMetric),this.privPhraseLatencies.length>0&&e.push({PhraseLatencyMs:this.privPhraseLatencies}),this.privHypothesisLatencies.length>0&&e.push({FirstHypothesisLatencyMs:this.privHypothesisLatencies});const t={Metrics:e,ReceivedMessages:this.privReceivedMessages},i=JSON.stringify(t);return this.privReceivedMessages={},this.privListeningTriggerMetric=null,this.privMicMetric=null,this.privConnectionEstablishMetric=null,this.privPhraseLatencies=[],this.privHypothesisLatencies=[],i}get hasTelemetry(){return 0!==Object.keys(this.privReceivedMessages).length||null!==this.privListeningTriggerMetric||null!==this.privMicMetric||null!==this.privConnectionEstablishMetric||0!==this.privPhraseLatencies.length||0!==this.privHypothesisLatencies.length}dispose(){this.privIsDisposed=!0}getConnectionError(e){switch(e){case 400:case 1002:case 1003:case 1005:case 1007:case 1008:case 1009:return"BadRequest";case 401:return"Unauthorized";case 403:return"Forbidden";case 503:case 1001:return"ServerUnavailable";case 500:case 1011:return"ServerError";case 408:case 504:return"Timeout";default:return"statuscode:"+e.toString()}}}var Ui=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class Ki{constructor(e){this.privIsDisposed=!1,this.privDetachables=new Array,this.privIsAudioNodeDetached=!1,this.privIsRecognizing=!1,this.privIsSpeechEnded=!1,this.privTurnStartAudioOffset=0,this.privLastRecoOffset=0,this.privHypothesisReceived=!1,this.privBytesSent=0,this.privRecogNumber=0,this.privInTurn=!1,this.privConnectionAttempts=0,this.privAudioSourceId=e,this.privRequestId=se(),this.privAudioNodeId=se(),this.privTurnDeferral=new le,this.privTurnDeferral.resolve()}get sessionId(){return this.privSessionId}get requestId(){return this.privRequestId}get audioNodeId(){return this.privAudioNodeId}get turnCompletionPromise(){return this.privTurnDeferral.promise}get isSpeechEnded(){return this.privIsSpeechEnded}get isRecognizing(){return this.privIsRecognizing}get currentTurnAudioOffset(){return this.privTurnStartAudioOffset}get recogNumber(){return this.privRecogNumber}get numConnectionAttempts(){return this.privConnectionAttempts}get bytesSent(){return this.privBytesSent}listenForServiceTelemetry(e){this.privServiceTelemetryListener&&this.privDetachables.push(e.attachListener(this.privServiceTelemetryListener))}startNewRecognition(){this.privIsSpeechEnded=!1,this.privIsRecognizing=!0,this.privTurnStartAudioOffset=0,this.privLastRecoOffset=0,this.privRecogNumber++,this.privServiceTelemetryListener=new Hi(this.privRequestId,this.privAudioSourceId,this.privAudioNodeId),this.onEvent(new Bi(this.requestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId))}onAudioSourceAttachCompleted(e,t){return Ui(this,void 0,void 0,(function*(){this.privAudioNode=e,this.privIsAudioNodeDetached=!1,t?yield this.onComplete():this.onEvent(new Ni(this.privRequestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId))}))}onPreConnectionStart(e,t){this.privAuthFetchEventId=e,this.privSessionId=t,this.onEvent(new Gi(this.privRequestId,this.privAuthFetchEventId,this.privSessionId))}onAuthCompleted(e){return Ui(this,void 0,void 0,(function*(){e&&(yield this.onComplete())}))}onConnectionEstablishCompleted(e,t){return Ui(this,void 0,void 0,(function*(){if(200===e)return this.onEvent(new Fi(this.requestId,this.privAudioSourceId,this.privAudioNodeId,this.privAuthFetchEventId,this.privSessionId)),this.privAudioNode&&this.privAudioNode.replay(),this.privTurnStartAudioOffset=this.privLastRecoOffset,void(this.privBytesSent=0);403===e&&(yield this.onComplete())}))}onServiceTurnEndResponse(e){return Ui(this,void 0,void 0,(function*(){this.privTurnDeferral.resolve(),!e||this.isSpeechEnded?(yield this.onComplete(),this.privInTurn=!1):(this.privTurnStartAudioOffset=this.privLastRecoOffset,this.privAudioNode.replay())}))}onSpeechContext(){this.privRequestId=se()}onServiceTurnStartResponse(){this.privTurnDeferral&&this.privInTurn&&(this.privTurnDeferral.reject("Another turn started before current completed."),this.privTurnDeferral.promise.then().catch((()=>{}))),this.privInTurn=!0,this.privTurnDeferral=new le}onHypothesis(e){this.privHypothesisReceived||(this.privHypothesisReceived=!0,this.privServiceTelemetryListener.hypothesisReceived(this.privAudioNode.findTimeAtOffset(e)))}onPhraseRecognized(e){this.privServiceTelemetryListener.phraseReceived(this.privAudioNode.findTimeAtOffset(e)),this.onServiceRecognized(e)}onServiceRecognized(e){this.privLastRecoOffset=e,this.privHypothesisReceived=!1,this.privAudioNode.shrinkBuffers(e),this.privConnectionAttempts=0}onAudioSent(e){this.privBytesSent+=e}onRetryConnection(){this.privConnectionAttempts++}dispose(){return Ui(this,void 0,void 0,(function*(){if(!this.privIsDisposed){this.privIsDisposed=!0;for(const e of this.privDetachables)yield e.detach();this.privServiceTelemetryListener&&this.privServiceTelemetryListener.dispose(),this.privIsRecognizing=!1}}))}getTelemetry(){return this.privServiceTelemetryListener.hasTelemetry?this.privServiceTelemetryListener.getTelemetry():null}onStopRecognizing(){return Ui(this,void 0,void 0,(function*(){yield this.onComplete()}))}onSpeechEnded(){this.privIsSpeechEnded=!0}onEvent(e){this.privServiceTelemetryListener&&this.privServiceTelemetryListener.onEvent(e),Oe.instance.onEvent(e)}onComplete(){return Ui(this,void 0,void 0,(function*(){this.privIsRecognizing&&(this.privIsRecognizing=!1,yield this.detachAudioNode())}))}detachAudioNode(){return Ui(this,void 0,void 0,(function*(){this.privIsAudioNodeDetached||(this.privIsAudioNodeDetached=!0,this.privAudioNode&&(yield this.privAudioNode.detach()))}))}}class qi{addPhrase(e){this.privPhrases||(this.privPhrases=[]),e instanceof Array?this.privPhrases=this.privPhrases.concat(e):this.privPhrases.push(e)}clearPhrases(){this.privPhrases=void 0}addReferenceGrammar(e){this.privGrammars||(this.privGrammars=[]),e instanceof Array?this.privGrammars=this.privGrammars.concat(e):this.privGrammars.push(e)}clearGrammars(){this.privGrammars=void 0}generateGrammarObject(){if(void 0===this.privGrammars&&void 0===this.privPhrases)return;const e={};if(e.ReferenceGrammars=this.privGrammars,void 0!==this.privPhrases&&0!==this.privPhrases.length){const t=[];this.privPhrases.forEach((e=>{t.push({Text:e})})),e.Groups=[{Type:"Generic",Items:t}]}return e}}class ji{constructor(e){this.privContext={},this.privDynamicGrammar=e}getSection(e){return this.privContext[e]||{}}setSection(e,t){this.privContext[e]=t}setPronunciationAssessmentParams(e){void 0===this.privContext.phraseDetection&&(this.privContext.phraseDetection={enrichment:{pronunciationAssessment:{}}}),this.privContext.phraseDetection.enrichment.pronunciationAssessment=JSON.parse(e),this.setWordLevelTimings(),this.privContext.phraseOutput.detailed.options.push("PronunciationAssessment"),-1===this.privContext.phraseOutput.detailed.options.indexOf("SNR")&&this.privContext.phraseOutput.detailed.options.push("SNR")}setWordLevelTimings(){void 0===this.privContext.phraseOutput&&(this.privContext.phraseOutput={detailed:{options:[]},format:{}}),void 0===this.privContext.phraseOutput.detailed&&(this.privContext.phraseOutput.detailed={options:[]}),this.privContext.phraseOutput.format="Detailed",-1===this.privContext.phraseOutput.detailed.options.indexOf("WordTimings")&&this.privContext.phraseOutput.detailed.options.push("WordTimings")}toJSON(){const e=this.privDynamicGrammar.generateGrammarObject();return this.setSection("dgi",e),JSON.stringify(this.privContext)}}class Vi{constructor(e){this.privSpeechStartDetected=JSON.parse(e)}static fromJSON(e){return new Vi(e)}get Offset(){return this.privSpeechStartDetected.Offset}}var Xi,Wi,Qi=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class Ji{constructor(e,t,i,n,r){if(this.privConnectionConfigurationPromise=void 0,this.privConnectionPromise=void 0,this.privSetTimeout=setTimeout,this.privIsLiveAudio=!1,this.recognizeOverride=void 0,this.recognizeSpeaker=void 0,this.disconnectOverride=void 0,this.receiveMessageOverride=void 0,this.sendPrePayloadJSONOverride=void 0,this.postConnectImplOverride=void 0,this.configConnectionOverride=void 0,this.handleSpeechPhraseMessage=void 0,this.handleSpeechHypothesisMessage=void 0,!e)throw new oe("authentication");if(!t)throw new oe("connectionFactory");if(!i)throw new oe("audioSource");if(!n)throw new oe("recognizerConfig");this.privMustReportEndOfStream=!1,this.privAuthentication=e,this.privConnectionFactory=t,this.privAudioSource=i,this.privRecognizerConfig=n,this.privIsDisposed=!1,this.privRecognizer=r,this.privRequestSession=new Ki(this.privAudioSource.id()),this.privConnectionEvents=new pe,this.privServiceEvents=new pe,this.privDynamicGrammar=new qi,this.privSpeechContext=new ji(this.privDynamicGrammar),this.privAgentConfig=new kt,"undefined"!=typeof Blob&&"undefined"!=typeof Worker&&(this.privSetTimeout=xi.setTimeout),this.connectionEvents.attach((e=>{if("ConnectionClosedEvent"===e.name){const t=e;(1003===t.statusCode||1007===t.statusCode||1002===t.statusCode||4e3===t.statusCode||this.privRequestSession.numConnectionAttempts>this.privRecognizerConfig.maxRetryCount)&&this.cancelRecognitionLocal(Ue.Error,1007===t.statusCode?Ke.BadRequestParameters:Ke.ConnectionFailure,`${t.reason} websocket error code: ${t.statusCode}`)}}))}get audioSource(){return this.privAudioSource}get speechContext(){return this.privSpeechContext}get dynamicGrammar(){return this.privDynamicGrammar}get agentConfig(){return this.privAgentConfig}set conversationTranslatorToken(e){this.privRecognizerConfig.parameters.setProperty(x.ConversationTranslator_Token,e)}set voiceProfileType(e){this.privRecognizerConfig.parameters.setProperty(x.SpeechServiceConnection_SpeakerIdMode,e)}set authentication(e){this.privAuthentication=this.authentication}isDisposed(){return this.privIsDisposed}dispose(e){return Qi(this,void 0,void 0,(function*(){if(this.privIsDisposed=!0,void 0!==this.privConnectionConfigurationPromise)try{const t=yield this.privConnectionConfigurationPromise;yield t.dispose(e)}catch(e){return}}))}get connectionEvents(){return this.privConnectionEvents}get serviceEvents(){return this.privServiceEvents}get recognitionMode(){return this.privRecognizerConfig.recognitionMode}recognize(e,t,i){return Qi(this,void 0,void 0,(function*(){if(void 0!==this.recognizeOverride)return void(yield this.recognizeOverride(e,t,i));this.privConnectionConfigurationPromise=void 0,this.privRecognizerConfig.recognitionMode=e,this.setSpeechSegmentationTimeout(),this.privSuccessCallback=t,this.privErrorCallback=i,this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privAudioSource.events);const n=this.connectImpl();let r;try{const e=yield this.audioSource.attach(this.privRequestSession.audioNodeId),t=yield this.audioSource.format,i=yield this.audioSource.deviceInfo;this.privIsLiveAudio=i.type&&i.type===U.Microphones,r=new Oi(e,t.avgBytesPerSec),yield this.privRequestSession.onAudioSourceAttachCompleted(r,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:i}}catch(e){throw yield this.privRequestSession.onStopRecognizing(),e}try{yield n}catch(e){return void(yield this.cancelRecognitionLocal(Ue.Error,Ke.ConnectionFailure,e))}const s=new Ei(this.privRequestSession.sessionId);this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,s),this.receiveMessage(),this.sendAudio(r).catch((e=>Qi(this,void 0,void 0,(function*(){yield this.cancelRecognitionLocal(Ue.Error,Ke.RuntimeError,e)}))))}))}stopRecognizing(){return Qi(this,void 0,void 0,(function*(){if(this.privRequestSession.isRecognizing)try{yield this.audioSource.turnOff(),yield this.sendFinalAudio(),yield this.privRequestSession.onStopRecognizing(),yield this.privRequestSession.turnCompletionPromise}finally{yield this.privRequestSession.dispose()}}))}connect(){return Qi(this,void 0,void 0,(function*(){return yield this.connectImpl(),Promise.resolve()}))}connectAsync(e,t){this.connectImpl().then((()=>{try{e&&e()}catch(e){t&&t(e)}}),(e=>{try{t&&t(e)}catch(e){}}))}disconnect(){return Qi(this,void 0,void 0,(function*(){if(yield this.cancelRecognitionLocal(Ue.Error,Ke.NoError,"Disconnecting"),void 0!==this.disconnectOverride&&(yield this.disconnectOverride()),void 0!==this.privConnectionPromise)try{yield(yield this.privConnectionPromise).dispose()}catch(e){}this.privConnectionPromise=void 0}))}sendMessage(e){}sendNetworkMessage(e,t){return Qi(this,void 0,void 0,(function*(){const i="string"==typeof t?Fe.Text:Fe.Binary,n="string"==typeof t?"application/json":"";return(yield this.fetchConnection()).send(new Pt(i,e,this.privRequestSession.requestId,n,t))}))}set activityTemplate(e){this.privActivityTemplate=e}get activityTemplate(){return this.privActivityTemplate}sendTelemetryData(){return Qi(this,void 0,void 0,(function*(){const e=this.privRequestSession.getTelemetry();if(!0!==Ji.telemetryDataEnabled||this.privIsDisposed||null===e)return;if(Ji.telemetryData)try{Ji.telemetryData(e)}catch(e){}const t=yield this.fetchConnection();yield t.send(new Pt(Fe.Text,"telemetry",this.privRequestSession.requestId,"application/json",e))}))}cancelRecognitionLocal(e,t,i){return Qi(this,void 0,void 0,(function*(){this.privRequestSession.isRecognizing&&(yield this.privRequestSession.onStopRecognizing(),this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,e,t,i))}))}receiveMessage(){return Qi(this,void 0,void 0,(function*(){try{if(this.privIsDisposed)return;let e=yield this.fetchConnection();const t=yield e.read();if(void 0!==this.receiveMessageOverride)return this.receiveMessageOverride();if(!t)return this.privRequestSession.isRecognizing?this.receiveMessage():void 0;this.privServiceHasSentMessage=!0;const i=Pt.fromConnectionMessage(t);if(i.requestId.toLowerCase()===this.privRequestSession.requestId.toLowerCase())switch(i.path.toLowerCase()){case"turn.start":this.privMustReportEndOfStream=!0,this.privRequestSession.onServiceTurnStartResponse();break;case"speech.startdetected":const t=Vi.fromJSON(i.textBody),n=new Pi(t.Offset,this.privRequestSession.sessionId);this.privRecognizer.speechStartDetected&&this.privRecognizer.speechStartDetected(this.privRecognizer,n);break;case"speech.enddetected":let r;r=i.textBody.length>0?i.textBody:"{ Offset: 0 }";const s=Vi.fromJSON(r);this.privRecognizerConfig.isContinuousRecognition&&this.privRequestSession.onServiceRecognized(s.Offset+this.privRequestSession.currentTurnAudioOffset);const o=new Pi(s.Offset+this.privRequestSession.currentTurnAudioOffset,this.privRequestSession.sessionId);this.privRecognizer.speechEndDetected&&this.privRecognizer.speechEndDetected(this.privRecognizer,o);break;case"turn.end":yield this.sendTelemetryData(),this.privRequestSession.isSpeechEnded&&this.privMustReportEndOfStream&&(this.privMustReportEndOfStream=!1,yield this.cancelRecognitionLocal(Ue.EndOfStream,Ke.NoError,void 0));const a=new Ei(this.privRequestSession.sessionId);if(yield this.privRequestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition),!this.privRecognizerConfig.isContinuousRecognition||this.privRequestSession.isSpeechEnded||!this.privRequestSession.isRecognizing)return void(this.privRecognizer.sessionStopped&&this.privRecognizer.sessionStopped(this.privRecognizer,a));e=yield this.fetchConnection(),yield this.sendPrePayloadJSON(e);break;default:(yield this.processTypeSpecificMessages(i))||this.privServiceEvents&&this.serviceEvents.onEvent(new Ye(i.path.toLowerCase(),i.textBody))}return this.receiveMessage()}catch(e){return null}}))}setSpeechSegmentationTimeout(){}sendSpeechContext(e,t){const i=this.speechContext.toJSON();if(t&&this.privRequestSession.onSpeechContext(),i)return e.send(new Pt(Fe.Text,"speech.context",this.privRequestSession.requestId,"application/json",i))}noOp(){}sendPrePayloadJSON(e,t=!0){return Qi(this,void 0,void 0,(function*(){if(void 0!==this.sendPrePayloadJSONOverride)return this.sendPrePayloadJSONOverride(e);yield this.sendSpeechContext(e,t),yield this.sendWaveHeader(e)}))}sendWaveHeader(e){return Qi(this,void 0,void 0,(function*(){const t=yield this.audioSource.format;return e.send(new Pt(Fe.Binary,"audio",this.privRequestSession.requestId,"audio/x-wav",t.header))}))}connectImpl(){return void 0!==this.privConnectionPromise?this.privConnectionPromise.then((e=>e.state()===He.Disconnected?(this.privConnectionId=null,this.privConnectionPromise=void 0,this.privServiceHasSentMessage=!1,this.connectImpl()):this.privConnectionPromise),(()=>(this.privConnectionId=null,this.privConnectionPromise=void 0,this.privServiceHasSentMessage=!1,this.connectImpl()))):(this.privConnectionPromise=this.retryableConnect(),this.privConnectionPromise.catch((()=>{})),void 0!==this.postConnectImplOverride?this.postConnectImplOverride(this.privConnectionPromise):this.privConnectionPromise)}sendSpeechServiceConfig(e,t,i){if(t.onSpeechContext(),!0!==Ji.telemetryDataEnabled){const e={context:{system:JSON.parse(i).context.system}};i=JSON.stringify(e)}if("true"===this.privRecognizerConfig.parameters.getProperty("f0f5debc-f8c9-4892-ac4b-90a7ab359fd2","false").toLowerCase()){const e=JSON.parse(i);e.context.DisableReferenceChannel="True",e.context.MicSpec="1_0_0",i=JSON.stringify(e)}if(i)return e.send(new Pt(Fe.Text,"speech.config",t.requestId,"application/json",i))}fetchConnection(){return Qi(this,void 0,void 0,(function*(){return void 0!==this.privConnectionConfigurationPromise?this.privConnectionConfigurationPromise.then((e=>e.state()===He.Disconnected?(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.privServiceHasSentMessage=!1,this.fetchConnection()):this.privConnectionConfigurationPromise),(()=>(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.privServiceHasSentMessage=!1,this.fetchConnection()))):(this.privConnectionConfigurationPromise=this.configureConnection(),yield this.privConnectionConfigurationPromise)}))}sendAudio(e){return Qi(this,void 0,void 0,(function*(){const t=yield this.audioSource.format;let i=Date.now();const n=this.privRecognizerConfig.parameters.getProperty("SPEECH-TransmitLengthBeforThrottleMs","5000"),r=t.avgBytesPerSec/1e3*parseInt(n,10),s=this.privRequestSession.recogNumber,o=()=>Qi(this,void 0,void 0,(function*(){if(!this.privIsDisposed&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing&&this.privRequestSession.recogNumber===s){const n=yield this.fetchConnection(),a=yield e.read();if(this.privRequestSession.isSpeechEnded)return;let c,p;if(!a||a.isEnd?(c=null,p=0):(c=a.buffer,this.privRequestSession.onAudioSent(c.byteLength),p=r>=this.privRequestSession.bytesSent?0:Math.max(0,i-Date.now())),0!==p&&(yield this.delay(p)),null!==c&&(i=Date.now()+1e3*c.byteLength/(2*t.avgBytesPerSec)),!this.privIsDisposed&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing&&this.privRequestSession.recogNumber===s){if(n.send(new Pt(Fe.Binary,"audio",this.privRequestSession.requestId,null,c)).catch((()=>{this.privRequestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition).catch((()=>{}))})),!(null==a?void 0:a.isEnd))return o();this.privIsLiveAudio||this.privRequestSession.onSpeechEnded()}}}));return o()}))}retryableConnect(){return Qi(this,void 0,void 0,(function*(){let e=!1;this.privAuthFetchEventId=se();const t=this.privRequestSession.sessionId;this.privConnectionId=void 0!==t?t:se(),this.privRequestSession.onPreConnectionStart(this.privAuthFetchEventId,this.privConnectionId);let i=0,n="";for(;this.privRequestSession.numConnectionAttempts<=this.privRecognizerConfig.maxRetryCount;){const t=e?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId),r=yield t;yield this.privRequestSession.onAuthCompleted(!1);const s=this.privConnectionFactory.create(this.privRecognizerConfig,r,this.privConnectionId);this.privRequestSession.listenForServiceTelemetry(s.events),s.events.attach((e=>{this.connectionEvents.onEvent(e)}));const o=yield s.open();if(200===o.statusCode)return yield this.privRequestSession.onConnectionEstablishCompleted(o.statusCode),Promise.resolve(s);1006===o.statusCode&&(e=!0),i=o.statusCode,n=o.reason,this.privRequestSession.onRetryConnection()}return yield this.privRequestSession.onConnectionEstablishCompleted(i,n),Promise.reject(`Unable to contact server. StatusCode: ${i}, ${this.privRecognizerConfig.parameters.getProperty(x.SpeechServiceConnection_Endpoint)} Reason: ${n}`)}))}delay(e){return new Promise((t=>this.privSetTimeout(t,e)))}writeBufferToConsole(e){let t="Buffer Size: ";if(null===e)t+="null";else{const i=new Uint8Array(e);t+=`${e.byteLength}\r\n`;for(let n=0;n<e.byteLength;n++)t+=i[n].toString(16).padStart(2,"0")+" ",(n+1)%16==0&&(console.info(t),t="")}console.info(t)}sendFinalAudio(){return Qi(this,void 0,void 0,(function*(){const e=yield this.fetchConnection();yield e.send(new Pt(Fe.Binary,"audio",this.privRequestSession.requestId,null,null))}))}configureConnection(){return Qi(this,void 0,void 0,(function*(){const e=yield this.connectImpl();return void 0!==this.configConnectionOverride?this.configConnectionOverride(e):(yield this.sendSpeechServiceConfig(e,this.privRequestSession,this.privRecognizerConfig.SpeechServiceConfig.serialize()),yield this.sendPrePayloadJSON(e,!1),e)}))}}Ji.telemetryDataEnabled=!0;class Zi{constructor(e){this.privSpeechHypothesis=JSON.parse(e)}static fromJSON(e){return new Zi(e)}get Text(){return this.privSpeechHypothesis.Text}get Offset(){return this.privSpeechHypothesis.Offset}get Duration(){return this.privSpeechHypothesis.Duration}get Language(){return void 0===this.privSpeechHypothesis.PrimaryLanguage?void 0:this.privSpeechHypothesis.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return void 0===this.privSpeechHypothesis.PrimaryLanguage?void 0:this.privSpeechHypothesis.PrimaryLanguage.Confidence}get SpeakerId(){return this.privSpeechHypothesis.SpeakerId}}!function(e){e[e.Success=0]="Success",e[e.SynthesisEnd=1]="SynthesisEnd",e[e.Error=2]="Error"}(Xi||(Xi={})),function(e){e[e.Success=0]="Success",e[e.NoMatch=1]="NoMatch",e[e.InitialSilenceTimeout=2]="InitialSilenceTimeout",e[e.BabbleTimeout=3]="BabbleTimeout",e[e.Error=4]="Error",e[e.EndOfDictation=5]="EndOfDictation",e[e.TooManyRequests=6]="TooManyRequests",e[e.BadRequest=7]="BadRequest",e[e.Forbidden=8]="Forbidden"}(Wi||(Wi={}));class Yi{constructor(e){this.privSimpleSpeechPhrase=JSON.parse(e),this.privSimpleSpeechPhrase.RecognitionStatus=Wi[this.privSimpleSpeechPhrase.RecognitionStatus]}static fromJSON(e){return new Yi(e)}get RecognitionStatus(){return this.privSimpleSpeechPhrase.RecognitionStatus}get DisplayText(){return this.privSimpleSpeechPhrase.DisplayText}get Offset(){return this.privSimpleSpeechPhrase.Offset}get Duration(){return this.privSimpleSpeechPhrase.Duration}get Language(){return void 0===this.privSimpleSpeechPhrase.PrimaryLanguage?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return void 0===this.privSimpleSpeechPhrase.PrimaryLanguage?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Confidence}get SpeakerId(){return this.privSimpleSpeechPhrase.SpeakerId}}class $i{static implTranslateRecognitionResult(e){let t=qe.Canceled;switch(e){case Wi.Success:t=qe.RecognizedSpeech;break;case Wi.NoMatch:case Wi.InitialSilenceTimeout:case Wi.BabbleTimeout:case Wi.EndOfDictation:t=qe.NoMatch;break;case Wi.Error:case Wi.BadRequest:case Wi.Forbidden:default:t=qe.Canceled}return t}static implTranslateCancelResult(e){let t=Ue.EndOfStream;switch(e){case Wi.Success:case Wi.EndOfDictation:case Wi.NoMatch:t=Ue.EndOfStream;break;case Wi.InitialSilenceTimeout:case Wi.BabbleTimeout:case Wi.Error:case Wi.BadRequest:case Wi.Forbidden:default:t=Ue.Error}return t}static implTranslateCancelErrorCode(e){let t=Ke.NoError;switch(e){case Wi.Error:t=Ke.ServiceError;break;case Wi.TooManyRequests:t=Ke.TooManyRequests;break;case Wi.BadRequest:t=Ke.BadRequestParameters;break;case Wi.Forbidden:t=Ke.Forbidden;break;default:t=Ke.NoError}return t}static implTranslateErrorDetails(e){let t="The speech service encountered an internal error and could not continue.";switch(e){case Ke.Forbidden:t="The recognizer is using a free subscription that ran out of quota.";break;case Ke.BadRequestParameters:t="Invalid parameter or unsupported audio format in the request.";break;case Ke.TooManyRequests:t="The number of parallel requests exceeded the number of allowed concurrent transcriptions."}return t}}class en{constructor(e){this.privDetailedSpeechPhrase=JSON.parse(e),this.privDetailedSpeechPhrase.RecognitionStatus=Wi[this.privDetailedSpeechPhrase.RecognitionStatus]}static fromJSON(e){return new en(e)}getJsonWithCorrectedOffsets(e){if(this.privDetailedSpeechPhrase.NBest){let t;for(const e of this.privDetailedSpeechPhrase.NBest)if(e.Words&&e.Words[0]){t=e.Words[0].Offset;break}if(t&&t<e){const i=e-t;for(const e of this.privDetailedSpeechPhrase.NBest){if(e.Words)for(const t of e.Words)t.Offset+=i;if(e.DisplayWords)for(const t of e.DisplayWords)t.Offset+=i}}}return JSON.stringify(this.privDetailedSpeechPhrase)}get RecognitionStatus(){return this.privDetailedSpeechPhrase.RecognitionStatus}get NBest(){return this.privDetailedSpeechPhrase.NBest}get Duration(){return this.privDetailedSpeechPhrase.Duration}get Offset(){return this.privDetailedSpeechPhrase.Offset}get Language(){return void 0===this.privDetailedSpeechPhrase.PrimaryLanguage?void 0:this.privDetailedSpeechPhrase.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return void 0===this.privDetailedSpeechPhrase.PrimaryLanguage?void 0:this.privDetailedSpeechPhrase.PrimaryLanguage.Confidence}get Text(){return this.privDetailedSpeechPhrase.NBest&&this.privDetailedSpeechPhrase.NBest[0]?this.privDetailedSpeechPhrase.NBest[0].Display||this.privDetailedSpeechPhrase.NBest[0].DisplayText:this.privDetailedSpeechPhrase.DisplayText}get SpeakerId(){return this.privDetailedSpeechPhrase.SpeakerId}}class tn extends Ji{constructor(e,t,i,n,r){super(e,t,i,n,r),this.privSpeechRecognizer=r;const s={};if(void 0!==n.autoDetectSourceLanguages){const e=n.autoDetectSourceLanguages.split(",");let t;t="Continuous"===n.languageIdMode?"DetectContinuous":"DetectAtAudioStart",this.privSpeechContext.setSection("languageId",{Priority:"PrioritizeLatency",languages:e,mode:t,onSuccess:{action:"Recognize"},onUnknown:{action:"None"}}),this.privSpeechContext.setSection("phraseOutput",{interimResults:{resultType:"Auto"},phraseResults:{resultType:"Always"}});const i=n.sourceLanguageModels;void 0!==i&&(s.customModels=i,s.onInterim={action:"None"},s.onSuccess={action:"None"})}(e=>{for(const t in e)return!1;return!0})(s)||this.privSpeechContext.setSection("phraseDetection",s)}setSpeechSegmentationTimeout(){const e=this.privRecognizerConfig.parameters.getProperty(x.Speech_SegmentationSilenceTimeoutMs,void 0);if(void 0!==e){const t=this.recognitionMode===G.Conversation?"CONVERSATION":this.recognitionMode===G.Dictation?"DICTATION":"INTERACTIVE",i=parseInt(e,10),n=this.privSpeechContext.getSection("phraseDetection");n.mode=t,n[t]={segmentation:{mode:"Custom",segmentationSilenceTimeoutMs:i}},this.privSpeechContext.setSection("phraseDetection",n)}}processTypeSpecificMessages(e){return t=this,i=void 0,r=function*(){let t;const i=new K;i.setProperty(x.SpeechServiceResponse_JsonResult,e.textBody);let n=!1;switch(e.path.toLowerCase()){case"speech.hypothesis":case"speech.fragment":const r=Zi.fromJSON(e.textBody),s=r.Offset+this.privRequestSession.currentTurnAudioOffset;t=new ki(this.privRequestSession.requestId,qe.RecognizingSpeech,r.Text,r.Duration,s,r.Language,r.LanguageDetectionConfidence,void 0,void 0,e.textBody,i),this.privRequestSession.onHypothesis(s);const o=new Ti(t,r.Duration,this.privRequestSession.sessionId);if(this.privSpeechRecognizer.recognizing)try{this.privSpeechRecognizer.recognizing(this.privSpeechRecognizer,o)}catch(e){}n=!0;break;case"speech.phrase":const a=Yi.fromJSON(e.textBody),c=$i.implTranslateRecognitionResult(a.RecognitionStatus);if(this.privRequestSession.onPhraseRecognized(this.privRequestSession.currentTurnAudioOffset+a.Offset+a.Duration),qe.Canceled===c){const e=$i.implTranslateCancelResult(a.RecognitionStatus),t=$i.implTranslateCancelErrorCode(a.RecognitionStatus);yield this.cancelRecognitionLocal(e,t,$i.implTranslateErrorDetails(t))}else{if(!this.privRequestSession.isSpeechEnded||c!==qe.NoMatch||a.RecognitionStatus===Wi.InitialSilenceTimeout){if(this.privRecognizerConfig.parameters.getProperty(T)===z[z.Simple])t=new ki(this.privRequestSession.requestId,c,a.DisplayText,a.Duration,a.Offset+this.privRequestSession.currentTurnAudioOffset,a.Language,a.LanguageDetectionConfidence,void 0,void 0,e.textBody,i);else{const n=en.fromJSON(e.textBody),r=n.Offset+this.privRequestSession.currentTurnAudioOffset,s=n.getJsonWithCorrectedOffsets(r);t=new ki(this.privRequestSession.requestId,c,n.RecognitionStatus===Wi.Success?n.NBest[0].Display:void 0,n.Duration,r,n.Language,n.LanguageDetectionConfidence,void 0,void 0,s,i)}const n=new Ti(t,t.offset,this.privRequestSession.sessionId);if(this.privSpeechRecognizer.recognized)try{this.privSpeechRecognizer.recognized(this.privSpeechRecognizer,n)}catch(e){}}if(this.privSuccessCallback){try{this.privSuccessCallback(t)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}n=!0}return n},new((n=void 0)||(n=Promise))((function(e,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}c((r=r.apply(t,i||[])).next())}));var t,i,n,r}cancelRecognition(e,t,i,n,r){const s=new K;if(s.setProperty(D,Ke[n]),this.privSpeechRecognizer.canceled){const t=new Mi(i,r,n,void 0,e);try{this.privSpeechRecognizer.canceled(this.privSpeechRecognizer,t)}catch(e){}}if(this.privSuccessCallback){const e=new ki(t,qe.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,r,void 0,s);try{this.privSuccessCallback(e),this.privSuccessCallback=void 0}catch(e){}}}}class nn{constructor(e,t){this.privHeaderName=e,this.privToken=t}get headerName(){return this.privHeaderName}get token(){return this.privToken}}class rn{constructor(e){if(!e)throw new oe("subscriptionKey");this.privAuthInfo=new nn(Et.AuthKey,e)}fetch(e){return Promise.resolve(this.privAuthInfo)}fetchOnExpiry(e){return Promise.resolve(this.privAuthInfo)}}class sn{constructor(e,t){if(!e)throw new oe("fetchCallback");if(!t)throw new oe("fetchOnExpiryCallback");this.privFetchCallback=e,this.privFetchOnExpiryCallback=t}fetch(e){return this.privFetchCallback(e).then((e=>new nn(Et.Authorization,void 0===e?void 0:sn.privTokenPrefix+e)))}fetchOnExpiry(e){return this.privFetchOnExpiryCallback(e).then((e=>new nn(Et.Authorization,void 0===e?void 0:sn.privTokenPrefix+e)))}}sn.privTokenPrefix="bearer ";var on=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class an{constructor(e,t,i){this.audioConfig=void 0!==e?e:Nt.fromDefaultMicrophoneInput(),this.privDisposed=!1,this.privProperties=t.clone(),this.privConnectionFactory=i,this.implCommonRecognizerSetup()}close(e,t){L.throwIfDisposed(this.privDisposed),ve(this.dispose(!0),e,t)}get internalData(){return this.privReco}dispose(e){return on(this,void 0,void 0,(function*(){this.privDisposed||(this.privDisposed=!0,e&&this.privReco&&(yield this.privReco.audioSource.turnOff(),yield this.privReco.dispose()))}))}static get telemetryEnabled(){return Ji.telemetryDataEnabled}static enableTelemetry(e){Ji.telemetryDataEnabled=e}implCommonRecognizerSetup(){let e="undefined"!=typeof window?"Browser":"Node",t="unknown",i="unknown";"undefined"!=typeof navigator&&(e=e+"/"+navigator.platform,t=navigator.userAgent,i=navigator.appVersion);const n=this.createRecognizerConfig(new Q(new J(new Y(e,t,i))));this.privReco=this.createServiceRecognizer(an.getAuthFromProperties(this.privProperties),this.privConnectionFactory,this.audioConfig,n)}recognizeOnceAsyncImpl(e){return on(this,void 0,void 0,(function*(){L.throwIfDisposed(this.privDisposed);const t=new le;yield this.implRecognizerStop(),yield this.privReco.recognize(e,t.resolve,t.reject);const i=yield t.promise;return yield this.implRecognizerStop(),i}))}startContinuousRecognitionAsyncImpl(e){return on(this,void 0,void 0,(function*(){L.throwIfDisposed(this.privDisposed),yield this.implRecognizerStop(),yield this.privReco.recognize(e,void 0,void 0)}))}stopContinuousRecognitionAsyncImpl(){return on(this,void 0,void 0,(function*(){L.throwIfDisposed(this.privDisposed),yield this.implRecognizerStop()}))}implRecognizerStop(){return on(this,void 0,void 0,(function*(){this.privReco&&(yield this.privReco.stopRecognizing())}))}static getAuthFromProperties(e){const t=e.getProperty(x.SpeechServiceConnection_Key,void 0);return t&&""!==t?new rn(t):new sn((()=>{const t=e.getProperty(x.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(t)}),(()=>{const t=e.getProperty(x.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(t)}))}}class cn extends an{constructor(e,t){const i=e;L.throwIfNull(i,"speechConfig"),L.throwIfNullOrWhitespace(i.properties.getProperty(x.SpeechServiceConnection_RecoLanguage),x[x.SpeechServiceConnection_RecoLanguage]),super(t,i.properties,new Ri),this.privDisposedRecognizer=!1}static FromConfig(e,t,i){const n=e;return t.properties.mergeTo(n.properties),new cn(e,i)}get endpointId(){return L.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(x.SpeechServiceConnection_EndpointId,"00000000-0000-0000-0000-000000000000")}get authorizationToken(){return this.properties.getProperty(x.SpeechServiceAuthorization_Token)}set authorizationToken(e){L.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(x.SpeechServiceAuthorization_Token,e)}get speechRecognitionLanguage(){return L.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(x.SpeechServiceConnection_RecoLanguage)}get outputFormat(){return L.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(T,z[z.Simple])===z[z.Simple]?z.Simple:z.Detailed}get properties(){return this.privProperties}recognizeOnceAsync(e,t){ve(this.recognizeOnceAsyncImpl(G.Interactive),e,t)}startContinuousRecognitionAsync(e,t){ve(this.startContinuousRecognitionAsyncImpl(G.Conversation),e,t)}stopContinuousRecognitionAsync(e,t){ve(this.stopContinuousRecognitionAsyncImpl(),e,t)}startKeywordRecognitionAsync(e,t,i){L.throwIfNull(e,"model"),i&&i("Not yet implemented.")}stopKeywordRecognitionAsync(e){e&&e()}close(e,t){L.throwIfDisposed(this.privDisposedRecognizer),ve(this.dispose(!0),e,t)}dispose(e){const t=Object.create(null,{dispose:{get:()=>super.dispose}});return i=this,n=void 0,s=function*(){this.privDisposedRecognizer||(e&&(this.privDisposedRecognizer=!0,yield this.implRecognizerStop()),yield t.dispose.call(this,e))},new((r=void 0)||(r=Promise))((function(e,t){function o(e){try{c(s.next(e))}catch(e){t(e)}}function a(e){try{c(s.throw(e))}catch(e){t(e)}}function c(t){var i;t.done?e(t.value):(i=t.value,i instanceof r?i:new r((function(e){e(i)}))).then(o,a)}c((s=s.apply(i,n||[])).next())}));var i,n,r,s}createRecognizerConfig(e){return new W(e,this.privProperties)}createServiceRecognizer(e,t,i,n){return new tn(e,t,i,n,this)}}var pn,un=function(){function e(t,i,n){this.isRunning=!1,this.baseSudASR=new P(n,this),p.d(e._TAG,"speechRegion:",i),this.speechConfig=q.fromSubscription(t,i)}return e.prototype.startASR=function(t){var i=this;if(p.d(e._TAG,"startASR language: "+t+" isRunning: "+this.isRunning),!this.isRunning){this.isRunning=!0;var n=Nt.fromStreamInput(this.createMicrophoneStream());this.speechConfig.speechRecognitionLanguage=t,this.reco=new cn(this.speechConfig,n),this.reco.recognized=function(t,n){if(p.d(e._TAG,"onRecognizedResult",n.result),n.result.reason===qe.RecognizedSpeech){var r=n.result.text;i.baseSudASR.onRecognizedResult(r)}},this.reco.startContinuousRecognitionAsync()}},e.prototype.stopASR=function(){p.d(e._TAG,"stopASR:",this.isRunning),this.isRunning&&(this.isRunning=!1,this.reco&&(this.releaseMicrophoneStream(),this.reco.stopContinuousRecognitionAsync()))},e.prototype.pushAudio=function(e,t){this.microphoneStream&&e&&t>0&&this.microphoneStream.write(e.slice())},e.prototype.handleGameASR=function(e){this.baseSudASR.handleGameASR(e)},e.prototype.createMicrophoneStream=function(){return this.releaseMicrophoneStream(),this.microphoneStream=Ve.createPushStream(),this.microphoneStream},e.prototype.releaseMicrophoneStream=function(){this.microphoneStream&&(this.microphoneStream.close(),this.microphoneStream=null)},e._TAG="AzureRealSudASRImpl",e}();!function(e){e[e.UNDEFINED=-1]="UNDEFINED",e[e.AZURE=1]="AZURE",e[e.SHU_MEI=2]="SHU_MEI"}(pn||(pn={}));var hn,dn=function(){function e(e){this._iSudASR=this.createASRImpl(e)}return e.prototype.createASRImpl=function(t){t.supportNumberLanguageList=e.getASRTextLanguageList(),t.supportTextLanguageList=e.getASRNumberLanguageList();var i=e.getUseASRType();if(p.d(e._TAG,"asrType:"+i),p.d(e._TAG,"asrLoadList:"+R.getAsrLoadList()),i===pn.AZURE){var n=R.getSdkRtssCfg();if(null!=n&&null!=n.microsoft_rtss_cfg){var r=n.microsoft_rtss_cfg;return new un(r.speech_subscription_key,r.speech_region,t)}return null}return null},e.prototype.startASR=function(e){null!=this._iSudASR&&this._iSudASR.startASR(e)},e.prototype.stopASR=function(){null!=this._iSudASR&&this._iSudASR.stopASR()},e.prototype.handleGameASR=function(e){null!=this._iSudASR&&this._iSudASR.handleGameASR(e)},e.prototype.pushAudio=function(e,t){null!=this._iSudASR&&this._iSudASR.pushAudio(e,t)},e.getASRTextLanguageList=function(){switch(this.getUseASRType()){case pn.AZURE:return R.getAzureASRTextLanguageList();case pn.SHU_MEI:default:return[]}},e.getASRNumberLanguageList=function(){switch(this.getUseASRType()){case pn.AZURE:return R.getAzureASRNumberLanguageList();case pn.SHU_MEI:default:return[]}},e.getUseASRType=function(){var e=R.getAsrLoadList();if(!e.length)return pn.UNDEFINED;for(var t=0;t<e.length;t++){var i=e[t];if(i===pn.AZURE)return i;if(i===pn.SHU_MEI)return i}return pn.UNDEFINED},e._TAG="ProxyASRImpl",e}(),ln=function(){function e(e,t,i,n,r){this.kTag="SudFSMMGStateHandlerImpl",this._fsmMG=e,this._userId=t,this._roomId=i,this._code=n,this._mgId=r,this._dynamicConfig="",this._GameCustomStateListener={onGameLoadStarted:function(){},onGameLoadCompleted:function(){},onGameStarted:function(){},onGameASR:function(){},onGameLoadPercent:function(e){}},this._gameStateMap=new Map,this._playerStateMap=new Map,this._appStateMap=new Map}return e.prototype.getGameState=function(e){return""},e.prototype.getPlayerState=function(e,t){return""},e.prototype.setCode=function(e){},e.prototype.setGameCustomStateListener=function(e){this._GameCustomStateListener=e},e.prototype.setDynamicConfig=function(e){this._dynamicConfig=e},e.prototype.handleCmd=function(e,t,i,n,r){null!=e?null!=t?"game"===e?"m2as-set-debug"===i?this.handleSetDebug(r,i,n):"m2as-mg-log"===i?this.handleMgLog(r,i,n):"m2as-get-net-status"===i?this.handleGetNetStatus(r,i,n):"m2as-get-game-view-info"===i?this.handleGetGameViewInfo(r,i,n):"m2as-get-game-cfg"===i?this.handleGetGameCfg(r,i,n):"m2as-vibrate"===i?this.handleVibrate(r,i,n):"m2as-get-sdk-info"===i?this.handleGetSDKInfo(r,i,n):"m2as-get-state"===i?this.handleGetState(r,i,n):"m2as-notify-game-load-started"===i?this.handleNotifyGameLoadStarted(r,i,n):"m2as-notify-game-load-completed"===i?this.handleNotifyGameLoadCompleted(r,i,n):"m2as-notify-game-started"===i?this.handleNotifyGameStarted(r,i,n):"mg_common_game_load_percent"===i?this.handleNotifyGameLoadPercent(r,i,n):"m2as-expire-code"===i?this.handleExpireCode(r,i,n):"mg_common_game_asr"===i?this.handleGameASR(r,i,n):"m2as-login"===i?this.handleLogin(r,i,n):this.handleGameNotifyStateChange(r,i,n):"player"===e?this.handlePlayerNotifyStateChange(r,t,i,n):r.fail(w.toJson(w.kFail,"param invalid cmd is not game or player")):r.fail(w.toJson(w.kFail,"param invalid param is null")):r.fail(w.toJson(w.kFail,"param invalid cmd is null"))},e.prototype.handleSetDebug=function(e,t,i){p.d(this.kTag,"handleSetDebug {0} = {1}",t,i),e.success(w.kSuccessJson)},e.prototype.handleMgLog=function(e,t,i){var n;null===(n=this._fsmMG)||void 0===n||n.onGameLog(i),e.success(w.kSuccessJson)},e.prototype.handleGetNetStatus=function(e,t,i){p.d(this.kTag,"handleGetNetStatus {0} = {1}",t,i),e.success('{"retCode":0, "retMsg":"success", "net_type":1}')},e.prototype.handleGetGameViewInfo=function(e,t,i){var n;null===(n=this._fsmMG)||void 0===n||n.onGetGameViewInfo(e,i)},e.prototype.handleGetGameCfg=function(e,t,i){var n;null===(n=this._fsmMG)||void 0===n||n.onGetGameCfg(e,i)},e.prototype.handleNotifyGameLoadPercent=function(e,t,i){p.d(this.kTag,"handleNotifyGameLoadPercent {0} = {1}",t,i),null!=this._GameCustomStateListener&&this._GameCustomStateListener.onGameLoadPercent(i),e.success(w.kSuccessJson)},e.prototype.handleVibrate=function(e,t,i){p.d(this.kTag,"handleGetNetStatus {0} = {1}",t,i),e.success(w.kSuccessJson)},e.prototype.handleGetSDKInfo=function(e,t,i){var n={ret_code:w.kSuccess,ret_msg:"success",env_type:R.getEnvType(),language:R.getLanguage(),wordLanguage:R.getLanguage(),asr_text_language_list:dn.getASRTextLanguageList(),asr_number_language_list:dn.getASRNumberLanguageList(),sdk_version:A.kVersion,app_id:R.getAppId(),platform:R.getPlatform(),bundle_id:R.getBundleID(),sud_sdk_trace_id:R.genTraceId(),mg_id:Number(this._mgId),mg_id_str:this._mgId,mg_api_cfg:R.getMgApiCfgJson(),app_server_info_url:"",game_login_url:"",dynamic_config:this._dynamicConfig};null==R.getSdkRtssCfg()||null==R.getSdkRtssCfg().sm_game_word_language||R.getSdkRtssCfg().sm_game_word_language||(n.wordLanguage=R.getSdkRtssCfg().sm_game_word_language);var r=R.getMgApiCfg();n.app_server_info_url=r.app_server_info_url,n.game_login_url=r.game_login_url,p.d(this.kTag,"getSDKInfo",n),e.success(JSON.stringify(n))},e.prototype.handleGetState=function(e,t,i){p.d(this.kTag,"handleGetState {0} = {1}",t,i),e.success("{}")},e.prototype.handleNotifyGameLoadStarted=function(e,t,i){var n;p.d(this.kTag,"onGameLoadStarted {0} = {1}",t,i),this._GameCustomStateListener.onGameLoadStarted(),null===(n=this._fsmMG)||void 0===n||n.onGameLoadingProgress(2,w.kSuccess,99),e.success(w.kSuccessJson)},e.prototype.handleNotifyGameLoadCompleted=function(e,t,i){p.d(this.kTag,"onGameLoadCompleted {0} = {1}",t,i),this._GameCustomStateListener.onGameLoadCompleted(),e.success(w.kSuccessJson)},e.prototype.handleNotifyGameStarted=function(e,t,i){var n,r;p.d(this.kTag,"onGameStarted {0} = {1}",t,i),this._GameCustomStateListener.onGameStarted(),(null===(n=this._fsmMG)||void 0===n?void 0:n.onGameStarted)&&(null===(r=this._fsmMG)||void 0===r||r.onGameStarted()),e.success(w.kSuccessJson)},e.prototype.handleLogin=function(e,t,i){p.d(this.kTag,"handleLogin {0} = {1}",t,i);var n={ret_code:w.kSuccess,ret_msg:"success",user_id:this._userId,room_id:this._roomId,mg_id:Number(this._mgId),mg_id_str:this._mgId,code:this._code,app_id:R.getAppId(),platform:R.getPlatform(),bundle_id:R.getBundleID(),sud_sdk_trace_id:R.genTraceId()};e.success(JSON.stringify(n))},e.prototype.handleExpireCode=function(e,t,i){var n,r;(null===(n=this._fsmMG)||void 0===n?void 0:n.onExpireCode)&&(null===(r=this._fsmMG)||void 0===r||r.onExpireCode(e,i))},e.prototype.handleGameASR=function(e,t,i){var n,r;p.d(this.kTag,"onGameASR {0} = {1}",t,i),this._GameCustomStateListener.onGameASR(i),(null===(n=this._fsmMG)||void 0===n?void 0:n.onGameStateChange)&&(null===(r=this._fsmMG)||void 0===r||r.onGameStateChange(e,t,i))},e.prototype.handleGameNotifyStateChange=function(e,t,i){var n,r;(null===(n=this._fsmMG)||void 0===n?void 0:n.onGameStateChange)&&(null===(r=this._fsmMG)||void 0===r||r.onGameStateChange(e,t,i))},e.prototype.handlePlayerNotifyStateChange=function(e,t,i,n){var r,s;(null===(r=this._fsmMG)||void 0===r?void 0:r.onPlayerStateChange)&&(null===(s=this._fsmMG)||void 0===s||s.onPlayerStateChange(e,t,i,n))},e}();!function(e){e[e.START=1]="START",e[e.LOADING=2]="LOADING",e[e.END=3]="END"}(hn||(hn={}));var vn="SudMGP",gn=function(){function e(){}return e.sendAppCustomCommandEvent=function(e,t,i,n){e.contentWindow&&e.contentWindow.postMessage({msgTag:vn,msgType:11,ctxId:t,state:i,dataJson:n},"*")},e.sendGameCustomCommandCallback=function(e,t,i,n,r){e.contentWindow&&e.contentWindow.postMessage({msgTag:vn,msgType:12,ctxId:t,isSuccess:i,state:n,dataJson:r},"*")},e}(),fn=function(){function e(e,t,i){this._isCalled=!1,this._window=e,this._ctxId=t,this._state=i}return e.prototype.success=function(e){this._isCalled||(gn.sendGameCustomCommandCallback(this._window,this._ctxId,!0,this._state,e),this._isCalled=!0)},e.prototype.fail=function(e){this._isCalled||(gn.sendGameCustomCommandCallback(this._window,this._ctxId,!1,this._state,e),this._isCalled=!0)},e}(),mn=function(){function e(){}return e.create=function(e,t){var i={iSudFSTAPP:t,language:e.language,supportTextLanguageList:[],supportNumberLanguageList:[]};return new dn(i)},e}(),_n=function(){function e(e,t){this._kTag="H5SudFSTAPPImpl";var i=e.parentElm,n=e.fstAppCtxId,r=e.userId,o=e.roomId,a=e.code,c=e.mgId,p=e.language;this._fstAppCtxId=n,this._userId=r,this._roomId=o,this._code=a,this._mgId=c,this._fsmMg=t,this._loadingFailed=!1,this._isCalledDestroyMG=!1,this._gameLayerView={},this._window=null,this._iframeUrl="",this._rootElm=i,this._gameCompeleted=!1,this._bigLoadingPicUrl="",this.revceiveGameLoading=!1,this._ctxIdListenerNotifyStateChangeMap=new Map,this._idIDGenerator=new s,this._sudFSMMGStateHandler=function(e,t,i,n,r){return new ln(e,t,i,n,r)}(t,r,o,a,c),this._sudASR=mn.create({language:p},this),this.initGameCustomStateListener(),this.loadGame(i)}return e.prototype.initGameCustomStateListener=function(){var e=this;this._sudFSMMGStateHandler.setGameCustomStateListener({onGameLoadStarted:function(){},onGameLoadCompleted:function(){e._gameCompeleted=!0,e._loading(e._rootElm,hn.END,w.kSuccess,100),R.getEnvType()===R.kEnvTypeSim&&e._createSimInfo(e._rootElm)},onGameStarted:function(){e._loadingFailed=!1},onGameLoadPercent:function(t){e.revceiveGameLoading=!0;try{var i=JSON.parse(t).percent,n=85+Math.floor(15*i/100);e._loading(e._rootElm,hn.LOADING,w.kSuccess,n)}catch(t){p.w(e._kTag,"onGameLoadPercent json parse error",t)}},onGameASR:function(t){e._sudASR.handleGameASR(t)}})},e.prototype._createSimInfo=function(e){var t=document.createDocumentFragment(),i=document.createElement("div"),n=document.createElement("span"),r=document.createElement("img");r.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAL4AAAA9CAYAAAATUNPrAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAvqADAAQAAAABAAAAPQAAAADYD5vDAAAqeElEQVR4Ae2dCbhUxbWo+wzM86AiqBzFEUXBIaKggonRaBxv1OdAnJOY3KjJzVOTlyh6kxhjBqPXJE7EecBoMBpfPo3oNYIi4IA4IKiIgiLIPHOG+/9FV7tP031Od58+iO+lvq96T1Wr1lSrVq2qvbsiVcb0pz/9qX1tbW235cuX9+7atevAbt267dSuXbt+nTt37rHlllt27NGjR6p79+51HTp0qK+oqKim6cqGhoba9evX169Zs6YduW41iXvz161b90FdXd0bq1atmsFxSVVV1bJ99913fRnR/Reo/485UFEI7Xfcccd2KOouKPGzKOQe1NmG63pSg/Wrq6tTKPzWXA/r2LHjUJR+p169eqVQ9lTPnj1TnTp1KqSZTJm1a9emzLSVQvFX0yFeozNMoc3nOb5GR5i2++67r8tU+NdJURy48cYbu2GM9oOX7ZXjVlttVYlRad+2bdsAB/6qF5XFAMUwBV1IHz2vB04DelGHYVtHXo8s1y1ZsmQ195fT9tKFCxcuPvLII9cW0065ymp1m00o/DAI+AGKeCyM+ib5OCp1hlHtICDU15r3798/1bdv31SXLl1Sbdq0aRZuvgK0lzKb6EwdYNS+tL3v0qVLv8Vo8kllZeX0N95441HwuGfXXXedlw9Ovvt33313D/BrB00B+SFDhnQDZhA09zztEK+TMBBqPXSupm699+mcDQsWLFjWvn17R7AKcKx95ZVXFp900kl1yXpNnT/11FPV7777bg+qV0FzA7RWfuELX+g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HmNbU9g+WHV4+joXVzPMMYv3Zui46sEri2YpRvL/CEd+loU4naOvsyfSdJM5/QNqw37CDJP8p+wkvsscIYlLb4rrZ9FQmHt3A3IdgV65kslE+HxWGh9gQXOBXT6nHQl6UYX1IFq/l3dP5pucrKbUZZCiEUR+sGo4yn7ZY7+k0mNltBlfldfC13uLqQtyzjcKXyF7mQOBXDH4asI90GiTvcWuPW30ObyliPqdQhCOAPGHogB2MUtBi7H2xHc7lDORBuBZq2dVg9/XtftZdp4gjyGies75WoPxX8Ouoaq+EbyMBTxK8PlaqIRnLQ862lvHXJdhYKvgM6lKPVCrudB+3RkOwmap+b7+6BGAFtwUZTiJ9uhE+wMortCzJ4wbSj7XAahBNu59dSlePf3lNIR7PkquoKHIas5OqRPpq1JtPUyc43pSTw25TkdYDsUfwiC249294fmIdDaS3rt/NJcyhxIxZNeXRppJ89BKSarBLQzhTanEr3YELQvI8H333//MBSuN3xtcBsFb3+1hY5K8UknP81RsI6AZyYEmDhX0Q2210FjLXSto0P7N0UruV5B20uYQ/l/ADktekSk3MeCiWqqYd6n7UyoqQvDTncUfyDHAbhAfVH83ljFTihIJXk919UwRNcIPQ7//uG/dujHVcCI1VoAGDQfZryH0s/gfDZwlhNZWdZSt6Up/Et55h84MDR3pW5faNyVEW97lL4Pk6tu8KATnaAKQ1ABL/xMnh9zkmYVScWqt4OT16LsK6Hbf0WZB70zuTeD60/Y1LaUvNHW6lJw/VedjTnwPylTiR6yTo9wAAAAAElFTkSuQmCC",r.setAttribute("style","width: 40px;height: 12.842px"),n.innerHTML=R.getOnlyTestText(),n.setAttribute("style","font-size: 12px;color: #fff;margin-left: 4px;"),i.append(r),i.append(n),i.setAttribute("style","position: absolute;bottom: 0;right: 0"),t.append(i),e.append(t)},e.prototype.loadGame=function(e){e.style.setProperty("position","relative"),e.innerHTML="",this._loading(e,hn.START,w.kSuccess,10);var t=this;R.getMGInfo(this._mgId,{onSuccess:function(i){if(t._loading(e,hn.START,w.kSuccess,20),1===i.h5engine){if(!i.h5url)return p.w(t._kTag,"gameInfo no h5url",""),void t._loading(e,hn.LOADING,w.kFail,20);t._iframeUrl="".concat(i.h5url,"?fstAppCtxId=").concat(t._fstAppCtxId),t._bigLoadingPicUrl=i.bigLoadingPic,t._initIframe(e),t._sudFSMMGStateHandler.setDynamicConfig(JSON.stringify(i.dynamic_config))}else t._loading(e,hn.START,w.kFail,20,(function(e){var t=document.createElement("div");t.setAttribute("style","\n position: absolute;\n top: 42%;\n left: 50%;\n color: #000;\n width: 200px;\n height: 30px;\n line-height: 30px;\n text-align: center;\n transform: translateX(-50%);\n background-color: #fff;\n border-radius: 4px;\n "),t.innerHTML="Please upgrade",e.append(t)}))},onFailure:function(i,n){t._loading(e,hn.LOADING,w.kFail,20)}})},e.prototype._loading=function(e,t,i,n,s){this._loadingFailed=i===w.kFail,r.getCfg().getShowCustomLoading()?this.fsmMgOnGameLoadingProgress(t,i,n):this._createDefaultLoading(e,i,n,s)},e.prototype.fsmMgOnGameLoadingProgress=function(e,t,i){this._fsmMg.onGameLoadingProgress&&this._fsmMg.onGameLoadingProgress(e,t,i)},e.prototype._createDefaultLoading=function(e,t,i,n){var s,o="".concat(this._kTag,"_wrap_parent_loading"),a="".concat(this._kTag,"_wrap_loading"),c="".concat(this._kTag,"_loading"),p="".concat(this._kTag,"_loading_text"),u="".concat(this._kTag,"_bgloading"),h=R.getLocalizationData(R.getSdkLocalizationCfg().load_tip_loading,R.getLanguage()),d=document.getElementById(o);if(d){var l=document.getElementById(c),v=document.getElementById(p),g=document.getElementById(a);if(n&&n(d),t===w.kFail){if(v){var f=R.getLocalizationData(R.getSdkLocalizationCfg().load_tip_fail,R.getLanguage());v.style.color="#ff1a1a",v&&(v.innerHTML="".concat(f," (").concat(i,"%)").concat(w.kFail))}return void(g&&this._createReloadButton(g))}if(this._gameCompeleted)return void(null===(s=d.parentNode)||void 0===s||s.removeChild(d));if(r.getCfg().getShowLoadingGameBg()&&this._bigLoadingPicUrl&&!document.getElementById(u)){var m=document.createElement("img");m.id=u,m.src=this._bigLoadingPicUrl,m.setAttribute("style","\n width: 100%;\n height: 100%;\n object-fit: cover;\n z-index: 1;\n "),d.append(m)}l&&(l.style.left=-(100-i)+"%"),v&&(v.innerHTML="".concat(h,"(").concat(i,"%)"))}else{if(100===i)return;var _=document.createDocumentFragment();d=document.createElement("div");var S=document.createElement("div"),y=document.createElement("img"),A=document.createElement("img"),C=(v=document.createElement("div"),document.createElement("div"));S.id=a,y.id=c,d.id=o,d.setAttribute("style","\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n -webkit-transform:translateZ(1px);\n -moz-transform:translateZ(1px);\n -o-transform:translateZ(1px);\n transform:translateZ(1px);\n "),S.setAttribute("style","\n z-index: 100000;\n position: absolute;\n top: 50%; \n left: 50%;\n transform: translate(-50%, -50%);\n width: 270px;\n height: 56px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n "),C.setAttribute("style","\n z-index: 100001;\n position: absolute;\n height: 22px;\n top: 50%; \n transform: translateY(-50%);\n left: 17px;\n right: 17px;\n border-radius: 26px;\n overflow: hidden;\n "),C.append(y),A.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAwwAAAC0CAMAAAAO0FvMAAAC/VBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzMzOjn34AAAAAAAAAAABLSELTzIeemna1spoAAADKw4Li26+bl3EAAADWzYjg15WcmXTZ0YlhX0hiX0kbGhkAAAABAQDWz4jYz4mdmXMZGRfg2ZYaGhkAAADa0YsAAAAAAADi3K3KwYIAAACblXGdl3MAAADe15UAAAAaGRgZGRjb04yhnXcDAwLCu4YxMTHSyovGv4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AXeDpPD/ehZorOschLodcB3oIEEmCKrKjc090zpZLJyxCSuDZ/IsCz4WSe0Ea7twN8YlV4wAOOQ+IE9FaTotzdZ0CgRxQwi0FWljN+UYagkEcNA78rJQesA+XgSAKsnCusrdsjQiBEkhBLySdC52FUg1cB3LAOtBDgggRaYIunKtpzYggHBCCJIBCWEgKsiAKhRj0t72rhuTAfYgXUxOh1s5VRAJkgPBDSwlJgbOgc0EUyjAoaUgOXIfmgSBIIlmEDOdq+ohIgAwIAe1yFXQsdBaIoXwbxCHnQR4IIkw4N6gXOiAEbEKTkMeCLFQOgzj0HqAhIgd6AAiICBJEES6cK+8dbckA4XGUEtDUIoVeQjmG1JAc5OEiYkcR6t25gra3BYPDFQJqq5ASxsyCNPQcUHKI0kN0aO2cK+/Q2kerCA6ijSj0EmhhMAftw4Yg0ErtnStulUGBHOSl0FkQhWIMqtNADgkCIpwb2Gtr1iZEPQVhqK3nIBASgWb16lxxswIDOZAEUegsDNcgDgKBZudGtWGTJNDCeAzS0HsQCDbJRJ+duH+3edTE/nQgCGM1yINAqMm5McmAJIy30Hcfg0CYhBvZXQakUIChaB1kwv20TwcnAINAAAQV0n/NgTyUIII+Yg6dqWGXL12tvPaE+kPrgjXCjFBucAQR5IcZ4P8ZXj84g6XqABFGKDJEk8aYgf2lCY5gVymKDKP23cAOzNj/BGfQd17/ZqDj8BkAAAAAAAAAAIDD3bPYHKSsGOBgAAAAAElFTkSuQmCC",A.setAttribute("style","z-index: 1;width: 100%; height: 56px; position: absolute;top: 0;left: 0;bottom: 0;right: 0"),v.setAttribute("style","z-index: 100002;font-family: PingFangSC-Medium, PingFang SC;\n width: 100%; font-size: 14px; height: 34px;line-height: 34px; position: absolute;top: 50%; left: 50%; transform: translate(-50%, -50%);text-align: center;color: #fff;"),v.innerHTML="".concat(h,"(").concat(i,"%)"),v.id=p,y.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqMAAABACAMAAAAZDo5fAAAB2lBMVEX0nTb/zSbxm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11v3PNt/9cbbcRwgWLMgAAAABJRU5ErkJggg==",y.setAttribute("style","position: absolute;top: 50%; transform: translateY(-50%); left: -".concat(100-i,"%;border-radius: 26px;")),y.style.width="100%",_.append(v),_.append(A),_.append(C),S.append(_),d.append(S),e.append(d)}},e.prototype._createReloadButton=function(e){var t=this,i=document.createElement("button");i.setAttribute("style","\n cursor: pointer;\n border: 2px solid #000;\n font-family: PingFangSC-Medium, PingFang SC;\n background-color: #fff;\n border-radius: 36px;\n z-index: 100002;\n width: 104px;\n height: 36px;\n color: #1A1A1A;\n position: absolute;\n bottom: -60px;\n left: 50%;\n transform: translateX(-50%);\n touch-action: manipulation;\n outline: none;\n -webkit-tap-highlight-color:rgba(0,0,0,0);\n ");var n=R.getLocalizationData(R.getSdkLocalizationCfg().load_reload,R.getLanguage());i.onclick=function(){t.loadGame(t._rootElm)},i.innerHTML=n,e.append(i)},e.prototype._initIframe=function(e){if(this._loading(e,1,w.kSuccess,20),e&&e instanceof HTMLElement){var t=document.createElement("iframe");t.src=this._iframeUrl,t.width="100%",t.height="100%",t.setAttribute("referrerpolicy","origin-when-cross-origin"),t.onerror=function(){n._loading(e,hn.LOADING,w.kFail,85)};var i=20,n=this;e.appendChild(t),this._window=t;var r=setInterval((function(){if(n.revceiveGameLoading)clearTimeout(r);else{var t=Math.floor(5*(Math.random()+1));(i+=t)>=85&&(i=85,clearTimeout(r)),n._loading(e,hn.LOADING,w.kSuccess,i)}}),100)}else p.w(this._kTag,"不存在挂载元素,请传入挂载元素","")},e.prototype._getFstAppCtxId=function(){return this._fstAppCtxId},e.prototype._onGameCustomCommand=function(e,t,i,n,r){if(this._window){var s=new fn(this._window,e,n);this._sudFSMMGStateHandler.handleCmd(t,i,n,r,s)}else p.w(this._kTag,"H5SudFSTAPPImpl游戏iframe对象不存在","")},e.prototype._onAppCustomCommandEventCallback=function(e,t,i){var n=this._ctxIdListenerNotifyStateChangeMap.get(e);null!=n&&(n.onSuccess(i),this._ctxIdListenerNotifyStateChangeMap.delete(e))},e.prototype.getGameView=function(){return this._gameLayerView},e.prototype.destroyMG=function(){return this._sudASR.stopASR(),this.notifyStateChange("a2ms-notify-destroy-game","{}",{onSuccess:function(e){},onFailure:function(e,t){}}),!0},e.prototype.updateCode=function(e,t){this.notifyStateChange("a2ms-update-code",JSON.stringify({code:e}),{onSuccess:function(e){},onFailure:function(e,t){}})},e.prototype.pushAudio=function(e,t){this._window&&null!=e&&t>0&&this._sudASR.pushAudio(e,t)},e.prototype.notifyStateChange=function(e,t,i){var n=this._idIDGenerator.genId();this._ctxIdListenerNotifyStateChangeMap.set(n,i),this._window&&gn.sendAppCustomCommandEvent(this._window,n,e,t)},e.prototype.reloadMG=function(){r.getCfg().getShowCustomLoading()&&!0===this._loadingFailed&&this.loadGame(this._rootElm)},e}(),Sn=function(){function e(){}return e.create=function(e,t){return function(e,t){return new _n(e,t)}(e,t)},e}(),yn=function(){function e(){}return e.handleMessageEvent=function(t){if(null!=t&&null!=t.data){var i=t.data;e.broadcastWindowOnMessage(i)}else e.appSelfOnMeessage&&e.appSelfOnMeessage.length&&e.appSelfOnMeessage.map((function(e){return e(t)}))},e._registerCustomCommandEvent=function(){e.isRegisterEvent=!0,p.d(this.kTag,"_registerCustomCommandEvent",e.isRegisterEvent),window.onmessage&&e.appSelfOnMeessage.push(window.onmessage),window.addEventListener("message",e.handleMessageEvent)},e._destoryCommandEvent=function(){window.removeEventListener("message",e.handleMessageEvent),e.isRegisterEvent=!1,p.d(this.kTag,"destoryCommandEvent",e.isRegisterEvent),e.appSelfOnMeessage&&e.appSelfOnMeessage.length&&window.addEventListener("message",(function(t){e.appSelfOnMeessage.map((function(e){return e(t)}))}))},e.getVersion=function(){return A.kVersion},e.getVersionAlias=function(){return A.kVersionAlias},e.getSudCfg=function(){return r.getCfg()},e.initSDK=function(e,t,i,n,r){R.initSDK(e,t,i,n,r)},e.uninitSDK=function(e){R.uninitSDK(e)},e.getMGList=function(e){R.getMGList(e)},e.loadMG=function(e,t,i,n,r,s,o){if(null==e||null==t||null==i||null==n||null==s)return p.w(this.kTag,"Parameters cannot be null"),null;if(""===e||""===t||""===i||""===n)return p.w(this.kTag,"Parameters cannot be empty string","userId: ".concat(e),"roomId: ".concat(t),"code: ".concat(i),"mgId: ".concat(n)),null;C.setUserId(e),R.setLanguage(r);var a=this._idIDGenerator.genId().toString(),c=Sn.create({parentElm:o,fstAppCtxId:a,userId:e,roomId:t,code:i,mgId:n,language:r},s);return this._ctxIdFSTAPPMap.set(a,c),this.isRegisterEvent||this._registerCustomCommandEvent(),c},e.destroyMG=function(t){if(null==t)return p.w(this.kTag,"destroyMG fstApp is invalid"),!1;var i=t._getFstAppCtxId();return e._ctxIdFSTAPPMap.delete(i),t.destroyMG(),e._destoryCommandEvent(),!0},e.prototype.setUserId=function(e){C.setUserId(e)},e.setLogLevel=function(e){p.setLogLevel(e)},e.setLogger=function(e){p.setLogger(e)},e.broadcastWindowOnMessage=function(t){if(t.msgTag===vn){var i=t.fstAppCtxId,n=e._ctxIdFSTAPPMap.get(i);null!=n?1===t.msgType?n._onGameCustomCommand(t.ctxId,t.cmd,t.param,t.state,t.dataJson):2===t.msgType&&n._onAppCustomCommandEventCallback(t.ctxId,t.state,t.dataJson):p.e(this.kTag,"No fstAPP")}else e.appSelfOnMeessage&&e.appSelfOnMeessage.length&&e.appSelfOnMeessage.map((function(e){return e(t)}))},e.kTag="SudMGP",e._idIDGenerator=new s,e._ctxIdFSTAPPMap=new Map,e.appSelfOnMeessage=[],e.isRegisterEvent=!1,e}();window.SudMGP=yn})(),n})()));
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sudmgp-sdk-js",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "webpack-dev-server --mode development --open --config webpack.config.demo.js",
|
|
8
8
|
"local": "webpack --mode development",
|
|
9
9
|
"build": "webpack --mode production",
|
|
10
|
+
"check": "npm pack",
|
|
10
11
|
"pub": "npm publish ./lib",
|
|
11
12
|
"lint": "eslint --ext .js,.ts,.tsx src/"
|
|
12
13
|
},
|
|
@@ -47,5 +48,7 @@
|
|
|
47
48
|
"webpack-dev-server": "^4.9.2",
|
|
48
49
|
"webpack-merge": "^5.8.0"
|
|
49
50
|
},
|
|
50
|
-
"dependencies": {
|
|
51
|
-
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"microsoft-cognitiveservices-speech-sdk": "^1.27.0"
|
|
53
|
+
}
|
|
54
|
+
}
|