/*! For license information please see 382.88154a2090aecc6392ad.js.LICENSE.txt */ "use strict";(self.webpackChunkchat=self.webpackChunkchat||[]).push([[382],{2517:(e,t,n)=>{n.d(t,{T:()=>o});var r=n(7489),i=n(3190),o={SendMessage:function(e){var t=e.content,n=void 0===t?"":t,o=e.type,a=void 0===o?0:o,s=e.baseMessageId,c=void 0===s?null:s,l=e.timeStamp,d=e.sign;this.name=i.Hj.SendMessage,this.model={content:n,type:a,baseMessageId:c,timeStamp:l,sign:d},this.messagePackModel=(0,r.parseObjectToArray)([a,n,c,d,l])},LikeMessage:function(e){var t=e.messageId,n=void 0===t?0:t;this.name=i.Hj.LikeMessage,this.model={messageId:n},this.messagePackModel=(0,r.parseObjectToArray)([n])},UnLikeMessage:function(e){var t=e.messageId,n=void 0===t?0:t;this.name=i.Hj.UnLikeMessage,this.model={messageId:n},this.messagePackModel=(0,r.parseObjectToArray)([n])},UpdatePlayer:function(e){var t=e.nickName,n=void 0===t?null:t,o=e.defaultAvatarId,a=void 0===o?0:o;this.name=i.Hj.UpdatePlayer,this.model={nickName:n,defaultAvatarId:a},this.messagePackModel=(0,r.parseObjectToArray)([n,a])}}},3414:(e,t,n)=>{n.r(t),n.d(t,{Backdrop:()=>T,default:()=>ae});var r=n(4914),i=n(678),o=n(3444),a=n.n(o),s=n(8874),c=n.n(s),l=n(7800),d=n(5094),u=n.n(d),m=n(6295),f=n(1543),h=n.n(f),p=n(2677),g=n.n(p),v=n(6309),y=n.n(v),b=n(7146),w=n.n(b),j=n(3484),x=n.n(j),k=n(9133),I=n(1508),C=n(4228),M=n(2153),S=n(3190),O=n(4848);function P(e){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(e)}function _(){_=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new E(r||[]);return i(a,"_invoke",{value:M(e,n,s)}),a}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var m="suspendedStart",f="suspendedYield",h="executing",p="completed",g={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var j=Object.getPrototypeOf,x=j&&j(j(N([])));x&&x!==n&&r.call(x,a)&&(w=x);var k=b.prototype=v.prototype=Object.create(w);function I(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(i,o,a,s){var c=u(e[i],e,o);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==P(d)&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function M(t,n,r){var i=m;return function(o,a){if(i===h)throw Error("Generator is already running");if(i===p){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=S(s,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===m)throw i=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=h;var l=u(t,n,r);if("normal"===l.type){if(i=r.done?p:f,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=p,r.method="throw",r.arg=l.arg)}}}function S(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=u(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function N(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),L(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;L(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:N(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function L(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return N(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?N(e,t):void 0}}(e,t)||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 N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n *{color:#76cc3d;}"],(0,I.Dj)({alignItems:"center"}))),ne=(0,r.memo)(c().div.withConfig({componentId:"sc-mebw0j-21"})(["font-size:0.75em;color:#a1a1a1;"])),re=(0,r.memo)(c().span.withConfig({componentId:"sc-mebw0j-22"})(["display:inline-flex;width:0.875em;height:0.875em;margin-right:0.25em;"])),ie=(0,r.memo)(c().span.withConfig({componentId:"sc-mebw0j-23"})(["padding:0.65em 0 0.375em;color:#b92322;display:inline-block;font:0.75em/1.5 var(--mainFont);"]));function oe(e){var t=e.style,n=(0,i.useDispatch)(),o=(0,r.useRef)(),a=A&&!u()(),s=(0,l.shallowSelector)(M.St),c=s.nickName,d=s.avatarUrl,m=s.canChangeNickName,f=(0,l.shallowSelector)(M.mC),p=(0,l.shallowSelector)(M.k9),v=(0,l.shallowSelector)(l.selectResources),b=v.strMyAccount,j=v.strNicknameExists,I=v.strOffensiveLanguage,P=v.strNickGuideline,N=v.strAvatar,oe=v.strNickname,ae=v.strSubmit,se=v.strAcceptedChar,ce=v.strMin4Char,le=v.strMax12Char,de=E((0,r.useState)(!1),2),ue=de[0],me=de[1],fe=E((0,r.useState)(""),2),he=fe[0],pe=fe[1],ge=E((0,r.useState)({min:!1,max:!1,charters:!1}),2),ve=ge[0],ye=ge[1],be=E((0,r.useState)(0),2),we=be[0],je=be[1];(0,r.useEffect)((function(){var e;je((null===(e=f.find((function(e){return e.url===d})))||void 0===e?void 0:e.id)||1)}),[d]);var xe=function(){var e,t=(e=_().mark((function e(){return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,me((function(e){return!e}));case 2:ue?pe(""):o.current.focus(),n(l.actions.setChatError({error:null}));case 4:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){L(o,r,i,a,s,"next",e)}function s(e){L(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}(),ke=(0,r.useMemo)((function(){var e,t=we===(null===(e=f.find((function(e){return e.url===d})))||void 0===e?void 0:e.id);return ue?!!Object.keys(ve).find((function(e){return!1===ve[e]})):t}),[we,d,f,ve,ue]);return(0,O.jsx)(T,{style:t.backdrop,children:(0,O.jsxs)(B,{style:t.container,isLandscape:a,children:[(0,O.jsxs)(U,{style:t.header,children:[(0,O.jsx)(R,{style:t.title,children:b||"_My account"}),(0,O.jsx)(G,{type:"button",style:t.closeBtn,onClick:function(){(0,i.batch)((function(){n(l.actions.closePopup({name:k.BASE_POPUP_NAMES.CHAT_REGISTRY_POPUP})),n(l.actions.setChatError({error:null}))}))},children:(0,O.jsx)(g(),{style:t.close,color:"rgba(var(--white), 0.8)"})})]}),(0,O.jsxs)(F,{style:t.formBlock,isLandscape:a,children:[(0,O.jsxs)(D,{isLandscape:a,px0:!0,children:[(0,O.jsx)(H,{style:t.labelBlock,px1:!0,isLandscape:a,children:(0,O.jsx)(W,{style:t.label,children:N||"_Avatar"})}),(0,O.jsx)(z,{style:t.avatars,isLandscape:a,children:(0,O.jsx)(Y,{style:t.avatarItems,children:f.map((function(e,n){return(0,O.jsx)(Z,{style:t.avatarImg,className:we===e.id?"selected":"",onClick:function(){return je(e.id)},src:e.url,alt:"Avatar"},"avatar_".concat(n))}))})})]}),(0,O.jsxs)(D,{isLandscape:a,children:[(0,O.jsx)(H,{style:t.labelBlock,isLandscape:a,children:(0,O.jsx)(W,{style:t.label,children:oe||"_Nickname"})}),(0,O.jsxs)($,{style:t.inputBlock,children:[(0,O.jsx)(Q,{ref:o,style:t.inputElement,className:p?"error":"",type:"text",value:ue?he:c,onChange:function(e){var t,n={},r=(null===(t=e.target.value)||void 0===t?void 0:t.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(e.target.value),pe(e.target.value),ye(n)},readOnly:!ue,autoFocus:ue}),m&&(0,O.jsx)(J,{style:t.inputActionBtn,onClick:xe,className:ue?"editMode":"editedMode",children:ue?(0,O.jsx)(y(),{}):(0,O.jsx)(h(),{})})]}),ue&&(0,O.jsxs)(K,{style:t.editModeValidations,children:[p===S.T2.NicknameExist&&(0,O.jsx)(ie,{style:t.errorText,children:j||"_The chosen Nickname already exists. Please choose another one."}),p===S.T2.NicknameWithProfanity&&(0,O.jsx)(ie,{style:t.errorText,children:I||"_No offensive, explicit, or inappropriate language is allowed."}),(0,O.jsx)(ee,{style:t.editModeInfo,children:P||"_Please make sure your nickname complies with the nickname guideline."}),(0,O.jsxs)(te,{style:t.editModeValidation,className:ve.min&&null!=he&&he.length?"valid":"invalid",children:[ve.min&&null!=he&&he.length?(0,O.jsx)(re,{style:t.editModeValidationIcon,children:(0,O.jsx)(w(),{style:t.editModeValidationCheck})}):(0,O.jsx)(re,{style:t.editModeValidationIcon,children:(0,O.jsx)(x(),{style:t.editModeValidationCancel})}),(0,O.jsx)(ne,{style:t.editModeValidationText,children:ce||"_Min. 4 characters"})]}),(0,O.jsxs)(te,{style:t.editModeValidation,className:ve.max&&null!=he&&he.length?"valid":"invalid",children:[ve.max&&null!=he&&he.length?(0,O.jsx)(re,{style:t.editModeValidationIcon,children:(0,O.jsx)(w(),{style:t.editModeValidationCheck})}):(0,O.jsx)(re,{style:t.editModeValidationIcon,children:(0,O.jsx)(x(),{style:t.editModeValidationCancel})}),(0,O.jsx)(ne,{style:t.editModeValidationText,children:le||"_Max. 12 characters"})]}),(0,O.jsxs)(te,{style:t.editModeValidation,className:ve.charters&&null!=he&&he.length?"valid":"invalid",children:[ve.charters&&null!=he&&he.length?(0,O.jsx)(re,{style:t.editModeValidationIcon,children:(0,O.jsx)(w(),{style:t.editModeValidationCheck})}):(0,O.jsx)(re,{style:t.editModeValidationIcon,children:(0,O.jsx)(x(),{style:t.editModeValidationCancel})}),(0,O.jsx)(ne,{style:t.editModeValidationText,children:se||"_Accepted characters: [a-z A-Z 0-9]"})]})]})]})]}),(0,O.jsx)(V,{style:t.footer,isLandscape:a,children:(0,O.jsx)(X,{style:t.button,className:ke?"disabled":"",type:"button",onClick:function(){var e={defaultAvatarId:we};m&&he&&(e.nickName=he),(0,C.LX)(e)},children:(0,O.jsx)(q,{style:t.buttonTxt,children:ae||"_Submit"})})})]})})}const ae=(0,r.memo)(oe);oe.defaultProps={style:{backdrop:{},container:{},header:{},title:{},closeBtn:{},close:{},formBlock:{},labelBlock:{},label:{},avatars:{},avatarItems:{},avatarImg:{},inputBlock:{},inputElement:{},inputActionBtn:{},editModeValidations:{},editModeInfo:{},editModeValidation:{},editModeValidationIcon:{},editModeValidationCheck:{},editModeValidationCancel:{},editModeValidationText:{}}},oe.propTypes={style:a().object}},1858:(e,t,n)=>{function r(e){var t=(new TextEncoder).encode(e);return crypto.subtle.digest("SHA-256",t).then((function(e){return Array.from(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}))}n.d(t,{t:()=>r})},2213:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(6295),i=n(9133),o=n(3190);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;tr?n:r:n},setSharedBigWinCoeff:function(e,t){var n=t.payload;e.gameInfo.sharedBigWinCoefficient=n},resetChatState:function(e){delete e.services.popups[i.BASE_POPUP_NAMES.CHAT_POPUP],delete e.services.popups[i.BASE_POPUP_NAMES.CHAT_REGISTRY_POPUP],e.services.chat={id:0,name:"",configuration:{minShareCoefficient:1e4},player:{id:0,isBlocked:!1,isInfluencer:!1,nickName:"",avatarUrl:"",canChangeNickName:!1},messages:[],pinnedMessages:[],defaultAvatars:[],emojis:[]}}}},7792:(e,t,n)=>{n.d(t,{u:()=>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:[]}}}},1020:(e,t,n)=>{var r=n(4914),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(e,t,n){var r,o={},l=null,d=null;for(r in void 0!==n&&(l=""+n),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(d=t.ref),t)a.call(t,r)&&!c.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:l,ref:d,props:o,_owner:s.current}}t.Fragment=o,t.jsx=l,t.jsxs=l},4848:(e,t,n)=>{e.exports=n(1020)}}]);