/*! For license information please see 893.44f3a4adf24b64b31127.js.LICENSE.txt */ "use strict";(self.webpackChunkchat=self.webpackChunkchat||[]).push([[893],{2590:(t,e,n)=>{n.d(e,{_:()=>i});var r=n(2211),i={SendMessage:function(t){var e=t.content,n=void 0===e?"":e,i=t.type,o=void 0===i?0:i,a=t.baseMessageId,s=void 0===a?null:a,c=t.timeStamp,l=t.sign;this.name=r.zC.SendMessage,this.model={content:n,type:o,baseMessageId:s,timeStamp:c,sign:l}},LikeMessage:function(t){var e=t.messageId,n=void 0===e?0:e;this.name=r.zC.LikeMessage,this.model={messageId:n}},UnLikeMessage:function(t){var e=t.messageId,n=void 0===e?0:e;this.name=r.zC.UnLikeMessage,this.model={messageId:n}},UpdatePlayer:function(t){var e=t.nickName,n=void 0===e?null:e,i=t.defaultAvatarId,o=void 0===i?0:i;this.name=r.zC.UpdatePlayer,this.model={nickName:n,defaultAvatarId:o}}}},3425:(t,e,n)=>{n.r(e),n.d(e,{Backdrop:()=>ot,default:()=>Ct});var r,i,o,a,s,c,l,d,u,f,h,m,p,v,y,g,b,x,w,j,k,S,M,O,_,P,E=n(8416),C=n(5694),I=n(5439),N=n.n(I),L=n(9411),A=n.n(L),B=n(1277),T=n(6606),V=n(7397),U=n.n(V),F=n(4528),z=n.n(F),G=n(2535),R=n.n(G),D=n(9987),H=n.n(D),Y=n(6241),Z=n.n(Y),$=n(8030),W=n(837),X=n(8430),q=n(2211),J=n(5893);function K(t){return K="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},K(t)}function Q(){Q=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,i){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),s=new M(i||[]);return r(a,"_invoke",{value:w(t,n,s)}),a}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var u={};function f(){}function h(){}function m(){}var p={};c(p,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(O([])));y&&y!==e&&n.call(y,o)&&(p=y);var g=m.prototype=f.prototype=Object.create(p);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function i(r,o,a,s){var c=d(t[r],t,o);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==K(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(u).then((function(t){l.value=t,a(l)}),(function(t){return i("throw",t,a,s)}))}s(c.arg)}var o;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return o=o?o.then(r,r):r()}})}function w(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=j(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=d(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function j(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,j(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),u;var i=d(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,u;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function k(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 S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function O(t){if(t||""===t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}function tt(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function et(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return nt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nt(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 nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n * {\n\t\tcolor: #76cc3d;\n\t}\n"])))),Ot=(0,E.memo)(A().div(O||(O=rt(["\n\tfont-size: 0.75em;\n\tcolor: #a1a1a1;\n"])))),_t=(0,E.memo)(A().span(_||(_=rt(["\n\tdisplay: inline-flex;\n\twidth: 0.875em;\n\theight: 0.875em;\n\tmargin-right: 0.25em;\n"])))),Pt=(0,E.memo)(A().span(P||(P=rt(["\n\tpadding: 0.65em 0 0.375em;\n\tcolor: #b92322;\n\tdisplay: inline-block;\n\tfont: 0.75em/1.5 var(--mainFont);\n"]))));function Et(t){var e=t.style,n=(0,C.useDispatch)(),r=(0,E.useRef)(),i=(0,B.shallowSelector)(X.aX),o=i.nickName,a=i.avatarUrl,s=i.canChangeNickName,c=(0,B.shallowSelector)(X.w4),l=(0,B.shallowSelector)(X.$V),d=(0,B.shallowSelector)(B.selectResources),u=d.strMyAccount,f=d.strNicknameExists,h=d.strOffensiveLanguage,m=d.strNickGuideline,p=d.strAvatar,v=d.strNickname,y=d.strSubmit,g=d.strAcceptedChar,b=d.strMin4Char,x=d.strMax12Char,w=et((0,E.useState)(!1),2),j=w[0],k=w[1],S=et((0,E.useState)(""),2),M=S[0],O=S[1],_=et((0,E.useState)({min:!1,max:!1,charters:!1}),2),P=_[0],I=_[1],N=et((0,E.useState)(0),2),L=N[0],A=N[1];(0,E.useEffect)((function(){var t;A((null===(t=c.find((function(t){return t.url===a})))||void 0===t?void 0:t.id)||1)}),[a]);var T=function(){var t,e=(t=Q().mark((function t(){return Q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,k((function(t){return!t}));case 2:j?O(""):r.current.focus(),n(B.actions.setChatError({error:null}));case 4:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){tt(o,r,i,a,s,"next",t)}function s(t){tt(o,r,i,a,s,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}(),V=(0,E.useMemo)((function(){var t,e=L===(null===(t=c.find((function(t){return t.url===a})))||void 0===t?void 0:t.id);return j?!!Object.keys(P).find((function(t){return!1===P[t]})):e}),[L,a,c,P,j]);return(0,J.jsx)(ot,{style:e.backdrop,children:(0,J.jsxs)(at,{style:e.container,children:[(0,J.jsxs)(st,{style:e.header,children:[(0,J.jsx)(ut,{style:e.title,children:u||"_My account"}),(0,J.jsx)(ft,{type:"button",style:e.closeBtn,onClick:function(){(0,C.batch)((function(){n(B.actions.closePopup({name:$.BASE_POPUP_NAMES.CHAT_REGISTRY_POPUP})),n(B.actions.setChatError({error:null}))}))},children:(0,J.jsx)(z(),{style:e.close,color:"rgba(var(--white), 0.8)"})})]}),(0,J.jsxs)(lt,{style:e.formBlock,children:[(0,J.jsxs)(dt,{px0:!0,children:[(0,J.jsx)(ht,{style:e.labelBlock,px1:!0,children:(0,J.jsx)(mt,{style:e.label,children:p||"_Avatar"})}),(0,J.jsx)(pt,{style:e.avatars,children:(0,J.jsx)(vt,{style:e.avatarItems,children:c.map((function(t,n){return(0,J.jsx)(yt,{style:e.avatarImg,className:L===t.id?"selected":"",onClick:function(){return A(t.id)},src:t.url,alt:"Avatar"},"avatar_".concat(n))}))})})]}),(0,J.jsxs)(dt,{children:[(0,J.jsx)(ht,{style:e.labelBlock,children:(0,J.jsx)(mt,{style:e.label,children:v||"_Nickname"})}),(0,J.jsxs)(gt,{style:e.inputBlock,children:[(0,J.jsx)(bt,{ref:r,style:e.inputElement,className:l?"error":"",type:"text",value:j?M:o,onChange:function(t){var e,n={},r=(null===(e=t.target.value)||void 0===e?void 0:e.trim())||"";n.min=r.length>=4,n.max=!!r.length&&r.length<=12,n.charters=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]+$/.test(t.target.value),O(t.target.value),I(n)},readOnly:!j,autoFocus:j}),s&&(0,J.jsx)(jt,{style:e.inputActionBtn,onClick:T,className:j?"editMode":"editedMode",children:j?(0,J.jsx)(R(),{}):(0,J.jsx)(U(),{})})]}),j&&(0,J.jsxs)(kt,{style:e.editModeValidations,children:[l===q.G_.NicknameExist&&(0,J.jsx)(Pt,{style:e.errorText,children:f||"_The chosen Nickname already exists. Please choose another one."}),l===q.G_.NicknameWithProfanity&&(0,J.jsx)(Pt,{style:e.errorText,children:h||"_No offensive, explicit, or inappropriate language is allowed."}),(0,J.jsx)(St,{style:e.editModeInfo,children:m||"_Please make sure your nickname complies with the nickname guideline."}),(0,J.jsxs)(Mt,{style:e.editModeValidation,className:P.min&&null!=M&&M.length?"valid":"invalid",children:[P.min&&null!=M&&M.length?(0,J.jsx)(_t,{style:e.editModeValidationIcon,children:(0,J.jsx)(H(),{style:e.editModeValidationCheck})}):(0,J.jsx)(_t,{style:e.editModeValidationIcon,children:(0,J.jsx)(Z(),{style:e.editModeValidationCancel})}),(0,J.jsx)(Ot,{style:e.editModeValidationText,children:b||"_Min. 4 characters"})]}),(0,J.jsxs)(Mt,{style:e.editModeValidation,className:P.max&&null!=M&&M.length?"valid":"invalid",children:[P.max&&null!=M&&M.length?(0,J.jsx)(_t,{style:e.editModeValidationIcon,children:(0,J.jsx)(H(),{style:e.editModeValidationCheck})}):(0,J.jsx)(_t,{style:e.editModeValidationIcon,children:(0,J.jsx)(Z(),{style:e.editModeValidationCancel})}),(0,J.jsx)(Ot,{style:e.editModeValidationText,children:x||"_Max. 12 characters"})]}),(0,J.jsxs)(Mt,{style:e.editModeValidation,className:P.charters&&null!=M&&M.length?"valid":"invalid",children:[P.charters&&null!=M&&M.length?(0,J.jsx)(_t,{style:e.editModeValidationIcon,children:(0,J.jsx)(H(),{style:e.editModeValidationCheck})}):(0,J.jsx)(_t,{style:e.editModeValidationIcon,children:(0,J.jsx)(Z(),{style:e.editModeValidationCancel})}),(0,J.jsx)(Ot,{style:e.editModeValidationText,children:g||"_Accepted characters: [a-z A-Z 0-9]"})]})]})]})]}),(0,J.jsx)(ct,{style:e.footer,children:(0,J.jsx)(xt,{style:e.button,className:V?"disabled":"",type:"button",onClick:function(){var t={defaultAvatarId:L};s&&M&&(t.nickName=M),(0,W.Zy)(t)},children:(0,J.jsx)(wt,{style:e.buttonTxt,children:y||"_Submit"})})})]})})}const Ct=(0,E.memo)(Et);Et.defaultProps={style:{backdrop:{},container:{},header:{},title:{},closeBtn:{},close:{},formBlock:{},labelBlock:{},label:{},avatars:{},avatarItems:{},avatarImg:{},inputBlock:{},inputElement:{},inputActionBtn:{},editModeValidations:{},editModeInfo:{},editModeValidation:{},editModeValidationIcon:{},editModeValidationCheck:{},editModeValidationCancel:{},editModeValidationText:{}}},Et.propTypes={style:N().object}},5457:(t,e,n)=>{function r(t){var e=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-256",e).then((function(t){return Array.from(new Uint8Array(t)).map((function(t){return t.toString(16).padStart(2,"0")})).join("")}))}n.d(e,{v:()=>r})},9864:(t,e,n)=>{n.d(e,{Z:()=>l});var r=n(6606),i=n(8030);function o(t){return o="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},o(t)}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e{n.d(e,{E:()=>r});var r={services:{popups:{},chat:{id:0,name:"",configuration:{minShareCoefficient:1e4},player:{id:0,isBlocked:!1,isInfluencer:!1,nickName:"",avatarUrl:"",canChangeNickName:!1},messages:[],pinnedMessages:[],defaultAvatars:[],emojis:[]}}}},5251:(t,e,n)=>{var r=n(8416),i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(t,e,n){var r,o={},l=null,d=null;for(r in void 0!==n&&(l=""+n),void 0!==e.key&&(l=""+e.key),void 0!==e.ref&&(d=e.ref),e)a.call(e,r)&&!c.hasOwnProperty(r)&&(o[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps)void 0===o[r]&&(o[r]=e[r]);return{$$typeof:i,type:t,key:l,ref:d,props:o,_owner:s.current}}e.Fragment=o,e.jsx=l,e.jsxs=l},5893:(t,e,n)=>{t.exports=n(5251)}}]);