(this.webpackChunkdiscord_app=this.webpackChunkdiscord_app||[]).push([[59859,28562,86502,77357,64045],{145911:(e,t,n)=>{e.exports=n.p+"e92599c3548209f77ec833c649f8939a.svg"},697694:(e,t,n)=>{e.exports=n.p+"87f8416faec0691b96525d0bb3027809.svg"},108881:(e,t,n)=>{e.exports=n.p+"750fe6bb60bf9451ab9ad9a0b6eabbbc.svg"},761869:(e,t,n)=>{e.exports=n.p+"481f8332b80859990fb464dbe288295e.svg"},884217:(e,t,n)=>{e.exports=n.p+"c19657ec8ccb7b12e610ab71d457bfd6.png"},921912:(e,t,n)=>{e.exports=n.p+"350e1c6739823620f031d023a48ac9d4.svg"},964766:(e,t,n)=>{e.exports=n.p+"3123277eb2e7083fde983985dcd209a6.svg"},3874:(e,t,n)=>{e.exports=n.p+"c115d59ca13c0f942965a82a0f05bf01.svg"},302255:(e,t,n)=>{e.exports=n.p+"ad530d02033b87bb89752f915c2fbe3c.svg"},117399:(e,t,n)=>{e.exports=n.p+"f1e026332f1d6e902bcbbc07892bc849.svg"},408056:(e,t,n)=>{e.exports=n.p+"fd65da49c3073002049383baeb24e658.svg"},498913:(e,t,n)=>{e.exports=n.p+"beec347635d7597215747fcaf461e569.svg"},598150:(e,t,n)=>{ e.exports=n.p+"9581653a5a4d0b7b56187044a9db301a.svg"},656470:(e,t,n)=>{e.exports=n.p+"12d9bda733d6432d605e8011c22c3e56.svg"},789885:(e,t,n)=>{e.exports=n.p+"8de4b17bb44ad5ef9f21f2f6f16aa8d1.svg"},492623:(e,t,n)=>{e.exports=n.p+"8c998f8fb62016fcfb4901e424ff378b.svg"},399898:(e,t,n)=>{e.exports=n.p+"645df33d735507f39c78ce0cac7437f0.svg"},74700:(e,t,n)=>{e.exports=n.p+"b5eb2f7d6b3f8cc9b60be4a5dcf28015.svg"},607603:(e,t,n)=>{e.exports=n.p+"02625ee29f851ec588c2020a88d82665.svg"},376354:(e,t,n)=>{e.exports=n.p+"b36de980b174d7b798c89f35c116e5c6.svg"},688224:(e,t,n)=>{e.exports=n.p+"fd879a28807b66b38d54e7db6ea18a69.svg"},96972:(e,t,n)=>{e.exports=n.p+"b36c705f790dad253981f1893085015a.svg"},540579:(e,t,n)=>{e.exports=n.p+"36c9a2fb7d0593a581a92373121c2848.svg"},572274:(e,t,n)=>{e.exports=n.p+"c8aeec4a5ee16aa9214b994f7355fea0.svg"},709804:(e,t,n)=>{e.exports=n.p+"37cf72199c4e106407223a1edaf34460.svg"},348833:(e,t,n)=>{e.exports=n.p+"23f41c9a000ffa229ef0b60ef127ccba.svg"},392544:(e,t,n)=>{ e.exports=n.p+"55b367aaef0b83c837ac6c3bfe01da4c.svg"},350672:(e,t,n)=>{e.exports=n.p+"6e97f6643e7df29b26571d96430e92f4.svg"},24264:(e,t,n)=>{e.exports=n.p+"55b941d7bba0d84f06c05db34b7c9aab.svg"},874638:(e,t,n)=>{e.exports=n.p+"187bc0709ea0cecffe622a50993d012c.svg"},956863:(e,t,n)=>{e.exports=n.p+"c096c74c5685ce049b779f7ce3591bab.svg"},947079:(e,t,n)=>{e.exports=n.p+"3fba9b3d08682f3ce0344e289fe668cb.svg"},903049:(e,t,n)=>{e.exports=n.p+"d5d75eacea4086ed5f38048b74851f43.svg"},188374:(e,t,n)=>{e.exports=n.p+"42b60052f80abd9c2bdd8fc24cf97988.svg"},789621:(e,t,n)=>{e.exports=n.p+"9167182d6b74446a1c818615c135c289.svg"},273361:(e,t,n)=>{e.exports=n.p+"67430d140a79af95585a19d304731dc5.svg"},129428:(e,t,n)=>{e.exports=n.p+"d6779172ed9209b5ad49df923ea7820c.svg"},566300:(e,t,n)=>{e.exports=n.p+"c11b69c74029b5deaca9ca7ce1e987b1.svg"},235920:(e,t,n)=>{e.exports=n.p+"23e073eb0ee21f94de11e5d0a7eec50e.svg"},200824:(e,t,n)=>{e.exports=n.p+"f69210154879227d0ede0308465cf388.svg"},389515:(e,t,n)=>{ e.exports=n.p+"816e71b3225c71bc105db7209fb4b796.svg"},785538:(e,t,n)=>{e.exports=n.p+"7866fb01d8b75b6fe9e6591373a0ddf2.svg"},761434:(e,t,n)=>{e.exports=n.p+"f88737ca3655b964bfdbbff8585f1d41.png"},88094:(e,t,n)=>{e.exports=n.p+"7dfe055a88781818b8368d1f9f2049da.png"},534413:(e,t,n)=>{e.exports=n.p+"e73889dfe6cc46c9161dd9c1d19cc5ca.svg"},182105:(e,t,n)=>{e.exports=n.p+"109dff8689b0dcedc5485a0b26c647f2.svg"},23943:(e,t,n)=>{e.exports=n.p+"0a14344c0e0bfe3a52aa245ecaaebca7.svg"},163471:(e,t,n)=>{e.exports=n.p+"f214135302d61205531f7b699beda3ae.svg"},770631:(e,t,n)=>{e.exports=n.p+"2af0d312aff32c40bf90e37cd91d2a52.svg"},961088:(e,t,n)=>{e.exports=n.p+"af1ba3a7e6cc150d54fe3f36ca83e5af.svg"},630234:(e,t,n)=>{e.exports=n.p+"1fd45d0febcfaabc6b535f3329b3b834.svg"},456202:(e,t,n)=>{e.exports=n.p+"5ec8d5e37b8734c04bde29eb7e2af36f.svg"},791643:(e,t,n)=>{e.exports=n.p+"ada35c4cc5073d182d563e6f39d6a7cf.svg"},565411:(e,t,n)=>{e.exports=n.p+"76f387b22097af941856a30be1aafa3f.svg"},727869:(e,t,n)=>{ e.exports=n.p+"5e690f4c63a19a36bff7f6364eaa6ea2.svg"},10439:(e,t,n)=>{e.exports=n.p+"fda43f574092d89177a4412046f51c44.svg"},680664:(e,t,n)=>{e.exports=n.p+"41a1814ec63404eb722ce88d1c28b4f4.png"},396448:(e,t,n)=>{e.exports=n.p+"8e5a6ee1fce31ef5c5800b7646a94d98.png"},50682:(e,t,n)=>{e.exports=n.p+"7786c98742fafc1347e5fedaa1c67ea9.svg"},509142:(e,t,n)=>{e.exports=n.p+"9c804cfda21f296f522fbadfb818c76f.svg"},226867:(e,t,n)=>{e.exports=n.p+"84b8a1a47627caf0b6d6dae9fc28f1c5.png"},794649:(e,t,n)=>{e.exports=n.p+"d759f3acc6286c964cc8118d7f68b374.svg"},80210:(e,t,n)=>{e.exports=n.p+"3ed9c7cdbea131bc485afa998a5ec93e.svg"},236481:(e,t,n)=>{e.exports=n.p+"1a23068e966efce6fb32ca9fecc65eed.svg"},694111:(e,t,n)=>{e.exports=n.p+"4aebeb85413bf3414671b2c138463909.svg"},484771:(e,t,n)=>{e.exports=n.p+"7de1e682a4fbf1483ad81f3872e5a9b2.png"},635232:(e,t,n)=>{e.exports=n.p+"34d96b0900c3f9fc0e57f7eeddf1e161.svg"},312154:(e,t,n)=>{e.exports=n.p+"7ee0d57b993e25a61a9f42a0808e721f.svg"},22513:(e,t,n)=>{ e.exports=n.p+"95f1d07727cd8303bb200217b50f98fa.svg"},515861:(e,t,n)=>{e.exports=n.p+"c0a2b25d7b3e46c1c969c809ee173e3a.svg"},568909:(e,t,n)=>{e.exports=n.p+"e50463c92d8fb550ee4a6018361098bb.svg"},531239:(e,t,n)=>{e.exports=n.p+"26f653c4a0bd723faa41d92b4f957cb9.svg"},302048:(e,t,n)=>{e.exports=n.p+"045d1e57ef93a0f9b55e9fa593116c96.svg"},180263:(e,t,n)=>{e.exports=n.p+"6a04c917a9b9b2706058f8f48bf83981.svg"},677291:(e,t,n)=>{e.exports=n.p+"2487bb81772c6dab62684cd570ac8dd4.svg"},864678:(e,t,n)=>{e.exports=n.p+"8895917b1fd65584171fb5794e5411be.svg"},367627:(e,t,n)=>{e.exports=n.p+"35c4885828d7808a119efea349c638a0.svg"},874744:(e,t,n)=>{e.exports=n.p+"4766a4c81adfcca7ce1c53c6a7590c23.svg"},101872:(e,t,n)=>{e.exports=n.p+"449b5e5b0765b27c68ef2bf735af539d.svg"},46802:(e,t,n)=>{e.exports=n.p+"5b6f3fce0c8b9fa0bcad7bbb51e13848.svg"},726954:(e,t,n)=>{e.exports=n.p+"2da390aaddef4384aa0520dd8a6fc156.svg"},897295:(e,t,n)=>{e.exports=n.p+"94ea936b0074481a45e1a0c50aed7e48.svg"},435696:(e,t,n)=>{ e.exports=n.p+"a6cde8ee51f202f776ef71ee9cf280d1.svg"},454675:(e,t,n)=>{e.exports=n.p+"e844e2dcc722ad0666556ca41351610f.svg"},404024:(e,t,n)=>{e.exports=n.p+"ed28635ce7d107f1a8b04379d009dd41.svg"},764728:(e,t,n)=>{e.exports=n.p+"cc6c3c95c28acf328b6173383ddb3b61.svg"},404940:(e,t,n)=>{e.exports=n.p+"c8234fe5675a618e7891b634d32d1c0f.svg"},185802:(e,t,n)=>{e.exports=n.p+"9b8d70b5b62f4983a80b2b136259b763.svg"},934104:(e,t,n)=>{e.exports=n.p+"5113924998ee17c4f43a65b8cf2d0153.svg"},652951:(e,t,n)=>{e.exports=n.p+"fd49d24049e28b740a0a1e08d15158b3.png"},207357:(e,t,n)=>{e.exports=n.p+"e06697bc1bf89b08d1e767aa21334ae0.png"},970298:(e,t,n)=>{e.exports=n.p+"07de3733e48397a3e9086e37a9cb0dac.svg"},946137:(e,t,n)=>{e.exports=n.p+"a8007d2ecb3aec65119698bff7052451.svg"},692760:(e,t,n)=>{e.exports=n.p+"a50c50c963aab21b5c3d58e7fd06664e.svg"},597055:(e,t,n)=>{e.exports=n.p+"ece95f914bae5931e7a48fadca4a146c.svg"},302147:(e,t,n)=>{e.exports=n.p+"da49b3a1b7e3f163d69aff38bf33609d.svg"},204186:(e,t,n)=>{ e.exports=n.p+"f18a19cd9fbf76b15b4d968274b0635a.svg"},337285:(e,t,n)=>{e.exports=n.p+"5e38a1b0dc183dd320c517e58ccfb074.svg"},691634:(e,t,n)=>{e.exports=n.p+"2ebbb7dbd17b154a625b58b33738fc85.svg"},998240:(e,t,n)=>{e.exports=n.p+"3224278ae6dc432b7fbc0fc90b54686e.svg"},810540:(e,t,n)=>{e.exports=n.p+"93e31ba1ad50859a7cbcd6b1f0035d6c.svg"},705206:(e,t,n)=>{e.exports=n.p+"984b386302bacf7fb81985ab31c5beec.png"},567012:(e,t,n)=>{e.exports=n.p+"a9efd5e06b5616d39a6ee4232211f9b0.svg"},862470:(e,t,n)=>{e.exports=n.p+"dd1ac77c281d77cfa4061925981469e2.svg"},148167:(e,t,n)=>{e.exports=n.p+"4d8c26b9b004da398fb8940d194e3aaa.svg"},237018:(e,t,n)=>{e.exports=n.p+"c173765c2ab447a8ec7ba0e3e8aa3c09.svg"},976518:(e,t,n)=>{e.exports=n.p+"48c9711c9fabbd43182bcaf602201b48.svg"},522627:(e,t,n)=>{e.exports=n.p+"6e0a487645bb93dc13fdb0b499352b46.svg"},583334:(e,t,n)=>{e.exports=n.p+"b8baf33f158fb831f7f243e36368ab72.svg"},630228:(e,t,n)=>{e.exports=n.p+"207efa8c7409188d94bfcdbeb66e33b1.svg"},20278:(e,t,n)=>{ e.exports=n.p+"eb47171e918604c7f7e861e94708f19f.svg"},955426:(e,t,n)=>{e.exports=n.p+"d63afdc8dee0d21c3c25f78f4f81a8a9.mov"},861197:(e,t,n)=>{e.exports=n.p+"686449dfc2b401327999d72f79b7c037.webm"},621491:(e,t,n)=>{e.exports=n.p+"2d197cc648cea186073da09b5d7639d1.mov"},109177:(e,t,n)=>{e.exports=n.p+"1442d764c3d6ee37ad6ba74a470bca14.webm"},470752:(e,t,n)=>{e.exports=n.p+"d8b61fb29328e17e879a14a5cc765e06.mov"},919098:(e,t,n)=>{e.exports=n.p+"6db35a89f93f27cec438f980be59635f.webm"},734207:(e,t,n)=>{e.exports=n.p+"9e8f64d43e65d86219eefaa871f25d0a.mov"},900615:(e,t,n)=>{e.exports=n.p+"c66604b9276c4dd8865a519b90394e9d.webm"},524268:(e,t,n)=>{e.exports=n.p+"2e16625f6f55b96572f79cc35682266f.png"},950737:(e,t,n)=>{e.exports=n.p+"3be860e37bf5f2df40ad15d2de5cee0e.png"},276727:(e,t,n)=>{e.exports=n.p+"97ac61a0b98fd6f01b4de370c9ccdb56.png"},49349:(e,t,n)=>{e.exports=n.p+"7cb25b8ad51d09af28fa31124e067f9b.png"},31890:(e,t,n)=>{e.exports=n.p+"c23a59030cd2583c8b8ae0e85bc99737.svg"},660588:(e,t,n)=>{ e.exports=n.p+"d4f4a5d2eb643d073f413e517ed0cc40.svg"},61541:(e,t,n)=>{"use strict";n.d(t,{W:()=>d});var r=n(707961),o=n(296602),i=n(959207),a=n(951442);function s(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){s(i,r,o,a,c,"next",e)}function c(e){s(i,r,o,a,c,"throw",e)}a(void 0)}))}}function l(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var u=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1, r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";n.d(t,{Z:()=>u});var r,o=n(281110),i=n(744564),a=n(347365),s=n(2590);function c(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var l=(c(r={},s.gkr.HOUSE_1,1),c(r,s.gkr.HOUSE_2,2),c(r,s.gkr.HOUSE_3,3),r);const u={joinHypeSquadOnline:function(e){return o.Z.post({url:s.ANM.HYPESQUAD_ONLINE,body:{house_id:l[e.houseID]},oldFormErrors:!0}).then((function(){return i.Z.dispatch({type:"HYPESQUAD_ONLINE_MEMBERSHIP_JOIN_SUCCESS", houseID:e.houseID})})).catch((function(e){throw new a.yZ(e)}))},leaveHypeSquadOnline:function(){return o.Z.delete({url:s.ANM.HYPESQUAD_ONLINE,oldFormErrors:!0}).then((function(){return i.Z.dispatch({type:"HYPESQUAD_ONLINE_MEMBERSHIP_LEAVE_SUCCESS"})})).catch((function(e){throw new a.yZ(e)}))}}},980151:(e,t,n)=>{"use strict";n.d(t,{RY:()=>i,iD:()=>a,Tb:()=>s,ec:()=>c});var r=n(744564),o=n(457493);function i(e){o.Z.queryDirectory(e,(function(t,n){null==t&&null!=n&&r.Z.dispatch({type:"INSTALLATION_LOCATION_ADD",path:e,metadata:n})}))}function a(e){r.Z.dispatch({type:"INSTALLATION_LOCATION_REMOVE",path:e})}function s(e,t){var n=t.label,o=t.isDefault;r.Z.dispatch({type:"INSTALLATION_LOCATION_UPDATE",path:e,label:n,isDefault:o})}function c(e){var t={},n=0,i=!0,a=!1,s=void 0;try{for(var c,l=function(){var i=c.value;if(null==i||"string"!=typeof i)return"continue";o.Z.queryDirectory(i,(function(o,a){++n;null==o&&null!=a&&(t[i]=a);n===e.length&&r.Z.dispatch({ type:"INSTALLATION_LOCATION_FETCH_METADATA",metadataPayload:t})}))},u=e[Symbol.iterator]();!(i=(c=u.next()).done);i=!0)l()}catch(e){a=!0;s=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw s}}}},577357:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(744564),o=n(703790),i=n(945514),a=n(823530);function s(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){s(i,r,o,a,c,"next",e)}function c(e){s(i,r,o,a,c,"throw",e)}a(void 0)}))}}var l=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1, r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]1&&void 0!==arguments[1]?arguments[1]:null;r.Z.dispatch({type:"INTEGRATION_SETTINGS_SET_SECTION",section:e,sectionId:t})},startEditingCommandPermissions:function(e){ r.Z.dispatch({type:"INTEGRATION_SETTINGS_START_EDITING_COMMAND",commandId:e})},stopEditingCommandPermissions:function(e){r.Z.dispatch({type:"INTEGRATION_SETTINGS_STOP_EDITING_COMMAND",commandId:e})},startEditingIntegration:function(e){r.Z.dispatch({type:"INTEGRATION_SETTINGS_START_EDITING_INTEGRATION",integrationId:e})},stopEditingIntegration:function(){r.Z.dispatch({type:"INTEGRATION_SETTINGS_STOP_EDITING_INTEGRATION"})},updateIntegration:function(e){r.Z.dispatch({type:"INTEGRATION_SETTINGS_UPDATE_INTEGRATION",settings:e})},startEditingWebhook:function(e){r.Z.dispatch({type:"INTEGRATION_SETTINGS_START_EDITING_WEBHOOK",webhookId:e})},stopEditingWebhook:function(){r.Z.dispatch({type:"INTEGRATION_SETTINGS_STOP_EDITING_WEBHOOK"})},updateWebhook:function(e){r.Z.dispatch({type:"INTEGRATION_SETTINGS_UPDATE_WEBHOOK",settings:e})},saveApplicationPermissions:function(e,t,n){return c((function(){var o;return l(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);r.Z.dispatch({ type:"INTEGRATION_SETTINGS_SUBMITTING"});return[4,i.U3({applicationId:e,commandId:e,defaultEveryoneValue:!0,defaultEverywhereValue:!0,guildId:t,permissions:n})];case 1:a.sent();r.Z.dispatch({type:"INTEGRATION_SETTINGS_SAVE_SUCCESS"});return[3,3];case 2:o=a.sent();r.Z.dispatch({type:"INTEGRATION_SETTINGS_SAVE_FAILURE",errors:o.body});return[3,3];case 3:return[2]}}))}))()},saveIntegration:function(e,t){return c((function(){var n;return l(this,(function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);r.Z.dispatch({type:"INTEGRATION_SETTINGS_SUBMITTING"});return[4,o.Z.updateIntegration(e,t.id,t.expire_behavior,t.expire_grace_period,t.enable_emoticons)];case 1:i.sent();r.Z.dispatch({type:"INTEGRATION_SETTINGS_SAVE_SUCCESS"});return[3,3];case 2:n=i.sent();r.Z.dispatch({type:"INTEGRATION_SETTINGS_SAVE_FAILURE",errors:n.body});return[3,3];case 3:return[2]}}))}))()},saveWebhook:function(e,t){return c((function(){var n;return l(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3]) ;r.Z.dispatch({type:"INTEGRATION_SETTINGS_SUBMITTING"});return[4,a.Z.update(e,t.id,t)];case 1:o.sent();r.Z.dispatch({type:"INTEGRATION_SETTINGS_SAVE_SUCCESS"});return[3,3];case 2:n=o.sent();r.Z.dispatch({type:"INTEGRATION_SETTINGS_SAVE_FAILURE",errors:n.body});return[3,3];case 3:return[2]}}))}))()}}},731503:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(744564);const o={addKeybind:function(e){r.Z.dispatch({type:"KEYBINDS_ADD_KEYBIND",keybind:e})},setKeybind:function(e){r.Z.dispatch({type:"KEYBINDS_SET_KEYBIND",keybind:e})},deleteKeybind:function(e){r.Z.dispatch({type:"KEYBINDS_DELETE_KEYBIND",id:e})},enableAll:function(e){r.Z.dispatch({type:"KEYBINDS_ENABLE_ALL_KEYBINDS",enable:e})}}},314620:(e,t,n)=>{"use strict";n.d(t,{b8:()=>f,GR:()=>p,ul:()=>E});var r=n(281110),o=n(744564),i=n(200892),a=n(534681),s=n(2590);function c(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function l(e){return function(){var t=this,n=arguments ;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){c(i,r,o,a,s,"next",e)}function s(e){c(i,r,o,a,s,"throw",e)}a(void 0)}))}}var u=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";n.d(t,{N:()=>f});var r=n(281110),o=n(744564),i=n(575136),a=n(2590);function s(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){s(i,r,o,a,c,"next",e)}function c(e){s(i,r,o,a,c,"throw",e)}a(void 0)}))}}var l=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){ return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";n.d(t,{Z:()=>d});var r=n(281110),o=n(744564),i=n(694444),a=n(196810),s=n(2590),c=n(473708);function l(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}var u=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1, r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";n.d(t,{Z:()=>o});var r=n(744564);const o={setEnabled:function(e){this.update({enabled:e})},update:function(e){var t=!0,n=!1,o=void 0 ;try{for(var i,a=Object.keys(e)[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var s=i.value;r.Z.dispatch({type:"STREAMER_MODE_UPDATE",key:s,value:e[s]})}}catch(e){n=!0;o=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw o}}}}},517716:(e,t,n)=>{"use strict";n.d(t,{Wt:()=>E,mc:()=>m,q$:()=>b});var r=n(744564),o=n(582762),i=n(451936),a=n(959207),s=n(661123),c=n(585622),l=n(875700),u=n(314620),f=n(2590);function d(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function p(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){d(i,r,o,a,s,"next",e)}function s(e){d(i,r,o,a,s,"throw",e)}a(void 0)}))}}var h=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){ return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";n.d(t,{W:()=>s});var r=n(281110),o=n(744564),i=n(239734),a=n(2590);function s(){ var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(i.Z.needsRefresh()){o.Z.dispatch({type:"LOAD_USER_AFFINITIES"});return r.Z.get({url:a.ANM.USER_AFFINITIES,retries:e?3:0,oldFormErrors:!0}).then((function(e){var t=e.body;o.Z.dispatch({type:"LOAD_USER_AFFINITIES_SUCCESS",affinities:t})}),(function(){o.Z.dispatch({type:"LOAD_USER_AFFINITIES_FAILURE"})}))}return Promise.resolve()}},823530:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(496486),o=n.n(r),i=n(281110),a=n(744564),s=n(2590),c=["Spidey Bot","Captain Hook"];const l={fetchForGuild:function(e){a.Z.dispatch({type:"WEBHOOKS_FETCHING",guildId:e});i.Z.get({url:s.ANM.GUILD_WEBHOOKS(e),oldFormErrors:!0}).then((function(t){var n=t.body;return a.Z.dispatch({type:"WEBHOOKS_UPDATE",guildId:e,webhooks:n})})).catch((function(t){var n=t.body;a.Z.dispatch({type:"WEBHOOKS_UPDATE",guildId:e,error:n.message})}))},fetchForChannel:function(e,t){a.Z.dispatch({type:"WEBHOOKS_FETCHING",guildId:e,channelId:t});i.Z.get({ url:s.ANM.CHANNEL_WEBHOOKS(t),oldFormErrors:!0}).then((function(n){var r=n.body;return a.Z.dispatch({type:"WEBHOOKS_UPDATE",guildId:e,channelId:t,webhooks:r})}))},create:function(e,t,n){null==n&&(n=c[o().random(0,c.length-1)]);return i.Z.post({url:s.ANM.CHANNEL_WEBHOOKS(t),body:{name:n},oldFormErrors:!0}).then((function(t){var n=t.body;a.Z.dispatch({type:"WEBHOOK_CREATE",guildId:e,webhook:n});return n}))},delete:function(e,t){return i.Z.delete({url:s.ANM.WEBHOOK(t),oldFormErrors:!0}).then((function(){a.Z.dispatch({type:"WEBHOOK_DELETE",guildId:e,webhookId:t})}))},update:function(e,t,n){return i.Z.patch({url:s.ANM.WEBHOOK(t),body:n,oldFormErrors:!0}).then((function(t){var n=t.body;a.Z.dispatch({type:"WEBHOOK_UPDATE",guildId:e,webhook:n});return n}))}}},946767:(e,t,n)=>{"use strict";n.d(t,{_:()=>x,Z:()=>K}) ;var r=n(785893),o=n(667294),i=n(496486),a=n.n(i),s=n(202351),c=n(539519),l=n(513328),u=n(707961),f=n(656645),d=n(736097),p=n(563367),h=n(294184),E=n.n(h),y=n(336194),m=n(421281),b=n(633878);function g(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function O(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function v(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){ var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function _(e){var t=e.width,n=void 0===t?80:t,o=e.height,i=void 0===o?20:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=v(e,["width","height","color","foreground"]);return(0,r.jsxs)("svg",O(function(e){for(var t=1;t{"use strict";n.r(t);n.d(t,{default:()=>Sfe});var r=n(785893),o=n(667294),i=n(517563),a=n(751615),s=n(202351),c=n(707961),l=n(84441),u=n(61541),f=n(327499),d=n(842629),p=n(517716),h=n(734691),E=n(316878),y=n(945235),m=n(173242),b=n(93191),g=n(391186),O=n(744564),v=n(961337),_=n(301928),I=n(979197),S=n(61209),T=n(50433),N=n(992625),A=n(563367),C=n(715107),P=n(464187),j=n(407561),R=n(258104),x=n(283133),M=n(2590);function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D(e){D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return D(e)}function Z(e,t){return!t||"object"!==k(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function L(e,t){ L=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return L(e,t)}var U,k=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function G(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=D(e);if(t){var o=D(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Z(this,n)}}function B(){var e=A.Z.getChannelId(),t=R.ZP.getSelfEmbeddedActivityForChannel(null!=e?e:""),n=S.Z.getChannel(e);return null==e||null==n||null==t?function(){var e=U;if(null!=e&&N.Z.isOpen(e)){O.Z.wait((function(){return v.xv(e)}));U=null}}():function(e,t){if(N.Z.isOpen(t))return!1;O.Z.wait((function(){return v.bA(t,M.NYg.EMBED_IFRAME,{channel:e})}));U=t}(n,(0,x.Z)(n.id,t.application_id))} function H(){var e,t=T.Z.hasLayers(),n=I.Z.getWindowOpen(M.KJ3.CHANNEL_CALL_POPOUT);return t&&!n?void(null!=(e=U)&&N.Z.isOpen(e)&&O.Z.wait((function(){return v.Cp(e)}))):function(){var e=U;null!=e&&N.Z.isOpen(e)&&O.Z.wait((function(){return v.$Z(e)}))}()}var V=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&L(e,t)}(n,e);var t=G(n);function n(){w(this,n);return t.apply(this,arguments)}var r=n.prototype;r._initialize=function(){C.Z.addChangeListener(B);P.Z.addChangeListener(B);A.Z.addChangeListener(B);j.Z.addChangeListener(B);I.Z.addChangeListener(B);R.ZP.addChangeListener(B);T.Z.addChangeListener(H)};r._terminate=function(){C.Z.removeChangeListener(B);P.Z.removeChangeListener(B);A.Z.removeChangeListener(B);j.Z.removeChangeListener(B);I.Z.removeChangeListener(B);R.ZP.removeChangeListener(B) ;T.Z.removeChangeListener(H)};r.__getLocalVars=function(){return{openEmbedId:U}};return n}(_.Z);const F=new V;var Y=n(473903),z=n(189041),W=n(999357),K=n(784426),q=n(443812),X=n(348592),Q=n(473708),$=n(982629),J=n.n($);function ee(){(0,z.qV)();(0,K.uL)(M.Z5c.LOGIN)}function te(e){var t=e.underageMessage,o=e.transitionState,i=(0,q.Dt)();return(0,r.jsxs)(c.Y0X,{transitionState:o,size:c.CgR.SMALL,"aria-labelledby":i,impressionName:W.zs.USER_AGE_GATE_UNDERAGE,impressionProperties:{existing_user:!0},children:[(0,r.jsx)(c.hzk,{children:(0,r.jsxs)("div",{className:J().container,children:[(0,r.jsx)("img",{alt:"",src:n(697694),className:J().img}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:J().title,id:i,children:Q.Z.Messages.AGE_GATE_UNDERAGE_EXISTING_HEADER}),(0,r.jsx)(c.xvT,{color:"header-secondary",className:J().subtitle,variant:"text-sm/normal",children:Q.Z.Messages.AGE_GATE_UNDERAGE_BODY.format({ underageMessage:null!=t?t:Q.Z.Messages.AGE_GATE_UNDERAGE_BODY_DEFAULT_REG_MESSAGE,helpURL:X.Z.getArticleURL(M.BhN.AGE_GATE)})}),(0,r.jsx)(c.xvT,{color:"header-secondary",className:J().subtitle,variant:"text-sm/normal",children:Q.Z.Messages.AGE_GATE_UNDERAGE_EXISTING_BODY_DELETION_WITH_DAYS.format({days:30})})]})}),(0,r.jsx)(c.mzw,{children:(0,r.jsx)(c.zxk,{size:c.PhG.SMALL,fullWidth:!0,onClick:ee,children:Q.Z.Messages.AGE_GATE_UNDERAGE_BACK_TO_LOGIN})})]})}var ne=n(938385),re=n.n(ne);function oe(e){var t=e.transitionState,o=(0,q.Dt)();return(0,r.jsxs)(c.Y0X,{transitionState:t,size:c.CgR.SMALL,"aria-labelledby":o,impressionName:W.zs.USER_AGE_GATE,impressionProperties:{existing_user:!0},children:[(0,r.jsx)(c.hzk,{children:(0,r.jsxs)("div",{className:re().container,children:[(0,r.jsx)("img",{alt:"",src:n(145911),className:re().img}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:re().title,id:o,children:Q.Z.Messages.AGE_GATE_AGE_VERIFIED}),(0,r.jsx)(c.xvT,{ color:"header-secondary",className:re().subtitle,variant:"text-sm/normal",children:Q.Z.Messages.AGE_GATE_AGE_VERIFIED_BODY})]})}),(0,r.jsx)(c.mzw,{children:(0,r.jsx)(c.zxk,{size:c.PhG.SMALL,fullWidth:!0,onClick:function(){(0,z.qV)()},autoFocus:!0,children:Q.Z.Messages.CLOSE})})]})}var ie=n(561210);function ae(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function se(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ae(i,r,o,a,s,"next",e)}function s(e){ae(i,r,o,a,s,"throw",e)}a(void 0)}))}}function ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function le(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function ue(e){ue=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return ue(e)}function fe(e){ for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?null==xe&&(xe=setTimeout((function(){Ue(!0)}),t)):Ue(!1)}}function Ze(){(0,ve.lj)();if(null!=Re){clearInterval(Re);Re=null}if(null!=xe){clearTimeout(xe);xe=null}}function Le(){Ge(0);De()} function Ue(e){if(null==Re){ke(e);Re=setInterval((function(){ke(!1)}),9e5)}}function ke(e){var t=(0,ve.R_)(e);Ie.default.track(M.rMx.CLIENT_HEARTBEAT,{client_heartbeat_initialization_timestamp:t.initialized,client_heartbeat_version:5});Ge(Date.now())}function Ge(e){Me=e;_e.Z.set(je,e)}var Be=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Ae(e,t)}(n,e);var t=Pe(n);function n(){Se(this,n);var e;(e=t.apply(this,arguments)).connectionState=null;e.focusedOrForegrounded=!0;e.shouldTrackHeartbeat=function(){return e.focusedOrForegrounded||null!=e.connectionState&&e.connectionState!==M.hes.DISCONNECTED&&e.connectionState!==M.hes.RTC_DISCONNECTED};e.scheduleHeartbeatTracking=function(){e.shouldTrackHeartbeat()?De():Ze()};e.handleLogin=function(){Le()};e.handleRTCStateChange=function(){var t=A.Z.getState() ;if(e.connectionState!==t){e.connectionState=t;we.log("RTC Connection Changed",t);e.scheduleHeartbeatTracking()}};e.handleWindowFocus=function(t){var n=t.focused;e.focusedOrForegrounded=n;e.scheduleHeartbeatTracking()};e.handleAppStateUpdate=function(t){var n=t.state;e.focusedOrForegrounded=n===M.$7l.ACTIVE;e.scheduleHeartbeatTracking()};return e}var r=n.prototype;r._initialize=function(){A.Z.addChangeListener(this.handleRTCStateChange);O.Z.subscribe("WINDOW_FOCUS",this.handleWindowFocus);O.Z.subscribe("APP_STATE_UPDATE",this.handleAppStateUpdate);O.Z.subscribe("LOGIN_SUCCESS",this.handleLogin);De()};r._terminate=function(){A.Z.removeChangeListener(this.handleRTCStateChange);O.Z.unsubscribe("WINDOW_FOCUS",this.handleWindowFocus);O.Z.unsubscribe("APP_STATE_UPDATE",this.handleAppStateUpdate);O.Z.unsubscribe("LOGIN_SUCCESS",this.handleLogin);Ze()};r.__getLocalVars=function(){return{HEARTBEAT_VERSION:5,HEARTBEAT_FREQUENCY_MINS:15,LATEST_HEARTBEAT_EVENT_TIMESTAMP:je,heartbeatIntervalId:Re, heartbeatTimeoutId:xe,lastHeartbeatEventTimestamp:Me,logger:we}};return n}(_.Z);const He=new Be;var Ve=n(61200),Fe=n(656645),Ye=n(736097),ze=n(671723),We=n(901654),Ke=n(36256);function qe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xe(e){Xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Xe(e)}function Qe(e,t){return!t||"object"!==Je(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function $e(e,t){$e=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return $e(e,t)}var Je=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function et(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{ Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Xe(e);if(t){var o=Xe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Qe(this,n)}}var tt=new Set,nt=new Set,rt=null;function ot(){var e=!0,t=!1,n=void 0;try{for(var r,o=tt[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;Fe.Z.setDisableLocalVideo(i,!1,Ke.Yn.DEFAULT,!1)}}catch(e){t=!0;n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}nt.clear();tt.clear()}var it=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&$e(e,t)}(n,e);var t=et(n);function n(){qe(this,n);var e;(e=t.apply(this,arguments)).handleWindowFocus=function(e){e.focused&&ot()};e.handleVoiceChannelSelect=function(e){var t=e.channelId ;if(t!==rt){ot();rt=t}};e.handlePopoutChange=function(){I.Z.getWindowFocused(M.KJ3.CHANNEL_CALL_POPOUT)&&ot()};return e}var r=n.prototype;r._initialize=function(){O.Z.subscribe("RTC_CONNECTION_VIDEO",this.handleIncomingVideo);O.Z.subscribe("AUDIO_SET_LOCAL_VIDEO_DISABLED",this.handleManualLocalVideoToggle);O.Z.subscribe("WINDOW_FOCUS",this.handleWindowFocus);O.Z.subscribe("VOICE_CHANNEL_SELECT",this.handleVoiceChannelSelect);I.Z.addChangeListener(this.handlePopoutChange)};r._terminate=function(){O.Z.unsubscribe("RTC_CONNECTION_VIDEO",this.handleIncomingVideo);O.Z.unsubscribe("AUDIO_SET_LOCAL_VIDEO_DISABLED",this.handleManualLocalVideoToggle);O.Z.unsubscribe("WINDOW_FOCUS",this.handleWindowFocus);O.Z.unsubscribe("VOICE_CHANNEL_SELECT",this.handleVoiceChannelSelect);I.Z.removeChangeListener(this.handlePopoutChange);ot();rt=null};r.handleIncomingVideo=function(e){var t=e.userId,n=e.context,r=e.streamId;if(n===Ke.Yn.DEFAULT&&null!=r){ var o=null!=ze.ZP.getCurrentGame(),i=We.Z.isFocused(),a=I.Z.getWindowFocused(M.KJ3.CHANNEL_CALL_POPOUT),s=Ye.Z.isLocalVideoDisabled(t,n),c=nt.has(t);if(o&&!i&&!a&&!s&&!c){tt.add(t);Fe.Z.setDisableLocalVideo(t,!0,n,!1)}}};r.handleManualLocalVideoToggle=function(e){var t=e.userId;if(e.persist){nt.add(t);tt.delete(t)}};r.__getLocalVars=function(){return{tempVideoMutes:tt,manualOverrides:nt,currentVoiceChannelId:rt}};return n}(_.Z);const at=new it;var st=n(64234),ct=n(769321),lt=n(473419),ut=n(72725),ft=n(846531),dt=n(413804);function pt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ht(e){ht=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return ht(e)}function Et(e,t){return!t||"object"!==mt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function yt(e,t){ yt=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return yt(e,t)}var mt=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function bt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=ht(e);if(t){var o=ht(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Et(this,n)}}var gt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&yt(e,t)}(n,e);var t=bt(n);function n(){pt(this,n);var e;(e=t.apply(this,arguments))._updateBackgroundGradientPresetId=function(t){ if(e._currentBackgroundGradientPresetId!==t)if(null!=t){(0,ut.zO)(t);e._currentBackgroundGradientPresetId=t}else{(0,ut.xs)();e._currentBackgroundGradientPresetId=void 0}};e._updateBackgroundGradientAngle=function(t){if(e._currentBackgroundGradientAngle!==t)if(null!=t){(0,ut.X9)(t);e._currentBackgroundGradientPresetId=t}else{(0,ut.Bf)();e._currentBackgroundGradientAngle=void 0}};e._updateClientTheme=function(){if(ft.W.getCurrentConfig({}).hasClientThemes){var t=ct.L1.getSetting(),n=t.backgroundGradientPresetId,r=t.backgroundGradientAngle;if(null==n||dt.qt[n].theme===st.Z.theme){e._updateBackgroundGradientPresetId(n);e._updateBackgroundGradientAngle(r)}else e._resetClientTheme()}else e._resetClientTheme()};return e}var r=n.prototype;r._initialize=function(){lt.Z.addChangeListener(this._updateClientTheme);st.Z.addChangeListener(this._updateClientTheme);ft.W.subscribe({},this._updateClientTheme)};r._terminate=function(){lt.Z.removeChangeListener(this._updateClientTheme) ;st.Z.removeChangeListener(this._updateClientTheme)};r._resetClientTheme=function(){(0,ut.xs)();(0,ut.Bf)();this._currentBackgroundGradientPresetId=void 0;this._currentBackgroundGradientAngle=void 0};r.__getLocalVars=function(){return{}};return n}(_.Z);const Ot=new gt;function vt(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function _t(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){vt(i,r,o,a,s,"next",e)}function s(e){vt(i,r,o,a,s,"throw",e)}a(void 0)}))}}function It(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function St(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Tt(e){Tt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Tt(e)}function Nt(e,t){ return!t||"object"!==Ct(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function At(e,t){At=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return At(e,t)}var Ct=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Pt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Tt(e);if(t){var o=Tt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Nt(this,n)}}var jt=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)}, "function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=200},An=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&_n(e,t)}(o,e);var t=Sn(o);function o(){mn(this,o);return t.apply(this,arguments)}var i=o.prototype;i._initialize=function(){O.Z.subscribe("CHANNEL_SELECT",this.handleChannelSelect)};i._terminate=function(){O.Z.unsubscribe("CHANNEL_SELECT",this.handleChannelSelect)};i.handleChannelSelect=function(e){var t=e.guildId;if(null!=t){if(Nn(t)){(0,pn.qz)();(0, un.kk)(ln.z$.FORUM_CHANNEL_UPSELL_MODAL);(0,c.ZDy)(yn((function(){var e,o;return Tn(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(74562)]).then(n.bind(n,274562))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,On(function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:hn.L.DISMISS;(0,un.EW)(ln.z$.FORUM_CHANNEL_UPSELL_MODAL,{dismissAction:e})}(t);e.onClose()},guildId:t,shouldUpsellCreation:!0}))}]}}))})),{onCloseCallback:function(){return(0,un.EW)(ln.z$.FORUM_CHANNEL_UPSELL_MODAL,{dismissAction:hn.L.DISMISS})},onCloseRequest:M.VqG})}}};i.__getLocalVars=function(){ return{MINIMUM_MEMBER_COUNT_FOR_UPSELL:200,isEligibleForForumChannelUpsell:Nn}};return o}(_.Z);const Cn=new An;var Pn=n(875700),jn=n(296602),Rn=n(959207),xn={};function Mn(e){var t=e.name,n=e.hash,r=e.missingData;Rn.Z.markGameReported(t);var o=!0,i=!1,a=void 0;try{for(var s,c=r[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var l=s.value;if("icon"===l){var u=xn[t];null!=u&&Pn.Z.uploadIcon(t,n,u);return}new jn.Z("GameStoreIconManager").log("Could not find missing data key: ".concat(l))}}catch(e){i=!0;a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}}function wn(e){var t=e.gameName,n=e.icon;xn[t]=n}const Dn=function(){O.Z.subscribe("UNVERIFIED_GAME_UPDATE",Mn);O.Z.subscribe("GAME_ICON_UPDATE",wn)};var Zn=n(314620),Ln=n(761814);function Un(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kn(e){kn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return kn(e)}function Gn(e,t){ return!t||"object"!==Hn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Bn(e,t){Bn=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Bn(e,t)}var Hn=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Vn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=kn(e);if(t){var o=kn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Gn(this,n)}}var Fn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{ value:e,writable:!0,configurable:!0}});t&&Bn(e,t)}(n,e);var t=Vn(n);function n(){Un(this,n);var e;(e=t.apply(this,arguments)).handleConnectionOpen=function(){Ln.Z.fetched||(0,Zn.b8)();Pn.Z.getDetectableGames()};return e}var r=n.prototype;r._initialize=function(){O.Z.subscribe("CONNECTION_OPEN",this.handleConnectionOpen)};r._terminate=function(){O.Z.unsubscribe("CONNECTION_OPEN",this.handleConnectionOpen)};r.__getLocalVars=function(){return{}};return n}(_.Z);const Yn=new Fn;var zn=n(964283),Wn=n(944751);function Kn(e){!function(e){var t=Wn.Z.launchableGames[e],n=Rn.Z.getGame(e);(null!=n?zn.Z.isLaunchable(n):zn.Z.isGameLaunchable(e)).then((function(n){n!==t&&O.Z.dispatch({type:"GAME_LAUNCHABLE_UPDATE",gameId:e,isLaunchable:n})}))}(e.gameId)}const qn=function(){O.Z.subscribe("CHECK_LAUNCHABLE_GAME",Kn)};var Xn=n(325213);const Qn=function(){Ln.Z.whenInitialized((function(){null!=Xn.Z.testModeApplicationId&&(0,p.Wt)(Xn.Z.testModeApplicationId,Xn.Z.testModeOriginURL)}))} ;var $n=n(951442),Jn=n(736818),er=n(499542);function tr(){if((0,er.Q)()){var e=Jn.default.getToken(),t=Jn.default.getId();if(null==e)throw new Error("missing user token");$n.S1(e,t)}}function nr(){$n.ob()}const rr=function(){O.Z.subscribe("CONNECTION_OPEN",tr);O.Z.subscribe("LOGOUT",nr)};var or=n(44700),ir=n(224813),ar=n(426307);function sr(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function cr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){sr(i,r,o,a,s,"next",e)}function s(e){sr(i,r,o,a,s,"throw",e)}a(void 0)}))}}var lr=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{ if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&void 0!==arguments[0])||arguments[0];if(!(0,xr.Z)(Ye.Z))return!1;if(null!=Pr.Z.getCurrentUserActiveStream())return!1;var t=(0,Mr.Z)(ze.ZP,jr.Z);if(null==t)return!1;if(t.isLauncher&&!e)return!1;var n=C.Z.getVoiceChannelId(),r=S.Z.getChannel(n);if(null==r)return!1;var o=r.getGuildId();if(!(0,Rr.JL)(r,Zt.Z,dn.Z,!1))return!1;(0,Tr.WH)(o,r.id,{ pid:t.pid})}()},keyEvents:{keyup:!0,keydown:!1}}),Hr(zr,M.kg4.TOGGLE_STREAMER_MODE,{onTrigger:function(){Nr.Z.setEnabled(!Lr.Z.enabled)},keyEvents:{keyup:!0,keydown:!1}}),Hr(zr,M.kg4.NAVIGATE_BACK,{onTrigger:function(){return(0,K.op)()},keyEvents:{keyup:!0,keydown:!1,focused:!0,blurred:!1}}),Hr(zr,M.kg4.NAVIGATE_FORWARD,{onTrigger:function(){return(0,K.eH)()},keyEvents:{keyup:!0,keydown:!1,focused:!0,blurred:!1}}),Hr(zr,M.kg4.SOUNDBOARD,{onTrigger:function(){if(qr()){var e=(0,Gr.Z)();null!=e&&(kr.Z.isUILocked(e)?(0,Zr.IN)(!0,e):(0,Zr.oZ)(e))}},keyEvents:{keyup:!0,keydown:!1}}),Hr(zr,M.kg4.SOUNDBOARD_HOLD,{onTrigger:function(e){if(qr()){var t=(0,Gr.Z)();null==t||(e?(0,Zr.IN)(!1,t):(0,Zr.oZ)(t))}},keyEvents:{keyup:!0,keydown:!0}}),Hr(zr,M.kg4.SAVE_CLIP,{onTrigger:function(){(0,Ar.C1)()},keyEvents:{keyup:!1,keydown:!0}}),zr),Qr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") ;e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Yr(e,t)}(n,e);var t=Kr(n);function n(){Br(this,n);return t.apply(this,arguments)}var r=n.prototype;r._initialize=function(){O.Z.wait((function(){return O.Z.dispatch({type:"KEYBINDS_REGISTER_GLOBAL_KEYBIND_ACTIONS",keybinds:Xr})}))};r._terminate=function(){};r.__getLocalVars=function(){return{KEYBINDS:Xr}};return n}(_.Z);const $r=new Qr;var Jr=n(668403);const eo=function(){O.Z.dispatch({type:"MOBILE_WEB_SIDEBAR_CLOSE"})},to=function(){O.Z.dispatch({type:"MOBILE_WEB_SIDEBAR_OPEN"})};var no=n(289283);function ro(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oo(e){oo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return oo(e)}function io(e,t){return!t||"object"!==so(t)&&"function"!=typeof t?function(e){ if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ao(e,t){ao=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return ao(e,t)}var so=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function co(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=oo(e);if(t){var o=oo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return io(this,n)}}var lo=!1;var uo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&ao(e,t)}(n,e) ;var t=co(n);function n(){ro(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getIsOpen=function(){return!no.tq||lo};r.__getLocalVars=function(){return{isSidebarOpen:lo}};return n}(s.ZP.Store);uo.displayName="MobileWebSidebarStore";const fo=new uo(O.Z,{MOBILE_WEB_SIDEBAR_OPEN:function(){lo=!0},MOBILE_WEB_SIDEBAR_CLOSE:function(){lo=!1}});var po=n(226613),ho=n(102921),Eo=new Date("06/16/2020");var yo=n(852626),mo=n(276985),bo=n(415879),go=n(135750),Oo=n(102909),vo=n(837067),_o=n(72580),Io=n(88415),So=n(239527),To=n(936323),No=n(199790),Ao=n(571680);function Co(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]Eo.getTime()&&!a.isClaimed()&&null==a.nsfwAllowed;!function(e){var t=function(){po.H();bo.Z.flowStep(Ao.MK.ANY,Ao.EW.NUF_COMPLETE,!0)};Uo(e).reverse().forEach((function(e){var n=t;t=function(){e.predicate()?e.open(n):n()}}));t()}([{key:"Unified NUF Modal",open:function(e){return u.apply(this,arguments)},predicate:function(){return s()&&!No.a}},{key:"New User Age Gate",open:yo.i,predicate:function(){return l&&!s()&&!No.a}},{key:"Claim Account Modal",open:function(e){return yo.j(Lt.FB,e)},predicate:function(){var e;return!t&&null!=Y.default.getCurrentUser()&&!(null===(e=Y.default.getCurrentUser())||void 0===e?void 0:e.isClaimed())&&!No.a}},{key:"Verification Gate with Claim Account",open:function(e){return(0,mo.hk)(o,null!=e?e:void 0)},predicate:function(){var e;return t&&!(null===(e=Y.default.getCurrentUser())||void 0===e?void 0:e.isClaimed())&&!No.a}},{key:"Guild Welcome Modal",open:function(e){return(0, c.ZDy)(jo((function(){var e,t;return Ho(this,(function(i){switch(i.label){case 0:return[4,n.e(5496).then(n.bind(n,705496))];case 1:e=i.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Do(wo({},e),{guildId:o}))}]}}))})),{onCloseCallback:e})},predicate:function(){return null!=o&&null!=Oo.Z.get(o)&&Oo.Z.get(o)!==Oo.a}}])}function u(){u=jo((function(e){var t;return Ho(this,(function(o){switch(o.label){case 0:t=function(e){switch(e){case To.F.AGE_GATE:bo.Z.flowStep(Ao.MK.ANY,Ao.EW.AGE_GATE);break;case To.F.CHOOSE_TEMPLATE:bo.Z.flowStep(Ao.MK.ANY,Ao.X2.GUILD_TEMPLATES);break;case To.F.CUSTOMIZE_GUILD:bo.Z.flowStep(Ao.MK.ANY,Ao.X2.GUILD_CREATE);break;case To.F.CHANNEL_PROMPT:bo.Z.flowStep(Ao.MK.ANY,Ao.X2.CHANNEL_PROMPT);break;case To.F.JOIN_GUILD:bo.Z.flowStep(Ao.MK.ANY,Ao.X2.JOIN_GUILD);break;case To.F.CREATION_INTENT:bo.Z.flowStep(Ao.MK.ANY,Ao.X2.CREATION_INTENT);break;case To.F.COMPLETE:bo.Z.flowStep(Ao.MK.ANY,Ao.X2.SUCCESS);break;case null:break;default:_o.vE(e)}};return[4,(0, c.ZDy)(jo((function(){var e,o;return Ho(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(95599),n.e(20995),n.e(12671)]).then(n.bind(n,412671))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,Do(wo({},e),{onSlideChange:t}))}]}}))})),{onCloseRequest:M.dG4,onCloseCallback:e,modalKey:Bo})];case 1:Bo=o.sent();return[2]}}))}));return u.apply(this,arguments)}};i.__getLocalVars=function(){return{nufModalKey:Bo}};return o}(_.Z);const Yo=new Fo;var zo=n(998330),Wo=n(896971),Ko=n(494425),qo=n(785085),Xo=n(44616);function Qo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $o(e){$o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return $o(e)}function Jo(e,t){return!t||"object"!==ti(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ei(e,t){ ei=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return ei(e,t)}var ti=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function ni(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=$o(e);if(t){var o=$o(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Jo(this,n)}}var ri=new Set,oi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&ei(e,t)}(n,e);var t=ni(n);function n(){Qo(this,n);var e;(e=t.apply(this,arguments)).handleSettingsUpdate=function(e){var t=e.settings ;t.enabled?(0,zo.T)(Ko.hn.ENABLE_POGGERMODE):!1===t.enabled&&(0,zo.T)(Ko.hn.DISABLE_POGGERMODE);Object.keys(t).some((function(e){return e.startsWith("confetti")}))&&(0,zo.T)(Ko.hn.CUSTOMIZE_CONFETTI)};e.handleMessageCreate=function(e){var t=e.channelId,n=e.message,r=n.author,o=n.nonce,i=n.mentions;if(!qo.Z.isEnabled())return!1;var a=Jn.default.getId();null!=(null==i?void 0:i.find((function(e){return e.id===a})))?(0,zo.T)(Ko.hn.PING_ME):i.length>0&&(null==r?void 0:r.id)===a&&(0,zo.T)(Ko.hn.PING_SOMEONE);if(!(0,Xo.wU)(r.id,a,o,ri))return!1;var s=Xo.ZP.getMostRecentMessageCombo(t),c=(null!=s?s:{}).combo;if(null==c)return!1;Object.values(Ko.hn).forEach((function(e){var t=e;if(null==Wo.Z.getUnlocked(t)){var n=(0,Ko.oX)(t),r=null==n?void 0:n.checkUnlock;null!=r&&!1!==r(c)&&(0,zo.T)(t)}}))};return e}var r=n.prototype;r._initialize=function(){O.Z.subscribe("MESSAGE_CREATE",this.handleMessageCreate);O.Z.subscribe("POGGERMODE_SETTINGS_UPDATE",this.handleSettingsUpdate)};r._terminate=function(){ O.Z.unsubscribe("MESSAGE_CREATE",this.handleMessageCreate);O.Z.unsubscribe("POGGERMODE_SETTINGS_UPDATE",this.handleSettingsUpdate)};r.__getLocalVars=function(){return{trackedMessageNonces:ri}};return n}(_.Z);const ii=new oi;var ai=n(530991);function si(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ci(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function li(e){li=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return li(e)}function ui(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){ Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function fi(e,t){return!t||"object"!==pi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function di(e,t){di=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return di(e,t)}var pi=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function hi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=li(e);if(t){var o=li(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return fi(this,n)}}var Ei=function(e){!function(e,t){ if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&di(e,t)}(n,e);var t=hi(n);function n(){si(this,n);return t.apply(this,arguments)}var o=n.prototype;o._initialize=function(){O.Z.subscribe("POGGERMODE_TEMPORARILY_DISABLED",this.handlePoggermodeTemporarilyDisabled)};o._terminate=function(){O.Z.unsubscribe("POGGERMODE_TEMPORARILY_DISABLED",this.handlePoggermodeTemporarilyDisabled)};o.handlePoggermodeTemporarilyDisabled=function(){(0,c.h7j)((function(e){return(0,r.jsx)(c.sm4,ui(function(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){ var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Ps(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ns(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ns(e,t)}(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.")}()}const js=(As(Is={},M.Etm.GET_CHANNEL,{scope:M.xVR.RPC,handler:function(e){var t=e.args.channel_id,n=e.socket,r=S.Z.getChannel(t);if(null==r)throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid channel id: ".concat(t));return(0,ts.T5)(r,(0,ts.zM)(r,n.application.id,n.authorization.scopes))}}),As(Is,M.Etm.GET_CHANNELS,{scope:M.xVR.RPC,handler:function(e){var t=e.args.guild_id,n=Wa().values(S.Z.loadAllGuildAndPrivateChannelsFromDisk());if(t){var r=Zt.Z.getGuild(t);if(null==r)throw new ds.Z(M.lTL.INVALID_GUILD,"Invalid guild id: ".concat(t));n=n.filter((function(e){return e.guild_id===r.id}))}return{channels:n.filter((function(e){return dn.Z.can(M.Plq.VIEW_CHANNEL,e)})).map((function(e){return{id:e.id,name:e.name,type:e.type}}))}}}),As(Is,M.Etm.SELECT_VOICE_CHANNEL,{scope:M.xVR.RPC,validation:function(e){ return e.object().required().keys({channel_id:e.string().allow(null),timeout:e.number().min(0).max(60),force:e.boolean()})},handler:function(e){var t=e.server,n=e.socket,r=e.args,o=r.channel_id,i=r.timeout,a=void 0===i?0:i,s=r.force,c=void 0!==s&&s;if(!o){d.default.selectVoiceChannel(null);return null}var l=C.Z.getVoiceChannelId();if(null!=l&&l!==o&&!1===c)throw new ds.Z(M.lTL.SELECT_VOICE_FORCE_REQUIRED,"User is already joined to a voice channel.");return t.storeWait(n,(function(){return S.Z.getChannel(o)}),a).catch((function(){throw new ds.Z(M.lTL.SELECT_CHANNEL_TIMED_OUT,"Request to select voice channel timed out.")})).then((function(e){if(null==e)throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid channel id: ".concat(o));if(!(0,Ss.vd)(e.type))throw new ds.Z(M.lTL.INVALID_CHANNEL,"Channel is not a voice channel");return Promise.all([Promise.resolve(e),(0,ts.T5)(e,(0,ts.zM)(e,n.application.id,n.authorization.scopes))])})).then((function(e){var t=Ps(e,2),n=t[0],r=t[1];if(r.guild_id){if((0, Ts.rY)(n,j.Z,Zt.Z))throw new ds.Z(M.lTL.INVALID_CHANNEL,"Channel is full");if(!dn.Z.can(M.Plq.CONNECT,n))throw new ds.Z(M.lTL.INVALID_PERMISSIONS,"Connect permission required to join channel")}d.default.selectVoiceChannel(n.id);return r}))}}),As(Is,M.Etm.GET_SELECTED_VOICE_CHANNEL,{scope:As({},M.Gp_.ANY,[M.xVR.RPC,M.xVR.RPC_VOICE_READ]),handler:function(e){var t=e.socket,n=C.Z.getVoiceChannelId(),r=null!=n?S.Z.getChannel(n):null;return null!=r?(0,ts.T5)(r,(0,ts.zM)(r,t.application.id,t.authorization.scopes)):null}}),As(Is,M.Etm.SELECT_TEXT_CHANNEL,{scope:M.xVR.RPC,validation:function(e){return e.object().required().keys({channel_id:e.string().allow(null),timeout:e.number().min(0).max(60)})},handler:function(e){var t=e.server,n=e.socket,r=e.args,o=r.channel_id,i=r.timeout,a=void 0===i?0:i;if(!o){(0,K.uL)(M.Z5c.ME);return null}return t.storeWait(n,(function(){return S.Z.getChannel(o)}),a).catch((function(){ throw new ds.Z(M.lTL.SELECT_CHANNEL_TIMED_OUT,"Request to select text channel timed out.")})).then((function(e){if(null==e)throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid channel id: ".concat(o));if(!(0,Ss.Qm)(e.type))throw new ds.Z(M.lTL.INVALID_CHANNEL,"Channel is not a text channel");return Promise.all([Promise.resolve(e),(0,ts.T5)(e,(0,ts.zM)(e,n.application.id,n.authorization.scopes))])})).then((function(e){var t=Ps(e,2),n=t[0],r=t[1];if(r.guild_id&&!dn.Z.can(M.Plq.VIEW_CHANNEL,n))throw new ds.Z(M.lTL.INVALID_CHANNEL,"No permission to see channel");r.guild_id?(0,K.dL)(M.Z5c.CHANNEL(r.guild_id,n.id)):d.default.selectPrivateChannel(n.id);return r}))}}),As(Is,M.Etm.CREATE_CHANNEL_INVITE,{scope:M.xVR.RPC,handler:function(e){var t=e.args.channel_id,n=Cs(e.args,["channel_id"]);return ir.Z.createInvite(t,n,"RPC").catch((function(){throw new ds.Z(M.lTL.INVALID_PERMISSIONS,"Unable to generate an invite for ".concat(t,". Does this user have permissions?"))}))}}),Is);const Rs=function(e,t,n){ t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},M.Etm.SET_CONFIG,{scope:M.wEG,validation:function(e){return e.object().required().keys({use_interactive_pip:e.boolean()})},handler:function(e){var t=e.socket,n=e.args.use_interactive_pip;if(t.transport!==M.Hej.POST_MESSAGE)throw new ds.Z(M.lTL.INVALID_COMMAND,'command not available from "'.concat(t.transport," transport"));if(null==t.application.id)throw new ds.Z(M.lTL.INVALID_COMMAND,"invalid application");O.Z.dispatch({type:"EMBEDDED_ACTIVITY_SET_CONFIG",applicationId:t.application.id,config:{useInteractivePIP:n}});return Promise.resolve({use_interactive_pip:n})}});function xs(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var Ms;const ws=(xs(Ms={},M.Etm.GET_GUILD,{scope:M.xVR.RPC,validation:function(e){return e.object().required().keys({guild_id:e.string(),timeout:e.number().min(0).max(60)})},handler:function(e){ var t=e.socket,n=e.server,r=e.args,o=r.guild_id,i=r.timeout,a=void 0===i?0:i;return n.storeWait(t,(function(){return Zt.Z.getGuild(o)}),a).catch((function(){throw new ds.Z(M.lTL.GET_GUILD_TIMED_OUT,"Request to get guild timed out.")})).then((function(e){if(null==e)throw new ds.Z(M.lTL.INVALID_GUILD,"Invalid guild id: ".concat(o));var t;return{id:e.id,name:e.name,icon_url:null!==(t=e.getIconURL(128))&&void 0!==t?t:null,members:[],vanity_url_code:e.vanityURLCode}}))}}),xs(Ms,M.Etm.GET_GUILDS,{scope:M.xVR.RPC,handler:function(){var e=Zt.Z.getGuilds();return{guilds:Wa().map(e,(function(e){return{id:e.id,name:e.name,icon_url:e.getIconURL(128)}}))}}}),Ms);var Ds=n(775173),Zs=n(347117);const Ls=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},M.Etm.GET_IMAGE,{scope:M.lHf,validation:function(e){return e.object().required().keys({type:e.string().required().valid(["user"]),id:e.string().required(), format:e.string().required().valid(["png","webp","jpg"]),size:e.number().required().valid([16,32,64,128,256,512,1024])})},handler:function(e){var t,n=e.args,r=n.type,o=n.id,i=n.format,a=void 0===i?"png":i,s=n.size,c=void 0===s?128:s;if("user"===r){var l=Y.default.getUser(o);if(null==l)throw new ds.Z(M.lTL.INVALID_USER,"Invalid user id: ".concat(o));t=Ds.ZP.getUserAvatarURL(l,!1,c,a);var u=window.GLOBAL_ENV.CDN_HOST;null!=u&&-1!==t.indexOf(u)&&(t+="&_=")}if(null==t)throw new ds.Z(M.lTL.INVALID_COMMAND,"No valid type.");return fetch(t).then((function(e){return e.blob()})).then((function(e){return(0,Zs.fD)(e)})).then((function(e){return{data_url:e}}))}});var Us=n(247162),ks=n(688271);const Gs=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},M.Etm.OPEN_EXTERNAL_LINK,{validation:function(e){return e.object().required().keys({url:e.string().required()})},handler:function(e){var t=e.socket,n=e.args.url;(0, ts.bu)(t.transport);try{var r=new URL(n);Lt.FB&&Us.Z.focus(null,!0);(0,ks.q)({href:r.toString()})}catch(e){throw new ds.Z(M.lTL.INVALID_COMMAND,"Invalid URL: ".concat(n))}}});function Bs(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Hs(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(i.flags=c);delete i.instance;null===(t=i.party)||void 0===t||delete t.privacy ;var l,u=i.assets,f=i.party,d=i.secrets,p=i.timestamps,h=i.buttons,E=i.type;(null==E||E!==M.IIU.PLAYING&&!s)&&(i.type=M.IIU.PLAYING);if(null!=d){var y=Wa().values(d).filter((function(e){return!!e}));if(null!=f&&Wa().intersection(y,[f.id]).length>0&&!_c.includes(n.application.id))throw new ds.Z(M.lTL.INVALID_ACTIVITY_SECRET,"secrets cannot match the party id");if(Wa().uniq(y).length2&&(p[I]=Math.floor(1e3*p[I]))}}catch(e){b=!0;g=e}finally{try{m||null==_.return||_.return()}finally{if(b)throw g}}} if(null==u)l=Promise.resolve([]);else{if(null==n.application||null==n.application.id)throw new Error;l=(0,bc.GR)(n.application.id,[u.large_image,u.small_image])}return l.then((function(e){var t=vc(e,2),r=t[0],s=t[1];if(null!=u){null!=r?u.large_image=r:delete u.large_image;null!=s?u.small_image=s:delete u.small_image}if(a()){O.Z.dispatch({type:"LOCAL_ACTIVITY_UPDATE",socketId:n.id,pid:o,activity:i});var c=i.secrets,l=i.party,f={application_id:n.application.id,type:i.type};if(null!=c){f.has_match_secret=!!c.match;f.has_join_secret=!!c.join}null!=u&&(f.has_images=!(!u.large_image&&!u.small_image));if(null!=l){f.party_max=null!=l.size?l.size[1]:void 0;f.party_id=l.id}Ie.default.track(M.rMx.ACTIVITY_UPDATED,f);return i}}))}});const Sc=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},hc.Et.SET_ORIENTATION_LOCK_STATE,{validation:function(e){return e.object().required().keys({ lock_state:e.number().valid(rs.xK.UNLOCKED,rs.xK.PORTRAIT,rs.xK.LANDSCAPE).required(),picture_in_picture_lock_state:e.number().valid(rs.xK.UNLOCKED,rs.xK.PORTRAIT,rs.xK.LANDSCAPE).allow(null).optional()})},handler:function(e){var t=e.socket,n=e.args,r=n.lock_state,o=n.picture_in_picture_lock_state,i=t.application.id;if(null==i)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");O.Z.dispatch({type:"EMBEDDED_ACTIVITY_SET_ORIENTATION_LOCK_STATE",applicationId:i,lockState:r,pictureInPictureLockState:o})}});var Tc=n(595138),Nc=n(315804),Ac=n(810274),Cc=n(151017);function Pc(e){if(M.Hej.IPC!==e&&M.Hej.POST_MESSAGE!==e)throw new ds.Z(M.lTL.INVALID_COMMAND,"Invalid transport.")}function jc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0})):Array.isArray(u)&&(y=u) ;if(null==Y.default.getCurrentUser())throw new ds.Z(M.lTL.OAUTH2_ERROR,"Client is not logged in");I.label=1;case 1:I.trys.push([1,3,,4]);return[4,(0,Il.Ww)({clientId:r,scopes:y,responseType:i,redirectUri:a,codeChallenge:s,codeChallengeMethod:c,state:l})];case 2:m=I.sent();return[3,4];case 3:b=I.sent();g=b.body;throw new ds.Z(M.lTL.OAUTH2_ERROR,"OAuth2 Authorization Error: ".concat(g.message||"Unknown Error"));case 4:if(h!==Sl.s.NONE||null==m||!m.authorized)return[3,8];I.label=5;case 5:I.trys.push([5,7,,8]);return[4,(0,Il.Iq)({authorize:!0,clientId:r,scopes:y,responseType:i,redirectUri:a,codeChallenge:s,codeChallengeMethod:c,state:l})];case 6:return[2,I.sent().location];case 7:O=I.sent();v=O.body;throw new ds.Z(M.lTL.OAUTH2_ERROR,"OAuth2 Authorize Error: ".concat(v.message||"Unknown Error"));case 8:null==n||n(m.application);_=Tl.ZP.NONE;try{_=_l.Z.deserialize(null!=f?f:0)}catch(e){}return[2,t(r,m,y,_,i,a,s,c,l,d,p,h,E)]}}))}));return Zl.apply(this,arguments)}function Ll(e,t){ if(e.authorization.accessToken)throw new ds.Z(M.lTL.INVALID_COMMAND,"Already authenticated");if(e.authorization.authing)throw new ds.Z(M.lTL.INVALID_COMMAND,"Already authenticating");e.authorization.authing=!0;return cs.Z.get({url:M.ANM.OAUTH2_CURRENT_AUTH,headers:{Authorization:"Bearer ".concat(t)},oldFormErrors:!0}).then((function(n){e.authorization.authing=!1;var r=n.body,o=r.application,i=r.user,a=r.scopes,s=r.expires;if(e.application.id!==o.id)throw new ds.Z(M.lTL.INVALID_CLIENTID,"Application does not match the connection's");var c=Y.default.getCurrentUser();if(null==c||!i||c.id!==i.id)throw new ds.Z(M.lTL.INVALID_TOKEN,"Token does not match current user");e.authorization.scopes=xl(e.authorization.scopes).concat(xl(a),[M.wEG]);e.authorization.accessToken=t;e.authorization.expires=new Date(s);O.Z.dispatch({type:"RPC_APP_AUTHENTICATED",socketId:e.id,application:e.application});return Rl(jl({},n.body),{access_token:t})}),(function(){ throw new ds.Z(M.lTL.INVALID_TOKEN,"Invalid access token: ".concat(t))})).catch((function(t){e.authorization.authing=!1;throw t}))}function Ul(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function kl(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}const Gl=function(e,t){var n;return Pl(n={},M.Etm.AUTHENTICATE,{handler:function(n){var r=n.socket,o=n.args.access_token;if(null==o&&r.transport===M.Hej.IPC){var i=r.application.id;if(null==i)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");var a=M.xVR.IDENTIFY,s=function(){ return Dl({client_id:i,scope:a,response_type:"token"},e,t).then((function(e){if(null==e)throw new ds.Z(M.lTL.UNKNOWN_ERROR,"Unknown error occurred");var t=e.split(/#|\?/),n=vl.parse(t[t.length-1]);if(null!=n.error){var o;throw new ds.Z(M.lTL.OAUTH2_ERROR,"OAuth2 Error: ".concat(n.error,": ").concat(null!==(o=n.error_description)&&void 0!==o?o:"unknown error"))}!function(e,t,n,r){var o,i=null!==(o=_e.Z.get(wl))&&void 0!==o?o:{};i[e]={accessToken:t,scope:n,expires:Date.now()+r};_e.Z.set(wl,i)}(i,n.access_token,n.scope,n.expires_in);return Ll(r,n.access_token)}))};o=function(e,t){var n=_e.Z.get(wl);if(null!=n&&null!=n[e]){var r=n[e];if(!(r.scope!==t||r.expires<=Date.now()))return r.accessToken;delete n[e];_e.Z.set(wl,n)}}(i,a);return null!=o?Ll(r,o).catch((function(){!function(e){var t,n=null!==(t=_e.Z.get(wl))&&void 0!==t?t:{};delete n[e];_e.Z.set(wl,n)}(i);return s()})):s()}if(null==o)throw new ds.Z(M.lTL.INVALID_TOKEN,"No access token provided");return Ll(r,o)}}),Pl(n,M.Etm.AUTHORIZE,{ handler:function(n){var r=n.socket,o=n.args,i=o.client_id;if(!i)throw new ds.Z(M.lTL.INVALID_CLIENTID,"No client id provided");if(null!=r.authorization.accessToken)throw new ds.Z(M.lTL.INVALID_COMMAND,"Already authenticated");if(r.authorization.authing)throw new ds.Z(M.lTL.INVALID_COMMAND,"Already authing");r.authorization.authing=!0;return cs.Z.get({url:M.ANM.APPLICATION_RPC(i),oldFormErrors:!0}).then((function(n){var i=n.body;if(r.application.id!==i.id)throw new ds.Z(M.lTL.INVALID_CLIENTID,"Application does not match the connection's");var a=o.scopes||o.scope;delete o.scopes;return Dl(Rl(jl({},o),{scope:a}),e,t)}),(function(){throw new ds.Z(M.lTL.INVALID_CLIENTID,"Invalid client id: ".concat(i))})).then((function(e){r.authorization.authing=!1;if(null==e)throw new ds.Z(M.lTL.UNKNOWN_ERROR,"Unknown error occurred");var t=vl.parse(e.split("?")[1].split("#")[0]);if(null!=t.error){var n ;throw new ds.Z(M.lTL.OAUTH2_ERROR,"OAuth2 Error: ".concat(t.error,": ").concat(null!==(n=t.error_description)&&void 0!==n?n:"unknown error"))}return{code:t.code}})).catch((function(e){r.authorization.authing=!1;throw e}))}}),n}((function(e,t,n,o,i,a,s,l,u,f,d,p,h){var E="OAuth2Authorize_".concat(e,"_").concat(f,"_").concat(d);return new Promise((function(y){var m=function(e){y(e)};(0,c.h7j)((function(c){return(0,r.jsx)(Ol.OAuth2AuthorizeModal,kl(function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]2&&void 0!==arguments[2]&&arguments[2];s.emit("disconnect",e,o?void 0:t);e.close(t.code,null!==(n=t.message)&&void 0!==n?n:"Unknown");var i=eu(null!==(r=Array.from(ou.entries()).find((function(t){var n=eu(t,2);n[0];return n[1]===e})))&&void 0!==r?r:[null,null],1),a=i[0];null!=a&&ou.delete(a)};s.handleIFrameMount=function(e){var t=e.id;iu.add(t);s.handshakeFailureTimeoutId=setTimeout((function(){Array.from(R.ZP.getSelfEmbeddedActivities().entries()).forEach((function(e){var t=eu(e,2),n=t[0],r=t[1];Ie.default.track(M.rMx.ACTIVITY_HANDSHAKE_TIMED_OUT,{application_id:n,channel_id:r.channelId,guild_id:r.guildId,timeout_ms:1e4})}))}),1e4)} ;s.handleIFrameUnmount=function(e){var t,n=e.id;iu.delete(n);var r=eu(null!==(t=Array.from(ou.entries()).find((function(e){var t=eu(e,2);t[0];return t[1].frameId===n})))&&void 0!==t?t:[null,null],2),o=r[0],i=r[1];if(null!=i&&null!=o){s.disconnectSocket(i,{code:M.$VG.CLOSE_NORMAL,message:"iFrame gone"},!0);ou.delete(o)}};s.handleMessage=function(e,t,n){var r=ou.get(t);try{s.routeEvent(r,t,e,n)}catch(e){null!=r?s.disconnectSocket(r,{code:e.code,message:e.message},!0):au(t,{code:e.code,message:e.message},n)}};s.handleFrame=function(e,t,n){var r,o,i;if(e!==t.origin)throw new ds.Z(M.$VG.INVALID_ORIGIN,"Origin has changed");try{i="string"==typeof n?JSON.parse(n):n}catch(e){throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Payload not recognized encoding")}null===(o=(r=s).onFrameHandled)||void 0===o||o.call(r,i,s.logger,t);s.emit("request",t,i)};var c,l=Kl(s);s.handleHandshake=(c=Xl((function(e,t,r){var o,i,a,s,c,u;return ru(this,(function(f){switch(f.label){case 0: null!=l.handshakeFailureTimeoutId&&clearTimeout(l.handshakeFailureTimeoutId);return[4,n.e(54533).then(n.t.bind(n,197683,23))];case 1:o=f.sent().default;try{o.assert(t,o.object().required().keys({v:o.number().min(1).max(1).required(),encoding:o.string().equal("json").optional(),client_id:o.string().required(),frame_id:o.string().required()}))}catch(e){throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,e.message)}a=(i=t).frame_id;if(!iu.has(a)){l.logger.error("Unrecognized frame ID ".concat(a));throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Unrecognized frame ID ".concat(a))}try{s=l.createPostMessageProxySocket({origin:e,postMessageToRPCClient:r,frameId:a,version:Number(i.v),logger:l.logger,postClose:au,encoding:null!==(c=i.encoding)&&void 0!==c?c:"json"})}catch(e){l.logger.error("Error opening window socket ".concat(e));throw e}l.logger.info("Socket Opened: ".concat(s.id));f.label=2;case 2:f.trys.push([2,4,,5]);return[4,l.validateSocketClient(s,e,i.client_id)];case 3:f.sent();if(!iu.has(a)){ l.logger.error("Frame ID ".concat(a," no longer exists"));throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Unrecognized frame ID ".concat(a))}ou.set(e,s);iu.delete(a);l.emit("connect",s);l.logger.info("Socket Validated: ".concat(s.id));return[3,5];case 4:u=f.sent();l.logger.info("Socket Closed: ".concat(s.id,", ").concat(u.message));throw u;case 5:return[2]}}))})),function(e,t,n){return c.apply(this,arguments)});var u=Kl(s);s.handleClose=function(){var e=Xl((function(e,t){var r,o;return ru(this,(function(i){switch(i.label){case 0:return[4,n.e(54533).then(n.t.bind(n,197683,23))];case 1:r=i.sent().default;try{r.assert(t,r.object().required().unknown(!0).keys({code:r.number().valid(Object.values(M.$VG)).required(),message:r.string().optional()}))}catch(e){throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,e.message)}o=t;u.disconnectSocket(e,o);return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}();Yl.S.subscribe(M.CkL.IFRAME_MOUNT,s.handleIFrameMount) ;Yl.S.subscribe(M.CkL.IFRAME_UNMOUNT,s.handleIFrameUnmount);s.validateSocketClient=e;s.logger=o;s.createPostMessageProxySocket=i;s.onFrameHandled=a;return s}r.prototype.routeEvent=function(e,t,n,r){if(!Array.isArray(n))throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Protocol error");var o=eu(n,2),i=o[0],a=o[1];switch(i){case zl.Z.HANDSHAKE:if(null!=e)throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Already connected");return this.handleHandshake(t,a,r);case zl.Z.FRAME:if(null==e)throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Not connected");return this.handleFrame(t,e,a);case zl.Z.CLOSE:if(null==e)throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Not connected");return this.handleClose(e,a);default:throw new ds.Z(M.$VG.CLOSE_UNSUPPORTED,"Invalid opcode")}};return r}(Fl()),cu=n(731458);function lu(e){lu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return lu(e)}function uu(e,t){return!t||"object"!==du(t)&&"function"!=typeof t?function(e){ if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function fu(e,t){fu=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return fu(e,t)}var du=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function pu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=lu(e);if(t){var o=lu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return uu(this,n)}}var hu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&fu(e,t)}(n,e);var t=pu(n) ;function n(e){var r,o=e.origin,i=e.postMessageToRPCClient,a=e.frameId,s=e.version,c=e.encoding,l=e.logger,u=e.postClose,f=e.onSendingToRPCClient;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);r=t.call(this,M.Hej.POST_MESSAGE,s,c);if(-1===["etf","json"].indexOf(c))throw new ds.Z(M.$VG.INVALID_ENCODING,"Invalid Encoding: ".concat(c));if("etf"===c)throw new ds.Z(M.$VG.INVALID_ENCODING,"Erlpack cannot be used on this client");r.origin=o;r.postMessageToRPCClient=i;r.frameId=a;r.logger=l;r.postClose=u;r.onSendingToRPCClient=f;r.closed=!1;return r}var r=n.prototype;r.send=function(e){var t;null===(t=this.onSendingToRPCClient)||void 0===t||t.call(this,e,this.id);this.postMessageToRPCClient([zl.Z.FRAME,e],this.origin)};r.close=function(e,t){this.closed||this.postClose(this.origin,{code:e,message:t},this.postMessageToRPCClient);this.closed=!0};return n}(cu.Z);const Eu=function(e){ var t=e.origin,n=e.postMessageToRPCClient,r=e.frameId,o=e.version,i=e.encoding,a=e.logger,s=e.postClose;return new hu({origin:t,postMessageToRPCClient:n,frameId:r,version:o,encoding:i,logger:a,postClose:s,onSendingToRPCClient:function(e,t){(Bl.default.isLoggingOverlayEvents||e.cmd!==M.Etm.OVERLAY&&e.evt!==M.zMe.OVERLAY)&&a.info("Socket Emit: ".concat(t),(0,Hl.Z)(e))}})};var yu=new jn.Z("RPCServer:PostMessage"),mu=function(e,t,n){(Bl.default.isLoggingOverlayEvents||e.cmd!==M.Etm.OVERLAY)&&t.info("Socket Message: ".concat(n.id),(0,Hl.Z)(e))};const bu={authCommands:Gl,voiceSettingsEvents:bl,postMessageTransport:function(){var e=new su(ml.em,yu,Eu,mu);window.addEventListener("message",(function(t){if(window!==t.source)if(null!=t.source&&null!=t.source.postMessage){var n=t.source,r=t.data,o=t.origin;e.handleMessage(r,o,(function(e,t){n.postMessage(e,t)}))}else yu.error("Unknown event source")}));return e}()};var gu=n(148834);var Ou=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n, enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},M.zMe.OVERLAY_UPDATE,{scope:M.lHf,handler:function(e){var t=e.args.pid,n=e.socket;if("number"!=typeof t||t<10)throw new ds.Z(M.lTL.INVALID_EVENT,"Invalid pid");return function(e){var r=e.prevState,o=e.dispatch,i=Ur.Z.enabled,a=!0,s=n.application.id;if(null!=s){var c=Ln.Z.getActiveLibraryApplication(s);null!=c&&(i=i&&c.isOverlayEnabled());a=Ur.Z.isInputLocked(t)}var l={enabled:i,locked:a};Wa().isEqual(l,r)||o(l);return l}}}),vu=n(57141),_u=n(846334),Iu=n(496916);function Su(e,t){return null!=e.application_id&&null==t.getApplicationActivity(e.application_id,!1)}var Tu=n(15970),Nu=n(997582),Au=n(436154),Cu=n(202181);function Pu(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function ju(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Pu(i,r,o,a,s,"next",e)}function s(e){Pu(i,r,o,a,s,"throw",e)}a(void 0)}))}} function Ru(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function xu(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var Mu,wu=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1, r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]4&&void 0!==c[4]?c[4]:"";if(null==(i=Nu.Z.getApplicationActivity(t))||null==i.secrets||!(0, ts.t9)(r,i.party,i.secrets))throw new ds.Z(M.lTL.NO_ELIGIBLE_ACTIVITY,"No eligible activity for application. Ensure an activity includes a party and appropriate secret.");if(a=Su(i,Au.Z)){s=(0,ml.s0)(e).lock;return[2,(0,_u.h7)(i,a).then((function(){s();throw new ds.Z(M.lTL.NO_ELIGIBLE_ACTIVITY,"No eligible activity for application. Ensure user does have have privacy enabled.")}))]}return[4,vu.Z.sendActivityInviteUser({userId:n,type:r,activity:i,content:o,location:"In-Game Invite"})];case 1:l.sent();return[2]}}))}));return Zu.apply(this,arguments)}const Lu=(Ru(Mu={},M.Etm.SEND_ACTIVITY_JOIN_INVITE,{scope:Ru({},M.Gp_.ANY,[M.xVR.RPC,M.lHf]),handler:function(e){var t=e.socket,n=e.args,r=n.user_id,o=n.pid,i=t.application.id;if(null==i)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");return Du(o,i,r,M.mFx.JOIN)}}),Ru(Mu,M.Etm.CLOSE_ACTIVITY_JOIN_REQUEST,{scope:Ru({},M.Gp_.ANY,[M.xVR.RPC,M.lHf]),handler:function(e){var t=e.args.user_id,n=S.Z.getDMFromUserId(t);null!=n&&(0, Iu.In)(n,!0,!0)}}),Ru(Mu,M.Etm.ACTIVITY_INVITE_USER,{scope:Ru({},M.Gp_.ANY,[M.xVR.RPC,M.lHf]),validation:function(e){return e.object().required().keys({user_id:e.string().required(),type:e.number().required().valid([M.mFx.JOIN]),content:e.string().min(0).max(1024),pid:e.number().min(0).required()})},handler:function(e){var t=e.socket,n=e.args,r=n.type,o=n.user_id,i=n.content,a=n.pid,s=t.application.id;if(null==s)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");return Du(a,s,o,r,i)}}),Ru(Mu,M.Etm.ACCEPT_ACTIVITY_INVITE,{scope:Ru({},M.Gp_.ANY,[M.xVR.RPC,M.lHf]),validation:function(e){return e.object().required().keys({type:e.number().required().valid([M.mFx.JOIN]),user_id:e.string().required(),session_id:e.string().required(),channel_id:e.string().required(),message_id:e.string().required()})},handler:function(e){var t=e.socket,n=e.args,r=n.type,o=n.user_id,i=n.session_id,a=n.channel_id,s=n.message_id,c=t.application.id ;if(null==c)throw new ds.Z(M.lTL.INVALID_COMMAND,"No application.");var l=Promise.resolve(!1);if(r===M.mFx.JOIN)l=Pn.Z.join({userId:o,sessionId:i,applicationId:c,channelId:a,messageId:s});return l.then((function(e){if(!e)throw new ds.Z(M.lTL.INVALID_INVITE,"Invite is expired or invalid.")}))}}),Ru(Mu,M.Etm.OPEN_INVITE_DIALOG,{scope:Ru({},M.Gp_.ANY,[M.xVR.RPC,M.lHf,M.wEG]),handler:function(e){var t=e.socket,o=C.Z.getVoiceChannelId(),i=S.Z.getChannel(o);if(null==i)throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid channel ".concat(o));var a=Zt.Z.getGuild(i.getGuildId());if(null==a)throw new ds.Z(M.lTL.INVALID_CHANNEL,"Invalid guild ".concat(i.getGuildId()));if(!(0,Tu.b)(dn.Z,a,i))throw new ds.Z(M.lTL.INVALID_PERMISSIONS,"No invite permissions for ".concat(o));var s=I.Z.getWindow(M.KJ3.CHANNEL_CALL_POPOUT);(null==s?void 0:s.closed)&&(s=null);var l=null!=s?M.IlC.POPOUT:M.IlC.APP;(0,Cu.Pr)({},null==s?void 0:s.document);(0,c.ZDy)(ju((function(){var e,o;return wu(this,(function(s){switch(s.label){ case 0:return[4,Promise.all([n.e(40532),n.e(45446)]).then(n.bind(n,945446))];case 1:e=s.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,xu(function(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]/g,(function(e,t){var r,o=Y.default.getUser(t);return null==o?e:null!==(r=qa.ZP.getNick(n,o.id))&&void 0!==r?r:lp.ZP.getName(o)})).replace(/<@&?(\d+)>/g,(function(e,t){var n=null!=o?o.roles[t]:null;return null!=n&&null!=n.name?n.name:Q.Z.Messages.MESSAGE_TTS_DELETED_ROLE})).replace(/<#(\d+)>/g,(function(e,t){var n=S.Z.getChannel(t);return null==n?e:(0,op.F6)(n,Y.default,Ja.Z)})).replace(//g,(function(e,t){return"".concat(Q.Z.Messages.EMOJI," ").concat(t)})).replace(/<\/([^\s]+?):(\d+)>/g,(function(e,t){return"/".concat(t)}));return null==r?Q.Z.Messages.MESSAGE_TTS.format({username:t,body:i}):Q.Z.Messages.MESSAGE_TTS_REPLY.format({username:t,body:i,replyUsername:r})}function vp(){if(!rp.Zh)return!1;var e=tl.default.locale;if(null==gp){ var t;gp=null===(t=window.speechSynthesis)||void 0===t?void 0:t.getVoices()}var n=gp.filter((function(t){return t.lang===e||t.lang.slice(0,e.length)===e}));bp=n.length>0?n[0]:null}function _p(e,t,n,r,o){return Ip.apply(this,arguments)}function Ip(){return(Ip=hp((function(e,t,n,r,o){var i;return Ep(this,(function(a){switch(a.label){case 0:if(null===(i=rp.e6(e,n)))return[2];null==bp&&vp();return t?[4,(0,up.NB)()]:[3,2];case 1:a.sent();return[3,3];case 2:null==mp||mp.removeEventListener("end",up.NB);a.label=3;case 3:i.addEventListener("end",up.NB);null!=r&&i.addEventListener("start",r);null!=o&&i.addEventListener("end",o);mp=i;rp.iq(i,bp);return[2]}}))}))).apply(this,arguments)}function Sp(e,t,n,r,o){_p(e,t,o,(function(){(0,up.Bo)(n,r)}))}function Tp(e){_p(e.text,e.interrupt,e.maxLength,e.onStart,e.onEnd)}function Np(){null!==mp&&mp.removeEventListener("end",up.NB);rp.M9();mp=null;return!0}function Ap(e){ var t,n,r,o=e.message,i=e.channel,a=o.type===M.uaV.REPLY?ip.Z.getMessageByReference(o.messageReference):null,s=(null==a?void 0:a.state)===ip.Y.LOADED?null==a||null===(t=a.message)||void 0===t?void 0:t.author:null,c=null!=s?null!==(n=qa.ZP.getNick(i.guild_id,null==s?void 0:s.id))&&void 0!==n?n:lp.ZP.getName(s):null,l=i.getGuildId(),u=null!==(r=qa.ZP.getNick(l,o.author.id))&&void 0!==r?r:lp.ZP.getName(o.author);Sp(Op(o.content,u,l,c),!0,i.id,o.id);return!0}function Cp(e){var t=e.channelId,n=e.message;if(e.optimistic||Ye.Z.isSelfDeaf())return!1;var r=S.Z.getChannel(t);if(null==r)return!1;var o=C.Z.getChannelId(),i=ap.ZP.getCurrentSidebarChannelId(o),a=t===o||t===i,s=ct.OW.getSetting()&&n.tts&&a,c=sp.Z.getTTSType(),l=n.author.id!==Jn.default.getId()&&(c===M.PrB.ALL_CHANNELS||c===M.PrB.SELECTED_CHANNEL&&a);if((s||l)&&!Ja.Z.isBlocked(n.author.id)){var u;if(yp.indexOf(n.id)>=0)return!1;yp.unshift(n.id)>10&&yp.pop();var f,d=r.getGuildId();if(null!=d&&cp.Z.getMutedChannels(d).has(t))return!1 ;var p,h=null!==(f=qa.ZP.getNick(d,n.author.id))&&void 0!==f?f:lp.ZP.getName(n.author),E=n.type===M.uaV.REPLY?null===(u=n.referenced_message)||void 0===u?void 0:u.author:null,y=null!=E?null!==(p=qa.ZP.getNick(d,null==E?void 0:E.id))&&void 0!==p?p:lp.ZP.getName(E):null;Sp(Op(n.content,h,d,y),!1,r.id,n.id,dp.f)}return!1}function Pp(e){var t=e.id,n=e.channelId,r=fp.Z.currentMessage;if(null!=r&&t===r.messageId&&n===r.channelId){(0,up.NB)();return!0}return!1}function jp(){Ye.Z.isSelfDeaf()&&rp.M9()}const Rp=function(){O.Z.subscribe("SPEAK_TEXT",Tp);O.Z.subscribe("SPEAK_MESSAGE",Ap);O.Z.subscribe("STOP_SPEAKING",Np);O.Z.subscribe("MESSAGE_CREATE",Cp);O.Z.subscribe("MESSAGE_DELETE",Pp);O.Z.subscribe("AUDIO_TOGGLE_SELF_DEAF",jp);O.Z.subscribe("USER_SETTINGS_PROTO_UPDATE",vp);O.Z.subscribe("I18N_LOAD_SUCCESS",vp)};var xp=n(762423),Mp=n(710528),wp=n(924308),Dp=n(966334);function Zp(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)} function Lp(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Zp(i,r,o,a,s,"next",e)}function s(e){Zp(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Up(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kp(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Gp(e){Gp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Gp(e)}function Bp(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0 ;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o.length>0){t.preventDefault();e.handleVerify()}};return e}var i=o.prototype;i.componentDidMount=function(){var e,t=this;return(e=function(){var e,r,o,i;return Xh(this,(function(a){switch(a.label){case 0:return[4,Promise.all([n.e(63266).then(n.t.bind(n,763266,19)),Promise.resolve().then(n.t.bind(n,211248,23))])] ;case 1:e=Wh.apply(void 0,[a.sent(),2]),r=e[0],o=e[1],i=o.default;t._animItem=i.loadAnimation({container:t._lottieRef,renderer:"svg",loop:!0,autoplay:!0,animationData:r});return[2]}}))},function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Hh(i,r,o,a,s,"next",e)}function s(e){Hh(i,r,o,a,s,"throw",e)}a(void 0)}))})()};i.componentWillUnmount=function(){this._timeout.stop();if(null!=this._animItem){this._animItem.destroy();this._animItem=void 0}};i.renderInputs=function(){var e=this.props,t=e.emailError,n=e.passwordError,o=e.submitting,i=this.state,a=i.email,s=i.password;return(0,r.jsxs)("div",{className:Uh().container,children:[(0,r.jsx)(c.xJW,{title:Q.Z.Messages.FORM_LABEL_EMAIL,className:gh().marginBottom20,children:(0,r.jsx)(c.oil,{value:a,error:t,onChange:this.handleEmailChange,onKeyPress:this.handleKeyPress,autoFocus:!0})}),(0,r.jsx)(c.xJW,{title:Q.Z.Messages.FORM_LABEL_PASSWORD,className:gh().marginBottom40,children:(0,r.jsx)(c.oil,{ type:"password",value:s,error:n,onChange:this.handlePasswordChange,onKeyPress:this.handleKeyPress})}),(0,r.jsx)(c.zxk,{fullWidth:!0,size:c.zxk.Sizes.LARGE,onClick:this.handleVerify,submitting:o,disabled:0===a.length||0===s.length,children:Q.Z.Messages.VERIFY_ACCOUNT})]})};i.renderActions=function(){var e=this.props.canChange;return(0,r.jsxs)("div",{className:Uh().container,children:[(0,r.jsx)(c.zxk,{className:gh().marginTop20,fullWidth:!0,size:c.zxk.Sizes.LARGE,look:c.iLD.INVERTED,color:c.Ttl.PRIMARY,onClick:this.handleResendEmail,children:Q.Z.Messages.RESEND_EMAIL}),e&&(0,r.jsx)(c.zxk,{className:gh().marginTop20,fullWidth:!0,size:c.zxk.Sizes.MEDIUM,look:c.iLD.LINK,color:c.Ttl.PRIMARY,onClick:this.handleChangeEmailClick,children:Q.Z.Messages.CHANGE_EMAIL})]})};i.render=function(){var e,t=this.state.resent,n=this.props,o=n.email,i=n.canResend,a=n.transitionState;e=t&&null!=o?Q.Z.Messages.VERIFY_EMAIL_BODY_RESENT.format({email:o }):i?Q.Z.Messages.VERIFY_EMAIL_BODY:Q.Z.Messages.ENTER_EMAIL_BODY;return(0,r.jsxs)(c.Y0X,{transitionState:a,"aria-labelledby":this._headerId,className:lh()(Uh().emailVerificationModal,Gh().vertical,Gh().alignCenter,Gh().justifyCenter,gh().marginTop60),children:[(0,r.jsx)("div",{className:Uh().animationContainer,ref:this.setLottieRef}),(0,r.jsx)("div",{id:this._headerId,className:lh()(Uh().title,gh().marginBottom8),children:Q.Z.Messages.VERIFY_BY_EMAIL}),(0,r.jsx)("div",{className:lh()(Uh().body,gh().marginBottom20),children:e}),i?this.renderActions():this.renderInputs()]})};return o}(o.PureComponent);Qh.defaultProps={canResend:!1,canChange:!0,onChangeEmailClick:M.dG4,onVerify:function(e,t){},onResend:M.dG4,onClose:M.dG4};const $h=Qh;function Jh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]2;return!0},cleanup:function(){}},{version:3,run:function(e){var t=s.ZP.PersistedStore.migrateAndReadStoreState("StickersPersistedStore",[function(e){return null==e||0===Object.keys(e).length?{usageHistory:{},favorites:[]}:e},function(e){if(null==e||0===Object.keys(e).length)return{usageHistory:{},favorites:[]};null==e.favorites&&(e.favorites=[]);return e}]).state;if(null==t)return!1;var n=!1;if(t.favorites.length>0){e.favoriteStickers=NE.Lt.create();e.favoriteStickers.stickerIds=Wa().uniq(t.favorites).slice(0,CE.oX);n=!0}if(Wa().size(t.usageHistory)>0){e.stickerFrecency=NE.ls.create();e.stickerFrecency.stickers=(0,AE.tU)(t.usageHistory,100);n=!0}return n},cleanup:function(){ _e.Z.remove("StickersPersistedStore")}},{version:4,run:function(e){var t=s.ZP.PersistedStore.migrateAndReadStoreState("EmojiStore",[function(){return{usageHistory:_e.Z.get("EmojiUsageHistory")||{}}}]).state;if(null==t)return!1;var n=!1;if(null!=t.favorites&&t.favorites.length>0){e.favoriteEmojis=NE.ND.create();e.favoriteEmojis.emojis=Wa().uniq(t.favorites).slice(0,CE.oX);n=!0}if(Wa().size(t.usageHistory)>0){e.emojiFrecency=NE.PL.create();e.emojiFrecency.emojis=(0,AE.tU)(t.usageHistory,100);n=!0}return n},cleanup:function(){_e.Z.remove("EmojiStore");_e.Z.remove("EmojiUsageHistory");_e.Z.remove("EmojiDiversitySurrogate")}},{version:6,run:function(e){null==e.favoriteGifs&&(e.favoriteGifs=NE.wK.create());null==e.favoriteGifs.gifs&&(e.favoriteGifs.gifs={});var t=PE(1);if(0===t.length)return!1;Wa()(e.favoriteGifs.gifs).values().sortBy("order").forEach((function(e,n){return e.order=t.length+1+n}));var n=NE.wK.toBinary(e.favoriteGifs).length,r=0,o=!0,i=!1,a=void 0;try{ for(var s,c=t[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var l=s.value,u=l.url,f=l.favorite;f.order=t.length-r;r++;if(u in e.favoriteGifs.gifs)e.favoriteGifs.gifs[u].order=f.order;else{var d=NE.JM.toBinary(f).length+u.length+7;if(!(n+d>CE.vY)){n+=d;e.favoriteGifs.gifs[u]=f}}}}catch(e){i=!0;a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}n=NE.wK.toBinary(e.favoriteGifs).length;for(;n>CE.vY;){var p=0;for(var h in e.favoriteGifs.gifs){delete e.favoriteGifs.gifs[h];if(++p>=10)break}n=NE.wK.toBinary(e.favoriteGifs).length}return!0},cleanup:function(){}},{version:7,run:function(e){var t=s.ZP.PersistedStore.migrateAndReadStoreState("ApplicationCommandFrecency",[]).state;if(null==t)return!1;var n=!1;if(Wa().size(t.usageHistory)>0){e.applicationCommandFrecency=NE.YI.create();e.applicationCommandFrecency.applicationCommands=(0,AE.tU)(t.usageHistory,500);n=!0}return n},cleanup:function(){_e.Z.remove("ApplicationCommandFrecency")}},{version:8,run:function(e){ var t=s.ZP.PersistedStore.migrateAndReadStoreState("SoundboardFavoriteStore",[]).state;if(null==t)return!1;var n=!1;if(Wa().size(t.favoriteSounds)>0){e.favoriteSoundboardSounds=NE.h_.create();Object.keys(t.favoriteSounds).forEach((function(n){new Set(t.favoriteSounds[n]).forEach((function(t){var n;null===(n=e.favoriteSoundboardSounds)||void 0===n||n.soundIds.push(t)}))}));n=!0}return n},cleanup:function(){_e.Z.remove("SoundboardFavoriteStore")}}];const RE=jE;var xE=n(970168),ME=n(256764),wE=n(169067);function DE(e,t){var n=!1;null==e.userContent&&(e.userContent={dismissedContents:new Uint8Array});null==e.userContent.dismissedContents&&(e.userContent.dismissedContents=new Uint8Array);if(!(0,ME.jl)(e.userContent.dismissedContents,t)){e.userContent.dismissedContents=(0,ME.GV)(e.userContent.dismissedContents,t);n=!0}return n}function ZE(e,t,n){return!!ld.qc.hasHiddenHotspot(t)&&DE(e,n)}var LE=[{version:2,run:function(e){var t;!function(e){e.Mentions="Recent Mentions";e.Unreads="Inbox" }(t||(t={}));if(null!=e.inbox)return!1;var n=!1,r=ln.f9.create();e.inbox=r;if(_e.Z.get("seenInboxTutorial",!1)){r.viewedTutorial=!0;n=!0}var o,i=_e.Z.get("recentsButtonTab2");if(null!=i){r.currentTab=i===t.Mentions?ln.X.MENTIONS:ln.X.UNREADS;n=!0}var a=null!==(o=_e.Z.get("unread-messages-collapsed-channels"))&&void 0!==o?o:{};for(var s in a)if(a[s]){var c=S.Z.getChannel(s);if(null!=c){n=!0;var l;(0,AE.i7)(e,null!==(l=c.guild_id)&&void 0!==l?l:"0",c.id,(function(e){e.collapsedInInbox=!0}))}}return n},cleanup:function(){_e.Z.remove("seenInboxTutorial");_e.Z.remove("recentsButtonTab2");_e.Z.remove("unread-messages-collapsed-channels")}},{version:3,run:function(e){var t=s.ZP.PersistedStore.migrateAndReadStoreState("EmojiStore",[function(){return{diversitySurrogate:_e.Z.get("EmojiDiversitySurrogate")||""}}]).state;if(null==t)return!1;var n=!1;if(null!=t.diversitySurrogate&&""!==t.diversitySurrogate){null==e.textAndImages&&(e.textAndImages=ln.Me.create()) ;null==e.textAndImages.diversitySurrogate&&(e.textAndImages.diversitySurrogate=xE.Gm.create());e.textAndImages.diversitySurrogate.value=t.diversitySurrogate;n=!0}return n},cleanup:function(){}},{version:4,run:function(e){var t=!1;(!0===_e.Z.get("HAS_SEEN_HUB_UPSELL")||ld.qc.hasHiddenHotspot(ld.v6.HUB_SECOND_EMAIL_CONNECTION_UPSELL))&&(t=DE(e,ln.z$.HUB_WAITLIST_UPSELL));return t},cleanup:function(){_e.Z.remove("HAS_SEEN_HUB_UPSELL")}},{version:5,run:function(e){var t,n,r,o,i,a,s,c=!1;e.textAndImages=null!==(t=e.textAndImages)&&void 0!==t?t:ln.Me.create();e.notifications=null!==(n=e.notifications)&&void 0!==n?n:ln.sf.create();e.privacy=null!==(r=e.privacy)&&void 0!==r?r:ln.bE.create();e.voiceAndVideo=null!==(o=e.voiceAndVideo)&&void 0!==o?o:ln.v_.create();e.gameLibrary=null!==(i=e.gameLibrary)&&void 0!==i?i:ln.Fm.create();e.debug=null!==(a=e.debug)&&void 0!==a?a:ln.tA.create();var l=null!==(s=_e.Z.get("UserSettingsStore"))&&void 0!==s?s:{};if("boolean"==typeof l.useRichChatTextBox){ e.textAndImages.useRichChatInput=xE.D5.create({value:l.useRichChatTextBox});c=!0}if("string"==typeof l.renderSpoilers){e.textAndImages.renderSpoilers=xE.Gm.create({value:l.renderSpoilers});c=!0}if("boolean"==typeof l.useThreadSidebar){e.textAndImages.useThreadSidebar=xE.D5.create({value:l.useThreadSidebar});c=!0}if("boolean"==typeof l.showInAppNotifications){e.notifications.showInAppNotifications=xE.D5.create({value:l.showInAppNotifications});c=!0}if(l.emojiPickerCollapsedSections instanceof Array){e.textAndImages.emojiPickerCollapsedSections=l.emojiPickerCollapsedSections;c=!0}if(l.stickerPickerCollapsedSections instanceof Array){e.textAndImages.stickerPickerCollapsedSections=l.stickerPickerCollapsedSections;c=!0}if("boolean"==typeof l.viewImageDescriptions){e.textAndImages.viewImageDescriptions=xE.D5.create({value:l.viewImageDescriptions});c=!0}if("boolean"==typeof l.showCommandSuggestions){e.textAndImages.showCommandSuggestions=xE.D5.create({value:l.showCommandSuggestions});c=!0} if("boolean"==typeof l.alwaysPreviewVideo){e.voiceAndVideo.alwaysPreviewVideo=xE.D5.create({value:l.alwaysPreviewVideo});c=!0}if("boolean"==typeof l.notifyFriendsOnGoLive){e.notifications.notifyFriendsOnGoLive=xE.D5.create({value:l.notifyFriendsOnGoLive});c=!0}if("boolean"==typeof l.installShortcutDesktop){e.gameLibrary.installShortcutDesktop=xE.D5.create({value:l.installShortcutDesktop});c=!0}if("boolean"==typeof l.installShortcutStartMenu){e.gameLibrary.installShortcutStartMenu=xE.D5.create({value:l.installShortcutStartMenu});c=!0}if("boolean"==typeof l.allowActivityPartyPrivacyFriends){e.privacy.allowActivityPartyPrivacyFriends=xE.D5.create({value:l.allowActivityPartyPrivacyFriends});c=!0}if("boolean"==typeof l.allowActivityPartyPrivacyVoiceChannel){e.privacy.allowActivityPartyPrivacyVoiceChannel=xE.D5.create({value:l.allowActivityPartyPrivacyVoiceChannel});c=!0}if("boolean"==typeof l.rtcPanelShowVoiceStates){e.debug.rtcPanelShowVoiceStates=xE.D5.create({ value:l.rtcPanelShowVoiceStates});c=!0}return c},cleanup:function(){}},{version:7,run:function(e){return ZE(e,ld.v6.APPLICATION_COMMAND_TOOLTIP,ln.z$.APPLICATION_COMMAND_TOOLTIP)},cleanup:function(){}},{version:8,run:function(e){return ZE(e,ld.v6.CHANNEL_BANNER_MEMBER_LIST_NOTICE,ln.z$.CHANNELINFO_CHANNELBANNER_NOTICE)},cleanup:function(){}},{version:9,run:function(e){ld.qc.hasHiddenHotspot(ld.v6.MULTI_ACCOUNT_TOOLTIP)&&_e.Z.set(wE.Ip,"true");return ZE(e,ld.v6.MULTI_ACCOUNT_TOOLTIP,ln.z$.ACCOUNT_MULTIACCOUNT_TOOLTIP)},cleanup:function(){}},{version:10,run:function(e){var t,n=ZE(e,ld.v6.HUB_LINK_CHANNEL_NOTICE,ln.z$.CHANNEL_NOTICE_HUBLINK),r=null!==(t=_e.Z.get("channelNotices"))&&void 0!==t?t:{};!1===r[M.vID.INVITE]&&DE(e,ln.z$.CHANNEL_NOTICE_INVITE)&&(n=!0);!1===r[M.vID.QUICKSWITCHER]&&DE(e,ln.z$.CHANNEL_NOTICE_QUICKSWITCHER)&&(n=!0);!1===r[M.vID.GUILD_BOOSTING]&&DE(e,ln.z$.CHANNEL_NOTICE_PREMIUM_GUILD_SUBSCRIPTION)&&(n=!0);return n},cleanup:function(){_e.Z.remove("channelNotices")}},{ version:11,run:function(e){var t=!1;ZE(e,ld.v6.GUILD_EVENT_UPSELL,ln.z$.GUILD_HEADER_EVENT_UPSELL)&&(t=!0);ZE(e,ld.v6.PREMIUM_PROGRESS_BAR_GUILD_HEADER_TOOLTIP,ln.z$.GUILD_HEADER_PREMIUM_GUILD_PROGRESS)&&(t=!0);ZE(e,ld.v6.ANIMATED_GUILD_BANNER_GUILD_HEADER_TOOLTIP,ln.z$.GUILD_HEADER_ANIMATED_GUILD_BANNER)&&(t=!0);return t},cleanup:function(){}},{version:12,run:function(e){var t=!1;_e.Z.get("hideNag")&&DE(e,ln.z$.NAGBAR_NOTICE_DOWNLOAD)&&(t=!0);_e.Z.get("hideConnectSpotify")&&DE(e,ln.z$.NAGBAR_NOTICE_CONNECT_SPOTIFY)&&(t=!0);_e.Z.get("hideConnectPlayStation")&&DE(e,ln.z$.NAGBAR_NOTICE_CONNECT_SPOTIFY)&&(t=!0);_e.Z.get("hideMFASMSNotice")&&DE(e,ln.z$.NAGBAR_NOTICE_MFA_SMS_BACKUP)&&(t=!0);return t},cleanup:function(){_e.Z.remove("hideNag");_e.Z.remove("hideConnectSpotify");_e.Z.remove("hideConnectPlayStation");_e.Z.remove("hideMFASMSNotice")}},{version:13,run:function(e){var t=!1;_e.Z.get("hidePremiumPromo")&&DE(e,ln.z$.NAGBAR_NOTICE_PREMIUM_PROMO)&&(t=!0) ;_e.Z.get("hidePremiumTier2TrialEnding")&&DE(e,ln.z$.NAGBAR_NOTICE_PREMIUM_TIER_TWO_TRIAL_ENDING)&&(t=!0);_e.Z.get("hidePremiumReactivateNotice")&&DE(e,ln.z$.NAGBAR_NOTICE_PREMIUM_REACTIVATE)&&(t=!0);ZE(e,ld.v6.INVITE_SPLASH_GUILD_HEADER_TOOLTIP,ln.z$.GUILD_HEADER_INVITE_SPLASH)&&(t=!0);return t},cleanup:function(){_e.Z.remove("hidePremiumPromo");_e.Z.remove("hidePremiumTier2TrialEnding");_e.Z.remove("hidePremiumReactivateNotice")}},{version:14,run:function(e){return ZE(e,ld.v6.ACTIVITY_BEB_TUTORIAL,ln.z$.ACTIVITIES_TUTORIAL_COACH_MARK)},cleanup:function(){}},{version:15,run:function(e){return ZE(e,ld.v6.NOW_PLAYING_CONSENT_CARD,ln.z$.NOW_PLAYING_CONSENT_CARD)},cleanup:function(){}},{version:16,run:function(e){var t=_e.Z.get("PromotionsPersistedStore");if(null==t)return!1;var n=t._state.lastDismissedOutboundPromotionStartDate;if(null!=n){null==e.userContent&&(e.userContent=ln.az.create());if(null==e.userContent.lastDismissedOutboundPromotionStartDate){ e.userContent.lastDismissedOutboundPromotionStartDate=xE.Gm.create({value:n});return!0}}return!1},cleanup:function(){}},{version:17,run:function(e){var t=s.ZP.PersistedStore.migrateAndReadStoreState("ExpressionSuggestionsPersistedStore",null).state;if(null==t)return!1;var n=t.expressionSuggestionsEnabled;if(null!=n){null==e.textAndImages&&(e.textAndImages=ln.Me.create());if(null==e.textAndImages.expressionSuggestionsEnabled){e.textAndImages.expressionSuggestionsEnabled=xE.D5.create({value:n});return!0}}return!1},cleanup:function(){_e.Z.remove("ExpressionSuggestionsPersistedStore")}},{version:18,run:function(e){var t=!1;ZE(e,ld.v6.GUILD_DELETE_FEEDBACK,ln.z$.GUILD_DELETE_FEEDBACK)&&(t=!0);ZE(e,ld.v6.GUILD_LEAVE_FEEDBACK,ln.z$.GUILD_LEAVE_FEEDBACK)&&(t=!0);return t},cleanup:function(){}},{version:19,run:function(e){var t,n=!1;null!==(t=_e.Z.get("forumHelperCardStorageKey"))&&void 0!==t&&t&&(n=DE(e,ln.z$.FORUM_CHANNEL_HELPER_CARD));return n},cleanup:function(){ _e.Z.remove("forumHelperCardStorageKey")}}];const UE=LE;var kE=n(969223),GE=n(917019);const BE=function(){kE.Z[CE.yP.PRELOADED_USER_SETTINGS]=UE;kE.Z[CE.yP.FRECENCY_AND_FAVORITES_SETTINGS]=RE;O.Z.subscribe("CONNECTION_OPEN",HE);O.Z.subscribe("USER_SETTINGS_PROTO_ENQUEUE_UPDATE",VE);O.Z.subscribe("USER_SETTINGS_PROTO_LOAD_IF_NECESSARY",FE);O.Z.subscribe("APP_STATE_UPDATE",YE)};function HE(){var e=lt.Z.getFullState(),t=e[CE.yP.PRELOADED_USER_SETTINGS];t.editInfo.triggeredMigrations&&GE.hW.markDirtyFromMigration(t.proto,t.editInfo.cleanupFuncs);Wa().forEach(GE.aj,(function(t,n){null!=e[Number(n)].editInfo.offlineEditDataVersion&&t.scheduleSaveFromOfflineEdit()}))}function VE(e){var t=e.settings,n=t.proto,r=t.type,o=e.delaySeconds,i=e.jitter;GE.aj[r].markDirty(n,{delaySeconds:o,jitter:i})}function FE(e){var t=e.settingsType;GE.aj[t].loadIfNecessary()}function YE(e){var t=e.state;"inactive"!==t&&"background"!==t||Wa().forEach(GE.aj,(function(e,t){ if(null!=lt.Z.getFullState()[Number(t)].editInfo.timeout){e.logger.log("Triggering persistChanges due to AppStateUpdate");e.persistChanges()}}))}var zE=n(721110);function WE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KE(e){KE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return KE(e)}function qE(e,t){return!t||"object"!==$E(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function XE(e,t){XE=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return XE(e,t)}var QE,$E=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function JE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{ Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=KE(e);if(t){var o=KE(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return qE(this,n)}}function ey(){var e,t=QE;if(null==t||!N.Z.isOpen(t))return!1;O.Z.wait((function(){return v.xv(t)}));null===(e=A.Z.getRTCConnection())||void 0===e||e.setPipOpen(!1);QE=null}function ty(){var e=A.Z.getChannelId(),t=QE===e;if(function(){var e=A.Z.getChannelId(),t=C.Z.getChannelId();if(!Ye.Z.supports(Ke.AN.VIDEO))return!0;if(I.Z.getWindowOpen(M.KJ3.CHANNEL_CALL_POPOUT))return!0;var n=Pr.Z.getAllActiveStreams().length>0;if(!(null!=e&&Object.values(j.Z.getVideoVoiceStatesForChannel(e)).some((function(e){var t=e.userId;return!Ye.Z.isLocalVideoDisabled(t)}))||n))return!0;var r=T.Z.hasLayers();return!(r&&T.Z.getLayers().includes(M.S9g.RTC_DEBUG)||!r&&e!==t)}())return ey();t||ey();return null!=e&&function(e){var t,n=S.Z.getChannel(e) ;if(null==n||N.Z.isOpen(e))return!1;O.Z.wait((function(){return v.bA(n.id,M.NYg.VIDEO,{channel:n})}));null===(t=A.Z.getRTCConnection())||void 0===t||t.setPipOpen(!0);QE=e}(e)}var ny=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&XE(e,t)}(n,e);var t=JE(n);function n(){WE(this,n);return t.apply(this,arguments)}var r=n.prototype;r._initialize=function(){C.Z.addChangeListener(ty);P.Z.addChangeListener(ty);A.Z.addChangeListener(ty);j.Z.addChangeListener(ty);T.Z.addChangeListener(ty);Pr.Z.addChangeListener(ty);I.Z.addChangeListener(ty);Ye.Z.addChangeListener(ty);R.ZP.addChangeListener(ty)};r._terminate=function(){C.Z.removeChangeListener(ty);P.Z.removeChangeListener(ty);A.Z.removeChangeListener(ty);j.Z.removeChangeListener(ty);T.Z.removeChangeListener(ty);Pr.Z.removeChangeListener(ty) ;I.Z.removeChangeListener(ty);Ye.Z.removeChangeListener(ty);R.ZP.removeChangeListener(ty)};r.__getLocalVars=function(){return{openChannelId:QE}};return n}(_.Z);const ry=new ny;var oy=n(595970);function iy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ay(e){ay=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return ay(e)}function sy(e,t){return!t||"object"!==ly(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function cy(e,t){cy=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return cy(e,t)}var ly=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function uy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{ Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=ay(e);if(t){var o=ay(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return sy(this,n)}}var fy=18e6,dy=new Uu.V7,py=new Uu.V7,hy=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&cy(e,t)}(n,e);var t=uy(n);function n(){iy(this,n);return t.apply(this,arguments)}var r=n.prototype;r._initialize=function(){O.Z.subscribe("IDLE",this.handleIdleUpdate)};r._terminate=function(){dy.stop();py.stop();O.Z.unsubscribe("IDLE",this.handleIdleUpdate)};r.handleIdleUpdate=function(){var e=oy.Z.getIdleSince();if(Lt.FB){dy.stop();py.stop();var t=Pr.Z.getAllActiveStreams(),n=!0,r=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){ if(i.value.state!==M.jm8.ENDED)return}}catch(e){r=!0;o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}if(null!=e){var s=A.Z.getChannelId();if(null!=s){py.start(fy,(function(){d.default.selectVoiceChannel(null)}));var c=Zt.Z.getGuild(A.Z.getGuildId());if(null!=c&&null!=c.afkChannelId&&c.afkChannelId!==s&&null!=c.afkTimeout){var l=S.Z.getChannel(s);null!=l&&(l.isGuildStageVoice()||dy.start(e+1e3*c.afkTimeout-Date.now(),(function(){null!=(c=Zt.Z.getGuild(A.Z.getGuildId()))&&null!=c.afkChannelId&&d.default.selectVoiceChannel(c.afkChannelId)})))}}}}};r.__getLocalVars=function(){return{AUTO_DISCONNECT_TIME:fy,afkTimeout:dy,autoDisconnectTimeout:py}};return n}(_.Z);const Ey=new hy;var yy=n(536038),my=n(532548),by=n(489770),gy=n(10712),Oy=n(801991),vy=n(912735);function _y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Iy(e,t){for(var n=0;n0||u.length>0)wy={};else{Wa().difference(a,i).forEach((function(e){wy[e]=ky(wy[e],e,M.QyF.INPUT)}));Wa().difference(c,s).forEach((function(e){wy[e]=ky(wy[e],e,M.QyF.OUTPUT)}))}if(!Wa().isEqual(i,a)||!Wa().isEqual(s,c)){xy=r;My=o;return!0}return!1}xy=r;My=o;Ry=!0},CONNECTED_DEVICE_SET:function(e){var t=e.displayName;!function(e,t,n){if(t===M.aVf.INPUT||t===M.aVf.INPUT_AND_OUTPUT){var r=xy[e];null!=r&&O.Z.wait((function(){return Fe.Z.setInputDevice(r,n)}))}if(t===M.aVf.OUTPUT||t===M.aVf.INPUT_AND_OUTPUT){var o=My[e];O.Z.wait((function(){return Fe.Z.setOutputDevice(o,n)}))}}(t,e.connectedDevicePreference,e.location);delete wy[t]},CONNECTED_DEVICE_IGNORE:function(e){var t=e.displayName;delete wy[t]},CONNECTED_DEVICE_NEVER_SHOW_MODAL:function(){wy={};jy={neverShowModal:!0}}});function Hy(e,t,n,r,o,i,a){try{ var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Vy(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Hy(i,r,o,a,s,"next",e)}function s(e){Hy(i,r,o,a,s,"throw",e)}a(void 0)}))}}var Fy=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys, o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0){if(em===t[0])return;if(null==(em=t[0]))return;!function(e){if(!Jy){Jy=!0;(0,c.ZDy)(Qy((function(){var t,o;return $y(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(43569)]).then(n.bind(n,43569))];case 1:t=i.sent(),o=t.default;return[2,function(t){var n=t.transitionState,i=t.onClose;return(0,r.jsx)(o,{pendingPayment:e,transitionState:n,onClose:function(){Jy=!1;return i()}})}]}}))})))}}(em)}}))};var nm=n(647136),rm=n(409125),om=n(377128),im=n(602397),am=n(716118);function sm(e,t,n){o.useEffect((function(){var r=t(),o=new s.Fh(e,(function(){var e=t(),o=n(r,e) ;null==o||sp.Z.isSoundDisabled(o)||(0,am.GN)(o,.4);r=e}));o.attach("useSound");return function(){return o.detach()}}))}function cm(){sm([Ye.Z,C.Z],(function(){return{inVoiceChannel:null!=C.Z.getVoiceChannelId(),selfMute:Ye.Z.isSelfMute(),selfDeaf:Ye.Z.isSelfDeaf(),audioPermissionReady:Ye.Z.isNativeAudioPermissionReady()}}),(function(e,t){var n=t.inVoiceChannel,r=t.selfMute,o=t.selfDeaf,i=t.audioPermissionReady;if(n){if(e.selfDeaf!==o)return o?"deafen":"undeafen";if(i&&(n||e.audioPermissionReady))return e.selfMute!==r?r?"mute":"unmute":void 0}}));return null}function lm(){sm([S.Z,A.Z,C.Z,rm.Z],(function(){var e=S.Z.getChannel(C.Z.getVoiceChannelId()),t=null==e?void 0:e.type,n=A.Z.getWasEverRtcConnected(),r=A.Z.getState();return{channelType:t,connected:r===M.hes.RTC_CONNECTED,connectHasStarted:!n&&r!==M.hes.DISCONNECTED||r===M.hes.RTC_CONNECTED,awaitingRemote:null!=rm.Z.getAwaitingRemoteSessionInfo(),connectedRemote:null!=rm.Z.getRemoteSessionId()}}),(function(e,t){ var n=t.channelType,r=t.connected,o=t.connectHasStarted,i=t.awaitingRemote,a=t.connectedRemote,s=e.channelType,c=e.connectedRemote,l=i||a,u=e.connected&&!r;if(!e.connectHasStarted&&o||a&&!c){if(null!=n&&Ss.Lr.has(n))return;return"user_join"}if(u){if(l||null!=s&&Ss.Lr.has(s))return;return"disconnect"}}));return null}function um(){sm([om.Z],(function(){return om.Z.isCurrentUserSpeaking()}),(function(e,t){if(e!==t){var n=Ye.Z.isSelfMute();if(Ye.Z.getMode()===M.pM4.PUSH_TO_TALK&&!n)return t?"ptt_start":"ptt_stop"}}));return null}function fm(){sm([Ye.Z],(function(){return Ye.Z.isSelfMutedTemporarily()}),(function(e,t){if(e!==t){var n=Ye.Z.isSelfMute();if(Ye.Z.getMode()===M.pM4.VOICE_ACTIVITY&&!n)return t?"ptt_stop":"ptt_start"}}));return null}function dm(){sm([j.Z],(function(){return j.Z.userHasBeenMovedVersion}),(function(e,t){if(e!==t)return"user_moved"}));return null}function pm(){sm([C.Z,j.Z],(function(){var e=C.Z.getVoiceChannelId();if(null==e)return Rd.xO.NONE ;var t=j.Z.getVoiceStateForChannel(e);return(0,Rd.gf)(t)}),(function(e,t){if(e!==t&&t===Rd.xO.REQUESTED_TO_SPEAK_AND_AWAITING_USER_ACK)return"reconnect"}));return null}function hm(){sm([C.Z,Pr.Z,Jn.default,j.Z,S.Z],(function(){var e,t=C.Z.getVoiceChannelId(),n=Jn.default.getId(),r=void 0,o=[],i=null,a=0,s=Pr.Z.getAllActiveStreams();if(null!=t){var c=S.Z.getChannel(t);if(null!=c){e=c.type;r=im.ZP.countVoiceStatesForChannel(c.id)-(j.Z.isInChannel(c.id)?1:0);o=Pr.Z.getAllApplicationStreamsForChannel(c.id).map((function(e){return e.ownerId}))}}var l=null;(null==(l=1===s.length?s[0]:Pr.Z.getCurrentUserActiveStream())?void 0:l.state)===M.jm8.CONNECTING&&(l=null);if(null!=l){i=(0,Cr.V9)(l);a=Pr.Z.getViewerIds(i).filter((function(e){return e!==n})).length}return{channelType:e,voiceChannelId:t,voiceChannelUserCount:r,streamingUserIds:o,singleActiveStreamKey:i,singleActiveStreamViewerCount:a,currentUserId:n,allActiveStreams:s}}),(function(e,t){ var n=t.channelType,r=t.voiceChannelId,o=t.voiceChannelUserCount,i=t.streamingUserIds,a=t.singleActiveStreamKey,s=t.singleActiveStreamViewerCount,c=t.currentUserId;if(e.voiceChannelId===r&&null!=r&&!(function(e){var t=S.Z.getChannel(e);if(null==t)return!1;var n=t.getGuildId();if(null==n)return!1;var r=Zt.Z.getGuild(n);return null!=r&&r.afkChannelId===t.id}(r)||null!=n&&Ss.Lr.has(n))){var l=null!=a&&e.singleActiveStreamKey===a,u=i.some((function(t){return!e.streamingUserIds.includes(t)})),f=e.allActiveStreams.map((function(e){return e.ownerId})),d=e.streamingUserIds.some((function(e){return!i.includes(e)&&(e===c||f.includes(e))})) ;return u?"stream_started":d?"stream_ended":e.singleActiveStreamViewerCount<=25&&l&&s>e.singleActiveStreamViewerCount?"stream_user_joined":null!=e.voiceChannelUserCount&&null!=o&&e.voiceChannelUserCount<=25&&o>e.voiceChannelUserCount?"user_join":null!=e.voiceChannelUserCount&&null!=o&&e.voiceChannelUserCount<=25&&o0};r.__getLocalVars=function(){return{INCOMING_CALL_MODAL_POSITION:Dm,DIMENSIONS:Zm,MULTIPLE_MODAL_OFFSET:10,DND_ACTIVE_CALLS:Lm,NO_INCOMING_CALLS:Um,incomingCalls:km,activeCalls:Gm,x:Bm,y:Hm,dnd:Vm}};return n}(s.ZP.Store);Wm.displayName="IncomingCallStore";const Km=new Wm(O.Z,{CALL_CREATE:Ym,CALL_UPDATE:Ym,CALL_DELETE:function(e){return Fm(e.channelId)},VOICE_CHANNEL_SELECT:function(e){return Fm(e.channelId)},INCOMING_CALL_MOVE:function(e){var t=e.x,n=e.y;Bm=t;Hm=n;_e.Z.set(Dm,{x:Bm,y:Hm});return!1},CHANNEL_DELETE:function(e){return Fm(e.channel.id)}});var qm=new Set(["Blink","Gecko","WebKit"]),Xm=M.dG4;if(Lt.FB)Xm=function(e){return ss.default.setBadge(e)};else if(qm.has(Nm().layout)){var Qm=new(Sm())({animation:"none"});Xm=function(e){try{(0,Am.PR)(e);Qm.badge(-1===e?"•":e)}catch(e){}}}function $m(e,t){ if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jm(e){Jm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Jm(e)}function eb(e,t){return!t||"object"!==nb(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function tb(e,t){tb=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return tb(e,t)}var nb=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function rb(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Jm(e);if(t){var o=Jm(this).constructor;n=Reflect.construct(r,arguments,o) }else n=r.apply(this,arguments);return eb(this,n)}}var ob=TE()({DEFAULT:null,UNREAD:null,CONNECTED:null,SPEAKING:null,MUTED:null,DEAFENED:null}),ib=(0,Lt.id)()?null:ob.DEFAULT,ab=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&tb(e,t)}(n,e);var t=rb(n);function n(){$m(this,n);var e;(e=t.apply(this,arguments)).getIcon=function(){var t=e.props,n=t.deafened,r=t.muted,o=t.speaking,i=t.connected,a=t.unread,s=ib;if((0,Lt.id)()&&!i)return s;if((0,Lt.IJ)()||!i){a&&(s=ob.UNREAD);return s}return s=n?ob.DEAFENED:r?ob.MUTED:o?ob.SPEAKING:ob.CONNECTED};return e}var r=n.prototype;r.componentDidMount=function(){ss.default.setSystemTrayIcon(this.getIcon())};r.componentDidUpdate=function(){ss.default.setSystemTrayIcon(this.getIcon())};r.componentWillUnmount=function(){ss.default.setSystemTrayIcon(ib)};r.render=function(){ return null};return n}(o.PureComponent),sb=function(){return null};if(Lt.FB){ss.default.on("SYSTEM_TRAY_TOGGLE_MUTE",(function(){return Fe.Z.toggleSelfMute()}));ss.default.on("SYSTEM_TRAY_TOGGLE_DEAFEN",(function(){return Fe.Z.toggleSelfDeaf()}));ss.default.on("SYSTEM_TRAY_OPEN_VOICE_SETTINGS",(function(){h.Z.open(M.oAB.VOICE)}));sb=s.ZP.connectStores([A.Z,Ye.Z,om.Z,Cm.Z,Ja.Z,sp.Z],(function(){var e=Cm.Z.getTotalMentionCount(),t=Cm.Z.hasAnyUnread(),n=Ja.Z.getPendingCount(),r=!sp.Z.getDisableUnreadBadge()&&!!(t||e+n>0);return{connected:A.Z.isConnected(),speaking:om.Z.isCurrentUserSpeaking(),muted:Ye.Z.isSelfMute()||Ye.Z.isSelfMutedTemporarily(),deafened:Ye.Z.isSelfDeaf(),unread:r}}))(ab)}const cb=sb;var lb=n(570814),ub=n(113512),fb=n(566706),db=n(908741),pb=n(457217),hb=n(973553),Eb=n(591821),yb=n(672380),mb=n(677681),bb=n(333568),gb=n(914964),Ob=n(971402),vb=n(764079),_b=n(341305),Ib=n(704271),Sb=n(396043),Tb=n(281808),Nb=n(347005),Ab=n(128169),Cb=n(386531),Pb=n(689175),jb=n(549511) ;function Rb(e,t){var n=(0,dE.ZP)([Zt.Z],(function(){return Zt.Z.getGuild(e)})),r=(0,dE.ZP)([S.Z],(function(){return S.Z.getChannel(t)})),o=(0,jb.a)().showOnboardingHome;return(0,dE.ZP)([Pb.Z,Cb.Z,qa.ZP],(function(){var e,t;return null!=n&&null!=r&&o&&n.hasFeature(M.oNc.GUILD_SERVER_GUIDE)&&!ms.yE(null!==(t=null===(e=qa.ZP.getSelfMember(n.id))||void 0===e?void 0:e.flags)&&void 0!==t?t:0,Ab.qQ.COMPLETED_HOME_ACTIONS)&&Cb.Z.hasMemberAction(n.id,r.id)&&!Pb.Z.hasCompletedActionForChannel(n.id,r.id)}))}var xb=n(25410),Mb=n(684412),wb=n(944522),Db=n(284610),Zb=n(747126),Lb=n(598123),Ub=n(189865),kb=n(373438),Gb=n(840484),Bb=n.n(Gb);function Hb(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Vb(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Hb(i,r,o,a,s,"next",e)}function s(e){Hb(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Fb(e,t,n){ t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Yb(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var zb=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r), 0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]y?o=72:n=72;return(0,r.jsxs)("div",{className:zg().media,children:[(0,Bg.Yi)({src:E,maxHeight:n,maxWidth:o,width:y,height:m,alt:null!=b&&f?Q.Z.Messages.SPOILER_HIDDEN_A11Y_LABEL:b,autoPlay:h,animated:p&&!f&&d,containerClassName:zg().thumbnailContainer,imageClassName:lh()(qg({},zg().spoiler,f)) }),f&&(0,r.jsx)(Vg.Z,{className:zg().spoilerTag})]})}function Qg(e){var t=e.resource,n=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(t.channelId)})),i=(0,s.e7)([Lb.Z],(function(){return Lb.Z.getMessages(t.channelId)})),a=i.first(),l=function(e){var t,n;if(null==e)return null;if((null===(t=e.content)||void 0===t?void 0:t.length)>0)return e.content;if((null===(n=e.embeds)||void 0===n?void 0:n.length)>0){var r=!0,o=!1,i=void 0;try{for(var a,s=e.embeds[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value;if(null!=c.rawDescription&&c.rawDescription.length>0)return c.rawDescription}}catch(e){o=!0;i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}}return null}(a),u=(0,Ug.zy)(a,!1),f=(null==u?void 0:u.length)>0?u[0]:null,d=null!=n&&null==i.first()&&!i.loadingMore&&!i.ready&&!i.hasFetched;o.useEffect((function(){d&&Lg.Z.fetchMessages({channelId:t.channelId,after:t.channelId,limit:5})}),[t.channelId,d]);return(0,r.jsxs)(c.P3F,{className:zg().row,onClick:function(e){ null!=n&&(e.shiftKey?(0,Nb.C3)(n.id):cd.Z.openResourceChannelAsSidebar({guildId:n.guild_id,channelId:n.id}))},children:[(0,r.jsxs)("div",{className:zg().content,children:[(0,r.jsx)(c.xvT,{className:zg().title,variant:"text-md/semibold",color:"header-primary",children:t.title}),null!=l&&(0,r.jsx)(c.xvT,{className:zg().messageContent,variant:"text-sm/normal",color:"header-secondary",lineClamp:3,children:kg.Z.parse(l)})]}),null!=f?(0,r.jsx)(Xg,{firstMedia:f,channelId:t.channelId}):null]})}function $g(e){var t=e.guild,n=e.isNewMember,o=jg(t.id);return 0===o.length?n?null:(0,r.jsxs)("div",{className:zg().emptyContainer,children:[(0,r.jsx)(c.X6q,{variant:"heading-xl/bold",color:"header-primary",children:Q.Z.Messages.MEMBER_ACTION_COMPLETE_EMPTY_STATE}),(0,r.jsx)("img",{className:zg().emptyStateImage,src:Kg(),alt:""}),(0,r.jsx)(c.zxk,{className:zg().emptyStateButton,onClick:function(){var e=Hg.ZP.getDefaultChannel(t.id);null!=e&&(0,K.uL)(M.Z5c.CHANNEL(t.id,e.id))},fullWidth:!0, children:Q.Z.Messages.MEMBER_ACTION_COMPLETE_EMPTY_STATE_CTA})]}):(0,r.jsxs)("div",{className:zg().container,children:[(0,r.jsx)(c.X6q,{variant:"heading-lg/bold",color:"header-primary",children:Q.Z.Messages.GUILD_HOME_RESOURCES}),o.map((function(e){return(0,r.jsx)(Qg,{resource:e},e.channelId)}))]})}var Jg=n(708674),eO=n(222752),tO=n(258875),nO=n.n(tO);function rO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function cO(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return rO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rO(e,t)}(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.")}()}var lO=o.memo((function(e){var t=e.guild;return(0,r.jsxs)(Og.Z,{channelId:Ig.oC.GUILD_HOME,guildId:t.id,className:lh()(xg().title,xg().background),innerClassname:xg().headerBarInner,children:[(0,r.jsx)(Og.Z.Icon,{icon:vg.Z,"aria-hidden":!0}),(0,r.jsxs)(Og.Z.Title,{children:[(0,r.jsx)(c.nn4,{ children:t.name}),Q.Z.Messages.SERVER_GUIDE]})]})}));var uO=n(730381),fO=n.n(uO),dO=n(349289),pO=n(813357),hO=n(357088),EO=n(239813),yO=n(910149);function mO(e,t){var n,r=function(n){var r=e[n],o=t[n];return r.length!==o.length?{v:!1}:r.some((function(e,t){return o[t]!==e}))?void 0:{v:!1}};if(e.length!==t.length)return!1;for(var o=0;o=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function SO(e){var t=e.width,n=void 0===t?16:t,o=e.height,i=void 0===o?16:o,a=e.color,s=void 0===a?"currentColor":a,c=IO(e,["width","height","color"]);return(0,r.jsxs)("svg",_O(function(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function CO(e){var t=e.width,n=void 0===t?16:t,o=e.height,i=void 0===o?16:o,a=e.color,s=void 0===a?"currentColor":a,c=AO(e,["width","height","color"]);return(0,r.jsxs)("svg",NO(function(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function xO(e){var t=e.width,n=void 0===t?16:t,o=e.height,i=void 0===o?16:o,a=e.color,s=void 0===a?"currentColor":a,c=RO(e,["width","height","color"]);return(0,r.jsxs)("svg",jO(function(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:[S.Z,dn.Z,Tv.Z],3),n=t[0],r=t[1],o=t[2],i=o.getActiveChannelIds(e),a=null!=i?Array.from(i):[];return a.map((function(e){return n.getChannel(e)})).filter(_o.lm).filter((function(e){if(null==e?void 0:e.hasFlag(Ig.zZ.ACTIVE_CHANNELS_REMOVED))return!1;if(!(0,Ss.Qm)(e.type))return!1 ;if(!r.can(M.Plq.VIEW_CHANNEL,e))return!1;var t=n.getChannel(e.parent_id);return!e.isThread()||null==t||!(null==t?void 0:t.hasFlag(Ig.zZ.ACTIVE_CHANNELS_REMOVED))}))},jv=function(e,t){var n,r=Cv(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[dn.Z,S.Z,im.ZP,Zt.Z],4),o=r[0],i=r[1],a=r[2],s=r[3],c=a.getVoiceStates(e),l=Object.keys(c).filter((function(e){return c[e].length>0})),u=null===(n=s.getGuild(e))||void 0===n?void 0:n.afkChannelId;return l.filter((function(e){return e!==u&&e!==(null==t?void 0:t.channel_id)})).map((function(e){return i.getChannel(e)})).filter(_o.lm).filter((function(e){return!(null==e?void 0:e.hasFlag(Ig.zZ.ACTIVE_CHANNELS_REMOVED))&&o.can(M.Plq.VIEW_CHANNEL,e)}))},Rv=n(96606),xv=n(973713),Mv=n.n(xv),wv=n(572274),Dv=n.n(wv);function Zv(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Lv(e){for(var t=1;t0}),[o.id]),d=a.lengthe.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?Q.Z.Messages.STARTING_IN_MINUTES.format({minutes:h}):Q.Z.Messages.STARTING_SOON;b="text-brand"}else null!=f&&""!==f&&(m=Q.Z.Messages.START_DATE_TO_END_DATE.format({start:u,end:f}));return(0,r.jsxs)("div",{className:lh()(y_().eventTime,(y={},b_(y,y_().isActive,a),b_(y,y_().isBrand,d||p),y)),children:[(0,r.jsx)(d_.Z,{width:O_,height:O_}),(0,r.jsxs)(c.xvT,{color:b,variant:"text-xs/normal",className:y_().eventTimeLabel,children:[m,(0,r.jsx)("span",{className:y_().separator,children:"•"})]})]})}function __(e){ var t=e.event,n=e.channel,i=e.isCollapsedSize,a=e.onEventClick,l=(0,s.e7)([dn.Z],(function(){return dn.Z.can(M.Plq.CONNECT,n)})),u=o.useCallback((function(){if(null!=n&&null!=n.getGuildId()&&l){(0,c_.Cq)(n);(0,K.XU)(n.getGuildId(),n.id)}}),[n,l]),f=(0,s_.Z)(t),d=t.entity_type===h_.WX.STAGE_INSTANCE?Q.Z.Messages.STAGE_CHANNEL_JOIN_BUTTON:Q.Z.Messages.JOIN;return null==t.image||i?null!=n&&l?(0,r.jsx)("div",{className:y_().eventJoinContainer,children:(0,r.jsx)(c.zxk,{className:y_().joinButton,onClick:u,fullWidth:!0,color:c.zxk.Colors.GREEN,children:d})}):null:null!=n&&l?(0,r.jsxs)(c.P3F,{onClick:u,className:y_().eventJoinContainer,children:[(0,r.jsx)("div",{className:y_().eventImg,style:{backgroundImage:"url(".concat(f,")")}}),(0,r.jsx)("div",{className:y_().eventImgHover,children:(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"none",className:y_().eventImgJoinButton,children:d})})]}):(0,r.jsx)(c.P3F,{onClick:a,className:y_().eventJoinContainer,children:(0,r.jsx)("div",{ className:y_().eventImg,style:{backgroundImage:"url(".concat(f,")")}})})}function I_(e){var t,n=e.event,o=e.channel,i=e.isActive,a=e.isCollapsedSize,s=(0,EO.KS)(o);return(0,r.jsxs)("div",{className:y_().eventInfo,children:[(!i||a)&&(0,r.jsx)(v_,{event:n}),(0,r.jsx)("div",{className:y_().location,children:null!=o&&null!=s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s,{width:O_,height:O_,className:y_().icon}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",className:y_().locationLabel,children:o.name})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p_.Z,{height:O_,width:O_,className:lh()(y_().channelContainer,y_().icon)}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",className:y_().locationLabel,children:o_(null!==(t=(0,i_.cS)(n))&&void 0!==t?t:void 0,!0)})]})})]})}function S_(e){var t=e.event,n=e.isInList,i=t.guild_id,a=(0,bb.Z)(eO.Gj),c=(0,Ov.xt)(t),l=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(t.channel_id)})),u=(0,s.e7)([wb.Z],(function(){return wb.Z.isLurking(i) }),[i]),f=o.useCallback((function(){Ie.default.track(M.rMx.HOME_EVENT_CLICKED,{guild_id:i,home_session_id:yv.Z.getHomeSessionId(i),guild_scheduled_event_id:t.id,is_active:c});(0,dr.bO)({eventId:t.id,parentGuildId:i})}),[t,i,c]),d=(0,s.Wu)([im.ZP],(function(){return null==l?[]:im.ZP.getVoiceStatesForChannel(l).map((function(e){return e.user}))}),[l]),p=(0,s.e7)([l_.Z],(function(){if(null!=l&&l.type===r_.d.GUILD_STAGE_VOICE)return l_.Z.getParticipantCount(null==l?void 0:l.id,u_.pV.AUDIENCE)}),[l]);return(0,r.jsx)(kv,{listItemId:n?t.id:void 0,shouldUseCollapsedLayout:!1,onClick:u?void 0:f,icon:c?(0,r.jsx)("div",{className:y_().liveNowIcon}):(0,r.jsx)(f_.Z,{width:16,height:16}),iconTooltipText:Q.Z.Messages.GUILD_HOME_EVENTS_TOOLTIP_TEXT,header:t.name,textNode:(0,r.jsx)(I_,{event:t,channel:l,isActive:c,isCollapsedSize:a}),accessoryNode:c?(0,r.jsx)(Rv.Z,{guildId:i,users:d,count:p,size:Rv.u.SIZE_16,max:3}):null,children:c&&(0,r.jsx)(__,{event:t,channel:l,isCollapsedSize:a,onEventClick:f})})} var T_=n(134658),N_=n.n(T_),A_=n(404024),C_=n.n(A_),P_=n(764728),j_=n.n(P_);function R_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){ var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function D_(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||L_(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 Z_(e){return function(e){if(Array.isArray(e))return R_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||L_(e)||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 L_(e,t){if(e){if("string"==typeof e)return R_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);return"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R_(e,t):void 0}}var U_={overflowX:void 0,overflowY:void 0};function k_(){var e="dark"===(0,Jb.ZP)()?C_():j_();return(0,r.jsxs)("div",{className:N_().emptyStateContainer,children:[(0,r.jsx)("img",{className:N_().image,src:e,width:154,height:48,alt:""}),(0,r.jsx)(c.X6q,{className:N_().title,variant:"heading-md/semibold",children:Q.Z.Messages.ACTIVE_CHANNELS_EMPTY_TITLE}),(0,r.jsx)(c.xvT,{className:N_().subtitle,color:"header-secondary",variant:"text-sm/normal",children:Q.Z.Messages.ACTIVE_CHANNELS_EMPTY_SUBTITLE})]})}function G_(e){ var t=e.isUsingCollapsedLayout,n=e.scrollerRef,o=e.handleScroll,i=e.activeChannels,a=e.totalActiveChannels,s=(0,gb.Z)("active-channels",n,{orientation:t?Iv.hy.HORIZONTAL:Iv.hy.VERTICAL});return(0,r.jsx)(pb.bG,{navigator:s,children:(0,r.jsx)(pb.SJ,{children:function(e){var s=e.ref,l=w_(e,["ref"]);return(0,r.jsxs)(c.xVE,M_(function(e){for(var t=1;t0,h=o.useRef(null),E=(0,vv.ZP)(t).filter((function(e){return!(0,Ov.xt)(e)})),y=D_(o.useState(0===E.length),2),m=y[0],b=y[1],g=D_(o.useState(!0),2),O=g[0],v=g[1],_=D_(o.useState(!1),2),I=_[0],T=_[1],N=(0,mb.Z)(),A=N.ref,C=N.width,P=o.useCallback((function(){var e=h.current;if(null!=e&&null!=C){var t=e.getScrollerState(),n=t.scrollLeft,r=t.scrollWidth;v(n<=0);T(n>=r-C-1)}}),[C]),j=o.useCallback((function(){var e=h.current;if(null!=e&&null!=C){var t=e.getScrollerState().scrollLeft,n=C+12,r=Math.max(.25*C-9,140),o=Math.ceil((t-n)/r)*r;e.scrollTo({to:Math.max(0,o),animate:!0})}}),[C]),R=o.useCallback((function(){var e=h.current ;if(null!=e&&null!=C){var t=e.getScrollerState(),n=t.scrollLeft,r=t.scrollWidth,o=C+12,i=Math.max(.25*C-9,140),a=Math.floor((n+o)/i)*i;e.scrollTo({to:Math.min(r,a),animate:!0})}}),[C]);o.useEffect((function(){Tv.Z.shouldFetch(t)&&(0,Sv.n)(t)}),[t]);!function(e,t,n){var r=(0,s.e7)([Tv.Z],(function(){var t=Tv.Z.getActiveChannelsFetchStatus(e);return null!=t&&!t.loading}),[e]);o.useEffect((function(){r&&Ie.default.track(M.rMx.ACTIVE_CHANNELS_LOADED,{guild_id:e,text_channels_shown:t.length,voice_channels_shown:n.length,home_session_id:yv.Z.getHomeSessionId(e)})}),[e,r])}(t,a,f);var x=o.useCallback((function(e){Ie.default.track(M.rMx.ACTIVE_CHANNEL_CLICKED,{guild_id:e.guild_id,channel_id:e.id,channel_type:e.type,text_channels_shown:a.length,voice_channels_shown:f.length,home_session_id:yv.Z.getHomeSessionId(e.guild_id)})}),[a,f]),w=a.map((function(e){return(0,r.jsx)(Wv,{guildId:t,channel:e,trackChannelClick:x},e.id)})),D=f.map((function(e){return(0,r.jsx)(n_,{guildId:t,channel:e, voiceStates:u[e.id],trackChannelClick:x,showPreview:!n},e.id)})),Z=[];if(n)Z=Z_(w).concat(Z_(D));else if(m)Z=za.compact([null!=l&&(0,r.jsx)(S_,{event:l,isInList:!0},"event")].concat(Z_(w.slice(0,10)),Z_(D)));else{var L=za.take(w,3-(D.length>0?1:0)-(null!=l?1:0)),U=za.take(D,3-L.length-(null!=l?1:0));Z=za.compact([null!=l&&(0,r.jsx)(S_,{event:l,isInList:!0},"event")].concat(Z_(L),Z_(U)))}return(0,r.jsx)("div",{ref:A,className:N_().container,children:(0,r.jsxs)(c.y5t,{component:(0,r.jsxs)("div",{className:N_().header,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:Q.Z.Messages.ACTIVE_CHANNELS_HEADER}),!n&&!0!==(null==i?void 0:i.loading)&&d>3&&(0,r.jsx)(c.P3F,{onClick:function(){return b(!m)},children:(0,r.jsx)(c.xvT,{className:N_().showAll,variant:"text-sm/normal",children:m?Q.Z.Messages.GUILD_HOME_SEE_LESS:Q.Z.Messages.GUILD_HOME_SEE_ALL.format({count:d})})})]}),children:[(null==i?void 0:i.loading)?(0,r.jsx)(c.xVE,{className:N_().channelList,orientation:"horizontal", paddingFix:!1,children:(0,r.jsx)(Fv,{guildId:t})}):p?(0,r.jsx)(G_,{isUsingCollapsedLayout:n,scrollerRef:h,handleScroll:P,activeChannels:Z,totalActiveChannels:d}):(0,r.jsx)(k_,{}),n&&p&&!O&&(0,r.jsx)(c.P3F,{className:lh()(N_().scrollIcon,N_().left),onClick:j,"aria-hidden":!0,children:(0,r.jsx)(Nv.Z,{direction:Nv.Z.Directions.LEFT,height:12,width:12})}),n&&p&&!I&&(0,r.jsx)(c.P3F,{className:lh()(N_().scrollIcon,N_().right),onClick:R,"aria-hidden":!0,children:(0,r.jsx)(Nv.Z,{direction:Nv.Z.Directions.RIGHT,height:12,width:12})})]})})}var H_=n(170892),V_=n(764334);function F_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Y_(e){Y_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Y_(e)}function z_(e,t){return!t||"object"!==K_(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t} function W_(e,t){W_=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return W_(e,t)}var K_=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function q_(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Y_(e);if(t){var o=Y_(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return z_(this,n)}}var X_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&W_(e,t)}(n,e);var t=q_(n);function n(){F_(this,n);return t.apply(this,arguments)}var r=n.prototype;r._initialize=function(){ O.Z.subscribe("MESSAGE_REACTION_ADD",this.handleReaction);O.Z.subscribe("MESSAGE_REACTION_REMOVE",this.handleReaction);O.Z.subscribe("SIDEBAR_VIEW_CHANNEL",this.handleSidebarViewChannel);O.Z.subscribe("MESSAGE_CREATE",this.handleMessageCreate);O.Z.subscribe("APP_STATE_UPDATE",this.handleAppStateUpdate)};r._terminate=function(){O.Z.unsubscribe("MESSAGE_REACTION_ADD",this.handleReaction);O.Z.unsubscribe("MESSAGE_REACTION_REMOVE",this.handleReaction);O.Z.unsubscribe("SIDEBAR_VIEW_CHANNEL",this.handleSidebarViewChannel);O.Z.unsubscribe("MESSAGE_CREATE",this.handleMessageCreate);O.Z.unsubscribe("APP_STATE_UPDATE",this.handleAppStateUpdate)};r.handleReaction=function(e){var t=e.type,n=e.userId,r=e.messageId,o=e.optimistic;if(n===Jn.default.getId()&&o){var i=P.Z.getGuildId();if(null!=i){var a=C.Z.getChannelId();if((0,Ig.ME)(a)){var s=Xb.ZP.getItemForMessageId(i,r);if(null!=s){var c=(0,H_.ZP)(s);(0,qb.wA)({feed_item_type:(0,V_.NH)(s.id),feed_item_id:s.id,load_id:Xb.ZP.getLoadId(i), action_type:"MESSAGE_REACTION_ADD"===t?eO.w8.REACTION_ADDED:eO.w8.REACTION_REMOVED,guild_id:i,channel_id:c.channel_id,message_id:r,home_session_id:yv.Z.getHomeSessionId(i)})}}}}};r.handleSidebarViewChannel=function(e){var t=e.channelId,n=e.baseChannelId;if(e.sidebarType===lv.t.VIEW_THREAD&&(0,Ig.ME)(n)){var r=P.Z.getGuildId();if(null!=r){var o=Xb.ZP.getItemForMessageId(r,t);null!=o&&o.type!==dO.w.FORUM_POST&&(0,qb.wA)({feed_item_type:(0,V_.NH)(o.id),feed_item_id:o.id,load_id:Xb.ZP.getLoadId(r),action_type:eO.w8.THREAD_EMBED_CLICKED,guild_id:r,channel_id:(0,yO.xp)(o),message_id:t,home_session_id:yv.Z.getHomeSessionId(r)})}}};r.handleMessageCreate=function(e){var t=e.optimistic,n=e.message;if(t&&n.state===M.yb.SENDING){var r=P.Z.getGuildId();if(null!=r){var o=ap.ZP.getSidebarState(Ig.oC.GUILD_HOME);if(null!=o&&(0,ap.D5)(o)){var i=S.Z.getChannel(o.channelId),a=(0,yO.FW)(o,i);if(null!=a){var s=Xb.ZP.getItemForMessageId(r,a);if(null!=s){var c,l;if(n.type===M.uaV.DEFAULT){ c=eO.w8.MESSAGED_IN_SIDEBAR;l=a}else if(n.type===M.uaV.REPLY){var u,f;l=null===(u=n.message_reference)||void 0===u?void 0:u.message_id;c=(null===(f=n.message_reference)||void 0===f?void 0:f.message_id)===a?eO.w8.REPLIED_TO_MESSAGE:eO.w8.REPLIED_IN_SIDEBAR}null!=c&&(0,qb.wA)({feed_item_type:(0,V_.NH)(s.id),feed_item_id:s.id,load_id:Xb.ZP.getLoadId(r),action_type:c,guild_id:r,channel_id:n.channel_id,message_id:l,home_session_id:yv.Z.getHomeSessionId(r)})}}}}}};r.handleAppStateUpdate=function(e){if("background"===e.state){var t=P.Z.getGuildId();null!=t&&Ie.default.track(M.rMx.HOME_BACKGROUNDED,{guild_id:t,home_session_id:yv.Z.getHomeSessionId(t),load_id:Xb.ZP.getLoadId(t)})}};r.__getLocalVars=function(){return{}};return n}(_.Z);const Q_=new X_;var $_=n(151154),J_=n(146358),eI=n(809784);function tI(e,t,n){for(var r=n.feedItemId,o=n.guildId,i=n.channelId,a=n.messageId,s=e.target;(0,eI.k)(s);){var c,l;if(s===t)break ;var u=null!==(l=null===(c=s.getAttribute("data-role"))||void 0===c?void 0:c.toUpperCase())&&void 0!==l?l:s.tagName;if("A"===u){(0,qb.wA)({feed_item_type:(0,V_.NH)(r),feed_item_id:r,load_id:Xb.ZP.getLoadId(o),action_type:eO.w8.LINK_CLICKED,guild_id:o,channel_id:i,message_id:a,home_session_id:yv.Z.getHomeSessionId(o)});return!0}if("IMG"===u){(0,qb.wA)({feed_item_type:(0,V_.NH)(r),feed_item_id:r,load_id:Xb.ZP.getLoadId(o),action_type:eO.w8.IMAGE_CLICKED,guild_id:o,channel_id:i,message_id:a,home_session_id:yv.Z.getHomeSessionId(o)});return!0}if("BUTTON"===u||"button"===s.getAttribute("role")){var f=eO.w8.BUTTON_CLICKED;if("view-more-replies"===s.getAttribute("data-action"))f=eO.w8.VIEW_MORE_REPLIES;(0,qb.wA)({feed_item_type:(0,V_.NH)(r),feed_item_id:r,load_id:Xb.ZP.getLoadId(o),action_type:f,guild_id:o,channel_id:i,message_id:a,home_session_id:yv.Z.getHomeSessionId(o)});return!0}s=s.parentNode}return!1}function nI(e){ var t=e.guildId,n=e.channelId,r=e.feedItemId,o=e.onChannelClick,i=e.onContentClick,a=function(e,o){e.stopPropagation();var a=Xb.ZP.getItem(t,r);if(null!=a){var s;(0,qb.wA)({feed_item_type:(0,V_.NH)(r),feed_item_id:r,load_id:Xb.ZP.getLoadId(t),action_type:eO.w8.MESSAGE_CLICKED,guild_id:t,channel_id:n,message_id:null!==(s=null==o?void 0:o.id)&&void 0!==s?s:(0,H_.ZP)(a).id,home_session_id:yv.Z.getHomeSessionId(t)});i(o)}};return{handleMessageClick:function(e,o,i){e.stopPropagation();tI(e,o,{feedItemId:r,guildId:t,channelId:n,messageId:i.id})||a(e,i)},handleChannelClick:function(e){e.stopPropagation();(0,qb.wA)({feed_item_type:(0,V_.NH)(r),feed_item_id:r,load_id:Xb.ZP.getLoadId(t),action_type:eO.w8.MESSAGE_CHANNEL_CLICKED,guild_id:t,channel_id:n,home_session_id:yv.Z.getHomeSessionId(t)});o()},handleCardClick:function(e,o){tI(e,o,{feedItemId:r,guildId:t,channelId:n})||a(e)},handleItemClick:a}} var rI=n(550131),oI=n(834876),iI=n(62994),aI=n(855395),sI=n(96812),cI=n(283285),lI=n(277600),uI=n(723876),fI=n(824803),dI=n(42028),pI=n(377557),hI=n.n(pI);function EI(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function yI(e){var t=e.message,n=e.guildId,i=e.animateAvatar,a=e.channel,s=e.author,l=(0,sI.Z)(t.id,Fg.d$),u=l.popouts,f=l.setPopout,d=u.usernameProfile,p=u.avatarProfile,h=o.useMemo((function(){return function(e){return(0,iI.Z)(e,t)}}),[t]),E=(0,aI.wq)(t.author.id,a.id),y=(0,aI.XO)(t,a,d,f),m=(0,aI.R9)(p,f),b=o.useCallback((function(){return f({usernameProfile:!1,avatarProfile:!1,referencedUsernameProfile:!1})}),[f]),g=(0,fI.F2)({props:{message:t,channel:a,author:s,guildId:n,compact:!0,displayCompactAvatars:!0,animate:i,showAvatarPopout:p,showUsernamePopout:d,onContextMenu:E,onClickUsername:y,onClickAvatar:m,onPopoutRequestClose:b},guildId:n,handleRenderPopout:h,className:hI().avatar}),O=(0,fI.xP)(e,h),v=(0, oI.XX)(t),_=(0,oI.Dv)(t),I="".concat(v," ").concat(_),S=(0,oI.Gq)(t);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(c.H,{className:hI().header,"aria-describedby":S,"aria-labelledby":I,children:[g,(0,r.jsx)("span",{id:(0,oI.XX)(t),className:hI().username,children:(0,r.jsx)(r.Fragment,{children:O})}),(0,r.jsx)(dI.Z,{id:(0,oI.Dv)(t),timestamp:t.timestamp,className:hI().timestamp})]})})}var mI=o.forwardRef((function(e,t){var n=e.message,i=e.className,a=e.onMessageClick,s=e.children,l=e.isTruncated,u=e.channel,f=e.guildId,d=e.animateAvatar,p=o.useRef(null),h=(0,cI.Z)(n,{hideSimpleEmbedContent:!0}),E=h.content,y=h.hasSpoilerEmbeds,m=(0,rI.ZP)(n),b=o.useCallback((function(e){a(e,p.current,n)}),[a,n]);return(0,r.jsxs)("div",{ref:p,className:i,onClick:b,role:"article",children:[(0,r.jsx)(c.tEY,{offset:{left:4,right:4},children:(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(yI,{author:m,message:n,channel:u,guildId:f,animateAvatar:d}),(0,r.jsx)(uI.ZP,{ className:lh()(hI().messageContent,EI({},hI().truncatedReply,l)),message:n,content:E,contentRef:t})]}),(0,lI.Z)({className:hI().accessories,channelMessageProps:e,hasSpoilerEmbeds:y,isInteracting:!1})]})}),s]})})),bI=n(720504),gI=n(677483),OI=n(754242),vI=n(384157),_I=n.n(vI),II=n(635232),SI=n.n(II),TI=n(312154),NI=n.n(TI),AI=n(22513),CI=n.n(AI),PI=n(515861),jI=n.n(PI),RI=n(568909),xI=n.n(RI),MI=n(531239),wI=n.n(MI),DI=n(302048),ZI=n.n(DI),LI=n(180263),UI=n.n(LI),kI=n(677291),GI=n.n(kI),BI=n(864678),HI=n.n(BI),VI=n(367627),FI=n.n(VI),YI=n(874744),zI=n.n(YI),WI=n(101872),KI=n.n(WI),qI=n(46802),XI=n.n(qI),QI=n(726954),$I=n.n(QI),JI=n(897295),eS=n.n(JI);function tS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function mS(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i} }(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return dS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dS(e,t)}(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.")}()}const bS=o.forwardRef((function(e,t){var n=e.className,i=e.children,a=e.ariaLabel,s=e.onContextMenu,l=e.onCardClick,u=e.onItemClick,f=e.listItemProps,d=e.itemId,p=e.selected,h=yS(e,["className","children","ariaLabel","onContextMenu","onCardClick","onItemClick","listItemProps","itemId","selected"]),E=mS((0,lS.Z)(t),2),y=E[0],m=E[1],b=o.useRef(null);return(0,r.jsxs)("div",ES(hS({ref:m,className:lh()(fS().card,fS().interactiveCard,pS({},fS().selected,p),n),"data-item-id":d,onContextMenu:s, onClick:function(e){return null==l?void 0:l(e,y.current)}},h),{children:[(0,r.jsx)(c.P3F,hS({className:fS().clickableTarget,innerRef:b,"aria-label":a,onClick:u},f)),i]}))}));var gS=n(864997),OS=n.n(gS);function vS(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function _S(e){var t=e.children,n=e.hideBorder;return(0,r.jsx)("div",{className:lh()(OS().feedItemHeader,vS({},OS().hideBorder,n)),children:t})}var IS=n(186440),SS=n(942450),TS=n.n(SS);function NS(e){e.stopPropagation()}function AS(e){var t=e.onContextMenu,n=Q.Z.Messages.MORE;return(0,r.jsx)("div",{onClick:NS,onContextMenu:NS,children:(0,r.jsx)(c.ua7,{text:n,hideOnClick:!0,children:function(e){var o=e.onMouseEnter,i=e.onMouseLeave,a=e.onClick;return(0,r.jsx)(c.zxk,{onMouseEnter:o,onMouseLeave:i,look:c.zxk.Looks.BLANK,size:c.zxk.Sizes.NONE,onClick:function(e){null==a||a();t(e)},"aria-label":n,className:TS().overflowButton,children:(0,r.jsx)(IS.Z,{className:TS().icon})}) }})})}function CS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function WS(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return HS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HS(e,t)}(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.")}()}var KS=o.memo((function(e){var t=e.message,n=e.channel,i=e.animateAvatar,a=e.repliedMessage,s=(0,sI.Z)(t.id,Fg.d$),c=s.popouts,l=s.setPopout,u=c.usernameProfile,f=c.avatarProfile,d=(0, aI.wq)(t.author.id,n.id),p=(0,aI.XO)(t,n,u,l),h=(0,aI.R9)(f,l),E=o.useCallback((function(){return l({usernameProfile:!1,avatarProfile:!1,referencedUsernameProfile:!1})}),[l]),y=(0,rI.ZP)(t),m=(0,xS.p9)({guildId:n.guild_id,roleId:y.iconRoleId});return(0,r.jsx)(fI.ZP,{guildId:n.guild_id,message:t,channel:n,repliedMessage:a,author:y,showTimestampOnHover:t.type!==M.uaV.REPLY,renderPopout:iI.Z,showAvatarPopout:f,showUsernamePopout:u,onClickAvatar:h,onClickUsername:p,onPopoutRequestClose:E,onContextMenu:d,roleIcon:m,animate:i})})),qS=o.forwardRef((function(e,t){var n=e.guildId,i=e.channel,a=e.message,l=e.feedItemId,u=e.className,f=e.animateAvatar,d=e.contentClassName,p=e.children,h=e.groupId,E=e.onMessageClick,y=e.hideHeader,m=void 0!==y&&y,b=e.forceAddReactions,g=void 0===b||b,O=zS(e,["guildId","channel","message","feedItemId","className","animateAvatar","contentClassName","children","groupId","onMessageClick","hideHeader","forceAddReactions"]),v=o.useRef(null),_=(0,s.e7)([S.Z],(function(){ return S.Z.getChannel(i.id)})),I=null!=_&&a.isFirstMessageInForumPost(_),T=(0,RS.dj)(a.id),N=(0,RS.tu)(n,a.id),A=T||N,C=(0,cI.Z)(a,{hideSimpleEmbedContent:!0,allowList:I||A,allowHeading:I||A,allowLinks:A,previewLinkTarget:A}),P=C.content,j=C.hasSpoilerEmbeds,R=a.type===M.uaV.REPLY?a.messageReference:void 0,x=(0,s.e7)([ip.Z],(function(){return ip.Z.getMessageByReference(R)})),w=(0,s.e7)([S.Z],(function(){return a.hasFlag(M.iLy.HAS_THREAD)&&S.Z.getChannel(a.id)})),D=(0,oI.iG)(a,h,{hasTimestamp:a.id===h}),Z=(0,oI.Gx)(a),L=null!=R?(0,r.jsx)(c.P3F,{onClick:function(e){if(null!=x.message){e.stopPropagation();(0,qb.wA)({feed_item_type:(0,V_.NH)(l),feed_item_id:l,load_id:Xb.ZP.getLoadId(n),action_type:eO.w8.REFERENCED_MESSAGE_CLICKED,guild_id:n,channel_id:i.id,message_id:a.id,home_session_id:yv.Z.getHomeSessionId(n)});cd.Z.openChannelAsSidebar({guildId:i.guild_id,channelId:i.id,baseChannelId:Ig.oC.GUILD_HOME,details:{type:lv.F.HOME,initialMessageId:x.message.id}})}},children:(0, ZS.Z)(a,i,R,x,!1)}):null,U=(0,MS.Z)(a),k=o.useCallback((function(e){E(e,v.current,a)}),[E,a]);return(0,r.jsx)(LS.Z,FS({messageRef:v,className:lh()(u,VS({},BS().mentioned,a.mentioned&&!(0,MS.Z)(a))),onClick:k,childrenRepliedMessage:L,childrenExecutedCommand:(0,DS.Z)(a,i,!1),childrenHeader:U||m?null:(0,r.jsx)(KS,{channel:i,message:a,animateAvatar:f,repliedMessage:x}),childrenAccessories:(0,lI.Z)({channelMessageProps:e,hasSpoilerEmbeds:j,isInteracting:!1,forceAddReactions:g}),childrenMessageContent:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(uI.ZP,{className:d,message:a,content:P,contentRef:t}),p]}),childrenSystemMessage:(0,wS.Z)(e),hasThread:null!=w&&a.hasFlag(M.iLy.HAS_THREAD),hasReply:a.type===M.uaV.REPLY,isSystemMessage:U,"aria-labelledby":D,"aria-describedby":Z},O))}));function XS(e){var t,n=e.message,i=e.guildId,a=e.feedItemId,s=e.disableTruncation,l=n.attachments.length>0,u=WS(o.useState(!1),2),f=u[0],d=u[1],p=WS(jS(i,a),2),h=p[0],E=p[1];return(0,r.jsx)(qS,YS(FS({ref:function(e){ null==e||s||d(e.scrollHeight>e.clientHeight)},contentClassName:lh()((t={},VS(t,kS().clampLarge,!s&&!h&&!l),VS(t,kS().clampSmall,!s&&!h&&l),t))},e),{children:f&&!h?(0,r.jsx)(c.P3F,{className:kS().showMore,onClick:function(e){return E(e,n)},"aria-hidden":!0,children:Q.Z.Messages.GUILD_FEED_TRUNCATED_MESSAGE_SEE_MORE}):null}))}const QS=o.memo(XS);function $S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}))?4:8,l=tT(o.useState(),2),u=l[0],f=l[1],d=tT(o.useState(),2),p=d[0],h=d[1],E=tT(jS(t,n),2),y=E[0],m=E[1];o.useLayoutEffect((function(){var e=0,t=!0,n=!1,r=void 0;try{for(var o,i=a.current.entries()[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var c=tT(o.value,2),l=c[0],u=c[1];if(null!=u){var d,p=parseFloat(null!==(d=window.getComputedStyle(u).getPropertyValue("line-height"))&&void 0!==d?d:"0"),E=u.scrollHeight/p;if((e+=E)>s){f(l);h(E-(e-s));break}}}}catch(e){n=!0;r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}),[i,s]);if(0===i.length)return null;var b=i[0].id;return(0,r.jsx)(r.Fragment,{children:i.map((function(t,n){if(null!=u&&n>u&&!y)return null;var o=u===n,s=o&&null!=p?function(e){if(e>=10)return kS().clampLarge;if(e>=4&&e<10)return kS().clampMed;if(e<4)return kS().clampSmall;return}(p):null,l=o&&null!=s&&!y;return(0,r.jsx)(qS,eT(function(e){ for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]1,animateAvatar:s,children:t!==n.length-1&&(0,r.jsx)("div",{className:iT().replySpine})},o.id)})),n.length>2&&(0,r.jsx)("div",{className:lh()(iT().conversationMessage,iT().viewMoreReplies),children:(0,r.jsx)(c.P3F,{onClick:u,"data-action":"view-more-replies",children:Q.Z.Messages.GUILD_FEED_TRUNCATED_REPLIES_VIEW_MORE.format({count:n.length-2})})},"view-more")]})}const yT=o.forwardRef((function(e,t){var n,i,a=e.guildId,l=e.conversationItem,u=e.showFeedback,f=e.setOnDismissedFeedback,d=l.root,p=d.messages,h=d.children,E=p[0],y=p[p.length-1],m=y.channel_id,b=(0,s.Wu)([Xb.ZP],(function(){return p.map((function(e){return Xb.ZP.getCachedMessage(a,m,e.id)})).filter(_o.lm)}),[a,m,p]),g=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(m)})),O=(0,EO.KS)(g,void 0,{textFocused:!0}),v=(0,EO.bT)(g),_=(0,op.ZP)(g),I=dT(o.useState(!1),2),T=I[0],N=I[1],A=(0,s.e7)([Ja.Z],(function(){return null!=y&&Ja.Z.isBlocked(y.author.id)})),C=(0, pb.JA)(null!==(i=null===(n=b[b.length-1])||void 0===n?void 0:n.id)&&void 0!==i?i:l.id),P=l.id,j=(0,s.e7)([ap.ZP],(function(){return ap.ZP.getSidebarState(Ig.oC.GUILD_HOME)})),R=(0,yO.FW)(j,g),x=null!=R&&E.id===R,w=nI({guildId:a,channelId:m,feedItemId:P,onChannelClick:function(){return(0,Yv.Z)(M.Z5c.CHANNEL(a,m,E.id))},onContentClick:function(e){var t;cd.Z.openChannelAsSidebar({guildId:a,channelId:m,baseChannelId:Ig.oC.GUILD_HOME,flash:!1,details:{type:lv.F.HOME,initialMessageId:null!==(t=null==e?void 0:e.id)&&void 0!==t?t:E.id,highlightMessageIds:new Set((0,H_.bE)(l))}})}}),D=w.handleItemClick,Z=w.handleChannelClick,L=w.handleCardClick,U=w.handleMessageClick,k=(0,s.e7)([Xb.ZP],(function(){return null==g?[]:h.map((function(e){return e.messages.map((function(e){return Xb.ZP.getCachedMessage(a,g.id,e.id)})).filter(_o.lm)})).filter((function(e){return 0!==e.length}))}),[a,g,h],mO);if(null==g||null==E||null==y||A)return null;var G,B=function(e){e.stopPropagation();(0, Ob.jW)(e,cT((function(){var e;return pT(this,(function(t){switch(t.label){case 0:return[4,hT()];case 1:e=t.sent();return[2,function(t){return(0,r.jsx)(e,fT(uT({},t),{item:l,channel:g}))}]}}))})))};return(0,r.jsxs)(bS,{className:u?iT().containerNoPadding:iT().container,ref:t,selected:x,onCardClick:L,onItemClick:D,onContextMenu:B,itemId:P,ariaLabel:Q.Z.Messages.GUILD_FEED_MESSAGE_ITEM_A11Y_LABEL.format({channelName:_}),listItemProps:C,onMouseEnter:function(){return N(!0)},onMouseLeave:function(){return N(!1)},children:[(0,r.jsxs)(c.y5t,{component:(0,r.jsxs)(_S,{children:[(0,r.jsx)("div",{className:iT().messageHeaderMenuLeft,children:(0,r.jsxs)(c.P3F,{className:iT().channelNameContainer,onClick:Z,children:[null!=O?(0,r.jsx)(c.ua7,{text:v,delay:500,children:function(e){return(0,r.jsx)(O,fT(uT({},e),{className:iT().channelIcon,height:16,width:16}))}}):null,(0,r.jsx)(c.X6q,{lineClamp:1,variant:"heading-sm/semibold",children:_})]})}),(0,r.jsx)("div",{className:iT().messageHeaderMenuRight, children:(0,r.jsx)(AS,{feedItem:l,guildId:a,onContextMenu:B})})]}),children:[(0,r.jsx)("div",{className:lh()(iT().messageBundleItemBody,(G={},lT(G,iT().conversationRoot,k.length>0),lT(G,iT().hasReply,E.type===M.uaV.REPLY),G)),children:(0,r.jsx)(rT,{feedItemId:l.id,guildId:a,channel:g,messages:b,animateAvatar:T,onMessageClick:U})}),(0,r.jsx)(ET,{item:l,channel:g,guildId:a,referenceMessageBundles:k,onMessageClick:U,animateAvatar:T})]}),u&&(0,r.jsx)(cS,{guildId:a,guildFeedItem:l,setOnDismissFeedback:f})]})}));var mT=n(708313),bT=n(749131),gT=n(310246),OT=n(773148),vT=n(548028),_T=n.n(vT);function IT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]3?Q.Z.Messages.GUILD_FEED_MESSAGE_ITEM_MAX_REPLIES.format({maxReplies:3}):Q.Z.Messages.GUILD_FEED_MESSAGE_ITEM_NUM_REPLIES.format({numReplies:a});return(0,r.jsx)(UT,{guildId:n,users:i,text:s})}const GT=o.forwardRef((function(e,t){var n,i,a=e.guildId,l=e.messageItem,u=e.showFeedback,f=e.setOnDismissedFeedback,d=l.message.channel_id,p=l.message.id,h=(0,s.cj)([Xb.ZP],(function(){ var e=Xb.ZP.getCachedMessage(a,d,p);return{message:e,isFeaturedMessage:null!=e&&Xb.ZP.getIsItemFeatured({guildId:a,entity:e,entityType:dO.w.MESSAGE})}}),[a,d,p]),E=h.message,y=h.isFeaturedMessage,m=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(d)})),b=(0,EO.KS)(m,void 0,{textFocused:!0}),g=(0,EO.bT)(m),O=null!==(n=null==l?void 0:l.referenceMessages)&&void 0!==n?n:[],v=(0,op.ZP)(m),_=DT(o.useState(!1),2),I=_[0],T=_[1],N=(0,s.e7)([Ja.Z],(function(){return null!=E&&Ja.Z.isBlocked(null==E?void 0:E.author.id)})),A=(0,pb.JA)(null!==(i=null==E?void 0:E.id)&&void 0!==i?i:p),C=(0,V_.ZP)(l),P=(0,s.e7)([ap.ZP],(function(){return ap.ZP.getSidebarState(Ig.oC.GUILD_HOME)})),j=(0,yO.FW)(P,m),R=null!=j&&l.message.id===j,x=l.highlighted?Q.Z.Messages.GUILD_FEED_SPECIAL_HIGHLIGHT:y?Q.Z.Messages.GUILD_FEED_FEATURED_BY_MODERATORS:null,w=nI({guildId:a,channelId:d,feedItemId:C,onChannelClick:function(){return(0,Yv.Z)(M.Z5c.CHANNEL(a,d,p))},onContentClick:function(){cd.Z.openChannelAsSidebar({guildId:a, channelId:d,baseChannelId:Ig.oC.GUILD_HOME,details:{type:lv.F.HOME,initialMessageId:p,highlightMessageIds:new Set([p])}})}}),D=w.handleItemClick,Z=w.handleChannelClick,L=w.handleCardClick,U=w.handleMessageClick;if(null==m||null==E||null==l||N)return null;var k=function(e){e.stopPropagation();(0,Ob.jW)(e,RT((function(){var e;return ZT(this,(function(t){switch(t.label){case 0:return[4,LT()];case 1:e=t.sent();return[2,function(t){return(0,r.jsx)(e,wT(MT({},t),{messageItem:l,channel:m,message:E}))}]}}))})))};return(0,r.jsxs)(bS,{className:u?CT().containerNoPadding:CT().container,ref:t,selected:R,onCardClick:L,onItemClick:D,onContextMenu:k,itemId:C,ariaLabel:Q.Z.Messages.GUILD_FEED_MESSAGE_ITEM_A11Y_LABEL.format({channelName:v}),listItemProps:A,onMouseEnter:function(){return T(!0)},onMouseLeave:function(){return T(!1)},children:[(0,r.jsxs)(c.y5t,{component:(0,r.jsxs)(_S,{children:[(0,r.jsxs)("div",{className:CT().messageHeaderMenuLeft,children:[(0,r.jsxs)(c.P3F,{ className:CT().channelNameContainer,onClick:Z,children:[null!=b?(0,r.jsx)(c.ua7,{text:g,delay:500,children:function(e){return(0,r.jsx)(b,wT(MT({},e),{className:CT().channelIcon,height:16,width:16}))}}):null,(0,r.jsx)(c.X6q,{lineClamp:1,variant:"heading-sm/semibold",children:v})]}),null!=x&&(0,r.jsxs)("div",{className:CT().featuredMessageContainer,children:[(0,r.jsx)(bO.Z,{height:4,width:4,"aria-hidden":"true",className:CT().featuredMessageIcon}),(0,r.jsx)(c.xvT,{className:CT().featuredMessageText,variant:"text-sm/normal",color:"header-secondary",children:x})]})]}),(0,r.jsx)("div",{className:CT().messageHeaderMenuRight,children:(0,r.jsx)(AS,{feedItem:l,guildId:a,onContextMenu:k})})]}),children:[(0,r.jsx)(QS,{className:CT().messageItemBody,guildId:a,animateAvatar:I,channel:m,message:E,feedItemId:l.id,onMessageClick:U}),(0,r.jsx)(kT,{referenceMessages:O,guildId:a})]}),u&&(0,r.jsx)(cS,{guildId:a,guildFeedItem:l,setOnDismissFeedback:f})]})}));var BT=n(858435),HT=n.n(BT);function VT(e,t){ (null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=rN.M3?Q.Z.Messages.GUILD_FEED_MESSAGE_ITEM_MAX_REPLIES.format({maxReplies:rN.M3}):Q.Z.Messages.GUILD_FEED_MESSAGE_ITEM_NUM_REPLIES.format({numReplies:o}),a=(0,s.e7)([tN.Z],(function(){return tN.Z.getMemberIdsPreview(n.id)})),c=(0,JT.iM)(n,null!=a?a:[]);return 0===o?null:(0,r.jsx)(UT,{guildId:n.guild_id,maxUsers:5,users:c,text:i})}const mN=o.forwardRef((function(e,t){var n,i=e.guildId,a=e.postItem,l=e.showFeedback,u=e.setOnDismissedFeedback,f=a.thread,d=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(f.id)}),[f.id]),p=(0,s.cj)([Xb.ZP],(function(){return{message:Xb.ZP.getCachedMessage(i,f.id,a.message.id),isFeaturedPost:Xb.ZP.getIsItemFeatured({guildId:i,entity:f, entityType:dO.w.FORUM_POST})}}),[i,a.message.id,f]),h=p.message,E=p.isFeaturedPost,y=(0,op.ZP)(f),m=(0,s.e7)([Ja.Z],(function(){return null!=h&&Ja.Z.isBlocked(null==h?void 0:h.author.id)})),b=(0,pb.JA)(null!==(n=null==h?void 0:h.id)&&void 0!==n?n:a.message.id),g=(0,V_.ZP)(a),O=(0,EO.bT)(f),v=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(f.parent_id)})),_=(0,op.ZP)(v),I=(0,EO.KS)(v),T=dN(o.useState(!1),2),N=T[0],A=T[1],C=(0,s.e7)([ap.ZP],(function(){return ap.ZP.getSidebarState(Ig.oC.GUILD_HOME)})),P=(0,yO.FW)(C,d),j=null!=P&&a.message.id===P,R=a.highlighted?Q.Z.Messages.GUILD_FEED_SPECIAL_HIGHLIGHT:E?Q.Z.Messages.GUILD_FEED_FEATURED_BY_MODERATORS:null,x=nI({guildId:i,channelId:f.id,feedItemId:g,onChannelClick:function(){return(0,Yv.Z)(M.Z5c.CHANNEL(i,f.parent_id))},onContentClick:function(){return cd.Z.openThreadAsSidebar({guildId:i,baseChannelId:Ig.oC.GUILD_HOME,channelId:f.id})}}),w=x.handleItemClick,D=x.handleChannelClick,Z=x.handleCardClick,L=x.handleMessageClick,U=dN((0, JT.ur)(f),2),k=U[0],G=U[1],B=k[0],H=(0,JT.eV)(f).slice(1),V=null!=Nm().name&&!hN.has(Nm().name);if(null==f||null==d||null==h||null==a||m)return null;var F=function(e){e.stopPropagation();(0,Ob.jW)(e,cN((function(){var e;return pN(this,(function(t){switch(t.label){case 0:return[4,EN()];case 1:e=t.sent();return[2,function(t){return(0,r.jsx)(e,fN(uN({},t),{messageItem:a,channel:d,message:h}))}]}}))})))};return(0,r.jsxs)(bS,{className:l?iN().containerNoPadding:iN().container,ref:t,selected:j,onCardClick:Z,onItemClick:w,onContextMenu:F,itemId:g,ariaLabel:Q.Z.Messages.GUILD_FEED_MESSAGE_ITEM_A11Y_LABEL.format({channelName:y}),listItemProps:b,onMouseEnter:function(){return A(!0)},onMouseLeave:function(){return A(!1)},children:[(0,r.jsx)(c.y5t,{component:(0,r.jsxs)(_S,{children:[(0,r.jsxs)("div",{className:iN().postHeaderMenuLeft,children:[(0,r.jsxs)(c.P3F,{className:iN().channelNameContainer,onClick:D,children:[null!=I?(0,r.jsx)(c.ua7,{text:O,delay:500,children:function(e){return(0, r.jsx)(I,fN(uN({},e),{className:iN().channelIcon,height:16,width:16}))}}):null,(0,r.jsx)(c.X6q,{className:iN().channelName,variant:"heading-sm/semibold",lineClamp:1,children:_})]}),null!=R&&(0,r.jsxs)("div",{className:iN().featuredPostContainer,children:[(0,r.jsx)(bO.Z,{height:4,width:4,"aria-hidden":"true",className:iN().featuredPostIcon}),(0,r.jsx)(c.xvT,{className:iN().featuredPostText,variant:"text-sm/normal",color:"header-secondary",children:R})]})]}),(0,r.jsx)("div",{className:iN().postHeaderMenuRight,children:(0,r.jsx)(AS,{feedItem:a,guildId:i,onContextMenu:F})})]}),children:(0,r.jsxs)(c.y5t,{component:(0,r.jsxs)("div",{className:iN().titleContainer,children:[(0,r.jsx)(c.X6q,{className:iN().title,variant:"heading-lg/semibold",children:f.name}),null!=B?(0,r.jsxs)("div",{className:iN().tags,children:[(0,r.jsx)(eN.ZP,{tag:B,size:eN.ZP.Sizes.SMALL}),G>0?(0,r.jsx)(eN.fz,{tags:H,count:G,size:eN.ZP.Sizes.SMALL}):null]}):null]}),children:[(0,r.jsx)(QS,{className:iN().messageItemBody, guildId:f.guild_id,animateAvatar:N,channel:f,message:h,feedItemId:a.id,onMessageClick:L,disableTruncation:V}),(0,r.jsx)(yN,{channel:f})]})}),l&&(0,r.jsx)(cS,{guildId:i,guildFeedItem:a,setOnDismissFeedback:u})]})}));function bN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?(0,qb.pb)(e,l,u):(0,qb.v)(e,l,u)}}catch(e){o=!0;i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}}(t,c,e)}),{root:s,rootMargin:"0px 100000px 0px 100000px",threshold:c});l.observe(r);return function(){l.disconnect()}}}else(0,qb.v)(t,n,Date.now())}),[n,t,a,i,d,p]);if(null==f||p)return null;if(d)return(0,r.jsx)(NT,{guildId:t,feedItem:f});switch(f.type){case dO.w.FORUM_POST:return(0,r.jsx)(mN,{ref:h,guildId:t,postItem:f,showFeedback:c,setOnDismissedFeedback:l});case dO.w.MESSAGE:return(0,r.jsx)(GT,{ref:h,guildId:t,messageItem:f,showFeedback:c,setOnDismissedFeedback:l});case dO.w.MESSAGE_BUNDLE:return(0,r.jsx)($T,{ref:h,guildId:t,messageBundleItem:f,showFeedback:c,setOnDismissedFeedback:l});case dO.w.CONVERSATION:return(0,r.jsx)(yT,{ref:h,guildId:t,conversationItem:f,showFeedback:c,setOnDismissedFeedback:l});default:(0,_o.vE)(f)}}));var vN=n(861426),_N=n(613677),IN=n(575978),SN=n(921122),TN=n(465637),NN=n(265367);function AN(e){var t=(0, s.e7)([Hg.ZP],(function(){return Hg.ZP.getChannels(e)}))[Hg.sH];return(0,s.Wu)([cp.Z],(function(){return t.filter((function(e){var t=e.channel;return r_.T.READABLE.has(t.type)&&!r_.T.GUILD_VOCAL.has(t.type)})).filter((function(t){var n=t.channel;return cp.Z.isChannelMuted(e,n.id)||cp.Z.isCategoryMuted(e,n.id)}))}),[e,t]).length}var CN=n(216595),PN=n.n(CN);function jN(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function RN(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){jN(i,r,o,a,s,"next",e)}function s(e){jN(i,r,o,a,s,"throw",e)}a(void 0)}))}}function xN(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function MN(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var wN=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0 ;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?Q.Z.Messages.GUILD_FEED_MUTED_CHANNELS_SUBTITLE.format({numMutedChannels:o,mutedChannelsHook:function(e,n){return DN(e,n,t)}}):Q.Z.Messages.GUILD_FEED_FOOTER_SUBTITLE}),(0,r.jsx)(c.zxk,{onClick:n,className:PN().button,children:Q.Z.Messages.GUILD_FEED_RELOAD})]})})),LN=o.memo((function(e){var t=e.guildId,n=e.onReloadClick,o=AN(t);return(0,r.jsxs)("div",{className:lh()(PN().container,PN().background),children:[(0,r.jsxs)("div",{ className:PN().iconContainer,children:[(0,r.jsx)(SN.Z,{className:PN().icon,width:36,height:36}),(0,r.jsx)(TN.Z,{className:PN().stars})]}),(0,r.jsx)(c.X6q,{className:PN().header,variant:"heading-md/semibold",children:Q.Z.Messages.GUILD_FEED_EMPTY_TITLE}),(0,r.jsx)(c.xvT,{color:"header-secondary",variant:"text-sm/normal",children:o>0?Q.Z.Messages.GUILD_FEED_MUTED_CHANNELS_SUBTITLE.format({numMutedChannels:o,mutedChannelsHook:function(e,n){return DN(e,n,t)}}):Q.Z.Messages.GUILD_FEED_EMPTY_SUBTITLE}),(0,r.jsx)(c.zxk,{onClick:n,className:PN().button,children:Q.Z.Messages.GUILD_FEED_RELOAD})]})})),UN=o.memo((function(e){var t=e.onReloadClick;return(0,r.jsxs)("div",{className:lh()(PN().container,PN().background),children:[(0,r.jsx)("div",{className:PN().iconContainer,children:(0,r.jsx)(NN.Z,{className:PN().icon,width:36,height:36})}),(0,r.jsx)(c.X6q,{className:PN().header,variant:"heading-md/semibold",children:Q.Z.Messages.GUILD_FEED_ERROR_TITLE}),(0,r.jsx)(c.xvT,{color:"header-secondary", variant:"text-sm/normal",children:Q.Z.Messages.GUILD_FEED_ERROR_SUBTITLE.format({url:M.yXt.STATUS})}),(0,r.jsx)(c.zxk,{onClick:t,className:PN().button,children:Q.Z.Messages.GUILD_FEED_RELOAD})]})})),kN=o.memo((function(e){var t=e.onReloadClick;return(0,r.jsxs)("div",{className:lh()(PN().container,PN().paginationContainer,PN().primaryBackground),children:[(0,r.jsx)("div",{className:PN().iconContainer,children:(0,r.jsx)(NN.Z,{className:PN().icon,width:36,height:36})}),(0,r.jsx)(c.X6q,{className:PN().header,variant:"heading-md/semibold",children:Q.Z.Messages.GUILD_FEED_ERROR_TITLE}),(0,r.jsx)(c.xvT,{color:"header-secondary",variant:"text-sm/normal",children:Q.Z.Messages.GUILD_FEED_ERROR_SUBTITLE.format({url:M.yXt.STATUS})}),(0,r.jsx)(c.zxk,{onClick:t,className:PN().button,children:Q.Z.Messages.RETRY})]})})),GN=n(627027),BN=n(427506),HN=n.n(BN);function VN(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function FN(e,t){ t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function YN(){var e=o.useMemo((function(){if(!(Wa().random(1)<.5))return FN(function(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.joinedAt.getTime()}),[null==e?void 0:e.joinedAt]),a=n&&r&&!i;o.useEffect((function(){a||t(hn.L.AUTO)}),[a]);return a||!0}(t,n);return a?i?(0,r.jsx)(EA,{onClose:n}):(0,r.jsx)(pA,{onClose:n}):null}var mA=[ln.z$.GUILD_FEED_NUX_CARD] ;const bA=o.memo((function(e){var t=e.guild;return(0,r.jsx)(WN.Z,{contentTypes:mA,groupName:hn.R.GUILD_FEED_TOP,children:function(e){var n=e.visibleContent,o=e.markAsDismissed;return n===ln.z$.GUILD_FEED_NUX_CARD?(0,r.jsx)(yA,{guild:t,onClose:o}):null}})}));var gA=n(621329),OA=n(318195),vA=n.n(OA);const _A=o.memo((function(){return(0,r.jsxs)("div",{className:vA().container,children:[(0,r.jsxs)("div",{className:vA().divider,children:[(0,r.jsx)("div",{className:vA().line}),(0,r.jsx)("div",{className:vA().icon,children:(0,r.jsx)(gA.Z,{height:24,width:24})}),(0,r.jsx)("div",{className:vA().line})]}),(0,r.jsx)(c.xvT,{className:vA().title,color:"header-primary",variant:"text-md/semibold",children:Q.Z.Messages.GUILD_FEED_UNREAD_DIVIDER_TITLE}),(0,r.jsx)(c.xvT,{className:vA().subtitle,color:"header-secondary",variant:"text-sm/normal",children:Q.Z.Messages.GUILD_FEED_UNREAD_DIVIDER_SUBTITLE})]})}));var IA=n(419984),SA=n.n(IA);function TA(e,t){(null==t||t>e.length)&&(t=e.length) ;for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&s()}}catch(e){n=!0;r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}),{root:r,rootMargin:"0px 0px 200px 0px",threshold:0});o.observe(t);return function(){o.disconnect()}}}),[i,l,s,t,n]);return null!=a?(0,r.jsx)(kN,{guildId:t,onReloadClick:s}):n?(0,r.jsx)("div",{className:SA().container,ref:l,children:(0,r.jsx)(zN,{count:1})}):(0,r.jsx)(ZN,{guildId:t,onReloadClick:c})}));function wA(e){var t,n,i,a=e.guild,c=e.renderMode,l=e.scrollerRef,u=e.seenManagerRef,f=_v(),d=CA((0,s.Wu)([Xb.ZP],(function(){return[eO.Ji.READ,eO.Ji.UNREAD,eO.Ji.HIGHLIGHTED,eO.Ji.ALL].map((function(e){ return Xb.ZP.getFeedItemSection(a.id,e)}))})),4),p=d[0],h=d[1],E=d[2],y=d[3],m=(0,s.e7)([Xb.ZP],(function(){return Xb.ZP.getLoadId(a.id)})),b=(0,s.e7)([yv.Z],(function(){return yv.Z.getHomeSessionId(a.id)})),g=(0,J_.Z)({guildId:a.id,highlightedItemData:f}),O=g.loading,v=g.error,_=g.fetchFresh,I=g.fetchPage,S=(0,s.e7)([Xb.ZP],(function(){return Xb.ZP.getPaginationStatus(a.id)})).hasMoreItems,T=bv.M.useExperiment({guildId:a.id}).hasNewHeader,N=yg(a).homeHeaderScroll;o.useEffect((function(){Q_.initialize();return function(){Q_.terminate()}}),[]);o.useLayoutEffect((function(){if(null!=m&&null!=b){(0,qb.Ps)(a.id);var e=(0,IN.UU)(),t=new $_.Z({guildId:a.id,loadId:m,homeSessionId:b,windowId:e,isPaused:!We.Z.isFocused(e)});t.initialize();u.current=t;return function(){t.terminate()}}}),[u,a.id,m,b]);var A=function(e){var t=CA(o.useState(null),2),n=t[0],r=t[1];o.useEffect((function(){var t,n=null===(t=e.current)||void 0===t?void 0:t.getScrollerNode();if(null!=n){ var o=new ResizeObserver((function(e){var t=!0,n=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var s=i.value;r(s.contentRect.height)}}catch(e){n=!0;o=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw o}}}));o.observe(n);return function(){o.disconnect()}}}),[e]);return n}(l),C=o.useMemo((function(){return c!==eO.EO.NEW?[]:PA(y).sort((function(e,t){return-ho.Z.compare((0,H_.ZP)(e).id,(0,H_.ZP)(t).id)}))}),[y,c]),P=o.useCallback(AA((function(){var e;return RA(this,(function(t){switch(t.label){case 0:return[4,null===(e=u.current)||void 0===e?void 0:e.maybeFlushSeenItems(Ev.cs.IMMEDIATE)];case 1:t.sent();_({force:!0,flushSeenItems:function(){var e;return null===(e=u.current)||void 0===e?void 0:e.maybeFlushSeenItems(Ev.cs.IMMEDIATE)}});return[2]}}))})),[u,_]);o.useEffect((function(){if(O===Xb.Q.LOADING_FRESH_FEED)if(T){var e;null===(e=l.current)||void 0===e||e.scrollTo({to:N})}else{var t;null===(t=l.current)||void 0===t||t.scrollToTop()} }),[O,T,N]);var j,R,x=0===y.length,M=(0,bI.vL)(),w=M.showFeedback,D=M.setOnDismissedFeedback;if(x)return O===Xb.Q.LOADING_FRESH_FEED?(0,r.jsx)("div",{className:SA().container,children:(0,r.jsx)(zN,{})}):null!=v?(0,r.jsx)(UN,{guildId:a.id,onReloadClick:P}):(0,r.jsx)(LN,{guildId:a.id,onReloadClick:P});if(c===eO.EO.TOP)return(0,r.jsxs)("div",{className:SA().container,children:[(0,r.jsx)(bA,{guild:a}),y.map((function(e,t){return(0,r.jsx)(ON,{guildId:a.id,itemId:e.id,scrollerHeight:A,scrollerRef:l,showFeedback:0===t&&w,setOnDismissedFeedback:D},e.id)})),(0,r.jsx)(MA,{guildId:a.id,hasMoreItems:null!=S&&S,scrollerRef:l,error:v,fetchPage:I,onReloadClick:P})]});if(c===eO.EO.NEW)return(0,r.jsxs)("div",{className:SA().container,children:[(0,r.jsx)(bA,{guild:a}),C.map((function(e,t){return(0,r.jsx)(ON,{guildId:a.id,itemId:e.id,scrollerHeight:A,scrollerRef:l,showFeedback:0===t&&w,setOnDismissedFeedback:D},e.id)})),(0,r.jsx)(MA,{guildId:a.id,hasMoreItems:null!=S&&S,scrollerRef:l,error:v,fetchPage:I, onReloadClick:P})]});var Z=null!==(R=null!==(j=null===(t=E[0])||void 0===t?void 0:t.id)&&void 0!==j?j:null===(n=h[0])||void 0===n?void 0:n.id)&&void 0!==R?R:null===(i=p[0])||void 0===i?void 0:i.id;return(0,r.jsxs)("div",{className:SA().container,children:[(0,r.jsx)(xA,{guildId:a.id}),(0,r.jsx)(bA,{guild:a}),E.map((function(e){return(0,r.jsx)(ON,{guildId:a.id,itemId:e.id,scrollerHeight:A,scrollerRef:l,showFeedback:e.id===Z&&w,setOnDismissedFeedback:D},e.id)})),h.map((function(e){return(0,r.jsx)(ON,{guildId:a.id,itemId:e.id,scrollerHeight:A,scrollerRef:l,showFeedback:e.id===Z&&w,setOnDismissedFeedback:D},e.id)})),p.length>0?(0,r.jsx)(_A,{}):null,p.map((function(e){return(0,r.jsx)(ON,{guildId:a.id,itemId:e.id,scrollerHeight:A,scrollerRef:l,showFeedback:e.id===Z&&w,setOnDismissedFeedback:D},e.id)})),(0,r.jsx)(MA,{guildId:a.id,hasMoreItems:null!=S&&S,scrollerRef:l,error:v,fetchPage:I,onReloadClick:P})]})}var DA=n(99270),ZA=n.n(DA);function LA(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value }catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function UA(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){LA(i,r,o,a,s,"next",e)}function s(e){LA(i,r,o,a,s,"throw",e)}a(void 0)}))}}function kA(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function GA(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?Wa().head(e):Wa().chain(a).filter((function(e){return!(0,Ov.xt)(e)})).minBy((function(e){return fO()(e.scheduled_start_time)})).value()}),[a,i]);if(null==s)return null;function l(){l=UA((function(){return HA(this,(function(e){switch(e.label){case 0:return[4,(0,c.ZDy)(UA((function(){var e,o;return HA(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(40706),n.e(89853)]).then(n.bind(n,389853))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,BA(GA({},e),{guildId:t.id}))}]}}))})))];case 1:e.sent();(0, un.EW)(ln.z$.GUILD_HEADER_EVENT_UPSELL);return[2]}}))}));return l.apply(this,arguments)}return(0,r.jsxs)("div",{className:ZA().container,children:[(0,r.jsxs)("div",{className:ZA().header,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:i?Q.Z.Messages.GUILD_EVENTS:Q.Z.Messages.GUILD_HOME_EVENTS_TITLE}),a.length>=2?(0,r.jsx)(c.P3F,{onClick:function(){return l.apply(this,arguments)},children:(0,r.jsx)(c.xvT,{className:ZA().showEvents,variant:"text-sm/normal",children:Q.Z.Messages.GUILD_HOME_SEE_ALL.format({count:a.length})})}):null]}),(0,r.jsx)("div",{className:ZA().events,children:(0,r.jsx)(S_,{event:s,isInList:!1})})]})}var FA=n(831855),YA=n.n(FA);function zA(e){var t=e.guild;o.useEffect((function(){(0,Tg.P)(t.id)}),[t.id]);var n=(0,s.e7)([Ng.Z],(function(){return Ng.Z.getGuild(t.id)}),[t]);return(0,r.jsxs)("div",{className:YA().memberInfo,children:[null!=(null==n?void 0:n.presenceCount)?(0,r.jsxs)("div",{className:YA().memberCount,children:[(0,r.jsx)("div",{ className:YA().dotOnline}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:YA().memberText,children:Q.Z.Messages.MEMBER_VERIFICATION_NUM_ONLINE.format({membersOnline:n.presenceCount})})]}):null,null!=(null==n?void 0:n.memberCount)?(0,r.jsxs)("div",{className:YA().memberCount,children:[(0,r.jsx)("div",{className:YA().dotOffline}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:YA().memberText,children:Q.Z.Messages.MEMBER_VERIFICATION_NUM_MEMBERS.format({members:n.memberCount})})]}):null]})}function WA(e){var t=e.guild;return(0,r.jsxs)("div",{className:YA().container,children:[(0,r.jsx)("div",{className:YA().iconWrapper,children:(0,r.jsx)(tg.Z,{className:YA().icon,guild:t,size:tg.Z.Sizes.LARGER,active:!0})}),(0,r.jsx)(c.xvT,{tag:"div",className:YA().name,variant:"heading-xl/semibold",children:t.name}),null!=t.description?(0,r.jsx)(c.xvT,{className:YA().description,variant:"text-md/normal",children:t.description}):null,(0,r.jsx)(zA,{guild:t})]})}const KA=o.memo(WA);function qA(e){ var t=e.guild;o.useEffect((function(){(0,Tg.P)(t.id)}),[t.id]);var n=(0,s.e7)([Ng.Z],(function(){return Ng.Z.getGuild(t.id)}),[t]);return(0,r.jsxs)("div",{className:YA().memberInfo,children:[t.hasCommunityInfoSubheader()&&(0,r.jsxs)("div",{className:YA().memberCount,children:[(0,r.jsx)(Cg.Z,{width:14,height:14}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"text-muted",children:Q.Z.Messages.DISCOVERABLE_GUILD_HEADER_PUBLIC})]}),null!=(null==n?void 0:n.presenceCount)&&(0,r.jsxs)("div",{className:YA().memberCount,children:[(0,r.jsx)("div",{className:YA().dotOnline}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"text-muted",children:Q.Z.Messages.MEMBER_VERIFICATION_NUM_ONLINE.format({membersOnline:n.presenceCount})})]}),null!=(null==n?void 0:n.memberCount)&&(0,r.jsxs)("div",{className:YA().memberCount,children:[(0,r.jsx)("div",{className:YA().dotOffline}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"text-muted",children:Q.Z.Messages.MEMBER_VERIFICATION_NUM_MEMBERS.format({ members:n.memberCount})})]})]})}function XA(e){var t=e.guild;return(0,r.jsx)("div",{className:YA().container,children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)("div",{className:YA().header,children:(0,r.jsx)(c.X6q,{variant:"heading-md/medium",children:Q.Z.Messages.GUILD_HOME_ABOUT})}),children:[null!=t.description?(0,r.jsx)(c.xvT,{className:YA().description,variant:"text-md/normal",children:t.description}):null,(0,r.jsx)(qA,{guild:t})]})})}const QA=o.memo(XA);var $A=n(866314),JA=n.n($A);function eC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function iC(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eC(e,t)}(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.")}()}var aC=o.memo((function(e){var t=e.guild,n=function(e,t){var n=mv.jD.useExperiment({}).showRefreshButton;o.useEffect((function(){mv.jD.trackExposure({})}),[]);var i=(0,s.e7)([dn.Z],(function(){ return dn.Z.can(M.Plq.MANAGE_MESSAGES,e)}),[e]),a=[];n&&a.push((0,r.jsx)(kb.JO,{tooltip:Q.Z.Messages.REFRESH,icon:hv.Z,onClick:function(){(0,qb.QF)({guildId:e.id,refresh:!0,flushSeenItems:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.maybeFlushSeenItems(Ev.cs.IMMEDIATE)}})}}));i&&a.push((0,r.jsx)(av,{guildId:e.id}));return a}(t,e.seenManagerRef);return(0,r.jsxs)(Og.Z,{channelId:Ig.oC.GUILD_HOME,guildId:t.id,className:lh()(nO().title,JA().background),innerClassname:JA().headerBarInner,toolbar:n,children:[(0,r.jsx)(Og.Z.Icon,{icon:pv.Z,"aria-hidden":!0}),(0,r.jsxs)(Og.Z.Title,{children:[(0,r.jsx)(c.nn4,{children:t.name}),Q.Z.Messages.GUILD_HOME]}),(0,r.jsx)(Kb.Z,{})]})})),sC=o.memo((function(e){var t=e.guild,n=e.containerHeight,i=e.isUsingCollapsedLayout,a=iC(o.useState(0),2),s=a[0],l=a[1],u=(0,mb.Z)(),f=u.ref,d=u.height;!function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=(0,vv.ZP)(e);o.useEffect((function(){ t&&Ie.default.track(M.rMx.HOME_EVENTS_LOADED,{guild_id:e,active_events_shown:n.some((function(e){return(0,Ov.xt)(e)}))?1:0,upcoming_events_shown:n.some((function(e){return!(0,Ov.xt)(e)}))?1:0,home_session_id:yv.Z.getHomeSessionId(e)})}),[e,t])}(t.id);o.useEffect((function(){if(null!=d){l(d+128-n)}}),[n,d]);var p=(0,c.mFp)(),h=bv.M.useExperiment({guildId:t.id}).hasNewHeader,E=h?-48:0;return(0,r.jsx)("aside",{className:JA().widgets,style:{top:Math.min(-s,E)},children:(0,r.jsx)(c.tEY,{children:(0,r.jsxs)("div",rC(nC({className:JA().widgetsContainer,ref:f,tabIndex:i?void 0:0,"aria-label":Q.Z.Messages.GUILD_HOME_SIDEBAR_A11Y_LABEL},i?{}:p),{children:[h?(0,r.jsx)(QA,{guild:t}):(0,r.jsx)(KA,{guild:t}),(0,r.jsx)(B_,{guildId:t.id,isUsingCollapsedLayout:i}),(0,r.jsx)(VA,{guild:t})]}))})})}));function cC(e){var t=e.pageWidth,n=e.onSidebarResize,o=(0,s.e7)([ap.ZP],(function(){return ap.ZP.getSidebarState(Ig.oC.GUILD_HOME)}));if(null==o)return null;var i,a=t-M.PrS-552 ;o.type===lv.t.VIEW_THREAD?i=(0,r.jsx)(uv.Z,{channelId:o.channelId,baseChannelId:Ig.oC.GUILD_HOME,channelViewSource:"Home View"}):o.type===lv.t.VIEW_CHANNEL&&(i=(0,r.jsx)(Wb,{channelId:o.channelId,baseChannelId:Ig.oC.GUILD_HOME,channelViewSource:"Home View"}));return(0,r.jsx)(hb.Z,{sidebarType:hb.y.HomeSidebar,maxWidth:a,onWidthChange:n,children:i})}var lC=[{label:"Segment Reads",value:eO.EO.SEGMENTED_READ},{label:"Top",value:eO.EO.TOP},{label:"New",value:eO.EO.NEW}];function uC(e){var t=e.renderMode,n=e.setRenderMode;return mv.Dx.useExperiment({}).showSelector?(0,r.jsx)(c.PhF,{className:JA().selector,options:lC,select:n,isSelected:function(e){return e===t},serialize:function(e){return String(e)}}):null}var fC=(0,yb.Z)((function(e){var t=e.guild,n=e.width,i=e.height,a=t.id,l=(0,s.e7)([ap.ZP],(function(){return ap.ZP.getSection(Ig.oC.GUILD_HOME)})),u=(0,s.e7)([dv.Z],(function(){return dv.Z.getCurrentSearchId() })),f=iC(o.useState(!1),2),d=f[0],p=f[1],h=iC(o.useState(M.$Y6),2),E=h[0],y=h[1],m=l===M.ULH.SEARCH,b=l===M.ULH.SIDEBAR_CHAT,g=m||b,v=o.useRef(null),_=(0,gb.Z)("top-messages",v),I=(0,mb.Z)().ref,S=iC(o.useState(eO.EO.SEGMENTED_READ),2),T=S[0],N=S[1],A=(0,bb.Z)(eO.Gj),C=o.useRef(!1),P=bv.M.useExperiment({guildId:a}).hasNewHeader,j=yg(t).homeHeaderScroll;o.useEffect((function(){C.current=!1}),[a]);o.useEffect((function(){null==Xb.ZP.getLoadId(a)&&cd.Z.closeChannelSidebar(Ig.oC.GUILD_HOME)}),[a]);!function(e){o.useEffect((function(){var t=yv.Z.getHomeSessionId(e);return function(){Ie.default.track(M.rMx.HOME_EXITED,{guild_id:e,home_session_id:t})}}),[e])}(a);o.useLayoutEffect((function(){var e=yv.Z.getSavedScrollPosition(a);if(!P||0!==e&&null!=e){if(null!=e){var t;null===(t=v.current)||void 0===t||t.scrollTo({to:e})}}else{var n;null===(n=v.current)||void 0===n||n.scrollTo({to:j})}return function(){var e,t=null===(e=v.current)||void 0===e?void 0:e.getScrollerState();null!=t&&function(e,t){ O.Z.dispatch({type:"GUILD_HOME_SET_SCROLL_POSITION",guildId:e,scrollPosition:t})}(a,t.scrollTop)}}),[a,P,j]);var R=n-M.PrS-E,x=!(g&&R<936)||A,w=o.useRef(null),D=o.useCallback((function(){if(!C.current){(0,gv.X)(a);C.current=!0;Ie.default.track(M.rMx.HOME_FIRST_SCROLL_STARTED,{guild_id:a,home_session_id:yv.Z.getHomeSessionId(a)})}}),[a]);(0,Am.Tt)({location:Q.Z.Messages.GUILD_HOME_HTML_TITLE.format({guildName:t.name})});var Z,L=(0,c.mFp)(),U=mv.fV.useExperiment({guildId:a}).showDeprecationNotice,k=x?(0,r.jsx)(sC,{guild:t,containerHeight:i,isUsingCollapsedLayout:A},"widgets"):null;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:lh()(nO().chat,JA().background,(Z={},tC(Z,nO().threadSidebarOpen,g),tC(Z,nO().threadSidebarFloating,g&&d),Z)),children:[(0,r.jsx)(aC,{guild:t,seenManagerRef:w}),(0,r.jsxs)("div",{ref:I,className:nO().content,children:[(0,r.jsx)(pb.bG,{navigator:_,children:(0,r.jsx)(pb.SJ,{children:function(e){var n=e.ref,o=oC(e,["ref"]);return(0, r.jsxs)(c.yWw,rC(nC({customTheme:!0,onScroll:D,className:lh()(JA().homeContainer,tC({},JA().homeContainerCollapsed,A)),ref:function(e){v.current=e;var t;n.current=null!==(t=null==e?void 0:e.getScrollerNode())&&void 0!==t?t:null}},o,L),{children:[P&&(0,r.jsx)(gg,{guild:t}),A?k:null,(0,r.jsxs)("div",{className:JA().homeContent,children:[U&&!t.hasFeature(M.oNc.GUILD_HOME_DEPRECATION_OVERRIDE)&&(0,r.jsxs)("div",{className:JA().deprecationNotice,children:[(0,r.jsxs)("div",{className:JA().deprecationNoticeContent,children:[(0,r.jsx)(c.X6q,{className:JA().heading,variant:"heading-lg/semibold",color:"always-white",children:Q.Z.Messages.GUILD_HOME_DEPRECATION_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"always-white",children:Q.Z.Messages.GUILD_HOME_DEPRECATION_DESCRIPTION})]}),(0,r.jsx)("img",{width:180,className:JA().image,src:sA(),alt:"","aria-hidden":!0})]}),(0,r.jsx)(c.y5t,{component:(0,r.jsxs)("div",{className:JA().topMessagesHeader,children:[(0,r.jsx)(c.X6q,{ variant:"heading-md/semibold",children:Q.Z.Messages.GUILD_FEED_TITLE}),(0,r.jsx)(uC,{renderMode:T,setRenderMode:N})]}),children:(0,r.jsx)(wA,{guild:t,renderMode:T,scrollerRef:v,seenManagerRef:w})})]}),A?null:k]}))}})}),m&&null!=u&&(0,r.jsx)(cv.Z,{searchId:u})]})]}),b?(0,r.jsx)(cC,{pageWidth:n,onSidebarResize:function(e,t){p(t);y(e)}}):null]})})),dC=(0,yb.Z)((function(e){var t,n=e.guild,i=e.width,a=(0,dE.ZP)([ap.ZP],(function(){return ap.ZP.getSection(Ig.oC.GUILD_HOME)})),s=cO(o.useState(!1),2),l=s[0],u=s[1],f=cO(o.useState(M.$Y6),2),d=f[0],p=f[1],h=a===M.ULH.SIDEBAR_CHAT,E=o.useRef(null),y=(0,gb.Z)("top-messages",E),m=(0,c.mFp)(),b=(0,bb.Z)(eO.Gj),g=i-M.PrS-d,O=h&&g<1020||b,v=(0,dE.ZP)([Cb.Z],(function(){return Cb.Z.getSettings(n.id)})),_=null==v?void 0:v.welcomeMessage,I=(0,_g.Z)(n.id);o.useEffect((function(){if(v===Cb.P)(0,Nb.cP)(n.id);else if(null!=v){var e,t,r,o,i;Ie.default.track(M.rMx.SERVER_GUIDE_VIEWED,aO(iO({},(0,Sb.hH)(n.id)),{ num_member_actions:null!==(r=null===(e=v.newMemberActions)||void 0===e?void 0:e.length)&&void 0!==r?r:0,num_member_actions_completed:Object.keys(null!==(o=Pb.Z.getCompletedActions(n.id))&&void 0!==o?o:{}).length,num_resource_channels:null!==(i=null===(t=v.resourceChannels)||void 0===t?void 0:t.length)&&void 0!==i?i:0}))}}),[n.id,v]);o.useEffect((function(){return function(){cd.Z.closeChannelSidebar(Ig.oC.GUILD_HOME)}}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:lh()(nO().chat,xg().background,(t={},oO(t,nO().threadSidebarOpen,h),oO(t,nO().threadSidebarFloating,h&&l),t)),children:[(0,r.jsx)(lO,{guild:n}),(0,r.jsx)(pb.bG,{navigator:y,children:(0,r.jsx)(pb.SJ,{children:function(e){var t=e.ref,o=sO(e,["ref"]);return(0,r.jsxs)(c.yWw,aO(iO({className:lh()(xg().homeContainer,oO({},xg().homeContainerCollapsed,O)),ref:function(e){E.current=e;var n;t.current=null!==(n=null==e?void 0:e.getScrollerNode())&&void 0!==n?n:null}},o,m),{children:[(0,r.jsx)("div",{ className:xg().maxWidthWrapper,children:(0,r.jsx)(gg,{guild:n})}),(0,r.jsxs)("div",{className:lh()(xg().homeContent,xg().maxWidthWrapper),children:[(0,r.jsxs)("div",{className:xg().mainContent,children:[(0,r.jsx)(Jg.Z,{guildId:n.id,welcomeMessage:_}),I&&(0,r.jsx)(Zg.Z,{guildId:n.id}),!I||O?(0,r.jsx)($g,{guild:n,isNewMember:I}):null]}),O?null:(0,r.jsx)(Dg,{guild:n,isNewMember:I})]})]}))}})})]}),h?(0,r.jsx)(Sg,{pageWidth:i,onSidebarResize:function(e,t){u(t);p(e)}}):null]})}));const pC=function(e){var t=e.guildId,n=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(t)}),[t]),i=_v(),a=(0,s.e7)([fv.Z],(function(){return fv.Z.hasLoadedExperiments})),c=(0,Qb.g)(t);o.useLayoutEffect((function(){!function(e){O.Z.dispatch({type:"GUILD_HOME_ENSURE_HOME_SESSION",guildId:e})}(t)}),[t]);o.useEffect((function(){if(a){var e=yv.Z.getHomeSessionSource(t),n=(0,mv.YM)(t)||c;if(null!=i){var r=i.channelId,o=i.messageId;if(!n){(0,sv.jd)(r,o);return}e=eO.SB.HIGHLIGHTS}else if(!n){f.Z.escapeToDefaultChannel(t) ;return}!function(e,t){Ie.default.track(M.rMx.HOME_OPENED,{guild_id:e,home_session_id:yv.Z.getHomeSessionId(e),home_session_source:t})}(t,e)}}),[t,i,a,c]);return null==n?(0,r.jsx)(Eb.Z,{channelId:void 0}):c?(0,r.jsx)(dC,{guild:n}):(0,r.jsx)(fC,{guild:n})};var hC=n(630346),EC=n(130585),yC=n(153771),mC=n(714305),bC=n(976685),gC=n(886391),OC=n(201615),vC=n(989280),_C=n(571094),IC=n.n(_C),SC=n(692760),TC=n.n(SC);const NC=function(e){var t=e.onCancel,n=e.onLeave,o=e.guild,i=void 0===o?null:o;return(0,r.jsxs)("div",{className:IC().confirmation,children:[(0,r.jsxs)("div",{className:IC().confirmationContent,children:[null!==i?(0,r.jsx)(tg.Z,{size:tg.Z.Sizes.LARGER,guild:i,className:IC().guildIcon}):(0,r.jsx)("img",{alt:Q.Z.Messages.MEMBER_VERIFICATION_PENDING_APPLICATION_ICON,src:TC(),className:IC().verificationStateIcon}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:IC().header, children:null!=(null==i?void 0:i.name)?Q.Z.Messages.MEMBER_VERIFICATION_APPLICATION_CONFIRMATION_TITLE_WITH_GUILD_NAME.format({guildName:i.name}):Q.Z.Messages.MEMBER_VERIFICATION_APPLICATION_CONFIRMATION_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"header-secondary",children:Q.Z.Messages.MEMBER_VERIFICATION_APPLICATION_CONFIRMATION_SUBTITLE})]}),(0,r.jsxs)("div",{className:IC().confirmationButtonColumn,children:[(0,r.jsx)(c.zxk,{onClick:t,look:c.zxk.Looks.LINK,color:c.zxk.Colors.LINK,size:c.zxk.Sizes.SMALL,children:Q.Z.Messages.MEMBER_VERIFICATION_CANCEL_APPLICATION}),(0,r.jsx)(c.zxk,{onClick:n,look:c.zxk.Looks.LINK,color:c.zxk.Colors.LINK,size:c.zxk.Sizes.SMALL,children:Q.Z.Messages.MEMBER_VERIFICATION_PENDING_APPLICATION_MODAL_WITHDRAW_AND_LEAVE})]})]})};var AC=n(680068),CC=n(79543),PC=n(748492),jC=n.n(PC);function RC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e) ;for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}var _P=function(){return null};function IP(e,t){var n=t.toLocaleString();switch(e){case gC.wB.SUBMITTED:return Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_PENDING_COUNT_HYPEN.format({count:n});case gC.wB.REJECTED:return Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_REJECTED_COUNT_HYPEN.format({count:n});case gC.wB.APPROVED:return Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_APPROVED_COUNT_HYPEN.format({count:n});default:return""}}function SP(e){var t=e.status,n=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_PENDING_APPLICATIONS_TITLE,o=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_PENDING_APPLICATIONS_BODY;switch(t){case gC.wB.REJECTED:n=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_REJECTED_APPLICATIONS_TITLE;o=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_REJECTED_APPLICATIONS_BODY;break;case gC.wB.APPROVED: n=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_APPROVED_APPLICATIONS_TITLE;o=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_APPROVED_APPLICATIONS_BODY;break;default:n=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_PENDING_APPLICATIONS_TITLE;o=Q.Z.Messages.GUILD_SETTINGS_MEMBER_VERIFICATION_EMPTY_PENDING_APPLICATIONS_BODY}return(0,r.jsxs)("div",{className:lP().emptyContainer,children:[(0,r.jsxs)("div",{className:lP().emptyIcon,children:[(0,r.jsx)(sP.Z,{className:lP().star}),(0,r.jsx)(gA.Z,{className:lP().checkmark}),(0,r.jsx)(aP.Z,{className:lP().plus})]}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",children:n}),(0,r.jsx)(c.xvT,{color:"header-secondary",className:lP().emptyBody,variant:"text-sm/normal",children:o})]})}const TP=function(e){var t=e.applicationStatus,n=e.guildJoinRequests,o=e.guildId,i=e.onScroll,a=e.listRef,l=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(o)}),[o]),u=(0,s.e7)([kC.Z],(function(){return kC.Z.isFetching() })),f=u?[n.length+25]:[n.length],d=GC({guildId:o}),p=(0,JC.A)({guildId:o}),h=(0,iP.Z)("guild-join-requests"),E=function(e){var i,a=e.row,s=n[a];return null==s?(0,r.jsx)(gP,{},a):(0,r.jsx)(bP,{className:lh()((i={},OP(i,lP().selected,d===s),OP(i,lP().siblingSelected,d===n[a-1]),i)),guild:l,guildJoinRequest:s,onClick:function(){return yC.Z.setSelectedGuildJoinRequest(o,s)},applicationStatus:t},"".concat(s.userId,"-").concat(s.applicationStatus,"-").concat(a))};return u||0!==n.length?(0,r.jsxs)(r.Fragment,{children:[0!==p&&t===gC.wB.SUBMITTED&&(0,r.jsx)(c.xvT,{className:lP().title,variant:"text-xs/semibold",color:"header-secondary",children:IP(t,p).toUpperCase()}),(0,r.jsx)(pb.bG,{navigator:h,children:(0,r.jsx)(pb.SJ,{children:function(e){var t=e.ref,n=e.role,o=vP(e,["ref","role"]);return(0,r.jsx)(c.aVo,function(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function LP(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=ZP(e,["width","height","color","foreground"]);return(0,r.jsx)("svg",DP(function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o.push((0,r.jsx)(c.xvT,{variant:"text-xs/medium",className:kj().channelSubtitle,color:"text-brand",children:Q.Z.Messages.CHANNEL_HIGHLIGHTS_COUNT.format({count:n})},"thread-count"));e.type===M.d4z.GUILD_FORUM&&t>=1&&o.push((0, r.jsx)(c.xvT,{variant:"text-xs/normal",className:kj().channelSubtitle,children:Q.Z.Messages.ACTIVE_FORUM_POST_COUNT.format({count:t})},"thread-count"));Wj.has(e.type)||o.push((0,r.jsx)(c.xvT,{variant:"text-xs/normal",className:kj().channelSubtitle,children:(0,hj.qw)(e.id)},"active"));null!=e.topic&&e.topic.length>0&&o.push((0,r.jsx)(vj.Z,{children:(0,r.jsx)(c.xvT,{className:kj().topic,variant:"text-xs/normal",children:kg.Z.parseTopic(e.topic,!0,{channelId:e.id})})},"topic"));return[o.map((function(e,t){return[e,(0,r.jsx)(Xj,{index:t},"subtitle-separator-".concat(t))]}))].flat(2).slice(0,-1)}(i,b,g),S=function(e){e.stopPropagation();if(zj.has(i.type)||e.shiftKey){(0,K.XU)(l.id,i.id);return!0}if(i.isGuildStageVoice()||i.isGuildVoice()){(0,c_.Cq)(i);return!0}cd.Z.openChannelAsSidebar({guildId:i.guild_id,channelId:i.id,baseChannelId:Ig.oC.CHANNEL_BROWSER});return!0},T=Q.Z.Messages.CHANNEL_BROWSER_VIEW ;i.isGuildStageVoice()||i.isGuildVoice()?T=Q.Z.Messages.JOIN:i.isForumChannel()&&(T=Q.Z.Messages.OPEN);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.ua7,{text:m,delay:500,position:h,children:function(e){var t;return(0,r.jsxs)(c.P3F,Fj(Vj({className:lh()(kj().channelRow,(t={},Hj(t,kj().firstChannel,u),Hj(t,kj().lastChannel,f),Hj(t,kj().disabled,y),t))},e),{onClick:v,onContextMenu:_,children:[(0,r.jsxs)("div",{className:kj().channelInfo,children:[(0,r.jsxs)("div",{className:kj().channelName,children:[(0,r.jsx)(pj._,{channel:i,guild:l}),(0,r.jsx)(vj.Z,{className:kj().name,children:(0,r.jsx)(c.xvT,{className:kj().channelText,variant:"text-md/medium",lineClamp:1,color:y?"text-muted":"text-normal",children:i.name})}),O?(0,r.jsx)(_j.IG,{text:Q.Z.Messages.NEW,color:$b.Z.unsafe_rawColors.BRAND_260.css,className:kj().titleBadge}):null]}),(0,r.jsx)("div",{className:kj().channelSubtitles,children:I})]}),(0,r.jsxs)("div",{className:kj().channelActions,children:[(0,r.jsx)(c.zxk,{ look:c.iLD.OUTLINED,color:c.Ttl.PRIMARY,size:c.PhG.SMALL,className:kj().viewChannelButton,onClick:S,children:T}),(0,r.jsx)(c.XZJ,{"aria-checked":E,value:E,type:c.XZJ.Types.INVERTED,disabled:y,innerClassName:kj().checkboxInner,displayOnly:!0})]})]}))}}),!f&&(0,r.jsx)(qj,{})]})}));function $j(e){var t,n=e.categories,i=e.guild,a=e.className,l=e.innerClassName,u=e.hasSidebar,f=function(e){var t=(0,s.e7)([cp.Z],(function(){return cp.Z.getPendingChannelUpdates(e)}));o.useEffect((function(){Aj(e);return function(){return Aj(e)}}),[e]);o.useEffect((function(){null!=t&&(0,Tj.C1)(e,t)}),[e,t]);var n=o.useCallback((function(e,t,n){var r=cp.Z.isChannelOptedIn(e,t),o=t===n;!r&&Sj.Z.isCollapsed(n)&&null!=n&&(0,Ij.mJ)(n);(0,Nj.hi)(e)?o?(0,Nj.rz)(e,{include:new Set([t])}):(0,Nj.rz)(e,{exclude:new Set([t])}):(0,Tj.k$)(e,t,!r,{section:M.jXE.CHANNEL_BROWSER})}),[]);return{onChannelClick:n}}(i.id).onChannelClick,d=(0,un.wE)(ln.z$.CHANNEL_BROWSER_NUX)?0:-1,p=o.useCallback((function(e){var t=e.section ;if(0===t&&-1===d)return null;var o=n._categories[t+d];return(0,r.jsx)(Kj,{channel:o.channel,guild:i,onCategoryClick:f},o.channel.id)}),[n,i,d,f]),h=o.useCallback((function(e){var t=e.section,o=e.row;if(0===t&&-1===d)return(0,r.jsx)(Lj,{guild:i});var a=n._categories[t+d],s=n[a.channel.id][o];return null==s?null:(0,r.jsx)(Qj,{category:a.channel,channel:s.channel,guild:i,isFirstChannel:0===o,isLastChannel:n[a.channel.id].length-1===o,tooltipDirection:u?"right":"top",onChannelClick:f},s.channel.id)}),[n,i,d,u,f]),E=(t=i.id,(0,Rj.te)(t)?250:152),y=(0,hj.tn)(i.id,n,64,E);return(0,r.jsx)(c._2F,{className:a,innerClassName:lh()(l,kj().scrollerInner),sectionHeight:48,rowHeight:function(e){return y[e].rowHeight},renderSection:p,renderRow:h,sections:y.map((function(e){return e.rowCount}))},"channel-browser-list")}var Jj=n(820272),eR=n.n(Jj);function tR(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0)u=PR(l,a);else if(c.length>0){u=function(e,t){return 0===e.length?"":Q.Z.Messages.ONBOARDING_HELP_TEXT_ADD_CHANNELS.format({count:e.length,extraCount:Math.max(e.length-2,0),channel1:e[0],channel2:e[1],itemHook:t})}(c,a);l.length>0&&(f=PR(l,a,!0))}return{helpText:u,helpTextAdditional:f}}function RR(e){var t,n=e.guild,r=e.prompt,o=e.selectedRoleIds,i=e.selectedChannelIds,a=e.itemHook,c=(0,s.Wu)([S.Z,Y.default,Ja.Z],(function(){return Array.from(i).map((function(e){return S.Z.getChannel(e)})).filter(_o.lm).map((function(e){return(0,op.F6)(e,Y.default,Ja.Z,!0)}))})),l=Array.from(o).map((function(e){var r;return null===(r=(null!==(t=null==n?void 0:n.roles)&&void 0!==t?t:{})[e])||void 0===r?void 0:r.name})).filter(_o.lm).map((function(e){return"@".concat(e) })),u=(null==r?void 0:r.singleSelect)?"":Q.Z.Messages.ONBOARDING_CHOOSE_ALL_OPTIONS;0===c.length&&l.length>0?u=Q.Z.Messages.CUSTOMIZE_COMMUNITY_ADD_ROLES.format({count:l.length,extraCount:Math.max(l.length-2,0),role1:l[0],role2:l[1],itemHook:a}):c.length>0&&0===l.length?u=Q.Z.Messages.CUSTOMIZE_COMMUNITY_ADD_CHANNELS.format({count:c.length,extraCount:Math.max(c.length-2,0),channel1:c[0],channel2:c[1],itemHook:a}):c.length>0&&l.length>0&&(u=Q.Z.Messages.CUSTOMIZE_COMMUNITY_ADD_CHANNELS_AND_ROLES.format({channelCount:c.length,extraChannelCount:Math.max(c.length-2,0),channel1:c[0],channel2:c[1],itemHook:a,roleCount:l.length,extraRoleCount:Math.max(l.length-2,0),role1:l[0],role2:l[1]}));return{helpText:u,helpTextAdditional:""}}function xR(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function MR(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function wR(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function DR(e){var t=e.width,n=void 0===t?120:t,o=e.height,i=void 0===o?80:o,a=e.backgroundColor,s=e.foregroundColor,c=wR(e,["width","height","backgroundColor","foregroundColor"]);return(0,r.jsxs)("svg",MR(function(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function VR(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=HR(e,["width","height","color","foreground"]);return(0,r.jsx)("svg",BR(function(e){for(var t=1;te.length)&&(t=e.length) ;for(var n=0,r=new Array(t);n0?(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"header-secondary",children:a.description}):null]}),(0,r.jsx)(mm.animated.div,{className:YR().checkIcon,style:I,children:(0,r.jsx)(VR,{width:10,height:10,color:$b.Z.unsafe_rawColors.WHITE_500.css})}),A((function(e,t){return v>0&&t&&(0,r.jsx)(mm.animated.div,{className:YR().memberCount,style:e,children:(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"always-white", children:Q.Z.Messages.ONBOARDING_OPTION_ROLE_COUNTS.format({memberCount:v})})})})),_&&(0,r.jsx)(_j.IG,{color:$b.Z.unsafe_rawColors.BRAND_260.css,text:Q.Z.Messages.NEW,className:YR().newBadge})]})})})}var $R=n(824390),JR=n.n($R),ex=n(737797),tx=n(312406),nx=n.n(tx);function rx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;return(0,r.jsxs)("div",{className:nx().selectOption,children:[(0,r.jsxs)("div",{className:nx().selectOptionTitle,children:[cx(e.emoji)&&(0,r.jsx)(ZR.Z,{emojiId:null===(n=e.emoji)||void 0===n?void 0:n.id,emojiName:null===(o=e.emoji)||void 0===o?void 0:o.name,animated:null!==(l=null===(i=e.emoji)||void 0===i?void 0:i.animated)&&void 0!==l&&l}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",children:e.title})]}),a&&e.isUnseen&&(0,r.jsx)(_j.IG,{color:$b.Z.unsafe_rawColors.BRAND_260.css,text:Q.Z.Messages.NEW,className:nx().optionNewBadge}),f&&(0,r.jsx)("div",{className:nx().selectOptionMemberCount,"data-hover":!0,children:(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"always-white",children:Q.Z.Messages.ONBOARDING_OPTION_ROLE_COUNTS.format({memberCount:u})})})]})}),[a,s]),d=o.useCallback((function(e,t){var n=e.data ;return 0===t.length||JR()(t.toLowerCase(),n.title.toLowerCase())}),[]);return(0,r.jsx)(ex.Z,{styleOverrides:lx,clearable:!1,isMulti:!0,options:t,onChange:i,value:n,closeMenuOnSelect:!1,multiValueRenderer:u,optionRenderer:f,filterOption:d})}var fx=n(322008),dx=n(290679),px=n(814178),hx=n.n(px),Ex=n(913198),yx=n.n(Ex);function mx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("hr",{className:hx().separator}),(0, r.jsx)(c.xvT,{variant:"text-xs/semibold",color:"text-muted",className:hx().title,children:Q.Z.Messages.ROLES}),(0,r.jsx)("div",{className:hx().roles,children:null==h?void 0:h.map((function(e){var t;return(0,r.jsxs)("div",{className:hx().role,children:[(0,r.jsx)(c.xko,{color:null!==(t=e.colorString)&&void 0!==t?t:(0,dR.Rf)(M.p6O),className:hx().roleDot}),(0,r.jsx)(c.xvT,{variant:"text-xs/medium",color:"header-primary",children:e.name})]},e.id)}))})]})]})]})}function Tx(e){var t,n=e.prompt,i=e.guild,a=vx(o.useState(null),2),l=a[0],u=a[1],f=vx(o.useState(new Set),2),d=f[0],p=f[1],h=null==n||null===(t=n.options)||void 0===t?void 0:t.filter((function(e){return d.has(e.id)})),E=(0,SR.L6)(h),y=(0,SR.dX)(h),m=(0,s.Wu)([IR.Z],(function(){return IR.Z.getOnboardingResponsesForPrompt(i.id,n.id)})),b=RR({guild:i,prompt:n,selectedRoleIds:E,selectedChannelIds:y,itemHook:function(e,t){return(0,r.jsx)(c.xvT,{variant:"text-xs/medium",color:"header-primary",children:e},t)} }),g=b.helpText,O=b.helpTextAdditional,v=CR(i.id).handleSelectOption,_=(0,c.dQu)($b.Z.unsafe_rawColors.BRAND_500),I=(0,mm.useSpring)({from:{color:n.isNew?_.hex({opacity:1}):_.hex({opacity:0})},color:_.hex({opacity:0}),config:{duration:300},delay:500}),S=n.options.map((function(e){return gx({value:e.id},e)})),T=n.options.filter((function(e){return m.includes(e.id)})).map((function(e){return e.id}));return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(mm.animated.div,{className:hx().prompt,style:{borderColor:I.color},children:[n.isNew&&(0,r.jsx)(_j.IG,{color:(0,ER.Lq)(M.Ilk.BRAND_260),text:Q.Z.Messages.NEW,className:hx().newBadge}),(0,r.jsxs)(c.X6q,{className:hx().promptTitle,variant:"heading-md/semibold",color:"header-primary",children:[n.title,n.required?(0,r.jsx)("span",{className:lh()(hx().required,bx({},hx().error,(null==l?void 0:l.type)===Ix)),children:"*"}):null]}),(0,r.jsx)(ux,{options:S,value:T,onChange:function(e){var t=e.find((function(e){return!m.includes(e.id) })),r=e.map((function(e){return e.id}));if(null!=t){v(n,t,!0);n.singleSelect&&n.options.forEach((function(e){return d.delete(e.id)}));d.add(t.id)}else{var o=m.filter((function(e){return!r.includes(e)})),i=n.options.filter((function(e){return o.includes(e.id)}));if(m.length<=i.length&&n.required){u({type:Ix});return}i.forEach((function(e){v(n,e,!1);d.delete(e.id)}))}p(new Set(d));u(null)},canBeNew:!n.isNew}),(0,r.jsxs)(c.xvT,{variant:"text-xs/normal",color:"text-muted",className:hx().helpText,children:[g," ",O]})]})})}function Nx(e){var t,n=e.prompt,i=e.guild,a=vx(o.useState(null),2),l=a[0],u=a[1],f=vx(o.useState(new Set),2),d=f[0],p=f[1],h=null==n||null===(t=n.options)||void 0===t?void 0:t.filter((function(e){return d.has(e.id)})),E=(0,SR.L6)(h),y=(0,SR.dX)(h),m=(0,s.Wu)([IR.Z],(function(){return IR.Z.getOnboardingResponsesForPrompt(i.id,n.id)})),b=RR({guild:i,prompt:n,selectedRoleIds:E,selectedChannelIds:y,itemHook:function(e,t){return(0,r.jsx)(c.xvT,{variant:"text-xs/medium", color:"header-primary",children:e},t)}}),g=b.helpText,O=b.helpTextAdditional,v=CR(i.id).handleSelectOption,_=(0,c.dQu)($b.Z.unsafe_rawColors.BRAND_500),I=(0,mm.useSpring)({from:{color:n.isNew?_.hex({opacity:1}):_.hex({opacity:0})},color:_.hex({opacity:0}),config:{duration:300},delay:500});return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(mm.animated.div,{className:hx().prompt,style:{borderColor:I.color},children:[n.isNew&&(0,r.jsx)(_j.IG,{color:(0,ER.Lq)(M.Ilk.BRAND_260),text:Q.Z.Messages.NEW,className:hx().newBadge}),(0,r.jsxs)(c.X6q,{className:hx().promptTitle,variant:"heading-md/semibold",color:"header-primary",children:[n.title,n.required?(0,r.jsx)("span",{className:lh()(hx().required,bx({},hx().error,(null==l?void 0:l.type)===Ix)),children:"*"}):null]}),(0,r.jsx)("div",{className:hx().promptOptions,children:n.options.map((function(e){return(0,r.jsx)(QR,{hideMemberCount:!0,guildId:i.id,option:e,onSelect:function(t){return function(e,t){if(t||1!==m.length||!n.required){ v(n,e,null!=t&&t);n.singleSelect&&t&&n.options.forEach((function(e){return d.delete(e.id)}));t?d.add(e.id):d.delete(e.id);p(new Set(d));u(null)}else u({type:Ix})}(e,t)},selected:m.includes(e.id),canBeNew:!n.isNew},e.id)}))}),(0,r.jsxs)(c.xvT,{variant:"text-xs/normal",color:"text-muted",className:hx().helpText,children:[g," ",O]})]})})}function Ax(e){var t=e.guildId,n=e.onBrowseChannels,i=(0,Jb.ZP)()===M.BRd.DARK,a=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(t)})),l=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),u=(0,bb.Z)("(min-width: 1344px)")&&null!=l,f=o.useCallback((function(){(0,K.uL)(M.Z5c.CHANNEL(t,Ig.oC.CHANNEL_BROWSER));null==n||n()}),[t,n]),d=(0,s.e7)([OR.ZP],(function(){return OR.ZP.hasUnread(t,dx.W.GUILD_ONBOARDING_QUESTION)})),p=function(e){var t=(0,dE.Wu)([IR.Z],(function(){return IR.Z.getEnabledOnboardingPrompts(e)}));return o.useMemo((function(){for(var e=0,n=[],r=[],o=[],i=[],a=0;a0||y.length>0)&&(0, r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{children:(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",color:"header-primary",children:Q.Z.Messages.ONBOARDING_PROMPT_ANSWERS_NEW.format({count:E.length+m})})}),E.map(g),y.map(g),(0,r.jsx)("div",{className:hx().sectionSeparator})]}),b.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",color:"header-primary",children:Q.Z.Messages.ONBOARDING_PROMPT_QUESTIONS_HEADER.format({count:b.length})}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"text-muted",children:Q.Z.Messages.ONBOARDING_PROMPT_MEMBER_DESCRIPTION})]}),b.map(g)]})]}),u&&(0,r.jsx)(Sx,{guild:a,user:l})]})})}var Cx=n(142665),Px=n.n(Cx);function jx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0})),m=(0,hj.fU)(t);return null==i?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:lh()(nO().chat,Rx({},nO().threadSidebarOpen,h)),children:[(0,r.jsx)(Mx,{guild:i,previousChannel:E}),(0,r.jsxs)("div",{className:lh()(nO().content,Px().container),children:[a&&(0,r.jsxs)(c.njP,{className:Px().tabBar,type:"top",look:"brand",selectedItem:u, onItemSelect:function(e){return f(e)},children:[(0,r.jsx)(c.njP.Item,{className:Px().tabBarItem,id:fx.l7.CUSTOMIZE,children:Q.Z.Messages.OPT_IN_GUILD_NOTICE_CTA},fx.l7.CUSTOMIZE),(0,r.jsxs)(c.njP.Item,{className:Px().tabBarItem,id:fx.l7.BROWSE,"aria-label":Q.Z.Messages.CHANNEL_BROWSER_TITLE,children:[Q.Z.Messages.CHANNEL_BROWSER_TITLE,(0,r.jsx)(_j.IG,{text:y?Q.Z.Messages.CHANNEL_TYPE_NEW:m,color:y?$b.Z.unsafe_rawColors.BRAND_260.css:$b.Z.colors.BACKGROUND_ACCENT.css,className:lh()(Rx({},Px().newBadge,y))})]},fx.l7.BROWSE)]}),function(){switch(u){case fx.l7.CUSTOMIZE:return(0,r.jsx)(Ax,{guildId:t,onBrowseChannels:function(){return f(fx.l7.BROWSE)}});case fx.l7.BROWSE:default:return(0,r.jsx)(lR,{guildId:t})}}()]})]}),h&&(0,r.jsx)(cR,{channelId:p})]})}var Dx=n(465704),Zx=n(302685),Lx=n(48543),Ux=n(362660),kx=n(189827),Gx=n(28417);const Bx=(0,tc.B)({kind:"user",id:"2023-01_guild_onboarding_includes_rules",label:"Guild Onboarding includes rules experience",defaultConfig:{includeRules:!1}, treatments:[{id:1,label:"Last page of onboarding is rules",config:{includeRules:!0}}]});var Hx=n(780409),Vx=n(742053),Fx=n.n(Vx);function Yx(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function zx(e){for(var t=1;t0&&(0,r.jsxs)(c.zxk,{className:Fx().button,innerClassName:Fx().buttonInner,onClick:function(){return u(p.length)},size:c.zxk.Sizes.MEDIUM,look:c.zxk.Looks.OUTLINED,grow:!1,color:c.zxk.Colors.PRIMARY,children:[(0,r.jsx)(gI.Z,{className:Fx().arrow,direction:gI.Z.Directions.LEFT}),Q.Z.Messages.BACK]})}),(0,r.jsxs)("div",{className:Fx().rightButtons,children:[(0,r.jsxs)(c.xvT,{className:Fx().helpText,variant:"text-xs/normal",color:"text-muted",children:[O," ",v]}),(0,r.jsx)(c.ua7,{text:h?Q.Z.Messages.ONBOARDING_REQUIRED_QUESTION:null,children:function(e){var t=e.onMouseEnter,n=e.onMouseLeave;return(0,r.jsx)(c.zxk,{className:Fx().button,innerClassName:Fx().buttonInner,onMouseEnter:t,onMouseLeave:n,onClick:function(){return i?d():f(p.length)},disabled:h,size:c.zxk.Sizes.MEDIUM,look:c.zxk.Looks.FILLED,grow:!1,color:b?c.zxk.Colors.PRIMARY:c.zxk.Colors.BRAND,children:i?(0, r.jsxs)(r.Fragment,{children:[Q.Z.Messages.FINISH,(0,r.jsx)("span",{className:Fx().finishEmoji,role:"img","aria-hidden":!0,children:"🎉"})]}):(0,r.jsxs)(r.Fragment,{children:[b?Q.Z.Messages.SKIP:Q.Z.Messages.NEXT,(0,r.jsx)(gI.Z,{className:Fx().arrow,direction:gI.Z.Directions.RIGHT})]})})}})]})]})]})})}function Xx(e){var t=e.headerId,n=e.guild,o=e.step,i=e.lastPrompt,a=e.questionCount,s=e.currentPrompt,l=e.selectOption,u=e.gotoPrevPrompt,f=e.gotoNextPrompt,d=e.completeOnboarding,p=(0,dE.Wu)([IR.Z],(function(){return IR.Z.getOnboardingResponsesForPrompt(n.id,s.id)})),h=0===p.length&&(null==s?void 0:s.required),E=null==s?void 0:s.options.filter((function(e){return p.includes(e.id)})),y=(0,SR.L6)(E),m=(0,SR.dX)(E),b=0===p.length,g=jR({guild:n,prompt:s,selectedRoleIds:y,selectedChannelIds:m,itemHook:Kx}),O=g.helpText,v=g.helpTextAdditional;return(0,r.jsx)("div",{className:Fx().prompt,children:(0,r.jsxs)("div",{className:Fx().promptContent,children:[(0,r.jsxs)(c.zJl,{ className:Fx().scrollerContent,children:[(0,r.jsxs)("div",{className:Fx().questionHeader,children:[(0,r.jsx)(c.xvT,{variant:"text-sm/medium",color:"text-muted",children:Q.Z.Messages.ONBOARDING_QUESTION_COUNT.format({currentQuestion:o+1,questionCount:a})}),s.required?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xvT,{variant:"text-xs/normal",className:Fx().headerSeparator,children:"·"}),(0,r.jsx)(c.xvT,{variant:"text-sm/medium",color:"text-brand",children:Q.Z.Messages.ONBOARDING_PROMPT_REQUIRED_LABEL})]}):null]}),(0,r.jsx)(c.X6q,{className:Fx().title,variant:"heading-xl/semibold",color:"header-primary",id:t,children:s.title}),(0,r.jsx)("div",{className:Fx().promptOptions,children:s.options.map((function(e){return(0,r.jsx)(QR,{guildId:n.id,option:e,onSelect:function(t){return l(s.id,e.id,null!=t&&t)},selected:p.includes(e.id)},e.id)}))})]}),(0,r.jsxs)("div",{className:Fx().navButtons,children:[(0,r.jsx)("div",{className:Fx().leftButtons,children:o>0&&(0,r.jsxs)(c.zxk,{ className:Fx().button,innerClassName:Fx().buttonInner,onClick:function(){return u(p.length)},size:c.zxk.Sizes.MEDIUM,look:c.zxk.Looks.OUTLINED,grow:!1,color:c.zxk.Colors.PRIMARY,children:[(0,r.jsx)(gI.Z,{className:Fx().arrow,direction:gI.Z.Directions.LEFT}),Q.Z.Messages.BACK]})}),(0,r.jsxs)("div",{className:Fx().rightButtons,children:[(0,r.jsxs)(c.xvT,{className:Fx().helpText,variant:"text-xs/normal",color:"text-muted",children:[O," ",v]}),(0,r.jsx)(c.ua7,{text:h?Q.Z.Messages.ONBOARDING_REQUIRED_QUESTION:null,children:function(e){var t=e.onMouseEnter,n=e.onMouseLeave;return(0,r.jsx)(c.zxk,{className:Fx().button,innerClassName:Fx().buttonInner,onMouseEnter:t,onMouseLeave:n,onClick:function(){return i?d():f(p.length)},disabled:h,size:c.zxk.Sizes.MEDIUM,look:c.zxk.Looks.FILLED,grow:!1,color:b?c.zxk.Colors.PRIMARY:c.zxk.Colors.BRAND,children:i?(0,r.jsxs)(r.Fragment,{children:[Q.Z.Messages.FINISH,(0,r.jsx)("span",{className:Fx().finishEmoji,role:"img","aria-hidden":!0,children:"🎉"})]}):(0, r.jsxs)(r.Fragment,{children:[b?Q.Z.Messages.SKIP:Q.Z.Messages.NEXT,(0,r.jsx)(gI.Z,{className:Fx().arrow,direction:gI.Z.Directions.RIGHT})]})})}})]})]})]})})}function Qx(e){var t=e.guild,n=e.prompts,i=e.step,a=e.selectOption,s=e.completeOnboarding,c=e.setCurrentStep,l=e.headerId,u=e.disableTracking,f=(0,dE.ZP)([bC.Z],(function(){return bC.Z.getRulesPrompt(t.id)})),d=(Bx.getCurrentConfig({}).includeRules||Hx.Z.getCurrentConfig({}).landOnHome)&&null!=f;o.useEffect((function(){mC.Z.fetchVerificationForm(t.id)}),[t.id]);var p=n[i],h=i+1>=n.length&&!d,E=n[0].required;o.useEffect((function(){u||Ie.default.track(M.rMx.GUILD_ONBOARDING_STEP_VIEWED,Wx(zx({},(0,Sb.hH)(t.id)),{step:0,required:E}))}),[t.id,E,u]);var y=function(e){if(!u){Ie.default.track(M.rMx.GUILD_ONBOARDING_STEP_COMPLETED,Wx(zx({},(0,Sb.hH)(t.id)),{step:i,options_selected:e,skipped:0===e,back:!1,in_onboarding:!0,is_final_step:!1}));i0&&Ie.default.track(M.rMx.GUILD_ONBOARDING_STEP_VIEWED,Wx(zx({},(0,Sb.hH)(t.id)),{step:i-1,required:n[i-1].required}))}c(Math.max(0,i-1))};if(null==p)return null;switch(p.type){case fx.FN.MULTIPLE_CHOICE:return(0,r.jsx)(Xx,{guild:t,headerId:l,step:i,questionCount:n.length,currentPrompt:p,lastPrompt:h,selectOption:a,gotoPrevPrompt:m,gotoNextPrompt:y,completeOnboarding:s});case fx.FN.DROPDOWN:return(0,r.jsx)(qx,{guild:t,headerId:l,step:i,questionCount:n.length,currentPrompt:p,lastPrompt:h,selectOption:a,gotoPrevPrompt:m,gotoNextPrompt:y,completeOnboarding:s});default:(0,_o.vE)(p.type)}}function $x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=0&&Ie.default.track(M.rMx.GUILD_ONBOARDING_STEP_VIEWED,rM(nM({},(0,Sb.hH)(n.id)),{step:u,required:i[u].required}))}s(u)},size:c.zxk.Sizes.MEDIUM,look:c.zxk.Looks.OUTLINED,grow:!1,color:c.zxk.Colors.PRIMARY,children:[(0,r.jsx)(gI.Z,{className:Fx().arrow,direction:gI.Z.Directions.LEFT}),Q.Z.Messages.BACK]})}),(0,r.jsxs)("div",{className:Fx().rightButtons,children:[(0,r.jsx)(c.xvT,{className:Fx().helpText,variant:"text-xs/normal",color:"text-muted",children:h?Q.Z.Messages.MEMBER_VERIFICATION_READ_AGREE_RULES:Q.Z.Messages.MEMBER_VERIFICATION_MUST_READ_RULES}),(0,r.jsxs)(c.zxk,{innerClassName:Fx().buttonInner,onClick:m,disabled:!h, size:c.zxk.Sizes.MEDIUM,look:c.zxk.Looks.FILLED,grow:!1,color:c.zxk.Colors.BRAND,children:[Q.Z.Messages.FINISH,(0,r.jsx)("span",{className:Fx().finishEmoji,role:"img","aria-hidden":!0,children:"🎉"})]})]})]})]})})}var sM=n(196583),cM=n.n(sM);function lM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0,P=o.useCallback((function(){(0,kx.kp)(A)&&m&&C?N(0):g()}),[A,m,C,N,g]);o.useEffect((function(){if(!kx.ZP.shouldShowOnboarding(t))return f.Z.escapeToDefaultChannel(t);(0,Zx.E)(t)}),[t]);var j=(0,mm.useTransition)(_,{config:mm.config.default,from:{scale:.8,opacity:0},enter:{scale:1,opacity:1},immediate:n||"cover"!==S&&null!==S}),R=kx.ZP.shouldShowOnboarding(t),x=null==O;o.useEffect((function(){if(!R||x){var e=setTimeout((function(){0;(0,K.uL)(M.Z5c.CHANNEL(t))}),1e3);return function(){return clearTimeout(e)}}}),[R,x,t]);if(!kx.ZP.shouldShowOnboarding(t))return null;if(null==O)return null;var w=function(){switch(_){case"cover":return(0,r.jsx)(Gx.ZP,{guild:O,onboardingStatus:kx.uX.READY,onStart:P});case"rules":return(0,r.jsx)(aM,{setCurrentStep:N,previousPromptIndex:y.length-1,guild:O,prompts:y,completeOnboarding:g}) ;case null:return null;default:return(0,r.jsx)(Qx,{guild:O,prompts:y,step:_,selectOption:b,completeOnboarding:g,setCurrentStep:N})}};return(0,r.jsxs)("div",{className:cM().main,ref:a,children:[null!=v?(0,r.jsx)(Lx.Z,{className:lh()(cM().artwork),src:v,width:l,height:u,imageClassName:cM().cover}):(0,r.jsx)(Dx.Z,{className:cM().artwork,preserveAspectRatio:"xMinYMin slice"}),null!=p&&(0,r.jsx)("div",{className:cM().gradient,style:{background:"linear-gradient(180deg, ".concat((0,Ux.aD)(p,.16)," 0%, ").concat((0,Ux.aD)(p,1)," 100%)")}}),(0,r.jsx)("div",{className:cM().gradient}),j((function(e,t,n){var o=n.key;return(0,r.jsx)(mm.animated.div,{ref:t===_?a:null,style:e,children:w()},o)})),"cover"===_&&(0,r.jsx)("div",{className:cM().bottomCenterContent,children:(0,r.jsx)(c.X6q,{variant:"heading-sm/normal",color:"header-secondary",children:Q.Z.Messages.ONBOARDING_COVER_PRIVACY_POLICY.format({privacyLink:M.EYA.PRIVACY})})})]})} var yM=n(710965),mM=n(202176),bM=n(198895),gM=n(615796),OM=n(547721),vM=n(783423),_M=n(772040),IM=n(973935),SM=n(142926),TM=n(840249),NM=n(383163),AM=n(873308),CM=n(936337),PM=n(202833),jM=n.n(PM);function RM(e){var t=e.buttonText,n=e.onGoBack,o=e.onDismiss,i=e.showCloseButton;return(0,r.jsxs)(CM.ZP,{className:jM().backNotice,children:[i&&(0,r.jsx)(CM.Ry,{onClick:o,noticeType:M.kVF.BACK_TO_PREVIOUS_SCREEN}),(0,r.jsxs)(c.zxk,{className:jM().backButton,innerClassName:jM().backButtonInner,look:c.zxk.Looks.OUTLINED,color:c.zxk.Colors.WHITE,size:c.zxk.Sizes.NONE,onClick:n,children:[(0,r.jsx)(AM.Z,{width:16,height:16,direction:AM.Z.Directions.LEFT,className:jM().backArrow}),t]})]})}var xM=n(223430),MM=n(436622),wM=n(371768),DM=n(249052),ZM=n(534681),LM=n(543491),UM=n(340562),kM=n(856744),GM=n(707276),BM=n.n(GM);function HM(e){var t,n,o=e.value,i=e.type;if(0===o)return null;if(i===kM.Qs.CHANNEL){t=MM.Z;n=Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_GROUP_CHANNEL_BENEFIT_PREVIEW.format({ value:o})}else{if(i!==kM.Qs.INTANGIBLE)throw new Error("Unsupported benefit type");t=wM.Z;n=Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_GROUP_INTANGIBLE_BENEFIT_PREVIEW.format({value:o})}return(0,r.jsxs)(c.xvT,{variant:"text-sm/normal",color:"interactive-normal",className:BM().benefitSummary,children:[(0,r.jsx)(t,{className:BM().benefitIcon})," ",n]})}function VM(e){var t=e.listing,n=t.subscription_plans[0],o=(0,ZM._W)(t.application_id,t.image_asset,40),i=t.role_benefits.benefits.filter((function(e){return e.ref_type===kM.Qs.CHANNEL})).length,a=t.role_benefits.benefits.filter((function(e){return e.ref_type===kM.Qs.INTANGIBLE})).length,s=i+a>0;return(0,r.jsxs)("div",{className:BM().listingPreview,children:[(0,r.jsx)("img",{src:o,alt:"",className:BM().listingPreviewImage}),(0,r.jsxs)("div",{className:BM().listingPreviewText,children:[(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"interactive-active",children:t.name}),(0,r.jsx)(xM.Z,{size:2}),(0,r.jsxs)(c.xvT,{ variant:"text-sm/normal",color:"interactive-normal",children:[(0,DM.T4)(n.price,n.currency)," / ",(0,LM.JE)(n)]}),s&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(xM.Z,{size:12}),(0,r.jsxs)("div",{className:BM().benefitSummaries,children:[(0,r.jsx)(HM,{type:kM.Qs.CHANNEL,value:i}),(0,r.jsx)(HM,{type:kM.Qs.INTANGIBLE,value:a})]})]})]})]})}function FM(e){var t=e.groupListing,n=e.onSelectGroup,o=(0,OM._k)(t.id),i=(0,s.e7)([vN.Z],(function(){return vN.Z.isViewingSubscriptionRoles(t.guild_id)})),a=o.filter((function(e){return i||e.published})),l=(0,bb.Z)(kM.iP),u=(0,q.Dt)(),f=(0,q.Dt)();return 0===a.length?null:(0,r.jsx)("article",{className:BM().container,"aria-labelledby":u,children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)(c.X6q,{variant:"heading-lg/semibold",id:u,children:t.name}),children:[(0,r.jsx)(xM.Z,{size:8}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"header-secondary",children:t.description}),(0,r.jsx)("div",{className:BM().divider}),(0,r.jsx)(c.X6q,{ variant:"heading-deprecated-12/semibold",className:BM().sectionHeader,id:f,children:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_AVAILABLE_TIERS.format({numTiers:a.length})}),l?(0,r.jsx)("ul",{className:BM().subscriptionCardContainer,"aria-labelledby":f,children:a.map((function(e){return(0,r.jsx)("li",{children:(0,r.jsx)(UM.Z,{guildId:t.guild_id,groupListingId:t.id,listingId:e.id,analyticsLocation:M.Sbl.ROLE_SUBSCRIPTIONS_TAB},e.id)},e.id)}))}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("ul",{className:BM().listingPreviews,"aria-labelledby":f,children:a.map((function(e){return(0,r.jsx)("li",{children:(0,r.jsx)(VM,{listing:e},e.id)},e.id)}))}),(0,r.jsx)(xM.Z,{size:24}),(0,r.jsx)(c.zxk,{onClick:n,fullWidth:!0,children:Q.Z.Messages.GUILD_ROLE_SUBSCRIPTION_PURCHASE_GROUP_CARD_CTA})]})]})})}var YM=n(341095),zM=n(506847),WM=n(805537),KM=n(504834),qM=n(196142),XM=n(96270);function QM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0})),h=f&&u,E=p,y=(0,Xt.bn)(ln.z$.APP_DIRECTORY_COACH_MARK);o.useEffect((function(){return function(){y&&(0,un.EW)(ln.z$.APP_DIRECTORY_COACH_MARK,{dismissAction:hn.L.AUTO,guildId:i})}}),[i,y]);return{shouldRenderAppDirectoryCoachMark:h,hidesAppDirectoryCoachMark:E}}var Qw=n(387099),$w=n(653224),Jw=n(301443),eD=n(766496),tD=n(886077);function nD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rD(e){rD=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return rD(e)}function oD(e,t){return!t||"object"!==aD(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function iD(e,t){iD=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return iD(e,t)}var aD=function(e){ return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function sD(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=rD(e);if(t){var o=rD(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return oD(this,n)}}var cD={hiddenEventsAndStages:[]};function lD(e){var t=e.eventId,n=e.stageId;null==t&&null==n||O.Z.dispatch({type:"LIVE_CHANNEL_NOTICE_HIDE",eventId:t,stageId:n})}var uD=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&iD(e,t)}(n,e);var t=sD(n);function n(){nD(this,n);return t.apply(this,arguments)} var r=n.prototype;r.initialize=function(e){null!=e&&null!=e.hiddenEventsAndStages&&(cD=e)};r.isLiveChannelNoticeHidden=function(e){var t=e.eventId,n=e.stageId;return!(null==n||!cD.hiddenEventsAndStages.includes("stage-".concat(n)))||null!=t&&cD.hiddenEventsAndStages.includes("event-".concat(t))};r.getState=function(){return cD};r.__getLocalVars=function(){return{state:cD}};return n}(s.ZP.PersistedStore);uD.displayName="LiveChannelNoticesStore";uD.persistKey="liveChannelNotices_v2";const fD=new uD(O.Z,{LIVE_CHANNEL_NOTICE_HIDE:function(e){var t=e.eventId,n=e.stageId;null!=t?cD.hiddenEventsAndStages.push("event-".concat(t)):null!=n&&cD.hiddenEventsAndStages.push("stage-".concat(n))},GUILD_SCHEDULED_EVENT_UPDATE:function(e){var t=e.guildScheduledEvent,n="event-".concat(t.id);!cD.hiddenEventsAndStages.includes(n)||t.status!==h_.p1.CANCELED&&t.status!==h_.p1.COMPLETED||(cD.hiddenEventsAndStages=cD.hiddenEventsAndStages.filter((function(e){return e!==n})))}, GUILD_SCHEDULED_EVENT_DELETE:function(e){var t=e.guildScheduledEvent,n="event-".concat(t.id);cD.hiddenEventsAndStages.includes(n)&&(cD.hiddenEventsAndStages=cD.hiddenEventsAndStages.filter((function(e){return e!==n})))},STAGE_INSTANCE_DELETE:function(e){var t=e.instance,n="stage-".concat(t.id);cD.hiddenEventsAndStages.includes(n)&&(cD.hiddenEventsAndStages=cD.hiddenEventsAndStages.filter((function(e){return e!==n})))}});var dD=(0,tc.B)({kind:"guild",id:"2021-10_study_group",label:"Student hub study group",defaultConfig:{enableStudyGroup:!1},treatments:[{id:1,label:"Enables study group sidebar",config:{enableStudyGroup:!0}}]}),pD=function(e){o.useEffect((function(){null!=e&&e.hasFeature(M.oNc.HUB)&&dD.trackExposure({guildId:e.id})}),[e]);var t;return dD.useExperiment({guildId:null!==(t=null==e?void 0:e.id)&&void 0!==t?t:""},{disable:null==e||!e.hasFeature(M.oNc.HUB)})};var hD=n(96299),ED=n(940455);function yD(e,t){ if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mD(e){mD=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return mD(e)}function bD(e,t){return!t||"object"!==OD(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function gD(e,t){gD=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return gD(e,t)}var OD=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function vD(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=mD(e);if(t){var o=mD(this).constructor;n=Reflect.construct(r,arguments,o) }else n=r.apply(this,arguments);return bD(this,n)}}var _D="publicUpsellChannelNoticeGuilds",ID=new Set;var SD=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&gD(e,t)}(n,e);var t=vD(n);function n(){yD(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(dn.Z,Zt.Z,fn.Z);this.syncWith([dn.Z,Zt.Z,fn.Z],M.dG4);var e;ID=null!==(e=new Set(_e.Z.get(_D)))&&void 0!==e?e:new Set};r.isVisible=function(e){if(null!=e){var t=fn.Z.getMemberCount(e.id);return!ID.has(e.id)&&null!=t&&t>=ED.U3&&dn.Z.can(M.Plq.ADMINISTRATOR,e)&&!e.hasFeature(M.oNc.COMMUNITY)}};r.__getLocalVars=function(){return{PUBLIC_UPSELL_CHANNEL_NOTICE_GUILDS_KEY:_D,guildIds:ID}};return n}(s.ZP.Store);SD.displayName="EnablePublicGuildUpsellNoticeStore";const TD=new SD(O.Z,{PUBLIC_UPSELL_NOTICE_DISMISS:function(e){ var t=e.guildId;if(!ID.has(t)){ID.add(t);_e.Z.set(_D,ID);return!0}}});var ND=n(985801),AD=n(930865);function CD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PD(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function jD(e){jD=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return jD(e)}function RD(e){for(var t=1;t0&&e.maxMembers-n<=1e4};r.__getLocalVars=function(){return{CHANNEL_MEMBER_CAP_THRESHOLD:1e4,guildIds:rZ}};return n}(s.ZP.Store);oZ.displayName="MaxMemberCountChannelNoticeStore";const iZ=new oZ(O.Z,{MAX_MEMBER_COUNT_NOTICE_DISMISS:function(e){var t=e.guildId;if(!rZ[M.vID.MAX_MEMBER_COUNT].has(t)){rZ[M.vID.MAX_MEMBER_COUNT].add(t);_e.Z.set(M.vID.MAX_MEMBER_COUNT,rZ[M.vID.MAX_MEMBER_COUNT]);return!0}}});var aZ;!function(e){e[e.ENABLE_PUBLIC_GUILD=0]="ENABLE_PUBLIC_GUILD" ;e[e.APPLIED_GUILD_BOOST_GRACE_PERIOD=1]="APPLIED_GUILD_BOOST_GRACE_PERIOD";e[e.MAX_MEMBER_COUNT=2]="MAX_MEMBER_COUNT";e[e.GUILD_LIVE_CHANNEL=3]="GUILD_LIVE_CHANNEL";e[e.GUILD_MFA_WARNING=4]="GUILD_MFA_WARNING";e[e.COMMANDS_MIGRATION=5]="COMMANDS_MIGRATION";e[e.APPLICATION_SUBSCRIPTION_EXPIRATION=6]="APPLICATION_SUBSCRIPTION_EXPIRATION";e[e.HUB_STUDY_ROOM=7]="HUB_STUDY_ROOM"}(aZ||(aZ={}));function sZ(e){var t,n=null!==(t=null==e?void 0:e.id)&&void 0!==t?t:"",r=(0,s.cj)([ND.Z],(function(){return{appliedGuildBoosts:ND.Z.getAppliedGuildBoostsForGuild(n),lastFetchedAt:ND.Z.getLastFetchedAtForGuild(n)}})).lastFetchedAt,i=(0,s.cj)([GD],(function(){return{lastDismissedGracePeriod:GD.getLastDismissedGracePeriodForGuild(n),isGracePeriodVisible:GD.isVisible(n)}})),a=i.lastDismissedGracePeriod,c=i.isGracePeriodVisible,l=(0,s.e7)([TD],(function(){return TD.isVisible(e)})),u=(0,s.e7)([iZ],(function(){return iZ.isVisible(e)})),f=(0,s.e7)([dn.Z],(function(){return dn.Z.can(M.Plq.ADMINISTRATOR,e) })),d=null!=a&&Date.now()-a<=M.Dge,p=null!=e?e.premiumSubscriberCount:0,h=(0,AD.rF)(p,n)!==M.Eu4.NONE,E=!(null!=r&&Date.now()-r<=432e5)&&(!d&&f&&h),y=function(e){var t,n=(0,tD.ZP)(e),r=S.Z.getChannel(null===(t=n[0])||void 0===t?void 0:t.id),o=(0,s.e7)([eD.Z],(function(){return eD.Z.getStageInstanceByChannel(null==r?void 0:r.id)}),[r]),i=(0,vv.k5)(e),a=(0,s.cj)([fD],(function(){return{isStageNoticeHidden:fD.isLiveChannelNoticeHidden({stageId:null==o?void 0:o.id}),isEventNoticeHidden:fD.isLiveChannelNoticeHidden({eventId:null==i?void 0:i.id})}}),[o,i]),c=a.isStageNoticeHidden,l=a.isEventNoticeHidden;return null!=i?null!=o?!c:!l:null!=o&&!c}(n),m=(0,s.e7)([XD],(function(){return XD.isVisible(e)})),b=hD.Z.useShouldShowChannelNotice(n),g=(0,Jw.h6)(e),O=pD(e).enableStudyGroup,v=g.length>0,_=O&&!Boolean(null==e?void 0:e.hasFeature(M.oNc.HUB));o.useEffect((function(){var e=-1;E&&(e=window.setTimeout((function(){null!=n&&(0,$w.C0)(n)}),30*Math.random()*1e3));return function(){ window.clearTimeout(e)}}),[n,E]);return l?aZ.ENABLE_PUBLIC_GUILD:c?aZ.APPLIED_GUILD_BOOST_GRACE_PERIOD:u?aZ.MAX_MEMBER_COUNT:y?aZ.GUILD_LIVE_CHANNEL:m?aZ.GUILD_MFA_WARNING:b?aZ.COMMANDS_MIGRATION:v?aZ.APPLICATION_SUBSCRIPTION_EXPIRATION:_?aZ.HUB_STUDY_ROOM:null}var cZ=n(24230),lZ=n(179138),uZ=n(495085),fZ=n(213013),dZ=n(383950),pZ=n(830001),hZ=n(833667),EZ=n(342147),yZ=n(955514),mZ=n(485911);function bZ(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function gZ(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){bZ(i,r,o,a,s,"next",e)}function s(e){bZ(i,r,o,a,s,"throw",e)}a(void 0)}))}}function OZ(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var vZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)}, "function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&void 0!==arguments[0]&&arguments[0],t=NU.useExperiment({},{autoTrackExposure:e}),n=t.showRedesignedChannelNotice,r=t.showRedesignedLiveChannelNotice;return{showRedesignedChannelNotice:n,showRedesignedLiveChannelNotice:r}}var CU=n(772260),PU=n.n(CU);function jU(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var RU=(0,za.debounce)(Sb.ZP.trackWithMetadata,500);const xU=function(e){ var t=e.guild,n=e.title,i=e.message,a=e.image,s=e.type,l=e.imageMarginX,u=e.imageMarginTop,f=e.trackingSource,d=e.undismissable,p=e.onDismissed,h=e.onClick,E=e.cta,y=e.ctaColor;o.useEffect((function(){RU(M.rMx.CHANNEL_NOTICE_VIEWED,{notice_type:s,guild_id:t.id})}),[t.id,s]);var m=null;"function"==typeof E?m=E():null!=E&&(m=(0,r.jsx)(c.zxk,{className:PU().button,size:c.zxk.Sizes.SMALL,onClick:function(){null!=s&&Ie.default.track(M.rMx.CHANNEL_NOTICE_CTA_CLICKED,{source:f,guild_id:t.id,notice_type:s});null==h||h()},fullWidth:!0,color:y,children:E}));var b=null!=l?"".concat(l,"px"):"16px";return(0,r.jsxs)("div",{className:PU().container,children:[!0===d?null:(0,r.jsx)(c.P3F,{onClick:function(){Sb.ZP.trackWithMetadata(M.rMx.CHANNEL_NOTICE_CLOSED,{notice_type:s});null==p||p()},className:PU().close,"aria-label":Q.Z.Messages.DISMISS,children:(0,r.jsx)(Ub.Z,{className:PU().closeIcon})}),null!=a&&(0,r.jsx)("div",{className:PU().imageContainer,style:{marginTop:"".concat(u,"px"),marginLeft:b, marginRight:b},children:(0,r.jsx)("img",{className:PU().image,src:a,alt:""})}),(0,r.jsxs)("div",{className:PU().message,children:[null!=n?(0,r.jsx)(c.xvT,{variant:"text-md/medium",color:"header-primary",className:lh()(PU().title,jU({},PU().noImageTitle,null==a)),children:n}):null,(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"text-muted",children:i}),m]})]})};var MU=n(899060),wU=n.n(MU);function DU(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function ZU(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function vk(e){var t=e.width,n=void 0===t?32:t,o=e.height,i=void 0===o?32:o,a=e.color,s=void 0===a?"currentColor":a,c=Ok(e,["width","height","color"]);return(0,r.jsx)("svg",gk(function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n5?l.slice(0,5):l,overflowUsers:u<1?null:(0,r.jsxs)("div",{className:PU().pill,children:[(0,r.jsx)(mk.Z,{width:jk,height:jk,className:PU().pillIcon}),(0,r.jsx)(c.xvT,{variant:"text-xs/medium",color:"header-secondary",className:PU().pillLabel,children:u})]})}}}else{if(t.entity_type===h_.WX.STAGE_INSTANCE&&h){var m=Q.Z.Messages.STAGE_CHANNEL_JOIN_BUTTON;(null==a?void 0:a.speaker)?m=Q.Z.Messages.STAGE_CHANNEL_JOINED_SPEAKER_BUTTON:null!=a&&(m=Q.Z.Messages.STAGE_CHANNEL_JOINED_AUDIENCE_BUTTON);return{noticeType:Ck.STAGE,title:n.topic,location:o.name,locationIcon:(0,r.jsx)(_k.Z,{width:Pk,height:Pk, className:PU().locationIcon}),canListenIn:i,buttonText:m,onClose:function(){return lD({stageId:null==n?void 0:n.id})},users:l.length>5?l.slice(0,5):l,overflowUsers:u<1?null:(0,r.jsxs)("div",{className:PU().pill,children:[(0,r.jsx)(mk.Z,{width:jk,height:jk,className:PU().pillIcon}),(0,r.jsx)(c.xvT,{variant:"text-xs/medium",color:"header-secondary",className:PU().pillLabel,children:u})]})}}if(t.entity_type===h_.WX.EXTERNAL){var b=(0,i_.cS)(t);return null==b?{noticeType:null}:{noticeType:Ck.EVENT_EXTERNAL,title:t.name,location:(0,dk.m)(b,!0),locationIcon:(0,r.jsx)(p_.Z,{width:Pk,height:Pk,className:PU().locationIcon}),canListenIn:!1,buttonText:Q.Z.Messages.GUILD_EVENT_DETAILS_INFO_TAB_TITLE,onClose:function(){return lD({eventId:null==t?void 0:t.id})},users:null==s?[]:[s],overflowUsers:null==t.user_count||t.user_count<1?null:(0,r.jsxs)("div",{className:PU().pill,children:[(0,r.jsx)(ev.Z,{width:jk,height:jk,className:PU().pillIcon}),(0,r.jsx)(c.xvT,{variant:"text-xs/medium", color:"header-secondary",className:PU().pillLabel,children:t.user_count})]})}}if(t.entity_type===h_.WX.VOICE&&null!=o){var g=(0,EO.KS)(o);return{noticeType:Ck.EVENT_VOICE,title:t.name,location:o.name,locationIcon:null!=g?(0,r.jsx)(g,{width:Pk,height:Pk,className:PU().locationIcon}):null,canListenIn:i,buttonText:Q.Z.Messages.GUILD_EVENT_JOIN,onClose:function(){return lD({eventId:null==t?void 0:t.id})},users:null==s?[]:[s],overflowUsers:null==t.user_count||t.user_count<1?null:(0,r.jsxs)("div",{className:PU().pill,children:[(0,r.jsx)(ev.Z,{width:jk,height:jk,className:PU().pillIcon}),(0,r.jsx)(c.xvT,{variant:"text-xs/medium",color:"header-secondary",className:PU().pillLabel,children:t.user_count})]})}}}return{noticeType:null}}({guildEvent:l,stageInstance:u,activeChannel:a,canConnect:m,myRole:b,eventCreator:O,speakers:E,listenerCount:y,isEventNoticeHidden:p,isStageNoticeHidden:d,isStudyRoomNotice:i}) }),[l,u,a,m,b,O,E,y,p,d,i]),_=v.noticeType,I=v.title,S=v.location,T=v.locationIcon,N=v.canListenIn,A=v.buttonText,C=v.users,P=v.overflowUsers,j=v.onClose;if(null==_)return null;return(0,r.jsxs)("div",{className:PU().container,children:[null!=j?(0,r.jsx)(c.P3F,{onClick:j,className:PU().close,"aria-label":Q.Z.Messages.DISMISS,children:(0,r.jsx)(Ub.Z,{className:PU().closeIcon})}):null,(0,r.jsxs)("div",{className:PU().header,children:[(0,r.jsx)(vk,{color:$b.Z.unsafe_rawColors.GREEN_230.css,width:Pk,height:Pk}),(0,r.jsx)(c.xvT,{variant:"text-xs/semibold",color:"text-positive",children:Q.Z.Messages.LIVE})]}),(C.length>0||null!=P)&&(0,r.jsxs)("div",{className:PU().participants,children:[C.map((function(e){return(0,r.jsx)(c.yRy,{preload:function(){return(0,mR.Z)(e.id,e.getAvatarURL(t.id,80),{guildId:t.id})},renderPopout:function(t){return(0,r.jsx)(yk.Z,Nk(Tk({},t),{userId:e.id}))},position:"right",children:function(n){return(0,r.jsx)(c.qEK,Nk(Tk({},n),{src:e.getAvatarURL(t.id,24), "aria-label":e.username,size:c.EFr.SIZE_24,className:PU().avatar}))}},e.id)})),P]}),(0,r.jsx)(c.xvT,{variant:"text-md/medium",color:"header-primary",className:lh()(PU().title,PU().live),children:I}),(0,r.jsxs)("div",{className:PU().locationContainer,children:[T,(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"text-muted",className:PU().location,children:S})]}),N||_===Ck.EVENT_EXTERNAL?(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.GREEN,onClick:function(){if(N){if(null==a||null==a.getGuildId())return;(0,c_.Cq)(a);(0,K.XU)(a.getGuildId(),a.id)}else{if(null==l)return;(0,dr.bO)({eventId:l.id})}},className:PU().button,fullWidth:!0,children:A}):null]})}var xk=n(68537),Mk=n(274740),wk=n.n(Mk);function Dk(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?(0,r.jsxs)("div",{className:wk().textBlock,children:[(0,r.jsx)(Rv.Z,{guildId:a,users:l,showUserPopout:!0,size:Rv.u.SIZE_16}),(0,r.jsx)(c.xvT,{color:"header-secondary",variant:"text-xs/normal",className:wk().userNames,children:(0,xk.ER)(a,l,null==t?void 0:t.id,n.length)})]}):null,u&&null==f&&(0,r.jsx)(Vk,{channel:t,label:d})]})}const zk=o.memo((function(e){var t=e.guild,n=AU(!0).showRedesignedLiveChannelNotice,o=pk(t.id),i=(0,vv.k5)(t.id),a=(0,s.e7)([eD.Z],(function(){return eD.Z.getStageInstanceByChannel(null==o?void 0:o.id)}),[o]),c=(0,s.cj)([fD],(function(){return{ isStageNoticeHidden:fD.isLiveChannelNoticeHidden({stageId:null==a?void 0:a.id}),isEventNoticeHidden:fD.isLiveChannelNoticeHidden({eventId:null==i?void 0:i.id})}}),[a,i]),l=c.isStageNoticeHidden,u=c.isEventNoticeHidden,f=null,d=null!=a&&null!=o&&!l;if(n)return(0,r.jsx)(Rk,{guild:t});null==i||u?d&&(f=(0,r.jsx)(Fk,{stageInstance:a,channel:o})):i.entity_type===h_.WX.STAGE_INSTANCE&&d?f=(0,r.jsx)(Fk,{stageInstance:a,channel:o}):i.entity_type===h_.WX.EXTERNAL?f=(0,r.jsx)(Bk,{guildEvent:i}):i.entity_type===h_.WX.VOICE&&null!=o&&(f=(0,r.jsx)(Gk,{guildEvent:i,channel:o}));return f}));var Wk=n(148167),Kk=n.n(Wk);function qk(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Xk(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){qk(i,r,o,a,s,"next",e)}function s(e){qk(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Qk(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0, configurable:!0,writable:!0}):e[t]=n;return e}var $k=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=M.Hqc&&e.hasFeature(M.oNc.CREATOR_MONETIZABLE)&&e.hasFeature(M.oNc.ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE)&&(0,Dt.H2)(e)&&(0,SM.LA)(e.id)};r.__getLocalVars=function(){return{}};return n}(s.ZP.Store);aB.displayName="RoleSubscriptionMWebPurchaseNoticeStore";const sB=new aB(O.Z);var cB=n(980604);function lB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uB(e){uB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return uB(e)}function fB(e,t){ return!t||"object"!==pB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function dB(e,t){dB=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return dB(e,t)}var pB=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function hB(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=uB(e);if(t){var o=uB(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return fB(this,n)}}var EB=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{ value:e,writable:!0,configurable:!0}});t&&dB(e,t)}(n,e);var t=hB(n);function n(){lB(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(Zt.Z);this.syncWith([Zt.Z],M.dG4)};r.channelNoticePredicate=function(e,t){return!e.hasFeature(M.oNc.BANNER)&&Date.now()-t>=M.Hqc};r.__getLocalVars=function(){return{}};return n}(s.ZP.Store);EB.displayName="GuildBoostingNoticeStore";const yB=new EB(O.Z);function mB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bB(e){bB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return bB(e)}function gB(e,t){return!t||"object"!==vB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function OB(e,t){OB=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return OB(e,t)}var vB=function(e){ return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function _B(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=bB(e);if(t){var o=bB(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return gB(this,n)}}var IB=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&OB(e,t)}(n,e);var t=_B(n);function n(){mB(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(dn.Z);this.syncWith([dn.Z],M.dG4)};r.channelNoticePredicate=function(e,t){ return Date.now()-t>=M.Hqc&&dn.Z.can(M.Plq.MANAGE_GUILD,e)};r.__getLocalVars=function(){return{}};return n}(s.ZP.Store);IB.displayName="GuildBoostingNoticeStore";const SB=new IB(O.Z);function TB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NB(e){NB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return NB(e)}function AB(e,t){return!t||"object"!==PB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function CB(e,t){CB=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return CB(e,t)}var PB=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function jB(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{ Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=NB(e);if(t){var o=NB(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return AB(this,n)}}function RB(){return!0}var xB=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&CB(e,t)}(n,e);var t=jB(n);function n(){TB(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(dn.Z);this.syncWith([dn.Z],RB)};r.channelNoticePredicate=function(e){var t=(0,SR.wC)(e.id),n=e.hasFeature(M.oNc.GUILD_ONBOARDING_EVER_ENABLED);return t&&!n};r.__getLocalVars=function(){return{}};return n}(s.ZP.Store);xB.displayName="GuildOnboardingUpsellNoticeStore";const MB=new xB(O.Z);function wB(e,t){ if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DB(e){DB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return DB(e)}function ZB(e,t){return!t||"object"!==UB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function LB(e,t){LB=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return LB(e,t)}var UB=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function kB(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=DB(e);if(t){var o=DB(this).constructor;n=Reflect.construct(r,arguments,o) }else n=r.apply(this,arguments);return ZB(this,n)}}var GB=!1;function BB(e){var t=Zt.Z.getGuild(e);if(null==t)return!1;if(!t.hasFeature(M.oNc.HUB))return!1;GB=!0;return!0}function HB(){return!0}var VB=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&LB(e,t)}(n,e);var t=kB(n);function n(){wB(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(Zt.Z,ud.Z);this.syncWith([ud.Z],HB)};r.channelNoticePredicate=function(e){return!!e.hasFeature(M.oNc.LINKED_TO_HUB)&&!GB};r.__getLocalVars=function(){return{isAlreadyInHub:GB}};return n}(s.ZP.Store);VB.displayName="HubLinkNoticeStore";const FB=new VB(O.Z,{CONNECTION_OPEN:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e.guilds[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){if(BB(o.value.id))return!0}}catch(e){n=!0;r=e }finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return!1},GUILD_CREATE:function(e){return BB(e.guild.id)}});function YB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zB(e){zB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return zB(e)}function WB(e,t){return!t||"object"!==qB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function KB(e,t){KB=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return KB(e,t)}var qB=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function XB(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0 }catch(e){return!1}}();return function(){var n,r=zB(e);if(t){var o=zB(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return WB(this,n)}}function QB(){return!0}var $B=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&KB(e,t)}(n,e);var t=XB(n);function n(){YB(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(dn.Z);this.syncWith([dn.Z],QB)};r.channelNoticePredicate=function(e,t){return Date.now()-t>=M.Hqc&&dn.Z.can(M.Plq.ADMINISTRATOR,e)};r.__getLocalVars=function(){return{}};return n}(s.ZP.Store);$B.displayName="InviteNoticeStore";const JB=new $B(O.Z);var eH="lastHiddenChannelNotice",tH=[{type:M.vID.GUILD_BOOSTING,store:SB,dismissibleContentType:ln.z$.CHANNEL_NOTICE_PREMIUM_GUILD_SUBSCRIPTION},{type:M.vID.GUILD_BANNER,store:yB, dismissibleContentType:ln.z$.CHANNEL_NOTICE_GUILD_BANNER},{type:M.vID.INVITE,store:JB,dismissibleContentType:ln.z$.CHANNEL_NOTICE_INVITE},{type:M.vID.HUB_LINK,store:FB,dismissibleContentType:ln.z$.CHANNEL_NOTICE_HUBLINK},{type:M.vID.QUICKSWITCHER,store:cB.Z,dismissibleContentType:ln.z$.CHANNEL_NOTICE_QUICKSWITCHER},{type:M.vID.ROLE_SUBSCRIPTION_MWEB_PURCHASE,store:sB,dismissibleContentType:ln.z$.GUILD_ROLE_SUBSCRIPTION_MWEB_PURCHASE_UPSELL},{type:M.vID.GUILD_ONBOARDING_UPSELL,store:MB,dismissibleContentType:ln.z$.GUILD_ONBOARDING_UPSELL_CHANNEL_NOTICE},{type:M.vID.CLIPS_EDUCATION,dismissibleContentType:ln.z$.CLIPS_CHANNEL_NOTICE_EDUCATION},{type:M.vID.LINKED_ROLES_ADMIN,dismissibleContentType:ln.z$.LINKED_ROLE_ADMIN_GUILD}],nH=tH.map((function(e){return e.store})).filter(_o.lm);function rH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)}));return(0,r.jsx)("div",{className:lH().container,ref:i,children:(0,r.jsx)(sH,{guild:t})})}var fH=n(918288),dH=n.n(fH);function pH(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var hH=function(){return(0,r.jsx)("div",{className:dH().spacer})},EH=function(){return(0,r.jsx)("div",{className:dH().category})},yH=function(e){var t=e.width;return(0,r.jsxs)("div",{className:dH().channel,children:[(0,r.jsx)("div",{className:dH().channelIcon}),(0,r.jsx)("div",{className:dH().channelName,style:{width:"".concat(t,"px")}})]})};const mH=function(e){var t=e.withBannerPadding;return(0,r.jsxs)("div",{className:lh()(dH().container,pH({},dH().bannerPadding,t)),children:[(0,r.jsx)(EH,{}),(0,r.jsx)(yH,{width:100}),(0,r.jsx)(yH,{width:74}),(0,r.jsx)(yH,{width:100}),(0,r.jsx)(yH,{width:70}),(0, r.jsx)(yH,{width:112}),(0,r.jsx)(yH,{width:175}),(0,r.jsx)(hH,{}),(0,r.jsx)(EH,{}),(0,r.jsx)(yH,{width:100}),(0,r.jsx)(yH,{width:74}),(0,r.jsx)(yH,{width:100}),(0,r.jsx)(yH,{width:70}),(0,r.jsx)(yH,{width:112}),(0,r.jsx)(yH,{width:56})]})};function bH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function CH(e,t){return!t||"object"!==RH(t)&&"function"!=typeof t?gH(e):t}function PH(e,t){PH=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return PH(e,t)}function jH(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bH(e,t);var n=Object.prototype.toString.call(e).slice(8,-1) ;"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bH(e,t)}(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.")}()}var RH=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function xH(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=SH(e);if(t){var o=SH(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return CH(this,n)}}var MH=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[] };return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=64&&o||e<64&&!o)&&(o=!o);(e>=wH&&!n||e=20&&n||e<20&&!n)&&(n=!n);n!==this.state.communityInfoVisible&&this.setState({communityInfoVisible:n});r.update({value:Math.min(1,Math.max(0,1-e/20)),immediate:!0 }).start()};i.renderChannelList=function(){var e=this.props,t=e.isUnavailable,n=e.guild,o=e.selectedChannel,i=e.enableStudyGroup,a=AH(e,["isUnavailable","guild","selectedChannel","enableStudyGroup"]);if(t||null==n)return(0,r.jsx)(mH,{withBannerPadding:null!=n&&null!=this.getGuildBannerHash()});if(n.hasFeature(M.oNc.HUB)&&!i)return(0,r.jsx)("div",{className:rU().hubContainer,children:(0,r.jsx)(BZ.Z,{guild:n,channel:null!=o?o:Hg.ZP.getDefaultChannel(n.id)})});var s=n.id===mZ._?lL.j:lL.E;return(0,r.jsx)(s,NH(TH({guild:n},a),{guildBanner:this.getGuildBannerHash(),hasGuildSubheader:this.state.hasGuildSubheader,onScroll:null==n||null==this.getGuildBannerHash()&&!n.hasCommunityInfoSubheader()?null:this.pinBannerOrGuildInfo}))};i.renderFooter=function(){var e=this.props,t=e.guild,n=e.selectedChannelId,o=e.shouldRenderNitroActivitiesCoachMark,i=e.shouldRenderBashOutCoachMark,a=e.shouldRenderBurstCoachmark,s=e.shouldRenderGarticPhoneCoachMark,c=[] ;o&&c.push(ln.z$.ACTIVITIES_NITRO_TUTORIAL_COACH_MARK_V2);i&&c.push(ln.z$.BASH_OUT_COACH_MARK);s&&c.push(ln.z$.ACTIVITY_COACH_MARK_GARTIC_PHONE);a&&c.push(ln.z$.BURST_REACTION_COACHMARK);return(0,r.jsx)(WN.Z,{contentTypes:c,children:function(e){var o=e.visibleContent,i=e.markAsDismissed;switch(o){case ln.z$.ACTIVITIES_NITRO_TUTORIAL_COACH_MARK_V2:return(0,r.jsx)(bL,{channelId:null!=n?n:void 0,markAsDismissed:function(){(0,un.EW)(ln.z$.ACTIVITIES_NITRO_TUTORIAL_COACH_MARK_V2,{forceTrack:!0,dismissAction:hn.L.DISMISS});c.includes(ln.z$.BASH_OUT_COACH_MARK)&&(0,un.EW)(ln.z$.BASH_OUT_COACH_MARK,{forceTrack:!0,dismissAction:hn.L.AUTO});s&&(0,un.EW)(ln.z$.ACTIVITY_COACH_MARK_GARTIC_PHONE,{forceTrack:!0,dismissAction:hn.L.AUTO})},tutorialType:sL.NITRO});case ln.z$.BASH_OUT_COACH_MARK:return(0,r.jsx)(bL,{channelId:null!=n?n:void 0,markAsDismissed:i,tutorialType:sL.BASH_OUT});case ln.z$.ACTIVITY_COACH_MARK_GARTIC_PHONE:return(0,r.jsx)(bL,{channelId:null!=n?n:void 0,markAsDismissed:i, tutorialType:sL.GARTIC_PHONE});case ln.z$.BURST_REACTION_COACHMARK:var a;return(0,r.jsx)(cL,{markAsDismissed:i,guildId:null!==(a=null==t?void 0:t.id)&&void 0!==a?a:""});default:return(0,r.jsx)(r.Fragment,{})}}})};i.render=function(){var e=this,t=this.props,n=t.guild,o=t.FooterAnalyticsLocationProvider;return(0,r.jsxs)("nav",{className:rU().container,onContextMenu:this.handleContextMenu,"aria-label":Q.Z.Messages.GUILD_SIDEBAR_A11Y_LABEL.format({guildName:null!=n?n.toString():""}),children:[null!=n&&this.renderGuildHeader(this.state.hasGuildSubheader),null!=n&&(0,r.jsx)(uH,{guild:n,setHasSubheader:function(t){return e.setState({hasGuildSubheader:t})}}),this.renderChannelList(),(0,r.jsx)(o,{children:this.renderFooter()})]})};o.getDerivedStateFromProps=function(e){var t=e.guild,n=e.hasChannelNotice;return null==t||null==t.banner||n?{renderBanner:!1,bannerVisible:!1}:null};return o}(o.PureComponent);function kH(e){var t=e.guildId,n=e.hideSelectedChannel,i=e.selectedChannelId,a=(0, s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(t)})),l=(0,uZ.Z)(t),u=(0,s.e7)([XZ.Z],(function(){return XZ.Z.getGuildDimensions(t).scrollTo})),f=(0,s.e7)([A.Z],(function(){return A.Z.getChannelId()})),d=jH((0,s.Wu)([dn.Z],(function(){return[dn.Z.can(M.Plq.MANAGE_GUILD,a),dn.Z.can(M.Plq.MANAGE_ROLES,a),dn.Z.can(M.Plq.MANAGE_THREADS,a)]})),3),p=d[0],h=d[1],y=d[2],m=(0,s.e7)([vo.Z],(function(){return vo.Z.isUnavailable(t)})),b=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),g=(0,s.e7)([st.Z],(function(){return st.Z.darkSidebar?M.BRd.DARK:st.Z.theme})),O=pD(a).enableStudyGroup,v=kw.s8.useExperiment({},{autoTrackExposure:!0}).enableNitroActivities,_=(0,Xt.ZP)((function(e){return e.currentlyShown.has(ln.z$.NAGBAR_NOTICE_CONNECT_PLAYSTATION)})),I=jH(o.useState(!_),2),N=I[0],C=I[1],P=(0,nh.Z)(t),j=(0,Hw.Z)(Pf.Z.GUILD_HEADER).AnalyticsLocationProvider,R=(0,Hw.Z)(Pf.Z.GUILD_CHANNEL_LIST_FOOTER).AnalyticsLocationProvider;o.useEffect((function(){t!==P&&C(!_)}),[t,P,_]) ;var x=jH((0,Xt.ZP)((function(e){return[tH.some((function(t){return e.currentlyShown.has(t.dismissibleContentType)})),e.currentlyShownGroup.has(hn.R.GUILD_HEADER_TOOLTIPS)]})),2),w=x[0],D=x[1],Z=null!=sZ(a)||w,L=(0,c.s9z)(c.JQI),U=(0,s.e7)([T.Z],(function(){return T.Z.hasLayers()})),k=(0,s.e7)([KZ.Z],(function(){return KZ.Z.shouldShow(ZH)})),G=p&&!1===(null==a?void 0:a.premiumProgressBarEnabled)&&!Bi.s.isDisallowPopupsSet(),B=(0,s.e7)([fn.Z],(function(){return fn.Z.getMemberCount(t)})),H=p&&null!=B&&B>=30&&!1===(null==a?void 0:a.premiumProgressBarEnabled)&&!Bi.s.isDisallowPopupsSet(),V=h&&null!=a&&(a.hasFeature(M.oNc.COMMUNITY)||null!=B&&B>=200),F=function(e){var t,n=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(e)})),r=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),o=(null==n?void 0:n.ownerId)===(null==r?void 0:r.id),i=(0,SZ.Sd)() ;return o&&null!==(t=null==n?void 0:n.hasFeature(M.oNc.COMMUNITY))&&void 0!==t&&t&&i&&!((null==n?void 0:n.hasFeature(M.oNc.CREATOR_MONETIZABLE))||(null==n?void 0:n.hasFeature(M.oNc.CREATOR_MONETIZABLE_PROVISIONAL))||(null==n?void 0:n.hasFeature(M.oNc.CREATOR_MONETIZABLE_DISABLED)))}(t),z=(0,lZ._)(t),W=p&&h,K=!0===(null==a?void 0:a.hasFeature(M.oNc.HUB)),q=p&&!0===(null==a?void 0:a.hasFeature(M.oNc.DISCOVERABLE)),X=(0,Qw.Q)(),Q=(p||(null==a?void 0:a.premiumTier)===M.Eu4.NONE)&&!Bi.s.isDisallowPopupsSet()&&!X,$=(0,s.e7)([GZ,T.Z],(function(){return null!=a&&null!=b&&p&&!T.Z.hasLayers()&&GZ.shouldShowGuildTemplateDirtyTooltip(t)})),J=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(i)})),ee=(0,s.e7)([E.Z],(function(){return E.Z.useReducedMotion})),te=(0,fZ.y)().isPopoutOpen,ne=(0,Rj.i8)(t),re=(0,s.e7)([zZ.Z],(function(){return!Wa().isEmpty(zZ.Z.getThreadsForGuild(t))})),oe=y&&null!=B&&B>=200&&re,ie=(0, IZ.z4)(),ae=v&&N,se=!0===(null==a?void 0:a.hasFeature(M.oNc.ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE)),ce=(0,SM.vS)(a)&&p&&se,le=(0,VZ.AR)(),ue=(0,un.wE)(jf.QD.BOOSTING),fe=Xw({canManageGuild:p,guildId:t}),de=fe.shouldRenderAppDirectoryCoachMark,pe=fe.hidesAppDirectoryCoachMark,he=Bw.useExperiment({},{autoTrackExposure:!0}).enabled,Ee=Na.ZP.canUsePremiumActivities(b),ye=v&&N&&he&&Ee,me=(0,Lw.Qd)(t).enabled,be=N&&me,ge=Gw.useExperiment({},{autoTrackExposure:!0}).enabled,Oe=v&&N&&ge,ve=!1;void 0!==a&&(ve=Object.values(a.roles).some((function(e){var t;return null===(null==e||null===(t=e.tags)||void 0===t?void 0:t.guild_connections)})));var _e=ve||h;_Z(a);var Ie=(0,un.wE)(ln.z$.PREMIUM_TUTORIAL_SERVER_MENU_TOOLTIP),Se=(0,dZ.MR)(a),Te=(0,dZ.WR)(a),Ne=(0,pZ.LK)(a),Ae=null!=a&&a.clydeEnabled(),Ce=(0,cZ.FF)(a,p)&&p&&!Ae,Pe=Uw._.useExperiment({}).enabled,je=(0,QZ.Z)(t,!Pe);return(0,r.jsx)(UH,{guildId:t,hideSelectedChannel:n,guild:a,scrollToChannel:u,selectedChannelId:n?null:i, selectedChannel:J,selectedVoiceChannelId:f,voiceStates:l,isUnavailable:m,theme:g,user:b,hasChannelNotice:Z,anyLayerOpen:L||U,showGuildBoostingProgressBarUpsell:G,showGuildBoostingProgressBarSizeUpsell:H,showInviteSplashUpsell:Q,showDiscoveryLandingPageSettingsUpsell:q,showGuildHeaderTutorial:k,showGuildTemplateDirtyTooltip:$,showRoleSubscriptionUpsell:F,showDiscoveryTooltip:z,showIntegrationPermissionTooltip:W,showHubPrivacySettingsTooltip:K,showCreatorPromoPageTooltip:ce,showNewUnreadsBar:ne,showActiveThreadsNotice:oe,showAntiRaidUpsellNotice:Se,showMentionRaidLimitUpsell:Te,showAutomodCustomBlockMessageUpsell:Ne,showClydeAITooltip:Ce,showGuildSoundboardPermissionUpsell:V,isHeaderPopoutOpen:te,enableStudyGroup:O,isGuildHeaderDismissibleTooltipShown:D,canShowCoachMarkAtBottom:N,HeaderAnalyticsLocationProvider:j,FooterAnalyticsLocationProvider:R,shouldRenderNitroActivitiesCoachMark:ae,shouldShowBoostingHighlight:le,isBoostingFlowDismissed:ue,shouldRenderAppDirectoryCoachMark:de, hidesAppDirectoryCoachMark:pe,shouldRenderBashOutCoachMark:ye,shouldRenderGarticPhoneCoachMark:Oe,showVerifiedRolesCoachmark:_e,canManageRoles:h,useReducedMotion:ee,isTutorialHighlightDismissed:Ie,shouldRenderBurstCoachmark:be,channelEmojis:je,showOnboardingUpsellCoachmark:ie})}var GH=n(917313),BH=n(757753),HH=n(966658),VH=n(826357),FH=n.n(VH);function YH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function yF(){var e=o.useRef(null),t=function(){var e=(0,s.e7)([S.Z],(function(){return S.Z.getPrivateChannelsVersion()})),t=(0,s.Wu)([S.Z,JH.Z],(function(){var e=S.Z.getMutablePrivateChannels();return yV(Array.from(JH.Z.getSpamChannelIds()).map((function(t){return e[t]})).filter((function(e){return null!=e})))}),[e]),n=(0,s.cj)([Y.default],(function(){var e={};t.forEach((function(t){var n=Y.default.getUser(t.recipients[0]);null!=n&&(e[t.id]=n)}));return e}),[t]);return o.useMemo((function(){return t.map((function(e){return{channel:e,user:n[e.id]}}))}),[t,n])}(),n=tV(),i=rV(),a=QH(),l=(0,iP.Z)("message-requests-spam-list"),u=(0,EV._)().channelId,f=o.useCallback((function(){(0,c.CFj)((0, c.Yz2)(Q.Z.Messages.MESSAGE_REQUEST_REQUEST_ERROR_ALERT_TITLE,c.pCN.FAILURE))}),[]),d=(0,oV.m)({onError:f}).rejectAll,p=o.useCallback((function(){var e=t.map((function(e){return e.channel.id}));d(e)}),[t,d]);o.useEffect((function(){Ie.default.track(M.rMx.SPAM_MESSAGE_REQUESTS_VIEWED,{num_spam_message_requests:n});lV.Z.increment({name:KH.V.SPAM_MESSAGE_REQUEST_VIEW})}),[]);var h=o.useCallback((function(e){var n,o,a,s=e.row,c=t[s],l=null===(n=t[s+1])||void 0===n||null===(o=n.channel)||void 0===o?void 0:o.id,f=c.channel.id,d=null!=u&&u===f,p=null!=u&&u===l;return(0,r.jsx)(fF,{className:lh()((a={},hF(a,pF().selected,d),hF(a,pF().siblingSelected,p),a)),channel:c.channel,user:c.user,hasSingleMessageRequest:i},f)}),[t,i,u]),E=o.useCallback((function(){return(0,r.jsxs)(dV.Z,{className:pF().sectionTitle,children:[Q.Z.Messages.MESSAGE_REQUESTS_SPAM_HEADER.format({count:n}),a&&n>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xvT,{className:pF().titleDivider,variant:"eyebrow", color:"header-secondary",tag:"span",children:"•"}),(0,r.jsx)(c.zxk,{onClick:p,look:c.iLD.LINK,color:c.Ttl.LINK,size:c.PhG.SMALL,className:pF().clearAllButton,"aria-label":Q.Z.Messages.MESSAGE_REQUESTS_CLEAR_ALL,children:Q.Z.Messages.MESSAGE_REQUESTS_CLEAR_ALL})]}):null]},"message-requests-spam-title")}),[n,p,a]);return 0===t.length?(0,r.jsx)(NV,{section:bV.pS.SPAM}):(0,r.jsx)(pb.bG,{navigator:l,children:(0,r.jsx)(pb.SJ,{children:function(n){var o=n.ref,i=n.role,a=EF(n,["ref","role"]);return(0,r.jsx)(c.aVo,function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function _F(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return gF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gF(e,t)}(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 IF(){var e=o.useRef(null),t=(0,eV.q)(),n=function(){var e=(0,s.e7)([S.Z],(function(){return S.Z.getPrivateChannelsVersion()})),t=(0,s.Wu)([S.Z,$H.Z],(function(){var e=S.Z.getMutablePrivateChannels() ;return yV(Array.from($H.Z.getMessageRequestChannelIds()).map((function(t){return e[t]})).filter((function(e){return null!=e})))}),[e]),n=(0,s.cj)([Y.default],(function(){var e={};t.forEach((function(t){var n=Y.default.getUser(t.recipients[0]);null!=n&&(e[t.id]=n)}));return e}),[t]);return o.useMemo((function(){return t.map((function(e){return{channel:e,user:n[e.id]}}))}),[t,n])}(),i=nV(),a=QH(),l=o.useCallback((function(){(0,c.CFj)((0,c.Yz2)(Q.Z.Messages.MESSAGE_REQUEST_REQUEST_ERROR_ALERT_TITLE,c.pCN.FAILURE))}),[]),u=(0,oV.m)({onError:l}).rejectAll,f=(0,iP.Z)("message-requests-list"),d=(0,EV._)().channelId,p=o.useCallback((function(){var e=n.map((function(e){return e.channel.id}));u(e)}),[n,u]),h=o.useCallback((function(e){var t,o,a,s=e.row,c=n[s],l=null===(t=n[s+1])||void 0===t||null===(o=t.channel)||void 0===o?void 0:o.id,u=c.channel.id,f=null!=d&&d===u,p=null!=d&&d===l;return(0,r.jsx)(aF,{className:lh()((a={},OF(a,bF().selected,f),OF(a,bF().siblingSelected,p),a)), channel:c.channel,user:c.user,hasSingleMessageRequest:i},u)}),[i,n,d]),E=o.useCallback((function(){return(0,r.jsxs)(dV.Z,{className:bF().sectionTitle,children:[t>0?Q.Z.Messages.MESSAGE_REQUESTS_PAGE_TITLE_WITH_COUNT.format({count:t}):Q.Z.Messages.MESSAGE_REQUESTS_PAGE_TITLE,a&&t>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xvT,{className:bF().titleDivider,variant:"eyebrow",color:"header-secondary",tag:"span",children:"•"}),(0,r.jsx)(c.zxk,{onClick:p,look:c.iLD.LINK,color:c.Ttl.LINK,size:c.PhG.SMALL,className:bF().clearAllButton,"aria-label":Q.Z.Messages.MESSAGE_REQUESTS_CLEAR_ALL,children:Q.Z.Messages.MESSAGE_REQUESTS_CLEAR_ALL})]}):null]},"title")}),[t,p,a]);n.length!==t&&lV.Z.increment({name:KH.V.MESSAGE_REQUEST_COUNT_DRIFT});return 0===n.length?(0,r.jsx)(NV,{section:bV.pS.REQUESTS}):(0,r.jsx)(pb.bG,{navigator:f,children:(0,r.jsx)(pb.SJ,{children:function(t){var o=t.ref,i=t.role,a=vF(t,["ref","role"]);return(0,r.jsx)(c.aVo,function(e){for(var t=1;t0?(0,r.jsx)(c.zxk,{className:sY().button,fullWidth:!1,size:c.PhG.LARGE,children:Q.Z.Messages.GET_STARTED}):null]})};var fY=n(895724),dY=n(138043),pY=n.n(dY);function hY(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}const EY=function(e){ var t=e.header,n=e.count,o=e.tooltipDescription,i=n>0?"text-brand":"text-muted";return(0,r.jsxs)("div",{className:pY().counter,children:[(0,r.jsx)(c.X6q,{variant:"heading-xxl/medium",color:i,children:(0,r.jsx)(c.y5t,{children:n})}),(0,r.jsxs)("div",{className:pY().textRow,children:[(0,r.jsx)(c.xvT,{variant:"text-sm/semibold",children:t}),(0,r.jsx)(c.ua7,{text:o,tooltipClassName:pY().tooltip,children:function(e){return(0,r.jsx)(fY.Z,function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function LY(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=ZY(e,["width","height","color","foreground"]);return(0,r.jsxs)("svg",DY(function(e){for(var t=1;t0?(0,r.jsx)(jY,{}):null,(0,r.jsx)(TY,{user:t})]})};var BY=n(897746),HY=n.n(BY);function VY(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function FY(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function YY(e){var t=e.icon,n=e.tooltip,o=e.onClick,i=e.className;return(0,r.jsx)(c.ua7,{text:n,children:function(e){return(0,r.jsx)(c.P3F,FY(function(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){ var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Pz(e){var t=e.sectionType,n=e.sectionTitle,i=e.requests,a=o.useRef(null),s="".concat(t,"-list"),l=(0,iP.Z)(s),u=o.useCallback((function(e){var n=e.row,o=e.listIndex,a=i[n],s=o===i.length;return(0,r.jsx)(Sz,{user:a,isLast:s,children:function(e){return t===LF.ne.ACTIVE?(0,r.jsx)(cz,{active:e,user:a}):(0,r.jsx)(Ez,{active:e,user:a})}})}),[i,t]),f=o.useCallback((function(){return(0,r.jsx)(dV.Z,{className:Nz().sectionTitle,children:(0,r.jsx)(c.xvT,{className:gh().marginBottom8,variant:"eyebrow",color:"header-secondary",children:n})},"title")}),[n]);return(0,r.jsx)("div",{className:Nz().section,children:(0,r.jsx)(pb.bG,{navigator:l,children:(0,r.jsx)(pb.SJ,{children:function(e){var t=e.ref,o=e.role,l=Cz(e,["ref","role"]);return(0,r.jsx)(c.aVo,function(e){for(var t=1;t0?(0,r.jsx)(Pz,{sectionType:LF.ne.ACTIVE,sectionTitle:o,requests:t}):(0,r.jsxs)("div",{className:Nz().section,children:[(0,r.jsx)(c.xvT,{ className:gh().marginBottom8,variant:"eyebrow",color:"header-secondary",children:o}),(0,r.jsx)("div",{className:Nz().box,children:(0,r.jsx)(OY,{text:Q.Z.Messages.FAMILY_CENTER_ACCEPTED_REQUESTS_EMPTY_DESCRIPTION.format({isAdult:e})})})]})})},Rz=function(){var e=(0,RF.Z)(),t=iY(LF.ne.PENDING);return 0===t.length?null:(0,r.jsx)(Pz,{sectionType:LF.ne.PENDING,sectionTitle:Q.Z.Messages.FAMILY_CENTER_PENDING_REQUESTS_TITLE.format({isAdult:e,count:t.length}),requests:t})};const xz=function(){return(0,r.jsxs)("div",{className:Nz().container,children:[(0,r.jsx)(jz,{}),(0,r.jsx)(Rz,{})]})};var Mz,wz,Dz=n(469858),Zz=n.n(Dz);function Lz(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){aW=!0;!function(){if(!iW&&aW){iW=!0;aW=!1;Yz()}}()}},FRIEND_SUGGESTION_CREATE:function(e){var t=sW(e.suggestion);if(null!=rW[t.key])return!1;oW++;rW=Qz(function(e){ for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1},function(e){return e.applicationStreams.length>0},function(e){return e.voiceChannels.length>0},function(e){return e.currentActivities.length>0},function(e){return e.isSpotifyActivity},function(e){return e.priorityMembers.map((function(e){return e.user.username.toLowerCase()})).join(" ")}],["desc","desc","desc","desc","asc","asc"]).value();rK=function(e){return e.filter((function(e){return e.voiceChannels.length>=1||e.currentActivities.length>0||e.applicationStreams.length>0}))}(i);oK=function(e){return e.map((function(e){return{type:M.GOo.USER,party:e}}))}(rK);!function(){if(sK.size>0){var e=Array.from(sK);Pn.Z.fetchApplications(e);e.forEach((function(e){return cK.add(e)}));sK.clear()}}();nK=!0}var vK=Wa().throttle((function(){OK();SK.emitChange()}),1e3) ;function _K(){if(!gK())return!1;vK();return!1}var IK=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&KW(e,t)}(n,e);var t=QW(n);function n(){BW(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.syncWith([Y.default,Rn.Z,$a.Z,UW.Z,j.Z,Pr.Z,Ja.Z,mW.Z,es.Z],_K);this.waitFor(my.Z,Zt.Z,Rn.Z,Y.default,es.Z)};r.__getLocalVars=function(){return{PARTY_ID_START_PARTY:$W,PARTY_ID_START_CHANNEL:JW,PARTY_ID_START_USER:eK,RECOMPUTE_NOW_PLAYING_THROTTLE:1e3,isMounted:tK,loaded:nK,currentActivityParties:rK,nowPlayingCards:oK,xboxGames:iK,twitchRecords:aK,applicationIdsToFetch:sK,applicationIdsFetched:cK,throttledRecomputeNowPlaying:vK,instance:SK}};!function(e,t,n){t&&HW(e.prototype,t);n&&HW(e,n)}(n,[{key:"currentActivityParties",get:function(){return rK}},{key:"nowPlayingCards", get:function(){return oK}},{key:"isMounted",get:function(){return tK}},{key:"loaded",get:function(){return nK}}]);return n}(s.ZP.Store);IK.displayName="NowPlayingViewStore";var SK=new IK(O.Z,{LOGOUT:function(){tK=!1;rK=[];oK=[];sK.clear()},NOW_PLAYING_MOUNTED:function(){tK=!0;vK()},NOW_PLAYING_UNMOUNTED:function(){tK=!1}});const TK=SK;var NK=n(83797),AK=n(934870),CK=n(429041),PK=n(579581),jK=n(265688),RK=n(61040),xK=n(101604),MK=n(712776),wK=n(983073),DK=n(483535),ZK=n(767484),LK=n(993137),UK=n(641277),kK=n(686910),GK=n(247729),BK=n(129010),HK=n(753724),VK=n(796938),FK=n(977005),YK=n(399098);function zK(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function JK(e,t){return!t||"object"!==nq(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function eq(e,t){eq=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return eq(e,t)}function tq(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return zK(e,t) ;var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zK(e,t)}(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.")}()}var nq=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function rq(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=qK(e);if(t){var o=qK(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return JK(this,n)}} var oq,iq=64,aq=160,sq=[14,14,12,12,10,8,6],cq=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return(0,r.jsx)(c.xvT,{className:lh()(RW().textContent,t),variant:"text-sm/semibold",children:e})},lq=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return(0,r.jsx)(c.xvT,{className:lh()(RW().textContent,t),variant:"text-xs/normal",children:e})},uq=(0,CK.Z)((function(e){var t=e.message;return(0,r.jsx)("div",{className:RW().timestamp,children:t})})),fq=function(e){var t=e.children;return(0,r.jsx)("section",{className:RW().section,children:t})},dq=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&eq(e,t)}(o,e);var t=rq(o);function o(){WK(this,o);return t.apply(this,arguments)}var i=o.prototype;i.renderTimePlayed=function(){ var e,t=this.props.activity,n=t.timestamps;if(null==n||!(0,MK.Z)(t)||(0,_W.Z)(t))return null;e=(0,NK.Z)(t)?(0,r.jsx)(uq,{timestamps:n}):(0,r.jsx)(kK.ZP,{start:n.start,end:n.end,location:kK.ZP.Locations.USER_ACTIVITY,className:RW().playTime});return lq(e)};i.render=function(){var e,t,o=this.props,i=o.activity,a=i.assets,s=i.details,c=i.state,l=i.application_id,u=o.getAssetImage;return(0,r.jsx)(fq,{children:(0,r.jsxs)("div",{className:RW().activitySection,children:[null!=a&&0!==Object.keys(a).length?(0,r.jsxs)("div",{className:RW().activitySectionAssets,children:[(0,r.jsx)("img",{alt:null!==(e=a.large_text)&&void 0!==e?e:"",src:u(l,a.large_image,[aq,aq]),className:lh()(RW().largeImage,KK({},RW().largeImageMask,null!=a.small_image))}),null!=a.small_image?(0,r.jsx)("img",{alt:null!==(t=a.small_text)&&void 0!==t?t:"",src:u(l,a.small_image,[iq,iq]),className:RW().smallImage}):null]}):(0,r.jsx)("div",{className:RW().activitySectionAssets,children:(0,r.jsx)("img",{alt:"",src:n(534413), className:RW().largeImage})}),(0,r.jsxs)("div",{children:[cq(null!=s&&""!==s?s:Q.Z.Messages.USER_ACTIVITY_HEADER_PLAYING),null!=c?lq(c):null,this.renderTimePlayed()]})]})})};return o}(o.Component),pq=TE()({XBOX:null,SPOTIFY:null,MULTIPLE:null}),hq=function(e){var t,n=e.src,o=e.onClick,i=e.onContextMenu;switch(n){case pq.XBOX:t=(0,r.jsx)(HK.Z,{className:RW().headerIcon,color:$b.Z.unsafe_rawColors.PRIMARY_300.css});break;case pq.SPOTIFY:t=(0,r.jsx)(BK.Z,{className:RW().headerIcon,color:$b.Z.unsafe_rawColors.SPOTIFY.css});break;case pq.MULTIPLE:t=(0,r.jsx)("div",{className:RW().multipleIconWrapper,children:(0,r.jsx)(GK.Z,{className:lh()(RW().headerIcon,RW().multipleIcon),color:$b.Z.unsafe_rawColors.PRIMARY_300.css})});break;default:t=(0,r.jsx)("img",{src:null!=n?n:void 0,alt:"",className:RW().headerIcon})}return null!=o||null!=i?(0,r.jsx)(c.P3F,{onClick:o,className:lh()(null!=o?RW().clickableIcon:""),onContextMenu:i,children:t}):t};hq.Src=pq;var Eq=function(e){ var t=e.priorityUser,n=e.title,o=e.subtitle,i=e.icon,a=e.onContextMenu,s=e.guildId;return(0,r.jsxs)("header",{className:null!=i?RW().headerFull:RW().headerSimple,children:[(0,r.jsx)(c.qEK,{src:t.user.getAvatarURL(s,32),"aria-label":t.user.username,size:c.EFr.SIZE_32,className:RW().headerAvatar,status:t.status,onContextMenu:a}),(0,r.jsxs)("div",{className:RW().headerDetails,children:[(0,r.jsx)(c.xvT,{className:lh()(RW().textContent),variant:"text-md/semibold",children:n}),(0,r.jsx)(c.xvT,{color:"header-secondary",className:RW().textContent,variant:"text-sm/normal",children:o})]}),null!=i?i:null]})};Eq.Icon=hq;var yq=function(e){var t=e.children,n=e.className,o=$K(e,["children","className"]);return(0,r.jsx)(c.tEY,{children:(0,r.jsx)(pW.Z,QK(XK({className:lh()(n,RW().wrapper),padded:!0},o),{children:t}))})};yq.Header=Eq;yq.Body=function(e){var t=e.children;return(0,r.jsx)(pW.Z,{inset:!0,padded:!1,className:RW().body,children:t})};yq.Separator=function(e){var t=e.inset,n=e.className ;return(0,r.jsx)("div",{className:lh()(RW().separator,KK({},RW().inset,t),n)})};yq.VoiceSection=function(e){var t,n,i=e.guild,a=e.channel,s=e.onGuildClick,l=e.partySize,u=e.members,f=e.onChannelContextMenu,d=o.useRef(null),p=(0,op.ZP)(a,!0);return(0,r.jsx)(fq,{children:(0,r.jsxs)("div",{className:RW().voiceSection,ref:d,onContextMenu:function(e){return f(e,a)},children:[(0,r.jsx)(c.P3F,{onClick:s,"aria-hidden":!0,tabIndex:-1,children:(0,r.jsxs)("div",{className:RW().voiceSectionAssets,children:[null!=i.getIconURL(32)?(0,r.jsx)("img",{alt:"",src:null!==(t=i.getIconURL(32))&&void 0!==t?t:void 0,className:lh()(RW().voiceSectionGuildImage,RW().largeImageMask)}):(0,r.jsx)("div",{className:RW().voiceSectionNoGuildImageWrapper,children:(0,r.jsx)("div",{className:RW().voiceSectionNoGuildImage,style:{fontSize:null!==(n=sq[i.acronym.length])&&void 0!==n?n:sq[sq.length-1]},children:i.acronym})}),(0,r.jsx)("div",{className:RW().voiceSectionIconWrapper,children:(0,r.jsx)(VK.Z,{ className:RW().voiceSectionIcon})})]})}),(0,r.jsx)(c.P3F,{onClick:s,focusProps:{ringTarget:d},children:(0,r.jsxs)("div",{className:RW().voiceSectionDetails,children:[cq(i.toString(),RW().voiceSectionText),lq(p,RW().voiceSectionText)]})}),(0,r.jsx)(YK.Z,{partySize:l,members:u,guildId:i.id})]})})};yq.GameSection=function(e){var t=e.icon,n=e.name,o=e.partySize,i=e.members;return(0,r.jsx)(fq,{children:(0,r.jsxs)("div",{className:RW().gameSection,children:[null!=t?(0,r.jsx)("img",{alt:"",src:t,className:RW().gameSectionIcon}):null,(0,r.jsxs)("div",{children:[cq(n),lq(Q.Z.Messages.ACTIVITY_FEED_SINGLE_MEMBER_LIST_HEADER.format({memberCount:o.totalSize}))]}),(0,r.jsx)(YK.Z,{partySize:o,members:i})]})})};yq.RichPresenceSection=dq;yq.XboxSection=function(e){var t=e.title;return(0,r.jsx)(fq,{children:(0,r.jsxs)("div",{className:RW().xboxSection,children:[(0,r.jsx)(HK.Z,{className:RW().xboxSectionIcon}),(0,r.jsxs)("div",{className:RW().xboxSectionDetails, children:[cq(t),lq(Q.Z.Messages.GAME_FEED_ACTIVITY_PLAYING_XBOX)]})]})})};yq.SpotifySection=function(e){var t=e.activity,n=t.assets,o=t.details,i=t.state,a=t.application_id,s=e.partySize,c=e.members,l=e.isSolo,u=e.getAssetImage;return(0,r.jsx)(fq,{children:(0,r.jsxs)("div",{className:RW().spotifySection,children:[null!=n?(0,r.jsxs)("div",{className:RW().activitySectionAssets,children:[(0,r.jsx)("img",{alt:null!==(oq=n.large_text)&&void 0!==oq?oq:"",src:u(a,n.large_image,[aq,aq]),className:lh()(RW().largeImage,RW().borderRadius0,KK({},RW().largeImageMask,null!=n.small_image))}),l?null:(0,r.jsx)(BK.Z,{className:RW().smallImage,color:$b.Z.unsafe_rawColors.SPOTIFY.css})]}):(0,r.jsx)("div",{}),(0,r.jsxs)("div",{children:[null!=o?cq(o):null,null!=i?lq(i):null]}),(0,r.jsx)(YK.Z,{minAvatarsShown:l?2:1,partySize:s,members:c})]})})};yq.TwitchSection=function(e){var t,o,i=e.activity,a=e.user,s=e.getAssetImage,l=e.guildId,u=i.name,f=i.details,d=i.assets,p=i.application_id;if(null!=d&&(0,SW.Z)(i)){ var h;t=(0,r.jsx)(LK.Z,{className:RW().twitchSectionPreviewWrapper,aspectRatio:16/9,children:(0,r.jsxs)(c.P3F,{href:(0,xK.Z)(i),tag:"a",target:"_blank",children:[(0,r.jsx)("img",{alt:null!==(h=d.large_text)&&void 0!==h?h:"",src:s(p,d.large_image,[900,500]),className:RW().twitchSectionPreview}),(0,r.jsx)("img",{src:n(182105),className:RW().twitchSectionPlayButton,alt:""})]})})}return(0,r.jsxs)(fq,{children:[(0,r.jsxs)("div",{className:lh()((o={},KK(o,RW().twitchSectionSimple,null==a),KK(o,RW().twitchSectionFull,null!=a),o)),children:[(0,r.jsx)("img",{alt:"",src:jK.Z.get(M.ABu.TWITCH).icon.lightSVG,className:RW().twitchSectionIcon}),(0,r.jsxs)("div",{children:[cq(u),null!=f?lq(f):null]}),null!=a?(0,r.jsx)(c.qEK,{src:a.getAvatarURL(l,24),"aria-label":a.username,className:RW().twitchSectionAvatar,size:c.EFr.SIZE_24}):null]}),t]})};yq.ApplicationStreamingSection=function(e){var t,n=e.activity,o=e.user,i=e.applicationStream,a=e.onPreviewClick,l=e.guildId,u=(0,s.e7)([S.Z],(function(){ return S.Z.getChannel(i.channelId)})),f=tq((0,Rr.wq)(u),2),d=f[0],p=f[1],h=(0,r.jsx)(LK.Z,{className:RW().applicationStreamingPreviewWrapper,aspectRatio:16/9,children:(0,r.jsxs)(c.P3F,{onClick:d?a:void 0,className:RW().applicationStreamingPreviewSize,children:[(0,r.jsx)(Xv.Z,{stream:i,className:RW().applicationStreamingPreviewSize}),(0,r.jsx)("div",{className:RW().applicationStreamingHoverWrapper,children:(0,r.jsx)("div",{className:RW().applicationStreamingHoverText,children:(0,Rr.P9)(p)})})]})}),E=null!==(t=(0,wK.Z)(n,i))&&void 0!==t?t:Q.Z.Messages.SHARING_SCREEN;return(0,r.jsxs)(fq,{children:[(0,r.jsxs)("div",{className:RW().applicationStreamingSection,children:[(0,r.jsx)(c.qEK,{size:c.EFr.SIZE_32,src:o.getAvatarURL(l,32),"aria-label":o.username,className:RW().applicationStreamingAvatar}),(0,r.jsxs)("div",{children:[cq(lp.ZP.getName(o)),lq(E)]}),(0,r.jsx)(FK.ZP,{size:FK.ZP.Sizes.SMALL})]}),h]})};yq.EmbeddedActivitySection=function(e){ var t=e.activity,n=e.channel,i=e.guildId,a=e.participants,l=(0,DK.Z)(),u=tq(o.useState(null),2),f=u[0],d=u[1];o.useEffect((function(){null!=t.application_id&&(0,bc.GR)(t.application_id,["embedded_background"]).then((function(e){var t=tq(e,1)[0];return d(t)}))}),[t.application_id]);var p,h=(0,s.Wu)([Y.default,Jn.default],(function(){return Array.from(a).map((function(e){return Jn.default.getId()===e?null:Y.default.getUser(e)})).filter(_o.lm)})),E=(0,PK.O)(),y=(0,Hw.Z)().analyticsLocations,m=Rn.Z.getGame(null!==(p=null==t?void 0:t.application_id)&&void 0!==p?p:"");if(null==m)return null;var b=null!=t.created_at&&t.created_at>0?{start:t.created_at}:void 0,O=(0,bc.xF)(m.id,f,300);return(0,r.jsxs)(fq,{children:[(0,r.jsxs)("div",{className:RW().embeddedActivityTopRow,children:[(0,r.jsx)(UK.Z,{game:m,size:UK.Z.Sizes.XSMALL,className:RW().embeddedActivityIcon}),(0,r.jsx)("div",{className:RW().embeddedActivityName,children:(0,r.jsx)(c.xvT,{variant:"text-sm/semibold",children:m.name}) }),null!=b?(0,r.jsx)("div",{className:RW().embeddedActivityTimeElapsed,children:(0,r.jsx)(c.xvT,{color:"text-muted",variant:"text-sm/normal",children:(0,r.jsx)(uq,{timestamps:b})})}):null]}),(0,r.jsx)(LK.Z,{aspectRatio:16/9,children:(0,r.jsxs)("div",{className:RW().embeddedActivityPlayerContainer,children:[null!=O?(0,r.jsx)("img",{src:O,alt:m.name,className:RW().embeddedActivityImage}):null,(0,r.jsxs)("div",{className:RW().embeddedActivityImageOverlay,children:[(0,r.jsx)(ZK.OV,{users:h,guildId:i,channelId:n.id}),(0,r.jsx)("div",{className:RW().embeddedActivityJoinWrapper,children:(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,onClick:function(e){e.stopPropagation();(0,RK.Z)({activity:t,currentEmbeddedApplication:l,activityChannelId:n.id,locationObject:E.location,embeddedActivitiesManager:g.Z,analyticsLocations:y})},children:Q.Z.Messages.JOIN})})]})]})})]})};const mq=yq;var bq=64;function gq(e,t){var n,r=e.length,o=0;if(null!=t&&null!=t.party&&null!=t.party.size&&t.party.size.length>=2){ var i=t.party.size;o=Math.max(i[0]-e.length,0);n=i[1]}else n=r+o;return{knownSize:r,unknownSize:o,totalSize:n}}function Oq(e){var t=e.party,n=e.onChannelContextMenu,o=t.voiceChannels,i=t.currentActivities,a=t.partiedMembers,s=t.applicationStreams,c=t.guildContext,l=[],u=function(e){var t=l.length;if(0!==t){var n,o,i=l[t-1],a="".concat(null!==(n=null==e?void 0:e.key)&&void 0!==n?n:""),s="".concat(null!==(o=null==i?void 0:i.key)&&void 0!==o?o:"").startsWith("game")&&a.startsWith("rich-presence");l.push((0,r.jsx)(mq.Separator,{inset:s},"sep-".concat(a)));l.push(e)}else l.push(e)};o.length>0&&o.forEach((function(e){var t=e.members,o=e.channel,i=e.guild;u((0,r.jsx)(mq.VoiceSection,{guild:i,channel:o,members:t,partySize:gq(t),onChannelContextMenu:n,onGuildClick:function(){(0,AK.X)(i.id)}},"voice-".concat(o.id)))}));var f=!0,p=!1,h=void 0;try{for(var E,y=t.currentActivities[Symbol.iterator]();!(f=(E=y.next()).done);f=!0){var m=E.value.activity;if(null!=m){var b=wW(m);if(null!=b){u(b);break}}} }catch(e){p=!0;h=e}finally{try{f||null==y.return||y.return()}finally{if(p)throw h}}s.length>0&&s.forEach((function(e){var t=e.stream,n=e.streamUser,o=e.activity;u((0,r.jsx)(mq.ApplicationStreamingSection,{guildId:null==c?void 0:c.id,user:n,activity:o,applicationStream:t,onPreviewClick:function(){d.default.selectVoiceChannel(t.channelId);(0,Tr.iV)(t)}},"application-stream-".concat(t.ownerId)))}));i.forEach((function(e,t){var n=e.activity,s=e.game,l=e.playingMembers,f=e.activityUser;if(null==n||null==n.type)return null;if(i.length>1&&n.type===M.IIU.PLAYING&&!(0,NK.Z)(n)&&null!=s){var d,p;u((0,r.jsx)(mq.GameSection,{icon:s.getIconURL(bq),name:s.name,partySize:{knownSize:l.length,unknownSize:0,totalSize:l.length},members:l},"game-".concat(null!==(d=n.session_id)&&void 0!==d?d:t,"-").concat(null!==(p=n.application_id)&&void 0!==p?p:t)))}else if((0,vW.Z)(n)){var h,E=new Set(l.map((function(e){return e.id}))),y=null===(h=o.find((function(e){return null!=e})))||void 0===h?void 0:h.channel ;null!=y&&u((0,r.jsx)(mq.EmbeddedActivitySection,{activity:n,participants:E,channel:y,guildId:y.guild_id},"embedded-activity-".concat(n.application_id)))}else if(null==n.assets&&!(0,NK.Z)(n)||n.type!==M.IIU.PLAYING)if((0,SW.Z)(n)){var m,b=o.length>0&&o[0].members.length>1,g=l.length>1;u((0,r.jsx)(mq.TwitchSection,{guildId:null==c?void 0:c.id,activity:n,user:b||g?f:null,getAssetImage:bc.xF},"streaming-".concat(null!==(m=n.session_id)&&void 0!==m?m:t)))}else if((0,_W.Z)(n)){var O;u((0,r.jsx)(mq.SpotifySection,{activity:n,isSolo:1===a.length,partySize:{knownSize:l.length,unknownSize:0,totalSize:l.length},getAssetImage:bc.xF,members:l},"spotify-".concat(null!==(O=n.session_id)&&void 0!==O?O:t,"-").concat(f.id)))}else if(null==n.assets&&!(0,NK.Z)(n)||n.type!==M.IIU.LISTENING){if((0,IW.Z)(n)){var v;u((0,r.jsx)(mq.XboxSection,{title:s.name},"xbox-".concat(null!==(v=n.session_id)&&void 0!==v?v:t)))}}else{var _;u((0,r.jsx)(mq.RichPresenceSection,{activity:n,getAssetImage:bc.xF },"rich-presence-".concat(null!==(_=n.session_id)&&void 0!==_?_:t,"-").concat(f.id)))}else{var I;u((0,r.jsx)(mq.RichPresenceSection,{activity:n,getAssetImage:bc.xF},"rich-presence-".concat(null!==(I=n.session_id)&&void 0!==I?I:t,"-").concat(f.id)))}}));return l.length>0?(0,r.jsx)(mq.Body,{children:l}):null}function vq(e){var t=e.party,o=e.onUserContextMenu,i=t.priorityMembers,a=t.guildContext,s=i[0],c=function(e){var t=e.priorityMembers,n=e.partiedMembers,r=new Set(t.map((function(e){return e.user.id}))),o=n.filter((function(e){return!r.has(e.id)})),i=lp.ZP.getName(t[0].user),a=null!=t[1]?lp.ZP.getName(t[1].user):null!=o[0]?lp.ZP.getName(o[0]):null;switch(n.length){case 1:return i;case 2:return Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_HEADER_TWO_KNOWN_ONLY.format({user1:i,user2:a});default:return Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_HEADER_TWO_KNOWN.format({user1:i,user2:a,extras:n.length-2})}}(t),l=function(e){ var t,o=e.priorityMembers,i=e.partiedMembers,a=e.voiceChannels,s=e.currentActivities,c=o.length,l=c+(i.length-c)===1,u=s[0],f=null==u?void 0:u.activity,d=null==u?void 0:u.startedPlayingTime,p={name:null!==(t=null==f?void 0:f.name)&&void 0!==t?t:""};if((0,vW.Z)(f)&&null!=f)return{subtitle:(0,r.jsx)(kK.ZP,{start:d,location:kK.ZP.Locations.ACTIVITY_FEED_NEW,messageProps:p}),icon:null};if(l&&null!=u){var h=u.game;if(null==f)return{subtitle:null,icon:null};var E=MW(f);if(null!=E)return E;switch(f.type){case M.IIU.PLAYING:return(0,IW.Z)(f)?{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_XBOX,icon:(0,r.jsx)(mq.Header.Icon,{src:mq.Header.Icon.Src.XBOX})}:{subtitle:(0,r.jsx)(kK.ZP,{start:d,location:kK.ZP.Locations.ACTIVITY_FEED_NEW,messageProps:p}),icon:null!=h?(0,r.jsx)(mq.Header.Icon,{src:null!=h.getIconURL(bq)?h.getIconURL(bq):n(534413)}):null};case M.IIU.STREAMING:return{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_STREAMING_TWITCH,icon:null!=h&&null!=h.getIconURL(bq)?(0,r.jsx)(mq.Header.Icon,{ src:h.getIconURL(bq)}):null};case M.IIU.LISTENING:var y;y=(0,_W.Z)(f)?(0,r.jsx)(mq.Header.Icon,{src:mq.Header.Icon.Src.SPOTIFY}):null!=h.getIconURL(bq)?(0,r.jsx)(mq.Header.Icon,{src:h.getIconURL(bq)}):(0,r.jsx)(mq.Header.Icon,{src:n(534413)});return{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_LISTENING.format({name:f.name}),icon:y};case M.IIU.WATCHING:return{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_WATCHING,icon:null!=h&&null!=h.getIconURL(bq)?(0,r.jsx)(mq.Header.Icon,{src:h.getIconURL(bq)}):null};default:return{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_IN_A_VOICE_CHANNEL,icon:null}}}if(0===s.length){if(a.length>0)return{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_IN_A_VOICE_CHANNEL,icon:null};var m=s[0];if(null!=m){var b=m.activity;if(null!=b){var g=MW(b);if(null!=g)return g}if(null!=b&&b.type===M.IIU.LISTENING)return{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_SPOTIFY,icon:(0,r.jsx)(mq.Header.Icon,{src:mq.Header.Icon.Src.SPOTIFY})}}}else if(1===s.length){ var O=s.find((function(e){return null!=e.activity}));if(null==O)return{subtitle:null,icon:null};var v=O.activity,_=O.game,I=O.startedPlayingTime;xh()(null!=v,"Activity was null somehow");return{subtitle:(0,r.jsx)(kK.ZP,{start:I,location:kK.ZP.Locations.ACTIVITY_FEED_NEW,messageProps:p}),icon:null!=_&&null!=_.getIconURL(bq)?(0,r.jsx)(mq.Header.Icon,{src:_.getIconURL(bq)}):null}}return{subtitle:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_MULTIPLE_GAMES,icon:(0,r.jsx)(mq.Header.Icon,{src:mq.Header.Icon.Src.MULTIPLE})}}(t),u=l.subtitle,f=l.icon;return(0,r.jsx)(mq.Header,{priorityUser:s,guildId:null==a?void 0:a.id,title:c,subtitle:u,icon:f,onContextMenu:function(e){return o(e,s.user)}})}var _q=n(545580),Iq=n(629223),Sq=n(476020);function Tq(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]1,n=function(e){var t=e.currentActivities,n=(0,s.e7)([Iq.Z],(function(){return Iq.Z.getAccounts().some((function(e){return e.type===jK.Z.get(M.ABu.XBOX).type}))})),o=t.some((function(e){var t=e.activity;return(0,IW.Z)(t)}));return n||!o?null:(0,r.jsx)(c.sNh,{id:"xbox-connect",action:function(){return h.Z.open(M.oAB.CONNECTIONS)},label:Q.Z.Messages.USER_ACTIVITY_CONNECT_PLATFORM.format({platform:Mq})})}(e),i=function(e){var t=e.currentActivities,n=o.useContext(Ie.AnalyticsContext);return(0,s.Wu)([ze.ZP,Ln.Z,Wn.Z,qy.Z,Sq.Z],(function(){return t.filter((function(e){return!(0,vW.Z)(e.activity)})).map((function(e){var t=e.activity,r=e.game,o=Ln.Z.getActiveLibraryApplication(r.id);return jq(Pq({},e),{libraryApplication:o,canJoin:null!=t&&(0, _q.Z)(t,M.xjy.JOIN)&&t.type===M.IIU.PLAYING,canPlay:(0,er.t)({LibraryApplicationStore:Ln.Z,LaunchableGameStore:Wn.Z,DispatchApplicationStore:qy.Z,ConnectedAppsStore:Sq.Z,applicationId:r.id,branchId:null!=o?o.branchId:null}),isLaunching:Wn.Z.launchingGames.has(r.id),isRunning:ze.ZP.getRunningVerifiedApplicationIds().includes(r.id),location:n.location})}))}),[t])}(e),a=[],l=!0,u=!1,f=void 0;try{for(var d,p=i[Symbol.iterator]();!(l=(d=p.next()).done);l=!0){var E=d.value,y=E.activity;null!=y&&null!=y.type&&a.push(wq(E,t),Dq(E,t))}}catch(e){u=!0;f=e}finally{try{l||null==p.return||p.return()}finally{if(u)throw f}}return[n].concat(Rq(a))}var Lq=n(386691),Uq=n.n(Lq);function kq(e){var t=e.user,n=e.status,o=e.isFocused,i=e.guildId;return(0,r.jsxs)("div",{className:Uq().memberItem,children:[(0,r.jsx)(c.qEK,{src:t.getAvatarURL(i,24),className:Uq().avatar,"aria-label":t.username,size:c.EFr.SIZE_24,status:n,statusColor:o?"currentColor":void 0}),(0,r.jsx)(UV.Z,{user:t,hideDiscriminator:!0})]})} function Gq(e){var t=e.label;return(0,r.jsxs)("div",{className:Uq().memberItem,children:[(0,r.jsx)("div",{className:lh()(Uq().avatar,Uq().unknown)}),(0,r.jsx)("div",{children:t})]})}function Bq(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&a.push((0,r.jsx)(c.sNh,{id:"unknown-members-".concat(null==o?void 0:o.session_id),render:function(e){return(0,r.jsx)(Gq,Fq(Vq({},e),{ label:Q.Z.Messages.GAME_FEED_UNKNOWN_PLAYERS.format({count:O})}))}}));return a}var Wq=n(761953);function Kq(e){return{af_voice_chat:e.voiceChannels.length>0,af_people_count:e.partiedMembers.length,af_rich_presence:e.currentActivities.some((function(e){var t=e.activity;return(0,NK.Z)(t)})),game_platform:e.currentActivities.length>0?(0,Mp.Z)(e.currentActivities[0].activity):null}}function qq(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Xq(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],n=function(){Wq.Z.openPrivateChannel(l).then((function(t){return Sb.ZP.trackWithMetadata(M.rMx.ACTIVITY_FEED_DM_VISITED,Xq({source:Qq(Xq({},s.location),{object:M.qAy.LIST_ITEM}),channel_id:t,recipient_id:"string"==typeof l?l:l[0],af_recently_played:!1},Kq(e)))}))},i=e.priorityMembers,a=e.partiedMembers,s=o.useContext(Ie.AnalyticsContext),l=i.map((function(e){return e.user.id})),u=1===a.length&&1===i.length,f=i.length-a.length>0 ;return!u&&!t||f||0===l.length?null:(0,r.jsx)(c.sNh,{id:"message",action:n,label:Q.Z.Messages.SEND_DM})}(t),l=function(e){var t=o.useContext(Ie.AnalyticsContext),n=e.voiceChannels[0],i=(0,s.e7)([dn.Z],(function(){return null!=n&&dn.Z.can(M.Plq.CONNECT,n.channel)}));return null==n?null:[(0,r.jsx)(c.sNh,{id:"join-voice",action:function(){(0,AK.X)(n.guild.id);d.default.selectVoiceChannel(n.channel.id);Sb.ZP.trackWithMetadata(M.rMx.ACTIVITY_FEED_VOICE_CHANNEL_VISITED,iX({source:aX(iX({},t.location),{object:M.qAy.LIST_ITEM}),guild_id:n.guild.id,channel_id:n.channel.id},Kq(e)))},label:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_ACTION_JOIN_CHANNEL,disabled:!i},"join-voice"),(0,r.jsx)(c.sNh,{id:"goto-server",action:function(){(0,AK.X)(n.guild.id);Sb.ZP.trackWithMetadata(M.rMx.ACTIVITY_FEED_GUILD_VISITED,iX({source:aX(iX({},t.location),{object:M.qAy.LIST_ITEM}),guild_id:n.guild.id,af_recently_played:!1},Kq(e)))},label:Q.Z.Messages.ACTIVITY_FEED_NOW_PLAYING_ACTION_GO_TO_SERVER},"goto-server")] }(t),u=function(e){return e.applicationStreams.map((function(e){var t=e.stream,n=e.streamUser;return(0,r.jsx)(c.sNh,{id:"spectate-".concat(t.ownerId),action:function(){d.default.selectVoiceChannel(t.channelId);(0,Tr.iV)(t)},label:Q.Z.Messages.WATCH_USER_STREAM.format({streamerName:lp.ZP.getName(n)})},"spectate-".concat(t.ownerId))}))}(t),f=rX(t),p=Zq(t),h=function(e){var t=e.priorityMembers,n=e.partiedMembers,i=e.currentActivities,a=e.guildContext,s=new Set(t.map((function(e){return e.user.id}))),l=n.filter((function(e){return!s.has(e.id)})),u=o.useMemo((function(){var e=i.flatMap((function(e){return e.playingMembers})).map((function(e){return e.id}));return n.filter((function(t){return!e.includes(t.id)}))}),[n,i]);if(i.length<=1&&0===u.length){var f,d;return(0,r.jsx)(c.kSQ,{label:n.length>1?Q.Z.Messages.ACTIVITY_FEED_SINGLE_MEMBER_LIST_HEADER.format({memberCount:n.length}):void 0, children:zq(t,l,n.length,null!==(d=null===(f=i[0])||void 0===f?void 0:f.activity)&&void 0!==d?d:void 0,null==a?void 0:a.id)})}var p=i.map((function(e,n){var o=e.playingMembers,i=e.game,l=e.activity,u=new Set(o.map((function(e){return e.id})));return(0,r.jsx)(c.kSQ,{label:"".concat(i.name," - ").concat(o.length),children:zq(t.filter((function(e){var t=e.user;return u.has(t.id)})),o.filter((function(e){return!s.has(e.id)})),o.length,null!=l?l:void 0,null==a?void 0:a.id)},n)})),h=u.map((function(e){return e.id})),E=(0,r.jsx)(c.kSQ,{label:"".concat(Q.Z.Messages.ACTIVITY_FEED_OTHER_MEMBER_LIST_HEADER," - ").concat(u.length),children:zq(t.filter((function(e){var t=e.user;return h.includes(t.id)})),u.filter((function(e){return!s.has(e.id)})),u.length,void 0,null==a?void 0:a.id)});return Yq(p).concat([E])}(t);return(0,r.jsxs)(c.v2r,{navId:"now-playing-menu",onClose:n,"aria-label":Q.Z.Messages.GENERIC_ACTIONS_MENU_LABEL,onSelect:i,children:[a,(0,r.jsxs)(c.kSQ,{children:[l,u]}),(0,r.jsx)(c.kSQ,{ children:f}),(0,r.jsx)(c.kSQ,{children:p}),h]})}var cX=n(658689);function lX(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function uX(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){lX(i,r,o,a,s,"next",e)}function s(e){lX(i,r,o,a,s,"throw",e)}a(void 0)}))}}function fX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dX(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function pX(e){pX=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return pX(e)}function hX(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?t.map((function(e){var t=e.party;return(0,r.jsx)(NX,{party:t},t.id)})):(0,r.jsxs)("div",{className:_X().emptyCard,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",className:_X().emptyHeader,children:Q.Z.Messages.ACTIVITY_FEED_NONE_PLAYING_HEADER}),(0,r.jsx)(c.xvT,{color:"none",className:_X().emptyText,variant:"text-sm/normal",children:Q.Z.Messages.ACTIVITY_FEED_NONE_PLAYING_BODY})]});return(0,r.jsx)(r.Fragment,{children:u})}var PX=n(252569),jX=n.n(PX);function RX(){var e=(0,Hw.Z)(Pf.Z.ACTIVE_NOW_COLUMN).AnalyticsLocationProvider,t=(0, s.e7)([mW.Z],(function(){return mW.Z.hasConsented(M.pjP.PERSONALIZATION)}))?[]:[ln.z$.NOW_PLAYING_CONSENT_CARD],n=(0,q.Dt)();return(0,r.jsx)(e,{children:(0,r.jsx)(fW.Z,{section:M.jXE.ACTIVE_NOW_COLUMN,children:(0,r.jsx)("aside",{className:jX().container,"aria-labelledby":n,children:(0,r.jsxs)(c.Ttm,{className:jX().scroller,children:[(0,r.jsx)(c.X6q,{variant:"heading-lg/semibold",className:jX().header,id:n,children:Q.Z.Messages.GAME_FEED_CURRENT_HEADER_TITLE}),(0,r.jsx)(WN.Z,{contentTypes:t,children:function(e){var t=e.visibleContent,n=e.markAsDismissed;if(t===ln.z$.NOW_PLAYING_CONSENT_CARD)return(0,r.jsx)(yW,{className:jX().consentCard,markAsDismissed:n})}}),(0,r.jsx)(CX,{})]})})})})}var xX=n(864928),MX=n(169376);function wX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DX(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[];wX(this,e);this._rows=t}var t=e.prototype;t.reset=function(){var t=Wa().map(Ja.Z.getRelationships(),(function(e,t){return new WX(kX({key:t,type:e, nickname:Ja.Z.getNickname(t)},FX(t),YX(t),zX(t)))})),n=Wa().map(lW.getSuggestions(),(function(e){return new WX(kX({key:e.key,type:99,nickname:e.name},FX(e.key),YX(e.key),zX(e.key)))}));return new e(Wa().concat(t,n))};t.clone=function(){return new e(this._rows)};t.update=function(e){for(var t=!1,n=0;n0&&void 0!==arguments[0]&&arguments[0];if(qX&&(e||QX!==M.pJs.ONLINE&&QX!==M.pJs.ADD_FRIEND)&&!XX){qX=!1;XX=!0;xX.Z.fetchRelationships()}}function nQ(){qX=!0;JX?XX=!1:tQ();$X=$X.reset();if(!eQ){var e=$X.getRelationshipCounts();QX=0===e[M.OGo.FRIEND]?0!==e[M.OGo.PENDING_INCOMING]?M.pJs.PENDING:M.pJs.ADD_FRIEND:M.pJs.ONLINE}}function rQ(){$X=JX?new KX:$X.reset()}function oQ(e){return function(){if(JX)return!1;if($X.update(e)){$X=$X.clone();return!0}return!1}}var iQ=function(e){UX(n,e);var t=VX(n);function n(){wX(this,n);return t.apply(this,arguments)} var r=n.prototype;r.initialize=function(){this.waitFor(Ja.Z,$a.Z,Y.default,Zt.Z,qa.ZP,Pr.Z,lW);this.syncWith([Ja.Z],rQ);this.syncWith([lW],rQ);this.syncWith([Y.default],oQ(FX));this.syncWith([$a.Z,Pr.Z],oQ(YX));nQ()};r.getState=function(){return{fetching:XX,section:QX,pendingCount:Ja.Z.getPendingCount(),rows:$X}};r.__getLocalVars=function(){return{SUGGESTION_TYPE:99,shouldFetch:qX,fetching:XX,section:QX,rows:$X,pause:JX,initialSectionSet:eQ}};return n}(s.ZP.Store);iQ.displayName="FriendsStore";const aQ=new iQ(O.Z,{CONNECTION_OPEN:function(){nQ()},FRIENDS_SET_SECTION:function(e){QX=e.section;tQ()},CHANNEL_SELECT:function(e){var t=e.channelId;JX=null!=t;rQ();return!JX},LOAD_RELATIONSHIPS_SUCCESS:function(){XX=!1},LOAD_RELATIONSHIPS_FAILURE:function(){qX=!0;XX=!0},DRAWER_SELECT_TAB:function(e){var t=e.tab;JX=t!==M.cII.FRIENDS;rQ();return!JX},FRIENDS_SET_INITIAL_SECTION:function(e){QX=e.section;eQ=!0}});var sQ=n(491275),cQ=n(792708),lQ=n(908478),uQ=n(668785),fQ=n(780929),dQ=n.n(fQ) ;function pQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=48&&t.which<=57;(null!=o&&o>r&&/^(.+?#\d{4})$/.test(n)&&!i||null!=o&&o>r&&!a&&!i)&&t.preventDefault()}},onChange:function(e){if(e.length<=0)a({type:"RESET"});else{var t="",n=mQ(e.split("#"),2)[1] ;d&&null==n||(t=e+M.LYt.slice(null!=n?n.length+1:0));a({type:"HINT",text:t})}},maxLength:37,autoFocus:!0,autoComplete:"off",name:"add-friend","data-lpignore":!0,placeholder:d?Q.Z.Messages.POMELO_ADD_FRIEND_DESCRIPTION:Q.Z.Messages.ADD_FRIEND_PLACEHOLDER,"aria-label":d?Q.Z.Messages.POMELO_ADD_FRIEND_DESCRIPTION:Q.Z.Messages.ADD_FRIEND_PLACEHOLDER,"aria-invalid":null!=f||void 0,"aria-describedby":null!=f?vQ:OQ}),null!=l&&(0,r.jsx)("div",{className:dQ().addFriendHint,"aria-hidden":!0,children:l}),(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,disabled:!s,type:"submit",children:Q.Z.Messages.ADD_FRIEND_BUTTON})]})}),null!=f&&(0,r.jsx)(c.R94,{role:"alert",id:vQ,type:c.R94.Types.ERROR,className:gh().marginTop8,children:f}),null!=u&&(0,r.jsx)(c.R94,{role:"status",type:c.R94.Types.SUCCESS,className:gh().marginTop8,children:u})]})}var SQ=n(215841),TQ=n(106750);function NQ(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function AQ(e,t){ t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function CQ(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function PQ(e){var t=e.color,n=void 0===t?"currentColor":t,o=CQ(e,["color"]);return(0,r.jsx)("svg",AQ(function(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function n$(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=t$(e,["width","height","color","foreground"]);return(0,r.jsx)("svg",e$(function(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?(0,r.jsx)(D$.Z,{className:L$().activity,textClassName:L$().text,emojiClassName:L$().customStatusEmoji,activities:n,applicationStream:o,animate:t}):(0,r.jsx)("div",{className:L$().text,children:(0,lp.u5)(i)})};var k$=n(299677),G$=n.n(k$);function B$(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H$(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function V$(e){V$=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return V$(e)}function F$(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}const sJ=function(e){var t=e.statusSections,n=e.renderRow,i=e.searchQuery,a=function(e){return 0===t[e].length?0:40},l=function(e){var r=e.section,o=e.row,i=t[r];if(null==i||null==o)return null;var a=i[o];return null==a?null:n(a)},u=(0,s.e7)([E.Z],(function(){return E.Z.keyboardModeEnabled})),f=o.useRef(null),d=o.useCallback((function(){return new Promise((function(e){var t=f.current;if(null==t)return e();t.scrollToTop({callback:function(){ return requestAnimationFrame((function(){return e()}))}})}))}),[]),p=o.useCallback((function(){return new Promise((function(e){var t=f.current;if(null==t)return e();t.scrollToBottom({callback:function(){return requestAnimationFrame((function(){return e()}))}})}))}),[]),h=o.useCallback((function(e){var t=document.querySelector(e),n=f.current;null!=t&&null!=n&&n.scrollIntoViewNode({node:t,padding:8,callback:function(){return null==t?void 0:t.focus()}})}),[]),y=(0,nJ.ZP)({id:"people-list",isEnabled:u,scrollToStart:d,scrollToEnd:p,setFocus:h});return(0,r.jsx)(pb.bG,{navigator:y,children:(0,r.jsx)(pb.SJ,{children:function(e){var n=e.ref,o=aJ(e,["ref"]);return(0,r.jsx)(c._2F,function(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}var hJ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r), 0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=64?(0,r.jsx)(sJ,{statusSections:n,renderRow:o,searchQuery:i}):(0, r.jsx)(EJ,{statusSections:n,renderRow:o,sectionFilter:a,searchQuery:i,useReducedMotion:s})}var mJ=n(791451),bJ=n.n(mJ);function gJ(e){var t=e.title,n=e.id;return(0,r.jsx)(dV.Z,{className:bJ().title,id:n,children:t})}var OJ=n(227580),vJ=n.n(OJ);function _J(e){var t=e.user,n=e.nickname,i=e.status,a=e.isFocused,s=o.useContext(Ie.AnalyticsContext),c=function(e){null==e||e.stopPropagation();xX.Z.addRelationship({userId:t.id,context:{location:"Friends"},type:void 0,friendToken:void 0,fromFriendSuggestion:!0})},l=function(e){null==e||e.stopPropagation();zz(t.id)},u=i===M.Skl.OFFLINE?M.Skl.UNKNOWN:i;return(0,r.jsx)(T$,{isFocused:a,user:t,onClick:function(){return(0,xp.m)({userId:t.id,analyticsLocation:s.location})},children:function(e){var o=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l$,{icon:gA.Z,actionType:l$.ActionTypes.ACCEPT,tooltip:Q.Z.Messages.FRIEND_REQUEST_ACCEPT,onClick:c,shouldHighlight:e}),(0,r.jsx)(l$,{icon:Ub.Z,actionType:l$.ActionTypes.DENY, tooltip:Q.Z.Messages.FRIEND_REQUEST_IGNORE,onClick:l,shouldHighlight:e})]});return(0,r.jsxs)("div",{className:vJ().listItemContents,children:[(0,r.jsx)(j$,{user:t,hovered:e,status:u,subText:n,className:vJ().userInfo}),(0,r.jsx)("div",{className:vJ().actions,children:o})]})}})}function IJ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?(0,r.jsx)(_j.mA,{count:l, className:RJ().badge,style:{paddingRight:0}}):null]}),u>0?(0,r.jsxs)(c.njP.Item,{id:M.pJs.SUGGESTIONS,className:RJ().item,"aria-label":Q.Z.Messages.FRIENDS_SECTION_SUGGESTIONS,children:[Q.Z.Messages.FRIENDS_SECTION_SUGGESTIONS,(0,r.jsx)(_j.mA,{count:u,className:RJ().badge,style:{paddingRight:0}})]}):null,(0,r.jsx)(c.njP.Item,{id:M.pJs.BLOCKED,className:RJ().item,children:Q.Z.Messages.BLOCKED}),(0,r.jsx)(c.njP.Item,{"aria-label":Q.Z.Messages.FRIENDS_SECTION_ADD_FRIEND,className:lh()(RJ().item,RJ().addFriend),id:M.pJs.ADD_FRIEND,children:(0,r.jsx)("span",{children:Q.Z.Messages.FRIENDS_SECTION_ADD_FRIEND})})]})]}),(0,r.jsxs)("div",{className:RJ().tabBody,children:[(0,r.jsx)(c.njP.Panel,{id:a,className:RJ().peopleColumn,"aria-labelledby":d,children:a===M.pJs.ADD_FRIEND?(0,r.jsx)($Q,{}):(0,r.jsx)(PJ,{titleId:d,sectionFilter:a})}),(0,r.jsx)("div",{className:RJ().nowPlayingColumn,children:(0,r.jsx)(RX,{})})]})]})} ;var wJ=n(247250),DJ=n(43566),ZJ=n(394352),LJ=n(442658),UJ=n(401080),kJ=n(552889),GJ=n(796909),BJ=n(58838),HJ=n(173808),VJ=n(136317),FJ=n(436145),YJ=n(821),zJ=n(398344),WJ=n(195363),KJ=n(401340),qJ=n(940581),XJ=n(788138),QJ=n.n(XJ),$J=n(163471),JJ=n.n($J),e0=n(770631),t0=n.n(e0),n0=n(961088),r0=n.n(n0),o0=n(630234),i0=n.n(o0),a0=n(456202),s0=n.n(a0),c0=n(791643),l0=n.n(c0),u0=n(565411),f0=n.n(u0);function d0(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?{ canUserSendEmoji:!0,userCantSendEmojiReason:void 0,actionType:E0.JUMP_TO_SERVER,guildId:t[0]}:{canUserSendEmoji:!1,userCantSendEmojiReason:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_OPEN_CHANNEL_TOOLTIP}}if(r.type!==r_.d.DM&&r.type!==r_.d.GUILD_TEXT&&r.type!==r_.d.GROUP_DM&&r.type!==r_.d.PUBLIC_THREAD&&r.type!==r_.d.PRIVATE_THREAD&&r.type!==r_.d.GUILD_VOICE)return{canUserSendEmoji:!1,userCantSendEmojiReason:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_CHANNEL_DOESNT_ALLOW_EMOJI_TOOLTIP};if(null!=n){if(!dn.Z.can(M.Plq.SEND_MESSAGES,r))return{canUserSendEmoji:!1,userCantSendEmojiReason:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_OPEN_CHANNEL_TOOLTIP};if(!dn.Z.can(M.Plq.USE_EXTERNAL_EMOJIS,r))return{canUserSendEmoji:!1,userCantSendEmojiReason:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_CHANNEL_DOESNT_ALLOW_EMOJI_TOOLTIP}}return{canUserSendEmoji:!0,userCantSendEmojiReason:void 0,actionType:E0.OPEN_CHAT}})),i=o.canUserSendEmoji,a=o.userCantSendEmojiReason,c=o.actionType,l=o.firstChannelWithNoNewMessages,u=o.guildId ;return{canUserSendEmoji:i,userCantSendEmojiReason:a,onClickEmojiTutorial:function(){i&&(c===E0.JUMP_TO_DM&&void 0!==l?(0,K.uL)(M.Z5c.CHANNEL(M.ME,l)):c===E0.JUMP_TO_SERVER&&void 0!==u?(0,AK.X)(u):c===E0.OPEN_CHAT&&void 0!==r&&r.type===r_.d.GUILD_VOICE&&wJ.Z.updateChatOpen(r.id,!0))}}}((0,s.Wu)([GJ.Z,$H.Z,JH.Z],(function(){var e=GJ.Z.getPrivateChannelIds();return(0,LJ.tU)(e,[$H.Z,JH.Z])})),p,l,f),E=h.canUserSendEmoji,y=h.userCantSendEmojiReason,m=h.onClickEmojiTutorial,b=function(e){var t=(0,s.cj)([P.Z,Zt.Z],(function(){if(0===e.length)return{isBoostStepEnabled:!1};var t=P.Z.getGuildId();return{isBoostStepEnabled:!0,currentGuild:Zt.Z.getGuild(t)}})),n=t.isBoostStepEnabled,r=t.currentGuild;return{isBoostStepEnabled:n,onClickBoostingTutorial:function(){n&&null==r&&e.length>0&&(0,AK.X)(e[0])}}}(p),g=b.isBoostStepEnabled,O=b.onClickBoostingTutorial,v=(0,Jb.ZP)();o.useEffect((function(){E||Ie.default.track(M.rMx.PREMIUM_FEATURE_TUTORIAL_FLOW_DISABLED,{flow:"emoji"}) ;g||Ie.default.track(M.rMx.PREMIUM_FEATURE_TUTORIAL_FLOW_DISABLED,{flow:"boost"})}),[E,g]);return(0,r.jsxs)("div",{className:QJ().tutorialStepsContainer,children:[(0,r.jsx)(y0,{stepDescription:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_CUSTOM_PROFILES,hasCompletedStep:t,image:(0,r.jsx)("img",{alt:"",src:i0()}),onClick:function(){(0,GE.w9)(jf.QD.PROFILE_CUSTOMIZATION);!function(e,t){Ie.default.track(M.rMx.PREMIUM_FEATURE_HELPER_ACTIONS,{location_stack:t,helper_action:jf.wt.CUSTOM_PROFILES_CLICKED});(0,KJ.k)(jf.MY[jf.QD.PROFILE_CUSTOMIZATION][0]);e();(0,FJ.p)(!0)}(c,a)}}),(0,r.jsx)("hr",{className:QJ().tutorialLinkSeparator}),(0,r.jsx)(y0,{stepDescription:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_EMOJI,hasCompletedStep:i,image:(0,r.jsx)("img",{alt:"",src:r0(),className:QJ().emojiTutorialImg}),onClick:function(){null==m||m();(0,GE.w9)(jf.QD.CUSTOM_EMOJI);!function(e,t){Ie.default.track(M.rMx.PREMIUM_FEATURE_HELPER_ACTIONS,{location_stack:e,helper_action:jf.wt.UNLOCK_EMOJI_CLICKED}) ;var n=t?Tb.I.SIDEBAR:Tb.I.NORMAL;(0,ZJ.RO)(qJ.X1.EMOJI,n);(0,YZ.$u)(ln.z$.PREMIUM_TUTORIAL_EMOJI_PICKER_COMPOSER_TOOLTIP);(0,KJ.k)(jf.MY[jf.QD.CUSTOM_EMOJI][0]);(0,FJ.p)(!0)}(a,d);!function(){var e=P.Z.getGuildId(),t=0;kR.Z.getTopEmoji(e).length>0&&t++;kR.Z.getDisambiguatedEmojiContext(e).favoriteEmojisWithoutFetchingLatest.length>0&&t++;kR.Z.getDisambiguatedEmojiContext(e).getFrequentlyUsedEmojisWithoutFetchingLatest().length>0&&t++;DJ.kJ.setActiveCategoryIndex(t)}()},tooltipText:y,isEnabled:E,shouldPreventDefaultEmojiPickerToggle:!0}),(0,r.jsx)("hr",{className:QJ().tutorialLinkSeparator}),(0,r.jsx)(y0,{stepDescription:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_BOOSTS,hasCompletedStep:n,image:(0,r.jsx)("img",{alt:"",src:v===M.BRd.DARK?JJ():t0(),className:QJ().boostTutorialImg}),onClick:function(){null==O||O();(0,GE.w9)(jf.QD.BOOSTING);!function(e){Ie.default.track(M.rMx.PREMIUM_FEATURE_HELPER_ACTIONS,{location_stack:e,helper_action:jf.wt.SERVER_BOOSTS_CLICKED});(0,fZ.l)(!0);(0, YZ.$u)(ln.z$.PREMIUM_TUTORIAL_SERVER_MENU_TOOLTIP);(0,KJ.k)(jf.MY[jf.QD.BOOSTING][0]);(0,FJ.p)(!0)}(a)},tooltipText:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_BOOST_FLOW_DISABLED_TOOLTIP,isEnabled:g})]})},b0=function(e,t){if(!t&&e>=1&&e<3)return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_WELCOME_BACK;switch(e){case 1:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_HEADER_COMPLETED_ONE;case 2:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_HEADER_LAST_ONE;case 3:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_HEADER_COMPLETED;default:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_HEADER}},g0=function(e){switch(e){case 1:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_SUB_HEADER_CHOOSE_ANOTHER_PERK;case 2:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_SUB_HEADER_LAST_ONE;case 3:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_SUB_HEADER_COMPLETED;default:return Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_SUB_HEADER}},O0=function(e){ var t=zJ.Z.isPersistentCoachmarkCollapsed?jf.wt.HELPER_UNCOLLAPSED:jf.wt.HELPER_COLLAPSED;Ie.default.track(M.rMx.PREMIUM_FEATURE_HELPER_ACTIONS,{location_stack:e,helper_action:t});(0,FJ.Lt)()},v0=function(e){var t=e.analyticsLocations,n=e.setDisplayDismissConfirmation,o=e.dismissedTutorialStepsLength,i=e.hasCompletedStepDuringSession,a=e.hasCompletedProfileTutorial,s=e.hasCompletedBoostTutorial,l=e.hasCompletedEmojiTutorial,u=e.hasCompletedAllSteps;return(0,r.jsxs)("div",{className:QJ().expandedCoachmarkContent,children:[(0,r.jsx)(c.xvT,{className:QJ().expandedCoachmarkHeader,variant:"text-md/semibold",children:b0(o,i)}),(0,r.jsx)(c.xvT,{className:QJ().expandedCoachmarkSubheader,variant:"text-sm/normal",children:g0(o)}),(0,r.jsx)(m0,{hasCompletedProfileTutorial:a,hasCompletedBoostTutorial:s,hasCompletedEmojiTutorial:l,analyticsLocations:t}),u&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("hr",{className:QJ().tutorialLinkSeparator}),(0,r.jsxs)("div",{ className:QJ().expandedCoachmarkFooterContent,children:[(0,r.jsx)(c.P3F,{onClick:function(){return n(!0)},children:(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:QJ().closeHelperLink,children:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_MARKETING_CLOSE})}),(0,r.jsx)(c.P3F,{onClick:function(){return function(e){Ie.default.track(M.rMx.PREMIUM_FEATURE_HELPER_ACTIONS,{location_stack:e,helper_action:jf.wt.EXPLORE_ALL_PERKS_CLICKED});(0,K.uL)(M.Z5c.APPLICATION_STORE)}(t)},children:(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:QJ().seeAllPerksLink,children:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_MARKETING_REDIRECT})})]})]})]})},_0=function(e){var t=e.analyticsLocations,n=e.setDisplayDismissConfirmation;return(0,r.jsxs)("div",{className:QJ().expandedCoachmarkContent,children:[(0,r.jsx)(c.xvT,{className:QJ().expandedCoachmarkHeader,variant:"text-md/semibold",children:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_CLOSE_CONFIRMATION_HEADER}),(0,r.jsx)(c.xvT,{ className:QJ().expandedCoachmarkSubheader,variant:"text-sm/normal",children:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_CLOSE_CONFIRMATION_SUBHEADER}),(0,r.jsx)("hr",{className:QJ().tutorialDismissConfirmationSeparator}),(0,r.jsxs)("div",{className:QJ().expandedCoachmarkFooterContent,children:[(0,r.jsx)(c.zxk,{onClick:function(){return n(!1)},look:c.iLD.BLANK,color:QJ().cancelButtonColor,children:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_CLOSE_CANCEL}),(0,r.jsx)(c.zxk,{onClick:function(){return function(e){Ie.default.track(M.rMx.PREMIUM_FEATURE_HELPER_ACTIONS,{location_stack:e,helper_action:jf.wt.HELPER_DISMISSED});(0,un.EW)(ln.z$.PREMIUM_TUTORIAL_EXPERIENCE)}(t)},children:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COACHMARK_CLOSE_YES})]})]})},I0=function(e){var t=e.analyticsLocations,n=(0,VZ.eM)(),i=n.includes(jf.QD.PROFILE_CUSTOMIZATION),a=n.includes(jf.QD.BOOSTING),l=n.includes(jf.QD.CUSTOM_EMOJI),u=h0(o.useState(!1),2),f=u[0],d=u[1];o.useEffect((function(){i&&a&&l&&d(!0)}),[i,a,l]) ;var p=(0,s.e7)([YJ.Z],(function(){return YJ.Z.hasCompletedStepDuringSession})),h=h0(o.useState(!1),2),y=h[0],m=h[1],b=(0,s.e7)([E.Z],(function(){return E.Z.useReducedMotion})),g=(0,s.e7)([zJ.Z],(function(){return zJ.Z.canPlayWowMoment}));o.useEffect((function(){return function(){g&&(0,FJ.HY)(!1)}}),[g]);var O=g&&!b;return(0,r.jsxs)("div",{className:lh()(QJ().expandedCoachmarkContentContainer,O&&QJ().slideInFromBottomAnimation),children:[O&&(0,r.jsx)(WJ.PremiumSubscriptionWowMomentForHelper,{}),(0,r.jsxs)("div",{className:QJ().expandedCoachmarkBannerContainer,children:[(0,r.jsx)("div",{className:QJ().expandedCoachmarkBannerBranding,children:(0,r.jsx)(HJ.Z,{color:$b.Z.unsafe_rawColors.WHITE_500.css,height:"26px"})}),(0,r.jsx)("div",{className:QJ().expandedCoachmarkBannerImageContainer,children:p||f?(0,r.jsx)("img",{alt:"",src:s0(),className:QJ().expandedCoachmarkCelebrationBannerImage}):(0,r.jsx)("img",{alt:"",src:f0(),className:QJ().expandedCoachmarkBannerImage})}),(0,r.jsx)(c.P3F,{ onClick:function(){return O0(t)},className:QJ().expandedCoachmarkCollapseButtonContainer,children:(0,r.jsx)(Zw.Z,{open:!1,className:QJ().expandedCoachmarkCollapseButton})})]}),y?(0,r.jsx)(_0,{analyticsLocations:t,setDisplayDismissConfirmation:m}):(0,r.jsx)(v0,{analyticsLocations:t,setDisplayDismissConfirmation:m,dismissedTutorialStepsLength:n.length,hasCompletedStepDuringSession:p,hasCompletedProfileTutorial:i,hasCompletedBoostTutorial:a,hasCompletedEmojiTutorial:l,hasCompletedAllSteps:f})]})},S0=function(e){var t=e.analyticsLocations;return(0,r.jsxs)(c.P3F,{onClick:function(){return O0(t)},className:QJ().collapsedCoachmarkContainer,children:[(0,r.jsx)("img",{alt:"",src:l0(),className:QJ().collapsedCoachmarkImage}),(0,r.jsx)(c.xvT,{variant:"text-sm/medium",className:QJ().collapsedCoachmarkHeading,children:Q.Z.Messages.PREMIUM_TRIAL_TUTORIAL_COLLAPSED_COACHMARK_HEADING}),(0,r.jsx)(BJ.Z,{className:QJ().collapsedCoachmarkExpandButton})]})};const T0=function(){var e=(0, s.e7)([zJ.Z],(function(){return zJ.Z.isPersistentCoachmarkCollapsed})),t=(0,Hw.Z)(Pf.Z.PREMIUM_TRIAL_TUTORIAL_COACHMARK).analyticsLocations;if((0,s.e7)([zJ.Z],(function(){return zJ.Z.isPersistentHelperHidden})))return(0,r.jsx)(r.Fragment,{});Ie.default.track(M.rMx.PREMIUM_FEATURE_HELPER_ACTIONS,{location_stack:t,helper_action:jf.wt.HELPER_RENDERED});return e?(0,r.jsx)(S0,{analyticsLocations:t}):(0,r.jsx)(I0,{analyticsLocations:t})};var N0=n(628486),A0=n(88818),C0=n(595689);function P0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j0(e){j0=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return j0(e)}function R0(e,t){return!t||"object"!==M0(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function x0(e,t){x0=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return x0(e,t)} var M0=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function w0(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=j0(e);if(t){var o=j0(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R0(this,n)}}var D0={};var Z0=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&x0(e,t)}(n,e);var t=w0(n);function n(){P0(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getSkuIdForChannel=function(e){return D0[e]};r.__getLocalVars=function(){return{channelIdToSkuId:D0}};return n}(s.ZP.Store) ;Z0.displayName="ChannelSKUStore";const L0=new Z0(O.Z,{CONNECTION_OPEN:function(){D0={}},STORE_LISTING_FETCH_SUCCESS:function(e){var t=e.channelId,n=e.storeListing;null!=t&&(D0[t]=n.sku.id)}});var U0=n(491509),k0=n(954640),G0=n(252411),B0=n.n(G0);function H0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V0(e){V0=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return V0(e)}function F0(e,t){return!t||"object"!==z0(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Y0(e,t){Y0=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Y0(e,t)}var z0=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function W0(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1 ;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=V0(e);if(t){var o=V0(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return F0(this,n)}}var K0=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Y0(e,t)}(n,e);var t=W0(n);function n(){H0(this,n);var e;(e=t.apply(this,arguments)).fetchStoreListing=function(t){var n=e.props,r=n.channel,o=n.inputSkuId;return null!=t?Wq.Z.fetchChannelStoreListing(r.id,t):null!=o?Wq.Z.fetchChannelStoreListing(r.id,o):Wq.Z.fetchChannelStoreListing(r.id)};e.renderApplicationListing=function(t){var n=t.location,o=e.props,i=o.channel,a=o.skuId,s=o.width;return(0,r.jsx)(k0.Z,{channel:i,inputSkuId:a, fetchStoreListing:e.fetchStoreListing,location:n,pageSize:(0,U0.getPageSize)(s)})};return e}var o=n.prototype;o.componentDidMount=function(){this.fetchStoreListing();(0,uV.e)("channel_store_listing")};o.render=function(){return null!=this.props.skuId?(0,r.jsx)(fW.Z,{page:M.ZY5.CHANNEL_STORE_LISTING,root:!0,children:(0,r.jsx)("div",{className:B0().applicationStore,children:(0,r.jsx)(a.AW,{path:"*",render:this.renderApplicationListing})})}):null};return n}(o.Component);const q0=(0,yb.Z)(s.ZP.connectStores([L0],(function(e){var t=e.channel,n=e.inputSkuId;return{skuId:null!=n?n:L0.getSkuIdForChannel(t.id)}}))(K0));function X0(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Q0(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function $0(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function J0(e){var t=e.width,n=void 0===t?14:t,o=e.height,i=void 0===o?14:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=$0(e,["width","height","color","foreground"]);return(0,r.jsx)("svg",Q0(function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;return(0,r.jsxs)(CM.ZP,{color:i?CM.DM.BRAND:CM.DM.PREMIUM_TIER_2,children:[(0,r.jsx)(CM.Ry,{onClick:o,noticeType:n}),!i&&(0,r.jsx)(eL.Z,{className:C1().premiumIcon}),(0,S1.Gv)(s,c,l,i),(0,r.jsx)(CM.No,{onClick:function(){o();h.Z.open(M.oAB.PREMIUM)},noticeType:n,children:Q.Z.Messages.LEARN_MORE})]})};var j1=n(73407),R1=n(4572);function x1(e){switch(e){case jf.Si.TIER_0:return CM.DM.PREMIUM_TIER_0;case jf.Si.TIER_2:return CM.DM.PREMIUM_TIER_2;default:throw new Error("Unsupported subscription tier: ".concat(e))}}function M1(e,t){switch(e){case jf.Si.TIER_0:return t.days>0?Q.Z.Messages.NOTICE_PREMIUM_TIER_0_TRIAL_ENDING_DAYS_VARIANT.format({days:t.days}):t.hours>0?Q.Z.Messages.NOTICE_PREMIUM_TIER_0_TRIAL_ENDING_HOURS_VARIANT.format({hours:t.hours}):Q.Z.Messages.NOTICE_PREMIUM_TIER_0_TRIAL_ENDING_MINUTES_VARIANT.format({ minutes:Math.max(t.minutes,1)});case jf.Si.TIER_2:return t.days>0?Q.Z.Messages.NOTICE_PREMIUM_TIER_2_TRIAL_ENDING_DAYS_VARIANT.format({days:t.days}):t.hours>0?Q.Z.Messages.NOTICE_PREMIUM_TIER_2_TRIAL_ENDING_HOURS_VARIANT.format({hours:t.hours}):Q.Z.Messages.NOTICE_PREMIUM_TIER_2_TRIAL_ENDING_MINUTES_VARIANT.format({minutes:Math.max(t.minutes,1)});default:throw new Error("Unsupported subscription tier: ".concat(e))}}function w1(e){switch(e){case jf.Si.TIER_0:return Q.Z.Messages.NOTICE_PREMIUM_TIER_0_TRIAL_ENDING_CTA_VARIANT;case jf.Si.TIER_2:return Q.Z.Messages.NOTICE_PREMIUM_TIER_2_TRIAL_ENDING_CTA_VARIANT;default:throw new Error("Unsupported subscription tier: ".concat(e))}}const D1=function(e){var t,n=e.dismissCurrentNotice,o=e.subscriptionTier,i=(0,Hw.Z)(function(e){switch(e){case jf.Si.TIER_0:return Pf.Z.PREMIUM_TIER_0_TRIAL_ENDING_NOTICE;case jf.Si.TIER_2:return Pf.Z.PREMIUM_TIER_2_TRIAL_ENDING_NOTICE;default:throw new Error("Unsupported subscription tier: ".concat(e))} }(o)).analyticsLocations,a=(0,R1.Np)(),s=(0,j1.Z)(null!=a&&null!=a.expires_at?Date.parse(a.expires_at):0);return null==a||(null===(t=a.subscription_trial)||void 0===t?void 0:t.sku_id)!==o||null==a.expires_at||Object.values(s).every((function(e){return 0===e}))?null:(0,r.jsxs)(CM.ZP,{color:x1(o),children:[(0,r.jsx)(CM.Ry,{onClick:n}),(0,r.jsx)(eL.Z,{className:C1().premiumIcon}),M1(o,s),(0,r.jsx)(CM.Ey,{onClick:function(){(0,$Z.Z)({trialId:a.trial_id,subscriptionTier:o,analyticsLocations:i,analyticsObject:{page:M.ZY5.IN_APP,section:M.jXE.NOTIFICATION_BAR,object:M.qAy.BUTTON_CTA}})},children:w1(o)})]})};function Z1(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function L1(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Z1(i,r,o,a,s,"next",e)}function s(e){Z1(i,r,o,a,s,"throw",e)}a(void 0)}))}}function U1(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0, configurable:!0,writable:!0}):e[t]=n;return e}var k1=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?(0,r.jsxs)("div",{className:O2().blocked,children:[(0,r.jsx)(E2.Z,{width:12,height:12,className:O2().blockedIcon}),(0,r.jsx)("div",{className:O2().blockedText,children:Q.Z.Messages.STAGE_SPEAK_INVITE_HEADER_BLOCKED_USERS.format({number:n})})]}):null,(0,r.jsx)(c.zxk,{className:lh()(O2().button,O2().acceptButton),size:c.zxk.Sizes.MIN,color:c.zxk.Colors.WHITE,onClick:function(){return v2(!1)},children:(0,r.jsx)(c.xvT,{className:O2().acceptText,variant:"text-xs/normal",color:"none",children:Q.Z.Messages.STAGE_SPEAK_INVITE_ACCEPT})}),(0,r.jsx)(c.zxk,{ className:lh()(O2().button,O2().declineButton),look:c.zxk.Looks.OUTLINED,size:c.zxk.Sizes.MIN,color:c.zxk.Colors.WHITE,onClick:function(){return v2(!0)},children:(0,r.jsx)(c.xvT,{className:O2().declineText,variant:"text-xs/normal",color:"none",children:Q.Z.Messages.STAGE_SPEAK_INVITE_DECLINE})})]})}var I2=n(746974),S2=n(842020);function T2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N2(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function A2(e){A2=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return A2(e)}function C2(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function P2(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function j2(e,t){return!t||"object"!==x2(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function R2(e,t){R2=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return R2(e,t)}var x2=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function M2(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1 ;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=A2(e);if(t){var o=A2(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return j2(this,n)}}var w2={DropdownSizes:S2.Z.DropdownSizes,Sizes:S2.Z.Sizes,Colors:S2.Z.Colors,Looks:S2.Z.Looks},D2=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&R2(e,t)}(n,e);var t=M2(n);function n(){T2(this,n);var e;(e=t.apply(this,arguments)).renderContextMenu=function(){var t=e.props,n=t.skus,o=t.onSKUSelect,i=t.onMenuSelect;return(0,r.jsx)(c.v2r,{onSelect:i,navId:"test-skus","aria-label":Q.Z.Messages.GENERIC_ACTIONS_MENU_LABEL,onClose:Ob.Zy,children:n.map((function(e){return(0, r.jsx)(c.sNh,{id:"".concat(e.id),label:e.name,action:function(){null==o||o(e)}},"".concat(e.id))}))})};e.handleContextMenu=function(t){t.stopPropagation();Ob.vq(t,e.renderContextMenu)};e.handleClick=function(){var t=e.props,n=t.onSKUSelect,r=t.primarySKU;null!=r&&(null==n||n(r))};return e}n.prototype.render=function(){var e=this.props,t=e.skus,n=e.children,o=(e.applicationId,e.primarySKU,e.onSKUSelect,P2(e,["skus","children","applicationId","primarySKU","onSKUSelect"]));return(0,r.jsx)(S2.Z,C2(function(e){for(var t=1;t0?this.handleContextMenu:null,onContextMenu:t.length>0?this.handleContextMenu:void 0},o),{children:n}))};return n }(o.PureComponent);const Z2=s.ZP.connectStores([I2.Z,Rn.Z],(function(e){var t,n=e.applicationId,r=(0,ZM.uF)(n,Rn.Z,I2.Z);return{skus:(null!==(t=I2.Z.getForApplication(n))&&void 0!==t?t:[]).sort((function(e,t){return null!=r&&e.id===r.id?-1:null!=r&&t.id===r.id?1:e.name>=t.name?-1:1})),primarySKU:r}}))(D2);function L2(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var U2=null;function k2(){null!==U2&&(0,c.Mr3)(U2);U2=null}function G2(){Fe.Z.setSilenceWarning(!1);k2()}function B2(){U2=(0,c.h7j)((function(e){return(0,r.jsx)(th.default,function(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function _4(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return m4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m4(e,t)}(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.")}()}var I4=function(e){var t=e.selected,n=v4(e,["selected"]),o=(0,pb.JA)("friends"),i=(0,s.e7)([Ja.Z],(function(){return Ja.Z.getPendingCount()}));return(0,r.jsx)(d4.Qj,O4(g4({selected:t,route:M.Z5c.FRIENDS,icon:sQ.Z,text:Q.Z.Messages.FRIENDS},n,o),{children:i>0?(0,r.jsx)(_j.mA,{count:i}):null})) },S4=function(e){var t=e.selected,n=e.hideGameUpdateProgressIndicator,o=v4(e,["selected","hideGameUpdateProgressIndicator"]),i=(0,pb.JA)("library");return(0,r.jsx)(d4.Qj,O4(g4({selected:t,route:M.Z5c.APPLICATION_LIBRARY,icon:u4.Z,text:Q.Z.Messages.LIBRARY},o,i),{children:(0,r.jsx)(h4.Z,{className:lh()(y4().downloadProgressCircle,b4({},y4().hideGameUpdateProgressIndicator,n))})}))},T4=function(e){var t,n,o=e.selected,i=e.route,a=e.locationState,c=v4(e,["selected","route","locationState"]),l=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),u=(0,s.e7)([s4.Z],(function(){return s4.Z.getPremiumTypeSubscription()})),f=(0,la.n3)(),d=(0,pb.JA)("nitro"),p=(0,R1.Np)(),h=(0,s.e7)([gM.Z],(function(){return gM.Z.isLocalizedPromoEnabled}))&&null==p,E=(0,t4.ij)().shouldShowUpsells,y=ca.L.useExperiment({}).enableTier0?2592e6:7776e6,m=(0,Vi.$k)(E||f||null!=p);if(!(o||null!=p||null!=l&&Date.now()-l.createdAt.getTime()>y||(0,Na.Qo)(l,u)||f))return null;if(E)n=(0,r.jsx)(n4.Z,{ isSelected:o});else if(f){n=(0,r.jsx)(WN.Z,{contentTypes:[ln.z$.PREMIUM_TIER_0_DESKTOP_MARKETING_PAGE_BADGE],children:function(e){if(e.visibleContent===ln.z$.PREMIUM_TIER_0_DESKTOP_MARKETING_PAGE_BADGE)return(0,r.jsx)("div",{className:y4().premiumTier0Badge,children:(0,r.jsx)(i4.Z,{})})}});t=y4().premiumTier0BadgeLinkButton}else if(null!=p)n=(0,r.jsx)(a4.Z,{trialOffer:p,isTabSelected:o});else if(m)n=(0,r.jsx)(o4.Z,{});else if(h){n=(0,r.jsx)(r4.k,{entryPoint:r4.U.PrivateMessages});o||(t=y4().localizedPricingBadge)}return(0,r.jsx)(d4.Qj,O4(g4({selected:o,route:i,icon:eL.Z,text:Q.Z.Messages.PREMIUM,locationState:a},c,d),{className:t,children:n}))},N4=function(e){var t=e.selected,n=(0,eV.q)(),o=(0,pb.JA)("messageRequests"),i=(0,EV._)().channelId;if(!(0,s.e7)([$H.Z,JH.Z],(function(){return(0,LJ.IO)([$H.Z,JH.Z])})))return null;var a=null==i?void 0:function(){return Wq.Z.preload(M.ME,i)};return(0,r.jsx)(d4.Qj,O4(g4({selected:t,route:M.Z5c.MESSAGE_REQUESTS,icon:fV.Z, text:Q.Z.Messages.MESSAGE_REQUESTS,onClick:a},o),{children:n>0?(0,r.jsx)(_j.mA,{count:n}):null}))},A4=function(e){var t=e.selected,n=Q.Z.Messages.FAMILY_CENTER_SIDEBAR_TITLE,o=(0,pb.JA)("family-center");return wF.useExperiment({}).enabled?(0,r.jsx)(d4.Qj,g4({selected:t,route:M.Z5c.PARENT_TOOLS,icon:jF.Z,text:n},o)):null},C4=function(){return(0,zG.$Z)("DM_SEARCH")};function P4(e){switch(e){case M.Z5c.APPLICATION_LIBRARY:return M.ZY5.LIBRARY;case M.Z5c.FRIENDS:return M.ZY5.FRIENDS_LIST}return e.startsWith(M.Z5c.APPLICATION_STORE)?e===M.Z5c.APPLICATION_STORE?M.ZY5.STORE_DIRECTORY_HOME:e.startsWith(M.Z5c.APPLICATION_STORE)?M.ZY5.STORE_DIRECTORY_BROWSE:M.ZY5.STORE_LISTING:M.ZY5.DM_CHANNEL}var j4=function(e){var t=e.showLibrary,n=e.hasLibraryApplication,o=e.homeLink,i=e.storeLink,a=e.premiumTabSelected,s=_4((0,N0.Z)((function(e){return[e.channelId,e.path]}),e4.Z),2),c=s[0],l=s[1];return(0,r.jsxs)("nav",{className:y4().privateChannels,"aria-label":Q.Z.Messages.PRIVATE_CHANNELS_A11Y_LABEL, children:[(0,r.jsx)(WZ.Z,{tutorialId:"direct-messages",position:"right",offsetX:-52,children:(0,r.jsx)("div",{className:y4().searchBar,children:(0,r.jsx)("button",{type:"button",className:y4().searchBarComponent,onClick:C4,children:Q.Z.Messages.DM_SEARCH_PLACEHOLDER})})}),(0,r.jsxs)(p4.Z,O4(g4({},e),{version:l,selectedChannelId:c,showDMHeader:!0,children:[(0,r.jsx)(I4,{selected:null!=l?l===M.Z5c.FRIENDS:o===M.Z5c.FRIENDS},"friends"),n&&t?(0,r.jsx)(S4,{selected:null==l?null!=o&&o.startsWith(M.Z5c.APPLICATION_LIBRARY):l.startsWith(M.Z5c.APPLICATION_LIBRARY),hideGameUpdateProgressIndicator:o===M.Z5c.APPLICATION_LIBRARY},"library"):null,(0,r.jsx)(T4,{selected:null==l?a:l.startsWith(M.Z5c.APPLICATION_STORE),route:null==i||location.pathname.startsWith(M.Z5c.APPLICATION_STORE)?M.Z5c.APPLICATION_STORE:i,locationState:{analyticsSource:{page:P4(o),section:M.jXE.NAVIGATION,object:M.qAy.NAVIGATION_LINK}}},"premium"),(0,r.jsx)(N4,{ selected:null==l?null!=o&&o.startsWith(M.Z5c.MESSAGE_REQUESTS):l===M.Z5c.MESSAGE_REQUESTS},"message-requests"),(0,r.jsx)(A4,{selected:null==l?null!=o&&o.startsWith(M.Z5c.PARENT_TOOLS):l===M.Z5c.PARENT_TOOLS},"parent-tools")]}))]})};function R4(){var e=(0,s.e7)([l4.Z],(function(){return l4.Z.getHomeLink()})),t=(0,s.e7)([I2.Z],(function(){if(e===M.Z5c.APPLICATION_STORE)return!0;var t=(0,f4.ZK)(e);if(null!=t){var n,r;return null!==(r=null===(n=I2.Z.get(t))||void 0===n?void 0:n.premium)&&void 0!==r&&r}return!1}),[e]),n=!ct.bm.useSetting(),o=(0,s.cj)([st.Z],(function(){return{theme:st.Z.theme}})).theme,i=(0,s.e7)([Ln.Z],(function(){return Ln.Z.hasLibraryApplication()})),a=(0,s.e7)([c4.Z],(function(){return c4.Z.getCurrentPath()}));return(0,r.jsx)(j4,{theme:o,showLibrary:n,hasLibraryApplication:i,storeLink:a,homeLink:e,premiumTabSelected:t})}var x4=n(9941),M4=n(458922),w4=n(412961);function D4(e){O.Z.dispatch({type:"LIBRARY_APPLICATION_FILTER_UPDATE",query:e})}function Z4(e){ var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];O.Z.dispatch({type:"LIBRARY_TABLE_ACTIVE_ROW_ID_UPDATE",key:e,isKeyboardEvent:t})}var L4=n(770819),U4=n(276433),k4=n(763993),G4=n(629904),B4=n.n(G4);function H4(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F4(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Y4(e){Y4=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Y4(e)}function z4(e,t){return!t||"object"!==K4(t)&&"function"!=typeof t?H4(e):t}function W4(e,t){W4=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return W4(e,t)}var K4=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function q4(e){var t=function(){ if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Y4(e);if(t){var o=Y4(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return z4(this,n)}}var X4=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&W4(e,t)}(n,e);var t=q4(n);function n(){V4(this,n);var e;(e=t.apply(this,arguments)).searchBarRef=null;e.state={focused:!1};e.setRef=function(t){e.searchBarRef=t};e.handleKeyDown=function(t){var n,r=e.props,o=r.activeRowKey,i=r.hasModalOpen,a=r.applicationViewItems,s=H4(e).searchBarRef;if(!(i||t.ctrlKey||t.altKey||t.metaKey||null==s)){var c=null===(n=(0, k4.uB)(t))||void 0===n?void 0:n.activeElement;if(c===s.inputRef.current||!(0,k4.VG)(c))switch(t.which){case M.yXg.ESCAPE:t.target!==s.inputRef.current?e.reset():null!=s.inputRef.current&&s.blur();break;case M.yXg.ENTER:if(null!=o){t.preventDefault();var l=a.find((function(e){return e.key===o}));if(null==l)return;var u=l.libraryApplication;nm.performDefaultLibraryApplicationAction(u,{analyticsParams:{source:M.Sbl.APPLICATION_LIBRARY,location:{page:M.ZY5.LIBRARY,section:M.jXE.LIBRARY_APPLICATION_LIST,object:M.qAy.BUTTON_CTA}}})}break;case M.yXg.ARROW_DOWN:case M.yXg.ARROW_UP:t.preventDefault();t.stopPropagation();e.updateActiveRow(t.which===M.yXg.ARROW_DOWN?1:-1);break;default:null!=s.inputRef.current&&t.target!==s.inputRef.current&&s.focus()}}};return e}var o=n.prototype;o.componentDidMount=function(){document.addEventListener("keydown",this.handleKeyDown)};o.componentWillUnmount=function(){O.Z.wait((function(){return Z4(null)})) ;document.removeEventListener("keydown",this.handleKeyDown)};o.reset=function(){Z4(null);D4("")};o.focusInput=function(){var e=this.searchBarRef;null!=e&&e.focus()};o.updateActiveRow=function(e){var t=this.props,n=t.applicationViewItems,r=t.activeRowKey,o=n.findIndex((function(e){return e.key===r})),i=0;o>=0&&(i=(o+e)%n.length)<0&&(i=n.length-1);var a=n[i];Z4(null!=a?a.key:null,!0)};o.render=function(){var e,t=this,n=this.props.filterQuery,o=this.state.focused;return(0,r.jsx)("div",{className:lh()((e={},F4(e,B4().libraryFilter,!0),F4(e,B4().focused,o),e)),children:(0,r.jsx)(yj.Z,{className:B4().searchBar,ref:this.setRef,onChange:D4,onFocus:function(){return t.setState({focused:!0})},onBlur:function(){return t.setState({focused:!1})},name:"filter",onClear:function(){t.reset();t.focusInput()},maxLength:100,query:n,placeholder:Q.Z.Messages.APPLICATION_LIBRARY_FILTER_PLACEHOLDER})})};return n}(o.Component);function Q4(){var e=(0,s.e7)([T.Z],(function(){return T.Z.hasLayers()})),t=(0, c.s9z)(c.JQI);return(0,r.jsx)(X4,{activeRowKey:(0,s.e7)([U4.Z],(function(){return U4.Z.activeRowKey})),hasModalOpen:t||e,filterQuery:(0,s.e7)([L4.Z],(function(){return L4.Z.applicationFilterQuery})),applicationViewItems:(0,s.e7)([L4.Z],(function(){return L4.Z.sortedFilteredLibraryApplicationViewItems}))})}var $4=n(956958),J4=n.n($4);function e3(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function t3(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function g3(e){return"CloudDone-".concat(e)}function O3(e){ var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=e.gradientConfig,u=b3(e,["width","height","color","foreground","gradientConfig"]),f=null;null!=l&&(f=(0,r.jsx)(h3,m3(y3({},l),{color:s,id:g3(l.id)})));return(0,r.jsxs)("svg",m3(y3({},(0,OO.Z)(u)),{width:n,height:i,viewBox:"0 0 24 24",children:[(0,r.jsx)("defs",{children:f}),(0,r.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,r.jsx)("path",{fill:null!=l?"url(#".concat(g3(l.id),")"):s,className:c,d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM10 17l-3.5-3.5 1.41-1.41L10 14.17 15.18 9l1.41 1.41L10 17z"})]}))}function v3(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function _3(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function T3(e){return"CloudDownload-".concat(e)}function N3(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function A3(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function j3(e){return"CloudUpload-".concat(e)}function R3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x3(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function M3(e){M3=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return M3(e)}function w3(e,t){return!t||"object"!==Z3(t)&&"function"!=typeof t?function(e){ if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function D3(e,t){D3=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return D3(e,t)}var Z3=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function L3(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=M3(e);if(t){var o=M3(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return w3(this,n)}}var U3,k3=new Set([M.TzF.PUSHING,M.TzF.PULLING]),G3=Object.freeze((x3(U3={},M.TzF.DONE,p3.Z),x3(U3,M.TzF.PLANNING,p3.Z),x3(U3,M.TzF.PREPARING,p3.Z),x3(U3,M.TzF.PUSHING,(function(e){ var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=e.gradientConfig,u=P3(e,["width","height","color","foreground","gradientConfig"]),f=null;null!=l&&(f=(0,r.jsx)(h3,C3(A3({},l),{color:s,id:j3(l.id)})));return(0,r.jsxs)("svg",C3(A3({},(0,OO.Z)(u)),{width:n,height:i,viewBox:"0 0 24 24",children:[(0,r.jsx)("defs",{children:f}),(0,r.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,r.jsx)("path",{fill:null!=l?"url(#".concat(j3(l.id),")"):s,className:c,d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"})]}))})),x3(U3,M.TzF.PULLING,(function(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=e.gradientConfig,u=S3(e,["width","height","color","foreground","gradientConfig"]),f=null;null!=l&&(f=(0,r.jsx)(h3,I3(_3({},l),{color:s, id:T3(l.id)})));return(0,r.jsxs)("svg",I3(_3({},(0,OO.Z)(u)),{width:n,height:i,viewBox:"0 0 24 24",children:[(0,r.jsx)("defs",{children:f}),(0,r.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,r.jsx)("path",{fill:null!=l?"url(#".concat(T3(l.id),")"):s,className:c,d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z"})]}))})),x3(U3,M.TzF.CONFLICT,p3.Z),x3(U3,M.TzF.ERROR,p3.Z),U3)),B3=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&D3(e,t)}(n,e);var t=L3(n);function n(){R3(this,n);var e;(e=t.apply(this,arguments))._doneTimer=new Uu.V7;return e}var o=n.prototype;o.componentDidMount=function(){this.getIsRecentlySynced()&&this.setRecentlySyncedTimeout()} ;o.componentDidUpdate=function(e){null!=this.props.cloudSyncState&&(this.props.cloudSyncState.type!==M.TzF.DONE||null==this.props.cloudSyncState.timestamp||null!=e.cloudSyncState&&null!=e.cloudSyncState.timestamp||this.setRecentlySyncedTimeout())};o.componentWillUnmount=function(){this._doneTimer.stop()};o.setRecentlySyncedTimeout=function(){var e=this;this._doneTimer.start(2e3,(function(){return e.forceUpdate()}))};o.getIsRecentlySynced=function(){var e=this.props.cloudSyncState;if(null!=e&&e.type===M.TzF.DONE){var t=e.timestamp;return null!=t&&Date.now()-t<=2e3}return!1};o.getStop=function(e,t){if(t)return 1;if(e.type===M.TzF.PUSHING||e.type===M.TzF.PULLING){return e.progress/e.total}return 0};o.getTooltip=function(e,t){switch(e.type){case M.TzF.DONE:return t?Q.Z.Messages.CLOUD_SYNC_ICON_TOOLTIP_DONE:Q.Z.Messages.CLOUD_SYNC_ICON_TOOLTIP_SUPPORTED;case M.TzF.CONFLICT:case M.TzF.ERROR:return Q.Z.Messages.CLOUD_SYNC_ICON_TOOLTIP_SUPPORTED;case M.TzF.PLANNING: return Q.Z.Messages.CLOUD_SYNC_ICON_TOOLTIP_PLANNING;case M.TzF.PREPARING:return Q.Z.Messages.CLOUD_SYNC_ICON_TOOLTIP_PREPARING;case M.TzF.PUSHING:return Q.Z.Messages.CLOUD_SYNC_ICON_TOOLTIP_PUSHING;case M.TzF.PULLING:return Q.Z.Messages.CLOUD_SYNC_ICON_TOOLTIP_PULLING;default:return null}};o.render=function(){var e=this.props,t=e.cloudSyncState,n=e.libraryApplication,o=e.className,i=null==t?{type:M.TzF.DONE}:t,a=this.getIsRecentlySynced(),s={};(k3.has(i.type)||a)&&(s.gradientConfig={id:n.id,startColor:"rgba(199, 208, 240, 1)",stopColor:"rgba(114, 137, 218, 1)",stop:this.getStop(i,a)});var l=a?O3:G3[i.type];return(0,r.jsx)(c.ua7,{text:this.getTooltip(i,a),children:function(e){return(0,r.jsx)(l,function(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e) ;for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function J3(e,t){return!t||"object"!==t6(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function e6(e,t){e6=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return e6(e,t)}var t6=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function n6(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=q3(e);if(t){var o=q3(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return J3(this,n)}}var r6,o6=function(e,t){var n,r,o,i,a={label:0,sent:function(){ if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0;if(i)return null;e=""!==o?Q.Z.Messages.APPLICATION_LIBRARY_EMPTY_SEARCH_DESCRIPTION.format({query:o}):Q.Z.Messages.APPLICATION_LIBRARY_EMPTY_STATE_DESCRIPTION_NO_IMPORT;return(0,r.jsxs)("div",{className:i?F3().emptyStateSmall:F3().emptyStateLarge,children:[(0,r.jsx)("div",{className:F3().emptyWumpus}),(0,r.jsx)(uh.Z,{grow:0,shrink:i?1:0,direction:uh.Z.Direction.VERTICAL,children:(0,r.jsxs)("div",{className:F3().emptyStateText,children:[(0,r.jsx)("div",{className:F3().emptyStateHeader, children:Q.Z.Messages.APPLICATION_LIBRARY_EMPTY_STATE_HEADER}),(0,r.jsx)("div",{className:F3().emptyStateDescription,children:e})]})})]})};a.render=function(){var e=this.props,t=e.sortKey,n=e.sortDirection,i=e.applicationViewItems,a=e.activeRowKey,s=e.stickyHeader,c=this.state,l=c.overflowMenuRowKey,u=c.highlightedApplicationKey;return(0,r.jsxs)(o.Fragment,{children:[i.length>0?(0,r.jsx)(c3.Z,{columns:l6,data:i,sortData:!1,rowComponent:u6,className:F3().table,headerClassName:s?F3().stickyHeader:F3().header,headerCellClassName:F3().headerCell,sortedHeaderCellClassName:F3().headerCellSorted,bodyCellClassName:F3().bodyCell,rowClassName:F3().row,sortKey:t,sortDirection:n,stickyHeader:s,rowProps:{activeRowKey:null!=l?l:a,highlightedApplicationKey:u,onMouseEnter:this.handleRowMouseEnter,onMouseLeave:this.handleRowMouseLeave,onContextMenu:this.handleApplicationContextMenu,setRef:this.setRowRef},cellProps:{activeRowKey:null!=l?l:a,onContextMenu:this.handleApplicationContextMenu, setActiveRowKey:this.setActiveRowKey,clearActiveRowKey:this.clearActiveRowKey,sortKey:t,sortDirection:n},onSort:this.handleSort}):null,this.renderImportHelp()]})};return i}(o.PureComponent);f6.defaultProps={stickyHeader:!1};function d6(e){var t=o.useContext(Ie.AnalyticsContext),n=(0,a.TH)(),i=(0,s.cj)([L4.Z],(function(){return{applicationViewItems:L4.Z.sortedFilteredLibraryApplicationViewItems,filterQuery:L4.Z.applicationFilterQuery,fetched:L4.Z.hasFetchedApplications}})),c=i.applicationViewItems,l=i.filterQuery,u=i.fetched,f=(0,s.cj)([U4.Z],(function(){return{sortKey:U4.Z.sortKey,sortDirection:U4.Z.sortDirection,activeRowKey:U4.Z.activeRowKey,isNavigatingByKeyboard:U4.Z.isNavigatingByKeyboard}})),d=f.sortKey,p=f.sortDirection,h=f.activeRowKey,E=f.isNavigatingByKeyboard;return(0,r.jsx)(f6,Q3(X3({},e),{analyticsContext:t,location:n,applicationViewItems:c,filterQuery:l,fetched:u,sortKey:d,sortDirection:p,activeRowKey:h,isNavigatingByKeyboard:E}))} var p6,h6=n(454708),E6=n(592659),y6=n(911220),m6=n.n(y6);function b6(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=s?s:o.length;d.setTransform(1,0,0,-1,0,n.height);d.clearRect(0,0,n.width,n.height);d.translate(0,.5*d.lineWidth);var v,_,I=Math.floor(n.width/(O-3)),S=.5*I,T=I-I*f;d.translate(T,0);d.beginPath();var N=-I;o.forEach((function(e,t){v={x:N,y:h*e/p};0===t?d.moveTo(v.x,v.y):d.bezierCurveTo(_.x+S,_.y,v.x-S,v.y,v.x,v.y);_=v;N+=I}));d.stroke();d.lineTo(N-I,0);d.lineTo(0,0);d.fill();l&&f<1&&(e.animationFrameRequestId=window.requestAnimationFrame(e.updateAnimation))}}};return e}var i=n.prototype;i.onDataUpdate=function(e,t){var n=this.props,r=n.maxValue,o=n.data,i=n.animate,a=null==e||e.data!==t.data&&!Wa().isEqual(e.data,t.data);if(a){var s;this.dataChangedAt=performance.now();this.maxValue=null!=r?r:(s=Math).max.apply(s,Z6(o))} if(a||null==e||!e.animate&&i||e.color!==this.props.color){var c=Ux.oo(this.props.color);this.fillColor="rgba(".concat(c.r,", ").concat(c.g,", ").concat(c.b,", 0.5)");window.cancelAnimationFrame(this.animationFrameRequestId);this.animationFrameRequestId=window.requestAnimationFrame(this.updateAnimation)}};i.componentDidMount=function(){this.animationFrameRequestId=0;this.onDataUpdate(null,this.props)};i.componentDidUpdate=function(e){this.onDataUpdate(e,this.props)};i.componentWillUnmount=function(){window.cancelAnimationFrame(this.animationFrameRequestId);this.animationFrameRequestId=0};i.render=function(){var e=this.props,t=e.className,n=e.pixelWidth,o=e.pixelHeight;return(0,r.jsx)("div",{className:t,children:(0,r.jsx)("canvas",{ref:this.canvas,className:j6().canvas,width:n,height:o})})};return n}(o.PureComponent);k6.defaultProps={animate:!0};const G6=k6;var B6=n(275746),H6=n.n(B6);const V6=function(e){ var t,n=e.title,o=e.className,i=e.color,a=e.animate,s=e.gradientStopColor,c=e.getHistoricalTotalBytes,l=(0,ER.Sl)(i).hex,u=null===(t=(0,ER.Sl)(s))||void 0===t?void 0:t.hex;return(0,r.jsx)(C6.Z,{getHistoricalTotalBytes:c,children:function(e,t,i){return(0,r.jsx)("div",{className:lh()(H6().monitor,o),children:(0,r.jsxs)(uh.Z,{align:uh.Z.Align.CENTER,children:[(0,r.jsxs)(uh.Z,{className:H6().text,direction:uh.Z.Direction.VERTICAL,children:[(0,r.jsx)("div",{className:H6().title,children:n}),(0,r.jsx)("div",{className:H6().rate,children:(s=e[e.length-1]/t*1e3,s>1e3?Q.Z.Messages.FILE_RATE_MB.format({size:Math.round(s/1e3)}):Q.Z.Messages.FILE_RATE_KB.format({size:Math.round(s)}))})]}),(0,r.jsx)("div",{className:H6().overflowContainer,children:(0,r.jsx)(G6,{data:e,maxValue:Math.max(Math.max.apply(null,e),1e3),className:H6().sparkChart,updateInterval:t,color:l,gradientStopColor:u,numUpdatesToShow:i,animate:a,pixelWidth:600,pixelHeight:48,lineWidth:4})})]})});var s}})};var F6=n(51786),Y6=n.n(F6) ;function z6(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?this.renderQueued():null==t.state||t.state.type!==M.vxO.UPDATING&&t.state.type!==M.vxO.REPAIRING&&t.state.type!==M.vxO.INSTALLING?null:null!=n&&n.paused?this.renderPaused():this.renderProgress()};!function(e,t,n){t&&X6(e.prototype,t);n&&X6(e,n)}(n,[{key:"isFocused",get:function(){var e=this.props.cellProps;return null!=e&&e.isFocused}}]);return n }(o.PureComponent),I5=function(){return(0,r.jsx)(p5,{icon:N6.Z,tooltip:Q.Z.Messages.GAME_LIBRARY_UPDATES_ACTION_RESUME,onClick:function(){return $n.v4()}})},S5=function(){return(0,r.jsx)(p5,{icon:T6.Z,tooltip:Q.Z.Messages.GAME_LIBRARY_UPDATES_ACTION_PAUSE,onClick:function(){return $n.wO()}})},T5=function(e){var t=e.item;return(0,r.jsx)(p5,{icon:S6.Z,tooltip:Q.Z.Messages.GAME_LIBRARY_UPDATES_ACTION_MOVE_UP,onClick:function(){return $n.A1(t.applicationId,t.branchId)}})},N5=function(e){var t=e.item;return(0,r.jsx)(p5,{icon:Ub.Z,tooltip:Q.Z.Messages.GAME_LIBRARY_UPDATES_ACTION_REMOVE,onClick:function(){return $n.al(t.applicationId,t.branchId)}})},A5=[{key:g5,cellClassName:Y6().nameCell,render:function(e){return(0,r.jsxs)(uh.Z,{align:uh.Z.Align.CENTER,children:[(0,r.jsx)(UK.Z,{game:e.application,className:Y6().gameIcon,size:UK.Z.Sizes.SMALL}),(0,r.jsx)("div",{className:Y6().nameCellText,children:e.application.name})]})}},{key:O5,cellClassName:Y6().progressCell, headerCellClassName:Y6().progressCellHeader,bodyCellClassName:Y6().progressCellBody,render:function(e,t){return(0,r.jsx)(_5,{item:e,cellProps:t})}},{key:v5,cellClassName:Y6().actionsCell,render:function(e,t){var n,o;if(e.finished)n=null!=e.libraryApplication?(0,r.jsx)(s3.Z,{libraryApplication:e.libraryApplication,size:c.zxk.Sizes.SMALL,className:Y6().gameActionButton,source:M.Sbl.APPLICATION_LIBRARY_UPDATES}):null;else if(null!=e.state){if(e.state.type!==M.vxO.UP_TO_DATE){n=e.index>0?(0,r.jsx)(T5,{item:e}):null!=t&&t.paused?(0,r.jsx)(I5,{}):(0,r.jsx)(S5,{item:e});o=(0,r.jsx)(N5,{item:e})}}else o=(0,r.jsx)(N5,{item:e});return(0,r.jsxs)(uh.Z,{justify:uh.Z.Justify.END,children:[n,o]})}}],C5=function(e){J6(n,e);var t=i5(n);function n(){q6(this,n);var e;(e=t.apply(this,arguments)).isUnmounted=!1;e.isTallerThanHalfViewport=!1;e.throttledUpdateHeight=Wa().throttle((function(){if(!e.isUnmounted){var t=e.props,n=t.height,r=t.onHeightTallerThanHalfViewportChange,o=n>window.innerHeight/2 ;if(e.isTallerThanHalfViewport!==o){e.isTallerThanHalfViewport=o;r(o)}}}),1e3);return e}var o=n.prototype;o.componentDidMount=function(){window.addEventListener("resize",this.throttledUpdateHeight)};o.componentDidUpdate=function(e){this.props.height!==e.height&&this.throttledUpdateHeight()};o.componentWillUnmount=function(){this.props.applications.forEach((function(e){e.finished&&O.Z.wait((function(){$n.wi(e.applicationId,e.branchId)}))}));window.removeEventListener("resize",this.throttledUpdateHeight);this.isUnmounted=!0};o.render=function(){var e=this.props,t=e.applications,n=e.paused,o=e.isFocused,i=e.theme,a=e.analyticsContext;return 0===t.length?null:(0,r.jsxs)("div",{className:Y6().gameUpdates,children:[(0,r.jsxs)("div",{className:Y6().headerRow,children:[(0,r.jsx)(V6,{className:lh()(Y6().headerCell,Y6().networkProgress),title:Q.Z.Messages.GAME_LIBRARY_UPDATES_HEADER_NETWORK,getHistoricalTotalBytes:qy.Z.getHistoricalTotalBytesDownloaded,color:M.Ilk.GREEN_360,animate:o}),(0, r.jsx)(V6,{className:lh()(Y6().headerCell,Y6().diskProgress),title:Q.Z.Messages.GAME_LIBRARY_UPDATES_HEADER_DISK,getHistoricalTotalBytes:qy.Z.getHistoricalTotalBytesWritten,color:M.Ilk.BLUE_345,animate:o})]}),(0,r.jsx)(c3.Z,{hasHeader:!1,columns:A5,data:t,className:Y6().table,rowClassName:Y6().row,rowComponent:f5,cellProps:{paused:n,isFocused:o,theme:i},rowProps:{onContextMenu:function(e,t){return b5(e,t,a)}},bodyCellClassName:Y6().cell})]})};return n}(o.PureComponent);function P5(e,t,n,r){return e.reduce((function(e,o,i){var a=o.applicationId,s=o.branchId,c=n.getGame(a),l=r.getState(a,s);null!=c&&e.push({key:"".concat(a,":").concat(s),applicationId:a,branchId:s,state:l,application:c,libraryApplication:Ln.Z.getLibraryApplication(a,s),finished:t,index:i});return e}),[])}const j5=(0,yb.Z)(s.ZP.connectStores([h6.Z,st.Z,We.Z,Rn.Z,qy.Z],(function(){var e=P5(h6.Z.activeItems,!1,Rn.Z,qy.Z),t=P5(h6.Z.finishedItems,!0,Rn.Z,qy.Z);return{applications:r5(e).concat(r5(t)),paused:h6.Z.paused, isFocused:We.Z.isFocused(),theme:st.Z.theme}}))((0,cX.Z)(C5)));var R5=n(248231),x5=n.n(R5);function M5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w5(e){w5=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return w5(e)}function D5(e,t){return!t||"object"!==L5(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Z5(e,t){Z5=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Z5(e,t)}var L5=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function U5(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}() ;return function(){var n,r=w5(e);if(t){var o=w5(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return D5(this,n)}}var k5=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Z5(e,t)}(n,e);var t=U5(n);function n(){M5(this,n);var e;(e=t.apply(this,arguments))._scrollerRef=o.createRef();e._scrollToPadding=0;e.state={includeUpdatesInScroller:!1};e.handleHeightTallerThanHalfViewportChange=function(t){e.setState({includeUpdatesInScroller:t})};e.scrollToRow=function(t,n){var r=e._scrollerRef.current;if(null!=r){t.focus();r.scrollIntoViewRect({start:n,end:n});e._scrollToOnMount=null}else{e._scrollToOnMount=t;e._scrollToPadding=n}};return e}var i=n.prototype;i.componentDidMount=function(){qH(M.Z5c.APPLICATION_LIBRARY);(0,w4.T)(M.jEp.LIBRARY);O.Z.wait((function(){return(0,x4.o)()})) ;(0,M4.N)();null!=this._scrollToOnMount&&null!=this._scrollerRef.current&&this.scrollToRow(this._scrollToOnMount,this._scrollToPadding)};i.renderToolbar=function(){return(0,r.jsx)(Q4,{})};i.render=function(){var e=this.state.includeUpdatesInScroller,t=(0,r.jsx)("div",{children:(0,r.jsx)(fW.Z,{section:M.jXE.LIBRARY_INSTALL_MODULE,children:(0,r.jsx)(j5,{onHeightTallerThanHalfViewportChange:this.handleHeightTallerThanHalfViewportChange})})});return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(i3,{currentRoute:M.Z5c.APPLICATION_LIBRARY,renderToolbar:this.renderToolbar}),e?null:t,(0,r.jsxs)(c.yWw,{className:lh()(x5().container,x5().scroller),ref:this._scrollerRef,children:[e?t:null,(0,r.jsx)(fW.Z,{section:M.jXE.LIBRARY_APPLICATION_LIST,children:(0,r.jsx)(d6,{stickyHeader:!e,scrollToRow:this.scrollToRow})})]})]})};return n}(o.PureComponent),G5=n(324171),B5=n(980151),H5=n(840974),V5=n(282019),F5=n.n(V5);function Y5(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0, writable:!0}):e[t]=n;return e}function z5(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var W5=Math.ceil(2*Math.PI*20);function K5(e){var t=Math.round(-85*e+199),n=Math.round(-71*e+208),r=Math.round(-22*e+240);return"rgb(".concat(t,", ").concat(n,", ").concat(r,")")}function q5(e){var t=Math.floor(W5*e);return"".concat(t,", ").concat(W5)}const X5=function(e){var t=e.total,n=e.used,o=Math.max(0,Math.min(1,n/t)),i="".concat(Math.floor(100*o),"%");return(0,r.jsx)(c.ua7,{text:Q.Z.Messages.APPLICATION_INSTALLATION_SPACE_USED.format({used:i}),children:function(e){return(0, r.jsxs)("div",z5(function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);nn+40:t>n)break;e++}m((function(t){return e<=b.length?e:t}))}}),[h,p,b]);return(0,r.jsxs)("ul",{ref:p,className:lh()(G7().tagContainer,i,H7({},G7().invisible,null==y)),children:[b.map((function(e,t){return(0,r.jsx)(W7,{className:s,onClick:function(){return n(e)},hide:null!=y&&t>=y,text:e},e)})),!l&&null!=y&&ye.length)&&(t=e.length) ;for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}} return o}function s8(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r8(e,t)}(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.")}()}const c8=function(e){var t=e.guild,n=s8(o.useState(!1),2),i=n[0],a=n[1],s=o.useCallback((function(){return a(!0) }),[a]),l=o.useCallback((function(){return a(!0)}),[a]);return(0,r.jsx)("div",{className:lh()(n8().actionButtonsContainer,o8({},n8().forceButtonsShow,i)),children:(0,r.jsx)(J7.ZP,{children:(0,r.jsx)(e8.GuildDiscoveryMenuPopout,{onRequestOpen:s,onRequestClose:l,guild:t,children:function(e){var t=e.onClick,n=a8(e,["onClick"]);return(0,r.jsx)(c.ua7,{text:Q.Z.Messages.MORE,hideOnClick:!0,children:function(e){var o=e.onClick,i=a8(e,["onClick"]);return(0,r.jsx)(J7.zx,i8(function(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=l){r(u);return}}}catch(e){o=!0;i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}}),[e]);o.useEffect((function(){i()}),[i]);o.useEffect((function(){window.addEventListener("resize",i);return function(){window.removeEventListener("resize",i)}}));return n}(y?B8:G8),b=(0,Hw.Z)().analyticsLocations;if(null==i)return null;var g=i.guilds,v=i.loading,_=null==g||0===g.length;if(!v&&_)return null;var I,S=function(){var e,t=(e=function(e){var t;return k8(this,(function(n){switch(n.label){case 0:if(!(0,Z7.yU)())return[3,1];(0,L7.Z)({analyticsSource:{page:M.ZY5.GUILD_DISCOVERY},analyticsLocation:{page:M.ZY5.GUILD_DISCOVERY,section:M.jXE.GUILD_CAP_UPSELL_MODAL},analyticsLocations:b});return[3,3];case 1:t=g.findIndex((function(t){return t.id===e}));return[4,l(e,t,a,p)];case 2:n.sent();n.label=3;case 3:return[2]}}))},function(){ var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){U8(i,r,o,a,s,"next",e)}function s(e){U8(i,r,o,a,s,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}();if(v||null==g){for(var T=[],N=0;N0&&o.startsWith("?")?vl.parse(o):{}).offset,a=null!=i?Math.floor(parseInt(i,10)/e.pageSize)+1:1;r.state={currentPage:a};return r}var o=n.prototype;o.componentDidUpdate=function(e){var t=this.props.resetCurrentPage;!e.resetCurrentPage&&t&&this.setState({currentPage:1})};o.render=function(){var e=this.props,t=e.totalCount,n=e.pageSize,o=e.maxVisiblePages,i=e.children,a=this.state.currentPage;return i({controller:(0,r.jsx)(c.DsT,{totalCount:t,pageSize:n,currentPage:a,maxVisiblePages:o,onPageChange:this.handlePageChange})})};return n}(o.PureComponent);const q8=K8 ;var X8=n(638057),Q8=n(340974),$8=n(282898),J8=n(594697),e9=n(325971),t9=n.n(e9);function n9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=2&&!(0,X8.x)(e)};r.doSearch=function(e,t,n,o){var i,a=r.props,s=a.defaultLanguage,c=a.currentCategoryId,l=r.state,u=l.query,f=l.selectedLanguage,d={approximate_member_count:i2.sq};o&&TQ.G7(u,d);r.setState({searchId:(0,M7.P)(),queryHasChanged:!1,isSearching:!0});TQ.bR(u,{categoryId:null==n?c:n,preferredLocale:null!==(i=null==f?void 0:f.code)&&void 0!==i?i:s.code,offset:e,length:t,filters:d})} ;r.handleSearchBlurred=function(e){var t=r.props.onSearchBlur;r.setState({inputFocused:!1});null==t||t()};r.handleSearchKeyPress=function(e){var t=r.state,n=t.query,o=t.queryHasChanged,i=r.props,a=i.loadId,s=i.currentCategoryId,c=s!==J8.Hk?s:null;if(r.canSearch(n)&&o&&e.charCode===M.yXg.ENTER){i2.tI(a,c);r.doSearch(0,12,void 0,!0)}else 0===n.length&&e.charCode===M.yXg.ENTER&&r.setState({isSearching:!1})};r.handleQueryChanged=function(e){r.setState({query:e,queryHasChanged:!0})};r.handleQueryCleared=function(){r.setState({query:"",queryHasChanged:!0,isSearching:!1})};r.handleLanguageChange=function(e){var t=r.props,n=t.mostRecentQuery,o=t.availableLanguages,i=null==o?void 0:o.find((function(t){return t.name===e}));r.setState({selectedLanguage:i},(function(){r.canSearch(n)&&r.doSearch(0,12)}))};r.handleCategoryChange=function(e){var t=r.props.mostRecentQuery;TQ.uY(e);r.canSearch(t)&&r.doSearch(0,12,e)};r.handleFocus=function(){var e=r.props.onSearchFocus;r.setState({inputFocused:!0}) ;null==e||e()};r.focusInput=function(){var e;null===(e=r._searchRef.current)||void 0===e||e.focus()};r.state={searchId:(0,M7.P)(),query:e.isSearchPage?e.mostRecentQuery:"",queryHasChanged:!1,isSearching:!1,selectedLanguage:e.defaultLanguage,inputFocused:!1,isHandlingTagSearch:e.isTagSearch||!1};return r}var i=n.prototype;i.componentDidMount=function(){var e=this.props,t=e.loadId,n=e.searchResults,r=e.currentCategoryId,o=this.state,i=o.searchId,a=o.query,s=o.isHandlingTagSearch,c=this.context;null==Q8.ZP.getSearchIndex()&&TQ.Ue();Yl.S.subscribe(M.CkL.GLOBAL_CLIPBOARD_PASTE,this.focusInput);Yl.S.subscribe(M.CkL.TEXTAREA_FOCUS,this.focusInput);if(a.length>0){var l=r!==J8.Hk?r:null;f9({loadId:t,searchId:i,query:a,guildResults:n.guilds,analyticsContext:c,categoryId:l,isTagSearch:s})}};i.componentDidUpdate=function(e,t){ var n=this.props,r=n.loadId,o=n.isFetchingSearch,i=n.searchResults,a=n.currentCategoryId,s=n.mostRecentQuery,c=this.state,l=c.isSearching,u=c.searchId,f=c.query,d=c.isHandlingTagSearch,p=this.context,h=e.isFetchingSearch&&!o,E=a!==J8.Hk?a:null;if((l||d)&&h){f9({loadId:r,searchId:u,query:f,guildResults:i.guilds,analyticsContext:p,categoryId:E,isTagSearch:d});this.setState({isHandlingTagSearch:!1})}!t.isSearching&&l&&i2.tI(r,E,p);e.mostRecentQuery!==s&&this.setState({query:s,searchId:(0,M7.P)(),isHandlingTagSearch:!0})};i.componentWillUnmount=function(){Yl.S.unsubscribe(M.CkL.GLOBAL_CLIPBOARD_PASTE,this.focusInput);Yl.S.unsubscribe(M.CkL.TEXTAREA_FOCUS,this.focusInput)};i.renderSearchOptions=function(){var e=this.props.availableLanguages,t=this.state.selectedLanguage;if(null==e)return null;var n,o=e.map((function(e){var t=e.name;return{label:t,value:t}}));return(0,r.jsx)(c.q4e,{className:t9().languageSelector,options:o,value:null!==(n=null==t?void 0:t.name)&&void 0!==n?n:"", onChange:this.handleLanguageChange,maxVisibleItems:6})};i.renderCategories=function(){var e=this,t=this.props,n=t.currentCategoryId,o=t.countsByCategory;return(0,r.jsx)("div",{className:t9().categories,children:null==o?void 0:o.map((function(t){var o=c9(t,2),i=o[0],a=o[1];return(0,r.jsx)(d9,{categoryId:i,name:i===J8.Hk?Q.Z.Messages.GUILD_DISCOVERY_ALL_CATEGORY_FILTER:D7.Z.getCategoryName(i),onCategoryChange:e.handleCategoryChange,isSelected:n===i,count:a},i)}))})};i.render=function(){var e=this.state,t=e.query,n=e.inputFocused,o=this.props,i=o.placeholder,a=o.isSearchPage;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:lh()(t9().container,r9({},t9().searchPage,a)),children:[(0,r.jsx)("div",{className:t9().search,children:(0,r.jsx)($8.Z,{ref:this._searchRef,searchTerm:t,className:a?void 0:t9().searchBox,inputClassName:a?void 0:t9().searchBoxInput,closeIconClassName:a?void 0:t9().closeIcon,searchIconClassName:a?void 0:t9().searchIcon, label:Q.Z.Messages.GUILD_DISCOVERY_SEARCH_LABEL,placeholder:i,onChange:this.handleQueryChanged,onClear:this.handleQueryCleared,onFocus:this.handleFocus,onBlur:this.handleSearchBlurred,onKeyPress:this.handleSearchKeyPress,autoFocus:!a,cta:n&&null!=t&&t.length>1?Q.Z.Messages.GUILD_DISCOVERY_SEARCH_ENTER_CTA:null})}),a?this.renderSearchOptions():null]}),a?this.renderCategories():null]})};return n}(o.PureComponent);p9.contextType=Ie.AnalyticsContext;function h9(e){var t=(0,s.e7)([D7.Z],(function(){return D7.Z.getDiscoveryCategories()}),[],D7.j),n=(0,s.e7)([Q8.ZP],(function(){return Q8.ZP.getTopCategoryCounts(e.mostRecentQuery)}));return(0,r.jsx)(p9,i9(function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&e.startsWith("?")?vl.parse(e):{}},z9=function(e){ var t=e.categoryId,n=e.categoryName,o=e.onClick,i=t===J8.Hk,a=i?Q.Z.Messages.GUILD_DISCOVERY_SEARCH_EMPTY_HEADER:Q.Z.Messages.GUILD_DISCOVERY_SEARCH_EMPTY_CATEGORY_HEADER.format({categoryName:n}),s=i?Q.Z.Messages.GUILD_DISCOVERY_SEARCH_EMPTY_BODY:Q.Z.Messages.GUILD_DISCOVERY_SEARCH_EMPTY_CATEGORY_BODY.format({onClick:o});return(0,r.jsxs)("div",{className:B9().emptyContainer,children:[(0,r.jsx)("div",{className:B9().emptyImage}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:B9().emptyHeader,children:a}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"header-secondary",children:s})]})},W9=function(){return(0,r.jsxs)("div",{className:B9().emptyContainer,children:[(0,r.jsx)("div",{className:B9().errorImage}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"header-secondary",className:B9().emptyHeader,children:Q.Z.Messages.GUILD_DISCOVERY_SEARCH_ERROR})]})};const K9=function(e){ var t=e.loadId,n=e.searchResults,i=e.mostRecentQuery,a=e.defaultLanguage,l=e.availableLanguages,u=e.isFetchingSearch,f=e.scroller,d=e.loadingGuildId,p=e.theme,h=e.currentCategoryId,E=e.currentCategoryName,y=e.onViewGuild,m=e.onGuildCardSeen,b=e.placeholder,g=e.onTagClick,O=Wa().uniqueId("GuildDiscovery"),v=n.guilds,_=n.loading,I=n.total,S=V9(o.useState(!1),2),T=S[0],N=S[1],A=Y9().tag,C=V9(o.useState(A),2),P=C[0],j=C[1],R=(0,s.e7)([Q8.ZP],(function(){return Q8.ZP.hasSearchError()})),x=function(e,t,n){TQ.bR(i,{categoryId:n?J8.Hk:h,preferredLocale:a.code,offset:e,length:t,filters:{approximate_member_count:i2.sq}});N(!1)};o.useEffect((function(){var e=Y9(),t=e.offset,n=e.tag,r=null!=t?Math.floor(parseInt(t,10)/F9)+1:1;j(!!n);1===r&&N(!0)}),[i]);var M=h===J8.Hk?Q.Z.Messages.GUILD_DISCOVERY_SEARCH_RESULTS_HEADER.format({count:null!=I?I.toLocaleString():"0",query:i}):Q.Z.Messages.GUILD_DISCOVERY_SEARCH_RESULTS_CATEGORY_HEADER.format({count:null!=I?I.toLocaleString():"0",query:i,category:E}) ;return(0,r.jsxs)("div",{className:B9().container,children:[(0,r.jsxs)("div",{className:B9().searchHeader,children:[(0,r.jsx)(c.P3F,{onClick:function(){TQ.AQ();i2.IZ(t)},className:B9().arrow,"aria-label":Q.Z.Messages.BACK,children:(0,r.jsx)(AM.Z,{direction:AM.Z.Directions.LEFT})}),(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:B9().header,children:M})]}),(0,r.jsx)(h9,{loadId:t,searchResults:n,mostRecentQuery:i,isFetchingSearch:u,defaultLanguage:a,placeholder:b,availableLanguages:l,isSearchPage:!0,currentCategoryId:h,isTagSearch:P}),R?(0,r.jsx)(W9,{}):I<=0?(0,r.jsx)(z9,{categoryId:h,categoryName:E,onClick:function(){TQ.uY(J8.Hk);x(0,F9,!0)}}):(0,r.jsx)("div",{className:B9().results,children:(0,r.jsx)(q8,{pageSize:F9,totalCount:I,resetCurrentPage:T,onPageChange:function(e){x((e-1)*F9,F9);null==f||f.scrollTo({to:0})},children:function(e){var t=e.controller;return(0,r.jsxs)("section",{"aria-labelledby":O,children:[(0,r.jsx)(k9,{guilds:v,loading:_,loadingPlaceholderCount:F9, onViewGuild:y,loadingGuildId:d,theme:p,analyticsContext:i2.P1.SEARCH,onGuildCardSeen:m,onTagClick:g}),t]})}})})]})};var q9=n(116433);function X9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?(0,r.jsxs)("div",{children:[(0,r.jsx)(c.X6q,{className:aee().title,variant:"heading-lg/semibold",children:Q.Z.Messages.YOUR_HUB}),(0,r.jsxs)("div",{className:aee().guildList,children:[o,(0,r.jsx)(oee,{hasHub:!0})]})]}):(0,r.jsx)("div",{className:aee().guildList,children:(0,r.jsx)(oee,{hasHub:!1})})})};var fee=n(610982),dee=n.n(fee),pee=n(237018),hee=n.n(pee);const Eee=function(e){ var t=e.loadId,n=(0,s.e7)([Zt.Z],(function(){var e=Zt.Z.getGuilds();return Object.entries(e).filter((function(e){var t=Q9(e,2);t[0];return t[1].hasFeature(M.oNc.HUB)})).map((function(e){var t=Q9(e,2);t[0];return t[1]}))}));o.useEffect((function(){(0,i2.Zt)({loadId:t,gamesYouPlayGuilds:[],allGuilds:[],categoryId:J8.U})}),[t]);(0,Am.Tt)({subsection:Q.Z.Messages.HUB_SCHOOL_HUBS,location:Q.Z.Messages.HUB_DIRECTORY_SEARCH_TITLE});return(0,r.jsx)(c.Ttm,{className:dee().scroller,children:(0,r.jsxs)("div",{className:dee().viewWrapper,children:[(0,r.jsxs)("div",{className:dee().headerContainer,children:[(0,r.jsx)("img",{alt:"",className:dee().headerImage,src:hee()}),(0,r.jsxs)("div",{className:dee().headerContent,children:[(0,r.jsx)(c.X6q,{className:dee().headerText,variant:"heading-xl/semibold",children:Q.Z.Messages.HUB_DIRECTORY_SEARCH_TITLE}),(0,r.jsx)(c.xvT,{className:dee().headerDescription,variant:"text-md/normal",color:"none",children:Q.Z.Messages.HUB_DIRECTORY_SEARCH_SUBTITLE})]})] }),(0,r.jsx)(uee,{guilds:n}),(0,r.jsx)("div",{className:dee().divider}),(0,r.jsx)(c.xvT,{className:dee().footerDescription,variant:"text-md/medium",color:"header-secondary",children:Q.Z.Messages.HUB_DISCOVERY_FOOTER_DESCRIPTION})]})})};var yee=n(575136),mee=n(80210),bee=n.n(mee),gee=n(236481),Oee=n.n(gee);function vee(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _ee(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Iee(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){_ee(i,r,o,a,s,"next",e)}function s(e){_ee(i,r,o,a,s,"throw",e)}a(void 0)}))}}function See(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tee(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Nee(e){ Nee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Nee(e)}function Aee(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0){var m;null===(m=this._scroller.current)||void 0===m||m.scrollTo({to:y})}(0,uV.e)("guild_discovery")};i.componentDidUpdate=function(e){var t=this.props,n=t.guilds,r=n.gamesYouPlay,o=n.featured,i=t.isFetching,a=t.mostRecentQuery,s=t.currentHomepageCategoryId,c=t.currentCategoryId;e.isFetching&&!i&&i2.Zt({loadId:this.loadId,gamesYouPlayGuilds:r.guilds,allGuilds:o.guilds,categoryId:s});if(e.currentCategoryId!==c){var l;null===(l=this._scroller.current)||void 0===l||l.scrollTo({to:0})} e.currentCategoryId!==c&&i2.Az(this.loadId,Array.from(this._guildIdsSeen));e.mostRecentQuery.length>0&&a.length<1&&s!==c&&(0,TQ.uY)(s)};i.componentWillUnmount=function(){var e=this.props,t=e.currentCategoryId,n=e.recommendationsLoadId,r=e.recommendationsGuilds;t===J8.Hk?null!=r&&null!=n&&i2.Az(n,this.getOrderedGuildIdsSeen(r.map((function(e){return e.id}))),"Game Recommendations"):i2.Az(this.loadId,Array.from(this._guildIdsSeen))};i.getOrderedGuildIdsSeen=function(e){var t=this;return e.filter((function(e){return t._guildIdsSeen.has(e)}))};i.renderGamesYouPlay=function(){var e=this.props,t=e.guilds,n=e.mightHaveGamesYouPlay,o=e.theme,i=e.userGuilds,a=Object.keys(i),s=t[M.Lcj.GAMES_YOU_PLAY];s.guilds=s.guilds.filter((function(e){return!a.includes(e.id)}));var c=this.state.loadingGuildId;return n?(0,r.jsx)(H8,{loadId:this.loadId,title:Q.Z.Messages.GUILD_DISCOVERY_HEADER_GAMES_YOU_PLAY,guildsData:s,loadingGuildId:c,analyticsContext:i2.P1.RECOMMENDED,onViewGuild:this.handleViewGuild, onGuildCardSeen:this.handleGuildCardSeen,fetchGuilds:TQ.gk,theme:o}):null};i.renderSearchBar=function(){var e,t=this.props,n=t.mostRecentQuery,o=t.guilds.search,i=t.defaultLanguage,a=t.isFetchingSearch,s=t.currentCategoryId,c=t.categories,l=t.currentCategoryName;x7.trackExposure({});var u,f=x7.getCurrentConfig({}).shouldDisplayRecommendedSearchTags?s===J8.Hk?Q.Z.Messages.GUILD_DISCOVERY_SEARCH_PLACEHOLDER_TAGS:Q.Z.Messages.GUILD_DISCOVERY_CATEGORY_SEARCH_PLACEHOLDER_TAGS.format({categoryName:l}):s===J8.Hk?Q.Z.Messages.GUILD_DISCOVERY_SEARCH_PLACEHOLDER:Q.Z.Messages.GUILD_DISCOVERY_CATEGORY_SEARCH_PLACEHOLDER.format({categoryName:l}),d=null!==(u=null===(e=o[n])||void 0===e?void 0:e[s])&&void 0!==u?u:Q8.xk;return(0,r.jsx)(h9,{loadId:this.loadId,searchResults:d,mostRecentQuery:n,isFetchingSearch:a,defaultLanguage:i,placeholder:f,currentCategoryId:s,categories:c})};i.renderSearchResults=function(){ var e,t,n=this,o=this.props,i=o.mostRecentQuery,a=o.guilds.search,s=o.availableLanguages,c=o.defaultLanguage,l=o.isFetchingSearch,u=o.theme,f=o.currentCategoryId,d=o.currentCategoryName,p=this.state.loadingGuildId,h=f===J8.Hk?Q.Z.Messages.GUILD_DISCOVERY_SEARCH_PLACEHOLDER:Q.Z.Messages.GUILD_DISCOVERY_CATEGORY_SEARCH_PLACEHOLDER.format({categoryName:d}),E=null!==(t=null===(e=a[i])||void 0===e?void 0:e[f])&&void 0!==t?t:Q8.xk;return(0,r.jsx)(K9,{loadId:this.loadId,availableLanguages:s,defaultLanguage:c,placeholder:h,isFetchingSearch:l,searchResults:E,mostRecentQuery:i,loadingGuildId:p,currentCategoryId:f,currentCategoryName:d,scroller:this._scroller.current,theme:u,onViewGuild:this.handleViewGuild,onGuildCardSeen:this.handleGuildCardSeen,onTagClick:function(e,t){return n.handleTagSearch(e,t,i2.P1.SEARCH)}})};i.renderRecommendedGuildsSection=function(){var e=this,t=this.props,n=t.guilds,o=t.theme,i=this.state.loadingGuildId;return(0,r.jsx)(H8,{loadId:this.loadId, title:Q.Z.Messages.GUILD_DISCOVERY_FEATURED_HEADER,guildsData:n.featured,analyticsContext:i2.P1.POPULAR,onViewGuild:this.handleViewGuild,onGuildCardSeen:this.handleGuildCardSeen,fetchGuilds:function(){return(0,TQ.$z)(0,30)},loadingGuildId:i,theme:o,onTagClick:function(t,n){return e.handleTagSearch(t,n,i2.P1.POPULAR)}})};i.renderPopularGuildsSection=function(){var e=this,t=this.props,n=t.guilds,o=t.theme,i=t.currentCategoryId,a=this.state.loadingGuildId;return(0,r.jsx)(H8,{loadId:this.loadId,title:Q.Z.Messages.GUILD_DISCOVERY_POPULAR_HEADER,guildsData:n[i],loadingGuildId:a,analyticsContext:i2.P1.POPULAR,onViewGuild:this.handleViewGuild,onGuildCardSeen:this.handleGuildCardSeen,fetchGuilds:function(){return(0,TQ.K5)(i)},currentCategoryId:i,theme:o,onTagClick:function(t,n){return e.handleTagSearch(t,n,i2.P1.POPULAR)}})};i.render=function(){var e,t,n=this,i=this.props,a=i.currentCategoryName,s=i.mostRecentQuery,l=i.currentCategoryId,u=i.guilds,f=s.length>0;x7.trackExposure({}) ;var d=x7.getCurrentConfig({}).shouldDisplayRecommendedSearchTags,p=l===J8.Hk?null===(e=u[M.Lcj.FEATURED])||void 0===e?void 0:e.guilds:null===(t=u[l])||void 0===t?void 0:t.guilds;if(l===J8.U)return(0,r.jsx)(Eee,{loadId:this.loadId});var h=l===J8.Hk?Q.Z.Messages.GUILD_DISCOVERY_HOME_TITLE:Q.Z.Messages.GUILD_DISCOVERY_CATEGORY_TITLE.format({categoryName:a});return(0,r.jsxs)("div",{className:A9().pageWrapper,children:[(0,r.jsx)(Am.yY,{subsection:f?s:void 0,location:h}),(0,r.jsx)("div",{className:lh()(A9().dragRegion,A9().pageHeaderDrag,Tee({},A9().searchPageDrag,f))}),no.tq&&(0,r.jsx)(kb.ZP,{children:(0,r.jsx)(o.Fragment,{})}),(0,r.jsx)(c.yWw,{className:A9().scroller,ref:this._scroller,onScroll:this.handleScroll,children:(0,r.jsx)("div",{className:lh()(A9().viewWrapper,Tee({},A9().searchPage,f)),children:f?this.renderSearchResults():(0,r.jsxs)(c.y5t,{forceLevel:1,component:(0,r.jsxs)("div",{className:A9().searchHeader,children:[(0,r.jsx)("img",{alt:"",className:A9().headerImage,src:Oee() }),(0,r.jsx)("div",{className:A9().headerContentWrapper,children:(0,r.jsxs)("div",{className:A9().headerContent,children:[(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:A9().searchTitle,children:l===J8.Hk?Q.Z.Messages.GUILD_DISCOVERY_HOME_TITLE:Q.Z.Messages.GUILD_DISCOVERY_CATEGORY_TITLE.format({categoryName:a})}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",className:A9().searchSubtitle,children:l===J8.Hk&&Q.Z.Messages.GUILD_DISCOVERY_HOME_SUBTITLE}),this.renderSearchBar(),d&&(0,r.jsx)(Q7,{hideOverflow:!0,section:i2.P1.HEADER,className:A9().headerTagContainer,discoveryTagStyle:X7.LIGHT,onTagClick:function(e){return n.handleTagSearch(e,void 0,i2.P1.HEADER)},tags:Wa().chain(p).flatMap((function(e){return e.keywords})).compact().uniq().sampleSize(10).value()})]})})]}),children:[(0,r.jsx)("div",{className:A9().featuredBody,children:l===J8.Hk?this.renderRecommendedGuildsSection():this.renderPopularGuildsSection()}),(0,r.jsxs)("div",{className:A9().footer,children:[(0,r.jsx)("img",{ alt:"",src:bee(),className:A9().footerImage}),(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:Q.Z.Messages.GUILD_DISCOVERY_CATEGORY_FOOTER_TITLE}),(0,r.jsx)(c.zxk,{look:c.zxk.Looks.LINK,color:c.zxk.Colors.LINK,size:c.zxk.Sizes.MIN,onClick:this.scrollToTop,children:Q.Z.Messages.GUILD_DISCOVERY_FOOTER_BODY})]})]})})})]})};return n}(o.PureComponent),Dee=s.ZP.connectStores([st.Z,tl.default,yee.Z,mW.Z,Q8.ZP,D7.Z,Zt.Z],(function(){var e,t=J8.dU,n=tl.default.locale,r=null!==(e=Wa().find(t,{code:n}))&&void 0!==e?e:t[0],o=yee.Z.applicationStatistics,i=Object.keys(o),a=mW.Z.hasConsented(M.pjP.PERSONALIZATION)&&i.length>0,s=Q8.ZP.getCurrentCategoryId(),c=Q8.ZP.getCurrentHomepageCategoryId();return{isFetching:Q8.ZP.isFetching(),isFetchingSearch:Q8.ZP.isFetchingSearch(),guilds:Q8.ZP.getDiscoverableGuilds(),mostRecentQuery:Q8.ZP.getMostRecentQuery(),currentCategoryId:s,currentHomepageCategoryId:c,currentCategoryName:D7.Z.getCategoryName(s),categories:D7.Z.getDiscoveryCategories(), userGuilds:Zt.Z.getGuilds(),theme:st.Z.theme,mightHaveGamesYouPlay:a,availableLanguages:t,defaultLanguage:r}}))(wee);function Zee(e){var t=(0,s.cj)([q9.Z],(function(){return{recommendedGuilds:q9.Z.getRecommendedGuilds(),loadId:q9.Z.getLoadId(),fetching:q9.Z.isFetching()}})),n=t.fetching,o=t.loadId,i=t.recommendedGuilds;return(0,r.jsx)(Dee,Cee(Aee({},e),{fetchingRecommendations:n,usingGameRecommendations:!1,recommendationsGuilds:i,recommendationsLoadId:o}))}var Lee=n(794547);function Uee(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function kee(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){ Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Gee(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Bee(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.className,l=e.foreground,u=Gee(e,["width","height","color","className","foreground"]);return(0,r.jsx)("svg",kee(function(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Yee(e){ var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.className,l=e.foreground,u=Fee(e,["width","height","color","className","foreground"]);return(0,r.jsx)("svg",Vee(function(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function qee(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.className,l=e.foreground,u=Kee(e,["width","height","color","className","foreground"]);return(0,r.jsx)("svg",Wee(function(e){for(var t=1;t0}})),t=e.currentCategoryId,n=e.isViewingSearchResults,o=(0,s.e7)([D7.Z],(function(){return D7.Z.getDiscoveryCategories()}),[],D7.j),i=null==o?void 0:o.map((function(e){ return lte(function(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function wte(e){ var t=e.width,n=void 0===t?20:t,o=e.height,i=void 0===o?20:o,a=e.color,s=void 0===a?"currentColor":a,c=Mte(e,["width","height","color"]);return(0,r.jsxs)("svg",xte(function(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue} if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=200}))}));return e&&!(0,lp.EO)(t)&&n},Wne=n(620440),Kne=n.n(Wne);const qne=function(e){var t=e.markAsDismissed,n=(0,dE.ZP)([E.Z],(function(){return E.Z.useReducedMotion}));return zne()?(0,r.jsx)(qZ.ZP,{asset:(0,r.jsx)(pL.Z,{className:Kne().video,src:"https://cdn.discordapp.com/attachments/1067194967979733053/1067195117439557712/Safety_BLOCK_Coachmark.mp4",loop:!0,autoPlay:!n,width:"100%"}),header:Q.Z.Messages.SAFETY_CONSUMER_EDUCATION_BLOCK_HEADER,content:Q.Z.Messages.SAFETY_CONSUMER_EDUCATION_BLOCK_CONTENT,buttonCTA:Q.Z.Messages.GOT_IT,className:Kne().coachmark,onClick:function(e){e.stopPropagation();t()},markAsDismissed:t,caretPosition:qZ.DF.BOTTOM_CENTER,headerClassName:Kne().header}):null} ;var Xne=n(618599),Qne=n.n(Xne);const $ne=function(e){var t=e.markAsDismissed,n=(0,dE.ZP)([E.Z],(function(){return E.Z.useReducedMotion}));return zne()?(0,r.jsx)(qZ.ZP,{asset:(0,r.jsx)(pL.Z,{className:Qne().video,src:"https://cdn.discordapp.com/attachments/1067194967979733053/1067195118026772480/Safety_MUTE_Coachmark.mp4",loop:!0,autoPlay:!n,width:"100%"}),header:Q.Z.Messages.SAFETY_CONSUMER_EDUCATION_MUTE_HEADER,content:Q.Z.Messages.SAFETY_CONSUMER_EDUCATION_MUTE_CONTENT,buttonCTA:Q.Z.Messages.GOT_IT,className:Qne().coachmark,onClick:function(e){e.stopPropagation();t()},markAsDismissed:t,caretPosition:qZ.DF.BOTTOM_CENTER,headerClassName:Qne().header}):null};var Jne,ere=n(784686);!function(e){e[e.VIEW=0]="VIEW";e[e.DISMISS=1]="DISMISS";e[e.CHANGE_SETTING=2]="CHANGE_SETTING"}(Jne||(Jne={}));var tre=n(218713),nre=n.n(tre),rre=n(660588),ore=n.n(rre);const ire=function(e){var t=e.markAsDismissed;o.useEffect((function(){Ie.default.track(M.rMx.DM_SAFETY_COACHMARK_ACTION,{action:Jne.VIEW}) }),[]);return(0,r.jsx)(qZ.ZP,{asset:(0,r.jsx)("img",{src:ore(),alt:Q.Z.Messages.USER_EXPLICIT_CONTENT_FILTER_COACHMARK_ASSET_ALT,className:nre().art}),header:Q.Z.Messages.USER_EXPLICIT_CONTENT_FILTER_COACHMARK_HEADER,content:Q.Z.Messages.USER_EXPLICIT_CONTENT_FILTER_COACHMARK_CONTENT,buttonCTA:Q.Z.Messages.GOT_IT,secondaryButtonCTA:Q.Z.Messages.USER_EXPLICIT_CONTENT_FILTER_COACHMARK_REDIRECT,className:nre().coachmark,onClick:function(e){e.stopPropagation();t();Ie.default.track(M.rMx.DM_SAFETY_COACHMARK_ACTION,{action:Jne.DISMISS})},onSecondaryClick:function(){(0,K.uL)(M.Z5c.SETTINGS("privacy-and-safety"));Ie.default.track(M.rMx.DM_SAFETY_COACHMARK_ACTION,{action:Jne.CHANGE_SETTING})},markAsDismissed:t,caretPosition:qZ.DF.BOTTOM_CENTER,headerClassName:nre().header})};const are=function(e){return(0,s.cj)([j.Z,Ye.Z,Jn.default],(function(){return function(e){ var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:j.Z,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ye.Z,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Jn.default,i=null!=e?n.getVoiceState(e.getGuildId(),o.getId()):null;return{selfDeaf:r.isSelfDeaf(),deaf:null!==(t=null==i?void 0:i.deaf)&&void 0!==t&&t}}(e,j.Z,Ye.Z,Jn.default)}))};var sre=n(79987),cre=n(377463),lre=n(466317),ure=n(308377),fre=n(6171),dre=n(961241),pre=n(554647),hre=n(168775),Ere=n(630781),yre=n(984479),mre=n(691797),bre=n(575709),gre=n.n(bre);function Ore(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vre(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function _re(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){vre(i,r,o,a,s,"next",e)}function s(e){vre(i,r,o,a,s,"throw",e)}a(void 0)}))}} function Ire(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sre(e,t){for(var n=0;n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function jre(e,t){return!t||"object"!==xre(t)&&"function"!=typeof t?Ore(e):t}function Rre(e,t){Rre=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Rre(e,t)}var xre=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Mre(e){ var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Nre(e);if(t){var o=Nre(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return jre(this,n)}}var wre=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5: a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&void 0!==arguments[0]?arguments[0]:M.oAB.ACCOUNT,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;h.Z.open(e,t,n)};e.handleOpenSettingsContextMenu=function(t){var o=e.props.currentUser;if(null!=o){var i=Ore(e);(0,Ob.jW)(t,_re((function(){var e,t;return wre(this,(function(a){switch(a.label){case 0:return[4,n.e(22587).then(n.bind(n,22587))];case 1:e=a.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Cre(Are({},e),{user:o,premiumSubscription:i.props.premiumSubscription,webBuildOverride:i.props.webBuildOverride}))}]}}))})))}} ;e.handleInputAudioContextMenu=function(e){(0,Ob.jW)(e,_re((function(){var e,t;return wre(this,(function(o){switch(o.label){case 0:return[4,Promise.resolve().then(n.bind(n,666305))];case 1:e=o.sent(),t=e.default;return[2,function(){return(0,r.jsx)(t,{onClose:Ob.Zy,renderInputDevices:!0,renderInputModes:!0,renderInputVolume:!0})}]}}))})))};e.handleOutputAudioContextMenu=function(e){(0,Ob.jW)(e,_re((function(){var e,t;return wre(this,(function(o){switch(o.label){case 0:return[4,Promise.resolve().then(n.bind(n,666305))];case 1:e=o.sent(),t=e.default;return[2,function(){return(0,r.jsx)(t,{onClose:Ob.Zy,renderOutputDevices:!0,renderOutputVolume:!0})}]}}))})))};e.handleMouseEnter=function(){e.setState({hovered:!0})};e.handleMouseLeave=function(){e.setState({hovered:!1})};e.handleMouseEnterMute=function(){e.setState({hoveringOnMute:!0,shouldShowSpeakingWhileMutedTooltip:!1});e.speakingWhileMutedTooltipTimeout.stop()};e.handleMouseLeaveMute=function(){e.setState({hoveringOnMute:!1})} ;e.handleCopyTag=function(){var t=e.props.currentUser,n=e.state,r=n.shouldShowNametagTooltip,o=n.copiedStreak;if(null!=t){(0,mre.JG)(lp.ZP.getUserTag(t,{decoration:"never",identifiable:"always"}));Ie.default.track(M.rMx.TEXT_COPIED,{type:"User Tag"});var i={shouldShowCopiedFeedback:!0,shouldShowNametagTooltip:!0};r||(i.copiedStreak=o+1);e.setState(i,(function(){e.copiedTimeout.start(1e3,(function(){return e.setState({shouldShowNametagTooltip:!1})}));e.copiedDecayTimeout.start(2e3,(function(){return e.setState({copiedStreak:0})}))}))}};e.handleOccludedChanged=function(){e.props.occluded&&e.setState({shouldShowNametagTooltip:!1,shouldShowSpeakingWhileMutedTooltip:!1})};e.handleSpeakingWhileMutedChanged=function(){var t=e.props,n=t.selfMute,r=t.serverMute,o=t.suppress,i=t.speakingWhileMuted,a=t.occluded,s=e.state.hoveringOnMute;if(i)s||!n||r||o||a||e.setState({shouldShowSpeakingWhileMutedTooltip:!0},(function(){e.speakingWhileMutedTooltipTimeout.start(2e3,(function(){return e.setState({ shouldShowSpeakingWhileMutedTooltip:!1})}))}));else{e.setState({shouldShowSpeakingWhileMutedTooltip:!1});e.speakingWhileMutedTooltipTimeout.stop()}};e.renderStatusPickerPopout=function(t){var n=t.closePopout,o=e.props,i=o.showRichProfilePopup,a=o.currentUser;if(i){var s={userId:null==a?void 0:a.id,user:a,onClose:function(){e.handleMouseLeave();null==n||n()}};return(0,r.jsx)("div",{className:gre().accountProfilePopoutWrapper,children:(0,r.jsx)(Yne,Are({},s))})}return(0,r.jsx)(Wte,{onClose:function(){e.handleMouseLeave();null==n||n()}})};e.renderSettingsGear=function(){var t=e.props.webBuildOverride;return(0,r.jsx)(hre.Z,{tooltipText:null!=t?Q.Z.Messages.USER_SETTINGS_WITH_BUILD_OVERRIDE.format({webBuildOverride:t.id}):Q.Z.Messages.USER_SETTINGS,onClick:e.handleOpenAccountSettings,onContextMenu:e.handleOpenSettingsContextMenu,innerClassName:null!=t?gre().buildOverrideButton:null,icon:lre.Z,children:null!=t?(0,r.jsx)(fre.Z,{width:9,height:9,className:gre().hasBuildOverride, "aria-hidden":!0}):null})};return e}var i=o.prototype;i.componentDidUpdate=function(e){var t=e.speakingWhileMuted,n=e.occluded,r=this.props,o=r.speakingWhileMuted;r.occluded!==n&&this.handleOccludedChanged();o!==t&&this.handleSpeakingWhileMutedChanged()};i.componentWillUnmount=function(){this.copiedTimeout.stop();this.copiedDecayTimeout.stop();this.speakingWhileMutedTooltipTimeout.stop()};i.renderCopiedSuccess=function(){var e=this.state.copiedStreak,t=[Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_1,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_2,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_3,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_4,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_5,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_6,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_7,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_8,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_9,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_10,Q.Z.Messages.ACCOUNT_USERNAME_COPY_SUCCESS_11],n=Math.min(Math.max(0,e-1),t.length-1) ;return(0,r.jsx)(c.UkV,{isShaking:this.isCopiedStreakGodlike,children:t[n]})};i.renderNameTagV2=function(){var e=this.state.hovered,t=this.props,n=t.customStatusActivity,o=t.userTag,i=t.currentUser;if(null==i)return null;var a=lp.ZP.getName(i),s="@"+o,c=null!=n?(0,r.jsx)(Q5.Z,{hoverText:s,forceHover:e,children:(0,r.jsx)(dte.Z,{activity:n,emojiClassName:gre().emoji,className:gre().customStatus})}):void 0;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:gre().panelTitleContainer,children:(0,r.jsx)(yre.Z,{children:a})}),(0,r.jsx)("div",{className:gre().panelSubtextContainer,children:(0,r.jsx)(Ere.Z,{children:null!=c?c:s})})]})};i.renderNameTag=function(){if(this.props.inGlobalDisplayNameExperiment)return this.renderNameTagV2();var e=this.props,t=e.customStatusActivity,n=e.hidePrivateData,o=e.currentUser,i=this.state.hovered;if(null==o)return null;var a=n?null:"#".concat(o.discriminator),s=null!=t?(0,r.jsx)(Q5.Z,{hoverText:a,forceHover:i,children:(0,r.jsx)(dte.Z,{ activity:t,emojiClassName:gre().emoji,className:gre().customStatus})}):a;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xvT,{className:gre().usernameContainer,variant:"text-sm/normal",children:(0,r.jsx)(yre.Z,{children:o.username})}),null!=s?(0,r.jsx)(Ere.Z,{className:gre().discriminator,children:s}):null]})};i.renderCopiableNameTag=function(){var e=this,t=this.props.currentUser,n=this.state,o=n.shouldShowNametagTooltip,i=n.shouldShowCopiedFeedback;if(null==t)return null;var a=null,s=c.FGA.PRIMARY;if(mre.wS){a=Q.Z.Messages.ACCOUNT_CLICK_TO_COPY;if(i){a=this.renderCopiedSuccess();s=this.isCopiedStreakGodlike?c.FGA.RED:c.FGA.GREEN}}return(0,r.jsx)(c.ua7,{text:a,forceOpen:o,"aria-label":!!mre.wS&&Q.Z.Messages.ACCOUNT_CLICK_TO_COPY,color:s,delay:500,onAnimationRest:function(t,n){i&&!o&&n.phase===M.UkZ.LEAVE&&e.setState({shouldShowCopiedFeedback:!1})},children:function(t){var n=t.onClick,o=t.onMouseEnter,a=Pre(t,["onClick","onMouseEnter"]);return(0,r.jsx)(c.P3F,Cre(Are({},a),{ onMouseEnter:function(){if(i){e.copiedTimeout.stop();e.setState({shouldShowNametagTooltip:!1},o)}else null==o||o()},onClick:function(){null==n||n();e.handleCopyTag()},className:lh()(gre().nameTag,Tre({},gre().canCopy,mre.wS)),children:e.renderNameTag()}))}})};i.renderAvatarWithPopout=function(){var e=this,t=this.props,n=t.speaking,o=t.streaming,i=t.currentUser,a=t.status,s=t.showTagAsButton,l=t.showTaglessAccountPanel,u=t.canUseAvatarDecorations;if(null==i)return null;var f=u?(0,Ds.NZ)({userId:i.id,avatarDecoration:i.avatarDecoration,size:(0,hR.y)(c.EFr.SIZE_32)}):null;return(0,r.jsx)(fW.Z,{object:M.qAy.AVATAR,children:(0,r.jsx)(c.yRy,{renderPopout:this.renderStatusPickerPopout,position:"top",align:"left",animation:c.yRy.Animation.FADE,spacing:14,fixed:!0,preload:function(){return(0,mR.Z)(i.id,null==i?void 0:i.getAvatarURL(null,80))},children:function(t,u){var d;return(0,r.jsxs)(c.P3F,Cre(Are({},t),{"aria-label":Q.Z.Messages.SET_STATUS,className:lh()(gre().avatarWrapper,(d={}, Tre(d,gre().withTagAsButton,s),Tre(d,gre().withTagless,l),d)),children:[(0,r.jsx)(Dre,{size:c.EFr.SIZE_32,src:i.getAvatarURL(void 0,32,!1),avatarDecoration:f,"aria-label":i.username,status:o?M.Skl.STREAMING:a,isSpeaking:n,className:gre().avatar}),s||l?(0,r.jsx)("div",{className:lh()(gre().nameTag,Tre({},gre().canCopy,mre.wS)),children:l?(0,r.jsx)(hre.Z,{tooltipText:null,icon:u.isShown?cre.Z:BJ.Z,role:"switch","aria-label":Q.Z.Messages.SET_STATUS}):e.renderNameTag()}):null]}))}})})};i.renderNameZone=function(){var e=this,t=this.props,n=t.currentUser,o=t.dismissibleContents,i=this.props,a=i.showTagAsButton,s=i.showTaglessAccountPanel;return null==n?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(WN.Z,{contentTypes:o.avatar,children:function(t){t.visibleContent;return e.renderAvatarWithPopout()}}),a||s?null:this.renderCopiableNameTag()]})};i.render=function(){ var e=this,t=this.props,n=t.currentUser,o=t.selfDeaf,i=t.selfMute,a=t.awaitingRemote,s=t.serverMute,l=t.serverDeaf,u=t.suppress,f=t.dismissibleContents,d=this.state.shouldShowSpeakingWhileMutedTooltip;if(null==n)return null;var p=i||u||s,h=o||l;return(0,r.jsxs)("div",{className:gre().container,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,children:[this.renderNameZone(),(0,r.jsxs)(uh.Z,{grow:0,children:[(0,r.jsx)(hre.Z,{tooltipText:d?Q.Z.Messages.ACCOUNT_SPEAKING_WHILE_MUTED:(0,cne.Z)(i,s,u,a),tooltipColor:d?c.FGA.GREEN:void 0,tooltipForceOpen:d||void 0,onMouseEnter:this.handleMouseEnterMute,onMouseLeave:this.handleMouseLeaveMute,icon:p?pre.Z:dre.Z,iconForeground:p?gre().strikethrough:null,onClick:this.handleToggleSelfMute,innerClassName:lh()(Tre({},gre().redIcon,s||u)),onContextMenu:this.handleInputAudioContextMenu,role:"switch","aria-label":Q.Z.Messages.MUTE,"aria-checked":p,disabled:a}),(0,r.jsx)(hre.Z,{tooltipText:sne(o,l,a),icon:o?ure.Z:mk.Z, onClick:this.handleToggleSelfDeaf,onContextMenu:this.handleOutputAudioContextMenu,innerClassName:lh()(Tre({},gre().redIcon,l)),iconForeground:h?gre().strikethrough:null,role:"switch","aria-label":Q.Z.Messages.DEAFEN,"aria-checked":h,disabled:a}),(0,r.jsx)(WN.Z,{contentTypes:f.settings,children:function(t){var o=t.visibleContent,i=t.markAsDismissed;switch(o){case ln.z$.USER_SAFETY_SAFE_DIRECT_MESSAGING:return(0,r.jsx)(c.yRy,{position:"top",align:"center",shouldShow:!0,renderPopout:function(){return(0,r.jsx)(ire,{markAsDismissed:i})},children:e.renderSettingsGear});case ln.z$.USER_SAFETY_CONSUMER_EDUCATION_BLOCK:return(0,r.jsx)(c.yRy,{position:"top",align:"center",shouldShow:!0,renderPopout:function(){return(0,r.jsx)(qne,{markAsDismissed:i})},children:e.renderSettingsGear});case ln.z$.USER_SAFETY_CONSUMER_EDUCATION_MUTE:return(0,r.jsx)(c.yRy,{position:"top",align:"center",shouldShow:!0,renderPopout:function(){return(0,r.jsx)($ne,{markAsDismissed:i})},children:e.renderSettingsGear}) ;case ln.z$.AVATAR_DECORATIONS_SPRING_2023_FEATURE_EDUCATION_TOOLTIP:return(0,r.jsx)(c.yRy,{position:"top",align:"center",shouldShow:!0,renderPopout:function(){return(0,r.jsx)(one,{user:n})},children:e.renderSettingsGear});default:return e.renderSettingsGear()}}})]})]})};!function(e,t,n){t&&Sre(e.prototype,t);n&&Sre(e,n)}(o,[{key:"isCopiedStreakGodlike",get:function(){return this.state.copiedStreak>=10}}]);return o}(o.PureComponent);function Lre(){var e=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),t=(0,s.e7)([Jn.default],(function(){return Jn.default.getId()})),n=ct.Ok.useSetting(),i=o.useMemo((function(){return null!=n?(0,pne.Z)(n):null}),[n]),a=(0,s.cj)([Au.Z],(function(){return{streaming:null!=Au.Z.findActivity((function(e){return e.type===M.IIU.STREAMING})),status:Au.Z.getStatus()}})),l=a.streaming,u=a.status,f=(0,Xte.Z)({userId:t}),d=lp.ZP.useUserTag(e,{decoration:"never"}),p=(0,s.e7)([Lr.Z],(function(){return Lr.Z.hidePersonalInformation})),h=(0, s.e7)([A.Z,S.Z],(function(){var e=A.Z.getChannelId();return null!=e?S.Z.getChannel(e):null})),E=(0,sre.Z)(h),y=E.mute,m=E.selfMute,b=E.suppress,g=are(h),O=g.selfDeaf,v=g.deaf,_=(0,s.e7)([ine.C],(function(){var e;return(0,ane.fD)()?null===(e=ine.C.getCurrentBuildOverride().overrides)||void 0===e?void 0:e.discord_web:null})),I=(0,s.e7)([s4.Z],(function(){return s4.Z.getPremiumTypeSubscription()})),N=(0,s.e7)([Ye.Z],(function(){return Ye.Z.getEverSpeakingWhileMuted()})),C=(0,s.e7)([T.Z],(function(){return T.Z.hasLayers()})),P=(0,c.s9z)(c.JQI)||C||Bi.s.isDisallowPopupsSet(),j=(0,ere.rW)(),R=(0,pR.U)(!0).canUseAvatarDecorations;o.useEffect((function(){Ene.trackExposure({})}));var x=(0,s.e7)([rm.Z],(function(){return null!=rm.Z.getAwaitingRemoteSessionInfo()})),w=Ene.useExperiment({}),D=w.isPopupEnabled,Z=w.isJoinedTagButtonEnabled,L=w.isTaglessAccountPanelEnabled,U=(0,hne.n)(),k=(0,qte.n)(),G=zne(),B=Kte.useExperiment({}).bucket,H={avatar:[],settings:[]};if(!P){ U&&k&&H.settings.push(ln.z$.USER_SAFETY_SAFE_DIRECT_MESSAGING);G&&(1===B?H.settings.push(ln.z$.USER_SAFETY_CONSUMER_EDUCATION_MUTE):H.settings.push(ln.z$.USER_SAFETY_CONSUMER_EDUCATION_BLOCK))}return(0,r.jsx)(Zre,{currentUser:e,customStatusActivity:i,dismissibleContents:H,userTag:d,hidePrivateData:p,inGlobalDisplayNameExperiment:j,occluded:P,premiumSubscription:I,selfDeaf:O,selfMute:m,serverDeaf:v,serverMute:y,showRichProfilePopup:D,showTagAsButton:Z,showTaglessAccountPanel:L,speaking:f,speakingWhileMuted:N,status:u,streaming:l,suppress:b,webBuildOverride:_,awaitingRemote:x,canUseAvatarDecorations:R})}var Ure=n(75529),kre=n(783072),Gre=n.n(kre);function Bre(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Hre(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Bre(i,r,o,a,s,"next",e)}function s(e){Bre(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Vre(e,t){ if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fre(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Yre(e){Yre=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Yre(e)}function zre(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function Wre(e,t){return!t||"object"!==qre(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t} function Kre(e,t){Kre=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Kre(e,t)}var qre=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Xre(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Yre(e);if(t){var o=Yre(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Wre(this,n)}}var Qre=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1, r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]1};i.handleStopListening=function(){(0,eoe.Z)()};i.renderUserPopout=function(e,t){return(0,r.jsx)(yk.Z,Ioe(_oe({},e),{userId:t.id}))};i.render=function(){var e=this.props,t=e.currentUser,n=e.host,o=e.party;return this.hasParty(o)&&null!=t?(0,r.jsx)(yoe,{ currentUser:t,host:n,party:o,renderUserPopout:this.renderUserPopout,renderOverflowPopout:this.renderOverflowPopout,onStopListening:this.handleStopListening,onUserContextMenu:this.handleUserContextMenu}):null};return o}(o.PureComponent);const joe=s.ZP.connectStores([$q.Z,Y.default,Ja.Z,UW.Z],(function(){var e,t,n=$q.Z.getSyncingWith(),r=$q.Z.getActivity(),o=Y.default.getCurrentUser(),i=[];if(null!=n){e=Y.default.getUser(n.userId);t=n.partyId}else if(null!=r&&null!=r.party&&null!=r.party.id){e=o;t=r.party.id}if(null!=t){var a;i=Wa()(Array.from(null!==(a=UW.Z.getParty(t))&&void 0!==a?a:[])).map((function(e){return Y.default.getUser(e)})).filter(_o.lm).orderBy([function(t){return null==e||e.id===t.id},function(e){return Ja.Z.isFriend(e.id)}],["desc","desc"]).value()}return{currentUser:o,host:e,party:i}}))(Poe);var Roe,xoe,Moe=n(216151),woe=n(946767),Doe=n(976010),Zoe=[(Roe="Watch Together",xoe="2021-09_watch_together_rollout",(0,tc.B)({kind:"guild",id:xoe, label:"Exposure tracking for ".concat(Roe," (do not override)"),defaultConfig:{},treatments:[]}))];var Loe=n(555086),Uoe=n(22664),koe=n(59732),Goe=n(436771),Boe=n(948243),Hoe=n(496388),Voe=n(122590),Foe=n(423871),Yoe=n(484802),zoe=n(550677),Woe=n(397897),Koe=n.n(Woe);function qoe(e){var t=e.platform;return t===zoe.YE.XBOX?(0,r.jsx)(HK.Z,{className:Koe().icon}):t===zoe.YE.PLAYSTATION?(0,r.jsx)(Foe.Z,{className:Koe().icon}):null}function Xoe(e){var t,n=e.voiceState,o=e.awaitingRemoteSessionInfo,i=null!=o?(0,Yoe.y)(o.type):null,a=(0,s.e7)([Gd.Z],(function(){var e;return null===(e=Gd.Z.getSessionById(null!==(t=null==n?void 0:n.sessionId)&&void 0!==t?t:""))||void 0===e?void 0:e.clientInfo.os})),l=null!=i?i:a;if(null==l||!zoe.al.has(l))return null;var u=null!=o,f=u?l===zoe.YE.XBOX?Q.Z.Messages.XBOX_TRANSFERRING_ELLIPSIS:Q.Z.Messages.PLAYSTATION_TRANSFERRING_ELLIPSIS:l===zoe.YE.XBOX?Q.Z.Messages.XBOX_REMOTE_CONNECTED.format():Q.Z.Messages.PLAYSTATION_REMOTE_CONNECTED.format();return(0, r.jsxs)("div",{className:lh()(Koe().root,u?Koe().connecting:Koe().connected),children:[(0,r.jsx)(qoe,{platform:l}),(0,r.jsx)(c.xvT,{color:u?"header-primary":"always-white",variant:"text-xs/medium",children:f})]})}var Qoe=n(371607),$oe=n(113865),Joe=n(203158),eie=n(641429),tie=n(261258),nie=n.n(tie);function rie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function uie(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return rie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rie(e,t)}(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.")}()}var fie=function(e,t){ var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function jie(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=Pie(e,["width","height","color","foreground"]);return(0,r.jsxs)("svg",Cie(function(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function wie(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=Mie(e,["width","height","color","foreground"]);return(0,r.jsxs)("svg",xie(function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=7)return{v:[r,!0]};r.push(e) },l=e[Symbol.iterator]();!(o=(s=l.next()).done);o=!0){var u=c();if("object"==((n=u)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n))return u.v}}catch(e){i=!0;a=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw a}}return[r,!1]}(t,p),2),E=h[0],y=h[1],m=y&&l?t:E;return m.length<=0?null:(0,r.jsx)(c.zJl,{className:lh()(tae().scroller,i),fade:!0,children:(0,r.jsxs)("div",{className:tae().voiceUsers,role:"group","aria-label":Q.Z.Messages.VOICE_PANEL_USERS_A11Y_LABEL,children:[m.map((function(e){var t=e.user,o=e.nick,i=e.voiceState;return t.id!==p?(0,r.jsx)(dae,{channel:n,user:t,nick:o,mute:i.isVoiceMuted(),deaf:i.isVoiceDeafened(),video:i.selfVideo,serverMute:i.mute,serverDeaf:i.deaf},t.id):null})),y?d:null]})})}var hae=n(58005),Eae=n.n(hae);function yae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Tae(e,t){return!t||"object"!==Cae(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t} function Nae(e,t){Nae=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Nae(e,t)}function Aae(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yae(e,t)}(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.")}()}var Cae=function(e){ return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Pae(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=vae(e);if(t){var o=vae(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Tae(this,n)}}var jae=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0, o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0,O=d?Q.Z.Messages.SHARE_YOUR_SCREEN:Q.Z.Messages.ACTIVITY_PANEL_GO_LIVE_TOOLTIP_NO_PERMISSION_IN_VOICE,v=h||a||E,_=(0,r.jsx)(Zie.Z,{className:lh()(Eae().buttonIcon,Oae({},Eae().withText,!v))});return(0,r.jsx)(c.yRy,{renderPopout:function(e){var t=e.closePopout;return(0,r.jsx)(Oie.Z,{channel:n,currentUser:u,activeStreams:f,onClose:t,handleGoLive:i?y:_ie.Z})},position:"top",align:"center",animation:c.yRy.Animation.FADE,children:function(e){var n=e.onClick,o=Sae(e,["onClick"]);return(0,r.jsx)(c.ua7,{text:O,children:function(e){var i;return(0,r.jsx)(c.zxk,Iae(_ae(Iae(_ae({},e),{size:c.zxk.Sizes.SMALL,onClick:function(r){var o;g?n(r):t();null===(o=e.onClick)||void 0===o||o.call(e)}, disabled:!d||l,className:lh()(Eae().button,Eae().buttonColor,(i={},Oae(i,Eae().buttonActive,null!=m),Oae(i,Eae().disabled,!d||l),i))}),g?o:null),{innerClassName:Eae().buttonContents,wrapperClassName:Eae().button,children:v?_:(0,r.jsxs)(uh.Z,{align:uh.Z.Align.CENTER,children:[_,Q.Z.Messages.GO_LIVE_SHARE_SCREEN]})}))}})}})}var Lae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Nae(e,t)}(o,e);var t=Pae(o);function o(){gae(this,o);var e;(e=t.apply(this,arguments)).canScreenshare=function(){var t=e.props,n=t.channel;return t.canGoLive&&null!=n&&null!=n.getGuildId()};e.handleNoiseCancellationClicked=function(){var t=e.props.noiseCancellationActive;Fe.Z.setNoiseCancellation(!t,{section:M.jXE.NOISE_CANCELLATION_POPOUT})};e.handleGoLive=function(){ var t=e.props,n=t.guild,r=t.channel,o=null!=r?r.getGuildId():null!=n?n.id:null;null!=o&&(0,Iie.Z)(o,r.id,M.Sbl.VOICE_PANEL)};e.handleChannelLinkClick=function(t){var n,r=e.props,o=r.guild,i=r.channel;xh()(null!=i,"Channel is null during navigation click");t.stopPropagation();Moe.Z.channelListScrollTo(null!==(n=null==o?void 0:o.id)&&void 0!==n?n:M.ME,i.id)};e.handleChannelLinkContextMenu=function(t){var o=e.props.channel;(0,Ob.jW)(t,bae((function(){var e,t;return jae(this,(function(i){switch(i.label){case 0:return[4,n.e(1048).then(n.bind(n,101048))];case 1:e=i.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,Iae(_ae({},e),{channel:o}))}]}}))})))};e.handleCloseVoicePanelIntroduction=function(){Or.Kw(vr.v.VOICE_PANEL_INTRODUCTION)};e.renderVoicePanelIntroduction=function(){return(0,r.jsxs)("div",{className:lh()(Eae().voicePanelIntroductionWrapper,"theme-light"),children:[(0,r.jsx)(c.X6q,{className:Eae().voicePanelIntroductionHeader,variant:"heading-md/semibold", children:Q.Z.Messages.VOICE_PANEL_INTRODUCTION_HEADER}),(0,r.jsx)(c.xvT,{className:Eae().voicePanelIntroductionText,variant:"text-sm/normal",children:Q.Z.Messages.VOICE_PANEL_INTRODUCTION_TEXT}),(0,r.jsx)(c.zxk,{className:Eae().voicePanelIntroductionButton,color:c.zxk.Colors.BRAND,onClick:e.handleCloseVoicePanelIntroduction,children:Q.Z.Messages.VOICE_PANEL_INTRODUCTION_CLOSE})]})};return e}var i=o.prototype;i.renderConnectionStatus=function(){var e=this.props,t=e.channel,n=e.guild,o=e.rtcConnectionQuality,i=e.rtcConnectionState,a=e.rtcConnectionLastPing,s=e.hasVideo;if(null==t)return null;var l,u=(0,op.F6)(t,Y.default,Ja.Z,!0);if(null!=n){l=M.Z5c.CHANNEL(n.id,t.id);u="".concat(u," / ").concat(n.name)}else l=M.Z5c.CHANNEL(M.ME,t.id);return(0,r.jsx)(Doe.Z,{statusTextClassName:Eae().statusWithPopout,quality:o,state:i,lastPing:a,hasVideo:s,children:(0,r.jsx)(c.tEY,{children:(0,r.jsx)(a1.rU,{to:l,onClick:this.handleChannelLinkClick,onContextMenu:this.handleChannelLinkContextMenu, children:(0,r.jsx)(Ere.Z,{className:Eae().channel,children:u})})})})};i.renderNoiseCancellation=function(){var e=this.props,t=e.noiseCancellationActive,n=e.noiseCancellationError,o=e.hasLayers,i=e.remoteVoiceState,a=e.channel,s=e.voiceStates,l=!o&&n;if(null!=i)return null;if(null==a?void 0:a.isGuildStageVoice()){if(!(null!=s.find((function(e){return e.user.id===Jn.default.getId()&&(0,Rd.gf)(e.voiceState)===Rd.xO.ON_STAGE})))&&(0,Eie.U5)(a.id))return(0,r.jsx)(Mae,{})}return l?(0,r.jsx)(c.ua7,{text:Q.Z.Messages.NOISE_CANCELLATION_CPU_OVERUSE,tooltipClassName:Eae().noiseCancellationTooltip,forceOpen:!0,children:function(e){var t=e["aria-label"];return(0,r.jsx)(hre.Z,{"aria-label":t,tooltipText:null,disabled:!0,icon:wie})}}):(0,r.jsx)(c.yRy,{position:"top",align:"center",renderPopout:function(){return(0,r.jsx)(xae,{})},children:function(e,n){var o=n.isShown;return(0,r.jsx)(hre.Z,Iae(_ae({},e),{tooltipClassName:Eae().noiseCancellationTooltip, tooltipText:o?null:Q.Z.Messages.NOISE_CANCELLATION_TOOLTIP,icon:t?jie:wie}))}},"krisp-popout")};i.renderVoiceStates=function(){var e=this.props,t=e.channel,n=e.voiceStates,o=e.showVoiceStates;return null!=t&&o&&0!==n.length?(0,r.jsx)(pae,{voiceStates:n,channel:t,className:Eae().voiceUsers}):null};i.renderChannelButtons=function(){var e=this.props,t=e.channel,n=e.canGoLive,o=e.canUseSoundboard,i=e.remoteVoiceState,a=e.enableActivities,s=e.voiceStates,c=e.selfStream,l=e.isPrivateChannelWithEnabledActivities;if(null==t||null!=i)return null;var u=Jn.default.getId();if(t.isGuildStageVoice()){if(!(0,pie.tu)(t.guild_id))return null;if(!n)return null;var f=s.find((function(e){return e.user.id===u}));if(null==f||f.voiceState.suppress)return null}var d=(t.isGuildVoice()||l)&&a,p=(0,bie.t)(t).reachedLimit,h=(0,pie.xJ)(t.id);return(0,r.jsxs)("div",{className:Eae().actionButtons,children:[(0,r.jsx)(wae,{channel:t,enableActivities:d,disabled:!h&&p}),(0,r.jsx)(Zae,{channel:t,canGoLive:n, enableActivities:d,disabled:t.isGuildStageVoice()&&(h&&null==c||!h&&p)}),(0,r.jsxs)(r.Fragment,{children:[d?(0,r.jsx)(Dae,{channel:t,enableActivities:a}):null,t.isGuildVoice()&&o&&(0,wr.Z)(t)?(0,r.jsx)(die,{className:lh()(Eae().button,Eae().buttonColor),iconClassName:Eae().buttonIcon,channel:t}):null]})]})};i.render=function(){var e=this,t=this.props,n=t.channel,o=t.noiseCancellationSupported,i=t.shouldShowVoicePanelIntroduction;return null==n?null:(0,r.jsx)(c.yRy,{renderPopout:this.renderVoicePanelIntroduction,position:"top",align:"center",animation:c.yRy.Animation.TRANSLATE,shouldShow:i,children:function(){return(0,r.jsxs)("div",{className:Eae().container,children:[(0,r.jsxs)(uh.Z,{className:Eae().connection,align:uh.Z.Align.CENTER,children:[(0,r.jsx)("div",{className:Eae().inner,children:e.renderConnectionStatus()}),(0,r.jsxs)(uh.Z,{grow:0,shrink:0,children:[o?e.renderNoiseCancellation():null,(0,r.jsx)(Kie,{channel:n})]})]}),e.renderVoiceStates(),e.renderChannelButtons()]})}})} ;return o}(o.PureComponent);const Uae=(0,cX.Z)((function(e){var t,n,i=(0,Voe.Z)(),a=(0,s.e7)([rm.Z],(function(){return rm.Z.getAwaitingRemoteSessionInfo()})),l=(0,s.e7)([Y.default],(function(){return Y.default.getCurrentUser()})),u=(0,s.cj)([A.Z],(function(){return null!=i?{channelId:i.channelId,rtcConnectionQuality:M.IE4.FINE,rtcConnectionState:M.hes.RTC_CONNECTED,rtcConnectionLastPing:0}:{channelId:A.Z.getChannelId(),rtcConnectionQuality:A.Z.getQuality(),rtcConnectionState:A.Z.getState(),rtcConnectionLastPing:A.Z.getLastPing()}})),f=u.channelId,d=Sae(u,["channelId"]),p=(0,s.e7)([S.Z],(function(){return S.Z.getChannel(f)}),[f]),h=null==p?void 0:p.getGuildId(),E=(0,s.e7)([Zt.Z],(function(){return Zt.Z.getGuild(h)}),[h]),y=(0,s.cj)([Ye.Z],(function(){return{noiseCancellationSupported:Ye.Z.isNoiseCancellationSupported(),noiseCancellationActive:Ye.Z.getNoiseCancellation(),noiseCancellationError:Ye.Z.isNoiseCancellationError(),canGoLive:(0,xr.Z)(Ye.Z)}})),m=(0, s.e7)([Ye.Z,ud.Z],(function(){return ud.Z.hasHotspot(vr.v.VOICE_PANEL_INTRODUCTION)&&(0,lp.EO)(l)&&!Ye.Z.isInteractionRequired()&&!(null==p?void 0:p.isGuildStageVoice())})),b=(0,s.e7)([j.Z],(function(){return null!=f&&j.Z.hasVideo(f)}),[f]),g=(0,s.e7)([Pr.Z],(function(){return Pr.Z.getCurrentUserActiveStream()})),O=(0,s.e7)([T.Z],(function(){return T.Z.hasLayers()})),v=(0,s.e7)([vN.Z],(function(){return vN.Z.isViewingRoles(h)})),_=(0,s.e7)([dn.Z],(function(){return v&&!dn.Z.can(M.Plq.VIEW_CHANNEL,p)}),[v,p]),I=ct.Fg.useSetting(),N=Aae((0,s.Wu)([im.ZP,l_.Z],(function(){return(null==p?void 0:p.isGuildStageVoice())?[l_.Z.getMutableParticipants(p.id,u_.pV.SPEAKER),l_.Z.getParticipantsVersion(p.id),null]:[null,null,null!=p?im.ZP.getVoiceStatesForChannel(p):null]}),[p]),3),C=N[0],P=N[1],R=N[2],x=o.useMemo((function(){return null!==(n=null!==(t=null==C?void 0:C.map((function(e){return{user:e.user,nick:e.userNick,voiceState:e.voiceState}})))&&void 0!==t?t:R)&&void 0!==n?n:[] }),[C,P,R]),w=Aae(o.useState(!1),2),D=w[0],Z=w[1];o.useEffect((function(){(v||_)&&Z(!1)}),[v,_,Z]);var L=JL.ZP.useExperiment({guildId:null!=h?h:""},{autoTrackExposure:!0,trackExposureOptions:{location:Pf.Z.RTC_PANEL}}).allowSoundboard,U=(0,Dr.f)(),k=(0,Hw.Z)(Pf.Z.RTC_PANEL).AnalyticsLocationProvider,G=(0,Loe.Z)(null!=h?h:"",null==p?void 0:p.id),B=(0,Goe.Z)(null==p?void 0:p.id);return(0,r.jsx)(k,{children:(0,r.jsxs)("div",{className:Eae().wrapper,children:[null!=i||null!=a?(0,r.jsx)(Xoe,{voiceState:i,awaitingRemoteSessionInfo:a}):null,(0,r.jsx)(Lae,Iae(_ae({},e,y,d),{enableActivities:G,remoteVoiceState:i,guild:E,channel:p,hasVideo:b,selfStream:g,hasLayers:O,voiceStates:x,showVoiceStates:I,shouldShowVoicePanelIntroduction:m,canUseSoundboard:L&&U,isPrivateChannelWithEnabledActivities:B})),!D&&v&&null!=h?(0,r.jsxs)("div",{className:Eae().viewAsRolesWarning,children:[(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:Eae().viewAsRolesWarningText, children:_?Q.Z.Messages.VIEW_AS_ROLES_HIDDEN_VC_WARNING:Q.Z.Messages.VIEW_AS_ROLES_VOICE_WARNING}),(0,r.jsx)(c.zxk,{className:Eae().viewAsRolesWarningButton,size:c.zxk.Sizes.MIN,onClick:function(){Z(!0)},children:Q.Z.Messages.DISMISS})]}):null]})})}));var kae=n(399920),Gae=n.n(kae);function Bae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&e.startsWith("?")?e.split("?")[1]:null;return(0,r.jsx)(Zee,{searchRoute:t})}(e.location.search)}, impressionName:W.zs.GUILD_DISCOVERY,disableTrack:!0}),(0,r.jsx)(ub.Z,{path:M.Z5c.GUILD_MEMBER_VERIFICATION(":guildId",":inviteCode?"),render:Xae,impressionName:W.zs.GUILD_MEMBER_VERIFICATION,disableTrack:!0}),(0,r.jsx)(ub.Z,{path:M.Z5c.GUILD_MEMBER_VERIFICATION_FOR_HUB(":guildId",":inviteCode?"),render:Qae,impressionName:W.zs.HUB_EMAIL_SIGNUP,impressionProperties:function(e){return{has_invite:void 0!==e.computedMatch.params.inviteCode}}}),(0,r.jsx)(ub.Z,{path:M.Z5c.FEATURE(":feature"),exact:!0,render:rse,disableTrack:!0})]})})]})]})})]})})}const ase=n(549869).Z;var sse=n(597967);var cse=n(978868);function lse(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?i:null,className:qse().actionButton,popoutOpen:c,onCameraUnavailable:vie.Z,onChange:function(){d.default.selectVoiceChannel(n.id,!0);(0,K.XU)(M.ME,n.id)}})}}),(0,r.jsx)(zse.Z,{channel:n,color:"green",centerButton:!0,className:lh()(qse().actionButton,qse().last),onClick:function(){return d.default.selectVoiceChannel(n.id)}})]})}function lce(e){var t=e.animatedStyle,n=e.y,i=e.x,a=e.channel,l=nce(o.useState(!1),2),u=l[0],f=l[1],d=(0,kV.x)(a),p=(0,op.ZP)(a),h=nce((0,s.Wu)([Ye.Z],(function(){return[Ye.Z.supports(Ke.AN.VIDEO),Object.keys(Ye.Z.getVideoDevices()).length]})),2),E=h[0],y=h[1],m=(0,s.e7)([We.Z],(function(){return We.Z.isFocused()})),b=(0,s.e7)([fb.Z],(function(){return fb.Z.getMode(a.id)})),g=o.useCallback((function(e){null!=e.top&&null!=e.left&&Sse(e.left,e.top)}),[]),O=(0,mm.useSpring)({value:u?1:0,config:tce(ece({},mm.config.stiff),{clamp:!0})});o.useEffect((function(){ var e=function(e){e.keyCode===M.yXg.ESCAPE&&Ise.Z.stopRinging(a.id)};window.addEventListener("keydown",e);return function(){return window.removeEventListener("keydown",e)}}),[a]);var v=b===M.WtW.VIDEO&&E&&y>0,_=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Wse.Z,{className:qse().icon,ringing:m,src:null!=d?d:"",ringingType:Wse.Z.RingingType.INCOMING,size:u?c.EFr.SIZE_40:c.EFr.SIZE_80}),(0,r.jsxs)("div",{className:qse().titleGroup,children:[(0,r.jsx)(c.xvT,{className:qse().title,color:"header-primary",variant:u?"text-md/semibold":"text-lg/semibold",children:p}),(0,r.jsx)(c.xvT,{color:"header-secondary",className:qse().subtitle,variant:u?"text-sm/normal":"text-md/normal",children:b===M.WtW.VOICE?Q.Z.Messages.INCOMING_CALL_ELLIPSIS:Q.Z.Messages.INCOMING_VIDEO_CALL_ELLIPSIS})]})]}),I=v?rce:oce;return(0,r.jsx)(Bse,{className:qse().wrapper,selector:".".concat(qse().root),initialPosition:{left:i,top:n},maxX:window.innerWidth,maxY:window.innerHeight,onDragEnd:g,dragAnywhere:!0,children:(0, r.jsx)(r.Fragment,{children:(0,r.jsxs)(mm.animated.div,{className:lh()(qse().root,Qse().elevationHigh,Jse({},qse().previewCamera,u),u?(0,pV.Q)("dark"):null),style:tce(ece({},t),{width:O.value.interpolate([0,1],[I.width,ice]),minHeight:O.value.interpolate([0,1],[I.height,ace]),translateX:O.value.interpolate([0,1],[0,-1*Math.abs(ice-I.width)/2])}),children:[u?(0,r.jsx)(sce,{header:_}):(0,r.jsx)("div",{className:qse().mainChannelInfo,children:_}),(0,r.jsx)(cce,{canVideo:v,channel:a,numVideoDevices:y}),v&&!u?(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,fullWidth:!0,look:c.zxk.Looks.LINK,color:c.zxk.Colors.PRIMARY,className:qse().previewButton,onClick:function(){return f(!0)},children:Q.Z.Messages.INCOMING_CALL_PREVIEW_CAMERA}):null]})})})}var uce=n(669754),fce=n(292832);function dce(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function pce(e,t){t=null!=t?t:{} ;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var hce={transform:"scale(0.7)",opacity:0},Ece={transform:"scale(1)",opacity:1};const yce=function(){var e=(0,s.e7)([C.Z],(function(){return C.Z.getChannelId()})),t=(0,s.Wu)([Km],(function(){return Km.getIncomingCalls().filter((function(t){var n=t.channel;return e!==n.id}))})),n=(0,s.e7)([Km],(function(){return Km.hasIncomingCalls()})),i=(0,s.e7)([sp.Z],(function(){return sp.Z.isSoundDisabled("call_ringing")})),a=(0,s.e7)([Lr.Z],(function(){return Lr.Z.disableSounds})),c=(0,s.e7)([uce.Z],(function(){return uce.Z.getSoundpack()})),l=o.useRef(!1),u=(0, _se.Z)((function(){if(c===fce.YC.CLASSIC){var e=500===Wa().random(1,1e3)?"call_ringing_beat":"call_ringing";return(0,am.tu)(e,"call_ringing")}return(0,am.uk)("call_ringing",c)}),[c]);o.useEffect((function(){return function(){u.stop()}}),[u]);o.useEffect((function(){if(a||i){if(l.current){u.stop();l.current=!1}}else if(n&&!l.current){u.loop();l.current=!0}else if(!n&&l.current){u.stop();l.current=!1}}),[i,a,n,u]);var f=(0,mm.useTransition)(t,{keys:function(e){var t;return null===(t=e.channel)||void 0===t?void 0:t.id},enter:{from:hce,to:Ece},leave:hce,config:{mass:1,tension:500,friction:18,clamp:!0}});return f((function(e,t){return(0,r.jsx)(lce,pce(function(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Cce(e,t){return!t||"object"!==jce(t)&&"function"!=typeof t?function(e){ if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Pce(e,t){Pce=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Pce(e,t)}var jce=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Rce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Ice(e);if(t){var o=Ice(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Cce(this,n)}}var xce,Mce=(0,mi.Un)({createPromise:function(){return n.e(54313).then(n.bind(n,95581))},webpackId:95581,name:"UserSettings"}),wce=(0,mi.Un)({createPromise:function(){return Promise.all([n.e(40532),n.e(56054),n.e(97621)]).then(n.bind(n,27314))}, webpackId:27314,name:"ChannelSettings"}),Dce=(_ce(xce={},M.S9g.USER_SETTINGS,(function(){return(0,r.jsx)(Mce,{})})),_ce(xce,M.S9g.CHANNEL_SETTINGS,(function(){return(0,r.jsx)(wce,{})})),_ce(xce,M.S9g.GUILD_SETTINGS,(function(){return(0,r.jsx)(bce.Z,{})})),xce),Zce="SHOWN",Lce="HIDDEN",Uce={friction:10,tension:100};function kce(){o.useEffect((function(){rh.Z.enable();rh.Z.enableTemp(mce.u);return function(){return rh.Z.disableTemp()}}),[]);return null}var Gce=function(e){Sce(n,e);var t=Rce(n);function n(e){vce(this,n);var r;(r=t.call(this,e)).containerRef=o.createRef();var i=1,a=1;if(e.mode===Lce){i=.93;a=0}r.state={animating:!1,scale:new ji.Z.Value(i),opacity:new ji.Z.Value(a),mode:e.mode};return r}var i=n.prototype;i.componentDidUpdate=function(e){var t=this.props.mode,n=e.mode;if(t!==n)return t===Zce&&n===Lce?this.animateIn():t===Lce&&n===Zce?this.animateUnder():void 0};i.componentWillEnter=function(e){var t=this,n=this.state,r=n.opacity;n.scale.setValue(1.1);r.setValue(0);e() ;this.setState({animating:!0},(function(){return t.animateIn()}))};i.componentWillLeave=function(e){var t=this;this.setState({animating:!0},(function(){return t.animateOut(e)}))};i.animateIn=function(e){var t=this;s.ZP.Emitter.pause(500);var n=this.state,r=n.opacity,o=n.scale;ji.Z.parallel([ji.Z.spring(r,Tce({toValue:1},Uce)),ji.Z.spring(o,Tce({toValue:1},Uce))]).start((function(){return t.animateComplete(e)}))};i.animateOut=function(e){s.ZP.Emitter.pause(500);var t=this.state,n=t.opacity,r=t.scale;Yl.S.dispatch(M.CkL.LAYER_POP_START);ji.Z.parallel([ji.Z.spring(n,Tce({toValue:0},Uce)),ji.Z.spring(r,Tce({toValue:1.1},Uce))]).start((function(){e();Yl.S.dispatch(M.CkL.LAYER_POP_COMPLETE)}))};i.animateUnder=function(){var e=this;s.ZP.Emitter.pause(500);var t=this.state,n=t.opacity,r=t.scale;ji.Z.parallel([ji.Z.spring(n,Tce({toValue:0},Uce)),ji.Z.spring(r,Tce({toValue:.93},Uce))]).start((function(){return e.animateComplete()}))};i.animateComplete=function(e){this.setState({animating:!1},e)} ;i.render=function(){var e,t=this,n=this.state.animating,o=this.props,i=o.mode,a=o.children,s=o.baseLayer,l=Ace(o,["mode","children","baseLayer"]),u=n||i===Lce?this.getAnimatedStyle():null,f=(0,r.jsx)(ji.Z.div,Nce(Tce({ref:function(e){return t.containerRef.current=null!=e?e.refs.node:void 0},"aria-hidden":i===Lce,className:lh()(Oce().layer,(e={},_ce(e,Oce().baseLayer,s),_ce(e,Oce().animating,n),_ce(e,"stop-animations",i===Lce),e)),style:u},l),{children:a}));return s?f:(0,r.jsx)(c.EqS,{containerRef:this.containerRef,children:f})};i.getAnimatedStyle=function(){var e=this.state,t=e.opacity,n=e.scale;return{opacity:t,transform:this.context.reducedMotion.enabled?void 0:[{scale:n},{translateZ:0}]}};n.getDerivedStateFromProps=function(e,t){return e.mode!==t.mode?{animating:!0,mode:e.mode}:null};return n}(o.PureComponent);Gce.defaultProps={baseLayer:!1};Gce.contextType=LR.S;var Bce=function(e){Sce(n,e);var t=Rce(n);function n(){vce(this,n);return t.apply(this,arguments)}var o=n.prototype ;o.componentDidMount=function(){Yl.S.subscribe(M.CkL.LAYER_POP_ESCAPE_KEY,eh.xf)};o.componentWillUnmount=function(){Yl.S.unsubscribe(M.CkL.LAYER_POP_ESCAPE_KEY,eh.xf)};o.renderLayers=function(){var e=this,t=this.props,n=t.children,o=t.layers,i=t.hasFullScreenLayer,a=o.length,s=[];s.push((0,r.jsx)(Gce,{mode:0!==a||i?Lce:Zce,baseLayer:!0,children:n},"layer-base"));o.forEach((function(t,n){return s.push(e.renderComponent(t,n,a))}));return s};o.renderComponent=function(e,t,n){var o,i=t===n-1;o="string"==typeof e?Dce[e]():(0,r.jsx)(e,{});return(0,r.jsxs)(Gce,{mode:i?Zce:Lce,children:[(0,r.jsx)(kce,{}),o]},"layer-".concat(t))};o.renderArtisanalHack=function(){return(0,r.jsx)("div",{className:lh()(Oce().bg,(0,pV.Q)(this.props.sidebarTheme))})};o.render=function(){return(0,r.jsxs)(r.Fragment,{children:[this.renderArtisanalHack(),(0,r.jsx)(cJ.Z,{component:"div",className:lh()(Oce().layers,this.props.className),children:this.renderLayers()})]})};return n}(o.PureComponent);function Hce(e){ var t=(0,s.e7)([st.Z],(function(){return st.Z.darkSidebar}))?M.BRd.DARK:void 0,n=(0,s.e7)([T.Z],(function(){return T.Z.getLayers()})),o=(0,fE.QP)((function(e){return e.fullScreenLayers.length>0}));return(0,r.jsx)(Bce,Nce(Tce({},e),{sidebarTheme:t,layers:n,hasFullScreenLayer:o}))}var Vce=n(854735),Fce=n.n(Vce);function Yce(){var e=o.useRef(null),t=o.useCallback((function(t){var n=t.duration,r=t.intensity;if(!E.Z.useReducedMotion&&We.Z.isFocused()){var o=e.current;xh()(null!=o,"Shakeable is shaken when not mounted");o.shake(n,r)}}),[]);o.useEffect((function(){rh.Z.setLayout(ym.ZP);rh.Z.enable();return function(){return rh.Z.disable()}}),[]);o.useEffect((function(){Yl.S.subscribe(M.CkL.SHAKE_APP,t);return function(){Yl.S.unsubscribe(M.CkL.SHAKE_APP,t)}}),[t]);!function(){var e=(0,s.e7)([Km],(function(){return Km.hasIncomingCalls()})),t=(0,s.e7)([Cm.Z,Ja.Z,sp.Z],(function(){var e=Cm.Z.getTotalMentionCount(),t=Ja.Z.getPendingCount(),n=Cm.Z.hasAnyUnread(),r=sp.Z.getDisableUnreadBadge(),o=e+t ;0===o&&n&&!r&&(o=-1);return o}));o.useEffect((function(){if(e){var t=ss.default.bounceDock("critical"),n=(0,Am.EM)({messages:[Q.Z.Messages.INCOMING_CALL],count:50});return function(){null==t||t();n()}}}),[e]);o.useEffect((function(){Xm(t)}),[t]);o.useEffect((function(){return function(){return Xm(0)}}),[])}();return(0,r.jsxs)(c.F0h,{ref:e,className:Fce().app,children:[(0,r.jsx)(Hce,{className:Fce().layers,children:(0,r.jsx)(ise,{})}),(0,r.jsx)(cb,{}),(0,r.jsx)(Em,{}),(0,r.jsx)(vse,{}),(0,r.jsx)(_m.Z,{}),(0,r.jsx)(vm,{}),(0,r.jsx)(yce,{})]})}const zce=o.memo(Yce);var Wce=n(112184),Kce=n(219264),qce=n(313197),Xce=n(408481),Qce=n(502925),$ce=n.n(Qce);function Jce(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function ele(e){ele=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return ele(e)}function tle(e,t){return!t||"object"!==rle(t)&&"function"!=typeof t?function(e){ if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function nle(e,t){nle=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return nle(e,t)}var rle=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function ole(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=ele(e);if(t){var o=ele(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return tle(this,n)}}var ile=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&nle(e,t)}(n,e) ;var t=ole(n);function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var o,i;(o=t.call(this,e)).videoRef=null;o._noProblemsTimeout=null;o._problemsTimeout=null;o._connectedSound=o.createSound();o._loadingText=(i=[Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_1,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_2,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_3,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_4,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_5,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_6.format({tabHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"tab",className:$ce().keybind},t)}}),Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_7,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_8,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_9,Q.Z.Messages.ACCESSIBILITY_LOADING_TIP_10.format({F6Hook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"f6",className:$ce().keybind},t)},tabHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"tab",className:$ce().keybind},t)} }),Q.Z.Messages.LOADING_LINE_1,Q.Z.Messages.LOADING_LINE_2,Q.Z.Messages.LOADING_LINE_4,Q.Z.Messages.LOADING_LINE_5,Q.Z.Messages.LOADING_LINE_6,Q.Z.Messages.LOADING_LINE_7,Q.Z.Messages.LOADING_LINE_8,Q.Z.Messages.LOADING_LINE_9,Q.Z.Messages.LOADING_LINE_10,Q.Z.Messages.LOADING_LINE_11,Q.Z.Messages.LOADING_LINE_12,Q.Z.Messages.LOADING_LINE_13,Q.Z.Messages.LOADING_LINE_14,Q.Z.Messages.LOADING_LINE_15,Q.Z.Messages.LOADING_TIP_1,Q.Z.Messages.LOADING_TIP_2,Q.Z.Messages.LOADING_TIP_3,Q.Z.Messages.LOADING_TIP_4,Q.Z.Messages.LOADING_TIP_5,Q.Z.Messages.LOADING_TIP_6,Q.Z.Messages.LOADING_TIP_7,Q.Z.Messages.LOADING_TIP_8,Q.Z.Messages.LOADING_TIP_9,Q.Z.Messages.LOADING_TIP_10,Q.Z.Messages.LOADING_TIP_11,Q.Z.Messages.LOADING_TIP_12,Q.Z.Messages.LOADING_TIP_13,Q.Z.Messages.LOADING_TIP_14,Q.Z.Messages.LOADING_TIP_15,Q.Z.Messages.LOADING_TIP_16,Q.Z.Messages.LOADING_TIP_17,Q.Z.Messages.LOADING_TIP_18,Q.Z.Messages.LOADING_TIP_19,Q.Z.Messages.LOADING_TIP_20,Q.Z.Messages.LOADING_TIP_21,Q.Z.Messages.LOADING_TIP_22,Q.Z.Messages.LOADING_TIP_23,Q.Z.Messages.LOADING_TIP_24,Q.Z.Messages.LOADING_TIP_25,Q.Z.Messages.LOADING_TIP_26,Q.Z.Messages.LOADING_TIP_27.format({ asterisks:"**"}),Q.Z.Messages.LOADING_KEYBIND_TIP_1.format({quickSwitcherHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"mod+k",className:$ce().keybind},t)}}),Q.Z.Messages.LOADING_KEYBIND_TIP_2.format({markUnreadHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"alt+click",className:$ce().keybind},t)}}),Q.Z.Messages.LOADING_KEYBIND_TIP_3.format({markServerUnreadHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"shift+esc",className:$ce().keybind},t)}}),Q.Z.Messages.LOADING_KEYBIND_TIP_4.format({navigateUnreadHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"shift+alt+up",className:$ce().keybind},t)},downHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"down",className:$ce().keybind},t)}}),Q.Z.Messages.LOADING_KEYBIND_TIP_5.format({keyboardShortcutsHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"mod+/",className:$ce().keybind},t)}}),Q.Z.Messages.LOADING_KEYBIND_TIP_6.format({messageNewlineHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"shift+return", className:$ce().keybind},t)}}),Q.Z.Messages.LOADING_KEYBIND_TIP_7.format({shiftHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"shift",className:$ce().keybind},t)}}),Q.Z.Messages.LOADING_KEYBIND_TIP_8.format({upHook:function(e,t){return(0,r.jsx)(c.M2$,{shortcut:"up",className:$ce().keybind},t)}})])[Wa().random(i.length-1)];o.handleReady=function(){o.setState({ready:!0});if((0,Lt.nI)()){ss.default.send("UPDATED_QUOTES",["Hold Tight — Loading Discord"]);ss.default.send("UPDATE_OPEN_ON_STARTUP")}};o.setVideoRef=function(e){o.videoRef=e};o.setProblemsTimeout=function(){null==o._problemsTimeout&&(o._problemsTimeout=setTimeout((function(){return o.setState({problems:!0})}),1e4))};o.clearProblemsTimeout=function(){clearTimeout(o._problemsTimeout);o._problemsTimeout=null};var a=e.connected;o.state={ready:a,hide:a,problems:!1,shouldRender:!a,opacity:new ji.Z.Value(a?0:1)};o._connectedSound.volume=1;return o}var o=n.prototype;o.createSound=function(){var e=this.props.soundpack,t=(0, am.uk)("discodo",e);t.volume=1;return t};o.componentDidMount=function(){this.setProblemsTimeout()};o.componentDidUpdate=function(e,t){var n=this,r=this.state,o=r.ready,i=r.hide,a=r.problems,s=r.opacity,c=this.props,l=c.connected,u=c.soundpack,f=c.reducedMotion,d=l&&o&&!i&&!a;e.soundpack!==u&&(this._connectedSound=this.createSound());if(e.connected!==l||d)if(l&&null!=this.videoRef){var p=Math.max(Math.ceil(1e3*(this.videoRef.duration-this.videoRef.currentTime)),600);clearTimeout(this._noProblemsTimeout);_e.Z.get(M.wli)&&this._connectedSound.play();f?this.setState({problems:!1,hide:l}):this._noProblemsTimeout=setTimeout((function(){n.setState({problems:!1,hide:l})}),p)}else this.setState({problems:!1,hide:l});else if(t.hide!==i){i?this.clearProblemsTimeout():this.setProblemsTimeout();this.setState({shouldRender:!0});ji.Z.timing(s,{toValue:i?0:1,duration:200}).start((function(){return n.setState({shouldRender:!i})}))}else t.problems!==a&&a&&f1.Z.checkIncidents()} ;o.componentWillUnmount=function(){this.clearProblemsTimeout();clearTimeout(this._noProblemsTimeout)};o.render=function(){if(this.state.shouldRender){var e=this._loadingText,t=null;if(null!=this.props.incident){e=this.props.incident.name;t=this.props.incident.incident_updates[0].body}return(0,r.jsxs)(ji.Z.div,{className:$ce().container,style:{opacity:this.state.opacity},children:[(0,r.jsxs)("div",{className:$ce().content,children:[(0,r.jsx)(Xce.Z,{autoPlay:!0,loop:!this.props.connected,setRef:this.setVideoRef,onReady:this.handleReady,className:this.state.ready?$ce().ready:""}),(0,r.jsxs)("div",{className:$ce().text,children:[null!=this.props.incident?null:(0,r.jsx)("div",{className:$ce().tipTitle,children:Q.Z.Messages.LOADING_DID_YOU_KNOW}),(0,r.jsx)("div",{className:null!=this.props.incident?$ce().title:$ce().tip,children:e}),(0,r.jsx)("div",{className:$ce().body,children:t})]})]}),(0,r.jsxs)("div",{className:lh()($ce().problems,Jce({},$ce().slideIn,this.state.problems)),children:[(0, r.jsx)("div",{className:$ce().problemsText,children:Q.Z.Messages.CONNECTING_PROBLEMS_CTA}),(0,r.jsxs)("div",{children:[(0,r.jsxs)(c.eee,{className:$ce().twitterLink,href:(0,Wce.Z)(M.RK.TWITTER),target:"_blank",children:[(0,r.jsx)(qce.Z,{className:$ce().icon}),Q.Z.Messages.TWEET_US]}),(0,r.jsxs)(c.eee,{className:$ce().statusLink,href:M.yXt.STATUS,target:"_blank",children:[(0,r.jsx)(J0,{className:$ce().icon}),Q.Z.Messages.SERVER_STATUS]})]})]})]})}return null};return n}(o.PureComponent);const ale=s.ZP.connectStores([my.Z,Kce.Z,uce.Z,E.Z],(function(){return{isTryingToConnect:my.Z.isTryingToConnect(),connected:my.Z.isConnected(),incident:Kce.Z.getIncident(),soundpack:uce.Z.getSoundpack(),reducedMotion:E.Z.useReducedMotion}}))((function(e){var t=e.isTryingToConnect,n=e.connected,o=e.incident,i=e.soundpack,a=e.reducedMotion;return t?(0,r.jsx)(ile,{reducedMotion:a,soundpack:i,connected:n,incident:o}):null}));var sle=n(389740);n(705429);function cle(e,t){ if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lle(e){lle=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return lle(e)}function ule(e,t){return!t||"object"!==ple(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function fle(e,t){fle=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return fle(e,t)}var dle,ple=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function hle(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=lle(e);if(t){var o=lle(this).constructor;n=Reflect.construct(r,arguments,o) }else n=r.apply(this,arguments);return ule(this,n)}}var Ele=new Uu.V7,yle=3e5;function mle(){if(null!=dle){if(null!=R.ZP.getSelfEmbeddedActivityForChannel(dle)){Lg.Z.sendBotMessage(dle,Q.Z.Messages.BOT_CALL_IDLE_DISCONNECT);d.default.selectVoiceChannel(null)}}}var ble=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&fle(e,t)}(n,e);var t=hle(n);function n(){cle(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(j.Z)};r.__getLocalVars=function(){return{currentChannelId:dle,_timeout:Ele,IDLE_TIMEOUT:yle}};return n}(s.ZP.Store);ble.displayName="CallIdleStore";new ble(O.Z,{CONNECTION_CLOSED:function(){dle=null;Ele.stop()},VOICE_STATE_UPDATES:function(e){return e.voiceStates.reduce((function(e,t){if(null!=t.guildId)return e;var n=j.Z.getCurrentClientVoiceChannelId(null) ;if(null==n){Ele.stop();return e}if(1===im.ZP.countVoiceStatesForChannel(n)){dle=n;Ele.start(yle,mle,!1)}else Ele.stop();return e}),!1)},EMBEDDED_ACTIVITY_DISCONNECT:function(){(0,_o.lm)(dle)&&1===im.ZP.countVoiceStatesForChannel(dle)&&Ele.start(yle,mle,!0)}});n(600958),n(227172),n(412732),n(881532),n(242928);var gle=n(32162);function Ole(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vle(e){vle=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return vle(e)}function _le(e,t){return!t||"object"!==Sle(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ile(e,t){Ile=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Ile(e,t)}var Sle=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Tle(e){var t=function(){ if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=vle(e);if(t){var o=vle(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _le(this,n)}}var Nle=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Ile(e,t)}(n,e);var t=Tle(n);function n(){Ole(this,n);return t.apply(this,arguments)}n.prototype.__getLocalVars=function(){return{NOTIFICATION_ICON_SIZE:64}};return n}(s.ZP.Store);Nle.displayName="UserAchievementStore";new Nle(O.Z,{USER_ACHIEVEMENT_UPDATE:function(e){var t=e.userAchievement,n=t.application_id,r=t.achievement ;if(100===t.percent_complete&&null!=r){var o=Rn.Z.getGame(n),i=null!=o?o.getIconURL(64):null;gle.default.showNotification(i,r.name,r.description,{notif_type:"USER_ACHIEVEMENT_UPDATE"},{omitViewTracking:!0})}}});n(69660),n(647428),n(223219),n(825781),n(424127),n(367891),n(425187),n(502569),n(353049),n(996246),n(431187),n(849172),n(533404),n(423427),n(266909),n(588415),n(747820),n(82443);var Ale=n(264076);n(866893),n(572615),n(926578),n(955089),n(524600),n(883650);function Cle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ple(e){Ple=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Ple(e)}function jle(e,t){return!t||"object"!==xle(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Rle(e,t){Rle=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Rle(e,t)} var xle=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Mle(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Ple(e);if(t){var o=Ple(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return jle(this,n)}}var wle=288e5,Dle={};function Zle(e){if(null==e||e===M.ME||e===M.I_8)return!1;var t,n=null!==(t=Dle[e])&&void 0!==t?t:0;if(Date.now()<=n+wle)return!1;Dle[e]=Date.now();Ie.default.track(M.rMx.HIGHLIGHTS_TEST_LOADED,{guild_id:e})}var Lle=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}) ;t&&Rle(e,t)}(n,e);var t=Mle(n);function n(){Cle(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(e){this.waitFor(P.Z);null!=e&&(Dle=e.lastHighlightsLoadMillis)};r.getState=function(){return{lastHighlightsLoadMillis:Dle}};r.__getLocalVars=function(){return{FETCH_HIGHLIGHTS_THRESHOLD_MILLIS:wle,lastHighlightsLoadMillis:Dle}};return n}(s.ZP.PersistedStore);Lle.displayName="HighlightsTestStore";Lle.persistKey="HighlightsTestStore";new Lle(O.Z,{CONNECTION_OPEN:function(){return Zle(P.Z.getGuildId())},CHANNEL_SELECT:function(e){return Zle(e.guildId)}});var Ule=n(909647);function kle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gle(e){Gle=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Gle(e)}function Ble(e,t){return!t||"object"!==Vle(t)&&"function"!=typeof t?function(e){ if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Hle(e,t){Hle=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Hle(e,t)}var Vle=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Fle(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Gle(e);if(t){var o=Gle(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ble(this,n)}}var Yle={};function zle(e,t){var n=Yle[e];if(null==n)return!1;if(n.has(t))return!1;Yle[e]=new Set(n.add(t));return!0}var Wle=function(e){!function(e,t){ if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Hle(e,t)}(n,e);var t=Fle(n);function n(){kle(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(e){this.waitFor(Jn.default,Zt.Z);Yle={};null!=e&&Object.keys(e).forEach((function(t){var n=e[t];null!=n&&"function"==typeof n[Symbol.iterator]&&(Yle[t]=new Set(n))}))};r.getProgress=function(e){return Yle[e]};r.hasProgress=function(e){var t=Yle[e];return null!=t&&!t.has(Ule.Rg.DISMISSED)};r.getState=function(){return Yle};r.__getLocalVars=function(){return{guildProgress:Yle}};return n}(s.ZP.PersistedStore);Wle.displayName="GuildProgressStore";Wle.persistKey="GuildProgressStore";new Wle(O.Z,{CONNECTION_OPEN:function(){var e=[];Object.keys(Yle).forEach((function(t){Yle[t].has(Ule.Rg.COMPLETED)&&e.push(t)}));e.forEach((function(e){return zle(e,Ule.Rg.DISMISSED)}))}, GUILD_PROGRESS_INITIALIZE:function(e){var t=e.guildId;null==Yle[t]&&(Yle[t]=new Set);Yle[t].has(Ule.Rg.COMPLETED)||Yle[t].delete(Ule.Rg.DISMISSED)},GUILD_PROGRESS_COMPLETED_SEEN:function(e){var t=e.guildId;if(null==Yle[t])return!1;Yle[t]=new Set(Yle[t].add(Ule.Rg.COMPLETED))},GUILD_PROGRESS_DISMISS:function(e){return zle(e.guildId,Ule.Rg.DISMISSED)},GUILD_CREATE:function(e){var t=e.guild,n=t.id,r=t.member_count,o=Zt.Z.getGuild(n);if(null==o)return!1;if(o.ownerId===Jn.default.getId()&&null!=Yle[o.id]){null!=o.icon&&Yle[o.id].add(Ule.Rg.AVATAR);r>1&&Yle[o.id].add(Ule.Rg.INVITE)}},CHANNEL_CREATE:function(e){var t=e.channel;return null!=t&&null!=t.guild_id&&null!=Yle[t.guild_id]&&zle(t.guild_id,Ule.Rg.CHANNEL)},CHANNEL_UPDATES:function(e){var t=e.updates,n=!1,r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value.channel;null!=c&&null!=c.guild_id&&null!=Yle[c.guild_id]&&!1!==zle(c.guild_id,Ule.Rg.CHANNEL)&&(n=!0)}}catch(e){o=!0;i=e}finally{try{ r||null==s.return||s.return()}finally{if(o)throw i}}return n},GUILD_SETTINGS_SUBMIT_SUCCESS:function(e){var t=e.guild;return null!=t&&(null!=t.id&&null!=Yle[t.id]&&null!=t.icon&&zle(t.id,Ule.Rg.AVATAR))},MESSAGE_CREATE:function(e){var t=e.channelId,n=e.message,r=S.Z.getChannel(t);return n.author.id===Jn.default.getId()&&null!=r&&null!=Yle[r.guild_id]&&zle(r.guild_id,Ule.Rg.MESSAGE)},GUILD_MEMBER_LIST_UPDATE:function(e){var t=e.guildId,n=e.memberCount;return null!=Yle[t]&&n>1&&zle(t,Ule.Rg.INVITE)}});n(11879),n(832748),n(206932),n(833589);var Kle=n(994130),qle=n(978396),Xle=n(4798),Qle=n(649536);function $le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nho.Z.extractTimestamp(null==n?void 0:n.id)){var r=(0,Qle.e5)(t);if(null!=r){uue.latestChannelMessages[t.channel_id]=r;return!0}}return!1},CHANNEL_MESSAGE_PREVIEW_LOAD_MESSAGES:function(e){var t=e.messages;if(!(0,qle.cn)())return!1;var n=!0,r=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value;uue.latestChannelMessages[s.channel_id]=(0,Qle.e5)(s)}}catch(e){r=!0;o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}},LOAD_MESSAGES_SUCCESS:function(e){var t=e.messages;if(!(0,qle.cn)()||0===t.length)return!1;var n=(0,Qle.e5)(t[0]),r=uue.latestChannelMessages[n.getChannelId()];ho.Z.compare(n.id,null==r?void 0:r.id)>-1&&(uue.latestChannelMessages[n.getChannelId()]=n)},LOCAL_MESSAGES_LOADED:function(e){var t;if(!(0,qle.cn)()||0===e.messages.length)return!1;(0,Kle.Z)(e.messages) ;ho.Z.compare(e.messages[0].id,null===(t=uue.latestChannelMessages[e.channelId])||void 0===t?void 0:t.id)>0&&(uue.latestChannelMessages[e.channelId]=(0,Qle.e5)(e.messages[0]))},APP_STATE_UPDATE:function(e){var t=e.state;((0,Lt.Dt)()?M.$7l.BACKGROUND:M.$7l.INACTIVE)===t&&uue.connected&&pue.throttledAppStatePersist();return!1},WINDOW_FOCUS:function(e){e.focused||pue.throttledAppStatePersist();return!1},MESSAGE_DELETE:function(e){var t=e.id,n=e.channelId;if(!(0,qle.cn)())return!1;var r=uue.latestChannelMessages[n];if(null!=r&&r.id===t){delete uue.latestChannelMessages[n];var o=Lb.Z.getMessages(n).last();null!=o&&(uue.latestChannelMessages[n]=o)}}});n(858311),n(560837),n(877778),n(523649),n(798808),n(218086),n(78551),n(79308),n(359067),n(487685),n(29975),n(96483);function hue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Eue(e){Eue=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)} ;return Eue(e)}function yue(e,t){return!t||"object"!==bue(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function mue(e,t){mue=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return mue(e,t)}var bue=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function gue(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Eue(e);if(t){var o=Eue(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return yue(this,n)}}var Oue,vue="ActivityTrackingStore",_ue=18e5,Iue=3e5,Sue=null!==(Oue=_e.Z.get(vue))&&void 0!==Oue?Oue:{},Tue={},Nue=!1;function Aue(e){ var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t&&Cue(e,!0);var n=Tue[e.applicationId];if(null!=n){n.stop();delete Tue[e.applicationId]}delete Sue[e.applicationId];_e.Z.set(vue,Sue)}function Cue(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Date.now(),r=null!=e.updatedAt?n-e.updatedAt:0;r>21e5&&(r=0);vu.Z.updateActivity({applicationId:e.applicationId,distributor:e.isDiscordApplication?M.GQo.DISCORD:e.distributor,shareActivity:(0,u3.OT)(e.applicationId,Ln.Z),token:e.token,duration:Math.floor(r/1e3),closed:t});e.updatedAt=n;var o=Tue[e.applicationId];null==o&&(o=Tue[e.applicationId]=new Uu.Xp).start(_ue,(function(){return Cue(e)}));if(!t){Sue[e.applicationId]=e;_e.Z.set(vue,Sue)}}function Pue(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=ze.ZP.getRunningGames(),n=new Set,r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value,l=c.name,u=c.distributor,f=Rn.Z.getGameByName(l) ;if(null!=f){n.add(f.id);f.id in Sue||Cue({applicationId:f.id,updatedAt:Date.now(),distributor:u})}}}catch(e){o=!0;i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}var d=!0,p=!1,h=void 0;try{for(var E,y=Object.keys(Sue)[Symbol.iterator]();!(d=(E=y.next()).done);d=!0){var m=E.value;n.has(m)||Aue(Sue[m],e)}}catch(e){p=!0;h=e}finally{try{d||null==y.return||y.return()}finally{if(p)throw h}}}function jue(){var e=!0,t=!1,n=void 0;try{for(var r,o=Object.keys(Sue)[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;Aue(Sue[i])}}catch(e){t=!0;n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}Nue=!1}var Rue=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&mue(e,t)}(n,e);var t=gue(n);function n(){hue(this,n);return t.apply(this,arguments)}var r=n.prototype ;r.initialize=function(){this.waitFor(ze.ZP,lt.Z,Ln.Z);this.syncWith([lt.Z],Pue)};r.getActivities=function(){return Sue};r.__getLocalVars=function(){return{STORAGE_KEY:vue,ACTIVITY_WINDOW:_ue,ACTIVITY_WINDOW_GRACE_PERIOD:Iue,CLOSE_AUTHENTICATION_FAILED:4004,applicationActivities:Sue,applicationIntervals:Tue,hasUpdatedOnConnectionOpen:Nue}};return n}(s.ZP.Store);Rue.displayName="ActivityTrackingStore";new Rue(O.Z,{RUNNING_GAMES_CHANGE:function(){return Pue()},CONNECTION_OPEN:function(){if(Nue)return!1;var e=!0,t=!1,n=void 0;try{for(var r,o=Object.keys(Sue)[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;Cue(Sue[i])}}catch(e){t=!0;n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}Pue(!1);Nue=!0},CONNECTION_CLOSED:function(e){4004===e.code&&jue()},LOGOUT:jue,ACTIVITY_UPDATE_SUCCESS:function(e){var t=e.applicationId,n=e.token,r=Sue[t];if(null==r)return!1;r.token=n;_e.Z.set(vue,Sue)},ACTIVITY_UPDATE_FAIL:function(e){var t=e.applicationId,n=Sue[t] ;if(null==n)return!1;n.token=null;n.updatedAt=null;_e.Z.set(vue,Sue)}});n(711338),n(180172),n(8489),n(610773),n(82863),n(381186),n(592981),n(490989),n(996077),n(440031),n(213818),n(70321);function xue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mue(e,t){for(var n=0;nkue&&cs.Z.get({url:M.ANM.GUILD_AFFINITIES,oldFormErrors:!0}).then((function(e){var t=e.body.guild_affinities;O.Z.dispatch({type:"LOAD_GUILD_AFFINITIES_SUCCESS",guildAffinities:t})}),(function(){O.Z.dispatch({type:"LOAD_GUILD_AFFINITIES_FAILURE"})}));return!1},LOAD_GUILD_AFFINITIES_SUCCESS:function(e){var t=e.guildAffinities;Gue.guildAffinities=[];Gue.guildAffinitiesByGuildId={};Gue.lastFetched=Date.now();t.forEach((function(e,t){var n=e.affinity,r=e.guild_id,o={score:n,guildId:r,index:t} ;Gue.guildAffinitiesByGuildId[r]=o;Gue.guildAffinities.push(o)}))},LOGOUT:function(){Bue()}});n(984216),n(512291),n(746477),n(470758),n(869160),n(558095),n(279812),n(371689),n(977528),n(40134),n(66768),n(876296),n(107218),n(688013),n(107403),n(256727);function Vue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fue(e){Fue=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Fue(e)}function Yue(e,t){return!t||"object"!==Wue(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function zue(e,t){zue=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return zue(e,t)}var Wue=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Kue(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1 ;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Fue(e);if(t){var o=Fue(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Yue(this,n)}}function que(){return!0}var Xue=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&zue(e,t)}(n,e);var t=Kue(n);function n(){Vue(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(){this.waitFor(Ale.Z)};r.getExperimentAssignment=function(e,t){return Ale.Z.getGuildExperimentDescriptor(t,e)};r.__getLocalVars=function(){return{}};return n}(s.ZP.Store);Xue.displayName="GuildExperimentStore";new Xue(O.Z,{LOGOUT:que,LOGIN_SUCCESS:que,CONNECTION_OPEN:que, EXPERIMENTS_FETCH_SUCCESS:que,OVERLAY_INITIALIZE:que,CACHE_LOADED:que,EXPERIMENTS_FETCH_FAILURE:que,EXPERIMENT_REGISTER_LEGACY:que,EXPERIMENT_OVERRIDE_BUCKET:que});n(430091);n(727266);function Que(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";n.d(t,{HZ:()=>r, d$:()=>o,Of:()=>s});var r,o,i=n(213192),a=n.n(i);!function(e){e[e.OTHER=0]="OTHER";e[e.GIFTING_REFUND=1]="GIFTING_REFUND";e[e.BUYERS_REMORSE=2]="BUYERS_REMORSE";e[e.WRONG_PURCHASE=3]="WRONG_PURCHASE";e[e.FORGOT_TO_CANCEL=4]="FORGOT_TO_CANCEL";e[e.SERVER_BOOSTING_COOLDOWN=5]="SERVER_BOOSTING_COOLDOWN";e[e.USER_CONFUSION=6]="USER_CONFUSION";e[e.WANT_TO_SWITCH_TIERS=7]="WANT_TO_SWITCH_TIERS";e[e.DONT_NEED=8]="DONT_NEED"}(r||(r={}));!function(e){e[e.OTHER=0]="OTHER";e[e.ALREADY_REFUNDED=1]="ALREADY_REFUNDED";e[e.NOT_USER_REFUNDABLE_TYPE=2]="NOT_USER_REFUNDABLE_TYPE";e[e.PAST_REFUNDABLE_DATE=3]="PAST_REFUNDABLE_DATE";e[e.ENTITLEMENT_ALREADY_CONSUMED=4]="ENTITLEMENT_ALREADY_CONSUMED";e[e.ALREADY_REFUNDED_PREMIUM=5]="ALREADY_REFUNDED_PREMIUM";e[e.ALREADY_REFUNDED_PREMIUM_GUILD=6]="ALREADY_REFUNDED_PREMIUM_GUILD"}(o||(o={}));var s=Object.freeze(a()({Authorised:null,Error:null}))},415324:(e,t,n)=>{"use strict";n.d(t,{b:()=>s,Z:()=>c});var r=n(785893),o=(n(667294),n(707961)),i=n(473708) ;function a(e){switch(e){case"brl":return i.Z.Messages.BRL_NAME;case"pln":return i.Z.Messages.PLN_NAME;case"try":return i.Z.Messages.TRY_NAME;case"usd":return i.Z.Messages.USD_NAME;case"aud":return i.Z.Messages.AUD_NAME;case"pen":return i.Z.Messages.PEN_NAME;case"php":return i.Z.Messages.PHP_NAME;case"ars":return i.Z.Messages.ARS_NAME;case"cop":return i.Z.Messages.COP_NAME;case"clr":return i.Z.Messages.CLR_NAME;case"jpy":return i.Z.Messages.JPY_NAME;case"idr":return i.Z.Messages.IDR_NAME;case"vnd":return i.Z.Messages.VND_NAME;case"thb":return i.Z.Messages.THB_NAME;case"myr":return i.Z.Messages.MYR_NAME;case"krw":return i.Z.Messages.KRW_NAME;case"mxn":return i.Z.Messages.MXN_NAME;case"bgn":return i.Z.Messages.BGN_NAME;case"czk":return i.Z.Messages.CZK_NAME;case"dkk":return i.Z.Messages.DKK_NAME;case"huf":return i.Z.Messages.HUF_NAME;case"ron":return i.Z.Messages.RON_NAME;case"sek":return i.Z.Messages.SEK_NAME;case"eur":return i.Z.Messages.EUR_NAME;default:return""}}function s(e){ var t=e.currencies,n=e.className,o=e.children;return t.length<2?null:(0,r.jsx)("div",{className:n,children:o})}const c=function(e){var t=e.currencies,n=e.onChange,i=e.selectedCurrency,s=e.className,c=e.disabled,l=void 0!==c&&c;if(t.length<2)return null;var u=t.map((function(e,t){return{key:t,value:e,label:"".concat(e.toUpperCase()," - ").concat(a(e))}}));return(0,r.jsx)(o.q4e,{value:i,options:u,onChange:function(e){null!=e&&n(e)},className:s,isDisabled:l})}},794249:(e,t,n)=>{"use strict";n.d(t,{Z:()=>S});var r=n(785893),o=n(667294),i=n(294184),a=n.n(i),s=n(707961),c=n(283124),l=n(370521),u=n(107364),f=n(926696),d=n(264628),p=n(421281),h=n(473708),E=n(348909),y=n.n(E);function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var n=0;n{ "use strict";n.d(t,{Z:()=>yt});var r=n(785893),o=n(667294),i=n(294184),a=n.n(i),s=n(441143),c=n.n(s),l=n(457217),u=n(202351),f=n(707961),d=n(744564),p=n(673679),h=n(458922),E=n(810978),y=n(914964),m=n(169376),b=n(661123),g=n(370521),O=n(177774),v=n(54709),_=n(2590),I=n(203600);function S(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}const ee=o.forwardRef((function(e,t){var n=e.currentPageIndex,o=e.numPages,i=e.onChangePage,s=e.children,c=e.className,l=e.showPageCount,u=void 0===l||l,d=J(e,["currentPageIndex","numPages","onChangePage","children","className","showPageCount"]),p=n<=0,h=n>=o-1;return(0,r.jsxs)("div",$(function(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(Ke,{description:t.description,cost:(0,ve.T4)(c-s,u)}),(0,r.jsx)(Ke,{description:K.Z.Messages.BILLING_PAYMENT_BREAKDOWN_TAXES,cost:(0,ve.T4)(s,u)})]}):null,(0,r.jsx)(Ke,{description:K.Z.Messages.BILLING_PAYMENT_BREAKDOWN_TOTAL,cost:(0,ve.T4)(c,u)}),l>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ke,{description:K.Z.Messages.BILLING_PAYMENT_BREAKDOWN_REFUNDED,cost:(0,ve.T4)(l,u)}),(0,r.jsx)(Ke,{description:K.Z.Messages.BILLING_PAYMENT_BREAKDOWN_NET,cost:(0,ve.T4)(c-l,u)})]})]})]})} ;s.renderInvoiceDownload=function(){var e=this.props.payment;return null==e.downloadableInvoice||""===e.downloadableInvoice?null:(0,r.jsxs)("div",{className:Ce().downloadInvoice,children:[(0,r.jsx)(f.eee,{href:e.downloadableInvoice,children:K.Z.Messages.BILLING_DOWNLOAD_INVOICE}),null!=e.downloadableRefundInvoices?e.downloadableRefundInvoices.map((function(e,t){return(0,r.jsx)(f.eee,{className:Ce().downloadRefundInvoice,href:e,children:K.Z.Messages.BILLING_DOWNLOAD_REFUND_INVOICE},t)})):null]})};s.renderRefundDetails=function(){var e=this.props,t=e.locale,n=e.payment,i=this.validateRefundRules();if(i.includes(Fe.PAYMENT_GATEWAY)||i.includes(Fe.PAYMENT_STATUS)||i.includes(Fe.ALREADY_REFUNDED)||i.includes(Fe.SKU_STICKER_PACK)||i.includes(Fe.SUBSCRIPTION_TYPE))return null;var a,s=0===i.length,c=He(t),l=this.isPremium?5:14;a=i.includes(Fe.SKU_TYPE)?K.Z.Messages.BILLING_APPLICATION_CONSUMABLE_REFUND_TEXT_UNABLE.format({supportURL:c }):s?n.isPreorder&&this.isSkuPreorder?K.Z.Messages.BILLING_PREORDER_REFUND_TEXT.format({supportURL:c}):n.isPremiumSubscription||n.isPremiumGuildSubscription?K.Z.Messages.BILLING_PREMIUM_REFUND_TEXT.format({dateLimit:l,supportURL:c}):n.isGift?K.Z.Messages.BILLING_GIFT_REFUND_TEXT.format({dateLimit:l,supportURL:c}):K.Z.Messages.BILLING_APPLICATION_REFUND_TEXT.format({dateLimit:l,playtimeLimit:2,supportURL:c}):n.isGift?K.Z.Messages.BILLING_GIFT_REFUND_TEXT_UNABLE.format({dateLimit:l}):n.isPremiumSubscription||n.isPremiumGuildSubscription?K.Z.Messages.BILLING_PREMIUM_REFUND_TEXT_UNABLE.format({dateLimit:l}):K.Z.Messages.BILLING_APPLICATION_REFUND_TEXT_UNABLE.format({dateLimit:l,playtimeLimit:2});this.isPremium&&Se()&&(a=null);return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(f.H,{className:Ce().paymentHeader,children:K.Z.Messages.BILLING_REFUND_HEADER}),(0,r.jsxs)("div",{className:Ce().paymentText,children:[(0,r.jsx)("div",{children:a}),this.renderRefundActions(i)]})]})} ;s.renderRefundCriteria=function(e,t,n,o){return(0,r.jsxs)("div",{className:Ce().refundCriteria,children:[(0,r.jsx)(f.H,{className:Ce().refundSubHeader,children:e}),(0,r.jsxs)("div",{className:Ce().refundIconContainer,children:[(0,r.jsx)(t,{className:Ce().refundCriteriaIcon}),null!=n&&(0,r.jsx)("div",{children:n})]})]},o)};s.renderRefundActions=function(e){var t,o=this.props,i=o.locale,a=o.payment;if(this.isSkuPreorder||e.includes(Fe.SKU_TYPE))return null;var s,c=e.includes(Fe.PURCHASE_DATE)?me.Z:ye.Z,l=e.includes(Fe.TIME_PLAYED)||(null===(t=a.premiumRefundDisqualificationReasons)||void 0===t?void 0:t.includes(Te.d$.PAST_REFUNDABLE_DATE))?me.Z:ye.Z;if(!this.isPremium||!Se())return(0,r.jsxs)("div",{className:Ce().refundActions,children:[(0,r.jsxs)("div",{className:Ce().refundRules,children:[this.renderRefundCriteria(a.isPreorder?K.Z.Messages.BILLING_REFUND_RELEASE_DATE_SUBHEADER:K.Z.Messages.BILLING_REFUND_PURCHASE_DATE_SUBHEADER,c,K.Z.Messages.BILLING_REFUND_PURCHASE_DATE.format({ daysSincePurchase:this.daysSincePurchase})),a.isSubscription||a.isGift?null:this.renderRefundCriteria(K.Z.Messages.BILLING_REFUND_PLAY_TIME_SUBHEADER,l,null!=this.timePlayed?this.timePlayed.humanize():K.Z.Messages.BILLING_REFUND_PLAY_TIME_NEVER_PLAYED)]}),(0,r.jsx)(f.eee,{href:He(i),children:K.Z.Messages.BILLING_REFUND_REPORT_A_PROBLEM})]});var u=(null!==(s=a.premiumRefundDisqualificationReasons)&&void 0!==s?s:[Te.d$.OTHER])[0],d=null!=u||0!==e.length||a.isPurchasedExternally;return(0,r.jsxs)("div",{className:Ce().refundActions,children:[(0,r.jsx)(f.ua7,{shouldShow:d,text:Ye(u),children:function(e){return(0,r.jsx)(f.zxk,Ze(De({},e),{color:f.zxk.Colors.PRIMARY,disabled:d,onClick:function(){return(0,f.ZDy)(je((function(){var e,t;return Be(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(80099)]).then(n.bind(n,480099))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,De({payment:a,reportProblemUrl:He(i)},e))}]}}))})))}, children:K.Z.Messages.BILLING_REFUND_BUTTON_TEXT}))}}),(0,r.jsx)(f.eee,{href:He(i),children:K.Z.Messages.BILLING_REFUND_REPORT_A_PROBLEM})]})};s.renderDescription=function(){var e,t,n=this.props,i=n.compactMode,a=n.payment,s=n.application,l=n.stickerPack,u=this.state.expanded,d=a.sku,p=a.subscription,h=null!=a.paymentSource&&_.Uk1.has(a.paymentSource.type);if(null!=p&&0!==p.items.length){var E=[],y=null;if(p.type===_.NYc.PREMIUM)p.items.forEach((function(e){var t=e.planId,n=e.quantity;if((0,te.PV)(t)){E.push(te.ZP.getDisplayName(t,!1,h));y=I.GP[t].skuId}else{E.push("".concat(n>1?"".concat(n,"x "):"").concat(te.ZP.getDisplayName(t,!1,h)));null==y&&(y=I.GP[t].skuId)}}));else if(p.type===_.NYc.GUILD){var m=V.Z.get(p.items[0].planId);c()(null!=m,"Guild subscription plan should already have been loaded");var b=m.interval===I.rV.YEAR?K.Z.Messages.YEARLY_GUILD_SUBSCRIPTION:K.Z.Messages.MONTHLY_GUILD_SUBSCRIPTION;E.push(b.format({planName:m.name}));y=m.skuId }else if(p.type===_.NYc.APPLICATION){var g=V.Z.get(p.items[0].planId);c()(null!=g,"Application subscription plan should already have been loaded");null!=s?E.push(K.Z.Messages.MONTHLY_APPLICATION_SUBSCRIPTION_V2.format({tier:null==d?void 0:d.name})):E.push(K.Z.Messages.APPLICATION_SUBSCRIPTION_FROM_DELETED_APPLICATION);y=g.skuId}t=E.join(", ");e=(0,r.jsx)(pe.Z,{className:Ce().descriptionIcon,game:s,size:pe.Z.Sizes.XSMALL,skuId:y})}else if(null!=d){t=a.isPreorder?K.Z.Messages.PREORDER_SKU_NAME.format({name:d.name}):d.name;if(null!=l){var O=(0,ce.Zt)(l);e=(0,r.jsx)(le.ZP,{disableAnimation:!u,isInteracting:u,sticker:O,className:Ce().descriptionIcon,size:24})}else e=(0,r.jsx)(pe.Z,{className:Ce().descriptionIcon,game:s,size:pe.Z.Sizes.XSMALL,skuId:d.id})}else{e=(0,r.jsx)(ge.Z,{className:Ce().descriptionIcon});t=a.description}var v=(0,r.jsx)("div",{className:Ce().date,children:(0,Oe.vc)(ie()(a.createdAt),"MM/DD/YYYY")}),S=a.isGift?(0,r.jsx)(f.ua7,{ text:K.Z.Messages.BILLING_GIFT_PURCHASE_TOOLTIP,children:function(e){return(0,r.jsx)(be.Z,De({className:Ce().giftIcon},e))}}):null;return i?(0,r.jsxs)("div",{className:Ce().description,children:[e,(0,r.jsxs)("div",{children:[t,v]}),S]}):(0,r.jsxs)(o.Fragment,{children:[v,(0,r.jsxs)("div",{className:Ce().description,children:[e,(0,r.jsx)("div",{children:t}),S]})]})};s.renderExpandedSection=function(){return(0,r.jsx)(f.P3F,{onClick:function(e){return e.stopPropagation()},children:(0,r.jsxs)("div",{className:Ce().expandedInfo,children:[(0,r.jsx)(f.H,{className:Ce().paymentHeader,children:K.Z.Messages.BILLING_PURCHASE_DETAILS_HEADER}),this.renderPaymentBreakdown(),this.renderInvoiceDownload(),this.renderRefundDetails()]})})};s.render=function(){var e=this,t=this.props,n=t.payment,o=t.className,i=t.compactMode,s=this.state.expanded;return(0,r.jsx)(l.mh,{id:n.id,children:function(t){return(0,r.jsxs)(f.P3F,Ze(De({onClick:e.handleExpandInfo, className:a()(s?Ce().payment:Ce().hoverablePayment,o,Me({},Ce().compact,i)),focusProps:{offset:4}},t),{children:[(0,r.jsxs)(Y.Z,{className:Ce().summaryInfo,align:Y.Z.Align.CENTER,children:[e.renderDescription(),(0,r.jsxs)("div",{className:Ce().amount,children:[e.renderStatus(),e.renderPrice()]}),(0,r.jsx)(Ee.Z,{className:Ce().expand,direction:s?Ee.Z.Directions.UP:Ee.Z.Directions.DOWN})]}),s?e.renderExpandedSection():null]}))}})};!function(e,t,n){t&&xe(e.prototype,t);n&&xe(e,n)}(i,[{key:"timePlayed",get:function(){var e=this.props.applicationStatistics;return null!=e&&null!=e.total_discord_sku_duration?ie().duration(e.total_discord_sku_duration,"seconds"):null}},{key:"daysSincePurchase",get:function(){var e=this.props.payment,t=null!=e.sku?e.sku.releaseDate:null,n=null!=t&&t.isAfter(e.createdAt)?t:e.createdAt;return ie()().diff(n,"days")}},{key:"isSkuPreorder",get:function(){var e=this.props.payment;return null!=e.sku&&e.sku.isPreorder()}},{key:"isPremium",get:function(){ var e=this.props.payment;return e.isPremiumSubscription||e.isPremiumGuildSubscription||e.isPremiumGift}},{key:"typeString",get:function(){var e=this.props.payment.paymentSource;return e instanceof g.qo?he.ZP.Types.PAYPAL:e instanceof g.dm?he.ZP.getType(e.brand):he.ZP.Types.UNKNOWN}}]);return i}(o.PureComponent);qe.defaultProps={compactMode:!1};function Xe(e){var t,n,i=e.payment,a=e.locale,s=e.compactMode,c=e.className,l=null!=i.sku&&Ve.includes(i.sku.type)?i.sku.applicationId:null,f=null===(t=i.sku)||void 0===t?void 0:t.applicationId,d=(null===(n=i.subscription)||void 0===n?void 0:n.type)===_.NYc.APPLICATION,p=(0,u.cj)([de.Z,ue.Z,fe.Z],(function(){return{applicationStatistics:null!=l?de.Z.getCurrentUserStatisticsForApplication(l):null,gameApplication:null!=l?ue.Z.getGame(l):null,paymentSources:fe.Z.paymentSources}})),h=p.applicationStatistics,E=p.gameApplication,y=p.paymentSources,m=(0,u.e7)([se.Z],(function(){return null!=f?se.Z.getApplication(f):null}));o.useEffect((function(){ d&&null!=f&&(0,ae.i6)(f)}),[f,d]);return(0,r.jsx)(qe,{applicationStatistics:h,application:d?m:E,stickerPack:null,paymentSources:y,locale:a,compactMode:s,className:c,payment:i})}var Qe=n(288436),$e=n.n(Qe);function Je(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function st(e,t){return!t||"object"!==ut(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ct(e,t){ct=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return ct(e,t)}function lt(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Je(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n) ;if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Je(e,t)}(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.")}()}var ut=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function ft(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=rt(e);if(t){var o=rt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return st(this,n)}}var dt=10;function pt(e){var t=e.payments,n=e.locale,i=e.compactMode,s=e.numPages,c=o.useRef(null),u=lt(o.useState(0),2),d=u[0],h=u[1],E=lt(o.useState(null),2),m=E[0],b=E[1],g=t.slice(d*dt,(d+1)*dt) ;o.useEffect((function(){var e;null===(e=c.current)||void 0===e||e.scrollTo({to:0})}),[d]);var O=o.useCallback((function(e){h(e);var n=t[t.length-1].id;if(e===s-1&&m!==n){(0,p.cQ)(dt,n);b(n)}}),[t,s,m]),v=(0,y.Z)("billing-history",c);return(0,r.jsx)(l.bG,{navigator:v,children:(0,r.jsx)(l.SJ,{children:function(e){var t=e.ref,o=at(e,["ref"]);return(0,r.jsx)(ee,it(ot({className:a()($e().verticalFit,$e().paginator),currentPageIndex:d,onChangePage:O,numPages:s,ref:t},o),{children:(0,r.jsx)(f.Den,{className:$e().bottomDivider,ref:c,children:g.map((function(e,t){return(0,r.jsx)(Xe,{className:a()($e().paymentRow,$e().bottomDivider),payment:e,locale:n,compactMode:i},t)}))})}))}})})}var ht=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&ct(e,t)}(n,e);var t=ft(n);function n(){et(this,n);var e ;(e=t.apply(this,arguments)).scrollerRef=o.createRef();return e}var i=n.prototype;i.componentDidMount=function(){d.Z.wait((function(){(0,h.N)();(0,p.cQ)(20)}))};i.renderPremiumExternalSubscription=function(e){c()(null!=e.paymentGateway,"Expected payment gateway when rendering for external subscription");return(0,r.jsxs)(f.Zbd,{className:$e().externalRow,children:[(0,r.jsx)("div",{className:$e().externalRowHeader,children:K.Z.Messages.BILLING_EXTERNAL_HEADER.format({paymentGatewayName:Ne.Vz[e.paymentGateway]})}),(0,r.jsx)("div",{className:$e().externalRowBody,children:K.Z.Messages.BILLING_EXTERNAL_DESCRIPTION.format({paymentGatewayName:Ne.Vz[e.paymentGateway],billingHistoryLink:(0,te.JE)(e.paymentGateway,"BILLING_HISTORY")})})]})};i.render=function(){var e=this.props,t=e.compactMode,n=e.payments,o=e.subscription,i=e.locale,s=null!=o&&o.isPurchasedExternally;return 0!==n.length||s?(0,r.jsxs)("div",{className:$e().verticalFit, children:[null!=o&&s?this.renderPremiumExternalSubscription(o):null,n.length>0?(0,r.jsxs)("div",{className:a()($e().paymentPane,$e().verticalFit),children:[t?null:(0,r.jsx)("div",{className:a()($e().paymentRow,$e().bottomDivider),children:(0,r.jsxs)(Y.Z,{className:$e().paymentRowHeader,children:[(0,r.jsx)("div",{className:Ce().date,children:K.Z.Messages.BILLING_PAYMENT_TABLE_HEADER_DATE}),(0,r.jsx)("div",{className:$e().paymentRowHeaderDescription,children:K.Z.Messages.BILLING_PAYMENT_TABLE_HEADER_DESCRIPTION}),(0,r.jsx)("div",{className:Ce().amount,children:K.Z.Messages.BILLING_PAYMENT_TABLE_HEADER_AMOUNT})]})}),(0,r.jsx)(pt,{compactMode:t,locale:i,payments:n,numPages:this.numPages})]}):null]}):null};!function(e,t,n){t&&tt(e.prototype,t);n&&tt(e,n)}(n,[{key:"numPages",get:function(){return Math.max(Math.ceil(this.props.payments.length/dt),1)}}]);return n}(o.PureComponent);ht.defaultProps={compactMode:!1};function Et(e){ var t,n=e.skuId,r=null===(t=e.subscription)||void 0===t?void 0:t.items[0].planId;return!(null==n||null==r||Object.values(I.Si).includes(n)||(0,te.PV)(r))}function yt(e){var t=(0,u.e7)([H],(function(){return H.getPayments()})),n=(0,u.e7)([F.Z],(function(){return F.Z.getPremiumTypeSubscription()})),i=o.useMemo((function(){return new Set(t.filter(Et).map((function(e){var t=e.subscription;return null==t?void 0:t.items[0].planId})))}),[t]),a=o.useMemo((function(){return new Set(t.filter(Et).map((function(e){return e.skuId})))}),[t]),s=(0,u.Wu)([V.Z],(function(){return V.Z.getPlanIdsForSkus(Array.from(a))})),c=o.useCallback((function(){return s.length===i.size}),[s,i]);o.useEffect((function(){c()||d.Z.wait((function(){a.forEach((function(e){return(0,E.GZ)(e,void 0,void 0,!0,void 0)}))}))}),[c,a]);return(0,r.jsx)(ht,it(ot({},e),{payments:c()?t:[],subscription:n}))}},176785:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(785893),o=(n(667294), n(294184)),i=n.n(o),a=n(707961),s=n(74535),c=n(265688),l=n(419087),u=n(652591),f=n(2590),d=n(91019),p=n.n(d);const h=function(e){var t=e.disabled,n=void 0!==t&&t,o=e.type,d=e.className,h=e.innerClassName,E=e.onConnect,y=(0,s.ZP)(),m=c.Z.get(o);return(0,r.jsx)(a.ua7,{text:m.name,children:function(e){var t=e.onMouseEnter,s=e.onMouseLeave;return(0,r.jsx)("div",{className:i()(p().wrapper,d),children:(0,r.jsx)(a.tEY,{children:(0,r.jsx)("button",{onMouseEnter:t,onMouseLeave:s,className:i()(p().inner,h),type:"button",disabled:n,style:{backgroundImage:"url('".concat(y===f.BRd.DARK?m.icon.darkSVG:m.icon.lightSVG,"')")},onClick:null!=E?E:function(){return function(e){var t=c.Z.get(e);(0,l.Z)(t.type,"Friends List");u.default.track(f.rMx.ACCOUNT_LINK_STEP,{previous_step:"desktop connections",current_step:"desktop oauth",platform_type:t.type})}(o)},"aria-label":m.name})})})}})}},322837:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(667294),o=n(178598),i=n(306472),a=n(120415);function s(e,t){ if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e){c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return c(e)}function l(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e,t){u=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return u(e,t)}var f=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var o=c(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments) ;return l(this,n)}}var p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&u(e,t)}(n,e);var t=d(n);function n(){s(this,n);var e;(e=t.apply(this,arguments)).handleFileDownload=function(t){t.preventDefault();var n=e.getFileContents(),r=e.props,o=r.fileName,i=r.onDownload;a.FB?e.downloadNative(n,o):e.downloadHtml5(n,o);null==i||i()};return e}var c=n.prototype;c.getFileContents=function(){var e=this.props.fileContents;"function"==typeof e&&(e=e());return e};c.downloadNative=function(e,t){i.Z.fileManager.saveWithDialog(e,t)};c.downloadHtml5=function(e,t){var n=new Blob([e],{type:this.props.contentType});(0,o.saveAs)(n,t)};c.render=function(){var e=this.props.children,t=r.Children.only(e);return r.cloneElement(t,{onClick:this.handleFileDownload})};return n}(r.Component)},164045:(e,t,n)=>{"use strict";n.d(t,{ Z:()=>re});var r=n(785893),o=n(667294),i=n(427537),a=n.n(i),s=n(717187),c=n.n(s),l=n(120415),u=n(310126),f=n(79251),d=n(2590);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;return(0,r.jsx)(j.tEY,{focusTarget:this._inputRef,ringTarget:this._containerRef,children:(0,r.jsx)("div",{onClick:this.handleClick,onMouseDown:this.handleMouseDown,ref:this._containerRef,className:T()(w().container,F[o],(c={},Z(c,w().hasValue,l),Z(c,w().disabled,a),c)),children:(0,r.jsxs)(R.Z,{className:w().layout,children:[(0,r.jsx)(R.Z.Child,{className:w().input,children:(0,r.jsx)("input",{id:this._inputId,placeholder:x.Z.Messages.SHORTCUT_RECORDER_NO_BIND,type:"text",ref:this.setInputRef,readOnly:!0,value:s,disabled:this.props.mode!==G.RECORDING||a})}),(0,r.jsx)(R.Z,{shrink:1,grow:0,style:{margin:0},children:(0,r.jsxs)(j.zxk,{className:w().button,disabled:a,onClick:function(e){e.stopPropagation();e.preventDefault();t.handleClick(e)},size:j.zxk.Sizes.MIN,color:j.Ttl.PRIMARY,children:[(0, r.jsx)("span",{className:w().text,children:e}),(0,r.jsx)("span",{className:w().editIcon})]})})]})})})};return n}(o.PureComponent);const z=Y;function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&r.handleComboChange(e);r.recordEnd()};var o=e.defaultValue;r.state={codes:o,mode:G.DEFAULT};return r}var o=n.prototype;o.componentDidMount=function(){this._mounted=!0};o.componentWillUnmount=function(){this._mounted=!1;this.cleanUp()} ;o.componentDidUpdate=function(e){this.props.defaultValue!==e.defaultValue&&this.setState({codes:this.props.defaultValue})};o.cleanUp=function(){if(l.FB&&null!=this.gs){this.gs.destroy();this.gs=null}};o.handleComboChange=function(e){var t=this.state.mode,n=this.props.onChange;if(t===G.RECORDING){null!=n&&n(e);this.setState({codes:e})}};o.render=function(){var e,t,n=this.state,o=n.codes,i=n.mode,a=this.props.disabled;if(ne){t=u.default.getDiscordUtils().inputCaptureRegisterElement;e=this.handleNativeChange}else l.FB||(e=this.handleComboKeys);return(0,r.jsx)(z,{disabled:a,value:o,mode:i,onClick:this.toggleRecordMode,onChange:e,registerNativeRecorder:t,disableOnClickWhileRecording:ne})};return n}(o.PureComponent)},342147:(e,t,n)=>{"use strict";n.d(t,{D2:()=>c,SE:()=>l});var r=n(202351),o=n(260561),i=n(682776),a=n(2590),s=(0,o.B)({kind:"guild",id:"2022-11_default_disable_mass_mention",label:"Disable mass mentions for communities by default",defaultConfig:{enabled:!1},treatments:[{id:1, label:"Enabled",config:{enabled:!0}}]});function c(e){return s.useExperiment({guildId:e},{autoTrackExposure:!0})}function l(e){var t,n=(0,r.e7)([i.Z],(function(){return i.Z.can(a.Plq.MANAGE_GUILD,e)})),o=s.useExperiment({guildId:null!==(t=null==e?void 0:e.id)&&void 0!==t?t:""},{autoTrackExposure:!0}).enabled;if(null==e)return!1;var c=e.hasFeature(a.oNc.COMMUNITY);return n&&c&&o}},540825:(e,t,n)=>{"use strict";n.d(t,{n:()=>o});var r=(0,n(260561).B)({kind:"user",id:"2022-05_safety_coms_update",label:"Safety Integrity Platform Coms Update",defaultConfig:{enabled:!1,forceConfirmationOnAccept:!1},treatments:[{id:1,label:"Enabled",config:{enabled:!0,forceConfirmationOnAccept:!1}}]});function o(){return r.useExperiment({}).enabled}},145800:(e,t,n)=>{"use strict";n.d(t,{Zh:()=>o,e6:()=>i,iq:()=>a,M9:()=>s});var r=n(813216),o=null!=window.speechSynthesis;function i(e,t){var n=e.replace(/(https?:\/\/[^\s]+)/g,(function(e){var t=e.match(/^https?:\/\/(?:www\.)?([^/?#]+)(?:[/?#]|$)/i) ;return null!=t?t[1]:""}));null!=t&&n.length>t&&(n=(n=n.substring(0,t)).substring(0,Math.min(n.length,n.lastIndexOf(" "))));var o=new SpeechSynthesisUtterance(n);o.rate=r.Z.speechRate;return o}function a(e,t){if(o){e.voice=t;speechSynthesis.speak(e)}}function s(){o&&speechSynthesis.cancel()}},863715:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(0,n(260561).B)({kind:"user",id:"2022-05_role_styles_setting",label:"Role Styles Setting",defaultConfig:{allowRoleStyles:!1},treatments:[{id:1,label:"Allow Role Styles Setting",config:{allowRoleStyles:!0}}]})},122012:(e,t,n)=>{"use strict";n.d(t,{d:()=>o,Y$:()=>i,jS:()=>a,tZ:()=>s,a8:()=>c});var r=n(744564);function o(){r.Z.dispatch({type:"DEVELOPER_ACTIVITY_SHELF_TOGGLE_ENABLED"})}function i(){r.Z.dispatch({type:"DEVELOPER_ACTIVITY_SHELF_TOGGLE_USE_ACTIVITY_URL_OVERRIDE"})}function a(e){r.Z.dispatch({type:"DEVELOPER_ACTIVITY_SHELF_SET_ACTIVITY_URL_OVERRIDE",activityUrlOverride:e})}function s(e){r.Z.dispatch({ type:"DEVELOPER_ACTIVITY_SHELF_MARK_ACTIVITY_USED",applicationId:e,timestamp:(new Date).getTime()})}function c(e){r.Z.dispatch({type:"DEVELOPER_ACTIVITY_SHELF_UPDATE_FILTER",filter:e})}},649222:(e,t,n)=>{"use strict";n.r(t);n.d(t,{ACTIVITY_ENCOURAGES_HW_ACCELERATION:()=>O,default:()=>v});var r=n(785893),o=n(667294),i=n(707961),a=n(944010),s=n(28661),c=n(107364),l=n(652591),u=n(310126),f=n(2590),d=n(473708),p=n(743140),h=n.n(p);function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function g(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1) ;"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}(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.")}()}var O="Activity Encourages Hardware Acceleration";function v(e){var t,n=e.applicationId,p=b(e,["applicationId"]),E=g(o.useState(!1),2),v=E[0],_=E[1],I=g((0,s.Z)([n]),1)[0],S=null!==(t=null==I?void 0:I.name)&&void 0!==t?t:"This Activity";o.useEffect((function(){l.default.track(f.rMx.OPEN_MODAL,{type:O})}),[]);var T=function(){var e="temporary";if(v){e="permanent";a.ZP.updatedUnsyncedSettings({disableActivityHardwareAccelerationPrompt:!0})}l.default.track(f.rMx.MODAL_DISMISSED,{type:O,dismiss_type:e});p.onClose()};return(0,r.jsxs)(i.Y0X,m(function(e){for(var t=1;t{"use strict";n.d(t,{mN:()=>a,qV:()=>s,qq:()=>c,C8:()=>l});var r=n(744564),o=(n(784426),n(652591)),i=n(2590);function a(e){o.default.track(i.rMx.OPEN_MODAL,{type:"Enter Your Birthday",source:{section:e}});r.Z.dispatch({type:"AGE_GATE_MODAL_OPEN",source:e})}function s(){r.Z.wait((function(){return r.Z.dispatch({type:"AGE_GATE_MODAL_CLOSE"})}))}function c(){r.Z.wait((function(){r.Z.dispatch({type:"AGE_GATE_SUCCESS_MODAL_OPEN"})}))}function l(e){r.Z.wait((function(){r.Z.dispatch({ type:"AGE_GATE_FAILURE_MODAL_OPEN",underageMessage:e})}))}},549869:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});function r(){return{}}},926543:(e,t,n)=>{"use strict";n.d(t,{M:()=>c,Z:()=>l});var r=n(785893),o=(n(667294),n(751615)),i=n(80783),a=n(2590),s=n(199790);function c(){var e=location.pathname+location.search;return s.a?a.Z5c.REGISTER:(0,i.U)(e,!1)}const l=function(){return(0,r.jsx)(o.l_,{to:c()})}},61200:(e,t,n)=>{"use strict";n.d(t,{e:()=>u});var r=n(785893),o=(n(667294),n(736818)),i=n(130585),a=n(926543),s=n(2590);function c(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function l(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{passProps:!0},f=function(n){return!(0,i.$8)()&&o.default.getLoginStatus()!==s.u34.LOGGING_IN&&o.default.allowLogoutRedirect()?null!=t?(0,r.jsx)(t,{renderRedirect:(0,r.jsx)(a.Z,{})}):(0,r.jsx)(a.Z,{}):(0,r.jsx)(e,l({},u.passProps?n:null))};f.displayName="Authenticated(".concat(null!==(c=null!==(n=e.displayName)&&void 0!==n?n:e.name)&&void 0!==c?c:"",")");return f}},710965:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(667294),o=n(402391);function i(e){r.useEffect((function(){if(null!=e){o.Z.lockChangeLog(e);return function(){o.Z.unlockChangeLog(e)}}}),[e])}},584656:(e,t,n)=>{"use strict";n.d(t,{N:()=>a,I:()=>s});var r=n(667294),o=n(260561),i=n(769321),a=(0,o.B)({kind:"user",id:"2022-01_discovery_iar",label:"Ability to report servers in Server Discovery",defaultConfig:{canSeeInAppReportingButtons:!1},treatments:[{id:1,label:"Show IAR buttons in Server Discovery",config:{canSeeInAppReportingButtons:!0}}]}) ;function s(){var e=a.useExperiment({}).canSeeInAppReportingButtons,t=i.Sb.useSetting(),n=e||t;r.useEffect((function(){a.trackExposure({})}),[]);return n}},473444:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>E,GuildDiscoveryMenuPopout:()=>y});var r=n(785893),o=(n(667294),n(202351)),i=n(707961),a=n(971402),s=n(112897),c=n(424871),l=n(567403),u=n(682776),f=n(528334),d=n(584656),p=n(2590),h=n(473708);function E(e){var t=e.guild,n=e.shiftId,E=e.onSelect,y=e.closePopout,m=e["aria-label"],b=(0,s.Z)(t.id,n,void 0,y),g=(0,o.e7)([l.Z],(function(){return l.Z.getGuild(t.id)}),[t.id]),O=(0,o.e7)([u.Z],(function(){return u.Z.can(p.Plq.ADMINISTRATOR,g)})),v=d.N.useExperiment({}).canSeeInAppReportingButtons;return(0,r.jsxs)(i.v2r,{onSelect:E,navId:"guild-discovery-context-menu","aria-label":null!=m?m:h.Z.Messages.GENERIC_ACTIONS_MENU_LABEL,onClose:a.Zy,children:[(0,r.jsx)(i.kSQ,{children:!O&&v?(0,r.jsx)(i.sNh,{id:"report-guild-discovery-listing",label:h.Z.Messages.REPORT_SERVER_NO_NAME, action:function(){(0,c.lt)(t);!function(){(0,a.Zy)();null==y||y()}()},icon:f.Z,color:"danger"}):null}),(0,r.jsx)(i.kSQ,{children:b})]})}var y=function(e){var t=e.guild,n=e.children,o=e.onRequestOpen,a=e.onRequestClose;return(0,r.jsx)(i.yRy,{onRequestOpen:o,onRequestClose:a,animation:i.yRy.Animation.NONE,position:"bottom",spacing:4,align:"right",renderPopout:function(e){var n=e.closePopout;return(0,r.jsx)(E,{guild:t,closePopout:n})},children:n})}},520330:(e,t,n)=>{"use strict";n.d(t,{o1:()=>I,L1:()=>S,ZP:()=>T});var r=n(785893),o=n(667294),i=n(202351),a=n(707961),s=n(744564),c=n(498442),l=n(443812),u=n(618887),f=n(99827),d=n(293078),p=n(473708),h=n(232862),E=n.n(h);function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0,o=1===C.length;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.xBx,{separator:!1,className:E().headerContainer,children:[(0,r.jsx)("div",{className:E().dropArt}),(0,r.jsx)(a.X6q,{variant:"heading-lg/semibold",children:p.Z.Messages.OUTBOUND_PROMOTION_REDEMPTION_MODAL_TITLE})]}),(0,r.jsxs)(a.hzk,{children:[(0,r.jsx)(a.xvT,{variant:"text-md/normal",className:E().dropBodyText,children:o?p.Z.Messages.DROPS_MODAL_CHOOSE_SINGLE_PLATFORM.format({platform:(0,d.Un)(C[0])}):p.Z.Messages.DROPS_MODAL_CHOOSE_PLATFORM.format({title:h.title})}),(0,r.jsx)(a.$i$,{className:E().formDivider}),(0,r.jsxs)(a.hjN,{className:E().dropFormSection,children:[(0,r.jsx)(a.q4e,{onChange:A,options:C.map((function(e){return{value:e,label:(0,d.Un)(e)}})),value:o?C[0]:N,isDisabled:!e, className:e?"":E().selectDangerBorder,look:e?a.qQH.FILLED:a.qQH.CUSTOM}),!e&&(0,r.jsx)(a.xvT,{variant:"text-sm/medium",color:"text-danger",className:E().errorCodesText,children:p.Z.Messages.DROPS_CODES_RAN_OUT})]})]}),(0,r.jsxs)(a.mzw,{children:[e&&(0,r.jsx)(a.zxk,{color:a.zxk.Colors.BRAND,onClick:function(){(0,a.ZDy)(b((function(){var e,i;return _(this,(function(a){switch(a.label){case 0:return[4,Promise.all([n.e(40532),n.e(95132)]).then(n.bind(n,195132))];case 1:e=a.sent(),i=e.default;return[2,function(e){return(void 0!==N||o)&&(0,r.jsx)(i,O(function(e){for(var t=1;t{"use strict";n.d(t,{c:()=>r});var r=(0,n(260561).B)({kind:"user",id:"2022-08_churro_experiment",label:"PS5 Voice Experiment",defaultConfig:{allowPlayStationStaging:!1},treatments:[{id:3,label:"PS Experiment + upsells + Staging",config:{allowPlayStationStaging:!0}}]})},647428:(e,t,n)=>{"use strict";n.d(t,{Z:()=>v});var r=n(202351),o=n(744564),i=n(120415),a=n(310126),s=new Set(["nvidia"]);var c=n(236625),l=n.n(c);var u=function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},i.AB.WINDOWS,{nvidia:">=397.93.0"});function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){ for(var n=0;n{"use strict";n.d(t,{l:()=>a,y:()=>s});var r=n(38736),o=Object.freeze({isPopoutOpen:!1}),i=(0,r.Z)((function(e){ return o})),a=function(e){i.setState((function(){return{isPopoutOpen:e}}))},s=i},955514:(e,t,n)=>{"use strict";n.d(t,{F:()=>p,Q:()=>h});var r=n(202351),o=n(418705),i=n(917019),a=n(473419),s=n(652591),c=n(256764),l=n(2590),u=n(458947),f=n(131559);function d(e,t){var n=a.Z.getDismissedGuildContent(t);return null!=n&&(0,c.jl)(n,e)}function p(e,t){return(0,r.e7)([a.Z],(function(){return d(e,t)}))}function h(e,t,n,r){(0,i.PS)(t,(function(n){if(d(e,t))return!1;n.dismissedGuildContent=(0,c.GV)(n.dismissedGuildContent,e)}),f.fy.INFREQUENT_USER_ACTION);n&&s.default.track(l.rMx.DISMISSIBLE_CONTENT_DISMISSED,{type:o.CW[e],guild_id:t,action:null!=r?r:u.L.AUTO})}},754242:(e,t,n)=>{"use strict";n.d(t,{iq:()=>s,Cl:()=>c,$D:()=>l,Pq:()=>o,Jh:()=>i,gq:()=>u});function r(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var o,i,a,s="guild_feed_feedback_last_seen",c=6048e5,l=450;!function(e){e.TERRIBLE="terrible";e.BAD="bad";e.OKAY="okay" ;e.GOOD="good";e.EXCELLENT="excellent"}(o||(o={}));!function(e){e[e.ALREADY_SAW=0]="ALREADY_SAW";e[e.IRRELEVANT=1]="IRRELEVANT";e[e.TOO_OLD=2]="TOO_OLD";e[e.CONFUSING_OR_RANDOM=3]="CONFUSING_OR_RANDOM";e[e.INAPPROPRIATE=4]="INAPPROPRIATE";e[e.UNINTERESTING=5]="UNINTERESTING";e[e.ENTERTAINING=6]="ENTERTAINING";e[e.INFORMATIVE=7]="INFORMATIVE";e[e.USEFUL=8]="USEFUL";e[e.OTHER=9]="OTHER";e[e.FUNNY=10]="FUNNY"}(i||(i={}));var u=(r(a={},o.TERRIBLE,[i.ALREADY_SAW,i.IRRELEVANT,i.TOO_OLD,i.CONFUSING_OR_RANDOM,i.INAPPROPRIATE,i.OTHER]),r(a,o.BAD,[i.ALREADY_SAW,i.IRRELEVANT,i.TOO_OLD,i.CONFUSING_OR_RANDOM,i.INAPPROPRIATE,i.OTHER]),r(a,o.OKAY,[i.IRRELEVANT,i.TOO_OLD,i.UNINTERESTING,i.ALREADY_SAW,i.OTHER]),r(a,o.GOOD,[i.FUNNY,i.ENTERTAINING,i.INFORMATIVE,i.USEFUL,i.OTHER]),r(a,o.EXCELLENT,[i.FUNNY,i.ENTERTAINING,i.INFORMATIVE,i.USEFUL,i.OTHER]),a)},720504:(e,t,n)=>{"use strict";n.d(t,{Cd:()=>m,vL:()=>b,i1:()=>g,IT:()=>O}) ;var r=n(667294),o=n(202351),i=n(630631),a=n(316878),s=n(123398),c=n(821229),l=n(652591),u=n(433932),f=n(614244),d=n(754242),p=n(2590),h=n(473708);function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nd.Cl)}),[e,a]),setOnDismissedFeedback:o}}function g(e){switch(e){case d.Jh.ALREADY_SAW:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_ALREADY_SAW;case d.Jh.IRRELEVANT:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_IRRELEVANT;case d.Jh.TOO_OLD:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_TOO_OLD;case d.Jh.CONFUSING_OR_RANDOM:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_CONFUSING;case d.Jh.INAPPROPRIATE:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_INAPPROPRIATE;case d.Jh.UNINTERESTING: return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_UNINTERESTING;case d.Jh.ENTERTAINING:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_ENTERTAINING;case d.Jh.INFORMATIVE:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_INFORMATIVE;case d.Jh.USEFUL:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_USEFUL;case d.Jh.OTHER:return h.Z.Messages.GUILD_FEED_FEEDBACK_OTHER_REASON;case d.Jh.FUNNY:return h.Z.Messages.GUILD_FEED_FEEDBACK_OPTION_FUNNY;default:return null}}function O(e){var t=e.guildId,n=e.guildFeedItem,c=e.setOnDismissFeedback,u=y(r.useState(),2),h=u[0],E=u[1],m=y(r.useState(new Set),2),b=m[0],O=m[1],v=y(r.useState(),2),_=v[0],I=v[1],S=y(r.useState(!1),2),T=S[0],N=S[1],A=y(r.useState(!1),2),C=A[0],P=A[1],j=y(r.useState(!1),2),R=j[0],x=j[1],M=r.useCallback((function(e){E(e);x(!0);N(!1);setTimeout((function(){x(!1)}),d.$D+150)}),[E,N,x]),w=r.useCallback((function(e){e===d.Jh.OTHER&&b.has(d.Jh.OTHER)&&I(null);var t=new Set(b);t.has(e)?t.delete(e):t.add(e);O(t) }),[b,I,O]),D=r.useCallback((function(){N(!0);O(new Set)}),[N,O]),Z=r.useCallback((function(e){!function(e){var t,n=e.guildId,r=e.guildFeedItem,o=e.dismissed,i=e.selectedRating,a=void 0===i?null:i,c=e.selectedReasons,u=void 0===c?null:c,d=e.userFeedback,h=void 0===d?null:d,E=Array.from(null!=u?u:[]);l.default.track(p.rMx.HOME_FEEDBACK_SUBMITTED,{guild_id:n,home_session_id:f.Z.getHomeSessionId(n),feed_item_id:r.id,feed_item_position:0,dismissed:o,report_name:"feed_item_feedback",load_id:s.ZP.getLoadId(n),rating:a,reason_codes:E,reason_descriptions:E.map((function(e){return null!==(t=g(e))&&void 0!==t?t:""})),user_feedback:h})}({guildId:t,guildFeedItem:n,dismissed:e,selectedRating:h,selectedReasons:b,userFeedback:_})}),[t,n,h,b,_]),L=r.useCallback((function(){i.Z.set(d.iq,Date.now());null==c||c(!0);C||Z(!0)}),[Z,c,C]),U=r.useCallback((function(){Z(!1);P(!0);i.Z.set(d.iq,Date.now())}),[Z]),k=r.useMemo((function(){return b.size>0&&(!b.has(d.Jh.OTHER)||null!=_&&""!==_)}),[b,_]),G=(0, o.e7)([a.Z],(function(){return a.Z.useReducedMotion})),B=r.useRef(!1);r.useEffect((function(){return function(){B.current=!0}}),[]);r.useEffect((function(){return function(){B.current&&null!=h&&L()}}),[h,L]);return{selectedRating:h,setSelectedRating:M,selectedReasons:b,setSelectedReasons:w,setUserFeedback:I,backPressed:T,onBackPressed:D,onSubmitPressed:U,onClosePressed:L,showSubmitted:C,isAnimating:R,canSubmit:k,useReducedMotion:G}}},825781:(e,t,n)=>{"use strict";n.d(t,{Z:()=>P});var r=n(202351),o=n(744564),i=n(2590);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return s(e)}function c(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e,t){l=Object.setPrototypeOf||function(e,t){ e.__proto__=t;return e};return l(e,t)}var u=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var o=s(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}var d,p,h,E,y,m,b,g,O,v=i.QZA.CLOSED,_={},I=!1;function S(){v=i.QZA.CLOSED;_={};b=null;g=void 0;O=[]}function T(){N();A();_={};v=i.QZA.OPEN}function N(){d=void 0;y=void 0}function A(){p=void 0;h=void 0;E=void 0;m=void 0}var C=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0, configurable:!0}});t&&l(e,t)}(n,e);var t=f(n);function n(){a(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getFormState=function(){return v};r.getErrors=function(){return _};r.showNotice=function(){return void 0!==d||void 0!==p||void 0!==h||void 0!==E||void 0!==y||void 0!==m};r.getPendingAvatar=function(){return d};r.getPendingBanner=function(){return p};r.getPendingBio=function(){return h};r.getPendingNickname=function(){return y};r.getPendingPronouns=function(){return E};r.getPendingAccentColor=function(){return y};r.getPendingThemeColors=function(){return m};r.getAllPending=function(){return{pendingAvatar:d,pendingBanner:p,pendingBio:h,pendingPronouns:E,pendingNickname:y,pendingThemeColors:m}};r.getGuild=function(){return b};r.getSource=function(){return g};r.getAnalyticsLocations=function(){return O};r.getIsDisableSubmit=function(){return I};r.__getLocalVars=function(){return{formState:v,errors:_,pendingAvatar:d,pendingBanner:p,pendingBio:h,pendingPronouns:E, pendingNickname:y,pendingThemeColors:m,guild:b,source:g,analyticsLocations:O,disableSubmit:I}};return n}(r.ZP.Store);C.displayName="GuildIdentitySettingsStore";const P=new C(o.Z,{GUILD_IDENTITY_SETTINGS_INIT:function(e){b=e.guild;v=i.QZA.OPEN;_={};g=e.source;O=e.analyticsLocations},GUILD_IDENTITY_SETTINGS_CLOSE:S,GUILD_IDENTITY_SETTINGS_RESET_AND_CLOSE_FORM:function(){T();S()},GUILD_IDENTITY_SETTINGS_SET_GUILD:function(e){b=e.guild;_={}},GUILD_IDENTITY_SETTINGS_SUBMIT:function(){v=i.QZA.SUBMITTING;_={}},GUILD_IDENTITY_SETTINGS_SUBMIT_FAILURE:function(e){if(v!==i.QZA.SUBMITTING)return!1;v=i.QZA.OPEN;var t;_=null!==(t=e.errors)&&void 0!==t?t:{}},USER_PROFILE_UPDATE_FAILURE:function(e){v=i.QZA.OPEN;_=e.errors},GUILD_IDENTITY_SETTINGS_SET_PENDING_AVATAR:function(e){var t=e.avatar;d=t},GUILD_IDENTITY_SETTINGS_SET_PENDING_BANNER:function(e){var t=e.banner;p=t},GUILD_IDENTITY_SETTINGS_SET_PENDING_BIO:function(e){var t=e.bio;h=t},GUILD_IDENTITY_SETTINGS_SET_PENDING_PRONOUNS:function(e){ var t=e.pronouns;E=t},GUILD_IDENTITY_SETTINGS_SET_PENDING_NICKNAME:function(e){var t=e.nickname;y=t},GUILD_IDENTITY_SETTINGS_SET_PENDING_THEME_COLORS:function(e){var t=e.themeColors;m=t},GUILD_IDENTITY_SETTINGS_RESET_PENDING_MEMBER_CHANGES:N,GUILD_IDENTITY_SETTINGS_RESET_PENDING_PROFILE_CHANGES:A,GUILD_IDENTITY_SETTINGS_RESET_ALL_PENDING:T,GUILD_IDENTITY_SETTINGS_SUBMIT_SUCCESS:T,GUILD_IDENTITY_SETTINGS_CLEAR_ERRORS:function(){_={}},GUILD_IDENTITY_SETTINGS_SET_DISABLE_SUBMIT:function(e){var t=e.disable;I=t}})},989280:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(785893),o=(n(667294),n(707961)),i=n(124251),a=n(473708),s=n(571094),c=n.n(s),l=n(946137),u=n.n(l);const f=function(e){var t=e.headerId,n=e.reapplyText,s=e.onReapply,l=e.confirmText,f=e.onConfirm,d=e.rejectionReason,p=void 0===d?null:d,h=e.guild,E=void 0===h?null:h;return(0,r.jsxs)("div",{className:c().confirmation,children:[(0,r.jsxs)("div",{className:c().confirmationContent,children:[null!==E?(0,r.jsx)(i.Z,{ size:i.Z.Sizes.LARGER,guild:E,className:c().guildIcon}):(0,r.jsx)("img",{alt:a.Z.Messages.MEMBER_VERIFICATION_APPLICATION_REJECTED_ICON,src:u(),className:c().verificationStateIcon}),(0,r.jsx)(o.X6q,{id:t,variant:"heading-xl/semibold",className:c().header,children:null!=(null==E?void 0:E.name)?a.Z.Messages.MEMBER_VERIFICATION_APPLICATION_REJECTED_TITLE_WITH_GUILD_NAME.format({guildName:E.name}):a.Z.Messages.MEMBER_VERIFICATION_APPLICATION_REJECTED_TITLE}),null!=p&&""!==p?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(o.xvT,{variant:"text-sm/normal",children:[(0,r.jsx)("span",{className:c().rejectionReasonLabel,children:a.Z.Messages.MEMBER_VERIFICATION_APPLICATION_REJECTED_REASON}),(0,r.jsx)("span",{className:c().rejectionReason,children:p})]})}):null]}),(0,r.jsxs)("div",{className:c().confirmationButtonRow,children:[(0,r.jsx)(o.zxk,{onClick:s,color:o.zxk.Colors.PRIMARY,className:c().confirmationButton,children:n}),(0,r.jsx)(o.zxk,{onClick:f,color:o.zxk.Colors.PRIMARY, className:c().confirmationButton,children:l})]})]})}},504834:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(785893),o=(n(667294),n(294184)),i=n.n(o),a=n(707961),s=n(223430),c=n(265367),l=n(477598),u=n.n(l);function f(e){var t=e.message,n=e.error,o=e.onClick,l=e.submitting,f=e.className,d=e.ctaMessage;return(0,r.jsxs)("div",{className:i()(u().container,f),children:[(0,r.jsxs)("div",{className:u().textContainer,children:[(0,r.jsx)(c.Z,{className:u().warningIcon}),(0,r.jsx)(s.Z,{size:10,horizontal:!0}),(0,r.jsxs)("div",{children:[(0,r.jsx)(s.Z,{size:1}),(0,r.jsx)(a.xvT,{className:u().info,variant:"text-sm/normal",children:t}),null!=n&&(0,r.jsx)(a.xvT,{className:i()(u().info,u().error),variant:"text-sm/normal",children:n})]})]}),(0,r.jsx)(s.Z,{size:16,horizontal:!0}),(0,r.jsx)(a.zxk,{className:u().undoButton,color:a.zxk.Colors.LINK,look:a.zxk.Looks.LINK,size:a.zxk.Sizes.ICON,onClick:o,submitting:l,children:d})]})}},196142:(e,t,n)=>{"use strict";n.d(t,{Z:()=>b}) ;var r=n(785893),o=n(667294),i=n(730381),a=n.n(i),s=n(673679),c=n(153686),l=n(19585),u=n(547721),f=n(504834),d=n(473708);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";n.d(t,{kZ:()=>d,W4:()=>p,Sn:()=>h,gq:()=>E,I4:()=>m,Ui:()=>b,U3:()=>g});var r=n(281110),o=n(744564),i=n(49621),a=n(248046),s=n(2590);function c(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){c(i,r,o,a,s,"next",e)}function s(e){c(i,r,o,a,s,"throw",e)}a(void 0)}))}}function u(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var f=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){ if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";n.d(t,{Z:()=>p}) ;var r=n(125333),o=n(58964),i=n(97245),a=n(269823),s=n(652591),c=n(877815),l=n(873297),u=n(2590);function f(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var d="template";const p=function(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}(function(e){for(var t=1;t-1)){var n=null!=e?(0,r.Oh)(e):(0,r.Gk)(),a=(0,o.WS)(),l=(0,o.ZP)(n,{utmSource:d,fingerprint:t,attemptId:a});s.default.track(u.rMx.DEEP_LINK_CLICKED,{fingerprint:(0,i.K)(t),attempt_id:a,source:d,guild_template_code:e});c.Z.launch(l,(function(){}))}}})},876003:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r,o=n(785893),i=(n(667294),n(294184)),a=n.n(i),s=n(74535),c=n(795470),l=n(912250),u=n(655402),f=n(888291),d=n(2590),p=n(240162),h=n.n(p);function E(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function y(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}var b=(E(r={},d.BRd.DARK,d.Ilk.PRIMARY_400),E(r,d.BRd.LIGHT,d.Ilk.PRIMARY_500),r);function g(e){var t,n=e.enabled,r=e.imageClassName,i=e.iconWrapperClassName,d=m(e,["enabled","imageClassName","iconWrapperClassName"]),p=(0,s.ZP)(),g={height:18,width:18,color:(0,c.Lq)(b[p])};return(0,o.jsx)(f.Z,y({className:a()((t={},E(t,h().avatarUploader,n),E(t,h().avatarUploaderDisabled,!n),t)), imageClassName:a()(r,h().avatarUploaderInnerSquare,E({},h().avatarUploaderInnerSquareDisabled,!n)),icon:null!=d.image&&""!==d.image?(0,o.jsx)(l.Z,y({},g)):(0,o.jsx)(u.Z,y({},g)),iconClassName:a()(h().avatarUploadIcon,h().hideDefaultIcon),iconWrapperClassName:i,showIcon:!0,showIconDisabled:!0,hideSize:!0},d))}},888291:(e,t,n)=>{"use strict";n.d(t,{S:()=>T,Z:()=>A});var r=n(785893),o=n(667294),i=n(294184),a=n.n(i),s=n(441143),c=n.n(s),l=n(707961),u=n(421281),f=n(694755),d=n(2590),p=n(473708),h=n(326726),E=n.n(h);function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function b(e){b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return b(e)}function g(e){for(var t=1;t{"use strict";n.d(t,{i:()=>h,Z:()=>I});var r=n(441143),o=n.n(r),i=n(202351),a=n(744564),s=n(665472),c=n(73904),l=n(869854);function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function d(e,t){return!t||"object"!==O(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(e,t){p=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return p(e,t)}var h,E,y,m,b,g,O=function(e){ return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d(this,n)}}!function(e){e[e.IN_FLIGHT=0]="IN_FLIGHT";e[e.ERRORED=1]="ERRORED";e[e.SUCCEEDED=2]="SUCCEEDED"}(h||(h={}));var _=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&p(e,t)}(n,e);var t=v(n);function n(){u(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getModalState=function(e){return e!==E?null:y} ;r.__getLocalVars=function(){return{currentNonce:E,currentState:y,queuedMessageId:m,queuedMessageChannelId:b,queuedMessageNonce:g}};return n}(i.ZP.Store);_.displayName="InteractionModalStore";const I=new _(a.Z,{LOGOUT:function(){E=null;y=null;m=null;b=null;g=null;return!0},INTERACTION_MODAL_CREATE:function(e){if(e.nonce===g){s.Z.deleteMessage(b,m,!0);m=null;b=null;g=null}return!1},INTERACTION_QUEUE:function(e){var t=e.messageId,n=e.nonce,r=e.data;switch(r.interactionType){case c.B8.APPLICATION_COMMAND:m=t;b=r.channelId;g=n;return!1;case c.B8.MODAL_SUBMIT:o()(null==E||y===h.ERRORED||y===h.SUCCEEDED,"cannot submit multiple modals at once");E=n;y=h.IN_FLIGHT;setTimeout((function(){E===n&&y===h.IN_FLIGHT&&(0,l.yr)(n)}),1e4);return!0;default:return!1}},INTERACTION_SUCCESS:function(e){var t=e.nonce;if(null==t||t!==E)return!1;y=h.SUCCEEDED;return!0},INTERACTION_FAILURE:function(e){var t=e.nonce;if(null==t||t!==E)return!1;y=h.ERRORED;return!0}})},196644:(e,t,n)=>{"use strict";n.d(t,{HJ:()=>d, yD:()=>p,Zd:()=>h});var r=n(541554),o=n(281110),i=n(744564),a=n(84441),s=n(736818),c=n(873553),l=n(2590);function u(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}var f=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue} if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";n.d(t,{L:()=>c});var r=n(667294),o=n(202351),i=n(744564),a=n(196644),s=n(873553);function c(){var e=(0,o.cj)([s.Z],(function(){return{isLoading:s.Z.getIsValidatingUsers(),multiAccountUsers:s.Z.getUsers()}}));r.useEffect((function(){i.Z.wait((function(){a.HJ()}))}),[]);return e}},226613:(e,t,n)=>{"use strict";n.d(t,{c:()=>o,H:()=>i});var r=n(744564) ;function o(e){r.Z.wait((function(){return r.Z.dispatch({type:"NUF_NEW_USER",newUserType:e})}))}function i(){r.Z.wait((function(){return r.Z.dispatch({type:"NUF_COMPLETE"})}))}},239527:(e,t,n)=>{"use strict";n.d(t,{M5:()=>r});var r;!function(e){e[e.MARKETING_UNCLAIMED=0]="MARKETING_UNCLAIMED";e[e.INVITE_UNCLAIMED=1]="INVITE_UNCLAIMED";e[e.ORGANIC_REGISTERED=2]="ORGANIC_REGISTERED";e[e.ORGANIC_REGISTERED_GUILD_TEMPLATE=3]="ORGANIC_REGISTERED_GUILD_TEMPLATE"}(r||(r={}))},88415:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(202351),o=n(744564);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return a(e)}function s(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e,t){ c=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return c(e,t)}var l=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=a(e);if(t){var o=a(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return s(this,n)}}var f=null;var d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&c(e,t)}(n,e);var t=u(n);function n(){i(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(e){var t ;f=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:null};r.getType=function(){return f};r.getState=function(){return{type:f}};r.__getLocalVars=function(){return{type:f}};return n}(r.ZP.PersistedStore);d.displayName="NewUserStore";d.persistKey="nuf";const p=new d(o.Z,{NUF_NEW_USER:function(e){var t=e.newUserType;f=t},NUF_COMPLETE:function(){f=null}})},936323:(e,t,n)=>{"use strict";n.d(t,{F:()=>r});var r;!function(e){e.AGE_GATE="age-gate";e.CHOOSE_TEMPLATE="choose-template";e.CUSTOMIZE_GUILD="customize-server";e.CHANNEL_PROMPT="channel-prompt";e.JOIN_GUILD="join-server";e.CREATION_INTENT="creation-intent";e.COMPLETE="complete"}(r||(r={}))},643676:(e,t,n)=>{"use strict";n.d(t,{Y:()=>f,Z:()=>p});var r=n(281110),o=n(744564),i=n(2590);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";n.d(t,{AG:()=>c,i0:()=>l,zE:()=>u,ip:()=>f,nP:()=>r,ne:()=>i,tx:()=>d});var r,o,i,a,s=n(473708),c=8,l=3,u=26,f=73;!function(e){e[e.DM_MESSAGE_SEND=1]="DM_MESSAGE_SEND";e[e.GDM_MESSAGE_SEND=2]="GDM_MESSAGE_SEND";e[e.MESSAGE_REACT=3]="MESSAGE_REACT";e[e.ADD_FRIEND=4]="ADD_FRIEND";e[e.SEND_CALL=5]="SEND_CALL";e[e.CALL_JOIN=6]="CALL_JOIN";e[e.GUILD_JOIN=7]="GUILD_JOIN"}(r||(r={}));!function(e){e[e.PARENT=1]="PARENT";e[e.CHILD=2]="CHILD"}(o||(o={}));!function(e){e[e.PENDING=1]="PENDING";e[e.ACTIVE=2]="ACTIVE";e[e.INACTIVE=3]="INACTIVE";e[e.DECLINED=4]="DECLINED";e[e.EXPIRED=5]="EXPIRED"}(i||(i={}));!function(e){e[e.USER_ADD=1]="USER_ADD";e[e.GUILD_ADD=2]="GUILD_ADD";e[e.USER_INTERACTION=3]="USER_INTERACTION";e[e.GUILD_INTERACTION=4]="GUILD_INTERACTION"}(a||(a={}));var d=new Map([[a.USER_INTERACTION,{counterHeader:function(){ return s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_INTERACTION_HEADER},counterTooltip:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_INTERACTION_TOOLTIP},sectionHeader:function(e){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_INTERACTION_SECTION_HEADER.format({count:e})},timestampFormatter:function(){return{today:s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_MESSAGED_TIMESTAMP_TODAY,yesterday:s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_MESSAGED_TIMESTAMP_YESTERDAY,days:s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_MESSAGED_TIMESTAMP_DAYS}}}],[a.USER_ADD,{counterHeader:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_ADD_FRIENDS_HEADER},counterTooltip:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_ADD_FRIENDS_TOOLTIP},sectionHeader:function(e){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_ADD_FRIENDS_SECTION_HEADER.format({count:e})},timestampFormatter:function(){return{today:s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_ADDED_TIMESTAMP_TODAY, yesterday:s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_ADDED_TIMESTAMP_YESTERDAY,days:s.Z.Messages.FAMILY_CENTER_ACTIVITY_USER_ADDED_TIMESTAMP_DAYS}}}],[a.GUILD_ADD,{counterHeader:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_JOIN_HEADER},counterTooltip:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_JOIN_TOOLTIP},sectionHeader:function(e){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_JOIN_SECTION_HEADER.format({count:e})},sectionDescription:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_JOIN_DESCRIPTION}}],[a.GUILD_INTERACTION,{counterHeader:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_INTERACTION_HEADER},counterTooltip:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_INTERACTION_TOOLTIP},sectionHeader:function(e){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_INTERACTION_SECTION_HEADER.format({count:e})},sectionDescription:function(){return s.Z.Messages.FAMILY_CENTER_ACTIVITY_GUILD_INTERACTION_DESCRIPTION}}]])}, 719174:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(202351),o=n(473903);function i(){var e=(0,r.e7)([o.default],(function(){var e;return null===(e=o.default.getCurrentUser())||void 0===e?void 0:e.nsfwAllowed}));return null!=e&&e}},779224:(e,t,n)=>{"use strict";n.d(t,{r:()=>O,Z:()=>v});var r=n(785893),o=(n(667294),n(318715)),i=n(707961),a=n(316878),s=n(80317),c=n(995141),l=n(170740),u=n(775173),f=n(310126),d=n(473708),p=n(763910),h=n.n(p);function E(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function y(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){ Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}var m,b=f.default.getEnableHardwareAcceleration()?i.Xo$:i.qEK,g=(E(m={},i.EFr.SIZE_40,40),E(m,i.EFr.SIZE_48,48),m),O=function(e){var t=e.user,n=e.avatarSize,f=void 0===n?i.EFr.SIZE_48:n,p=(0,o.ZP)([a.Z],(function(){return a.Z.useReducedMotion})),m=g[f],O=(0,s.U)().canUseAvatarDecorations,v=(0,l.w)({user:t,size:m}),_=v.avatarSrc,I=v.isAvatarAnimating,S=v.eventHandlers,T=!p&&I,N=O?(0,u.NZ)({userId:t.id,avatarDecoration:t.avatarDecoration,size:(0,c.y)(f),canAnimate:T}):null;return(0,r.jsx)("div",y(function(e){for(var t=1;t{"use strict";n.d(t,{Z:()=>c});var r=n(785893),o=(n(667294),n(707961)),i=n(334835),a=n(720810),s=n.n(a);const c=function(e){var t=e.user;return(0,r.jsx)(o.xvT,{className:"tag",variant:"text-md/medium",children:(0,r.jsx)(i.Z,{user:t,showAccountIdentifier:!0,className:s().tagContainer,usernameClass:s().username,discriminatorClass:s().discriminator})})}},560837:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var r=n(202351),o=n(744564),i=n(335186);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)} ;return s(e)}function c(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e,t){l=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return l(e,t)}var u,f=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var o=s(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}var p=(0,i.K4)();function h(e){var t=e.countryCode;if(null!=t){var n;p=null!==(n=(0,i.Zz)(t))&&void 0!==n?n:(0,i.K4)()}}var E=function(e){!function(e,t){ if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&l(e,t)}(n,e);var t=d(n);function n(){a(this,n);return t.apply(this,arguments)}var r=n.prototype;r.initialize=function(e){null!=e&&(u=e.selectedCountryCode)};r.getUserAgnosticState=function(){return{selectedCountryCode:u}};r.getCountryCode=function(){return null!=u?u:p};r.__getLocalVars=function(){return{selectedCountryCode:u,defaultCountryCode:p}};return n}(r.ZP.DeviceSettingsStore);E.displayName="PhoneStore";E.persistKey="PhoneStore";const y=new E(o.Z,{PHONE_SET_COUNTRY_CODE:function(e){var t=e.countryCode;u=t},CONNECTION_OPEN:h,SET_LOCATION_METADATA:h})},998330:(e,t,n)=>{"use strict";n.d(t,{D:()=>b,T:()=>m});var r=n(785893),o=n(667294),i=n(707961),a=n(744564),s=n(494425),c=n(294184),l=n.n(c),u=n(530991),f=n(17229),d=n(510036),p=n.n(d),h=function(e){var t=e.color;return(0, r.jsxs)("svg",{width:"48",height:"28",viewBox:"0 0 55 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("rect",{x:"10.1968",y:"7",width:"14.4203",height:"14.4203",transform:"rotate(45 10.1968 7)",className:p().toastBG}),(0,r.jsx)("rect",{x:"27.3936",y:"0.59021",width:"23.4851",height:"23.4851",transform:"rotate(45 27.3936 0.59021)",className:p().toastBG}),(0,r.jsx)("rect",{x:"44.5903",y:"7",width:"14.4203",height:"14.4203",transform:"rotate(45 44.5903 7)",className:p().toastBG}),(0,r.jsx)("rect",{x:"10.1968",y:"13",width:"6",height:"6",transform:"rotate(45 10.1968 13)",fill:t}),(0,r.jsx)("path",{d:"M27.3936 4.39355L34.1233 16.2873L27.3936 28.1811L20.6638 16.2873L27.3936 4.39355Z",fill:t}),(0,r.jsx)("rect",{x:"44.5903",y:"13",width:"6",height:"6",transform:"rotate(45 44.5903 13)",fill:t})]})};function E(e){var t=e.achievement,n=e.unlocked,a=t.name,c=t.description,d=t.rarity,E=t.hideDescriptionUntilUnlock,y=t.onAction,m=(0,s.F7)(d).color;o.useEffect((function(){ var e=setTimeout((function(){u.Z.playAchievementUnlockSound()}),50);return function(){clearTimeout(e)}}),[]);var b=null!=y&&n,g=b?i.P3F:"div";return(0,r.jsxs)(g,{className:l()(p().container,b&&p().actionable),onClick:function(){b&&y()},children:[(0,r.jsx)("div",{className:p().iconContainer,children:(0,r.jsx)(f.Z,{achievementId:t.id,size:f.Z.Sizes.SIZE_40,unlocked:n})}),(0,r.jsxs)("div",{className:p().nameContainer,children:[(0,r.jsx)(i.xvT,{variant:"text-md/semibold",color:"header-primary",children:a()}),(0,r.jsx)(i.xvT,{variant:"text-xs/medium",color:"header-secondary",children:E&&!n?"?????":c()})]}),(0,r.jsx)("div",{className:p().flair,children:(0,r.jsx)(h,{color:m})})]})}var y=n(473708);function m(e){a.Z.dispatch({type:"POGGERMODE_ACHIEVEMENT_UNLOCK",achievementId:e})}function b(e,t){var n=(0,s.oX)(e);null!=n&&(0,i.CFj)((0,i.Yz2)(y.Z.Messages.POGGERMODE_ACHIEVEMENTS,i.pCN.CUSTOM,{position:i.azu.BOTTOM,component:(0,r.jsx)(E,{achievement:n,unlocked:t}),duration:6e3}))}}, 896971:(e,t,n)=>{"use strict";n.d(t,{Z:()=>v});var r=n(202351),o=n(744564),i=n(736818),a=n(998330),s=n(785085),c=n(44616);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function d(e){for(var t=1;t{"use strict";n.d(t,{hn:()=>r,EP:()=>o,LG:()=>l,oX:()=>u,F7:()=>f});var r,o,i,a=n(673383),s=n(473708);function c(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}!function(e){e[e.ENABLE_POGGERMODE=0]="ENABLE_POGGERMODE";e[e.DISABLE_POGGERMODE=1]="DISABLE_POGGERMODE";e[e.PING_SOMEONE=2]="PING_SOMEONE";e[e.PING_ME=3]="PING_ME";e[e.COMBO_MULTI_LEVEL_1=4]="COMBO_MULTI_LEVEL_1";e[e.COMBO_MULTI_LEVEL_2=5]="COMBO_MULTI_LEVEL_2";e[e.COMBO_MULTI_LEVEL_3=6]="COMBO_MULTI_LEVEL_3";e[e.COMBO_MULTI_LEVEL_4=7]="COMBO_MULTI_LEVEL_4";e[e.TOTAL_SCORE_LEVEL_1=8]="TOTAL_SCORE_LEVEL_1" ;e[e.TOTAL_SCORE_LEVEL_2=9]="TOTAL_SCORE_LEVEL_2";e[e.TOTAL_SCORE_LEVEL_3=10]="TOTAL_SCORE_LEVEL_3";e[e.TOTAL_SCORE_LEVEL_4=11]="TOTAL_SCORE_LEVEL_4";e[e.TOTAL_SCORE_LEVEL_5=12]="TOTAL_SCORE_LEVEL_5";e[e.VISITOR_100=13]="VISITOR_100";e[e.CUSTOMIZE_CONFETTI=14]="CUSTOMIZE_CONFETTI";e[e.MORE=15]="MORE";e[e.COMBO_VALUE_LEVEL_1=16]="COMBO_VALUE_LEVEL_1";e[e.COMBO_VALUE_LEVEL_2=17]="COMBO_VALUE_LEVEL_2";e[e.COMBO_VALUE_LEVEL_3=18]="COMBO_VALUE_LEVEL_3";e[e.COMBO_VALUE_LEVEL_4=19]="COMBO_VALUE_LEVEL_4"}(r||(r={}));!function(e){e[e.COMMON=0]="COMMON";e[e.UNCOMMON=1]="UNCOMMON";e[e.RARE=2]="RARE";e[e.EPIC=3]="EPIC";e[e.LEGENDARY=4]="LEGENDARY"}(o||(o={}));var l=(c(i={},r.ENABLE_POGGERMODE,{id:r.ENABLE_POGGERMODE,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_ENABLE_POGGERMODE_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_ENABLE_POGGERMODE_DESCRIPTION},rarity:o.COMMON,hideDescriptionUntilUnlock:!1}),c(i,r.DISABLE_POGGERMODE,{id:r.DISABLE_POGGERMODE, name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_DISABLE_POGGERMODE_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_DISABLE_POGGERMODE_DESCRIPTION},rarity:o.UNCOMMON,hideDescriptionUntilUnlock:!1}),c(i,r.VISITOR_100,{id:r.VISITOR_100,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_VISITOR_100_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_VISITOR_100_DESCRIPTION},rarity:o.LEGENDARY,hideDescriptionUntilUnlock:!0,onAction:function(){window.open("https://www.youtube.com/watch?v=dQw4w9WgXcQ","_blank")}}),c(i,r.CUSTOMIZE_CONFETTI,{id:r.CUSTOMIZE_CONFETTI,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_CUSTOMIZE_CONFETTI_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_CUSTOMIZE_CONFETTI_DESCRIPTION},rarity:o.COMMON,hideDescriptionUntilUnlock:!1}),c(i,r.MORE,{id:r.MORE,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_MORE_NAME},description:function(){ return s.Z.Messages.POGGERMODE_ACHIEVEMENT_MORE_DESCRIPTION},rarity:o.UNCOMMON,hideDescriptionUntilUnlock:!1}),c(i,r.PING_SOMEONE,{id:r.PING_SOMEONE,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_PING_SOMEONE_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_PING_SOMEONE_DESCRIPTION},rarity:o.COMMON,hideDescriptionUntilUnlock:!1}),c(i,r.PING_ME,{id:r.PING_ME,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_PING_ME_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_PING_ME_DESCRIPTION},rarity:o.UNCOMMON,hideDescriptionUntilUnlock:!1}),c(i,r.COMBO_MULTI_LEVEL_1,{id:r.COMBO_MULTI_LEVEL_1,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_1_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_1_DESCRIPTION},rarity:o.COMMON,hideDescriptionUntilUnlock:!1,checkUnlock:function(e){return e.multiplier>=2}}),c(i,r.COMBO_MULTI_LEVEL_2,{id:r.COMBO_MULTI_LEVEL_2, name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_2_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_2_DESCRIPTION},rarity:o.UNCOMMON,hideDescriptionUntilUnlock:!1,checkUnlock:function(e){return e.multiplier>=4}}),c(i,r.COMBO_MULTI_LEVEL_3,{id:r.COMBO_MULTI_LEVEL_3,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_3_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_3_DESCRIPTION},rarity:o.RARE,hideDescriptionUntilUnlock:!1,checkUnlock:function(e){return e.multiplier>=5}}),c(i,r.COMBO_MULTI_LEVEL_4,{id:r.COMBO_MULTI_LEVEL_4,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_4_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_MULTI_LEVEL_4_DESCRIPTION},rarity:o.RARE,hideDescriptionUntilUnlock:!1,checkUnlock:function(e){return e.multiplier>=7}}),c(i,r.TOTAL_SCORE_LEVEL_1,{id:r.TOTAL_SCORE_LEVEL_1, name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_1_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_1_DESCRIPTION},rarity:o.EPIC,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 430===(0,a.Eo)(e)}}),c(i,r.TOTAL_SCORE_LEVEL_2,{id:r.TOTAL_SCORE_LEVEL_2,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_2_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_2_DESCRIPTION},rarity:o.EPIC,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 555===(0,a.Eo)(e)}}),c(i,r.TOTAL_SCORE_LEVEL_3,{id:r.TOTAL_SCORE_LEVEL_3,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_3_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_3_DESCRIPTION},rarity:o.EPIC,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 898===(0,a.Eo)(e)}}),c(i,r.TOTAL_SCORE_LEVEL_4,{id:r.TOTAL_SCORE_LEVEL_4, name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_4_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_4_DESCRIPTION},rarity:o.LEGENDARY,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 1337===(0,a.Eo)(e)}}),c(i,r.TOTAL_SCORE_LEVEL_5,{id:r.TOTAL_SCORE_LEVEL_5,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_5_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_TOTAL_SCORE_LEVEL_5_DESCRIPTION},rarity:o.LEGENDARY,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 2048===(0,a.Eo)(e)}}),c(i,r.COMBO_VALUE_LEVEL_1,{id:r.COMBO_VALUE_LEVEL_1,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_1_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_1_DESCRIPTION},rarity:o.RARE,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 64===e.value}}),c(i,r.COMBO_VALUE_LEVEL_2,{ id:r.COMBO_VALUE_LEVEL_2,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_2_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_2_DESCRIPTION},rarity:o.EPIC,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 88===e.value}}),c(i,r.COMBO_VALUE_LEVEL_3,{id:r.COMBO_VALUE_LEVEL_3,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_3_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_3_DESCRIPTION},rarity:o.EPIC,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 99===e.value}}),c(i,r.COMBO_VALUE_LEVEL_4,{id:r.COMBO_VALUE_LEVEL_4,name:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_4_NAME},description:function(){return s.Z.Messages.POGGERMODE_ACHIEVEMENT_COMBO_VALUE_LEVEL_4_DESCRIPTION},rarity:o.LEGENDARY,hideDescriptionUntilUnlock:!0,checkUnlock:function(e){return 113===e.value}}),i);function u(e){return l[e]} var f=function(e){switch(e){case o.COMMON:return{color:"#1ABC9C"};case o.UNCOMMON:return{color:"#3498DB"};case o.RARE:return{color:"#9B59B6"};case o.EPIC:return{color:"#E91E63"};case o.LEGENDARY:return{color:"#E67E22"}}}},530991:(e,t,n)=>{"use strict";n.d(t,{Z:()=>w});var r=n(744564),o=n(301928),i=n(669754),a=n(736818),s=n(563367),c=n(715107),l=n(788169),u=n(716118),f=n(785085),d=n(44616),p=n(2590);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:1,n=s.Z.isConnected(),r=n?I:1;N.push([e,t*r]);R()};const w=new(function(e){!function(e,t){ if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&b(e,t)}(n,e);var t=v(n);function n(){E(this,n);return t.apply(this,arguments)}var o=n.prototype;o._initialize=function(){d.ZP.addChangeListener(this.startAudio);r.Z.subscribe("RTC_CONNECTION_STATE",this.setVolume);r.Z.subscribe("TYPING_STOP",this.stopAudio);r.Z.subscribe("TYPING_STOP_LOCAL",this.stopAudio);r.Z.subscribe("CHANNEL_SELECT",this.stopAudio);r.Z.subscribe("POGGERMODE_SETTINGS_UPDATE",this.stopAudio)};o._terminate=function(){d.ZP.removeChangeListener(this.startAudio);r.Z.unsubscribe("RTC_CONNECTION_STATE",this.setVolume);r.Z.unsubscribe("TYPING_STOP",this.stopAudio);r.Z.unsubscribe("TYPING_STOP_LOCAL",this.stopAudio);r.Z.unsubscribe("CHANNEL_SELECT",this.stopAudio);r.Z.unsubscribe("POGGERMODE_SETTINGS_UPDATE",this.stopAudio);clearTimeout(A)};o.setVolume=function(e){ e.state===p.hes.RTC_CONNECTED?_.volume=I:_.volume=1};o.handleTypingStop=function(e){var t=e.userId;a.default.getId()===t&&P()};o.stopAudio=function(){P()};o.startAudio=function(){if(j()){var e=c.Z.getChannelId();if(null!=e){var t,n=a.default.getId(),r=l.Z.isTyping(e,n),o=d.ZP.getUserCombo(n,e),i=null!==(t=null==o?void 0:o.multiplier)&&void 0!==t?t:1;r&&i>=7?C():P()}}};o.playAchievementUnlockSound=function(){j()&&M("poggermode_achievement_unlock")};o.__getLocalVars=function(){return{applause:_,COMBO_SOUND_EFFECT_MULTIPLIER_THRESHOLD:7,REGULAR_VOLUME:1,REDUCED_VOLUME:I,SOUND_DEQUEUE_TIMEOUT_MS:1e3,isLooping:S,isPlaying:T,soundQueue:N,soundTimeoutId:A,loopApplause:C,stopApplause:P,canPlaySound:j,playSoundFromQueue:R,queueNextSound:x,enqueueSound:M}};return n}(o.Z))},17229:(e,t,n)=>{"use strict";n.d(t,{Z:()=>b});var r,o=n(785893),i=(n(667294),n(707961)),a=n(74535),s=n(795470),c=n(436187),l=n(349491),u=n(382518),f=n(494425),d=n(488462),p=n(97291),h=n.n(p);function E(e,t,n){ t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function y(e){for(var t=1;t{"use strict";n.d(t,{c:()=>r});var r;!function(e){e[e.PREMIUM_FEATURE_LARGER_FILE_UPLOADS_ID=0]="PREMIUM_FEATURE_LARGER_FILE_UPLOADS_ID";e[e.PREMIUM_FEATURE_ANIMATED_EMOJI_ID=1]="PREMIUM_FEATURE_ANIMATED_EMOJI_ID";e[e.PREMIUM_FEATURE_HD_VIDEO_STREAMING_ID=2]="PREMIUM_FEATURE_HD_VIDEO_STREAMING_ID";e[e.PREMIUM_FEATURE_CUSTOM_PROFILES_ID=3]="PREMIUM_FEATURE_CUSTOM_PROFILES_ID" ;e[e.PREMIUM_FEATURE_BUY_ONE_GET_ONE_ID=4]="PREMIUM_FEATURE_BUY_ONE_GET_ONE_ID"}(r||(r={}))},100749:(e,t,n)=>{"use strict";n.d(t,{hz:()=>v,ED:()=>T,Ox:()=>N,pV:()=>A});var r=n(667294),o=n(202351),i=n(281110),a=n(347365),s=n(370459),c=n(536392),l=n(850841),u=n(2590);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function b(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(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.")}()}var g=function(e,t){var n,r,o,i,a={ label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{ "use strict";n.d(t,{U:()=>d});var r=n(730381),o=n.n(r),i=n(202351),a=n(711531),s=n(551778),c=n(536392),l=n(850841),u=n(2590),f=n(488462);function d(){var e=(0,i.e7)([c.Z],(function(){return c.Z.getPremiumTypeSubscription()})),t=(0,i.e7)([s.Z],(function(){return null!=e&&null!=e.planIdFromItems?s.Z.get(null==e?void 0:e.planIdFromItems):null})),n=(0,i.e7)([a.Z],(function(){return null!=e&&null!=e.paymentSourceId?a.Z.getPaymentSource(e.paymentSourceId):null}),[e]),r=null!=n&&f.Uk.has(n.type),d=(null==e?void 0:e.status)===u.O0b.PAST_DUE?o()().diff(o()(e.currentPeriodStart),"days"):0;return!(null==e||null==t||!(0,l.uZ)(t.id))&&(r&&d>=0&&d<=(0,l.lU)(e)&&e.status===u.O0b.PAST_DUE&&!e.isPurchasedExternally)}},83435:(e,t,n)=>{"use strict";n.d(t,{l:()=>b,Y:()=>g});var r=n(667294),o=n(202351),i=n(744564),a=n(473903),s=n(850841),c=n(666870),l=n(803548),u=n(247253),f=n(188435),d=n(203600);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nnew Date(e)}));return t?r.filter((function(e){return(0,l.Nw)(e)})):r}),[n,e,t])}},392649:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(785893),o=(n(667294),n(707961)),i=n(225416),a=n.n(i);function s(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function c(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function l(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{} ;var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function u(e){var t=e.children,n=l(e,["children"]);return(0,r.jsx)(o.zxk,c(function(e){for(var t=1;t{"use strict";n.r(t);n.d(t,{PremiumSubscriptionWowMomentForHelper:()=>Y,default:()=>z}) ;var r=n(785893),o=n(667294),i=n(248088),a=n(202351),s=n(744564),c=n(316878),l=n(786170),u=n(652591),f=n(245305),d=n(930948),p=n(666870),h=n(436145),E=n(398344),y=n(156620),m=n(305082),b=n(266997),g=n(955426),O=n.n(g),v=n(621491),_=n.n(v),I=n(470752),S=n.n(I),T=n(734207),N=n.n(T),A=n(2590),C=n(732278),P=n.n(C),j=n(861197),R=n.n(j),x=n(109177),M=n.n(x),w=n(919098),D=n.n(w),Z=n(900615),L=n.n(Z);function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]52||-1===C,R=(0,f.rO)(),x=j||R,M=R?"video/mp4":"video/webm";x&&!e&&I&&s&&null===O&&null===v&&!1===_&&function(e){F.apply(this,arguments)}(R);o.useEffect((function(){var t=function(){var t=(0,p._y)(),n=(0,b.fz)();if(y.Z.getCurrentConfig({},{disable:e||!t||!x}).enabled||n){N(!0);H=setTimeout((function(){N(!1);Z(!0);u.default.track(A.rMx.PREMIUM_WOW_MOMENT_VIEWED,{wow_moment_type:y.X.GRADIENT_HIGHLIGHT})}),2e3)}if(e){(0,h.HY)(!1);(0,h.Dd)(!1)}x||(0,h.Dd)(!1)};d.S.subscribe(A.CkL.PREMIUM_SUBSCRIPTION_CREATED,t);return function(){d.S.unsubscribe(A.CkL.PREMIUM_SUBSCRIPTION_CREATED,t)}}),[e,x]);var w=B(o.useState(!1),2),D=w[0],Z=w[1],L=B(o.useState(!1),2),U=L[0],k=L[1],G=(0,i.useSpring)({opacity:D?.2:0,config:{duration:100},immediate:e}),V=(0,i.useSpring)({x:U?"100%":"-100%",config:{duration:500},immediate:e||!U});o.useEffect((function(){var e=-1 ;D&&(e=window.setTimeout((function(){k(!0)}),1e3));return function(){window.clearTimeout(e)}}),[D]);o.useEffect((function(){var e=-1;U&&(e=window.setTimeout((function(){k(!1);Z(!1);(0,h.Dd)(!1)}),1e3));return function(){window.clearTimeout(e)}}),[U]);return(0,r.jsxs)("div",{className:P().wrapper,children:[T&&null!==O&&(0,r.jsx)(l.Z,{autoPlay:!0,className:P().videoWrapper,onPlay:function(){clearTimeout(H);u.default.track(A.rMx.PREMIUM_WOW_MOMENT_VIEWED,{wow_moment_type:y.X.WUMPUS_FLIGHT})},onTimeUpdate:function(e){if(e.currentTarget.currentTime>4){(0,h.HY)(!0);(0,h.Dd)(!1)}},onEnded:function(){N(!1)},children:(0,r.jsx)("source",{src:O,type:M})}),(0,r.jsx)(i.animated.div,{className:P().gadientHighlight,style:G}),(0,r.jsx)(i.animated.div,{className:P().swipeWrapper,style:V,children:(0,r.jsxs)("svg",{className:P().swipe,viewBox:"0 0 848 1024",fill:"none",children:[(0,r.jsx)("path",{d:"M257.206 1024L0 0H341.333L598.539 1024H257.206Z",fill:"white"}),(0,r.jsx)("path",{ d:"M847.975 1024H690.436L433.231 0H590.769L847.975 1024Z",fill:"white"})]})})]})}},798564:(e,t,n)=>{"use strict";n.d(t,{MM:()=>re,ZP:()=>oe});var r=n(785893),o=n(667294),i=n(294184),a=n.n(i),s=n(441143),c=n.n(s),l=n(730381),u=n.n(l),f=n(202351),d=n(336194),p=n(707961),h=n(734691),E=n(153686),y=n(19585),m=n(845882),b=n(604160),g=n(800336),O=n(473903),v=n(107364),_=n(641277),I=n(265367),S=n(652591),T=n(850841),N=n(447246),A=n(100749),C=n(499171),P=n(392649),j=n(250740),R=n(666800),x=n(673679),M=n(64234),w=n(551778),D=n(249052),Z=n(2590),L=n(473708),U=n(551047),k=n.n(U);function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(b.diff(u()(),"days")<=7||o.status===Z.O0b.PAST_DUE)&&!m&&!o.isPurchasedExternally,T=I&&o.status===Z.O0b.PAST_DUE&&!m&&!o.isPurchasedExternally,P=(0,C.U)(),x=!m&&P,M=(null==o?void 0:o.status)===Z.O0b.PAST_DUE?u()().diff(u()(o.currentPeriodStart),"days"):0,w=Q((0,A.Ox)({subscriptionId:o.id,preventFetch:!x}),1)[0];if(null==E||null==y)return(0,r.jsx)(p.$jN,{});null!=o.renewalMutations&&(o.renewalMutations.planId!==o.planId&&!(0,g.Q)(o.renewalMutations.planId)||o.hasExternalPlanChange)&&(n=(0,r.jsx)(z,{subscription:o,renewalMutations:o.renewalMutations,className:K().renewalMutationNotice,analyticsLocation:h}));return(0,r.jsx)("div",{className:c,children:(0,r.jsxs)(p.y5t,{component:(0,r.jsx)(p.vwX,{className:K().sectionTitle,tag:"h1",children:L.Z.Messages.USER_SETTINGS_SUBSCRIPTIONS_HEADER}),children:[S?(0,r.jsx)(J,{}):null,T?(0, r.jsx)(ee,{}):null,x&&null!=w?(0,r.jsx)(te,{daysPastDue:M,subscription:o,openInvoiceId:w.id}):null,n,(0,r.jsxs)("div",{className:K().subscriptionRows,children:[(0,r.jsx)("p",{className:K().sectionDescription,children:L.Z.Messages.BILLING_PAYMENT_PREMIUM_DESCRIPTION}),(0,r.jsx)(j.Z,{subscription:o,renewalInvoicePreview:E,paymentSource:i,busy:s,analyticsLocation:h}),(0,r.jsx)($,{subscription:o,fromStandaloneBillingPage:d,className:K().guildSubscriptionRow})]}),(0,r.jsx)("div",{children:(0,r.jsx)(p.y5t,{component:(0,r.jsx)(p.vwX,{tag:"h5",children:L.Z.Messages.BILLING_STEP_PAYMENT}),children:(0,r.jsxs)("div",{className:K().details,children:[(0,r.jsx)(ne,{subscription:o,renewalInvoicePreview:y,className:K().detailsBlock}),(0,r.jsxs)("div",{className:a()(K().detailsBlock,X({},K().redBorder,T)),children:[(0,r.jsx)(p.vwX,{tag:"h3",className:K().detailBlockHeader,children:o.isPurchasedExternally&&null!=o.paymentGateway?L.Z.Messages.BILLING_MANAGED_BY_PAYMENT_GATEWAY.format({ paymentGatewayName:Z.Vzj[o.paymentGateway]}):L.Z.Messages.BILLING_PAY_FOR_IT_WITH}),(0,r.jsx)(R.Z,{subscription:o,onPaymentSourceAdded:N.i1,highlightAddPaymentMethodButton:S||T,analyticsLocation:h,currentInvoicePreview:E,dropdownClassName:K().paymentDropdown}),(0,r.jsx)("div",{className:K().paymentDropdownFinePrint,children:L.Z.Messages.BILLING_APPLIES_TO_ALL_SUBSCRIPTIONS})]})]})})})]})})}},250740:(e,t,n)=>{"use strict";n.d(t,{R:()=>Z,Z:()=>L});var r=n(785893),o=(n(667294),n(294184)),i=n.n(o),a=n(441143),s=n.n(a),c=n(707961),l=n(665082),u=n(153686),f=n(19585),d=n(296602),p=n(604160),h=n(800336),E=n(551778),y=n(759890),m=n(345392),b=n(850841),g=n(447246),O=n(392649),v=n(203600),_=n(2590),I=n(473708),S=n(812879),T=n.n(S);function N(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function A(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){N(i,r,o,a,s,"next",e)} function s(e){N(i,r,o,a,s,"throw",e)}a(void 0)}))}}function C(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function P(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?n[0]:t.currency,o=!1;1===n.length&&(null==a?void 0:a.id)===t.paymentSourceId&&(0,g.tD)(e.id,r,null==a?void 0:a.id)?o=!0:null==a||(0,b.Z8)()||(o=!0);o?l.O5(t,N):(0,p.Z)({initialPlanId:t.planIdFromItems,analyticsLocations:N,analyticsLocation:S,analyticsObject:M})}},k=b.ZP.getPlanIdFromInvoice(t,o);if((0,h.Q)(k))return null;var G,B=b.ZP.getStatusFromInvoice(t,o),H=b.ZP.getPremiumType(k),V=(C(G={},T().tier0,H===v.p9.TIER_0),C(G,T().tier1,H===v.p9.TIER_1),C(G,T().tier2,H===v.p9.TIER_2),C(G,T().canceled,B===_.O0b.CANCELED),C(G,T().failedPayment,(0,b.zV)(B)),G),F=null;switch(H){case v.p9.TIER_0:F=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.Z,{className:T().discordWordmark,"aria-label":I.Z.Messages.PREMIUM_TIER_0}),(0,r.jsx)("div",{className:T().basicWordmark})]});break;case v.p9.TIER_1:F=(0,r.jsx)(D,{});break;case v.p9.TIER_2:F=(0,r.jsx)(y.Z,{className:T().planName, "aria-label":I.Z.Messages.PREMIUM_TITLE})}return(0,r.jsx)(w,{wordMark:F,subscriptionInfo:function(e){s()(null!=o,"Expected renewalInvoicePreview");return(0,r.jsx)("div",{className:T().planInfo,children:(0,b.qV)({planId:e,subscription:t,renewalInvoicePreview:o})})}(k),buttons:function(){var e=t.status;if(t.isPurchasedExternally){var n=(0,b.JE)(t.paymentGateway,"SUBSCRIPTION_MANAGEMENT");return(0,r.jsx)(c.eee,{href:n,useDefaultUnderlineStyles:!1,children:(0,r.jsx)(c.zxk,{className:i()(T().toolsButton,T().externalButton),size:c.zxk.Sizes.SMALL,look:c.iLD.OUTLINED,color:c.Ttl.WHITE,submitting:d,children:I.Z.Messages.BILLING_MANAGE_SUBSCRIPTION})})}if(b.ZP.isBaseSubscriptionCanceled(t))return(0,r.jsx)(c.zxk,{className:T().toolsButton,size:c.zxk.Sizes.SMALL,look:c.iLD.INVERTED,color:c.Ttl.BRAND,submitting:d,onClick:U,children:I.Z.Messages.RESUBSCRIBE});if(e===_.O0b.ACTIVE||e===_.O0b.PAST_DUE){var o=!1,a=null;if(null!=t.renewalMutations){o=!0 ;a=t.renewalMutations.planId!==t.planId?I.Z.Messages.PREMIUM_SWITCH_PLAN_DISABLED_PENDING_MUTATION_PLAN:I.Z.Messages.PREMIUM_SWITCH_PLAN_DISABLED_PENDING_MUTATION_PREMIUM_GUILD_SUBSCRIPTION}if(null!=t.trialEndsAt){o=!0;a=I.Z.Messages.PREMIUM_SWITCH_PLAN_DISABLED_IN_TRIAL}e===_.O0b.PAST_DUE&&(o=!0);return(0,r.jsxs)("div",{className:T().toolsButtons,children:[(0,r.jsx)(c.zxk,{className:T().toolsButton,size:c.zxk.Sizes.SMALL,look:c.iLD.LINK,color:c.Ttl.WHITE,submitting:d,onClick:Z,children:I.Z.Messages.CANCEL}),(0,r.jsx)(c.ua7,{text:a,children:function(e){return(0,r.jsx)(O.Z,j(P({},e),{disabled:o,className:T().toolsButton,onClick:function(){(0,p.Z)({analyticsLocations:N,analyticsLocation:S,analyticsObject:M})},children:I.Z.Messages.PREMIUM_SWITCH_PLANS}))}})]})}}(),statusClasses:V})}},666800:(e,t,n)=>{"use strict";n.d(t,{Z:()=>U}) ;var r=n(785893),o=n(667294),i=n(294184),a=n.n(i),s=n(441143),c=n.n(s),l=n(202351),u=n(707961),f=n(933599),d=n(665082),p=n(810978),h=n(415324),E=n(700812),y=n(19585),m=n(266472),b=n(793461),g=n(711531),O=n(551778),v=n(850841),_=n(447246),I=n(530562),S=n(100749),T=n(2590),N=n(473708),A=n(57274),C=n.n(A),P=n(913957),j=n.n(P);function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?n[0]:T.pKx.USD},ne=function(e){null!=e&&ee(e,te(e),J)},re=function(e){(0,_.i1)(e.id,(0,I.yb)(s)).then((function(){ee(e,te(e),J)}));"function"==typeof A&&A(e.id)},oe=function(){(0,u.ZDy)(M((function(){var e,t;return L(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(38039),n.e(27059),n.e(84501)]).then(n.bind(n,184501))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,D(function(e){for(var t=1;t0){var ie=O.Z.get(s.planIdForCurrencies);c()(null!=ie,"Unable to fetch plan");var ae=(0,_.DE)(ie,s.paymentSourceId,!1);return(0,r.jsxs)(r.Fragment,{children:[(i=s.paymentSourceId,(0,r.jsx)(E.Z,{prependOption:null==i?{label:N.Z.Messages.ATTACH_PAYMENT_SOURCE_PROMPT_OPTION,value:null}:null,className:R,paymentSources:z,hidePersonalInformation:k,selectedPaymentSourceId:i,onChange:ne,onPaymentSourceAdd:oe,dropdownLoading:K})),null!=s.paymentSourceId?(0,r.jsx)(h.b,{currencies:ae,children:(0,r.jsxs)("div",{ className:a()(C().currency,j().flex,j().alignCenter),children:[(0,r.jsx)("div",{children:N.Z.Messages.PAYMENT_CURRENCY_PAYING_IN}),(0,r.jsx)(h.Z,{className:C().currencyDropdown,selectedCurrency:Q,currencies:ae,onChange:function(e){ee(void 0,e,J)}})]})}):null]})}return(0,r.jsx)(u.zxk,{fullWidth:!0,look:u.zxk.Looks.FILLED,color:P?u.zxk.Colors.BRAND:u.zxk.Colors.PRIMARY,onClick:oe,children:N.Z.Messages.BILLING_ADD_PAYMENT_METHOD})}return(0,r.jsx)(u.$jN,{})}var k,G=(k=M((function(e,t,o){var i;return L(this,(function(a){switch(a.label){case 0:return[4,(0,u.ZDy)(M((function(){var i,a;return L(this,(function(s){switch(s.label){case 0:return[4,n.e(2010).then(n.bind(n,302010))];case 1:i=s.sent(),a=i.default;return[2,function(n){return(0,r.jsx)(a,{newInvoice:e,onConfirm:t,onCancel:o,modalProps:n})}]}}))})),{onCloseRequest:function(){null!=i&&(0,u.Mr3)(i);o()}})];case 1:i=a.sent();return[2]}}))})),function(e,t,n){return k.apply(this,arguments)})},282196:(e,t,n)=>{"use strict";n.d(t,{RE:()=>M, T5:()=>D,Xb:()=>Z,aE:()=>L,cD:()=>U,s9:()=>k,zM:()=>G,zy:()=>B,S5:()=>H,t9:()=>V,fy:()=>F,vv:()=>Y,YK:()=>W,tr:()=>K,FJ:()=>q,bu:()=>X,_f:()=>Q});n(496486);var r=n(608575),o=n(281110),i=n(580085),a=n(630631),s=n(665472),c=n(84894),l=n(883064),u=n(550131),f=n(769321),d=n(382060),p=n(567403),h=n(736097),E=n(598123),y=n(491260),m=n(473903),b=n(407561),g=n(773148),O=n(968696),v=n(860872),_=n(425636),I=n(2590);function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]1&&void 0!==arguments[1]?arguments[1]:[];return t.indexOf(e)>-1}function D(e,t){var n=[],r=e.getGuildId();[I.d4z.GUILD_CATEGORY].concat(A(d.tx)).includes(e.type)||n.push(new Promise((function(t){E.Z.whenReady(e.id,(function(){return t()}));s.Z.fetchMessages({channelId:e.id,limit:I.AQB})})));return Promise.all(n).then((function(){var n,o=(!e.isNSFW()||!0===(null===(n=m.default.getCurrentUser())||void 0===n?void 0:n.nsfwAllowed))&&t?E.Z.getMessages(e.id).toArray().map(Z):[],i=Object.values(b.Z.getVoiceStatesForChannel(e.id)).map((function(t){return L(r,e.id,t)}));return{id:e.id,name:e.name,type:e.type,topic:e.topic,bitrate:e.bitrate,user_limit:e.userLimit,guild_id:r,position:e.position,messages:o,voice_states:i} }))}function Z(e){var t=l.Z.parseToAST(e.content,!0,{channelId:e.channel_id}).map(x),n=(0,u.ZH)(e),r=n.colorString,o=n.nick;return{id:e.id,blocked:e.blocked,bot:e.bot,content:e.content,content_parsed:t.length?t:void 0,nick:o,author_color:r,edited_timestamp:e.edited_timestamp||e.editedTimestamp,timestamp:e.timestamp,tts:e.tts,mentions:e.mentions,mention_everyone:e.mention_everyone||e.mentionEveryone,mention_roles:e.mention_roles||e.mentionRoles,embeds:e.embeds,attachments:e.attachments,author:e.author?(0,_.Z)(e.author):void 0,pinned:e.pinned,type:e.type}}function L(e,t,n){var r=n.mute,o=n.deaf,i=n.selfMute,a=n.selfDeaf,s=n.suppress,c=n.userId,l=m.default.getUser(c);if(null==l)throw new Error("Invalid user id: ".concat(c));return{nick:g.Z.getName(e,t,l),mute:h.Z.isLocalMute(l.id),volume:h.Z.getLocalVolume(l.id),pan:h.Z.getLocalPan(l.id),voice_state:{mute:r,deaf:o,self_mute:i,self_deaf:a,suppress:s},user:(0,_.Z)(l)}}function U(e,t,n){var r=m.default.getUser(t);return{type:e, user:null!=r?(0,_.Z)(r):null,presence:{status:y.Z.getStatus(t),activity:null!=n?y.Z.getApplicationActivity(t,n):y.Z.getPrimaryActivity(t)}}}function k(e){if(null==e)return!1;var t,n=window.location.origin;if(e===n)return!0;try{t=r.parse(e).hostname}catch(e){return!1}return window.location.hostname===t&&"localhost"===t||null==e.match("staging")&&!(!j.test(e)||!j.test(n))}function G(e,t,n){var r=p.Z.getGuild(e.getGuildId());return(null!=r?r.getApplicationId():e.getApplicationId())===t||n.indexOf(I.xVR.MESSAGES_READ)>-1}function B(e){switch(e){case I.hes.RTC_CONNECTED:case I.hes.RTC_CONNECTING:case I.hes.RTC_DISCONNECTED:return e.replace(/^RTC_/,"VOICE_");default:return e}}function H(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.instance,r=e.secrets,o=e.party,i=0;n&&(i|=I.xjy.INSTANCE);null!=(null==r?void 0:r.join)&&(i|=I.xjy.JOIN);if(t){i|=I.xjy.EMBEDDED;return i|=I.xjy.PARTY_PRIVACY_VOICE_CHANNEL} if((null==o?void 0:o.privacy)===I.RYY.PUBLIC||a.Z.get("ACTIVITIES_FORCE_PUBLIC")){f.cP.getSetting()&&(i|=I.xjy.PARTY_PRIVACY_FRIENDS);f.Ou.getSetting()&&(i|=I.xjy.PARTY_PRIVACY_VOICE_CHANNEL)}return i}function V(e,t,n){return e===I.mFx.JOIN&&(null!=t&&null!=t.id&&null!=n.join)}function F(e,t,n){return o.Z.get({url:I.ANM.APPLICATION_RPC(t),oldFormErrors:!0,retries:3}).then((function(r){var o=r.body,i=o.rpc_origins,a=o.id,s=o.name,l=o.icon,u=o.cover_image,f=o.flags;if("string"==typeof n)if(e.transport===I.Hej.POST_MESSAGE){var d=(0,c.Z)(t);if(null==d||!w(n,[d]))throw new v.Z(I.$VG.INVALID_ORIGIN,"Invalid Origin")}else if(!w(n,i))throw new v.Z(I.$VG.INVALID_ORIGIN,"Invalid Origin");e.application={id:a,name:s,icon:l,coverImage:u,flags:f}}),(function(){throw new v.Z(I.$VG.INVALID_CLIENTID,"Invalid Client ID")}))}function Y(e,t){return z.apply(this,arguments)}function z(){return(z=N((function(e,t){var n,r;return C(this,(function(o){switch(o.label){case 0:if(null==(n=R[e])){r=t?2:60 ;n=new i.Z(r,6e4);R[e]=n}return[4,n.process()];case 1:o.sent();return[2]}}))}))).apply(this,arguments)}function W(e,t){null==t&&(e.authorization.scopes=[I.lHf])}function K(e){var t=h.Z.getSettings(),n=function(e){return Object.values(e).sort((function(e,t){return e.index-t.index})).map((function(e){return{id:e.id,name:e.name}}))},r=e(t);return{input:{available_devices:n(h.Z.getInputDevices()),device_id:t.inputDeviceId,volume:t.inputVolume},output:{available_devices:n(h.Z.getOutputDevices()),device_id:t.outputDeviceId,volume:t.outputVolume},mode:{type:t.mode,auto_threshold:t.modeOptions.autoThreshold,threshold:t.modeOptions.threshold,shortcut:r,delay:t.modeOptions.delay},automatic_gain_control:t.automaticGainControl,echo_cancellation:t.echoCancellation,noise_suppression:t.noiseSuppression,qos:t.qos,silence_warning:t.silenceWarning,deaf:t.deaf,mute:t.mute}}function q(e,t){var n=h.Z.getSettings(e),r=t(n);return{input_mode:{type:n.mode,shortcut:r},local_mutes:Object.keys(n.localMutes), local_volumes:n.localVolumes,self_mute:n.mute,self_deaf:n.deaf}}function X(e){if(e!==I.Hej.POST_MESSAGE)throw new v.Z(I.lTL.INVALID_COMMAND,'command not available from "'.concat(e," transport"))}function Q(e){if(null==e.id)throw new v.Z(I.lTL.INVALID_COMMAND,"Invalid application")}},196389:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(2590);function o(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function i(e){for(var t=1;t{"use strict";n.d(t,{Z:()=>s});var r=n(496486),o=n.n(r),i=n(860872),a=n(2590);var s=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);this.transport=t;this.version=n;this.encoding=r;this.id=o().uniqueId() ;this.authorization={authing:!1,scopes:[],accessToken:null,expires:new Date(0)};this.application={id:null,name:null,icon:null};if(null==n||n>a.X6Q||n<1)throw new i.Z(a.$VG.INVALID_VERSION,"Invalid Version: ".concat(n))}},232949:(e,t,n)=>{"use strict";n.d(t,{s0:()=>p,em:()=>y,_X:()=>m,GC:()=>b});var r=n(993754),o=n(304275),i=n(310126),a=n(79251),s=n(860872),c=n(282196),l=n(2590);function u(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}var f=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]) ;switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{ "use strict";n.d(t,{Z:()=>R});var r=n(348764),o=n(717187),i=n.n(o),a=n(496486),s=n.n(a),c=n(296602),l=n(310126),u=n(196389),f=n(731458),d=n(232949),p=n(2590);function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e){E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return E(e)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&b(e,t)}function m(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e,t){b=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return b(e,t)}var g=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e} ;function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=E(e);if(t){var o=E(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return m(this,n)}}var v,_=l.default.requireModule("discord_rpc").RPCIPC,I=new c.Z("RPCServer:IPC"),S={HANDSHAKE:0,FRAME:1,CLOSE:2,PING:3,PONG:4};function T(e,t){null!=e.setHandshakeComplete?e.setHandshakeComplete(t):e._didHandshake=t}function N(e){return null!=e.getHandshakeComplete?e.getHandshakeComplete():e._didHandshake}function A(e){return new Promise((function(t,n){"string"==typeof e&&(e=_.net.createConnection(e));e.pause();e.on("readable",(function(){try{P(e)}catch(t){e.end(C(S.CLOSE,{code:1003,message:t.message}));e.destroy()}}));var r=function(){try{e.end();e.destroy()}catch(e){} },o=Promise.race([new Promise((function(t){return e.on("error",(function(){return t()}))})),new Promise((function(t,n){e.on("pong",(function(){return n(new Error("socket responded with pong"))}))})),new Promise((function(e,t){setTimeout((function(){return t(new Error("socket alive timeout"))}),1e3)}))]).then((function(){r()}),(function(e){r();throw e}));e.write(C(S.PING,s().uniqueId()));return o.then(t,n)}))}function C(e,t){t=JSON.stringify(t);var n=r.Buffer.byteLength(t),o=r.Buffer.alloc(8+n);o.writeInt32LE(e,0);o.writeInt32LE(n,4);o.write(t,8,n);return function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}(o)}function P(e){var t=e.read(8);if(t){var n=(t=r.Buffer.from(t)).readInt32LE(0),o=t.readInt32LE(4);if(!Object.values(S).includes(n)||o<0)throw new Error("protocol error");if(!(t=e.read(o)))throw new Error("data size does not match what was received");t=r.Buffer.from(t);var i=JSON.parse(t.toString());switch(n){case S.PING:e.emit("ping",i);e.write(C(S.PONG,i)) ;break;case S.PONG:e.emit("pong",i);break;case S.HANDSHAKE:if(N(e))throw new Error("already did handshake");T(e,!0);e.emit("handshake",i);break;case S.FRAME:if(!N(e))throw new Error("did not handshake");e.emit("request",i);break;case S.CLOSE:e.end();e.destroy()}P(e)}}var j=function(e){y(n,e);var t=O(n);function n(e,r,o){h(this,n);var i;(i=t.call(this,"ipc",r,o))._socket=e;return i}var r=n.prototype;r.send=function(e){I.info("Socket Emit: ".concat(this.id),(0,u.Z)(e));this._socket.write(C(S.FRAME,e))};r.close=function(e,t){this._socket.end(C(S.CLOSE,{code:e,message:t}));this._socket.destroy()};return n}(f.Z);const R=new(function(e){y(n,e);var t=O(n);function n(){h(this,n);var e;e=t.call(this);(v=_.net.createServer((function(t){return e.handleConnection(t)}))).on("error",(function(e){return I.error("Error: ".concat(e.message))}));_.getAvailableSocket(A).then((function(e){v.listen(e,(function(){ ("function"==typeof v.listening?v.listening():v.listening)&&I.info("Starting on ".concat(v.address()))}))}));return e}n.prototype.handleConnection=function(e){var t=this;T(e,!1);e.pause();e.on("readable",(function(){try{P(e)}catch(t){e.end(C(S.CLOSE,{code:p.$VG.CLOSE_UNSUPPORTED,message:t.message}));e.destroy()}}));e.once("handshake",(function(n){var r,o=n.client_id,i=+n.v;try{r=new j(e,i,"json")}catch(t){e.end(C(S.CLOSE,{code:t.code,message:t.message}));e.destroy();return}I.info("Socket Opened: ".concat(r.id));e.on("error",(function(e){return I.error("Socket Error: ".concat(e.message))}));e.on("close",(function(){I.info("Socket Close: ".concat(r.id));t.emit("disconnect",r)}));(0,d.em)(r,null,o).then((function(){e.on("request",(function(e){I.info("Socket Message: ".concat(r.id),(0,u.Z)(e));t.emit("request",r,e)}));t.emit("connect",r)})).catch((function(e){var t=e.code,n=e.message;return r.close(t,n)}))}))};return n}(i()))},907709:(e,t,n)=>{"use strict";n.d(t,{Z:()=>V}) ;var r=n(717187),o=n.n(r),i=n(496486),a=n.n(i),s=n(817673),c=n(608575),l=n(744564),u=n(296602),f=n(118044),d=n(310126),p=n(860872),h=n(196389),E=n(731458),y=n(232949),m=n(2590),b=n(348764).Buffer;function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:0,t=e>0?void 0:function(){if(L(x.listening)){var e=x.address().port;D.info("Starting on ".concat(e));l.Z.dispatch({type:"RPC_SERVER_READY",port:e})}};x.listen(m.V6Z+e%m.frH,"127.0.0.1",t)}function k(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:200,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=L(e.headers).origin?{"Access-Control-Allow-Origin":L(e.headers).origin,"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Methods":"POST, GET, PUT, PATCH, DELETE","Access-Control-Allow-Headers":["Content-Type","Authorization"].join(", ")}:{};n=n?JSON.stringify(n):"";r=200!==r||n.length?r:204;t.setHeader("Content-Length",b.byteLength(n));t.setHeader("Content-Type","application/json") ;t.writeHead(r,T({},o,i));t.end(n)}function G(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;k(e,t,{code:o,message:r},n)}var B=function(e){S(n,e);var t=R(n);function n(e,r,o){v(this,n);var i;i=t.call(this,"ws",r,o);if(-1===["etf","json"].indexOf(o))throw new p.Z(m.$VG.INVALID_ENCODING,"Invalid Encoding: ".concat(o));if("etf"===o&&null==P)throw new p.Z(m.$VG.INVALID_ENCODING,"Erlpack cannot be used on this client");i._socket=e;return i}var r=n.prototype;r.send=function(e){(f.default.isLoggingOverlayEvents||e.cmd!==m.Etm.OVERLAY&&e.evt!==m.zMe.OVERLAY)&&D.info("Socket Emit: ".concat(this.id),(0,h.Z)(e));null!=P&&"etf"===this.encoding?this._socket.send(P.pack(e),{binary:!0}):this._socket.send(JSON.stringify(e))};r.close=function(e,t){this._socket.close(e,t)};return n}(E.Z),H=function(e){S(n,e);var t=R(n);function n(e,r,o,i){v(this,n);var a;a=t.call(this,"http",o,i);if("json"!==i)throw new p.Z(m.$VG.INVALID_ENCODING,"Invalid Encoding: ".concat(i));a._sendCallback=e ;a._closeCallback=r;return a}var r=n.prototype;r.send=function(e){(f.default.isLoggingOverlayEvents||e.cmd!==m.Etm.OVERLAY)&&D.info("Socket Emit: ".concat(this.id),e);this._sendCallback(e)};r.close=function(e,t){this._closeCallback(t,e)};return n}(E.Z);const V=new(function(e){S(n,e);var t=R(n);function n(){v(this,n);var e;e=t.call(this);var r=0;(x=M.http.createServer()).on("error",(function(e){D.error("Error: ".concat(e.message));("EADDRINUSE"===e.code||e.message.includes("EADDRINUSE"))&&setTimeout((function(){return U(++r)}),1e3)}));x.on("request",e.handleRequest.bind(O(e)));U(r);var o={instanceId:x.instanceId||0,server:x};new M.ws.Server(o).on("connection",(function(t){return e.handleConnection(t)}));return e}var r=n.prototype;r.handleRequest=function(e,t){var n=this,r=C(L(e.url).split("?"),2),o=r[0],i=r[1],a=L(e.method);if("/rpc"!==o||"OPTIONS"!==a){var l="POST"===a;if("/rpc"!==o||"GET"!==a&&!l)G(e,t,404,"Not Found");else{ var u=s.parse(i),f=l?L(e.headers)["content-type"].split("/")[1]:"json",d=function(){var e=c.parse(u.callback),n=e.protocol,r=e.host;n===location.protocol&&r===location.host?t.setHeader("Location",u.callback):t.setHeader("Location",w);t.writeHead(301);t.end()},p=new H(l?k.bind(null,e,t):d,l?G.bind(null,e,t,400):d,+u.v,f);if(l)(0,y.em)(p,L(e.headers).origin,u.client_id).then((function(){var r="";e.on("data",(function(e){return r+=e}));e.on("error",(function(){return G(e,t,500,"Internal Server Error")}));e.on("end",(function(){return n.handleMessage(p,r)}))})).catch((function(e){var t=e.code,n=e.message;return p.close(t,n)}));else{p.authorization.scopes=[m.CND];this.handleMessage(p,decodeURIComponent(u.payload))}}}else k(e,t,{body:""})};r.handleConnection=function(e){var t,n=this,r=s.parse(L(e.upgradeReq).url.split("?")[1]),o=L(e.upgradeReq).headers.origin||"";try{t=new B(e,+r.v,r.encoding||"json")}catch(t){e.close(t.code,t.message);return}D.info("Socket Opened: ".concat(t.id)) ;e.on("error",(function(e){return D.error("WS Error: ".concat(e.message))}));e.on("close",(function(e,r){D.info("Socket Closed: ".concat(t.id,", code ").concat(e,", message ").concat(r));a().remove(Z,(function(e){return e===t}));n.emit("disconnect",t)}));(0,y.em)(t,o,r.client_id).then((function(){Z.push(t);e.on("message",(function(e){return n.handleMessage(t,e)}));n.emit("connect",t)})).catch((function(e){var n=e.code,r=e.message;return t.close(n,r)}))};r.handleMessage=function(e,t){var n;try{if(null!=P&&"etf"===e.encoding)n=P.unpack(t);else{if("string"!=typeof t)throw new Error;n=JSON.parse(t)}}catch(t){e.close(m.$VG.CLOSE_UNSUPPORTED,"Payload not ".concat(e.encoding));return}(f.default.isLoggingOverlayEvents||n.cmd!==m.Etm.OVERLAY)&&D.info("Socket Message: ".concat(e.id),(0,h.Z)(n));this.emit("request",e,n)};return n}(o()))},938058:(e,t,n)=>{"use strict";n.d(t,{f:()=>r,q:()=>o}) ;var r=200,o=[0,.25,.5,.75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25,4.5,4.75,5,5.25,5.5,5.75,6,6.25,6.5,6.75,7,7.25,7.5,7.75,8,8.25,8.5,8.75,9,9.25,9.5,9.75,10]},42261:(e,t,n)=>{"use strict";n.d(t,{vG:()=>i,M0:()=>a,Od:()=>s});var r,o=n(473708),i="emails";!function(e){e.COMMUNICATION="communication";e.SOCIAL="social";e.TIPS="tips";e.RECOMMENDATIONS_AND_EVENTS="recommendations_and_events";e.UPDATES_AND_ANNOUNCEMENTS="updates_and_announcements"}(r||(r={}));var a=[r.TIPS,r.RECOMMENDATIONS_AND_EVENTS,r.UPDATES_AND_ANNOUNCEMENTS],s=[{category:r.COMMUNICATION,label:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_COMMUNICATION},subLabel:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_COMMUNICATION_SUBLABEL}},{category:r.SOCIAL,label:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_SOCIAL},subLabel:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_SOCIAL_SUBLABEL}},{category:r.UPDATES_AND_ANNOUNCEMENTS,label:function(){ return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_UPDATES_AND_ANNOUNCEMENTS},subLabel:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_UPDATES_AND_ANNOUNCEMENTS_SUBLABEL}},{category:r.TIPS,label:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_TIPS},subLabel:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_TIPS_SUBLABEL}},{category:r.RECOMMENDATIONS_AND_EVENTS,label:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_RECOMMENDATIONS_AND_EVENTS},subLabel:function(){return o.Z.Messages.USER_SETTINGS_EMAIL_CATEGORY_RECOMMENDATIONS_AND_EVENTS_SUBLABEL}}]},96483:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var r=n(202351),o=n(744564);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function s(e){s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){ return e.__proto__||Object.getPrototypeOf(e)};return s(e)}function c(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e,t){l=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return l(e,t)}var u=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var o=s(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}var d={},p=null;function h(){d={};p=null}var E=function(e){!function(e,t){ if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&l(e,t)}(n,e);var t=f(n);function n(){i(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getEmailSettings=function(){return{categories:d,initialized:p}};r.__getLocalVars=function(){return{categories:d,initialized:p}};return n}(r.ZP.Store);E.displayName="EmailSettingsStore";const y=new E(o.Z,{CONNECTION_OPEN:h,LOGOUT:h,EMAIL_SETTINGS_FETCH_SUCCESS:function(e){var t=e.settings;d=t.categories;p=t.initialized},EMAIL_SETTINGS_UPDATE_SUCCESS:function(e){var t=e.settings;d=t.categories},EMAIL_SETTINGS_UPDATE:function(e){var t=e.updates;d=function(e){for(var t=1;t{"use strict";n.d(t,{X:()=>l});var r=n(202351),o=n(53645),i=n(130962),a=n(473903),s=(0,n(260561).B)({kind:"user",id:"2022-10_crunchyroll_connection",label:"Crunchyroll connection",defaultConfig:{enabled:!1},treatments:[{id:1,label:"Enable Crunchyroll connection",config:{enabled:!0}}]}),c=n(2590),l=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=i.c.useExperiment({}).allowPlayStationStaging,n=s.useExperiment({}).enabled,l=(0,r.e7)([a.default],(function(){return a.default.getCurrentUser()}));return function(r){var i;return r.type===c.ABu.PLAYSTATION_STAGING?t:r.type===c.ABu.CRUNCHYROLL?n:!(void 0===l||!(null===(i=o.bO[r.type])||void 0===i?void 0:i.includes(l.id)))||(!!e||r.enabled)}}},517672:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(785893),o=(n(667294),n(294184)),i=n.n(o),a=n(707961),s=n(895724),c=n(404576),l=n.n(c) ;function u(e){var t=e.children,n=e.className;return(0,r.jsxs)("div",{className:i()(l().root,n),children:[(0,r.jsx)(s.Z,{className:l().info}),(0,r.jsx)(a.xvT,{className:l().text,variant:"text-sm/medium",color:"text-normal",children:t})]})}},265508:(e,t,n)=>{"use strict";n.d(t,{Z:()=>I});var r=n(785893),o=n(667294),i=n(441143),a=n.n(i),s=n(202351),c=n(707961),l=n(84441),u=n(895303),f=n(473903),d=n(473708);function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function E(e){E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return E(e)}function y(e){for(var t=1;t{"use strict";n.d(t,{Z:()=>M});var r=n(785893),o=n(667294),i=n(165695),a=n(707961),s=n(130671),c=n(2590),l=n(473708);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function O(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function v(e,t){v=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return v(e,t)}function _(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,o,i=[],a=!0,s=!1 ;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(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.")}()}var I=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function S(e){var t="function"==typeof Map?new Map:void 0;S=function(e){if(null===e||!(n=e,-1!==Function.toString.call(n).indexOf("[native code]")))return e;var n ;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return h(e,arguments,y(this).constructor)}r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}});return v(r,e)};return S(e)}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return O(this,n)}}var N=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i ;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";n.r(t);n.d(t,{default:()=>O});var r=n(785893),o=n(667294),i=n(202351),a=n(707961),s=n(579194),c=n(450383),l=n(98265),u=n(973646),f=n(2590),d=n(473708),p=n(550478),h=n.n(p);function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";n.d(t,{Z:()=>mC});var r=n(785893),o=n(667294),i=n(999357),a=n(418705),s=n(336194),c=n(707961),l=n(744564),u=n(84441),f=n(579194),d=n(734691),p=n(888312),h=n(604375),E=n(19585),y=n(202351),m=n(384411),b=n(468235),g=n(335072),O=n(294184),v=n.n(O),_=n(476893),I=n.n(_) ;function S(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function T(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function C(e){var t=e.title,n=e.note,o=e.children,i=e.className;return(0,r.jsxs)("div",{className:v()(I().inputItem,i),children:[(0,r.jsxs)("div",{className:I().inputItemText,children:[(0,r.jsx)(c.xvT,{className:I().inputItemTitle,variant:"text-md/semibold",color:"interactive-active",children:t}),null!=n&&(0,r.jsx)(c.xvT,{className:I().note,variant:"text-sm/medium",color:"header-secondary",children:n})]}),o]})}function P(e){var t=e.options,n=e.value,o=e.select,i=e.selectClassName,a=A(e,["options","value","select","selectClassName"]);return(0,r.jsx)(C,N(T({},a),{children:(0,r.jsx)(c.PhF,{className:v()(I().selectControl,i),options:t,isSelected:function(e){return e===n},select:o, serialize:function(e){return String(e)}})}))}function j(e){var t=e.value,n=e.onChange,o=e.editable,i=e.textInputClassName,a=e.onClick,s=A(e,["value","onChange","editable","textInputClassName","onClick"]);return(0,r.jsx)(C,N(T({},s),{children:(0,r.jsx)(c.oil,{onClick:a,editable:o,className:v()(I().selectControl,i),value:t,onChange:n})}))}var R=n(453790),x=n(473708),M=n(764147),w=n.n(M);function D(){var e=(0,y.e7)([g.Z],(function(){return g.Z.getSettings()})),t=e.viewerClipsEnabled,n=e.viewerConnectivity,i=(0,y.e7)([m.default],(function(){return m.default.locale})),a=o.useMemo((function(){return[{value:R.dJ.ALL,label:x.Z.Messages.CLIPS_CONNECTIVITY_ALL},{value:R.dJ.FRIENDS,label:x.Z.Messages.CLIPS_CONNECTIVITY_FRIENDS}]}),[i]);return(0,r.jsxs)(c.hjN,{children:[(0,r.jsx)(c.j7V,{className:w().formItem,hideBorder:!0,value:t,note:x.Z.Messages.CLIPS_SETTINGS_ALLOW_VIEWER_CLIPS_HELP,onChange:b.yl,children:x.Z.Messages.CLIPS_SETTINGS_ALLOW_VIEWER_CLIPS}),(0,r.jsx)(P,{className:w().formItem, title:x.Z.Messages.CLIPS_SETTINGS_WHO_CAN_CAPTURE,note:x.Z.Messages.CLIPS_SETTINGS_WHO_CAN_CAPTURE_HELP,value:n,select:b.QM,options:a})]})}var Z=n(441143),L=n.n(Z),U=n(731503),k=n(164045),G=n(138049),B=n(2590),H=n(494628),V=n.n(H),F=n(102670),Y=n.n(F);function z(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function W(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function K(){var e=(0,y.cj)([g.Z],(function(){return g.Z.getSettings()})),t=e.clipsEnabled,n=e.clipsQuality,i=e.clipsLength,a=(0,y.e7)([G.Z],(function(){ return G.Z.getKeybindForAction(B.kg4.SAVE_CLIP,!0)}));L()(null!=a,"Save clip keybind unset");var s=(0,y.e7)([m.default],(function(){return m.default.locale})),l=o.useMemo((function(){return[{value:R.Rp.DEFAULT,label:x.Z.Messages.CLIPS_QUALITY_DEFAULT}]}),[s]),u=o.useMemo((function(){return[{value:R.OT.SECONDS_30,label:x.Z.Messages.CLIPS_LENGTH_SECONDS.format({count:30})},{value:R.OT.MINUTES_1,label:x.Z.Messages.CLIPS_LENGTH_MINUTES.format({count:1})},{value:R.OT.MINUTES_2,label:x.Z.Messages.CLIPS_LENGTH_MINUTES.format({count:2})}]}),[s]),f=o.useCallback((function(e){U.Z.setKeybind(W(function(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&b.T1(e[0]);return[2]}}))})),onChange:B.VqG})})}var ee=n(796631),te=n.n(ee);function ne(){var e=(0,E.Z)().AnalyticsLocationProvider;return(0,r.jsx)(e,{children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)(c.X6q,{variant:"heading-lg/extrabold",children:x.Z.Messages.CLIPS_CLIPPING}),children:[(0,r.jsx)(c.xvT,{className:te().subHeader,variant:"text-sm/medium",color:"header-secondary", children:x.Z.Messages.CLIPS_SETTINGS_TOP_SUBHEADER}),(0,r.jsxs)("form",{className:te().form,onSubmit:function(e){return e.preventDefault()},children:[(0,r.jsx)(K,{}),(0,r.jsx)(c.$i$,{className:Y().formItem}),(0,r.jsx)(D,{}),(0,r.jsx)(c.$i$,{className:Y().formItem}),(0,r.jsx)(J,{})]})]})})}var re=n(630631),oe=n(917019),ie=n(473419),ae=n(107364),se=n(190186),ce=n(98265),le=n(256764),ue=n(518280),fe=n.n(ue);function de(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:fe().marginBottom20,children:(0,r.jsx)(c.vwX,{children:"Recent Overrides"})}),(0,r.jsx)(Ee,{items:p,dismissedContents:s,handleChange:d})]}):null,(0,r.jsx)(ae.Z,{className:v()(fe().marginBottom20,fe().marginTop20),children:(0,r.jsx)(c.vwX,{children:"Available Dismissible Contents"})}),(0,r.jsx)(Ee,{items:h,dismissedContents:s,handleChange:d}),(0,r.jsx)(c.zxk,{look:c.zxk.Looks.LINK,onClick:oe.sr,children:"Clear All Dismissed Contents"})]})}var me=n(270946),be=n(482139),ge=n(825781),Oe=n(785085),ve=n(496486),_e=n.n(ve),Ie=n(513328),Se=n(735885),Te=n(316878),Ne=n(776009),Ae=n(270307),Ce=n(136317),Pe=n(382518),je=n(930948),Re=n(716118),xe=n(998330),Me=n(494425),we=n(214142),De=n(533293),Ze=n(677483),Le=n(72580),Ue=n(896971),ke=n(730381),Ge=n.n(ke),Be=n(70145),He=n(17229),Ve=n(807891),Fe=n.n(Ve);function Ye(e){var t=e.achievementId,n=e.dateUnlocked,o=(0,Me.oX)(t);if(null==o)return null ;var i=null!=n,a=o.name,s=o.description,l=o.hideDescriptionUntilUnlock,u=o.onAction,f=l&&!i,d=i?"header-primary":"text-muted",p=i?"header-secondary":"text-muted",h=Ge()(n),E=null!=u&&i,y=E?c.P3F:"div";return(0,r.jsxs)(y,{className:v()(Fe().container,E&&Fe().actionable),onClick:function(){E&&u()},children:[(0,r.jsx)("div",{className:Fe().iconContainer,children:(0,r.jsx)(He.Z,{achievementId:t,size:He.Z.Sizes.SIZE_40,unlocked:i})}),(0,r.jsxs)("div",{className:Fe().nameContainer,children:[null!=n&&(0,r.jsx)(c.xvT,{variant:"text-xxs/semibold",color:"text-muted",className:Fe().unlocked,children:(0,Be.Y4)(h)}),(0,r.jsx)(c.xvT,{variant:"text-md/medium",color:d,children:a()}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:p,children:f?"?????":s()})]})]})}var ze=n(184671),We=n.n(ze);function Ke(e){var t=e.onBackClick,n=(0,y.e7)([Ue.Z],(function(){return Ue.Z.getAllUnlockedAchievements()})),i=o.useMemo((function(){return Object.values(n).sort((function(e,t){return t.dateUnlocked-e.dateUnlocked }))}),[n]),a=o.useMemo((function(){return Object.values(Me.LG).filter(Le.lm).filter((function(e){return null==n[e.id]})).sort((function(e,t){return e.rarity-t.rarity}))}),[n]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.hjN,{children:(0,r.jsxs)(c.P3F,{onClick:t,className:We().backContainer,children:[(0,r.jsx)(Ze.Z,{direction:Ze.Z.Directions.LEFT,className:We().icon}),(0,r.jsx)(c.xvT,{variant:"text-lg/normal",color:"text-normal",children:x.Z.Messages.BACK})]})}),(0,r.jsxs)("div",{className:We().headerContainer,children:[(0,r.jsxs)("div",{className:We().headerTextContainer,children:[(0,r.jsx)(c.X6q,{variant:"heading-lg/extrabold",color:"header-primary",children:x.Z.Messages.POGGERMODE_ACHIEVEMENT_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"header-secondary",children:x.Z.Messages.POGGERMODE_ACHIEVEMENT_DESCRIPTION})]}),(0,r.jsx)("div",{className:We().headerIcon,children:(0,r.jsx)(Pe.Z,{color:s.Z.unsafe_rawColors.ORANGE_345.css,width:40,height:40})})]}),i.length>0&&(0, r.jsx)(c.hjN,{className:We().divider,children:(0,r.jsx)("div",{className:We().achievementGrid,children:i.map((function(e){var t=e.achievementId,n=e.dateUnlocked;return(0,r.jsx)(Ye,{achievementId:t,dateUnlocked:n},t)}))})}),a.length>0&&(0,r.jsxs)(c.hjN,{className:We().divider,children:[(0,r.jsx)("div",{className:We().headerTextContainer,children:(0,r.jsx)(c.xvT,{variant:"text-md/bold",color:"header-secondary",children:x.Z.Messages.POGGERMODE_ACHIEVEMENT_LOCKED_TITLE})}),(0,r.jsx)("div",{className:We().achievementGrid,children:a.map((function(e){return(0,r.jsx)(Ye,{achievementId:e.id},e.id)}))})]}),(0,r.jsx)(c.hjN,{className:We().divider,children:(0,r.jsx)("div",{className:We().bottomPadding})})]})}var qe=n(991789),Xe=n(69540),Qe=n(631696),$e=n.n(Qe);function Je(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ni&&(0,xe.T)(Me.hn.MORE);s(e,t)}({shakeIntensity:e},ot.SHAKE)},onMarkerRender:function(e){return e===ct[ct.length-1]?x.Z.Messages.POGGERMODE_SCREENSHAKE_MAX:"".concat(100*e,"%")}})]}),(0,r.jsx)(ft,{disabled:u,locations:[{ location:Xe.oZ.CHAT_INPUT,title:x.Z.Messages.POGGERMODE_SCREENSHAKE_LOCATION_CHAT_INPUT_ENABLED,description:x.Z.Messages.POGGERMODE_SCREENSHAKE_LOCATION_CHAT_INPUT_ENABLED_DESCRIPTION},{location:Xe.oZ.VOICE_USER,title:x.Z.Messages.POGGERMODE_SCREENSHAKE_LOCATION_VOICE_USER_ENABLED,description:x.Z.Messages.POGGERMODE_SCREENSHAKE_LOCATION_VOICE_USER_ENABLED_DESCRIPTION},{location:Xe.oZ.MENTION,title:x.Z.Messages.POGGERMODE_SCREENSHAKE_LOCATION_MENTION_ENABLED,description:x.Z.Messages.POGGERMODE_SCREENSHAKE_LOCATION_MENTION_ENABLED_DESCRIPTION}],settingsLocations:a,onChange:function(e){return s({screenshakeEnabledLocations:e},ot.SHAKE)}})]})}function mt(e){var t=e.updateSettings;return(0,r.jsx)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.POGGERMODE_SETTINGS_CUSTOMIZATION,children:(0,r.jsxs)(c.xJW,{className:$e().formItem,children:[(0,r.jsx)(c.R94,{className:$e().formItem,children:x.Z.Messages.POGGERMODE_HIDE_SETTINGS_DESCRIPTION}),(0,r.jsx)(c.zxk,{className:$e().hideButton, size:c.zxk.Sizes.SMALL,onClick:function(){t({enabled:!1,settingsVisible:!1});(0,Se.xf)()},children:x.Z.Messages.POGGERMODE_HIDE_SETTINGS})]})})}function bt(e){var t=e.onChangePage;return(0,r.jsxs)(c.hjN,{children:[(0,r.jsxs)(c.P3F,{onClick:function(){return t(it.ACHIEVEMENT_LIST)},className:$e().achievementContainer,children:[(0,r.jsx)("div",{className:$e().achievementIconContainer,children:(0,r.jsx)(Pe.Z,{color:s.Z.unsafe_rawColors.ORANGE_345.css})}),(0,r.jsxs)("div",{className:$e().achievementTextContainer,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",color:"header-primary",children:x.Z.Messages.POGGERMODE_ACHIEVEMENT_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-md/normal",color:"header-secondary",children:x.Z.Messages.POGGERMODE_ACHIEVEMENT_DESCRIPTION})]}),(0,r.jsx)(Ce.Z,{width:16,className:$e().rightCaretIcon})]}),(0,r.jsx)(c.$i$,{className:$e().divider})]})}var gt=function(){return n.e(37948).then(n.t.bind(n,394198,19)).then((function(e){return e.default}))};function Ot(e){ var t=e.onChangePage,n=e.setShowEnableAnimation,i=function(e,t,n,r){return(null!=t?t:e)&&(null!=r?r:n)},a=(0,y.cj)([Oe.Z],(function(){return Oe.Z.getState()})),s=o.useRef(new Ie.V7),l=rt(o.useState(!1),2),u=l[0],f=l[1],d=rt(o.useState({x:0,y:0}),2),p=d[0],h=d[1],E=function(e,t){!function(e){if(e.enabled&&!1===a.enabled){n(!0);(0,Re.GN)("poggermode_enabled");var t;je.S.dispatch(B.CkL.SHAKE_APP,{duration:2e3,intensity:null!==(t=e.shakeIntensity)&&void 0!==t?t:a.shakeIntensity})}}(e);(0,we.AI)(e);if(null!=t){var r=t===ot.CONFETTI,o=i(a.confettiEnabled,e.confettiEnabled,a.enabled,e.enabled);if(r&&o){f(!0);s.current.start(2*qe.z,(function(){f(!0);s.current.start(2*qe.z,(function(){return f(!1)}))}))}var c=t===ot.SHAKE,l=i(a.screenshakeEnabled,e.screenshakeEnabled,a.enabled,e.enabled);if(c&&l){var u;je.S.dispatch(B.CkL.SHAKE_APP,{duration:1e3,intensity:null!==(u=e.shakeIntensity)&&void 0!==u?u:a.shakeIntensity})}}},m=function(e){h({x:e.clientX,y:e.clientY})};o.useEffect((function(){ var e=s.current;window.addEventListener("mousemove",m);return function(){e.stop();window.removeEventListener("mousemove",m)}}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.X6q,{variant:"heading-lg/semibold",className:$e().title,children:x.Z.Messages.POGGERMODE}),(0,r.jsx)(pt,{settings:a,updateSettings:E}),(0,r.jsx)(bt,{onChangePage:t}),(0,r.jsx)(Et,{settings:a,updateSettings:E}),(0,r.jsx)(yt,{settings:a,updateSettings:E}),(0,r.jsx)(ht,{settings:a,updateSettings:E}),(0,r.jsx)(mt,{updateSettings:E}),(0,r.jsx)(De.Z,{firing:u,position:p})]})}var vt=function(e,t,n){var o=function(e){return function(){t(e)}};switch(e){case it.USER_SETTINGS:return(0,r.jsx)(Ot,{onChangePage:o(it.ACHIEVEMENT_LIST),setShowEnableAnimation:n});case it.ACHIEVEMENT_LIST:return(0,r.jsx)(Ke,{onBackClick:o(it.USER_SETTINGS)});default:return null}},_t=function(e){return e===it.USER_SETTINGS?Ae.n.LEFT:Ae.n.RIGHT};function It(){ var e=rt(o.useState(it.USER_SETTINGS),2),t=e[0],n=e[1],i=rt(o.useState(_t(t)),2),a=i[0],s=i[1],c=rt(o.useState(!1),2),l=c[0],u=c[1],f=(0,y.e7)([Te.Z],(function(){return Te.Z.useReducedMotion})),d=l&&!f;o.useEffect((function(){var e=setTimeout((function(){s(_t(t))}),500);return function(){return clearTimeout(e)}}),[t]);o.useEffect((function(){Math.random()>.99&&(0,xe.T)(Me.hn.VISITOR_100)}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ae.Z,{className:$e().slideAnimator,step:t,direction:a,children:vt(t,n,u)}),(0,r.jsx)("div",{className:d?$e().enableAnimationOverlayVisible:$e().enableAnimationOverlayHidden,children:(0,r.jsx)(Ne.Z,{className:$e().enableAnimation,importData:gt,shouldAnimate:d,autoplay:!1,resetOnPlay:!0,loop:!1,onComplete:function(){return u(!1)}})})]})}var St=n(874259),Tt=n(673679),Nt=n(653224),At=n(595138),Ct=n(810978),Pt=n(256204),jt=n(392649),Rt=n(536392),xt=n(223430),Mt=n(655674),wt=n.n(Mt),Dt=n(349263),Zt=n.n(Dt),Lt=n(50682),Ut=n.n(Lt);function kt(e){ var t=e.onClickManageSubscription,n=(0,y.e7)([Rt.Z],(function(){return Rt.Z.getSubscriptions()})),i=o.useMemo((function(){return Object.values(null!=n?n:{}).filter((function(e){return e.type===B.NYc.APPLICATION&&e.status!==B.O0b.ENDED}))}),[n]);return 0===i.length?null:(0,r.jsxs)("div",{className:wt().container,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",className:wt().sectionTitle,children:x.Z.Messages.APPLICATION_USER_SUBSCRIPTIONS_TITLE}),(0,r.jsx)(xt.Z,{size:4}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:wt().sectionDescription,children:x.Z.Messages.APPLICATION_USER_SUBSCRIPTIONS_DESCRIPTION}),(0,r.jsx)(xt.Z,{size:24}),(0,r.jsxs)("div",{className:v()(Zt().guildBoostingSubscriptionRow,wt().card),children:[(0,r.jsx)("img",{src:Ut(),alt:"",className:wt().bannerImage}),(0,r.jsxs)("div",{className:wt().textContainer,children:[(0,r.jsx)(c.X6q,{variant:"heading-xl/semibold",className:wt().header,children:x.Z.Messages.APPLICATION_USER_SUBSCRIPTIONS_TITLE}),(0, r.jsx)(c.xvT,{variant:"text-md/normal",className:wt().description,children:x.Z.Messages.APPLICATION_ACTIVE_USER_SUBSCRIPTIONS_DESCRIPTION.format({numSubscriptions:i.length})})]}),(0,r.jsx)(jt.Z,{color:c.zxk.Colors.BRAND,onClick:t,children:x.Z.Messages.APPLICATION_MANAGE_SUBSCRIPTIONS_BUTTON})]})]})}var Gt=n(177001),Bt=n(301443),Ht=n(311846),Vt=n(407817),Ft=n(196142),Yt=n(100749),zt=n(666800),Wt=n(711531),Kt=n(124251),qt=n(377463),Xt=n(755556),Qt=n.n(Xt);const $t=function(e){var t=e.label,n=e.onClick,o=e.submitting;return(0,r.jsx)(c.P3F,{onClick:o?void 0:n,className:Qt().button,children:(0,r.jsxs)("div",{className:Qt().contentContainer,children:[o?(0,r.jsx)(c.$jN,{type:c.$jN.Type.PULSING_ELLIPSIS,className:Qt().spinner}):(0,r.jsx)(c.xvT,{variant:"text-md/medium",className:Qt().label,children:t}),(0,r.jsx)(qt.Z,{className:Qt().arrow})]})})};var Jt=n(443812),en=n(386991),tn=n(531441),nn=n(243763),rn=n(199722),on=n(333398),an=n(567403),sn=n(151367),cn=n(249052),ln=n(266909) ;function un(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0)return!0}}catch(e){n=!0;r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return!1}),[e])?Gn.PY.SUBSCRIBED:0===e.size?Gn.PY.NONE:Gn.PY.IN_SUBSCRIPTION_SERVER}var Hn=[];function Vn(e){var t,n=e.ensureFresh,r=e.hasFetched,o=e.hasRoleSubscriptions,i=Rt.Z.getActiveGuildSubscriptions();return!(0!==(null!==(t=null==i?void 0:i.length)&&void 0!==t?t:0)||!o)||(!(!n||r)||!r&&!Rt.Z.hasFetchedSubscriptions())}var Fn=n(216421),Yn=n(198895),zn=n(784426),Wn=n(840249),Kn=n(633440);function qn(e,t){(null==t||t>e.length)&&(t=e.length) ;for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&void 0!==arguments[0]?arguments[0]:{}).ensureFresh,t=void 0!==e&&e,n=Bn()===Gn.PY.SUBSCRIBED,r=(0,y.e7)([Rt.Z],(function(){return Rt.Z.getActiveGuildSubscriptions()})),i=o.useRef(!1);o.useEffect((function(){if(Vn({ensureFresh:t,hasRoleSubscriptions:n,hasFetched:i.current})){i.current=!0;Tt.jg()}}),[t,n]);return null!=r?r:Hn}(),i=(0,Un.sp)(n).loading;(0,Ln.Z)(Zn.tq?"role-subscriptions-user-setting":void 0);return i?(0,r.jsx)(c.$jN,{}):0===n.length?null:(0,r.jsxs)("div",{className:Pr().container,children:[(0,r.jsxs)(c.zxk,{look:c.zxk.Looks.BLANK, innerClassName:Pr().backButtonContents,onClick:t,children:[(0,r.jsx)(Gt.Z,{className:Pr().arrowIcon}),x.Z.Messages.GUILD_ROLE_SUBSCRIPTIONS_MANAGE_SUBSCRIPTIONS_PAGE_BACK_BUTTON_CTA]}),(0,r.jsx)(xt.Z,{size:10}),(0,r.jsx)(c.vwX,{tag:"h1",children:x.Z.Messages.GUILD_ROLE_MANAGE_SUBSCRIPTION_PAGE_TITLE}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:Pr().pageDescription,children:x.Z.Messages.GUILD_ROLE_MANAGE_SUBSCRIPTION_PAGE_DESCRIPTION}),(0,r.jsx)("div",{className:Pr().subscriptionsContainer,children:n.map((function(e){return(0,r.jsx)(Ar,{subscription:e},e.id)}))})]})};var Rr=n(793461),xr=n(223219),Mr=n(615796),wr=n(641277),Dr=n(652591),Zr=n(850841),Lr=n(473903),Ur=n(551778),kr=n(95891),Gr=n(250740),Br=n(203600),Hr=n(866051),Vr=n.n(Hr);function Fr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?[4,(0,be.iq)(null==n?void 0:n.id,t)]:[3,2];case 1:i=u.sent();o=o&&null!==(a=null==i?void 0:i.ok)&&void 0!==a&&a;(null==i?void 0:i.ok)&&(0,be.IO)();u.label=2;case 2:return Object.keys(r).length>0?[4,(0,lo.Z)(r,null==n?void 0:n.id)]:[3,4];case 3:s=u.sent();o=o&&null!==(l=null==s?void 0:s.ok)&&void 0!==l&&l;(null==s?void 0:s.ok)&&(0,be.pG)();u.label=4;case 4:o&&(0,be.b9)();c(!1);return[2]}}))})),[null==n?void 0:n.id]),u=o.useCallback((function(){(0,be.W3)()}),[]);return(0,r.jsx)(so.Z,{submitting:s,onSave:l,onReset:u,disabled:t,errorMessage:null!==(e=null==i?void 0:i.message)&&void 0!==e?e:void 0})}var mo=n(450383),bo=n(973646);function go(e,t){(null==t||t>e.length)&&(t=e.length) ;for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?[4,(0,f.Mn)(t)]:[3,2];case 1:a=u.sent() ;r=r&&null!==(s=null==a?void 0:a.ok)&&void 0!==s&&s;(null==a?void 0:a.ok)?(0,f.si)():null!=(null==a||null===(o=a.body)||void 0===o?void 0:o.username)&&(0,bo.P)();u.label=2;case 2:return Object.keys(n).length>0?[4,(0,lo.Z)(n)]:[3,4];case 3:c=u.sent();r=r&&null!==(l=null==c?void 0:c.ok)&&void 0!==l&&l;(null==c?void 0:c.ok)&&(0,lo.pG)();u.label=4;case 4:r&&(0,f.b9)();i(!1);return[2]}}))})),[]),s=o.useCallback((function(){(0,f.W3)()}),[]);return(0,r.jsx)(so.Z,{submitting:n,onSave:a,onReset:s,disabled:e})}function To(){return(0,y.e7)([ge.Z],(function(){return ge.Z.showNotice()}))?(0,r.jsx)(yo,{}):(0,r.jsx)(So,{})}var No=n(19292),Ao=n(396043),Co=n(981054),Po=n.n(Co),jo=n(524268),Ro=n.n(jo),xo=n(950737),Mo=n.n(xo);function wo(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var Do,Zo;!function(e){e[e.WUMPUS=0]="WUMPUS";e[e.PHIBI=1]="PHIBI"}(Do||(Do={}));wo(Zo={},Do.WUMPUS,Po().activityCharacterWumpus), wo(Zo,Do.PHIBI,Po().activityCharacterPhibi);var Lo=n(547308),Uo=n(74535),ko=n(109206),Go=n(80317),Bo=n(795470),Ho=n(807947),Vo=n(888291),Fo=n(23260),Yo=n(436817),zo=n(185041),Wo=n(362658),Ko=n(735100),qo=n(777532),Xo=n(754828),Qo=n(546789),$o=n(259317),Jo=n(905464),ei=n(470442),ti=n(784686),ni=n(769321),ri=n(21372),oi=n(491260),ii=n(901654),ai=n(258441),si=n(775173),ci=n(749565),li=n(248088),ui=n(104738);function fi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Wa(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0){i.push(r.value);if(t&&i.length===t)break}}catch(e){s=!0;o=e}finally{try{a||null==n.return||n.return()}finally{ if(s)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ha(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ha(e,t)}(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 Ka(e){var t=e.onChange,n=e.onClose,i=e.color,a=e.suggestedColors,l=e.disabled,u=e.label,f=e.colorPickerMiddle,d=e.colorPickerFooter,p=e.showEyeDropper,h=o.useRef(null),E=(0,c.dQu)(s.Z.colors.BACKGROUND_PRIMARY).hex(),y=s.Z.colors.BACKGROUND_ACCENT.css,m=(0,vi.DP)(i),b=(0,Lo.Rf)(i),g=b===E?y:b,O=(0,Bo.Lq)(m?B.Ilk.WHITE_500:B.Ilk.PRIMARY_530),_=(0,La.Z)(f),I=(0,La.Z)(d),S=Wa(o.useState(Za().v4()),2),T=S[0],N=S[1];o.useEffect((function(){_===f&&I===d||N(Za().v4())}),[d,f,I,_]) ;return(0,r.jsx)(c.yRy,{positionKey:T,renderPopout:function(e){return(0,r.jsx)(Ua.Z$,Ya(Fa({},e),{value:i,onChange:t,suggestedColors:a,middle:f,footer:d,showEyeDropper:p}))},onRequestClose:n,children:function(e){var t=e.onClick,n=za(e,["onClick"]);return(0,r.jsxs)("div",{ref:h,className:v()(Ba().colorSwatch,Va({},Ba().disabled,l)),children:[(0,r.jsx)(c.P3F,Ya(Fa({},n),{tabIndex:l?-1:0,onClick:l?B.dG4:t,style:{backgroundColor:b,borderColor:g},className:Ba().swatch,"aria-label":x.Z.Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR,focusProps:{ringTarget:h},children:(0,r.jsx)(ka.Z,{className:Ba().editPencilIcon,width:14,height:14,color:O})})),u]})}})}var qa=n(791431),Xa=n.n(qa);function Qa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0 ;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]B.tPV)},errors:null==p?void 0:p.bio,pendingBio:u,currentBio:T,disabled:!v},"about")]})]})}var Ts=n(455469),Ns=n(552889),As=n(281728),Cs=n.n(As);function Ps(e){ var t=e.guildId,n=e.navigateToUserProfileSettings,i=(0,y.e7)([Ns.Z],(function(){return Ns.Z.getFlattenedGuildIds()})),a=(0,y.e7)([an.Z],(function(){return an.Z.getGuilds()})),s=(0,y.e7)([ge.Z],(function(){return ge.Z.showNotice()})),l=o.useMemo((function(){return i.map((function(e){var t=a[e];L()(null!=t,"guild should not be null");return{label:t.name,value:t.id}}))}),[i,a]),u=o.useCallback((function(e){return null==e?null:(0,r.jsx)(Kt.Z,{className:Cs().guildSelectOptionIcon,guild:a[e.value],size:Kt.Z.Sizes.SMOL,active:!0})}),[a]),f=function(e){var t=a[e];null!=t&&(0,be.HP)(t)};return(0,r.jsx)(Ts.$,{substeps:[Br.H6.PROFILE_CUSTOMIZATION_GUILD_PROFILES],onBack:function(){return n()},children:function(){return(0,r.jsx)(Xi,{className:Cs().section,title:x.Z.Messages.PROFILE_CUSTOMIZATION_GUILD_SELECT_TITLE,forcedDivider:!0,children:(0,r.jsx)(c.VcW,{isDisabled:s,onChange:f,value:t,options:l,renderOptionPrefix:u,placeholder:x.Z.Messages.PROFILE_CUSTOMIZATION_GUILD_SELECT_PLACEHOLDER})})}})} function js(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Rs(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){js(i,r,o,a,s,"next",e)}function s(e){js(i,r,o,a,s,"throw",e)}a(void 0)}))}}function xs(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Ms(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue} if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]B.tPV)},pendingBio:u,currentBio:null!==(n=null==i?void 0:i.bio)&&void 0!==n?n:""},"bio")]})}var jc=n(458947);function Rc(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function xc(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?l[0].value:null),2),f=u[0],d=u[1],p=ml(o.useState(""),2),h=p[0],m=p[1],b=ml(o.useState({plan_id:Br.Xh.PREMIUM_MONTH_TIER_2,gift:"true"}),2),g=b[0],O=b[1],v="true"!==g.gift&&null!=s,_=ml(o.useState(l.length>0?l[0].value:null),2),I=_[0],S=_[1],T=(0, E.Z)($n.Z.PAYMENT_FLOW_TEST_PAGE),N=T.AnalyticsLocationProvider,A=T.analyticsLocations;(0,Un.tT)(null==I?void 0:I.id);var C=(0,Un.GG)(null==I?void 0:I.id),P=o.useMemo((function(){return null==I?[]:C.filter((function(e){return null!=e.subscription_listings&&e.subscription_listings.map((function(e){return e.published})).includes(!0)}))}),[C,I]);return(0,r.jsx)(N,{children:(0,r.jsxs)(c.hjN,{title:"Payment Flow Modals",tag:c.RB0.H1,children:[(0,r.jsx)(c.vwX,{children:"Gift"}),(0,r.jsxs)(c.xJW,{className:dl().formItem,children:[(0,r.jsx)(c.q4e,{value:t,options:[{value:Br.Si.TIER_2,label:"Nitro"},{value:Br.Si.TIER_1,label:"Nitro Classic"},{value:Br.Si.TIER_0,label:"Nitro Basic"}],onChange:function(e){return n(e)}}),(0,r.jsx)(as.Z,{subscriptionTier:t,isGift:!0,premiumModalAnalyticsLocation:{}})]}),(0,r.jsx)(c.$i$,{className:dl().formDivider}),(0,r.jsx)(c.vwX,{children:"Premium Select Plan"}),(0,r.jsx)(c.xJW,{className:dl().formItem,children:(0,r.jsx)(c.zxk,{onClick:function(){return(0,ll.Z)({ analyticsLocations:A})},children:"Select Plan"})}),(0,r.jsx)(c.$i$,{className:dl().formDivider}),(0,r.jsx)(c.vwX,{children:"Boost"}),(0,r.jsxs)(c.xJW,{className:dl().formItem,children:[(0,r.jsx)(c.q4e,{value:f,options:l,onChange:function(e){return d(e)}}),null!=f?(0,r.jsx)(cl.Z,{guild:f,analyticsLocation:{}}):(0,r.jsx)("div",{children:"No Guild to boost"})]}),(0,r.jsx)(c.$i$,{className:dl().formDivider}),(0,r.jsxs)(c.vwX,{children:[(0,r.jsx)("div",{children:"Standalone: Trial Promotion Redemption"}),(0,r.jsx)(c.eee,{href:"https://i.dis.gd/createPromo",children:"How to create promotion"})]}),(0,r.jsxs)(c.xJW,{className:dl().formItem,children:[(0,r.jsx)(c.oil,{placeholder:"Promotion Code",value:h,onChange:function(e){return m(e)}}),(0,r.jsx)(c.ua7,{text:"Need Promotion Code",shouldShow:h.length<1,children:function(e){var t=e.onMouseEnter,n=e.onMouseLeave;return(0,r.jsx)(c.zxk,{disabled:h.length<1,onMouseEnter:t,onMouseLeave:n,onClick:function(){ window.open(B.Z5c.BILLING_PROMOTION_REDEMPTION(h))},children:"Open Link"})}})]}),(0,r.jsx)(c.$i$,{className:dl().formDivider}),(0,r.jsx)(c.vwX,{children:"Standalone: Gift/Subscription Purchase"}),(0,r.jsxs)(c.xJW,{className:dl().formItem,children:[(0,r.jsx)(c.q4e,{value:g.plan_id,options:[{value:Br.Xh.PREMIUM_MONTH_TIER_2,label:"Nitro"},{value:Br.Xh.PREMIUM_MONTH_TIER_1,label:"Nitro Classic"},{value:Br.Xh.PREMIUM_MONTH_TIER_0,label:"Nitro Basic"}],onChange:function(e){return O((function(t){return yl(El({},t),{plan_id:e})}))}}),(0,r.jsx)(c.q4e,{value:g.gift,options:[{value:"true",label:"Gift"},{value:"false",label:"Not Gift"}],onChange:function(e){return O((function(t){return yl(El({},t),{gift:e})}))}}),(0,r.jsx)(c.ua7,{text:"Already subscribed",shouldShow:v,children:function(e){var t=e.onMouseEnter,n=e.onMouseLeave;return(0,r.jsx)(c.zxk,{onMouseLeave:n,onMouseEnter:t,disabled:v,onClick:function(){window.open(B.Z5c.BILLING_PREMIUM_SUBSCRIBE+"?"+sl.stringify(El({},g)))}, children:"Open Link"})}})]}),(0,r.jsx)(c.$i$,{className:dl().formDivider}),(0,r.jsx)(c.vwX,{children:"Creator Revenue"}),(0,r.jsxs)(c.xJW,{className:dl().formItem,children:[(0,r.jsx)(c.xvT,{className:dl().guildServerDescription,variant:"text-sm/normal",children:"Premium Server Subscription For"}),(0,r.jsx)(c.q4e,{value:I,options:l,onChange:function(e){return S(e)}})]}),null!=I?(0,r.jsx)("div",{className:dl().formItem,children:P.map((function(e){return e.subscription_listings_ids.map((function(t){return(0,r.jsx)(er.Z,{guildId:I.id,groupListingId:e.id,listingId:t},t)}))}))}):null,(0,r.jsx)(c.$i$,{className:dl().formDivider}),(0,r.jsx)(c.vwX,{children:"Helpers"}),(0,r.jsxs)(c.xJW,{className:dl().formItem,children:[(0,r.jsx)(c.zxk,{onClick:function(){return(0,Ct.mE)()},children:"Reset SubscriptionPlanStore"}),(0,r.jsx)(c.zxk,{onClick:function(){return(0,Tt.GM)()},children:"Reset SubscriptionStore"})]}),(0,r.jsx)(c.$i$,{className:dl().formDivider}),(0,r.jsx)(c.vwX,{ children:"Premium Tutorial"}),(0,r.jsxs)(c.xJW,{className:dl().formItem,children:[(0,r.jsx)(c.zxk,{onClick:function(){return(0,ul.Rr)()},children:"Reset PremiumTutorialStore"}),(0,r.jsx)(c.zxk,{onClick:function(){(0,oe.w9)(Br.QD.CUSTOM_EMOJI);(0,oe.w9)(Br.QD.BOOSTING);(0,oe.w9)(Br.QD.PROFILE_CUSTOMIZATION);(0,oe.w9)(a.z$.PREMIUM_TUTORIAL_FILE_UPLOAD_COMPOSER_TOOLTIP);(0,oe.w9)(a.z$.PREMIUM_TUTORIAL_STICKER_PICKER_COMPOSER_TOOLTIP);(0,oe.w9)(a.z$.PREMIUM_TUTORIAL_EMOJI_PICKER_COMPOSER_TOOLTIP);(0,oe.w9)(a.z$.PREMIUM_TUTORIAL_SERVER_MENU_TOOLTIP)},children:"Reset all tutorials"}),(0,r.jsx)(c.zxk,{onClick:function(){(0,Se.xf)();(0,zn.uL)(B.Z5c.APPLICATION_STORE);(0,ul.HY)(!0);(0,ul.Dd)(!0);je.S.dispatch(B.CkL.PREMIUM_SUBSCRIPTION_CREATED)},children:"Toggle Wow Moment"})]})]})})};var gl=n(112184),Ol=n(319463),vl=n(750349),_l=n(313197),Il=n(474816),Sl=n.n(Il),Tl={offset:{top:-8}};function Nl(){return(0,r.jsxs)("div",{className:Sl().socialLinks,children:[(0,r.jsx)(c.eee,{target:"_blank", tabIndex:-1,rel:"author",title:"Twitter",href:(0,gl.Z)(B.RK.TWITTER),className:Sl().link,focusProps:Tl,children:(0,r.jsx)(_l.Z,{foreground:Sl().foreground,"aria-hidden":!0})}),(0,r.jsx)(c.eee,{target:"_blank",rel:"author",title:"Facebook",tabIndex:-1,href:B.fK7.FACEBOOK_URL,className:Sl().link,focusProps:Tl,children:(0,r.jsx)(Ol.Z,{foreground:Sl().foreground,"aria-hidden":!0})}),(0,r.jsx)(c.eee,{target:"_blank",rel:"author",title:"Instagram",tabIndex:-1,href:B.fK7.INSTAGRAM_URL,className:Sl().link,focusProps:Tl,children:(0,r.jsx)(vl.Z,{foreground:Sl().foreground,"aria-hidden":!0})})]})}var Al=n(710432);function Cl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;(0,c.ZDy)(Nu((function(){var t,o;return Pu(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(73284)]).then(n.bind(n,854104))];case 1:t=i.sent(),o=t.default;return[2,function(t){return(0,r.jsx)(o,Cu({claimRequired:e},t))}]}}))})),{onCloseRequest:e?Su.dG:null,onCloseCallback:t})};var Ru=n(694444),xu=n(64234),Mu=n(265508),wu=n(322837),Du=n(919244),Zu=n(411177),Lu=n(426797),Uu=n(970112),ku=n(971402),Gu=n(693622),Bu=n(651034),Hu=n(281110);function Vu(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Fu(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Vu(i,r,o,a,s,"next",e)}function s(e){ Vu(i,r,o,a,s,"throw",e)}a(void 0)}))}}var Yu=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length) ;for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(0,r.jsx)("div",{className:uf().credentialList,children:t.map((function(e){return(0,r.jsx)(Bu.Z,{avatar:null,name:e.name,className:uf().credentialItem,onContextMenu:function(t){(0,ku.vq)(t,(function(t){return(0,r.jsx)(mf,hf(pf({},t),{credentialId:e.id}))}))},children:(0,r.jsx)(c.zxk,{look:c.zxk.Looks.BLANK,color:c.zxk.Colors.TRANSPARENT,size:c.zxk.Sizes.ICON, onClick:function(t){(0,ku.vq)(t,(function(t){return(0,r.jsx)(mf,hf(pf({},t),{credentialId:e.id}))}))},"aria-label":x.Z.Messages.TWO_FA_WEBAUTHN_CREDENTIAL_OPTIONS,innerClassName:uf().credentialOptions,children:(0,r.jsx)(Gu.Z,{className:uf().overflowIcon,foreground:uf().overflowIconFg,"aria-hidden":!0})})},e.id)}))}),(0,r.jsx)("div",{children:(0,r.jsx)(c.zxk,{onClick:function(){u(!0);(function(){return zu.apply(this,arguments)})().then((function(e){var t=e.ticket,n=e.challenge;(0,c.h7j)((function(e){return(0,r.jsx)(yf,hf(pf({},e),{ticket:t,challenge:n}))}))})).finally((function(){u(!1)}))},submitting:s,size:c.zxk.Sizes.SMALL,children:x.Z.Messages.TWO_FA_WEBAUTHN_REGISTER})})]}):null}var gf=n(691797),Of=n(178176);var vf=n(751388),_f=n(58118),If=n(841391),Sf=n.n(If);function Tf(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function Nf(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n) ;function a(e){Tf(i,r,o,a,s,"next",e)}function s(e){Tf(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Af(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cf(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Pf(e){Pf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Pf(e)}function jf(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0){s=(0,r.jsx)(wu.Z,{fileContents:this.getDownloadFileContents,contentType:"text/plain",fileName:"discord_backup_codes.txt",children:(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,children:x.Z.Messages.TWO_FA_DOWNLOAD_CODES})});var l=function(e){return e.map((function(e){return(0,r.jsx)(Lf,{code:e},e.code)}))};e=(0,r.jsxs)(c.hjN,{title:x.Z.Messages.TWO_FA_BACKUP_CODES_LABEL,children:[(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:fe().marginBottom20,children:x.Z.Messages.TWO_FA_BACKUP_CODES_BODY.format()}),(0,r.jsxs)(ae.Z,{children:[(0,r.jsx)(ae.Z.Child,{children:(0,r.jsx)("ul",{className:Sf().checkboxGroup, children:l(a.slice(0,a.length/2))})}),(0,r.jsx)(ae.Z.Child,{children:(0,r.jsx)("ul",{className:Sf().checkboxGroup,children:l(a.slice(a.length/2))})})]}),(0,r.jsx)("div",{children:(0,r.jsx)(c.zxk,{onClick:this.generateBackupCodes,look:c.iLD.LINK,size:c.PhG.MIN,children:x.Z.Messages.TWO_FA_GENERATE_CODES})}),(0,r.jsx)(c.$i$,{className:fe().marginTop20})]})}return(0,r.jsxs)(c.hjN,{children:[(0,r.jsxs)(c.vwX,{className:v()(Sf().isEnabled,fe().marginTop4,fe().marginBottom8),children:[(0,r.jsx)("img",{alt:"",className:v()(Sf().lockIcon),src:n(392544)}),x.Z.Messages.TWO_FA_ENABLED]}),(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:fe().marginBottom20,children:x.Z.Messages.TWO_FA_DESCRIPTION}),(0,r.jsxs)(ae.Z,{justify:ae.Z.Justify.START,className:fe().marginBottom20,children:[(0,r.jsx)(ae.Z.Child,{wrap:!0,grow:0,children:s}),(0,r.jsx)(ae.Z.Child,{wrap:!0,children:(0,r.jsx)(c.ua7,{text:x.Z.Messages.TWO_FA_DISABLED_FOR_SERVER_SUBSCRIPTION_MOD,hide:!i,children:function(e){return(0, r.jsx)(c.zxk,Rf(jf({},e),{onClick:t.handleDisableMFA,size:c.zxk.Sizes.SMALL,color:c.Ttl.RED,look:c.iLD.OUTLINED,disabled:i,children:x.Z.Messages.TWO_FA_REMOVE}))}})})]}),e,this.renderMFASMS(),Of.Ae&&(0,r.jsx)(bf,{})]})};i.renderDisabled=function(){return(0,r.jsxs)(c.hjN,{title:x.Z.Messages.TWO_FA,children:[(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:fe().marginBottom20,children:x.Z.Messages.TWO_FA_SALES_PITCH}),(0,r.jsx)(c.xJW,{children:(0,r.jsx)(c.zxk,{onClick:vf.Z.enableMFA,size:c.PhG.SMALL,children:x.Z.Messages.TWO_FA_ENABLE})})]})};i.render=function(){var e=this.props.currentUser;return Of.uZ?e.verified?e.mfaEnabled?this.renderEnabled():this.renderDisabled():(0,r.jsx)(c.hjN,{title:x.Z.Messages.TWO_FA,children:(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,children:x.Z.Messages.TWO_FA_NOT_VERIFIED})}):(0,r.jsx)(c.hjN,{title:x.Z.Messages.TWO_FA,children:(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,children:x.Z.Messages.TWO_FA_USE_DESKTOP_APP})})} ;i.openPhoneVerificationModal=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,c.h7j)((function(t){return(0,r.jsx)(Zu.default,jf({reason:Lu.L.USER_SETTINGS_UPDATE},t,e))}),{modalKey:_f.M})};return o}(o.PureComponent);const kf=y.ZP.connectStores([Lr.default,Ru.Z,an.Z,ns.Z],(function(){var e=Lr.default.getCurrentUser(),t=an.Z.getGuilds(),n=Object.values(t).some((function(e){return e.hasFeature(B.oNc.ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE)&&ns.Z.can(B.Plq.ADMINISTRATOR,e)}));L()(null!=e,"TwoFactorAuth: currentUser cannot be undefined");return{currentUser:e,isRoleSubscriptionGuildAdmin:n,togglingSMS:Ru.Z.togglingSMS}}))(Uf);var Gf=n(153837),Bf=n.n(Gf);function Hf(e){var t=e.className,n=e.currentUser,o=e.handleDisableAccount,i=e.handleDeleteAccount,a=n.isClaimed();return(0,r.jsxs)(c.hjN,{className:t,title:x.Z.Messages.USER_SETTINGS_ACCOUNT_REMOVAL_SECTION,children:[(0,r.jsx)(c.R94,{className:Bf().description,type:c.R94.Types.DESCRIPTION, children:a?x.Z.Messages.USER_SETTINGS_ACCOUNT_REMOVAL_DESCRIPTION:x.Z.Messages.USER_SETTINGS_ACCOUNT_REMOVAL_DESCRIPTION_UNCLAIMED}),(0,r.jsxs)("div",{className:Bf().buttonContainer,children:[a?(0,r.jsx)(c.zxk,{className:Bf().disableButton,look:c.iLD.FILLED,color:c.Ttl.RED,size:c.PhG.SMALL,onClick:o,children:x.Z.Messages.DISABLE_ACCOUNT}):null,(0,r.jsx)(c.zxk,{look:c.iLD.OUTLINED,color:c.Ttl.RED,size:c.PhG.SMALL,onClick:i,children:x.Z.Messages.DELETE_ACCOUNT})]})]})}var Vf=n(334835),Ff=n(995141),Yf=n(112897),zf=n(253567),Wf=n(351619),Kf=n(186440),qf=n(310126);function Xf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]a.current.clientWidth;return(0,r.jsxs)("div",{className:v()(td().field,t),children:[(0,r.jsx)("div",{className:td().constrainedRow,children:(0,r.jsxs)("div",{className:td().usernameRow,children:[(0,r.jsx)(c.vwX,{className:td().fieldTitle,children:x.Z.Messages.USER_SETTINGS_LABEL_USERNAME}),(0,r.jsxs)("div",{className:td().usernameInnerRow,ref:a,children:[(0,r.jsx)(c.xvT,{tag:"span",color:"header-primary",variant:"text-md/normal",children:i.isPomelo()?i.pomeloTag:i.username}),!i.isPomelo()&&(0,r.jsxs)(c.xvT,{tag:"span",color:"header-secondary",variant:"text-md/normal",children:["#",i.discriminator]})]})]})}),(0,r.jsx)(c.zxk,{className:td().fieldButton,size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.PRIMARY, "aria-label":x.Z.Messages.USER_SETTINGS_ACCOUNT_EDIT_USERNAME_A11Y_LABEL,onClick:function(){return(0,c.ZDy)(od((function(){var e,t;return ld(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(25934)]).then(n.bind(n,425934))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,ad({},e))}]}}))})))},children:s?x.Z.Messages.DISAPPROVAL:x.Z.Messages.EDIT})]})}function dd(e){var t=e.text,n=e.censor,i=e.revealLabel,a=e.hideLabel,s=cd(o.useState(!1),2),l=s[0],u=s[1],f=l?t:n(t);return(0,r.jsxs)(r.Fragment,{children:[f,(0,r.jsx)(c.zxk,{look:c.zxk.Looks.LINK,size:c.zxk.Sizes.MIN,color:c.zxk.Colors.LINK,"aria-label":l?a:i,onClick:function(){return u(!l)},children:l?x.Z.Messages.HIDE:x.Z.Messages.REVEAL})]})}function pd(e){var t,o=e.className,i=e.user;if(i.isClaimed())if(null==i.email)t={buttonText:x.Z.Messages.ADD,buttonAriaLabel:x.Z.Messages.USER_SETTINGS_ACCOUNT_ADD_EMAIL_A11Y_LABEL,buttonColor:c.zxk.Colors.PRIMARY, valueMessage:x.Z.Messages.USER_SETTINGS_NO_EMAIL_PLACEHOLDER,handleClick:function(){return(0,c.ZDy)(od((function(){var e,t;return ld(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(71379)]).then(n.bind(n,171379))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,ad({},e))}]}}))})))}};else{var a=i.email;t={buttonText:x.Z.Messages.EDIT,buttonAriaLabel:x.Z.Messages.USER_SETTINGS_ACCOUNT_EDIT_EMAIL_A11Y_LABEL,buttonColor:c.zxk.Colors.PRIMARY,valueMessage:(0,r.jsx)(dd,{text:a,censor:Jf,revealLabel:x.Z.Messages.USER_SETTINGS_ACCOUNT_REVEAL_EMAIL_A11Y_LABEL,hideLabel:x.Z.Messages.USER_SETTINGS_ACCOUNT_HIDE_EMAIL_A11Y_LABEL}),handleClick:function(){return(0,c.ZDy)(od((function(){var e,t;return ld(this,(function(o){switch(o.label){case 0:return[4,Promise.all([n.e(40532),n.e(71379)]).then(n.bind(n,171379))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,ad({},e))}]}}))})))}}}else t={ buttonText:x.Z.Messages.CLAIM_ACCOUNT_SHORT,buttonAriaLabel:x.Z.Messages.CLAIM_ACCOUNT_SHORT,buttonColor:c.zxk.Colors.BRAND,valueMessage:x.Z.Messages.USER_SETTINGS_ADD_EMAIL_CLAIM,handleClick:function(){return ju()}};return(0,r.jsxs)("div",{className:v()(td().field,o),children:[(0,r.jsx)("div",{className:td().constrainedRow,children:(0,r.jsxs)("div",{children:[(0,r.jsx)(c.vwX,{className:td().fieldTitle,children:x.Z.Messages.USER_SETTINGS_LABEL_EMAIL}),(0,r.jsx)("div",{children:(0,r.jsx)(c.xvT,{tag:"span",color:"header-primary",variant:"text-md/normal",children:t.valueMessage})})]})}),(0,r.jsx)(c.zxk,{className:td().fieldButton,size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.PRIMARY,"aria-label":t.buttonAriaLabel,onClick:t.handleClick,children:t.buttonText})]})}function hd(e){var t=e.className,o=e.user;if(!o.isClaimed())return null;var i,a=o.phone,s=null!=a,l=null!=o.email;i=s?(0,r.jsx)(dd,{text:a,censor:$f,revealLabel:x.Z.Messages.USER_SETTINGS_ACCOUNT_REVEAL_PHONE_A11Y_LABEL, hideLabel:x.Z.Messages.USER_SETTINGS_ACCOUNT_HIDE_PHONE_A11Y_LABEL}):x.Z.Messages.USER_SETTINGS_NO_PHONE_PLACEHOLDER;return(0,r.jsxs)("div",{className:v()(td().field,t),children:[(0,r.jsx)("div",{className:td().constrainedRow,children:(0,r.jsxs)("div",{children:[(0,r.jsx)(c.vwX,{className:td().fieldTitle,children:x.Z.Messages.USER_SETTINGS_LABEL_PHONE_NUMBER}),(0,r.jsx)("div",{children:(0,r.jsx)(c.xvT,{tag:"span",color:"header-primary",variant:"text-md/normal",children:i})})]})}),(0,r.jsxs)("div",{className:td().fieldButtonList,children:[s&&l?(0,r.jsx)(c.zxk,{className:v()(td().fieldButton,td().removeButton),size:c.zxk.Sizes.SMALL,look:c.zxk.Looks.LINK,color:c.zxk.Colors.PRIMARY,"aria-label":x.Z.Messages.USER_SETTINGS_ACCOUNT_REMOVE_PHONE_A11Y_LABEL,onClick:function(){(0,c.h7j)((function(e){return(0,r.jsx)(Iu.default,sd(ad({},e),{title:x.Z.Messages.USER_SETTINGS_ACCOUNT_REMOVE_PHONE_NUMBER_TITLE, children:o.hasFlag(B.xW$.MFA_SMS)?x.Z.Messages.USER_SETTINGS_ACCOUNT_REMOVE_PHONE_SMS_BACKUP_WARNING:void 0,actionText:x.Z.Messages.REMOVE,handleSubmit:function(e){return Lu.Z.removePhone(e,Lu.L.USER_SETTINGS_UPDATE)}}))}))},children:x.Z.Messages.REMOVE}):null,(0,r.jsx)(c.zxk,{className:td().fieldButton,size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.PRIMARY,"aria-label":s?x.Z.Messages.USER_SETTINGS_ACCOUNT_EDIT_PHONE_A11Y_LABEL:x.Z.Messages.USER_SETTINGS_ACCOUNT_ADD_PHONE_A11Y_LABEL,onClick:function(){(0,c.ZDy)(od((function(){var e,t;return ld(this,(function(o){switch(o.label){case 0:return[4,Promise.resolve().then(n.bind(n,411177))];case 1:e=o.sent(),t=e.default;return[2,function(e){return(0,r.jsx)(t,ad({reason:Lu.L.USER_SETTINGS_UPDATE},e))}]}}))})),{modalKey:_f.M})},children:s?x.Z.Messages.EDIT:x.Z.Messages.ADD})]})]})}function Ed(e){var t=e.user,n=(0,Yf.Z)(t.id);return ni.Sb.useSetting()&&gf.wS?(0,r.jsx)(c.yRy,{renderPopout:function(e){var t=e.closePopout;return(0,r.jsx)(c.v2r,{ onClose:t,onSelect:void 0,navId:"copy-id","aria-label":x.Z.Messages.USER_MORE_ACTIONS_MENU_LABEL,children:n})},children:function(e){return(0,r.jsx)(c.P3F,sd(ad({},e),{className:td().overflowMenuButton,"aria-label":x.Z.Messages.ACTIONS,children:(0,r.jsx)(Kf.Z,{className:td().overflowMenuIcon,height:24,width:24})}))}}):null}function yd(){d.Z.setSection(B.oAB.PROFILE_CUSTOMIZATION)}function md(){Dr.default.track(B.rMx.PREMIUM_PROMOTION_OPENED,{location_page:B.ZY5.USER_SETTINGS,location_section:B.jXE.SETTINGS_ACCOUNT,location_object:B.qAy.TOOLTIP});d.Z.setSection(B.oAB.PREMIUM)}function bd(){var e,t=(0,y.e7)([Lr.default],(function(){var e=Lr.default.getCurrentUser();L()(null!=e,"UserSettingsAccountProfileCard: currentUser cannot be undefined");return e})),n=(0,Yo.Z)(t.id),o=(0,Go.U)().canUseAvatarDecorations,i=ni.co.useSetting(),a=(0,y.e7)([mo.Z],(function(){return mo.Z.getErrors()})),s=null==a||null===(e=a.avatar)||void 0===e?void 0:e[0],l=o?(0,si.NZ)({userId:t.id, avatarDecoration:t.avatarDecoration,size:(0,Ff.y)(c.EFr.SIZE_80),canAnimate:!0}):null;return(0,r.jsxs)("div",{className:td().accountProfileCard,children:[(0,r.jsx)(zf.Z,{displayProfile:n,user:t,allowEdit:!1,guildId:void 0,profileType:Si.y0.SETTINGS}),(0,r.jsxs)("div",{className:td().userInfo,children:[(0,r.jsx)(ud,{className:td().avatar,src:t.getAvatarURL(void 0,80,!0),avatarDecoration:l,status:i,size:c.EFr.SIZE_80,"aria-label":t.username}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:td().profileCardUsernameRow,children:[(0,r.jsx)(Vf.Z,{user:t,className:td().userTag,discriminatorClass:td().discriminator}),(0,r.jsx)(Ed,{user:t})]}),(0,r.jsx)(Wf.Z,{className:td().badgeList,user:t,premiumSince:null==n?void 0:n.premiumSince,premiumGuildSince:null==n?void 0:n.premiumGuildSince,size:Wf.V.SIZE_22,openPremiumSettings:md})]}),(0,r.jsx)(c.zxk,{onClick:yd,size:c.zxk.Sizes.SMALL,children:x.Z.Messages.USER_SETTINGS_EDIT_USER_PROFILE})]}),(0,r.jsxs)("div",{className:td().background, children:[null!=s?(0,r.jsx)(c.xvT,{className:td().avatarError,variant:"text-xs/normal",color:"text-danger",children:s}):null,(0,r.jsxs)("div",{className:td().fieldList,children:[(0,r.jsx)(fd,{user:t}),(0,r.jsx)(pd,{className:td().fieldSpacer,user:t}),(0,r.jsx)(hd,{className:td().fieldSpacer,user:t})]})]})]})}var gd=n(528562);function Od(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function vd(e){vd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return vd(e)}function _d(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0],t=this,n=this.props.currentUser,o=an.Z.getGuilds(),i=Object.keys(o).filter((function(e){return o[e].ownerId===n.id}));i.length>0?this.setState({shouldRenderOwnedGuildsModal:!0}):n.isClaimed()?(0,c.h7j)((function(n){return(0,r.jsx)(Iu.default,Id(_d({},n),{handleSubmit:function(n){return t.handleSubmitDisableAccount(n,e)},title:e?x.Z.Messages.DELETE_ACCOUNT:x.Z.Messages.DISABLE_ACCOUNT,actionText:e?x.Z.Messages.DELETE_ACCOUNT:x.Z.Messages.DISABLE_ACCOUNT,children:e?x.Z.Messages.DELETE_ACCOUNT_BODY:x.Z.Messages.DISABLE_ACCOUNT_BODY}))})):this.setState({ shouldRenderDeleteAccountConfirmModal:!0})};return o}(o.PureComponent);const Pd=function(){var e=(0,y.e7)([Lr.default],(function(){var e=Lr.default.getCurrentUser();L()(null!=e,"ConnectedUserAccountSettings: currentUser cannot be undefined");return e})),t=(0,y.e7)([Ru.Z],(function(){return Ru.Z.getBackupCodes()})),n=(0,y.e7)([Rr.Z],(function(){return Rr.Z.hidePersonalInformation})),o=(0,y.e7)([xu.Z],(function(){return xu.Z.theme}));return(0,r.jsx)(Cd,{currentUser:e,backupCodes:t,hide:n,theme:o})};function jd(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Rd(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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 }(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function xd(e){var t=function(){ni.SE.updateSetting(e?Object.keys(an.Z.getGuilds()):[])};(0,c.h7j)((function(e){return(0,r.jsx)(c.sm4,Rd(function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)return(0,r.jsx)(c.xJW,{faded:!0,title:x.Z.Messages.PERMISSIONS,className:fe().marginTop20,children:(0,r.jsx)("ul",{children:e})})}(),l&&(0,r.jsx)(Oh,{application:i})]})})},_h=function(){var e=(0,r.jsxs)(ae.Z,{className:v()(hh().header,fe().marginBottom20),children:[(0,r.jsxs)(ae.Z,{className:hh().headerInfo,children:[(0,r.jsx)(ae.Z.Child,{className:hh().appAvatar,grow:0,children:(0,r.jsx)("img",{src:yh(),alt:""})}),(0,r.jsx)(ae.Z.Child,{children:(0,r.jsxs)(c.X6q,{ variant:"text-sm/semibold",children:[x.Z.Messages.CLYDE_NAME,(0,r.jsx)(sh.Z,{className:hh().botTag,type:sh.H.AI})]})})]}),(0,r.jsx)(ae.Z.Child,{wrap:!0,grow:0,children:(0,r.jsx)(c.zxk,{color:c.Ttl.RED,look:c.iLD.OUTLINED,size:c.PhG.SMALL,onClick:function(){return Kp(!1)},children:x.Z.Messages.DISABLE})})]});return(0,r.jsx)(c.Zbd,{className:v()(hh().authedApp,fe().marginBottom8),outline:!0,children:(0,r.jsx)(c.y5t,{component:e,children:(0,r.jsx)(c.xJW,{faded:!0,title:x.Z.Messages.CLYDE_AUTHORIZE_HEADING,children:(0,r.jsx)(c.R94,{children:x.Z.Messages.CLYDE_AUTHORIZE_DETAILS.format({learnMoreURL:ta.Z.getArticleURL(B.BhN.CLYDE_AI)})})})})})};const Ih=function(){var e=(0,y.e7)([Rr.Z],(function(){return Rr.Z.hidePersonalInformation})),t=(0,y.e7)([ah.Z],(function(){return ah.Z.getApps()})),i=(0,y.e7)([Wp.ZP],(function(){return Wp.ZP.getSelfEmbeddedActivities()})),a=(0,y.e7)([oh],(function(){return oh.getConsentStatus()}));o.useEffect((function(){Fp.fetch();qp()}),[]);return e?(0, r.jsx)(Pt.Z,{}):(0,r.jsx)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.AUTHORIZED_APPS,children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)(c.ToO,{className:fe().marginBottom40,type:c.sje.PRIMARY,title:x.Z.Messages.APPLICATIONS_AND_CONNECTIONS,body:x.Z.Messages.APPLICATIONS_AND_CONNECTIONS_BODY}),children:[a?(0,r.jsx)(_h,{}):null,null==t?(0,r.jsx)(c.$jN,{className:fe().marginTop20,type:c.$jN.Type.SPINNING_CIRCLE}):0===t.length?(0,r.jsxs)(gh,{className:hh().marginTop20,children:[(0,r.jsx)(ch.ox,{darkSrc:n(3874),lightSrc:n(302255),width:380,height:282}),(0,r.jsx)(ch.OZ,{note:x.Z.Messages.NO_AUTHORIZED_APPS_NOTE,children:x.Z.Messages.NO_AUTHORIZED_APPS})]}):t.map((function(e){return(0,r.jsx)(vh,bh({onDelete:function(){return function(e){var t=e.id,n=e.application;Fp.delete(t);var r=i.get(n.id);null!=r&&(0,zp.mW)({channelId:r.channelId,applicationId:n.id})}(e)}},e),e.id)}))]})})};var Sh=n(487683),Th=n(842227),Nh=n(933599),Ah=n(633878);function Ch(e,t,n){t in e?Object.defineProperty(e,t,{value:n, enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Ph(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function jh(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function Rh(e){ var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=e.foreground,l=jh(e,["width","height","color","foreground"]);return(0,r.jsx)("svg",Ph(function(e){for(var t=1;t12&&(n=n.substring(0,1));o.push(n);(parseInt(n,10)>1||2===n.length||null!=r&&""!==r)&&o.push("/");null!=r&&""!==r&&parseInt(r,10)>99&&(r=(r+"").substring(0,2));o.push(r);return o.join("")}function Uh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kh(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function Gh(e){Gh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return Gh(e)}function Bh(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})) ;return e}function Hh(e,t){return!t||"object"!==Fh(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Vh(e,t){Vh=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return Vh(e,t)}var Fh=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function Yh(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=Gh(e);if(t){var o=Gh(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Hh(this,n)}}var zh=/[^0-9]/g,Wh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") ;e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&Vh(e,t)}(n,e);var t=Yh(n);function n(){Uh(this,n);var e;(e=t.apply(this,arguments)).selectionStart=0;e.setRef=function(t){var n=e.props.inputRef;e._inputRef=t;null!=n&&n(t)};e.handleChange=function(t,n){var r=e.props,o=r.value,i=r.onChange,a=e._inputRef;if(t!==o&&null!=a&&null!=o){var s=Lh(t),c=a.selectionStart;s===o&&s.length<=3&&o.includes("/")&&!t.includes("/")?s=s.replace(zh,""):s===o&&t.includes("/")&&!o.includes("/")&&(s+="/");s.length>t.length&&(c+=s.length-t.length);e.selectionStart=c;null!=i&&i(s,n)}};return e}var o=n.prototype;o.componentDidUpdate=function(e){var t=this._inputRef;e.value!==this.props.value&&null!=t&&t.setSelectionRange(this.selectionStart,this.selectionStart)};o.render=function(){return(0,r.jsx)(c.oil,Bh(function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&!a?(0,r.jsx)(c.$i$,{className:_E().sourceDivider}):null,(0,r.jsxs)(ae.Z,{align:ae.Z.Align.CENTER,justify:ae.Z.Justify.BETWEEN,className:_E().paymentSourceRow,children:[(0,r.jsx)(iE.Z,{paymentSource:t,isDefault:n,isForSubscription:s,locale:l,showSubtext:!0}),o?null:(0,r.jsx)(c.zxk,{color:c.zxk.Colors.PRIMARY,onClick:this.handleEditClick,size:c.zxk.Sizes.SMALL,children:x.Z.Messages.EDIT})]})]})};return n}(o.PureComponent);LE.defaultProps={isEditing:!1,hideDivider:!1,onEditClick:function(){}};var UE=function(e){ PE(o,e);var t=DE(o);function o(){NE(this,o);var e;(e=t.apply(this,arguments)).state={editingPayment:null};e.handleEditClick=function(t){e.setState({editingPayment:t})};e.handleCancel=function(){e.setState({editingPayment:null})};var i,a=IE(e);e.handleDelete=(i=TE((function(e){return ZE(this,(function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,Tt.xt(e)];case 1:t.sent();a.setState({editingPayment:null});return[3,3];case 2:t.sent();return[3,3];case 3:return[2]}}))})),function(e){return i.apply(this,arguments)});var s=IE(e);e.handleSubmit=function(){var e=TE((function(e,t){return ZE(this,(function(n){switch(n.label){case 0:if(null==e)return[3,4];n.label=1;case 1:n.trys.push([1,3,,4]);return[4,Tt.LI(e,t)];case 2:n.sent();s.setState({editingPayment:null});return[3,4];case 3:n.sent();return[3,4];case 4:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}();e.handlePaymentSourceAdded=function(){var e=TE((function(e){return ZE(this,(function(t){switch(t.label){ case 0:return[4,(0,xh.i1)(e.id)];case 1:t.sent();return[2]}}))}));return function(t){return e.apply(this,arguments)}}();e.handleAddPaymentMethod=function(){var t=IE(e);(0,c.ZDy)(TE((function(){var e,o;return ZE(this,(function(i){switch(i.label){case 0:return[4,Promise.all([n.e(40532),n.e(38039),n.e(27059),n.e(84501)]).then(n.bind(n,184501))];case 1:e=i.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,RE(jE({},e),{onAddPaymentSource:t.handlePaymentSourceAdded}))}]}}))})),{onCloseCallback:function(){(0,Nh.fw)()}})};return e}var i=o.prototype;i.renderFooter=function(){var e=this.props.paymentSources;return(0,r.jsxs)(ae.Z,{justify:ae.Z.Justify.END,className:_E().footer,children:[0===Object.keys(e).length?(0,r.jsxs)(ae.Z.Child,{children:[(0,r.jsx)(c.xvT,{variant:"text-sm/normal",children:x.Z.Messages.BILLING_NO_PAYMENT_METHOD}),(0,r.jsx)("div",{className:_E().subText,children:x.Z.Messages.BILLING_NO_PAYMENT_METHOD_DESCRIPTION})]}):null,(0,r.jsx)(c.zxk,{ onClick:this.handleAddPaymentMethod,children:x.Z.Messages.BILLING_ADD_PAYMENT_METHOD})]})};i.render=function(){var e=this,t=this.props,n=t.defaultPaymentSourceId,o=t.paymentSources,i=t.locale,a=t.removing,s=t.submitting,l=t.premiumSubscriptionPaymentSourceId,u=_e().values(o).sort((function(e,t){return e.id===n?-1:t.id===n?1:Th.default.compare(e.id,t.id)})),f=this.state.editingPayment,d=u.findIndex((function(e){return e.id===f})),p=u.map((function(t,o){return(0,r.jsx)(LE,{locale:i,paymentSource:t,isDefault:n===t.id,onCancel:e.handleCancel,onDelete:e.handleDelete,isForSubscription:t.id===l,hideDivider:d===o-1,onSubmit:e.handleSubmit,index:o,submitting:s,removing:a,isEditing:f===t.id,onEditClick:e.handleEditClick},t.id)}));return(0,r.jsxs)("div",{children:[(0,r.jsx)(c.vwX,{tag:"h1",children:(0,r.jsxs)(ae.Z,{align:ae.Z.Align.CENTER,children:[(0,r.jsx)(c.ua7,{position:"left",text:x.Z.Messages.BILLING_SECURE_TOOLTIP,children:function(e){return(0,r.jsx)(Rh,jE({className:_E().lockIcon},e))} }),x.Z.Messages.BILLING_PAYMENT_SOURCES]})}),p,d!==u.length-1?(0,r.jsx)(c.$i$,{className:_E().sourceDivider}):null,this.renderFooter()]})};return o}(o.PureComponent);const kE=UE;var GE=n(123435),BE=n(569851),HE=n.n(BE);function VE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FE(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function YE(e){YE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return YE(e)}function zE(e,t){return!t||"object"!==KE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function WE(e,t){WE=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return WE(e,t)}var KE=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function qE(e){var t=function(){ if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=YE(e);if(t){var o=YE(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return zE(this,n)}}var XE=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&WE(e,t)}(n,e);var t=qE(n);function n(){VE(this,n);return t.apply(this,arguments)}var o=n.prototype;o.componentDidMount=function(){l.Z.wait((function(){Tt.tZ();Tt.jg()}))};o.handleRedemptionRedirect=function(){d.Z.setSection(B.oAB.INVENTORY)};o.render=function(){ var e=this.props,t=e.syncing,n=e.hide,o=e.paymentSources,i=e.defaultPaymentSourceId,a=e.locale,s=e.premiumSubscription,l=e.isRemovingPaymentSource,u=e.isUpdatingPaymentSource;return n?(0,r.jsx)(Pt.Z,{}):(0,r.jsxs)("div",{className:HE().userSettingsBilling,children:[t&&0===Object.keys(o).length?(0,r.jsx)("div",{className:HE().syncing,children:(0,r.jsx)(c.$jN,{})}):(0,r.jsx)(kE,{paymentSources:o,defaultPaymentSourceId:i,premiumSubscriptionPaymentSourceId:null!=s&&s.status!==B.O0b.CANCELED?s.paymentSourceId:null,locale:a,removing:l,submitting:u}),(0,r.jsx)("div",{className:HE().paymentHistory,children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)(c.vwX,{tag:"h1",children:x.Z.Messages.BILLING_PAYMENT_HISTORY}),children:[(0,r.jsx)(GE.oQ,{}),(0,r.jsx)(Sh.Z,{locale:a})]})}),(0,r.jsx)(c.Zbd,{className:HE().codeRedemptionRedirect,type:c.Zbd.Types.CUSTOM,children:x.Z.Messages.BILLING_CODE_REDEMPTION_REDIRECT.format({onClick:this.handleRedemptionRedirect})})]})};return n}(o.PureComponent);function QE(){ var e=(0,y.cj)([m.default,Mr.Z,Wt.Z,Lr.default,Rr.Z,Rt.Z],(function(){var e=Rt.Z.getPremiumTypeSubscription(),t=Lr.default.getCurrentUser();L()(null!=t,"UserSettingsBilling: currentUser cannot be undefined");return{locale:m.default.locale,hide:Rr.Z.enabled,isClaimed:t.isClaimed(),isVerified:t.verified,premiumSubscription:e,defaultPaymentSourceId:Wt.Z.defaultPaymentSourceId,paymentSources:Wt.Z.paymentSources,syncing:Mr.Z.isSyncing,isRemovingPaymentSource:Mr.Z.isRemovingPaymentSource,isUpdatingPaymentSource:Mr.Z.isUpdatingPaymentSource}}));return(0,r.jsx)(XE,function(e){for(var t=1;te.length)&&(t=e.length) ;for(var n=0,r=new Array(t);n0)return(0,r.jsx)(c.$i$,{ className:Iy().connectedAccountSeparator})}(),n.revoked?(0,r.jsx)(c.xJW,{className:Iy().integrationsWrapper,children:(0,r.jsx)(c.R94,{className:Iy().integrationRevoked,children:x.Z.Messages.CONNECTED_ACCOUNT_REVOKED.format({onReconnect:a})})}):n.integrations.length>0?(0,r.jsxs)(c.xJW,{className:Iy().integrationsWrapper,children:[(0,r.jsx)(c.vwX,{tag:c.RB0.H5,children:(0,r.jsx)(c.xvT,{variant:"text-xs/semibold",children:x.Z.Messages.SUB_ENABLED_SERVERS})}),(0,r.jsx)("div",{children:n.integrations.map((function(e){return(0,r.jsx)(Py,{integration:e},e.id)}))})]}):void 0]})}function Ry(e){var t=e.alreadyConnectedPlatforms,n=e.excludedPlatformTypes,i=e.includedDisabledPlatformTypes;o.useEffect((function(){return function(){(0,Hs.EW)(a.z$.NEW_CRUNCHYROLL_CONNECTION,{dismissAction:jc.L.AUTO})}}),[]);return(0,r.jsxs)("div",{className:Iy().connectContainer,children:[(0,r.jsx)(c.X6q,{variant:"heading-md/bold",color:"interactive-active",className:Iy().connectHeader, children:x.Z.Messages.CONNECTIONS_USER_SETTINGS_CONNECT_ACCOUNTS_HEADER}),(0,r.jsx)(c.xvT,{variant:"text-xs/normal",color:"header-secondary",children:x.Z.Messages.CONNECTIONS_USER_SETTINGS_CONNECT_ACCOUNTS_DESCRIPTION.format({privacyPolicyUrl:B.EYA.PRIVACY})}),(0,r.jsx)(xy,{alreadyConnectedPlatforms:t,excludedPlatformTypes:n,includedDisabledPlatformTypes:i})]})}function xy(e){var t=e.alreadyConnectedPlatforms,n=e.excludedPlatformTypes,o=e.includedDisabledPlatformTypes,i=function(e){var t=ey.Z.get(e);(0,ry.Z)(t.type);Dr.default.track(B.rMx.ACCOUNT_LINK_STEP,{previous_step:"desktop connections",current_step:"desktop oauth",platform_type:t.type})};return(0,r.jsxs)("div",{className:Iy().connectionsContainer,children:[(0,ty.AK)(o,n,t).slice(0,10).map((function(e){return(0,r.jsx)(JE.Z,{type:e.type,className:Iy().accountButton,innerClassName:Iy().accountButtonInner},e.type)})),(0,r.jsx)(c.ua7,{text:x.Z.Messages.CONNECTIONS_VIEW_MORE,children:function(e){var t=e.onMouseEnter,a=e.onMouseLeave ;return(0,r.jsx)("div",{className:v()(Iy().accountAddWrapper,Iy().accountButton),children:(0,r.jsx)(c.tEY,{children:(0,r.jsx)("button",{onMouseEnter:t,onMouseLeave:a,className:v()(Iy().accountAddInner,Iy().accountButtonInner),type:"button",onClick:function(){return function(e){l.Z.dispatch({type:"CONNECTIONS_GRID_MODAL_SHOW",onComplete:i,excludedPlatformTypes:e,includedDisabledPlatformTypes:o})}(n)},"aria-label":x.Z.Messages.ADD_NEW_CONNECTION,children:(0,r.jsx)(Ce.Z,{height:18,width:18,"aria-label":x.Z.Messages.CONNECTIONS_VIEW_MORE})})})})}})]})}function My(e){var t,o=e.fetching,i=e.accounts,a=e.theme;t=o?(0,r.jsx)(c.$jN,{className:fe().marginTop20,type:c.$jN.Type.SPINNING_CIRCLE}):0===i.length?(0,r.jsxs)(ch.ZP,{className:fe().marginTop40,theme:a,children:[(0,r.jsx)(ch.ox,{darkSrc:n(117399),lightSrc:n(408056),width:230,height:220}),(0,r.jsx)(ch.OZ,{note:x.Z.Messages.CONNECTED_ACCOUNTS_NONE,children:x.Z.Messages.CONNECTED_ACCOUNTS_NONE_TITLE})]}):i.filter((function(e){ return ey.Z.isSupported(e.type)})).map((function(e,t){return(0,r.jsx)(jy,{theme:a,account:e,onDisconnect:function(){return function(e){var t=e.type,n=e.id;$E.Z.disconnect(t,n)}(e)}},t)}));return(0,r.jsx)(c.xJW,{className:Iy().connectionList,children:t})}const wy=function(){var e=(0,y.e7)([Rr.Z],(function(){return Rr.Z.hidePersonalInformation})),t=(0,y.e7)([iy.Z],(function(){return iy.Z.isFetching()})),n=(0,y.e7)([iy.Z],(function(){return iy.Z.getAccounts()})),i=(0,y.e7)([Lr.default],(function(){return Lr.default.getCurrentUser()})),a=(0,Uo.ZP)(),s=oy.c.useExperiment({}).allowPlayStationStaging,l=o.useMemo((function(){var e,t,n=new Set;s&&n.add(B.ABu.PLAYSTATION_STAGING);(null===(e=ty.bO[B.ABu.INSTAGRAM])||void 0===e?void 0:e.includes(null!==(t=null==i?void 0:i.id)&&void 0!==t?t:""))&&n.add(B.ABu.INSTAGRAM);return n}),[s,null==i?void 0:i.id]),u=((0,y.e7)([Ns.Z],(function(){return Ns.Z.getFlattenedGuildIds()})),(0,ly.X)()),f=o.useMemo((function(){return new Set(ey.Z.filter((function(e){ return!u(e)})).map((function(e){return e.type})))}),[u]),d=o.useMemo((function(){var e=new Set;n.forEach((function(t){return e.add(t.type)}));return e}),[n]);o.useEffect((function(){$E.Z.fetch()}),[]);return e?(0,r.jsx)(Pt.Z,{}):(0,r.jsxs)(c.hjN,{className:Iy().connections,tag:c.RB0.H1,title:x.Z.Messages.CONNECTIONS,children:[(0,r.jsx)(Ry,{alreadyConnectedPlatforms:d,excludedPlatformTypes:f,includedDisabledPlatformTypes:l}),(0,r.jsx)(My,{fetching:t,accounts:n,theme:a})]})};var Dy=n(402391),Zy=n(414523),Ly=n(762572),Uy=n(285991),ky=n(441394),Gy=n(498442),By=n(998137),Hy=n(940007),Vy=n(734620),Fy=n(91174),Yy=n(762308),zy=n(84841),Wy=n(8489),Ky=n(118044),qy=n(532548),Xy=n(688013),Qy=n(948582),$y=n(212098),Jy=n.n($y),em=n(768864),tm=n.n(em),nm=n(333286),rm=n.n(nm);function om(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0,s=Sm(null!=i?i:{})&&"stable"!==window.GLOBAL_ENV.RELEASE_CHANNEL?(0,r.jsx)(c.xvT,{color:"text-danger",variant:"text-md/normal",children:"Mobile build overrides must be generated using the desktop/web stable client for now!"}):null ;return(0,r.jsxs)(c.hjN,{className:fe().marginTop60,children:[(0,r.jsxs)(ae.Z,{className:fe().marginBottom20,children:[(0,r.jsx)(ae.Z.Child,{children:(0,r.jsx)(c.vwX,{tag:c.RB0.H1,children:"Build Overrides"})}),(0,r.jsx)(ae.Z.Child,{grow:0,children:(0,r.jsx)(c.zxk,{size:c.PhG.SMALL,onClick:this.handleAddBuildOverride,disabled:!a,children:"Add Build Override"})})]}),(0,r.jsx)(c.$i$,{}),(0,r.jsxs)(ae.Z,{direction:ae.Z.Direction.VERTICAL,children:[s,e,(0,r.jsxs)(ae.Z,{grow:0,direction:ae.Z.Direction.HORIZONTAL_REVERSE,children:[this.renderRefreshButton(),this.renderSaveButton(),this.renderLinkButton()]})]})]})};return o}(o.Component),Cm=function(e){fm(o,e);var t=Om(o);function o(){cm(this,o);var e;(e=t.apply(this,arguments)).state={ttlSeconds:3600,releaseChannel:"all",userIds:new Set,userIdEntry:"",userIdEntryError:null,allowedVersions:[],allowedVersionEntry:"",allowedVersionEntryError:null,publicLink:" ",statusText:null,statusTextColor:ce.Z.Colors.STATUS_RED,allowLoggedOut:!1} ;e.setUserEntryError=function(t){e.setState({userIdEntryError:t})};e.setStatusMessage=function(t,n){e.setState({statusText:t,statusTextColor:null!=n?n:ce.Z.Colors.STATUS_RED})};e.handleUserIDEntry=function(t){if(!/^[\d\s,]*$/.test(t))return e.setUserEntryError("User IDs are numbers!");var n=new Set(t.split(/[,\s]+/).filter(Boolean));e.setState({userIdEntry:t,userIds:n})};e.setAllowedVersionError=function(t){e.setState({allowedVersionEntryError:t})};e.handleAllowedVersionEntry=function(t){e.setState({allowedVersionEntry:t})};e.handleAllowedVersionEnter=function(t){t.charCode===B.yXg.ENTER&&e.handleAddAllowedVersion()};e.handleAddAllowedVersion=function(){var t=e.state,n=t.allowedVersions,r=t.allowedVersionEntry;if(0===(r=r.trim()).length)return e.setAllowedVersionError("Enter a valid version number!");if(n.indexOf(r)>=0)return e.setAllowedVersionError("You already added that version!");e.setState({allowedVersions:mm(n).concat([r]),allowedVersionEntry:"",allowedVersionEntryError:""})} ;e.handleRemoveAllowedVersion=function(t){var n=e.state.allowedVersions;n=n.filter((function(e){return e!==t}));e.setState({allowedVersions:n})};e.handleAllowLoggedOut=function(t){e.setState({allowLoggedOut:t})};e.handleExpirationChange=function(t){e.setState({ttlSeconds:t})};e.handleReleaseChannelChange=function(t){e.setState({releaseChannel:t})};e.handleExperiments=function(t){if(0!==t.trim().length){try{var n=JSON.parse(t);for(var r in n){if(null==r.match(/^[0-9]{4}\-[0-9]{2}_[a-z0-9_]+$/)){e.setState({experimentsError:"".concat(r," is an invalid experiment name")});return}if("number"!=typeof n[r]){e.setState({experimentsError:"".concat(r," has an invalid bucket override")});return}}}catch(t){e.setState({experimentsError:"Unable to parse experiments ".concat(t.message)});return}e.setState({experiments:t,experimentsError:void 0})}else e.setState({experimentsError:void 0})};e.generatePayload=function(){return{overrides:e.props.buildOverrides,meta:{ release_channel:"all"===e.state.releaseChannel?null:e.state.releaseChannel,ttl_seconds:e.state.ttlSeconds,user_ids:Array.from(e.state.userIds),allowed_versions:e.isMobile()?e.state.allowedVersions:void 0,allow_logged_out:e.state.allowLoggedOut,experiments:null==e.state.experiments?null:JSON.parse(e.state.experiments)}}};var n=im(e);e.handleGenerateLink=sm((function(){var e,t;return vm(this,(function(r){switch(r.label){case 0:if(n.isMobile()&&0===n.state.allowedVersions.length){n.setAllowedVersionError("You must add at least one allowed version for iOS");return[2]}n.setStatusMessage(null);e=n.generatePayload();return[4,(0,By.M3)(e)];case 1:if(!1!==(t=r.sent()).error)n.setStatusMessage(JSON.stringify(t.error),ce.Z.Colors.STATUS_RED);else{n.setState({publicLink:t.url.toString()});0===e.meta.user_ids.length&&n.setStatusMessage("Warning! No users added to the whitelist! This link could be used by anyone to override their build.",ce.Z.Colors.STATUS_YELLOW)}return[2]}}))}));return e} var i=o.prototype;i.isMobile=function(){var e;return Sm(null!==(e=this.props.buildOverrides)&&void 0!==e?e:{})};i.renderSettingsForm=function(){var e=this,t=this.state,n=t.ttlSeconds,o=t.releaseChannel,i=t.userIdEntry,a=t.userIdEntryError,s=t.allowedVersions,l=t.allowedVersionEntry,u=t.allowedVersionEntryError,f=t.allowLoggedOut,d=t.experiments,p=t.experimentsError,h=Qy.S6.find((function(e){return e.value===n})),E=s.map((function(e){return{label:e,value:e}}));return(0,r.jsxs)(ae.Z.Child,{basis:"70%",children:[(0,r.jsx)(c.xJW,{title:"Expire After",className:fe().marginBottom20,children:(0,r.jsx)(c.q4e,{value:null!=h?h.value:null,options:Qy.S6,onChange:this.handleExpirationChange})}),this.isMobile()?null:(0,r.jsx)(c.xJW,{title:"Release Channel",className:fe().marginBottom20,children:(0,r.jsx)(c.q4e,{value:o,options:Qy.F$,onChange:this.handleReleaseChannelChange})}),this.isMobile()?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xJW,{title:"Add allowed app version (required)", className:fe().marginBottom20,children:(0,r.jsxs)(ae.Z,{direction:ae.Z.Direction.HORIZONTAL,children:[(0,r.jsx)(ae.Z.Child,{wrap:!0,basis:"90%",children:(0,r.jsx)(c.oil,{autoFocus:!0,value:l,onKeyPress:this.handleAllowedVersionEnter,error:u,onChange:this.handleAllowedVersionEntry,placeholder:"Example: 34"})}),(0,r.jsx)(c.zxk,{onClick:this.handleAddAllowedVersion,children:"Add"})]})}),(0,r.jsx)(c.xJW,{title:"Remove allowed app version",className:fe().marginBottom20,children:(0,r.jsx)(c.q4e,{value:null,options:E,onChange:this.handleRemoveAllowedVersion,isDisabled:0===s.length})})]}):null,this.isMobile()?null:(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(c.xJW,{title:"Limit to User IDs (optional)",className:fe().marginBottom20,children:[(0,r.jsx)(ae.Z,{direction:ae.Z.Direction.HORIZONTAL,children:(0,r.jsx)(ae.Z.Child,{wrap:!0,basis:"90%",children:(0,r.jsx)(c.Kx8,{value:i,error:a,onBlur:function(){return e.setUserEntryError("")},onChange:this.handleUserIDEntry})})}),(0,r.jsx)(c.xvT,{ variant:"text-sm/normal",color:"text-muted",className:fe().marginTop8,children:"User IDs can be separated by whitespace or commas."})]})}),(0,r.jsxs)(c.xJW,{title:"Client Experiment Override",className:fe().marginBottom20,children:[(0,r.jsx)(ae.Z,{direction:ae.Z.Direction.HORIZONTAL,children:(0,r.jsx)(ae.Z.Child,{wrap:!0,basis:"90%",children:(0,r.jsx)(c.Kx8,{value:d,error:p,onChange:this.handleExperiments,placeholder:'{"2022-01_threads":1}'})})}),(0,r.jsx)(c.xvT,{variant:"text-sm/normal",color:"text-muted",className:fe().marginTop8,children:"Locally override the given experiments to the given bucket. This ONLY applies locally and WILL NOT affect the server. When the user clears build override, the experiment override is removed as well."})]}),(0,r.jsx)(c.j7V,{onChange:this.handleAllowLoggedOut,value:f,children:"Allow logged out users"})]})};i.renderPayloadBlock=function(){var e=JSON.stringify(this.generatePayload(),null,2),t=function(){return e},o=(0,r.jsx)(Fy.GI,{ createPromise:function(){return Promise.resolve().then(n.bind(n,455049))},webpackId:455049,renderFallback:t,render:function(n){var o=n.highlight("json",e,!0);return null==o?t():(0,r.jsx)("code",{className:"hljs scroller ".concat(o.language," ").concat(rm().scrollbarGhost," ").concat(Jy().codebox),dangerouslySetInnerHTML:{__html:o.value}})}});return(0,r.jsx)(ae.Z.Child,{children:(0,r.jsx)(c.Zbd,{children:(0,r.jsx)("pre",{children:o})})})};i.renderLinkForm=function(){var e=this.state,t=e.statusTextColor,n=e.statusText,o=e.publicLink;return(0,r.jsxs)("div",{children:[(0,r.jsx)(c.xJW,{title:"Signed Link",children:(0,r.jsxs)(ae.Z,{children:[(0,r.jsx)(ae.Z.Child,{wrap:!0,basis:"75%",children:(0,r.jsx)(Gy.Z,{value:o})}),(0,r.jsx)(c.zxk,{onClick:this.handleGenerateLink,children:"Generate Link"})]})}),(0,r.jsx)(ce.Z,{color:t,className:"".concat(fe().marginBottom8," ").concat(fe().marginTop8),children:n})]})};i.render=function(){var e=this.props,t=e.onClose,n=e.transitionState;return(0, r.jsxs)(c.Y0X,{size:c.CgR.LARGE,transitionState:n,"aria-label":"Generate Public Build Override Link",children:[(0,r.jsxs)(c.xBx,{justify:ae.Z.Justify.BETWEEN,separator:!1,children:[(0,r.jsx)(c.X6q,{variant:"heading-lg/semibold",children:"Generate Public Build Override Link"}),(0,r.jsx)(c.olH,{onClick:t})]}),(0,r.jsxs)(c.hzk,{children:[(0,r.jsxs)(ae.Z,{children:[this.renderSettingsForm(),this.renderPayloadBlock()]}),this.renderLinkForm()]})]})};return o}(o.Component);function Pm(){throw new Error("Send help")}function jm(){var e=ym(o.useState(!1),2),t=e[0],n=e[1],i=ym(o.useState(""),2),a=i[0],s=i[1];o.useEffect((function(){sm((function(){var e;return vm(this,(function(t){switch(t.label){case 0:return[4,(0,Hc.Y)()];case 1:e=t.sent();s(e);return[2]}}))}))()}),[]);return t?{}:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:[Jy().buttonsContainer,fe().marginBottom20].join(" "),children:[(0,r.jsx)(c.zxk,{onClick:function(){return window.open(a,"_blank")},disabled:""===a, children:"Open Overlay"}),(0,r.jsx)(c.zxk,{onClick:function(){qy.Z.getSocket().close();qy.Z.getSocket().connect()},children:"Reset Socket"}),Wy.q&&(0,r.jsx)(c.zxk,{onClick:function(){l.Z.dispatch({type:"CLEAR_CACHES"})},children:"Clear Caches"})]}),(0,r.jsx)(c.hjN,{title:"Crashes",tag:c.RB0.H1,children:(0,r.jsxs)("div",{className:Jy().buttonsContainer,children:[(0,r.jsx)(c.zxk,{onClick:function(){return qf.default.crash(0)},children:"libdiscord Abort"}),(0,r.jsx)(c.zxk,{onClick:function(){return qf.default.crash(1)},children:"libdiscord SIGSEGV"}),(0,r.jsx)(c.zxk,{onClick:function(){return qf.default.crash(2)},children:"libdiscord EXCEPTION_ACCESS_VIOLATION"}),(0,r.jsx)(c.zxk,{onClick:function(){return n(!0)},children:"React Crash"}),(0,r.jsx)(c.zxk,{onClick:Pm,children:"onClick Throw"})]})})]})}var Rm=y.ZP.connectStores([Ky.default,zy.Z],(function(){return{isTracingRequests:Ky.default.isTracingRequests,isForcedCanary:Ky.default.isForcedCanary, isLoggingGatewayEvents:Ky.default.isLoggingGatewayEvents,isLoggingOverlayEvents:Ky.default.isLoggingOverlayEvents,isLoggingAnalyticsEvents:Ky.default.isLoggingAnalyticsEvents,isAxeEnabled:Ky.default.isAxeEnabled,isSourceMapsEnabled:Ky.default.sourceMapsEnabled,isAnalyticsDebuggerEnabled:Ky.default.isAnalyticsDebuggerEnabled,isIdleStatusIndicatorEnabled:Ky.default.isIdleStatusIndicatorEnabled,appDirectoryIncludesInactiveCollections:Ky.default.appDirectoryIncludesInactiveCollections,isDevToolsEnabled:zy.Z.devToolsEnabled}}))((function(e){var t=e.isTracingRequests,n=e.isForcedCanary,o=e.isLoggingGatewayEvents,i=e.isLoggingOverlayEvents,a=e.isLoggingAnalyticsEvents,s=(e.isAxeEnabled,e.isSourceMapsEnabled),l=e.isAnalyticsDebuggerEnabled,u=e.isIdleStatusIndicatorEnabled,f=e.appDirectoryIncludesInactiveCollections,d=e.isDevToolsEnabled,p=(0,y.e7)([Lr.default],(function(){return Lr.default.getCurrentUser()}));return(0,r.jsxs)(c.hjN,{title:"Developer Flags",tag:c.RB0.H1, children:[Gc.Z.isDeveloper&&(0,r.jsx)(c.j7V,{value:d,note:(0,r.jsxs)(r.Fragment,{children:["Enable client DevTools (open via Help menu in top right or with"," ",(0,r.jsx)("kbd",{className:Jy().key,children:cp.Z.modKey})," + ",(0,r.jsx)("kbd",{className:Jy().key,children:cp.Z.altKey})," ","+ ",(0,r.jsx)("kbd",{className:Jy().key,children:"O"}),")."]}),onChange:function(e){return(0,Yy.Qh)({devToolsEnabled:e})},children:"Enable DevTools"}),(0,r.jsx)(c.j7V,{value:t,note:"Force trace all client requests with APM",onChange:function(e){return(0,Zy.y)({trace:e})},children:"Enable Tracing Requests"}),(0,r.jsx)(c.j7V,{value:n,note:"Force all API requests to canary instances",onChange:function(e){return(0,Zy.y)({canary:e})},children:"Enable Forced Canary"}),(0,r.jsx)(c.j7V,{value:o,note:"Logs all incoming and outgoing gateway events to the developer console, enable verbose logging in the developer console to see!",onChange:function(e){return(0,Zy.y)({logGatewayEvents:e})}, children:"Enable Logging of Gateway Events to Console"}),(0,r.jsx)(c.j7V,{value:i,note:"Logs all overlay related RPC events. Super noisy if an overlay is connected",onChange:function(e){return(0,Zy.y)({logOverlayEvents:e})},children:"Enable Logging of Overlay RPC Events & Commands"}),(0,r.jsx)(c.j7V,{value:a,note:"Logs all analytics events to the developer console",onChange:function(e){return(0,Zy.y)({logAnalyticsEvents:e})},children:"Enable Logging of Analytics Events"}),(0,r.jsx)(c.j7V,{value:s,note:"Only enable on devices you trust.",onChange:function(e){return(0,Zy.y)({sourceMapsEnabled:e})},children:"Enable source maps to be loaded on this client"}),(0,r.jsx)(c.j7V,{value:l,note:"Displays a floating debugger with viewed impressions",onChange:function(e){return(0,Zy.y)({analyticsDebuggerEnabled:e})},children:"Enable standard analytics debugger view"}),(null==p?void 0:p.isStaff())?(0,r.jsx)(c.j7V,{value:u,note:"Displays a floating idle status indicator",onChange:function(e){ return(0,Zy.y)({idleStatusIndicatorEnabled:e})},children:"Enable idle status indicator"}):null,null,(null==p?void 0:p.isStaff())?(0,r.jsx)(c.j7V,{value:null==p?void 0:p.hasDisabledPremium(),note:"Force non premium user experience locally",onChange:function(e){return Uy.mB(B.xW$.DISABLE_PREMIUM,e)},children:"Enable force non nitro experience locally"}):null,(null==p?void 0:p.isStaff())?(0,r.jsx)(c.j7V,{value:f,note:"In App Directory, include inactive collections on the homepage. Use this to preview changes to collections before publishing them.",onChange:function(e){return(0,Zy.y)({appDirectoryIncludesInactiveCollections:e})},children:"Preview Unpublished Collections on App Directory Homepage"}):null]})}));function xm(){var e=(0,y.e7)([Xy.Z],(function(){return Xy.Z.getSurveyOverride()})),t=ym(o.useState(null!=e?e:""),2),n=t[0],i=t[1];return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:"Survey Override",className:fe().marginTop60,children:[(0,r.jsx)(c.vwX,{ children:"Copy the ID of the Survey you want to test:"}),(0,r.jsxs)("form",{className:Jy().surveyOverride,onSubmit:function(e){e.preventDefault();n.length>0?Ly.Xq(n):Ly.Xq(null)},children:[(0,r.jsx)(c.oil,{className:Jy().surveyOverrideInput,value:n,onChange:i}),(0,r.jsx)(c.zxk,{type:"submit",children:"Save Override"})]})]})}function Mm(){var e,t=(0,y.e7)([Vy.Z],(function(){return Vy.Z.overrideId()})),n=ym(o.useState(null!==(e=Vy.Z.overrideId())&&void 0!==e?e:""),2),i=n[0],a=n[1];return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:"Changelog Override",className:fe().marginTop60,children:[(0,r.jsx)(c.vwX,{children:"Enter the ID of the changelog you want to test"}),(0,r.jsxs)("div",{className:Jy().surveyOverride,children:[(0,r.jsx)(c.oil,{className:Jy().surveyOverrideInput,value:i,onChange:a}),(0,r.jsx)(c.zxk,{onClick:function(){""===i?Dy.Z.setChangelogOverride(null):Dy.Z.setChangelogOverride(i)},disabled:t===i,children:"Update Changelog"})]})]})}var wm=function(e){fm(n,e);var t=Om(n) ;function n(){cm(this,n);return t.apply(this,arguments)}n.prototype.render=function(){return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(Rm,{}),(0,r.jsx)(jm,{}),(0,r.jsx)(xm,{}),(0,r.jsx)(Mm,{}),(0,r.jsx)(Am,{})]})};return n}(o.PureComponent);const Dm=wm;var Zm=n(661123),Lm=n(987594);function Um(){var e=ni.xq.useSetting(),t=o.useMemo((function(){return(0,Lm.bL)(e)}),[e]);return(0,r.jsx)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.FRIEND_REQUESTS,children:(0,r.jsxs)(c.hjN,{title:x.Z.Messages.FRIEND_PERMITTED_SOURCE,className:fe().marginBottom40,children:[(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:t.all,onChange:function(e){return ni.xq.updateSetting(e?B.HGf:B.HGf&~B.SOq.NO_RELATION)},children:x.Z.Messages.FRIEND_PERMITTED_SOURCE_ALL}),(0,r.jsx)(c.j7V,{value:t.all||t.mutualFriends,onChange:function(t){return ni.xq.updateSetting(t?Zm.pj(e,B.SOq.MUTUAL_FRIENDS):Zm.M1(e,B.SOq.MUTUAL_FRIENDS,B.SOq.NO_RELATION))}, children:x.Z.Messages.FRIEND_PERMITTED_SOURCE_MUTUAL_FRIENDS}),(0,r.jsx)(c.j7V,{value:t.all||t.mutualGuilds,onChange:function(t){return ni.xq.updateSetting(t?Zm.pj(e,B.SOq.MUTUAL_GUILDS):Zm.M1(e,B.SOq.MUTUAL_GUILDS,B.SOq.NO_RELATION))},children:x.Z.Messages.FRIEND_PERMITTED_SOURCE_MUTUAL_GUILDS})]})})}var km=n(875700),Gm=n(959207),Bm=n(671723),Hm=n(108106),Vm=n(425454),Fm=n(416044),Ym=n(295652),zm=n(496320),Wm=n.n(zm),Km=n(637678),qm=n.n(Km),Xm=n(913957),Qm=n.n(Xm);function $m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0 ;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?(0,r.jsx)("div",{className:fv().feedback,children:x.Z.Messages.DROPS_REQUEST_FEEDBACK_SUCCESS.format({feedbackURL:"https://survey.alchemer.com/s3/7043098/Discord-Drops-CSAT?user_id=".concat(null!==(S=null==n?void 0:n.id)&&void 0!==S?S:"")})}):null]})}(),function(){var e,t=u.find((function(e){return e.giftCodeBatchId===Br.m8&&!e.consumed})),n=null!==(e=u.filter((function(e){return e.giftCodeBatchId===Br.rX&&!e.consumed})))&&void 0!==e?e:[],o=bv(_e().partition(n,(function(e){return e.subscriptionPlanId===Br.Xh.PREMIUM_YEAR_TIER_2})),2),i=o[0],a=o[1],s=_.length+I.length>0;return(0,r.jsx)(c.hjN,{children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:s?x.Z.Messages.GIFT_INVENTORY_YOUR_GIFTS:void 0}),children:[s?(0,r.jsx)(c.$i$,{className:fv().divider}):null,I.map((function(e){var t=e.code,n=e.promotion;return(0,r.jsx)(_v,{outboundPromotion:n, code:t,addClaimedOutboundPromotionCode:T},n.id)})),_.map((function(e){return(0,r.jsx)(_v,{outboundPromotion:e,code:S[e.id],addClaimedOutboundPromotionCode:T},e.id)})),null!=t?(0,r.jsx)(cv,{className:fv().skuCard,skuId:t.skuId,subscriptionPlanId:t.subscriptionPlanId,entitlements:[t],giftCodeBatchId:Br.m8},(0,Xg.Bg)(t.skuId,t.subscriptionPlanId)):null,i.length>0?(0,r.jsx)(cv,{className:fv().skuCard,skuId:i[0].skuId,subscriptionPlanId:i[0].subscriptionPlanId,entitlements:i,giftCodeBatchId:Br.rX},(0,Xg.Bg)(i[0].skuId,i[0].subscriptionPlanId)):null,a.length>0?(0,r.jsx)(cv,{className:fv().skuCard,skuId:a[0].skuId,subscriptionPlanId:a[0].subscriptionPlanId,entitlements:a,giftCodeBatchId:Br.rX},(0,Xg.Bg)(a[0].skuId,a[0].subscriptionPlanId)):null]})})}(),(0,r.jsx)(c.hjN,{children:(0,r.jsxs)(c.y5t,{component:(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:x.Z.Messages.GIFT_INVENTORY_GIFTS_YOU_PURCHASED}),children:[(0,r.jsx)(c.$i$,{className:fv().divider}),0===Object.keys(f).length?(0, r.jsxs)("div",{className:fv().emptyState,children:[(0,r.jsx)("div",{className:fv().emptyStateImage}),(0,r.jsx)(c.H,{className:fv().emptyStateHeader,children:x.Z.Messages.GIFT_INVENTORY_NO_GIFTS}),(0,r.jsx)("p",{className:fv().emptyStateSubtext,children:x.Z.Messages.GIFT_INVENTORY_NO_GIFTS_SUBTEXT.format({onClick:e})})]}):_e().keys(f).map((function(e){var t=(0,Xg.Z0)(e),n=t.skuId,o=t.subscriptionPlanId,i=t.giftStyle;return(0,r.jsx)(cv,{className:fv().skuCard,skuId:n,subscriptionPlanId:o,entitlements:f[e],giftStyle:i},e)}))]})})]}):(0,r.jsx)(c.$jN,{className:fv().loading})};var Tv=n(607810),Nv=n.n(Tv);function Av(){return(0,Wg.Q)()?(0,r.jsx)(GE.c8,{}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(zg.Z,{section:B.jXE.LIBRARY_INVENTORY_CODE_REDEMPTION,children:(0,r.jsx)(hO,{})}),(0,r.jsx)(c.$i$,{className:Nv().divider}),(0,r.jsx)(zg.Z,{section:B.jXE.LIBRARY_INVENTORY_GIFTS_LIST,children:(0,r.jsx)(Sv,{})})]})} var Cv=n(452006),Pv=n(344524),jv=n(228667),Rv=n(866926),xv=n(255088),Mv=n(229400),wv=n(613677),Dv=n(79251),Zv=n(668785),Lv=n(714163),Uv=n.n(Lv);function kv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gv(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?o/s*100:100;return(0,r.jsx)(OI.Z,{background:II().progressBackground,percent:c,strokeSize:OI.Z.StrokeSizes.SMALL,className:v()(II().gemIndicatorProgressCircle,t),children:(0,r.jsxs)("div",{className:II().gemIndicatorContainer,children:[this.renderIcon(i),(0,r.jsx)("div",{className:II().tierLabel,children:(0,gI.nW)(i)})]})})};return n}(o.Component);var RI=n(217674),xI=n(102921);function MI(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}function wI(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){MI(i,r,o,a,s,"next",e)}function s(e){MI(i,r,o,a,s,"throw",e)}a(void 0)}))}}function DI(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function ZI(e){for(var t=1;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]new Date,s=null!=t.premiumGuildSubscription?new Date(xI.Z.extractTimestamp(t.premiumGuildSubscription.id)):null,l=t.canceled,u=l?Fc.Z:RI.Z;return(0,r.jsxs)("div",{className:HI().guildSubscriptionSlot,children:[(0,r.jsx)(u,{className:v()(HI().guildSubscriptionSlotIcon,VI({},HI().guildSubscriptionSlotIconCanceled,l))}),(0,r.jsxs)("div",{className:HI().guildSubscriptionSlotContent,children:[(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:HI().guildSubscriptionCreationDate,children:null!=s?x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_CREATION_DATE.format({date:s}):x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_UNUSED_SLOT_DESCRIPTION}),(0,r.jsxs)(c.xvT,{variant:"text-xs/normal",color:"text-muted",children:[a&&null!=i?(0,r.jsx)(WI,{deadline:i.getTime()}):null,a&&l?" • ":null,l?x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_PENDING_CANCELATION.format({ date:n.currentPeriodEnd}):null]})]}),(0,r.jsx)(c.yRy,{renderPopout:function(e){var i=e.closePopout;return(0,r.jsx)(kI,{onClose:i,guildBoostSlot:t,premiumSubscription:n,hasCancelableGuildBoostSlot:o})},position:"right",align:"center",children:function(e){return(0,r.jsx)(c.P3F,YI(FI({},e),{"aria-label":x.Z.Messages.MORE_OPTIONS,className:HI().guildSubscriptionSlotMenuIcon,children:(0,r.jsx)(Gu.Z,{})}))}})]})}function XI(e){var t=e.guildId,n=e.guildBoostSlots,o=e.premiumSubscription,i=e.availableGuildBoostSlots,a=e.hasCancelableGuildBoostSlot,s=(0,y.e7)([an.Z],(function(){return t!==zI?an.Z.getGuild(t):null}));return null==s&&t!==zI?null:(0,r.jsxs)("div",{className:HI().guild,children:[null!=s?(0,r.jsx)(KI,{guild:s,guildBoostSlots:n,availableGuildBoostSlots:i}):null,(0,r.jsx)("div",{className:HI().guildSubscriptionSlots,children:n.map((function(e){return(0,r.jsx)(qI,{guildBoostSlot:e,premiumSubscription:o,hasCancelableGuildBoostSlot:a},e.id)}))})]})}function QI(){var e=(0, y.e7)([Rt.Z],(function(){return Rt.Z.getPremiumTypeSubscription()})),t=(0,y.e7)([bI.Z],(function(){return bI.Z.boostSlots})),n=_e()(t).filter((function(e){return e.isAvailable()})).value(),o=_e()(t).groupBy((function(e){var t=e.premiumGuildSubscription;return null!=t?t.guildId:zI})).value(),i=o[0],a=Object.keys(o).filter((function(e){return e!==zI}));if(0===a.length&&null==i||null==e)return null;var s=_e()(t).filter((function(e){return!e.canceled})).value().length>Zr.ZP.getNumIncludedPremiumGuildSubscriptionSlots(e.planId);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xvT,{variant:"text-sm/normal",className:HI().blurb,children:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_SUBTITLE.format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.GUILD_SUBSCRIPTIONS)})}),null!=i?(0,r.jsx)(XI,{guildId:zI,guildBoostSlots:i,premiumSubscription:e,availableGuildBoostSlots:n,hasCancelableGuildBoostSlot:s}):null,a.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.X6q,{ variant:"heading-deprecated-12/semibold",className:HI().subSectionHeader,children:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_ACTIVE_TITLE}),a.map((function(t){return(0,r.jsx)(XI,{guildId:t,guildBoostSlots:o[t],premiumSubscription:e,availableGuildBoostSlots:n,hasCancelableGuildBoostSlot:s},t)}))]}):null]})}var $I=n(726544),JI=n.n($I);function eS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tS(e){tS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return tS(e)}function nS(e,t){return!t||"object"!==oS(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function rS(e,t){rS=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return rS(e,t)}var oS=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function iS(e){var t=function(){ if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=tS(e);if(t){var o=tS(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return nS(this,n)}}const aS=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&rS(e,t)}(n,e);var t=iS(n);function n(){eS(this,n);var e;(e=t.apply(this,arguments)).renderFeature=function(t,n){return(0,r.jsxs)("div",{className:JI().feature,children:[e.renderIcon(t),(0,r.jsxs)("div",{children:[null!=t.title?(0,r.jsx)("div",{className:JI().title,children:t.title}):null,(0,r.jsx)("div",{ className:null==t.title?JI().descriptionStandalone:JI().description,children:t.description})]})]},n)};return e}var o=n.prototype;o.renderIcon=function(e){if(null!=e.overrideIcon)return e.overrideIcon(JI().icon);if(null!=e.icon&&null!=e.iconClass){var t=e.icon;return(0,r.jsx)(t,{className:v()(JI().icon,e.iconClass)})}throw new Error("Missing overrideIcon or iconName and iconClass")};o.render=function(){return(0,r.jsx)("div",{className:JI().features,style:{gridTemplateColumns:Array(this.props.columns).fill("1fr").join(" ")},children:this.props.features.map(this.renderFeature)})};return n}(o.Component);var sS=n(399370),cS=n(781453),lS=n(841070),uS=n(23727),fS=n(855595),dS=n(71236);function pS(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function hS(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function ES(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function yS(e){var t=e.width,n=void 0===t?24:t,o=e.height,i=void 0===o?24:o,a=e.color,s=void 0===a?"currentColor":a,c=ES(e,["width","height","color"]);return(0,r.jsxs)("svg",hS(function(e){for(var t=1;t0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.vwX,{tag:"h1",children:x.Z.Messages.PREMIUM_GUILD_SUBSCRIPTION_TITLE}),(0,r.jsx)(GE.oQ,{}),(0,r.jsx)(QI,{})]}):null,children:(0,r.jsx)(_S,{})})})]}):(0,r.jsx)("div",{className:v()(OS().container,OS().loading),children:(0,r.jsx)(c.$jN,{})})}var SS=n(105783),TS=n(546274),NS=n(540825),AS=n(652119),CS=n(31914),PS=n(294303),jS=n(665640),RS=n.n(jS);function xS(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function MS(e){ MS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return MS(e)}function wS(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function LS(e,t){return!t||"object"!==kS(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function US(e,t){US=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return US(e,t)}var kS=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function GS(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=MS(e);if(t){ var o=MS(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return LS(this,n)}}function BS(e){var t=e.body,n=ZS(e,["body"]);(0,c.h7j)((function(e){return(0,r.jsx)(c.sm4,DS(wS({},e,n),{children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:t})}))}))}function HS(e){var t=e.message;BS({header:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_FAILURE_TITLE,confirmText:x.Z.Messages.OKAY,body:t})}var VS=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&US(e,t)}(n,e);var t=GS(n);function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var r;(r=t.call(this,e)).handleChangeDefaultGuildsRestricted=function(e){r.setState({defaultGuildsRestricted:!e},(function(){return r.showGuildRestrictionModal(!e)}))} ;r.handleChangeDropsOptedOut=function(){r.props.personalization&&ni.bh.updateSetting(!r.props.dropsOptedOut)};r.handleChangeDefaultMessageRequestRestricted=function(e){r.setState({defaultMessageRequestRestricted:!e},(function(){return r.showMessageRequestRestrictionModal(!e)}))};r.handleUsageStatisticsChange=function(){!r.props.usageStatistics?(0,TS.g)([B.pjP.USAGE_STATISTICS],[]).catch(HS):BS({header:x.Z.Messages.USAGE_STATISTICS_DISABLE_MODAL_TITLE,body:x.Z.Messages.USAGE_STATISTICS_DISABLE_MODAL_BODY,confirmText:x.Z.Messages.USAGE_STATISTICS_DISABLE_MODAL_CONFIRM,cancelText:x.Z.Messages.USAGE_STATISTICS_DISABLE_MODAL_CANCEL,onConfirm:function(){return(0,TS.g)([],[B.pjP.USAGE_STATISTICS]).catch(HS)}})};r.handlePersonalizationChange=function(){!r.props.personalization?(0,TS.g)([B.pjP.PERSONALIZATION],[]).catch(HS):BS({header:x.Z.Messages.PERSONALIZATION_DISABLE_MODAL_TITLE,confirmText:x.Z.Messages.PERSONALIZATION_DISABLE_MODAL_CONFIRM, cancelText:x.Z.Messages.PERSONALIZATION_DISABLE_MODAL_CANCEL,onConfirm:function(){(0,TS.g)([],[B.pjP.PERSONALIZATION]).catch(HS);ni.bh.updateSetting(!0)},body:x.Z.Messages.PERSONALIZATION_DISABLE_MODAL_BODY})};r.handleAccessibilityDetectionChange=function(){ni.dQ.updateSetting(!r.props.allowAccessibilityDetection)};r.handleDataDownloadRequest=function(){BS({header:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_MODAL_TITLE,body:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_MODAL_NOTE,confirmText:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_MODAL_CONFIRM,cancelText:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_MODAL_CANCEL,onConfirm:function(){r.setState({requestingHarvest:!0},(function(){(0,f.V3)().then((function(e){if(null!=e&&null!=e.body){r.setState({currentHarvestRequest:e.body});SS.Z.show({body:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_MODAL_SUCCESS})}else SS.Z.show({title:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_FAILURE_TITLE, body:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_FAILURE_BODY})}),(function(){return SS.Z.show({title:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_FAILURE_TITLE,body:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_FAILURE_BODY})})).finally((function(){return r.setState({requestingHarvest:!1})}))}))}})};var o=e.defaultGuildsRestricted,i=e.defaultMessageRequestRestricted;r.state={defaultGuildsRestricted:o,defaultMessageRequestRestricted:i,currentHarvestRequest:null,requestingHarvest:!0};return r}var i=n.prototype;i.componentDidMount=function(){var e=this;(0,TS.I)();(0,f.ol)().then((function(t){var n={requestingHarvest:!1,currentHarvestRequest:t.body};e.setState(n)}),(function(){e.setState({requestingHarvest:!1})}))};i.componentDidUpdate=function(e){e.defaultGuildsRestricted!==this.props.defaultGuildsRestricted&&this.setState({defaultGuildsRestricted:this.props.defaultGuildsRestricted})};i.showGuildRestrictionModal=function(e){var t=this;BS({ header:x.Z.Messages.USER_DM_SETTINGS_TITLE,body:x.Z.Messages.USER_DM_SETTINGS_DESCRIPTION,confirmText:x.Z.Messages.NO_TEXT,cancelText:x.Z.Messages.YES_TEXT,confirmButtonColor:c.zxk.Colors.BRAND,onConfirm:function(){ni.iG.updateSetting(e);t.trackDefaultDmsUpdated(e,!1)},onCancel:function(){ni.iG.updateSetting(e);ni.h2.updateSetting(e?Object.keys(an.Z.getGuilds()):[]);t.trackDefaultDmsUpdated(e,!0)}})};i.trackDefaultDmsUpdated=function(e,t){Dr.default.track(B.rMx.GUILD_DEFAULT_DMS_UPDATED,{default_guilds_restricted:e,applied_to_existing_guilds:t})};i.showMessageRequestRestrictionModal=function(e){var t=this;BS({header:x.Z.Messages.MESSAGE_REQUESTS_SETTING_GENERAL_MODAL_HEADER,body:x.Z.Messages.MESSAGE_REQUESTS_SETTING_GENERAL_MODAL_DESCRIPTION,confirmText:x.Z.Messages.NO_TEXT,cancelText:x.Z.Messages.YES_TEXT,confirmButtonColor:c.zxk.Colors.BRAND,onConfirm:function(){ni.mX.updateSetting(e);t.trackDefaultMessageRequestUpdated(e,!1)},onCancel:function(){ni.mX.updateSetting(e) ;ni.zA.updateSetting(e?Object.keys(an.Z.getGuilds()):[]);t.trackDefaultMessageRequestUpdated(e,!0)}})};i.trackDefaultMessageRequestUpdated=function(e,t){Dr.default.track(B.rMx.GUILD_DEFAULT_MESSAGE_REQUEST_UPDATED,{default_guilds_restricted:e,applied_to_existing_guilds:t})};i.renderDMSafety=function(){var e=this.props.isComsUpdateEnabled;return(0,r.jsx)(c.hjN,{className:fe().marginBottom40,children:(0,r.jsxs)(c.xJW,{tag:c.RB0.H5,className:fe().marginBottom4,title:x.Z.Messages.USER_EXPLICIT_CONTENT_FILTER,children:[(0,r.jsx)(c.R94,{type:c.geA.DESCRIPTION,className:fe().marginBottom8,children:this.props.isComsUpdateEnabled?x.Z.Messages.USER_EXPLICIT_CONTENT_FILTER_HELP_V2:x.Z.Messages.USER_EXPLICIT_CONTENT_FILTER_HELP}),(0,r.jsx)(c.Eep,{value:this.props.explicitContentFilter,options:(0,PS.w9)(e),onChange:function(e){var t=e.value;return ni.UP.updateSetting(t)}})]})})};i.renderServerPrivacy=function(){ var e=this.props,t=e.viewNsfwGuilds,n=e.currentUser,o=e.isStricterMessageRequests,i=e.viewNsfwCommands,a=this.state,s=a.defaultGuildsRestricted,l=a.defaultMessageRequestRestricted,u=!0===n.nsfwAllowed;return(0,r.jsxs)(c.hjN,{className:fe().marginBottom40,children:[(0,r.jsx)(c.vwX,{tag:c.RB0.H5,className:fe().marginBottom8,children:x.Z.Messages.USER_DM_SETTINGS}),(0,r.jsx)(c.j7V,{value:!s,note:x.Z.Messages.USER_DM_SETTINGS_HELP,onChange:this.handleChangeDefaultGuildsRestricted,children:x.Z.Messages.NEW_GUILDS_DM_ALLOWED}),(0,r.jsx)(c.j7V,{value:!!u&&t,note:x.Z.Messages.NSFW_GUILDS_TOGGLE_CAPTION,disabled:!u,onChange:ni.DC.updateSetting,children:x.Z.Messages.NSFW_GUILDS_TOGGLE_HEADER}),!o&&(0,r.jsx)(c.j7V,{value:!l,note:x.Z.Messages.MESSAGE_REQUESTS_SETTING_GENERAL_CAPTION.format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.MESSAGE_REQUESTS)}),disabled:s,onChange:this.handleChangeDefaultMessageRequestRestricted,children:x.Z.Messages.MESSAGE_REQUESTS_SETTING_GENERAL_HEADER}),(0, r.jsx)(c.j7V,{value:!!u&&i,note:x.Z.Messages.NSFW_DM_COMMANDS_CAPTION,disabled:!u,onChange:ni.xM.updateSetting,children:x.Z.Messages.NSFW_DM_COMMANDS_HEADER})]})};i.renderDataPrivacy=function(){var e=this.props,t=e.usageStatistics,n=e.personalization,o=e.allowAccessibilityDetection,i=e.dropsOptedOut;return(0,r.jsxs)(c.hjN,{className:fe().marginBottom40,children:[(0,r.jsx)(c.vwX,{tag:c.RB0.H5,className:fe().marginBottom8,children:x.Z.Messages.DATA_PRIVACY_CONTROLS}),(0,r.jsx)(c.j7V,{value:t,note:x.Z.Messages.DATA_PRIVACY_CONTROLS_USAGE_STATISTICS_NOTE.format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.DATA_PRIVACY_CONTROLS)}),onChange:this.handleUsageStatisticsChange,children:x.Z.Messages.DATA_PRIVACY_CONTROLS_USAGE_STATISTICS_TITLE}),(0,r.jsx)(c.j7V,{value:n,note:x.Z.Messages.DATA_PRIVACY_CONTROLS_PERSONALIZATION_NOTE_LEARN_MORE.format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.DATA_PRIVACY_CONTROLS)}),hideBorder:!0,onChange:this.handlePersonalizationChange, children:x.Z.Messages.DATA_PRIVACY_CONTROLS_PERSONALIZATION_TITLE}),(0,r.jsx)(c.j7V,{value:!i&&n,note:(0,r.jsxs)("div",{className:RS().dependentSetting,children:[x.Z.Messages.USER_DROPS_SETTINGS_DROPS_OPTED_OUT_NOTE,i?(0,r.jsx)("div",{className:v()(fe().marginTop8,RS().feedback),children:x.Z.Messages.DROPS_REQUEST_FEEDBACK_OPT_OUT.format({feedbackURL:"https://survey.alchemer.com/s3/7043738/Discord-Drops-Opt-Out-Survey?user_id=".concat(this.props.currentUser.id)})}):null]}),disabled:!n,onChange:this.handleChangeDropsOptedOut,children:(0,r.jsxs)("div",{className:v()(RS().betaTagContainer,RS().dependentSetting),children:[x.Z.Messages.USER_DROPS_SETTINGS_DROPS_OPTED_OUT,(0,r.jsx)(me.Z,{className:RS().betaTagIcon})]})}),(0,r.jsx)(c.j7V,{value:o,note:x.Z.Messages.DATA_PRIVACY_CONTROLS_ALLOW_ACCESSIBILITY_DETECTION_NOTE.format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.ACCESSIBILITY_TRACKING)}),onChange:this.handleAccessibilityDetectionChange, children:x.Z.Messages.DATA_PRIVACY_CONTROLS_ALLOW_ACCESSIBILITY_DETECTION_TITLE}),(0,r.jsx)(c.vwX,{tag:c.RB0.H3,className:v()(fe().marginTop20,fe().marginBottom8),children:x.Z.Messages.DATA_PRIVACY_CONTROLS_BASIC_SERVICE_TITLE}),(0,r.jsx)(c.R94,{type:c.geA.DESCRIPTION,className:fe().marginBottom20,children:x.Z.Messages.DATA_PRIVACY_CONTROLS_BASIC_SERVICE_NOTE.format({onClick:function(){d.Z.setSection(B.oAB.ACCOUNT)}})}),this.renderHarvestRequest()]})};i.renderHarvestRequest=function(){var e,t=this,n=this.props.currentUser,i=this.state,a=i.requestingHarvest,s=i.currentHarvestRequest,l=(0,Lm.$6)(s,n),u=(0,r.jsx)(c.ua7,{text:n.verified?null:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_TOOLTIP,children:function(e){var n=e.onMouseEnter,o=e.onMouseLeave;return(0,r.jsx)(c.zxk,{disabled:l,onClick:t.handleDataDownloadRequest,onMouseEnter:n,onMouseLeave:o,look:c.zxk.Looks.OUTLINED,color:c.zxk.Colors.BRAND,submitting:a,children:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_DOWNLOAD})}}) ;if(l&&null!=s){e=(0,r.jsx)(c.Zbd,{className:RS().card,children:(0,r.jsx)(c.xvT,{variant:"text-md/normal",children:x.Z.Messages.DATA_DOWNLOAD_REQUESTED_STATUS_NOTE.format({date:Ge()(s.created_at).add(B.eBq,"days").format("MMMM Do YYYY")})})});u=null}null!=u&&(u=(0,r.jsx)(ae.Z,{children:u}));return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(c.$i$,{className:fe().marginBottom20}),(0,r.jsx)(c.vwX,{tag:c.RB0.H3,children:x.Z.Messages.DATA_PRIVACY_CONTROLS_PERSONAL_DATA_TITLE}),(0,r.jsx)(c.R94,{type:c.geA.DESCRIPTION,className:fe().marginBottom20,children:x.Z.Messages.DATA_PRIVACY_CONTROLS_REQUEST_DATA_NOTE.format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.GDPR_REQUEST_DATA)})}),e,u]})};i.renderPrivacyAndTermsNote=function(){return(0,r.jsx)(c.hjN,{className:fe().marginBottom40,children:(0,r.jsx)(c.ToO,{type:c.ToO.Types.PRIMARY,body:x.Z.Messages.USER_SETTINGS_PRIVACY_TERMS.format({termsLink:B.EYA.TERMS,privacyLink:B.EYA.PRIVACY})})})};i.renderStaffOnlySettings=function(){ var e=this.props,t=e.currentUser,n=e.nonSpamRetrainingOptIn;return t.isStaff()?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.$i$,{className:fe().marginBottom20}),(0,r.jsxs)(c.hjN,{className:fe().marginBottom40,children:[(0,r.jsx)(c.vwX,{tag:c.RB0.H5,className:fe().marginBottom8,children:x.Z.Messages.PRIVACY_SETTINGS_STAFF_ONLY_HEADER}),(0,r.jsxs)(c.xJW,{tag:c.RB0.H5,className:fe().marginBottom4,children:[(0,r.jsx)(c.R94,{type:c.geA.DESCRIPTION,className:fe().marginBottom8,children:x.Z.Messages.PRIVACY_SETTINGS_STAFF_ONLY_DESC}),(0,r.jsx)(c.Eep,{options:(0,Lm.xH)(),value:null==n?Lm.g0.UNDECIDED:n?Lm.g0.OPTIN:Lm.g0.OPTOUT,onChange:function(e){var t=e.value;return ni.kJ.updateSetting(Lm.ac[t])}})]})]})]}):null};i.render=function(){var e=this.props.fetchedConsents;return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.PRIVACY_AND_SAFETY,children:[this.renderDMSafety(),this.renderServerPrivacy(),e?this.renderDataPrivacy():null,this.renderPrivacyAndTermsNote(),this.renderStaffOnlySettings()] })};return n}(o.PureComponent);function FS(){var e=(0,NS.n)(),t=(0,y.e7)([Lr.default],(function(){var e=Lr.default.getCurrentUser();L()(null!=e,"ConnectedUserSettingsPrivacySafety: currentUser cannot be undefined");return e})),n=(0,y.cj)([CS.Z],(function(){return{fetchedConsents:CS.Z.fetchedConsents,usageStatistics:CS.Z.hasConsented(B.pjP.USAGE_STATISTICS),personalization:CS.Z.hasConsented(B.pjP.PERSONALIZATION)}}));return(0,r.jsx)(VS,wS({currentUser:t,defaultGuildsRestricted:ni.iG.useSetting(),defaultMessageRequestRestricted:ni.mX.useSetting(),nonSpamRetrainingOptIn:ni.kJ.useSetting(),isStricterMessageRequests:(0,AS.Z)(),isComsUpdateEnabled:e,viewNsfwGuilds:ni.DC.useSetting(),viewNsfwCommands:ni.xM.useSetting(),allowAccessibilityDetection:ni.dQ.useSetting(),explicitContentFilter:ni.UP.useSetting(),showCurrentGame:ni.G6.useSetting(),dropsOptedOut:ni.bh.useSetting()},n))}var YS=n(196810);function zS(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return} s.done?t(c):Promise.resolve(c).then(r,o)}function WS(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){zS(i,r,o,a,s,"next",e)}function s(e){zS(i,r,o,a,s,"throw",e)}a(void 0)}))}}function KS(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function qS(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function XS(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o }(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}var QS=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0){n.splice(t,1);r=!0}},l=t[Symbol.iterator]();!(o=(s=l.next()).done);o=!0)c()}catch(e){i=!0;a=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw a}}if(!r)return!1;yT=n}});function OT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0&&(n=t.splice(o,1)[0])}t.sort((function(e,t){return t.approx_last_used_time.valueOf()-e.approx_last_used_time.valueOf()}));return{currentSession:n, otherSessions:t}}),[e])),n=t.currentSession,i=t.otherSessions,s=(0,y.e7)([Rr.Z],(function(){return Rr.Z.hidePersonalInformation})),u=(0,y.e7)([Lr.default],(function(){return Lr.default.getCurrentUser()})),f=AT(o.useState(!1),2),d=f[0],p=f[1];o.useEffect((function(){(0,Hs.EW)(a.z$.AUTH_SESSIONS_NEW,{dismissAction:jc.L.AUTO});!function(){nT.apply(this,arguments)}();var e=setTimeout((function(){return p(!0)}),500);return function(){clearTimeout(e);l.Z.dispatch({type:"FETCH_AUTH_SESSIONS_SUCCESS",sessions:[]})}}),[]);var h,E=function(){Hu.Z.post({url:B.ANM.AUTH_SESSION_NOTIFICATIONS_DEBUG})};if(s)return(0,r.jsx)(Pt.Z,{});h=null==n&&0===i.length?d?(0,r.jsx)("div",{className:TT().loading,children:(0,r.jsx)(c.$jN,{})}):null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:TT().sessions,children:[(0,r.jsx)(c.hjN,{tag:c.RB0.H5,title:x.Z.Messages.AUTH_SESSIONS_CURRENT,titleClassName:TT().groupTitle,children:null!=n?(0,r.jsx)(PT,{session:n,current:!0}):null }),i.length>0||!(null==u?void 0:u.mfaEnabled)?(0,r.jsxs)(c.hjN,{tag:c.RB0.H5,title:x.Z.Messages.AUTH_SESSIONS_OTHERS,titleClassName:TT().groupTitle,className:TT().otherSessions,children:[i.map((function(e){return(0,r.jsx)(PT,{session:e},e.id_hash)})),(null==u?void 0:u.mfaEnabled)?null:(0,r.jsx)(jT,{})]}):null]}),i.length>0?(0,r.jsxs)(c.hjN,{tag:c.RB0.H5,title:x.Z.Messages.AUTH_SESSIONS_OTHERS_LOG_OUT_TITLE,children:[(0,r.jsx)(c.R94,{type:c.geA.DESCRIPTION,children:x.Z.Messages.AUTH_SESSIONS_OTHERS_LOG_OUT_DESCRIPTION}),(0,r.jsx)(c.zxk,{look:c.zxk.Looks.OUTLINED,color:c.zxk.Colors.RED,size:c.zxk.Sizes.SMALL,className:TT().logOutAllButton,onClick:function(){return rT(i.map((function(e){return e.id_hash})))},children:x.Z.Messages.AUTH_SESSIONS_OTHERS_LOG_OUT_ACTION})]}):null]});return(0,r.jsxs)(c.hjN,{tag:c.RB0.H1,title:x.Z.Messages.AUTH_SESSIONS,children:[(0,r.jsx)(c.R94,{type:c.geA.DESCRIPTION,className:TT().description,children:x.Z.Messages.AUTH_SESSIONS_DESCRIPTION }),(null==u?void 0:u.isStaff())?(0,r.jsxs)("div",{className:TT().tools,children:[(0,r.jsx)(c.xvT,{className:TT().toolsTitle,variant:"text-md/bold",children:"DEV TOOLS"}),(0,r.jsx)(c.xvT,{className:TT().toolsTitle,variant:"text-sm/normal",color:"text-danger",children:"These tools are only shown to staff users."}),(0,r.jsx)(c.ua7,{text:"Triggers mobile and email suspicious session notifications for the current user",children:function(e){var t=e.onMouseEnter,n=e.onMouseLeave;return(0,r.jsx)(c.zxk,{size:c.zxk.Sizes.SMALL,color:c.zxk.Colors.PRIMARY,onClick:E,onMouseEnter:t,onMouseLeave:n,children:"Trigger Suspicious Sessions Notification"})}})]}):null,h]})}function PT(e){var t,n,o,i,a,s,l=e.session,u=e.current,f=null!==(a=null===(t=l.client_info)||void 0===t?void 0:t.location)&&void 0!==a?a:null===(n=l.client_info)||void 0===n?void 0:n.ip,d=null===(o=l.client_info)||void 0===o?void 0:o.platform,p=function(e){switch(null==e?void 0:e.toLowerCase().trim()){case null:case void 0:case"":return{ text:x.Z.Messages.AUTH_SESSIONS_OS_UNKNOWN,icon:Vm.Z};case"ios":case"android":return{text:e,icon:IT.Z};default:return{text:e,icon:Vm.Z}}}(null===(i=l.client_info)||void 0===i?void 0:i.os),h=p.text,E=p.icon,y=u?null:(s=l.approx_last_used_time,(Date.now()-s.valueOf())/1e3/60/60<1?x.Z.Messages.AUTH_SESSIONS_ACTIVE_RECENTLY:Ge()(s).fromNow()),m=[h,d].filter(Le.lm),b=[f,y].filter(Le.lm);return(0,r.jsxs)("div",{className:v()(TT().session,u?TT().currentSession:null),children:[(0,r.jsx)("div",{className:TT().sessionIcon,children:(0,r.jsx)(E,{width:"32",height:"32"})}),(0,r.jsxs)("div",{className:TT().sessionInfo,children:[(0,r.jsxs)(c.xvT,{variant:"eyebrow",className:TT().sessionInfoRow,children:[(0,r.jsx)("span",{children:m[0]}),m.length>1&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:"·"}),(0,r.jsx)("span",{children:m[1]})]})]}),(0,r.jsxs)(c.xvT,{variant:"text-sm/medium",className:TT().sessionInfoRow,children:[(0,r.jsx)("span",{children:b[0]}),b.length>1&&(0, r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:"·"}),(0,r.jsx)("span",{children:b[1]})]})]})]}),u?null:(0,r.jsx)(c.P3F,{className:TT().sessionMoreButton,onClick:function(){return rT(l.id_hash)},"aria-label":x.Z.Messages.AUTH_SESSIONS_SESSION_LOG_OUT,children:(0,r.jsx)(el.Z,{})})]},l.id_hash)}function jT(){return(0,r.jsxs)("div",{className:v()(TT().session,TT().legacySession),children:[(0,r.jsx)("div",{className:TT().sessionIcon,children:(0,r.jsx)(_T.Z,{width:"32",height:"32"})}),(0,r.jsxs)("div",{className:TT().sessionInfo,children:[(0,r.jsx)(c.xvT,{variant:"eyebrow",className:TT().sessionInfoRow,color:"text-muted",children:(0,r.jsx)("span",{children:x.Z.Messages.AUTH_SESSIONS_UNKNOWN_LEGACY})}),(0,r.jsx)(c.xvT,{variant:"text-sm/medium",className:TT().sessionInfoRow,color:"text-muted",children:(0,r.jsx)("span",{children:x.Z.Messages.AUTH_SESSIONS_UNKNOWN_LEGACY_LOG_OUT.format({onClick:function(){return d.Z.setSection(B.oAB.ACCOUNT)}})})})]})]})} var RT=n(929370),xT=n(563145),MT=n.n(xT);function wT(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function DT(){var e=(0,y.cj)([Rr.Z],(function(){return function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?s.map((function(t){return(0,r.jsx)(yN,{experiment:t.experiment,experimentId:t.id,descriptor:e[t.id]},t.id)})):(0,r.jsx)("div",{className:pN().emptyState,children:(0,r.jsx)(c.X6q,{variant:"heading-md/semibold",children:"No Experiments Found"})})]})}var bN=n(656645),gN=n(36256),ON=n(396448),vN=n(680664);function _N(){var e=(0,y.cj)([Bc.Z],(function(){return{experimentalEncoders:Bc.Z.getExperimentalEncoders()}})).experimentalEncoders;return"stable"!==qf.default.releaseChannel&&Bc.Z.isExperimentalEncodersSupported()?(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:e,onChange:function(e){return bN.Z.setExperimentalEncoders(e)},disabled:!1,children:x.Z.Messages.EXPERIMENTAL_ENCODERS}):null}function IN(){var e=(0,y.e7)([xu.Z],(function(){return xu.Z.theme})),t=(0,y.cj)([Bc.Z],(function(){return{openH264:Bc.Z.getOpenH264(),hardwareH264:Bc.Z.getHardwareH264(),supportsOpenH264:Bc.Z.supports(gN.AN.OPEN_H264),av1Enabled:Bc.Z.getAv1Enabled()} })),n=t.openH264,o=t.hardwareH264,i=t.supportsOpenH264,a=t.av1Enabled;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.hjN,{className:fe().marginBottom20,title:x.Z.Messages.USER_SETTINGS_VOICE_CODEC_TITLE,children:(0,r.jsx)(c.ToO,{className:fe().marginBottom20,type:c.Dd5.PRIMARY,imageData:{src:e===B.BRd.LIGHT?ON:vN,width:70,height:40},align:ae.Z.Align.CENTER,body:x.Z.Messages.USER_SETTINGS_VOICE_CODEC_DESCRIPTION})}),i&&(0,r.jsxs)(c.hjN,{className:fe().marginBottom20,title:x.Z.Messages.USER_SETTINGS_VOICE_VIDEO_CODEC_TITLE,children:[(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:n,onChange:function(e){bN.Z.setOpenH264(e);bN.Z.setHardwareH264(e)},disabled:!1,note:x.Z.Messages.FORM_HELP_OPEN_H264,children:x.Z.Messages.USER_SETTINGS_VOICE_OPEN_H264}),(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:o,onChange:function(e){bN.Z.setHardwareH264(e);bN.Z.setAV1Enabled(e&&a)},disabled:!n,note:x.Z.Messages.FORM_HELP_HARDWARE_H264, children:x.Z.Messages.USER_SETTINGS_VOICE_HARDWARE_H264}),(0,r.jsx)(c.j7V,{className:v()(fe().marginTop8,fe().marginBottom20),value:a&&o,onChange:function(e){return function(e){bN.Z.setAV1Enabled(e);Dr.default.track(B.rMx.VOICE_SETTINGS_CHANGED,{av1_disabled:!e,av1_enabled:e})}(e&&o)},note:x.Z.Messages.FORM_HELP_HARDWARE_AV1,disabled:!o,children:x.Z.Messages.USER_SETTINGS_VOICE_AV1}),(0,r.jsx)(_N,{})]})]})}var SN=n(797364),TN=n(816251),NN=n(727785),AN=n(247162);function CN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=1e3?"".concat((e/=1e3).toFixed(2),"s"):"".concat(e.toFixed(0)," ms")}function aA(e){var t,n=e.inputMode,o=(0,y.cj)([Bc.Z],(function(){return Bc.Z.getModeOptions()})),i=o.shortcut,a=o.delay;t=Yc.FB||n!==B.pM4.PUSH_TO_TALK?(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:v()(QN().pttToolsMessage,fe().marginBottom8),children:x.Z.Messages.USER_SETTINGS_VOICE_ADD_MULTIPLE.format({onClick:function(){return d.Z.setSection(B.oAB.KEYBINDS)}})}):(0,r.jsx)(c.R94,{type:c.R94.Types.DESCRIPTION,className:v()(QN().pttToolsMessage,QN().pttToolsWarning,fe().marginBottom8),children:x.Z.Messages.PTT_LIMITED_WARNING.format({onDownloadClick:function(){return zN("Help Text PTT")}})});return(0,r.jsxs)("div",{className:QN().pttTools,children:[(0,r.jsxs)(ae.Z,{children:[(0,r.jsx)(ae.Z.Child,{basis:"50%",children:(0,r.jsx)(c.xJW,{title:x.Z.Messages.FORM_LABEL_SHORTCUT,children:(0,r.jsx)(k.Z,{defaultValue:i,onChange:function(e){return bN.Z.setMode(n,{shortcut:e})} })})}),(0,r.jsx)(ae.Z.Child,{basis:"50%",children:(0,r.jsxs)(c.xJW,{children:[(0,r.jsx)(c.vwX,{id:rA,tag:c.RB0.H5,className:fe().marginBottom8,children:x.Z.Messages.INPUT_MODE_PTT_RELEASE_DELAY}),(0,r.jsx)(c.iRW,{initialValue:a,onValueChange:function(e){return bN.Z.setMode(n,{delay:e})},onValueRender:iA,maxValue:B.qhL,"aria-labelledby":rA})]})})]}),t]})}function sA(){var e=(0,y.e7)([Bc.Z],(function(){return Bc.Z.getMode()})),t=[{value:B.pM4.VOICE_ACTIVITY,name:x.Z.Messages.INPUT_MODE_VAD},{value:B.pM4.PUSH_TO_TALK,name:nA?x.Z.Messages.INPUT_MODE_PTT_LIMITED:x.Z.Messages.INPUT_MODE_PTT}];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xJW,{title:x.Z.Messages.FORM_LABEL_INPUT_MODE,className:fe().marginBottom20,children:(0,r.jsx)(c.Eep,{onChange:oA,options:t,value:e})}),e===B.pM4.PUSH_TO_TALK&&(0,r.jsx)(aA,{inputMode:e})]})}var cA=n(318715),lA=n(946767),uA=n(959132),fA=n.n(uA);function dA(){return(0,cA.ZP)([Bc.Z],(function(){return Bc.Z.supports(gN.AN.LOOPBACK)}))?(0,r.jsx)("div",{ className:fA().micTest,children:(0,r.jsx)(lA.Z,{title:x.Z.Messages.USER_SETTINGS_VOICE_MIC_TEST_TITLE,description:x.Z.Messages.USER_SETTINGS_VOICE_MIC_TEST_DESCRIPTION,notchBackground:lA._.GRAY,captionVoice:x.Z.Messages.USER_SETTINGS_VOICE_MIC_TEST_VOICE_CAPTION,captionNoVoice:(0,r.jsxs)(r.Fragment,{children:[x.Z.Messages.USER_SETTINGS_VOICE_MIC_TEST_VOICE_NO_INPUT_NOTICE,(0,r.jsx)(c.eee,{className:fA().micTestHelpLink,href:ta.Z.getArticleURL(B.BhN.NO_INPUT_DETECTED),children:x.Z.Messages.NOTICE_NO_INPUT_DETECTED_HELP_LINK_TEXT})]}),buttonTest:x.Z.Messages.USER_SETTINGS_VOICE_MIC_TEST_BUTTON_INACTIVE,buttonStop:x.Z.Messages.USER_SETTINGS_VOICE_MIC_TEST_BUTTON_ACTIVE,buttonClassName:fA().micTestButton,buttonColor:c.zxk.Colors.BRAND,location:{page:B.ZY5.USER_SETTINGS,section:B.jXE.SETTINGS_VOICE_AND_VIDEO}})}):null}function pA(e){switch(e){case B.rtk.ENABLING:return x.Z.Messages.USER_SETTINGS_VOICE_SOUNDSHARE_ENABLING_LABEL;case B.rtk.ENABLED: return x.Z.Messages.USER_SETTINGS_VOICE_SOUNDSHARE_ENABLED_LABEL;case B.rtk.FAILED_TO_ENABLE:return x.Z.Messages.USER_SETTINGS_VOICE_SOUNDSHARE_FAILED_TO_ENABLE_LABEL}return x.Z.Messages.USER_SETTINGS_VOICE_SOUNDSHARE_NOT_ENABLED_LABEL}function hA(){var e=(0,y.cj)([Bc.Z],(function(){return{videoHook:Bc.Z.getVideoHook(),experimentalSoundshare:Bc.Z.getExperimentalSoundshare(),soundshareEnabled:Bc.Z.getSoundshareEnabled(),supportsVideoHook:Bc.Z.supports(gN.AN.VIDEO_HOOK),supportsExperimentalSoundshare:Bc.Z.supportsExperimentalSoundshare(),supportsEnableSoundshare:Bc.Z.supportsEnableSoundshare()}})),t=e.videoHook,n=e.experimentalSoundshare,o=e.soundshareEnabled,i=e.supportsVideoHook,a=e.supportsExperimentalSoundshare,s=e.supportsEnableSoundshare;return i||a||s?(0,r.jsxs)(c.hjN,{className:fe().marginBottom20,title:x.Z.Messages.FORM_LABEL_SCREENSHARE,children:[i&&(0,r.jsx)(c.j7V,{value:t,onChange:function(e){return bN.Z.setVideoHook(e)},note:x.Z.Messages.FORM_HELP_VIDEO_HOOK, children:x.Z.Messages.USER_SETTINGS_VOICE_VIDEO_HOOK_LABEL}),a&&(0,r.jsx)(c.j7V,{value:n,onChange:function(e){return bN.Z.setExperimentalSoundshare(e)},children:x.Z.Messages.USER_SETTINGS_VOICE_EXPERIMENTAL_SOUNDSHARE_LABEL}),s&&(0,r.jsxs)(c.xJW,{children:[(0,r.jsx)(c.R94,{className:fe().marginBottom20,children:pA(o).format({helpdeskArticle:ta.Z.getArticleURL(B.BhN.OSX_SOUNDSHARE)})}),(0,r.jsx)(ae.Z,{children:(0,r.jsx)(ae.Z.Child,{grow:0,shrink:0,children:(0,r.jsx)(c.zxk,{className:fe().marginBottom20,size:c.zxk.Sizes.SMALL,onClick:function(){return bN.Z.enableSoundshare()},disabled:o!==B.rtk.NOT_ENABLED,children:x.Z.Messages.USER_SETTINGS_VOICE_INSTALL_LABEL})})}),(0,r.jsx)(c.$i$,{className:fe().marginBottom20})]})]}):null}var EA=n(336177),yA=n(815378),mA=n(615457),bA=n(196028),gA=n.n(bA),OA=(0,Jt.hQ)();function vA(){var e=(0,yA.pI)();return(0,r.jsxs)("div",{className:v()(gA().soundboardRow),children:[(0,r.jsxs)("div",{className:v()(gA().soundboardColumn,gA().leftColumn),children:[(0, r.jsx)(c.vwX,{tag:c.RB0.H5,className:gA().soundboardTitle,children:x.Z.Messages.USER_SETTINGS_SOUNDBOARD}),(0,r.jsx)(c.xvT,{color:"header-secondary",variant:"text-sm/normal",children:x.Z.Messages.USER_SETTINGS_SOUNDBOARD_VOLUME_DESCRIPTION_WITH_LINK.format({helpCenterArticle:ta.Z.getArticleURL(B.BhN.SOUNDBOARD)})})]}),(0,r.jsxs)("div",{className:v()(gA().soundboardColumn,gA().rightColumn),children:[(0,r.jsx)(c.vwX,{id:OA,tag:c.RB0.H5,className:gA().soundboardSubtitle,children:x.Z.Messages.USER_SETTINGS_SOUNDBOARD_VOLUME}),(0,r.jsx)(c.iRW,{initialValue:(0,mA.P)(e),maxValue:100,onValueRender:function(e){return"".concat(e.toFixed(0),"%")},asValueChanges:function(t){e=(0,mA.A)(t);(0,EA.xz)(e)},"aria-labelledby":OA})]})]})}var _A=n(579581),IA=n(535312),SA=n(597246),TA=n(359721),NA=n(761012),AA=n(785289),CA=n.n(AA);function PA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}));o.useEffect((function(){return function(){f.current&&l.Z.wait((function(){return(0,SA.Up)(d.current)}))}}),[]);return(0,r.jsx)(NA.Z,{selectedBackgroundOption:s,onSelectBackgroundOption:function(e){f.current=!0;d.current=e;u(e);(0,TA.wG)(e,{location:p.location}).catch(B.dG4)}, renderCamera:function(e){return t?(0,r.jsx)("div",{className:CA().cameraWrapper,children:(0,r.jsxs)("div",{className:CA().camera,children:[(0,r.jsx)(i,{deviceId:e,width:MA,height:wA,disabled:!t}),(0,r.jsx)(NA.S,{})]})}):(0,r.jsxs)("div",{className:CA().cameraWrapper,children:[(0,r.jsx)("div",{className:CA().previewImage}),(0,r.jsx)(c.ua7,{text:h?null:x.Z.Messages.CAMERA_UNAVAILABLE,children:function(e){return(0,r.jsx)(c.zxk,RA(function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n{"use strict";n.d(t,{P:()=>i});var r=n(707961),o=n(473708);function i(){(0,r.CFj)((0,r.Yz2)(o.Z.Messages.USER_SETTINGS_UPDATE_FAILURE,r.pCN.FAILURE))}},8489:(e,t,n)=>{"use strict";n.d(t,{q:()=>oe});var r=n(496486),o=n.n(r),i=n(17916),a=(n(887235),n(940060)),s=n(202351),c=n(630631),l=n(744564),u=n(296602),f=n(717225);function d(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,o)}var p=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){ return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;(r=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]ce){re.log("Writing cache from window unfocus");he()}else re.log("Not writing cache from window unfocus");return!1}}:{})},425187:(e,t,n)=>{"use strict";n.d(t,{Z:()=>k});var r=n(496486),o=n.n(r),i=n(202351),a=n(744564),s=n(823530),c=n(367891),l=n(567403),u=n(682776),f=n(170585),d=n(2590);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;i--)t(i);var a=!0,s=!1,c=void 0;try{for(var l,u=function(){var e=l.value,t=A.find((function(t){if(t.id===e.id)return!0}));null==t&&A.push(e)},f=o[Symbol.iterator]();!(a=(l=f.next()).done);a=!0)u()}catch(e){s=!0;c=e}finally{try{a||null==f.return||f.return()}finally{if(s)throw c}}A=v(A);D()},INTEGRATION_SETTINGS_SUBMITTING:function(){j=d.QZA.SUBMITTING;R={}},INTEGRATION_SETTINGS_SAVE_FAILURE:function(e){if(j!==d.QZA.SUBMITTING)return!1;j=d.QZA.OPEN;var t;R=null!==(t=e.errors)&&void 0!==t?t:{}}});const k=U},502569:(e,t,n)=>{"use strict";n.d(t,{Z:()=>k});var r=n(496486),o=n.n(r),i=n(202351),a=n(630631),s=n(744564),c=n(563135),l=n(367891),u=n(61209),f=n(2590),d=n(449518);function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n{"use strict";n.d(t,{Z:()=>z});var r=n(496486),o=n.n(r),i=n(730381),a=n.n(i),s=n(202351),c=n(281110),l=n(744564),u=n(382060),f=n(848285),d=n(424158),p=n(722406),h=n(61209),E=n(2590);function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function b(e){b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)} ;return b(e)}function g(e){for(var t=1;t{"use strict";n.d(t,{Z:()=>E});var r=n(202351),o=n(744564),i=n(473903),a=n(2590);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e){c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return c(e)}function l(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e,t){u=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return u(e,t)}var f=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function d(e){var t=function(){ if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var o=c(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}var p=null;var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&u(e,t)}(n,e);var t=d(n);function n(){s(this,n);return t.apply(this,arguments)}var r=n.prototype;r.getHouseMembership=function(){return p};r.__getLocalVars=function(){return{houseID:p}};return n}(r.ZP.Store);h.displayName="HypeSquadStore";const E=new h(o.Z,{CONNECTION_OPEN:function(){var e=i.default.getCurrentUser() ;null!=e&&(e.hasFlag(a.xW$.HYPESQUAD_ONLINE_HOUSE_1)?p=a.gkr.HOUSE_1:e.hasFlag(a.xW$.HYPESQUAD_ONLINE_HOUSE_2)?p=a.gkr.HOUSE_2:e.hasFlag(a.xW$.HYPESQUAD_ONLINE_HOUSE_3)&&(p=a.gkr.HOUSE_3))},HYPESQUAD_ONLINE_MEMBERSHIP_LEAVE_SUCCESS:function(){p=null},HYPESQUAD_ONLINE_MEMBERSHIP_JOIN_SUCCESS:function(e){p=e.houseID}})},517205:(e,t,n)=>{"use strict";n.d(t,{Z:()=>C});var r=n(496486),o=n.n(r),i=n(202351),a=n(744564),s=n(574169),c=n(736818),l=n(870614),u=n(736097),f=n(2590);function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function h(e){h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return h(e)}function E(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function y(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function m(e,t){m=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return m(e,t)}var b,g=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){ var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var v={};function _(e,t){if(null==b)throw new Error("Creating RTCConnection without session.");var n=l.Z.getLobby(e);if(null==n)throw new Error("Creating RTCConnection without lobby.");var r=n.application_id,o=new s.Z({userId:c.default.getId(),sessionId:b,guildId:e,channelId:t,context:r});o.on("state",(function(t,n,r){a.Z.dispatch(E(function(e){for(var t=1;t{"use strict";n.d(t,{Z:()=>O});var r=n(496486),o=n.n(r),i=n(541554),a=n(202351),s=n(744564);function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n{"use strict";n.d(t,{Z:()=>g});var r=n(785893),o=n(667294),i=n(294184),a=n.n(i),s=n(693959),c=n.n(s);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function d(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})) ;return e}function p(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function h(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function E(e,t){E=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return E(e,t)}var y=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{ Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h(this,n)}}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});t&&E(e,t)}(n,e);var t=m(n);function n(){l(this,n);return t.apply(this,arguments)}n.prototype.render=function(){var e,t=this.props,n=t.tag,o=t.children,i=t.hoverText,s=t.className,l=t.forceHover,f=p(t,["tag","children","hoverText","className","forceHover"]);return(0,r.jsxs)("div",d(function(e){for(var t=1;t{"use strict";n.d(t,{Z:()=>p});var r=n(785893),o=(n(667294),n(294184)),i=n.n(o),a=n(707961),s=n(794921),c=n.n(s);function l(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function u(e){for(var t=1;t=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function p(e){ var t,n=e.padded,o=void 0===n||n,s=e.inset,p=void 0!==s&&s,h=e.active,E=void 0!==h&&h,y=e.className,m=e.children,b=e.onClick,g=d(e,["padded","inset","active","className","children","onClick"]);if(null!=b){var O;return(0,r.jsx)(a.P3F,f(u({onClick:b,tabIndex:null!=b?0:-1,className:i()(y,(O={},l(O,c().outer,!p),l(O,c().inset,p),l(O,c().padded,o),l(O,c().active,E),l(O,c().interactive,null!=b),O))},g),{children:m}))}return(0,r.jsx)("div",f(u({className:i()(y,(t={},l(t,c().outer,!p),l(t,c().inset,p),l(t,c().padded,o),l(t,c().active,E),t))},g),{children:m}))}},912250:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(785893),o=(n(667294),n(633878));function i(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function a(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function c(e){var t=e.color,n=void 0===t?"currentColor":t,c=e.height,l=void 0===c?24:c,u=e.width,f=void 0===u?24:u,d=s(e,["color","height","width"]);return(0,r.jsx)("svg",a(function(e){for(var t=1;t{"use strict";n.d(t,{Z:()=>c});var r=n(785893),o=(n(667294),n(633878));function i(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function a(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function c(e){var t=e.width,n=void 0===t?16:t,c=e.height,l=void 0===c?16:c,u=e.color,f=void 0===u?"currentColor":u,d=e.className,p=e.foreground,h=s(e,["width","height","color","className","foreground"]);return(0,r.jsx)("svg",a(function(e){for(var t=1;t{"use strict";n.d(t,{Z:()=>c});var r=n(785893),o=(n(667294),n(633878));function i(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function a(e,t){ t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function c(e){ var t=e.width,n=void 0===t?16:t,c=e.height,l=void 0===c?16:c,u=e.color,f=void 0===u?"currentColor":u,d=e.className,p=e.foreground,h=s(e,["width","height","color","className","foreground"]);return(0,r.jsx)("svg",a(function(e){for(var t=1;t{"use strict";n.d(t,{Z:()=>c});var r=n(785893),o=(n(667294),n(633878));function i(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function a(e,t){t=null!=t?t:{} ;Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function c(e){var t=e.width,n=void 0===t?24:t,c=e.height,l=void 0===c?24:c,u=e.color,f=void 0===u?"currentColor":u,d=e.foreground,p=s(e,["width","height","color","foreground"]);return(0, r.jsx)("svg",a(function(e){for(var t=1;t{"use strict";n.d(t,{Z:()=>c});var r=n(785893),o=(n(667294),n(633878));function i(e,t,n){ t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function a(e,t){t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function c(e){ var t=e.width,n=void 0===t?24:t,c=e.height,l=void 0===c?24:c,u=e.color,f=void 0===u?"currentColor":u,d=e.className,p=e.foreground,h=s(e,["width","height","color","className","foreground"]);return(0,r.jsx)("svg",a(function(e){for(var t=1;t{"use strict";n.d(t,{Z:()=>c});var r=n(785893),o=(n(667294),n(633878));function i(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function a(e,t){ t=null!=t?t:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(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}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n])}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function c(e){ var t=e.width,n=void 0===t?20:t,c=e.height,l=void 0===c?16:c,u=e.color,f=void 0===u?"currentColor":u,d=e.className,p=e.foreground,h=s(e,["width","height","color","className","foreground"]);return(0,r.jsx)("svg",a(function(e){for(var t=1;t{"use strict";n.d(t,{Z:()=>f});var r=n(496486),o=n.n(r),i=n(113609),a=n(821229),s=n(749106);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{"use strict";n.d(t,{uj:()=>c,tI:()=>l,X8:()=>u});var r=n(441143),o=n.n(r),i=n(2590),a=n(473708);function s(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var c=function(){var e=Object.keys(i.gkr);return e[Math.floor(Math.random()*e.length)]},l=function(){ var e=[i.gkr.HOUSE_1,i.gkr.HOUSE_2,i.gkr.HOUSE_3,i.jsM],t=[a.Z.Messages.HYPESQUAD_QUESTION_0_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_1_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_2_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_3_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_4_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_5_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_6_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_7_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_8_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_9_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_10_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_11_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_12_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_13_PROMPT,a.Z.Messages.HYPESQUAD_QUESTION_14_PROMPT],n=[[a.Z.Messages.HYPESQUAD_QUESTION_0_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_0_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_0_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_0_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_1_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_1_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_1_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_1_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_2_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_2_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_2_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_2_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_3_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_3_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_3_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_3_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_4_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_4_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_4_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_4_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_5_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_5_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_5_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_5_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_6_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_6_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_6_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_6_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_7_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_7_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_7_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_7_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_8_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_8_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_8_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_8_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_9_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_9_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_9_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_9_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_10_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_10_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_10_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_10_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_11_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_11_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_11_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_11_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_12_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_12_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_12_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_12_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_13_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_13_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_13_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_13_RESPONSE_D],[a.Z.Messages.HYPESQUAD_QUESTION_14_RESPONSE_A,a.Z.Messages.HYPESQUAD_QUESTION_14_RESPONSE_B,a.Z.Messages.HYPESQUAD_QUESTION_14_RESPONSE_C,a.Z.Messages.HYPESQUAD_QUESTION_14_RESPONSE_D]] ;return function(){for(var e=[];e.length<5;){var t=Math.floor(15*Math.random());e.includes(t)||e.push(t)}return e}().map((function(r){var i=t[r],a=n[r];o()(null!=i&&null!=a,"Invalid HypeSquad quiz question index");return{prompt:i,options:a.map((function(t,n){var r=e[n];o()(null!==r,"Invalid HypeSquad quiz question option index");return{copy:t,house:r}}))}}))},u=function(e){var t;return(s(t={},i.gkr.HOUSE_1,a.Z.Messages.HYPESQUAD_HOUSE_1),s(t,i.gkr.HOUSE_2,a.Z.Messages.HYPESQUAD_HOUSE_2),s(t,i.gkr.HOUSE_3,a.Z.Messages.HYPESQUAD_HOUSE_3),t)[e]}},786502:(e,t,n)=>{"use strict";n.d(t,{bm:()=>O,an:()=>_,rh:()=>I,Sz:()=>S,Vg:()=>R,ZP:()=>x});var r,o=n(213192),i=n.n(o),a=n(258104),s=n(61209),c=n(21372),l=n(717091),u=n(840922),f=n(473903),d=n(796909),p=n(504275),h=n(2590),E=n(718634),y=n(473708);function m(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}function b(e){for(var t=1;t0&&a.length>=r)break;if(!t.has(h)){var E=f.default.getUser(h);if(null!=E&&!v(o,E.id)){i.add(E.id);a.push({type:O.FRIEND,item:E,isSuggested:!0});s.numFriends++}}}}catch(e){l=!0;u=e}finally{try{c||null==p.return||p.return()}finally{if(l)throw u}}}}(g(b({},E),{suggestedUserIds:n}));!function(e){var t=e.omitUserIds,n=e.maxRowsWithoutQuery,r=e.guildId,o=e.shownUserIds,i=e.rows,a=e.counts,c=e.includeGroupDms,u=!0,p=!1,E=void 0;try{for(var y,m=d.Z.getPrivateChannelIds()[Symbol.iterator]();!(u=(y=m.next()).done);u=!0){var b=y.value;if(null!=n&&n>0&&i.length>=n)break;var g=s.Z.getChannel(b);if(null!=g&&g.isPrivate())if(c&&g.type===h.d4z.GROUP_DM){i.push({type:O.GROUP_DM,item:g,isSuggested:!1}) ;a.numGroupDms++}else if(null!=l.ZP.lastMessageId(g.id)){var _=g.getRecipientId();if(null!=_&&!t.has(_)&&!o.has(_)){var I=f.default.getUser(_);if(null==I||I.bot||v(r,I.id))continue;o.add(I.id);i.push({type:O.DM,item:I,isSuggested:!1});a.numDms++}}}}catch(e){p=!0;E=e}finally{try{u||null==m.return||m.return()}finally{if(p)throw E}}}(g(b({},E),{includeGroupDms:!0}));!function(e){var t=e.omitUserIds,n=e.maxRowsWithoutQuery,r=e.guildId,o=e.shownUserIds,i=e.rows,a=e.counts,s=!0,c=!1,l=void 0;try{for(var d,p=u.Z.getFriendIDs()[Symbol.iterator]();!(s=(d=p.next()).done);s=!0){var h=d.value;if(null!=n&&n>0&&i.length>=n)break;if(!t.has(h)&&!o.has(h)){var E=f.default.getUser(h);if(null!=E&&!v(r,E.id)){i.push({type:O.FRIEND,item:E,isSuggested:!1});a.numFriends++}}}}catch(e){c=!0;l=e}finally{try{s||null==p.return||p.return()}finally{if(c)throw l}}}(E)}else{var y={query:e,rows:a,counts:c};!function(e){var t=e.query,n=e.omitUserIds,r=e.shownUserIds,o=e.rows,i=e.counts;p.ZP.queryDMUsers({query:t, limit:50}).forEach((function(e){var t=e.record;if(!n.has(t.id)){var a=s.Z.getDMFromUserId(t.id);if(null!=a&&null!=l.ZP.lastMessageId(a)){r.add(t.id);o.push({type:O.DM,item:t,isSuggested:!1});i.numDms++}}}))}(g(b({},y),{omitUserIds:t,shownUserIds:i}));!function(e){var t=e.query,n=e.rows,r=e.counts;p.ZP.queryGroupDMs({query:t,limit:50,fuzzy:!1}).forEach((function(e){var t=e.record;n.push({type:O.GROUP_DM,item:t,isSuggested:!1});r.numGroupDms++}))}(y);!function(e){var t=e.query,n=e.rows,r=e.counts,o=e.omitUserIds,i=e.shownUserIds;p.ZP.queryFriends({query:t,limit:500,_fuzzy:!1}).forEach((function(e){var t=e.record;if(!o.has(t.id)&&!i.has(t.id)){i.add(t.id);n.push({type:O.FRIEND,item:t,isSuggested:!1});r.numFriends++}}))}(g(b({},y),{omitUserIds:t,shownUserIds:i}))}return{rows:a,counts:c}}function I(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=d.Z.getPrivateChannelIds()[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var c=i.value,u=s.Z.getChannel(c) ;if(null!=u&&u.isDM()&&null!=l.ZP.lastMessageId(u.id)){var p=u.getRecipientId();if(null!=p&&!e.has(p)){var h=f.default.getUser(p);if(null==h||h.bot||v(t,h.id))continue;return h}}}}catch(e){r=!0;o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return null}function S(e){var t=e.channel,n=e.inviteTargetType,r=e.applicationId;if(n===E.Iq.EMBEDDED_APPLICATION)if(null!=t){var o=!0,i=!1,s=void 0;try{for(var c,l=a.ZP.getEmbeddedActivitiesForChannel(t.id)[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var u=c.value;if(u.application_id===r)return new Set(u.connections.keys())}}catch(e){i=!0;s=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw s}}}return new Set}var T,N="minutes",A="hours",C="days",P="never",j=(m(T={},r.INVITE_OPTIONS_30_MINUTES.value,{value:30,type:N}),m(T,r.INVITE_OPTIONS_1_HOUR.value,{value:1,type:A}),m(T,r.INVITE_OPTIONS_6_HOURS.value,{value:6,type:A}),m(T,r.INVITE_OPTIONS_12_HOURS.value,{value:12,type:A}),m(T,r.INVITE_OPTIONS_1_DAY.value,{ value:1,type:C}),m(T,r.INVITE_OPTIONS_7_DAYS.value,{value:7,type:C}),m(T,r.INVITE_OPTIONS_FOREVER.value,{value:0,type:P}),T);function R(e,t){var n=parseInt(t,10),r=0===n,o=j[e].value;switch(j[e].type){case N:return r?y.Z.Messages.INVITE_EXPIRES_MINUTES:y.Z.Messages.INVITE_EXPIRES_MINUTES_OR_USES.format({numUses:n});case A:return r?y.Z.Messages.INVITE_EXPIRES_HOURS.format({numHours:o}):y.Z.Messages.INVITE_EXPIRES_HOURS_OR_USES.format({numHours:o,numUses:n});case C:return r?y.Z.Messages.INVITE_EXPIRES_DAYS_PLURAL.format({numDays:o}):y.Z.Messages.INVITE_EXPIRES_DAYS_OR_USES_PLURAL.format({numDays:o,numUses:n});case P:return r?y.Z.Messages.INVITE_EXPIRES_NEVER:y.Z.Messages.INVITE_EXPIRES_USES.format({numUses:n});default:return""}}const x={getMaxAgeOptions:r.MAX_AGE_OPTIONS,getMaxUsesOptions:r.MAX_USES_OPTIONS,INVITE_OPTIONS_FOREVER:r.INVITE_OPTIONS_FOREVER,INVITE_OPTIONS_1_DAY:r.INVITE_OPTIONS_1_DAY,INVITE_OPTIONS_7_DAYS:r.INVITE_OPTIONS_7_DAYS, INVITE_OPTIONS_12_HOURS:r.INVITE_OPTIONS_12_HOURS,INVITE_OPTIONS_6_HOURS:r.INVITE_OPTIONS_6_HOURS,INVITE_OPTIONS_1_HOUR:r.INVITE_OPTIONS_1_HOUR,INVITE_OPTIONS_30_MINUTES:r.INVITE_OPTIONS_30_MINUTES,INVITE_OPTIONS_UNLIMITED:r.INVITE_OPTIONS_UNLIMITED,INVITE_OPTIONS_ONCE:r.INVITE_OPTIONS_ONCE,INVITE_OPTIONS_5_TIMES:r.INVITE_OPTIONS_5_TIMES,INVITE_OPTIONS_10_TIMES:r.INVITE_OPTIONS_10_TIMES,INVITE_OPTIONS_25_TIMES:r.INVITE_OPTIONS_25_TIMES,INVITE_OPTIONS_50_TIMES:r.INVITE_OPTIONS_50_TIMES,INVITE_OPTIONS_100_TIMES:r.INVITE_OPTIONS_100_TIMES}},987594:(e,t,n)=>{"use strict";n.d(t,{YK:()=>d,gl:()=>p,_o:()=>h,rr:()=>E,bL:()=>y,$6:()=>m,g0:()=>l,ac:()=>b,xH:()=>g});var r=n(769321),o=n(837067),i=n(567403),a=(n(652591),n(2590)),s=n(473708);function c(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}var l,u,f=864e5*a.eBq;function d(){var e=r.h2.getSetting();0===o.Z.totalUnavailableGuilds&&(e=e.filter((function(e){ return null!=i.Z.getGuild(e)})));return e}function p(){var e=r.zA.getSetting();0===o.Z.totalUnavailableGuilds&&(e=e.filter((function(e){return null!=i.Z.getGuild(e)})));return e}function h(){var e=r.SE.getSetting();0===o.Z.totalUnavailableGuilds&&(e=e.filter((function(e){return null!=i.Z.getGuild(e)})));return e}function E(){var e=r.iH.getSetting();0===o.Z.totalUnavailableGuilds&&(e=e.filter((function(e){return null!=i.Z.getGuild(e)})));return e}function y(e){return(e&a.HGf)===a.HGf?{all:!0,mutualFriends:!0,mutualGuilds:!0}:{all:!1,mutualFriends:(e&a.SOq.MUTUAL_FRIENDS)===a.SOq.MUTUAL_FRIENDS,mutualGuilds:(e&a.SOq.MUTUAL_GUILDS)===a.SOq.MUTUAL_GUILDS}}function m(e,t){return!t.verified||null!=e&&f>Date.now()-new Date(e.created_at).getTime()}!function(e){e[e.UNDECIDED=0]="UNDECIDED";e[e.OPTIN=1]="OPTIN";e[e.OPTOUT=2]="OPTOUT"}(l||(l={}));var b=(c(u={},l.UNDECIDED,void 0),c(u,l.OPTIN,!0),c(u,l.OPTOUT,!1),u);function g(){return[{ name:s.Z.Messages.PRIVACY_SETTINGS_NON_SPAM_RETRAINING_SETTING_OPT_IN_HEADER,desc:s.Z.Messages.PRIVACY_SETTINGS_NON_SPAM_RETRAINING_SETTING_OPT_IN_DESC,value:l.OPTIN},{name:s.Z.Messages.PRIVACY_SETTINGS_NON_SPAM_RETRAINING_SETTING_OPT_OUT_HEADER,desc:s.Z.Messages.PRIVACY_SETTINGS_NON_SPAM_RETRAINING_SETTING_OPT_OUT_DESC,value:l.OPTOUT},{name:s.Z.Messages.PRIVACY_SETTINGS_NON_SPAM_RETRAINING_SETTING_UNSET_HEADER,desc:s.Z.Messages.PRIVACY_SETTINGS_NON_SPAM_RETRAINING_SETTING_UNSET_DESC,value:l.UNDECIDED}]}},218146:(e,t,n)=>{"use strict";n.r(t);n.d(t,{INVITE_OPTIONS_UNLIMITED:()=>i,INVITE_OPTIONS_ONCE:()=>a,INVITE_OPTIONS_5_TIMES:()=>s,INVITE_OPTIONS_10_TIMES:()=>c,INVITE_OPTIONS_25_TIMES:()=>l,INVITE_OPTIONS_50_TIMES:()=>u,INVITE_OPTIONS_100_TIMES:()=>f,MAX_USES_OPTIONS:()=>d,INVITE_OPTIONS_30_MINUTES:()=>p,INVITE_OPTIONS_1_HOUR:()=>h,INVITE_OPTIONS_6_HOURS:()=>E,INVITE_OPTIONS_12_HOURS:()=>y,INVITE_OPTIONS_1_DAY:()=>m,INVITE_OPTIONS_7_DAYS:()=>b,INVITE_OPTIONS_FOREVER:()=>g, MAX_AGE_OPTIONS:()=>O});var r=n(473708);function o(e,t){return{value:e,get label(){return t()}}}var i=o(0,(function(){return r.Z.Messages.MAX_USES.format({maxUses:0})})),a=o(1,(function(){return r.Z.Messages.MAX_USES.format({maxUses:1})})),s=o(5,(function(){return r.Z.Messages.MAX_USES.format({maxUses:5})})),c=o(10,(function(){return r.Z.Messages.MAX_USES.format({maxUses:10})})),l=o(25,(function(){return r.Z.Messages.MAX_USES.format({maxUses:25})})),u=o(50,(function(){return r.Z.Messages.MAX_USES.format({maxUses:50})})),f=o(100,(function(){return r.Z.Messages.MAX_USES.format({maxUses:100})})),d=[i,a,s,c,l,u,f],p=o(1800,(function(){return r.Z.Messages.DURATION_MINUTES.format({minutes:30})})),h=o(3600,(function(){return r.Z.Messages.DURATION_HOURS.format({hours:1})})),E=o(21600,(function(){return r.Z.Messages.DURATION_HOURS.format({hours:6})})),y=o(43200,(function(){return r.Z.Messages.DURATION_HOURS.format({hours:12})})),m=o(86400,(function(){return r.Z.Messages.DURATION_DAYS.format({ days:1})})),b=o(604800,(function(){return r.Z.Messages.DURATION_DAYS.format({days:7})})),g=o(0,(function(){return r.Z.Messages.MAX_AGE_NEVER})),O=[p,h,E,y,m,b,g]}}]); //# sourceMappingURL=ab1ce7821b551424c922.js.map