WXL
7 小时以前 d79ce11fcd47db138764557d214f4ea2169fb90a
1
2
3
/*! For license information please see 6148.864d88e85e5345400e69.js.LICENSE.txt */
(self.webpackChunkhunyuan_bot=self.webpackChunkhunyuan_bot||[]).push([[6148],{2513:(t,e,r)=>{"use strict";r.d(e,{D8:()=>E,pi:()=>S});var n=r(22359),o=r(68244),i=r(7378),a=r(46091),u=r(28619),c=r(80628),l=r(53550),s=r(43721);function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function h(){h=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new R(n||[]);return o(a,"_invoke",{value:C(t,r,u)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var d="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function b(){}function w(){}function _(){}var E={};l(E,a,(function(){return this}));var S=Object.getPrototypeOf,L=S&&S(S(k([])));L&&L!==r&&n.call(L,a)&&(E=L);var O=_.prototype=b.prototype=Object.create(E);function I(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var c=p(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==f(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function C(e,r,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=N(u,n);if(c){if(c===g)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=p(e,r,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function N(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,N(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function k(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(f(e)+" is not iterable")}return w.prototype=_,o(O,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:w,configurable:!0}),w.displayName=l(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,l(t,c,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},I(x.prototype),l(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},I(O),l(O,c,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=k,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){y(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function y(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==f(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function m(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){v(i,n,o,a,u,"next",t)}function u(t){v(i,n,o,a,u,"throw",t)}a(void 0)}))}}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return b(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var w="input.model_switch.autoshow_web_list",_="prompt_send_record";function E(){var t=g((0,n.fp)(o.On),2),e=t[0],r=t[1],s=g((0,n.fp)(o.X),2),f=s[0],p=s[1],v=(0,n.md)(o.LU),b=(0,n.md)(a.w),_=(0,n.md)(c.bk),E=(0,n.Xr)(o.Gw),S=(0,n.md)(o.TY),O=(0,n.md)(o.ot),I=(0,i.useMemo)((function(){var t;return(null===(t=b.appBaseConfig)||void 0===t?void 0:t.autoExpandModelList)||{enable:!1,limitCount:0,limitMinutes:0}}),[b]);return{showModelSelectGuide:(0,u.$)(m(h().mark((function t(){var n,o,i,a,u,c,s,m,g;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(I.enable&&_&&_.auth&&"1"!==S&&O){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,(0,l.G_)({key:w},null==_?void 0:_.userId);case 4:if(n=t.sent,o=3,i=!1,a=null==n?void 0:n.find((function(t){return t.key===w})))try{c=JSON.parse((null==a||null===(u=a.value)||void 0===u?void 0:u.config_value)||"{}"),Boolean(null==c?void 0:c.enable)&&(o=Number(null==c?void 0:c.max_count),i=!0)}catch(t){}if(s=i&&L({maxCount:o}),m=Date.now(),!((g=(null==e?void 0:e[_.userId])||{count:0,lastShowTime:0}).count>=I.limitCount&&-1!==I.limitCount||m-g.lastShowTime<=60*I.limitMinutes*1e3&&-1!==I.limitMinutes||s)){t.next=14;break}return t.abrupt("return");case 14:if(r(d(d({},e),{},y({},_.userId,{count:-1===I.limitCount?0:g.count+1,lastShowTime:-1===I.limitMinutes?0:m}))),!v&&!f){t.next=19;break}return f&&p(!1),E(!1),t.abrupt("return");case 19:E(!0);case 20:case"end":return t.stop()}}),t)}))))}}function S(t){var e=(t||{}).modelId,r=localStorage.getItem(_)||"{}";try{var n=JSON.parse(r);n[e]=(n[e]||0)+1,localStorage.setItem(_,JSON.stringify(n))}catch(t){}}function L(t){var e=(t||{}).maxCount;if("number"!=typeof e)return!1;var r=0,n=0,o=localStorage.getItem(_);try{var i=JSON.parse(o||"{}");Object.entries(i).forEach((function(t){var e=g(t,2),o=e[0],i=e[1],a=[s.VP,s.Ng].includes(o),u=[s.ht,s.tI].includes(o);"number"==typeof i&&(a&&(r+=i),u&&(n+=i))}))}catch(t){return!1}return r>=e&&n>=e}},2835:(t,e,r)=>{"use strict";r.d(e,{A9:()=>d,Px:()=>g,fn:()=>h,fx:()=>s,zR:()=>v});var n=r(48335),o=r(66220),i=r(8687);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function u(){u=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new R(n||[]);return o(a,"_invoke",{value:C(t,r,u)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var d="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function b(){}function w(){}function _(){}var E={};f(E,c,(function(){return this}));var S=Object.getPrototypeOf,L=S&&S(S(k([])));L&&L!==r&&n.call(L,c)&&(E=L);var O=_.prototype=b.prototype=Object.create(E);function I(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,u,c){var l=p(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==a(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,u,c)}),(function(t){r("throw",t,u,c)})):e.resolve(f).then((function(t){s.value=t,u(s)}),(function(t){return r("throw",t,u,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function C(e,r,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=N(u,n);if(c){if(c===g)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=p(e,r,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function N(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,N(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function k(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(a(e)+" is not iterable")}return w.prototype=_,o(O,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:w,configurable:!0}),w.displayName=f(_,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,f(t,s,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},I(x.prototype),f(x.prototype,l,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},I(O),f(O,s,"Generator"),f(O,c,(function(){return this})),f(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=k,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function c(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){c(i,n,o,a,u,"next",t)}function u(t){c(i,n,o,a,u,"throw",t)}a(void 0)}))}}function s(t){return f.apply(this,arguments)}function f(){return(f=l(u().mark((function t(e){var r;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,i.Em)({url:(0,n.e9)(o.s.GET_MSG_RED_DOT),method:"post",data:{path_list:e},hideTip:!0});case 2:return r=t.sent,t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function h(t){return p.apply(this,arguments)}function p(){return(p=l(u().mark((function t(e){var r;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,i.Em)({url:(0,n.e9)(o.s.GET_MSG_SUB_RED_DOT),method:"post",data:{path:e},hideTip:!0});case 2:return r=t.sent,t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function d(t){return y.apply(this,arguments)}function y(){return(y=l(u().mark((function t(e){var r;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,i.Em)({url:(0,n.e9)(o.s.RESET_MSG_RED_DOT),method:"post",data:{path:e},hideTip:!0});case 2:return r=t.sent,t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function v(){return m.apply(this,arguments)}function m(){return(m=l(u().mark((function t(){var e;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,i.Em)({url:(0,n.e9)(o.s.GET_MSG_TIPS),method:"post",data:{tips_type:["team_account_tips","team_dialog"]},hideTip:!0});case 2:return e=t.sent,t.abrupt("return",e);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function g(t){return b.apply(this,arguments)}function b(){return(b=l(u().mark((function t(e){var r;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,i.Em)({url:(0,n.e9)(o.s.ACTION_MSG_TIPS),method:"post",data:{tips_type:e||"team_account_tips",action:"close"},hideTip:!0});case 2:return r=t.sent,t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}},3847:()=>{},19994:(t,e,r)=>{"use strict";r.d(e,{A:()=>f});var n=r(26093),o=r(75416),i=r(22448),a=r(7378),u=r(42239),c=r(24417),l=r(85803),s=r(85428);function f(t){var e=(0,n.Bd)().t,r=t.downloadPcInfo;(0,a.useEffect)((function(){var t;(0,u.Ay)(c.Qy.OnPageMod,{page_id:"LoginPage",mod_id:"Download_mod",button_id:"download"}),null===(t=l.fQ.ins)||void 0===t||t.infoAll({type:"download_pc_app_login",payload:{}})}),[]);var f=(0,a.useCallback)((function(){var t;(0,u.Ay)(c.Qy.OnPageClick,{page_id:"LoginPage",mod_id:"Download_mod",button_id:"download"}),null===(t=l.fQ.ins)||void 0===t||t.infoAll({type:"click_launch_app_login",payload:{}});var e="";(0,i.cX)(navigator.userAgent)&&(e=(null==r?void 0:r.mac)||""),(0,i.Zm)(navigator.userAgent)&&(e=(null==r?void 0:r.windows)||""),e&&window.open(e)}),[r]);return(0,s.jsx)("div",{className:o.A.pc_download_not_login_modal,onClick:f,children:e("立即下载")})}},21409:(t,e,r)=>{"use strict";r.d(e,{k:()=>d,u:()=>y});var n=r(7378),o=r(44059),i=r(40403),a=r(64607),u=r(85428);function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return p(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var d=function(t){return t.JOIN="join",t.CREATE="create",t}({});function y(){var t=h((0,n.useState)({type:null,params:{}}),2),e=t[0],r=t[1],c=function(){var t,n;null===(t=e.params)||void 0===t||null===(n=t.onClose)||void 0===n||n.call(t),r({type:null,params:{}})};return{teamDialog:(0,o.createPortal)(function(){var t,r,n;if(!e.type)return null;var o={visible:!0,onClose:c};return"create"===e.type?(0,u.jsx)(i.x,s(s({},o),{},{onManage:null==e||null===(t=e.params)||void 0===t?void 0:t.onManage,onInvite:null==e||null===(r=e.params)||void 0===r?void 0:r.onInvite})):(0,u.jsx)(a.V,s(s({},o),{},{onStart:null==e||null===(n=e.params)||void 0===n?void 0:n.onStart}))}(),document.body),showTeamDialog:function(t){return r({type:t.type,params:t.params})}}}},22568:(t,e,r)=>{"use strict";r.d(e,{v:()=>c});var n=r(26093);const o={create_team_container:"index_create_team_container__eRxdo"};var i=r(42239),a=r(41540),u=r(85428);function c(){var t=(0,n.Bd)().t;return(0,u.jsx)("div",{className:o.create_team_container,onClick:function(){(0,i.Ay)(a.Qy.OnPageClick,{page_id:"LoginPage"})},children:t("立即创建团队")})}},23536:(t,e,r)=>{"use strict";r.d(e,{k:()=>l});var n=r(10047),o=r(74938),i=r(25570),a=r(2774),u=r(22359),c=r(7378);function l(){var t=(0,u.Xr)(o.aq),e=(0,u.Xr)(o.W8),r=(0,a.g)(i.Vs,(function(t){return t?{supportFunctions:null==t?void 0:t.supportFunctions,internetSearch:null==t?void 0:t.internetSearch}:null})),l=Boolean((null==r?void 0:r.internetSearch)&&r.internetSearch.functionGroupList),s=(0,c.useRef)(l),f=(0,a.g)(n.Ec,(function(t){var e;return{isNewChat:1===(null==t||null===(e=t.convs)||void 0===e?void 0:e.length),chatId:null==t?void 0:t.id}}),[]),h=(0,c.useRef)(f);return(0,c.useEffect)((function(){s.current=l}),[l]),(0,c.useEffect)((function(){h.current={isNewChat:f.isNewChat,chatId:null==f?void 0:f.chatId}}),[f]),{handleUserModelConfigUpdate:function(r){var n,o=null==r?void 0:r.content;if(o&&null!==(n=h.current)&&void 0!==n&&n.isNewChat)try{var i=JSON.parse(o),a=(null==i?void 0:i.chatSubModelId)||(null==i?void 0:i.chatModelId);a&&t(a);var u=[];u=s.current?i.internetSearch?[i.internetSearch]:[]:Boolean(null==i?void 0:i.supportInternetSearch)?["supportInternetSearch"]:[],e(u)}catch(t){}},handleConversationModelConfigUpdate:function(r){var n,o=null==r?void 0:r.content;if(o&&(null===(n=h.current)||void 0===n||!n.isNewChat))try{var i,a=JSON.parse(o);if((null==a?void 0:a.cid)===(null===(i=h.current)||void 0===i?void 0:i.chatId))try{var u=JSON.parse(null==a?void 0:a.chatModelExtInfo),c=(null==u?void 0:u.subModelId)||(null==u?void 0:u.modelId)||(null==a?void 0:a.chatModelId);c&&t(c);var l=null==u?void 0:u.supportFunctions,f=[];f=s.current?null!=l&&l.internetSearch?[l.internetSearch]:[]:Boolean(null==l?void 0:l.supportInternetSearch)?["supportInternetSearch"]:[],e(f)}catch(t){}}catch(t){}}}}},26580:(t,e,r)=>{"use strict";r.d(e,{GI:()=>d,Hu:()=>p,YI:()=>s,cE:()=>h,dW:()=>y});var n=r(20911),o=r(7378),i=r(22448),a=r(27991),u=function(){var t;if(null!==(t=window.performance)&&void 0!==t&&t.memory){var e=[],r=0;setInterval((function(){var t=window.performance.memory,n=t.usedJSHeapSize,o=t.jsHeapSizeLimit,i=n/1048576;if(e.length<12)e.push(i);else{var u=e.reduce((function(t,e){return t+e}),0)/12;if(r){var c=(u-r)/r;if(Math.abs(c)>.05){var l=o/1048576;a.M.report("per_data_metric_memory",{HY508:i.toFixed(),HY501:l.toFixed(),HY502:(l-i).toFixed()})}}r=u,e=[]}}),1e4)}},c=function(t){if(window.PerformanceObserver){var e=new PerformanceObserver((function(t){t.getEntries().forEach((function(t){t.duration>5e3&&a.M.report("perf_anr",{HY501:t.duration}),t.duration}))})),r={entryTypes:["longtask"]};e.observe(r);document.addEventListener("visibilitychange",(function(){document.hidden?e.disconnect():e.observe(r)}))}},l=function(t){var e=(t||{}).interval,r=setInterval((function(){var t=document.getElementsByTagName("*").length;t>1e4&&(clearInterval(r),a.M.report("perf_dom_nodes",{HY501:t}))}),1e3*(void 0===e?10:e))},s=function(){return!!((0,i.rv)()||(0,i.xv)()||(0,i.a7)())},f=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5;return Math.random()<t};function h(t){(0,n.A)((function(){s()||(u(),c(t),l(t))}))}function p(t){(0,o.useEffect)((function(){if(t&&!s()){var e,r=performance.now(),n=0,o=document.hidden,i=0,u=o?r:0;return o||(e=requestAnimationFrame(c)),document.addEventListener("visibilitychange",l),function(){o&&u>0&&(i+=performance.now()-u);var t=performance.now()-r,c=n/((t-i)/1e3),s=t/1e3;isNaN(c)||a.M.report("perf_fps",{HY501:c.toFixed(1),HY502:s.toFixed(1)}),cancelAnimationFrame(e),document.removeEventListener("visibilitychange",l)}}function c(){n++,e=requestAnimationFrame(c)}function l(){var t=performance.now(),r=document.hidden;!o&&r?(u=t,cancelAnimationFrame(e)):o&&!r&&(u>0&&(i+=t-u),e=requestAnimationFrame(c)),o=r}}),[t])}function d(){var t=(0,o.useMemo)((function(){return["getAgentChatDetailDuration","triggerRenderChatListMeasureDuration","renderMeasureDuration","startGetAgentChatDetail","endGetAgentChatDetail","triggerRenderChatList","startRenderChatList","endRenderChatList"]}),[]);return{chatListPerformance:(0,o.useCallback)((function(e){var r,n;if((e||f()&&!s())&&(null===(r=performance)||void 0===r||null===(n=r.mark)||void 0===n||n.call(r,"endRenderChatList"),performance.getEntriesByName("triggerRenderChatList").length))try{var o={getDetail:performance.measure("getAgentChatDetailDuration","startGetAgentChatDetail","endGetAgentChatDetail"),triggerRenderChatList:performance.measure("triggerRenderChatListMeasureDuration","triggerRenderChatList","endRenderChatList"),render:performance.measure("renderMeasureDuration","startRenderChatList","endRenderChatList")};requestAnimationFrame((function(){var t,e,r,n,i=(null===(t=document.querySelector(".agent-chat__list__content"))||void 0===t||null===(t=t.textContent)||void 0===t?void 0:t.length)||0;a.M.report("perf_switch_history_conversation",{HY501:null===(e=o.getDetail.duration)||void 0===e?void 0:e.toFixed(),HY502:null===(r=o.render.duration)||void 0===r?void 0:r.toFixed(),HY503:null===(n=o.triggerRenderChatList.duration)||void 0===n?void 0:n.toFixed(),HY504:i})})),t.forEach((function(t){performance.clearMarks(t)}))}catch(e){t.forEach((function(t){try{performance.clearMarks(t)}catch(t){}}))}}),[t])}}function y(){var t=(0,o.useRef)(!1),e=(0,o.useCallback)((function(e){if(!t.current){var r,n,o="0";if("ready"===e)if(null===(r=performance)||void 0===r||null===(n=r.mark)||void 0===n||n.call(r,"pageReady"),performance.getEntriesByName("pageLoad").length){t.current=!0;try{var i;o=null===(i=performance.measure("pageLoadDuration","pageLoad","pageReady").duration)||void 0===i?void 0:i.toFixed(),performance.clearMarks("pageLoadDuration"),performance.clearMarks("pageLoad"),performance.clearMarks("pageReady")}catch(t){}}a.M.report("trace_web_chain",{HY501:e,HY502:Date.now(),HY503:0,HY504:o})}}),[]);return(0,o.useEffect)((function(){var t,r;null===(t=performance)||void 0===t||null===(r=t.mark)||void 0===r||r.call(t,"pageLoad"),e("load")}),[e]),e}},53277:(t,e,r)=>{"use strict";r.d(e,{e:()=>m});var n=r(26093),o=r(44059),i=r(77256),a=r(7378),u=r(28619),c=r(26796),l=r(42239),s=r(78677),f=r(79815),h=r(35299),p=r(69687),d=r(85428);function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return v(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,n.Bd)().t,r=t.onOk,v=t.onCancel,m=(0,a.useRef)({}),g=(0,a.useRef)(""),b=y((0,a.useState)(!1),2),w=b[0],_=b[1],E=y((0,a.useState)(1),2),S=E[0],L=E[1],O=(0,u.$)((function(t){_(!0),L(1),m.current=t.params,g.current=t.type||"",(0,l.Ay)({hyrptImpressionEventCode:s.Xe.PAGE_MOD,hyrptPageId:"LoginPage",hyrptModId:"log_off_mod"},"impression")})),I=(0,u.$)((function(){if("phone"!==g.current){var t=window.location,e=t.host,r=t.protocol;window.location.href="".concat(r,"//").concat(e,"/chat")}else window.location.reload()})),x=(0,u.$)((function(){_(!0),r?r():I()})),C=(0,u.$)((function(){_(!1),v?v():I()})),N=(0,u.$)((function(){2!==S?((0,c.wm)(m.current).then((function(t){(0,p.pK)(t.data.userId,t.data.token),x()})).catch((function(t){var e,r=t.error||{},n=null===(e=r.response)||void 0===e||null===(e=e.data)||void 0===e?void 0:e.error;if(n)return(0,f.Ax)(n.message||r.message),void(n.code===h._.coolingPeriodInconsistent?C():_(!1));(0,f.Ax)(r.message)})).finally((function(){sessionStorage.removeItem("anonUserInfo")})),(0,l.Ay)({hyrptClickEventCode:s.Xe.PAGE_CLICK,hyrptPageId:"LoginPage",hyrptModId:"log_off_mod",hyrptButtonId:"login"},"click")):x()}));return{dialog:(0,o.createPortal)((0,d.jsx)(i.lG,{visible:w,theme:"warning",header:e("重要提示"),confirmBtn:{theme:"default",content:e(1===S?"继续登录":"我知道了")},cancelBtn:!1,closeOnOverlayClick:!1,placement:"center",onClose:C,onConfirm:N,destroyOnClose:!0,children:(0,d.jsx)("div",{className:"recovery-account-tip",children:e(1===S?"当前账号已在注销流程中,如果继续登录,将自动撤回本次注销。":"你在申请注销账号的 15 天内重新登录了元宝,注销申请已撤销。如果需要重新注销,请再次提交申请,并保证 15 天内不要登录。")})}),document.body),show:O}}},60528:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});r(7378);var n=r(39646),o=r(85428);function i(t){!function(t){if(null==t)throw new TypeError("Cannot destructure "+t)}(t);var e=(0,n.Zp)();return(0,o.jsxs)("div",{style:{display:"flex",width:"100%",height:"100%",alignItems:"center",justifyContent:"center"},children:["请检查网络是否存在问题,再",(0,o.jsx)("div",{style:{textDecoration:"underline",cursor:"pointer"},onClick:function(){return e(0)},children:"点击重试"})]})}},68418:(t,e,r)=>{"use strict";r.d(e,{N:()=>Mt});var n=r(7378),o=r(22359),i=r(2835),a=r(65706),u=r(45042);function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function l(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,h(n.key),n)}}function s(t,e,r){return e&&l(t.prototype,e),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t,e,r){return(e=h(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:e+""}var p=function(t){return t.CLEARHISTORYSUCCESS="clear_history_success",t.CLEARHISTORYFAILED="clear_history_failed",t.MSG_STOP="msg_stop",t.ASKCANCELSUCCESS="ask_cancel_success",t.ASKCANCELFAILED="ask_cancel_failed",t.SENDREQSUCCESS="send_req_success",t.SENDREQFAILED="send_req_failed",t.CREATE_SESSION_SUCCESS="create_session_success",t.CREATE_SESSION_FAIL="create_session_fail",t.ASK_SEND_START="send_start",t.ASK_SEND_FAIL="ask_send_fail",t.ASK_NETWORK_ERROR="ask_network_error",t.QUESTION_INIT="question_init",t.ANSWER_INIT="answer_init",t.ANSWER_RECEIVE="answer_receive",t.ANSWER_END="answer_end",t.SINGLE_ANSWER_END="single_answer_end",t.VOTE_SUCCESS="vote_success",t.VOTE_FAILED="vote_failed",t.PULL_SUCCESS="pull_success",t.PULL_FAIL="pull_fail",t.RE_SEND_ASK="re_send_ask",t.CLEAR_HISTORIES="clear_histories",t.WS_CUSTOM_EVENT="ws_custom_event",t.PRESET_QUESTION_MORE_POPOVER_SWITCH="preset_question_more_popover_switch",t.VIP_GUIDE_MSG_ANIMATE="vip_guide_msg_animate",t.WEB_SOCKET_ERROR_WHEN_ASK="web_socket_error_when_ask",t.JOIN_MEETING="join_meeting",t.LEAVE_MEETING="leave_meeting",t.USER_INFO_CHANGE="user_info_change",t.TRIGGER_ASK="TRIGGER_ASK",t.GO_LOGIN="go_login",t.REFRESH_CONV_LIST="refresh_conv_list",t.NEW_CONV="new_conv",t.INPUT_FOCUS="input_focus",t.INPUT_BLUR="input_blur",t.NEED_UPLOAD_FILE_CHANGE="need_upload_file_change",t.UPLOAD_FILE_IN_MEETING="upload_file_in_meeting",t.OPEN_FILE_SELECT="open_file_select",t.FILE_REUPLOAD="file_reupload",t.DISMISS_ALL_TRANSCRIPTION_BUBBLE="dismiss_all_transcription_bubble",t.INPUT_DISABLED_BLINK="input_disabled_blink",t.CONTACTS_SELECT="contacts_select",t.GET_REMINDER_SETTING_SUCCESS="get_reminder_setting_success",t.GET_REMINDER_SETTING_FAIL="get_reminder_setting_fail",t.SET_REMINDER_SETTING_SUCCESS="set_reminder_setting_success",t.SET_REMINDER_SETTING_FAIL="set_reminder_setting_fail",t.WINDOW_WIDTH_CHANGE="window_width_change",t.IOS_SIMULATE_MANUAL_SCROLL="IOS_SIMULATE_MANUAL_SCROLL",t.SENSITIVE_MSG_RECEIVE="sensitive_msg_receive",t.MSG_FLASH_ANIMATE="msg_flash_animate",t.RECORD_ASSSTANT_OPEN_HISTORY="record_assstant_open_history",t.TRANS_MEETING_ASK_ANIMATE="trans_meeting_ask_animate",t.RECORD_TRANS_OPENED="record_trans_opened",t.PRESET_OPEN_RECORD="preset_open_record",t.SCROLL_TO_BOTTOM="scroll_to_bottom",t}({}),d=s((function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),f(this,"eventMap",new Map),f(this,"addListener",(function(t,r){var n=e.eventMap.get(t)||[];n.push(r),e.eventMap.set(t,n)})),f(this,"removeListener",(function(t){e.eventMap.set(t,[])})),f(this,"removeCallback",(function(t,r){var n=e.eventMap.get(t)||[],o=n.indexOf(r);-1!==o&&(n.splice(o,1),e.eventMap.set(t,n))})),f(this,"emit",(function(t,r){(e.eventMap.get(t)||[]).forEach((function(t){try{null==t||t(r)}catch(t){}}))}))}));const y=new d;var v=r(84162),m=r(37844);function g(t){return new Promise((function(e){return setTimeout(e,t)}))}function b(){return(0,m.A)().replace(/-/g,"")}function w(){var t="__ws_connection_id__";if(sessionStorage.getItem(t))return sessionStorage.getItem(t);var e=b().slice(0,16);return sessionStorage.setItem(t,e),e}var _=r(6310),E=r.n(_);const S=JSON.parse('{"options":{"syntax":"proto3"},"nested":{"trpc":{"nested":{"yuanbao":{"nested":{"conn_common":{"options":{"go_package":"git.woa.com/ifBookProtocol/hunyuanbot/yuanbao_conn/conn_common"},"nested":{"RetCode":{"values":{"SUCCESS":0,"PARAMS_INVALID":40011,"AUTH_FAIL":40100,"UNKNOWN_ROUTE":40300,"ALREADY_AUTH":41101,"SAME_KIND_DEV_LOGIN":41102,"INNER_SVR_FAIL":50400,"OVERLOAD_CONTROL":50503,"SET_STATE_CONFLICT":51001,"CONN_OVER_LIMIT":51002,"NO_USER_ONLINE":51003,"PARTIAL_FAIL":51004,"NET_FAIL":90001,"BACKEND_RETURN_FAIL":90003,"USER_OFFLINE":20001,"USER_NOT_EXIST":20002}},"Head":{"fields":{"cmdType":{"type":"uint32","id":1},"cmd":{"type":"string","id":2},"seqNo":{"type":"uint32","id":3},"msgId":{"type":"string","id":4},"module":{"type":"string","id":5},"needAck":{"type":"bool","id":6},"status":{"type":"int32","id":10}}},"ConnMsg":{"fields":{"head":{"type":"Head","id":1},"data":{"type":"bytes","id":2}}},"DirectedPush":{"fields":{"type":{"type":"uint32","id":1},"content":{"type":"string","id":2}}},"AuthInfo":{"fields":{"uid":{"type":"string","id":1},"source":{"type":"string","id":2},"token":{"type":"string","id":3}}},"DeviceInfo":{"fields":{"appVersion":{"type":"string","id":1},"appOperationSystem":{"type":"string","id":2},"appBundleId":{"type":"string","id":3},"qimei":{"type":"string","id":4},"qimei36":{"type":"string","id":5},"h38":{"type":"string","id":6},"language":{"type":"string","id":7},"deviceId":{"type":"string","id":8},"deviceName":{"type":"string","id":9},"instanceId":{"type":"string","id":10},"tid":{"type":"string","id":11},"uskey":{"type":"string","id":12},"busParamsMd5":{"type":"string","id":13},"packageType":{"type":"string","id":14},"appPublishChannel":{"type":"string","id":15},"signVersion":{"type":"string","id":16},"packageSignature":{"type":"string","id":17}}},"Container":{"fields":{"type":{"type":"int32","id":1},"uniqueKey":{"type":"string","id":2}}},"AuthBindReq":{"fields":{"bizId":{"type":"string","id":1},"authInfo":{"type":"AuthInfo","id":2},"deviceInfo":{"type":"DeviceInfo","id":3},"containerInfo":{"type":"Container","id":4},"envName":{"type":"string","id":5},"bindMode":{"type":"uint32","id":6},"forceToken":{"type":"string","id":7}}},"AuthBindRsp":{"fields":{"code":{"type":"int32","id":1},"message":{"type":"string","id":2},"connectId":{"type":"string","id":3},"timestamp":{"type":"uint64","id":4},"clientIp":{"type":"string","id":5}}},"PingReq":{"fields":{}},"PingRsp":{"fields":{"heartInterval":{"type":"uint32","id":1},"timestamp":{"type":"uint64","id":2}}},"KickoutMsg":{"fields":{"status":{"type":"int32","id":1},"reason":{"type":"string","id":2},"otherDeviceName":{"type":"string","id":3}}},"Meta":{"fields":{"key":{"type":"string","id":1},"value":{"type":"string","id":2}}},"UpdateMetaReq":{"fields":{"metaInfos":{"rule":"repeated","type":"Meta","id":1}}},"UpdateMetaRsp":{"fields":{"code":{"type":"int32","id":1},"message":{"type":"string","id":2}}},"PushMsg":{"fields":{"cmd":{"type":"string","id":1},"module":{"type":"string","id":2},"msgId":{"type":"string","id":3},"data":{"type":"bytes","id":4}}}}}}}}}}}');var L,O,I=null===E()||void 0===E()||null===(L=E().Root)||void 0===L||null===(O=L.fromJSON)||void 0===O?void 0:O.call(L,S);function x(t,e){try{return I.lookupType(t).decode(new Uint8Array(e))}catch(t){return null}}function C(t,e){try{var r=I.lookupType(t),n=r.create(e);return r.encode(n).finish()}catch(t){return null}}var N=r(90460),T=r(26093);function A(t){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(t)}function R(){R=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),u=new T(n||[]);return o(a,"_invoke",{value:I(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var _=Object.getPrototypeOf,E=_&&_(_(k([])));E&&E!==r&&n.call(E,a)&&(w=E);var S=b.prototype=m.prototype=Object.create(w);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==A(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function I(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=x(u,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function x(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,x(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function k(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(A(e)+" is not iterable")}return g.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(O.prototype),l(O.prototype,u,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=k,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function k(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function P(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){k(i,n,o,a,u,"next",t)}function u(t){k(i,n,o,a,u,"throw",t)}a(void 0)}))}}var j=0,M={reqKey:"trpc.yuanbao.conn_common.ConnMsg"},D={cmd:"auth-bind",module:"conn_access",reqKey:"trpc.yuanbao.conn_common.AuthBindReq",rspKey:"trpc.yuanbao.conn_common.AuthBindRsp"},G={cmd:"ping",module:"conn_access",reqKey:"trpc.yuanbao.conn_common.PingReq",rspKey:"trpc.yuanbao.conn_common.PingRsp"},U={reqKey:"trpc.yuanbao.conn_common.DirectedPush"};function F(){return B.apply(this,arguments)}function B(){return(B=P(R().mark((function t(){var e,r,n,o,i,a;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=w(),r=(0,N.I5)(N.PU),n=(null==r?void 0:r.getLocalQimei36())||{},o=n.h38,i=(0,T.qA)(),a={appVersion:"",appOperationSystem:"",appBundleId:"",qimei:"",qimei36:null==r?void 0:r.q36,h38:o,language:i,deviceId:"",deviceName:"",instanceId:"5",tid:"",uskey:"",busParamsMd5:"",packageType:"",appPublishChannel:"",signVersion:"",packageSignature:""},t.abrupt("return",{bizId:"yuanbao",authInfo:{uid:"",source:"",token:""},deviceInfo:a,containerInfo:{type:1,uniqueKey:e},envName:"ci-540",bindMode:0,forceToken:""});case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function K(t,e,r){var n={cmd:t,module:e,msg_id:r||b(),seq_no:j,cmd_type:0};return j+=1,n}function H(t){return Y.apply(this,arguments)}function Y(){return Y=P(R().mark((function t(e){var r,n,o;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=1,t.next=4,F();case 4:return r=t.sent,n=C(D.reqKey,r),x(D.reqKey,n),o=K(D.cmd,D.module),t.abrupt("return",C(M.reqKey,{head:o,data:n}));case 14:return t.prev=14,t.t0=t.catch(1),t.abrupt("return",null);case 18:case"end":return t.stop()}}),t,null,[[1,14]])}))),Y.apply(this,arguments)}function q(){return q=P(R().mark((function t(){var e,r,n;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e=C(G.reqKey,{}),r=K(G.cmd,G.module),n=C(M.reqKey,{head:r,data:e}),t.abrupt("return",n);case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",null);case 10:case"end":return t.stop()}}),t,null,[[0,7]])}))),q.apply(this,arguments)}function W(t){return V.apply(this,arguments)}function V(){return(V=P(R().mark((function t(e){return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",x(D.rspKey,e));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function J(t){return Q.apply(this,arguments)}function Q(){return(Q=P(R().mark((function t(e){return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",x(G.rspKey,e));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var $=function(t){return t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSING=2]="CLOSING",t[t.CLOSED=3]="CLOSED",t[t.TICKET_INVALID=10004]="TICKET_INVALID",t[t.OVERLIMIT=10008]="OVERLIMIT",t[t.CLOSED_DURING_ANSWER=11]="CLOSED_DURING_ANSWER",t[t.OPEN_DURING_ANSWER=12]="OPEN_DURING_ANSWER",t}({}),z=function(t){return t[t.RED_DOT=2]="RED_DOT",t[t.TIPS=4]="TIPS",t[t.ADMIN_DELETE=5]="ADMIN_DELETE",t[t.NEW_JOIN=6]="NEW_JOIN",t[t.PRIVACY=7]="PRIVACY",t[t.UserModelConfigUpdate=10]="UserModelConfigUpdate",t[t.ConversationModelConfigUpdate=11]="ConversationModelConfigUpdate",t}({});function X(t){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},X(t)}function Z(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function tt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Z(Object(r),!0).forEach((function(e){at(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function et(){et=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),u=new T(n||[]);return o(a,"_invoke",{value:I(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var _=Object.getPrototypeOf,E=_&&_(_(A([])));E&&E!==r&&n.call(E,a)&&(w=E);var S=b.prototype=m.prototype=Object.create(w);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==X(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function I(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=x(u,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function x(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,x(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(X(e)+" is not iterable")}return g.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(O.prototype),l(O.prototype,u,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function rt(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function nt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){rt(i,n,o,a,u,"next",t)}function u(t){rt(i,n,o,a,u,"throw",t)}a(void 0)}))}}function ot(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ut(n.key),n)}}function it(t,e,r){return e&&ot(t.prototype,e),r&&ot(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function at(t,e,r){return(e=ut(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ut(t){var e=function(t,e){if("object"!=X(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=X(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==X(e)?e:e+""}var ct=function(t){return t[t.CloseCodeSameUserReconnect=4014]="CloseCodeSameUserReconnect",t}(ct||{}),lt=function(t){return t[t.PENDING=0]="PENDING",t[t.SUCCESS=1]="SUCCESS",t[t.FAILED=2]="FAILED",t}(lt||{});var st=it((function t(e){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),at(this,"timeout",5e3),at(this,"retryMaxCount",10),at(this,"socketAuthStatus",lt.PENDING),at(this,"fiboIntervalArr",function(t){if(t<1)return[];for(var e=[1],r=0,n=1;e.length<t;){var o=r+n;e.push(o),r=n,n=o}return e}(this.retryMaxCount)),at(this,"retryCount",0),at(this,"retryInterval",this.fiboIntervalArr[this.retryCount]),at(this,"pingInterval",10),at(this,"sleepInterval",200),at(this,"updateRetryCount",(0,v.A)((function(t){t<=r.retryMaxCount&&(r.retryCount=t)}),200)),at(this,"reConnect",(0,v.A)((function(){setTimeout((function(){var t,e,n;[$.OPEN,$.CONNECTING].includes(null===(t=r.socketRef)||void 0===t?void 0:t.readyState)||(r.updateRetryCount(r.retryCount+1),r.retryCount<r.retryMaxCount?(r.retryInterval=r.fiboIntervalArr[r.retryCount],null===(e=r.onRetry)||void 0===e||e.call(r),r.connect().then((function(){return r.heartbeat()}))):null===(n=r.onClose)||void 0===n||n.call(r,r.retryCount))}),1e3*r.retryInterval)}),200)),at(this,"close",(function(){var t;return null===(t=r.socketRef)||void 0===t?void 0:t.close()})),at(this,"connect",(function(){return new Promise((function(t,e){var n,o;if((null===(n=r.socketRef)||void 0===n?void 0:n.readyState)===$.OPEN)return t(r.socketRef);if((null===(o=r.socketRef)||void 0===o?void 0:o.readyState)===$.CONNECTING)return t(r.socketRef);var i=new WebSocket(r.socketUrl);r.socketRef=i;var a=setTimeout((function(){null==r||r.close(),r.onError({msg:"connect time out",code:0}),e("connect time out")}),r.timeout);i.addEventListener("open",(function(){clearTimeout(a),r.resetRetryCountTimeout=setTimeout((function(){r.updateRetryCount(0)}),3e3),t(i),r.onOpen()})),i.addEventListener("error",(function(t){clearTimeout(a),r.onError({msg:t.type,code:0})})),i.addEventListener("close",(function(t){clearTimeout(a),r.onError({msg:"close",code:t.code})})),i.addEventListener("message",(function(t){clearTimeout(a),r.onReceive(t)}))}))})),at(this,"disableReConnect",(function(){r.updateRetryCount(r.retryMaxCount)})),at(this,"enableReConnect",(function(){r.updateRetryCount(0)})),at(this,"heartbeat",(function(){r.pingInterval===r.heartBeatIntervalLast&&r.heartBeatInterval||(window.clearInterval(r.heartBeatInterval),r.heartBeatInterval=setInterval((function(){(function(){return q.apply(this,arguments)})().then((function(t){return t&&r.send(t)}))}),1e3*(r.pingInterval-1)),r.heartBeatIntervalLast=r.pingInterval)})),at(this,"send",function(){var t=nt(et().mark((function t(e){var n,o,i,a,u,c=arguments;return et().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=c.length>1&&void 0!==c[1]?c[1]:0,t.next=3,r.ready();case 3:return null===(n=r.socketRef)||void 0===n||n.send(e),t.next=6,x(M.reqKey,e);case 6:return i=t.sent,a=setTimeout((function(){u(o)}),r.timeout),u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;setTimeout((function(){var n=t+1;n<r.retryMaxCount&&r.send(e,n)}),1e3*r.fiboIntervalArr[t])},t.abrupt("return",new Promise((function(t){var e,r;y.addListener("".concat(p.SENDREQSUCCESS,"_").concat(null==i||null===(e=i.head)||void 0===e?void 0:e.cmd,"_").concat(null==i||null===(r=i.head)||void 0===r?void 0:r.msgId),(function(e){window.clearTimeout(a),t(e)}))})));case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),at(this,"ready",nt(et().mark((function t(){var e;return et().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((null===(e=r.socketRef)||void 0===e?void 0:e.readyState)!==WebSocket.OPEN||r.socketAuthStatus!==lt.SUCCESS){t.next=2;break}return t.abrupt("return",Promise.resolve(r.socketRef));case 2:if(!(r.retryCount<r.retryMaxCount)){t.next=6;break}return t.next=5,g(r.sleepInterval);case 5:return t.abrupt("return",r.ready());case 6:return t.abrupt("return",Promise.reject("WebSocket connection failed"));case 7:case"end":return t.stop()}}),t)})))),at(this,"onOpen",nt(et().mark((function t(){var e;return et().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:H(r.extraInfo).then((function(t){t&&r.socketRef.send(t)})),null===(e=r.onConnect)||void 0===e||e.call(r);case 3:case"end":return t.stop()}}),t)})))),at(this,"onError",(function(t){var e;window.clearTimeout(r.resetRetryCountTimeout),r.socketAuthStatus=lt.PENDING,null===(e=r.onClose)||void 0===e||e.call(r,r.retryCount,t.code),t.code,ct.CloseCodeSameUserReconnect})),at(this,"onReceive",function(){var t=nt(et().mark((function t(e){var n,o,i,a,u,c,l,s,f,h,d,v,m,g,b,w,_,E,S,L;return et().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,Blob.prototype.arrayBuffer=Blob.prototype.arrayBuffer||function(){var t=this;return new Promise((function(e){var r=new FileReader;r.onload=function(){e(r.result)},r.readAsArrayBuffer(t)}))},t.next=4,e.data.arrayBuffer();case 4:return c=t.sent,t.next=7,x(M.reqKey,c);case 7:return l=t.sent,t.next=10,x(U.reqKey,l.data);case 10:if(s=t.sent,null==l||null===(n=l.head)||void 0===n||!n.status){t.next=23;break}if((null==l||null===(f=l.head)||void 0===f?void 0:f.cmd)!==D.cmd){t.next=21;break}return r.socketAuthStatus=lt.FAILED,t.next=17,W(l.data);case 17:d=t.sent,(v=d.retCode)===$.TICKET_INVALID&&(null==r||r.close()),null===(h=r.onClose)||void 0===h||h.call(r,r.retryCount,v);case 21:t.next=34;break;case 23:if((null==l||null===(m=l.head)||void 0===m?void 0:m.cmd)!==D.cmd){t.next=27;break}r.socketAuthStatus=lt.SUCCESS,t.next=34;break;case 27:if((null==l||null===(g=l.head)||void 0===g?void 0:g.cmd)!==G.cmd){t.next=34;break}return t.next=30,J(l.data);case 30:b=t.sent,(w=b.heartInterval)>1&&(r.pingInterval=w,r.heartbeat());case 34:if((null==s?void 0:s.type)!==z.RED_DOT&&(null==s?void 0:s.type)!==z.TIPS&&(null==s?void 0:s.type)!==z.ADMIN_DELETE&&(null==s?void 0:s.type)!==z.NEW_JOIN&&(null==s?void 0:s.type)!==z.PRIVACY&&(null==s?void 0:s.type)!==z.UserModelConfigUpdate&&(null==s?void 0:s.type)!==z.ConversationModelConfigUpdate||null===(_=r.onMessage)||void 0===_||_.call(r,s),2!==(null==l||null===(o=l.head)||void 0===o?void 0:o.cmdType)||null==l||null===(i=l.head)||void 0===i||!i.need_ack){t.next=48;break}if(t.prev=37,E=C(M.reqKey,{head:tt(tt({},l.head),{},{need_ack:4}),data:{}})){t.next=41;break}return t.abrupt("return");case 41:r.send(E),t.next=47;break;case 44:t.prev=44,t.t0=t.catch(37);case 47:return t.abrupt("return");case 48:if(null==l||null===(a=l.head)||void 0===a||!a.msgId||1!==(null==l||null===(u=l.head)||void 0===u?void 0:u.cmdType)){t.next=51;break}return y.emit("".concat(p.SENDREQSUCCESS,"_").concat(null==l||null===(S=l.head)||void 0===S?void 0:S.cmd,"_").concat(null==l||null===(L=l.head)||void 0===L?void 0:L.msgId),l.data),t.abrupt("return");case 51:t.next=57;break;case 54:t.prev=54,t.t1=t.catch(0);case 57:case"end":return t.stop()}}),t,null,[[0,54],[37,44]])})));return function(e){return t.apply(this,arguments)}}()),this.socketUrl=e.url,this.extraInfo=e.extraInfo||"",this.onConnect=e.onConnect,this.onClose=e.onClose,this.onRetry=e.onRetry,this.onMessage=e.onMessage})),ft=r(22448);function ht(t){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ht(t)}function pt(){pt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),u=new T(n||[]);return o(a,"_invoke",{value:I(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var _=Object.getPrototypeOf,E=_&&_(_(A([])));E&&E!==r&&n.call(E,a)&&(w=E);var S=b.prototype=m.prototype=Object.create(w);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==ht(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function I(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=x(u,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function x(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,x(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(ht(e)+" is not iterable")}return g.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(O.prototype),l(O.prototype,u,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function dt(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function yt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){dt(i,n,o,a,u,"next",t)}function u(t){dt(i,n,o,a,u,"throw",t)}a(void 0)}))}}var vt={test:"wss://wss.yuanbao.test.hunyuan.woa.com/wss/connection",prerelease:"wss://wss-yuanbao.pre.hunyuan.woa.com/wss/connection",prod:"wss://wss.yuanbao.tencent.com/wss/connection"};var mt=r(63457),gt=r(77256),bt=r(26796),wt=r(69687),_t=r(39646),Et=r(43721),St=r(42239),Lt=r(24417),Ot=r(26580),It=r(31519);function xt(t){return xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xt(t)}function Ct(){Ct=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),u=new T(n||[]);return o(a,"_invoke",{value:I(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var _=Object.getPrototypeOf,E=_&&_(_(A([])));E&&E!==r&&n.call(E,a)&&(w=E);var S=b.prototype=m.prototype=Object.create(w);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==xt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function I(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=x(u,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function x(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,x(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(xt(e)+" is not iterable")}return g.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(O.prototype),l(O.prototype,u,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Nt(t){return function(t){if(Array.isArray(t))return Pt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||kt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tt(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function At(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Tt(i,n,o,a,u,"next",t)}function u(t){Tt(i,n,o,a,u,"throw",t)}a(void 0)}))}}function Rt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||kt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kt(t,e){if(t){if("string"==typeof t)return Pt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pt(t,e):void 0}}function Pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var jt=/^home:\/\/app\.drawer\.my\.account_list#\{(\d+)\}$/;function Mt(t){var e,r,c,l,s,f,h,d=Rt((0,n.useState)(!1),2),v=d[0],m=d[1],g=Rt((0,o.fp)(a.a),2)[1],b=(0,T.Bd)().t,w=(0,_t.Zp)(),_=(0,n.useRef)(null),E=(0,n.useRef)(!1),S=(0,n.useMemo)((function(){var e,r,n=(null===(e=t.chatBotState)||void 0===e||null===(e=e.authInfo)||void 0===e?void 0:e.auth)&&4!==(null===(r=t.chatBotState)||void 0===r||null===(r=r.authInfo)||void 0===r?void 0:r.status),o=(0,u.uT)()===It.MP.WOA;return n&&t.enabled&&!o&&!(0,Ot.YI)()}),[t]),L=(0,n.useCallback)(function(){var t=At(Ct().mark((function t(e){var r,n,o,a,u,c,l,s;return Ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(S){t.next=2;break}return t.abrupt("return");case 2:return t.prev=2,t.next=5,(0,i.fx)(["home://app.drawer.avatar","home://app.drawer.my.create_team"].concat(Nt(e||[])));case 5:o=t.sent,a=new Map(o.data.map((function(t){return[t.path,t.is_show]}))),u=null!==(r=a.get("home://app.drawer.avatar"))&&void 0!==r&&r,c=null!==(n=a.get("home://app.drawer.my.create_team"))&&void 0!==n&&n,l=new Map,s=!1,a.forEach((function(t,e){if(e.startsWith("home://app.drawer.my.account_list#")){var r;s=!0;var n=null===(r=e.match(jt))||void 0===r?void 0:r[1];l.set(n||"",t)}})),s||l.clear(),g({drawerAvatarRedDotSwitch:u,teamAccountRedDotMap:l,createTeamRedDotSwitch:c}),t.next=19;break;case 16:t.prev=16,t.t0=t.catch(2);case 19:case"end":return t.stop()}}),t,null,[[2,16]])})));return function(e){return t.apply(this,arguments)}}(),[S,g]),O=(0,n.useCallback)(At(Ct().mark((function t(){var e,r,n,o,a;return Ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(S){t.next=2;break}return t.abrupt("return");case 2:return t.prev=2,t.next=5,(0,i.fn)("home://app.drawer.my.account_list#");case 5:if(r=t.sent,n=null===(e=r.data)||void 0===e?void 0:e.item_list,o=new Map(null==n?void 0:n.map((function(t){return[t.path,t.is_show]}))),a=new Map,null!=n&&n.length){t.next=12;break}return g({teamAccountRedDotMap:new Map}),t.abrupt("return");case 12:o.forEach((function(t,e){if(e.startsWith("home://app.drawer.my.account_list#")){var r,n=null===(r=e.match(jt))||void 0===r?void 0:r[1];n&&a.set(n,t)}})),g({teamAccountRedDotMap:a}),t.next=20;break;case 17:t.prev=17,t.t0=t.catch(2);case 20:case"end":return t.stop()}}),t,null,[[2,17]])}))),[S,g]),I=(0,n.useCallback)(At(Ct().mark((function t(){var e,r,n,o;return Ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(S){t.next=2;break}return t.abrupt("return");case 2:return t.prev=2,t.next=5,(0,i.zR)();case 5:r=t.sent,n=(null===(e=r.data)||void 0===e?void 0:e.map((function(t){try{return JSON.parse(t.content).content_type}catch(t){return null}})).filter(Boolean))||[],o=mt.a8.EMPTY,n.includes(mt.a8.HANDSHARE)?o=mt.a8.HANDSHARE:n.includes(mt.a8.JOINTEAM)?o=mt.a8.JOINTEAM:n.includes(mt.a8.CREATE_TEAM_TIPS)&&(o=mt.a8.CREATE_TEAM_TIPS),n.includes(mt.a8.TEAM_GUID)&&m(!0),g({teamTips:o}),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(2);case 16:case"end":return t.stop()}}),t,null,[[2,13]])}))),[S,g]),x=(r=(e={isEnable:S,onReceivePush:function(e){try{if(!e)return;var r,n,o,i=e.type,a=e.content,u=JSON.parse(a);if(i===z.RED_DOT){var c,l=null==u||null===(c=u.path_info)||void 0===c?void 0:c.map((function(t){return t.path})).filter((function(t){return jt.test(t)}));L(l),O()}i===z.TIPS&&null!=u&&null!==(r=u.tips_type)&&void 0!==r&&r.length&&I(),i===z.ADMIN_DELETE&&(0,bt.ri)().then((function(){(0,St.Ay)(Lt.Qy.OnPageMod,{page_id:"TeamRemovePage"}),(0,wt.ek)(),t.triggerLogout(),null==t||t.initApp().then((function(){var t,e,r;w("/chat/".concat(Et.kv),{replace:!0});var n=gt.r3.confirm({dialogClassName:"global-ui-dialog",header:b((null==u||null===(t=u.dialogs)||void 0===t?void 0:t["zh-CN"].title)||"移出团队通知"),body:b((null==u||null===(e=u.dialogs)||void 0===e?void 0:e["zh-CN"].content)||"你的账号已被管理员移出团队"),confirmBtn:{content:b((null==u||null===(r=u.dialogs)||void 0===r?void 0:r["zh-CN"].buttonsTitle)||"我知道了")},cancelBtn:null,destroyOnClose:!0,placement:"center",onClose:function(){return n.hide()},onConfirm:function(){n.hide()}})}))})),i===z.PRIVACY&&(null==t||t.initApp()),i===z.UserModelConfigUpdate&&(null==t||null===(n=t.handleUserModelConfigUpdate)||void 0===n||n.call(t,{type:i,content:a})),i===z.ConversationModelConfigUpdate&&(null==t||null===(o=t.handleConversationModelConfigUpdate)||void 0===o||o.call(t,{type:i,content:a}))}catch(t){}}}).isEnable,c=(0,u._$)(),l=(0,n.useRef)(null),s=(0,n.useCallback)(function(){var t=yt(pt().mark((function t(e){return pt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l.current){t.next=5;break}return t.next=4,(0,u.yy)(100);case 4:return t.abrupt("return",s(e));case 5:return t.abrupt("return",l.current.send(e));case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),[]),f=(0,n.useCallback)((function(){var t;l.current&&(null===(t=l.current)||void 0===t||t.close(),l.current=null)}),[]),h=function(){var t=yt(pt().mark((function t(r){var n;return pt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:null===(n=e.onReceivePush)||void 0===n||n.call(e,r);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),(0,n.useEffect)((function(){if(r&&!(0,ft.d4)()&&!l.current){var t;l.current=new st({url:vt[c],onClose:e.onClose,onRetry:e.onRetry,onMessage:h,onConnect:(t=yt(pt().mark((function t(){var r;return pt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:null===(r=e.onConnect)||void 0===r||r.call(e);case 1:case"end":return t.stop()}}),t)}))),function(){return t.apply(this,arguments)})});var n=function(){var t=l.current;t&&t.connect().then((function(){return t.heartbeat()}))};n();var o=function(){var t;null===(t=l.current)||void 0===t||t.enableReConnect(),setTimeout((function(){n()}),200)};return document.addEventListener("visibilitychange",(function(){var t;"visible"!==document.visibilityState?null===(t=l.current)||void 0===t||t.disableReConnect():o()})),y.addListener("".concat(p.WEB_SOCKET_ERROR_WHEN_ASK),o),function(){f(),y.removeListener("".concat(p.WEB_SOCKET_ERROR_WHEN_ASK))}}}),[r]),{close:f});return(0,n.useEffect)((function(){if(S&&!E.current)E.current=!0,L(),O(),I(),_.current=x;else if(!S&&null!=_&&_.current){var t;null==_||null===(t=_.current)||void 0===t||t.close(),_.current=null,E.current=!1}}),[S,x,L,O,I]),{showPushTeamGuide:v,setShowPushTeamGuide:m}}}}]);
//# sourceMappingURL=sourcemap/6148.864d88e85e5345400e69.js.map