1(self.webpackChunkkatan=self.webpackChunkkatan||[]).push([[804],{491:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_active_black.cf9ea1be25d60f69f6b7.svg"},599:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_politics_intrigue.358a3e69a179ce765291.svg"},601:(e,t,s)=>{"use strict";e.exports=s.p+"assets/settlement_gold.971614e4b55713318408.svg"},648:(e,t,s)=>{"use strict";s.d(t,{QM:()=>r,Sq:()=>n,ey:()=>i,uC:()=>o});var i=function(e){return e.ContentFrameReady="content-frame-ready",e.Subscribe="subscribe",e.Unsubscribe="unsubscribe",e.SetActivity="set-activity",e.DispatchDiscordEvent="dispatch",e.OpenExternalLink="open-external-link",e.InviteFriends="invite-friends",e.Purchase="purchase",e.ShareMoment="share-moment",e.ShareActivityLink="share-activity-link",e.SetOrientation="set-orientation",e}({}),n=function(e){return e.Ready="ready",e.CreateMountPopup="create-mount-popup",e}({}),r=function(e){return e.UserAlreadyHasMembershipError="user-already-has-membership-error",e}({}),o=function(e){return e[e.PurchaseMembership=0]="PurchaseMembership",e[e.PurchaseGift=1]="PurchaseGift",e[e.PurchaseCoins=2]="PurchaseCoins",e[e.InviteFriends=3]="InviteFriends",e[e.ShareMoment=4]="ShareMoment",e[e.OpenExternalLink=5]="OpenExternalLink",e}({})},655:(e,t,s)=>{"use strict";s.d(t,{m:()=>g});var i=s(12658),n=s(68492),r=s(72589),o=s(10369),a=s(18587),c=s(44529),l=s(58602),d=s(69508),u=s(72239),h=s(70970),p=s(2658);class m{get isSuccess(){return r.c.isNumberBetween(this.status,200,299)&&null==this.json.error}constructor(e){this.status=e.status,this.headers=e.headers,this.json=e.data}}class g{static async getRequestResponse(e,t={}){let s=e;t.urlVariable&&(s+="/"+t.urlVariable),a.r.isUserOnDiscord&&(s="/.proxy"+s);const n={...this.defaultConfig,headers:t.headers,params:t.params,signal:t.abortSignal},r=new m(await i.A.get(s,n));if(this.storeAuthToken(r),h.F.isChallengeResponse(r.headers))return await h.F.obtainPreClearanceCookie(),this.getRequestResponse(e,t);if(h.F.isTokenResponse(r.headers)){let s;p.D.show({key:"strings:popups.replay.pleaseWait"});try{s=await h.F.getToken()}catch(e){return void p.D.remove()}const i={...t.headers,turnstileToken:s},n=await this.getRequestResponse(e,{...t,headers:i});return p.D.remove(),n}return r}static async getRequestHandler(e,t,s,i=!0,n){const r=await this.getRequestResponse(e,{urlVariable:t,params:s,headers:n});if(null!=r)return r.isSuccess?r:void(i&&this.handleResponseError(r))}static async postRequestWhenReady(e,t,s,i="application/json"){for(;!g.csrfToken&&!a.r.isUserOnDiscordMobile;)await(0,u.cb)(50);return this.postRequestHandler(e,t,s,i)}static async postRequestHandler(e,t,s,n="application/x-www-form-urlencoded",r){if(!g.csrfToken&&!a.r.isUserOnDiscordMobile){const e=new l.Ak({key:"strings:popups.errors.general.title"},{key:"strings:popups.errors.clientNotReady"},d.R.ServiceUnavailable);return void o.r.showDefaultErrorPopup(e)}const c={"Content-Type":n,"x-csrf-token":g.csrfToken,...r};a.r.isUserOnDiscord&&(e="/.proxy"+e);const u=new m(await i.A.post(e,s,{headers:c,...this.defaultConfig,params:t}));if(this.storeAuthToken(u),h.F.isChallengeResponse(u.headers))return await h.F.obtainPreClearanceCookie(),this.postRequestHandler(e,t,s,n);if(h.F.isTokenResponse(u.headers)){let i;try{i=await h.F.getToken()}catch(e){return}return this.postRequestHandler(e,t,s,n,{turnstileToken:i})}if(u.isSuccess)return u;this.handleResponseError(u)}static storeAuthToken(e){a.r.isUserOnDiscordMobile&&null!=e.headers["x-auth-token"]&&c.p.setAuthToken(e.headers["x-auth-token"])}static handleResponseError(e){const t=e.json.error;if(null==t)return;if(null==t.type)return;const s=n.F.deserializeErrorData(t);null!=s&&o.r.handleError(s)}static get defaultConfig(){return{validateStatus:e=>!0}}}g.csrfToken="",i.A.interceptors.request.use(e=>{if(a.r.isUserOnDiscordMobile){const t=c.p.getAuthToken();null!=t&&e.headers.set("x-auth-token",t)}return e})},766:(e,t,s)=>{"use strict";s.d(t,{i:()=>c});var i=s(76092),n=s(92524),r=s(80708),o=s(5201),a=s(15055);function c(e){const t={type:i.k0.PurchaseSessionStarted,category:i.eX.Store,stringValue:e.method,dimensions:{storeProductType:e.storeProductType,productType:e.productType}};r.CA.sendAnalyticEvent(t),o.z.captureEvent(a.x.PurchaseSessionStarted,{method:e.method,storeProductType:n.l6[e.storeProductType],productType:e.productType})}},780:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_science_road_building.3f972a0989faf60df257.svg"},881:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_discard_broadcast.6161a89619b65cc63577.mp3"},927:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_road_place.d101fe727f7ff45b8379.mp3"},1176:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_mail.0656e9f2c0cfcddfb878.svg"},1199:(e,t,s)=>{"use strict";s.r(t),s.d(t,{ANDROID_APP_USER_AGENT:()=>i,IPAD_APP_USER_AGENT:()=>r,IPHONE_APP_USER_AGENT:()=>n,TABLET_APP_USER_AGENT:()=>o,isAndroidDeviceUserAgent:()=>l,isIOSDeviceUserAgent:()=>c,isMobileAppUserAgent:()=>u,isMobileDeviceUserAgent:()=>a,isTabletDeviceUserAgent:()=>d,isUserOnMobile:()=>h});const i="Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; Nexus One Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",n="Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile",r="Mozilla/5.0 (iPad; U; CPU OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile",o="Mozilla/5.0 (Linux; Android 12; SM-X906C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36",a=e=>/Android|iPhone|iPad|iPod/i.test(e||""),c=e=>/iPhone|iPad|iPod/i.test(e||""),l=e=>/Android/i.test(e||""),d=e=>/(tablet|ipad|playbook|silk)|(android(?!.*mobile))/i.test(e||""),u=e=>[n,r,o,i].includes(e||""),h=(e,t)=>{if(u(e))return!0;var s;return null!==(s=null==t?void 0:t.includes("/mobile"))&&void 0!==s&&s}},1631:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_city_wall_place.219aa0bd070ac4032644.mp3"},1714:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_merchant_orange.c9b72d3d42f402e65dc5.svg"},1767:(e,t,s)=>{"use strict";s.d(t,{Y:()=>I});var i=s(9902),n=s(17399),r=s(4508),o=s(36872),a=s(9029),c=s(72239),l=s(13618),d=s(96990);class u{createBaseNotification(e){(0,a.zO)(this._container,this.viewData.image,"notification_image"),this.content=(0,a.Le)(this._container,"notification_content"),this.textContainer=(0,a.Le)(this.content,"notification_text"),this.timestamp=(0,a.Le)(this.content,"notification_timestamp"),(0,a.oB)(this.timestamp,c.Re.getTimeAgoTextFromDate(e)),(0,a.RH)(this.textContainer,this.viewData.text)}createResponseButtons(){if(null==this.viewData.responseButtons)return;const e=(0,a.Le)(this.content,"notification_response_buttons"),t=(0,a.Le)(e,"notification_response_button btn_general");(0,a.RH)(t,{key:"strings:colonistCommon.buttons.accept"}),(0,a.G0)(t,()=>{var e;this.callbackOnClick(),null===(e=this.viewData.responseButtons)||void 0===e||e.acceptButtonAction()});const s=(0,a.Le)(e,"notification_response_button notification_ignore_button btn_general");(0,a.RH)(s,{key:"strings:colonistCommon.buttons.ignore"}),(0,a.G0)(s,()=>{var e;this.callbackOnClick(),null===(e=this.viewData.responseButtons)||void 0===e||e.ignoreButtonAction()})}setCallbackOnClick(e){this.callbackOnClick=e}setClickActions(){if(this.createSecondaryAction(),null==this.viewData.secondaryLink)return;const{url:e,text:t,openNewTab:s}=this.viewData.secondaryLink,i=(0,a.cE)(this.content,e,t,"notification_link","",s);d.N.isUserOnMobileWebview()&&!d.N.isUserOnDiscordMobile()||(0,a.G0)(i,t=>{var s,i;t.preventDefault(),(0,l.Yf)(e,!1,!0),null===(s=(i=this.viewData).clickAction)||void 0===s||s.call(i)})}createSecondaryAction(){if(null==this.viewData.secondaryAction)return;const e=(0,a.Le)(this.content,"notification_link");(0,a.RH)(e,this.viewData.secondaryAction.text),(0,a.G0)(e,()=>{var t;return null===(t=this.viewData.secondaryAction)||void 0===t?void 0:t.onAction(e)})}get dateReceived(){return this._dateReceived}get container(){return this._container}get notificationId(){return this._notificationId}get isRead(){return this._isRead}get hasCTAs(){return null!=this.viewData.responseButtons}markAsRead(){this._isRead||(this._isRead=!0,this._container.classList.add("notification_item_read"))}updateTimestamp(){(0,a.oB)(this.timestamp,c.Re.getTimeAgoTextFromDate(this.dateReceived))}constructor(e,t,s){this._isRead=!1;const i=(0,a.Le)(s,"notification_item");this._container=i,this._dateReceived=t,this._notificationId=e}}var h=s(18587),p=s(75589),m=s(66935);const g={key:"strings:popups.notification.giftURLCreatedCopyLink"};class f extends u{setOnClose(e){this.onClose=e}markAsReadIfNeeded(e){null!=e&&this.markAsRead()}getViewData(e,t){switch(e.type){case r.jI.UserReportedBanned:return{text:{key:"strings:popups.notification.reportedUserBanned.body"},image:o.am.Guest};case r.jI.UserReportedThankYou:return{text:{key:"strings:popups.notification.reportedUserThankYou.body"},image:o.am.Guest};case r.jI.HolidaySale2023Expired:return{text:{key:"strings:popups.notification.holidaySale2023Expired.body"},clickAction:()=>{var e;return null===(e=this.onClose)||void 0===e?void 0:e.call(this)},image:o.am.Guest,secondaryLink:{url:"/store",openNewTab:!0,text:{key:"strings:popups.notification.giftMembershipReceived.checkButton",options:{context:h.r.isUserOnDiscord?"discord":""}}}};case r.jI.GiftMembershipReceivedFromAdmin:return{text:{key:"strings:popups.notification.giftMembershipReceived.body"},clickAction:()=>{var e;return null===(e=this.onClose)||void 0===e?void 0:e.call(this)},image:o.am.Guest,secondaryLink:{url:"/store#gifted_memberships",openNewTab:!0,text:{key:"strings:popups.notification.giftMembershipReceived.checkButton",options:{context:h.r.isUserOnDiscord?"discord":""}}}};case r.jI.TranslationHelp:return{text:{key:"strings:popups.notification.translationHelp.body",options:{language:e.language,username:e.username,link:h.r.isUserOnMobileAppOrWeb?void 0:e.link}},image:o.am.Guest};case r.jI.UserReportedWarning:return{text:{key:"strings:popups.notification.reportedUserWarning"},image:o.am.DangerIcon};case r.jI.RoomInviteResponse:var s;return{text:{key:"strings:popups.notification.youRespondedToRoomInviteFrom",options:{username:null==t?void 0:t.username,context:e.response?void 0:"declined"}},image:null!==(s=null==t?void 0:t.icon)&&void 0!==s?s:o.am.Guest};case r.jI.MissedRoomInvite:var i;return{text:{key:"strings:popups.notification.youRespondedToRoomInviteFrom",options:{username:null==t?void 0:t.username,context:"missed"}},image:null!==(i=null==t?void 0:t.icon)&&void 0!==i?i:o.am.Guest};case r.jI.YouAreNowFriendsWith:var n;return{text:{key:"strings:popups.notification.youAreNowFriendsWith",options:{username:null==t?void 0:t.username}},image:null!==(n=null==t?void 0:t.icon)&&void 0!==n?n:o.am.Guest};case r.jI.GiftMembershipReceivedFromUser:var a;
1const u=null==e||null===(a=e.giftMessage)||void 0===a?void 0:a.trim();var c;return{text:{key:"strings:popups.notification.giftMembershipReceivedFromFriend",options:{context:u?"":"noMessage",gifter:null==t?void 0:t.username,giftMessage:u}},image:null!==(c=null==t?void 0:t.icon)&&void 0!==c?c:o.am.Guest};case r.jI.GiftMembershipWasSent:const g=p.G.getMembershipTitleFromType(e.membershipType);var l;return{text:(0,m.dN)({key:"strings:popups.notification.giftMembershipWasSentToFriend",options:{duration:e.duration,username:null==t?void 0:t.username}},{membershipType:g}),image:null!==(l=null==t?void 0:t.icon)&&void 0!==l?l:o.am.Guest};case r.jI.GiftURLCreated:const y="strings:popups.notification.giftURLCreated",v=1==e.duration?"":"multiple",S=p.G.getMembershipTitleFromType(e.membershipType),b=`${window.location.origin}/store#redeem=${e.hash}`;var d;return{text:(0,m.dN)({key:y,options:{duration:e.duration,hash:e.hash,context:v}},{membershipType:S}),image:null!==(d=null==t?void 0:t.icon)&&void 0!==d?d:o.am.Guest,secondaryAction:f.getGiftLinkAction(b)};case r.jI.YouAreBanned:return{text:{key:"strings:popups.errors.userBannedError.youAreBanned",options:{untilDate:` until ${new Date(e.untilDate).toDateString()}`}},image:o.am.DangerIcon,secondaryLink:{url:"/community-guidelines",openNewTab:!0,text:{key:"strings:homePage.singletonPages.communityGuidelines"}}};case r.jI.GeneralAnnouncement:return{text:{key:"strings:colonistCommon.utils.#buffer",options:{value:e.message}},image:o.am.GameModeBase};case r.jI.YouAreMuted:return{text:{key:"strings:popups.notification.youAreMuted.body"},image:o.am.DangerIcon}}}static getGiftLinkAction(e){if(p.G.hasShareLinkHandler())return{text:{key:"strings:popups.notification.giftURLCreatedShareLink"},onAction:()=>p.G.shareLink(e)};let t;return{text:g,onAction:async s=>{await f.copyGiftLinkToClipboard(e)&&((0,a.RH)(s,{key:"strings:roomPage.copiedLink"}),clearTimeout(t),t=setTimeout(()=>(0,a.RH)(s,g),1500))}}}static async copyGiftLinkToClipboard(e){try{return await navigator.clipboard.writeText(e),!0}catch{const t=(0,a.cE)(document.body,e,{key:"strings:colonistCommon.utils.emptyString"},"");return t.target="_blank",t.click(),!1}}constructor(e,t){super(e.id,e.dateReceived,t),this.notificationUserDetails=e.notificationUserDetails,this.viewData=this.getViewData(e.typeData,this.notificationUserDetails),this.createBaseNotification(e.dateReceived),this.markAsReadIfNeeded(e.dateRead),this.setClickActions()}}var y=s(4651),v=s(55853),S=s(76349);class b extends u{static getViewData(e){switch(e.type){case r.jI.LiveRoomInvite:return{text:{key:"strings:roomPage.userInvitedToRoom",options:{username:e.senderUsername,roomId:e.roomId}},image:e.senderIcon,responseButtons:{acceptButtonAction:()=>v.Y.respondToFriendRoomInvite(e.roomId,!0,e.senderUserId),ignoreButtonAction:()=>v.Y.respondToFriendRoomInvite(e.roomId,!1,e.senderUserId)}};case r.jI.FriendRequestReceived:return{text:{key:"strings:popups.notification.userSentYouFriendRequest",options:{username:e.username}},image:o.am.Friends,responseButtons:{acceptButtonAction:()=>{S.v.respondToFriendRequest({userId:e.userId,username:e.username},!0)},ignoreButtonAction:()=>{S.v.respondToFriendRequest({userId:e.userId,username:e.username},!1)}}}}}constructor(e,t){super("",e.dateReceived,t),this.viewData=b.getViewData(e.typeData),this.createBaseNotification(e.dateReceived),this.createResponseButtons(),this.setClickActions()}}var C=s(81888);class P{setLazyLoadAction(){this.notificationPanelContent.addEventListener("scroll",e=>{if(this.lazyLoadingDisabled)return;0!=this.notificationPanelContent.scrollTop+this.notificationPanelContent.clientHeight>=this.notificationPanelContent.scrollHeight-this.lazyLoadDOMTolerance&&this.getOlderNotificationsThrottled()})}getOlderNotificationsThrottled(){const e=new Date;if(e.getTime()-this.timeOfLastNotificationRequest.getTime()<this.LAZY_LOAD_THROTTLE_MS)return;const t=this.notifications[this.notifications.length-1];y.S.getNotificationsAfterDate(t.dateReceived),this.timeOfLastNotificationRequest=e}hideNotificationPanel(){this.notificationPanel.classList.contains("hidden")||(this.notificationPanel.classList.add("hidden"),this.markViewedNotificationsAsRead(),this.displayNumberOfUnreadNotifications(this.lastUnreadNotificationCount))}showNotificationPanel(){this.notificationPanel.classList.remove("hidden")}showNotificationContainer(){this.notificationContainer.classList.remove("hidden")}
1onNotificationIconClick(){this.notificationPanel.classList.contains("hidden")?this.showNotificationPanel():this.hideNotificationPanel()}markViewedNotificationsAsRead(){this.notifications.some(e=>!e.hasCTAs&&!e.isRead)&&(this.markAllNotificationsAsRead(),y.S.sendMarkAllNotificationsAsRead())}hidePanelIfClickedOutside(e){const t=e.target,s=this.notificationPanel.contains(t),i=this.notificationIcon.contains(t);s||i||this.hideNotificationPanel()}addNotification(e){if(this.findNotificationById(e.id)>-1)return;const t=new f(e,this.notificationPanelContent);t.setCallbackOnClick(()=>this.removeCTANotification(t)),t.setOnClose(()=>this.hideNotificationPanel()),this.notificationPanelContent.appendChild(t.container),this.notifications.push(t),this.sortNotificationViewsByDateReceived()}sortNotificationViewsByDateReceived(){this.notifications.sort((e,t)=>t.dateReceived.getTime()-e.dateReceived.getTime());for(const e of this.notifications)this.notificationPanelContent.removeChild(e.container);for(const e of this.notifications)this.notificationPanelContent.appendChild(e.container)}addNotifications(e){0==e.length&&(this.lazyLoadingDisabled=!0);for(const t of e)this.addNotification(t);this.noNotificationsMessage.classList.toggle("hidden",this.notifications.length>0),this.addNotificationCallback()}markNotificationAsRead(e){const t=this.notifications.find(t=>t.notificationId==e);null==t||t.markAsRead()}markAllNotificationsAsRead(){for(const e of this.notifications)e.hasCTAs||e.markAsRead()}displayNumberOfUnreadNotifications(e){this.lastUnreadNotificationCount=e;const t=e+this.notifications.filter(e=>e.hasCTAs).length,s=t>r.te-1?r.te-1+"+":t.toString();this.notificationIconUnreadNumber.innerText=s,this.notificationIconUnreadContainer.classList.toggle("hidden",0==t)}addCTANotification(e){const t=new b(e,this.notificationPanelContent);return t.setCallbackOnClick(()=>this.removeCTANotification(t)),this.notificationPanelContent.appendChild(t.container),this.notifications.push(t),this.sortNotificationViewsByDateReceived(),this.displayNumberOfUnreadNotifications(this.lastUnreadNotificationCount),this.noNotificationsMessage.classList.toggle("hidden",this.notifications.length>0),t}removeCTANotification(e){const t=this.notifications.indexOf(e);-1!=t&&(this.notifications.splice(t,1),this.notificationPanelContent.removeChild(e.container),this.displayNumberOfUnreadNotifications(this.lastUnreadNotificationCount),e.container.remove(),this.noNotificationsMessage.classList.toggle("hidden",this.notifications.length>0))}updateNotificationTimestamps(){for(const e of this.notifications)e.updateTimestamp()}findNotificationById(e){return this.notifications.findIndex(t=>t.notificationId==e)}addFriendRequestNotification(e,t){if(this.cachedFriendRequests.includes(e.userId))return;this.cachedFriendRequests.push(e.userId);const s={dateReceived:t,typeData:{type:r.jI.FriendRequestReceived,userId:e.userId,username:e.username}},i=this.addCTANotification(s);this.userIdNotificationMap.set(e.userId,i)}constructor(e){this.notifications=[],this.lazyLoadDOMTolerance=1,this.lastUnreadNotificationCount=0,this.timeOfLastNotificationRequest=new Date,this.LAZY_LOAD_THROTTLE_MS=500,this.lazyLoadingDisabled=!1,this.UPDATE_NOTIFICATION_TIMESTAMP_MS=5e3,this.userIdNotificationMap=new Map,this.cachedFriendRequests=[],this.addNotificationCallback=e,this.notificationIcon=document.getElementById("header_profile_notification_icon"),this.notificationContainer=document.getElementById("header_profile_notification_container"),this.notificationPanel=document.getElementById("header_profile_notification_panel"),this.notificationPanelContent=document.getElementById("header_profile_notification_panel_content"),this.notificationIconUnreadNumber=document.getElementById("header_profile_notification_count"),this.notificationIconUnreadContainer=document.getElementById("header_profile_notification_count_container"),this.noNotificationsMessage=document.getElementById("header_profile_notification_no_notifications"),C._.registerChangeListener(()=>{p.G.canUseLiveNotificationService()&&this.showNotificationContainer()}),(0,a.G0)(this.notificationIcon,()=>
1this.onNotificationIconClick()),document.addEventListener("pointerdown",e=>this.hidePanelIfClickedOutside(e)),setInterval(()=>this.updateNotificationTimestamps(),this.UPDATE_NOTIFICATION_TIMESTAMP_MS),this.setLazyLoadAction();const t=document.getElementById("header_profile_notification_panel_header_back_button");null!=t&&(0,a.G0)(t,()=>this.hideNotificationPanel()),S.v.setCallbackFriendRequestResponded(async(e,t)=>{const s=this.userIdNotificationMap.get(e.userId);null!=s&&this.removeCTANotification(s)})}}var k=s(76092),T=s(80708),A=s(10369),R=s(68492),w=s(46581);class I{setupShuffleLinkInterceptor(){this.notificationPanelController.notificationPanelContent.querySelectorAll(I.SHUFFLE_LINK_SELECTOR).forEach(e=>{e.hasAttribute("data-shuffle-handler")||(e.setAttribute("data-shuffle-handler","true"),this.handleShuffleLink(e))})}async addFriendRequestsToNotificationPanel(){if(null==C._.userState)return;if(null==this.notificationPanelController)return;const e=await S.v.getFriendRequestsReceived(C._.userState);if(0!==e.length)for(const t of e)this.notificationPanelController.addFriendRequestNotification(t,new Date(t.dateCreated))}static sendPlayNowClickAnalytic(){const e={type:k.k0.NotificationAnalytics,category:k.eX.NotificationPanel,floatValue:k.Jd.NotificationPanelShuffleClickPlayNow};T.CA.sendAnalyticEvent(e)}static displayRedirectErrors(){const e=window.location.hash;if(e.startsWith("#error="))try{const t=e.substring(7);if(!t)return;const s=decodeURIComponent(t);if(!s)return;const i=JSON.parse(s);if(null==(null==i?void 0:i.type))return;const n=R.F.deserializeErrorData(i);if(null==n)return;A.r.handleError(n)}catch(e){}finally{(0,n.fr)()}}static displayAccountDeletionPopup(){new URLSearchParams(window.location.search).has("account-deleted")&&((0,i.C)({title:{key:"strings:popups.accountDeletionConfirmation.title"},body:{key:"strings:popups.accountDeletionConfirmation.body"}}),(0,n.CK)())}constructor(){this.notificationPanelController=new P(()=>this.setupShuffleLinkInterceptor()),this.addFriendRequestsToNotificationPanel(),I.displayAccountDeletionPopup(),I.displayRedirectErrors()}}I.SHUFFLE_LINK_SELECTOR=`a[href*="#matchmakingqueue=${w.Nw.UnrankedShuffle}"]`},1863:(e,t,s)=>{"use strict";s.d(t,{z:()=>i});var i,n=s(72239),r=s(18587),o=s(44529),a=s(81888),c=s(67908),l=s(87220);!function(e){e.canShowLoginPopup=function(){var e,t;return!(void 0!==(0,l.Ak)(window.location.href))&&(!r.r.isUserOnDiscord&&(!(null===(e=a._.userState)||void 0===e?void 0:e.isLoggedIn)&&(!(null===(t=a._.userState)||void 0===t?void 0:t.hasZeroCompletedGames())&&0!==n.n.randomIntBetween(0,1))))},e.canShowDiscordKeepPlayingOnWebPopup=function(){return!!r.r.isUserOnDiscord&&(1!=o.p.getDiscordKeepPlayingOnWebPopupShown()&&["ru"].includes(r.r.language))},e.canShowSubscriptionPopup=function(){var e,t;return!r.r.isUserOnDiscordMobile&&(!(null===(e=a._.userState)||void 0===e?void 0:e.items.hasMembership())&&!(null===(t=a._.userState)||void 0===t?void 0:t.hasZeroCompletedGames()))},e.canShowRushIncentivePopup=function(){var e,t;return!r.r.isUserOnDiscordMobile&&(!(null===(e=a._.userState)||void 0===e?void 0:e.items.hasMembership())&&(!(null===(t=a._.userState)||void 0===t?void 0:t.hasZeroCompletedGames())&&(!(o.p.getRushIncentivePopupShownCount()>=3)&&0==o.p.getRushGamesPlayed())))},e.shouldShowChangeUsernamePopup=function(e){var t,s;return 0!=r.r.isUserOnDiscord&&(!((null!==(s=null===(t=a._.userState)||void 0===t?void 0:t.usernameChangeAttemptsLeft)&&void 0!==s?s:0)<1)&&(1!=o.p.getDiscordOnlineUsernamePopupShown()&&null!=e))},e.userEligibleForRanked=function(){var e,t;return(null!==(t=null===(e=a._.userState)||void 0===e?void 0:e.totalCompletedGameCount)&&void 0!==t?t:0)>=c.FP.NumberOfGamesToUnlockRanked},e.gamesLeftToUnlockRanked=function(){var e,t;return c.FP.NumberOfGamesToUnlockRanked-(null!==(t=null===(e=a._.userState)||void 0===e?void 0:e.totalCompletedGameCount)&&void 0!==t?t:0)},e.shouldShowLobbyAds=function(){var e,t;return(null!==(t=null===(e=a._.userState)||void 0===e?void 0:e.totalCompletedGameCount)&&void 0!==t?t:0)>=c.FP.NumberOfGamesToUnlockRanked}}(i||(i={}))},1932:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_largest_army_highlight.be615b163db0dbd64fbc.svg"},2109:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ship_mysticblue_north_west.bac6d11f88a524bbf0ff.svg"},2328:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_volcano_preview.c79f209e148f7c8270eb.png"},2330:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_forward_end.bf63a16452d507f26db0.svg"},2451:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_discord_color.1e70305dd86daa1b1f19.svg"},2658:(e,t,s)=>{"use strict";s.d(t,{D:()=>n});var i=s(9029);
1class n{static show(e){if(null!=this.connectionLostBackground)return;const t=(0,i.Le)(document.body,"game-reconnecting-overlay");(0,i.Le)(t,"loading-spinner"),(0,i.i5)(t,"game-reconnecting-text",e),this.connectionLostBackground=t}static remove(){null!=this.connectionLostBackground&&this.connectionLostBackground.remove(),this.connectionLostBackground=void 0}}},2928:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_05x.8e3569036478c93caba8.svg"},3015:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_politics_constitution.86fdbdb04ea427c71409.svg"},3143:(e,t,s)=>{"use strict";s.d(t,{b:()=>c});var i=s(46581),n=s(81888);function r(e){var t;return!!e.isGameModePremium()&&!(null===(t=n._.userState)||void 0===t?void 0:t.items.hasAccessToPremiumMode(e))}var o=s(27455),a=s(98560);function c(e){(0,a._)({title:e.name,image:e.icon,bodyItems:l(e.modeSetting),onSubscribe:(0,o.u)(r(e),i.p9[e.modeSetting],"gameMode")})}function l(e){switch(e){case i.p9.Classic4P:return"strings:colonistCommon.gameModes.classic4P.body";case i.p9.TutorialClassic4P:case i.p9.BeginnerModeClassic4P:return"strings:colonistCommon.gameModes.classicTutorial4P.body";case i.p9.Classic56P:return"strings:colonistCommon.gameModes.classic56P.body";case i.p9.Classic78P:return"strings:colonistCommon.gameModes.classic78P.body";case i.p9.Seafarers4P:return"strings:colonistCommon.gameModes.seafarers4P.body";case i.p9.Seafarers56P:return"strings:colonistCommon.gameModes.seafarers56P.body";case i.p9.CitiesAndKnights4P:return"strings:colonistCommon.gameModes.citiesAndKnights4P.body";case i.p9.CitiesAndKnights56P:return"strings:colonistCommon.gameModes.citiesAndKnights56P.body";case i.p9.CitiesAndKnightsSeafarers4P:return"strings:colonistCommon.gameModes.seafarersAndCitiesAndKnights4P.body";case i.p9.CitiesAndKnightsSeafarers56P:return"strings:colonistCommon.gameModes.seafarersAndCitiesAndKnights56P.body";case i.p9.ServerStressTestClassic4P:return"strings:colonistCommon.gameModes.serverStressTestClassic4P.body";case i.p9.ColonistRush4P:return"strings:colonistCommon.gameModes.colonistRush.body"}}},3328:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_lock_on.2f4010a296f7d415e505.svg"},3700:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_active_gold.e6d083c7de0f5a7d8188.svg"},3738:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_ss3_4p_preview.333ddc553878ec4ef418.png"},3844:(e,t,s)=>{"use strict";s.d(t,{H:()=>u});var i=s(73617),n=s(97861),r=s(648),o=s(18628),a=s(41592),c=s(9902),l=s(13618);class d{createPopup(e){if(null==(null==e?void 0:e.popupType))throw new Error("Popup type is missing");e.popupType===r.QM.UserAlreadyHasMembershipError&&this.createUserAlreadyHasMembershipError(e)}createUserAlreadyHasMembershipError(e){if(null==e.error)return;(0,c.C)({title:{key:"strings:popups.errors.discordActiveMembershipError.title"},body:{key:"strings:popups.errors.discordActiveMembershipError.body"},confirmLabel:{key:"strings:colonistCommon.buttons.discord"},onConfirm:()=>(0,l.Yf)(a.T,!0)}),this.sendUserAlreadyHasMembershipReportToSentry(e.error)}sendUserAlreadyHasMembershipReportToSentry(e){var t,s;const i={discordUsername:null!==(s=null===(t=this.contentFrameCommunicationHandler.serverProfile)||void 0===t?void 0:t.username)&&void 0!==s?s:"unknown username",errorCode:e.code,errorMessage:e.message};(0,o.wd)(`Discord Error | ${e.message}`,{level:"error",extra:{data:JSON.stringify(i)}})}constructor(e){this.contentFrameCommunicationHandler=e}}class u{static normalizeOptionalString(e){if(null!=e&&"undefined"!=e)return e}async waitToBeReady(){return this.readyPromise}async subscribeToDiscordEvent(e,t){0==this.subscriptionListener.listenerCount(e)&&await this.sendMessageToMount({command:r.ey.Subscribe,subscription:e});return this.subscriptionListener.subscribe(e,t)}async unsubscribeFromDiscordEvent(e,t){1==this.subscriptionListener.listenerCount(e)&&await this.sendMessageToMount({command:r.ey.Unsubscribe,event:e}),this.subscriptionListener.unsubscribe(e,t)}handleMessageReceivedFromMount({data:e,origin:t}){var s;if("object"!=typeof e||Array.isArray(e)||null===e)return;try{if(t!==new URL(document.referrer).origin)return}catch(e){return}const{messageId:i,event:n,command:o,data:a,args:c}=e;if(n!==r.Sq.CreateMountPopup){if(o===r.ey.DispatchDiscordEvent){if(null==n)throw new Error("Event is missing");this.subscriptionListener.emit(n,a)}null!=i&&(null===(s=this.messagesWaitingForResponse.get(i))||void 0===s||s.resolve(a),this.messagesWaitingForResponse.delete(i))}else this.mountPopupHandler.createPopup(a)}sendMessageToMount(e){console.log("Sending message",e);const t=(0,i.eJ)();window.parent.postMessage({messageId:t,...e},document.referrer?document.referrer:"*");return new Promise((e,s)=>{this.messagesWaitingForResponse.set(t,{resolve:e,reject:s})})}openExternalLink(e){this.sendMessageToMount({command:r.ey.OpenExternalLink,data:{url:e}})}constructor(){this.messagesWaitingForResponse=new Map,this.subscriptionListener=new n.X,window.addEventListener("message",e=>this.handleMessageReceivedFromMount(e)),this.mountPopupHandler=new d(this),this.readyPromise=new Promise(e=>{this.subscriptionListener.subscribeOnce(r.Sq.Ready,({instanceId:t,serverId:s,userDiscordAccessToken:i,serverProfile:n,userPermissions:r,referrerId:o,referralTypeId:a,isInitialLoad:c})=>{this.voiceChannelId=t,this.inDiscordServer=null!=s,this.userDiscordAccessToken=i,this.serverProfile=n,this.userPermissions=r,this.referrerId=u.normalizeOptionalString(o),this.referralTypeId=u.normalizeOptionalString(a),this.isInitialLoad=c,e()})}),this.sendMessageToMount({command:r.ey.ContentFrameReady})}}},4459:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_christmas.c58d5735b6fe15be1bd4.png"},4508:(e,t,s)=>{"use strict";s.d(t,{jI:()=>n,te:()=>i});const i=100;var n=function(e){return e[e.UserReportedBanned=1]="UserReportedBanned",e[e.UserReportedThankYou=2]="UserReportedThankYou",e[e.HolidaySale2023Expired=3]="HolidaySale2023Expired",e[e.GiftMembershipReceivedFromAdmin=4]="GiftMembershipReceivedFromAdmin",e[e.TranslationHelp=5]="TranslationHelp",e[e.UserReportedWarning=6]="UserReportedWarning",e[e.LiveRoomInvite=7]="LiveRoomInvite",e[e.RoomInviteResponse=8]="RoomInviteResponse",e[e.MissedRoomInvite=9]="MissedRoomInvite",e[e.FriendRequestReceived=10]="FriendRequestReceived",e[e.YouAreNowFriendsWith=11]="YouAreNowFriendsWith",e[e.GiftMembershipReceivedFromUser=12]="GiftMembershipReceivedFromUser",e[e.GiftMembershipWasSent=13]="GiftMembershipWasSent",e[e.GiftURLCreated=14]="GiftURLCreated",e[e.NewUserJoinedFromReferral=15]="NewUserJoinedFromReferral",e[e.ReferralRewardItemUnlocked=16]="ReferralRewardItemUnlocked",e[e.YouAreBanned=17]="YouAreBanned",e[e.FreeAvatarUnlocked=18]="FreeAvatarUnlocked",e[e.PushReferrersToInviteMoreFriends=19]="PushReferrersToInviteMoreFriends",e[e.GeneralAnnouncement=20]="GeneralAnnouncement",e[e.YourFriendMustLogInToCountReferral=21]="YourFriendMustLogInToCountReferral",e[e.YouAreMuted=22]="YouAreMuted",e}({})},4651:(e,t,s)=>{"use strict";s.d(t,{S:()=>o});var i=s(34668),n=s(75589),r=s(55547);
1class o{static init(){r.sZ.controller.registerSessionEstablishedObserver(()=>{this.registerToNotificationServiceAndGetNotifications()})}static registerToNotificationServiceAndGetNotifications(){i.Q.registerToNotificationService(),n.G.delayNotificationDataRequest(()=>this.getNotifications())}static getNotifications(){const e={date:new Date,notificationCountToSend:this.INITIAL_NOTIFICATION_COUNT};i.Q.getNotifications(e)}static sendMarkNotificationAsRead(e){i.Q.markNotificationAsRead(e)}static sendMarkAllNotificationsAsRead(){i.Q.markAllNotificationsAsRead()}static getNotificationsAfterDate(e){const t={date:e,notificationCountToSend:this.LAZY_LOAD_NOTIFICATION_COUNT};i.Q.getNotifications(t)}}o.INITIAL_NOTIFICATION_COUNT=25,o.LAZY_LOAD_NOTIFICATION_COUNT=10},4903:(e,t,s)=>{"use strict";e.exports=s.p+"assets/road_black.6f85c9480c8f0d89d58a.svg"},4938:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_colonist_coin.b8299b0a0e207b09b5fa.svg"},4945:(e,t,s)=>{"use strict";e.exports=s.p+"assets/gold.a55b7d71ce877c25fdc3.svg"},5059:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_politics_back.fb615bb90ce2c66fe346.svg"},5124:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_reconnect.7b7e2abb7694621b904f.mp3"},5144:(e,t,s)=>{"use strict";s.d(t,{d$:()=>o,qy:()=>a});var i=s(63359),n=s(68924),r=s(55935),o=function(e){return e[e.InitialPlacement=0]="InitialPlacement",e[e.Dice=1]="Dice",e[e.Turn=2]="Turn",e[e.GameEnd=3]="GameEnd",e[e.SpecialBuildPhase=4]="SpecialBuildPhase",e}({}),a=function(e){return e[e.None=0]="None",e[e.InitialPlacementPlaceSettlement=1]="InitialPlacementPlaceSettlement",e[e.InitialPlacementPlaceCity=2]="InitialPlacementPlaceCity",e[e.InitialPlacementRoadPlacement=3]="InitialPlacementRoadPlacement",e[e.PlaceRoad=4]="PlaceRoad",e[e.PlaceRoadForFree=5]="PlaceRoadForFree",e[e.PlaceSettlement=6]="PlaceSettlement",e[e.PlaceCity=7]="PlaceCity",e[e.PlaceCityWithDiscount=8]="PlaceCityWithDiscount",e[e.PlaceShip=9]="PlaceShip",e[e.PlaceShipForFree=10]="PlaceShipForFree",e[e.SelectShipToMove=11]="SelectShipToMove",e[e.MoveShip=12]="MoveShip",e[e.PlaceCityWall=13]="PlaceCityWall",e[e.PlaceCityWallForFree=14]="PlaceCityWallForFree",e[e.PlaceKnight=15]="PlaceKnight",e[e.PlaceKnightForFree=16]="PlaceKnightForFree",e[e.UpgradeKnight=17]="UpgradeKnight",e[e.UpgradeKnightForFree=18]="UpgradeKnightForFree",e[e.ActivateKnight=19]="ActivateKnight",e[e.SelectKnightToTakeAction=20]="SelectKnightToTakeAction",e[e.SelectKnightAction=21]="SelectKnightAction",e[e.MoveKnightOffTurn=22]="MoveKnightOffTurn",e[e.SelectKnightToRemove=23]="SelectKnightToRemove",e[e.PlaceRobberOrPirate=24]="PlaceRobberOrPirate",e[e.PlaceRobberOnly=25]="PlaceRobberOnly",e[e.PlacePirateOnly=26]="PlacePirateOnly",e[e.SelectWhoToRob=27]="SelectWhoToRob",e[e.SelectCardsToDiscard=28]="SelectCardsToDiscard",e[e.SelectProgressCardsToDiscard=29]="SelectProgressCardsToDiscard",e[e.Place2MoreRoadBuilding=30]="Place2MoreRoadBuilding",e[e.Place1MoreRoadBuilding=31]="Place1MoreRoadBuilding",e[e.Select2ResourcesForYearOfPlenty=32]="Select2ResourcesForYearOfPlenty",e[e.Select1ResourceForMonopoly=33]="Select1ResourceForMonopoly",e[e.SelectCardsForPendingDistributions=34]="SelectCardsForPendingDistributions",e[e.PlaceMetropolis=35]="PlaceMetropolis",e[e.SelectProgressCard=36]="SelectProgressCard",e[e.SelectCityToPillage=37]="SelectCityToPillage",e[e.PlaceMerchant=38]="PlaceMerchant",e[e.SelectDiceForAlchemist=39]="SelectDiceForAlchemist",e[e.SelectTileProductionNumbersToSwap=40]="SelectTileProductionNumbersToSwap",e[e.SelectPlayerForDeserter=41]="SelectPlayerForDeserter",e[e.SelectRoadToRemove=42]="SelectRoadToRemove",e[e.DiplomatSelectWhetherToPlaceNewEdgePiece=43]="DiplomatSelectWhetherToPlaceNewEdgePiece",e[e.IntrigueSelectKnightToMove=44]="IntrigueSelectKnightToMove",e[e.SpySelectPlayer=45]="SpySelectPlayer",e[e.SpySelectProgressCard=46]="SpySelectProgressCard",e[e.SelectCardsForWedding=47]="SelectCardsForWedding",e[e.CommercialHarborSelectPlayerAndResource=48]="CommercialHarborSelectPlayerAndResource",e[e.CommercialHarborOpponentSelectsCard=49]="CommercialHarborOpponentSelectsCard",e[e.MasterMerchantSelectPlayer=50]="MasterMerchantSelectPlayer",e[e.MasterMerchantSelectCards=51]="MasterMerchantSelectCards",e[e.MerchantFleetSelectResource=52]="MerchantFleetSelectResource",e[e.ResourceMonopolySelectResource=53]="ResourceMonopolySelectResource",e[e.CommodityMonopolySelectResource=54]="CommodityMonopolySelectResource",e}({});const c=i.Ikc({completedTurns:i.aig().int().nonnegative(),turnState:i.k5n(o),actionState:i.k5n(a),currentTurnPlayerColor:i.k5n(r.DS),startTime:i.aig().min(0),allocatedTime:i.aig()}).strict();(0,n.e)(c)},5161:(e,t,s)=>{"use strict";s.d(t,{fx:()=>n,l6:()=>i});const i=517!=s.j?["beginner","baseBots","rushBots","casual1v1","casual4p","shuffle","ranked1v1","ranked4p","rankedRush","rankedCitiesAndKnights"]:null,n=517!=s.j?["easy","medium","hard"]:null},5201:(e,t,s)=>{"use strict";s.d(t,{z:()=>a});var i=s(18587),n=s(81888),r=s(81431),o=s(36872);class a{static startFlowRecording(e){this.init(),null!=this.posthogPromise&&(this.activeFlow=e,this.registerFlowRecordingStart())}static stopFlowRecording(){null!=this.posthogPromise&&(this.activeFlow=void 0,this.stopRecording())}static captureEvent(e,t){this.init(),null!=this.posthogPromise&&this.captureIdentifiedEvent(e,t)}static init(){var e;""!=i.r.posthogKey&&(i.r.isUserOnMobileAppOrWeb&&((0,r.H)()||(null!==(e=this.posthogPromise)&&void 0!==e||(this.posthogPromise=this.loadAndInitialize()),this.identifyPromise=this.identifyUser())))}
1static async registerFlowRecordingStart(){if(null==this.posthogPromise)return;const e=await this.posthogPromise;e.onFeatureFlags(()=>this.startRecordingIfFlowEnabled(e))}static async stopRecording(){if(null==this.posthogPromise)return;(await this.posthogPromise).stopSessionRecording()}static async captureIdentifiedEvent(e,t){if(null==this.posthogPromise)return;const s=await this.posthogPromise;await this.identifyPromise,s.capture(e,{...this.getExperimentVariantProperties(),...t})}static getExperimentVariantProperties(){const e=Object.entries(n._.abTests);return Object.fromEntries(e.map(([e,t])=>[`$feature/${e}`,t]))}static async loadAndInitialize(){const{posthog:e}=await s.e(745).then(s.bind(s,35192));return e.init(i.r.posthogKey,{api_host:i.r.posthogHost,autocapture:!1,capture_pageview:!1,capture_pageleave:!1,disable_session_recording:!0}),e}static async identifyUser(){if(null==this.posthogPromise)return;if(await n._.waitUntilFresh,null==n._.userState)return;const e=await this.posthogPromise,t=this.getUserProperties(n._.userState);e.identify(n._.userState.id,t),e.register(t)}static getUserProperties(e){const t=Object.entries(n._.abTests),s=Object.fromEntries(t.map(([e,t])=>[`abTest_${e}`,t])),r=e.items.membership;return{username:e.username,isLoggedIn:e.isLoggedIn,membership:null==r?"None":o.Qb[r],totalCompletedGameCount:e.totalCompletedGameCount,isUserOnMobileAppOrWeb:i.r.isUserOnMobileAppOrWeb,isUserOnMobileWebBrowser:i.r.isUserOnMobileWebBrowser,isUserOnTabletApp:i.r.isUserOnTabletApp,...s}}static startRecordingIfFlowEnabled(e){null!=this.activeFlow&&1==e.isFeatureEnabled(this.getFlowFlagKey(this.activeFlow))&&e.startSessionRecording()}static getFlowFlagKey(e){return`session-replay-${e}`}}},5877:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_rush_10_min.415e9de6606f12ad49d7.png"},5895:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_membership_incentive.a8908e88cad32a32dd24.svg"},6218:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_profile_ranked.bb756445fe0a551ed281.svg"},6236:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_playtime.63e007ba9dc3dbe892df.svg"},6818:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_inactive_black.456cd3704a8bcde5defd.svg"},6822:(e,t,s)=>{"use strict";s.d(t,{Hs:()=>u,RC:()=>g,er:()=>p,pA:()=>m,zl:()=>h});var i=s(46581),n=s(46507),r=s(72239),o=s(44529);const a="beginner",c={easy:i.R1.BotEasy,medium:i.R1.BotMedium,hard:i.R1.BotHard},{leftToRight:l,rightToLeft:d}=r.BF.createBidirectionalRecord([["beginner",i._M.BeginnerMode],["baseBots",i._M.Classic],["rushBots",i._M.ColonistRush],["casual1v1",i.Nw.UnrankedClassic1v1],["casual4p",i.Nw.UnrankedClassic4P],["shuffle",i.Nw.UnrankedShuffle],["ranked1v1",i.Nw.RankedClassic1v1],["ranked4p",i.Nw.RankedClassic4P],["rankedRush",i.Nw.RankedRush4P],["rankedCitiesAndKnights",i.Nw.RankedCitiesAndKnights4P]]);function u(e){return l[e.modeId]}function h(e){var t;const s=null===(t=o.p.getLastModeSelectorSelection())||void 0===t?void 0:t.variantIdByMode;return function(e){return Object.hasOwn(d,e)}(e)?{modeId:d[e],variantIdByMode:s}:{modeId:a,variantIdByMode:s}}function p(e){if(!("baseBots"==e.modeId||"rushBots"==e.modeId))return;const t=(0,n.Np)(e,e.modeId);return null!=t?c[t]:void 0}function m(){var e;return null!==(e=o.p.getLastModeSelectorSelection())&&void 0!==e?e:{modeId:a}}function g(e){o.p.setLastModeSelectorSelection(e)}},6883:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_city_destroy.72dd3de3ddb780e2fb3c.mp3"},6918:(e,t,s)=>{"use strict";e.exports=s.p+"assets/gif_remove_ads_hexedshape_gold.ac2e283eba8b8551937c.gif"},6949:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_blog.e92c013831274cf5e8c0.svg"},7099:(e,t,s)=>{"use strict";s.d(t,{T:()=>C});var i=s(67908),n=s(87290),r=s(22194),o=s(81888),a=s(655),c=s(32398),l=s(13359),d=s(9029),u=s(59200),h=s(72589),p=s(61114);class m{calculateProgressPercentage(){const e=this.seasonProgress.demotionDivisionBoundary.boundary,t=this.seasonProgress.promotionDivisionBoundary.boundary;
1return h.c.calculatePercentage(Number(this.currentSkill),e,t)}fillProgressBar(e){this.progressBarDiv.style.width=`${e}%`,this.progressBarDiv.style.backgroundColor=p.i.getColor(p.i.Color.GreenDark)}constructor(e,t,s){this.progressBarIdBase="ranked_progress_bar",this.seasonProgress=e,this.currentSkill=t,this.progressBarContainerDiv=(0,d.Le)(s,`${this.progressBarIdBase}_container`),this.progressBarDiv=(0,d.Le)(this.progressBarContainerDiv,this.progressBarIdBase);const i=this.calculateProgressPercentage();this.fillProgressBar(i)}}var g=s(70908),f=s(35883),y=s(55547),v=s(13618),S=s(72046),b=s(16611);class C{set username(e){this._username=e}static setPlayNowButtonClickHandlers(){const e=document.getElementsByClassName("ranked-play-now");for(const t of e)(0,d.G0)(t,()=>{y.P_.handleUrlRedirectViaParameters(l.T.EnterMatchmaking,t.dataset.matchmakingType)},!1,!0)}async fetchRankedDataForSelectedSeason(e){const t=await a.m.getRequestHandler(c.l.apiUserProfile.ranked(this._username),e.toString());if(null!=t){this.rankedData=t.json;for(const e of this.rankedData)null!=e.currentRankedState&&(e.currentRankedState=r.Gb.deserialize(e.currentRankedState));this.isSelectionCurrentSeason=e==this.currentSeason,this.setRankedDataUI()}}setRankedDataUI(){this.hackyLogicToHideAllCards();for(const e of this.rankedData){const t=this.getRankedModeString(e.modeType);if(!t)return;const s=(0,S.F)(`ranked_mode_player_info_card_${t}`,this.isPopup),i=document.getElementById(s);i.hidden=!1,this.createClickEventToRouteToLeaderboard(i,e.modeType),C.updatePlayNowVisibility(i,e.isLiveSeasonMode);const n=(0,S.F)(`ranked_mode_player_stats_${t}_container`,this.isPopup),r=document.getElementById(n);r.replaceChildren();const o=(0,S.F)(`${this.progressContainerIdBase}_${t}_container`,this.isPopup),a=document.getElementById(o);a.replaceChildren(),null!=e.currentRankedState?this.displayCurrentSeasonState(e,a):this.populatePastSeasonProgress(e,a),this.populateBasicStats(e,r),this.populateRankingStats(e,r)}}hackyLogicToHideAllCards(){const e=[this.baseGameIdentifier,this.oneVersusOneIdentifier,this.citiesAndKnightsIdentifier,this.rushIdentifier];for(const t of e){const e=(0,S.F)(`ranked_mode_player_info_card_${t}`,this.isPopup);document.getElementById(e).hidden=!0}}displayCurrentSeasonState(e,t){if(null!=e.currentRankedState)switch(e.currentRankedState.type){case r.Ob.RankedLocked:this.displayRankedLocked(e.currentRankedState,t);break;case r.Ob.Placement:var s;this.displayRankedPlacementState(e.currentRankedState,t),(null===(s=o._.userState)||void 0===s?void 0:s.username)==decodeURIComponent(this._username)&&this.createPlayNowLink(e,t);break;case r.Ob.Ranked:e.division!=n.os.None&&this.createDivisionIcon(e.division,e.subdivision,t),C.displayRankedProgressBar(e.currentRankedState,t)}}displayRankedLocked(e,t){const s=(0,d.Le)(t,""),i=e.getFindGamePopupStatusText();s.innerText=g.a7.t(i.key,i.options)}displayRankedPlacementState(e,t){const s=(0,d.Le)(t,""),i=e.getFindGamePopupStatusText();s.innerText=g.a7.t(i.key,i.options)}static displayRankedProgressBar(e,t){new m(e.currentDivisionState,e.currentMMR,t)}populatePastSeasonProgress(e,t){e.division==n.os.None?this.createNoGamesPlayedText(t):this.createDivisionIcon(e.division,e.subdivision,t)}createDivisionIcon(e,t,s){const i=(0,d.Le)(s,""),r=f.j.getRankedDivisionImage(e);(0,d.zO)(i,r);const o=f.j.getRankedSubdivisionImage(t);null!=o&&(0,d.zO)(i,o);const a=(0,d.Le)(s,""),c=t==n.Yt.None?"":n.Yt[t];a.innerText=`${n.os[e]} ${c}`}getRankedModeString(e){switch(e){case i.Wz.Classic4P:return this.baseGameIdentifier;case i.Wz.Classic1v1:return this.oneVersusOneIdentifier;case i.Wz.CitiesAndKnights4P:return this.citiesAndKnightsIdentifier;case i.Wz.Rush4P:return this.rushIdentifier;default:return""}}populateBasicStats(e,t){const s="-"==e.winRate?e.winRate:`${e.winRate}%`;this.createStatDiv(t,{key:"strings:leaderboardPage.tableHeaders.rating"},e.skillRating),this.createStatDiv(t,{key:"strings:leaderboardPage.tableHeaders.games"},e.gamesPlayed),this.createStatDiv(t,{key:"strings:leaderboardPage.tableHeaders.winPercentage"},s)}
1populateRankingStats(e,t){e.rankedStanding.forEach(e=>{this.createRankingStatsForRegionalStanding(e,t)})}createRankingStatsForRegionalStanding(e,t){const s=("-"!=e.rank?"#":"")+e.rank,i=u.f.tLeaderboardTabName(e.name);this.createStatDiv(t,{key:"strings:colonistCommon.utils.#buffer",options:{value:i}},s)}createStatDiv(e,t,s){const i=(0,d.Le)(e,this.statContainerClass),n=(0,d.Le)(i,""),r=(0,d.Le)(i,"ranked_mode_player_stat_value");n.innerText=g.a7.t(t.key,t.options),r.innerText=s}createPlayNowLink(e,t){const s=(0,d.cE)(t,"",this.playNowLinkText,"");(0,d.G0)(s,()=>{b.A9.play(b.hc.Click),y.P_.handleUrlRedirectViaParameters(l.T.EnterMatchmaking,e.matchmakingRedirectType)},!0,!0)}createNoGamesPlayedText(e){(0,d.Le)(e,"").innerText=g.a7.t(this.noGamesPlayedText.key,this.noGamesPlayedText.options)}static updatePlayNowVisibility(e,t){const s=e.getElementsByClassName("ranked-play-now")[0];null!=s&&s.classList.toggle("hidden",!t)}createClickEventToRouteToLeaderboard(e,t){if(!this.isSelectionCurrentSeason)return(0,d.G0)(e,()=>{}),void(e.style.cursor="default");e.style.cursor="pointer",(0,d.G0)(e,()=>(0,v.Yf)(`/leaderboards/${i.Wz[t]}`))}constructor(e,t=!1){this.progressContainerIdBase="ranked_mode_player_progress",this.baseGameIdentifier="base",this.oneVersusOneIdentifier="1v1",this.citiesAndKnightsIdentifier="citiesandknights",this.rushIdentifier="rush",this.statContainerClass="ranked_mode_player_stat",this.playNowLinkText={key:"strings:colonistCommon.rankedState.playNow"},this.noGamesPlayedText={key:"strings:colonistCommon.rankedState.noGamesPlayed"},this._username=e,this.isPopup=t,C.setPlayNowButtonClickHandlers()}}},7136:(e,t,s)=>{"use strict";s.d(t,{_:()=>u,zo:()=>y});var i=s(63359),n=s(13567),r=s(87952),o=s(68924),a=s(55935);if(!/^(251|517|837)$/.test(s.j))var c=s(65223);var l=s(66710),d=s(72239),u=function(e){return e[e.PendingResponse=0]="PendingResponse",e[e.Accepted=1]="Accepted",e[e.Rejected=2]="Rejected",e[e.Embargoed=3]="Embargoed",e}({});const h=d.h4.getEnumValues(a.DS),p=i.Ikc({id:l.j.readonly(),creator:i.k5n(a.DS).readonly(),offeredResources:i.YOg(i.k5n(n.O3)).readonly(),wantedResources:i.YOg(i.k5n(n.O3)).readonly(),counterOfferInResponseToTradeId:l.j.nullable().optional().readonly(),playersCreatingCounterOffer:(0,r.Qc)(h,i.zMY()).readonly(),playerResponses:(0,r.Qc)(h,i.k5n(u)).readonly(),forcedResponse:i.k5n(u).readonly().exactOptional()}).strict(),m=p;(0,r.Jg)(m);const g=(0,o.e)(p),f=i.KCZ([g,i.chJ()]);(0,r.Jg)(f,{requireAtLeastOneEntry:!0});function y(e){return(t=e,(0,c.o)(m,t)).success;var t}},7325:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_pause.c6627a2537c5b015d64b.svg"},7572:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_devcard_used.e75cc2960b64df57b35a.mp3"},7597:(e,t,s)=>{"use strict";s.d(t,{j:()=>n});var i=s(55436);function n(e,t,s){if(null==t)return;const n=(0,i.i)(e.map(e=>e.membershipProduct),t,s);for(const t of e){const e=n.get(t.membershipProduct.type);null!=e&&r(t,e)}}function r(e,t){return"manage"==t?e.changeToManageButton():"upgrade"==t?e.changeToUpgradeButton():"downgrade"==t?e.changeToDowngradeButton():"goAnnual"==t?e.changeToGoAnnualButton():"owned"==t?e.changeToOwnedButton():"cancelGift"==t?e.changeToCancelButton():"none"==t?e.removeButton():void 0}},7893:(e,t,s)=>{"use strict";s.d(t,{y:()=>l});var i=s(71763),n=s(26122);if(517!=s.j)var r=s(46196);var o=s(28844),a=s(70908),c=s(50200);const l=(e,t)=>{const s=document.getElementById(e);if(!s)throw new Error(`Container with id ${e} not found`);const l=(0,n.createRoot)(s),d=(0,c.c)();return{render:e=>{l.render(i.createElement(r.x,{i18n:a.a7.instance},i.createElement(o.DialogManagerProvider,null,i.createElement(o.VliAdProvider,{store:d},i.createElement(t,e)))))},unmount:()=>l.unmount()}}},7894:(e,t,s)=>{"use strict";s.d(t,{q:()=>r});var i=s(46507);const n=(0,s(11445).K)(i.DY);function r(e){n(e)}},8322:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_halloween.ad0b97f44c3d24d88fb4.png"},8399:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_x.5efbc794816c7abe462b.svg"},8764:(e,t,s)=>{"use strict";s.d(t,{Y:()=>l});var i=s(36872),n=s(81888),r=s(13160),o=s(18587),a=s(96990);const c=250;function l(){var e;if(!(a.N.isUserOnIOSApp()?o.r.shouldEnableNativeIOSPaymentsOnMobile:a.N.isUserOnAndroidApp()&&o.r.shouldEnableNativeAndroidPaymentsOnMobile))return!1;const t=(null===(e=n._.userState)||void 0===e?void 0:e.accessLevel)==i.hx.User;if(o.r.shouldDisableIAPForExternalUsersOnMobile&&t)return!1;var s;return(null!==(s=r.I.getBuildNumber())&&void 0!==s?s:0)>=c}},8842:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_vietnam_preview.a97a9b801e05e7318479.png"},8878:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_wall_blue.b8235dda6d4fa0ab26cf.svg"},9029:(e,t,s)=>{"use strict";s.d(t,{Dg:()=>y,Ey:()=>R,G0:()=>L,Kr:()=>A,Le:()=>h,M3:()=>g,RH:()=>E,Sw:()=>l,Tl:()=>
1o,Tw:()=>_,WL:()=>k,Wr:()=>b,Z3:()=>v,aW:()=>f,cE:()=>C,fc:()=>u,fg:()=>T,gX:()=>m,i5:()=>p,i9:()=>a,n8:()=>S,oB:()=>D,t2:()=>I,uk:()=>M,w8:()=>w,xW:()=>d,zO:()=>P});var i=s(70908),n=s(17399),r=s(96990);let o;function a(e){o=e}function c(e,t,s,i){e.className=s,e.id=i,t.appendChild(e)}function l(e,t){const s=document.createElement("DIV");return void 0!==e&&(s.className=e),void 0!==t&&(s.id=t),s}function d(e,t){const s=document.createElement("script");return s.src=t,c(s,e,"",""),s}function u(e,t){null==document.querySelector(`script[src="${t}"]`)&&d(e,t)}function h(e,t,s=""){const i=document.createElement("DIV");return c(i,e,t,s),i}function p(e,t,s){const i=document.createElement("SPAN");return E(i,s),c(i,e,t,""),i}function m(e,t,s=""){const i=document.createElement("FORM");return c(i,e,t,s),i}function g(e,t,s=""){const i=document.createElement("INPUT");return c(i,e,t,s),i}function f(e,t,s=""){const i=document.createElement("TEXTAREA");return c(i,e,t,s),i}function y(e,t,s="",i,n,r,o){const a=document.createElement("INPUT");return a.type="range",a.min=i.toString(),a.max=n.toString(),a.step=r.toString(),a.value=o.toString(),c(a,e,t,s),a}function v(e,t,s="",i){const n=g(e,t,s);return n.type="checkbox",n.onclick=i,n}function S(e,t,s,i="",n="H3"){const r=document.createElement(n);return E(r,t),c(r,e,s,i),r}function b(e,t,s,i=""){const n=document.createElement("P");return E(n,t),c(n,e,s,i),n}function C(e,t,s,i,n="",r=!1){const o=document.createElement("A");return E(o,s),o.href=t,r&&(o.target="_blank"),c(o,e,i,n),o}function P(e,t,s="",i="",r){const o=document.createElement("IMG");return _(o,t),null!=(null==r?void 0:r.loading)&&(o.loading=r.loading),o.src=(0,n.tu)(t),c(o,e,s,i),o}function k(e,t,s,i="",n){const r=document.createElement("IMG");return r.alt=o(s.key,s.options),null!=(null==n?void 0:n.loading)&&(r.loading=n.loading),r.src=t,c(r,e,i,""),r}function T(e,t,s,i=!1){const n=document.createElement("OPTION");return e.appendChild(n),n.value=t,n.innerText=o(s.key,s.options),n.selected=i,n}function A(e,t,s="",i){const n=document.createElement("SELECT");return n.onchange=()=>{i(n.value)},c(n,e,t,s),n}function R(e,t,s){const i=document.createElement("BUTTON");return E(i,s),c(i,e,t,""),i}function w(e,t,s,i,n=""){const r=document.createElement("IFRAME");return r.width=t,r.height=s,r.src=i,r.frameBorder="0",c(r,e,n,""),r}function I(e,t,s,i=""){const n=document.createElement("LI");return E(n,t),c(n,e,s,i),n}function M(e,t,s=""){const i=document.createElement("UL");return c(i,e,t,s),i}function _(e,t){const s=(0,n.rV)(t);e.alt=o(s.key,s.options)}function E(e,t){var s;const i="strings:colonistCommon.utils.#buffer"===t.key?null===(s=t.options)||void 0===s?void 0:s.value:o(t.key,t.options);e.innerHTML=i}function D(e,t){var s;const n="strings:colonistCommon.utils.#buffer"===t.key?null===(s=t.options)||void 0===s?void 0:s.value:i.a7.t(t.key,t.options);e.innerText=n}function L(e,t,s=!1,i=!1){const n="ontouchstart"in window||navigator.maxTouchPoints>0;if(r.N.isUserOnMobileWebview()&&!r.N.isCypressTest()&&n){const s=5;let n,r;return e.ontouchstart=e=>{const t=e.touches[0];n=t.clientX,r=t.clientY},e.ontouchend=async e=>{const o=e.changedTouches[0],a=Math.abs(o.clientX-n),c=Math.abs(o.clientY-r);a>s||c>s||(e.preventDefault(),i&&e.stopPropagation(),await t(e))},void(e.style.transition="all 0s")}e.onclick=async e=>{s&&e.preventDefault(),i&&e.stopPropagation(),await t(e)}}},9108:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_avocado.329e70a52777393b5aab.svg"},9127:(e,t,s)=>{"use strict";s.d(t,{P7:()=>n,WA:()=>i});var i=function(e){return e[e.Offline=0]="Offline",e[e.OnlineAndIdle=1]="OnlineAndIdle",e[e.InRoom=2]="InRoom",e[e.InGame=3]="InGame",e}({}),n=function(e){return e[e.RegisterToFriendService=1]="RegisterToFriendService",e[e.ChangeOnlineStatus=2]="ChangeOnlineStatus",e[e.GetAllFriendsOnlineStatus=3]="GetAllFriendsOnlineStatus",e[e.InviteFriendToRoom=4]="InviteFriendToRoom",e[e.GetAllRoomInvitesReceived=5]="GetAllRoomInvitesReceived",e[e.RespondToFriendRoomInvite=6]="RespondToFriendRoomInvite",e[e.GetNotifications=7]="GetNotifications",e[e.MarkNotificationAsRead=8]="MarkNotificationAsRead",e[e.MarkAllNotificationsAsRead=9]="MarkAllNotificationsAsRead",e[e.RegisterToNotificationService=10]="RegisterToNotificationService",e}({})},9401:(e,t,s)=>{"use strict";e.exports=s.p+"assets/grandmaster.abb26f73ab2d7952e22f.svg"},9440:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_google_color.6ce9a9c7990769926caa.svg"},9511:(e,t,s)=>{"use strict";s.d(t,{S:()=>is});var i=s(55547),n=s(66935),r=s(46235),o=s(31530),a=s(18587),c=s(55935),l=s(13567),d=s(37183),u=s(23789),h=s(34405),p=s(72611),m=s(65944),g=s(18797),f=s(45901),y=s(10534);const v=s.p+"assets/generated_tile_lumber.ce98887f6f467e76852f.svg",S=s.p+"assets/generated_tile_brick.fd5dbb845772bdeba45b.svg",b=s.p+"assets/generated_tile_wool.29bcdda6873893e2a506.svg",C=s.p+"assets/generated_tile_grain.50fd57746befab85ea35.svg",P=s.p+"assets/generated_tile_ore.1b4024908dfb91c65232.svg",k=s.p+"assets/generated_tile_desert.9e169062cabe58886069.svg";var T=s(79080),A=s(72957),R=s(23153),w=s(45859),I=s(64323),M=s(33555),_=s(23201),E=s(62302),D=s(89544),L=s(41901),B=s(79824),x=s(12908),O=s(90878),G=s(89173),F=s(46771),U=s(1714),N=s(48266),H=s(47609),K=s(51839),W=s(99059),V=s(88112),q=s(66730),Q=s(23566),j=s(84317),z=s(10297),$=s(30762),Y=s(1176),Z=s(68282),J=s(92626),X=s(83078),ee=s(21018),te=s(38774),se=s(89844),ie=s(73324),ne=s(45023),re=s(23918),oe=s(49265),ae=s(86464),ce=s(57363),le=s(92712),de=s(43451),ue=s(83082),he=s(89941),pe=s(17332),me=s(81895),ge=s(88478),fe=s(84486),ye=s(37642),ve=s(30081),Se=s(16647),be=s(77110),Ce=s(60793),Pe=s(79048),ke=s(60411),Te=s(86717),Ae=s(74524),Re=s(76812),we=s(75757),Ie=s(27406);const Me=s.p+"assets/partition.cca3c23ac8acfc934563.svg";var _e=s(491);const Ee=s.p+"assets/knight_level2_active_black.aec38adee7733dbe83aa.svg",De=s.p+"assets/knight_level3_active_black.335bf8306220ded73f98.svg";var Le=s(6818);const Be=s.p+"assets/knight_level2_inactive_black.08f9bfe34007a874e224.svg",xe=s.p+"assets/knight_level3_inactive_black.022103aa9d59dbe1f3c1.svg";var Oe=s(64458);const Ge=s.p+"assets/knight_level2_active_blue.ca3204eb4c318025f966.svg",Fe=s.p+"assets/knight_level3_active_blue.5e9d46ade18b568fbdfb.svg";var Ue=s(61193);const Ne=s.p+"assets/knight_level2_inactive_blue.ff296956aa880c833971.svg",He=s.p+"assets/knight_level3_inactive_blue.33b844b15d7855d456fc.svg";var Ke=s(53142);const We=s.p+"assets/knight_level2_active_bronze.39966c740c2f7c365441.svg",Ve=s.p+"assets/knight_level3_active_bronze.1f27fe71a7f7111db136.svg";var qe=s(11773);const Qe=s.p+"assets/knight_level2_inactive_bronze.fdd25be6764e9a2ba506.svg",je=s.p+"assets/knight_level3_inactive_bronze.f64a490e885c953a8313.svg";var ze=s(3700);const $e=s.p+"assets/knight_level2_active_gold.fd0f150fd4f1b74158fe.svg",Ye=s.p+"assets/knight_level3_active_gold.66e90d2385b08a2067a9.svg";var Ze=s(32663);const Je=s.p+"assets/knight_level2_inactive_gold.8559e5a1a627c50f3f1a.svg",Xe=s.p+"assets/knight_level3_inactive_gold.8459950c30f93475e3dd.svg";var et=s(89179);const tt=s.p+"assets/knight_level2_active_green.4b67db78179d9a5dba61.svg",st=s.p+"assets/knight_level3_active_green.c401f232f96ec0d865a9.svg";var it=s(47538);const nt=s.p+"assets/knight_level2_inactive_green.b9a84fd630fde5f35c74.svg",rt=s.p+"assets/knight_level3_inactive_green.63dd288c2b5af25f7b12.svg";var ot=s(32741);const at=s.p+"assets/knight_level2_active_mysticblue.73c1edbfc553b6aee053.svg",ct=s.p+"assets/knight_level3_active_mysticblue.09cff65e3f877a4e0454.svg";var lt=s(14466);const dt=s.p+"assets/knight_level2_inactive_mysticblue.f7ef914ca48e6e129577.svg",ut=s.p+"assets/knight_level3_inactive_mysticblue.1b5ad7787cca0d9eed86.svg";var ht=s(9808);const pt=s.p+"assets/knight_level2_active_orange.313f9dfe6c0b690e4cf3.svg",mt=s.p+"assets/knight_level3_active_orange.620a1e78ac42cf8d028b.svg";var gt=s(73023);
1const ft=s.p+"assets/knight_level2_inactive_orange.8073cf6b89d7fb1b11a5.svg",yt=s.p+"assets/knight_level3_inactive_orange.6229d6bec541151d67b1.svg";var vt=s(80420);const St=s.p+"assets/knight_level2_active_purple.4523de6a93e37eedb387.svg",bt=s.p+"assets/knight_level3_active_purple.fd82776714c1af47b918.svg";var Ct=s(77999);const Pt=s.p+"assets/knight_level2_inactive_purple.3d6e8b963cd33e9598c6.svg",kt=s.p+"assets/knight_level3_inactive_purple.37c5afca6cc0bb1559ab.svg";var Tt=s(72311);const At=s.p+"assets/knight_level2_active_red.960feab109087323c0ce.svg",Rt=s.p+"assets/knight_level3_active_red.faf1f9a50b1bc6b4aefc.svg";var wt=s(75602);const It=s.p+"assets/knight_level2_inactive_red.f578ea3432e602160c56.svg",Mt=s.p+"assets/knight_level3_inactive_red.77914d75bedd26be9b79.svg";var _t=s(62945);const Et=s.p+"assets/knight_level2_active_silver.f8b02a8e24623ade4982.svg",Dt=s.p+"assets/knight_level3_active_silver.3942cce527e142b913e4.svg";var Lt=s(88834);const Bt=s.p+"assets/knight_level2_inactive_silver.ade9b5b8cc2772da5ced.svg",xt=s.p+"assets/knight_level3_inactive_silver.8f0ad58e14b864c3abc9.svg";var Ot=s(56145);const Gt=s.p+"assets/knight_level2_active_white.cb4f2c63ad406b9bd089.svg",Ft=s.p+"assets/knight_level3_active_white.38e5fde3a5d85e238aaa.svg";var Ut=s(70248);const Nt=s.p+"assets/knight_level2_inactive_white.d08e76a3871a9e6ff9e1.svg",Ht=s.p+"assets/knight_level3_inactive_white.7f89ea17cb06cee0f6ae.svg";var Kt=s(57566);const Wt=s.p+"assets/knight_level2_active_pink.e490bdcce900686629a7.svg",Vt=s.p+"assets/knight_level3_active_pink.152fabe7bf7787e6b4e6.svg";var qt=s(73461);const Qt=s.p+"assets/knight_level2_inactive_pink.cf0e3addcad4cc996b9b.svg",jt=s.p+"assets/knight_level3_inactive_pink.6cab8466546cf52d4ae8.svg",zt=s.p+"assets/icon_square_framed_politics.ecd63a7de3319a5288e6.svg",$t=s.p+"assets/icon_square_framed_science.b51de4dedc05486569fb.svg",Yt=s.p+"assets/icon_square_framed_trade.28d7d5a642a8086def22.svg";var Zt=s(35883),Jt=s(72239),Xt=s(73052),es=s(33825),ts=s(61114),ss=s(70908);class is{static replaceKeywordsWithImages(e){var t;const s=null!==(t=this.getPlayerColorFromText(e))&&void 0!==t?t:c.DS.Red,i=this.getImageMapObject(s),n=this.getImageDictionaryRegex(s),r=this.regexToMatchUsername(),o=new RegExp(`(${r.source}|${n.source})`,"gi");return e.replace(o,e=>{if(r.test(e))return e;const t=e.toLowerCase();var s;return null!==(s=i[t])&&void 0!==s?s:e})}static colorAndBoldUsernames(e){const t=is.regexToMatchUsername();return e.replace(t,e=>this.getHighlightedUsername(e))}static getHighlightedUsername(e){e=is.stripPlayerMarkers(e);return'<span style="font-weight:600;word-break:break-all;color:'+is.getTextColor(is.getUsernameCorrectCapitalization(e),ts.i.getColor(ts.i.Color.White))+'">'+e+"</span>"}static getUsernameCorrectCapitalization(e){var t;return null!==(t=is.getUsernameList().find(t=>t.toLowerCase()==e.toLowerCase()))&&void 0!==t?t:""}static getImageDictionaryRegex(e){if(null!=this.imageDictionaryRegex)return this.imageDictionaryRegex;const t=Object.keys(this.getImageMapObject(e)),s=this.regexToMatchOneOfList(t);return this.imageDictionaryRegex=s,s}static getTextColor(e,t){const s=this.getPlayerColorFromText(e);return null!=s?a.r.isUserOnMobileAppOrWeb?ts.i.getPlayerBGDarkHashForMobile(s):ts.i.getPlayerBGDarkHash(s):t}static getUsernameList(){var e,t;return(null===i.sZ||void 0===i.sZ||null===(e=i.sZ.gameListener.gameState)||void 0===e?void 0:e.players.length)>0?i.sZ.gameListener.gameState.players.map(e=>e.username):null!=(null===i.sZ||void 0===i.sZ||null===(t=i.sZ.lobbyListener.room)||void 0===t?void 0:t.getUsernames())?i.sZ.lobbyListener.room.getUsernames():[]}static stripPlayerMarkers(e){return(null!=e?e:"").replaceAll(n.Cv,"").replaceAll(n.fQ,"")}static regexToMatchUsername(){const e=this.getUsernameList().map(e=>`(?:${n.Cv}|\\b)${(0,r.A)(e)}(?:${n.fQ}|\\b)`);return is.regexToMatchOneOfList(e)}static regexToMatchOneOfList(e){const t=e.join("|");return new RegExp(t,"gi")}static getPlayers(){var e;return null===i.sZ||void 0===i.sZ||null===(e=i.sZ.gameListener.gameState)||void 0===e?void 0:e.players}static getPlayerColorFromText(e){let t=-1,s=-1,i=c.DS.Red;const n=this.getPlayers();if(void 0!==n){for(const r of n){const n=is.getTextIndexForPlayer(e,r);if(-1==n)continue;const o=n<t,a=n==t&&r.username.length>s;(-1==t||o||a)&&(t=n,s=r.username.length,i=r.color)}return-1==t?void 0:i}}static getTextIndexForPlayer(e,t){const s=e.indexOf("You"),i=t.color==c.DS.None,n=e.indexOf(t.username);return-1==n&&i?s:n}static getDebugClientText(e){if("/debug"!=e)return;return{key:"strings:colonistCommon.utils.#buffer",options:{value:":private:<br>userAgent: "+navigator.userAgent+"<br>language: "+navigator.language+"<br>cookieEnabled: "+navigator.cookieEnabled+"<br>innerHeight: "+window.innerHeight+"<br>innerWidth: "+window.innerWidth+"<br>outerHeight: "+window.outerHeight+"<br>outerWidth: "+window.outerWidth,interpolation:{escapeValue:!1}}}}static getImageMapObject(e){const t=this.playerImageMap.get(e);if(null!=t)return t;const s=this.createImageMapObject(e);return this.playerImageMap.set(e,s),s}static createImageMapObject(e){const t={lumber:rs(d,"lumber"),wood:rs(d,"woo
1d"),tree:rs(d,"wood"),timber:rs(d,"wood"),brick:rs(u,"brick"),wool:rs(h,"wool"),sheep:rs(h,"wool"),grain:rs(p,"grain"),wheat:rs(p,"grain"),paper:rs(m,"paper"),cloth:rs(g,"cloth"),coin:rs(f,"coin")," ore":" "+rs(y,"ore"),stone:rs(y,"ore"),rock:rs(y,"ore"),":tile_lumber:":os(v,"lumber tile"),":tile_brick:":os(S,"brick tile"),":tile_wool:":os(b,"wool tile"),":tile_grain:":os(C,"grain tile"),":tile_ore:":os(P,"ore tile"),":tile_desert:":os(k,"desert tile"),":tile_gold:":os(T,"gold tile"),":knight:":rs(A,"knight"),":robber:":as(R,"robber"),":pirate:":as(w,"pirate"),trophy:as(I,"trophy"),":chit:":as(M,"chit"),":largestarmy:":as(_,"largest army"),":longestroad:":as(E,"longest road"),":defenderofcolonist:":as(D,"defender of colonist"),":icon_merchant_black:":as(L,"Merchant black"),":icon_merchant_blue:":as(B,"Merchant blue"),":icon_merchant_bronze:":as(x,"Merchant bronze"),":icon_merchant_gold:":as(O,"Merchant gold"),":icon_merchant_green:":as(G,"Merchant green"),":icon_merchant_mysticblue:":as(F,"Merchant mystic blue"),":icon_merchant_orange:":as(U,"Merchant orange"),":icon_merchant_purple:":as(N,"Merchant purple"),":icon_merchant_red:":as(H,"Merchant red"),":icon_merchant_silver:":as(K,"Merchant silver"),":icon_merchant_white:":as(W,"Merchant white"),":icon_merchant_pink:":as(V,"Merchant pink"),":road:":as(Zt.j.roadsByColor[e],"road"),":ship:":as(Zt.j.shipsByColor[e],"ship"),":settlement:":as(Zt.j.settlementsByColor[e],"settlement"),":house:":as(Zt.j.settlementsByColor[e],":house:"),":city:":as(Zt.j.citiesByColor[e],"city"),":city_wall:":as(Zt.j.cityWallsByColor[e],"city wall"),":metropolis_science:":as(q,"metropolis_science"),":metropolis_trade:":as(Q,"metropolis_trade"),":metropolis_politics:":as(j,"metropolis_politics"),":private:":as(z,""),":public:":as($,""),":mail:":as(Y,""),":pack_settler:":as(Z,""),":pack_colonist:":as(J,""),":pack_founder:":as(X,""),":admin:":as(ee,""),":moderator:":as(te,""),":bot:":as(se,""),":dice:1":as(ie,"dice_1"),":dice:2":as(ne,"dice_2"),":dice:3":as(re,"dice_3"),":dice:4":as(oe,"dice_4"),":dice:5":as(ae,"dice_5"),":dice:6":as(ce,"dice_6"),":dice_red:1":as(le,"dice_red_1"),":dice_red:2":as(de,"dice_red_2"),":dice_red:3":as(ue,"dice_red_3"),":dice_red:4":as(he,"dice_red_4"),":dice_red:5":as(pe,"dice_red_5"),":dice_red:6":as(me,"dice_red_6"),":dice_event:1":as(ge,"dice_barbarian"),":dice_event:2":as(ge,"dice_barbarian"),":dice_event:3":as(ge,"dice_barbarian"),":dice_event:4":as(fe,"dice_science"),":dice_event:5":as(ye,"dice_trade"),":dice_event:6":as(ve,"dice_politics"),":prob:2":as(Se,"prob_2"),":prob:3":as(be,"prob_3"),":prob:4":as(Ce,"prob_4"),":prob:5":as(Pe,"prob_5"),":prob:6":as(ke,"prob_6"),":prob:8":as(Te,"prob_8"),":prob:9":as(Ae,"prob_9"),":prob:10":as(Re,"prob_10"),":prob:11":as(we,"prob_11"),":prob:12":as(Ie,"prob_12"),":partition:":as(Me,":partition:",.6),":knight_active_level1_black:":as(_e,"Knight"),":knight_active_level2_black:":as(Ee,"Knight"),":knight_active_level3_black:":as(De,"Knight"),":knight_inactive_level1_black:":as(Le,"Knight"),":knight_inactive_level2_black:":as(Be,"Knight"),":knight_inactive_level3_black:":as(xe,"Knight"),":knight_active_level1_blue:":as(Oe,"Knight"),":knight_active_level2_blue:":as(Ge,"Knight"),":knight_active_level3_blue:":as(Fe,"Knight"),":knight_inactive_level1_blue:":as(Ue,"Knight"),":knight_inactive_level2_blue:":as(Ne,"Knight"),":knight_inactive_level3_blue:":as(He,"Knight"),":knight_active_level1_bronze:":as(Ke,"Knight"),":knight_active_level2_bronze:":as(We,"Knight"),":knight_active_level3_bronze:":as(Ve,"Knight"),":knight_inactive_level1_bronze:":as(qe,"Knight"),":knight_inactive_level2_bronze:":as(Qe,"Knight"),":knight_inactive_level3_bronze:":as(je,"Knight"),":knight_active_level1_gold:":as(ze,"Knight"),":knight_active_level2_gold:":as($e,"Knight"),":knight_active_level3_gold:":as(Ye,"Knight"),":knight_inactive_level1_gold:":as(Ze,"Knight"),":knight_inactive_level2_gold:":as(Je,"Knight"),":knight_inactive_level3_gold:":as(Xe,"Knight"),":knight_active_level1_green:":as(et,"Knight"),":knight_active_level2_green:":as(tt,"Knight"),":knight_active_level3_green:":as(st,"Knight"),":knight_inactive_level1_green:":as(it,"Knight"),":knight_inactive_level2_green:":as(nt,"Knight"),":knight_inactive_level3_green:":as(rt,"Knight"),":knight_active_level1_mysticblue:":as(ot,"Knight"),":knight_active_level2_mysticblue:":as(at,"Knight"),":knight_active_level3_mysticblue:":as(ct,"Knight"),":knight_inactive_level1_mysticblue:":as(lt,"Knight"),":knight_inactive_level2_mysticblue:":as(dt,"Knight"),":knight_inactive_level3_mysticblue:":as(ut,"Knight"),":knight_active_level1_orange:":as(ht,"Knight"),":knight_active_level2_orange:":as(pt,"Knight"),":knight_active_level3_orange:":as(mt,"Knight"),":knight_inactive_level1_orange:":as(gt,"Knight"),":knight_inactive_level2_orange:":as(ft,"Knight"),":knight_inactive_level3_orange:":as(yt,"Knight"),":knight_active_level1_purple:":as(vt,"Knight"),":knight_active_level2_purple:":as(St,"Knight"),":knight_active_level3_purple:":as(bt,"Knight"),":knight_inactive_level1_purple:":as(Ct,"Knight"),":knight_inactive_level2_purple:":as(Pt,"Knight"),":knight_inactive_level3_purple:":as(kt,"Knight"),":knight_active_level1_red:":as(Tt,"Knight"),":knight_active_level2_red:":as(At,"Knight"),":knight_active_level3_red:":as(Rt,"Knight"),":knight_inactive_level1_red:":as(wt,"Knight"),":knight_inactive_level2_red:":as(It,"Knight"),":knight_inactive_level3_red:":as(Mt,"Knight"),":knight_active_level1_silver:":as(_t,"Knight"),":knight_active_level2_silver:":as(Et,"Knight"),":knight_active_level3_silver:":as(Dt,"Knight"),":knight_inactive_level1_silver:":as(Lt,"Knight"),":knight_inactive_level2_silver:":as(Bt,"Knight"),":knight_inactive_level3_silver:":as(xt,"Knight"),":knight_active_level1_white:":as(Ot,"Knight"),":knight_active_level2_white:":as(Gt,"Knight"),":knight_active_level3_white:":as(Ft,"Knight"),":knight_inactive_level1_white:":as(Ut,"Knight"),":knight_inactive_level2_white:":as(Nt,"Knight"),":knight_inactive_level3_white:":as(Ht,"Knight"),":knight_active_level1_pink:":as(Kt,"Knight"),":knight_active_level2_pink:":as(Wt,"Knight"),":knight_active_level3_pink:":as(Vt,"Knight"),":knight_inactive_level1_pink:":as(qt,"Knight"),":knight_inactive_level2_pink:":as(Qt,"Knight"),":knight_inactive_level3_pink:":as(jt,"Knight"),":icon_square_framed_politics:":as(zt,"politics square",.8),":icon_square_framed_science:":as($t,"science square",.8),":icon_square_framed_trade:":as(Yt,"trade square",.8)};for(const e of Jt.h4.getEnumValues(l.O3)){const s=Xt.YT[e];t[`:card_${e}:`]=rs(Xt.av[e],ss.a7.t(s.key,s.options))}return t}}is.playerImageMap=new Map,is.OPEN_RULEBOOK_LINK_HASH="#open-rulebook";const ns=20;function rs(e,t){const s='" height="'+ns+'" width="'+ns/es.k3;return'<img src="'+e+'" alt="'+(0,o.A)(t)+s+'" class="lobbyChatTextIcon">'}function os(e,t){const s='" height="'+ns+'" width="'+ns/es.Nk;return'<img src="'+e+'" alt="'+(0,o.A)(t)+s+'" class="lobbyChatTextIcon">'}function as(e,t,s=1){const i=ns*s,n='" height="'+i+'" width="'+i;return'<img src="'+e+'" alt="'+(0,o.A)(t)+n+'" class="lobbyChatTextIcon">'}},9557:(e,t,s)=>{"use strict";s.d(t,{Yh:()=>u,dF:()=>l});var i=s(50482),n=s(92524),r=s(81888),o=s(9902),a=s(82535),c=s(62374);function l(){var e;const t=null===(e=r._.userState)||void 0===e?void 0:e.items.membershipPaymentMethod;t!=n.g5.Discord?t!=n.g5.Apple?t!=n.g5.Android?a.B.executeStripeCustomerPortalSession():d({key:"strings:storePage.manageMembership.body",options:{context:"updateOnGooglePlay"}}):d({key:"strings:storePage.manageMembership.body",options:{context:"updateOnAppStore"}}):d(function(){var e;const t=null===(e=r._.userState)||void 0===e?void 0:e.items.getCurrentMembership();if(null==t)throw new Error("Membership not found");return i.Zt.isAnnualMembership(t.type)?{key:"strings:storePage.manageMembership.body",options:{context:"waitForExpiration"}}:{key:"strings:storePage.manageMembership.body",options:{context:"updateOnDiscord"}}}())}function d(e){(0,o.C)({title:{key:"strings:storePage.manageMembership.title"},body:e})}function u(){(0,o.C)({title:{key:"strings:storePage.sections.membership.cancelConfirmation.title"},body:{key:"strings:storePage.sections.membership.cancelConfirmation.body"},onConfirm:async()=>await c.m.cancelGiftedMembership(),showCancelBtn:!0})}},9808:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_active_orange.dafdc2dd7f0479b69714.svg"},9878:(e,t,s)=>{"use strict";s.d(t,{V:()=>i});var i=function(e){return e[e.Trade=0]="Trade",e[e.Politics=1]="Politics",e[e.Science=2]="Science",e}({})},9902:(e,t,s)=>{"use strict";s.d(t,{C:()=>n});var i=s(28844);const n=(0,s(11445).K)(i.SimpleDialog)},9977:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_scarf_smile.d551ba3d63e22d436124.svg"},10008:(e,t,s)=>{"use strict";e.exports=s.p+"assets/road_purple.44404500b4749200ee0c.svg"},10200:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_robber_cupid.d1c748c8c57c72454dd7.png"},10297:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_lightning.36c72b398cd3982ca025.svg"},10321:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_fullscreen_expand.8142bdc24178fb978f67.svg"},10369:(e,t,s)=>{"use strict";s.d(t,{r:()=>l});var i=s(69508),n=s(51309),r=s(9902),o=s(35790),a=s(96990),c=s(13618);class l{static handleError(e){switch(e.type){case i.w.DefaultError:this.showDefaultErrorPopup(e);break;case i.w.AuthError:this.showAuthErrorPopup(e);break;case i.w.MustLogin:new n.L;break;case i.w.MustBeMember:this.showMustBeMemberPopup(e);break;case i.w.Blocking:this.showBlockingPopup(e)}}static showDefaultErrorPopup(e){var t;const s=null!==(t=e.title)&&void 0!==t?t:{key:"strings:popups.errors.general.title"};(0,r.C)({title:s,body:e.description})}static showAuthErrorPopup(e){var t;const s=null!==(t=e.title)&&void 0!==t?t:{key:"strings:popups.errors.general.title"};(0,r.C)({title:s,body:e.getDisplayMessage()})}static showMustBeMemberPopup(e){var t;const s=null!==(t=e.title)&&void 0!==t?t:{key:"strings:popups.errors.general.title"},i=a.N.isUserOnMobileAppOrWeb()?"/mobile/store#membership":"/store#membership";(0,r.C)({title:s,body:e.description,confirmLabel:{key:"strings:popups.uhOh.checkButton"},onConfirm:()=>(0,c.Yf)(i)})}static showBlockingPopup(e){var t;const s=null!==(t=e.title)&&void 0!==t?t:{key:"strings:popups.errors.general.title"};(0,o.B)({title:s,body:e.description})}}},10427:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_disconnect.5221e15ddb955d8ebb49.mp3"},10494:(e,t,s)=>{"use strict";s.d(t,{I:()=>U});var i=s(36872),n=s(9029),r=s(38910),o=s(17399),a=s(655),c=s(32398),l=s(70908),d=s(9902),u=s(89010),h=s(25549);const p=s.p+"assets/icon_spinner.258e53ff32bddfc6ebbc.svg",m=s.p+"assets/icon_cross.c154a3a055cea8a22040.svg",g=s.p+"assets/icon_checkmark.549171a248a111715f22.svg";class f extends r.X{get isGiftLinkSelected(){return this.giftLinkToggle.checked&&!this.selectExistingPlayerToggle.checked}get recipientUsername(){return this._recipientUsername}setRecipient(e){this.resetInputField(),this.recipientUsernameInputField.value=e,this.queryUsernames()}createSidebarButton(){super.createSidebarButton(),(0,n.RH)(this.selectionTitle,{key:"strings:storePage.sections.giftOverlay.recipientSelection.buttonTitle"})}createPageContent(){super.createPageContent(),(0,n.n8)(this.pageTitle,{key:"strings:storePage.sections.giftOverlay.recipientSelection.tabTitle"},"","","H2"),this.createOptions(),this.mainCTAButton=this.createNextButton()}createOptions(){this.createSelectExistingPlayer(),this.createGiftLink(),this.selectExistingPlayerToggle.click()}createSelectExistingPlayer(){const e=(0,n.Le)(this.pageContainer,"store-gift-overlay-recipient-selection-option-container"),t=(0,n.Le)(e,"recipient-selection-toggle-and-label-container");this.inputFieldContainer=(0,n.Le)(e,"recipient-selection-input-field-container"),this.infoContainer=(0,n.Le)(e,"recipient-selection-info-container"),(0,n.i5)(this.infoContainer,"recipient-selection-info-message",{key:"strings:storePage.sections.giftOverlay.recipientSelection.errorMessageRecipientInputField"}),this.infoContainer.classList.add("hidden"),this.selectExistingPlayerToggle=(0,n.Z3)(t,"","",t=>{t.stopPropagation();const s=this.selectExistingPlayerToggle.checked;this.resetInputField(),s?(this.recipientUsernameInputField.value="",e.classList.add("selected"),this.inputFieldContainer.classList.remove("hidden"),this.giftLinkToggle.checked&&this.giftLinkToggle.click()):(e.classList.remove("selected"),this.inputFieldContainer.classList.add("hidden"),this.disableNextButton())}),e.addEventListener("click",()=>this.selectExistingPlayerToggle.click()),(0,n.n8)(t,{key:"strings:storePage.sections.giftOverlay.recipientSelection.giftToAnExistingUser"},"","","H3"),this.initializeRecipientInputField(this.inputFieldContainer)}initializeRecipientInputField(e){this.userIcon=(0,n.WL)(e,u,{key:"strings:colonistCommon.utils.emptyString"},"user-icon"),this.recipientUsernameInputField=(0,n.M3)(e,"recipient-selection-input"),this.searchIcon=(0,n.WL)(e,h,{key:"strings:colonistCommon.utils.emptyString"},"search-icon"),this.spinnerIcon=(0,n.WL)(e,p,{key:"strings:colonistCommon.utils.emptyString"},"spinner-icon"),this.crossIcon=(0,n.WL)(e,m,{key:"strings:colonistCommon.utils.emptyString"},"cross-icon"),this.checkMarkIcon=(0,n.WL)(e,g,{key:"strings:colonistCommon.utils.emptyString"},"checkmark-icon"),this.spinnerIcon.classList.add("hidden"),this.crossIcon.classList.add("hidden"),this.userIcon.classList.add("hidden"),this.checkMarkIcon.classList.add("hidden"),this.recipientUsernameInputField.placeholder=l.a7.t("strings:storePage.sections.giftOverlay.recipientSelection.recipientPlaceholder"),this.recipientUsernameInputField.addEventListener("click",e=>e.stopPropagation()),(0,n.G0)(this.searchIcon,()=>{},!1,!0),(0,n.G0)(this.spinnerIcon,()=>{},!1,!0),(0,n.G0)(this.checkMarkIcon,()=>{},!1,!0),(0,n.G0)(this.crossIcon,()=>this.resetInputField(),!1,!0),this.recipientUsernameInputField.addEventListener("input",e=>{this.disableNextButton(),this.markAsCompleted(!1),this.showLoadingState(),this.resetSearchState(),null!=this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.queryUsernames()},500)})}createGiftLink(){const e=(0,n.Le)(this.pageContainer,"store-gift-overlay-recipient-selection-option-container"),t=(0,n.Le)(e,"recipient-selection-toggle-and-label-container");this.giftLinkToggle=(0,n.Z3)(t,"","",t=>{t.stopPropagation();this.giftLinkToggle.checked?(e.classList.add("selected"),this.selectExistingPlayerToggle.checked&&this.selectExistingPlayerToggle.click(),this.enableNextButton(),this.markAsCompleted(!0)):(e.classList.remove("selected"),this.disableNextButton(),this.markAsCompleted(!1))}),(0,n.n8)(t,{key:"strings:storePage.sections.giftOverlay.recipientSelection.giftLink.title"},"","","H3"),e.addEventListener("click",()=>this.giftLinkToggle.click()),f.createInformationButton(t)}static createInformationButton(e){const t=(0,n.zO)(e,i.am.InfoIcon,"info-button");(0,n.G0)(t,()=>{(0,d.C)({title:{key:"strings:storePage.sections.giftOverlay.recipientSelection.giftLink.information.title"},body:"strings:storePage.sections.giftOverlay.recipientSelection.giftLink.information.body"})},!1,!0)}showLoadingState(){this.spinnerIcon.classList.remove("hidden"),this.searchIcon.classList.add("hidden"),this.crossIcon.classList.add("hidden"),this.checkMarkIcon.classList.add("hidden"),this.userIcon.classList.add("hidden"),this.infoContainer.classList.add("hidden")}showReadyToSearchState(){this.searchIcon.classList.remove("hidden"),this.spinnerIcon.classList.add("hidden"),this.crossIcon.classList.add("hidden"),this.checkMarkIcon.classList.add("hidden"),this.userIcon.classList.add("hidden"),this.infoContainer.classList.add("hidden")}showErrorState(){this.searchIcon.classList.add("hidden"),this.spinnerIcon.classList.add("hidden"),this.checkMarkIcon.classList.add("hidden"),this.crossIcon.classList.remove("hidden"),this.infoContainer.classList.remove("hidden")}resetSearchState(){this.userIcon.classList.add("hidden"),this.recipientUsernameInputField.classList.remove("success-search"),this.recipientUsernameInputField.classList.remove("error-search")}async queryUsernames(){const e=this.recipientUsernameInputField.value;0==e.length&&(this.spinnerIcon.classList.add("hidden"),this.searchIcon.classList.remove("hidden"));if(!(e.length>=3))return this.onIncorrectUsernameInput();
1const t=await a.m.getRequestHandler(c.l.apiUserProfile.stickyPlayerInfo(e),void 0,void 0,!1);if(this.recipientUsernameInputField.value==e)if(this.resetSearchState(),null!=t){const e=t.json;if(!e.isLoggedIn)return this.onIncorrectUsernameInput();this.onCorrectUsernameInput();const s=null!=e.iconImageId?(0,o.tu)(e.iconImageId):u;this.userIcon.setAttribute("src",s)}else this.onIncorrectUsernameInput()}resetInputField(){this.recipientUsernameInputField.value="",this._recipientUsername=void 0,this.showReadyToSearchState(),this.resetSearchState(),this.markAsCompleted(!1)}onIncorrectUsernameInput(){this.recipientUsernameInputField.classList.add("error-search"),this._recipientUsername=void 0,this.disableNextButton(),this.showErrorState(),this.markAsCompleted(!1)}onCorrectUsernameInput(){this.recipientUsernameInputField.classList.add("success-search"),this._recipientUsername=this.recipientUsernameInputField.value,this.enableNextButton(),this.searchIcon.classList.add("hidden"),this.spinnerIcon.classList.add("hidden"),this.checkMarkIcon.classList.remove("hidden"),this.userIcon.classList.remove("hidden"),this.markAsCompleted(!0)}constructor(e,t,s,i,n){super(e,t,s,i),n&&this.setRecipient(n)}}var y=s(78524),v=s(73264),S=s(64733),b=s(50482);class C extends v.O{select(){(0,n.RH)(this.subscribeButtonText,{key:"strings:storePage.sections.giftOverlay.tierSelection.selected"}),this.productDiv.classList.add("selected"),this.subscribeButton.classList.add("selected")}deselect(){(0,n.RH)(this.subscribeButtonText,{key:"strings:storePage.sections.giftOverlay.tierSelection.select"}),this.productDiv.classList.remove("selected"),this.subscribeButton.classList.remove("selected")}setPrice(e){const t=this.localizedStoreProductData.find(e=>e.productId==this.membershipProduct.mobileIAPSKUId);var s;const i=null!==(s=null==t?void 0:t.displayPrice)&&void 0!==s?s:void 0;(0,n.RH)(this.priceDiv,{key:"strings:colonistCommon.utils.emptyString"}),this.membershipPrice=(0,n.n8)(this.priceDiv,{key:"strings:colonistCommon.utils.emptyString"},"","","H1"),(0,n.RH)(this.membershipPrice,{key:"strings:colonistCommon.utils.#buffer",options:{value:null!=i?i:`$${e}`}}),this.disclaimerText.replaceChildren()}isAnnualGiftMembership(){return 0!=this.membershipProduct.discount}addBestValueHint(){if(!this.membershipProduct.bestValue)return;this.productDiv.classList.add("store_page_membership_best_value_border");const e=(0,n.Le)(this.headerDiv,"badge-white badge-lg");(0,n.Wr)(e,{key:"strings:storePage.mostPopular"},"")}showStrikeThroughPrice(){const e=b.Zt.getMonthlyPriceOfAnnualMembership(this.getColonistMembershipType());if(null==e)return;const t=this.getLocalizedYearlyStrikethroughPrice(),s="$"+12*parseFloat(e),i=null!=t?t:s,r=(0,n.Wr)(this.priceDiv,{key:"strings:storePage.sections.membership.billing.strikethrough",options:{amount:i}},"strikethrough-price","");this.priceDiv.insertBefore(r,this.priceDiv.firstChild)}getLocalizedYearlyStrikethroughPrice(){const e=b.Zt.getMonthlyProductOfAnnualMembership(this.getColonistMembershipType());if(null==e)return;const t=y.Z.getMembershipProduct(e.type),s=this.localizedStoreProductData.find(e=>e.productId==t.mobileIAPSKUId);return null!=(null==s?void 0:s.price)?(0,S.jH)(s):void 0}constructor(e,t,s,i){super(e,t,s),this.localizedStoreProductData=[],this.localizedStoreProductData=i,(0,n.RH)(this.subscribeButtonText,{key:"strings:storePage.sections.giftOverlay.tierSelection.select"}),this.subscribeButtonText.style.marginBottom="0",this.setPrice(s.getDefaultPrice()),this.subscribeButton.classList.add("button-select"),this.isAnnualGiftMembership()&&this.showStrikeThroughPrice()}}var P=s(76092),k=s(80708),T=s(66935),A=s(75589),R=s(18587),w=s(29962);class I extends r.X{get selectedTier(){return this.selectedGiftTier}get giftDuration(){return this.selectedGiftDuration}selectGiftTier(e,t){for(const t of this.membershipProductViews){t.deselect();const s=t.membershipProduct.oneTimePurchaseType;null!=s&&(s==e&&t.select())}const s=I.isSelectedTierAnnual(e);this.selectedGiftDuration=s?12:1,this.selectedGiftTier=e,this.enableNextButton(),this.markAsCompleted(!0),this.setTabAnnual(s),this.updateSelectedTierInfoText(t);const i={type:P.k0.SelectedGiftTier,category:P.eX.GiftMembershipOverlay,floatValue:e};k.CA.sendAnalyticEvent(i)}deselectAllGiftTiers(){for(const e of this.membershipProductViews)e.deselect();this.selectedGiftTier=void 0,this.setTabAnnual(!0),this.disableNextButton(),this.markAsCompleted(!1),this.topNavigationButtonSelectedTierInfo.classList.add("hidden")}createSidebarButton(){super.createSidebarButton();const e=(0,n.Le)(this.selectionTitle,"store-gift-sidebar-texts");
1(0,n.Wr)(e,{key:"strings:storePage.sections.giftOverlay.tierSelection.buttonTitle"},""),this.topNavigationButtonSelectedTierInfo=(0,n.Le)(e,"store-gift-sidebar-texts subtext hidden")}createPageContent(){super.createPageContent(),(0,n.n8)(this.pageTitle,{key:"strings:storePage.sections.giftOverlay.tierSelection.tabTitle"},"","","H2");const e=(0,n.Le)(this.pageContainer,"toggle-container");this.toggleButtonMonthly=(0,n.Le)(e,"toggle-tab"),(0,n.Wr)(this.toggleButtonMonthly,{key:"strings:storePage.membership.frequency.oneMonth"},""),(0,n.G0)(this.toggleButtonMonthly,()=>this.setTabAnnual(!1)),this.toggleButtonAnnual=(0,n.Le)(e,"toggle-tab");const t=I.getAnnualDiscount();(0,n.Wr)(this.toggleButtonAnnual,{key:"strings:storePage.membership.frequency.oneYear",options:{context:"store",discount:t}},""),(0,n.G0)(this.toggleButtonAnnual,()=>this.setTabAnnual(!0))}createGiftMembershipProducts(){const e=(0,n.Le)(this.pageContainer,"store-gift-overlay-tiers-container"),t=y.Z.getAllMembershipProducts();for(const s of t){const t=new C(e,this.storeState,s,this.localizedStoreProductData);I.setDiscordGiftPrice(t);const i=s.oneTimePurchaseType;null!=i&&((0,n.G0)(t.productDiv,()=>this.selectGiftTier(i,s.type)),this.membershipProductViews.push(t))}}setTabAnnual(e){this.setToggleButtonsActiveState(e);for(const t of this.membershipProductViews){const s=t.isAnnualGiftMembership()!=e;t.productDiv.classList.toggle("hidden",s)}}setToggleButtonsActiveState(e){e?(this.toggleButtonAnnual.classList.add("active"),this.toggleButtonMonthly.classList.remove("active")):(this.toggleButtonMonthly.classList.add("active"),this.toggleButtonAnnual.classList.remove("active"))}static getAnnualDiscount(){if(!R.r.isUserOnDiscord)return 20;const e=12*b.Zt.getMembershipProduct(i.Qb.PremiumMonthly).price;return Math.round(100*(1-w.O.PREMIUM/e))}static isSelectedTierAnnual(e){switch(e){case i.IM.GiftEliteYearly:case i.IM.GiftPremiumYearly:case i.IM.GiftPlusYearly:case void 0:return!0;case i.IM.GiftEliteMonthly:case i.IM.GiftPremiumMonthly:case i.IM.GiftPlusMonthly:return!1;default:throw new Error("Invalid gift tier")}}updateSelectedTierInfoText(e){(0,n.RH)(this.topNavigationButtonSelectedTierInfo,this.getSelectedTierInfoText(e)),this.topNavigationButtonSelectedTierInfo.classList.remove("hidden")}getSelectedTierInfoText(e){const t=this.selectedGiftTier,s=I.isSelectedTierAnnual(t)?{key:"strings:storePage.membership.frequency.oneYear"}:{key:"strings:storePage.membership.frequency.oneMonth"},i=A.G.getMembershipTitleFromType(e);return(0,T.dN)({key:"strings:storePage.sections.giftOverlay.tierSelection.selectedTier"},{frequency:s,tier:i})}static setDiscordGiftPrice(e){if(!R.r.isUserOnDiscord)return;const t=this.getDiscordGiftPrice(e.membershipProduct);if(null==t)return;const s=`${(t/100).toFixed(2)}`;e.setPrice(s)}static getDiscordGiftPrice(e){if(!R.r.isUserOnDiscord)return e.price;if(null!=e.oneTimePurchaseType)switch(e.oneTimePurchaseType){case i.IM.GiftPlusYearly:return w.O.PLUS;case i.IM.GiftPremiumYearly:return w.O.PREMIUM;case i.IM.GiftEliteYearly:return w.O.ELITE;default:return e.price}}constructor(e,t,s,i,n,r,o){super(e,t,i,n),this.membershipProductViews=[],this.selectedGiftDuration=1,this.localizedStoreProductData=[],this.storeState=s,this.localizedStoreProductData=o,this.createGiftMembershipProducts(),this.mainCTAButton=this.createNextButton(),this.disableNextButton(),this.mainCTAButton.classList.add("gift-tier-selection-next-button"),this.setTabAnnual(!0)}}class M extends r.X{get giftMessage(){return this.messageInput.value}resetForm(){this.messageInput.value=""}createSidebarButton(){super.createSidebarButton(),(0,n.RH)(this.selectionTitle,{key:"strings:storePage.sections.giftOverlay.detailsSelection.title"})}createPageContent(){super.createPageContent(),(0,n.n8)(this.pageTitle,{key:"strings:storePage.sections.giftOverlay.detailsSelection.title"},"","","H2"),this.createMessageInput(),this.mainCTAButton=this.createCheckoutButton()}createMessageInput(){const e=(0,n.Le)(this.pageContainer,"store-gift-overlay-details-input-container"),t=(0,n.Le)(e,"store-gift-overlay-detail
1s-message-title-and-counter-container");(0,n.n8)(t,{key:"strings:storePage.sections.giftOverlay.detailsSelection.message"},"","","H2");const s=(0,n.i5)(t,"input-counter",{key:"strings:colonistCommon.utils.#buffer",options:{value:"0/150"}});this.messageInput=(0,n.aW)(e,"store-gift-overlay-message-input"),this.messageInput.placeholder=l.a7.t("strings:storePage.sections.giftOverlay.detailsSelection.messagePlaceholder"),this.messageInput.maxLength=150,this.messageInput.addEventListener("input",()=>s.textContent=`${this.messageInput.value.length}/150`)}constructor(e,t,s,i){super(e,t,i,s)}}var _=s(82535),E=function(e){return e[e.GiftURL=0]="GiftURL",e[e.GiftToUser=1]="GiftToUser",e}({}),D=s(13618),L=s(69508),B=s(55547),x=s(81888),O=s(51309),G=s(92524),F=s(766);class U{init(){const e=window.location.hash;let t;if("#gift"==e){var s;t=new URLSearchParams(window.location.search).get("username")||void 0,(null===(s=x._.userState)||void 0===s?void 0:s.isLoggedIn)||new O.L(!0,"gift")}this.createHeaderSection(),this.createBodySection(t),"#gift"!==e&&this.hide(),e.includes("#redeem")&&U.redeemCode(e)}createHeaderSection(){const e=(0,n.Le)(this.mainContainer,"store-gift-overlay-header-container"),t=(0,n.zO)(e,i.am.Logo);(0,n.G0)(t,()=>this.goToHomepage()),(0,n.n8)(e,{key:"strings:storePage.sections.giftOverlay.title"},"","","H2");const s=(0,n.zO)(e,i.am.XMark,"store-gift-overlay-close-button");(0,n.G0)(s,()=>this.hide())}createBodySection(e){const t=(0,n.Le)(this.mainContainer,"store-gift-overlay-body-container"),s=(0,n.Le)(t,"store-gift-overlay-sidebar-container"),i=(0,n.Le)(t,"store-gift-overlay-tabs-container"),r=()=>this.hide(),o=()=>this.checkout(),a=null!=e;this.tierSelectionController=new I(i,s,this.storeState,r,o,a,this.localizedStoreProductData),this.recipientSelectionController=new f(i,s,r,o,e),this.detailsSelectionController=new M(i,s,o,r),this.tierSelectionController.select(),a&&this.reorderPages(!0)}reorderPages(e){e?(this.recipientSelectionController.makePageFirst(),this.recipientSelectionController.select()):(this.tierSelectionController.makePageFirst(),this.tierSelectionController.select())}checkout(){var e;const t=this.tierSelectionController.selectedTier,s=this.tierSelectionController.giftDuration,i=this.recipientSelectionController.isGiftLinkSelected,n=this.recipientSelectionController.recipientUsername;var r;const o=null!==(r=null===(e=this.detailsSelectionController)||void 0===e?void 0:e.giftMessage)&&void 0!==r?r:"";if(null==t)return this.tierSelectionController.select();if(!i&&null==n)return this.recipientSelectionController.select();const a={giftPurchaseType:i?E.GiftURL:E.GiftToUser,oneTimePurchaseType:t,receiverUsername:n,duration:s,giftMessage:o};this.executeCheckout(t,a)}async executeCheckout(e,t){(0,F.i)({storeProductType:G.l6.OneTimePurchase,productType:e,method:"stripeCheckout"}),r.X.sendGiftFlowAnalytics(P.tV.SuccessfulCheckoutClick),_.B.executeStripeColonistGiftPurchaseSession(e,t)}goToHomepage(){(0,D.Yf)((0,D.mE)())}hide(){this.mainContainer.classList.add("hidden")}show(){B.OV.removeDisconnectBanners(),this.tierSelectionController.select(),this.mainContainer.classList.remove("hidden"),this.resetForm()}resetForm(){var e;this.recipientSelectionController.resetInputField(),this.recipientSelectionController.disableNextButton(),this.tierSelectionController.deselectAllGiftTiers(),null===(e=this.detailsSelectionController)||void 0===e||e.resetForm(),this.recipientSelectionController.isGiftLinkSelected&&this.recipientSelectionController.selectExistingPlayerToggle.click()}selectGiftTier(e){switch(e){case i.Qb.EliteMonthly:this.tierSelectionController.selectGiftTier(i.IM.GiftEliteMonthly,e);break;case i.Qb.EliteYearly:this.tierSelectionController.selectGiftTier(i.IM.GiftEliteYearly,e);break;case i.Qb.PremiumMonthly:this.tierSelectionController.selectGiftTier(i.IM.GiftPremiumMonthly,e);break;case i.Qb.PremiumYearly:this.tierSelectionController.selectGiftTier(i.IM.GiftPremiumYearly,e);break;case i.Qb.PlusMonthly:this.tierSelectionController.selectGiftTier(i.IM.GiftPlusMonthly,e);break;case i.Qb.PlusYearly:this.tierSelectionController.selectGiftTier(i.IM.GiftPlusYearly,e);break;case i.Qb.Holiday2023AllAccessPass:throw new Error("Invalid membership type")}}static async redeemCode(e){const t=e.split("=")[1],s=await a.m.getRequestHandler(c.l.a
1piGetGiftMembershipData(t),void 0),i=null==s?void 0:s.json.data;if(null==i)return;const n=A.G.getMembershipTitleFromType(i.membershipType),r=(0,T.dN)({key:"strings:storePage.sections.giftOverlay.membershipReceived",options:{count:i.lengthMonths,gifter:`${i.senderName}`,message:i.message}},{giftTier:n});return(0,d.C)({title:{key:"strings:imgAlts.StoreGiftMembership"},body:r,onConfirm:async()=>{const e=await a.m.postRequestHandler(c.l.apiRedeemGiftFromHash(),void 0,{hash:t});(null==e?void 0:e.status)==L.R.Ok&&(0,D.Yf)((0,D.mE)())}}),i}updateRecipient(e){this.resetForm(),null!=e&&this.recipientSelectionController.setRecipient(e)}constructor(e,t,s=[]){this.localizedStoreProductData=[],this.mainContainer=(0,n.Le)(e,"store-gift-overlay-container"),this.storeState=t,this.localizedStoreProductData=s,this.init()}}},10524:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_science_inventor.975ce928d050685ef4a8.svg"},10534:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_ore.117f64dab28e1c987958.svg"},10806:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_helmet.51aebe76ec0ebff615b7.svg"},10968:(e,t,s)=>{"use strict";function i(e,t,s){return Math.max(Math.min(e,s),t)}function n(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function r(e,t,s){return e+(t-e)*s}s.d(t,{Cc:()=>r,Yf:()=>n,qE:()=>i})},11148:(e,t,s)=>{"use strict";s.d(t,{C:()=>d});var i=s(67908);if(!/^(251|517|837)$/.test(s.j))var n=s(7136);var r=s(34668),o=s(80708),a=s(54801),c=s(44529);const l=i.o8.UIGameEventEnums;class d{onStateAutoRejoinGame(e){r.Q.reconnectGame(e)}onStateCurrentGameState(){var e;null===(e=this.uiGameManager)||void 0===e||e.eventController.sendEvent(void 0,i.o8.UIGameEventEnums.GameStateUpdated)}onStateBankState(){var e;null===(e=this.uiGameManager)||void 0===e||e.eventController.sendEvent(void 0,l.BankStateUpdated)}onStateMapState(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.MapStateUpdated)}onPlayerControllerState(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.PlayerControllerStateUpdated)}onSelectPlayer(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.SelectPlayer)}onGivePlayerResourcesFromTile(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.GivePlayerCardFromTile)}onExchangeCards(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.ExchangeCards)}onHighlightCorners(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.SetCornerHighlight)}onHighlightRoadEdges(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.SetRoadEdgeHighlight)}onHighlightShipEdges(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.SetShipEdgeHighlight)}onHighlightTiles(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.SetTileHighlight)}onHighlightDiceNumbersForInventor(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.HighlightDiceNumbersForInventor)}onAmountOfCardsToDiscard(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.SelectCardsToDiscard)}onSelectCardsToGiveToPlayer(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.SelectCardToGiveToAnotherPlayer)}onSelectPlayerAndCard(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.SelectPlayerAndCard)}onCardsToSelectForPendingTransaction(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.SelectCardsForPendingDistribution)}onConfirmUseDevelopmentCard(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.ConfirmUseDevelopmentCard)}onSelectPlayerUsingDevelopmentCard(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.SelectPlayerForDevelopmentCard)}onStealDevelopmentCardFromPlayer(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.StealDevelopmentCardFromPlayer)}onStealResourceCardFromPlayer(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.StealResourceCardFromPlayer)}onClosePopupUI(){var e;null===(e=this.uiGameManager)||void 0===e||e.eventController.sendEvent(void 0,l.ClosePopupUI)}onCardsToSelectForDevelopmentCard(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.SelectCardsFromBankUsingDevelopmentCard)}onSelectDice(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.SelectDice)}onCityImprovementStateUpdated(){var e;null===(e=this.uiGameManager)||void 0===e||e.eventController.sendEvent(void 0,l.CityImprovementStateUpdated)}onSpecialBuildPhaseUpdated(){var e;null===(e=this.uiGameManager)||void 0===e||e.eventController.sendEvent(void 0,l.SpecialBuildPhaseStateUpdated)}onForceShowCityImprovementButtons(){var e;null===(e=this.uiGameManager)||void 0===e||e.gameStore.getState().gameActionButtons.setCityImprovementExtraButtonsOpen(!0)}onKnightStateUpdated(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.KnightStateUpdated)}onEmbargoState(){var e;null===(e=this.uiGameManager)||void 0===e||e.eventController.sendEvent(void 0,l.EmbargoStatusUpdated)}onCloseOffer(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.RemoveTradeOffer)}onResetTradeStateAtEndOfTurn(){var e;null===(e=this.uiGameManager)||void 0===e||e.eventController.sendEvent(void 0,l.TradeResetStateAtEndOfTurn)}onTradeResponseState(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.TradeResponseState)}onTradePlayersCreatingCounterOfferState(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.TradePlayersCreatingCounterOfferState)}onGetOffer(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.NewTradeOfferReceived)}onBoldTextInTradeWindow(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.BoldTextInTradeWindow)}onBuildGame(e){this.onStateInitialPlacement(),null!=this.uiGameManager&&(this.uiGameManager.buildGame(e),o.CA.sendGoogleTagManagerEvent(o.CA.GoogleTagManagerEvent.GameStarted),this.uiGameManager.eventController.sendEvent(void 0,l.FinishedBuildingGame))}onDiceState(e=!0){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.DiceStateUpdated)}async onGameEndState(e,t){if(null==this.uiGameManager)return;const i=new((await Promise.all([s.e(175),s.e(728),s.e(567),s.e(675)]).then(s.bind(s,57768))).UIGameEndController)(this.uiGameManager,e.endGameState,e.isReplayAvailable,e.rankedUserStates,t);return this.uiGameManager.gameState.isGameOver=!0,this.uiGameManager.eventController.sendEvent(void 0,l.GameEnd),this.uiGameManager.toolTipController.closeTip(),i}onEndGameText(e){var t;const s=e;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(s,l.GameEndRematchTextUpdated)}onTogglePauseGame(e){var t,s,i;const n=Object.assign(new a.WF,e);null===(t=this.uiGameManager)||void 0===t||t.pauseController.togglePause(n),null===(s=this.uiGameManager)||void 0===s||s.gameStore.getState().gamePause.setIsPaused(n.paused),null===(i=this.uiGameManager)||void 0===i||i.gameStore.getState().gamePause.setRemainingPauseTimeMS(n.remainingPauseTime)}onBeginnerHintActivated(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.BeginnerHintReceived)}onBeginnerModeActionUpdate(e){var t;null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(e,l.BeginnerModeActionUpdated)}onBeginnerModeLevelEnd(){c.p.incrementBeginnerModeLevel()}gameStateUpdated(e,t=!0){var s,i,n,r,o;
1if(void 0===this.uiGameManager)return;const a=e.diff;this.uiGameManager.gameController.applyStateUpdates([a]),this.uiGameManager.gameController.timeLeftInCurrentState=e.timeLeftInState;const c=Math.random()/10;this.uiGameManager.gameStore.getState().setTimeLeftInSeconds(e.timeLeftInState+c),null==a.currentState&&null==(null===(i=a.experimentalMechanicState)||void 0===i||null===(s=i.mechanicTurnColonistRushState)||void 0===s?void 0:s.playersToggledEndTurn)||this.onStateCurrentGameState();(null!=a.diceState||null!=a.mechanicEventDiceState)&&this.onDiceState(t);const l=null!=(null===(o=a.experimentalMechanicState)||void 0===o||null===(r=o.playerStates)||void 0===r||null===(n=r[this.uiGameManager.gameController.myColor])||void 0===n?void 0:n.actionState);(null!=a.playerStates||null!=a.mechanicDevelopmentCardsState||null!=a.mechanicSettlementState||null!=a.mechanicCityState||null!=a.mechanicCityWallState||null!=a.mechanicRoadState||null!=a.mechanicShipState||null!=a.mechanicProgressCardsState||null!=a.mechanicLongestRoadState||null!=a.mechanicLargestArmyState||l)&&this.onPlayerControllerState(t),null!=a.bankState&&this.onStateBankState(),null!=a.tradeState&&this.onTradeStateUpdate(a.tradeState);(null!=a.mapState||null!=a.mechanicRobberState||null!=a.mechanicPirateState||null!=a.mechanicMerchantState)&&this.onStateMapState(t),null!=a.gameLogState&&this.onGameLogStateUpdate(a.gameLogState),a.mechanicSpecialBuildPhaseState&&this.onSpecialBuildPhaseUpdated(),a.mechanicKnightState&&this.onKnightStateUpdated(a.mechanicKnightState),a.mechanicCityImprovementsState&&this.onCityImprovementStateUpdated();const d=this.uiGameManager.gameController.stateController.state,u=Object.keys(e.diff);this.uiGameManager.gameStore.getState().setGameState(d,u)}onTradeStateUpdate(e){var t;if(null!=e.embargoState&&this.onEmbargoState(),null!=e.activeOffers)for(const t in e.activeOffers){const s=e.activeOffers[t];if(null===s){this.onCloseOffer(t);continue}if(null==s)continue;1==Object.keys(s).length?(null!=s.playerResponses&&this.onTradeResponseState(t),null!=s.playersCreatingCounterOffer&&this.onTradePlayersCreatingCounterOfferState(t)):(0,n.zo)(s)&&this.onGetOffer(t)}null===(t=this.uiGameManager)||void 0===t||t.eventController.sendEvent(void 0,l.TradeStateUpdated)}onGameLogStateUpdate(e){void 0!==this.uiGameManager&&(this.uiGameManager.gameController.isReplay||d.appendGameLogs(e))}static async appendGameLogs(e){const t=await Promise.all([s.e(728),s.e(567),s.e(675)]).then(s.bind(s,60902)),{addNewLog:i}=t;for(const t in e){const s=e[t];null!=s&&i(Number(t),s)}}onFriendUpdateOnlineStatus(e){var t,s;if(e.sendingAllFriends)return null===(t=this.generalServicesController.onlineFriendController)||void 0===t?void 0:t.updateAllFriendsOnlineStatus(e.onlineFriendStatuses);const i=e.onlineFriendStatuses[0];null===(s=this.generalServicesController.onlineFriendController)||void 0===s||s.updateFriendOnlineStatus(i)}onFriendReceivedRoomInvites(e){var t;null===(t=this.generalServicesController.onlineFriendController)||void 0===t||t.receivedRoomInvites(e)}onFriendReceivedFriendRequest(e){var t;null===(t=this.generalServicesController.onlineFriendController)||void 0===t||t.receivedFriendRequest(e)}onFriendRemoveRoomInvite(e){var t;null===(t=this.generalServicesController.onlineFriendController)||void 0===t||t.removeRoomInvitesWithRoomId(e)}onFriendRoomInviteResponse(e){var t;null===(t=this.generalServicesController.onlineFriendController)||void 0===t||t.friendRespondedToRoomInvite(e)}onFriendRoomInviteSentSuccessfully(e){var t;null===(t=this.generalServicesController.onlineFriendController)||void 0===t||t.roomInviteSentToFriendSuccessfully(e)}onNotificationsReceived(e){var t;null===(t=this.generalServicesController.notificationActionController)||void 0===t||t.addNotificationsToPanel(e)}onMarkedAsRead(e){var t;null===(t=this.generalServicesController.notificationActionController)||void 0===t||t.markNotificationAsRead(e)}constructor(e){this.generalServicesController=e}}},11445:(e,t,s)=>{"use strict";s.d(t,{K:()=>a});s(71763);var i=s(9029),n=s(7893),r=s(28844);let o=0;function a(e){const t=`dialog-container-${o}`;let s,a;o+=1;const c=()=>{null!=s&&(s.unmount(),s=void 0,null==a||a.remove(),a=void 0)};return(...o)=>{var l;const d=null!==(l=o[0])&&void 0!==l?l:{};null==s&&(a=(0,i.Le)((0,r.getDialogRoot)(),"",t),s=(0,n.y)(t,e)),s.render({...d,onClose:c})}}},11531:(e,t,s)=>{"use strict";e.exports=s.p+"assets/logo.91681d8792afec7588e1.png"},11773:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_inactive_bronze.930281c927fdcf863946.svg"},11903:(e,t,s)=>{"use strict";e.exports=s.p+"assets/settlement_pink.245ee8f50ee2f8d7d70c.svg"},12326:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_crown.7e87560656a62a1fddea.svg"},12403:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_gear_preview.3d928b26568c08378a20.png"},12608:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_google.145006bbb205a8f5bd04.svg"},12688:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_wall_gold.984963f350d61fa96331.svg"},12745:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_trade_resource_monopoly.2e3904c38a24f239229c.svg"},12908:(e,t,s)=>{"use strict";
1e.exports=s.p+"assets/icon_merchant_bronze.2db5564900399e5a4ebd.svg"},13047:(e,t,s)=>{"use strict";s.d(t,{$:()=>i});const i=324},13128:(e,t,s)=>{"use strict";s.d(t,{R:()=>l});var i=s(71763),n=s(46507),r=s(18587),o=s(13618),a=s(26876);const c=(0,s(11445).K)(({onClose:e,onConfirm:t})=>{const s=(0,i.useRef)(!1);(0,i.useEffect)(()=>{(0,a.b4)()},[]);return i.createElement(n.U,{showVideo:!r.r.isUserOnDiscord,onExternalClick:e=>{(0,a.eJ)(),(0,o.Yf)(e,!0)},onClose:()=>{s.current||(0,a.Ly)(),e()},onConfirm:()=>{s.current=!0,(0,a.hc)(),e(),t()}})});function l(e){c({onConfirm:e})}},13160:(e,t,s)=>{"use strict";s.d(t,{I:()=>i});var i;!function(e){e.getDeviceLanguages=function(){var e;return null!=(null===(e=window.MOBILE)||void 0===e?void 0:e.deviceLanguages)?window.MOBILE.deviceLanguages:[]},e.getStatusBarHeight=function(){var e;if(null!=(null===(e=window.MOBILE)||void 0===e?void 0:e.statusBarHeight))return window.MOBILE.statusBarHeight;const t=localStorage.getItem("device-statusBarHeight");return null==t?null:Number(t)},e.getSafeAreaInsetBottom=function(){var e;if(null!=(null===(e=window.MOBILE)||void 0===e?void 0:e.safeAreaInsetBottom))return window.MOBILE.safeAreaInsetBottom;const t=localStorage.getItem("device-safeAreaInsetBottom");return null==t?null:Number(t)},e.getBuildNumber=function(){var e;if(null!=(null===(e=window.MOBILE)||void 0===e?void 0:e.buildVersion))return Number(window.MOBILE.buildVersion);const t=localStorage.getItem("mBuildVersion");return null==t?null:Number(t)},e.getPlatform=function(){var e;return null!=(null===(e=window.MOBILE)||void 0===e?void 0:e.platformOS)?window.MOBILE.platformOS:localStorage.getItem("mPlatformOS")}}(i||(i={}))},13250:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ship_orange_north_west.17cb559e3cfc094e935b.svg"},13279:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_robber_santa.247b8bec2c7052826e7b.svg"},13359:(e,t,s)=>{"use strict";s.d(t,{T:()=>r,q:()=>o});var i=s(66935),n=s(18587),r=function(e){return e.EnterMatchmaking="matchmakingqueue",e.EnterBotGame="enterbotgame",e.VideoAdTesting="bidtest",e.Campaign="campaign",e.Lobby="lobby",e.Spectate="spectate",e.MainPage="mainpage",e.SelectMode="selectmode",e.CreateRoom="createroom",e.SuppressPopupsOnLoad="suppresspopupsonload",e.DiscordLeaderboard="discordleaderboard",e.DiscordStore="discordstore",e.DiscordAbout="discordabout",e.DiscordCareers="discordcareers",e.DiscordChampionship25="discordchampionship25",e.DiscordChampionship26="discordchampionship26",e.DiscordCommunity="discordcommunity",e.DiscordFAQ="discordfaq",e.DiscordPrivacyPolicy="discordprivacypolicy",e.DiscordPatchNotes="discordpatchnotes",e.DiscordProfile="discordprofile",e.DiscordGifting="discordgifting",e.DiscordValues="discordvalues",e.DiscordValuesExamples="discordvaluesexamples",e.DiscordTerms="discordterms",e.DiscordPressKit="discordpresskit",e.DiscordRefundPolicy="discordrefundpolicy",e.DiscordCommunityGuidelines="discordcommunityguidelines",e.DiscordMore="discordmore",e.MobileLeaderboard="mobileleaderboard",e.MobileLobby="mobilelobby",e.MobileHomepage="mobilehomepage",e.MobileStore="mobilestore",e.MobileProfile="mobileprofile",e.MobileMore="mobilemore",e.MobileReactivation="mobilereactivation",e.MobileImageSharing="mobileimagesharing",e.ReconnectGame="reconnectgame",e.RetiredReferralShare="share",e}({});class o{static accessGameFromLink(e){const t=this.getRoomIdFromUrl();null!=t&&e(t)}static getRoomIdFromUrl(){if(void 0===window.location.hash)return;if(""==window.location.hash)return;if(!this.isUrlPathRoot())return;const e=window.location.hash.substr(1,window.location.hash.length);return Object.values(r).some(t=>e.startsWith(t))||null==e?void 0:e.toLocaleLowerCase()}static isUrlPathRoot(){const e=new RegExp(String.raw`\/${n.r.language}\/?`),t=location.pathname.replace(e,"/");return"/"==t||"/mobile"==t||"/.proxy/discord/web"==t||"/.proxy/discord/mobile"==t}static extractHashAndValue(e){const t=e.indexOf("#");if(-1==t||t==e.length-1)return{hash:void 0,value:void 0};const s=e.slice(t+1).split("=");return{hash:s[0],value:s.length>1?s[1]:void 0}}static getLanguagePrefix(){const e=new Map([["zh","zh-CN"],["pt","pt-PT"]]),t=[...i.F2.languages,...e.keys()],s=window.location.pathname.split("/");if(s.length<2)return"";const n=s[1];return t.includes(n)?n:""}static getPathnameWithoutLanguagePrefix(){const e=window.location.pathname;if(!this.getLanguagePrefix())return e;return"/"+e.split("/").slice(2).join("/")}static getRelativeUrlWithoutLanguagePrefix(){return this.getPathnameWithoutLanguagePrefix()+window.location.search+window.location.hash}}},13399:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_discordlogin.8384f19f1752419065e3.svg"},13435:(e,t,s)=>{"use strict";s.d(t,{W:()=>i});class i{}},13506:(e,t,s)=>{"use strict";s.d(t,{Ci:()=>g,Ip:()=>f,b2:()=>m});var i=s(46581),n=s(13618),r=s(9029),o=s(61570),a=s(80708),c=s(76092),l=s(78134),d=s(84235),u=s(67908),h=s(18587),p=s(72239);function m(e){return{games:g(e.gameDatas,e.profileUserId,{isPopup:!1})}}function g(e,t,s){return[...e].reverse().map(e=>function(e,t,s){var n;const r=i.KN.deserialize(e.setting),o=null===(n=e.players.find(e=>e.userId===t))||void 0===n?void 0:n.playerColor,a=e.hasReplay&&null!=o;return{id:e.id,dateText:p.Re.convertTimestampToDateTimeText(e.startTime),durationText:p.Re.formatSecondsToElapsedString(e.duration/p.Re.MILLISECONDS),victoryPointsToWin:r.victoryPointsToWin,turnCount:e.turnCount,players:e.players.map(y),settings:v(r),replayUrl:a?S(e,o,s):void 0}}(e,t,s.isPopup))}function f(e,t){null!=t&&(a.CA.sendAnalyticEvent({type:c.k0.ReplayClickedViewFromProfileGameHistory,category:c.eX.Replay,stringValue:e}),(0,n.Yf)(t,!0))}function y(e){return{username:e.isHuman?e.username:(0,r.Tl)("strings:profilePage.history.botName"),hasProfile:e.isHuman&&e.username!=o.t,rank:e.rank,points:e.points,finished:e.finished,quitWithPenalty:e.quitWithPenalty}}function v(e){const t=l.qq.getModeDataForMode(e.modeSetting);if(null!=t)return{id:e.id,mapName:d.X.getMapName(e.mapSetting),modeName:t.name,extensionName:(0,u.Dw)(e.extensionSetting),scenarioName:(0,u.g1)(e.scenarioSetting),diceText:(0,u.Zd)(e.diceSetting),turnTimerText:u.mt.getSpeedSettingText(e.gameSpeed),friendlyRobber:e.friendlyRobber,karmaActive:e.karmaActive,hideBankCards:e.hideBankCards,cardDiscardLimit:e.cardDiscardLimit}}function S(e,t,s){if(h.r.isUserOnDiscord&&s)return`https://colonist.io/replay?gameId=${e.id}&playerColor=${t}`;if(h.r.isUserOnDiscord)return`/replay?gameId=${e.id}&playerColor=${t}`;const i=new URL(window.location.href);return i.pathname=h.r.isUserOnMobileAppOrWeb?"/mobile/replay":"/replay",i.searchParams.set("gameId",e.id.toString()),i.searchParams.set("playerColor",t.toString()),i.href}},13567:(e,t,s)=>{"use strict";s.d(t,{O3:()=>n,P3:()=>o,Q4:()=>r,qT:()=>a});var i=s(63359),n=function(e){return e[e.ResourceBack=0]="ResourceBack",e[e.Lumber=1]="Lumber",e[e.Brick=2]="Brick",e[e.Wool=3]="Wool",e[e.Grain=4]="Grain",e[e.Ore=5]="Ore",e[e.Cloth=6]="Cloth",e[e.Coin=7]="Coin",e[e.Paper=8]="Paper",e[e.AnyResource=9]="AnyResource",e[e.DevelopmentBack=10]="DevelopmentBack",e[e.Knight=11]="Knight",e[e.VictoryPoint=12]="VictoryPoint",e[e.Monopoly=13]="Monopoly",e[e.RoadBuilding=14]="RoadBuilding",e[e.YearOfPlenty=15]="YearOfPlenty",e[e.CommodityBack=16]="CommodityBack",e[e.ProgressCardTradeBack=17]="ProgressCardTradeBack",e[e.ProgressCardTradeCommercialHarbor=18]="ProgressCardTradeCommercialHarbor",e[e.ProgressCardTradeMasterMerchant=19]="ProgressCardTradeMasterMerchant",e[e.ProgressCardTradeMerchant=20]="ProgressCardTradeMerchant",e[e.ProgressCardTradeMerchantFleet=21]="ProgressCardTradeMerchantFleet",e[e.ProgressCardTradeResourceMonopoly=22]="ProgressCardTradeResourceMonopoly",e[e.ProgressCardTradeCommodityMonopoly=23]="ProgressCardTradeCommodityMonopoly",e[e.ProgressCardPoliticsBack=24]="ProgressCardPoliticsBack",e[e.ProgressCardPoliticsBishop=25]="ProgressCardPoliticsBishop",e[e.ProgressCardPoliticsConstitution=26]="ProgressCardPoliticsConstitution",e[e.ProgressCardPoliticsDeserter=27]="ProgressCardPoliticsDeserter",e[e.ProgressCardPoliticsDiplomat=28]="ProgressCardPoliticsDiplomat",e[e.ProgressCardPoliticsIntrigue=29]="ProgressCardPoliticsIntrigue",e[e.ProgressCardPoliticsSaboteur=30]="ProgressCardPoliticsSaboteur",e[e.ProgressCardPoliticsSpy=31]="ProgressCardPoliticsSpy",e[e.ProgressCardPoliticsWarlord=32]="ProgressCardPoliticsWarlord",e[e.ProgressCardPoliticsWedding=33]="ProgressCardPoliticsWedding",e[e.ProgressCardScienceBack=34]="ProgressCardScienceBack",e[e.ProgressCardScienceAlchemist=35]="ProgressCardScienceAlchemist",e[e.ProgressCardScienceCrane=36]="ProgressCardScienceCrane",e[e.ProgressCardScienceEngineer=37]="ProgressCardScienceEngineer",e[e.ProgressCardScienceInventor=38]="ProgressCardScienceInventor",e[e.ProgressCardScienceIrr
1igation=39]="ProgressCardScienceIrrigation",e[e.ProgressCardScienceMedicine=40]="ProgressCardScienceMedicine",e[e.ProgressCardScienceMining=41]="ProgressCardScienceMining",e[e.ProgressCardSciencePrinter=42]="ProgressCardSciencePrinter",e[e.ProgressCardScienceRoadBuilding=43]="ProgressCardScienceRoadBuilding",e[e.ProgressCardScienceSmith=44]="ProgressCardScienceSmith",e[e.ProgressCardBack=45]="ProgressCardBack",e[e.ResourceOverLimit=46]="ResourceOverLimit",e}({}),r=function(e){return e[e.Resource=0]="Resource",e[e.Commodity=1]="Commodity",e[e.AnyResource=2]="AnyResource",e[e.Development=3]="Development",e[e.ProgressTrade=4]="ProgressTrade",e[e.ProgressPolitics=5]="ProgressPolitics",e[e.ProgressScience=6]="ProgressScience",e[e.Miscellaneous=7]="Miscellaneous",e}({}),o=function(e){return e[e.StartingResources=0]="StartingResources",e[e.ResourceTile=1]="ResourceTile",e[e.GoldTile=2]="GoldTile",e[e.Aqueduct=3]="Aqueduct",e[e.BarbarianProgressCard=4]="BarbarianProgressCard",e}({});const a=i.Ikc({cards:i.YOg(i.k5n(n))}).strict();i.jgl(i.k5n(n),i.aig().int().nonnegative())},13618:(e,t,s)=>{"use strict";s.d(t,{$$:()=>u,BA:()=>f,Ez:()=>d,O6:()=>h,VX:()=>v,Yf:()=>b,a8:()=>m,be:()=>S,gN:()=>p,mE:()=>y});var i=s(72239);if(517!=s.j)var n=s(32349);if(!/^(251|517|837)$/.test(s.j))var r=s(51061);var o=s(18587),a=s(70908),c=s(42466),l=s(17326);function d(e,t){t||(t=window.location.href),e=e.replace(/[[\]]/g,"\\$&");const s=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return s?s[2]?decodeURIComponent(s[2].replace(/\+/g," ")):"":null}function u(){const e=window.navigator.userAgent.toLowerCase(),t=e.indexOf("safari")>-1&&-1==e.indexOf("chrome"),s=e.indexOf("version/15.4")>=0,i=null!==e.match(/cpu (os|iphone os) 15_4 like mac os x/);return t&&(s||i)}function h(){const e=window.navigator.userAgent.toLowerCase(),t=e.match(/firefox\/(\d+)/),s=(t?parseInt(t[1],10):0)>=149,i=e.indexOf("windows")>-1;return s&&i}function p(){i.n.randomBool()?b("https://play.google.com/store/apps/details?id=com.colonist.colonist",!0):b("https://apps.apple.com/us/app/colonist-io/id6444831129",!0)}function m(e){return(0,r.A)(e,i.R$.secondsAsMilliseconds(2),{trailing:!1})}let g=!1;function f(e){return async t=>{if(!g){g=!0;try{await e(t)}finally{g=!1}}}}function y(){const e=a.vX.getLanguagePathPrefix();return o.r.isUserOnDiscordMobile?`/.proxy${e}/discord/mobile`:o.r.isUserOnDiscord?`/.proxy${e}/discord/web`:o.r.isUserOnMobile||o.r.isUserOnMobileAppOrWeb?`${e}/mobile`:`${e}/`}function v(e,t){return`${y()}#${e}=${t}`}function S(){const e=`${a.vX.getLanguagePathPrefix()}/catan-rules${(0,l.j3)(l.RD.Mobile)}`;return o.r.isUserOnDiscordMobile?`/.proxy${e}`:e}function b(e,t=!1,s=!1){c.y.closeAllPopups();const i=o.r.isUserOnMobileAppOrWeb,r=o.r.isUserOnDiscordMobile;if(o.r.isUserOnDiscord&&function(e){return"/faq"==e||(!!e.startsWith("/faq#")||!!e.startsWith("/faq?"))}(e))return C(function(e){const t=e.indexOf("#");return-1==t?n.r9:`${n.r9}${e.slice(t)}`}(e));const a=!e.startsWith("/")&&!e.includes(window.location.origin),l=e.includes("/auth/")||e.includes("/auth-link/"),d=i&&!a&&!l,u=r&&!a&&!l&&!t;if((d||u)&&s)return function(e){const t=document.createElement("a");t.href=decodeURIComponent(e),document.body.appendChild(t),t.click(),document.body.removeChild(t)}(e);if(u){const t=e.startsWith("/")?`${window.location.origin}${e}`:e;return void(window.location.href=t)}if(d)return function(e){const t=e.startsWith("/")?`${window.location.origin}${e}`:e,s=new URL(t),i=`${s.pathname}${s.search}${s.hash}`,n=i.includes("/mobile")?i:`/mobile${i}`;history.pushState({},"",n),setTimeout(()=>window.location.reload(),100)}(e);const h=e.startsWith("#")?`${window.location.origin}/${e}`:e;if((i||r)&&t)return C(h);window.open(h,t?"_blank":"_self")}function C(e){const t=document.createElement("a");t.href=e,t.target="_blank",t.rel="noopener noreferrer",document.body.appendChild(t),t.click(),document.body.removeChild(t)}},13627:(e,t,s)=>{"use strict";s.d(t,{m1:()=>a,vk:()=>c});var i=s(63359),n=s(87952),r=s(68084),o=s(68924),a=function(e){return e[e.Desert=0]="Desert",e[e.Lumber=1]="Lumber",e[e.Brick=2]="Brick",e[e.Wool=3]="Wool",e[e.Grain=4]="Grain",e[e.Ore=5]="Ore",e[e.Gold=6]="Gold",e[e.Fog=7]="Fog",e[e.Sea=8]="Sea",e}({});const c=i.KCZ([i.euz(0),r.Cj]),l=i.Ikc({x:i.aig().int().readonly(),y:i.aig().int().readonly(),type:i.k5n(a),diceNumber:c}
1).strict();(0,n.rd)(l);const d=(0,o.e)(l);(0,n.rd)(d,{requireAtLeastOneEntry:!0})},13647:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_rescardback.03c18312a76028b0d9c9.svg"},13657:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_info.0f1a765945c77be429ac.svg"},13801:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_rush_4_player.76b3ebb256f30fcb7c74.svg"},14159:(e,t,s)=>{"use strict";s.d(t,{U:()=>i});var i,n=s(69508),r=s(58602),o=s(36872),a=s(41592);!function(e){class t extends r.Ak{constructor(){super({key:"strings:popups.errors.matchmakingError.title"},{key:"strings:popups.errors.matchmakingError.alreadySearchingForMatch"},n.R.Conflict)}}e.AlreadySearchingForMatch=t;class s extends r.Ak{constructor(){super({key:"strings:popups.errors.matchmakingError.title"},{key:"strings:popups.errors.matchmakingError.internalServerError",options:{email:o.gq.SUPPORT_EMAIL}},n.R.InternalServerError)}}e.InternalServerError=s;class i extends r.Ak{constructor(){super({key:"strings:popups.errors.matchmakingError.title"},{key:"strings:popups.errors.matchmakingError.invalidRequest"},n.R.BadRequest)}}e.InvalidRequest=i;class c extends r.Ak{constructor(e,t){super({key:"strings:popups.errors.matchmakingInfo.title"},{key:"strings:popups.errors.matchmakingInfo.playMoreToUnlockRanked",options:{finishedGames:e,totalRequiredGames:t,gamesNeeded:t-e}},n.R.ServiceUnavailable)}}e.RankedLocked=c;class l extends r.Ak{constructor(e,t){super({key:"strings:popups.errors.matchmakingInfo.title"},{key:"strings:popups.errors.matchmakingInfo.playMoreToUnlockShuffle",options:{finishedGames:e,totalRequiredGames:t,gamesNeeded:t-e}},n.R.ServiceUnavailable)}}e.ShuffleLocked=l;class d extends r.Ak{constructor(){super({key:"strings:popups.errors.matchmakingError.title"},{key:"strings:colonistCommon.serverStatus.serverUpdating",options:{discordLink:a.T}},n.R.ServiceUnavailable)}}e.ServerUpdating=d;class u extends r.Ak{constructor(){super({key:"strings:popups.errors.matchmakingError.title"},{key:"strings:popups.errors.matchmakingError.alreadyPlayingRankedGame"},n.R.Conflict)}}e.AlreadyPlayingRankedGame=u;class h extends r.Ak{constructor(){super({key:"strings:popups.errors.matchmakingError.title"},{key:"strings:popups.errors.matchmakingError.invalidRankedMode"},n.R.BadRequest)}}e.InvalidRankedMode=h;class p extends r.Ak{constructor(){super({key:"strings:popups.errors.matchmakingError.queueUpdating.title"},{key:"strings:popups.errors.matchmakingError.queueUpdating.body"},n.R.ServiceUnavailable)}}e.QueueUpdating=p;class m extends r.Ak{constructor(){super({key:"strings:popups.errors.matchmakingError.noFreeGamesRemaining.title"},{key:"strings:popups.errors.matchmakingError.noFreeGamesRemaining.body"},n.R.Forbidden)}}e.NoFreeGamesRemaining=m}(i||(i={}))},14466:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_inactive_mysticblue.4be0cd1ca2192d885d8e.svg"},14602:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_earth_preview.d98aa9a56b808c58f4a7.png"},14816:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_gifting.e25a2bdd24a7d9ce1aed.png"},15055:(e,t,s)=>{"use strict";s.d(t,{x:()=>i});var i=function(e){return e.StoreVisited="store_visited",e.MembershipTierClicked="membership_tier_clicked",e.MembershipSubscribeClicked="membership_subscribe_clicked",e.PurchaseSessionStarted="purchase_session_started",e.MembershipSubscribed="membership_subscribed",e.StoreSocialProofShown="store_social_proof_shown",e}({})},15123:(e,t,s)=>{"use strict";s.d(t,{LB:()=>a,rG:()=>l,um:()=>c});var i=s(63359),n=s(87952),r=s(68924),o=s(55935),a=function(e){return e[e.North=0]="North",e[e.South=1]="South",e}({}),c=function(e){return e[e.Settlement=1]="Settlement",e[e.City=2]="City",e[e.DestroyedCity=3]="DestroyedCity",e[e.KnightActiveLevel1=4]="KnightActiveLevel1",e[e.KnightActiveLevel2=5]="KnightActiveLevel2",e[e.KnightActiveLevel3=6]="KnightActiveLevel3",e[e.KnightInactiveLevel1=7]="KnightInactiveLevel1",e[e.KnightInactiveLevel2=8]="KnightInactiveLevel2",e[e.KnightInactiveLevel3=9]="KnightInactiveLevel3",e}({}),l=function(e){return e[e.IslandSettlingChits=0]="IslandSettlingChits",e[e.CityWall=1]="CityWall",e[e.MetropolisScience=2]="MetropolisScience",e[e.MetropolisTrade=3]="MetropolisTrade",e[e.MetropolisPolitics=4]="MetropolisPolitics",e}({});const d=i.Ikc({x:i.aig().int().readonly(),y:i.aig().int().readonly(),z:i.k5n(a).readonly(),owner:i.KCZ([i.k5n(o.DS).exclude(["None"]),i.chJ()]).exactOptional(),buildingType:i.KCZ([i.k5n(c),i.chJ()]).exactOptional(),bonuses:i.YOg(i.k5n(l)).exactOptional(),restrictedStartingPlacement:i.euz(!0).exactOptional()}).strict();(0,n.rd)(d);const u=(0,r.e)(d);(0,n.rd)(u,{requireAtLeastOneEntry:!0})},15166:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_goldrush_preview.a33313f7fd0419b2b041.png"},15428:(e,t,s)=>{"use strict";s.d(t,{C:()=>u});var i=s(71763),n=s(46507),r=s(76092),o=s(80708),a=s(13618);const c=e=>{const t={type:r.k0.ABTestClickAnalytics,category:r.eX.ABTestClickAnalytics,floatValue:e};o.CA.sendAnalyticEvent(t)},l=()=>{window.history.pushState("",document.title,window.location.pathname+window.location.search)};const d=(0,s(11445).K)(({onClose:e,variant:t,continuationAction:s})=>{const o=()=>{"dismissible"==t&&(c(r.Jd.AdblockPopupContinueAction),s()),l(),e()},d=()=>{c(r.Jd.AdblockPopupDisableAction),l(),e(),(0,a.Yf)("/disable-ad-block",!0)},u=()=>{c(r.Jd.AdblockPopupBecomeMemberAction),l(),e(),(0,a.Yf)("/store#membership",!0)};return"dismissible"==t?i.createElement(n.Rn,{onClose:o,onDisableAdblock:d,onBecomeMember:u}):i.createElement(n.wm,{onDisableAdblock:d,onBecomeMember:u})});function u(e){d({continuationAction:e.continuationAction,variant:e.variant})}},15549:(e,t,s)=>{"use strict";s.d(t,{P:()=>p});var i=s(72239),n=s(16611),r=s(36872),o=s(55547),a=s(66935),c=s(84235),l=s(78134);
1if(!/^(251|517|837)$/.test(s.j))var d=s(48139);if(!/^(251|517|837)$/.test(s.j))var u=s(55935);var h=s(35883);class p{static run(e,t){if(null==e)return;if(e.gameSetting.id!=t.gameSetting.id)return;new p(e,t).notify()}notify(){this.playSounds(),this.notifyPrivateGameChanged(),this.notifyNoTrollsChanged(),this.notifyBotAdded(),this.notifyMapChanged(),this.notifyGameModeChanged(),this.notifyDiceTypeChanged(),this.notifyVpToWinChanged(),this.notifyCardDiscardLimitChanged(),this.notifyFriendlyRobberChanged(),this.notifyHideBankCardsChanged(),this.notifyMaxPlayersChanged(),this.notifyGameSpeedChanged(),this.notifyPlayOrderSelectionActiveChanged(),this.notifyPlayerDisconnected(),this.notifyPlayerConnected(),this.notifyHostChanged(),this.notifyPlayerColorChanged()}playSounds(){if(!i.BF.isObjectEqual(this.oldRoomState.gameSetting,this.newRoomState.gameSetting))return void n.A9.play(n.hc.RoomSettingUpdated);const e=this.oldRoomState.getSessions().filter(e=>e.isReadyToPlay).length;this.newRoomState.getSessions().filter(e=>e.isReadyToPlay).length>e&&n.A9.play(n.hc.RoomGetReady)}notifyNoTrollsChanged(){this.oldRoomState.isNoTrollsGame()!=this.newRoomState.isNoTrollsGame()&&(this.wasAndIsHost||(this.newRoomState.isNoTrollsGame()?this.showNotification({key:"strings:roomPage.notifications.enabledNoTrollsGame",options:{minimumKarma:this.newRoomState.gameSetting.minimumKarma}}):this.showNotification({key:"strings:roomPage.notifications.disabledNoTrollsGame"})))}notifyPrivateGameChanged(){this.oldRoomState.gameSetting.privateGame!=this.newRoomState.gameSetting.privateGame&&(this.wasAndIsHost||(this.newRoomState.gameSetting.privateGame?this.showNotification({key:"strings:roomPage.notifications.roomChangedToPrivate"}):this.showNotification({key:"strings:roomPage.notifications.roomChangedToPublic"})))}notifyBotAdded(){this.oldRoomState.getSessions().filter(e=>e.isBot).length>=this.newRoomState.getSessions().filter(e=>e.isBot).length||this.showNotification({key:"strings:roomPage.notifications.botAdded"})}notifyMapChanged(){if(this.oldRoomState.gameSetting.mapSetting==this.newRoomState.gameSetting.mapSetting)return;if(this.wasAndIsHost)return;const e=c.X.getMapDataForMap(this.newRoomState.gameSetting.mapSetting);if(null==e)return;const t=(0,a.dN)({key:"strings:roomPage.notifications.changedMap"},{map:e.name});this.showNotification(t)}notifyGameModeChanged(){if(this.oldRoomState.gameSetting.modeSetting==this.newRoomState.gameSetting.modeSetting)return;if(this.wasAndIsHost)return;const e=l.qq.getModeDataForMode(this.newRoomState.gameSetting.modeSetting);if(null==e)return;const t=(0,a.dN)({key:"strings:roomPage.notifications.changedGameMode"},{gameMode:e.name});this.showNotification(t)}notifyDiceTypeChanged(){this.oldRoomState.gameSetting.diceSetting!=this.newRoomState.gameSetting.diceSetting&&(this.wasAndIsHost||this.showNotification({key:"strings:roomPage.notifications.changedDice",options:{diceSetting:`${r.ZP[this.newRoomState.gameSetting.diceSetting]}`}}))}notifyVpToWinChanged(){this.oldRoomState.gameSetting.victoryPointsToWin!=this.newRoomState.gameSetting.victoryPointsToWin&&(this.wasAndIsHost||this.showNotification({key:"strings:roomPage.notifications.changedVpToWin",options:{vpToWin:this.newRoomState.gameSetting.victoryPointsToWin}}))}notifyCardDiscardLimitChanged(){this.oldRoomState.gameSetting.cardDiscardLimit!=this.newRoomState.gameSetting.cardDiscardLimit&&(this.wasAndIsHost||this.showNotification({key:"strings:roomPage.notifications.changedCardDiscardLimit",options:{cardDiscardLimit:this.newRoomState.gameSetting.cardDiscardLimit}}))}notifyFriendlyRobberChanged(){this.oldRoomState.gameSetting.friendlyRobber!=this.newRoomState.gameSetting.friendlyRobber&&(this.wasAndIsHost||this.showNotification({key:"strings:roomPage.notifications.changedFriendlyRobber",options:{context:this.newRoomState.gameSetting.friendlyRobber.toString()}}))}notifyHideBankCardsChanged(){this.oldRoomState.gameSetting.hideBankCards!=this.newRoomState.gameSetting.hideBankCards&&(this.wasAndIsHost||this.showNotification({key:"strings:roomPage.notifications.changedHideBankCards",options:{context:this.newRoomState.gameSetting.hideBankCards.toString()}}))}notifyMaxPlayersChanged(){this.oldRoomState.gameSetting.maxPlayers!=this.newRoomState.gameSetting.maxPlayers&&(this.wasAndIsHost||this.showNotification({key:"strings:roomPage.notifications.changedMaxPlayers",options:{maxPlayers:this.newRoomState.gameSetting.maxPlayers}}))}notifyGameSpeedChanged(){this.oldRoomState.gameSetting.gameSpeed!=this.newRoomState.gameSetting.gameSpeed&&(this.wasAndIsHost||this.showNotification({key:"strings:roomPage.notifications.changedTurnTimer",options:{turnTimer:`${r.ro[this.newRoomState.gameSetting.gameSpeed]}`}}))}notifyPlayOrderSelectionActiveChanged(){this.oldRoomState.gameSetting.playOrderSelectionActive!=this.newRoomState.gameSetting.playOrderSelectionActive&&(this.wasAndIsHost||(this.newRoomState.gameSetting.playOrderSelectionActive?this.showNotification({key:"strings:roomPage.notifications.enabledPlayOrderSelection"}):this.showNotification({key:"strings:roomPage.notifications.disabledPlayOrderSelection"})))}notifyHostChanged(){this.oldRoomState.hostSession.roomSessionId!=this.newRoomState.hostSession.roomSessionId&&this.showNotification({key:"strings:roomPage.notifications.newHostIs",options:{username:this.newRoomState.hostSession.username}})}notifyPlayerDisconnected(){const e=(0,d.A)(this.newRoomState.getSessions(),"roomSessionId");for(const t of this.oldRoomState.getSessions())null==e[t.roomSessionId]&&(this.oldRoomState.hostSession.roomSessionId==t.roomSessionId?this.showNotification({key:"strings:roomPage.notifications.hostDisconnected",options:{username:t.username}}):null!=t.userId&&this.newRoomState.kickedUserIds.includes(t.userId)?this.showNotification({key:"strings:roomPage.notifications.hostKickedUser",options:{hostUsername:this.newRoomState.hostSession.username,kickedUsername:t.username}}):this.showNotification({key:"strings:roomPage.notifications.userDisconnected",options:{username:t.username}}))}notifyPlayerConnected(){const e=(0,d.A)(this.oldRoomState.getSessions(),"roomSessionId");for(const t of this.newRoomState.getSessions())null==e[t.roomSessionId]&&this.mySessionId!=t.userSessionId&&(t.isBot||this.showNotification({key:"strings:roomPage.notifications.userConnected",options:{username:t.username}}))}notifyPlayerColorChanged(){const e=(0,d.A)(this.oldRoomState.getSessions(),"roomSessionId");for(const t of this.newRoomState.getSessions()){if(t.isBot)continue;const s=e[t.roomSessionId];null!=s&&(s.selectedColor!=t.selectedColor&&this.showNotification({key:"strings:roomPage.notifications.userSelectedColor",options:{username:t.username,color:`${u.DS[t.selectedColor]}`}},h.j.getPlayerColorBuildings(t.selectedColor).settlement))}}showNotification(e,t=r.am.Lightning){o.OV.showNotification(t,e)}constructor(e,t){this.oldRoomState=e,this.newRoomState=t,this.mySessionId=o.sZ.controller.session.id,this.wasAndIsHost=e.isHost(this.mySessionId)&&t.isHost(this.mySessionId)}}},15627:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_language.0c451f80f5552b374e17.svg"},15730:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_ranked.cc2328766ae089287e70.png"},15751:(e,t,s)=>{"use strict";s.d(t,{c:()=>d});var i=s(67908),n=s(70908),r=s(81888),o=s(18587);function a(e){var t;return e.mapEnum!=o.r.freeMap&&(!!e.isMapPremium()&&!(null===(t=r._.userState)||void 0===t?void 0:t.items.hasAccessToPremiumMap(e)))}var c=s(27455),l=s(98560);function d(e){(0,l._)({title:e.name,image:e.image,bodyText:u(e.mapEnum),onSubscribe:(0,c.u)(a(e),i.Qy[e.mapEnum],"map")})}function u(e){switch(e){case i.Qy.Classic4P:return n.a7.t("strings:colonistCommon.gameMaps.classic.4P.description");case i.Qy.Classic4PRandom:return n.a7.tArray("strings:colonistCommon.gameMaps.classic.random4P.description").join("");case i.Qy.SS1HeadingForNewShores3P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.headingForNewShores",{count:3});case i.Qy.SS1HeadingForNewShores4P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.headingForNewShores",{count:4});case i.Qy.SS1HeadingForNewShores56P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.headingForNewShores",{count:6});case i.Qy.TutorialSS1HeadingForNewShores4P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.tutorialHeadingForNewShores4P");case i.Qy.SS2FourIslands3P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.fourIslands",{count:3});case i.Qy.SS2FourIslands4P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.fourIslands",{count:4});case i.Qy.SS2SixIslands56P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.sixIslands");case i.Qy.TutorialSS2FourIslands4P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.tutorialFourIslands4P");case i.Qy.SS3FogIslands3P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.fogIslands",{count:3});case i.Qy.SS3FogIslands4P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.fogIslands",{count:4});case i.Qy.SS3FogIslands56P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.fogIslands",{count:6});case i.Qy.TutorialSS3FogIsland4P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.tutorialFogIslands4P");case i.Qy.SS4ThroughTheDesert3P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.throughTheDesert",{c
1ount:3});case i.Qy.SS4ThroughTheDesert4P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.throughTheDesert",{count:4});case i.Qy.SS4ThroughTheDesert56P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.throughTheDesert",{count:6});case i.Qy.TutorialSS4ThroughTheDesert4P:return n.a7.t("strings:colonistCommon.gameMaps.seafarers.tutorialThroughTheDesert4P");case i.Qy.Earth:case i.Qy.EarthSeafarers:return n.a7.tArray("strings:colonistCommon.gameMaps.fun.earth.description").join("");case i.Qy.USA:return n.a7.tArray("strings:colonistCommon.gameMaps.fun.usa.description").join("");case i.Qy.UK:case i.Qy.UKSeafarers:return n.a7.tArray("strings:colonistCommon.gameMaps.fun.uk.description").join("");case i.Qy.Diamond:return n.a7.tArray("strings:colonistCommon.gameMaps.fun.diamond.description").join("");case i.Qy.Gear:return n.a7.tArray("strings:colonistCommon.gameMaps.fun.gear.description").join("");case i.Qy.Lakes:return n.a7.tArray("strings:colonistCommon.gameMaps.fun.lakes.description").join("");case i.Qy.Pond:return n.a7.tArray("strings:colonistCommon.gameMaps.fun.pond.description").join("");case i.Qy.Twirl:return n.a7.tArray("strings:colonistCommon.gameMaps.fun.twirl.description").join("");case i.Qy.ShuffleBoard:return n.a7.tArray("strings:colonistCommon.gameMaps.fun.shuffleBoard.description").join("");case i.Qy.BlackForest:return n.a7.tArray("strings:colonistCommon.gameMaps.fun.blackForest.description").join("");case i.Qy.Volcano:return n.a7.tArray("strings:colonistCommon.gameMaps.fun.volcano.description").join("");case i.Qy.GoldRush:return n.a7.tArray("strings:colonistCommon.gameMaps.fun.goldRush.description").join("");default:return""}}},15756:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_offer_acceptable.a5cb7ea299386e908402.mp3"},15894:(e,t,s)=>{"use strict";e.exports=s.p+"assets/logo_white.ecffb98e9e500e4dba5d.svg"},15902:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_devcard_bought.46ffc2c18d78b9b26aa1.mp3"},16200:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_bot_count.7337ba934e6e992feb8e.svg"},16208:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_green.d7ea2b2bde643e17efe1.svg"},16508:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_forward.74054acf204e9ff545aa.svg"},16647:(e,t,s)=>{"use strict";e.exports=s.p+"assets/prob_2.08c89e29dd2e12da2ea4.svg"},16703:(e,t,s)=>{"use strict";e.exports=s.p+"assets/social_icon_facebook.b0036e7461385d2356fe.svg"},16845:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_politics_bishop.8f94776d21efcacfa196.svg"},16968:(e,t,s)=>{"use strict";e.exports=s.p+"assets/settlement_silver.c1ebe2cf2c224c47ce21.svg"},17057:(e,t,s)=>{"use strict";s.d(t,{g:()=>i});class i{}},17112:(e,t,s)=>{"use strict";s.d(t,{K:()=>n});var i=s(39853);class n{constructor(){(0,i.AD)()}}},17130:(e,t,s)=>{"use strict";s.d(t,{x:()=>d});var i=s(655),n=s(32398),r=s(81888),o=s(87220),a=s(9029),c=s(55547),l=s(18587);class d{static async shareOrCopyLink(e,t){const s=t?()=>d.getShareableLinkInReplay(t):()=>d.getShareableLinkInGameEnd(e);if(l.r.isUserOnMobileAppOrWeb){const e=await s();if(null==e)return;c.IH.openShareLinkMobileModal(e)}else await d.copyShareableLink(s)}static async getShareableLinkInReplay(e){const t=e.replayData.databaseGameId,s=d.getShareableLinkPerspectiveInReplay(e),i=await d.getShareableLinkWithPerspective(t,s);if(null==i)return;const n=e.getCurrentAction();return d.addActionToShareableLink(i,n)}static async getShareableLinkInGameEnd(e){const t=c.sZ.gameListener.databaseGameId,s=d.getShareableLinkPerspectiveInGameEnd(e);return await d.getShareableLinkWithPerspective(t,s)}static async getShareableLinkWithPerspective(e,t){const s=n.l.apiReplayShareableLink(e,t.toString()),r=await i.m.getRequestHandler(s,void 0);if(null!=r)return r.json}static async copyShareableLink(e){const t="text/plain",s=new ClipboardItem({[t]:(async()=>{const s=void 0!==(0,o.Ak)(window.location.href)?location.href:await e();return null==s?new Blob([""],{type:t}):new Blob([s],{type:t})})()});try{await navigator.clipboard.write([s])}catch{const e=await s.getType(t),i=await e.text(),n=(0,a.cE)(document.body,i,{key:"strings:colonistCommon.utils.emptyString"},"");n.target="_blank",n.click()}}static getShareableLinkPerspectiveInReplay(e){var t;const s=e.replayData.playerUserStates,i=e.replayData.playerPerspective,n=s.find(e=>e.selectedColor===i);if((null===(t=r._.userState)||void 0===t?void 0:t.id)===(null==n?void 0:n.userId))return i;const o=s.find(e=>{var t;return e.userId===(null===(t=r._.userState)||void 0===t?void 0:t.id)});return void 0!==o?o.selectedColor:i}static getShareableLinkPerspectiveInGameEnd(e){const t=e.myColor,s=e.playOrder;return e.isPlayerSpectator?s[0]:t}static addActionToShareableLink(e,t){if(-1===t)return e;const s=new URL(e);return s.searchParams.set(o.qe,t.toString()),s.href}}},17294:(e,t,s)=>{"use strict";e.exports=s.p+"assets/membership_icon_plus.4a202484f09061f93885.svg"},17326:(e,t,s)=>{"use strict";s.d(t,{Lo:()=>r,RD:()=>i,iU:()=>a,j3:()=>o,zz:()=>n});var i=function(e){return e.Popup="popup",e.Fullscreen="fullscreen",e.Discord="discord",e.Mobile="mobile",e}({}),n=function(e){return e.Classic4P="bg",e.Classic56P="56p",e.Seafarers4P="sf",e.CitiesAndKnights4P="ck",e.ColonistRush4P="colonistrush",e}({});function r(e){switch(e){case"bg":return"";case"56p":return"/5-6-player";case"sf":return"/seafarers";case"ck":return"/cities-and-knights";case"colonistrush":return"/colonist-rush"}}function o(e){return"fullscreen"==e?"":`/${e}`}function a(e,t){const s=o(t);return e.endsWith(s)?e:`${e}${s}`}},17332:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_red_5.a762355ebd78a9a928b4.svg"},17399:(e,t,s)=>{"use strict";s.d(t,{CK:()=>u,Ox:()=>a,W:()=>d,fr:()=>h,lx:()=>g,r9:()=>o,rV:()=>m,tu:()=>p,vV:()=>l,yl:()=>c});var i=s(36872),n=s(72239),r=s(35883);const o=1,a=.4;function c(e,t,s){return e+s>t&&e-s<t}function l(e,t){const s="Something went wrong, please contact admins at "+i.gq.SUPPORT_EMAIL+" with copying this log and explaining what actions you took right before this error.";console.log(s),d(e,t)}function d(e,t){console.info(e);for(const e of t)console.info(e)}function u(){window.history.replaceState(null,"",window.location.pathname+window.location.hash)}function h(){history.pushState("",document.title,window.location.pathname+window.location.search)}function p(e){return r.j.getImgPath(e)}function m(e){return{key:`strings:imgAlts.${n.h4.getEnumKey(e,i.am)}`}}function g(e){return{src:p(e),alt:m(e)}}},17564:(e,t,s)=>{"use strict";e.exports=s.p+"assets/base.e094a4c95da0f64d3b22.svg"},17700:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_timer.10c989d4205f3d776717.svg"},17972:(e,t,s)=>{"use strict";s.d(t,{f:()=>r});var i=s(36872),n=s(92524);class r{getProductName(){return this.title}getDefaultPrice(){return"$"+this.price/100}getUSDPrice(){return this.price/100}static getOneTimePurchaseProduct(e,t=1){const s=this.products.get(e);return s.itemQuantity=t,s}static initProducts(e){this.products.set(i.IM.Holiday2023AllAccessPass,new r({type:i.IM.Holiday2023AllAccessPass,title:{key:"strings:storePage.sections.holiday_sale.title",options:{context:"full"}}
1,price:699,discordSKUId:e.passAllAccessHoliday2023,lobbyImage:i.am.StoreMembershipHoliday2023,isActive:()=>!1})),this.products.set(i.IM.GiftPlusMonthly,new r({type:i.IM.GiftPlusMonthly,title:{key:"strings:storePage.membership.title.plus"},price:899,discordSKUId:e.giftMembershipPlus,lobbyImage:i.am.StoreMembershipPlus,isActive:()=>!0})),this.products.set(i.IM.GiftPremiumMonthly,new r({type:i.IM.GiftPremiumMonthly,title:{key:"strings:storePage.membership.title.premium"},price:1899,discordSKUId:e.giftMembershipPremium,lobbyImage:i.am.StoreMembershipPremium,isActive:()=>!0})),this.products.set(i.IM.GiftEliteMonthly,new r({type:i.IM.GiftEliteMonthly,title:{key:"strings:storePage.membership.title.elite"},price:2499,discordSKUId:e.giftMembershipElite,lobbyImage:i.am.StoreMembershipElite,isActive:()=>!0})),this.products.set(i.IM.GiftPlusYearly,new r({type:i.IM.GiftPlusYearly,title:{key:"strings:storePage.membership.title.plus"},price:8388,discordSKUId:e.giftMembershipPlusYearly,lobbyImage:i.am.StoreMembershipPlus,isActive:()=>!0})),this.products.set(i.IM.GiftPremiumYearly,new r({type:i.IM.GiftPremiumYearly,title:{key:"strings:storePage.membership.title.premium"},price:17988,discordSKUId:e.giftMembershipPremiumYearly,lobbyImage:i.am.StoreMembershipPremium,isActive:()=>!0})),this.products.set(i.IM.GiftEliteYearly,new r({type:i.IM.GiftEliteYearly,title:{key:"strings:storePage.membership.title.elite"},price:23988,discordSKUId:e.giftMembershipEliteYearly,lobbyImage:i.am.StoreMembershipElite,isActive:()=>!0}))}constructor(e){this.storeProductType=n.l6.OneTimePurchase,this.stripeCheckoutType=n.hg.Payment,this.itemQuantity=1,Object.assign(this,e)}}r.products=new Map},18366:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_trade_merchant_fleet.7f798e55127b89f1c966.svg"},18487:(e,t,s)=>{"use strict";s.d(t,{V:()=>a});var i=s(59518),n=s(9029),r=s(90676),o=s(18587);class a{constructor(e){const t=e.getElementsByClassName("language-button")[0];if(null==t)return;(0,n.G0)(t,()=>(0,i.y)()),(0,r.vy)(t,{key:"strings:homePage.footer.changeLanguageButtonTooltip"},"top",void 0,"small");const s=t.querySelector("div");s&&(0,n.oB)(s,{key:"strings:colonistCommon.utils.#buffer",options:{value:o.r.language}})}}},18587:(e,t,s)=>{"use strict";s.d(t,{r:()=>r});var i=s(44529),n=s(96990);class r{}r.language=window.language,r.isProduction=window.isProduction,r.freeMap=window.freeMap,r.onlineCount=window.onlineCount,r.gamesToday=window.gamesToday,r.discordChannelUrl=window.discordChannelUrl,r.socketDebugActive=window.socketDebugActive,r.ejsSocketServerWss=window.socketServerWSS,r.logRocketId=window.logRocketId,r.posthogKey=window.posthogKey,r.posthogHost=window.posthogHost,r.vliPrerollId=window.vliPreRoll,r.isUserOnDiscord=window.isUserOnDiscord,r.discordSDKClientId=window.discordSDKClientId,r.isUserOnMobileWebBrowser=n.N.isUserOnMobileWebBrowser(),r.isUserOnMobileAppOrWeb=n.N.isUserOnMobileAppOrWeb(),r.isUserOnMobile=window.isUserOnMobile,r.isUserOnTabletApp=n.N.isUserOnTabletApp(),r.isUserOnDiscordMobile=window.isUserOnDiscordMobile||n.N.isUserOnDiscordMobile(),r.shouldDisplayNewMobileGameUI=i.p.isPortraitGamePlayEnabled(),r.discordSKUIds=window.discordSKUIds,r.versionNumber=window.versionNumber,r.analyticsActive=window.analyticsActive,r.canPurchaseCoinsOnDiscord=window.canPurchaseCoinsOnDiscord,r.showConsoleLogUI=window.showConsoleLogUI,r.showVliAdAtBottomInGame=window.showVliAdAtBottomInGame,r.frontendSentryDSN=window.frontendSentryDSN,r.mobileAp
1pSentryDSN=window.mobileAppSentryDSN,r.frontendSentryEnvironment=window.frontendSentryEnvironment,r.frontendSentryTraceSampleRate=window.frontendSentryTraceSampleRate,r.vliPublicKey=window.vliPublicKey,r.vliAdvKey=window.vliAdvKey,r.vliModeSelector728x90=window.vliModeSelector728x90,r.vliInGameLeft=window.vliInGameLeft,r.vliInGameRight=window.vliInGameRight,r.vliInGameBottom=window.vliInGameBottom,r.supportEmail=window.supportEmail,r.shouldHideStoreOnMobile=window.shouldHideStoreOnMobile&&n.N.isUserOnMobileAppOrWeb(),r.shouldHideAdsOnMobile=window.shouldHideAdsOnMobile,r.hotjarTrackingCode=window.hotjarTrackingCode,r.shouldEnableNativeIOSPaymentsOnMobile=window.shouldEnableNativeIOSPaymentsOnMobile,r.shouldEnableNativeAndroidPaymentsOnMobile=window.shouldEnableNativeAndroidPaymentsOnMobile,r.isPushNotificationsEnabled=window.isPushNotificationsEnabled,r.rankedPrerollAdsEnabled=window.rankedPrerollAdsEnabled,r.showUpdateAppPopupForVersion=window.showUpdateAppPopupForVersion,r.shouldDisableStoreOnAndroidMobile=window.shouldDisableStoreOnAndroidMobile,r.shouldDisableIAPForExternalUsersOnMobile=window.shouldDisableIAPForExternalUsersOnMobile,r.discordActivityMobileOrientation=window.discordActivityMobileOrientation,r.helplyWidgetId=window.helplyWidgetId,r.stripePublicKey=window.stripePublicKey},18797:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_cloth.d0d158fa81f0eb0b0a3b.svg"},19136:(e,t,s)=>{"use strict";s.d(t,{M:()=>i});var i=function(e){return e.Store="store",e}({})},19227:(e,t,s)=>{"use strict";s.d(t,{g:()=>n});const i=/^(269|85)$/.test(s.j)?["https://","http://localhost:8080","mailto:"]:null;class n{static isExternalLink(e){return i.some(t=>e.startsWith(t))}static getElementHref(e){var t;if(null!=e)return"store-href"==e.getAttribute("id")?"/store":null===(t=e.closest("a"))||void 0===t?void 0:t.getAttribute("href")}init(){this.overrideWindowOpen(),document.addEventListener("click",e=>this.interceptLinkClicks(e))}openExternalLink(e){this.openExternalLinkHandler(e)}overrideWindowOpen(){const e=window.open;window.open=(t,s,i)=>{var r;const o=null!=t?String(t):"";return n.isExternalLink(o)?(this.openExternalLink(o),null):(null===(r=this.handleInternalNavigation)||void 0===r?void 0:r.call(this,o))?null:e.call(window,t,s,i)}}interceptLinkClicks(e){const t=e.target,s=n.getElementHref(t);if(s)return n.isExternalLink(s)?(e.preventDefault(),void this.openExternalLink(s)):void(null!=this.handleInternalNavigation&&this.handleInternalNavigation(s)&&e.preventDefault())}constructor(e,t){this.openExternalLinkHandler=e,this.handleInternalNavigation=t}}},19590:(e,t,s)=>{"use strict";s.d(t,{bi:()=>k,wD:()=>S,jn:()=>P,rS:()=>R.r,$c:()=>w,B5:()=>p.B5,j:()=>p.j,Lg:()=>p.Lg,rP:()=>g,cN:()=>X,cR:()=>N,BW:()=>te,Gu:()=>Q,Wl:()=>q,g_:()=>Z,Ro:()=>J,vi:()=>Y,w$:()=>z,ZM:()=>j,HS:()=>ie,T5:()=>F,oh:()=>U,de:()=>K,G8:()=>W,qF:()=>b,bR:()=>p.bR,oI:()=>u,wt:()=>D,s8:()=>x,NC:()=>E,uR:()=>M,jP:()=>B,Jc:()=>c});var i=s(54801);if(837!=s.j)var n=s(29267);var r=s(72239),o=s(15123);if(837!=s.j)var a=s(13627);function c(e){switch(e){case o.um.KnightActiveLevel1:case o.um.KnightActiveLevel2:case o.um.KnightActiveLevel3:case o.um.KnightInactiveLevel1:case o.um.KnightInactiveLevel2:case o.um.KnightInactiveLevel3:return!0;default:return!1}}class l{get owner(){return this.state.owner}get buildingType(){return this.state.buildingType}get restrictedStartingPlacement(){return null!=this.state.restrictedStartingPlacement&&this.state.restrictedStartingPlacement}get bonuses(){return null==this.state.bonuses?this.state.bonuses=[]:this.state.bonuses}sameCornerLocation(e){return this.hexCorner.x==e.hexCorner.x&&(this.hexCorner.y==e.hexCorner.y&&this.hexCorner.z==e.hexCorner.z)}sameCorner(e){return this.owner==e.owner&&(this.buildingType==e.buildingType&&this.sameCornerLocation(e))}hasCornerBonusOfType(e){for(const t of this.bonuses)if(t==e)return!0;return!1}doesCornerHaveMetropolis(){return!!r.lv.elementInArray(this.bonuses,o.rG.MetropolisPolitics)||(!!r.lv.elementInArray(this.bonuses,o.rG.MetropolisScience)||!!r.lv.elementInArray(this.bonuses,o.rG.MetropolisTrade))}getMetropolis(){return r.lv.elementInArray(this.bonuses,o.rG.MetropolisPolitics)?o.rG.MetropolisPolitics:r.lv.elementInArray(this.bonuses,o.rG.MetropolisScience)?o.rG.MetropolisScience:r.lv.elementInArray(this.bonuses,o.rG.MetropolisTrade)?o.rG.MetropolisTrade:void 0}
1removeCornerBonus(e){r.lv.removeElementFromArray(this.bonuses,e)}constructor(e){this.state=e,this.hexCorner=new p.B5(this.state.x,this.state.y,this.state.z)}}class d{get owner(){return this.state.owner}get type(){return this.state.type}sameEdge(e){return this.owner==e.owner&&(this.type==e.type&&(this.hexEdge.x==e.hexEdge.x&&(this.hexEdge.y==e.hexEdge.y&&this.hexEdge.z==e.hexEdge.z)))}constructor(e){this.state=e,this.hexEdge=new p.j(this.state.x,this.state.y,this.state.z)}}class u{get tileType(){return this.state.type}get diceNumber(){return this.state.diceNumber}get diceProbability(){switch(this.diceNumber){case 2:case 12:return 1;case 3:case 11:return 2;case 4:case 10:return 3;case 5:case 9:return 4;case 6:case 8:return 5}return 0}sameTileHex(e){return e.hexFace.x==this.hexFace.x&&e.hexFace.y==this.hexFace.y}isTileHexNeighbor(e){const t=e.hexFace.neighbors();for(const e of t)if(e.x==this.hexFace.x&&e.y==this.hexFace.y)return!0;return!1}isTileLand(){return this.tileType!=a.m1.Sea&&this.tileType!=a.m1.Fog}constructor(e){this.state=e,this.hexFace=new p.Lg(this.state.x,this.state.y)}}class h{traverseConnectedPathUsingDepthFirstSearch(e,t,s){if(!t.includes(e)&&e.owner==this.player){t.push(e),t.length>this.longestConnectedRoadEdges.length&&(this.longestConnectedRoadEdges=[...t]),this.allConnectedTileEdges.includes(e)||this.allConnectedTileEdges.push(e);for(const i of e.hexEdge.endPoints()){const n=this.mapState.tileState.getTileCorner(i);if(null==n)continue;const r=this.mapState.tileState.getTileCornerIndex(n.hexCorner);if(null==r)continue;n.owner==this.player&&this.interConnectedCornerBuildings.push(r);null==n.owner&&!this.interConnectedEmptyNodes.includes(r)&&this.interConnectedEmptyNodes.push(r);const o=n.owner!=this.player&&null!=n.owner;if(o&&!this.interConnectedEnemyBuildings.includes(r)&&this.interConnectedEnemyBuildings.push(r),!this.ignoreOpponentBuildings&&o)continue;const a=n.owner==this.player;if(!this.ignoreMyBuildings&&a)continue;if(!(null!=s&&s.sameCorner(n)))for(const s of n.hexCorner.touchingEdges()){const i=this.mapState.tileState.getTileEdge(s);null!=i&&(this.edgeMap.includes(i)&&this.isEdgeTransitionContinuous(i,e,n)&&this.traverseConnectedPathUsingDepthFirstSearch(i,t,n))}}t.pop()}}isEdgeTransitionContinuous(e,t,s){return e.type==t.type||!c(s.buildingType)&&s.owner==this.player}constructor(e,t,s,i,n=!1,r=!0){this.player=e,this.edgeMap=t,this.mapState=i,this.ignoreOpponentBuildings=n,this.ignoreMyBuildings=r,this.longestConnectedRoadEdges=[],this.allConnectedTileEdges=[],this.interConnectedCornerBuildings=[],this.interConnectedEmptyNodes=[],this.interConnectedEnemyBuildings=[];this.traverseConnectedPathUsingDepthFirstSearch(s,[])}}if(837!=s.j)var p=s(25204);class m{get tiles(){return this._tiles}get tileCorners(){return this._tileCorners}get tileEdges(){return this._tileEdges}addNewTile(e){this._tiles.push(e);const t=this.tiles.length-1;return this.tileHexStates[t]=e.state,this.indexTileHex(e,t),t}addNewCorner(e){this._tileCorners.push(e);const t=this.tileCorners.length-1;this.tileCornerStates[t]=e.state,this.indexMapCorner(e,t)}addNewEdge(e){this._tileEdges.push(e);const t=this.tileEdges.length-1;this.tileEdgeStates[t]=e.state,this.indexMapEdges(e,t)}loadMap(){this.loadMapTiles(),this.loadMapCorners(),this.loadMapEdges()}loadMapTiles(){for(const e in this.tileHexStates){const t=this.tileHexStates[e];if(null==t)continue;const s=new u(t);this._tiles.push(s);const i=this.tiles.length-1;this.indexTileHex(s,i)}}indexTileHex(e,t){var s;const i=null!==(s=this.tileHexIndexes[e.hexFace.x])&&void 0!==s?s:[];i[e.hexFace.y]=t,this.tileHexIndexes[e.hexFace.x]=i}loadMapCorners(){for(const e in this.tileCornerStates){const t=this.tileCornerStates[e];if(null==t)continue;const s=new l(t);this._tileCorners.push(s);const i=this.tileCorners.length-1;this.indexMapCorner(s,i)}}indexMapCorner(e,t){var s;const i=null!==(s=this.tileCornerIndexes[e.hexCorner.x])&&void 0!==s?s:[];var n;const r=null!==(n=i[e.hexCorner.y])&&void 0!==n?n:[];r[e.hexCorner.z]=t,i[e.hexCorner.y]=r,this.tileCornerIndexes[e.hexCorner.x]=i}loadMapEdges(){for(const e in this.tileEdgeStates){const t=this.tileEdgeStates[e];if(null==t)continue;const s=new d(t);this._tileEdges.push(s);const i=this.tileEdges.length-1;this.indexMapEdges(s,i)}}indexMapEdges(e,t){var s;const i=null!==(s=this.tileEdgeIndexes[e.hexEdge.x])&&void 0!==s?s:[];var n;const r=null!==(n=i[e.hexEdge.y])&&void 0!==n?n:[];r[e.hexEdge.z]=t,i[e.hexEdge.y]=r,this.tileEdgeIndexes[e.hexEdge.x]=i}getTileHexIndex(e){const t=this.tileHexIndexes[e.x];if(null!=t)return t[e.y]}getTileCornerIndex(e){const t=this.tileCornerIndexes[e.x];if(null==t)return;const s=t[e.y];return null!=s?s[e.z]:void 0}getTileEdgeIndex(e){const t=this.tileEdgeIndexes[e.x];if(null==t)return;const s=t[e.y];return null!=s?s[e.z]:void 0}getTileHex(e){const t=this.getTileHexIndex(e);if(null==t)return;const s=this.tiles[t];return null!=s&&s.hexFace.sameFace(e)?s:void 0}getTileCorner(e){const t=this.getTileCornerIndex(e);if(null==t)return;const s=this.tileCorners[t];return null!=s&&s.hexCorner.sameCorner(e)?s:void 0}getTileEdge(e){const t=this.getTileEdgeIndex(e);if(null==t)return;const s=this.tileEdges[t];return null!=s&&s.hexEdge.sameEdge(e)?s:void 0}isEdgeTouchingLand(e){for(const t of e.hexEdge.touchingFaces()){const e=this.getTileHex(t);if(null!=e&&e.isTileLand())return!0}return!1}isCornerTouchingLand(e){for(const t of e.hexCorner.touchingFaces()){const e=this.getTileHex(t);if(null!=e&&e.isTileLand())return!0}return!1}isEdgeTouchingSea(e){for(const t of e.hexEdge.touchingFaces()){const e=this.getTileHex(t);if(null==e)return!0;
1if(e.tileType==a.m1.Sea)return!0}return!1}isCornerTouchingSea(e){for(const t of e.hexCorner.touchingFaces()){const e=this.getTileHex(t);if(null==e)return!0;if(e.tileType==a.m1.Sea)return!0}return!1}isEdgeOnShore(e){const t=this.getTileEdge(e);return null!=t&&(!!this.isEdgeTouchingLand(t)&&!!this.isEdgeTouchingSea(t))}isCornerOnShore(e){const t=this.getTileCorner(e);return null!=t&&(!!this.isCornerTouchingLand(t)&&!!this.isCornerTouchingSea(t))}isTileOnShore(e){if(!e.isTileLand())return!1;for(const t of e.hexFace.neighbors()){const e=this.getTileHex(t);if(null==e)return!0;if(e.tileType==a.m1.Sea)return!0}return!1}getPlacedEdgePieceCountForPlayer(e,t){let s=0;for(const i in this.tileEdgeStates){const n=this.tileEdgeStates[i];null!=n&&(n.type==e&&n.owner==t&&(s+=1))}return s}getPlacedCornerBuildingCountForPlayer(e,t){let s=0;for(const i in this.tileCornerStates){const n=this.tileCornerStates[i];null!=n&&(n.buildingType==e&&n.owner==t&&(s+=1))}return s}constructor(e,t,s){this._tiles=[],this._tileCorners=[],this._tileEdges=[],this.tileHexStates=e,this.tileCornerStates=t,this.tileEdgeStates=s,this.tileHexIndexes=[],this.tileCornerIndexes=[],this.tileEdgeIndexes=[],this.loadMap()}}class g{isPortOnEastSideOfTile(e){const t=new p.j(e.hexFace.x,e.hexFace.y+1,n.L9.NorthWest);if(this.portState.isPortOnEdge(t))return!0;const s=new p.j(e.hexFace.x+1,e.hexFace.y,n.L9.West);if(this.portState.isPortOnEdge(s))return!0;const i=new p.j(e.hexFace.x+1,e.hexFace.y-1,n.L9.SouthWest);return!!this.portState.isPortOnEdge(i)}isCornerKnightAndIsKnightNotTouchingEdgeType(e,t,s){if(!c(t.buildingType))return!1;for(const i of t.hexCorner.touchingEdges()){const t=this.tileState.getTileEdge(i);if(null!=t&&(null!=t.type&&t.owner==e&&t.type==s))return!1}return!0}areAdjacentCornersEmpty(e){for(const t of e.hexCorner.adjacentCorners()){const e=this.tileState.getTileCorner(t);if(null!=e&&(null!=e.buildingType&&!c(e.buildingType)))return!1}return!0}areAdjacentEdgesEmpty(e){for(const t of e.hexCorner.touchingEdges()){const e=this.tileState.getTileEdge(t);if(null!=e&&null!=e.type)return!1}return!0}generateEdgeMapForPlayerAndPieces(e,t){const s=[];for(const i of this.tileState.tileEdges)i.owner==e&&null!=i.type&&t.includes(i.type)&&s.push(i);return s}willMovingEdgeTypeBreakClosedRoute(e,t,s){const i=this.generateEdgeMapForPlayerAndPieces(e,[s]),n=new h(e,i,t,this,!0,!1);if(this.isEdgeTypeAtTheEndOfARoute(t,s))return!1;return!!(r.lv.removeDuplicatesFromArray([...n.interConnectedCornerBuildings]).length>=2)||!this.edgeCaseIsEdgePartOfLoopAndTouchingSingleBuilding(t,n.interConnectedCornerBuildings)&&!this.edgeCaseIsEdgePartOfLoopNotTouchingBuilding(e,t,i,s)}edgeCaseIsEdgePartOfLoopAndTouchingSingleBuilding(e,t){if(t.length<2)return!1;const s=r.lv.removeDuplicatesFromArray(t);if(!(1==s.length))return!1;const i=s[0],n=this.tileState.tileCorners[i];if(!(e.owner==n.owner))return!1;for(const t of e.hexEdge.endPoints())if(t.sameCorner(n.hexCorner))return!0;return!1}edgeCaseIsEdgePartOfLoopNotTouchingBuilding(e,t,s,i){r.lv.removeElementFromArray(s,t);const n=s;for(const s of t.hexEdge.endPoints()){if(null!=this.tileState.getTileCorner(s))for(const r of s.touchingEdges()){const s=this.tileState.getTileEdge(r);if(null==s)continue;if(s.sameEdge(t))continue;if(s.owner!=t.owner)continue;if(s.type!=i)continue;const o=new h(e,n,s,this,true,false);if(this.edgeCaseIsTouchingEdgeLoopingBackToOtherEndOfEdge(t,o.interConnectedEmptyNodes))return!0}}return!1}edgeCaseIsTouchingEdgeLoopingBackToOtherEndOfEdge(e,t){const s=[];for(const t of e.hexEdge.endPoints()){const e=this.tileState.getTileCorner(t);if(null==e)continue;const i=this.tileState.getTileCornerIndex(e.hexCorner);null!=i&&s.push(i)}for(const e of s)if(!t.includes(e))return!1;return!0}isEdgeTypeAtTheEndOfARoute(e,t){const s=[];for(const i of e.hexEdge.endPoints()){const n=this.tileState.getTileCorner(i);if(null!=n)if(n.owner!=e.owner)for(const r of i.touchingEdges()){const i=this.tileState.getTileEdge(r);null!=i&&(i.sameEdge(e)||i.owner==e.owner&&i.type==t&&(s.includes(n)||s.push(n)))}else s.push(n)}return s.length<2}
1arePlayersProtectedByFriendlyRobberTouchingTile(e,t){if(0==e.length)return!1;const s=this.playersWithBuildingsAroundTile(t);for(const t of s)if(e.includes(t))return!0;return!1}doPlayersProtectedByFriendlyRobberHaveShipTouchingTile(e,t){if(0==e.length)return!1;const s=this.playersWithEdgePieceAroundTile(t,n.K2.Ship);for(const t of s)if(e.includes(t))return!0;return!1}playersWithBuildingsAroundTile(e){const t=[];for(const s of this.tileState.tiles[e].hexFace.corners()){const e=this.tileState.getTileCorner(s);null!=e&&(null!=e.owner&&(c(e.buildingType)||t.includes(e.owner)||t.push(e.owner)))}return t}playersWithEdgePieceAroundTile(e,t){const s=[];for(const i of this.tileState.tiles[e].hexFace.edges()){const e=this.tileState.getTileEdge(i);null!=e&&(null!=e.owner&&e.type==t&&(s.includes(e.owner)||s.push(e.owner)))}return s}getMapPipStatistics(){const e={};for(const s of this.tileState.tiles){var t;const i=null!==(t=e[s.tileType])&&void 0!==t?t:0;e[s.tileType]=i+s.diceProbability}return e}getLongestRouteTouchingTileEdge(e){if(null==e.owner)return[];if(null==this.tileState.getTileEdgeIndex(e.hexEdge))return[];const t=!1,s=!0,i=this.generateEdgeMapForPlayerAndPieces(e.owner,[n.K2.Road,n.K2.Ship]),r=new h(e.owner,i,e,this,t,s).allConnectedTileEdges;let o=[];for(const i of r){const n=new h(e.owner,r,i,this,t,s);0!=n.longestConnectedRoadEdges.includes(e)&&(o.length>=n.longestConnectedRoadEdges.length||(o=[...n.longestConnectedRoadEdges]))}return o}constructor(e){this.tileState=new m(e.tileHexStates,e.tileCornerStates,e.tileEdgeStates),this.portState=new i.Vd(e.portEdgeStates),this.fogTileGroupStates=e.fogTileGroupStates}}var f=s(36872),y=s(35190);class v{hasCardsInInventory(e){const t=r.lv.removeDuplicatesFromArray(e);for(const s of t){if(r.lv.countOccurenceOfValueInArray(this.cards,s)<r.lv.countOccurenceOfValueInArray(e,s))return!1}return!0}getCardsOfType(e){const t=[];for(const s of this.cards){const i=y.LY.getCardDataForCard(s);null!=i&&(i.cardTypeEnum==e&&t.push(s))}return t}hasCardOfType(e){for(const t of this.cards){const s=y.LY.getCardDataForCard(t);if(null!=s&&s.cardTypeEnum==e)return!0}return!1}getNumberOfCardsInInventory(){return this.cards.length}getCardCountOfType(e){return this.getCardsOfType(e).length}getCardCountForCard(e){return r.lv.countOccurenceOfValueInArray(this.cards,e)}constructor(e){this.state=e}}class S extends v{get cards(){const e=[];for(const t of this.state.cards)e.push(t);return e}}class b{get color(){return this.state.color}get displayIcon(){return this.isActiveHumanSession?this.userState.databaseIcon:f.am.Bot}get profilePictureUrl(){return this.userState.profilePictureUrl}get username(){return this.userState.username}get userId(){return this.userState.userId}get isConnected(){return this.state.isConnected}get isUser(){return null!=this.userState.userId}get isActiveHumanSession(){return!!this.isUser&&!!this.isConnected}get cardDiscardLimit(){return this.state.cardDiscardLimit}get victoryPointsState(){return this.state.victoryPointsState}get bankTradeRatiosState(){return this.state.bankTradeRatiosState}get isLocalDiscordPlayer(){return null!=this.profilePictureUrl}get isPlayingOnDiscord(){return null!=this.userState.deviceType&&f.Ej.includes(this.userState.deviceType)}hasResourceCardsInHand(e){return this.resourceCards.hasCardsInInventory(e)}constructor(e,t,s){this.state=e,this.userState=t,this.resourceCards=new S(this.state.resourceCards),this.isCurrentUser=null!=t.userId&&t.userId===s}}var C=s(52955);class P extends(/^(251|837)$/.test(s.j)?null:v){get cards(){const e=[];for(const t in this.state){const s=Number(t);if("number"!=typeof s)continue;const i=this.state[s];P.isCardCountValid(i)&&(0!=i&&e.push(...Array(i).fill(s)))}return e}static isCardCountValid(e){return(0,C.Li)(e)}}class k{get hideBankCards(){return this.state.hideBankCards}constructor(e){this.state=e,this.resourceCards=new P(this.state.resourceCards)}}if(!/^(251|837)$/.test(s.j))var T=s(55935);if(!/^(251|837)$/.test(s.j))var A=s(7136);if(!/^(251|837)$/.test(s.j))var R=s(47177);class w{getPlayerValidator(e){const t=this.playerValidators.get(e);if(null==t)throw new Error(`PlayerValidator for color ${T.DS[e]} not found`);return t}getPlayersTakingAction(){const e=[];for(const t of this.playerValidators.values())this.isPlayerTakingOutOfTurnAction(t.color)&&e.push(t.color);return 0==e.length?this.currentStateValidator.currentTurnPlayers:e}isPlayerTakingOutOfTurnAction(e){const t=this.gameState.playerStates[e];if(void 0===t)return!1;if(t.isTakingAction)return!0;
1if(Object.keys(this.gameState.tradeState.activeOffers).length>0&&this.currentStateValidator.currentTurnPlayers.includes(e))return!0;for(const t of Object.values(this.gameState.tradeState.activeOffers))if(null!=t){if(1==t.playersCreatingCounterOffer[e])return!0;if(t.playerResponses[e]==A._.PendingResponse)return!0}return!1}constructor(e,t){var s,i,n,r;this.playerValidators=new Map,this.gameState=e,this.userStates=t,this.mapValidator=new g(e.mapState);const o=null===(s=e.experimentalMechanicState)||void 0===s?void 0:s.currentState,a=null===(i=e.experimentalMechanicState)||void 0===i?void 0:i.mechanicTurnColonistRushState,c=null===(n=e.experimentalMechanicState)||void 0===n?void 0:n.mechanicRobberColonistRushState,l=null===(r=e.experimentalMechanicState)||void 0===r?void 0:r.playerStates,d=Array.from(this.playerValidators.keys());this.currentStateValidator=new R.r(e.currentState,o,a,l,d,c);for(const e in this.gameState.playerStates){const t=Number(e),s=this.gameState.playerStates[t];if(null==s)continue;const i=this.userStates.find(e=>e.selectedColor===t);if(null==i)continue;const n=new b(s,i);this.playerValidators.set(n.color,n)}}}if(!/^(251|837)$/.test(s.j))var I=s(13567);var M,_=s(46581),E=function(e){return e[e.ProposalWanted=0]="ProposalWanted",e[e.ProposalOffered=1]="ProposalOffered",e[e.WantedSelector=2]="WantedSelector",e[e.OfferedSelector=3]="OfferedSelector",e}({}),D=function(e){return e[e.Accept=0]="Accept",e[e.Reject=1]="Reject",e[e.CounterOfferCreating=2]="CounterOfferCreating",e[e.CounterOfferCreatedOrCanceled=3]="CounterOfferCreatedOrCanceled",e}({}),L=function(e){return e[e.AvatarContainer=0]="AvatarContainer",e[e.ResponseButtons=1]="ResponseButtons",e}({});if(/^(251|837)$/.test(s.j))I=s(13567);if(/^(251|837)$/.test(s.j))A=s(7136);!function(e){e.tradeMaximumWantedResources=6,e.delayClosingTradeWhenAllPlayersReject=1500,e.DEFAULT_BANK_TRADE_RATIO=4,e.getRandomTradeDelayBetweenBounds=function(e){return r.n.randomIntBetween(e.mininumTime,e.maximumTime)},e.botGamePlayerAutoRejectTradeIfDoesntHaveResourcesDelay={mininumTime:4e3,maximumTime:6e3},e.humanGamePlayerAutoRejectTradeIfDoesntHaveResourcesDelay={mininumTime:5e3,maximumTime:7e3},e.botTradeFastResponseDelay={mininumTime:500,maximumTime:1e3},e.botTradeSlowResponseDelay={mininumTime:4e3,maximumTime:6e3},e.botTradeExecutionIfAllPlayersHaveRespondedDelay={mininumTime:500,maximumTime:1e3},e.botTradeExecutionIfWaitingForPlayersResponseDelay={mininumTime:1e4,maximumTime:12e3},e.isOpenEndedTrade=function(e,t){return!!e.includes(I.O3.AnyResource)||!!t.includes(I.O3.AnyResource)},e.getBankTradeRatioError=function(e,t,s={}){const i=r.lv.removeDuplicatesFromArray(e);if(i.length<=0)return{error:{key:"strings:game.errors.tradeErrors.invalidBankTradeRatios"},payload:{isBankTradeButtonDisabled:!0}};if(0==t.length)return{error:{key:"strings:game.errors.tradeErrors.offerIncomplete"}};let n=0;const o=[];for(const t of i){var a;const i=null!==(a=s[t])&&void 0!==a?a:4,c=r.lv.countOccurenceOfValueInArray(e,t);if(c%i!=0){o.push(t);continue}const l=c/i;l<1?o.push(t):n+=l}if(o.length>0)return{error:{key:"strings:game.errors.tradeErrors.invalidBankTradeRatios"},payload:{isBankTradeButtonDisabled:!0,highlightCards:{cardsToHighlight:o,locations:[E.ProposalOffered]}}};const c=r.lv.removeDuplicatesFromArray(t);return n!=t.length?{error:{key:"strings:game.errors.tradeErrors.bankTradeIncorrectWantedCardCount",options:{count:n}},payload:{isBankTradeButtonDisabled:!0,highlightCards:{cardsToHighlight:c,locations:[E.ProposalWanted]}}}:void 0},e.getBankTradeRatioForCard=function(t,s){var i;const n=null===(i=t.find(e=>e.resource==s))||void 0===i?void 0:i.tradeRatio;return null!=n?n:e.DEFAULT_BANK_TRADE_RATIO},e.createPlayerTradeState=function(e,t,s,i){const n=null!=s.counterOfferInResponseToTradeId,r={};for(const t of e){(n?i.includes(t):t==s.creator)||(r[t]=A._.PendingResponse)}const o={};for(const t of e)o[t]=!1;return{id:t,creator:s.creator,offeredResources:s.offeredResources,wantedResources:s.wantedResources,playerResponses:r,counterOfferInResponseToTradeId:s.counterOfferInResponseToTradeId,playersCreatingCounterOffer:o,...null!=s.forcedResponse?{forcedResponse:s.forcedResponse}:void 0}}}(M||(M={}));class B{get tradeExecutorColor(){return null!=this.state.counterOfferInResponseToTradeId?this.currentTurnPlayerColors[0]:this.state.creator}getGivingResources(e){const t=this.isCounterOfferByNonTradeExecutor();return this.isTradeExecutor(e)?t?this.state.wantedResources:this.state.offeredResources:t?this.state.offeredResources:this.state.wantedResources}getReceivingResources(e){const t=this.isCounterOfferByNonTradeExecutor();return this.isTradeExecutor(e)?t?this.state.offeredResources:this.state.wantedResources:t?this.state.wantedResources:this.state.offeredResources}getRecipientColor(e){return this.isTradeExecutor(e)?T.DS.None:this.tradeExecutorColor}getPlayerResponseStates(){const e=[];for(const t in this.state.playerResponses)e.push({player:Number(t),responseStatus:this.state.playerResponses[t]});return e}getPlayerResponseState(e){const t=this.state.playerResponses[e];if(null!=t)return{player:Number(e),responseStatus:t}}getPlayersCreatingCounterOffer(){const e=[];for(const t in this.state.playersCreatingCounterOffer)e.push({player:Number(t),isCreatingCounterOffer:this.state.playersCreatingCounterOffer[t]});return e}getExecuteTradeActionStatus(e){const t=this.playerStates.get(e);if(null==t)return{canTakeAction:!1,displayActionButton:!1};if(!this.isTradeExecutor(e))return{canTakeAction:!1,displayActionButton:!1};if(this.isOpenEndedTrade())return{canTakeAction:!1,displayActionButton:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.tradeErrors.cannotExecuteOpenEndedTrade"}};const s=this.getTradeExecutorOfferedResources();return t.hasResourceCardsInHand(s)?{canTakeAction:!0,displayActionButton:!0}:{canTakeAction:!1,displayActionButton:!0,errorMessageIfCantTakeAction:{key:"strings:game.errors.tradeErrors.invalidResources"}}}getAcceptTradeActionStatus(e){if(this.isTradeExecutor(e))return{canTakeAction:!1,displayActionButton:!1};const t=this.playerStates.get(e);if(null==t)return{canTakeAction:!1,displayActionButton:!1};if(this.isOpenEndedTrade())return{canTakeAction:!1,displayActionButton:!1};if(_.LF.doesPlayer1HaveAnEmbargoAgainstPlayer2(this.embargoState,this.tradeExecutorColor,e))return{canTakeAction:!1,displayActionButton:!0,errorMessageIfCantTakeAction:{key:"strings:game.errors.tradeErrors.playerBlockedTradingWithYou",options:{playerUsername:this.getTradeExecutorPlayerUsername()}}};const s=this.getTradeExecutorWantedResources();return t.hasResourceCardsInHand(s)?{canTakeAction:!0,displayActionButton:!0}:{canTakeAction:!1,displayActionButton:!0,errorMessageIfCantTakeAction:{key:"strings:game.errors.tradeErrors.invalidResources"}}}isPlayerUnableToAcceptTrade(e){if(e==T.DS.None)return!1;return this.isTradeExecutor(e)?this.isTradeExecutorUnableToAcceptTrade(e):this.isOtherPlayerUnableToAcceptTrade(e)}getTradeAutoRejectionTime(e,t){if(0==this.doesPlayerHaveAnyCardToTrade(t))return 0;const s=r.xU.getDefaultTradeAutoRejectionTimeByGameSpeed(e);if(0==this.isPlayerUnableToAcceptTrade(t))return s;const i=r.Re.MILLISECONDS,n=.75*s;return r.n.randomNumberBetweenFloat(n-i,n+i)}isTradeExecutor(e){if(!(null!=this.state.counterOfferInResponseToTradeId))return this.state.creator==e;return this.currentTurnPlayerColors.includes(e)}doesPlayerHaveAnyCardToTrade(e){const t=this.playerStates.get(e);return null==t||t.resourceCards.getNumberOfCardsInInventory()>0}isTradeExecutorUnableToAcceptTrade(e){return!this.isOpenEndedTrade()&&!this.getExecuteTradeActionStatus(e).canTakeAction}isOtherPlayerUnableToAcceptTrade(e){return this.isOpenEndedTrade()?this.shouldOtherPlayerFastAutoRejectOpenEndedTrade(e):!this.getAcceptTradeActionStatus(e).canTakeAction}shouldOtherPlayerFastAutoRejectOpenEndedTrade(e){const t=this.playerStates.get(e);if(null==t)return!1;const s=this.getTradeExecutorWantedResources();if(s.length>t.resourceCards.getNumberOfCardsInInventory())return!0;
1if(r.lv.countOccurenceOfValueInArray(s,I.O3.AnyResource)==s.length)return!1;const i=r.lv.removeAllOccurrenceFromArray(s,I.O3.AnyResource);return!t.hasResourceCardsInHand(i)}getProposeCounterOfferActionStatus(e){if(e===T.DS.None)return{canTakeAction:!1,displayActionButton:!1};const t=_.LF.doesPlayer1HaveAnEmbargoAgainstPlayer2(this.embargoState,this.tradeExecutorColor,e);return this.counterOffersEnabled?this.state.creator==e?{canTakeAction:!1,displayActionButton:!1}:t?{canTakeAction:!1,displayActionButton:!0,errorMessageIfCantTakeAction:{key:"strings:game.errors.tradeErrors.playerBlockedTradingWithYou",options:{playerUsername:this.getTradeExecutorPlayerUsername()}}}:{canTakeAction:!0,displayActionButton:!0}:{canTakeAction:!1,displayActionButton:!1}}getRejectTradeActionStatus(e){if(e===T.DS.None)return{canTakeAction:!1,displayActionButton:!1};return _.LF.doesPlayer1HaveAnEmbargoAgainstPlayer2(this.embargoState,this.tradeExecutorColor,e)?{canTakeAction:!1,displayActionButton:!0,errorMessageIfCantTakeAction:{key:"strings:game.errors.tradeErrors.playerBlockedTradingWithYou",options:{playerUsername:this.getTradeExecutorPlayerUsername()}}}:{canTakeAction:!0,displayActionButton:!0}}getOfferComponentsToDisplay(e){if(this.isOpenEndedTrade())return L.AvatarContainer;return e==T.DS.None?L.AvatarContainer:this.isTradeExecutor(e)?L.ResponseButtons:L.AvatarContainer}isOpenEndedTrade(){return M.isOpenEndedTrade(this.state.offeredResources,this.state.wantedResources)}getTradeExecutorOfferedResources(){return null!=this.state.counterOfferInResponseToTradeId?this.state.wantedResources:this.state.offeredResources}getTradeExecutorWantedResources(){return null!=this.state.counterOfferInResponseToTradeId?this.state.offeredResources:this.state.wantedResources}getTradeExecutorPlayerUsername(){const e=this.playerStates.get(this.tradeExecutorColor);var t;return null!==(t=null==e?void 0:e.username)&&void 0!==t?t:""}isCounterOfferByNonTradeExecutor(){return null!=this.state.counterOfferInResponseToTradeId&&!this.isTradeExecutor(this.state.creator)}disableCounterOffers(){this.counterOffersEnabled=!1}constructor(e,t,s,i){this.state=e,this.currentTurnPlayerColors=t,this.playerStates=new Map;for(const e of s)this.playerStates.set(e.color,e);this.embargoState=i,this.counterOffersEnabled=!0}}class x{getTradeCreationDataError(e){this.tradeCreationData=e;const t=this.getTradeDataError();if(null!=t)return t;const s=r.lv.removeAllInstancesOfElementInArray(this.tradeCreationData.offeredResources,I.O3.AnyResource);if(!this.playerCards.hasCardsInInventory(s))return{error:{key:"strings:game.errors.tradeErrors.doesNotHaveOfferedCards"}};if(this.tradeCreationData.isBankTrade)return this.getBankTradeError();if(this.numberOfPlayers<=1)return{error:{key:"strings:game.errors.tradeErrors.only1HumanPlayer"},payload:{isPlayerTradeButtonDisabled:!0}};const i=this.getWantedCardOverLimitError();if(null!=i)return i;return null!=this.tradeCreationData.counterOfferInResponseToTradeId?this.getCounterOfferTradeError():this.getPlayerTradeError(e.creator)}getTradeDataError(){if(this.tradeCreationData.isBankTrade&&!this.currentTurnPlayerColors.includes(this.tradeCreationData.creator))return{error:{key:"strings:game.errors.tradeErrors.bankTradesOnYourTurnOnly"},payload:{isBankTradeButtonDisabled:!0}};const e=this.getTradeErrorTradeSameTypeCards();if(null!=e)return e;const t=this.getEmptyTradeError();return null!=t?t:this.areAllResourcesActiveInGame()?void 0:{error:{key:"strings:game.errors.tradeErrors.cardIsNotActiveForGameMode"}}}getBankTradeError(){if(M.isOpenEndedTrade(this.tradeCreationData.offeredResources,this.tradeCreationData.wantedResources))return{error:{key:"strings:game.errors.tradeErrors.cannotUseAnyResourceCardsWithBank"},payload:{isBankTradeButtonDisabled:!0}};const e=M.getBankTradeRatioError(this.tradeCreationData.offeredResources,this.tradeCreationData.wantedResources,this.playerTradeBankRatioState);if(null!=e)return e;const t=this.getEmptyBankError();return null!=t?t:void 0}getCounterOfferTradeError(){if(null==this.tradeCreationData.counterOfferInResponseToTradeId)return{error:{key:"strings:game.errors.tradeErrors.invalidCounterOfferId"}};if(!(null!=this.activeTradeStates[this.tradeCreationData.counterOfferInResponseToTradeId]))return{error:{key:"strings:game.errors.tradeErrors.counterOfferOnlyIfOriginalOfferIsStillOpen"}};const e=this.getTradeExecutorFromTradeCreationData();if(_.LF.doesPlayer1HaveAnEmbargoAgainstPlayer2(this.embargoState,e,this.tradeCreationData.creator))return{error:{key:"strings:game.errors.tradeErrors.currentTurnPlayerBlockedTradingWithYou"}};const t=this.activeTradeStates[this.tradeCreationData.counterOfferInResponseToTradeId],s=null==t?void 0:t.creator;if(null==s)return{error:{key:"strings:game.errors.tradeErrors.invalidCounterOfferId"}};const i=this.isIdenticalTradeActive(s);if(null!=i)return{error:{key:"strings:game.errors.tradeErrors.identicalTradeIsAlreadyActive"},payload:{highlightTrade:{tradeIds:[i],autoAcceptOffer:!0}}};return this.modeSetting===_.p9.ColonistRush4P?{error:{key:"strings:game.errors.tradeErrors.counterOfferDisabledInColonistRushMode"}}:this.getSharedCounterOfferAndPlayerTradeErrors()}getPlayerTradeError(e){if(!this.currentTurnPlayerColors.includes(e))return{error:{key:"strings:game.errors.tradeErrors.canOnlyInitiateTradeFromYourTurn"},payload:{isPlayerTradeButtonDisabled:!0}};if(_.LF.didPlayerEmbargoAllOtherPlayers(this.embargoState,e))return{error:{key:"strings:game.errors.tradeErrors.youBlockedTradingWithAllPlayers"}};if(_.LF.didEveryoneEmbargoPlayer(this.embargoState,e))return{error:{key:"strings:game.errors.tradeErrors.everyoneBlockedTradingWithYou"}};const t=this.isIdenticalTradeActive(e);return null!=t?{error:{key:"strings:game.errors.tradeErrors.identicalTradeIsAlreadyActive"},payload:{highlightTrade:{tradeIds:[t]}}}:this.getSharedCounterOfferAndPlayerTradeErrors()}getSharedCounterOfferAndPlayerTradeErrors(){const e=this.getNoOneHasWantedResourceError();return null!=e?e:this.hasPlayerCreatedIdenticalTradeTooManyTimes()?{error:{key:"strings:game.errors.tradeErrors.identicalTradeLimit"},payload:{highlightCards:{cardsToHighlight:this.allValidCards,locations:[E.ProposalOffered,E.ProposalWanted]}}}:this.doesPlayerHaveTooManyActiveTrades()?{error:{key:"strings:game.errors.tradeErrors.tooManyActiveTrades"},payload:{highlightTrade:{tradeIds:[...this.getAllMyActiveTradeIds()]}}}:void 0}getTradeErrorTradeSameTypeCards(){const e=[],t=r.lv.removeDuplicatesFromArray(this.tradeCreationData.offeredResources);for(const s of t)s!=I.O3.AnyResource&&this.tradeCreationData.wantedResources.includes(s)&&e.push(s);if(e.length>=1)return{error:{key:"strings:game.errors.tradeErrors.tradingSameTypeCards"},payload:{highlightCards:{cardsToHighlight:e,locations:[E.ProposalOffered,E.ProposalWanted]},isBankTradeButtonDisabled:!0,isPlayerTradeButtonDisabled:!0}}}getTradeExecutorFromTradeCreationData(){return null!=this.tradeCreationData.counterOfferInResponseToTradeId?this.currentTurnPlayerColors[0]:this.tradeCreationData.creator}getEmptyTradeError(){const e=this.isOfferedResourcesEmpty(),t=this.isWantedResourcesEmpty();if(e&&t)return{error:{key:"strings:game.errors.tradeErrors.offerIncomplete"},payload:{highlightCards:{cardsToHighlight:this.allValidCards,locations:[E.OfferedSelector,E.WantedSelector]},isPlayerTradeButtonDisabled:!0,isBankTradeButtonDisabled:!0}};if(e)return{error:{key:"strings:game.errors.tradeErrors.offerIncomplete"},payload:{highlightCards:{cardsToHighlight:this.allValidCards,locations:[E.OfferedSelector]},isPlayerTradeButtonDisabled:!0,isBankTradeButtonDisabled:!0}};if(t)return{error:{key:"strings:game.errors.tradeErrors.offerIncomplete"},payload:{highlightCards:{cardsToHighlight:this.allValidCards,locations:[E.WantedSelector]},isPlayerTradeButtonDisabled:!0,isBankTradeButtonDisabled:!0}};const s=this.getNoCardsToOpenEndedTradeError();return s||void 0}getEmptyBankError(){const e=[],t=r.lv.removeDuplicatesFromArray(this.tradeCreationData.wantedResources);for(const s of t){const t=this.tradeCreationData.wantedResources.filter(e=>e==s);this.bankHasRequiredResources(t)||e.push(s)}if(0!=e.length)return{error:{key:"strings:game.errors.tradeErrors.bankDoesNotHaveRequestedResources"},payload:{highlightCards:{cardsToHighlight:e,locations:[E.ProposalWanted]}}}}bankHasRequiredResources(e){return new S(this.bankState.resourceCards).hasCardsInInventory(e)}getNoCardsToOpenEndedTradeError(){if(M.isOpenEndedTrade(this.tradeCreationData.offeredResources,this.tradeCreationData.wantedResources)&&0==this.playerCards.getNumberOfCardsInInventory())return{error:{key:"strings:game.errors.tradeErrors.notEnoughCardsForOpenEndedTrade"},payload:{isPlayerTradeButtonDisabled:!0,isBankTradeButtonDisabled:!0}}}getWantedCardOverLimitError(){const e=M.tradeMaximumWantedResources;if(this.tradeCreationData.wantedResources.length>=e)return{error:{key:"strings:game.errors.tradeErrors.tooManyWantedCards"},payload:{highlightCards:{cardsToHighlight:this.allValidCards,locations:[E.ProposalWanted]},isPlayerTradeButtonDisabled:!0}}}isOfferedResourcesEmpty(){return 0==this.tradeCreationData.offeredResources.length}isWantedResourcesEmpty(){return 0==this.tradeCreationData.wantedResources.length}areAllResourcesActiveInGame(){const e=y.LY.getCardEnumsOfTypes(this.activeResourceCards);e.push(I.O3.AnyResource);for(const t of this.tradeCreationData.offeredResources)if(!e.includes(t))return!1;for(const t of this.tradeCreationData.wantedResources)if(!e.includes(t))return!1;return!0}getNoOneHasWantedResourceError(){const e=r.lv.removeDuplicatesFromArray(this.tradeCreationData.wantedResources),t=[];for(const s of e)this.doesASinglePlayerHaveResourceCard(s)||t.push(s);if(t.length>0)return{error:{key:"strings:game.errors.tradeErrors.noOneHasThatResource"},payload:{highlightCards:{cardsToHighlight:t,locations:[E.ProposalWanted]}}}}doesASinglePlayerHaveResourceCard(e){const t=y.LY.getCardDataForCard(e);if(null==t)return!1;if(this.bankState.hideBankCards)return!0;const s=i.Sl.resourceCardCountFor(this.modeSetting,t.cardTypeEnum);return r.lv.countOccurenceOfValueInArray(this.bankState.resourceCards.cards,e)!=s}isIdenticalTradeActive(e){for(const t of Object.values(this.activeTradeStates))if(null!=t&&t.creator==e&&x.isIdenticalTrade(t,this.tradeCreationData))return t.id}hasPlayerCreatedIdenticalTradeTooManyTimes(){const e=this.getMaximumNumberOfTimesIdenticalTradeCanBeCreated();return this.getNumberOfTimesIdenticalOfferWasCreatedThisTurnByPlayer(this.tradeCreationData)>=e}getMaximumNumberOfTimesIdenticalTradeCanBeCreated(){return this.isTradeCreatorBot?x.maximumNumberOfTimesAnIdenticalTradeCanBeCreatedByBots:this.currentTurnPlayerColors.includes(this.tradeCreationData.creator)?x.maximumNumberOfTimesAnIdenticalTradeCanBeCreatedFor
1CurrentTurnPlayer:x.maximumNumberOfTimesAnIdenticalTradeCanBeCreatedForOtherPlayers}doesPlayerHaveTooManyActiveTrades(){const e=this.currentTurnPlayerColors.includes(this.tradeCreationData.creator)?x.maximumNumberOfActiveUniqueTradesForCurrentTurnPlayer:x.maximumNumberOfActiveUniqueTradesForOtherPlayers;return this.getNumberOfActiveTradesCreatedByTradeCreator()>=e}getNumberOfActiveTradesCreatedByTradeCreator(){let e=0;for(const t of Object.values(this.activeTradeStates))null!=t&&t.creator==this.tradeCreationData.creator&&(e+=1);return e}getAllMyActiveTradeIds(){const e=[];for(const t of Object.values(this.activeTradeStates))null!=t&&t.creator==this.tradeCreationData.creator&&e.push(t.id);return e}getNumberOfTimesIdenticalOfferWasCreatedThisTurnByPlayer(e){const t=this.tradesClosedThisTurn;if(null==t)return 0;let s=0;for(const i of Object.values(t))null!=i&&x.isIdenticalTrade(i,e)&&(s+=1);return s}static isIdenticalTrade(e,t){if(e.offeredResources.length!=t.offeredResources.length)return!1;if(e.wantedResources.length!=t.wantedResources.length)return!1;return null!=t.counterOfferInResponseToTradeId?!!r.lv.arraysEqual(e.offeredResources,t.wantedResources)&&!!r.lv.arraysEqual(e.wantedResources,t.offeredResources):!!r.lv.arraysEqual(e.offeredResources,t.offeredResources)&&!!r.lv.arraysEqual(e.wantedResources,t.wantedResources)}constructor(e,t,s,i,n,r,o,a,c,l,d){this.activeResourceCards=e,this.numberOfPlayers=t,this.playerCards=new S({cards:s}),this.currentTurnPlayerColors=d,this.isTradeCreatorBot=i,this.bankState=n,this.playerTradeBankRatioState=r,this.activeTradeStates=o,this.tradesClosedThisTurn=a,this.modeSetting=c,this.embargoState=l,this.allValidCards=y.LY.getCardEnumsOfTypes([...e,I.Q4.AnyResource])}}x.maximumNumberOfTimesAnIdenticalTradeCanBeCreatedByBots=1,x.maximumNumberOfTimesAnIdenticalTradeCanBeCreatedForCurrentTurnPlayer=3,x.maximumNumberOfTimesAnIdenticalTradeCanBeCreatedForOtherPlayers=2,x.maximumNumberOfActiveUniqueTradesForCurrentTurnPlayer=5,x.maximumNumberOfActiveUniqueTradesForOtherPlayers=3;class O{constructor(e,t){this.playerValidators=new Map;for(const t of e)this.playerValidators.set(t.color,t);this.mapValidator=t}}if(/^(251|837)$/.test(s.j))T=s(55935);var G=s(5144);if(837==s.j)n=s(29267);class F extends O{getRoadPlayerState(e){if(e==T.DS.None)return{bankRoadAmount:0};const t=this.mechanicRoadState[e];if(void 0===t)throw new Error(`No road player state for player ${e}`);return t}hasResourcesAndPiecesForRoad(e,t){if(this.getRoadPlayerState(e).bankRoadAmount<=0)return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughRoadPieces"}};if(!t)return{canTakeAction:!0};const s=(0,y.Vm)(_.Ob.Road),i=this.playerValidators.get(e);if(null==i)return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noPlayer"}};return i.hasResourceCardsInHand(s)?{canTakeAction:!0}:{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughResources"}}}canPlayerPlaceRoad(e,t){if(this.currentStateValidator.isSomePlayerInActionState(G.qy.SelectCardsToDiscard))return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.playersDiscarding"}};const s=this.whereCanPlayerPlaceRoads(e),i=this.hasResourcesAndPiecesForRoad(e,t);return i.validHoverLocations=s,i.canTakeAction?s.length<=0?{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noWhereToPlaceRoad"},validHoverLocations:s}:{canTakeAction:!0,validHoverLocations:s}:i}whereCanPlayerPlaceRoads(e){const t=[];for(const s of this.mapValidator.tileState.tileCorners)if(s.owner==e&&null!=s.buildingType&&!this.mapValidator.isCornerKnightAndIsKnightNotTouchingEdgeType(e,s,n.K2.Road))for(const e of s.hexCorner.touchingEdges()){const s=this.mapValidator.tileState.getTileEdge(e);if(null==s)continue;if(!this.mapValidator.tileState.isEdgeTouchingLand(s))continue;if(null!=s.type)continue;const i=this.mapValidator.tileState.getTileEdgeIndex(s.hexEdge);null!=i&&t.push(i)}for(const s of this.mapValidator.tileState.tileEdges)if(s.owner==e&&s.type==n.K2.Road)for(const e of s.hexEdge.endPoints()){const s=this.mapValidator.tileState.getTileCorner(e);if(null!=s&&null==s.owner)for(const e of s.hexCorner.touchingEdges()){const s=this.mapValidator.tileState.getTileEdge(e);if(null==s)continue;if(!this.mapValidator.tileState.isEdgeTouchingLand(s))continue;if(null!=s.type)continue;const i=this.mapValidator.tileState.getTileEdgeIndex(s.hexEdge);null!=i&&t.push(i)}}const s=r.lv.removeDuplicatesFromArray(t);if(null==this.playerValidators.get(e))return s;const i=this.getRoadPlayerState(e);var o;for(const e of null!==(o=i.restrictedRoadPlacements)&&void 0!==o?o:[])r.lv.removeElementFromArray(s,e);return s}whereCanPlayerPlaceBeginningRoads(e){const t=[];for(const s of this.mapValidator.tileState.tileCorners)if(s.owner==e&&null!=s.buildingType&&this.mapValidator.areAdjacentEdgesEmpty(s))for(const e of s.hexCorner.touchingEdges()){const s=this.mapValidator.tileState.getTileEdge(e);if(null==s)continue;if(!this.mapValidator.tileState.isEdgeTouchingLand(s))continue;const i=this.mapValidator.tileState.getTileEdgeIndex(s.hexEdge);null!=i&&t.push(i)}return t}constructor(e,t,s,i){super(e,t),this.currentStateValidator=s,this.mechanicRoadState=i}}class U extends O{getSettlementPlayerState(e){if(e==T.DS.None)return{bankSettlementAmount:0};const t=this.settlementState[e];if(void 0===t)throw new Error(`No settlement player state for player ${e}`);return t}hasResourcesAndPiecesForSettlement(e,t){if(this.getSettlementPlayerState(e).bankSettlementAmount<=0)return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughSettlementPieces"}};if(!t)return{canTakeAction:!0}
1;const s=(0,y.Vm)(_.Ob.Settlement),i=this.playerValidators.get(e);if(void 0===i)return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noPlayer"},validHoverLocations:[]};return i.hasResourceCardsInHand(s)?{canTakeAction:!0}:{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughResources"}}}canPlayerPlaceSettlement(e,t){if(this.currentStateValidator.isSomePlayerInActionState(G.qy.SelectCardsToDiscard))return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.playersDiscarding"}};const s=this.whereCanPlayerPlaceSettlements(e),i=this.hasResourcesAndPiecesForSettlement(e,t);return i.validHoverLocations=s,i.canTakeAction?s.length<=0?{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.settlementsNeedToBeTwoRoadsApart"},validHoverLocations:s}:{canTakeAction:!0,validHoverLocations:s}:i}whereCanPlayerPlaceSettlements(e){const t=[];for(const s of this.mapValidator.tileState.tileEdges)if(null!=s.type&&s.owner==e)for(const e of s.hexEdge.endPoints()){const s=this.mapValidator.tileState.getTileCorner(e);if(null==s)continue;if(null!=s.owner)continue;if(!this.mapValidator.areAdjacentCornersEmpty(s))continue;if(!this.mapValidator.tileState.isCornerTouchingLand(s))continue;const i=this.mapValidator.tileState.getTileCornerIndex(s.hexCorner);null!=i&&t.push(i)}return r.lv.removeDuplicatesFromArray(t)}whereCanPlayerPlaceBeginningSettlements(){const e=[];for(const t of this.mapValidator.tileState.tileCorners){if(null!=t.owner)continue;if(!this.mapValidator.areAdjacentCornersEmpty(t))continue;const s=this.mapValidator.tileState.getTileCornerIndex(t.hexCorner);null!=s&&(this.mapValidator.tileState.isCornerTouchingLand(t)&&(t.restrictedStartingPlacement||e.push(s)))}return r.lv.removeDuplicatesFromArray(e)}constructor(e,t,s,i){super(e,t),this.currentStateValidator=s,this.settlementState=i}}class N extends O{getCityPlayerState(e){if(e==T.DS.None)return{bankCityAmount:0};const t=this.cityState[e];if(void 0===t)throw new Error(`No MechanicCityPlayerState for player ${e}`);return t}hasResourcesAndPiecesForCity(e,t,s){const i=this.playerValidators.get(e);if(null==i)return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noPlayer"}};const n=this.getCityPlayerState(e);if(n.bankCityAmount<=0)return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughCityPieces"}};if(!t)return{canTakeAction:!0};if(this.mapValidator.tileState.getPlacedCornerBuildingCountForPlayer(o.um.Settlement,e)<=0)return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noSettlementToUpgrade"}};var a;s=null!==(a=null!=s?s:n.nextCityDiscount)&&void 0!==a?a:[];const c=(0,y.Vm)(_.Ob.City);r.lv.removeElementsFromArray(c,s);return i.hasResourceCardsInHand(c)?{canTakeAction:!0}:{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughResources"}}}canPlayerPlaceCity(e){if(this.currentStateValidator.isSomePlayerInActionState(G.qy.SelectCardsToDiscard))return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.playersDiscarding"}};const t=this.hasResourcesAndPiecesForCity(e,!0),{where:s}=this.whereCanPlayerPlaceCities(e);return t.validHoverLocations=s,t.canTakeAction?s.length<=0?{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noWhereToPlaceCity"},validHoverLocations:s}:{canTakeAction:!0,validHoverLocations:s}:t}whereCanPlayerPlaceCities(e){const t=[];for(const[s,i]of this.mapValidator.tileState.tileCorners.entries())if(i.owner==e){if(i.buildingType==o.um.DestroyedCity)return this.whereCanPlayerUpgradeDestroyedCity(e);i.buildingType==o.um.Settlement&&t.push(s)}return{where:t,cornerBuildingTypeBeingUpgraded:o.um.Settlement}}whereCanPlayerUpgradeDestroyedCity(e){const t=[];for(const[s,i]of this.mapValidator.tileState.tileCorners.entries())i.owner==e&&i.buildingType==o.um.DestroyedCity&&t.push(s);return{where:t,cornerBuildingTypeBeingUpgraded:o.um.DestroyedCity}}constructor(e,t,s,i){super(e,t),this.currentStateValidator=s,this.cityState=i}}if(837==s.j)a=s(13627);
1class H{seaTilesWithoutPirate(){const e=[];for(const[t,s]of this.mapValidator.tileState.tiles.entries())t!=this.pirateState.locationTileIndex&&s.tileType==a.m1.Sea&&e.push(t);return e}whereCanPlayerPlacePirate(e){const t=this.seaTilesWithoutPirate(),s=[];for(const i of t)this.mapValidator.arePlayersProtectedByFriendlyRobberTouchingTile(e,i)||this.mapValidator.doPlayersProtectedByFriendlyRobberHaveShipTouchingTile(e,i)||s.push(i);return 0==s.length&&s.push(this.pirateState.locationTileIndex),s}isEdgeTouchingTileWithPirate(e){for(const t of e.hexEdge.touchingFaces()){const e=this.mapValidator.tileState.getTileHexIndex(t);if(null!=e&&e==this.pirateState.locationTileIndex)return!0}return!1}constructor(e,t){this.mapValidator=e,this.pirateState=t}}class K extends O{getShipPlayerState(e){if(e==T.DS.None)return{bankShipAmount:0};const t=this.mechanicShipState[e];if(void 0===t)throw new Error(`No ship player state for player ${e}`);return t}hasResourcesAndPiecesForShip(e,t){if(this.getShipPlayerState(e).bankShipAmount<=0)return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughShipPieces"}};if(!t)return{canTakeAction:!0};const s=(0,y.Vm)(_.Ob.Ship),i=this.playerValidators.get(e);if(null==i)return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noPlayer"}};return i.hasResourceCardsInHand(s)?{canTakeAction:!0}:{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughResources"}}}canPlayerPlaceShip(e,t){if(null==this.playerValidators.get(e))return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noPlayer"},validHoverLocations:[]};const s=this.whereCanPlayerPlaceShips(e),i=this.hasResourcesAndPiecesForShip(e,t);return i.validHoverLocations=s,i.canTakeAction?s.length<=0?{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noWhereToPlaceShip"},validHoverLocations:s}:{canTakeAction:!0,validHoverLocations:s}:i}whereCanPlayerPlaceShips(e,t=void 0){const s=[];for(const t of this.mapValidator.tileState.tileCorners)if(t.owner==e&&null!=t.buildingType&&!this.mapValidator.isCornerKnightAndIsKnightNotTouchingEdgeType(e,t,n.K2.Ship))for(const e of t.hexCorner.touchingEdges()){var i;const t=this.mapValidator.tileState.getTileEdge(e);if(null==t)continue;if(!this.mapValidator.tileState.isEdgeTouchingSea(t))continue;if(null!=t.owner)continue;if(null!=t.type)continue;if(null===(i=this.pirateValidator)||void 0===i?void 0:i.isEdgeTouchingTileWithPirate(t))continue;const n=this.mapValidator.tileState.getTileEdgeIndex(t.hexEdge);null!=n&&(s.includes(n)||s.push(n))}for(const i of this.mapValidator.tileState.tileEdges){if(i.owner!=e)continue;if(i.type!=n.K2.Ship)continue;if(this.mapValidator.tileState.getTileEdgeIndex(i.hexEdge)!=t)for(const e of i.hexEdge.endPoints()){const t=this.mapValidator.tileState.getTileCorner(e);if(null!=t&&null==t.owner)for(const t of e.touchingEdges()){var o;const e=this.mapValidator.tileState.getTileEdge(t);if(null==e)continue;if(null!=e.type)continue;if(!this.mapValidator.tileState.isEdgeTouchingSea(e))continue;if(null!=e.owner)continue;if(null===(o=this.pirateValidator)||void 0===o?void 0:o.isEdgeTouchingTileWithPirate(e))continue;const i=this.mapValidator.tileState.getTileEdgeIndex(e.hexEdge);null!=i&&(s.includes(i)||s.push(i))}}}const a=this.playerValidators.get(e);if(null==a)return s;const c=this.getShipPlayerState(a.color);var l;for(const e of null!==(l=c.restrictedShipPlacements)&&void 0!==l?l:[])r.lv.removeElementFromArray(s,e);return s}whereCanPlayerPlaceBeginningShips(e){const t=[];for(const i of this.mapValidator.tileState.tileCorners)if(i.owner==e&&null!=i.buildingType&&this.mapValidator.areAdjacentEdgesEmpty(i))for(const e of i.hexCorner.touchingEdges()){var s;const i=this.mapValidator.tileState.getTileEdge(e);if(null==i)continue;if(!this.mapValidator.tileState.isEdgeTouchingSea(i))continue;if(null===(s=this.pirateValidator)||void 0===s?void 0:s.isEdgeTouchingTileWithPirate(i))continue;const n=this.mapValidator.tileState.getTileEdgeIndex(i.hexEdge);null!=n&&t.push(n)}return t}constructor(e,t,s,i){super(e,t),this.mechanicShipState=s,null!=i&&(this.pirateValidator=new H(t,i))}}class W extends O{canPlayerMoveShip(e){if(null==this.playerValidators.get(e))return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noPlayer"},validHoverLocations:[]};const t=this.getMovableShipsForPlayer(e);return this.validatorShip.getShipPlayerState(e).hasMovedShipThisTurn?{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.canOnlyMoveOneShipPerTurn"},validHoverLocations:t}:t.length<=0?{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noOpenShips"},validHoverLocations:t}:{canTakeAction:!0,validHoverLocations:t}}getMovableShipsForPlayer(e){const t=[];for(const i of this.mapValidator.tileState.tileEdges){var s;if(i.owner!=e)continue;if(i.type!=n.K2.Ship)continue;if(null===(s=this.validatorPirate)||void 0===s?void 0:s.isEdgeTouchingTileWithPirate(i))continue;const r=this.mapValidator.tileState.getTileEdgeIndex(i.hexEdge);if(null==r)continue;0!=this.validatorShip.whereCanPlayerPlaceShips(e,r).length&&(this.mapValidator.willMovingEdgeTypeBreakClosedRoute(e,i,n.K2.Ship)||t.includes(r)||t.push(r))}if(null==this.playerValidators.get(e))return t;const i=this.validatorShip.getShipPlayerState(e);var o;for(const e of null!==(o=i.restrictedShipMovesFrom)&&void 0!==o?o:[])r.lv.removeElementFromArray(t,e);return t}constructor(e,t,s,i){super(e,t),this.validatorShip=new K(e,t,s,i),null!=i&&(this.validatorPirate=new H(t,i))}}class V{get developmentCardsBoughtThisTurn(){var e;return null!==(e=this.developmentCardPlayerState.developmentCardsBoughtThisTurn)&&void 0!==e?e:[]}get developmentCardsUsed(){return this.developmentCardPlayerState.developmentCardsUsed}get hasUsedDevelopmentCardThisTurn(){return this.developmentCardPlayerState.hasUsedDevelopmentCardThisTurn}constructor(e){this.developmentCardPlayerState=e,this.developmentCards=new S(this.developmentCardPlayerState.developmentCards)}}class q extends O{getDevelopmentCardsPlayerState(e){const t=this.playerDevelopmentCardStates.get(e);if(void 0===t)throw new Error(`No MechanicDevelopmentCardsPlayerState for player ${e}`);return t}hasResourcesForDevelopmentCard(e){const t=this.playerValidators.get(e);if(null==t)return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noPlayer"}};const s=(0,y.Vm)(_.Ob.DevelopmentCard);return t.hasResourceCardsInHand(s)?{canTakeAction:!0}
1:{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughResources"}}}isOpponentInBlockingState(e,t){return e===I.O3.Knight&&this.currentStateValidator.isOpponentInKnightBlockingState(t)}canPlayerUseDevelopmentCard(e,t){if(this.currentStateValidator.isSomePlayerInActionState(G.qy.SelectCardsToDiscard))return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.playersDiscarding"}};if(this.isOpponentInBlockingState(t,e))return q.getErrorMessageIfBlockedByOpponentActionState(t);const s=this.getDevelopmentCardsPlayerState(e),i=new S(s.developmentCards);if(!1===i.cards.includes(t))return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.developmentCardNotInHand"}};if(t==I.O3.VictoryPoint)return{canTakeAction:!0};if(s.hasUsedDevelopmentCardThisTurn)return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.gameState.gameLogs.canOnlyPlayOneDevCardPerTurn"}};var n;return i.getCardCountForCard(t)<=r.lv.countOccurenceOfValueInArray(null!==(n=s.developmentCardsBoughtThisTurn)&&void 0!==n?n:[],t)?{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.gameState.gameLogs.cannotPlayDevCardOnTurnYouBoughtIt"}}:{canTakeAction:!0}}canPlayerBuyDevelopmentCard(e){if(this.currentStateValidator.isSomePlayerInActionState(G.qy.SelectCardsToDiscard))return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.playersDiscarding"}};if(!(this.bankDevelopmentCards.cards.length>0))return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noDevelopmentCardsInBank"}};return this.hasResourcesForDevelopmentCard(e).canTakeAction?{canTakeAction:!0}:{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughResources"}}}canPlayerUseAtLeastOneDevelopmentCard(e){for(const t of this.getDevelopmentCardsPlayerState(e).developmentCards.cards)if(t!=I.O3.VictoryPoint&&this.canPlayerUseDevelopmentCard(e,t).canTakeAction)return!0;return!1}getPlayersTotalDevelopmentCards(e){return this.getDevelopmentCardsPlayerState(e).developmentCards.cards.length}getPlayersTotalDevelopmentCardsOfType(e,t){const s=this.getDevelopmentCardsPlayerState(e),i=new S(s.developmentCards);return r.lv.countOccurenceOfValueInArray(i.cards,t)}getPlayersTotalUsedDevelopmentCardsOfType(e,t){const s=this.getDevelopmentCardsPlayerState(e);return r.lv.countOccurenceOfValueInArray(s.developmentCardsUsed,t)}getTotalDevelopmentCardsInBank(){return this.bankDevelopmentCards.getNumberOfCardsInInventory()}static getErrorMessageIfBlockedByOpponentActionState(e){return e===I.O3.Knight?{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.knightUsageBlockedByOpponentAction"}}:{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.developmentCardBlockedByOpponentAction"}}}constructor(e,t,s,i){super(e,t),this.currentStateValidator=s,this.bankDevelopmentCards=new S(i.bankDevelopmentCards),this.playerDevelopmentCardStates=new Map;for(const e in i.players){const t=Number(e),s=i.players[t];null!=s&&this.playerDevelopmentCardStates.set(t,new V(s))}this.playerDevelopmentCardStates.set(T.DS.None,new V({developmentCards:{cards:[]},developmentCardsUsed:[]}))}}class Q extends O{getCityWallPlayerState(e){if(e==T.DS.None)return{bankCityWallAmount:0};const t=this.cityWallState[e];if(void 0===t)throw new Error(`No MechanicCityWallPlayerState for player ${e}`);return t}hasResourcesAndPiecesForCityWall(e,t){if(this.getCityWallPlayerState(e).bankCityWallAmount<=0)return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughCityWallPieces"}};if(!t)return{canTakeAction:!0};const s=this.playerValidators.get(e);if(void 0===s)return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noPlayer"}};const i=(0,y.Vm)(_.Ob.CityWall);return s.hasResourceCardsInHand(i)?{canTakeAction:!0}:{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughResources"}}}canPlayerPlaceCityWall(e){const t=this.whereCanPlayerPlaceCityWall(e),s=this.hasResourcesAndPiecesForCityWall(e,!0);return s.validHoverLocations=t,s.canTakeAction?t.length<=0?{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noFreeCity"},validHoverLocations:t}:{canTakeAction:!0,validHoverLocations:t}:s}whereCanPlayerPlaceCityWall(e){const t=[];for(const[s,i]of this.mapValidator.tileState.tileCorners.entries())i.owner==e&&i.buildingType==o.um.City&&(i.hasCornerBonusOfType(o.rG.CityWall)||t.push(s));return t}constructor(e,t,s){super(e,t),this.cityWallState=s}}class j extends O{getLongestRoadPlayerState(e){if(e==T.DS.None)return{longestRoad:0};const t=this.longestRoadState[e];if(void 0===t)throw new Error(`No longestRoadPlayerState for player ${e}`);return t}getPlayerWithLongestRoadCard(){for(const e in this.longestRoadState){const t=Number(e);if(this.getLongestRoadPlayerState(t).hasLongestRoad)return t}return T.DS.None}doesBankHaveLongestRoadCard(){return this.getPlayerWithLongestRoadCard()==T.DS.None}constructor(e,t,s){super(e,t),this.longestRoadState=s}}class z extends O{getLargestArmyPlayerState(e){if(e==T.DS.None)return{};const t=this.largestArmyState[e];if(void 0===t)throw new Error(`No largestArmyPlayerState for player ${e}`);return t}getPlayerWithLargestArmy(){for(const e in this.largestArmyState){const t=Number(e);if(this.getLargestArmyPlayerState(t).hasLargestArmy)return t}return T.DS.None}doesBankHaveLargestArmyCard(){return this.getPlayerWithLargestArmy()==T.DS.None}constructor(e,t,s){super(e,t),this.largestArmyState=s}}var $=s(51596);class Y{getKnightPlayerState(){return this.knightPlayerState}getKnightStates(){return Object.values(this.knightPlayerState.knights).filter(e=>void 0!==e)}getKnightAtLocation(e){for(const t of this.getKnightStates())if(t.locationCornerIndex===e)return t}getPlayerKnightStrength(){return this.getKnightStates().map(e=>Y.getKnightStrength(e)).reduce((e,t)=>
1e+t)}getKnightWithLevelFromInventory(e,t=!1){for(const s of this.getKnightStates()){if(!(void 0===s.locationCornerIndex))continue;if(s.level!==e)continue;if(t||s.level<=this.knightPlayerState.maxPurchaseableLevelUnlocked)return s}}getKnightWithHighestLevelFromInventory(e,t){for(let s=e;s>0;s--){const e=this.getKnightWithLevelFromInventory(s,t);if(void 0!==e)return e}}getKnightsWithLevelFromMap(e){const t=[];for(const s of this.getKnightStates())void 0!==s.locationCornerIndex&&s.level===e&&t.push(s);return t}getAmountOfKnightsEligibleForActivation(){let e=0;for(const t of this.getKnightStates())void 0!==t.locationCornerIndex&&!0!==t.isActivated&&(t.isActivatedThisTurn||(e+=1));return e}getAmountOfKnightsEligibleForUpgrade(){let e=0;for(const t of this.getKnightStates()){if(void 0===t.locationCornerIndex)continue;if(t.isUpgradedThisTurn)continue;null!=this.getKnightWithLevelFromInventory(t.level+1)&&(e+=1)}return e}getAmountOfKnightsOfLevelThatCanBePlacedOnMap(e){let t=0;for(const s of this.getKnightStates())void 0===s.locationCornerIndex&&s.level===e&&(t+=1);return t}canPlayerPlaceNewKnight(e){const t=this.whereCanPlayerPlaceNewKnight(),s=this.hasResourcesAndPiecesForNewKnight(e);return s.validHoverLocations=t,s.canTakeAction?t.length<=0?{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noWhereToPlaceKnight"},validHoverLocations:t}:{canTakeAction:!0,validHoverLocations:t}:s}whereCanPlayerPlaceNewKnight(){const e=[];for(const t of this.mapValidator.tileState.tileEdges)if(null!=t.type&&t.owner==this.playerColor)for(const s of t.hexEdge.endPoints()){const t=this.mapValidator.tileState.getTileCorner(s);if(null==t)continue;if(null!=t.buildingType)continue;if(null!=t.owner)continue;if(!this.mapValidator.tileState.isCornerTouchingLand(t))continue;const i=this.mapValidator.tileState.getTileCornerIndex(t.hexCorner);null!=i&&e.push(i)}return e}hasResourcesAndPiecesForNewKnight(e){return null==this.getKnightWithLevelFromInventory(1)?{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughLevelOneKnights"}}:this.hasResourcesForKnight(e).canTakeAction?{canTakeAction:!0}:{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughResources"}}}hasResourcesForKnight(e){if(!e)return{canTakeAction:!0};const t=(0,y.Vm)(_.Ob.Knight);return this.playerValidator.hasResourceCardsInHand(t)?{canTakeAction:!0}:{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughResources"}}}canPlayerUpgradeKnight(){const e=this.whereCanPlayerUpgradeKnight(),t=this.hasResourcesForKnightUpgrade(!0);return t.validHoverLocations=e,t.canTakeAction?e.length<=0?{canTakeAction:!1,errorMessageIfCantTakeAction:this.getNoUpgradeableKnightsErrorMessage(),validHoverLocations:e}:{canTakeAction:!0,validHoverLocations:e}:t}whereCanPlayerUpgradeKnight(){const e=[];for(const t of this.getKnightStates()){if(null==t.locationCornerIndex)continue;if(t.isUpgradedThisTurn)continue;void 0!==this.getKnightWithLevelFromInventory(t.level+1)&&e.push(t.locationCornerIndex)}return e}whereUpgradeKnightHasNoHigherLevelPieceInSupply(){const e=[];for(const t of this.getKnightStates()){if(null==t.locationCornerIndex)continue;if(t.isUpgradedThisTurn)continue;if(t.level>=$.UG)continue;this.getAmountOfKnightsOfLevelThatCanBePlacedOnMap(t.level+1)>0||e.push(t.locationCornerIndex)}return e}hasKnightBlockedOnlyByUpgradedThisTurn(){for(const e of this.getKnightStates()){if(null==e.locationCornerIndex)continue;if(!e.isUpgradedThisTurn)continue;if(null!=this.getKnightWithLevelFromInventory(e.level+1))return!0}return!1}getNoUpgradeableKnightsErrorMessage(){return this.whereUpgradeKnightHasNoHigherLevelPieceInSupply().length>0?{key:"strings:game.errors.canOnlyPlaceTwoKnightsOfEachLevel"}:this.hasKnightBlockedOnlyByUpgradedThisTurn()?{key:"strings:game.errors.cantUpgradeKnightTwicePerTurn"}:{key:"strings:game.errors.noKnightsToUpgrade"}}hasResourcesForKnightUpgrade(e){const t=e?(0,y.Vm)(_.Ob.Knight):[];return this.playerValidator.hasResourceCardsInHand(t)?{canTakeAction:!0}:{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughResources"}}}canPlayerActivateKnight(){const e=this.whereCanPlayerActivateKnight(),t=this.hasResourcesForKnightActivation();return t.validHoverLocations=e,t.canTakeAction?e.length<=0?{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noKnightsToActivate"},validHoverLocations:e}:{canTakeAction:!0,validHoverLocations:e}:t}whereCanPlayerActivateKnight(){const e=[];for(const t of this.getKnightStates())null!=t.locationCornerIndex&&!0!==t.isActivated&&!0!==t.isActivatedThisTurn&&e.push(t.locationCornerIndex);return e}hasResourcesForKnightActivation(){const e=[I.O3.Grain];return this.playerValidator.hasResourceCardsInHand(e)?{canTakeAction:!0}
1:{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughResources"}}}static getKnightStrength(e){return void 0===e.locationCornerIndex||!1===e.isActivated?0:e.level}static getKnightCornerBuildingType(e){switch(e.isActivated+"|"+e.level){case!0+"|1":return o.um.KnightActiveLevel1;case!0+"|2":return o.um.KnightActiveLevel2;case!0+"|3":return o.um.KnightActiveLevel3;case!1+"|1":return o.um.KnightInactiveLevel1;case!1+"|2":return o.um.KnightInactiveLevel2;case!1+"|3":return o.um.KnightInactiveLevel3}}constructor(e,t,s){this.playerValidator=e,this.mapValidator=t,this.knightPlayerState=s,this.playerColor=this.playerValidator.color}}class Z extends O{getKnightPlayerValidators(){return this.knightPlayerValidators}getKnightPlayerValidator(e){const t=this.knightPlayerValidators.find(t=>t.playerColor==e);if(void 0===t)throw new Error(`No knightPlayerValidator for player ${e}`);return t}getAnyKnightAtLocation(e){for(const t of this.knightPlayerValidators){const s=t.getKnightAtLocation(e);if(void 0!==s)return s}}getTotalKnightStrength(){return this.knightPlayerValidators.map(e=>e.getPlayerKnightStrength()).reduce((e,t)=>e+t)}getPlayersWithHighestKnightStrength(){const e=this.knightPlayerValidators.map(e=>e.getPlayerKnightStrength()),t=Math.max(...e);return this.getPlayersWithKnightStrength(t)}getPlayersWithLowestKnightStrength(e=[]){const t=this.knightPlayerValidators.filter(t=>!e.includes(t.playerColor)).map(e=>e.getPlayerKnightStrength()),s=Math.min(...t);return this.getPlayersWithKnightStrength(s,e)}whereCanPlayerRemoveKnight(e){const t=this.getKnightPlayerValidator(e),s=[];for(const e of t.getKnightStates())null!=e.locationCornerIndex&&s.push(e.locationCornerIndex);return s}whereCanPlayerMoveKnight(e,t,s){const i=this.getStartingEdgesForKnight(e),n=[];for(const r of i){const i=this.runMapDepthFirstSearch(t,r);if(null==i)return[];const o=i.interConnectedEnemyBuildings,a=s?this.whatKnightsCanPlayerDisplacedWithKnight(o,e):[],c=i.interConnectedEmptyNodes;n.push(...a),n.push(...c)}return n}runMapDepthFirstSearch(e,t){const s=this.mapValidator.generateEdgeMapForPlayerAndPieces(e,[n.K2.Road,n.K2.Ship]);return new h(e,s,t,this.mapValidator,!1,!0)}getStartingEdgesForKnight(e){if(null==e.locationCornerIndex)return[];const t=[],s=this.mapValidator.tileState.tileCorners[e.locationCornerIndex].hexCorner.touchingEdges();for(const i of s){const s=this.mapValidator.tileState.getTileEdge(i);null!=s&&(s.owner==e.owner&&null!=s.type&&t.push(s))}return t}whatKnightsCanPlayerDisplacedWithKnight(e,t){const s=[];for(const i of e){const e=this.getAnyKnightAtLocation(i);null!=e&&(e.level>=t.level||s.push(i))}return s}getPlayersWithKnightStrength(e,t=[]){const s=[];for(const i of this.knightPlayerValidators)i.getPlayerKnightStrength()===e&&(t.includes(i.playerColor)||s.push(i.playerColor));return s}constructor(e,t,s){super(e,t),this.knightPlayerValidators=[];for(const e in s){const t=Number(e),i=s[t];if(null==i)continue;const n=this.playerValidators.get(t);if(null==n)continue;const r=new Y(n,this.mapValidator,i);this.knightPlayerValidators.push(r)}}}class J extends O{canPlayerTakeKnightAction(e){const t=this.getAllKnightLocationsEligibleForActions(e);return t.length<=0?{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noKnightsForAction"},validHoverLocations:t}:{canTakeAction:!0,validHoverLocations:t}}getAllKnightLocationsEligibleForActions(e){return[...this.getKnightLocationsPlayerCanMove(e),...this.getKnightLocationsThatCanChaseAwayTheRobberOrPirate(e)]}getKnightLocationsPlayerCanMove(e){const t=this.knightValidator.getKnightPlayerValidator(e),s=[];for(const i of t.getKnightStates()){if(!i.isActivated)continue;if(null==i.locationCornerIndex)continue;if(i.isActivatedThisTurn)continue;const t=!0;this.knightValidator.whereCanPlayerMoveKnight(i,e,t).length>0&&s.push(i.locationCornerIndex)}return s}getKnightLocationsThatCanChaseAwayTheRobberOrPirate(e){const t=this.knightValidator.getKnightPlayerValidator(e),s=[];for(const e of t.getKnightStates()){if(!e.isActivated)continue;if(null==e.locationCornerIndex)continue;if(e.isActivatedThisTurn)continue;this.whereCanKnightChaseAwayRobberOrPirate(e).length<=0||s.push(e.locationCornerIndex)}return s}whereCanKnightChaseAwayRobberOrPirate(e){if(null==e.locationCornerIndex)return[];const t=this.mapValidator.tileState.tileCorners[e.locationCornerIndex],s=[];for(const e of t.hexCorner.touchingFaces()){var i,n,r,o;const t=this.mapValidator.tileState.getTileHex(e);if(null==t)continue;const a=this.mapValidator.tileState.getTileHexIndex(t.hexFace);null!=a&&(1==(null===(i=this.robberState)||void 0===i?void 0:i.isActive)&&(null===(n=this.robberState)||void 0===n?void 0:n.locationTileIndex)==a&&s.push(a),1==(null===(r=this.pirateState)||void 0===r?void 0:r.isActive)&&(null===(o=this.pirateState)||void 0===o?void 0:o.locationTileIndex)==a&&s.push(a))}return s}constructor(e,t,s,i,n){super(e,t),this.knightValidator=new Z(e,t,s),this.robberState=i,this.pirateState=n}}class X extends O{getBarbarianStrength(){let e=0;for(const t of this.mapValidator.tileState.tileCorners)void 0!==t.owner&&t.buildingType===o.um.City&&(e+=1);return e}getBarbarianProgress(){return this.barbarianInvasionState.barbarianProgress}constructor(e,t,s){super(e,t),this.barbarianInvasionState=s}}var ee=s(9878);class te extends O{getPlayerCityImprovementsState(e){if(e==T.DS.None)return te.getEmptyCityImprovementState();const t=this.cityImprovementsState[e];if(null==t)throw new Error(`No MechanicCityImprovementsPlayerState for player ${T.DS[e]}`);return t}getPlayerCityImprovementsStateForType(e,t){const s=this.getPlayerCityImprovementsState(e)[t];if(null==s)throw new Error(`No MechanicCityImprovementsTypeState for player ${T.DS[e]} and improvementType ${ee.V[t]}`);return s}getCurrentCityLevelForPlayerAndType(e,t){var s;if(null==this.cityImprovementsState[e])throw new Error(`No MechanicCityImprovementsPlayerState for player ${T.DS[e]}`);return null===(s=this.getPlayerCityImprovementsState(e)[t])||void 0===s?void 0:s.level}getPlayerMetropolisCount(e){if(null==this.cityImprovementsState[e])throw new Error(`No MechanicCityImprovementsPlayerState for player ${T.DS[e]}`);let t=0;const s=this.getPlayerCityImprovementsState(e);for(const e of Object.values(s))e.hasMetropolis&&(t+=1);return t}getPlayerColorOfMetropolisOwner(e){for(const[t,s]of Object.entries(this.cityImprovementsState))if(null!=s)for(const[i,n]of Object.entries(s))if(e==parseInt(i,10)&&n.hasMetropolis)return parseInt(t,10)}getCostForNextCityUpgradeForPlayerAndType(e,t){const s=this.getPlayerCityImprovementsStateForType(e,t);if(null==s)return;const i=s.level,n=s.nextLevelDiscount;return te.getCostToUpgradeType(t,i,n)}canPlayerUpgradeAnyCity(e){let t={canTakeAction:!1};return r.h4.loopEnums(ee.V,(s,i)=>{const n=this.canPlayerUpgradeCity(e,i);n.canTakeAction&&(t=n)}),t}canPlayerUpgradeCity(e,t){const s=this.playerValidators.get(e);if(null==s)return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.noPlayer"}};if(!(this.mapValidator.tileState.getPlacedCornerBuildingCountForPlayer(o.um.City,e)>0))return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.needAtLeastOneCity"}};const i=this.getCostForNextCityUpgradeForPlayerAndType(e,t);if(null==i)return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.alreadyMaxLevel"}};if(!s.hasResourceCardsInHand(i))return{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.notEnoughResources"}};const n=this.getCurrentCityLevelForPlayerAndType(s.color,t);if(null==n)return{canTakeAction:!1};return n>=5?{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.alreadyMaxLevel"}}:this.isCityUpgradeBlockedBecausePlayerHasNoWhereToPlaceMetropolis(e,t)?{canTakeAction:!1,errorMessageIfCantTakeAction:{key:"strings:game.errors.needAnotherCity"}}:{canTakeAction:!0}
1}static convertCityImprovementTypeToMetropolisType(e){switch(e){case ee.V.Politics:return o.rG.MetropolisPolitics;case ee.V.Science:return o.rG.MetropolisScience;case ee.V.Trade:return o.rG.MetropolisTrade}}isCityUpgradeBlockedBecausePlayerHasNoWhereToPlaceMetropolis(e,t){if(null==this.getPlayerCityImprovementsState(e))return!0;const s=this.getCurrentCityLevelForPlayerAndType(e,t);if(null==s)return!0;const i=this.mapValidator.tileState.getPlacedCornerBuildingCountForPlayer(o.um.City,e)-this.getPlayerMetropolisCount(e)>=1,n=s>=3,r=this.getPlayerColorOfMetropolisOwner(t)==e;return!i&&n&&!r}static getEmptyCityImprovementState(){return{[ee.V.Politics]:{level:0,nextLevelDiscount:0,hasMetropolis:!1},[ee.V.Science]:{level:0,nextLevelDiscount:0,hasMetropolis:!1},[ee.V.Trade]:{level:0,nextLevelDiscount:0,hasMetropolis:!1}}}static getCostToUpgradeType(e,t,s=0){if(5==t)return;const i=t+1-s,n=te.getCommodityRequiredForUpgrade(e);return new Array(i).fill(n)}static getCommodityRequiredForUpgrade(e){switch(e){case ee.V.Politics:return I.O3.Coin;case ee.V.Science:return I.O3.Paper;case ee.V.Trade:return I.O3.Cloth}}constructor(e,t,s){super(e,t),this.cityImprovementsState=s}}class se{constructor(e){this.progressCardsPlayerState=e,this.progressCards=new S(this.progressCardsPlayerState.progressCards)}}class ie extends O{getProgressCardsPlayerValidator(e){const t=this.progressCardsPlayerValidators.get(e);if(null==t)throw new Error(`No MechanicProgressCardsPlayerState for player ${e}`);return t}canPlayerUseAtLeastOneProgressCard(e){for(const t of this.getProgressCardsPlayerValidator(e).progressCards.cards)if(this.canPlayerUseProgressCard(e,t).canTakeAction)return!0;return!1}canPlayerUseProgressCard(e,t){return{canTakeAction:this.getPlayersProgressCardCountForCard(e,t)>0}}getPlayersTotalProgressCards(e){return this.getProgressCardsPlayerValidator(e).progressCards.cards.length}getPlayersProgressCardCountForCard(e,t){return this.getProgressCardsPlayerValidator(e).progressCards.getCardCountForCard(t)}hasProgressCardsInPlayerHand(e,t){return this.getProgressCardsPlayerValidator(e).progressCards.hasCardsInInventory(t)}constructor(e,t,s){super(e,t),this.bankProgressCards=new S(s.bankProgressCards),this.progressCardsPlayerValidators=new Map;for(const e in s.players){const t=Number(e),i=s.players[t];if(null==i)continue;const n=new se(i);this.progressCardsPlayerValidators.set(t,n)}const i=new se({progressCards:{cards:[]}});this.progressCardsPlayerValidators.set(T.DS.None,i)}}},19599:(e,t,s)=>{"use strict";s.d(t,{d:()=>n});var i=s(46507);const n=(0,s(11445).K)(i.Iw)},19823:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_hide_bank_card.404bde9c956ffaa8fddc.svg"},20024:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_istanbul_preview.2d22c3d3653e783501f1.png"},20230:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_lakes_preview.2d6d015c91ad9c12c3c7.png"},20558:(e,t,s)=>{"use strict";e.exports=s.p+"assets/road_blue.3301e2eed15cae5a6a05.svg"},21018:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_admin.2019e44d7957895ffbb9.svg"},21047:(e,t,s)=>{"use strict";function i(e,t){switch(e){case"unableToSend":return{key:"strings:game.gameState.gameLogs.couldNotsendChatMessage"};case"disabled":return{key:"strings:game.gameState.gameLogs.chatIsDisabled"};case"badLanguage":return{key:"strings:game.gameState.gameLogs.useProperLanguage"};case"tooLong":return{key:"strings:game.gameState.gameLogs.messageTooLong"};case"spam":return{key:"strings:game.gameState.gameLogs.pleaseDoNotSpam"};case"wrongCommand":return{key:"strings:commands.errors.wrongCommand"};case"commandCrashed":return{key:"strings:commands.errors.commandCrashed"};case"muted":return{key:"strings:game.gameState.gameLogs.youHaveBeenMuted",options:{date:t}};case"notSignedIn":return{key:"strings:game.gameState.gameLogs.signInToAccessChat"}}}function n(e){switch(e){case"tutorial":return[{key:"strings:commands.messages.emojiTutorial",options:{exampleString:'"lumbér/brÃck"',exampleEmojis:"lumberbricksheepgrain ore:road:settlementcity"}},{key:"strings:commands.messages.chatTutorial",options:{exampleString:'"/disablechat"'}}];case"chatEnabled":return[{key:"strings:commands.messages.chatEnabled"}];case"chatDisabled":return[{key:"strings:commands.messages.chatDisabled"}]}}s.d(t,{$:()=>n,b:()=>i})},21099:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_wall_red.a7d0cd496c747715b6f3.svg"},21218:(e,t,s)=>{"use strict";s.d(t,{P:()=>a});var i=s(46581),n=s(55547),r=s(13359);function o(e){n.P_.handleUrlRedirectViaParameters(r.T.EnterMatchmaking,e)}function a(){return{onClickBaseGame:()=>o(i.Nw.RankedClassic4P),onClick1v1:()=>o(i.Nw.RankedClassic1v1),onClickCK:()=>o(i.Nw.RankedCitiesAndKnights4P),onClickColonistRush:()=>o(i.Nw.RankedRush4P)}}},21466:(e,t,s)=>{"use strict";s.d(t,{n:()=>i});
1class i{static extractRoomIdFromCustomLink(e,t){if(null==e)return;if(0==t)return;const s=e.split("+");if(s.length<2)return;const i=s[1].split("=");return i.length<2||"room"!=i[0]?void 0:i[1]}static extractReferralTypeFromCustomLink(e){return e.split("+")[0]}}},21503:(e,t,s)=>{"use strict";e.exports=s.p+"assets/road_green.d206aed3747b3687bc40.svg"},22030:(e,t,s)=>{"use strict";s.d(t,{s4:()=>a,gr:()=>l,Dj:()=>r,jP:()=>c,II:()=>o,yF:()=>n,CJ:()=>i,Ih:()=>d});var i=function(e){return e[e.Standard=0]="Standard",e[e.FreeMap=1]="FreeMap",e[e.BeginnerMode=2]="BeginnerMode",e[e.CustomLink=3]="CustomLink",e[e.DiscordActivity=4]="DiscordActivity",e[e.Tournament=5]="Tournament",e}({});var n=function(e){return e[e.EditSettings=0]="EditSettings",e[e.SeedOrderSelection=1]="SeedOrderSelection",e[e.PlayOrderSelection=2]="PlayOrderSelection",e}({}),r=function(e){return e[e.ClickedBotGame=2]="ClickedBotGame",e[e.ClickedCreateRoom=3]="ClickedCreateRoom",e[e.ClickedJoinRoom=4]="ClickedJoinRoom",e[e.AccessGameLink=5]="AccessGameLink",e[e.ClickedSpectateGame=6]="ClickedSpectateGame",e[e.ReconnectGame=7]="ReconnectGame",e[e.SaveClientReferrer=8]="SaveClientReferrer",e[e.SetAdBlockStatus=9]="SetAdBlockStatus",e[e.InteractedWithSite=10]="InteractedWithSite",e[e.ClickedStartBeginnerMode=11]="ClickedStartBeginnerMode",e[e.Clicked1v1BeginnerBotGame=12]="Clicked1v1BeginnerBotGame",e[e.ClickedEasyBotGame=13]="ClickedEasyBotGame",e[e.WatchRoomList=14]="WatchRoomList",e[e.StopWatchingRoomList=15]="StopWatchingRoomList",e[e.AutoRejoinGame=16]="AutoRejoinGame",e[e.ClickedRushBotGame=18]="ClickedRushBotGame",e}({});const o=[11,2,12,3,4,5,6,7,18];var a=function(e){return e[e.ChannelJoin=1]="ChannelJoin",e[e.ChannelJoinRoomOrGame=2]="ChannelJoinRoomOrGame",e}({});const c=[1,2];var l=function(e){return e[e.AllMaps=0]="AllMaps",e[e.AllExpansions=1]="AllExpansions",e[e.PremiumMatchmaking=2]="PremiumMatchmaking",e[e.CustomLinks=3]="CustomLinks",e[e.ColonistCoins=4]="ColonistCoins",e[e.NoAds=5]="NoAds",e[e.AllColors=6]="AllColors",e[e.BasicReplay=7]="BasicReplay",e[e.FullReplay=8]="FullReplay",e}({}),d=function(e){return e[e.GetShuffleQueueData=1]="GetShuffleQueueData",e}({})},22186:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_trade_commercial_harbor.928146af979e0e396be4.svg"},22194:(e,t,s)=>{"use strict";s.d(t,{os:()=>i,Yt:()=>n,Gb:()=>h,Ob:()=>r});var i=function(e){return e[e.Grandmaster=0]="Grandmaster",e[e.Master=1]="Master",e[e.Diamond=2]="Diamond",e[e.Platinum=3]="Platinum",e[e.Gold=4]="Gold",e[e.Silver=5]="Silver",e[e.Bronze=6]="Bronze",e[e.None=7]="None",e}({}),n=function(e){return e[e.None=0]="None",e[e.I=1]="I",e[e.II=2]="II",e[e.III=3]="III",e[e.IV=4]="IV",e[e.V=5]="V",e}({}),r=function(e){return e[e.Placement=0]="Placement",e[e.Ranked=1]="Ranked",e[e.RankedLocked=2]="RankedLocked",e}({});class o{}class a extends o{finishedPlacementGames(){return this.numberOfGamesPlayed>=this.requiredNumberOfGames}getEndGameScreenText(){const e=this.requiredNumberOfGames-this.numberOfGamesPlayed;return{title:{key:"strings:game.endGame.rankedUpdate.lockedTitle",options:{gamesPlayedCount:this.numberOfGamesPlayed,requiredGamesCount:this.requiredNumberOfGames}},description:{key:"strings:game.endGame.rankedUpdate.lockedDescription",options:{count:e}}}}getEndGameData(){return this.defaultEndGameData}getFindGamePopupStatusText(){return{key:"strings:colonistCommon.rankedState.gamesPlayed",options:{gamesPlayedCount:this.numberOfGamesPlayed,count:this.requiredNumberOfGames}}}static deserialize(e){return new a(e.numberOfGamesPlayed,e.requiredNumberOfGames)}constructor(e,t){super(),this.type=r.RankedLocked,this.numberOfGamesPlayed=e,this.requiredNumberOfGames=t,this.defaultEndGameData={amount:"-",highest:!1}}}var c=s(66935);class l{static deserialize(e){return new l(e.divisionType,e.subdivisionType,e.demotionDivisionBoundary,e.promotionDivisionBoundary)}constructor(e,t,s,i){this.divisionType=e,this.subdivisionType=t,this.demotionDivisionBoundary=s,this.promotionDivisionBoundary=i}}class d extends o{getEndGameScreenText(){return{title:(0,c.Co)(`${this.currentMMR}`),description:{key:"strings:colonistCommon.utils.emptyString"}}}getEndGameScreenMMRChangeText(){return{key:"strings:game.endGame.rankedUpdate.rating",options:{ratingChange:`${this.mostRecentChangeInValue>0?"+":""}${this.mostRecentChangeInValue}`}}}getEndGameData(){return{amount:`${this.mostRecentChangeInValue>0?"+":""}${this.mostRecentChangeInValue}`,highest:!1}}getFindGamePopupStatusText(){return{key:"strings:colonistCommon.rankedState.rating",options:{rating:this.currentMMR}}}static deserialize(e){const t=l.deserialize(e.previousDivisionState),s=l.deserialize(e.currentDivisionState);return new d(e.userStatCategory,e.previousMMR,e.currentMMR,t,s,e.promotionDemotionText)}constructor(e,t,s,i,n,o){super(),this.type=r.Ranked,this.userStatCategory=e,this.mostRecentChangeInValue=Math.round(s-t),this.promotionDemotionText=o,this.previousMMR=Math.round(t),this.currentMMR=Math.round(s),this.currentDivisionState=n,this.previousDivisionState=i}}class u extends o{finishedPlacementGames(){return this.numberOfPlacementGamesFinished>=this.numberOfPlacementGamesRequired}getEndGameScreenText(){const e=this.numberOfPlacementGamesRequired-this.numberOfPlacementGamesFinished;return{title:{key:"strings:game.endGame.rankedUpdate.placementTitle",options:{gamesPlayedCount:this.numberOfPlacementGamesFinished,requiredGamesCount:this.numberOfPlacementGamesRequired}},description:{key:"strings:game.endGame.rankedUpdate.placementDescription",options:{count:e}}}}getEndGameData(){return this.defaultEndGameData}getFindGamePopupStatusText(){return{key:"strings:colonistCommon.rankedState.placementGamesPlayed",options:{gamesPlayedCount:this.numberOfPlacementGamesFinished,count:this.numberOfPlacementGamesRequired}}}static deserialize(e){return new u(e.numberOfPlacementGamesFinished,e.numberOfPlacementGamesRequired)}constructor(e,t){super(),this.type=r.Placement,this.numberOfPlacementGamesFinished=e,this.numberOfPlacementGamesRequired=t,this.defaultEndGameData={amount:"-",highest:!1}}}class h{static deserialize(e){switch(e.type){case r.Placement:return u.deserialize(e);case r.Ranked:return d.deserialize(e);case r.RankedLocked:return a.deserialize(e)}}}s(36872)},22466:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_share.21acd51b7df57e85f2db.svg"},22502:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_settlement_phase_ended_guitar.21440c801c97c0a7e291.mp3"},23153:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_robber.2b909f277d60f24633e8.svg"},23201:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_largest_army.206b49b3c9d2b206f699.svg"},23288:(e,t,s)=>{"use strict";s.d(t,{U:()=>i});class i{constructor(e){this.roomState=e}}},23336:(e,t,s)=>{"use strict";s.d(t,{l:()=>a});var i=s(648),n=s(76092),r=s(80708),o=s(70908);class a{static canOpenInviteFriendsDialog(e){return!!e.inDiscordServer&&!!e.canInviteFriends}static inviteFriends(e){e.sendMessageToMount({command:i.ey.InviteFriends})}static inviteFriendsIfAllowed(e,t){return!!a.canOpenInviteFriendsDialog(t)&&(a.inviteFriends(e),!0)}static async shareActivityLink(e,t){a.sendShareActivityLinkAnalytic(t.analyticsPopupTriggered);const s=await e.sendMessageToMount({command:i.ey.ShareActivityLink,data:{message:t.message,referrer_id:t.referrerId,custom_id:t.referralTypeId}});1==(null==s?void 0:s.success)&&a.sendShareActivityLinkAnalytic(t.analyticsPopupSuccess)}static getRoomInvitationShareActivityLinkData(e){return{message:o.a7.t("strings:homePage.popups.discordRoomInvitationUsingShareActivityLink.text"),referralTypeId:`${n.Td.DiscordRoomInvitationUsingShareActivityLink.toString()}+room=${e}
1`,analyticsPopupTriggered:n.dN.RoomInvitationUsingShareActivityLinkPopupTriggered,analyticsPopupSuccess:n.dN.RoomInvitationUsingShareActivityLinkSuccessfullyShared}}static inviteFriendsOrShareActivityLink(e,t){a.inviteFriendsIfAllowed(e,t)||a.shareActivityLink(e,t.shareActivityLinkData)}static inviteFriendsToRoom(e,t){a.inviteFriendsOrShareActivityLink(e,{inDiscordServer:t.inDiscordServer,canInviteFriends:t.canInviteFriends,shareActivityLinkData:a.getRoomInvitationShareActivityLinkData(t.roomId)})}static sendShareActivityLinkAnalytic(e){const t={type:n.k0.ReferralAnalytics,category:n.eX.ShareActivityLink,floatValue:e};r.CA.sendAnalyticEvent(t)}}},23359:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var i=s(46507),n=s(11445),r=s(9902);const o=(0,n.K)(i.ep),a={key:"strings:popups.reportPopup.reportedPopupText"},c={key:"strings:popups.reportPopup.success"};function l(e,t,s){const n=s?a:c;o({playerName:e,reasons:i.Qt,onReport:s=>{t(e,i.wD.fromReasonId(s)),(0,r.C)({title:{key:"strings:popups.reportPopup.reported"},body:n})}})}},23566:(e,t,s)=>{"use strict";e.exports=s.p+"assets/metropolis_trade.ff1adabda27121403f8c.svg"},23789:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_brick.5950ea07a7ea01bc54a5.svg"},23813:(e,t,s)=>{"use strict";function i(e,t){const s={};let i=!1;for(const e in t){const a=t[e],c=Array.isArray(a)?r(a):n(a);s[`${e}`]=c,o(a)&&(i=!0)}return{key:e.key,options:{...e.options,...s,interpolation:{escapeValue:!i}}}}function n(e){return`$t(${e.key}, ${JSON.stringify(e.options)})`}function r(e){const t=[];for(const s of e)t.push(n(s));return t}function o(e){const t=Array.isArray(e)?e:[e];for(const e of t)if(null!=e.options)return!0;return!1}s.d(t,{d:()=>i})},23918:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_3.bdf9bed70b715ad2ab2c.svg"},24036:(e,t,s)=>{"use strict";e.exports=s.p+"assets/seafarers_cities_and_knights.43e95ec3637274800502.svg"},24127:(e,t,s)=>{"use strict";s.d(t,{r:()=>c});var i=s(9029),n=s(36872),r=s(50482),o=s(22030),a=s(87770);class c{createPerks(){const e=(0,i.Le)(this.bodyDiv,"store_page_membership_grid",""),t=r.Zt.getMembershipProduct(n.Qb.EliteMonthly),s=this.getValidMembershipPerks(t);for(const t of s)this.createPerkIn(e,t)}createPerkIn(e,t){const s=(0,i.Le)(e,"",""),n=(0,i.zO)(s,t.imageUrl),r=(0,i.Le)(e,"",""),o=(0,i.Wr)(r,t.description,"",""),a=c.createInfoIcon(e,t);this.isPerkActive(t)||(n.style.display="none",o.style.opacity="50%",a.style.opacity="50%")}addBestValueHint(){if(!this.membershipProduct.bestValue)return;this.productDiv.classList.add("store_page_membership_best_value_border");const e=(0,i.Le)(this.headerDiv,"badge-white badge-lg");(0,i.Wr)(e,{key:"strings:storePage.bestValue"},"")}getValidMembershipPerks(e){const t=structuredClone(this.membershipProduct.perks);for(const s of e.perks)t.some(e=>e.type==s.type)||s.type!=o.gr.FullReplay&&t.push(s);
1return c.mergeMapsAndExpansionDescriptions(t),t}static mergeMapsAndExpansionDescriptions(e){const t=e.find(e=>e.type==o.gr.AllMaps),s=e.find(e=>e.type==o.gr.AllExpansions);if(!t||!s)return e;const i=e.indexOf(t);return e.splice(i,1),s.description={key:"strings:storePage.sections.membership.perks.allMapsAndExpansions"},e}isPerkActive(e){return this.membershipProduct.perks.some(t=>t.type==e.type)}static createInfoIcon(e,t){const s=(0,i.Le)(e,"","");if(![o.gr.AllExpansions,o.gr.AllMaps,o.gr.BasicReplay,o.gr.FullReplay,o.gr.PremiumMatchmaking].includes(t.type))return s;const r=(0,i.zO)(s,n.am.InfoIcon);return c.createClickEventForInfoIcon(r),s}static createClickEventForInfoIcon(e){(0,i.G0)(e,()=>(0,a.w)(),!1,!0)}constructor(e,t){this.membershipProduct=t,this.productDiv=(0,i.Le)(e,"store_page_membership",""),this.headerDiv=(0,i.Le)(this.productDiv,"store_page_membership_header "+this.membershipProduct.membershipColor,""),(0,i.zO)(this.headerDiv,this.membershipProduct.lobbyImage,"header_background_image"),(0,i.zO)(this.headerDiv,this.membershipProduct.lobbyImage),(0,i.n8)(this.headerDiv,this.membershipProduct.membershipTitle,"","","H2"),this.bodyDiv=(0,i.Le)(this.productDiv,"store_page_membership_body",""),this.createPerks(),this.addBestValueHint()}}},24309:(e,t,s)=>{"use strict";e.exports=s.p+"assets/colonist_rush.a2f49d4c0fbecdb5b95e.svg"},24368:(e,t,s)=>{"use strict";e.exports=s.p+"assets/road_gold.c48ddeff8c81a713c940.svg"},24460:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_mysticblue.32a6f930f077420c71ba.svg"},24674:(e,t,s)=>{"use strict";s.d(t,{c:()=>a});var i=s(17399);if(517!=s.j)var n=s(87069);var r=s(51662),o=s(72239);class a{static register(e){if(null!=this.loader)throw new Error("GameEngineLoader is already registered");this.loader=e,this.scheduleIdlePrefetch()}static async ensureReady(){if(null==this.loader)return;var e;null!==(e=this.constructPromise)&&void 0!==e||(this.constructPromise=this.createGameEngine());const t=await this.constructPromise,i=await Promise.all([s.e(175),s.e(728),s.e(567),s.e(675)]).then(s.bind(s,78046));return await i.UIGameSpriteHandler.loadAssets(!0),t}static scheduleIdlePrefetch(){(0,n.O)(()=>{this.prefetch().catch(e=>{(0,i.vV)("GameEngineLoader.prefetch",[e])})})}static async prefetch(){if(null==this.loader)return;var e;null!==(e=this.constructPromise)&&void 0!==e||(this.constructPromise=this.createGameEngine());const t=await Promise.all([s.e(175),s.e(728),s.e(567),s.e(675)]).then(s.bind(s,78046));await Promise.all([this.constructPromise,t.UIGameSpriteHandler.loadAssets(!1)])}static async createGameEngine(){if(null==this.loader)throw new Error("Game engine loader is not registered");try{await r.m.webGLCheck();const e=await this.loader.loadGameManagerFactory();return await(0,o.cb)(),e()}catch(e){throw this.constructPromise=void 0,e}}}},24880:(e,t,s)=>{"use strict";e.exports=s.p+"assets/store_color_black.5402db69abb248187cfc.svg"},24912:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_gifting_thanksgiving.0cf1f7ccd5667b4d709a.png"},25061:(e,t,s)=>{"use strict";e.exports=s.p+"assets/membership_icon_premium.df4327a99ca9fb53a8d7.svg"},25196:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_city_place.ef88a7889150162d1350.mp3"},25204:(e,t,s)=>{"use strict";if(s.d(t,{B5:()=>a,Lg:()=>o,bR:()=>r,j:()=>c}),!/^(51|83)7$/.test(s.j))var i=s(15123);if(!/^(51|83)7$/.test(s.j))var n=s(29267);class r{constructor(e,t){this.x=e,this.y=t}}class o{get id(){return`${this.x}-${this.y}`}neighbors(){const e=[];return e.push(new o(this.x+1,this.y-1)),e.push(new o(this.x+1,this.y)),e.push(new o(this.x,this.y+1)),e.push(new o(this.x-1,this.y+1)),e.push(new o(this.x-1,this.y)),e.push(new o(this.x,this.y-1)),e}corners(){const e=[];return e.push(new a(this.x,this.y,i.LB.North)),e.push(new a(this.x+1,this.y-1,i.LB.South)),e.push(new a(this.x,this.y+1,i.LB.North)),e.push(new a(this.x,this.y,i.LB.South)),e.push(new a(this.x-1,this.y+1,i.LB.North)),e.push(new a(this.x,this.y-1,i.LB.South)),e}edges(){const e=[];return e.push(new c(this.x+1,this.y-1,n.L9.SouthWest)),e.push(new c(this.x+1,this.y,n.L9.West)),e.push(new c(this.x,this.y+1,n.L9.NorthWest)),e.push(new c(this.x,this.y,n.L9.SouthWest)),e.push(new c(this.x,this.y,n.L9.West)),e.push(new c(this.x,this.y,n.L9.NorthWest)),e}sameFace(e){return this.x==e.x&&this.y==e.y}toPixel(e,t){const s=t*Math.sqrt(3)*(this.x+this.y/2)+e.x,i=3*t/2*this.y+e.y;return new r(s,i)}constructor(e,t){this.x=e,this.y=t}}class a{get id(){return`${this.x}-${this.y}-${this.z}`}toPixel(e,t){const s=new o(this.x,this.y).toPixel(e,t);switch(this.z){case i.LB.North:return new r(s.x,s.y-t);case i.LB.South:return new r(s.x,s.y+t)}}touchingFaces(){const e=[];switch(this.z){case i.LB.North:e.push(new o(this.x+1,this.y-1)),e.push(new o(this.x,this.y)),e.push(new o(this.x,this.y-1));break;case i.LB.South:e.push(new o(this.x,this.y)),e.push(new o(this.x,this.y+1)),e.push(new o(this.x-1,this.y+1))}return e}touchingEdges(){const e=[];switch(this.z){case i.LB.North:e.push(new c(this.x+1,this.y-1,n.L9.West)),e.push(new c(this.x+1,this.y-1,n.L9.SouthWest)),e.push(new c(this.x,this.y,n.L9.NorthWest));break;case i.LB.South:e.push(new c(this.x,this.y+1,n.L9.NorthWest)),e.push(new c(this.x,this.y+1,n.L9.West)),e.push(new c(this.x,this.y,n.L9.SouthWest))}return e}adjacentCorners(){const e=[];switch(this.z){case i.LB.North:e.push(new a(this.x+1,this.y-2,i.LB.South)),e.push(new a(this.x+1,this.y-1,i.LB.South)),e.push(new a(this.x,this.y-1,i.LB.South));break;case i.LB.South:e.push(new a(this.x,this.y+1,i.LB.North)),e.push(new a(this.x-1,this.y+2,i.LB.North)),e.push(new a(this.x-1,this.y+1,i.LB.North))}return e}sameCorner(e){return this.x==e.x&&(this.y==e.y&&this.z==e.z)}constructor(e,t,s){this.x=e,this.y=t,this.z=s}}class c{get id(){return`${this.x}-${this.y}-${this.z}`}endPoints(){const e=[];
1switch(this.z){case n.L9.NorthWest:e.push(new a(this.x,this.y-1,i.LB.South)),e.push(new a(this.x,this.y,i.LB.North));break;case n.L9.West:e.push(new a(this.x-1,this.y+1,i.LB.North)),e.push(new a(this.x,this.y-1,i.LB.South));break;case n.L9.SouthWest:e.push(new a(this.x,this.y,i.LB.South)),e.push(new a(this.x-1,this.y+1,i.LB.North))}return e}centerPointToPixel(e,t){const s=new o(this.x,this.y).toPixel(e,t),i=t/2*Math.sqrt(3),n=this.getDirectionAngle(),a=i*Math.cos(2*Math.PI*n/360),c=i*Math.sin(2*Math.PI*n/360);return new r(s.x+a,s.y+c)}getDirectionAngle(){switch(this.z){case n.L9.NorthWest:return 240;case n.L9.West:return 180;case n.L9.SouthWest:return 120}}touchingFaces(){const e=[];switch(e.push(new o(this.x,this.y)),this.z){case n.L9.NorthWest:e.push(new o(this.x,this.y-1));break;case n.L9.West:e.push(new o(this.x-1,this.y));break;case n.L9.SouthWest:e.push(new o(this.x-1,this.y+1))}return e}sameEdge(e){return this.x==e.x&&(this.y==e.y&&this.z==e.z)}constructor(e,t,s){this.x=e,this.y=t,this.z=s}}},25549:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_search.fceb750a9ceb1fa1e4e7.svg"},25783:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o,y:()=>r});var i=s(84445),n=s(17399);function r(e){return e.map(e=>({name:e.name,imageSrc:(0,n.tu)(e.image),categorySlug:(0,i.bl)(e.category)}))}function o(e){return{items:r(e)}}},25918:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_signin.09776fae150baa9ee0bf.svg"},26626:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_sound_on.ce82851dda8c7f94b440.svg"},26674:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_snowflake_preview.80c0fa8ac185a8708ed8.png"},26876:(e,t,s)=>{"use strict";s.d(t,{Ly:()=>c,b4:()=>o,eJ:()=>l,hc:()=>a});var i=s(76092),n=s(80708);function r(e){const t={type:e,category:i.eX.MainFunnel};n.CA.sendAnalyticEvent(t)}function o(){r(i.k0.RushRulesPopupShown)}function a(){r(i.k0.RushRulesPopupStartGameClicked)}function c(){r(i.k0.RushRulesPopupDismissed)}function l(){r(i.k0.RushRulesPopupVideoClicked)}},26894:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_yearofplenty.3df210b5455b7438db09.svg"},27019:(e,t,s)=>{"use strict";e.exports=s.p+"assets/bronze.4ee59db67b7900c761eb.svg"},27058:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_knight_place.604372b092e27ba0954a.mp3"},27060:(e,t,s)=>{"use strict";s.d(t,{x:()=>i,z:()=>n});const i=3,n=4},27406:(e,t,s)=>{"use strict";e.exports=s.p+"assets/prob_12.6031ada2e92549efc5ba.svg"},27455:(e,t,s)=>{"use strict";s.d(t,{u:()=>a});var i=s(76092),n=s(80708);var r=s(55547),o=s(18587);function a(e,t,s){if(e&&!o.r.shouldHideStoreOnMobile)return()=>{r.P_.premiumMembershipCheckAction(),function(e,t){const s={type:i.k0.ItemInfoSubscribeClicked,category:i.eX.Store,stringValue:e,dimensions:{itemType:t}};n.CA.sendAnalyticEvent(s)}(t,s)}}},27532:(e,t,s)=>{"use strict";e.exports=s.p+"assets/logo.a66b03915fd67e4c68f8.svg"},27630:(e,t,s)=>{"use strict";s.d(t,{Y:()=>l,V:()=>c});var i=s(9902),n=s(55547),r=s(23288);class o extends r.U{shouldShowWarning(){const e=this.roomState.getSessions().find(e=>e.userSessionId==n.sZ.controller.session.id);return this.roomState.hostSession.userSessionId!=n.sZ.controller.session.id&&(!(null==e?void 0:e.isReadyToPlay)&&this.roomState.gameSetting.victoryPointsToWin>this.roomState.victoryPointsRecommendedLimit)}getTitle(){return{key:"strings:roomPage.warnings.readyUpExceedLimitWarning.title"}}getDescription(){return{key:"strings:roomPage.warnings.readyUpExceedLimitWarning.description"}}}var a=s(34865),c=function(e){return e[e.StartGameVPExceededRecommendedLimit=0]="StartGameVPExceededRecommendedLimit",e[e.ReadyUpVPExceededRecommendedLimit=1]="ReadyUpVPExceededRecommendedLimit",e}({});class l{static runWithWarning(e,t,s){const n=this.getWarningPopupContent(t,s);n.shouldShowWarning()?(0,i.C)({title:n.getTitle(),body:n.getDescription(),onConfirm:()=>e(!0),showCancelBtn:!0}):e()}static getWarningPopupContent(e,t){switch(e){case 0:return new a.n(t);case 1:return new o(t)}}}},28333:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_ship_move.2c671d2aea50c68e2a87.mp3"},28584:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_danger_red.8000c0879b039d8dfb32.svg"},28624:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_vp.672597308e3a8f1100ae.svg"},28785:(e,t,s)=>{"use strict";s.d(t,{$:()=>h});var i=s(71763),n=s(46507),r=s(67908),o=s(59200),a=s(18587),c=s(72046),l=s(13618);const d=(0,s(11445).K)(({onClose:e})=>i.createElement(n.fV,{onClose:e,onLearnMoreClick:()=>(0,l.Yf)("/faq#ranked",!0,!0)}));var u=s(51309);const h=({data:e,ctaConfig:t,onRankedModeChange:s})=>{var h;const p=(0,i.useCallback)(t=>e.subscribe(t),[e]),m=(0,i.useCallback)(()=>e.getState(),[e]),g=(0,i.useSyncExternalStore)(p,m);(0,i.useEffect)(()=>(e.init(),()=>
1e.dispose()),[e]);const f=e.getMyRowData(),y=null===(h=g.myStickyRowData)||void 0===h?void 0:h.unrankedOverrideMessage,v=null!=y?a.r.isUserOnMobileAppOrWeb?{key:"strings:colonistCommon.utils.n/a"}:y:void 0,S=g.noFriendsEmpty?{key:"strings:leaderboardPage.noRankedFriends"}:void 0;return i.createElement(n.Ec,{rowData:g.rowData,myRowData:f,unrankedMessage:v,emptyText:S,moreDataAvailable:g.moreDataAvailable,leaderboards:g.tableTabs.map(e=>({id:e.leaderboardUrl,label:o.f.tLeaderboardTabName(e.label)})),enabledRankedModeIds:g.enabledTabIds,activeRankedModeId:r.Wz[g.rankedModeType],activeLeaderboardUrl:g.leaderboardUrl,searchNode:i.createElement(n.Ac,{defaultValue:g.searchTerm,onSearch:t=>{e.changeSearch(t)}}),seasonStartDate:g.seasonStartDate,seasonEndDate:g.seasonEndDate,onRankedModeChange:t=>{(async t=>{await e.changeRankedMode(r.Wz[t]),null==s||s()})(t)},onLeaderboardChange:t=>{e.changeLeaderboardUrl(t)},fetchMoreData:()=>e.fetchMoreData(),onClickRow:e=>c.x.init(e.username,n.F_.Ranked),onClickLocationFlag:t=>{t.myData||null!=t.countryLeaderboardUrl&&e.changeLeaderboardUrl(t.countryLeaderboardUrl)},onClickDivisionIcon:()=>d(),onClickMembershipIcon:()=>(0,l.Yf)("/store#membership",!0,!0),onClickLogin:(()=>{const e=g.myStickyRowData;return null!=e&&!e.loggedIn})()?()=>new u.L:void 0,isUserOnDiscord:a.r.isUserOnDiscord,ctaConfig:t})}},28943:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_rushinfo.cd66000344dc8ab386d0.svg"},29100:(e,t,s)=>{"use strict";s.d(t,{ck:()=>k,aO:()=>R,lw:()=>E,g0:()=>I,oS:()=>D,ri:()=>M,qL:()=>A,GJ:()=>L});var i=s(16611),n=s(54823),r=s(76092),o=s(80708),a=s(55547),c=s(655),l=s(32398),d=s(44529),u=s(44517),h=s(82535),p=s(46507);const m=(0,s(11445).K)(p.rx);var g=s(9902),f=s(18587),y=s(13618),v=s(98389),S=s(7894),b=s(60144);const C={[r.sG.Google]:{link:()=>l.l.googleLink(),unlink:()=>l.l.googleUnlink()},[r.sG.Discord]:{link:()=>l.l.discordLink(),unlink:()=>l.l.discordUnlink()},[r.sG.Apple]:{link:()=>l.l.appleLink(),unlink:()=>l.l.appleUnlink()}};function P(e,t){f.r.isUserOnDiscord?function(e){(0,g.C)({title:{key:"strings:popups.errors.discordRedirectToWeb.title"},body:{key:"strings:popups.errors.discordRedirectToWeb.body"},confirmLabel:{key:"strings:popups.errors.discordRedirectToWeb.cta"},onConfirm:()=>(0,y.Yf)(`https://colonist.io/profile/${e}#settings`,!0)})}(e):t()}function k(){i.A9.play(i.hc.Click);const e={type:r.k0.ClickedStore,category:r.eX.Store};o.CA.sendAnalyticEvent(e),(0,y.Yf)("/store#membership",void 0,!0)}function T(){i.A9.play(i.hc.Click),h.B.executeStripeCustomerPortalSession()}function A(e){P(e,T)}function R(e,t){P(e,()=>(0,y.Yf)(C[t].link()))}function w(e){const t=C[e].unlink();(0,g.C)({title:{key:"strings:profilePage.removeAccount.title"},body:{key:"strings:profilePage.removeAccount.body"},onConfirm:()=>{!async function(e){null!=await c.m.getRequestHandler(e,void 0)&&location.reload()}(t)},showCancelBtn:!0})}function I(e,t){P(e,()=>w(t))}function M(){(0,g.C)({title:{key:"strings:homePage.header.logoutPopup.title"},body:{key:"strings:homePage.header.logoutPopup.body"},onConfirm:async()=>{null!=await c.m.postRequestHandler(l.l.logout(),void 0,void 0)&&(d.p.setUserBypassedLogin(!1),d.p.clearUserState(),(0,y.Yf)((0,y.mE)()))},showCancelBtn:!0})}function _(e){m({username:e,onConfirm:t=>{!async function(e,t){if(!(0,n.h)(e,t))return void(0,g.C)({title:{key:"strings:popups.errors.general.title"},body:{key:"strings:profilePage.deleteAccount.usernamesDontMatch"}});const s={username:t};null!=await c.m.postRequestHandler(l.l.apiDeleteProfile(),void 0,s,"application/json")&&(d.p.clearUserState(),a.i0.sendEvent(u.s.ReloadWebsite),(0,y.Yf)("/?account-deleted=1"))}(e,t)}})}function E(e){P(e,()=>_(e))}function D(){(0,v.y)({selectColorAction:async e=>await b.a.updatePreferredColor(e)})}function L(){var e,t,s;(0,S.q)({width:document.body.clientWidth,height:document.body.clientHeight,userAgent:navigator.userAgent,platform:null!==(s=null===(t=window.navigator)||void 0===t||null===(e=t.userAgentData)||void 0===e?void 0:e.platform)&&void 0!==s?s:navigator.platform,cookieEnabled:navigator.cookieEnabled})}},29249:(e,t,s)=>{"use strict";s.d(t,{n:()=>i,q:()=>n});var i=function(e){return e[e.Information=0]="Information",e[e.Success=1]="Success",e[e.Warning=2]="Warning",e[e.Error=3]="Error",e[e.SocketError=4]="SocketError",e[e.Reconnect=5]="Reconnect",e}({});
1class n{}},29267:(e,t,s)=>{"use strict";s.d(t,{K2:()=>c,L9:()=>a});var i=s(63359),n=s(87952),r=s(68924),o=s(55935),a=function(e){return e[e.NorthWest=0]="NorthWest",e[e.West=1]="West",e[e.SouthWest=2]="SouthWest",e}({}),c=function(e){return e[e.Road=1]="Road",e[e.Ship=2]="Ship",e}({});const l=i.Ikc({x:i.aig().int().readonly(),y:i.aig().int().readonly(),z:i.k5n(a).readonly(),owner:i.KCZ([i.k5n(o.DS).exclude(["None"]),i.chJ()]).exactOptional(),type:i.KCZ([i.k5n(c),i.chJ()]).exactOptional()}).strict();(0,n.rd)(l);const d=(0,r.e)(l);(0,n.rd)(d,{requireAtLeastOneEntry:!0})},29297:(e,t,s)=>{"use strict";e.exports=s.p+"assets/social_icon_x.50cea629a9c993752e63.svg"},29319:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_wall_black.48c681c0690df06eb44f.svg"},29567:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_wall_green.6d64a1276d6823f48223.svg"},29806:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_profile_friends.1bfd063191711b70ff79.svg"},29962:(e,t,s)=>{"use strict";s.d(t,{O:()=>i});class i{}i.PLUS=7499,i.PREMIUM=14999,i.ELITE=19999},30040:(e,t,s)=>{"use strict";s.d(t,{s:()=>i});class i{set(e,t){null!=this.storage&&this.storage.setItem(e,String(t))}get(e,t=null){return null!=this.storage?this.storage.getItem(e):t}setJSON(e,t){null!=this.storage&&this.storage.setItem(e,JSON.stringify(t))}getJSON(e,t=null){if(null==this.storage)return t;const s=this.storage.getItem(e);if(null==s)return t;try{return JSON.parse(s)}catch{return t}}delete(e){null!=this.storage&&this.storage.removeItem(e)}constructor({storage:e}){this.storage=e}}},30081:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_event_politics.b1c46a6a3c1437381142.svg"},30429:(e,t,s)=>{"use strict";e.exports=s.p+"assets/road_white.78e66baab120779d5c30.svg"},30762:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_player.823fcffb830b912c3bc5.svg"},30817:(e,t,s)=>{"use strict";s.d(t,{P:()=>c,p:()=>o});var i=s(63359),n=s(72239),r=s(87952),o=function(e){return e[e.Settlement=0]="Settlement",e[e.City=1]="City",e[e.DevelopmentCardVictoryPoint=2]="DevelopmentCardVictoryPoint",e[e.LargestArmy=3]="LargestArmy",e[e.LongestRoad=4]="LongestRoad",e[e.Chits=5]="Chits",e[e.Metropolis=6]="Metropolis",e[e.DefenderOfColonist=7]="DefenderOfColonist",e[e.ProgressCardVictoryPoint=8]="ProgressCardVictoryPoint",e[e.Merchant=9]="Merchant",e}({});const a=n.h4.getEnumValues(o),c=(0,r.Qc)(a,i.aig().int().nonnegative())},30911:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r,k:()=>o});var i=s(53015);if(517!=s.j)var n=s(55935);const r=2;class o{static getStorePlayerColorOfPlayerColor(e){switch(e){case n.DS.None:case n.DS.Red:case n.DS.Blue:case n.DS.Orange:case n.DS.Green:return;case n.DS.Black:return i.WB.Black;case n.DS.Purple:return i.WB.Purple;case n.DS.MysticBlue:return i.WB.MysticBlue;case n.DS.White:return i.WB.White;case n.DS.Bronze:return i.WB.Bronze;case n.DS.Silver:return i.WB.Silver;case n.DS.Gold:return i.WB.Gold;case n.DS.Pink:return i.WB.Pink}}static getPlayerColorOfStorePlayerColor(e){switch(e){case i.WB.Gold:return n.DS.Gold;case i.WB.Silver:return n.DS.Silver;case i.WB.Bronze:return n.DS.Bronze;case i.WB.Black:return n.DS.Black;case i.WB.Purple:return n.DS.Purple;case i.WB.MysticBlue:return n.DS.MysticBlue;case i.WB.White:return n.DS.White;case i.WB.Pink:return n.DS.Pink}}constructor(){this.activeInStore=!1,this.subscriptionOnly=!1,this.hideOnDiscordMobile=!1}}},31364:(e,t,s)=>{"use strict";e.exports=s.p+"assets/settlement_green.1b78c696cd137be02fae.svg"},31597:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_beginner_hint_activated.99512f2b1314db3489d6.mp3"},31869:(e,t,s)=>{"use strict";e.exports=s.p+"assets/membership_icon_holiday2023.081572d7f5bd075ccb33.svg"},31941:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_profile_history.72004f9b4244690de945.svg"},32132:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_pass_turn.8d5b7a48c40a85b859cd.svg"},32223:(e,t,s)=>{"use strict";s.d(t,{C2:()=>l,Tu:()=>c,W5:()=>a,a3:()=>r});var i=s(76092),n=s(80708),r=function(e){return e.MilestoneSignup="milestone_signup",e.RoomEntryLogin="room_entry_login",e}({});function o(e,t){const s={type:e,category:i.eX.MainFunnel,dimensions:t};n.CA.sendAnalyticEvent(s)}function a(e){o(i.k0.GuestPopupShown,{source:e})}function c(e,t){o(i.k0.GuestPopupLoginClicked,{source:e,provider:i.sG[t]})}function l(e){o(i.k0.GuestPopupContinueAsGuest,{source:e})}},32294:(e,t,s)=>{"use strict";function i(e){return Math.floor(e)}s.d(t,{Q:()=>i})},32398:(e,t,s)=>{"use strict";s.d(t,{l:()=>n});var i=s(18587);
1class n{static socketServerWSS(){return i.r.ejsSocketServerWss}static googleAuth(e){return e?`auth/google?callbackHash=${e}`:"/auth/google"}static appleAuth(e){return e?`/auth/apple?callbackHash=${e}`:"/auth/apple"}static discordAuth(e){return e?`/auth/discord?callbackHash=${e}`:"/auth/discord"}static discordActivityAuth(){return"/auth/discord-activity"}static googleLink(e){return e?`/auth-link/google?callbackHash=${e}`:"/auth-link/google"}static appleLink(e){return e?`/auth-link/apple?callbackHash=${e}`:"/auth-link/apple"}static discordLink(e){return e?`/auth-link/discord?callbackHash=${e}`:"/auth-link/discord"}static googleUnlink(){return"/auth-unlink/google"}static appleUnlink(){return"/auth-unlink/apple"}static discordUnlink(){return"/auth-unlink/discord"}static logout(){return"/logout"}static checkoutProductUrl(e){return`/checkout?product=${e}`}static checkoutMembershipUrl(e){return`/checkout?membership=${e}`}static checkoutOneTimePurchaseUrl(e){return`/checkout?one-time-purchase=${e}`}static apiPayGetStoreStripeSession(){return"/api/pay/get-store-stripe-session"}static apiPayGetStripePaymentClientSecret(){return"/api/pay/get-stripe-payment-client-secret"}static apiPayGetStoreXsollaSession(){return"/api/pay/get-store-xsolla-session"}static apiPayCreateCustomerPortalSession(){return"/api/pay/stripe-create-customer-portal-session"}static apiPayPurchaseItem(){return"/api/pay/purchase-item"}static apiActivateGiftMembership(){return"/api/membership/activate-gift"}static apiCancelGiftMembership(){return"/api/membership/cancel-gift"}static apiStoreSocialProof(){return"/api/store/social-proof"}static apiAnalytics(){return"/api/analytic-events"}static apiUpdateProfile(){return"/api/profile-edit"}static apiDeleteProfile(){return"/api/profile/delete"}static apiFindGameState(){return"/api/find-game-ranked-state"}static apiModeSelector(){return"/api/mode-selector"}static apiUserState(){return"/api/user-state"}static apiUserStateCreate(){return"/api/user-state/create"}static apiUserLoginState(){return"/api/user-login-state"}static apiUserProfileAddFriend(){return"/api/profile-edit/add-friend-request"}static apiUserProfileAcceptFriend(){return"/api/profile-edit/accept-friend-request"}static apiUserProfileRemoveFriend(){return"/api/profile-edit/remove-friend"}static apiUserProfileRankedSeasons(){return"/api/profile/ranked-seasons"}static apiGetDiscordAccessToken(){return"/api/discord/token"}static apiHandleDiscordPurchase(){return"/api/discord/handle-purchase"}static apiSaveDiscordData(){return"/api/discord/save-data"}static apiFriendRequestsReceived(){return"/api/header/friend-requests-received"}static apiSetUserLanguage(){return"/api/user/language"}static apiSetUserReferrer(){return"/api/user/set-referrer"}static apiAssignABTest(){return"/api/user/assign-ab-test"}static apiGetRooms(){return"/data/rooms.json"}static apiGetGames(){return"/data/games.json"}static apiGetRegions(){return"/data/regions.json"}static apiReportPlayer(e){return`/api/${encodeURIComponent(e)}/report-user`}static apiFeedbackFormSubmit(){return"/api/feedback-form"}static apiFeedbackFormShow(){return"/api/show-feedback-form"}static apiGetNotifications(){return"/api/notifications"}static apiMarkNotificationAsRead(e){return`/api/notifications/${e}/mark-as-read`}static apiValidateUsername(e){return`/api/validate-username/${e}`}static apiUsernameChangeInfo(){return"/api/profile-edit/username-change-info"}static apiEditProfileInfo(){return"/api/profile-edit/info"}static apiChangeRegion(){return"/api/profile/change-region"}static apiReplayShareableLink(e,t){return`/api/replay/shareable-link?gameId=${e}&playerColor=${t}`}static apiReplayDataFromSlug(e){return`/api/replay/data-from-slug?replayUrlSlug=${e}`}static apiReplayDataFromGameId(e,t){return`/api/replay/data-from-game-id?gameId=${e}&playerColor=${t}`}static apiRedeemGiftFromHash(){return"/api/gift-membership/redeem"}static apiGetGiftMembershipData(e){return`/api/gift-membership/hash?hash=${e}`}static apiSaveGiftMetadata(){return"/api/gift-membership/metadata"}static apiReactivationMessage(){return"/api/plan-user-reactivation"}static apiChampionship25Content(){return"/api/championship25/content"}static apiChampionship26Content(){return"/api/championship26/content"}static apiHelplyToken(){return"/api/helply-token"}static apiNoltToken(){return"/api/nolt-token"}}n.apiUserProfile=Object.freeze({stickyPlayerInfo:e=>`/api/profile/${encodeURIComponent(e)}/sticky-player-info`,overview:e=>`/api/profile/${encodeURIComponent(e)}/overview`,history:e=>`/api/profile/${encodeURIComponent(e)}/history`,items:e=>`/api/profile/${encodeURIComponent(e)}/items`,friends:()=>"/api/profile/friends",ranked:e=>`/api/profile/${encodeURIComponent(e)}/ranked`,username:e=>`/api/profile/${e}/username`}),n.apiLeaderboards=Object.freeze({data:(e,t)=>`/api/leaderboards/${e}/${t}`,usernameSearch:(e,t)=>`/api/leaderboards-username-search/${e}/${t}`,tabs:e=>`/api/leaderboards-tabs/${e}`,stickyRowData:(e,t)=>`/api/leaderboards-my-sticky-row-data/${e}/${t}`})},32581:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_hourglass.6bc68349265ccde43880.svg"},32663:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_inactive_gold.8b603be7d7373391d16f.svg"},32741:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_active_mysticblue.97008f504adb4788e71c.svg"},32936:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_farmer.9cb32833f3b86664e95f.svg"},32980:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_gifting_valentines.85cb6aadc9f5394bb546.png"},33292:(e,t,s)=>{"use strict";s.d(t,{a:()=>p});var i=s(92524),n=s(64265),r=s(50482),o=s(13618),a=s(82535),c=s(17399),l=s(9029),d=s(17972),u=s(5201),h=s(19136);class p{hideNonStripePayments(){if(!this.isMembershipProduct())return;document.getElementById("label_paypal").style.display="none";document.getElementById("label_amazon_pay").style.display="none";document.getElementById("label_bitpay").style.display="none";document.getElementById("label_other_methods").style.display="none"}deactivatePaynowButton(){this.paynowButton.classList.add("inactive"),(0,l.G0)(this.paynowButton,()=>{})}activatePaynowButton(){this.paynowButton.classList.remove("inactive"),(0,l.G0)(this.paynowButton,()=>this.clickedPaynow())}static getStoreProduct(){const e=(0,o.Ez)("product");
1if(null!=e){const t=Number(e);return n.AB.getPurchaseProduct(t)}const t=(0,o.Ez)("membership");if(null!=t){const e=Number(t);return r.Zt.getMembershipProduct(e)}const s=(0,o.Ez)("one-time-purchase");if(null!=s){const e=Number(s),t=d.f.getOneTimePurchaseProduct(e);if(0==t.isActive())return;return t}}generateCheckoutItem(){this.isMembershipProduct()?this.generateMembershipCheckoutText():this.generateCoinCheckoutText()}generateMembershipCheckoutText(){const e=this.product;e.billedAnnually?(0,l.RH)(this.itemPrice,{key:"strings:storePage.sections.membership.billing.yearlyPayment",options:{amount:e.getAnnualPrice()}}):(0,l.RH)(this.itemPrice,{key:"strings:colonistCommon.utils.#buffer",options:{value:"$"+this.product.getDefaultPrice()}}),(0,l.RH)(this.itemName,this.product.getProductName()),this.generateMembershipRenewalCheckoutText(),this.itemImage.src=(0,c.tu)(this.product.lobbyImage)}generateCoinCheckoutText(){(0,l.RH)(this.itemPrice,{key:"strings:colonistCommon.utils.#buffer",options:{value:this.product.getDefaultPrice()}}),(0,l.RH)(this.itemName,this.product.getProductName()),this.itemImage.src=(0,c.tu)(this.product.lobbyImage)}generateMembershipRenewalCheckoutText(){const e=document.getElementById("membership-renewal-info"),t={key:"strings:storePage.checkout.membershipRenewalInfo",options:{date:this.calculateMembershipRenewalDate()}};(0,l.RH)(e,t)}calculateMembershipRenewalDate(){const e=new Date;return this.product.billedAnnually?e.setFullYear(e.getFullYear()+1):e.setMonth(e.getMonth()+1),e.toLocaleDateString()}connectPaymentForm(){for(const e of this.radioButtons)(0,l.G0)(e,()=>this.activatePaynowButton())}getSelectedPaymentMethod(){for(const e of this.radioButtons)if(e.checked)switch(e.id){case"credit_debit":case"google_pay":case"apple_pay":return i.g5.Stripe;case"paypal":case"amazon_pay":case"bitpay":case"other_methods":return i.g5.Xsolla}return(0,c.vV)("getSelectedPaymentMethod",["Error wtf"]),i.g5.Stripe}isMembershipProduct(){return this.product instanceof r.Zt}clickedPaynow(){const e=this.getSelectedPaymentMethod();e==i.g5.Stripe&&a.B.executeStripeColonistProductPurchaseSession(this.product.storeProductType,this.product.type,this.product.itemQuantity),e==i.g5.Xsolla&&a.B.executeXsollaColonistCoinPurchaseSession(this.product.storeProductType,this.product.type)}constructor(){u.z.startFlowRecording(h.M.Store),this.paynowButton=document.getElementById("checkout_paynow_button"),this.itemImage=document.getElementById("checkout_item_image"),this.itemPrice=document.getElementById("checkout_item_price"),this.itemName=document.getElementById("checkout_item_name"),this.radioButtons=document.getElementsByName("payment_method");const e=p.getStoreProduct();null!=e?(this.product=e,this.hideNonStripePayments(),this.activatePaynowButton(),this.generateCheckoutItem(),this.connectPaymentForm()):this.deactivatePaynowButton()}}},33460:(e,t,s)=>{"use strict";s.d(t,{w:()=>l,g:()=>d});var i=s(9029),n=s(70908),r=s(18587),o=s(72239);class a{update(e){if(this.stopCountdown(),this.cardContainer.replaceChildren(),this.sectionDiv.classList.toggle("hidden",null==e),null==e)return;const t=(0,i.Le)(this.cardContainer,"store_page_membership store_page_active_gift_membership"),s=(0,i.Le)(t,"store_page_active_gift_membership_header");(0,i.zO)(s,e.membershipProduct.lobbyImage),(0,i.n8)(s,e.membershipProduct.membershipTitle,"","","H2");const n=(0,i.Le)(t,"store_page_membership_body");if(null!=e.giftedByUsername&&(0,i.Wr)(n,{key:"strings:storePage.sections.membership.activeGift.giftedBy",options:{gifter:e.giftedByUsername}},""),null!=e.activatedAt){const t=e.activatedAt.toLocaleDateString(r.r.language,{day:"numeric",month:"short",year:"numeric"});(0,i.Wr)(n,{key:"strings:storePage.sections.membership.activeGift.activatedOn",options:{date:t}},"")}null!=e.endsAt&&(this.endsInText=(0,i.Wr)(n,{key:"strings:colonistCommon.utils.emptyString"},""),this.endsAt=e.endsAt,this.updateCountdown())}updateCountdown(){if(null==this.endsInText||null==this.endsAt)return;const e=this.endsAt.getTime()-Date.now();(0,i.RH)(this.endsInText,{key:"strings:storePage.sections.membership.activeGift.endsIn",options:{timeLeft:c(e)}}),e<=0||(this.countdownTimer=setTimeout(()=>this.updateCountdown(),o.Re.getAdaptiveCountdownPollIntervalMs(e)))}stopCountdown(){null!=this.countdownTimer&&clearTimeout(this.countdownTimer),this.countdownTimer=void 0,this.endsInText=void 0,this.endsAt=void 0}constructor(e,t){this.sectionDiv=e,this.cardContainer=t}}function c(e){const t=Math.max(0,Math.floor(e/o.R$.minutesAsMilliseconds(1))),s=Math.floor(t/1440),i=Math.floor(t%1440/60),r=t%60,a=[];return s>0&&a.push(n.a7.t("strings:colonistCommon.dates.day",{count:s})),i>0&&a.push(n.a7.t("strings:colonistCommon.dates.hour",{count:i})),a.push(n.a7.t("strings:colonistCommon.dates.minute",{count:r})),a.join(" ")}const l="store_page_membership_title";class d{setMembershipTitle(){const e=document.getElementById(l);null!=e&&(0,i.RH)(e,{key:"strings:storePage.sections.membership.title"})}onMembershipToggleChanged(e){}updateActiveGiftMembership(e){if(null==this.activeGiftMembershipView){const e=document.getElementById("active_gift_membership"),t=document.getElementById("store_page_active_gift_membership_div");if(null==e||null==t)return;this.activeGiftMembershipView=new a(e,t)}this.activeGiftMembershipView.update(e)}constructor(){this.membershipItems=[],setTimeout(()=>this.setMembershipTitle(),100)}}},33555:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_chit.147cbb6f9a6127b840db.svg"},33724:(e,t,s)=>{"use strict";s.d(t,{j:()=>o});var i=s(36872),n=s(9029),r=s(90676);class o{get isDisabled(){return this._isDisabled}set isDisabled(e){this._isDisabled=e,this.slider.disabled=e,this.setSliderVisibility()}createContainer(){this.sliderContainer=(0,n.Le)(this.container,"room-settings-slider-container")}createHeader(){this.headerContainer=(0,n.Le)(this.sliderContainer,"room-settings-slider-header");const e=(0,n.Le)(this.headerContainer,"room-settings-slider-title");(0,n.n8)(e,this.title,""),this.sliderWarningImage=(0,n.zO)(e,i.am.DangerIcon,"hidden"),(0,r.vy)(this.sliderWarningImage,{key:"strings:roomPage.options.vpToWin.aboveRecommendedLimit"})}createSlider(){this.sliderTrackContainer=(0,n.Le)(this.sliderContainer,"room-settings-slider-track-container"),(0,n.i5)(this.sliderTrackContainer,"room-settings-slider-label",{key:"strings:colonistCommon.utils.#buffer",options:{value:this.min}});const e=(0,n.Le)(this.sliderTrackContainer,"room-settings-slider-wrapper");
1this.slider=(0,n.Dg)(e,"room-settings-slider-input","",this.min,this.max,this.step,this.defaultValue),this.sliderTrack=(0,n.Le)(e,"room-settings-slider-track"),this.sliderThumb=(0,n.i5)(e,"room-settings-slider-thumb",{key:"strings:colonistCommon.utils.#buffer",options:{value:this.defaultValue}}),(0,n.i5)(this.sliderTrackContainer,"room-settings-slider-label",{key:"strings:colonistCommon.utils.#buffer",options:{value:this.max}}),this.textDisplay=(0,n.i5)(this.sliderContainer,"room-settings-slider-text-display",{key:"strings:colonistCommon.utils.#buffer",options:{value:this.defaultValue}}),this.slider.oninput=()=>this.handleOnInput(),this.slider.onchange=()=>this.handleOnChange(),this.resizeObserver=new ResizeObserver(()=>this.updateSlider()),this.resizeObserver.observe(this.slider),this.updateSlider()}removeSlider(){this.resizeObserver.disconnect(),this.sliderTrackContainer.remove(),this.textDisplay.remove()}setSliderVisibility(){this.sliderContainer.classList.toggle("view-only",this.isDisabled)}updateSlider(){const e=this.slider.valueAsNumber,t=(e-this.min)/(this.max-this.min),s=this.slider.offsetWidth,i=t*s,r=Math.max(4,Math.min(i,s-4));this.sliderThumb.style.left=`${r}px`,(0,n.oB)(this.sliderThumb,{key:"strings:colonistCommon.utils.#buffer",options:{value:e}});const o=e!=this.defaultValue;this.sliderContainer.classList.toggle("modified",o),this.sliderThumb.classList.toggle("modified",o),this.sliderTrack.style.setProperty("--progress-percent",100*t+"%"),this.sliderTrack.classList.toggle("warning",this.isAboveWarningThreshold()),this.sliderWarningImage.classList.toggle("hidden",!this.isAboveWarningThreshold()),(0,n.oB)(this.textDisplay,{key:"strings:colonistCommon.utils.#buffer",options:{value:e}})}updateSliderConfig(e,t){e==this.defaultValue&&t==this.max||(this.defaultValue=e,this.max=t,this.removeSlider(),this.createSlider())}setWarningThreshold(e){this.sliderWarningThreshold=e}isAboveWarningThreshold(){return this.slider.valueAsNumber>this.sliderWarningThreshold}handleOnInput(){this.isDisabled||(null!=this.onInput&&this.onInput(this.slider.valueAsNumber),this.updateSlider())}handleOnChange(){this.container.style.overflow="",this.isDisabled||this.onChange&&this.onChange(this.slider.valueAsNumber)}setOnInput(e){this.onInput=e}setValue(e,t=!1){this.slider.value=e.toString(),this.isDisabled=t,this.updateSlider()}constructor(e,t,s,i,n,r=1,o,a=!1){this.container=e,this.title=t,this.defaultValue=s,this.min=i,this.max=n,this.step=r,this.onChange=o,this.createContainer(),this.createHeader(),this.createSlider(),this.isDisabled=a}}},33744:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_red.991ae0c7a0b95da9811d.svg"},33832:(e,t,s)=>{"use strict";s.d(t,{fT:()=>i,UA:()=>r,iV:()=>n});var i=function(e){return e.AppForeground="app_foreground",e.AppBackground="app_background",e.BackButtonPressed="back_button_pressed",e.GameStarted="game_started",e.LobbyLoaded="lobby_loaded",e.OrientationPortrait="orientation_portrait",e.OrientationLandscape="orientation_landscape",e.Resize="resize",e.ShareLink="room_link",e.ShareImage="share_image",e.RequestNotificationPermission="request_notification_permission",e.NotificationSetExternalUserId="notification_set_external_user_id",e.RequestReview="request_review",e.ShowTextNotification="show_text_notification",e.ShowTopBottomSafeArea="show_top_bottom_safe_area",e.ShowSplashScreen="should_show_splash_screen",e.AppEncounteredError="app_encountered_error",e.PurchaseProduct="purchase_product",e.GiftMembership="gift_membership",e.PurchaseMembership="purchase_membership",e.LocalizedPricingSubscriptions="localized_pricing_subscriptions",e.LocalizedPricingProducts="localized_pricing_products",e.UserCancelledPurchase="user_cancelled_purchase",e.ShowManageSubscriptions="show_manage_subscriptions",e.IAPCompleted="iap_completed",e.BannerAd="banner_ad",e}({});function n(e){return Object.values(i).includes(e)}var r=s(1199)},34405:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_wool.17a6dea8d559949f0ccc.svg"},34463:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_achievement_ck_progress.a6041ba5935a47b7a5b3.mp3"},34554:(e,t,s)=>{"use strict";s.d(t,{N:()=>r,q:()=>o});var i=s(29249),n=s(36872),r=function(e){return e[e.General=0]="General",e[e.Volume=1]="Volume",e}({});function o(e){switch(e){case i.n.Information:return n.am.InfoIcon;case i.n.Success:return n.am.CheckMark;case i.n.Warning:case i.n.Reconnect:return n.am.Lightning;case i.n.Error:case i.n.SocketError:return n.am.DangerIcon}}},34668:(e,t,s)=>{"use strict";s.d(t,{Q:()=>b});var i=s(46581),n=s(71068),r=s(78134);const o={[i.R1.BotEasy]:[i.R1.BotEasy,i.R1.BotEasy,i.R1.BotEasy],[i.R1.BotMedium]:[i.R1.BotMedium,i.R1.BotEasy,i.R1.BotEasy],[i.R1.BotHard]:[i.R1.BotMedium,i.R1.BotMedium,i.R1.BotMedium]},a={[i.R1.BotEasy]:i.K4.Slow,[i.R1.BotMedium]:i.K4.Normal,[i.R1.BotHard]:i.K4.Fast};class c{static getGameSettingsForStandardRoom(e){const t=new i.KN(e,i.Cz.CreatedRoomGame);return t.privateGame=!0,t.diceSetting=i.ZP.Balanced,t.friendlyRobber=!0,t}static applyRushDefaults(e){const t=r.qq.getModeDataForMode(i.p9.ColonistRush4P);null!=t&&(e.modeSetting=t.modeSetting,e.extensionSetting=t.extensionSetting,e.mapSetting=t.defaultMap,e.cardDiscardLimit=t.defaultCardDiscardLimit,e.friendlyRobber=t.defaultFriendlyRobber,e.victoryPointsToWin=t.defaultVPsToWin,e.gameSpeed=i.ro.Rush5s,e.botSpeed=i.K4.Fast)}static beginnerMode(e,t=n.eT.Level1){const s=new i.KN(e,i.Cz.BeginnerMode);return s.botSpeed=i.K4.Normal,s.gameSpeed=i.ro.Base12000s,s.modeSetting=i.p9.BeginnerModeClassic4P,s.diceSetting=i.ZP.Random,s.mapSetting=(0,n.NF)(t),s.victoryPointsToWin=(0,n.CL)(t),s.cardDiscardLimit=(0,n._O)(t),s}static botGame(e,t){const s=new i.KN(e,t.gameTypeEnum);for(const e of Object.keys(t))e in s&&(s[e]=t[e]);return s}static getBotGameBots(e){return[...o[e]]}static getRushBotGameBotSpeed(e){var t;return null!==(t=a[e])&&void 0!==t?t:i.K4.Fast}static getGameSettingsForFreeMap(e,t){const s=new i.KN(e,i.Cz.CreatedRoomGame);return s.hideBankCards=!0,s.gameSpeed=i.ro.Base60s,s.botSpeed=i.K4.Fast,s.mapSetting=t,s}static getGameSettingsForBeginnerMode(e){const t=c.beginnerMode(e);return t.hideBankCards=!1,t.diceSetting=i.ZP.Random,t.friendlyRobber=!1,t.privateGame=!0,t.karmaActive=!1,t}
1static getGameSettingsForTournamentRoom(e){const t=new i.KN(e,i.Cz.CreatedTournamentRoom);return t.privateGame=!0,t.hideBankCards=!0,t.playOrderSelectionActive=!1,t}static getGameSettingsForCustomLinkRoom(e){const t=c.getGameSettingsForStandardRoom(e);return t.privateGame=!0,t}static getGameSettingsForDiscordActivityLobby(e){const t=c.getGameSettingsForStandardRoom(e);return t.privateGame=!0,t.karmaActive=!1,t}static matchmakingClassic4P(){const e=new i.KN("",i.Cz.MatchmakingGame);return e.modeSetting=i.p9.Classic4P,e.extensionSetting=i.Ly.Players4,e.scenarioSetting=i.ec.None,e.mapSetting=i.Qy.Classic4P,e.diceSetting=i.ZP.Random,e.hideBankCards=!0,e.gameSpeed=i.ro.Base60s,e.botSpeed=i.K4.Fast,e}static matchmakingClassic1v1(){const e=new i.KN("",i.Cz.MatchmakingGame);return e.modeSetting=i.p9.Classic4P,e.maxPlayers=2,e.extensionSetting=i.Ly.Players4,e.scenarioSetting=i.ec.None,e.mapSetting=i.Qy.Classic4P,e.diceSetting=i.ZP.Balanced,e.hideBankCards=!0,e.gameSpeed=i.ro.Base30s,e.friendlyRobber=!0,e.victoryPointsToWin=15,e.cardDiscardLimit=9,e}static matchmakingCitiesAndKnights(){const e=new i.KN("",i.Cz.MatchmakingGame);return e.modeSetting=i.p9.CitiesAndKnights4P,e.extensionSetting=i.Ly.Players4,e.scenarioSetting=i.ec.None,e.mapSetting=i.Qy.Classic4P,e.diceSetting=i.ZP.Random,e.hideBankCards=!0,e.gameSpeed=i.ro.Base60s,e.victoryPointsToWin=13,e}static matchmakingRush4P(){const e=new i.KN("",i.Cz.MatchmakingGame);return e.modeSetting=i.p9.ColonistRush4P,e.extensionSetting=i.Ly.Players4,e.scenarioSetting=i.ec.None,e.mapSetting=i.Qy.Classic4P,e.diceSetting=i.ZP.Balanced,e.hideBankCards=!0,e.gameSpeed=i.ro.Rush5s,e.botSpeed=i.K4.Fast,e.cardDiscardLimit=9,e.friendlyRobber=!0,e}static matchmakingShuffle(){const e=new i.KN("",i.Cz.MatchmakingGame);return e.hideBankCards=!0,e.gameSpeed=i.ro.Base60s,e.botSpeed=i.K4.Fast,e.diceSetting=i.ZP.Balanced,e.friendlyRobber=!0,e}static testSetting(){const e=new i.KN("idid",i.Cz.Unknown);return e.modeSetting=i.p9.TutorialClassic4P,e.mapSetting=i.Qy.TutorialClassic4P,e.gameSpeed=i.ro.Base30s,e.botSpeed=i.K4.Fast,e}}var l=s(80708),d=s(24674),u=s(76092),h=s(55547),p=s(22030),m=s(36872),g=s(44529),f=s(9127),y=s(76349),v=s(75589),S=s(81888);class b{static interactedWithSite(){this.sendLobby(p.Dj.InteractedWithSite,!0)}static setAdBlockStatusToUserSession(e){this.sendLobby(p.Dj.SetAdBlockStatus,e)}static async continueCampaignMode(){await this.waitUntilGameCanBeStarted();const e=g.p.getBeginnerModeLevel();if(e==n.eT.End)return this.start1v1BeginnerBotGame();this.startBeginnerMode(e)}static async clickedStartBotGame(e,t){await this.waitUntilGameCanBeStarted();const s=this.createStartBotGameData(e);this.sendLobby(t,s)}static createStartBotGameData(e){return{clientVersion:m.$m,bots:c.getBotGameBots(e),difficulty:e}}static registerToFriendService(){y.v.canUseOnlineFriendService()&&this.sendGeneral(f.P7.RegisterToFriendService,{})}static changedOnlineStatus(e){y.v.canUseOnlineFriendService()&&b.sendGeneral(f.P7.ChangeOnlineStatus,e)}static getAllFriendsOnlineStatus(){y.v.canUseOnlineFriendService()&&b.sendGeneral(f.P7.GetAllFriendsOnlineStatus,{})}static inviteFriendToRoom(e,t){if(!y.v.canUseOnlineFriendService())return;const s={receiverUserId:e,roomId:t};this.sendGeneral(f.P7.InviteFriendToRoom,s)}static respondToFriendRoomInvite(e,t,s){if(!y.v.canUseOnlineFriendService())return;const i={roomId:e,accept:t,senderUserId:s};this.sendGeneral(f.P7.RespondToFriendRoomInvite,i)}static getAllFriendRoomInvitesReceived(){y.v.canUseOnlineFriendService()&&this.sendGeneral(f.P7.GetAllRoomInvitesReceived,{})}static registerToNotificationService(){v.G.canUseLiveNotificationService()&&this.sendGeneral(f.P7.RegisterToNotificationService,{})}static markNotificationAsRead(e){v.G.canUseLiveNotificationService()&&this.sendGeneral(f.P7.MarkNotificationAsRead,e)}static markAllNotificationsAsRead(){v.G.canUseLiveNotificationService()&&this.sendGeneral(f.P7.MarkAllNotificationsAsRead,{})}static getNotifications(e){v.G.canUseLiveNotificationService()&&this.sendGeneral(f.P7.GetNotifications,e)}static watchRoomList(){this.sendLobby(p.Dj.WatchRoomList,{})}static stopWatchingRoomList(){this.sendLobby(p.Dj.StopWatchingRoomList,{})}static clickedCreateRoom(e,t){this.sendAnalyticEvent(u.k0.JoinedRoom,u.eX.Room,void 0,u.lb.ClickedCreateRoom);const s={roomType:e,clientVersion:m.$m,isPrivate:t};this.sendLobby(p.Dj.ClickedCreateRoom,s)}static async clickedJoinRoom(e){await this.waitUntilGameCanBeStarted(),this.sendAnalyticEvent(u.k0.JoinedRoom,u.eX.Room,e,u.lb.ClickedLobbyRoom);const t={gameId:e,clientVersion:m.$m};this.sendLobby(p.Dj.ClickedJoinRoom,t)}static async clickedSpectateGame(e){await this.waitUntilGameCanBeStarted();const t={gameId:e,clientVersion:m.$m};this.sendLobby(p.Dj.ClickedSpectateGame,t)}static reconnectGame(e){(async()=>{await d.c.ensureReady();const t={gameId:e,clientVersion:m.$m};this.sendLobby(p.Dj.ReconnectGame,t)})()}static autoRejoinGame(){this.sendLobby(p.Dj.AutoRejoinGame,{})}static async enterRoom(e){try{await this.waitUntilGameCanBeStarted()}catch(e){if(e instanceof m.lc)return void this.updateURLToRoom("");throw e}const t={gameId:e,clientVersion:m.$m};
1this.sendLobby(p.Dj.AccessGameLink,t)}static async accessGameFromLink(e){this.sendAnalyticEvent(u.k0.JoinedRoom,u.eX.Room,e,u.lb.EnteredRoomLink),await this.enterRoom(e)}static startBeginnerMode(e){const t={clientVersion:m.$m,level:e,map:(0,n.NF)(e),bots:(0,n.$v)(e)};this.sendLobby(p.Dj.ClickedStartBeginnerMode,t)}static start1v1BeginnerBotGame(){const e={clientVersion:m.$m,bots:[i.R1.BotEasy]};this.sendLobby(p.Dj.Clicked1v1BeginnerBotGame,e)}static updateURLToRoom(e){window.location.hash!="#"+e&&window.location.assign("#"+e)}static joinChannel(e,t,s,i){(async()=>{try{await d.c.ensureReady();const n={channelId:e,isInitialLoad:s,roomOrGameId:i,...t};this.sendChannel(p.s4.ChannelJoin,n)}catch(e){if(!(e instanceof m.lc))throw e;this.updateURLToRoom("")}})()}static clickedJoinChannelRoomOrGame(e,t){(async()=>{await d.c.ensureReady();const s={channelId:e,roomType:t};this.sendChannel(p.s4.ChannelJoinRoomOrGame,s)})()}static sendLobby(e,t){const s={action:e,payload:t};h.sZ.controller.sender.sendToServerType(m.lo.LobbyAction,"lobby",s,p.II.includes(e))}static sendChannel(e,t){const s={action:e,payload:t};h.sZ.controller.sender.sendToServerType(m.lo.ChannelAction,"lobby",s,p.jP.includes(e))}static sendGeneral(e,t){const s={action:e,payload:t};h.sZ.controller.sender.sendToServerType(m.lo.GeneralAction,"lobby",s,!1)}static sendAnalyticEvent(e,t,s,i){const n={type:e,category:t,stringValue:s,floatValue:i};l.CA.sendAnalyticEvent(n)}static async waitUntilGameCanBeStarted(){await S._.requireUser(),await d.c.ensureReady()}}},34777:(e,t,s)=>{"use strict";s.d(t,{$:()=>h});var i=s(9029),n=s(72239),r=s(655),o=s(32398),a=s(18587),c=s(36872);const l=[{slug:"gQYTA2vXZQV9fT2n"}],d=[{gameId:"191208779",playerColor:11},{gameId:"191208784",playerColor:5},{gameId:"191208346",playerColor:3},{gameId:"191208573",playerColor:5}],u=[{gameId:"191197897",playerColor:2},{gameId:"191197330",playerColor:1},{gameId:"191196681",playerColor:4},{gameId:"191198102",playerColor:2},{gameId:"191199121",playerColor:2},{gameId:"191196320",playerColor:5},{gameId:"191196489",playerColor:5},{gameId:"191196952",playerColor:1},{gameId:"191197221",playerColor:11},{gameId:"191197079",playerColor:1},{gameId:"191196444",playerColor:4},{gameId:"191197644",playerColor:1},{gameId:"191197558",playerColor:5},{gameId:"191196948",playerColor:12},{gameId:"191196835",playerColor:6},{gameId:"191196714",playerColor:1}];class h{static async loadContent(){try{const e=await r.m.getRequestHandler(o.l.apiChampionship25Content(),void 0);if(null==e)return;const t=e.json;if(null==t)return;Array.isArray(t.partners)&&h.renderPartners(t.partners)}catch(e){return}}static renderResults(){const e=document.getElementById("championship25-final-grid"),t=document.getElementById("championship25-semifinals-grid"),s=document.getElementById("championship25-quarterfinals-grid");e&&h.renderResultCards(e,l),t&&h.renderResultCards(t,d),s&&h.renderResultCards(s,u)}static renderResultCards(e,t){t.forEach((t,s)=>{const n=(0,i.Le)(e,"result-card"),r=(0,i.Le)(n,"result-info");(0,i.i5)(r,"result-title",{key:"strings:colonistCommon.utils.#buffer",options:{value:`Table ${s+1}`}});const o=h.getReplayUrl(t),a=(0,i.cE)(n,o,{key:"strings:colonistCommon.utils.emptyString"},"replay-btn",void 0,!0);(0,i.zO)(a,c.am.ReplayIcon)})}static getReplayUrl(e){if(a.r.isUserOnDiscord)return"slug"in e?`/replay/${e.slug}`:`/replay?gameId=${e.gameId}&playerColor=${e.playerColor}`;const t=new URL(window.location.href);return t.pathname=a.r.isUserOnMobileAppOrWeb?"/mobile/replay":"/replay","slug"in e?t.pathname+=`/${e.slug}`:(t.searchParams.set("gameId",e.gameId.toString()),t.searchParams.set("playerColor",e.playerColor.toString())),t.href}static renderPartners(e){const t=document.getElementById("championship25-partners-title"),s=[],r=document.getElementById("championship25-view-all-partners-btn"),o=document.getElementById("championship25-partners-grid");(0,i.oB)(t,{key:"strings:colonistCommon.utils.#buffer",options:{value:`Partners (${e.length})`}}),(0,i.RH)(o,{key:"strings:colonistCommon.utils.emptyString"});const c=n.lv.shuffle(e);for(const e of c){const t=(0,i.Le)(o,"partner-item");if(!a.r.isUserOnDiscord&&null!=e.imageUrl&&e.imageUrl.length>0){const s=document.createElement("img");s.src=e.imageUrl,s.alt=e.name,t.appendChild(s)}const n=(0,i.Le)(t,"partner-name");(0,i.oB)(n,{key:"strings:colonistCommon.utils.#buffer",options:{value:e.name}}),s.push(t)}const l=e.length,d=window.innerWidth<=991?6:14;if(l<=d)r.classList.add("hidden");else{for(let e=d;e<l;e++)s[e].classList.add("hidden");(0,i.G0)(r,()=>{for(const e of s)e.classList.remove("hidden");r.classList.add("hidden")},!0)}}constructor(){h.renderResults(),h.loadContent()}}},34802:(e,t,s)=>{"use strict";s.d(t,{M:()=>v});var i=s(36872),n=s(81888),r=s(55547),o=s(655),a=s(32398),c=s(34668),l=s(13618),d=s(72239),u=s(27838),h=s(71168),p=s(93359);const m=d.R$.secondsAsMilliseconds(2),g=d.R$.secondsAsMilliseconds(2);function f(e){return{...e,gameMapSetting:e.map,gameModeSetting:e.mode}}const y=(0,l.BA)(async e=>{await r.P_.createClickedJoinRoomCallback(e)}),v=function({requestRooms:e,watchRoomList:t,stopWatchingRoomList:s,isSocketOpen:i,registerSessionEstablishedObserver:n,getUserKarma:r,joinRoom:o,showRoomGoneNotification:a,showKickedNotification:c}){const l=new h.G,d=new Map,y=new Set;let v,S,b,C=!1;const P=(0,u.y)(()=>({rooms:[],start:()=>{C||(C=!0,A(),b=n(()=>{A(),t()}),i()?t():(k(),v=setInterval(()=>{k()},m)),S=setInterval(()=>function(){let e=!1;for(const[t,s]of d)s.visible||(d.delete(t),e=!0);e&&R()}(),g))},stop:()=>{C&&(C=!1,clearInterval(v),v=void 0,clearInterval(S),S=void 0,null==b||b(),b=void 0,s(),A())},updateRoomList:e=>{C&&(T(e),R())},onGotKicked:(e,t)=>{c(),t||(y.add(e),R())},clickRoom:e=>{var t;
11==(null===(t=d.get(e))||void 0===t?void 0:t.visible)?o(e):a()}}));async function k(){const t=await e();null!=t&&C&&(T({full:!1,rooms:t}),function(e){for(const[t,s]of d){e.some(e=>e.id==t)||d.set(t,{...s,visible:!1})}}(t),R())}function T(e){e.full&&d.clear();const t=0==d.size?function(e){const t=new Map(e.map(e=>[e.id,e]));return l.sort(e.map(f),r()).map(e=>t.get(e.id))}(e.rooms):e.rooms;for(const e of t)d.set(e.id,e)}function A(){d.clear(),P.setState({rooms:[]})}function R(){const e=r(),t=Array.from(d.values()).map(t=>(0,p.L)(f(t),{isUnavailable:!t.visible||y.has(t.id),userKarma:e}));P.setState({rooms:t})}return P}({requestRooms:async()=>{const e=await o.m.getRequestHandler(a.l.apiGetRooms(),void 0);if(null!=e)return e.json.rooms},watchRoomList:()=>c.Q.watchRoomList(),stopWatchingRoomList:()=>c.Q.stopWatchingRoomList(),isSocketOpen:()=>r.sZ.controller.isSocketOpen(),registerSessionEstablishedObserver:e=>r.sZ.controller.registerSessionEstablishedObserver(e),getUserKarma:()=>{var e;return null===(e=n._.userState)||void 0===e?void 0:e.karma},joinRoom:e=>{y(e)},showRoomGoneNotification:()=>{r.OV.showNotification(i.am.Lightning,{key:"strings:homePage.lobbyPage.popups.roomNoLongerExists"})},showKickedNotification:()=>{r.OV.showNotification(i.am.Lightning,{key:"strings:roomPage.notifications.youWereKickedFromRoom"})}})},34837:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_gamemode_1v1.66f7e985f12ba9a12056.svg"},34865:(e,t,s)=>{"use strict";if(s.d(t,{n:()=>n}),!/^(251|517|837)$/.test(s.j))var i=s(23288);class n extends(/^(251|517|837)$/.test(s.j)?null:i.U){shouldShowWarning(){return this.roomState.gameSetting.victoryPointsToWin>this.roomState.victoryPointsRecommendedLimit}getTitle(){return{key:"strings:roomPage.warnings.startGameExceedLimitWarning.title"}}getDescription(){return{key:"strings:roomPage.warnings.startGameExceedLimitWarning.description"}}}},34911:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_bronze.fed2c86edb98d55da481.svg"},34998:(e,t,s)=>{"use strict";s.d(t,{v:()=>u});var i=s(87506),n=s(18587),r=s(76092),o=s(80708),a=s(9029);class c{userSkippedAd(){console.log("[Preroll] Ad Hidden/Skipped"),c.sendAdsPerformanceData(r.k0.VideoAdsComplete)}static sendMatchmakingRequestAfterAd(){if(null==i.O.lastRequestedQueue)return;i.O.enterMatchmaker(i.O.lastRequestedQueue,!1)}userFinishedWatching(){console.log("[Preroll] User completed watching ad"),c.sendMatchmakingRequestAfterAd()}adFailedToStart(){console.log("[Preroll] Ad error occurred. Sending to matchmaking now"),this.sendToMatchmakingBecauseAdFailed()}adIsReadyToBeShown(){console.log("[Preroll] Ad started"),this.removeLoadingAdBackground(),clearTimeout(this.instreamAdStartTimeout),this.instreamAdStartTimeout=void 0}startMatchmakingVideoAd(){var e;c.sendAdsPerformanceData(r.k0.VideoAdsCalled),void 0!==(null===(e=window.viAPItag)||void 0===e?void 0:e.initPowerInstream)?this.startInstreamAd(window.viAPItag.initPowerInstream):(c.sendMatchmakingRequestAfterAd(),c.sendAdsPerformanceData(r.k0.VideoAdsBlocked))}startInstreamAd(e){this.loadingAdBackground=c.buildLoadingAdBackground(document.body),this.instreamAdStartTimeout=setTimeout(()=>{console.log("[Preroll] Ad timeout occurred. Sending to matchmaking now"),this.sendToMatchmakingBecauseAdFailed()},this.INSTREAM_AD_START_TIMEOUT),e(n.r.vliPrerollId)}sendToMatchmakingBecauseAdFailed(){clearTimeout(this.INSTREAM_AD_START_TIMEOUT),this.instreamAdStartTimeout=void 0,this.removeLoadingAdBackground(),c.removeVLIPrerollBecauseAdFailed(),c.sendMatchmakingRequestAfterAd(),c.sendAdsPerformanceData(r.k0.VideoAdsNeverLoaded)}static sendAdsPerformanceData(e){const t={type:e,category:r.eX.AdsPerformance};o.CA.sendAnalyticEvent(t)}static buildLoadingAdBackground(e){const t=(0,a.Le)(e,"game-reconnecting-overlay");return(0,a.Le)(t,"loading-spinner"),(0,a.i5)(t,"game-reconnecting-text",{key:"strings:roomPage.loadingAd"}),t}removeLoadingAdBackground(){var e;null===(e=this.loadingAdBackground)||void 0===e||e.remove()}static removeVLIPrerollBecauseAdFailed(){const e=document.querySelector(`[data-ad-slot="${n.r.vliPrerollId}"]`);null==e||e.remove()}constructor(){this.INSTREAM_AD_START_TIMEOUT=7500,null!=window.vitag&&(window.vitag.instreamConfig={loadingText:"Loading advertisement..",hidden:()=>this.userSkippedAd(),complete:()=>
1this.userFinishedWatching(),error:()=>this.adFailedToStart(),started:()=>this.adIsReadyToBeShown()})}}var l=s(43486),d=s(74058);class u{triggerMatchmakingVideoAd(e,t,s){const n=(0,d.zl)(e,t,s);return null!=n&&(i.O.storeMatchmakingRequest(e),"vli"==n?(null===(r=this.vliController)||void 0===r||r.startMatchmakingVideoAd(),!0):"internal"==n&&(l.I.start(e),!0));var r}constructor(){this.vliController=n.r.isUserOnDiscord?void 0:new c}}},35032:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_settlement_place.c5c4ccb495e1499035b1.mp3"},35078:(e,t,s)=>{"use strict";s.d(t,{J:()=>i});var i=function(e){return e[e.Leaderboard=0]="Leaderboard",e[e.Lobby=1]="Lobby",e[e.Homepage=2]="Homepage",e[e.Store=3]="Store",e[e.More=4]="More",e[e.Game=5]="Game",e}({})},35190:(e,t,s)=>{"use strict";s.d(t,{d0:()=>i,LY:()=>l,Vm:()=>u,a:()=>c});var i=function(e){return e[e.None=0]="None",e[e.NormalClick=1]="NormalClick",e[e.TradeWindow=2]="TradeWindow",e[e.InformationPopup=3]="InformationPopup",e[e.ConfirmationPopup=4]="ConfirmationPopup",e}({}),n=s(72239),r=s(13567);var o=s(5144);function a(){return[{cardEnum:r.O3.DevelopmentBack,cardTypeEnum:r.Q4.Development,isCardBack:!0,clickPopupType:i.None,allowableTurnStates:void 0},{cardEnum:r.O3.Knight,cardTypeEnum:r.Q4.Development,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn,o.d$.Dice]},{cardEnum:r.O3.VictoryPoint,cardTypeEnum:r.Q4.Development,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:void 0},{cardEnum:r.O3.Monopoly,cardTypeEnum:r.Q4.Development,isCardBack:!1,clickPopupType:i.NormalClick,allowableTurnStates:[o.d$.Turn,o.d$.Dice]},{cardEnum:r.O3.RoadBuilding,cardTypeEnum:r.Q4.Development,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn,o.d$.Dice]},{cardEnum:r.O3.YearOfPlenty,cardTypeEnum:r.Q4.Development,isCardBack:!1,clickPopupType:i.NormalClick,allowableTurnStates:[o.d$.Turn,o.d$.Dice]}]}function c(e){return a().some(t=>t.cardEnum==e)}class l{static getCardDataForCard(e){return"string"==typeof e&&(e=parseInt(e,10)),this.cardMap.get(e)}static getBaseCardDataForType(e){const t=this.getCardEnumsOfTypes(e),s=[];for(const e of t){const t=this.getCardDataForCard(e);null!=t&&s.push(t)}return s}static getCardTypeFromCardEnum(e){var t;return null===(t=this.getCardDataForCard(e))||void 0===t?void 0:t.cardTypeEnum}static getCardBackOfCard(e){return"string"==typeof e&&(e=parseInt(e,10)),this.cardToCardBackMap.get(e)}static getCardEnumsOfTypes(e){const t=[];for(const s of this.cardDataList)s.isCardBack||n.lv.elementInArray(e,s.cardTypeEnum)&&t.push(s.cardEnum);return t}static areCardsValidInputForType(e,t){const s=n.lv.removeDuplicatesFromArray(e);for(const e of s){const s=this.getCardDataForCard(e);if(null!=s){if(s.isCardBack)return!1;if(!n.lv.elementInArray(t,s.cardTypeEnum))return!1}}return!0}static isResourceCard(e){const t=this.getCardDataForCard(e);return null!=t&&(t.cardTypeEnum==r.Q4.Resource||t.cardTypeEnum==r.Q4.Commodity)}static isDevelopmentOrProgressCard(e){const t=this.getCardDataForCard(e);return null!=t&&(t.cardTypeEnum==r.Q4.Development||(t.cardTypeEnum==r.Q4.ProgressTrade||(t.cardTypeEnum==r.Q4.ProgressPolitics||t.cardTypeEnum==r.Q4.ProgressScience)))}static getCardBacksForCards(e){return e.map(e=>this.getCardBackOfCard(e)).filter(e=>null!=e)}static compareCardDisplayOrder(e,t){var s;var i;return(null!==(s=this.cardOrderMap.get(e))&&void 0!==s?s:this.cardDataList.length)-(null!==(i=this.cardOrderMap.get(t))&&void 0!==i?i:this.cardDataList.length)}static sortCards(e){return[...e].sort((e,t)=>this.compareCardDisplayOrder(e,t))}}l.cardDataList=[{cardEnum:r.O3.ResourceBack,cardTypeEnum:r.Q4.Resource,isCardBack:!0,clickPopupType:i.None,allowableTurnStates:void 0},{cardEnum:r.O3.Lumber,cardTypeEnum:r.Q4.Resource,isCardBack:!1,clickPopupType:i.TradeWindow,allowableTurnStates:void 0},{cardEnum:r.O3.Brick,cardTypeEnum:r.Q4.Resource,isCardBack:!1,clickPopupType:i.TradeWindow,allowableTurnStates:void 0},{cardEnum:r.O3.Wool,cardTypeEnum:r.Q4.Resource,isCardBack:!1,clickPopupType:i.TradeWindow,allowableTurnStates:void 0},{cardEnum:r.O3.Grain,cardTypeEnum:r.Q4.Resource,isCardBack:!1,clickPopupType:i.TradeWindow,allowableTurnStates:void 0},{cardEnum:r.O3.Ore,cardTypeEnum:r.Q4.Resource,isCardBack:!1,clickPopupType:i.TradeWindow,allowableTurnStates:void 0},{cardEnum:r.O3.CommodityBack,cardTypeEnum:r.Q4.Commodity,isCardBack:!0,clickPopupType:i.None,allowableTurnStates:void 0},{cardEnum:r.O3.Paper,cardTypeEnum:r.Q4.Commodity,isCardBack:!1,clickPopupType:i.TradeWindow,allowableTurnStates:void 0},{cardEnum:r.O3.Cloth,cardTypeEnum:r.Q4.Commodity,isCardBack:!1,clickPopupType:i.TradeWindow,allowableTurnStates:void 0},{cardEnum:r.O3.Coin,cardTypeEnum:r.Q4.Commodity,isCardBack:!1,clickPopupType:i.TradeWindow,allowableTurnStates:void 0},{cardEnum:r.O3.AnyResource,cardTypeEnum:r.Q4.AnyResource,isCardBack:!1,clickPopupType:i.None,allowableTurnStates:void 0},...a(),{cardEnum:r.O3.ProgressCardScienceBack,cardTypeEnum:r.Q4.ProgressScience,isCardBack:!0,clickPopupType:i.None,allowableTurnStates:void 0},{cardEnum:r.O3.ProgressCardScienceAlchemist,cardTypeEnum:r.Q4.ProgressScience,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Dice]},{cardEnum:r.O3.ProgressCardScienceCrane,cardTypeEnum:r.Q4.ProgressScience,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardScienceEngineer,cardTypeEnum:r.Q4.ProgressScience,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardScienceInventor,cardTypeEnum:r.Q4.ProgressScience,isCardBack:!1,clickPopupType:i.NormalClick,allowableTurnStates:[o.d$.Turn]}
1,{cardEnum:r.O3.ProgressCardScienceIrrigation,cardTypeEnum:r.Q4.ProgressScience,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardScienceMedicine,cardTypeEnum:r.Q4.ProgressScience,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardScienceMining,cardTypeEnum:r.Q4.ProgressScience,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardSciencePrinter,cardTypeEnum:r.Q4.ProgressScience,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardScienceRoadBuilding,cardTypeEnum:r.Q4.ProgressScience,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardScienceSmith,cardTypeEnum:r.Q4.ProgressScience,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardTradeBack,cardTypeEnum:r.Q4.ProgressTrade,isCardBack:!0,clickPopupType:i.None,allowableTurnStates:void 0},{cardEnum:r.O3.ProgressCardTradeCommercialHarbor,cardTypeEnum:r.Q4.ProgressTrade,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardTradeMasterMerchant,cardTypeEnum:r.Q4.ProgressTrade,isCardBack:!1,clickPopupType:i.NormalClick,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardTradeMerchant,cardTypeEnum:r.Q4.ProgressTrade,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardTradeMerchantFleet,cardTypeEnum:r.Q4.ProgressTrade,isCardBack:!1,clickPopupType:i.NormalClick,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardTradeResourceMonopoly,cardTypeEnum:r.Q4.ProgressTrade,isCardBack:!1,clickPopupType:i.NormalClick,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardTradeCommodityMonopoly,cardTypeEnum:r.Q4.ProgressTrade,isCardBack:!1,clickPopupType:i.NormalClick,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardPoliticsBack,cardTypeEnum:r.Q4.ProgressPolitics,isCardBack:!0,clickPopupType:i.None,allowableTurnStates:void 0},{cardEnum:r.O3.ProgressCardPoliticsBishop,cardTypeEnum:r.Q4.ProgressPolitics,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardPoliticsConstitution,cardTypeEnum:r.Q4.ProgressPolitics,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardPoliticsDeserter,cardTypeEnum:r.Q4.ProgressPolitics,isCardBack:!1,clickPopupType:i.NormalClick,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardPoliticsDiplomat,cardTypeEnum:r.Q4.ProgressPolitics,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardPoliticsIntrigue,cardTypeEnum:r.Q4.ProgressPolitics,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardPoliticsSaboteur,cardTypeEnum:r.Q4.ProgressPolitics,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardPoliticsSpy,cardTypeEnum:r.Q4.ProgressPolitics,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardPoliticsWarlord,cardTypeEnum:r.Q4.ProgressPolitics,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ProgressCardPoliticsWedding,cardTypeEnum:r.Q4.ProgressPolitics,isCardBack:!1,clickPopupType:i.ConfirmationPopup,allowableTurnStates:[o.d$.Turn]},{cardEnum:r.O3.ResourceOverLimit,cardTypeEnum:r.Q4.Miscellaneous,isCardBack:!1,clickPopupType:i.None,allowableTurnStates:void 0},{cardEnum:r.O3.ProgressCardBack,cardTypeEnum:r.Q4.Miscellaneous,isCardBack:!1,clickPopupType:i.None,allowableTurnStates:void 0}],l.cardMap=new Map(l.cardDataList.map(e=>[e.cardEnum,e])),l.cardToCardBackMap=new Map(l.cardDataList.map(e=>{var t;return[e.cardEnum,null===(t=l.cardDataList.filter(t=>{var s;return(null===(s=l.cardMap.get(e.cardEnum))||void 0===s?void 0:s.cardTypeEnum)==t.cardTypeEnum}).find(e=>e.isCardBack))||void 0===t?void 0:t.cardEnum]})),l.cardOrderMap=new Map(l.cardDataList.map((e,t)=>[e.cardEnum,t])),(()=>{const e=n.h4.getEnumValues(r.O3),t=l.cardDataList.map(e=>e.cardEnum);if(e.length!==t.length)throw new Error(`CardDataController: cardDataList does not contain exactly ${e.length} cards`);if(new Set(t).size!==t.length)throw new Error("CardDataController: cardDataList contains duplicate CardEnums")})();var d=s(46581);function u(e){switch(e){case d.Ob.City:return[r.O3.Grain,r.O3.Grain,r.O3.Ore,r.O3.Ore,r.O3.Ore];case d.Ob.Settlement:return[r.O3.Lumber,r.O3.Brick,r.O3.Wool,r.O3.Grain];case d.Ob.Road:return[r.O3.Lumber,r.O3.Brick];case d.Ob.DevelopmentCard:return[r.O3.Wool,r.O3.Grain,r.O3.Ore];case d.Ob.Ship:return[r.O3.Lumber,r.O3.Wool];case d.Ob.CityWall:return[r.O3.Brick,r.O3.Brick];case d.Ob.Knight:return[r.O3.Wool,r.O3.Ore]}}},35351:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_dice_roll_4.ac72a311905cf5bfad2a.mp3"},35387:(e,t,s)=>{"use strict";s.d(t,{X:()=>n});var i=s(16611);const n=e=>(...t)=>{i.A9.play(i.hc.Click),e(...t)}},35606:(e,t,s)=>{"use strict";s.d(t,{n:()=>r});var i=s(19590),n=s(78134);class r{initGameModeData(e){const t=n.qq.getModeDataForMode(e);null!=t&&(this.gameModeData=t)}initPlayerControllerStates(e,t){const s=new i.qF(e,t);this.players.push(s)}initMapState(e){this.mapState=e}hasOnlyOneHumanPlayer(){let e=0;for(const t of this.players)t.isUser&&(e+=1);return 1==e}constructor(){this.players=[],this.mapState=new i.rP({tileHexStates:{},tileCornerStates:{},tileEdgeStates:{},portEdgeStates:{},fogTileGroupStates:{}}),this.isPlayerTakingOffTurnAction=!1,this.canResign=!1,this.isGameOver=!1}}},35742:(e,t,s)=>{"use strict";s.d(t,{u:()=>n});var i=s(72589);class n{handleUrlHash(){const e=window.location.hash,t=n.getSectionFromHash(e);this.scrollToSection(t)}onSidebarClick(e){if(e.preventDefault(),null===e.target)return;if(!(e.target instanceof HTMLElement))return;const t=e.target.closest("a");if(null===t)return;const s=n.getSectionFromHash(t.href);this.scrollToSection(s),s&&n.updateUrlHash(s.id)}static updateUrlHash(e){window.location.hash!=="#"+e&&history.replaceState(null,"","#"+e)}static getSectionFromHash(e){const t=e.split("#")[1];return document.getElementById(t)}onContentScroll(){if(null==this.contentDiv)return;const e=Array.from(this.contentDiv.children),t=this.contentDiv.scrollHeight-this.viewportDiv.clientHeight,s=e.filter(e=>{if(!(e instanceof HTMLElement))return!1;const s=getComputedStyle(e);
1if("none"===s.display)return!1;if("hidden"===s.visibility)return!1;return e.offsetTop/this.contentDiv.scrollHeight*t<this.viewportDiv.scrollTop}),i=s[s.length-1];if(void 0===i)return;if(""===i.id)return;const n=this.sidebarDiv.querySelector(`a[href="#${i.id}"]`);null!==n&&(this.setCurrentSectionLink(n),this.debouncedUpdateUrlHash(i.id))}debouncedUpdateUrlHash(e){this.hashUpdateTimer&&clearTimeout(this.hashUpdateTimer),this.hashUpdateTimer=setTimeout(()=>n.updateUrlHash(e),150)}setCurrentSectionLink(e){this.currentSectionLink!==e&&(this.currentSectionLink&&this.currentSectionLink.classList.remove(this.currentSectionLinkClass),this.currentSectionLink=e,this.currentSectionLink.classList.add(this.currentSectionLinkClass))}scrollToSection(e){if(null==e)return;const t=this.contentDiv.scrollHeight-this.viewportDiv.clientHeight,s=e.offsetTop/this.contentDiv.scrollHeight*t,n=Math.floor(s+e.scrollHeight/this.contentDiv.scrollHeight*t),r=i.c.clamp(e.offsetTop,s,n);this.viewportDiv.scroll(0,r)}selectFirstLink(){if(null==this.sidebarDiv)return;const e=this.sidebarDiv.querySelector("a");null!==e&&this.setCurrentSectionLink(e)}constructor(e,t,s=e,i="active"){this.currentSectionLink=null,this.hashUpdateTimer=null,this.contentDiv=e,this.sidebarDiv=t,this.viewportDiv=s,this.currentSectionLinkClass=i,this.handleUrlHash(),this.onContentScroll(),null===this.currentSectionLink&&this.selectFirstLink()}}},35790:(e,t,s)=>{"use strict";s.d(t,{B:()=>a});var i=s(46507),n=s(9029),r=s(7893);const o="translucent-overlay-container";function a({title:e,body:t,confirmLabel:s,onConfirm:a}){if(null!=document.getElementById(o))return;const c=(0,n.Le)(document.body,"",o),l=(0,r.y)(o,i.IV);l.render({title:e,body:t,...null!=s?{confirmLabel:s}:{},...null!=a?{onConfirm:()=>{l.unmount(),c.remove(),a()}}:{}})}},35883:(e,t,s)=>{"use strict";s.d(t,{j:()=>Nr});var i=s(55935),n=s(22194),r=s(36872),o=s(60674),a=s(89844);const c=s.p+"assets/icon_bots_beginner.25f6a943efcf233ec036.svg",l=s.p+"assets/icon_bots_easy.4dfcfb866167103b9263.svg",d=s.p+"assets/icon_bots_medium.1fddb3251f0da8bbf588.svg",u=s.p+"assets/icon_bots_hard.88ad35d51c2e6e883411.svg";var h=s(55803),p=s(8399),m=s(11531),g=s(10297);const f=s.p+"assets/icon_plus.a514569ca73da58e8762.svg",y=s.p+"assets/icon_plus_store.4d870528387aa3d60169.svg";var v=s(1176),S=s(21018),b=s(38774),C=s(89010),P=s(30762),k=s(95621),T=s(59541),A=s(41141),R=s(90872),w=s(41775),I=s(13657);const M=s.p+"assets/icon_danger.b3fb8f39efcd7c30a93f.svg",_=s.p+"assets/karma_white.90e26e6ec19a2da878c3.svg",E=s.p+"assets/karma_red.d21242999f61a5a23ce9.svg",D=s.p+"assets/karma_orange.50da63a8def2d9c8b575.svg",L=s.p+"assets/karma_green.411a0217fef52668479b.svg",B=s.p+"assets/disable_abblock.c5ac9a0cedb5af327346.png";var x=s(4938),O=s(47782),G=s(10321),F=s(45103);const U=s.p+"assets/gif_fullscreen.42e77ed3e1017df3faa6.gif";var N=s(48716),H=s(26626),K=s(90272),W=s(53059),V=s(41790),q=s(47563),Q=s(64141),j=s(28943);const z=s.p+"assets/icon_mm_search.e9d439fb90e5019305a4.svg",$=s.p+"assets/icon_lock.05ad30a9974596547b00.svg";var Y=s(3328),Z=s(22466),J=s(44855),X=s(62949);const ee=s.p+"assets/store_icon_avatar.327eef60fd53d5089322.png",te=s.p+"assets/store_icon_maps.ed11c0ab51512370af79.png",se=s.p+"assets/store_icon_expansions.bdd8ad6029d40a272643.png",ie=s.p+"assets/store_icon_colors.06a28b1bb881fa93ba43.png",ne=s.p+"assets/map_diamond_preview.57b2c86d87487165a346.png";var re=s(20024),oe=s(20230);const ae=s.p+"assets/map_pond_preview.156fd911def6e35e7723.png";var ce=s(12403),le=s(91767),de=s(63116),ue=s(14602),he=s(59138);const pe=s.p+"assets/map_shuffleboard_preview.d8a45ad58a7fce91e213.png",me=s.p+"assets/map_pangaea_preview.ecf73119d865433881c4.png",ge=s.p+"assets/map_spinner_preview.93d5a3a43db2a32608dd.png",fe=s.p+"assets/map_cyclops_preview.363d7990435a07639dea.png",ye=s.p+"assets/map_random_base_preview.c1cc73a85407d84296e1.png",ve=s.p+"assets/map_base_4p_preview.7ea40296a96ee1c95c4e.png";var Se=s(44423);const be=s.p+"assets/map_hourglass_preview.e02e6635ad914c15e10b.png",Ce=s.p+"assets/map_hourglass_xl_preview.32bacd68ebb1d42dedfb.png";var Pe=s(26674);const ke=s.p+"assets/map_mini_base_preview.97a427595f26c894c0e2.png",Te=s.p+"assets/map_australia_preview.3cd0a11cdbecd9152e28.png",Ae=s.p+"assets/map_circle_preview.6e66ff773fe3b372ba5a.png",Re=s.p+"assets/map_duel_preview.be4e8bfcdce0f5edb8ae.png",we=s.p+"assets/map_monopoly_preview.23fba9abf43a1d33c63f.png",Ie
1=s.p+"assets/map_king_of_the_hill_preview.40aac24fafd75a736355.png";var Me=s(71568),_e=s(63406);const Ee=s.p+"assets/map_doggo_preview.9cb17f6ec1b3ec63916d.png",De=s.p+"assets/map_trade_islands_preview.4a915a6f7e813e22e6fe.png",Le=s.p+"assets/map_turning_tides_preview.df3ac07e909deedd796f.png";var Be=s(52324),xe=s(2328);const Oe=s.p+"assets/map_kite_preview.850df983556c9fdd5419.png";var Ge=s(8842);const Fe=s.p+"assets/map_two_isles_preview.07510cff17d3d198f15c.png";var Ue=s(72248),Ne=s(15166),He=s(89100),Ke=s(41398);const We=s.p+"assets/map_5_6_player_preview.9231bc7c8856796b3d1e.png",Ve=s.p+"assets/map_7_8_player_preview.76e8a11424b844cdd7b2.png",qe=s.p+"assets/map_ss1_3p_preview.fd7f6a61dd46c906d0b4.png",Qe=s.p+"assets/map_ss1_4p_preview.f653a5d9e5f66cdea95c.png",je=s.p+"assets/map_ss1_6p_preview.ece955cd7e19ccca2845.png",ze=s.p+"assets/map_ss2_3p_preview.38a5bc6db123ec7b4271.png",$e=s.p+"assets/map_ss2_4p_preview.5bdb8f299cc96689771e.png",Ye=s.p+"assets/map_ss2_6p_preview.d3a75f9e4250cbf77765.png",Ze=s.p+"assets/map_ss3_3p_preview.c99eaafe2a0298ac3412.png";var Je=s(3738);const Xe=s.p+"assets/map_ss3_6p_preview.062ef04b8a00ed541283.png",et=s.p+"assets/map_ss4_3p_preview.f2b77bb95c3262721195.png",tt=s.p+"assets/map_ss4_4p_preview.f89c99787d83a61108e6.png",st=s.p+"assets/map_ss4_6p_preview.11bfdf29420d9c89f2d2.png";var it=s(34837),nt=s(17564);const rt=s.p+"assets/56player.9303311195075dc4c759.svg",ot=s.p+"assets/78player.9df999e65c967cd455bb.svg";var at=s(44945);const ct=s.p+"assets/seafarers_56player.70311c162c1c75827c87.svg";var lt=s(46995);const dt=s.p+"assets/cities_and_knights_56player.8d3009e523c0bbdd00ea.svg";var ut=s(24036);const ht=s.p+"assets/seafarers_cities_and_knights_56player.c6cd7dbcfbd0374cf7e1.svg";var pt=s(24309);const mt=s.p+"assets/shuffle.e27389f0cf1fbfb2b7ee.svg",gt=s.p+"assets/1v1_ranked.099318c6a55545a0d654.svg",ft=s.p+"assets/4p_ranked.32f7ef826af99d557cd8.svg";var yt=s(60085);const vt=s.p+"assets/colonist_rush_bot.aeddf19449976ad552fb.svg",St=s.p+"assets/pack_settler.cba2ea0c8bd2bd4ec4ac.svg",bt=s.p+"assets/pack_colonist.54d02ca9b458ea10ad8f.svg",Ct=s.p+"assets/pack_founder.a8b5c95038f5861be2a5.svg";var Pt=s(87354),kt=s(57795),Tt=s(34911),At=s(90712),Rt=s(23153);const wt=s.p+"assets/dice_3_sharp.f1b9a5a58124a8190ee4.svg";var It=s(57363),Mt=s(52211),_t=s(19823),Et=s(75615);const Dt=s.p+"assets/store_item_56player.4823202375a1c707becc.png";var Lt=s(71894);const Bt=s.p+"assets/store_item_seafarers.2c8fb6bc5a247be8dcfd.png",xt=s.p+"assets/store_item_seafarers_56player.c4c0d93232772fcd437f.png";var Ot=s(91456);const Gt=s.p+"assets/store_item_cities_and_knights_56player.881ff1f480138271183b.png",Ft=s.p+"assets/store_item_seafarers_cities_and_knights.7feba49b11c6d0a1e02f.png",Ut=s.p+"assets/store_item_seafarers_cities_and_knights_56player.d60e962b21dedd692862.png",Nt=s.p+"assets/store_item_colonist_rush.748f43c66a4b05149877.png";var Ht=s(24880);const Kt=s.p+"assets/store_color_purple.ddbe077211b3b13a2fe0.svg",Wt=s.p+"assets/store_color_mysticblue.0b581e066e05a0dc053e.svg",Vt=s.p+"assets/store_color_white.1c73bbb97adfc5629fa7.svg",qt=s.p+"assets/store_color_bronze.d15d2597a03a777dae2c.svg",Qt=s.p+"assets/store_color_silver.d17cd740b0292d4b2dbc.svg",jt=s.p+"assets/store_color_gold.36ade4e6f433f06bb6b5.svg",zt=s.p+"assets/store_color_pink.f0ad146d50e2b3db4ded.svg",$t=s.p+"assets/store_icon_membership.607ebfe3bbe6fad775cf.svg";var Yt=s(68282),Zt=s(92626),Jt=s(83078);const Xt=s.p+"assets/icon_christmas_hat.3000be8740132e1ed147.svg";var es=s(13279),ts=s(59011),ss=s(10200),is=s(45859);const ns=s.p+"assets/medal_gold.b44df7c9eb44541c4ad3.svg",rs=s.p+"assets/medal_silver.2b336579e8a89ec40258.svg",os=s.p+"assets/medal_bronze.a73fa650b8e60e85838c.svg",as=s.p+"assets/icon_elephant.5c1515fe7202098da9c2.svg";var cs=s(80232),ls=s(32936),ds=s(9108),us=s(56116),hs=s(12326),ps=s(51255),ms=s(10806),gs=s(52283),fs=s(52580),ys=s(97077),vs=s(99527),Ss=s(41178);const bs=s.p+"assets/icon_gifter.6cb1e577b1d1be395daa.svg";var Cs=s(59968),Ps=s(41611),ks=s(17700),Ts=s(66987),As=s(20558),Rs=s(21503),ws=s(40972),Is=s(4903),Ms=s(93189),_s=s(24368),Es=s(30429),Ds=s(10008),Ls=s(62713),Bs=s(60178),xs=s(55828),Os=s(85919),Gs=s(31364),Fs=s(58961),Us=s(59548),Ns=s(16968),Hs=s(601),Ks=s(73050),Ws=s(38853),Vs=s(96144),qs=s(11903),Qs=s(33744),js=s(65019),zs=s(16208),$s=s(87541),Ys=s(85424),Zs=s(
150276),Js=s(88429),Xs=s(98734),ei=s(73697),ti=s(24460),si=s(64907),ii=s(17294),ni=s(25061),ri=s(78119),oi=s(31869),ai=s(61925),ci=s(42052);const li=s.p+"assets/perks_icon_free_maps.b405f6a780e148c32767.png",di=s.p+"assets/perks_icon_free_expansions.39b4ce839c9111fe9bf9.png",ui=s.p+"assets/perks_icon_ranked.740d42bb164f83ca9391.png",hi=s.p+"assets/perks_icon_custom_links.bb43f63d1d3532d8e858.png",pi=s.p+"assets/perks_icon_coins.777985cebf39733279f5.png",mi=s.p+"assets/perks_icon_no_ads.8a757155d4ee99d423c7.png";var gi=s(58699),fi=s(91082),yi=s(93047),vi=s(6918);const Si=s.p+"assets/coin_stack_1.5f693cf618655da89f2b.png",bi=s.p+"assets/coin_stack_2.d6d2fb11327c18541402.png",Ci=s.p+"assets/coin_stack_3.6932a52a5edd8935a3ab.png",Pi=s.p+"assets/coin_stack_4.763e5673628babb12160.png",ki=s.p+"assets/coin_stack_5.1be8ae54b5372e0b60a7.png",Ti=s.p+"assets/coin_stack_6.f0e65a81082c496f146c.png";var Ai=s(29806);const Ri=s.p+"assets/icon_add_friend_2.c3acf8dc1dc8b93f3b76.svg";var wi=s(12608),Ii=s(73503),Mi=s(87239);const _i=s.p+"assets/icon_facebook.00529da5d71ae5bc1fed.svg";var Ei=s(27019),Di=s(68160),Li=s(4945),Bi=s(63247),xi=s(55010),Oi=s(96625),Gi=s(9401),Fi=s(83337),Ui=s(65410),Ni=s(75127),Hi=s(85877),Ki=s(71902);const Wi=s.p+"assets/menu_portrait_mode.b5c9aca45119e2e2afcb.png",Vi=s.p+"assets/menu_landscape_mode.9b89db216dd60a4602ef.png";var qi=s(37145),Qi=s(61495),ji=s(7325),zi=s(16508),$i=s(2330),Yi=s(2928),Zi=s(48834),Ji=s(48295),Xi=s(82969),en=s(96197),tn=s(54227),sn=s(73484),nn=s(50049),rn=s(87887),on=s(1932),an=s(81145),cn=s(28624),ln=s(6218),dn=s(31941),un=s(50517),hn=s(98299);const pn=s.p+"assets/badge_tournament_cc25.102ed2491f5c0ac21d9b.svg",mn=s.p+"assets/badge_tournament_s11_first.d9cc9cf4ed06a6623b99.svg",gn=s.p+"assets/badge_tournament_4p.dac5e83a3b63cfe4bacb.svg",fn=s.p+"assets/banner_member.cfe69c53918ea61fa7fb.png",yn=s.p+"assets/banner_shuffle.84b948bdc8e749330727.png";var vn=s(21099),Sn=s(8878),bn=s(96396),Cn=s(29567),Pn=s(29319),kn=s(42778),Tn=s(48613),An=s(12688),Rn=s(38493),wn=s(65432),In=s(62681),Mn=s(48498),_n=s(75279),En=s(73316),Dn=s(13250),Ln=s(59179),Bn=s(67523),xn=s(48376),On=s(71937),Gn=s(60190),Fn=s(99273),Un=s(88758),Nn=s(2109),Hn=s(62640),Kn=s(75602),Wn=s(61193),Vn=s(73023),qn=s(47538),Qn=s(6818),jn=s(11773),zn=s(88834),$n=s(32663),Yn=s(70248),Zn=s(77999),Jn=s(14466),Xn=s(73461),er=s(72311),tr=s(64458),sr=s(9808),ir=s(89179),nr=s(491),rr=s(53142),or=s(62945),ar=s(3700),cr=s(56145),lr=s(80420),dr=s(32741),ur=s(57566),hr=s(47609),pr=s(79824),mr=s(1714),gr=s(89173),fr=s(41901),yr=s(12908),vr=s(51839),Sr=s(90878),br=s(99059),Cr=s(48266),Pr=s(46771),kr=s(88112);const Tr=s.p+"assets/player_bg_red.e23255a1eaac03a05c9d.svg",Ar=s.p+"assets/player_bg_blue.ccf3b0e2738233b4e592.svg",Rr=s.p+"assets/player_bg_orange.501a7e983f1b0c42c2b0.svg",wr=s.p+"assets/player_bg_green.3caf586360d8a53b7520.svg",Ir=s.p+"assets/player_bg_black.83ee1c2a1f5f182e656f.svg",Mr=s.p+"assets/player_bg_bronze.45bc74232bcf07972718.svg",_r=s.p+"assets/player_bg_silver.2e50d8b9369e42bd322c.svg",Er=s.p+"assets/player_bg_gold.970d985e809295330140.svg",Dr=s.p+"assets/player_bg_white.0c947f6527948c64d15e.svg",Lr=s.p+"assets/player_bg_purple.a8e5b6b5a7aadb278f99.svg",Br=s.p+"assets/player_bg_mysticblue.d566c2c9e62b6173c72f.svg",xr=s.p+"assets/player_bg_pink.da3d420acf9114ecde55.svg",Or=s.p+"assets/landscape_deprecation.1b2bb8b6751e445b5e98.gif",Gr=s.p+"assets/icon_leaderboard.1106beb27b83e146e2f8.svg",Fr=s.p+"assets/portrait_mode_opt_in.be1831a5ff439756d396.png",Ur=s.p+"assets/switch_to_portrait.9b94514e595b4ea274b0.png";class Nr{static setVersionNumber(e){this.versionNumber=e}static getRankedDivisionImage(e){switch(e){case n.os.Bronze:return r.am.RankBronze;case n.os.Silver:return r.am.RankSilver;case n.os.Gold:return r.am.RankGold;case n.os.Platinum:return r.am.RankPlatinum;case n.os.Diamond:return r.am.RankDiamond;case n.os.Master:return r.am.RankMaster;case n.os.Grandmaster:return r.am.RankGrandmaster;case n.os.None:return r.am.XMark}}static getRankedSubdivisionImage(e){if(e!==n.Yt.None)switch(e){case n.Yt.I:return r.am.RankSubdivisionI;case n.Yt.II:return r.am.RankSubdivisionII;case n.Yt.III:return r.am.RankSubdivisionIII;case n.Yt.IV:return r.am.RankSubdivisionIV;case n.Yt.V:return r.am.RankSubdivisionV}}static getPlayerColorBuildings(e){switch(e){case i.DS.Red:return{road:r.am.RoadRed,settlement:r.am.SettlementRed,city:r.am.CityRed};case i.DS.Blue:return{road:r.am.RoadBlue,settlement:r.am.SettlementBlue,city:r.am.CityBlue};case i.DS.Green:return{road:r.am.RoadGreen,settlement:r.am.SettlementGreen,city:r.am.CityGreen};case i.DS.Orange:return{road:r.am.RoadOrange,settlement:r.am.SettlementOrange,city:r.am.CityOrange};case i.DS.Black:return{road:r.am.RoadBlack,settlement:r.am.SettlementBlack,city:r.am.CityBlack};case i.DS.Silver:return{road:r.am.RoadSilver,settlement:r.am.SettlementSilver,city:r.am.CitySilver};case i.DS.Gold:return{road:r.am.RoadGold,settlement:r.am.SettlementGold,city:r.am.CityGold};case i.DS.White:return{road:r.am.RoadWhite,settlement:r.am.SettlementWhite,city:r.am.CityWhite};case i.DS.Purple:return{road:r.am.RoadPurple,settlement:r.am.SettlementPurple,city:r.am.CityPurple};case i.DS.MysticBlue:return{road:r.am.RoadMysticBlue,settlement:r.am.SettlementMysticBlue,city:r.am.CityMysticBlue};case i.DS.Bronze:return{road:r.am.RoadBronze,settlement:r.am.SettlementBronze,city:r.am.CityBronze};case i.DS.Pink:return{road:r.am.RoadPink,settlement:r.am.SettlementPink,city:r.am.CityPink};case i.DS.None:}return{road:r.am.CheckMark,settlement:r.am.CheckMark,city:r.am.CheckMark}}static getImgPath(e){switch(e){case r.am.Pencil:return o;case r.am.Bot:return a;case r.am.BotBeginner:return c;case r.am.BotEasy:return l;case r.am.BotMedium:return d;case r.am.BotHard:return u;case r.am.CheckMark:return h;case r.am.XMark:return p;case r.am.Logo:return m;case r.am.Lightning:return g;case r.am.Plus:return f;case r.am.PlusStore:return y;case r.am.Mail:return v;case r.am.Admin:return S;case r.am.Moderator:return b;case r.am.User:return C;case r.am.Guest:return P;case r.am.Star:return k;case r.am.Players:return T;case r.am.PlayersRanked:return A;case r.am.ReplayIcon:return R;case r.am.QuestionMark:return w;case r.am.InfoIcon:return I;case r.am.DangerIcon:return M;case r.am.KarmaWhite:return _;case r.am.KarmaRed:return E;case r.am.KarmaOrange:return D;case r.am.KarmaGreen:return L;case r.am.DisableAdBlock:return B;case r.am.ColonistCoin:return x;case r.am.Rulebook:return O;case r.am.BankIcon:return At;case r.am.FullScreenExpand:return G;case r.am.FullScreenContract:return F;case r.am.FullScreenGif:return U;case r.am.LeftArrow:return N;case r.am.Audio:return H;case r.am.Eye:return K;case r.am.SendArrow:return W;case r.am.Settings:return V;case r.am.Chat:return q;case r.am.Log:return Q;case r.am.RushInformation:return j;case r.am.MatchmakingSearch:return z;case r.am.Lock:case r.am.LockOutlined:case r.am.LockSlanted:return $;case r.am.LockOn:return Y;case r.am.Share:return Z;case r.am.NoAds:return J;case r.am.Colors:return X;case r.am.Avatars:return ee;case r.am.Maps:return te;case r.am.Expansions:return se;case r.am.AllColors:return ie;case r.am.Memberships:return $t;case r.am.MapDiamondPreview:return ne;case r.am.MapIstanbulPreview:return re;case r.am.MapLakesPreview:return oe;case r.am.MapPondPreview:return ae;case r.am.MapGearPreview:return ce;case r.am.MapUSAPreview:return le;case r.am.MapTwirlPreview:return de;case r.am.MapEarthPreview:return ue;case r.am.MapUKPreview:return he;case r.am.MapShuffleBoardPreview:return pe;case r.am.MapPangaeaPreview:return me;case r.am.MapSpinnerPreview:return ge;case r.am.MapCyclopsPreview:return fe;case r.am.MapRandomBasePreview:return ye;case r.am.MapClassic4PPreview:return ve;case r.am.MapRomaniaPreview:return Se;case r.am.MapHourglassPreview:return be;case r.am.MapHourglassXLPreview:return Ce;case r.am.MapSnowflakePreview:return Pe;case r.am.MapMiniBasePreview:return ke;case r.am.MapAustraliaPreview:return Te;case r.am.MapCirclePreview:return Ae;case r.am.MapDuelPreview:return Re;case r.am.MapMonopolyPreview:return we;case r.am.MapKingOfTheHillPreview:return Ie;case r.am.MapEuropePreview:return Me;case r.am.MapMountainOfRichesPreview:return _e;case r.am.MapDoggoPreview:return Ee;case r.am.MapTradeIslandsPreview:return De;case r.am.MapTurningTidesPreview:return Le;case r.am.MapBlackForestPreview:return Be;case r.am.MapVolcanoPreview:return xe;case r.am.MapKitePreview:return Oe;case r.am.MapVietnamPreview:return Ge;case r.am.MapTwoIslesPreview:return Fe;case r.am.MapJellyFishPreview:return Ue;case r.am.MapGoldRushPreview:return Ne;case r.am.MapStripesPreview:return He;case r.am.MapMonopolyIslandsPreview:return Ke;
1case r.am.MapClassic56PPreview:return We;case r.am.MapClassic78PPreview:return Ve;case r.am.MapSS1HeadingForNewShores3PPreview:return qe;case r.am.MapSS1HeadingForNewShores4PPreview:return Qe;case r.am.MapSS1HeadingForNewShores56PPreview:return je;case r.am.MapSS2FourIslands3PPreview:return ze;case r.am.MapSS2FourIslands4PPreview:return $e;case r.am.MapSS2SixIslands56PPreview:return Ye;case r.am.MapSS3FogIslands3PPreview:return Ze;case r.am.MapSS3FogIslands4PPreview:return Je;case r.am.MapSS3FogIslands56PPreview:return Xe;case r.am.MapSS4ThroughTheDesert3PPreview:return et;case r.am.MapSS4ThroughTheDesert4PPreview:return tt;case r.am.MapSS4ThroughTheDesert56PPreview:return st;case r.am.GameMode1v1:return it;case r.am.GameModeBase:case r.am.GameModeBasePreview:return nt;case r.am.GameModeBase56P:return rt;case r.am.GameModeBase78P:return ot;case r.am.GameModeSeafarers:return at;case r.am.GameModeSeafarers56P:return ct;case r.am.GameModeCnK:return lt;case r.am.GameModeCitiesAndKnights56P:return dt;case r.am.GameModeCnKSeafarers:return ut;case r.am.GameModeSeafarersCitiesAndKnights56P:return ht;case r.am.GameModeColonistRush:return pt;case r.am.GameModeShuffle:return mt;case r.am.GameModeRanked1v1:return gt;case r.am.GameModeRanked4P:return ft;case r.am.GameModeRankedRush:return yt;case r.am.GameModeBotRush:return vt;case r.am.SettlerPack:return St;case r.am.ColonistPack:return bt;case r.am.FounderPack:return Ct;case r.am.RoadBronze:return Pt;case r.am.SettlementBronze:return kt;case r.am.CityBronze:return Tt;case r.am.Bank:return At;case r.am.Robber:return Rt;case r.am.Dice3Sharp:return wt;case r.am.Dice6:return It;case r.am.PrivateGame:return Mt;case r.am.HideBankCards:return _t;case r.am.Gift:return Et;case r.am.StoreItemExpansionClassic56P:return Dt;case r.am.StoreItemExpansionClassic78P:return Lt;case r.am.StoreItemSeafarers4P:return Bt;case r.am.StoreItemSeafarers56P:return xt;case r.am.StoreItemCitiesAndKnights4P:return Ot;case r.am.StoreItemCitiesAndKnights56P:return Gt;case r.am.StoreItemCitiesAndKnightsSeafarers4P:return Ft;case r.am.StoreItemCitiesAndKnightsSeafarers56P:return Ut;case r.am.StoreItemColonistRush:return Nt;case r.am.StoreColorBlack:return Ht;case r.am.StoreColorPurple:return Kt;case r.am.StoreColorMysticBlue:return Wt;case r.am.StoreColorWhite:return Vt;case r.am.StoreColorBronze:return qt;case r.am.StoreColorSilver:return Qt;case r.am.StoreColorGold:return jt;case r.am.StoreColorPink:return zt;case r.am.IconSettlerHat:return Yt;case r.am.IconColonistHat:return Zt;case r.am.IconFounderHat:return Jt;case r.am.IconChristmasHat:return Xt;case r.am.IconRobberSanta:return es;case r.am.IconRobberLunar:return ts;case r.am.IconRobberCupid:return ss;case r.am.IconPirateShip:return is;case r.am.IconMedalGold:return ns;
1case r.am.IconMedalSilver:return rs;case r.am.IconMedalBronze:return os;case r.am.IconElephant:return as;case r.am.IconSombrero:return cs;case r.am.IconFarmer:return ls;case r.am.IconAvocado:return ds;case r.am.IconCactus:return us;case r.am.IconCrown:return hs;case r.am.IconSwords:return ps;case r.am.IconHelmet:return ms;case r.am.IconSnorkel:return gs;case r.am.IconScarf:return fs;case r.am.IconTie:return ys;case r.am.IconWorker:return vs;case r.am.IconMummy:return Ss;case r.am.IconGifter:return bs;case r.am.IconNoTroll:return Cs;case r.am.IconRotation:return Ps;case r.am.IconTimer:return ks;case r.am.IconBeta:return P;case r.am.RoadRed:return Ts;case r.am.RoadBlue:return As;case r.am.RoadGreen:return Rs;case r.am.RoadOrange:return ws;case r.am.RoadBlack:return Is;case r.am.RoadSilver:return Ms;case r.am.RoadGold:return _s;case r.am.RoadWhite:return Es;case r.am.RoadPurple:return Ds;case r.am.RoadMysticBlue:return Ls;case r.am.RoadPink:return Bs;case r.am.SettlementRed:return xs;case r.am.SettlementBlue:return Os;case r.am.SettlementGreen:return Gs;case r.am.SettlementOrange:return Fs;case r.am.SettlementBlack:return Us;case r.am.SettlementSilver:return Ns;case r.am.SettlementGold:return Hs;case r.am.SettlementWhite:return Ks;case r.am.SettlementPurple:return Ws;case r.am.SettlementMysticBlue:return Vs;case r.am.SettlementPink:return qs;case r.am.CityRed:return Qs;case r.am.CityBlue:return js;case r.am.CityGreen:return zs;case r.am.CityOrange:return $s;case r.am.CityBlack:return Ys;case r.am.CitySilver:return Zs;case r.am.CityGold:return Js;case r.am.CityWhite:return Xs;case r.am.CityPurple:return ei;case r.am.CityMysticBlue:return ti;case r.am.CityPink:return si;case r.am.StoreMembershipPlus:return ii;case r.am.StoreMembershipPremium:return ni;case r.am.StoreMembershipElite:return ri;case r.am.StoreMembershipHoliday2023:return oi;case r.am.StoreGiftMembership:return ai;case r.am.StoreGiftMembershipDark:return ci;case r.am.StoreMembershipPerkAllMaps:return li;case r.am.StoreMembershipPerkAllExpansions:return di;case r.am.StoreMembershipPerkRankedGames:return ui;case r.am.StoreMembershipPerkCustomLinks:return hi;case r.am.StoreMembershipPerkColonistCoins:return pi;case r.am.StoreMembershipPerkNoAds:return mi;case r.am.StoreMembershipPerkNoAdsGifDesertBox:return gi;case r.am.StoreMembershipPerkNoAdsGifGoldBox:return fi;case r.am.StoreMembershipPerkNoAdsGifDesertHex:return yi;case r.am.StoreMembershipPerkNoAdsGifGoldHex:return vi;case r.am.StoreMembershipPerkAllColors:return ie;case r.am.CoinStack1:return Si;case r.am.CoinStack2:return bi;case r.am.CoinStack3:return Ci;case r.am.CoinStack4:return Pi;case r.am.CoinStack5:return ki;case r.am.CoinStack6:return Ti;case r.am.Friends:return Ai;case r.am.AddFriend:return Ri;case r.am.GoogleIcon:return wi;case r.am.AppleIcon:return Ii;case r.am.DiscordIcon:return Mi;case r.am.FacebookIcon:return _i;case r.am.RankBronze:return Ei;case r.am.RankSilver:return Di;case r.am.RankGold:return Li;case r.am.RankPlatinum:return Bi;case r.am.RankDiamond:return xi;case r.am.RankMaster:return Oi;case r.am.RankGrandmaster:return Gi;case r.am.RankSubdivisionI:return Fi;case r.am.RankSubdivisionII:return Ui;case r.am.RankSubdivisionIII:return Ni;case r.am.RankSubdivisionIV:return Hi;case r.am.RankSubdivisionV:return Ki;case r.am.LandscapeIcon:return Vi;case r.am.PortraitIcon:return Wi;case r.am.RewindToStart:return qi;case r.am.Rewind:return N;case r.am.Play:return Qi;case r.am.Pause:return ji;case r.am.FastForward:return zi;case r.am.FastForwardToEnd:return $i;case r.am.X05:return Yi;case r.am.X1:return Zi;case r.am.X2:return Ji;case r.am.X4:return Xi;case r.am.X8:return en;case r.am.DownArrowBlack:case r.am.DownArrow:return tn;case r.am.UpArrow:return sn;case r.am.OutArrow:return nn;case r.am.LongestRoad:return rn;case r.am.LargestArmy:return on;case r.am.CardMonopoly:return an;case r.am.CardVictoryPoint:return cn;case r.am.ProfileOverview:return P;case r.am.ProfileRanked:return ln;case r.am.ProfileHistory:return dn;case r.am.ProfileItems:return un;case r.am.ProfileMemberships:return hn;case r.am.ProfileSettings:return V;case r.am.TournamentCC25:return pn;case r.am.TournamentS11First:return mn;case r.am.Tournament4P:return gn;case r.am.BannerMember:return fn;case r.am.BannerShuffle:return yn;case r.am.LandscapeDeprecationWarning:return Or;case r.am.Leaderboard:return Gr;case r.am.PortraitModeOptIn:return Fr;case r.am.SwitchToPortrait:return Ur}}}Nr.roadsByColor={[i.DS.None]:"",[i.DS.Red]:Ts,[i.DS.Blue]:As,[i.DS.Orange]:ws,[i.DS.Green]:Rs,[i.DS.Black]:Is,[i.DS.Bronze]:Pt,[i.DS.Silver]:Ms,[i.DS.Gold]:_s,[i.DS.White]:Es,[i.DS.Purple]:Ds,[i.DS.MysticBlue]:Ls,[i.DS.Pink]:Bs},Nr.settlementsByColor={[i.DS.None]:"",[i.DS.Red]:xs,[i.DS.Blue]:Os,[i.DS.Orange]:Fs,[i.DS.Green]:Gs,[i.DS.Black]:Us,[i.DS.Bronze]:kt,[i.DS.Silver]:Ns,[i.DS.Gold]:Hs,[i.DS.White]:Ks,[i.DS.Purple]:Ws,[i.DS.MysticBlue]:Vs,[i.DS.Pink]:qs},Nr.citiesByColor={[i.DS.None]:"",[i.DS.Red]:Qs,[i.DS.Blue]:js,[i.DS.Orange]:$s,[i.DS.Green]:zs,[i.DS.Black]:Ys,[i.DS.Bronze]:Tt,[i.DS.Silver]:Zs,[i.DS.Gold]:Js,[i.DS.White]:Xs,[i.DS.Purple]:ei,[i.DS.MysticBlue]:ti,[i.DS.Pink]:si},Nr.cityWallsByColor={[i.DS.None]:"",[i.DS.Red]:vn,[i.DS.Blue]:Sn,[i.DS.Orange]:bn,[i.DS.Green]:Cn,[i.DS.Black]:Pn,[i.DS.Bronze]:kn,[i.DS.Silver]:Tn,[i.DS.Gold]:An,[i.DS.White]:Rn,[i.DS.Purple]:wn,[i.DS.MysticBlue]:In,[i.DS.Pink]:Mn},Nr.shipsByColor={[i.DS.None]:"",[i.DS.Red]:_n,[i.DS.Blue]:En,[i.DS.Orange]:Dn,[i.DS.Green]:Ln,[i.DS.Black]:Bn,[i.DS.Bronze]:xn,[i.DS.Silver]:On,[i.DS.Gold]:Gn,[i.DS.White]:Fn,[i.DS.Purple]:Un,[i.DS.MysticBlue]:Nn,[i.DS.Pink]:Hn},Nr.knightsInactiveByColor={[i.DS.None]:"",[i.DS.Red]:Kn,[i.DS.Blue]:Wn,[i.DS.Orange]:Vn,[i.DS.Green]:qn,[i.DS.Black]:Qn,[i.DS.Bronze]:jn,[i.DS.Silver]:zn,[i.DS.Gold]:$n,[i.DS.White]:Yn,[i.DS.Purple]:Zn,[i.DS.MysticBlue]:Jn,[i.DS.Pink]:Xn},Nr.knightsActiveByColor={[i.DS.None]:"",[i.DS.Red]:er,[i.DS.Blue]:tr,[i.DS.Orange]:sr,[i.DS.Green]:ir,[i.DS.Black]:nr,[i.DS.Bronze]:rr,[i.DS.Silver]:or,[i.DS.Gold]:ar,[i.DS.White]:cr,[i.DS.Purple]:lr,[i.DS.MysticBlue]:dr,[i.DS.Pink]:ur}
1,Nr.merchantByColor={[i.DS.None]:"",[i.DS.Red]:hr,[i.DS.Blue]:pr,[i.DS.Orange]:mr,[i.DS.Green]:gr,[i.DS.Black]:fr,[i.DS.Bronze]:yr,[i.DS.Silver]:vr,[i.DS.Gold]:Sr,[i.DS.White]:br,[i.DS.Purple]:Cr,[i.DS.MysticBlue]:Pr,[i.DS.Pink]:kr},Nr.playerBackgroundByColor={[i.DS.None]:"",[i.DS.Red]:Tr,[i.DS.Blue]:Ar,[i.DS.Orange]:Rr,[i.DS.Green]:wr,[i.DS.Black]:Ir,[i.DS.Bronze]:Mr,[i.DS.Silver]:_r,[i.DS.Gold]:Er,[i.DS.White]:Dr,[i.DS.Purple]:Lr,[i.DS.MysticBlue]:Br,[i.DS.Pink]:xr}},36242:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_careers.b8d1a64cc22f7364a281.svg"},36412:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_gift.5239cfd544f410556f16.png"},36872:(e,t,s)=>{"use strict";s.d(t,{lc:()=>F,hx:()=>B,K4:()=>I,GV:()=>x,$m:()=>v.$,lo:()=>d,Qb:()=>n,IM:()=>r,Ej:()=>G,bq:()=>O,ZP:()=>w,um:()=>T,Ly:()=>A,Vd:()=>a,ro:()=>k,Cz:()=>S,am:()=>i,l6:()=>D.l6,fx:()=>D.fx,Qy:()=>C,p9:()=>b,bh:()=>M,ZC:()=>l,ZS:()=>h,p5:()=>u,FL:()=>g,Yt:()=>y,gu:()=>f,SB:()=>m,kv:()=>p,Lj:()=>c,ec:()=>R,gq:()=>L,$y:()=>o,_A:()=>E,sP:()=>P,VZ:()=>_});var i=function(e){return e[e.Pencil=0]="Pencil",e[e.Bot=1]="Bot",e[e.CheckMark=2]="CheckMark",e[e.XMark=3]="XMark",e[e.Logo=4]="Logo",e[e.Lightning=5]="Lightning",e[e.Plus=6]="Plus",e[e.PlusStore=7]="PlusStore",e[e.Mail=8]="Mail",e[e.Admin=9]="Admin",e[e.Moderator=10]="Moderator",e[e.User=11]="User",e[e.Guest=12]="Guest",e[e.Star=13]="Star",e[e.Players=14]="Players",e[e.PlayersRanked=285]="PlayersRanked",e[e.ReplayIcon=15]="ReplayIcon",e[e.QuestionMark=16]="QuestionMark",e[e.InfoIcon=17]="InfoIcon",e[e.DangerIcon=18]="DangerIcon",e[e.KarmaWhite=19]="KarmaWhite",e[e.KarmaRed=20]="KarmaRed",e[e.KarmaOrange=21]="KarmaOrange",e[e.KarmaGreen=22]="KarmaGreen",e[e.DisableAdBlock=23]="DisableAdBlock",e[e.ColonistCoin=24]="ColonistCoin",e[e.Rulebook=25]="Rulebook",e[e.BankIcon=26]="BankIcon",e[e.FullScreenExpand=27]="FullScreenExpand",e[e.FullScreenContract=28]="FullScreenContract",e[e.FullScreenGif=29]="FullScreenGif",e[e.LeftArrow=30]="LeftArrow",e[e.Audio=31]="Audio",e[e.Eye=32]="Eye",e[e.SendArrow=33]="SendArrow",e[e.Settings=34]="Settings",e[e.Chat=35]="Chat",e[e.Log=36]="Log",e[e.MatchmakingSearch=37]="MatchmakingSearch",e[e.Lock=38]="Lock",e[e.LockOutlined=39]="LockOutlined",e[e.LockSlanted=40]="LockSlanted",e[e.LockOn=288]="LockOn",e[e.Share=41]="Share",e[e.NoAds=246]="NoAds",e[e.Colors=247]="Colors",e[e.Avatars=261]="Avatars",e[e.Maps=262]="Maps",e[e.Expansions=263]="Expansions",e[e.AllColors=264]="AllColors",e[e.Memberships=267]="Memberships",e[e.RoadBronze=42]="RoadBronze",e[e.SettlementBronze=43]="SettlementBronze",e[e.CityBronze=44]="CityBronze",e[e.MapDiamondPreview=45]="MapDiamondPreview",e[e.MapLakesPreview=46]="MapLakesPreview",e[e.MapPondPreview=47]="MapPondPreview",e[e.MapGearPreview=48]="MapGearPreview",e[e.MapUSAPreview=49]="MapUSAPreview",e[e.MapTwirlPreview=50]="MapTwirlPreview",e[e.MapEarthPreview=51]="MapEarthPreview",e[e.MapUKPreview=52]="MapUKPreview",e[e.MapCyclopsPreview=53]="MapCyclopsPreview",e[e.MapClassic4PPreview=54]="MapClassic4PPreview",e[e.MapClassic56PPreview=55]="MapClassic56PPreview",e[e.MapClassic78PPreview=56]="MapClassic78PPreview",e[e.MapPangaeaPreview=57]="MapPangaeaPreview",e[e.MapSpinnerPreview=58]="MapSpinnerPreview",e[e.MapRandomBasePreview=59]="MapRandomBasePreview",e[e.MapRomaniaPreview=60]="MapRomaniaPreview",e[e.MapHourglassPreview=61]="MapHourglassPreview",e[e.MapHourglassXLPreview=62]="MapHourglassXLPreview",e[e.MapSnowflakePreview=63]="MapSnowflakePreview",e[e.MapShuffleBoardPreview=64]="MapShuffleBoardPreview",e[e.MapMiniBasePreview=65]="MapMiniBasePreview",e[e.MapAustraliaPreview=66]="MapAustraliaPreview",e[e.MapDuelPreview=67]="MapDuelPreview",e[e.MapMonopolyPreview=68]="MapMonopolyPreview",e[e.MapKingOfTheHillPreview=69]="MapKingOfTheHillPreview",e[e.MapMountainOfRichesPreview=70]="MapMountainOfRichesPreview",e[e.MapDoggoPreview=71]="MapDoggoPreview",e[e.MapTradeIslandsPreview=72]="MapTradeIslandsPreview",e[e.MapTurningTidesPreview=73]="MapTurningTidesPreview",e[e.MapBlackForestPreview=74]="MapBlackForestPreview",e[e.MapVolcanoPreview=75]="MapVolcanoPreview",e[e.MapCirclePreview=76]="MapCirclePreview",e[e.MapKitePreview=77]="MapKitePreview",e[e.MapVietnamPreview=78]="MapVietnamPreview",e[e.MapTwoIslesPreview=79]="MapTwoIslesPreview",e[e.MapJellyFishPreview=80]="MapJellyFishPreview",e[e.MapGoldRushPreview=81]="MapGoldRushPreview",e[e.MapIstanbulPreview=82]="MapIstanbulPreview",e[e.MapEuropePreview=83]="MapEuropePreview",e[e.MapStripesPreview=84]="MapStripesPreview",e[e.MapMonopolyIslandsPreview=85]="MapMonopolyIslandsPreview",e[e.MapSS1HeadingForNewShores3PPreview=86]="MapSS1HeadingForNewShores3PPreview",e[e.MapSS1HeadingForNewShores4PPreview=87]="MapSS1HeadingForNewShores4PPreview",e[e.MapSS1HeadingForNewShores56PPreview=88]="MapSS1HeadingForNewShores56PPreview",e[e.MapSS2FourIslands3PPreview=89]="MapSS2FourIslands3PPreview",e[e.MapSS2FourIslands4PPreview=90]="MapSS2FourIslands4PPreview",e[e.MapSS2SixIslands56PPreview=91]="MapSS2SixIslands56PPreview",e[e.MapSS3FogIslands3PPreview=92]="MapSS3FogIslands3PPreview",e[e.MapSS3FogIslands4PPreview=93]="MapSS3FogIslands4PPreview",e[e.MapSS3FogIslands56PPreview=94]="MapSS3FogIslands56PPreview",e[e.MapSS4ThroughTheDesert3PPreview=95]="MapSS4ThroughTheDesert3PPreview",e[e.MapSS4ThroughTheDesert4PPreview=96]="MapSS4ThroughTheDesert4PPreview",e[e.MapSS4ThroughTheDesert56PPreview=97]="MapSS4ThroughTheDesert56PPreview",e[e.GameMode1v1=98]="GameMode1v1",e[e.GameModeBase=99]="GameModeBase",e[e.GameModeBase56P=250]="GameModeBase56P",e[e.GameModeBase78P=251]="GameModeBase78P",e[e.GameModeSeafarers=252]="GameModeSeafarers",e[e.GameModeSeafarers56P=253]="GameModeSeafarers56P",e[e.GameModeCnK=100]="GameModeCnK",e[e.GameModeCitiesAndKnights56P=254]="GameModeCitiesAndKnights56P",e[e.GameModeCnKSeafarers=248]="GameModeCnKSeafarers",e[e.GameModeSeafarersCitiesAndKnights56P=255]="GameModeSeafarersCitiesAndKnights56P",e[e.GameModeColonistRush=270]="GameModeColonistRush",e[e.GameModeBasePreview=101]="GameModeBasePreview",e[e.StoreMembershipPlus=102]="StoreMembershipPlus",e[e.StoreMembershipPremium=103]="StoreMembershipPremium",e[e.StoreMembershipElite=104]="StoreMembershipElite",e[e.StoreMembershipHoliday2023=105]="StoreMembershipHoliday2023",e[e.StoreMembershipPerkAllMaps=106]="StoreMembershipPerkAllMaps",e[e.StoreMembershipPerkAllExpansions=107]="StoreMembershipPerkAllExpansions",e[e.StoreMembershipPerkR
1ankedGames=108]="StoreMembershipPerkRankedGames",e[e.StoreMembershipPerkCustomLinks=109]="StoreMembershipPerkCustomLinks",e[e.StoreMembershipPerkColonistCoins=110]="StoreMembershipPerkColonistCoins",e[e.StoreMembershipPerkNoAds=111]="StoreMembershipPerkNoAds",e[e.StoreMembershipPerkNoAdsGifDesertBox=112]="StoreMembershipPerkNoAdsGifDesertBox",e[e.StoreMembershipPerkNoAdsGifGoldBox=113]="StoreMembershipPerkNoAdsGifGoldBox",e[e.StoreMembershipPerkNoAdsGifDesertHex=114]="StoreMembershipPerkNoAdsGifDesertHex",e[e.StoreMembershipPerkNoAdsGifGoldHex=115]="StoreMembershipPerkNoAdsGifGoldHex",e[e.StoreMembershipPerkAllColors=116]="StoreMembershipPerkAllColors",e[e.StoreItemExpansionClassic56P=117]="StoreItemExpansionClassic56P",e[e.StoreItemExpansionClassic78P=118]="StoreItemExpansionClassic78P",e[e.StoreItemSeafarers4P=119]="StoreItemSeafarers4P",e[e.StoreItemSeafarers56P=120]="StoreItemSeafarers56P",e[e.StoreItemCitiesAndKnights4P=121]="StoreItemCitiesAndKnights4P",e[e.StoreItemCitiesAndKnights56P=122]="StoreItemCitiesAndKnights56P",e[e.StoreItemCitiesAndKnightsSeafarers4P=123]="StoreItemCitiesAndKnightsSeafarers4P",e[e.StoreItemCitiesAndKnightsSeafarers56P=124]="StoreItemCitiesAndKnightsSeafarers56P",e[e.StoreItemColonistRush=295]="StoreItemColonistRush",e[e.StoreColorBlack=125]="StoreColorBlack",e[e.StoreColorPurple=126]="StoreColorPurple",e[e.StoreColorMysticBlue=127]="StoreColorMysticBlue",e[e.StoreColorWhite=128]="StoreColorWhite",e[e.StoreColorBronze=129]="StoreColorBronze",e[e.StoreColorSilver=130]="StoreColorSilver",e[e.StoreColorGold=131]="StoreColorGold",e[e.StoreColorPink=132]="StoreColorPink",e[e.IconElephant=133]="IconElephant",e[e.IconSombrero=134]="IconSombrero",e[e.IconFarmer=135]="IconFarmer",e[e.IconAvocado=136]="IconAvocado",e[e.IconCactus=137]="IconCactus",e[e.IconCrown=138]="IconCrown",e[e.IconSwords=139]="IconSwords",e[e.IconHelmet=140]="IconHelmet",e[e.IconSnorkel=141]="IconSnorkel",e[e.IconScarf=142]="IconScarf",e[e.IconTie=143]="IconTie",e[e.IconWorker=144]="IconWorker",e[e.IconMummy=145]="IconMummy",e[e.IconSettlerHat=146]="IconSettlerHat",e[e.IconColonistHat=147]="IconColonistHat",e[e.IconFounderHat=148]="IconFounderHat",e[e.IconChristmasHat=149]="IconChristmasHat",e[e.IconPirateShip=150]="IconPirateShip",e[e.IconMedalGold=151]="IconMedalGold",e[e.IconMedalSilver=152]="IconMedalSilver",e[e.IconMedalBronze=153]="IconMedalBronze",e[e.IconRobberSanta=154]="IconRobberSanta",e[e.IconRobberLunar=155]="IconRobberLunar",e[e.IconRobberCupid=156]="IconRobberCupid",e[e.IconGifter=256]="IconGifter",e[e.IconNoTroll=258]="IconNoTroll",e[e.SettlerPack=157]="SettlerPack",e[e.ColonistPack=158]="ColonistPack",e[e.FounderPack=159]="FounderPack",e[e.Bank=160]="Bank",e[e.Robber=161]="Robber",e[e.Dice3Sharp=289]="Dice3Sharp",e[e.Dice6=162]="Dice6",e[e.PrivateGame=163]="PrivateGame",e[e.HideBankCards=164]="HideBankCards",e[e.RoadRed=165]="RoadRed",e[e.RoadBlue=166]="RoadBlue",e[e.RoadGreen=167]="RoadGreen",e[e.RoadOrange=168]="RoadOrange",e[e.RoadBlack=169]="RoadBlack",e[e.RoadSilver=170]="RoadSilver",e[e.RoadGold=171]="RoadGold",e[e.RoadWhite=172]="RoadWhite",e[e.RoadPurple=173]="RoadPurple",e[e.RoadMysticBlue=174]="RoadMysticBlue",e[e.RoadPink=175]="RoadPink",e[e.SettlementRed=176]="SettlementRed",e[e.SettlementBlue=177]="SettlementBlue",e[e.SettlementGreen=178]="SettlementGreen",e[e.SettlementOrange=179]="SettlementOrange",e[e.SettlementBlack=180]="SettlementBlack",e[e.SettlementSilver=181]="SettlementSilver",e[e.SettlementGold=182]="SettlementGold",e[e.SettlementWhite=183]="SettlementWhite",e[e.SettlementPurple=184]="SettlementPurple",e[e.SettlementMysticBlue=185]="SettlementMysticBlue",e[e.SettlementPink=186]="SettlementPink",e[e.CityRed=187]="CityRed",e[e.CityBlue=188]="CityBlue",e[e.CityGreen=189]="CityGreen",e[e.CityOrange=190]="CityOrange",e[e.CityBlack=191]="CityBlack",e[e.CitySilver=192]="CitySilver",e[e.CityGold=193]="CityGold",e[e.CityWhite=194]="CityWhite",e[e.CityPurple=195]="CityPurple",e[e.CityMysticBlue=196]="CityMysticBlue",e[e.CityPink=197]="CityPink",e[e.CoinStack1=198]="CoinStack1",e[e.CoinStack2=199]="CoinStack2",e[e.CoinStack3=200]="CoinStack3",e[e.CoinStack4=201]="CoinStack4",e[e.CoinStack5=202]="CoinStack5",e[e.CoinStack6=203]="CoinStack6",e[e.Friends=204]="Friends",e[e.AddFriend=266]="AddFriend",e[e.GoogleIcon=205]="GoogleIcon",e[e.AppleIcon=206]="AppleIcon",e[e.DiscordIcon=207]="DiscordIcon",e[e.FacebookIcon=208]="FacebookIcon",e[e.RankBronze=209]="RankBronze",e[e.RankSilver=210]="RankSilver",e[e.RankGold=211]="RankGold",e[e.RankPlatinum=212]="RankPlatinum",e[e.RankDiamond=213]="RankDiamond",e[e.RankMaster=214]="RankMaster",e[e.RankGrandmaster=215]="RankGrandmaster",e[e.RankSubdivisionI=216]="RankSubdivisionI",e[e.RankSubdivisionII=217]="RankSubdivisionII",e[e.RankSubdivisionIII=218]="RankSubdivisionIII",e[e.RankSubdivisionIV=219]="RankSubdivisionIV",e[e.RankSubdivisionV=220]="RankSubdivisionV",e[e.LandscapeIcon=221]="LandscapeIcon",e[e.PortraitIcon=222]="PortraitIcon",e[e.RewindToStart=223]="RewindToStart",e[e.Rewind=224]="Rewind",e[e.Play=225]="Play",e[e.Pause=226]="Pause",e[e.FastForward=227]="FastForward",e[e.FastForwardToEnd=228]="FastForwardToEnd",e[e.X05=229]="X05",e[e.X1=230]="X1",e[e.X2=231]="X2",e[e.X4=232]="X4",e[e.X8=233]="X8",e[e.DownArrowBlack=265]="DownArrowBlack",e[e.DownArrow=234]="DownArrow",e[e.UpArrow=235]="UpArrow",e[e.OutArrow=286]="OutArrow",e[e.LongestRoad=236]="LongestRoad",e[e.LargestArmy=237]="LargestArmy",e[e.CardMonopoly=238]="CardMonopoly",e[e.CardVictoryPoint=239]="CardVictoryPoint",e[e.ProfileOverview=240]="ProfileOverview",e[e.ProfileRanked=241]="ProfileRanked",e[e.ProfileHistory=242]="ProfileHistory",e[e.ProfileItems=243]="ProfileItems",e[e.ProfileMemberships=269]="ProfileMemberships",e[e.ProfileSettings=244]="ProfileSettings",e[e.StoreGiftMembership=245]="StoreGiftMembership",e[e.StoreGiftMembershipDark=249]="StoreGiftMembershipDark",e[e.TournamentCC25=283]="TournamentCC25",e[e.TournamentS11First=257]="Tourn
1amentS11First",e[e.Tournament4P=260]="Tournament4P",e[e.BannerMember=259]="BannerMember",e[e.BannerShuffle=282]="BannerShuffle",e[e.LandscapeDeprecationWarning=268]="LandscapeDeprecationWarning",e[e.IconRotation=271]="IconRotation",e[e.IconTimer=272]="IconTimer",e[e.GameModeShuffle=273]="GameModeShuffle",e[e.IconBeta=275]="IconBeta",e[e.BotBeginner=276]="BotBeginner",e[e.BotEasy=277]="BotEasy",e[e.BotMedium=278]="BotMedium",e[e.BotHard=279]="BotHard",e[e.GameModeRanked1v1=280]="GameModeRanked1v1",e[e.GameModeRanked4P=281]="GameModeRanked4P",e[e.GameModeRankedRush=293]="GameModeRankedRush",e[e.GameModeBotRush=294]="GameModeBotRush",e[e.Leaderboard=284]="Leaderboard",e[e.Gift=287]="Gift",e[e.PortraitModeOptIn=290]="PortraitModeOptIn",e[e.SwitchToPortrait=291]="SwitchToPortrait",e[e.RushInformation=292]="RushInformation",e}({}),n=function(e){return e[e.PlusMonthly=0]="PlusMonthly",e[e.PremiumMonthly=1]="PremiumMonthly",e[e.EliteMonthly=2]="EliteMonthly",e[e.PlusYearly=3]="PlusYearly",e[e.PremiumYearly=4]="PremiumYearly",e[e.EliteYearly=5]="EliteYearly",e[e.Holiday2023AllAccessPass=6]="Holiday2023AllAccessPass",e}({});var r=function(e){return e[e.Holiday2023AllAccessPass=0]="Holiday2023AllAccessPass",e[e.GiftPlusMonthly=1]="GiftPlusMonthly",e[e.GiftPremiumMonthly=2]="GiftPremiumMonthly",e[e.GiftEliteMonthly=3]="GiftEliteMonthly",e[e.GiftPlusYearly=4]="GiftPlusYearly",e[e.GiftPremiumYearly=5]="GiftPremiumYearly",e[e.GiftEliteYearly=6]="GiftEliteYearly",e}({}),o=function(e){return e[e.Seafarers4P=0]="Seafarers4P",e[e.CitiesAndKnights4P=1]="CitiesAndKnights4P",e[e.TradersAndBarbarians=2]="TradersAndBarbarians",e[e.ExplorersAndPirates=3]="ExplorersAndPirates",e[e.Classic56P=4]="Classic56P",e[e.Classic78P=5]="Classic78P",e[e.Seafarers56P=6]="Seafarers56P",e[e.CitiesAndKnights56P=7]="CitiesAndKnights56P",e[e.CitiesAndKnightsSeafarers4P=8]="CitiesAndKnightsSeafarers4P",e[e.CitiesAndKnightsSeafarers56P=9]="CitiesAndKnightsSeafarers56P",e[e.ColonistRush4P=10]="ColonistRush4P",e}({});const a=130,c=137,l="2";var d=function(e){return e[e.GameAction=1]="GameAction",e[e.LobbyAction=2]="LobbyAction",e[e.RoomAction=3]="RoomAction",e[e.MatchmakingAction=4]="MatchmakingAction",e[e.ChannelAction=5]="ChannelAction",e[e.Noop=6]="Noop",e[e.GeneralAction=7]="GeneralAction",e[e.Echo=8]="Echo",e[e.CloseSocket=9]="CloseSocket",e[e.RoomCommand=10]="RoomCommand",e[e.ShuffleAction=11]="ShuffleAction",e[e.MatchmakingCommand=12]="MatchmakingCommand",e}({});const u=4007,h=4012,p=4015,m=4017,g=4018,f=4019,y=4020;if(517!=s.j)var v=s(13047);var S=function(e){return e[e.Unknown=0]="Unknown",e[e.Tutorial=1]="Tutorial",e[e.BotGame=2]="BotGame",e[e.CreatedRoomGame=3]="CreatedRoomGame",e[e.MatchmakingGame=5]="MatchmakingGame",e[e.MatchmakingGameRanked=6]="MatchmakingGameRanked",e[e.BeginnerMode=7]="BeginnerMode",e[e.CreatedTournamentRoom=8]="CreatedTournamentRoom",e}({}),b=function(e){return e[e.Classic4P=0]="Classic4P",e[e.TutorialClassic4P=1]="TutorialClassic4P",e[e.Classic56P=2]="Classic56P",e[e.Classic78P=3]="Classic78P",e[e.Seafarers4P=4]="Seafarers4P",e[e.Seafarers56P=5]="Seafarers56P",e[e.CitiesAndKnights4P=6]="CitiesAndKnights4P",e[e.CitiesAndKnights56P=7]="CitiesAndKnights56P",e[e.CitiesAndKnightsSeafarers4P=8]="CitiesAndKnightsSeafarers4P",e[e.CitiesAndKnightsSeafarers56P=9]="CitiesAndKnightsSeafarers56P",e[e.ServerStressTestClassic4P=10]="ServerStressTestClassic4P",e[e.BeginnerModeClassic4P=11]="BeginnerModeClassic4P",e[e.ColonistRush4P=12]="ColonistRush4P",e}({}),C=function(e){return e[e.Classic4P=0]="Classic4P",e[e.TutorialClassic4P=1]="TutorialClassic4P",e[e.Classic4PRandom=2]="Classic4PRandom",e[e.Classic56P=3]="Classic56P",e[e.Classic78P=4]="Classic78P",e[e.SS1HeadingForNewShores3P=5]="SS1HeadingForNewShores3P",e[e.SS1HeadingForNewShores4P=6]="SS1HeadingForNewShores4P",e[e.SS1HeadingForNewShores56P=7]="SS1HeadingForNewShores56P",e[e.TutorialSS1HeadingForNewShores4P=8]="TutorialSS1HeadingForNewShores4P",e[e.SS2FourIslands3P=9]="SS2FourIslands3P",e[e.SS2FourIslands4P=10]="SS2FourIslands4P",e[e.SS2SixIslands56P=11]="SS2SixIslands56P",e[e.TutorialSS2FourIslands4P=12]="TutorialSS2FourIslands4P",e[e.SS3FogIslands3P=13]="SS3FogIslands3P",e[e.SS3FogIslands4P=14]="SS3FogIslands4P",e[e.SS3FogIslands56P=15]="SS3FogIslands56P",e[e.TutorialSS3FogIsland4P=16]="TutorialSS3FogIsland4P",e[e.SS4ThroughTheDesert3P=17]="SS4ThroughTheDesert3P",e[e.SS4ThroughTheDesert4P=18]="SS4ThroughTheDesert4P",e[e.SS4ThroughTheDesert56P=19]="SS4ThroughTheDesert56P",e[e.TutorialSS4ThroughTheDesert4P=20]="TutorialSS4ThroughTheDesert4P",e[e.KingOfTheHill=21]="KingOfTheHill",e[e.Earth=22]="Earth",e[e.EarthSeafarers=23]="EarthSeafarers",e[e.USA=24]="USA",e[e.UK=25]="UK",e[e.UKSeafarers=26]="UKSeafarers",e[e.Diamond=27]="Diamond",e[e.Gear=28]="Gear",e[e.Lakes=29]="Lakes",e[e.Pond=30]="Pond",e[e.Twirl=31]="Twirl",e[e.ShuffleBoard=32]="ShuffleBoard",e[e.BlackForest=33]="BlackForest",e[e.Volcano=34]="Volcano",e[e.Circle=35]="Circle",e[e.Kite=36]="Kite",e[e.Romania=37]="Romania",e[e.MiniBase=38]="MiniBase",e[e.Monopoly=39]="Monopoly",e[e.MountainOfRiches=40]="MountainOfRiches",e[e.Doggo=41]="Doggo",e[e.Duel=42]="Duel",e[e.TradeIslands=43]="TradeIslands",e[e.TradeIslandsSeafarers=44]="TradeIslandsSeafarers",e[e.Vietnam=45]="Vietnam",e[e.TurningTidesSeafarers=46]="TurningTidesSeafarers",e[e.TurningTidesClassic=47]="TurningTidesClassic",e[e.TwoIsles=48]="TwoIsles",e[e.JellyFish=49]="JellyFish",e[e.GoldRush=50]="GoldRush",e[e.Istanbul=51]="Istanbul",e[e.IstanbulSeafarers=52]="IstanbulSeafarers",e[e.Europe=53]="Europe",e[e.EuropeSeafarers=54]="EuropeSeafarers",e[e.Stripes=55]="Stripes",e[e.MonopolyIslands=56]="MonopolyIslands",e[e.MonopolyIslandsSeafarers=57]="MonopolyIslandsSeafarers",e[e.CampaignLevel1=58]="CampaignLevel1",e[e.CampaignLevel2=59]="CampaignLevel2",e[e.CampaignRoadRace=60]="CampaignRoadRace",e[e.CampaignRoadRace2=61]="CampaignRoadRace2",e}({});function P(e){switch(e){case 0:case 6:default:return 0;case 1:case 10:return 1;case 11:return 58;case 2:case 7:return 3;case 3:return 4;case 4:case 8:return 6;case 5:case 9:return 7}}var k=function(e){return e[e.Base30s=0]="Base30s",e[e.Base60s=1]="Base60s",e[e.Base120s=2]="Base120s",e[e.Base240s=3]="Base240s",e[e.Base12000s=4]="Base12000s",e[e.Rush5s=5]="Rush5s",e[e.Rush8s=6]="Rush8s",e[e.Rush10s=7]="Rush10s",e[e.Rush15s=8]="Rush15s",e[e.Rush20s=9]="Rush20s",e[e.Base15s=10]="Base15s",e}({}),T=function(e){return e[e.Inactive=0]="Inactive",e[e.HiddenUnranked1v1=1]="HiddenUnranked1v1",e[e.HiddenUnranked4PClassic=2]="HiddenUnranked4PClassic",e[e.VisibleRanked1v1=3]="VisibleRanked1v1",e[e.VisibleRanked4PClassic=4]="VisibleRanked4PClassic",e[e.VisibleRankedCitiesAndKnights4P=5]="VisibleRankedCitiesAndKnights4P",e[e.HiddenUnrankedShuffle=6]="HiddenUnrankedShuffle",e[e.VisibleRanked4PRush=7]="VisibleRanked4PRush",e}({}),A=function(e){return e[e.Players4=0]="Players4",e[e.Players56=1]="Players56",e[e.Players78=2]="Players78",e}({}),R=function(e){return e[e.None=0]="None",e[e.SS1HeadingForNewShores=1]="SS1HeadingForNewShores",e[e.SS2TheFourIslands=2]="SS2TheFourIslands",e[e.SS3TheFogIslands=3]="SS3TheFogIslands",e[e.SS4ThroughTheDesert=4]="SS4ThroughTheDesert",e}({}),w=function(e){return e[e.Random=0]="Random",e[e.Balanced=1]="Balanced",e[e.StressTestSequence=2]="StressTestSequence",e[e.PredefinedDiceSequenceDeleted=3]="PredefinedDiceSequenceDeleted",e}({}),I=function(e){return e[e.Fast=0]="Fast",e[e.Normal=1]="Normal",e[e.Slow=2]="Slow",e}({}),M=function(e){return e.Feature="Feature",e.Update="Update",e.Blog="Blog",e.Fix="Fix",e.Youtube="YouTube",e}({});function _(e,t,s,i,n){return{date:new Date(e,t-1,s),version:i,contents:n}}function E(e,t,s,i,n,r){return{type:e,description:t,contributors:null==s?[]:s,beforeImgUrl:i,afterImgUrl:n,link:r}}if(517!=s.j)var D=s(5161);class L{}L.SUPPORT_EMAIL="[email protected]",L.DISCORD_CHANNEL="https://discord.gg/colonist",L.DISCORD_SERVER_ID="605233308577562643",L.BLOG_URL="https://blog.colonist.io",L.APP_STORE_URL="https://apps.apple.com/us/app/colonist-io/id6444831129",L.PLAY_STORE_URL="https://play.google.com/store/apps/details?id=com.colonist.colonist";var B=function(e){return e[e.Administrator=0]="Administrator",e[e.User=1]="User",e[e.Manager=4]="Manager",e[e.Moderator=5]="Moderator",e}({});const x=200;var O=function(e){return e[e.Unknown=0]="Unknown",e[e.Web=1]="Web",e[e.Discord=2]="Discord",e[e.AppleWeb=3]="AppleWeb",e[e.AppleApp=4]="AppleApp",e[e.AndroidWeb=5]="AndroidWeb",e[e.AndroidApp=6]="AndroidApp",e[e.MobileUnknown=7]="MobileUnknown",e[e.DiscordMobile=8]="DiscordMobile",e}({});const G=/^(51|83)7$/.test(s.j)?null:[2,8];
1class F extends Error{constructor(){super("AbortError")}}},36919:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_science_medicine.2383b5ba0184a11b8a0a.svg"},37099:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_back.999e2100ec85897f785f.svg"},37145:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_rewind_start.8d1d46525d9109204730.svg"},37183:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_lumber.cf22f8083cf89c2a29e7.svg"},37642:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_event_trade.99431534a1e93bf1516a.svg"},37864:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_sound_off.8c9d6be907f2f45125b7.svg"},38271:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_click.9c3152cb7a312c82805e.mp3"},38493:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_wall_white.8224311ef29d6d210922.svg"},38774:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_moderator.72852cec760a260c5969.svg"},38853:(e,t,s)=>{"use strict";e.exports=s.p+"assets/settlement_purple.af6c0adb105271efbfb5.svg"},38854:(e,t,s)=>{"use strict";s.d(t,{M:()=>o});var i=s(9029),n=s(36872);class r{updateInteractability(e){this.setView(e),this.shouldDisableOnClick(e)?(0,i.G0)(this.container,()=>{}):this.shouldShowInfoOnClick(e)?this.setInfoOnClick():this.setOnClick()}init(){this.setOnClick(),this.updateCellView()}updateCellView(){this.available||this.setUnavailable(),this.selected&&this.setSelected(),this.bannerText&&this.createBanner(this.bannerText)}createBanner(e){const t=(0,i.Le)(this.container,"badge-green badge-sm");(0,i.Wr)(t,e,"")}setView(e){this.container.classList.toggle("guest-view",e)}setUnavailable(){this.container.classList.add("unavailable"),(0,i.zO)(this.container,n.am.Lock,"item-scroll-cell-lock"),this.canToggle&&this.setInfoOnClick()}setSelected(){this.container.classList.add("selected")}shouldDisableOnClick(e){return!(!e||!this.canToggle)}shouldShowInfoOnClick(e){return!!e||(!this.canToggle||!this.available)&&(!(!this.canToggle||this.available)||!!this.selected)}setOnClick(){(0,i.G0)(this.container,this.clickAction)}setInfoOnClick(){null!=this.infoAction?(0,i.G0)(this.container,this.infoAction):(0,i.G0)(this.container,()=>{})}constructor(e,t){this.container=(0,i.Le)(e,"item-scroll-cell"),this.name=t.name;const s=(0,i.zO)(this.container,t.image,"item-scroll-cell-image"),r=(0,i.Wr)(this.container,this.name,"item-scroll-cell-text");var o,a;s.draggable=!1,r.textContent&&(r.textContent=r.textContent.replace(/-/g,"â")),t.showInfoIcon&&(0,i.zO)(this.container,n.am.InfoIcon,"item-scroll-cell-info-icon"),this.available=t.available,this.selected=t.selected,this.canToggle=null!==(o=t.canToggle)&&void 0!==o&&o,this.bannerText=null!==(a=t.bannerText)&&void 0!==a?a:void 0,this.clickAction=t.clickAction,this.infoAction=t.infoAction,this.init()}}class o{update(e){this.clear(),this.generateItems(e),this.updateArrowVisibility(),this.scrollable&&this.scrollToSelectedItem()}updateInteractabilityOfElements(e){this.items.forEach(t=>{t.updateInteractability(e)})}resetScroll(){this.scrollable&&(this.scrollWrapper.scrollLeft=0),this.updateArrowVisibility()}initScrolling(){if(this.scrollable)return(0,i.G0)(this.leftArrow,()=>this.scroll(-this.scrollAmount)),(0,i.G0)(this.rightArrow,()=>this.scroll(this.scrollAmount)),void(this.scrollWrapper.onscroll=()=>this.updateArrowVisibility());this.leftArrow.style.display="none",this.rightArrow.style.display="none",this.scrollWrapper.classList.add("no-scroll")}initResizeObserver(){this.scrollable&&(this.resizeObserver=new ResizeObserver(()=>{this.updateArrowVisibility(),this.scrollToSelectedItem()}),this.resizeObserver.observe(this.scrollWrapper))}scroll(e){if(!this.scrollable)return;const t=this.scrollWrapper.scrollLeft,s=this.getMaxScrollPosition(),i=Math.max(0,Math.min(s,t+e));this.scrollWrapper.scrollTo({left:i,behavior:"smooth"})}getMaxScrollPosition(){return Math.max(0,this.scrollWrapper.scrollWidth-this.scrollWrapper.clientWidth)}updateArrowVisibility(){if(!this.scrollable)return this.leftArrow.style.display="none",void(this.rightArrow.style.display="none");const{scrollLeft:e,scrollWidth:t,clientWidth:s}=this.scrollWrapper,i=e>1,n=e<t-s-1;this.leftArrow.style.display=i?"block":"none",this.rightArrow.style.display=n?"block":"none"}generateItems(e){const t=[...e];t.sort((e,t)=>
1e.available===t.available?0:e.available?-1:1);const s=t.find(e=>void 0!==e.bannerText);if(s){const e=t.indexOf(s);t.splice(e,1),t.splice(1,0,s)}t.forEach(e=>{const t=new r(this.scrollContainer,e);this.items.push(t)}),this.scrollable&&this.scrollToSelectedItem()}scrollToSelectedItem(){this.scrollable&&requestAnimationFrame(()=>{const e=this.items.find(e=>e.container.classList.contains("selected"));if(!e)return;const t=e.container,s=t.offsetWidth,i=this.scrollWrapper.clientWidth,n=this.scrollWrapper.scrollLeft,r=t.offsetLeft;if(r>=n&&r+s<=n+i)return;const o=r-i/2+s/2;this.scrollWrapper.scrollTo({left:Math.max(0,Math.min(o,this.getMaxScrollPosition())),behavior:"smooth"})})}clear(){(0,i.RH)(this.scrollContainer,{key:"strings:colonistCommon.utils.emptyString"}),this.items.length=0}constructor(e,t,s=!0){this.items=[],this.scrollAmount=500,this.scrollWrapper=e.querySelector(".item-scroll-wrapper"),this.scrollContainer=this.scrollWrapper.querySelector(".item-scroll-container"),this.leftArrow=e.querySelector(".scroll-arrow.left-arrow"),this.rightArrow=e.querySelector(".scroll-arrow.right-arrow"),this.scrollable=s,this.initScrolling(),this.generateItems(t),this.updateArrowVisibility(),this.initResizeObserver()}}},38910:(e,t,s)=>{"use strict";s.d(t,{X:()=>a});var i=s(36872),n=s(9029),r=s(76092),o=s(80708);class a{createSidebarButton(){this.topNavigationButton=(0,n.Le)(this.sidebarContainer,"store-gift-sidebar-button");const e=this.sidebarContainer.children.length;this.tabOrderNumberContainer=(0,n.Le)(this.topNavigationButton,"store-gift-sidebar-order-number"),this.tabOrderNumber=(0,n.Wr)(this.tabOrderNumberContainer,{key:"strings:colonistCommon.utils.#buffer",options:{value:`${e}`}},""),this.checkmark=(0,n.zO)(this.tabOrderNumberContainer,i.am.CheckMark,"store-gift-sidebar-checkmark"),this.checkmark.classList.add("hidden"),this.selectionTitle=(0,n.Le)(this.topNavigationButton,"store-gift-sidebar-title")}select(){var e;for(const e of this.parentDiv.children)e.classList.add("hidden");for(const e of this.sidebarContainer.children)e.classList.remove("selected");this.topNavigationButton.classList.add("selected"),null===(e=this.titleAndContentContainer)||void 0===e||e.classList.remove("hidden")}makePageFirst(){this.parentDiv.prepend(this.titleAndContentContainer),this.sidebarContainer.prepend(this.topNavigationButton);let e=1;for(const t of this.sidebarContainer.children)if(t.classList.contains("store-gift-sidebar-button")){const s=t.querySelector(".store-gift-sidebar-order-number p");s&&(s.textContent=`${e}`),e+=1}}selectNextPage(){a.sendGiftFlowAnalytics(r.tV.SuccessfulPageCompletion),this.titleAndContentContainer.classList.add("hidden"),this.topNavigationButton.classList.remove("selected"),this.markAsCompleted(!0);const e=this.titleAndContentContainer.nextElementSibling,t=this.topNavigationButton.nextElementSibling;null==e||e.classList.remove("hidden"),null==t||t.classList.add("selected")}markAsCompleted(e){e?(this.tabOrderNumberContainer.classList.add("completed"),this.tabOrderNumber.classList.add("hidden"),this.checkmark.classList.remove("hidden")):(this.tabOrderNumberContainer.classList.remove("completed"),this.tabOrderNumber.classList.remove("hidden"),this.checkmark.classList.add("hidden"))}enableNextButton(){var e;null===(e=this.mainCTAButton)||void 0===e||e.classList.remove("disabled")}disableNextButton(){var e;null===(e=this.mainCTAButton)||void 0===e||e.classList.add("disabled")}createPageContent(){this.titleAndContentContainer=(0,n.Le)(this.parentDiv,"store-gift-page-container"),this.pageTitle=(0,n.Le)(this.titleAndContentContainer,"store-gift-page-title");const e=(0,n.zO)(this.pageTitle,i.am.LeftArrow);(0,n.G0)(e,()=>this.selectPreviousPage()),this.pageContainer=(0,n.Le)(this.titleAndContentContainer,"store-gift-page-content")}createNextButton(){const e=(0,n.Le)(this.pageContainer,"store-gift-overlay-main-cta-button");return(0,n.Wr)(e,{key:"strings:storePage.sections.giftOverlay.recipientSelection.next"},""),(0,n.G0)(e,()=>{e.classList.contains("disabled")||this.selectNextPage()}),e.classList.add("disabled"),e}createCheckoutButton(){const e=(0,n.Le)(this.pageContainer,"store-gift-overlay-main-cta-button");return(0,n.Wr)(e,{key:"strings:storePage.checkout.checkout"},""),(0,n.G0)(e,()=>{e.classList.contains("disabled")||this.checkoutAction()}),e}selectPreviousPage(){var e;const t=this.titleAndContentContainer.previousElementSibling,s=this.topNavigationButton.previousElementSibling;if(!t||!s)return null===(e=this.hideGiftOverlayAction)||void 0===e?void 0:e.call(this);this.titleAndContentContainer.classList.add("hidden"),this.topNavigationButton.classList.remove("selected"),null==t||t.classList.remove("hidden"),null==s||s.classList.add("selected")}static sendGiftFlowAnalytics(e){const t={type:r.k0.GiftingFlowAnalytic,category:r.eX.GiftMembershipOverlay,floatValue:e};o.CA.sendAnalyticEvent(t)}constructor(e,t,s,i){this.parentDiv=e,this.hideGiftOverlayAction=s,this.sidebarContainer=t,this.createSidebarButton(),this.createPageContent(),(0,n.G0)(this.topNavigationButton,()=>this.select()),this.checkoutAction=i}}},38968:(e,t,s)=>{"use strict";s.d(t,{k:()=>c});var i=s(36872),n=s(9029),r=s(46581),o=s(78134),a=(s(66935),s(84235));function c(e,t){const s=function(e){const t=a.X.getMapDataForMap(e);return null==t?void 0:t.image}(e);if(null==s)return;const c=function(e){if(o.qq.getModeDataForMode(e))switch(e){case r.p9.Classic4P:case r.p9.Classic56P:case r.p9.Classic78P:return;case r.p9.Seafarers4P:case r.p9.Seafarers56P:return i.am.GameModeSeafarers;case r.p9.CitiesAndKnights4P:case r.p9.CitiesAndKnights56P:return i.am.GameModeCnK;case r.p9.CitiesAndKnightsSeafarers4P:case r.p9.CitiesAndKnightsSeafarers56P:return i.am.GameModeCnKSeafarers;case r.p9.ColonistRush4P:return i.am.GameModeColonistRush;default:return}}(t),l=(0,n.Sw)("shuffle-queue-icon");(0,n.zO)(l,i.am.GameModeShuffle,"shuffle-queue-icon-shuffle-card");
1const d=(0,n.Le)(l,"shuffle-queue-icon-details");return(0,n.zO)(d,s,"shuffle-queue-icon-map"),null!=c&&(0,n.zO)(d,c,"shuffle-queue-icon-mode"),l}},39091:(e,t,s)=>{"use strict";e.exports=s.p+"assets/social_icon_reddit.914b5e689f1d1da1d0d4.svg"},39190:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_valentines.934b641a1f8e90232f9b.png"},39384:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_leave_room.471d70cdfe103a4afdce.mp3"},39509:(e,t,s)=>{"use strict";s.d(t,{o:()=>l});var i=s(9902),n=s(55547),r=s(36872),o=s(29249);if(/^(269|630|651|85)$/.test(s.j))var a=s(41592);var c=s(13618);function l(e){e.onInvalidPlayerCountEncountered((e,t)=>{const s={key:t?"strings:roomPage.notifications.failedToSelectPlayerCount":"strings:roomPage.notifications.invalidGameModeSelected",options:{playerCount:e}},n=t?{confirmLabel:{key:"strings:colonistCommon.buttons.store"},onConfirm:()=>(0,c.Yf)("/store#membership",!0,!0)}:{};(0,i.C)({title:{key:"strings:popups.informationView.title"},body:s,...n})}),e.onFailedToReducePlayerCount(()=>{n.OV.showNotification(r.am.Lightning,{key:"strings:roomPage.notifications.kickPlayersBeforeMakingRoomSmaller"})}),e.onFailedToStartGameBecauseServerIsUpdating(()=>{n.OV.show({key:"strings:colonistCommon.serverStatus.serverUpdating",options:{discordLink:a.T}},o.n.Information)}),e.onFailedToStartGamePlayersNotReady(e=>{n.OV.showNotification(r.am.Lightning,{key:"strings:roomPage.notifications.usersNotReadyToPlay",options:{usernames:e,count:e.length}})}),e.onFailedToSelectUsedColor(()=>{n.OV.showNotification(r.am.Lightning,{key:"strings:roomPage.notifications.colorNotAvailable"})}),e.onFailedToExecuteCommandGameStarting(()=>{n.OV.showNotification(r.am.Lightning,{key:"strings:roomPage.notifications.gameStarting"})}),e.onFailedToSetGameSpeed(()=>{n.OV.showNotification(r.am.Lightning,{key:"strings:roomPage.notifications.failedToSetGameSpeed"})})}},39588:(e,t,s)=>{"use strict";s.d(t,{K:()=>l});var i=s(46507),n=s(655),r=s(7893),o=s(72046),a=s(81888),c=s(18587);class l{mountReactSidebar(){const e=(0,o.F)("profile_sidebar",this.isPopup);this.tabsView=(0,r.y)(e,i.cf),this.renderTabs()}renderTabs(){const e=!this.isPopup&&c.r.isUserOnMobile,t={activeTabId:this.activeTabId,onTabChange:e=>this.onTabSelected(e),showFriends:!this.isPopup&&!this.hiddenTabs.has(i.F_.Friends),showSettings:!this.isPopup&&!this.hiddenTabs.has(i.F_.Settings)};e?this.tabsView.render({...t,layoutMode:"controlled",direction:"horizontal",hideText:!0}):this.tabsView.render({...t,direction:"vertical"})}hasMadeApiCall(e){return this.apiCallsMade.has(e)}markApiCallMade(e){this.apiCallsMade.add(e)}setTabVisible(e,t){t?this.hiddenTabs.delete(e):this.hiddenTabs.add(e),this.renderTabs()}showSection(e){if((e==i.F_.Friends||e==i.F_.Settings)&&!this.isCurrentUserProfile()&&(e=i.F_.Overview),this.sectionsByTabId.forEach((t,s)=>{t.classList.toggle("hidden",s!=e)}),this.activeTabId=e,this.renderTabs(),c.r.isUserOnDiscord)return;window.location.pathname.includes("/profile")&&history.replaceState(null,"",window.location.pathname+window.location.search+`#${e}`)}showSectionFromHash(){const e=window.location.hash.replace("#","");if(""==e)return!1;for(const t of this.sectionsByTabId.keys())if(t==e)return this.showSection(t),!0;return!1}setUsername(e){this.username=e}isCurrentUserProfile(){var e;return(null===(e=a._.userState)||void 0===e?void 0:e.username.toLowerCase())==decodeURIComponent(this.username.toLowerCase())}async genericApiCallWrapper(e,t,s){if(this.hasMadeApiCall(e))return;const i=await n.m.getRequestHandler(t,void 0);if(null==i)return;if(!i.isSuccess)return;s(i.json),this.markApiCallMade(e)}resetApiCalls(){this.apiCallsMade.clear()}constructor(e=!1,t="",s=()=>{}){this.activeTabId=i.F_.Overview,this.apiCallsMade=new Set,this.hiddenTabs=new Set,this.isPopup=e,this.username=t,this.onTabSelected=s;const n=new Map([[i.F_.Overview,"overview-container"],[i.F_.Ranked,"ranked-container"],[i.F_.History,"game-history-container"],[i.F_.Items,"items-container"],[i.F_.Friends,"friends-container"],[i.F_.Settings,"settings-container"]]),r=[i.F_.Overview,i.F_.Ranked,i.F_.History,i.F_.Items],a=e?r:Array.from(n.keys());this.sectionsByTabId=new Map(a.map(t=>{const s=(0,o.F)(n.get(t),e);return[t,document.getElementById(s)]})),this.mountReactSidebar()}}},39718:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_trade_back.0198349da9287ab13eb1.svg"},39853:(e,t,s)=>{"use strict";s.d(t,{AD:()=>g,W4:()=>h,xd:()=>m,yq:()=>p});var i=s(76092),n=s(36872),r=s(81888),o=s(13618),a=s(80708),c=s(5201),l=s(15055),d=s(67846);const u="purchase-success";function h(e){const t={type:i.k0.ABTestClickAnalytics,category:i.eX.ABTestClickAnalytics,floatValue:f(e)};a.CA.sendAnalyticEvent(t),c.z.captureEvent(l.x.MembershipTierClicked,{membershipType:n.Qb[e]})}function p(e){const t=(0,d.i4)(),s={type:i.k0.MembershipSubscribeClicked,category:i.eX.Store,floatValue:f(e)};null!=t&&(s.dimensions=t),a.CA.sendAnalyticEvent(s),c.z.captureEvent(l.x.MembershipSubscribeClicked,{membershipType:n.Qb[e],...t})}function m(e){const t={type:i.k0.StoreSocialProofShown,category:i.eX.Store,stringValue:e};a.CA.sendAnalyticEvent(t),c.z.captureEvent(l.x.StoreSocialProofShown,{kind:e})}function g(){let e=!1;const t=new Set;r._.registerChangeListener(s=>{if(null==s)return;const r=s.items.membership;if(null==r)return void(e=!0);const h="1"==(0,o.Ez)(u);if(!e&&!h)return;if(t.has(r))return;t.add(r);const p=(0,d.i4)(),m={type:i.k0.MembershipPurchased,category:i.eX.Store,floatValue:f(r)};null!=p&&(m.dimensions=p),a.CA.sendAnalyticEvent(m),c.z.captureEvent(l.x.MembershipSubscribed,{membershipType:n.Qb[r],...p}),null!=p&&(0,d.Mj)()})}function f(e){switch(e){case n.Qb.PlusMonthly:return i.Jd.StoreMembershipPlusMonthly;case n.Qb.PremiumMonthly:return i.Jd.StoreMembershipPremiumMonthly;case n.Qb.EliteMonthly:return i.Jd.StoreMembershipEliteMonthly;case n.Qb.PlusYearly:return i.Jd.StoreMembershipPlusYearly;case n.Qb.PremiumYearly:return i.Jd.StoreMembershipPremiumYearly;case n.Qb.EliteYearly:return i.Jd.StoreMembershipEliteYearly;case n.Qb.Holiday2023AllAccessPass:return i.Jd.StoreMembershipHoliday2023AllAccessPass}}},40279:(e,t,s)=>{"use strict";s.d(t,{l:()=>l,s:()=>r});var i=s(36872),n=s(17399);function r(e){return{totalGames:String(e.gameData.totalGames),winPercent:e.gameData.winPercent,pointsPerGame:e.gameData.pointsPerGame,karma:e.karma,pointsInLast100Games:String(e.gameData.pointsInLast100Games)}}const o="7735637",a="19719305",c=/^(251|517|837)$/.test(s.j)?null:["3208020","94451747","56604020","51304747","96441641","61890847","55031713","99019802","52067869","99218961","99247781","66028376","98791974","61751886","99200482","98719794","96620362","57772422","23034368","59201781","29049792","61557587","69054281","85
1708590","90997704","54219086","92602114","96622700","8770469","7735637","100621319","100939283","29911838","18910613","99285407","99822064","101290199","17600804","19374179","99141635","89711215","87958833","48433699","100681011","54365173","19630401","100931185","102303207","101762213","98899185","47836044","100978327","62826207","8041134","101493654","97799211","54314828","102189971"];function l(e){const t=[];return e==o&&t.push({image:(0,n.tu)(i.am.TournamentCC25),tooltipText:{key:"strings:profilePage.overview.badges.tournamentCC25Tooltip"}}),e==a&&t.push({image:(0,n.tu)(i.am.TournamentS11First),tooltipText:{key:"strings:profilePage.overview.badges.season11TournamentFirstTooltip"}}),c.includes(e)&&t.push({image:(0,n.tu)(i.am.Tournament4P),tooltipText:{key:"strings:profilePage.overview.badges.tournament4pTooltip"}}),t}},40344:(e,t,s)=>{"use strict";s.d(t,{q:()=>T});var i=s(7893),n=s(71763),r=s(46507);if(/^(269|630|651|85)$/.test(s.j))var o=s(86434);var a=s(34802);const c=()=>{const e=(0,o.P)(a.M,e=>e.rooms);return(0,n.useEffect)(()=>(a.M.getState().start(),()=>a.M.getState().stop()),[]),n.createElement(r.YQ,{games:e,onGameRowClick:e=>a.M.getState().clickRoom(e),testId:"lobby-open-rooms-table"})};var l=s(28844),d=s(655),u=s(32398),h=s(34668),p=s(13618),m=s(72239);if(/^(269|630|651|85)$/.test(s.j))var g=s(27838);var f=s(71168),y=s(93359);const v=m.R$.secondsAsMilliseconds(1),S=m.R$.secondsAsMilliseconds(30);function b({requestGames:e,spectateGame:t}){const s=new f.G;let i,n,r=!1,o=0;const a=(0,g.y)(()=>({games:[],start:()=>{r||(r=!0,n=setInterval(()=>l(),v),l())},stop:()=>{r&&(r=!1,clearInterval(n),n=void 0)},refresh:c,clickGame:e=>{t(e)}}));async function c(){if(null!=i)return i;i=async function(){o=Date.now();const t=await e();if(null==t)return;const i=s.sort(t);a.setState({games:i.map(e=>(0,y.L)(e))})}();try{await i}finally{i=void 0}}function l(){if(!r)return;Date.now()-o<S||c()}return a}const C=(0,p.BA)(async e=>{await h.Q.clickedSpectateGame(e)}),P=()=>{const e=(0,n.useMemo)(()=>b({requestGames:async()=>{const e=await d.m.getRequestHandler(u.l.apiGetGames(),void 0,void 0,!1);if(null!=e)return e.json.games},spectateGame:e=>{C(e)}}),[]),t=(0,o.P)(e,e=>e.games),s=(0,l.useWindowFocus)();(0,n.useEffect)(()=>{if(s)return e.getState().start(),()=>e.getState().stop()},[e,s]);const i=(0,n.useCallback)(()=>e.getState().refresh(),[e]);return n.createElement(r.YQ,{games:t,onGameRowClick:t=>e.getState().clickGame(t),onRefresh:i,testId:"lobby-spectate-table"})},k=({isVisible:e,activeTabId:t,onTabChange:s,onClickCreateRoom:i,onClickJoinRoom:o,onClickPlayWithFriends:a,playWithFriendsLabel:l})=>n.createElement(n.Activity,{mode:e?"visible":"hidden"},n.createElement(r.Ux,{activeTabId:t,onTabChange:s,openRoomsTab:n.createElement(c,null),spectateTab:n.createElement(P,null),onClickCreateRoom:i,onClickJoinRoom:o,onClickPlayWithFriends:a,playWithFriendsLabel:l}));class T{setCtaConfig(e){this.ctaConfig=e,this.renderView()}show(){this.setVisible(!0)}hide(){this.setVisible(!1)}openSpectateTab(){this.changeTab("spectate")}setVisible(e){this.isVisible!=e&&(this.isVisible=e,this.renderView())}renderView(){this.view.render({isVisible:this.isVisible,activeTabId:this.activeTabId,onTabChange:this.changeTab,...this.ctaConfig})}constructor(e){this.isVisible=!1,this.activeTabId="openRooms",this.changeTab=e=>{this.activeTabId!=e&&(this.activeTabId=e,this.renderView())},this.ctaConfig=e,this.view=(0,i.y)("lobby_root",k),this.renderView()}}},40625:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_mobile_app.296095858302e95b9196.png"},40972:(e,t,s)=>{"use strict";e.exports=s.p+"assets/road_orange.07bb26b8c1e63dd438c7.svg"},41051:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_gifting_easter.411c04fac4dd6c617ab6.png"},41141:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_players_ranked.9993bfe2e4b9fcdbd2a5.svg"},41157:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_metropolis_place.1be024ebfef9cda2091e.mp3"},41178:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_mummy.7990e9ab2e51f4c57a1b.svg"},41232:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_join.70f9db255b78977dcc64.png"},41398:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_monopoly_islands_preview.bd3724a5cece164dd329.png"},41611:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_rotation.656c2925f60e743646a7.svg"},41659:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_fullscreen.c89463c3dc00ebdc790b.png"},41775:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_question_mark.d0426b4cde82d6b28479.svg"},41790:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_settings.79564d9f7bfde870611f.svg"},41901:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_merchant_black.23d3085d7c9f2bc643d1.svg"},42003:(e,t,s)=>{"use strict";s.d(t,{h:()=>r});var i=s(9029),n=s(72046);class r{getSeasonDropdownElement(){const e=(0,n.F)("profile_ranked_season_dropdown",this.isPopup);return document.getElementById(e)}fetchRankedDataForLatestSeason(){const e=this.seasons[0];this.profileRankedController.currentSeason=e.seasonType,this.profileRankedController.fetchRankedDataForSelectedSeason(e.seasonType)}createDropdownOptions(){this.seasons.map(e=>{(0,i.fg)(this.seasonDropdown,e.seasonType.toString(),e.name)})}createDropdownChangeEvent(){this.seasonDropdown.onchange=()=>{const e=Number(this.seasonDropdown.value);this.profileRankedController.fetchRankedDataForSelectedSeason(e)}}constructor(e,t,s=!1){this.isPopup=s,this.seasons=e,this.seasonDropdown=this.getSeasonDropdownElement(),this.profileRankedController=t,this.fetchRankedDataForLatestSeason(),this.createDropdownOptions(),this.createDropdownChangeEvent()}}},42052:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_gift_box_dark.371df2cc9dde87c19bc3.svg"},42202:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_trade_commodity_monopoly.385f8154b2e8fab61bf5.svg"},42380:(e,t,s)=>{"use strict";s.d(t,{M4:()=>i,sb:()=>n});const i=/^(251|517|837|85)$/.test(s.j)?null:["valentines","easter","halloween","thanksgiving","christmas"];class n{static isHolidayNowAndExtendsToNewYear(e,t,s,i){return!!e.extendsToNewYear&&(t>=s||t<=i)}static isHolidayNow(e,t,s){let i=!1,n=!1;return e>=t&&(i=!0),e<=s&&(n=!0),!(!i||!n)}static getCurrentHoliday(e){const t=null!=e?e:new Date;for(const e of n.holidayDates){const s=new Date(t);s.setMonth(e.dates.start.month-1),s.setDate(e.dates.start.day);const i=new Date(t);if(i.setMonth(e.dates.end.month-1),i.setDate(e.dates.end.day),n.isHolidayNowAndExtendsToNewYear(e,t,s,i))return e.name;if(n.isHolidayNow(t,s,i))return e.name}}}n.holidayDates=[{name:"valentines",dates:{start:{month:1,day:24},end:{month:2,day:18}}},{name:"easter",dates:{start:{month:3,day:20},end:{month:4,day:30}}},{name:"halloween",dates:{start:{month:10,day:10},end:{month:11,day:5}}},{name:"thanksgiving",dates:{start:{month:11,day:6},end:{month:11,day:30}}},{name:"christmas",dates:{start:{month:12,day:1},end:{month:1,day:12}},extendsToNewYear:!0}]},42418:(e,t,s)=>{"use strict";function i(e){return"/profile/"+encodeURIComponent(e)}function n(){const e=window.location.pathname.split("/"),t=e[e.length-1];return decodeURIComponent(t)}function r(){const e=function(e){const t=new URL(e);return t.searchParams.delete("token"),t.href}(window.location.href);history.replaceState(null,"",e)}s.d(t,{Bg:()=>n,UY:()=>r,mh:()=>i})},42466:(e,t,s)=>{"use strict";s.d(t,{y:()=>n});var i=s(28844);class n{static trackPopup(e){n.activePopups.push(e)}static untrackPopup(e){n.activePopups=n.activePopups.filter(t=>t!=e)}static isPopupTracked(e){return null!=n.activePopups.find(t=>t==e)}static closeAllPopups(){n.removeActivePopups(),window.dispatchEvent(new Event(i.CLOSE_ALL_DIALOGS_EVENT))}
1static removeActivePopups(){n.activePopups.forEach(e=>{e.removePopup()})}}n.activePopups=[]},42647:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_ck_ranked.f834a96a9f9e4542715e.png"},42778:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_wall_bronze.3a964572b70d2b458c91.svg"},42827:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_rush_no_turns.eb0fe69628d238b86820.png"},42845:(e,t,s)=>{"use strict";s.d(t,{N:()=>i});class i{addData(e){if(!this.orderBroken){if(this.data.push({added:Date.now(),data:e}),this.data.length>10)return this.orderBroken=!0,void this.onSequenceError(this.lastSequence,Date.now(),`Too many pending entries: ${this.data.length}`,this.data,this.lastReleasedData);for(null==this.lastSequence&&(this.lastSequence=e.sequence-1);this.releaseNextData(););}}releaseNextData(){const e=this.data.findIndex(e=>e.data.sequence==this.lastSequence+1);if(e<0)return!1;const t=this.data[e].data;return this.lastSequence=t.sequence,this.onData(t),this.lastReleasedData.push(this.data[e])>5&&this.lastReleasedData.shift(),this.data.splice(e,1),this.data.length>0}reset(){this.lastSequence=void 0,this.orderBroken=!1,this.data.length=0,this.lastReleasedData.length=0}checkDataAge(){if(!this.orderBroken)for(const e of this.data)if(!(Date.now()-e.added<500))return this.orderBroken=!0,void this.onSequenceError(this.lastSequence,Date.now(),"Missing entry did not arrive in 500ms",this.data,this.lastReleasedData)}constructor(e,t){this.lastReleasedData=[],this.data=[],this.orderBroken=!1,this.onData=e,this.onSequenceError=t,setInterval(()=>this.checkDataAge(),500)}}},42883:(e,t,s)=>{"use strict";s.d(t,{V:()=>o});var i=s(46507),n=s(17399);const r=(0,s(11445).K)(i.y3);function o(e,t,s){r({title:e,imageUrl:(0,n.tu)(t),description:s})}},43181:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_rescardoverlimit.94289aa29992189fe66c.svg"},43451:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_red_2.c484643f7087f8dcb98d.svg"},43486:(e,t,s)=>{"use strict";s.d(t,{I:()=>M});var i=s(76092),n=s(46581);const r=[{creativeId:"internal_ad_1",loadImage:async()=>{const{default:e}=await s.e(567).then(s.t.bind(s,94978,17));return e},durationMs:13e3},{creativeId:"internal_ad_2",loadImage:async()=>{const{default:e}=await s.e(567).then(s.t.bind(s,69949,17));return e},durationMs:12600},{creativeId:"internal_ad_3",loadImage:async()=>{const{default:e}=await s.e(567).then(s.t.bind(s,82276,17));return e},durationMs:13e3},{creativeId:"rush_queue_ad",loadImage:async()=>{const{default:e}=await s.e(567).then(s.t.bind(s,94462,17));return e},durationMs:11e3},{creativeId:"colonist_rush_ad",loadImage:async()=>{const{default:e}=await s.e(567).then(s.t.bind(s,22001,17));return e},durationMs:14800,matchTypes:[n._M.ColonistRush]},{creativeId:"colonist_rush_ad_2",loadImage:async()=>{const{default:e}=await s.e(567).then(s.t.bind(s,73882,17));return e},durationMs:15e3,matchTypes:[n._M.ColonistRush]}],o={DURATION_6S:{generic:{creativeId:"generic_duration_6s",loadImage:async()=>{const{default:e}=await s.e(567).then(s.t.bind(s,26339,17));return e},durationMs:6e3},rush:{creativeId:"rush_duration_6s",loadImage:async()=>{const{default:e}=await s.e(567).then(s.t.bind(s,20276,17));return e},durationMs:6e3}},DURATION_10S:{generic:{creativeId:"generic_duration_10s",loadImage:async()=>{const{default:e}=await s.e(567).then(s.t.bind(s,22e3,17));return e},durationMs:1e4},rush:{creativeId:"rush_duration_10s",loadImage:async()=>{const{default:e}=await s.e(567).then(s.t.bind(s,23353,17));return e},durationMs:1e4}},DURATION_15S:{generic:{creativeId:"generic_duration_15s",loadImage:async()=>{const{default:e}=await s.e(567).then(s.t.bind(s,45235,17));return e},durationMs:15e3},rush:{creativeId:"rush_duration_15s",loadImage:async()=>{const{default:e}=await s.e(567).then(s.t.bind(s,22862,17));return e},durationMs:15e3}}};function a(e,t="DEFAULT"){if("DEFAULT"!=t)return function(e,t){const s=e==n._M.ColonistRush?"rush":"generic";return o[t][s]}(e,t);const s=r.filter(t=>{var s;return null===(s=t.matchTypes)||void 0===s?void 0:s.includes(e)}),i=s.length>0?s:r.filter(e=>null==e.matchTypes);return 0!=i.length?i[Math.floor(Math.random()*i.length)]:void 0}var c=s(81888),l=s(32398),d=s(655),u=s(18587);const h="INTERNAL_VIDEO_AD_DURATION",p="DEFAULT",m=new Set([p,"DURATION_6S","DURATION_10S","DURATION_15S"]);let g,f;async function y(){const e=u.r.isUserOnMobileAppOrWeb?v():p;if(null!=e)return e;null!=f||(f=async function(){const e={abTestCategory:h};try{const t=await d.m.postRequestWhenReady(l.l.apiAssignABTest(),void 0,e),s=null==t?void 0:t.json,i=null==s?void 0:s.abTestId;if(!S(i))return;return c._.abTests.INTERNAL_VIDEO_AD_DURATION=i,i}catch{return}}());const t=await f;return null!=t?(g=t,f=void 0,t):(f=void 0,p)}function v(){const e=c._.abTests.INTERNAL_VIDEO_AD_DURATION;return S(e)?e:null!=g?g:void 0}function S(e){return null!=e&&m.has(e)}var b=s(87506),C=s(13618),P=s(55547),k=s(9029),T=s(80708),A=s(67846);function R(e){const t={abVariant:e.variant,creativeId:e.ad.creativeId,durationMs:e.ad.durationMs,matchType:w(e.matchType),surface:I(e.matchType)},s={type:e.type,category:i.eX.AdsPerformance,dimensions:t};var n;null!=e.failReason&&(s.stringValue=e.failReason),((n=e.type)==i.k0.InternalVideoAdStarted||n==i.k0.InternalVideoAdStoreClicked)&&(0,A.sm)(t),T.CA.sendAnalyticEvent(s)}function w(e){switch(e){case n.Nw.RankedClassic1v1:return"rankedClassic1v1";case n.Nw.RankedClassic4P:return"rankedClassic4P";case n.Nw.RankedRush4P:return"rankedRush4P";case n._M.ColonistRush:return"colonistRushBots";default:return String(e)}}function I(e){return e==n._M.ColonistRush?"rushBots":"matchmaking"}class M{static async start(e,t){const s=a(e,await y());if(null==s)return void M.continueToGame(t);const n=null!==(r=v())&&void 0!==r?r:p;var r;try{const i=await s.loadImage();M.startGifAd({ad:s,imageUrl:i,matchType:e,variant:n,onComplete:t})}catch{R({type:i.k0.InternalVideoAdFailed,ad:s,matchType:e,variant:n,failReason:"image_load_failed"}),M.continueToGame(t)}}static startGifAd(e){const{ad:t,imageUrl:s,matchType:n,variant:r,onComplete:o}=e,a=M.createOverlay(),c=M.createImage();a.appendChild(c),document.body.appendChild(a);let l,d=!1;const u=()=>{clearTimeout(l),l=void 0}
1,h=e=>{if(d)return;d=!0,u();R({type:null==e?i.k0.InternalVideoAdCompleted:i.k0.InternalVideoAdFailed,ad:t,matchType:n,variant:r,failReason:e}),a.remove(),M.continueToGame(o)};(0,k.G0)(a,()=>{d||(d=!0,u(),R({type:i.k0.InternalVideoAdStoreClicked,ad:t,matchType:n,variant:r}),P.P_.cancelMatchmakingSearch(),a.remove(),(0,C.Yf)("/store#membership"))}),c.addEventListener("error",()=>h("image_error")),R({type:i.k0.InternalVideoAdStarted,ad:t,matchType:n,variant:r}),l=setTimeout(()=>h(),t.durationMs),c.src=s}static continueToGame(e){null==e?null!=b.O.lastRequestedQueue&&b.O.enterMatchmaker(b.O.lastRequestedQueue,!1):e()}static createOverlay(){const e=document.createElement("div");return e.classList.add("internal-video-ad-overlay"),e}static createImage(){const e=document.createElement("img");return e.alt="",e.classList.add("internal-video-ad-image"),e}}},43743:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_plus.46fff0845ed2292eb916.png"},44289:(e,t,s)=>{"use strict";s.d(t,{t:()=>u});var i=s(76092),n=s(50482),r=s(92524),o=s(81888),a=s(88225),c=s(9029),l=s(66935),d=s(29100);class u{initMembershipStatus(){var e;(null===(e=o._.userState)||void 0===e?void 0:e.items.hasMembership())?this.showMembershipTitleAndIcon():this.showNotMemberTextAndBecomeMemberCTA()}showMembershipTitleAndIcon(){var e,t,s;const i=null===(e=o._.userState)||void 0===e?void 0:e.items.getCurrentMembership();if(null==i)return;const a=n.Zt.getMembershipProduct(i.type),h=(0,c.Le)(this.membershipStatusContainer,"page-profile-settings-account-container","");(0,c.zO)(h,i.image);const p=(0,l.dN)({key:"strings:storePage.membership.body"},{title:i.title,frequency:a.billedAnnually?{key:"strings:storePage.membership.frequency.annual"}:{key:"strings:storePage.membership.frequency.monthly"}});(0,c.n8)(h,p,"","","H3");if((null===(t=o._.userState)||void 0===t?void 0:t.items.membershipPaymentMethod)==r.g5.Stripe||(null===(s=o._.userState)||void 0===s?void 0:s.items.membershipPaymentMethod)==r.g5.Discord){const e=(0,c.Le)(this.membershipStatusContainer,"page-profile-settings-account-button disconnect");(0,c.RH)(e,{key:"strings:storePage.sections.membership.action.manage"}),u.setCurrentUserClickAction(e,d.qL),this.membershipStatusContainer.appendChild(e)}}showNotMemberTextAndBecomeMemberCTA(){const e=(0,c.Wr)(this.membershipStatusContainer,{key:"strings:profilePage.settings.membership.dontHaveMemebership"},""),t=(0,c.cE)(this.membershipStatusContainer,"",{key:"strings:profilePage.settings.membership.becomeMember"},"button_cta_main");(0,c.G0)(t,d.ck,!0),this.membershipStatusContainer.appendChild(e),this.membershipStatusContainer.appendChild(t)}initAccountsSection(){u.setConnectAccountButtonAction(this.googleButton,i.sG.Google),u.setConnectAccountButtonAction(this.discordButton,i.sG.Discord),u.setConnectAccountButtonAction(this.appleButton,i.sG.Apple)}setUserLoginState(e){this.currentUserLoginState=e,this.setAccountEmailsIfAlreadyConnected()}setAccountEmailsIfAlreadyConnected(){for(const e of this.currentUserLoginState){const t={key:"strings:colonistCommon.utils.#buffer",options:{value:e.email}};switch(e.providerId){case i.sG.Google:(0,c.RH)(this.googleEmail,t),this.googleEmail.classList.remove("hidden"),u.setDisconnectAccountButtonAction(this.googleButton,i.sG.Google);break;case i.sG.Discord:(0,c.RH)(this.discordEmail,t),this.discordEmail.classList.remove("hidden"),u.setDisconnectAccountButtonAction(this.discordButton,i.sG.Discord);break;case i.sG.Apple:(0,c.RH)(this.appleEmail,t),this.appleEmail.classList.remove("hidden"),u.setDisconnectAccountButtonAction(this.appleButton,i.sG.Apple)}}}static setCurrentUserClickAction(e,t){(0,c.G0)(e,()=>{var e;const s=null===(e=o._.userState)||void 0===e?void 0:e.username;null!=s&&t(s)})}static setConnectAccountButtonAction(e,t){u.setCurrentUserClickAction(e,e=>(0,d.aO)(e,t))}static setDisconnectAccountButtonAction(e,t){u.setCurrentUserClickAction(e,e=>(0,d.g0)(e,t)),e.classList.add("disconnect"),(0,c.RH)(e,{key:"strings:profilePage.settings.accounts.disconnect"})}constructor(){this.membershipStatusContainer=document.getElementById("membership-status-container"),this.deleteAccountButton=document.getElementById("page-profile-settings-delete-account"),this.logoutButton=document.getElementById("page-profile-settings-logout"),u.setCurrentUserClickAction(this.deleteAccountButton,d.lw),this.logoutButton&&(0,c.G0)(this.logoutButton,d.ri),this.googleEmail=document.getElementById("page-profile-settings-account-email-google"),this.discordEmail=document.getElementById("page-profile-settings-account-email-discord"),this.appleEmail=document.getElementById("page-profile-settings-account-email-apple"),this.googleButton=document.getElementById("page-profile-settings-account-button-google"),this.discordButton=document.getElementById("page-profile-settings-account-button-discord"),this.appleButton=document.getElementById("page-profile-settings-account-button-apple");const e=document.getElementById("page-profile-settings-change-region");(0,c.G0)(e,()=>(0,a.A)()),this.initMembershipStatus(),this.initAccountsSection()}}},44423:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_romania_preview.0732e30a6cb0ad9aabed.png"},44517:(e,t,s)=>{"use strict";if(s.d(t,{a:()=>o,s:()=>r}),837!=s.j)var i=s(53879);class n{sendEvent(e){const t=this.STORAGE_KEY_PREFIX+r[e];localStorage.setItem(t,Date.now().toString()),localStorage.removeItem(t)}onEvent(e,t){this.eventCallbacks.set(e,t)}constructor(){this.STORAGE_KEY_PREFIX="tab_communication_event_",this.eventCallbacks=new Map,window.addEventListener("storage",e=>
1{if(!e.key)return;if(!e.key.startsWith(this.STORAGE_KEY_PREFIX))return;const t=e.key.slice(this.STORAGE_KEY_PREFIX.length),s=r[t],i=this.eventCallbacks.get(s);null==i||i()})}}var r=function(e){return e[e.ReloadWebsite=0]="ReloadWebsite",e}({});class o{static createTabCommunication(){return i.U.isAvailable()?new i.U:new n}}},44529:(e,t,s)=>{"use strict";s.d(t,{p:()=>u});var i=s(71068),n=s(52955),r=s(30040),o=s(66935),a=s(35078),c=s(36872),l=s(67908);const d=new r.s({storage:"undefined"==typeof localStorage?void 0:localStorage});var u;!function(e){const t="versionno",s="authtoken",r="careersBadgeDismissedVersion",u="mastervolume",h="ismuted",p="resolution",m="animationstatus",g="logrocket",f="keyboardshortcuts",y="lastmembershipincentivepopuptime",v="roomsettingssnapshot",S=["roomdicesetting","roomgamespeedsetting","roomfriendlyrobberactivesetting","roommodesetting","roommapsetting","roomprivategamesetting","roomhidebankcardssetting","roomnotrollssetting","roommaxplayerssetting","roomvictorypointstowinsetting","roomcarddiscardlimitsetting"],b="showportraitgameplay",C="mLoginBypassed",P="mShowAllowNotificationPopup",k="mNotificationUserId",T="mPushNotificationRequestStatus",A="mLastRequestPushNotificationTime",R="mRequestPushNotificationTimeData",w="mLastShownAllowNotificationPopup",I="mUserOrientationControllerJourneyStatus",M="mLocalizedStoreProductAndSubscriptionData",_="mLocalizedStoreProductData",E="mLastScene",D="shouldshowfeedbackform",L="lastfeedbackformdate",B="discordlinkingsuccesspopup",x="discordonlineusernamepopupshown",O="discordchangeregionincentivepopupshown",G="discordkeepplayingonwebpopupshown",F="beginnerModeLevel",U="giftMetadataId",N="userState",H="language",K="languagePreferenceSelected",W="lastselectedmodeselectorselection",V="rushbotgamecompletioncount",q="playerinfosectionuseddevsactive",Q="playerinfosectionckactive",j="playerinfosectionpiecesactive",z="rushgamesplayed",$="rushincentivepopupshowncount",Y="newSeasonPopupSeenSeasonId",Z="internalVideoAdAttribution";function J(){const e=d.get(t);return null==e?null:Number(e)}function X(){const e=d.get(u);if(null==e)return;let t=parseFloat(e);return!isNaN(t)&&(t<0&&(t=0),t>1&&(t=1),isFinite(t))?t:void 0}function ee(){return"true"===d.get(h)}function te(){const e=i.eT.Level1,t=d.get(F);return null==t?(d.set(F,e),e):Number(t)}function se(e){d.set(N,JSON.stringify(e))}function ie(){const e=d.get(z);if(null==e)return 0;const t=Number(e);return Number.isNaN(t)?0:t}function ne(){const e=d.get($);if(null==e)return 0;const t=Number(e);return Number.isNaN(t)?0:t}function re(){var e;return Number(null!==(e=d.get(V))&&void 0!==e?e:0)}e.isReactProfilePageEnabled=function(){return"true"==d.get("reactprofilepage")},e.setLogRocket=function(e){d.set(g,e)},e.getLogRocket=function(){const e=d.get(g);return null==e?null:"true"==e},e.setAuthToken=function(e){d.set(s,e)},e.getAuthToken=function(){return d.get(s)},e.setKeyboardShortcuts=function(e){d.set(f,e)},e.getKeyboardShortcuts=function(){const e=d.get(f);return null==e?null:"true"==e},e.setResolution=function(e){d.set(p,e)},e.getResolution=function(){const e=d.get(p);return null==e||isNaN(Number(e))?null:Number(e)},e.setAnimation=function(e){d.set(m,e)},e.getAnimation=function(){const e=d.get(m);return null==e?null:"true"==e},e.setVersionNo=function(e){return d.set(t,e),!0},e.getVersionNo=J,e.setMasterVolume=function(e){d.set(u,e)},e.getMasterVolume=X,e.setIsMuted=function(e){d.set(h,e)},e.getIsMuted=ee,e.getEffectiveVolume=function(){return ee()?0:X()},e.setLastMembershipIncentivePopupTime=function(e){d.set(y,e)},e.getLastMembershipIncentivePopupTime=function(){const e=d.get(y);return e?new Date(e):null},e.setRoomSettingsSnapshot=function(e){d.setJSON(v,e)},e.getRoomSettingsSnapshotRaw=function(){const e=d.getJSON(v);if(null!=e)return e;const t=function(){const e={};let t=!1;const s=e=>{const t=d.get(e);if(null==t)return;const s=Number(t);return Number.isNaN(s)?void 0:s},i=e=>{const t=d.get(e);if(null!=t)return"true"==t},n=(s,i)=>{null!=i&&(e[s]=i,t=!0)};return n("modeSetting",s("roommodesetting")),n("mapSetting",s("roommapsetting")),n("maxPlayers",s("roommaxplayerssetting")),n("privateGame",i("roomprivategamesetting")),n("hideBankCards",i("roomhidebankcardssetting")),n("noTrolls",i("roomnotrollssetting")),n("victoryPointsToWin",s("roomvictorypointstowinsetting")),n("cardDiscardLimit",s("roomcarddiscardlimitsetting")),n("diceSetting",s("roomdicesetting")),n("friendlyRobber",i("roomfriendlyrobberactivesetting")),n("gameSpeed",s("roomgamespeedsetting")),t?e:null}();if(null==t)return null;d.setJSON(v,t);for(const e of S)d.delete(e);return t},e.clearDeprecationStorage=function(){d.delete("showportraitfeedbackpopup"),d.delete("isLandscapeDeprecated"),d.delete("lastTimestampDeprecationPopupShown"),d.delete(A),d.delete("firstsessiontimestamp"),d.delete("portraitmodeenforcementaccepted")},e.shouldResetGameOrientation=function(){return null==d.get(b)},e.isPortraitGamePlayEnabled=function(){return"false"!=d.get(b)},e.setPortraitGamePlayEnabled=function(e){d.set(b,e)},e.setStatusBarHeight=function(e){d.set("device-statusBarHeight",e)},e.setSafeAreaInsetBottom=function(e){d.set("device-safeAreaInsetBottom",e)},e.getIfUserBypassedLogin=function(){return"true"==d.get(C)},e.setUserBypassedLogin=function(e){d.set(C,e)},e.setLastShownAllowNotificationPopupTime=function(e){d.set(w,e instanceof Date?e.toISOString():e)},e.setNotificationUserId=function(e){d.set(k,e)},e.getNotificationUserId=function(){return d.get(k)},e.getLastShownAllowNotificationPopupTime=function(){const e=d.get(w);return e?new Date(e):null},e.setShouldShowAllowNotificationPopup=function(e){d.set(P,e)},e.getShouldShowAllowNotificationPopup=function(){const e=d.get(P);return null==e?null:"true"==e},e.setPushNotificationRequestStatus=function(e){d.set(T,e)},e.getPushNotificationRequestStatus=function(){return"true"==d.get(T)},e.getLastRequestPushNotificationTime=function(){const e=d.get(A);return e?new Date(e):null},e.setRequestPushNotificationTimeData=function(e){d.set(R,JSON.stringify(e))},e.getRequestPushNotificationTimeData=function(){var e;return JSON.parse(null!==(e=d.get(R))&&void 0!==e?e:"{}")},e.setUserOrientationControllerJourneyStatus=function(e){d.set(I,e)},e.getUserOrientationControllerJourneyStatus=function(){return d.get(I)},e.setLocalizedStoreSubscriptionData=function(e){d.set(M,JSON.stringify(e))},e.setLocalizedStoreProductData=function(e){d.set(_,JSON.stringify(e))},e.getLocalizedStoreSubscriptionData=function(){try{var e;return JSON.parse(null!==(e=d.get(M))&&void 0!==e?e:"[]")}catch{return[]}},e.getLocalizedStoreProductData=function(){try{var e;return JSON.parse(null!==(e=d.get(_))&&void 0!==e?e:"[]")}catch{return[]}},e.setLastScene=function(e){d.set(E,e)},e.getLastScene=function(){const e=d.get(E);if(null==e)return null;const t=Number(e);return isNaN(t)?null:Object.values(a.J).includes(t)?t:null},e.clearLastScene=function(){d.delete(E)},e.removeShouldShowFeedbackForm=function(){d.delete(D)},e.setShouldShowFeedbackForm=function(e){d.set(D,e)},e.getShouldShowFeedbackForm=function(){const e=d.get(D);return null==e?null:"true"==e},e.setLastFeedbackFormDate=function(e){d.set(L,e instanceof Date?e.toISOString():e)},e.getLastFeedbackFormDate=function(){const e=d.get(L);return e?new Date(e):null},e.incrementBeginnerModeLevel=function(){const e=te();if(null==e)return;const t=e+1;(0,n._k)(t,i.eT)&&d.set(F,t)},e.decrementBeginnerModeLevel=function(){const e=te();if(null==e)return;const t=e-1;(0,n._k)(t,i.eT)&&d.set(F,t)},e.resetBeginnerModeLevel=function(){d.set(F,i.eT.Level1)},e.getBeginnerModeLevel=te,e.setDiscordAccountLinked=function(){d.set(B,!0)},e.getDiscordAccountLinked=function(){return"true"==d.get(B)},e.removeDiscordAccountLinked=function(){d.delete(B)},e.setDiscordOnlineUsernamePopupShown=function(){d.set(x,!0)},e.getDiscordOnlineUsernamePopupShown=function(){return"true"==d.get(x)},e.setDiscordChangeRegionIncentivePopupShown=function(){d.set(O,!0)},e.getDiscordChangeRegionIncentivePopupShown=function(){return"true"==d.get(O)},e.setDiscordKeepPlayingOnWebPopupShown=function(){d.set(G,!0)},e.getDiscordKeepPlayingOnWebPopupShown=function(){return"true"==d.get(G)},e.setUserState=se,e.clearUserState=function(){se({})},e.getUserState=function(){const e=d.get(N);if(null!=e)try{return JSON.parse(e)}catch{return}},e.getLanguage=function(){var e;return null!==(e=d.get(H))&&void 0!==e?e:o.F2.defaultLanguage},e.setLanguage=function(e){d.set(H,e),async function(e){if("serviceWorker"
1in navigator){var t;await navigator.serviceWorker.ready,null===(t=navigator.serviceWorker.controller)||void 0===t||t.postMessage({type:"languageChange",language:e})}}(e)},e.isLanguagePreferenceSelected=function(){return"true"==d.get(K)},e.setLanguagePreferenceSelected=function(e){d.set(K,e)},e.setGiftMetadataId=function(e){d.set(U,e)},e.getGiftMetadataId=function(){return d.get(U)},e.clearGiftMetadataId=function(){d.delete(U)},e.setLastModeSelectorSelection=function(e){d.setJSON(W,e)},e.getLastModeSelectorSelection=function(){const e=d.getJSON(W);return null==e?null:function(e){if("object"!=typeof e||null==e)return!1;const t=e;return!!c.l6.includes(t.modeId)&&function(e){if(null==e)return!0;if("object"!=typeof e)return!1;for(const[t,s]of Object.entries(e)){if(!c.l6.includes(t))return!1;if(!c.fx.includes(s))return!1}return!0}(t.variantIdByMode)}(e)?e:(d.delete(W),null)},e.setPlayerInfoSectionUsedDevsActive=function(e){d.set(q,e)},e.getPlayerInfoSectionUsedDevsActive=function(){const e=d.get(q);return null==e?null:"true"==e},e.setPlayerInfoSectionCKActive=function(e){d.set(Q,e)},e.getPlayerInfoSectionCKActive=function(){const e=d.get(Q);return null==e?null:"true"==e},e.setPlayerInfoSectionPiecesActive=function(e){d.set(j,e)},e.getPlayerInfoSectionPiecesActive=function(){const e=d.get(j);return null==e?null:"true"==e},e.setCareersBadgeDismissed=function(){const e=J();null!=e&&d.set(r,e)},e.isCareersBadgeVisible=function(){const e=d.get(r);if(null==e)return!0;const t=J();return null==t||Number(e)!=t},e.setNewSeasonPopupSeenSeasonId=function(e){d.set(Y,e)},e.getNewSeasonPopupSeenSeasonId=function(){const e=d.get(Y);if(null==e)return;const t=Number(e);return(0,n._k)(t,l.Wu)?t:void 0},e.getRushGamesPlayed=ie,e.incrementRushGamesPlayed=function(){d.set(z,ie()+1)},e.getRushIncentivePopupShownCount=ne,e.incrementRushIncentivePopupShownCount=function(){d.set($,ne()+1)},e.getRushBotGameCompletionCount=re,e.incrementRushBotGameCompletionCount=function(){d.set(V,re()+1)},e.setInternalVideoAdAttribution=function(e){d.setJSON(Z,e)},e.getInternalVideoAdAttribution=function(){return d.getJSON(Z)},e.clearInternalVideoAdAttribution=function(){d.delete(Z)}}(u||(u={}))},44845:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_sign_in.c38beffa9feae4f7b668.png"},44855:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_no_ads.77c0296a26597f73ac9c.svg"},44945:(e,t,s)=>{"use strict";e.exports=s.p+"assets/seafarers.0842252543885288e92b.svg"},44957:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_discard_notification.f8b0f8122a6973c3d615.mp3"},45023:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_2.05d31959b2838006865b.svg"},45103:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_fullscreen_contract.7af56c892561691f8505.svg"},45190:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_pirate_place.c32218267fdd6180b827.mp3"},45477:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_victory.53cd54688682aff09802.mp3"},45655:(e,t,s)=>{"use strict";s.d(t,{S:()=>i});var i=function(e){return e[e.JL1=0]="JL1",e[e.JL2=1]="JL2",e[e.JL3=2]="JL3",e[e.JL4=3]="JL4",e[e.JL5=4]="JL5",e}({})},45859:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_pirate_ship.98a1a328d29cf9ea351f.svg"},45901:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_coin.fa1ec5179bfed0886c9d.svg"},45973:(e,t,s)=>{"use strict";s.d(t,{B:()=>i});class i{}i.globalLeaderboardUrl="",i.maximumLeaderboardAPIRankingRangeLimit=100,i.emptyUsernameSearch="",i.emptyRank="-"},46169:(e,t,s)=>{"use strict";s.d(t,{d:()=>a});var i=s(46507),n=s(11445),r=s(18587);const o=(0,n.K)(i.YR);function a(e=!1){o({isTournamentRoom:e,isStoreDisabled:r.r.shouldHideStoreOnMobile})}},46456:(e,t,s)=>{"use strict";s.d(t,{y:()=>r});var i=s(72239),n=s(81888);class r{static get shuffleQueueData(){return this._shuffleQueueData}static notifyListeners(){this.changeListeners.trigger(this._shuffleQueueData,this._shufflePlayerData)}static notifyQueueUpdatedListeners(){this.queueUpdatedListeners.trigger()}static updateQueueData(e){this._shuffleQueueData=e,this.notifyListeners(),this.notifyQueueUpdatedListeners()}static updatePlayerData(e){this._shufflePlayerData=e,this.notifyListeners()}static registerChangeListener(e){return this.changeListeners.add(e,this._shuffleQueueData,this._shufflePlayerData)}static registerQueueUpdatedListener(e){return this.queueUpdatedListeners.addWithoutCallback(e)}static waitForShuffleQueueData(){var e;return null!=this._shuffleQueueData&&null!=this._shufflePlayerData?Promise.resolve(this._shuffleQueueData):(null===(e=n._.userState)||void 0===e?void 0:e.isLoggedIn)?new Promise(e=>{const t=setTimeout(()=>{s(),e(void 0)},2e3),s=this.registerChangeListener((i,n)=>{null!=i&&null!=n&&(clearTimeout(t),s(),e(i))})}):Promise.resolve(this._shuffleQueueData)}}r.changeListeners=new i.gp,r.queueUpdatedListeners=new i.gp},46581:(e,t,s)=>{"use strict";s.d(t,{bi:()=>_,R1:()=>E,K4:()=>i.K4,_M:()=>A,gO:()=>a,ZP:()=>i.ZP,um:()=>i.um,tC:()=>P,Ly:()=>i.Ly,$d:()=>c,KN:()=>I,ro:()=>i.ro,Cz:()=>i.Cz,Qy:()=>i.Qy,Nw:()=>T,p9:()=>i.p9,Ob:()=>r,Zt:()=>l,ec:()=>i.ec,w$:()=>o,LF:()=>B,lu:()=>n,tZ:()=>y,QK:()=>p,pO:()=>D,WB:()=>S,e4:()=>m,AE:()=>g,dV:()=>f,v1:()=>C,nL:()=>v,EZ:()=>b,Mg:()=>h,rr:()=>L,uj:()=>u,uh:()=>k,V1:()=>R});var i=s(36872),n=function(e){return e[e.CheatingWithAnotherPlayer=1]="CheatingWithAnotherPlayer",e[e.AbusingChat=2]="AbusingChat",e[e.InappropriateUsername=3]="InappropriateUsername",e[e.WastingTime=4]="WastingTime",e[e.Griefing=5]="Griefing",e[e.ThrowingTheGame=6]="ThrowingTheGame",e}({}),r=function(e){return e[e.City=0]="City",e[e.Settlement=1]="Settlement",e[e.Road=2]="Road",e[e.DevelopmentCard=3]="DevelopmentCard",e[e.Ship=4]="Ship",e[e.CityWall=5]="CityWall",e[e.Knight=6]="Knight",e}({}),o=function(e){return e[e.TutorialClassic=0]="TutorialClassic",e[e.Classic=1]="Classic",e[e.Seafarers=2]="Seafarers",e[e.CitiesAndKnights=3]="CitiesAndKnights",e[e.CitiesAndKnightsSeafarers=4]="CitiesAndKnightsSeafarers",e[e.Inactive=5]="Inactive",e[e.ServerStressTest=6]="ServerStressTest",e}({}),a=function(e){return e[e.Default=0]="Default",e[e.ColonistRush=1]="ColonistRush",e}({}),c=function(e){return e[e.GameChatSubmit=0]="GameChatSubmit",e[e.SkippedWelcome=1]="SkippedWelcome",e[e.ClickedDice=2]="ClickedDice",e[e.SelectedTile=3]="SelectedTile",e[e.SelectedTiles=4]="SelectedTiles",e[e.SelectedPlayer=5]="SelectedPlayer",e[e.PassedTurn=6]="PassedTurn",e[e.SelectedCards=7]="SelectedCards",e[e.SelectedCardsState=8]="SelectedCardsState",e[e.BuyDevelopmentCard=9]="BuyDevelopmentCard",e[e.WantToBuildRoad=10]="WantToBuildRoad",e[e.ConfirmBuildRoad=11]="ConfirmBuildRoad",e[e.ConfirmBuildRoadSkippingSelection=12]="ConfirmBuildRoadSkippingSelection",e[e.ConfirmRemoveRoad=13]="ConfirmRemoveRoad",e[e.WantToBuildSettlement=14]="WantToBuildSettlement",e[e.ConfirmBuildSettlement=15]="ConfirmBuildSettlement",e[e.ConfirmBuildSettlementSkippingSelection=16]="ConfirmBuildSettlementSkippingSelection",e[e.WantToBuildCity=17]="WantToBuildCity",e[e.ConfirmBuildCity=18]="ConfirmBuildCity",e[e.ConfirmBuildCitySkippingSelection=19]="ConfirmBuildCitySkippingSelection",e[e.WantToBuildShip=20]="WantToBuildShip",e[e.ConfirmBuildShip=21]="
1ConfirmBuildShip",e[e.ConfirmBuildShipSkippingSelection=22]="ConfirmBuildShipSkippingSelection",e[e.WantToMoveShip=23]="WantToMoveShip",e[e.SelectedShipToMove=24]="SelectedShipToMove",e[e.ConfirmMoveShip=25]="ConfirmMoveShip",e[e.WantToBuildCityWall=26]="WantToBuildCityWall",e[e.ConfirmBuildCityWall=27]="ConfirmBuildCityWall",e[e.ConfirmBuildCityWallSkippingSelection=28]="ConfirmBuildCityWallSkippingSelection",e[e.WantToPlaceKnight=29]="WantToPlaceKnight",e[e.ConfirmPlaceKnight=30]="ConfirmPlaceKnight",e[e.ConfirmPlaceKnightSkippingSelection=31]="ConfirmPlaceKnightSkippingSelection",e[e.WantToUpgradeKnight=32]="WantToUpgradeKnight",e[e.ConfirmUpgradeKnight=33]="ConfirmUpgradeKnight",e[e.ConfirmUpgradeKnightSkippingSelection=34]="ConfirmUpgradeKnightSkippingSelection",e[e.WantToActivateKnight=35]="WantToActivateKnight",e[e.ConfirmActivateKnight=36]="ConfirmActivateKnight",e[e.ConfirmActivateKnightSkippingSelection=37]="ConfirmActivateKnightSkippingSelection",e[e.WantToTakeKnightAction=38]="WantToTakeKnightAction",e[e.SelectKnightToTakeAction=39]="SelectKnightToTakeAction",e[e.ConfirmMoveKnight=40]="ConfirmMoveKnight",e[e.ConfirmMoveKnightOffTurn=41]="ConfirmMoveKnightOffTurn",e[e.ConfirmRemoveKnight=42]="ConfirmRemoveKnight",e[e.ConfirmCityUpgrade=43]="ConfirmCityUpgrade",e[e.ConfirmBuildMetropolis=44]="ConfirmBuildMetropolis",e[e.ConfirmPillageCity=45]="ConfirmPillageCity",e[e.ConfirmDicePair=46]="ConfirmDicePair",e[e.CancelAction=47]="CancelAction",e[e.ClickedDevelopmentCard=48]="ClickedDevelopmentCard",e[e.CreateTrade=49]="CreateTrade",e[e.UpdateTradeResponse=50]="UpdateTradeResponse",e[e.ExecuteTrade=51]="ExecuteTrade",e[e.ToggledEmbargo=52]="ToggledEmbargo",e[e.RequestActionSwap=53]="RequestActionSwap",e[e.TogglePause=54]="TogglePause",e[e.LeaveGame=55]="LeaveGame",e[e.Resign=56]="Resign",e[e.RequestSpecialBuildPhase=57]="RequestSpecialBuildPhase",e[e.CancelSpecialBuildPhase=58]="CancelSpecialBuildPhase",e[e.ClickedRematch=59]="ClickedRematch",e[e.Vote=60]="Vote",e[e.Pong=61]="Pong",e[e.RequestBeginnerHint=62]="RequestBeginnerHint",e[e.SkipWelcomeAction=63]="SkipWelcomeAction",e[e.RequestBeginnerModeLevelEnd=64]="RequestBeginnerModeLevelEnd",e[e.StressTestGracefulShutdown=65]="StressTestGracefulShutdown",e[e.SelectedInitialPlacementIndex=66]="SelectedInitialPlacementIndex",e[e.RequestGameState=67]="RequestGameState",e[e.NotifyBackendClientAutoReconnected=68]="NotifyBackendClientAutoReconnected",e[e.ReportPlayer=69]="ReportPlayer",e[e.FastReconnect=70]="FastReconnect",e}({});class l{}l.MIN_VP_TO_WIN=3,l.DEFAULT_VP_TO_WIN=10,l.MIN_CARD_DISCARD_LIMIT=5,l.DEFAULT_CARD_DISCARD_LIMIT=7,l.MAX_CARD_DISCARD_LIMIT=20,l.MIN_PLAYER_COUNT=1,l.DEFAULT_PLAYER_COUNT=4,l.MAX_PLAYER_COUNT=8,l.DEFAULT_GAME_SPEED_SETTING=i.ro.Base60s,l.DEFAULT_BOT_SPEED_SETTING=i.K4.Normal,l.DEFAULT_HIDE_BANK_CARDS=!1,l.DEFAULT_FRIENDLY_ROBBER=!1,l.DEFAULT_MODE_SETTING=i.p9.Classic4P,l.DEFAULT_EXTENSION_SETTING=i.Ly.Players4,l.DEFAULT_SCENARIO_SETTING=i.ec.None,l.DEFAULT_MAP_SETTING=i.Qy.Classic4P,l.DEFAULT_DICE_SETTING=i.ZP.Random,l.DEFAULT_KARMA_THRESHOLD=0,l.NO_TROLLS_KARMA_THRESHOLD=19;class d{}const u=s(30817).p;class h extends d{constructor(...e){super(...e),this.victoryPointType=u.Settlement,this.value=1,this.private=!1}}class p extends d{constructor(...e){super(...e),this.victoryPointType=u.City,this.value=2,this.private=!1}}class m extends d{constructor(...e){super(...e),this.victoryPointType=u.DevelopmentCardVictoryPoint,this.value=1,this.private=!0}}class g extends d{constructor(...e){super(...e),this.victoryPointType=u.LargestArmy,this.value=2,this.private=!1}}class f extends d{constructor(...e){super(...e),this.victoryPointType=u.LongestRoad,this.value=2,this.private=!1}}class y extends d{constructor(...e){super(...e),this.victoryPointType=u.Chits,this.value=1,this.private=!1}}class v extends d{constructor(...e){super(...e),this.victoryPointType=u.Metropolis,this.value=2,this.private=!1}}class S extends d{constructor(...e){super(...e),this.victoryPointType=u.DefenderOfColonist,this.value=1,this.private=!1}}class b extends d{constructor(...e){super(...e),this.victoryPointType=u.ProgressCardVictoryPoint,this.value=1,this.private=!1}}class C extends d{constructor(...e){super(...e),this.victoryPointType=u.Merchant,this.value=1,this.private=!1}}var P=function(e){return e[e.Science=4]="Science",e[e.Trade=5]="Trade",e[e.Politics=6]="Politics",e}({}),k=function(e){return e[e.DisableKarma=0]="DisableKarma",e[e.TogglePause=1]="TogglePause",e}({}),T=function(e){return e[e.RankedClassic4P=1]="RankedClassic4P",e[e.UnrankedClassic4P=2]="UnrankedClassic4P",e[e.RankedCitiesAndKnights4P=9]="RankedCitiesAndKnights4P",e[e.UnrankedClassic1v1=13]="UnrankedClassic1v1",e[e.RankedClassic1v1=15]="RankedClassic1v1",e[e.UnrankedShuffle=16]="UnrankedShuffle",e[e.RankedRush4P=17]="RankedRush4P",e}({}),A=function(e){return e.BeginnerMode="beginner-mode",e.Classic="bots-classic",e.ColonistRush="bots-colonist-rush",e}({});function R(e){return Object.values(A).includes(e)}var w=s(52955);class I{static deserialize(e){const t=new I(e.id,e.gameType);return t.channelId=e.channelId,t.privateGame=e.privateGame,t.minimumKarma=e.minimumKarma,t.eloType=e.eloType,t.modeSetting=e.modeSetting,t.mapSetting=e.mapSetting,t.victoryPointsToWin=e.victoryPointsToWin,t.karmaActive=e.karmaActive,t.cardDiscardLimit=e.cardDiscardLimit,t.maxPlayers=e.maxPlayers,t.gameSpeed=e.gameSpeed,t.botSpeed=e.botSpeed,t.hideBankCards=e.hideBankCards,t.friendlyRobber=e.friendlyRobber,t.diceSetting=e.diceSetting,t.scenarioSetting=e.scenarioSetting,t.extensionSetting=e.extensionSetting,t.gameType=e.gameType,t.playOrderSelectionActive=e.playOrderSelectionActive,t}isValidGameSettings(){for(const e of Object.keys(this))if(!this.isValidDataForAttribute(e))return!1;return!0}isNoTrollsGame(){return this.minimumKarma==l.NO_TROLLS_KARMA_THRESHOLD}toggleNoTrolls(){this.minimumKarma=this.isNoTrollsGame()?l.DEFAULT_KARMA_THRESHOLD:l.NO_TROLLS_KARMA_THRESHOLD}isValidDataForAttribute(e){if(!(e in this))return!1;const t=this[e];switch(e){case"id":case"name":return"string"==typeof t;case"channelId":return"string"==typeof t||null==t;case"privateGame":case"playOrderSelectionActive":case"karmaActive":case"hideBankCards":case"friendlyRobber":return"boolean"==typeof t;case"minimumKarma":case"victoryPointsToWin":case"cardDiscardLimit":case"maxPlayers":return"number"==typeof t;case"modeSetting":return(0,w._k)(t,i.p9);case"extensionSetting":return(0,w._k)(t,i.Ly);case"scenarioSetting":return(0,w._k)(t,i.ec);case"mapSetting":return(0,w._k)(t,i.Qy);case"diceSetting":return(0,w._k)(t,i.ZP);case"gameSpeed":return(0,w._k)(t,i.ro);case"botSpeed":return(0,w._k)(t,i.K4);case"gameType":return(0,w._k)(t,i.Cz);case"eloType":return(0,w._k)(t,i.um)}return!1}isSimilarTo(e){return this.modeSetting===e.modeSetting&&this.extensionSetting===e.extensionSetting&&this.scenarioSetting===e.scenarioSetting&&this.mapSetting===e.mapSetting&&this.diceSetting===e.diceSetting}constructor(e,t){this.minimumKarma=l.DEFAULT_KARMA_THRESHOLD,this.modeSetting=l.DEFAULT_MODE_SETTING,this.extensionSetting=l.DEFAULT_EXTENSION_SETTING,this.scenarioSetting=l.DEFAULT_SCENARIO_SETTING,this.mapSetting=l.DEFAULT_MAP_SETTING,this.diceSetting=l.DEFAULT_DICE_SETTING,this.victoryPointsToWin=l.DEFAULT_VP_TO_WIN,this.karmaActive=!0,this.cardDiscardLimit=l.DEFAULT_CARD_DISCARD_LIMIT,this.maxPlayers=l.DEFAULT_PLAYER_COUNT,this.gameSpeed=l.DEFAULT_GAME_SPEED_SETTING,this.botSpeed=l.DEFAULT_BOT_SPEED_
1SETTING,this.hideBankCards=l.DEFAULT_HIDE_BANK_CARDS,this.friendlyRobber=l.DEFAULT_FRIENDLY_ROBBER,this.id=e,this.gameType=t,this.privateGame=!1,this.playOrderSelectionActive=!1,this.eloType=i.um.Inactive}}s(72239);var M=s(5144);class _{}_.actions=[M.qy.None,M.qy.PlaceRoad,M.qy.PlaceSettlement,M.qy.PlaceCity,M.qy.PlaceShip,M.qy.PlaceCityWall,M.qy.Select2ResourcesForYearOfPlenty,M.qy.Select1ResourceForMonopoly,M.qy.SelectShipToMove,M.qy.MoveShip,M.qy.PlaceKnight,M.qy.UpgradeKnight,M.qy.ActivateKnight,M.qy.SelectKnightToTakeAction,M.qy.SelectKnightAction,M.qy.SelectPlayerForDeserter,M.qy.MasterMerchantSelectPlayer,M.qy.MerchantFleetSelectResource,M.qy.SelectTileProductionNumbersToSwap,M.qy.SpySelectPlayer,M.qy.CommodityMonopolySelectResource,M.qy.ResourceMonopolySelectResource];var E=function(e){return e[e.BotEasy=0]="BotEasy",e[e.BotMedium=1]="BotMedium",e[e.BotHard=2]="BotHard",e}({});class D{static getVictoryPointByType(e){return"string"==typeof e&&(e=parseInt(e,10)),this.typeToData.get(e)}}D.victoryPointDataList=[new h,new p,new m,new g,new f,new y,new v,new S,new b,new C],D.typeToData=new Map(D.victoryPointDataList.map(e=>[e.victoryPointType,e]));class L{static totalPublicVictoryPoints(e){let t=0;for(const[s,i]of Object.entries(e)){const e=D.getVictoryPointByType(Number(s));null!=e&&(e.private||(t+=e.value*i))}return t}static totalPrivateVictoryPoints(e){let t=0;for(const[s,i]of Object.entries(e)){const e=D.getVictoryPointByType(Number(s));null!=e&&(t+=e.value*i)}return t}static totalVictoryPointsOfType(e,t){let s=0;for(const n of t){if(null==e[n])continue;const t=D.getVictoryPointByType(n);var i;if(null!=t)s+=(null!==(i=e[n])&&void 0!==i?i:0)*t.value}return s}}class B{static getNonEmbargoedPlayersForPlayer(e,t){const s=[],i=Object.keys(e).map(e=>Number(e)),n=this.getActiveEmbargoesForPlayer(e,t);for(const e of i)e!=t&&(n.includes(e)||s.push(e));return s}static getActiveEmbargoesForPlayer(e,t){var s,i;return null!==(i=null===(s=e[t])||void 0===s?void 0:s.activeEmbargosAgainst)&&void 0!==i?i:[]}static didPlayerEmbargoAllOtherPlayers(e,t){const s=Object.keys(e).map(e=>Number(e)).length;return 1!=s&&this.getActiveEmbargoesForPlayer(e,t).length==s-1}static didEveryoneEmbargoPlayer(e,t){const s=Object.keys(e).map(e=>Number(e));for(const i of s)if(i!=t&&!this.doesPlayer1HaveAnEmbargoAgainstPlayer2(e,i,t))return!1;return!0}static doesPlayer1HaveAnEmbargoAgainstPlayer2(e,t,s){return this.getActiveEmbargoesForPlayer(e,t).includes(s)}}},46702:(e,t,s)=>{"use strict";e.exports=s.p+"assets/rush_rules_placeholder.34c106bb96ad161cedd7.png"},46771:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_merchant_mysticblue.a88c6fc56f06796a9255.svg"},46903:(e,t,s)=>{"use strict";s.d(t,{p:()=>i});class i{}},46995:(e,t,s)=>{"use strict";e.exports=s.p+"assets/cities_and_knights.b88f54dbb5ad30f46de7.svg"},47177:(e,t,s)=>{"use strict";if(s.d(t,{r:()=>n}),!/^(251|517|837)$/.test(s.j))var i=s(5144);class n{get currentState(){return this._currentState}get currentTurnPlayers(){var e,t;return null!==(t=null===(e=this._experimentalCurrentState)||void 0===e?void 0:e.currentTurnPlayers)&&void 0!==t?t:[this._currentState.currentTurnPlayerColor]}get nextPlayerToMoveRobber(){var e,t;return null!==(t=null===(e=this._mechanicRobberColonistRushState)||void 0===e?void 0:e.playerToMoveRobberOnNextSevenRoll)&&void 0!==t?t:void 0}get currentActivePlayers(){if(this._mechanicTurnColonistRushState){const e=this.currentTurnPlayers.filter(e=>this.getPlayerActionState(e)==i.qy.SelectCardsToDiscard);if(e.length>0)return e;const t=this.playersToggledEndTurn;return this.currentTurnPlayers.filter(e=>!t.includes(e))}return this.currentTurnPlayers}get playersToggledEndTurn(){var e;const t=null===(e=this._mechanicTurnColonistRushState)||void 0===e?void 0:e.playersToggledEndTurn;return null==t?[]:Object.keys(t).map(e=>parseInt(e,10))}getPlayerActionState(e){var t,s,i;return null!==(i=null===(s=this._playerStates)||void 0===s||null===(t=s[e])||void 0===t?void 0:t.actionState)&&void 0!==i?i:this._currentState.actionState}hasPlayerToggledEndTurn(e){return this.playersToggledEndTurn.includes(e)}isSomePlayerInActionState(e){return this._playerColors.some(t=>this.getPlayerActionState(t)===e)}areAllPlayersInActionState(e){return this._playerColors.every(t=>this.getPlayerActionState(t)===e)}getPlayersInActionState(e){return this._playerColors.filter(t=>this.getPlayerActionState(t)===e)}isOpponentInKnightBlockingState(e){const t=[i.qy.PlaceRobberOrPirate,i.qy.PlaceRobberOnly,i.qy.PlacePirateOnly,i.qy.SelectWhoToRob];return this._playerColors.some(s=>s!==e&&t.includes(this.getPlayerActionState(s)))}constructor(e,t,s,i,n,r){this._currentState=e,this._experimentalCurrentState=t,this._mechanicTurnColonistRushState=s,this._mechanicRobberColonistRushState=r,this._playerStates=i,this._playerColors=n}}},47538:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_inactive_green.b7621bd6217a3b877b7e.svg"},47563:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_chat.fc7ab020f8054b3ee525.svg"},47609:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_merchant_red.772a79b33afee4832755.svg"},47782:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_book.74e42a5caf5ecc35edc2.svg"},47871:(e,t,s)=>{"use strict";s.d(t,{P:()=>r});var i=s(655),n=s(32398);class r{static async setUserReferrer(e,t,s){const r={referredByDiscordUserId:e,referredByUserId:t,referralTypeId:s};
1await i.m.postRequestWhenReady(n.l.apiSetUserReferrer(),void 0,r)}}},48266:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_merchant_purple.c46c2a829736cedeb5d9.svg"},48295:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_2x.89e523f2ff9783bb992b.svg"},48376:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ship_bronze_north_west.7d4b03aa15de6feda84f.svg"},48498:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_wall_pink.faf96df6cfa36a3c8146.svg"},48613:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_wall_silver.396d32811ce73c2cc28e.svg"},48679:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_rush_10_min.bd11347ef8eea49d2dd6.svg"},48716:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_arrow.b8e6ce7b0ed07009bbc7.svg"},48834:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_1x.2842c0ae586852304677.svg"},49265:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_4.ec56593699eed0f02856.svg"},49937:(e,t,s)=>{"use strict";s.d(t,{N:()=>l});class i{}i.PROBABILITY_OF_SHOWING_FEEDBACK_FORM=.1,i.DAYS_BETWEEN_FEEDBACK_FORMS=90;var n=s(72239),r=s(44529),o=s(32398),a=s(655),c=s(81888);class l{static async fetchShouldShowFeedbackForm(){if(null==c._.userState)return;if(!this.haveEnoughDaysPassedSinceLastFeedbackForm())return;if(null!=r.p.getShouldShowFeedbackForm())return;const e=await a.m.getRequestHandler(o.l.apiFeedbackFormShow(),void 0);if(null==e)return void r.p.setShouldShowFeedbackForm(!1);const t=e.json;r.p.setShouldShowFeedbackForm(t.shouldShow),null!=t.lastShown&&r.p.setLastFeedbackFormDate(t.lastShown)}static shouldShowFeedbackForm(){if(!this.haveEnoughDaysPassedSinceLastFeedbackForm())return!1;const e=r.p.getShouldShowFeedbackForm();return null!=e&&(r.p.removeShouldShowFeedbackForm(),e)}static haveEnoughDaysPassedSinceLastFeedbackForm(){const e=r.p.getLastFeedbackFormDate();if(null!=e){if(n.Re.absoluteDifferenceInDays(e,new Date)<i.DAYS_BETWEEN_FEEDBACK_FORMS)return!1}return!0}}},50049:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_arrow_out.4566392ae0cd5cd0e812.svg"},50200:(e,t,s)=>{"use strict";if(s.d(t,{c:()=>P}),517!=s.j)var i=s(97585);var n=s(28844);if(517!=s.j)var r=s(27838);var o=s(18587),a=s(9029),c=s(81888),l=s(66873);if(517!=s.j)var d=s(87069);const u="Init";var h,p,m,g;const f={modeSelectorBottom:null!==(h=o.r.vliModeSelector728x90)&&void 0!==h?h:"",inGameLeft:null!==(p=o.r.vliInGameLeft)&&void 0!==p?p:"",inGameRight:null!==(m=o.r.vliInGameRight)&&void 0!==m?m:"",inGameBottom:null!==(g=o.r.vliInGameBottom)&&void 0!==g?g:""};let y=!1;const v=()=>{y||(y=!0,(0,d.O)(()=>{const e=(0,l.C)();e.isAdPlatformAvailable&&e.canUserSeeAds&&((0,a.fc)(document.body,o.r.vliPublicKey),(0,a.fc)(document.body,o.r.vliAdvKey))}))},S=e=>{var t;const s=()=>{var t,s;null===(s=window.viAPItag)||void 0===s||null===(t=s.display)||void 0===t||t.call(s,e)};if(null!=(null===(t=window.viAPItag)||void 0===t?void 0:t.display))return void s();const i=window.vitag;null!=i&&(Array.isArray(i[u])||(i[u]=[]),i[u].push(s))},b=e=>{if(e)return[];const t=(0,l.C)();if(!t.canUserSeeAds)return[];const s=Object.keys(n.EXTERNAL_AD_DEFINITIONS),i=[];for(const e of s){if(n.EXTERNAL_AD_DEFINITIONS[e].isLobbyAd&&!t.canUserSeeLobbyAds)continue;if(!t.isAdPlatformAvailable){i.push({slot:e});continue}const s=f[e];""!=s&&i.push({slot:e,slotId:s})}return i};let C;const P=()=>(null!=C||(C=k()),C),k=()=>{let e=!1;const t=(0,r.y)((t,s)=>({eligibleAds:b(e),ensureInitialized:v,display:S,setAdblockActive:n=>{e=n;const r=b(e);(0,i.A)(s().eligibleAds,r)||t({eligibleAds:r})}}));return c._.registerChangeListener(()=>{const s=b(e);(0,i.A)(t.getState().eligibleAds,s)||t.setState({eligibleAds:s})}),t}},50276:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_silver.26273336eca9379b82f4.svg"},50482:(e,t,s)=>{"use strict";s.d(t,{FN:()=>g,Io:()=>m,WM:()=>h,Z5:()=>l,Zt:()=>f,a8:()=>a,ky:()=>d,s9:()=>p,vN:()=>u});var i=s(66935),n=s(36872),r=s(92524),o=s(22030),a=function(e){return e.EliteYearly="elite_yearly_gift",e.EliteMonthly="elite_monthly_gift",e.PremiumYearly="premium_yearly_gift",e.PremiumMonthly="premium_monthly_gift",e.PlusYearly="plus_yearly_gift",e.PlusMonthly="plus_monthly_gift",e}({});class c{}class l extends c{constructor(...e){super(...e),this.type=o.gr.AllMaps,this.description={key:"strings:storePage.sections.membership.perks.allMaps"},this.imageUrl=n.am.CheckMark}}class d extends c{constructor(...e){super(...e),this.type=o.gr.AllExpansions,this.description={key:"strings:storePage.sections.membership.perks.allExpansions"},this.imageUrl=n.am.CheckMark}}class u extends c{constructor(...e){super(...e),this.type=o.gr.PremiumMatchmaking,this.description={key:"strings:storePage.sections.membership.perks.premiumMatchmaking.t
1itle"},this.imageUrl=n.am.CheckMark}}class h extends c{constructor(...e){super(...e),this.type=o.gr.NoAds,this.description={key:"strings:storePage.sections.membership.perks.noAdsAndFullScreen"},this.imageUrl=n.am.CheckMark}}class p extends c{constructor(...e){super(...e),this.type=o.gr.AllColors,this.description={key:"strings:storePage.sections.membership.perks.allColors"},this.imageUrl=n.am.CheckMark}}class m extends c{constructor(...e){super(...e),this.type=o.gr.BasicReplay,this.description={key:"strings:storePage.sections.membership.perks.basicReplay"},this.imageUrl=n.am.CheckMark}}class g extends c{constructor(...e){super(...e),this.type=o.gr.FullReplay,this.description={key:"strings:storePage.sections.membership.perks.fullReplay"},this.imageUrl=n.am.CheckMark}}class f{getProductName(){const e={title:this.membershipTitle,frequency:this.getFrequencyTranslation()};return(0,i.dN)({key:"strings:storePage.membership.body"},e)}getFrequencyTranslation(){return{key:this.billedAnnually?"strings:storePage.membership.frequency.annual":"strings:storePage.membership.frequency.monthly"}}getDefaultPrice(){return""+this.price/100}getAnnualPrice(){return""+12*this.price/100}static getBaseAnnualPriceOfAnnualMembership(e){switch(e){case n.Qb.PlusYearly:return f.getMembershipProduct(n.Qb.PlusMonthly).getAnnualPrice();case n.Qb.PremiumYearly:return f.getMembershipProduct(n.Qb.PremiumMonthly).getAnnualPrice();case n.Qb.EliteYearly:return f.getMembershipProduct(n.Qb.EliteMonthly).getAnnualPrice();default:return}}static getMonthlyPriceOfAnnualMembership(e){switch(e){case n.Qb.PlusYearly:return f.getMembershipProduct(n.Qb.PlusMonthly).getDefaultPrice();case n.Qb.PremiumYearly:return f.getMembershipProduct(n.Qb.PremiumMonthly).getDefaultPrice();case n.Qb.EliteYearly:return f.getMembershipProduct(n.Qb.EliteMonthly).getDefaultPrice();default:return}}static getMonthlyProductOfAnnualMembership(e){switch(e){case n.Qb.PlusYearly:return f.getMembershipProduct(n.Qb.PlusMonthly);case n.Qb.PremiumYearly:return f.getMembershipProduct(n.Qb.PremiumMonthly);case n.Qb.EliteYearly:return f.getMembershipProduct(n.Qb.EliteMonthly);default:return}}static isAnnualMembership(e){switch(e){case n.Qb.PlusYearly:case n.Qb.PremiumYearly:case n.Qb.EliteYearly:return!0;default:return!1}}static getAllMembershipProducts(){return Array.from(this.products.values()).filter(e=>null==e.oneTimePurchaseType)}static getMembershipProduct(e){return this.products.get(e)}static initProducts(e){const t=new f({type:n.Qb.Holiday2023AllAccessPass,price:699,discordSKUId:e.passAllAccessHoliday2023,mobileIAPSKUId:"all_access_pass_holiday_2023",membershipTitle:{key:"strings:storePage.membership.title.holiday2023"},membershipColor:"membership_type_holiday_2023",lobbyImage:n.am.StoreMembershipHoliday2023,perks:[new h,new u,new d,new l],billedAnnually:!1,bestValue:!1,discount:0,isActive:()=>!1});t.oneTimePurchaseType=n.IM.Holiday2023AllAccessPass,this.products.set(n.Qb.Holiday2023AllAccessPass,t),this.products.set(n.Qb.PlusMonthly,new f({type:n.Qb.PlusMonthly,price:899,discordSKUId:e.membershipPlusMonthly,mobileIAPSKUId:"plus_monthly",membershipTitle:{key:"strings:storePage.membership.title.plus"},membershipColor:"membership_type1",lobbyImage:n.am.StoreMembershipPlus,perks:[new h,new u,new m],billedAnnually:!1,bestValue:!1,discount:0,isActive:()=>!0})),this.products.set(n.Qb.PremiumMonthly,new f({type:n.Qb.PremiumMonthly,price:1899,discordSKUId:e.membershipPremiumMonthly,mobileIAPSKUId:"premium_monthly",membershipTitle:{key:"strings:storePage.membership.title.premium"},membershipColor:"membership_type2",lobbyImage:n.am.StoreMembershipPremium,perks:[new h,new u,new g,new d,new l],billedAnnually:!1,bestValue:!0,discount:0,isActive:()=>!0})),this.products.set(n.Qb.EliteMonthly,new f({type:n.Qb.EliteMonthly,price:2499,discordSKUId:e.membershipEliteMonthly,mobileIAPSKUId:"elite_monthly",membershipTitle:{key:"strings:storePage.membership.title.elite"},membershipColor:"membership_type3",lobbyImage:n.am.StoreMembershipElite,perks:[new h,new u,new g,new d,new l,new p],billedAnnually:!1,bestValue:!1,discount:0,isActive:()=>!0})),this.products.set(n.Qb.PlusYearly,new f({type:n.Qb.PlusYearly,price:699,discordSKUId:e.membershipPlusYearly,mobileIAPSKUId:"plus_yearly",membershipTitle:{key:"strings:storePage.membership.title.plus"},membershipColor:"membership_type1",lobbyImage:n.am.StoreMembershipPlus,perks:[new h,new u,new m],billedAnnually:!0,bestValue:!1,discount:24,isActive:()=>!0})),this.products.set(n.Qb.PremiumYearly,new f({type:n.Qb.PremiumYearly,price:1499,discordSKUId:e.membershipPremiumYearly,mobileIAPSKUId:"premium_yearly",membershipTitle:{key:"strings:storePage.membership.title.premium"},membershipColor:"membership_type2",lobbyImage:n.am.StoreMembershipPremium,perks:[new h,new u,new g,new d,new l],billedAnnually:!0,bestValue:!0,discount:48,isActive:()=>!0})),this.products.set(n.Qb.EliteYearly,new f({type:n.Qb.EliteYearly,price:1999,discordSKUId:e.membershipEliteYearly,mobileIAPSKUId:"elite_yearly",membershipTitle:{key:"strings:storePage.membership.title.elite"},membershipColor:"membership_type3",lobbyImage:n.am.StoreMembershipElite,perks:[new h,new u,new g,new d,new l,new p],billedAnnually:!0,bestValue:!1,discount:60,isActive:()=>!0}))}constructor(e){this.storeProductType=r.l6.Membership,this.stripeCheckoutType=r.hg.Subscription,this.itemQuantity=1,this.oneTimePurchaseType=void 0,Object.assign(this,e)}}f.products=new Map},50506:(e,t,s)=>{"use strict";s.d(t,{k:()=>f});var i=s(72239),n=s(9127),r=s(9029),o=s(55853),a=s(13359),c=s(18587),l=s(76092),d=s(80708);class u{createFriendContainer(e,t,s,i){const n=(0,r.Le)(e,"room_friend_container");c.r.isUserOnDiscordMobile&&n.classList.add("discord_mobile"),this.container=n;const o=(0,r.Le)(n,"room_friend_info"),a=(0,r.Le)(n,"btn_invite_friend btn_general");(0,r.i5)(a,"btn_invite_friend_text",{key:"strings:roomPage.invite"});const l=(0,r.Le)(o,"room_friend_user");this.inviteButton=a,(0,r.G0)(this.inviteButton,()=>this.onInviteButtonClick()),(0,r.zO)(l,i);const d=(0,r.Le)(l,"room_friend_username_and_status"),u={key:"strings:colonistCommon.utils.#buffer",options:{value:t}};(0,r.i5)(d,"room_friend_username",u);const h=this.getTextAndClassNameForOnlineStatus(s),p={key:"strings:colonistCommon.utils.#buffer",options:{value:h.textStatus}};this.statusText=(0,r.i5)(d,"room_friend_status_text",p),this.statusText.classList.add(h.className),this.onlineStatus=s}getTextAndClassNameForOnlineStatus(e){switch(e){case n.WA.OnlineAndIdle:return{textStatus:"Online",className:this.statusTextClassNames[0]};case n.WA.InRoom:return{textStatus:"In room",className:this.statusTextClassNames[1]};case n.WA.InGame:return{textStatus:"In game",className:this.statusTextClassNames[2]};default:return{textStatus:"Offline",className:this.statusTextClassNames[3]}}}onInviteButtonClick(){if(this.invitingDisabled)return;const e=a.q.getRoomIdFromUrl();if(!e)return;o.Y.inviteFriendToRoom(this.userId,e);const t={type:l.k0.ClickedInviteFriendButton,category:l.eX.Room,stringValue:e};d.CA.sendAnalyticEventsWithMobileDimensions(t)}disableInviteButton(){this.inviteButton.classList.add("btn_invite_friend_clicked"),(0,r.RH)(this.inviteButton,{key:"strings:colonistCommon.utils.emptyString"}),(0,r.i5)(this.inviteButton,"btn_invite_friend_text",{key:"strings:roomPage.invited"}),this.invitingDisabled=!0}enableInviteButton(){this.invitingDisabled&&(this.inviteButton.classList.remove("btn_invite_friend_clicked"),this.invitingDisabled=!1,(0,r.RH)(this.inviteButton,{key:"strings:colonistCommon.utils.emptyString"}),(0,r.i5)(this.inviteButton,"btn_invite_friend_text",{key:"strings:roomPage.invite"}))}getUserId(){return this.userId}updateOnlineStatus(e){const t=this.getTextAndClassNameForOnlineStatus(e);this.statusText.innerText=t.textStatus,this.statusText.classList.remove(...this.statusTextClassNames),this.statusText.classList.add(t.className),this.onlineStatus=e}remove(){this.container.remove()}getOnlineStatus(){return this.onlineStatus}getContainer(){return this.container}constructor(e,t,s,i,n){this.invitingDisabled=!1,this.statusTextClassNames=["room_friend_status_online","room_friend_status_in_room","room_friend_status_in_game","room_friend_status_offline"],this.createFriendContainer(e,t,s,i),this.userId=n}}var h=s(70908),p=s(76349),m=s(81888),g=s(51309);class f{setRoomId(e){}updateRoomState(e){this.removeFriendsInSameRoom(e.getUserIds()),this.isRoomFull=e.getSessionCount()>=e.gameSetting.maxPlayers,this.updateFriendsList(this.friendList)}removeFriendsInSameRoom(e){for(const t of this.friendViews){e.includes(t.getUserId())&&this.removeFriendView(t)}this.usersInRoom=e}updateAllFriendCount(){var e;if(!(null===(e=m._.userState)||void 0===e?void 0:e.isLoggedIn))return this.allFriendCount=0,void this.updateHeaderView(0);this.allFriendCount=p.v.state.friends.length;const t=this.friendList.filter(e=>e.onlineStatus!=n.WA.Offline).length;this.updateHeaderView(t)}showFriendListUI(){var e,t;this.friendPlayerList.classList.add("shorten"),this.friendListContainer.classList.remove("hidden"),this.friendHeader.classList.remove("hidden");const s=!(null===(e=m._.userState)||void 0===e?void 0:e.isLoggedIn);if(null===(t=this.friendListContainer.querySelector(".room_friend_container"))||void 0===t||t.remove(),this.emptyFriendMessage=void 0,s)return this.createLoginToAddFriendsMessage();this.toggleEmptyFriendMessage(!0)}updateHeaderView(e){const t=h.a7.t("strings:roomPage.friendsCount",{count:e,maxCount:this.allFriendCount});this.friendHeader.innerText!=t&&(this.friendHeader.innerText=t)}updateFriendsList(e){var t;if(!(null===(t=m._.userState)||void 0===t?void 0:t.isLoggedIn))return;this.friendList=e;for(const e of this.friendViews)e.remove();if(this.friendViews.length=0,this.isRoomFull)return this.toggleRoomFullMessage(!0);const s=e.filter(e=>
1!this.usersInRoom.includes(e.userId));if(0==s.length)return this.toggleEmptyFriendMessage(!0);for(const e of s)this.addFriendView(e)}updateFriendOnlineStatus(e){const t=this.friendViews.find(t=>t.getUserId()==e.userId),s=e.onlineStatus==n.WA.Offline,i=!t;if(this.deleteRemovalTimeout(e.userId),i&&!s)return this.addFriendView(e);if(!i){if(s)return this.removeFriendViewWithDelay(t,e.userId);t.updateOnlineStatus(e.onlineStatus),this.sortFriendsListByOnlineStatus()}}addFriendView(e){if(this.usersInRoom.includes(e.userId))return;const t=new u(this.friendListContainer,e.username,e.onlineStatus,e.icon,e.userId);this.friendViews.push(t),this.toggleEmptyFriendMessage(!1),this.toggleRoomFullMessage(!1),this.updateHeaderView(this.friendViews.length),this.sortFriendsListByOnlineStatus()}removeFriendView(e){i.lv.removeElementFromArray(this.friendViews,e),e.remove(),0==this.friendViews.length&&this.toggleEmptyFriendMessage(!0),this.updateHeaderView(this.friendViews.length)}createEmptyFriendMessage(){const e=(0,r.Le)(this.friendListContainer,"room_friend_container"),t=(0,r.Le)(e,"room_friend_empty_message_container");(0,r.i5)(t,"room_friend_empty_message_text",{key:"strings:roomPage.noFriendsOnline"}),this.emptyFriendMessage=e}createLoginToAddFriendsMessage(){const e=(0,r.Le)(this.friendListContainer,"room_friend_container"),t=(0,r.Le)(e,"room_friend_empty_message_container room_friend_empty_message_container_login");(0,r.i5)(t,"room_friend_empty_message_text",{key:"strings:profilePage.friends.loginToAddFriends"}),(0,r.G0)(t,()=>{new g.L})}toggleEmptyFriendMessage(e){e&&this.toggleRoomFullMessage(!1),null==this.emptyFriendMessage?0!=e&&this.createEmptyFriendMessage():this.emptyFriendMessage.classList.toggle("hidden",!e)}toggleRoomFullMessage(e){e&&this.toggleEmptyFriendMessage(!1),null==this.roomFullMessage?0!=e&&this.createRoomFullMessage():this.roomFullMessage.classList.toggle("hidden",!e)}createRoomFullMessage(){const e=(0,r.Le)(this.friendListContainer,"room_friend_container");(0,r.i5)(e,"room_friend_empty_message_text",{key:"strings:roomPage.roomFull"}),this.roomFullMessage=e}toggleFriendInviteButtonState(e,t){const s=this.friendViews.find(t=>t.getUserId()==e);null!=s&&(t?s.enableInviteButton():s.disableInviteButton())}sortFriendsListByOnlineStatus(){this.friendViews.sort((e,t)=>e.getOnlineStatus()-t.getOnlineStatus());for(const e of this.friendViews)this.friendListContainer.removeChild(e.getContainer());for(const e of this.friendViews)this.friendListContainer.appendChild(e.getContainer())}removeFriendViewWithDelay(e,t){const s=setTimeout(()=>this.removeFriendView(e),this.FRIEND_REMOVAL_DELAY_MS);this.removalTimeouts.set(t,s)}deleteRemovalTimeout(e){const t=this.removalTimeouts.get(e);null!=t&&(this.removalTimeouts.delete(e),clearTimeout(t))}animateInviteFriendsButton(){}constructor(e,t,s){this.friendViews=[],this.removalTimeouts=new Map,this.FRIEND_REMOVAL_DELAY_MS=1e3,this.usersInRoom=[],this.friendList=[],this.isRoomFull=!1,this.friendListContainer=e,this.friendHeader=t,this.friendPlayerList=s,m._.registerChangeListener(()=>{this.showFriendListUI(),p.v.state.loadFriends(m._.userState)}),p.v.state.registerChangeListener(()=>{this.updateAllFriendCount()})}}},50517:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_profile_items.b443a1a428459b1d29b7.svg"},51099:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_profile_ranked.3cbd24ce47c7f8560528.png"},51238:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_thanksgiving.8c3912231313bd856c15.png"},51255:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_swords.be3d92632519cbdf2d33.svg"},51309:(e,t,s)=>{"use strict";s.d(t,{L:()=>S});var i=s(95176),n=s(9029),r=s(36872),o=s(32398),a=s(80708),c=s(13618),l=s(44529),d=s(16611),u=s(81888),h=s(32223),p=s(76092),m=s(71161);const g=s.p+"assets/landing_page_background_overlay_mobile.d68b902812559340b0ba.png";var f=s(9440),y=s(2451);const v=[{image:r.am.IconSwords,textKey:"strings:popups.login.features.playRanked"},{image:r.am.Memberships,textKey:"strings:popups.login.features.trackProgress"},{image:r.am.Avatars,textKey:"strings:popups.login.features.challengeFriends"}];class S extends i.y{createLoginButtons(){var e;S.createLoginProviderButtons(this.loginButtonsDiv,this.callbackHash,this.popupSource),this.ssoMode?this.onCancel&&S.createCancelButton(this.loginButtonsDiv,this.onCancel):(null===(e=u._.userState)||void 0===e?void 0:e.isLoggedIn)||S.createContinueAsGuestButton(this.loginButtonsDiv,this,this.popupSource)}static buildLoginPopupBody(e,t){e.contentContainer.classList.add("popup-login"),e.body.className="popup-login-body",(0,n.WL)(e.body,g,{key:"strings:colonistCommon.utils.emptyString"},"popup-login-background-overlay"),(0,n.WL)(e.body,m,{key:"strings:colonistCommon.utils.emptyString"},"login-logo");const s=(null==t?void 0:t.ssoMode)?"strings:popups.login.noltSsoMessage":"strings:popups.login.tagline";if((0,n.i5)(e.body,"login-tagline",{key:s}),!(null==t?void 0:t.ssoMode)){const t=(0,n.Le)(e.body,"login-features");for(const e of v){const s=(0,n.Le)(t,"login-feature-item");(0,n.zO)(s,e.image),(0,n.i5)(s,"",{key:e.textKey})}}return(0,n.Le)(e.body,"popup-login-wrapper")}static createContinueAsGuestButton(e,t,s){const i=(0,n.Le)(e,"popup-login-btn popup-login-continue-btn");(0,n.i5)(i,"popup-login-continue-btn-text",{key:"strings:popups.login.continueAsGuest"}),(0,n.G0)(i,()=>{d.A9.play(d.hc.Click),null!=s&&(0,h.C2)(s),t.removePopup()})}static createCancelButton(e,t){const s=(0,n.Le)(e,"popup-login-btn popup-login-continue-btn");(0,n.i5)(s,"popup-login-continue-btn-text",{key:"strings:colonistCommon.buttons.cancel"}),(0,n.G0)(s,()=>{d.A9.play(d.hc.Click),t()})}static createLoginProviderButtons(e,t,s){const i=(0,n.Le)(e,"popup-login-btn login-btn-provider");(0,n.WL)(i,f,{key:"strings:colonistCommon.utils.emptyString"},"google-icon"),(0,n.i5)(i,"",{key:"strings:popups.login.continueWith",options:{context:"google"}});const a=(0,n.Le)(e,"popup-login-btn login-btn-provider");(0,n.WL)(a,y,{key:"strings:colonistCommon.utils.emptyString"},"discord-icon"),(0,n.i5)(a,"",{key:"strings:popups.login.continueWith",options:{context:"discord"}});const c=(0,n.Le)(e,"popup-login-btn login-btn-provider");(0,n.zO)(c,r.am.AppleIcon),(0,n.i5)(c,"",{key:"strings:popups.login.continueWith",options:{context:"apple"}}),(0,n.G0)(i,S.createLoginClickHandler(o.l.googleAuth(t),null!=s?{source:s,provider:p.sG.Google}:void 0)),(0,n.G0)(a,S.createLoginClickHandler(o.l.discordAuth(t),null!=s?{source:s,provider:p.sG.Discord}:void 0)),(0,n.G0)(c,S.createLoginClickHandler(o.l.appleAuth(t),null!=s?{source:s,provider:p.sG.Apple}:void 0))}static getCallbackHashFromUrl(){const e=window.location.hash;if(e&&!(e.length<=1))return e.substring(1)}static createLoginClickHandler(e,t){return()=>{d.A9.play(d.hc.Click),a.CA.sendGoogleTagManagerEvent(a.CA.GoogleTagManagerEvent.UserClickedLoginButton),t&&(0,h.Tu)(t.source,t.provider),l.p.clearUserState(),(0,c.Yf)(e)}}constructor(e=!1,t,s){var i;super({key:"strings:homePage.header.login"},{key:"strings:colonistCommon.utils.emptyString"},()=>{},()=>{},!0),this.preventClicksOutsideOfPopupFromClosingPopup=e,this.callbackHash=null!=t?t:S.getCallbackHashFromUrl(),this.ssoMode=null!==(i=null==s?void 0:s.ssoMode)&&void 0!==i&&i,this.onCancel=null==s?void 0:s.onCancel,this.popupSource=null==s?void 0:s.popupSource,(0,n.RH)(this.body,{key:"strings:colonistCommon.utils.emptyString"}),this.loginButtonsDiv=S.buildLoginPopupBody(this,{ssoMode:this.ssoMode}),this.createLoginButtons(),this.removeFooter(),this.show(),null!=this.popupSource&&(0,h.W5)(this.popupSource)}}},51596:(e,t,s)=>{"use strict";s.d(t,{UG:()=>c});var i=s(63359),n=s(87952),r=s(68924),o=s(55935),a=s(72239);const c=3,l=i.KCZ([i.euz(1),i.euz(2),i.euz(3)]),d=i.Ikc({owner:i.k5n(o.DS).exclude(["None"]).readonly(),level:l.readonly(),isUpgradedThisTurn:i.zMY(),isActivated:i.zMY(),isActivatedThisTurn:i.zMY(),locationCornerIndex:i.KCZ([i.aig().int().nonnegative(),i.chJ()]).exactOptional()}).strict(),u=(0,r.e)(d),h=(0,n.rd)(d),p=(0,n.rd)(u,{requireAtLeastOneEntry:!0}),m=i.Ikc({maxPurchaseableLevelUnlocked:l,knights:h}).strict(),g=a.h4.getEnumValues(o.DS);(0,n.Qc)(g,m);const f=i.Ikc({maxPurchaseableLevelUnlocked:l,knights:p}).strict(),y=(0,r.e)(f);(0,n.Qc)(g,y,{requireAtLeastOneEntry:!0})},51662:(e,t,s)=>{"use strict";s.d(t,{m:()=>l});var i=s(18587),n=s(36872),r=s(34668),o=s(55547),a=s(35790),c=s(13618);class l{static showTestServerPopup(){i.r.isProduction||o.OV.showNotification(n.am.Admin,{key:"strings:homePage.header.testServerMessage"})}static async webGLCheck(){const{PIXI:e}=await Promise.all([s.e(175),s.e(675)]).then(s.bind(s,39304));e.utils.isWebGLSupported()||(i.r.isUserOnDiscord?this.showHardwareAccelerationPopup():i.r.isUserOnMobileAppOrWeb?this.showWebGLPopupOnMobileApp():this.showWebGLPopup())}static monitorIfUserInteractedWithSite(e){e||null==this.interactedWithSiteEventListener&&(this.interactedWithSiteEventListener=()=>this.sendUserInteractedWithSite(),document.addEventListener("mousemove",this.interactedWithSiteEventListener),document.addEventListener("mousedown",this.interactedWithSiteEventListener))}static sendUserInteractedWithSite(){null!=this.interactedWithSiteEventListener&&(document.removeEventListener("mousemove",this.interactedWithSiteEventListener),document.removeEventListener("mousedown",this.interactedWithSiteEventListener),r.Q.interactedWithSite())}static showWebGLPopup(){(0,a.B)({title:{key:"strings:homePage.popups.webGLInactive.title"},body:{key:"strings:homePage.popups.webGLInactive.body"},confirmLabel:{key:"strings:homePage.popups.webGLInactive.showMeHow"},onConfirm:()=>(0,c.Yf)("https://blog.colonist.io/how-to-enable-webgl/")})}static showHardwareAccelerationPopup(){(0,a.B)({title:{key:"strings:homePage.popups.hardwareAccelerationRequired.title"},body:"strings:homePage.popups.hardwareAccelerationRequired.body"})}static showWebGLPopupOnMobileApp(){(0,a.B)({title:{key:"strings:homePage.popups.webGLInactiveOnMobileApp.title"},body:{key:"strings:homePage.popups.webGLInactiveOnMobileApp.body"}})}}},51839:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_merchant_silver.82dd86ab681507d3e1e8.svg"},51853:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_science_printer.bb781a2164021b032e8c.svg"},51988:(e,t,s)=>{"use strict";s.d(t,{F:()=>r});var i=s(53015),n=s(64038);class r{static getItemsInCategory(e,t=!0){const s=[];for(const i of r.itemList)t&&!i.activeInStore||i.category==e&&s.push(i);return s}static getItemDetail(e,t){return this.getItemDetailFromArray(e,t,r.itemList)}static isPurchasedWithSubscription(e,t){if(e.subscriptionOnly)return!0;
1if(e.name.key==(new n.RF).name.key)return!1;const s=e.category==i.n9.Expansion||e.category==i.n9.Map||e.category==i.n9.Color;return t&&s}static getItemDetailFromArray(e,t,s){for(const i of s)if(i.category==e&&i.type==t)return i}}r.itemList=[new n.l2,new n.RU,new n.Vk,new n.kD,new n.L$,new n.__,new n.bf,new n.SN,new n.ZZ,new n.r8,new n.D8,new n.xm,new n.LK,new n.$G,new n.xU,new n.Xf,new n.Zc,new n.yl,new n.dZ,new n.b6,new n.qW,new n.dS,new n.jU,new n.Ms,new n.lt,new n.As,new n.Ry,new n.p7,new n.lQ,new n.Ke,new n.rf,new n.bZ,new n.NH,new n.bE,new n.hK,new n.Jt,new n.hd,new n.lY,new n.SV,new n.yT,new n.pk,new n.XP,new n.G,new n.YU,new n.j6,new n.FK,new n.z3,new n.yI,new n.qD,new n.Gi,new n.ac,new n.fB,new n.W1,new n.RF,new n.Ph,new n.ef,new n.Hl,new n.Ge,new n.v$]},52211:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_sunglasses.734c2c7351fa92975814.svg"},52283:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_snorkel.4a6733f5b4da07fe8066.svg"},52324:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_blackforest_preview.273287323f0cba6b14ef.png"},52533:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_room_setting_updated.26996274eec91bbe677d.mp3"},52580:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_scarf.46080dfa00aa75acf7a7.svg"},52955:(e,t,s)=>{"use strict";s.d(t,{TO:()=>v,P8:()=>g,mF:()=>n,M2:()=>p,mb:()=>u,oX:()=>f,bv:()=>o,Li:()=>r,Xx:()=>a,_k:()=>d,BI:()=>m,fv:()=>h,xd:()=>c,to:()=>l});var i=s(36872);function n(e){return"boolean"==typeof e}function r(e){return"number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)}function o(e){return void 0===e||null===e}function a(e,t,s){return r(e)&&e>=t&&e<=s}function c(e){return"string"==typeof e}function l(e,t,s){return c(e)&&a(e.length,t,s)}function d(e,t){return!!r(e)&&null!=t[e]}function u(e){return c(e)&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function h(e,t){const s=t==i.hx.Administrator,n=t==i.hx.Manager,r=t==i.hx.Moderator,o=t==i.hx.User;switch(e){case void 0:return!1;case i.hx.Administrator:if(s||n||r||o)return!0;break;case i.hx.Manager:if(n||r||o)return!0;break;case i.hx.Moderator:if(r||o)return!0;break;case i.hx.User:if(o)return!0}return!1}function p(e){return e instanceof Date&&!isNaN(e.getTime())||!(!c(e)||isNaN(Date.parse(e)))}function m(e){return"object"==typeof e&&!Array.isArray(e)}function g(e){return Array.isArray(e)}function f(e){return null!=e&&e instanceof File}class y extends Error{constructor(e,t){super(e),this.value=t}}function v(e,t,s,i="Value is not a valid string"){if(!l(e,t,s))throw new y(i,e);return e}},53015:(e,t,s)=>{"use strict";s.d(t,{WB:()=>a,ai:()=>r,h8:()=>n,l1:()=>o,n9:()=>i,nx:()=>c});var i=function(e){return e[e.PresalePack=0]="PresalePack",e[e.Expansion=1]="Expansion",e[e.Map=2]="Map",e[e.Icon=3]="Icon",e[e.Color=4]="Color",e[e.Consumable=5]="Consumable",e[e.Membership=6]="Membership",e}({}),n=function(e){return e[e.SettlerPack=0]="SettlerPack",e[e.ColonistPack=1]="ColonistPack",e[e.FounderPack=2]="FounderPack",e}({}),r=function(e){return e[e.Earth=0]="Earth",e[e.USA=1]="USA",e[e.UK=2]="UK",e[e.Diamond=3]="Diamond",e[e.Gear=4]="Gear",e[e.Lakes=5]="Lakes",e[e.Pond=6]="Pond",e[e.Twirl=7]="Twirl",e[e.Classic4PRandom=8]="Classic4PRandom",e[e.ShuffleBoard=9]="ShuffleBoard",e[e.BlackForest=10]="BlackForest",e[e.Volcano=11]="Volcano",e[e.GoldRush=12]="GoldRush",e}({}),o=function(e){return e[e.FounderHat=0]="FounderHat",e[e.ColonistHat=1]="ColonistHat",e[e.SettlerHat=2]="SettlerHat",e[e.ChristmasHat=3]="ChristmasHat",e[e.Player=4]="Player",e[e.PirateShip=5]="PirateShip",e[e.MedalGold=6]="MedalGold",e[e.MedalSilver=7]="MedalSilver",e[e.MedalBronze=8]="MedalBronze",e[e.Elephant=9]="Elephant",e[e.Avocado=10]="Avocado",e[e.Cactus=11]="Cactus",e[e.Crown=12]="Crown",e[e.Swords=13]="Swords",e[e.Helmet=14]="Helmet",e[e.Snorkel=15]="Snorkel",e[e.Scarf=16]="Scarf",e[e.Tie=17]="Tie",e[e.Worker=18]="Worker",e[e.Sombrero=19]="Sombrero",e[e.Farmer=20]="Farmer",e[e.RobberSanta=21]="RobberSanta",e[e.RobberLunar=22]="RobberLunar",e[e.RobberCupid=23]="RobberCupid",e[e.Mummy=24]="Mummy",e[e.Gifter=25]="Gifter",e}({}),a=function(e){return e[e.Gold=0]="Gold",e[e.Silver=1]="Silver",e[e.Bronze=2]="Bronze",e[e.Black=3]="Black",e[e.Purple=4]="Purple",e[e.MysticBlue=5]="MysticBlue",e[e.White=6]="White",e[e.Pink=7]="Pink",e}({}),c=function(e){return e[e.UsernameChange=0]="UsernameChange",e[e.PurchaseResourceCardWithColonistCoin=1]="PurchaseResourceCardWithColonistCoin",e[e.PurchaseDevelopmentCardWithColonistCoin=2]="PurchaseDevelopmentCardWithColonistCoin",e[e.PremiumRoom=3]="PremiumRoom",e}({})},53059:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_send.0395fe5de05351959b13.svg"},53084:(e,t,s)=>{"use strict";s.d(t,{E:()=>f});var i=s(71763),n=s(46507),r=s(44529),o=s(59518),a=s(13618),c=s(72239),l=s(18587),d=s(655),u=s(32398),h=s(81888);if(/^(269|504|630|651|85)$/.test(s.j))var p=s(873);const m=({onRulebookClick:e,faqExternalUrl:t})=>{const[s,m]=(0,i.useState)(r.p.isCareersBadgeVisible()),g=e=>(0,a.Yf)(e,!1,!0),f=e=>(0,a.Yf)(e,!0),y=i.createElement(n.KB,{gamesToday:c.$x.parseFormattedNumber(l.r.gamesToday),playersOnline:c.$x.parseFormattedNumber(l.r.onlineCount)});return i.createElement(n.lb,{isFaqExternal:!!t,language:l.r.language,liveStats:y,onAboutClick:()=>g("/about"),onBlogClick:()=>f("https://blog.colonist.io/"),onCareersClick:()=>{m(!1),r.p.setCareersBadgeDismissed(),g("/careers")},onChampionshipClick:()=>g("/championship2026"),onFaqClick:()=>{t?f(t):g("/faq")},onLanguageClick:()=>(0,o.y)(),onPatchNotesClick:()=>g("/patch-notes"),onPlayerHubClick:()=>g("/community"),onPrivacyClick:()=>g("/privacy-policy"),onRulebookClick:e,onSuggestionsClick:async()=>{var e,t;if(l.r.isUserOnMobile)return f(p.B);if(!(null===(e=h._.userState)||void 0===e?void 0:e.isLoggedIn))return f(p.B);const s=await d.m.getRequestHandler(u.l.apiNoltToken()),i=null==s||null===(t=s.json)||void 0===t?void 0:t.noltSsoUrl;if(null==i)return f(p.B);(0,a.Yf)(i,!0)},showCareersNotification:s,versionNumber:l.r.versionNumber})};var g=s(7893);function f(e,t,s){const i=(0,g.y)(e,m);return i.render({onRulebookClick:t,...s}),i}},53142:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_active_bronze.01bd5895615929ab9a14.svg"},53304:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_gifting_halloween.58ec6e46fa733b78407d.png"},53503:(e,t,s)=>{"use strict";s.d(t,{T:()=>
1o});var i=s(50482),n=s(92524),r=s(81888);class o{set items(e){this.storeUI.bodyController.updateOwnedItems(e),this.storeUI.bodyController.updatePriceForFounderPack(e)}get membershipToggleYearlyActive(){return this._membershipToggleYearlyActive}set membershipToggleYearlyActive(e){this._membershipToggleYearlyActive=e,this.storeUI.bodyController.membershipItems.forEach(t=>{const s=t.membershipProduct.billedAnnually==e;t.productDiv.style.display=s?"flex":"none"}),this.storeUI.bodyController.membershipTabsController.setTabAnnual(e),this.storeUI.bodyController.onMembershipToggleChanged(e)}setMembership(e,t){this.storeUI.bodyController.updateOwnedMembership(e,t),this.storeUI.bodyController.updateSubscribedItems(e,t);const s=void 0===e||i.Zt.isAnnualMembership(e.type);this.membershipToggleYearlyActive=s}set giftedMembershipItems(e){this.storeUI.bodyController.updateGiftedMemberships(e)}updateUserStoreState(e){var t;this.items=null!==(t=null==e?void 0:e.items.getItems())&&void 0!==t?t:[];const s=null==e?void 0:e.items.membership;var n;this.setMembership(null!=s?i.Zt.getMembershipProduct(s):void 0,null==e?void 0:e.items.membershipPaymentMethod),this.giftedMembershipItems=null!==(n=null==e?void 0:e.items.giftedMemberships)&&void 0!==n?n:[],this.updateActiveGiftMembership(e)}updateActiveGiftMembership(e){const t=null==e?void 0:e.items;if(null==(null==t?void 0:t.membership)||t.membershipPaymentMethod!=n.g5.None)return this.storeUI.bodyController.updateActiveGiftMembership(void 0);this.storeUI.bodyController.updateActiveGiftMembership({membershipProduct:i.Zt.getMembershipProduct(t.membership),giftedByUsername:t.membershipGiftedByUsername,activatedAt:t.membershipStartDate,endsAt:t.membershipEndDate})}constructor(e){this._membershipToggleYearlyActive=!0,this.storeUI=e,setTimeout(()=>{r._.registerChangeListener(e=>{this.updateUserStoreState(e)})},1)}}},53829:(e,t,s)=>{"use strict";s.d(t,{b:()=>p,i:()=>g});var i,n=s(46581),r=s(14159),o=s(58602),a=s(69508),c=s(45655);!function(e){class t extends o.Ak{constructor(){super({key:"strings:popups.errors.general.title"},{key:"strings:popups.errors.general.userNotFound"},a.R.Unauthorized)}}e.UserNotFound=t;class s extends o.Ak{constructor(){super({key:"strings:popups.errors.internalServerError.title"},{key:"strings:popups.errors.internalServerError.notifiedDevelopmentTeam"},a.R.InternalServerError,c.S.JL4)}}e.InternalServerError=s;class i extends o.Ak{constructor(){super({key:"strings:popups.errors.authenticationError.title"},{key:"strings:popups.errors.authenticationError.invalidAuthentication"},a.R.InternalServerError,c.S.JL4)}}e.AuthenticationError=i;class n extends o.Ak{constructor(e){super({key:"strings:popups.errors.userBannedError.title"},{key:"strings:popups.errors.userBannedError.youAreBanned",options:{untilDate:e?` until ${e}`:""}},a.R.Forbidden)}}e.UserBanned=n;class r extends o.Ak{constructor(e){super({key:"strings:popups.errors.userExceededRateLimit.title"},{key:"strings:popups.errors.userExceededRateLimit.body",options:{remainingTime:e}},a.R.TooManyRequests)}}e.ErrorUserRateLimitExceeded=r}(i||(i={}));var l,d=s(77434);!function(e){class t extends o.Ak{constructor(){super({key:"strings:popups.errors.leaderboardError.title"},{key:"strings:popups.errors.leaderboardError.leaderboardsDisabled"},a.R.ServiceUnavailable)}}e.LeaderboardDisabled=t;class s extends o.Ak{constructor(){super({key:"strings:popups.errors.leaderboardError.title"},{key:"strings:popups.errors.leaderboardError.invalidRankedMode"},a.R.BadRequest)}}e.InvalidRankedMode=s;class i extends o.Ak{constructor(){super({key:"strings:popups.errors.leaderboardError.title"},{key:"strings:popups.errors.leaderboardError.rangeTooBig"},a.R.BadRequest)}}e.RankingRangeTooBig=i;class n extends o.Ak{constructor(){super({key:"strings:popups.errors.leaderboardError.title"},{key:"strings:popups.errors.leaderboardError.errorPullingData"},a.R.InternalServerError)}}e.PullingData=n;class r extends o.Ak{constructor(){super({key:"strings:popups.errors.leaderboardError.title"},{key:"strings:popups.errors.leaderboardError.invalidUsernameSearchString",options:{minUsernameLength:d.xy,maxUsernameLength:d.Tk}},a.R.BadRequest)}}e.IncorrectSearchNameLength=r;class c extends o.Ak{constructor(){super({key:"strings:popups.errors.leaderboardError.title"},{key:"strings:popups.errors.leaderboardError.noEntriesFound"},a.R.BadRequest)}}e.NoSearchFound=c;class l extends o.Ak{constructor(e){super({key:"strings:popups.errors.leaderboardError.title"},{key:"strings:popups.errors.leaderboardError.noFriendsWithUsern
1ame",options:{usernameFragment:e}},a.R.BadRequest)}}e.NoFriendsForSearch=l;class u extends o.Ak{constructor(){super({key:"strings:popups.errors.leaderboardError.title"},{key:"strings:popups.errors.leaderboardError.invalidApiParameters"},a.R.BadRequest)}}e.InvalidParameters=u;class h extends o.Ak{constructor(){super({key:"strings:popups.errors.leaderboardError.title"},{key:"strings:popups.errors.leaderboardError.unknownError"},a.R.InternalServerError)}}e.UnknownError=h;class p extends o.Ak{constructor(){super({key:"strings:popups.errors.leaderboardError.title"},{key:"strings:popups.errors.leaderboardError.invalidUrl"},a.R.BadRequest)}}e.InvalidUrl=p}(l||(l={}));var u,h=s(84324);!function(e){class t extends o.Ak{constructor(){super({key:"strings:popups.errors.rankedError.title"},{key:"strings:popups.errors.rankedError.waitingForAdblockState"},a.R.BadRequest)}}e.NoAdBlockState=t;class s extends o.Ak{constructor(){super({key:"strings:popups.errors.rankedError.title"},{key:"strings:popups.errors.rankedError.invalidSeason"},a.R.BadRequest)}}e.InvalidSeason=s;class i extends o.Ak{constructor(){super({key:"strings:popups.errors.rankedError.title"},{key:"strings:popups.errors.rankedError.betaSeason"},a.R.ServiceUnavailable)}}e.BetaSeasonsNotSaved=i;class n extends o.Ak{constructor(){super({key:"strings:popups.errors.rankedError.title"},{key:"strings:popups.errors.rankedError.noAccessToCitiesAndKnights"},a.R.Unauthorized)}}e.NoAccessToCitiesAndKnights=n;class r extends o.Ak{constructor(){super({key:"strings:popups.errors.rankedError.title"},{key:"strings:popups.errors.rankedError.noActiveSeason"},a.R.ServiceUnavailable)}}e.NoActiveSeason=r;class c extends o.Ak{constructor(){super({key:"strings:popups.errors.rankedError.title"},{key:"strings:popups.errors.rankedError.noSeasonAnnounced"},a.R.ServiceUnavailable)}}e.NoNewSeasonAnnounced=c;class l extends o.Ak{constructor(e){super({key:"strings:popups.errors.rankedError.title"},{key:"strings:popups.errors.rankedError.nextSeasonNotStarted",options:{timeUntilNextSeason:`${h.i.getDaysHoursMinutesBetweenDatesString(e,new Date)}`}},a.R.ServiceUnavailable)}}e.NextSeasonNotStarted=l;class d extends o.Ak{constructor(){super({key:"strings:popups.errors.rankedError.title"},{key:"strings:popups.errors.rankedError.logInForRanked"},a.R.BadRequest)}}e.MustLogin=d}(u||(u={}));class p{joinQueue(e,t){this.protocol.send("joinQueue",{queue:m[e],clientVersion:t})}leaveCurrentQueue(){this.protocol.send("leaveCurrentQueue",{})}requestQueueAccess(e){this.protocol.send("requestQueueAccess",{clientVersion:e})}onQueueAccess(e){return this.protocol.onEvent("queueAccess",({errors:t})=>{e(t)}),()=>this.protocol.removeListener("queueAccess")}onMatchStatus(e){this.protocol.onEvent("matchStatus",({numberOfPlayersFound:t,totalNumberOfPlayersNeeded:s})=>{e(t,s)})}onError(e){this.protocol.onEvent("error",t=>{e(g(t.error))})}onServerChanged(e){this.protocol.onEvent("serverChanged",()=>{e()})}constructor(e){this.protocol=e}}const m={[n.Nw.RankedClassic4P]:"rankedClassic4P",[n.Nw.UnrankedClassic4P]:"unrankedClassic4P",[n.Nw.RankedCitiesAndKnights4P]:"rankedCitiesAndKnights4P",[n.Nw.UnrankedClassic1v1]:"unrankedClassic1v1",[n.Nw.RankedClassic1v1]:"rankedClassic1v1",[n.Nw.UnrankedShuffle]:"unrankedShuffle",[n.Nw.RankedRush4P]:"rankedRush4P"};function g(e){switch(e.type){case"serverUpdating":return new r.U.ServerUpdating;case"alreadySearchingForMatch":return new r.U.AlreadySearchingForMatch;case"queuePaused":return new r.U.QueueUpdating;case"server":return new r.U.InternalServerError;case"invalidRequest":return new r.U.InvalidRequest;case"outdatedClient":return new o.Ak({key:"strings:popups.errors.general.title"},{key:"strings:popups.errors.newVersion.refreshClient"},a.R.Conflict);case"banned":return new i.UserBanned(e.bannedUntil);case"noFreeGamesRemaining":return new r.U.NoFreeGamesRemaining;case"shuffle.notEnoughGamesPlayed":return new r.U.ShuffleLocked(e.gamesPlayed,e.gamesRequired);case"leaderboardsDisabled":return new l.LeaderboardDisabled;case"noActiveRankedSeason":return new u.NoActiveSeason;case"ranked.notEnoughGamesPlayed":return new r.U.RankedLocked(e.gamesPlayed,e.gamesRequired);case"notLoggedIn":return new u.MustLogin;case"noCitiesAndKnightsAccess":return new u.NoAccessToCitiesAndKnights;case"alreadyPlayingRankedGame":return new r.U.AlreadyPlayingRankedGame}return new r.U.InternalServerError}},53879:(e,t,s)=>{"use strict";s.d(t,{U:()=>i});
1class i{static isAvailable(){return"function"==typeof BroadcastChannel}sendEvent(e){this.broadcastChannel.postMessage(e)}onEvent(e,t){this.eventCallbacks.set(e,t)}constructor(){this.CHANNEL_NAME="colonist",this.broadcastChannel=new BroadcastChannel(this.CHANNEL_NAME),this.eventCallbacks=new Map,this.broadcastChannel.addEventListener("message",e=>{const t=this.eventCallbacks.get(e.data);null==t||t()})}}},54005:(e,t,s)=>{"use strict";e.exports=s.p+"assets/social_icon_instagram.051bc8f53fc713908399.svg"},54227:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_arrow_down.43abc0247b96f0840f9b.svg"},54593:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_settlement_phase_ended.7e282406bfa6bbac3eb7.mp3"},54655:(e,t,s)=>{"use strict";s.d(t,{_:()=>a});var i=s(67908),n=s(655),r=s(32398),o=s(70908);function a(e){const{manageHistory:t}=e;return{requestTabs:async e=>{const t=await n.m.getRequestHandler(r.l.apiLeaderboards.tabs(e),void 0);if(null!=t)return t.json},requestStickyRow:async(e,t)=>{const s=await n.m.getRequestHandler(r.l.apiLeaderboards.stickyRowData(i.Wz[e],t),void 0);if(null==s)return;const o=s.json;return""==o?void 0:o},requestScrollData:async(e,t,s,o,a)=>{const c=await n.m.getRequestHandler(r.l.apiLeaderboards.data(i.Wz[e],t),void 0,{start:s,end:o,search:a});if(null!=c)return c.json},requestSearchData:async(e,t,s)=>{const o=await n.m.getRequestHandler(r.l.apiLeaderboards.usernameSearch(i.Wz[e],t),void 0,{usernameSearchInput:s});if(null!=o)return o.json},getCurrentUrl:()=>t?`${window.location.pathname}${window.location.search}`:"",pushHistoryState:t?(e,t)=>history.pushState(e,"",t):()=>{},updateBrowserTitle:t?(e,t)=>{const s=t?`/${t}`:"",n=`${i.Wz[e]}${s}`;document.title=o.a7.t("strings:leaderboardPage.pageHeadInfo.title",{pageName:n,interpolation:{escapeValue:!1}})}:()=>{},subscribePopState:t?e=>{const t=t=>e(t.state);return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)}:()=>()=>{},getLanguagePathPrefix:()=>o.vX.getLanguagePathPrefix()}}},54801:(e,t,s)=>{"use strict";s.d(t,{Sl:()=>c,Eo:()=>i,xJ:()=>w.x,zG:()=>w.z,WF:()=>n.W,Vd:()=>u,p_:()=>P,cy:()=>f,KB:()=>R,O1:()=>T,I6:()=>m,mg:()=>b});var i=function(e){return e[e.FirstGameState=1]="FirstGameState",e[e.BuildGame=4]="BuildGame",e[e.TogglePauseGame=5]="TogglePauseGame",e[e.CanResignGame=6]="CanResignGame",e[e.PlayerControllerState=12]="PlayerControllerState",e[e.AmountOfCardsToDiscard=13]="AmountOfCardsToDiscard",e[e.CardsToSelectForDevelopmentCard=18]="CardsToSelectForDevelopmentCard",e[e.CardsToSelectForPendingTransaction=19]="CardsToSelectForPendingTransaction",e[e.SelectPlayerUsingDevelopmentCard=20]="SelectPlayerUsingDevelopmentCard",e[e.ConfirmUseDevelopmentCard=21]="ConfirmUseDevelopmentCard",e[e.StealDevelopmentCardFromPlayer=22]="StealDevelopmentCardFromPlayer",e[e.StealResourceCardFromPlayer=23]="StealResourceCardFromPlayer",e[e.SelectPlayerAndCard=24]="SelectPlayerAndCard",e[e.SelectCardsToGiveToPlayer=25]="SelectCardsToGiveToPlayer",e[e.SelectDice=26]="SelectDice",e[e.ClosePopupUI=27]="ClosePopupUI",e[e.GivePlayerResourcesFromTile=28]="GivePlayerResourcesFromTile",e[e.SelectPlayer=29]="SelectPlayer",e[e.HighlightCorners=30]="HighlightCorners",e[e.HighlightRoadEdges=31]="HighlightRoadEdges",e[e.HighlightShipEdges=32]="HighlightShipEdges",e[e.HighlightTiles=33]="HighlightTiles",e[e.HighlightDiceNumbersForInventor=34]="HighlightDiceNumbersForInventor",e[e.TradeState=36]="TradeState",e[e.TradeResponseState=37]="TradeResponseState",e[e.EmbargoState=38]="EmbargoState",e[e.BoldTextInTradeWindow=39]="BoldTextInTradeWindow",e[e.CloseOffer=40]="CloseOffer",e[e.InfoMessage=42]="InfoMessage",e[e.ExchangeCards=43]="ExchangeCards",e[e.GameSettings=44]="GameSettings",e[e.GameEndState=45]="GameEndState",e[e.RematchLink=46]="RematchLink",e[e.EndGameText=47]="EndGameText",e[e.SpectatorData=48]="SpectatorData",e[e.Vote=51]="Vote",e[e.CityImprovementStateUpdated=52]="CityImprovementStateUpdated",e[e.ForceShowCityImprovementButtons=53]="ForceShowCityImprovementButtons",e[e.MerchantStateUpdates=58]="MerchantStateUpdates",e[e.PlayTurnSound=59]="PlayTurnSound",e[e.PlayersTakingAction=60]="PlayersTakingAction",e[e.PlayersDoneTakingAction=61]="PlayersDoneTakingAction",e[e.ExitInitialPlacement=62]="ExitInitialPlacement",e[e.TradeFinalized=63]="TradeFinalized",e[e.TradeRejectedByAll=64]="TradeRejectedByAll",e[e.KnightPlaced=65]="KnightPlaced",e[e.KnightActivated=66]="KnightActivated",e[e.KnightUpgraded=67]="KnightUpgraded",e[e.PlayerDisconnected=68]="PlayerDisconnected",e[e.PlayerReconnected=69]="PlayerReconnected",e[e.DiscardBroadcast=70]="DiscardBroadcast",e[e.SpectatorChatMessage=73]="SpectatorChatMessage",e[e.SendBroadcast=74]="SendBroadcast",e[e.TradeEmbargoState=75]="TradeEmbargoState",e[e.Ping=76]="Ping",e[e.BeginnerHintActivated=77]="BeginnerHintActivated",e[e.KarmaState=78]="KarmaState",e[e.StressTestLagTest=79]="StressTestLagTest",e[e.ResetTradeStateAtEndOfTurn=80]="ResetTradeStateAtEndOfTurn",e[e.ClosedTradeStates=81]="ClosedTradeStates",e[e.BeginnerModeActionUpdate=87]="BeginnerModeActionUpdate",e[e.BeginnerModeLevelEnd=88]="BeginnerModeLevelEnd",e[e.Re
1setBeginnerModeLevel=89]="ResetBeginnerModeLevel",e[e.TriggerClientGameStateReset=90]="TriggerClientGameStateReset",e[e.GameStateUpdated=91]="GameStateUpdated",e[e.ReplayData=92]="ReplayData",e[e.EndOfInitialPlacement=93]="EndOfInitialPlacement",e[e.RushInitialPlacementTimedOutAnalytic=94]="RushInitialPlacementTimedOutAnalytic",e[e.RobberPlacementResolvedAnalytic=95]="RobberPlacementResolvedAnalytic",e}({});if(!/^(251|837)$/.test(s.j))var n=s(13435);var r=s(46581),o=s(35190),a=s(13567);class c{static resourceCardCountFor(e,t){switch(t){case a.Q4.Resource:return c.resourceCardCountForResourceCards(e);case a.Q4.Commodity:return c.resourceCardCountForCommiditiesCards(e);default:return 19}}static resourceCardCountForResourceCards(e){switch(e){case r.p9.Seafarers4P:case r.p9.CitiesAndKnights4P:case r.p9.CitiesAndKnightsSeafarers4P:case r.p9.Classic4P:return 19;case r.p9.Seafarers56P:case r.p9.CitiesAndKnights56P:case r.p9.CitiesAndKnightsSeafarers56P:case r.p9.Classic56P:return 24;case r.p9.Classic78P:return 29;default:return 19}}static resourceCardCountForCommiditiesCards(e){switch(e){case r.p9.Seafarers4P:case r.p9.CitiesAndKnights4P:case r.p9.CitiesAndKnightsSeafarers4P:case r.p9.Classic4P:return 12;case r.p9.Seafarers56P:case r.p9.CitiesAndKnights56P:case r.p9.CitiesAndKnightsSeafarers56P:case r.p9.Classic56P:return 18;case r.p9.Classic78P:return 24;default:return 12}}static getStartingResourceCardsForBankState(e,t){const s={},i=o.LY.getCardEnumsOfTypes(t);for(const t of i){const i=o.LY.getCardDataForCard(t);if(null==i)continue;const n=c.resourceCardCountFor(e,i.cardTypeEnum);s[t]=n}return s}}var l=s(19590);class d{get type(){return this.state.type}get owner(){return this.state.owner}constructor(e){this.state=e,this.hexEdge=new l.j(this.state.x,this.state.y,this.state.z)}}class u{get portEdges(){return this._portEdges}getPortEdgeAtLocation(e){for(const t of this.portEdges)if(t.hexEdge.sameEdge(e))return t}addPortEdge(e){this._portEdges.push(e);const t=this._portEdges.length-1;this.portEdgeStates[t]=e.state}loadPorts(){for(const e in this.portEdgeStates){const t=this.portEdgeStates[e];if(null==t)continue;const s=new d(t);this._portEdges.push(s)}}isPortOnEdge(e){for(const t of this.portEdges)if(t.hexEdge.sameEdge(e))return!0;return!1}constructor(e){this._portEdges=[],this.portEdgeStates=e,this.loadPorts()}}if(!/^(251|837)$/.test(s.j))var h=s(55935);function p(e){if(null==e)return{};const t=o.LY.getCardEnumsOfTypes(e),s={};return t.forEach(e=>s[e]=4),s}function m(){return e=h.DS.None,t=!0,s=7,{color:e,victoryPointsState:{},bankTradeRatiosState:p([]),resourceCards:{cards:[]},cardDiscardLimit:s,isConnected:t,isTakingAction:!1};var e,t,s}var g=s(72239);function f(e,t){const s={};for(const i of Object.keys(e)){i in t||(s[i]=null)}for(const i of Object.keys(t)){const n=t[i],r=i in e,o=r?e[i]:y(n);if(null===o)throw new Error("Original attribute cannot be set to null. Null is reserved for deleting properties.");if(Array.isArray(o)||Array.isArray(n)){if(Array.isArray(n)&&0===n.length&&!r){s[i]=[];continue}const e=v(o,n);if(null==e)continue;s[i]=e;continue}if(null!==n){if("object"==typeof n&&"object"==typeof o){if(0===Object.keys(n).length&&!r){s[i]={};continue}const e=f(o,n);if(null==e)continue;s[i]=e;continue}if("object"==typeof n||"object"==typeof o)throw new Error("Objects did not have the same nested structure");o!==n&&(s[i]=n)}else{if("object"!=typeof o)throw new Error("Null can only used with object attributes. Consider using Undefined instead. Null is a reserved for deleting properties");s[i]=null}}if(!(0===Object.keys(s).length))return s}function y(e){return Array.isArray(e)?[]:"object"==typeof e?{}:void 0}function v(e,t){if(!Array.isArray(e)||!Array.isArray(t))throw new Error("Can only compare simple arrays if both objects are arrays");const s="Only simple string and number arrays can be used in this system. Please convert array to indexed object instead.";if(!S(e))throw new Error(s);if(!S(t))throw new Error(s);if(!g.lv.arraysEqual(e,t))return[...t]}function S(e){const t=["undefined","number","string"];for(const s of e)if(!t.includes(typeof s))return!1;return!0}function b(e){const t={};for(const s of e)C(t,s);return t}function C(e,t){for(const s of Object.keys(t)){const i=t[s];null!==i?Array.isArray(i)||"object"!=typeof i?e[s]=i:(s in e||(e[s]={}),C(e[s],i)):e[s]=null}}function P(e,t){for(const s of t)k(e,s)}function k(e,t){for(const s of Object.keys(t)){const i=t[s];null!==i?Array.isArray(i)||"object"!=typeof i?e[s]=i:(s in e||(e[s]={}),k(e[s],i)):delete e[s]}}s(36872);function T(e,t){var s;const i=structuredClone(e);for(const e in i.playerStates){const s=Number(e),n=i.playerStates[e];
1null!=n&&A(n,s,t)}return void 0!==i.gameLogState&&R(i.gameLogState,t),void 0!==i.gameChatState&&function(e,t){const s=0===t.length;s?function(e){for(const t in e){const s=e[t];if(null==s)continue;0!=s.toSpectators||delete e[t]}}(e):function(e,t){for(const s in e){const i=e[s];null!=i&&(null!=i.recipients&&(g.lv.isSomeElementIncluded(i.recipients,t)||delete e[s]))}}(e,t)}(i.gameChatState,t),null!=(null===(s=i.mapState)||void 0===s?void 0:s.fogTileGroupStates)&&function(e){for(const t in e){const s=e[t];null!=s&&(delete s.possibleDiceNumbers,delete s.possibleTileTypes)}}(i.mapState.fogTileGroupStates),null!=i.mechanicSpecialBuildPhaseState&&function(e,t){if(null==e.playerStates)return;for(const s in e.playerStates){const i=Number(s),n=e.playerStates[i];null!=n&&(t.includes(i)||delete n.isRequesting)}}(i.mechanicSpecialBuildPhaseState,t),null!=i.mechanicDevelopmentCardsState&&function(e,t){var s;null!=(null===(s=e.bankDevelopmentCards)||void 0===s?void 0:s.cards)&&(e.bankDevelopmentCards.cards=o.LY.getCardBacksForCards(e.bankDevelopmentCards.cards));for(const s in e.players){var i;const n=Number(s);if(t.includes(n))continue;const r=e.players[n];null!=r&&(null!=(null===(i=r.developmentCards)||void 0===i?void 0:i.cards)&&(r.developmentCards.cards=o.LY.getCardBacksForCards(r.developmentCards.cards)),null!=r.developmentCardsBoughtThisTurn&&delete r.developmentCardsBoughtThisTurn)}}(i.mechanicDevelopmentCardsState,t),null!=i.mechanicProgressCardsState&&function(e,t){var s;null!=(null===(s=e.bankProgressCards)||void 0===s?void 0:s.cards)&&(e.bankProgressCards.cards=o.LY.getCardBacksForCards(e.bankProgressCards.cards));for(const s in e.players){var i;const n=Number(s);if(t.includes(n))continue;const r=e.players[n];null!=r&&(null!=(null===(i=r.progressCards)||void 0===i?void 0:i.cards)&&(r.progressCards.cards=o.LY.getCardBacksForCards(r.progressCards.cards)))}}(i.mechanicProgressCardsState,t),i}function A(e,t,s){var i;return s.includes(t)||(void 0!==e.victoryPointsState&&function(e){for(const t of Object.keys(e)){const s=r.pO.getVictoryPointByType(Number(t));null!=s&&(s.private&&delete e[t])}}(e.victoryPointsState),void 0!==(null===(i=e.resourceCards)||void 0===i?void 0:i.cards)&&(e.resourceCards.cards=o.LY.getCardBacksForCards(e.resourceCards.cards))),e}function R(e,t){0===t.length?function(e){for(const t in e){const s=e[t];if(null==s)continue;0!=s.toSpectators||delete e[t]}}(e):function(e,t){for(const s in e){const i=e[s];null!=i&&(null!=i.specificRecipients&&(g.lv.isSomeElementIncluded(i.specificRecipients,t)||delete e[s]))}}(e,t)}if(!/^(251|837)$/.test(s.j))var w=s(27060)},54823:(e,t,s)=>{"use strict";function i(e,t){return e.toLowerCase()==t.toLowerCase()}s.d(t,{h:()=>i})},55010:(e,t,s)=>{"use strict";e.exports=s.p+"assets/diamond.11ab288221989c929608.svg"},55436:(e,t,s)=>{"use strict";s.d(t,{i:()=>r,o:()=>o});var i=s(50482),n=s(92524);function r(e,t,s){const r=new Map;if(null==t){for(const t of e)r.set(t.type,"subscribe");return r}if(function(e){const t=e==n.g5.Stripe,s=e==n.g5.Apple||e==n.g5.Android;return!t&&!s}(s)){const i=s==n.g5.None?"cancelGift":"owned";for(const s of e)r.set(s.type,s.type==t.type?i:"none");return r}const o=i.Zt.isAnnualMembership(t.type);let a=!1;for(const s of e)o||!i.Zt.isAnnualMembership(s.type)?a?r.set(s.type,"upgrade"):s.type!=t.type?r.set(s.type,"downgrade"):(r.set(s.type,"manage"),a=!0):r.set(s.type,"goAnnual");return r}function o(e,t,s){var i;const r=null!==(i=t.get(e))&&void 0!==i?i:"subscribe",o=s==n.g5.None;return"none"==r&&o?"cancelGift":r}},55536:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_membership.2dd8fb677256640029b2.png"},55547:(e,t,s)=>{"use strict";s.d(t,{gC:()=>Pt,_$:()=>bt,OV:()=>vt,Bm:()=>kt,sZ:()=>yt,i0:()=>St,IH:()=>ft,P_:()=>Ct,vY:()=>gt});var i=s(18587),n=s(80708),r=s(81888),o=s(70908);if(837!=s.j)var a=s(14177);if(837!=s.j)var c=s(47649);if(837!=s.j)var l=s(56759);if(837!=s.j)var d=s(26573);class u{static isReferrerInformationEmpty(e){return null==e.referrer&&null==e.referralCode}}u.marketingReferralCodeURLVariable="referralCode",u.maxReferralCodeLength=20,u.maxReferrerLength=150;var h=s(34668),p=s(22030);class m{static init(){this.initVariables(),window.addEventListener("storage",e=>
1{if("string"==typeof e.key&&null!=e.newValue)switch(e.key){case"requestSavedReferrer":this.sendSessionReferrer();break;case"sendSessionReferrer":this.updateSessionReferrer(e.newValue);break;case"requestSessionReferralCode":this.sendSessionReferralCode();break;case"sendSessionReferralCode":this.updateSessionReferralCode(e.newValue)}}),this.requestSavedReferrerFromOtherOpenTabs(),this.requestSavedReferralCodeFromOtherOpenTabs(),yt.controller.registerSessionEstablishedObserver(()=>{const e=this.referrer,t=this.referralCode,s={referrer:""==e?void 0:e,referralCode:null!=t?t:void 0};u.isReferrerInformationEmpty(s)||h.Q.sendLobby(p.Dj.SaveClientReferrer,s)})}static initVariables(){this.referrer,this.referralCode}static requestSavedReferrerFromOtherOpenTabs(){window.localStorage.setItem("requestSavedReferrer",""),window.localStorage.removeItem("requestSavedReferrer")}static sendSessionReferrer(){const e=this.getSessionReferrer();null!=e&&(window.localStorage.setItem("sendSessionReferrer",e),window.localStorage.removeItem("sendSessionReferrer"))}static updateSessionReferrer(e){null!=e&&(this.referrer=e)}static requestSavedReferralCodeFromOtherOpenTabs(){window.localStorage.setItem("requestSessionReferralCode",""),window.localStorage.removeItem("requestSessionReferralCode")}static sendSessionReferralCode(){const e=this.getSessionReferralCode();null!=e&&(window.localStorage.setItem("sendSessionReferralCode",e),window.localStorage.removeItem("sendSessionReferralCode"))}static updateSessionReferralCode(e){null!=e&&(this.referralCode=e)}static get referrer(){const e=this.getSessionReferrer();if(null!=e)return e;const t=document.referrer;return this.referrer=t,t}static set referrer(e){sessionStorage.setItem(this.REFERRER_KEY,e)}static getSessionReferrer(){return sessionStorage.getItem(this.REFERRER_KEY)}static get referralCode(){const e=this.getSessionReferralCode();if(null!=e)return e;const t=this.getReferralCodeFromURL();return null==t?null:(this.referralCode=t,t)}static set referralCode(e){null!=e&&sessionStorage.setItem(this.REFERRAL_CODE_KEY,e)}static getSessionReferralCode(){return sessionStorage.getItem(this.REFERRAL_CODE_KEY)}static getReferralCodeFromURL(){return new URLSearchParams(window.location.search).get(u.marketingReferralCodeURLVariable)}}m.REFERRER_KEY="referrer",m.REFERRAL_CODE_KEY="referralCode";var g=s(44529);const f=new(s(30040).s)({storage:"undefined"==typeof sessionStorage?void 0:sessionStorage});var y;!function(e){const t="hasuserinteracted";e.setHasUserInteracted=function(e){f.set(t,e)},e.getHasUserInteracted=function(){return"true"==f.get(t)}}(y||(y={}));var v=s(72239),S=s(13618);if(837!=s.j)var b=s(42418);var C=s(95107);class P{setVersion(){this.updateStorageVersion(this.thisVersion)}isSameVersion(){const e=this.getStorageVersion();return null!=e&&(0,v.Qn)(e)==(0,v.Qn)(this.thisVersion)}hasNoVersion(){const e=this.getStorageVersion();return 0==e||null==e}async showPatchnotes(){if(this.isSameVersion())return;if(1==C.v.suppressPopupsOnLoad)return;this.willShowPatchnoteThisSession=!0,this.setVersion();const[e,{showPatchNotesDialog:t},{handleAnnouncementBannerClick:i}]=await Promise.all([Promise.all([s.e(494),s.e(567)]).then(s.bind(s,31464)),s.e(567).then(s.bind(s,40075)),s.e(50).then(s.bind(s,76529))]),n=new e.PatchNoteData,r=n.getAnnouncementBanner();t({patchNotes:n.getLast5(),announcements:n.getAnnouncements(),announcementBanner:null==r?void 0:{image:{src:r.imageUrl,alt:"strings:popups.patchNote.announcement"},onClick:()=>i(r)},onExternalClick:e=>(0,S.Yf)(e,!0,!0),onProfileClick:e=>(0,S.Yf)((0,b.mh)(e),!0,!0)})}constructor(e,t,s){this.getStorageVersion=e,this.thisVersion=t,this.updateStorageVersion=s,this.willShowPatchnoteThisSession=!1,this.hasNoVersion()&&this.setVersion()}}var k=s(35883),T=s(50482),A=s(64265),R=s(49937),w=s(17972),I=s(32398),M=s(655),_=s(9902),E=s(36872),D=s(4508);class L{static async displayAllPendingNotifications(){if(i.r.isUserOnDiscord)return;if(i.r.isUserOnMobileAppOrWeb)return;if(null==r._.userState)return;if(0==document.getElementById("header_profile_notification_container").classList.contains("hidden"))return;const e=await M.m.getRequestHandler(I.l.apiGetNotifications(),void 0);if(null==e)return;const t=e.json;for(const e of t)this.isCornerPopup(e)?this.displayCornerPopup(e):this.displayViewPopup(e)}static isCornerPopup(e){return e.typeData.type===D.jI.UserReportedWarning}static displayCornerPopup(e){const t=this.getCornerPopupData(e);vt.showNotification(t.image,t.text,t.duration,void 0,this.markNotificationAsReadAction(e.id))}static displayViewPopup(e){const t=this.getViewPopupData(e);if(null==t)return;const s=this.markNotificationAsReadAction(e.id);(0,_.C)({title:t.title,body:t.body,onDismiss:()=>{s()},...null!=t.confirmLabel?{confirmLabel:t.confirmLabel}:{},...null!=t.checkAction?{onConfirm:t.checkAction}:{}})}static getViewPopupData(e){switch(e.typeData.type){case D.jI.UserReportedBanned:return{title:{key:"strings:popups.notification.reportedUserBanned.title"},body:{key:"strings:popups.notification.reportedUserBanned.body"}};case D.jI.UserReportedThankYou:return{title:{key:"strings:popups.notification.reportedUserThankYou.title"},body:{key:"strings:popups.notification.reportedUserThankYou.body"}};case D.jI.HolidaySale2023Expired:return{title:{key:"strings:popups.notification.holidaySale2023Expired.title"},body:{key:"strings:popups.notification.holidaySale2023Expired.body"}};case D.jI.TranslationHelp:return{title:{key:"strings:popups.notification.translationHelp.title"},body:{key:"strings:popups.notification.translationHelp.body",options:{language:e.typeData.language,username:e.typeData.username,link:e.typeData.link}}};case D.jI.GiftMembershipReceivedFromAdmin:return{title:{key:"strings:popups.notification.giftMembershipReceived.title"},body:{key:"strings:popups.notification.giftMembershipReceived.body"},confirmLabel:{key:"strings:popups.notification.giftMembershipReceived.checkButton"},checkAction:()=>(0,S.Yf)("/store#gifted_memberships",!0)};default:return}}static getCornerPopupData(e){if(e.typeData.type===D.jI.UserReportedWarning)return{image:E.am.DangerIcon,text:{key:"strings:popups.notification.reportedUserWarning"},duration:v.Re.SECONDS_IN_MINUTE*v.Re.MILLISECONDS};throw new Error("Unsupported notification type for displayCornerPopup")}static markNotificationAsReadAction(e,t){return async()=>{await M.m.postRequestHandler(I.l.apiMarkNotificationAsRead(e),void 0,void 0),null==t||t()}}}var B=s(44517);if(837!=s.j)var x=s(84240);var O=s(9029);class G{static init(){var e,t,s,n;(null===(e=r._.userState)||void 0===e?void 0:e.isLoggedIn)?(null===(s=document.getElementById("g_id_onload"))||void 0===s||s.setAttribute("data-auto_prompt","false"),this.cancelPopup(),this.delayedCancelPopup()):null===(n=document.getElementById("g_id_onload"))||void 0===n||n.setAttribute("data-auto_prompt","true");this.initialized||i.r.isUserOnMobile||i.r.isUserOnDiscord||(null===(t=r._.userState)||void 0===t?void 0:t.isLoggedIn)||((0,O.xW)(document.body,"https://accounts.google.com/gsi/client"),this.initialized=!0)}static cancelPopup(){var e,t,s;null===(s=window.google)||void 0===s||null===(t=s.accounts)||void 0===t||null===(e=t.id)||void 0===e||e.cancel()}static delayedCancelPopup(){if(this.initialized)for(let e=0;e<2e3;e+=500)setTimeout(()=>{this.cancelPopup()},e)}}G.initialized=!1;class F{static init(){var e,t,s,n,o,a,c;this.initialized||(i.r.isUserOnDiscord||(null!==(t=null===(e=r._.userState)||void 0===e?void 0:e.totalCompletedGameCount)&&void 0!==t?t:0)>0||"https:"==window.location.protocol&&(s=window,n=document,s.hj=null!==(c=s.hj)&&void 0!==c?c:function(){var e;(s.hj.q=null!==(e=s.hj.q)&&void 0!==e?e:[]).push(arguments)},s._hjSettings={hjid:i.r.hotjarTrackingCode,hjsv:6},o=n.getElementsByTagName("head")[0],(a=n.createElement("script")).async=1,a.src="https://static.hotjar.com/c/hotjar-"+s._hjSettings.hjid+".js?sv="+s._hjSettings.hjsv,o.appendChild(a),this.initialized=!0))}}F.initialized=!1;var U=s(66873);class N{static init(){var e;if(this.initialized)return;const t=(0,U.C)();t.isAdPlatformAvailable&&t.canUserSeeAds&&(window.hashString=null===(e=r._.userState)||void 0===e?void 0:e.vliHash,(0,O.fc)(document.body,i.r.vliPublicKey),(0,O.fc)(document.body,i.r.vliAdvKey),(0,O.fc)(document.body,"//cdn.jsdelivr.net/gh/vli-platform/adb-analytics@7
17bebb/v1.0.min.js"),t.canUserSeeLobbyAds&&(document.querySelectorAll(".vli_page_vertical_ad").forEach(e=>e.classList.remove("hidden")),document.querySelectorAll(".main_page_ad_300x100").forEach(e=>e.classList.remove("hidden")),document.querySelectorAll(".main_page_ad_300x250").forEach(e=>e.classList.remove("hidden"))),document.querySelectorAll(".adsbyvli").forEach(e=>e.classList.remove("hidden")),this.initialized=!0)}}N.initialized=!1;class H{static init(){var e;this.initialized||"localhost"!==window.location.hostname&&(i.r.isUserOnDiscord||i.r.isUserOnMobile&&i.r.shouldHideAdsOnMobile||i.r.showVliAdAtBottomInGame||r._.isStale()||(null===(e=r._.userState)||void 0===e?void 0:e.items.hideAds())||((0,O.xW)(document.body,"//api.adinplay.com/libs/aiptag/pub/KTN/colonist.io/tag.min.js"),this.initialized=!0))}}H.initialized=!1;var K=s(78524),W=s(4651);class V{static getInstance(){return null==this.instance&&(this.instance=new V),this.instance}static get isOnline(){const e=navigator.onLine;return null==e||!!e}onOnline(e){this.onlineListeners.addWithoutCallback(e)}onOffline(e){this.offlineListeners.addWithoutCallback(e)}listenToBrowserConnectivity(){window.addEventListener("online",()=>{this.onlineListeners.trigger()}),window.addEventListener("offline",()=>{this.offlineListeners.trigger()})}constructor(){this.onlineListeners=new v.gp,this.offlineListeners=new v.gp,this.listenToBrowserConnectivity()}}var q=function(e){return e[e.RouteToServerType=2]="RouteToServerType",e[e.RouteToServerDirect=3]="RouteToServerDirect",e[e.SocketRouter=4]="SocketRouter",e}({});new TextDecoder;const Q=new TextEncoder;function j(e,t,s,i){const n=Q.encode(s),r=new Uint8Array(3+n.byteLength+i.byteLength),o=new DataView(r.buffer);return o.setUint8(0,e),o.setUint8(1,t),o.setUint8(2,n.byteLength),r.set(n,3),r.set(i,3+n.byteLength),r.buffer}if(837!=s.j)var z=s(62777);var $=s(67908);if(837!=s.j)var Y=s(18628);class Z{sendToServer(e,t,s,i=!1){if(t)this.send(q.RouteToServerDirect,e,t,s,i);else try{const t=new Error("Direct to server message has no recipient");throw t.subType=e,t.data=s,t}catch(e){console.error(e),Y.Cp(e)}}sendToServerType(e,t,s,i=!1){this.send(q.RouteToServerType,e,t,s,i)}sendNoop(){this.send(q.SocketRouter,E.lo.Noop,"",{},!1)}sendCloseSocket(e){const t=new Uint8Array([e-4e3]),s=j(q.SocketRouter,E.lo.CloseSocket,"",t);this.socket.send(s)}sendPing(e){const t={id:`${$.zd.State.SocketMonitorUpdate}`,data:{timestamp:e}};this.send(q.SocketRouter,E.lo.Echo,"",t,!1)}onSessionEstablished(){this.isSessionPending=!1;for(const e of this.bufferedOutgoingSecondaryMessages)this.socket.send(e);this.bufferedOutgoingSecondaryMessages.length=0,this.bufferedOutgoingPrimaryMessage&&(this.socket.send(this.bufferedOutgoingPrimaryMessage),this.bufferedOutgoingPrimaryMessage=void 0)}get isPrimaryCommandQueued(){return null!=this.bufferedOutgoingPrimaryMessage}onPrimaryCommandQueued(e){this.primaryCommandQueuedListeners.addWithoutCallback(e)}send(e,t,s,i,n){const r=j(e,t,s,z.l(i));if(this.isSessionPending)n?this.bufferedOutgoingPrimaryMessage=r:this.bufferedOutgoingSecondaryMessages.push(r);else{if(!this.socket.isSocketOpen()){if(!n)return;return this.bufferedOutgoingPrimaryMessage=r,void this.primaryCommandQueuedListeners.trigger()}this.socket.send(r)}}constructor(e,t){this.isSessionPending=!0,this.primaryCommandQueuedListeners=new v.gp,this.bufferedOutgoingSecondaryMessages=[],this.socket=e,t(()=>this.onSessionEstablished())}}var J=s(17399);if(837!=s.j)var X=s(64853);var ee=s(70970);class te{isSocketOpen(){var e;return(null===(e=this.webSocket)||void 0===e?void 0:e.readyState)===WebSocket.OPEN}async connect(){const e=(0,v.ph)();this.connectionPromise=e;const t=9*v.Re.MILLISECONDS;return setTimeout(()=>{e.pending&&(this.close(E.SB),e.resolve("retry"))},t),this.detachWebSocket(),this.webSocket=new WebSocket(await this.getWebSocketUrl()),this.webSocket.binaryType="arraybuffer",this.webSocket.onmessage=t=>this.handleInitialWebSocketMessage(t,e),this.webSocket.onclose=t=>{switch(t.code){case E.p5:case E.FL:e.resolve("permanentlyFailed");break;case E.gu:this.sendTurnstileToken=!0,e.resolve("retry");break;default:e.resolve("retry")}this.handleWebSocketClose(t.code)},this.webSocket.onerror=t=>{this.handleWebSocketError(t),e.resolve("retry")},e}detachWebSocket(){null!=this.webSocket&&(this.webSocket.onmessage=null,this.webSocket.onclose=null,this.webSocket.onerror=null,this.webSocket.close(),this.webSocket=void 0)}async getWebSocketUrl(){const e=new URLSearchParams;if(e.append("version",E.ZC),null!=this.firstUserSessionId&&e.append("firstUserSessionId",this.firstUserSessionId),i.r.isUserOnDiscordMobile){const t=g.p.getAuthToken();null!=t&&e.append("authToken",t)}return this.sendTurnstileToken&&e.append("turnstileToken",await ee.F.getToken()),`${this.serverUrl}?${e}`}handleInitialWebSocketMessage(e,t){if(null!=this.webSocket){try{const s=JSON.parse(e.data);switch(s.type){case"Connected":return void(null==this.firstUserSessionId&&(this.firstUserSessionId=s.userSessionId));case"SessionEstablished":return this.webSocket.onmessage=e=>this.handleWebSocketMessage(e),this.onSessionEstablished(),t.resolve("connected"),void(this.sendTurnstileToken=!1)}}catch(t){console.error("Parse websocket initial message error",e,t)}this.handleWebSocketMessage(e)}}handleWebSocketMessage(e){const t=X.D4(e.data);i.r.socketDebugActive&&(0,J.W)("SocketMessage",["======",`Message type: ${t.id}, data:`,t.data]),this.onStateUpdate(Number(t.id),t.data)}handleWebSocketError(e){var t;
1i.r.socketDebugActive&&(0,J.vV)("connect",["Closing socket, encountered error: ",e]),null===(t=this.webSocket)||void 0===t||t.close()}handleWebSocketClose(e){e!=E.p5?this.onClose():(0,S.Yf)((0,S.mE)())}close(e){var t;null!=this.webSocket&&(this.webSocket.close(e),this.detachWebSocket(),null===(t=this.connectionPromise)||void 0===t||t.resolve("retry"),this.onClose())}send(e){var t;this.isSocketOpen()&&(null===(t=this.webSocket)||void 0===t||t.send(e))}constructor(e,t,s,i){this.sendTurnstileToken=!1,this.serverUrl=e,this.onSessionEstablished=t,this.onStateUpdate=s,this.onClose=i}}class se{async connect(){return this.currentClient.isSocketOpen()?(this.onSessionEstablished(),"connected"):this.currentClient.connect()}send(e){this.currentClient.send(e)}close(e){this.currentClient.close(e)}isSocketOpen(){return this.currentClient.isSocketOpen()}createClient(){const e=new te(this.serverUrl,()=>{e===this.currentClient&&this.onSessionEstablished()},(t,s)=>{e===this.currentClient&&(t!==$.zd.State.ReplaceSocket?this.onStateUpdate(t,s):this.replaceSocketClient())},()=>{e===this.currentClient&&this.onClose()});return e}async replaceSocketClient(){const e=this.currentClient,t=this.createClient();"connected"===await t.connect()&&e===this.currentClient&&t.isSocketOpen()&&e.isSocketOpen()?(this.currentClient=t,e.close(E.Yt),this.onClose()):t.close()}constructor(e,t,s,i){this.serverUrl=e,this.onSessionEstablished=t,this.onStateUpdate=s,this.onClose=i,this.currentClient=this.createClient()}}class ie{connect(){var e;return this.currentUserId=null===(e=r._.userState)||void 0===e?void 0:e.id,this.socket.connect()}enableConnect(){this.enabled||(this.enabled=!0,r._.registerChangeListener(()=>{this.checkUserChanged()}),this.registerSessionEstablishedObserver(()=>{this.checkUserChanged()}))}registerSessionEstablishedObserver(e){return this.sessionEstablishedObservers.add(e),()=>{this.sessionEstablishedObservers.delete(e)}}handleStateUpdate(e,t){var s;null===(s=this.stateHandlers.get(e))||void 0===s||s(t)}setStateHandler(e,t){this.stateHandlers.set(e,t)}registerSocketCloseObserver(e){this.socketCloseObservers.push(e)}setSession(e){var t;this.session=e,null===(t=n.CA.logRocket)||void 0===t||t.set(this.session),null==gt||gt.showPatchnotes()}triggerSessionEstablishedObservers(){for(const e of this.sessionEstablishedObservers)e()}isSocketOpen(){return this.socket.isSocketOpen()}close(e){null!=e&&this.sender.sendCloseSocket(e),this.socket.close(e)}handleSocketClose(){this.currentUserId=void 0;for(const e of this.socketCloseObservers)e()}checkUserChanged(){var e;this.isSocketOpen()&&(null===(e=r._.userState)||void 0===e?void 0:e.id)!=this.currentUserId&&this.close(E.kv)}constructor(e){this.enabled=!1,this.sessionEstablishedObservers=new Set,this.stateHandlers=new Map,this.socketCloseObservers=[],this.socket=new se(e,()=>this.triggerSessionEstablishedObservers(),(e,t)=>this.handleStateUpdate(e,t),()=>this.handleSocketClose()),this.sender=new Z(this.socket,e=>this.registerSessionEstablishedObserver(e)),V.getInstance().onOffline(()=>this.close())}}class ne{get isReconnecting(){return this.isReconnectionNeeded}onTriggered(e){this.triggeredListeners.addWithoutCallback(e)}onStarted(e){this.startedListeners.addWithoutCallback(e)}onMaxDisconnectExceeded(e){this.maxDisconnectExceededListeners.addWithoutCallback(e)}onConnected(e){this.connectedListeners.addWithoutCallback(e)}onFailed(e){this.failedListeners.addWithoutCallback(e)}start(){this.isEnabled&&(this.triggeredListeners.trigger(),this.isReconnectionNeeded=!0,this.canReconnectFunction()&&this.startMaxDisconnectTimer(),this.isRetryLoopRunning||(this.isRetryLoopRunning=!0,this.startedListeners.trigger(),this.run()))}restart(){var e;this.start(),null===(e=this.wakeFromDelay)||void 0===e||e.call(this)}disable(){var e;this.isEnabled=!1,this.isReconnectionNeeded=!1,this.stopMaxDisconnectTimer(),null===(e=this.wakeFromDelay)||void 0===e||e.call(this)}async run(){const e=v.R$.secondsAsMilliseconds(3),t=v.R$.secondsAsMilliseconds(15);for(let t=1;t<=ne.ATTEMPTS_PER_ROUND&&this.isReconnectionNeeded;t+=1){if(!this.canReconnectFunction()){this.stopMaxDisconnectTimer();break}let t;try{t=await this.reconnectFunction()}catch{t="retry"}switch(t){case"connected":case"permanentlyFailed":return this.isReconnectionNeeded=!1,this.isRetryLoopRunning=!1,this.stopMaxDisconnectTimer(),void("connected"==t?this.connectedListeners.trigger():this.failedListeners.trigger());case"retry":if(await this.waitFor(e))return void this.run();break}}this.isReconnectionNeeded?(await this.waitFor(t),this.isEnabled&&this.isReconnectionNeeded?(this.canReconnectFunction()&&this.startMaxDisconnectTimer(),this.run()):this.isRetryLoopRunning=!1):this.isRetryLoopRunning=!1}async waitFor(e){const t=await new Promise(t=>{this.wakeFromDelay=()=>t(!0),setTimeout(()=>t(!1),e)});return this.wakeFromDelay=void 0,t}startMaxDisconnectTimer(){if(null!=this.maxDisconnectTimeout)return;const e=v.R$.secondsAsMilliseconds(30);this.maxDisconnectTimeout=setTimeout(()=>{this.maxDisconnectExceededListeners.trigger()},e)}stopMaxDisconnectTimer(){clearTimeout(this.maxDisconnectTimeout),this.maxDisconnectTimeout=void 0}constructor({reconnect:e,canReconnect:t}){this.isReconnectionNeeded=!1,this.isRetryLoopRunning=!1,this.isEnabled=!0,this.triggeredListeners=new v.gp,this.startedListeners=new v.gp,this.maxDisconnectExceededListeners=new v.gp,this.connectedListeners=new v.gp,this.failedListeners=new v.gp,this.reconnectFunction=e,this.canReconnectFunction=t}}ne.ATTEMPTS_PER_ROUND=15;class re extends ne{handleReconnectAllowed(){this.socket.isSocketOpen()||this.restart()}constructor(e){super({reconnect:()=>e.connect(),canReconnect:()=>!!r._.hasUser()&&!!V.isOnline}),this.socket=e,this.socket.registerSocketCloseObserver(()=>this.start()),V.getInstance().onOnline(()=>this.handleReconnectAllowed()),r._.registerChangeListenerWithoutCallback(()=>this.handleReconnectAllowed())}}if(837!=s.j)var oe=s(67707);var ae=s(35790);class ce{static processSocketData(e){"number"==typeof e&&(this.expectedSocketAmount=Number(e),this.receivedSocketAmount=0,this.startingTime=Date.now(),(0,J.W)("processSocketData",["-------------------------------------"]),(0,J.W)("processSocketData",[`Expecting ${this.expectedSocketAmount}`])),"string"==typeof e&&"test"==e&&(this.receivedSocketAmount+=1),"string"==typeof e&&"done"==e&&((0,J.W)("processSocketData",[`Expected ${this.expectedSocketAmount}`]),(0,J.W)("processSocketData",[`Received ${this.receivedSocketAmount}`]),(0,J.W)("processSocketData",[`Took ${Date.now()-this.startingTime}ms`]),this.expectedSocketAmount=0,this.receivedSocketAmount=0,this.startingTime=0)}}ce.expectedSocketAmount=0,ce.receivedSocketAmount=0,ce.startingTime=0;var le=s(51662),de=s(29249);class ue{static send(e,t){const s={action:e,payload:t};yt.controller.sender.sendToServerType(E.lo.ShuffleAction,"lobby",s)}static requestShuffleQueueData(){this.send(p.Ih.GetShuffleQueueData,void 0)}}var he=s(46507),pe=s(66935),me=s(30911),ge=s(53015),fe=s(60144);const ye=(0,s(11445).K)(he._i);function ve(e){const t={key:"strings:storePage.success.youGotItem",options:{itemName:o.a7.t(e.name.key,e.name.options),category:function(e){switch(e){case ge.n9.Color:return o.a7.t("strings:storePage.sections.color.title",{context:"one"});case ge.n9.Icon:return o.a7.t("strings:storePage.sections.avatar.title",{context:"one"});default:return""}}(e.category)}};ye({imageUrl:(0,J.tu)(e.image),itemTitle:t,onUseItem:()=>{!async function(e){switch(e.category){case ge.n9.Color:{const t=me.k.getPlayerColorOfStorePlayerColor(e.type);if(null==t)return;await fe.a.updatePreferredColor(t);const s=(0,pe.dN)({key:"strings:homePage.header.defaultColorSelector.colorChanged"},{color:e.name});vt.showNotification(e.image,s);break}case ge.n9.Icon:{await fe.a.updateIcon(e.type);const t=(0,pe.dN)({key:"strings:homePage.header.avatarSelector.avatarChanged"},{icon:e.name});vt.showNotification(e.image,t);break}}}(e)}})}class Se{constructor(e,t){this.lobbyStateHandlers=new Map,this.channelStateHandlers=new Map,this.generalStateHandlers=new Map,this.socketActionController=t,e.setStateHandler($.zd.State.LobbyStateUpdate,e=>{var t;null===(t=this.lobbyStateHandlers.get(e.type))||void 0===t||t(e.payload)}),e.setStateHandler($.zd.State.ChannelStateUpdate,e=>{var t;null===(t=this.channelStateHandlers.get(e.type))||void 0===t||t(e.payload)}),e.setStateHandler($.zd.State.GeneralStateUpdate,e=>{var t;null===(t=this.generalStateHandlers.get(e.type))||void 0===t||t(e.payload)}),this.lobbyStateHandlers.set($.zd.LobbyState.SessionState,t=>{var s;const i=oe.E.deserialize(t);le.m.monitorIfUserInteractedWithSite(null===(s=r._.userState)||void 0===s?void 0:s.interactedWithSite),e.setSession(i),this.socketActionController.onStateSessionState(),ue.requestShuffleQueueData()}),this.lobbyStateHandlers.set($.zd.LobbyState.LobbyDisconnectData,e=>{vt.showGames(e)}),this.lobbyStateHandlers.set($.zd.LobbyState.AutoRejoinGame,e=>{this.socketActionController.onStateAutoRejoinGame(e)}),this.lobbyStateHandlers.set($.zd.LobbyState.SendPopup,e=>{"strings:popups.errors.newVersion.refreshClient"==e.body.key?(0,ae.B)({title:{key:"strings:popups.errors.newVersion.title"},body:{key:"strings:popups.errors.newVersion.refreshClient"},onConfirm:()=>window.location.reload()}):(0,_.C)({title:e.title,body:e.body})}),this.lobbyStateHandlers.set($.zd.LobbyState.SendBroadcast,e=>{vt.show(e.text,de.n.Information)}),this.lobbyStateHandlers.set($.zd.LobbyState.SocketTest,e=>{ce.processSocketData(e)}),this.lobbyStateHandlers.set($.zd.LobbyState.ShowCornerPopup,e=>{vt.showNotification(e.icon,e.text)}),this.lobbyStateHandlers.set($.zd.LobbyState.ServerUpdating,()=>{(0,ae.B)({title:{key:"strings:popups.patchNote.announcement"},body:{key:"strings:popups.errors.serverUpdate"}})}),this.lobbyStateHandlers.set($.zd.LobbyState.ReloadClient,e=>{setTimeout(()=>window.location.reload(),e.delay)}),this.lobbyStateHandlers.set($.zd.LobbyState.ServerUpdated,e=>{if(null==yt.gameListener.databaseGameId)return;if((0,v.Qn)(E.$m)==(0,v.Qn)(e.newServerVersion))return;vt.show({key:"strings:popups.errors.newVersion.newVersionReleasedWarning"},de.n.Information),bt.serverUpdated=!0}),this.lobbyStateHandlers.set($.zd.LobbyState.RoomListUpdate,e=>{this.socketActionController.onRoomListUpdate(e)}),this.lobbyStateHandlers.set($.zd.LobbyState.UserStateUpdate,e=>{r._.update(e)}),this.lobbyStateHandlers.set($.zd.LobbyState.ItemPurchaseSuccessPopup,e=>{ve(e)}),this.channelStateHandlers.set($.zd.ChannelState.ChannelRoomUpdate,e=>{this.socketActionController.onChannelRoomUpdate(e)}),this.generalStateHandlers.set($.zd.GeneralState.UpdateOnlineStatus,e=>{this.socketActionController.onFriendUpdateOnlineStatus(e)}),this.generalStateHandlers.set($.zd.GeneralState.ReceivedRoomInvites,e=>{this.socketActionController.onFriendReceivedRoomInvites(e)}),this.generalStateHandlers.set($.zd.GeneralState.ReceivedFriendRequest,e=>{this.socketActionController.onFriendReceivedFriendRequest(e)}),this.generalStateHandlers.set($.zd.GeneralState.RemoveRoomInvite,e=>{this.socketActionController.onFriendRemoveRoomInvite(e)}),this.generalStateHandlers.set($.zd.GeneralState.RoomInviteResponse,e=>{this.socketActionController.onFriendRoomInviteResponse(e)}),this.generalStateHandlers.set($.zd.GeneralState.RoomInviteSentSuccessfully,e=>{this.socketActionController.onFriendRoomInviteSentSuccessfully(e)}),this.generalStateHandlers.set($.zd.GeneralState.Notifications,e=>{this.socketActionController.onNotificationsReceived(e)}),this.generalStateHandlers.set($.zd.GeneralState.MarkedAsRead,e=>{this.socketActionController.onMarkedAsRead(e)})}}var be=s(54801),Ce=s(35606),Pe=s(76092);var ke=s(84324),Te=s(16611);class Ae{removeOldPopupIfExists(){const e=document.querySelector(".popup-notification");null!=e&&e.remove()}setCancel(){window.addEventListener("click",e=>{e.target==this.container&&this.removePopup()})}positionContainerInTopRightCorner(){const e=ft.canvasController,t=ft.canvasController.responsiveController.getScaleForRotation(),s=e.responsiveController.getCanvasX(),n=t*(e.appW-2*e.chatWidth)+s,r=e.responsiveController.getCanvasY();this.contentContainer.style.position="absolute",this.contentContainer.style.transform="none",this.contentContainer.style.width=i.r.isUserOnMobileAppOrWeb?"70vw":e.chatWidth*t+"px",this.contentContainer.style.left=i.r.isUserOnMobileAppOrWeb?"15vw":n+"px",this.contentContainer.style.top=i.r.isUserOnMobileAppOrWeb?"40vh":r+"px",this.contentContainer.style.marginRight=e.margin+"px",this.contentContainer.style.marginTop=e.margin+"px"}removePopup(){this.container.style.display="none",null!=this.container.parentElement&&this.container.parentElement.removeChild(this.container)}show(){this.container.style.display="block"}isRemoved(){return"none"==this.container.style.display}constructor(e,t){this.removeOldPopupIfExists(),this.container=(0,O.Le)(document.body,"popup-notification"),this.contentContainer=(0,O.Le)(this.container,"popup-content-temporary"),this.header=(0,O.Le)(this.contentContainer,"popup-header"),this.body=(0,O.Le)(this.contentContainer,"popup-body"),this.footer=(0,O.Le)(this.contentContainer,"popup-footer"),this.setCancel(),this.checkButton=(0,O.Le)(this.footer,"btn_general btn_general_check"),(0,O.G0)(this.checkButton,()=>{Te.A9.play(Te.hc.Click),this.removePopup()}),this.positionContainerInTopRightCorner(),(0,O.n8)(this.header,e,"","","H4"),(0,O.Wr)(this.body,t,""),this.show();const s=6*ke.i.MILLISECONDS;setTimeout(()=>{this.removePopup()},s)}}if(837!=s.j)var Re=s(51178);if(837!=s.j)var we=s(2443);class Ie{get uiGameManager(){return ft}restoreGameClientWithoutClosingSocket(){var e;null===(e=this.uiGameManager)||void 0===e||e.eventController.sendEvent(void 0,$.o8.UIGameEventEnums.ClientReconnectionTriggered),this.reset(),this.reconnectMode="full",this.gameClientRestorationController.start()}reset(){var e;null===(e=this.gameStateReceiver)||void 0===e||e.reset(),this.reconnectSucceeded=void 0,this.reconnectMode="none"}static playGameStartedSound(e){const t=e===E.p9.ColonistRush4P?Te.hc.GameStartedGuitar:Te.hc.GameStarted;(0,Te.Au)(t)}static playSettlementPhaseEndedSound(e){const t=e===E.p9.ColonistRush4P?Te.hc.SettlementPhaseEndedGuitar:Te.hc.SettlementPhaseEnded;(0,Te.Au)(t)}constructor({socketController:e,socketActionController:t,socketReconnectionController:s,activeGameRoomMonitor:i}){this.gameStateHandlers=new Map,this.playedStartGameSound=!1,this.reconnectMode="none",this.gameState=new Ce.n,this.socketActionController=t,this.activeGameRoomMonitor=i;this.gameClientRestorationController=new ne({reconnect:async()=>
1{if(null==this.gameSettingId)return"permanentlyFailed";const e=(0,v.ph)();var t;if(this.reconnectSucceeded=()=>e.resolve("connected"),"none"==this.reconnectMode&&null!=this.reconnectToken)null===(t=this.socketActionController.uiGameManager)||void 0===t||t.socketGameSend.reconnectFast(this.gameSettingId,this.reconnectToken),this.reconnectMode="fast";else if("none"==this.reconnectMode||"fast"==this.reconnectMode)h.Q.reconnectGame(this.gameSettingId),this.reconnectMode="full";else{var s;null===(s=this.socketActionController.uiGameManager)||void 0===s||s.socketGameSend.requestGameState()}return setTimeout(()=>{e.pending&&e.resolve("retry")},10*v.Re.MILLISECONDS),e},canReconnect:()=>e.isSocketOpen()}),this.gameStateReceiver=new v.N_(t=>{try{var s;null===(s=this.gameStateHandlers.get(t.type))||void 0===s||s(t.payload)}catch(t){console.log(t),e.close(E.ZS),Y.Cp(t)}},(e,t,s,i,r)=>{n.CA.sendAnalyticEvent({category:Pe.eX.Socket,type:Pe.k0.SocketSequenceError,dimensions:{databaseGameId:this.databaseGameId,lastSequence:e,time:t,reason:s,pendingData:i.map(e=>({t:e.added,s:e.data.sequence,gu:e.data.type})),lastReleasedData:r.map(e=>({t:e.added,s:e.data.sequence,gu:e.data.type})),monitorStats:(0,Re.A)((0,we.A)(yt.monitor.stats,["buckets"]),e=>0==e)}}),this.restoreGameClientWithoutClosingSocket()}),e.setStateHandler($.zd.State.GameStateUpdate,e=>{this.gameStateReceiver.addData(e)}),e.registerSessionEstablishedObserver(()=>{this.reset(),null!=this.gameSettingId&&this.gameClientRestorationController.restart()}),this.gameStateHandlers.set(be.Eo.FirstGameState,e=>{null!=this.socketActionController.uiGameManager&&(yt.monitor.activate(),this.gameState.serverId=e.serverId,this.databaseGameId=e.databaseGameId,this.gameSettingId=e.gameSettingId,this.activeGameRoomMonitor.startGame(),this.reconnectToken=e.reconnectToken,null!=this.reconnectSucceeded&&(this.reconnectSucceeded(),this.socketActionController.uiGameManager.socketGameSend.notifyBackendClientAutoReconnected()),e.shouldResetGameClient&&this.socketActionController.uiGameManager.resetGameUIToRebuildOnReconnect(),null==vt||vt.removeDisconnectBanners(),this.socketActionController.onConnectionEstablished(e),e.isReconnectingSession&&(this.playedStartGameSound=!0))}),this.gameStateHandlers.set(be.Eo.SpectatorData,e=>{var t;null===(t=this.uiGameManager)||void 0===t||t.setSpectators(e)}),this.gameStateHandlers.set(be.Eo.BeginnerHintActivated,e=>{var t;this.socketActionController.onBeginnerHintActivated(e),null===(t=this.uiGameManager)||void 0===t||t.gameStore.getState().gameBeginnerHint.setBeginnerHintData(e)}),this.gameStateHandlers.set(be.Eo.BeginnerModeActionUpdate,e=>{var t;this.socketActionController.onBeginnerModeActionUpdate(e),null===(t=this.uiGameManager)||void 0===t||t.gameStore.getState().gameBeginnerHint.setBeginnerActionState(e)}),this.gameStateHandlers.set(be.Eo.BeginnerModeLevelEnd,e=>{this.socketActionController.onBeginnerModeLevelEnd()}),this.gameStateHandlers.set(be.Eo.Vote,e=>{var t;const s=e.done?void 0:e;null===(t=this.uiGameManager)||void 0===t||t.gameStore.getState().gameVote.setVoteState(s)}),this.gameStateHandlers.set(be.Eo.SelectPlayer,e=>{this.socketActionController.onSelectPlayer(e)}),this.gameStateHandlers.set(be.Eo.ExchangeCards,e=>{this.socketActionController.onExchangeCards(e)}),this.gameStateHandlers.set(be.Eo.HighlightCorners,e=>{this.socketActionController.onHighlightCorners(e)}),this.gameStateHandlers.set(be.Eo.HighlightRoadEdges,e=>{this.socketActionController.onHighlightRoadEdges(e)}),this.gameStateHandlers.set(be.Eo.HighlightShipEdges,e=>{this.socketActionController.onHighlightShipEdges(e)}),this.gameStateHandlers.set(be.Eo.HighlightTiles,e=>{this.socketActionController.onHighlightTiles(e)}),this.gameStateHandlers.set(be.Eo.HighlightDiceNumbersForInventor,e=>{this.socketActionController.onHighlightDiceNumbersForInventor(e)}),this.gameStateHandlers.set(be.Eo.AmountOfCardsToDiscard,e=>{this.socketActionController.onAmountOfCardsToDiscard(e),Te.A9.play(Te.hc.DiscardNotification)}),this.gameStateHandlers.set(be.Eo.DiscardBroadcast,()=>{Te.A9.play(Te.hc.DiscardBroadcast)}),this.gameStateHandlers.set(be.Eo.SelectCardsToGiveToPlayer,e=>{this.socketActionController.onSelectCardsToGiveToPlayer(e),Te.A9.play(Te.hc.YourTurn)}),this.gameStateHandlers.set(be.Eo.CardsToSelectForDevelopmentCard,e=>{this.socketActionController.onCardsToSelectForDevelopmentCard(e)}),this.gameStateHandlers.set(be.Eo.SelectPlayerAndCard,e=>{this.socketActionController.onSelectPlayerAndCard(e)}),this.gameStateHandlers.set(be.Eo.CardsToSelectForPendingTransaction,e=>{this.socketActionController.onCardsToSelectForPendingTransaction(e)}),this.gameStateHandlers.set(be.Eo.ConfirmUseDevelopmentCard,e=>{this.socketActionController.onConfirmUseDevelopmentCard(e)}),this.gameStateHandlers.set(be.Eo.SelectPlayerUsingDevelopmentCard,e=>{this.socketActionController.onSelectPlayerUsingDevelopmentCard(e)}),this.gameStateHandlers.set(be.Eo.StealDevelopmentCardFromPlayer,e=>{this.socketActionController.onStealDevelopmentCardFromPlayer(e)}),this.gameStateHandlers.set(be.Eo.StealResourceCardFromPlayer,e=>{this.socketActionController.onStealResourceCardFromPlayer(e)}),this.gameStateHandlers.set(be.Eo.ClosePopupUI,()=>{this.socketActionController.onClosePopupUI()}),this.gameStateHandlers.set(be.Eo.SelectDice,e=>{this.socketActionController.onSelectDice(e)}),this.gameStateHandlers.set(be.Eo.RushInitialPlacementTimedOutAnalytic,e=>{var t,s;t=this.databaseGameId,s=e,n.CA.sendAnalyticEventsWithMobileDimensions({type:Pe.k0.RushInitialPlacementTimedOut,category:Pe.eX.Game,dimensions:{gameId:t,placementRound:s.placementRound,timeoutOutcome:s.timeoutOutcome}})}),this.gameStateHandlers.set(be.Eo.RobberPlacementResolvedAnalytic,e=>{const t=this.uiGameManager;if(null==t)return;const s=t.robberPlacementAnalyticController.consumeTiming();!function(e){const t="placed"==e.outcome?e.msSincePhaseStart:void 0,s="timedOut"==e.outcome?e.tileSelected:void 0;n.CA.sendAnalyticEventsWithMobileDimensions({type:Pe.k0.RobberPlacementResolved,category:Pe.eX.Game,dimensions:{gameId:e.gameId,trigger:e.trigger,outcome:e.outcome,msAllocated:e.msAllocated,msToFirstTap:e.msToFirstTap,msToConfirm:t,tileSelected:s}})}({gameId:this.databaseGameId,trigger:e.trigger,outcome:e.outcome,msAllocated:e.msAllocated,msToFirstTap:s.msToFirstTap,msSincePhaseStart:s.msSincePhaseStart,tileSelected:s.tileSelected})}),this.gameStateHandlers.set(be.Eo.CityImprovementStateUpdated,()=>{this.socketActionController.onCityImprovementStateUpdated()}),this.gameStateHandlers.set(be.Eo.ForceShowCityImprovementButtons,()=>{this.socketActionController.onForceShowCityImprovementButtons()}),this.gameStateHandlers.set(be.Eo.PlayTurnSound,()=>{Te.A9.play(Te.hc.YourTurn)}),this.gameStateHandlers.set(be.Eo.InfoMessage,e=>{new Ae({key:"strings:popups.informationView.title"},e)}),this.gameStateHandlers.set(be.Eo.ResetTradeStateAtEndOfTurn,e=>{this.socketActionController.onResetTradeStateAtEndOfTurn()}),this.gameStateHandlers.set(be.Eo.BoldTextInTradeWindow,e=>{this.socketActionController.onBoldTextInTradeWindow(e)}),this.gameStateHandlers.set(be.Eo.BuildGame,e=>{this.socketActionController.onBuildGame(e),this.playedStartGameSound||(Ie.playGameStartedSound(e.gameSettings.modeSetting),this.playedStartGameSound=!0)}),this.gameStateHandlers.set(be.Eo.GameStateUpdated,e=>{this.socketActionController.gameStateUpdated(e,!0)}),this.gameStateHandlers.set(be.Eo.GivePlayerResourcesFromTile,e=>{this.socketActionController.onGivePlayerResourcesFromTile(e)}),this.gameStateHandlers.set(be.Eo.RematchLink,e=>{window.location.hash=e,window.location.reload()}),this.gameStateHandlers.set(be.Eo.EndGameText,e=>{this.socketActionController.onEndGameText(e)}
1),this.gameStateHandlers.set(be.Eo.TogglePauseGame,e=>{this.socketActionController.onTogglePauseGame(e)}),this.gameStateHandlers.set(be.Eo.CanResignGame,e=>{var t;this.gameState.canResign=e,null===(t=this.uiGameManager)||void 0===t||t.setCanResign(e)}),this.gameStateHandlers.set(be.Eo.GameEndState,e=>{if(this.activeGameRoomMonitor.endGame(),null!=this.uiGameManager){if(this.uiGameManager.socketGameSend.endBeginnerModeLevel(),t.onGameEndState(e),s.disable(),this.gameClientRestorationController.disable(),this.uiGameManager.gameController.gameSettings.modeSetting==E.p9.ColonistRush4P){g.p.incrementRushGamesPlayed();this.uiGameManager.gameController.gameSettings.gameType==$.Cz.BotGame&&g.p.incrementRushBotGameCompletionCount()}n.CA.sendGoogleTagManagerEvent(n.CA.GoogleTagManagerEvent.GameFinished)}}),this.gameStateHandlers.set(be.Eo.ExitInitialPlacement,()=>{null!=this.uiGameManager&&Ie.playSettlementPhaseEndedSound(this.uiGameManager.gameController.gameSettings.modeSetting)}),this.gameStateHandlers.set(be.Eo.TradeFinalized,()=>{Te.A9.play(Te.hc.OfferAccepted)}),this.gameStateHandlers.set(be.Eo.TradeRejectedByAll,()=>{Te.A9.play(Te.hc.OfferRejected)}),this.gameStateHandlers.set(be.Eo.KnightPlaced,()=>{Te.A9.play(Te.hc.KnightPlace)}),this.gameStateHandlers.set(be.Eo.KarmaState,e=>{null!=this.uiGameManager&&(this.uiGameManager.gameController.gameSettings.karmaActive=e.isActive,this.uiGameManager.gameStore.getState().gameSettings.setIsKarmaActive(e.isActive),this.uiGameManager.gameStore.getState().setHasUsedDisableKarmaRequest(e.hasUsedDisableRequest))}),this.gameStateHandlers.set(be.Eo.KnightActivated,()=>{Te.A9.play(Te.hc.KnightEquip)}),this.gameStateHandlers.set(be.Eo.KnightUpgraded,()=>{Te.A9.play(Te.hc.KnightUpgrade)}),this.gameStateHandlers.set(be.Eo.PlayerReconnected,()=>{Te.A9.play(Te.hc.Reconnect)}),this.gameStateHandlers.set(be.Eo.PlayerDisconnected,()=>{Te.A9.play(Te.hc.Disconnect)}),this.gameStateHandlers.set(be.Eo.SpectatorChatMessage,e=>{var t;null===(t=this.uiGameManager)||void 0===t||t.addSpectatorMessage(e)}),this.gameStateHandlers.set(be.Eo.ResetBeginnerModeLevel,()=>{g.p.resetBeginnerModeLevel()}),this.gameStateHandlers.set(be.Eo.SendBroadcast,e=>{vt.show(e.text,de.n.Information)}),this.gameStateHandlers.set(be.Eo.Ping,()=>{var e;null===(e=this.socketActionController.uiGameManager)||void 0===e||e.socketGameSend.pong()}),this.gameStateHandlers.set(be.Eo.TriggerClientGameStateReset,()=>{this.restoreGameClientWithoutClosingSocket()})}}var Me=s(46456);const _e=$.zd.ShuffleState;class Ee{constructor(e){this.shuffleStateHandlers=new Map,e.setStateHandler($.zd.State.ShuffleStateUpdate,e=>{var t;null===(t=this.shuffleStateHandlers.get(e.type))||void 0===t||t(e.payload)}),this.shuffleStateHandlers.set(_e.ShuffleQueueData,e=>{Me.y.updateQueueData(e)}),this.shuffleStateHandlers.set(_e.ShufflePlayerData,e=>{Me.y.updatePlayerData(e)})}}if(837!=s.j)var De=s(43126);const Le=$.zd.State;class Be{activate(){this.active||(this.active=!0,this.startMonitoringLatency())}startMonitoringLatency(){this.active&&(null!=this.timer&&(this.stats.reconnects+=1),this.stopMonitoringLatency(),this.timer=setInterval(()=>this.sendPing(),1e3))}sendPing(){const e=Date.now();this.pingTimestamps.add(e),this.controller.sender.sendPing(e)}stopMonitoringLatency(){clearInterval(this.timer),this.pingTimestamps.clear()}handlePong(e){var t,s;const i=Date.now(),n=e.timestamp;if(!this.pingTimestamps.has(n))return;const r=Math.round((i-n)/2);this.lastLatency=r;const o=xe(r);var a;null!==(a=(t=this.stats.buckets)[s=o])&&void 0!==a||(t[s]=0),this.stats.buckets[o]+=1,r<=500?this.stats.low+=1:r<=1500?this.stats.medium+=1:r<=5e3?this.stats.high+=1:this.stats.dropped+=1,this.pingTimestamps.delete(n)}getFinalStats(){const e=(0,De.A)(this.stats);for(const n of this.pingTimestamps){var t,s;const r=xe(Date.now()-n);var i;null!==(i=(t=e.buckets)[s=r])&&void 0!==i||(t[s]=0),e.buckets[r]+=1}return e}constructor(e){this.pingTimestamps=new Set,this.lastLatency=0,this.active=!1,this.controller=e,this.stats={reconnects:0,low:0,medium:0,high:0,dropped:0,buckets:{}},this.controller.registerSessionEstablishedObserver(()=>this.startMonitoringLatency()),this.controller.registerSocketCloseObserver(()=>this.stopMonitoringLatency()),this.controller.setStateHandler(Le.SocketMonitorUpdate,e=>this.handlePong(e))}}function xe(e){return 100*Math.round(e/100)}
1if(837!=s.j)var Oe=s(93640);var Ge=s(46581);class Fe{static deserialize(e){const t=new Fe;return t.updateSequence=e.updateSequence,t.gameSetting=e.gameSetting,t.isTournament=e.isTournament,t.hostSession=e.hostSession,t.isTestFreeExpansionsAndMaps=e.isTestFreeExpansionsAndMaps,t.creationPhase=e.creationPhase,t.guests=e.guests,t.victoryPointsRecommendedLimit=e.victoryPointsRecommendedLimit,t.victoryPointsMaxAllowed=e.victoryPointsMaxAllowed,t.kickedUserIds=[...e.kickedUserIds],t}getSessionCount(){return this.guests.length+1}getSessions(){return[...this.guests,this.hostSession]}getGuestSessions(){return[...this.guests]}getUsernames(){return this.getSessions().map(e=>e.username)}getUserIds(){return this.getSessions().map(e=>e.userId).filter(e=>null!=e)}isInRoom(e){for(const t of this.getSessions())if(t.userSessionId==e.userSessionId)return!0;return!1}isMultiplayer(){for(const e of this.getGuestSessions())if(!e.isBot)return!0;return!1}isHost(e){return e==this.hostSession.userSessionId}isHostSubscribed(){return this.hostSession.isMember}isGuest(e){return e!=this.hostSession.userSessionId}isPrivateGame(){return this.gameSetting.privateGame}isNoTrollsGame(){return this.gameSetting.minimumKarma==Ge.Zt.NO_TROLLS_KARMA_THRESHOLD}constructor(){this.creationPhase=p.yF.EditSettings,this.victoryPointsRecommendedLimit=Ge.Zt.DEFAULT_VP_TO_WIN}}var Ue=s(55935);const Ne=$.mt.RoomInfoMessage;class He{onRoomStateUpdated(e){this.protocol.onEvent("stateUpdated",t=>{this.activeGameRoomMonitor.enterRoom();const s=t.sessions.map(e=>({roomSessionId:e.roomSessionId,userSessionId:e.userSessionId,userId:e.userId,isBot:e.isBot,isReadyToPlay:e.isReadyToPlay,selectedColor:We[e.selectedColor],username:e.username,isMember:e.isMember,isLoggedIn:e.isLoggedIn,icon:e.icon,profilePictureUrl:e.profilePictureUrl,karmaCompletedGames:e.karmaCompletedGames,karmaTotalGames:e.karmaTotalGames,availableColors:e.availableColors.map(e=>We[e]),botDifficulty:null==e.botDifficulty?void 0:et[e.botDifficulty]}));e(Fe.deserialize({updateSequence:t.updateSequence,gameSetting:{id:t.roomId,privateGame:t.private,playOrderSelectionActive:t.playOrderSelectionActive,minimumKarma:t.minimumKarma,modeSetting:qe[t.gameMode],mapSetting:je[t.map],diceSetting:$e[t.diceType],victoryPointsToWin:t.victoryPointsToWin,cardDiscardLimit:t.cardDiscardLimit,maxPlayers:t.maxPlayers,gameSpeed:Ze[t.gameSpeed],botSpeed:Je[t.botSpeed],hideBankCards:t.hiddenBankCards,friendlyRobber:t.friendlyRobber},isTournament:t.isTournament,isTestFreeExpansionsAndMaps:t.isTestFreeExpansionsAndMaps,victoryPointsRecommendedLimit:t.victoryPointsRecommendedLimit,victoryPointsMaxAllowed:t.victoryPointsMaxAllowed,kickedUserIds:t.kickedUserIds,creationPhase:st[t.creationPhase],hostSession:s[0],guests:s.slice(1)}))})}onInfoMessageUpdated(e){this.protocol.onEvent("infoMessageUpdated",({messageType:t})=>{e(tt[t])})}onSeedOrderSelected(e){this.protocol.onEvent("seedOrderSelected",({seedOrder:t})=>{e({seedOrder:t.map(e=>[e[0],We[e[1]]])})})}onPlayOrderSelected(e){this.protocol.onEvent("playOrderSelected",({mapState:t,currentSelector:s,playOrder:i})=>{e({mapState:t,currentSelector:We[s],playOrder:i.map(e=>[We[e[0]],e[1]])})})}onGotKicked(e){this.protocol.onEvent("gotKicked",({roomId:t,canRejoin:s})=>{e(t,s)})}onFailedToStartGameMembershipRequired(e,t=!1){t&&this.protocol.removeListener("failedToStartGameMembershipRequired"),this.protocol.onEvent("failedToStartGameMembershipRequired",e)}onReceivedChatMessage(e){this.protocol.onEvent("receivedChatMessage",({message:t,senderUsername:s,senderIcon:i})=>{e(t,s,i)})}onInvalidPlayerCountEncountered(e){this.protocol.onEvent("invalidPlayerCountEncountered",({playerCount:t,missingExtension:s})=>{e(t,s)})}onFailedToReducePlayerCount(e){this.protocol.onEvent("failedToReducePlayerCount",()=>{e()})}onFailedToStartGameBecauseServerIsUpdating(e){this.protocol.onEvent("failedToStartGameBecauseServerIsUpdating",()=>{e()})}onFailedToStartGamePlayersNotReady(e){this.protocol.onEvent("failedToStartGamePlayersNotReady",({players:t})=>{e(t)})}onFailedToSelectUsedColor(e){this.protocol.onEvent("failedToSelectUsedColor",()=>{e()})}onFailedToExecuteCommandGameStarting(e){this.protocol.onEvent("failedToExecuteCommandGameStarting",()=>{e()})}onFailedToSetGameSpeed(e){this.protocol.onEvent("failedToSetGameSpeed",()=>{e()})}onKickedInactiveHost(e){this.protocol.onEvent("kickedInactiveHost",()=>{e()})}onFailedToSendChatMessage(e){this.protocol.onEvent("failedToSendChatMessage",({reason:t,mutedUntil:s})=>{e(t,s)})}onReceivedChatResponse(e){this.protocol.onEvent("receivedChatResponse",({response:t})=>{e(t)})}setReadyToStart(e){this.protocol.send("setReadyToStart",{ready:e})}selectColor(e,t){t!==Ue.DS.None&&this.protocol.send("selectColor",{roomSessionId:e,color:Ke[t]})}startGame(){this.protocol.send("startGame",{clientVersion:E.$m})}startSeedOrderSelection(){this.protocol.send("startSeedOrderSelection",{})}kickPlayer(e){this.protocol.send("kickPlayer",{roomSessionId:e})}
1addBot(){this.protocol.send("addBot",{})}setBotDifficulty(e,t){this.protocol.send("setBotDifficulty",{roomSessionId:e,botDifficulty:Xe[t]})}setPrivateGame(e){this.protocol.send("setPrivateGame",{privateGame:e})}toggleNoTrolls(){this.protocol.send("toggleNoTrolls",{})}togglePlayOrderSelection(){this.protocol.send("togglePlayOrderSelection",{})}setGameMode(e){this.protocol.send("setGameMode",{gameMode:Ve[e]})}setMap(e){this.protocol.send("setMap",{map:Qe[e]})}setDiceType(e){this.protocol.send("setDiceType",{diceType:ze[e]})}setVictoryPointsToWin(e){this.protocol.send("setVictoryPointsToWin",{victoryPoints:e})}setGameSpeed(e){this.protocol.send("setGameSpeed",{gameSpeed:Ye[e]})}setCardDiscardLimit(e){this.protocol.send("setCardDiscardLimit",{limit:e})}setFriendlyRobber(e){this.protocol.send("setFriendlyRobber",{friendlyRobber:e})}setHideBankCards(e){this.protocol.send("setHiddenBankCards",{hiddenBankCards:e})}setMaxPlayers(e){this.protocol.send("setMaxPlayers",{maxPlayers:e})}setSeedOrder(e,t){e!==Ue.DS.None&&this.protocol.send("setSeedOrder",{color:Ke[e],order:t})}setPlayOrder(e){this.protocol.send("setPlayOrder",{order:e})}startPlayOrderSelection(){this.protocol.send("startPlayOrderSelection",{})}leave(){this.activeGameRoomMonitor.leaveRoom(),this.protocol.send("leave",{})}submitChatText(e){this.protocol.send("submitChatText",{text:e})}constructor({protocol:e,activeGameRoomMonitor:t}){this.protocol=e,this.activeGameRoomMonitor=t}}const Ke={[Ue.DS.Blue]:"blue",[Ue.DS.Bronze]:"bronze",[Ue.DS.Gold]:"gold",[Ue.DS.Green]:"green",[Ue.DS.MysticBlue]:"mysticBlue",[Ue.DS.Orange]:"orange",[Ue.DS.Pink]:"pink",[Ue.DS.Purple]:"purple",[Ue.DS.Red]:"red",[Ue.DS.Silver]:"silver",[Ue.DS.White]:"white",[Ue.DS.Black]:"black"},We={blue:Ue.DS.Blue,bronze:Ue.DS.Bronze,gold:Ue.DS.Gold,green:Ue.DS.Green,mysticBlue:Ue.DS.MysticBlue,orange:Ue.DS.Orange,pink:Ue.DS.Pink,purple:Ue.DS.Purple,red:Ue.DS.Red,silver:Ue.DS.Silver,white:Ue.DS.White,black:Ue.DS.Black},Ve={[E.p9.Classic4P]:"classic4P",[E.p9.TutorialClassic4P]:"tutorialClassic4P",[E.p9.Classic56P]:"classic56P",[E.p9.Classic78P]:"classic78P",[E.p9.Seafarers4P]:"seafarers4P",[E.p9.Seafarers56P]:"seafarers56P",[E.p9.CitiesAndKnights4P]:"citiesAndKnights4P",[E.p9.CitiesAndKnights56P]:"citiesAndKnights56P",[E.p9.CitiesAndKnightsSeafarers4P]:"citiesAndKnightsSeafarers4P",[E.p9.CitiesAndKnightsSeafarers56P]:"citiesAndKnightsSeafarers56P",[E.p9.ServerStressTestClassic4P]:"serverStressTestClassic4P",[E.p9.BeginnerModeClassic4P]:"beginnerModeClassic4P",[E.p9.ColonistRush4P]:"colonistRush"},qe={classic4P:E.p9.Classic4P,tutorialClassic4P:E.p9.TutorialClassic4P,classic56P:E.p9.Classic56P,classic78P:E.p9.Classic78P,seafarers4P:E.p9.Seafarers4P,seafarers56P:E.p9.Seafarers56P,citiesAndKnights4P:E.p9.CitiesAndKnights4P,citiesAndKnights56P:E.p9.CitiesAndKnights56P,citiesAndKnightsSeafarers4P:E.p9.CitiesAndKnightsSeafarers4P,citiesAndKnightsSeafarers56P:E.p9.CitiesAndKnightsSeafarers56P,serverStressTestClassic4P:E.p9.ServerStressTestClassic4P,beginnerModeClassic4P:E.p9.BeginnerModeClassic4P,colonistRush:E.p9.ColonistRush4P},Qe={[E.Qy.Classic4P]:"classic4P",[E.Qy.TutorialClassic4P]:"tutorialClassic4P",[E.Qy.Classic4PRandom]:"classic4PRandom",[E.Qy.Classic56P]:"classic56P",[E.Qy.Classic78P]:"classic78P",[E.Qy.SS1HeadingForNewShores3P]:"sS1HeadingForNewShores3P",[E.Qy.SS1HeadingForNewShores4P]:"sS1HeadingForNewShores4P",[E.Qy.SS1HeadingForNewShores56P]:"sS1HeadingForNewShores56P",[E.Qy.TutorialSS1HeadingForNewShores4P]:"tutorialSS1HeadingForNewShores4P",[E.Qy.SS2FourIslands3P]:"sS2FourIslands3P",[E.Qy.SS2FourIslands4P]:"sS2FourIslands4P",[E.Qy.SS2SixIslands56P]:"sS2SixIslands56P",[E.Qy.TutorialSS2FourIslands4P]:"tutorialSS2FourIslands4P",[E.Qy.SS3FogIslands3P]:"sS3FogIslands3P",[E.Qy.SS3FogIslands4P]:"sS3FogIslands4P",[E.Qy.SS3FogIslands56P]:"sS3FogIslands56P",[E.Qy.TutorialSS3FogIsland4P]:"tutorialSS3FogIsland4P",[E.Qy.SS4ThroughTheDesert3P]:"sS4ThroughTheDesert3P",[E.Qy.SS4ThroughTheDesert4P]:"sS4ThroughTheDesert4P",[E.Qy.SS4ThroughTheDesert56P]:"sS4ThroughTheDesert56P",[E.Qy.TutorialSS4ThroughTheDesert4P]:"tutorialSS4ThroughTheDesert4P",[E.Qy.KingOfTheHill]:"kingOfTheHill",[E.Qy.Earth]:"earth",[E.Qy.EarthSeafarers]:"earthSeafarers",[E.Qy.USA]:"uSA",[E.Qy.UK]:"uK",[E.Qy.UKSeafarers]:"uKSeafarers",[E.Qy.Diamond]:"diamond",[E.Qy.Gear]:"gear",[E.Qy.Lakes]:"lakes",[E.Qy.Pond]:"pond",[E.Qy.Twirl]:"twirl",[E.Qy.ShuffleBoard]:"shuffleBoard",[E.Qy.BlackForest]:"blackForest",[E.Qy.Volcano]:"volcano",[E.Qy.Circle]:"circle",[E.Qy.Kite]:"kite",[E.Qy.Romania]:"romania",[E.Qy.MiniBase]:"miniBase",[E.Qy.Monopoly]:"monopoly",[E.Qy.MountainOfRiches]:"mountainOfRiches",[E.Qy.Doggo]:"doggo",[E.Qy.Duel]:"duel",[E.Qy.TradeIslands]:"tradeIslands",[E.Qy.TradeIslandsSeafarers]:"tradeIslandsSeafarers",[E.Qy.Vietnam]:"vietnam",[E.Qy.TurningTidesSeafarers]:"turningTidesSeafarers",[E.Qy.TurningTidesClassic]:"turningTidesClassic",[E.Qy.TwoIsles]:"twoIsles",[E.Qy.JellyFish]:"jellyFish",[E.Qy.GoldRush]:"goldRush",[E.Qy.Istanbul]:"istanbul",[E.Qy.IstanbulSeafarers]:"istanbulSeafarers",[E.Qy.Europe]:"europe",[E.Qy.EuropeSeafarers]:"europeSeafarers",[E.Qy.Stripes]:"stripes",[E.Qy.MonopolyIslands]:"monopolyIslands",[E.Qy.MonopolyIslandsSeafarers]:"monopolyIslandsSeafarers",[E.Qy.CampaignLevel1]:"campaignLevel1",[E.Qy.CampaignLevel2]:"campaignLevel2",[E.Qy.CampaignRoadRace]:"campaignRoadRace",[E.Qy.CampaignRoadRace2]:"campaignRoadRace2"},je={classic4P:E.Qy.Classic4P,tutorialClassic4P:E.Qy.TutorialClassic4P,classic4PRandom:E.Qy.Classic4PRandom,classic56P:E.Qy.Classic56P,classic78P:E.Qy.Classic78P,sS1HeadingForNewShores3P:E.Qy.SS1HeadingForNewShores3P,sS1HeadingForNewShores4P:E.Qy.SS1HeadingForNewShores4P,sS1HeadingForNewShores56P:E.Qy.SS1HeadingForNewShores56P,tutorialSS1HeadingForNewShores4P:E.Qy.TutorialSS1HeadingForNewShores4P,sS2FourIslands3P:E.Qy.SS2FourIslands3P,sS2FourIslands4P:E.Qy.SS2FourIslands4P,sS2SixIslands56P:E.Qy.SS2SixIslands56P,tutorialSS2FourIslands4P:E.Qy.TutorialSS2FourIslands4P,sS3FogIslands3P:E.Qy.SS3FogIslands3P,sS3FogIslands4P:E.Qy.SS3FogIslands4P,sS3FogIslands56P:E.Qy.SS3FogIslands56P,tutorialSS3FogIsland4P:E.Qy.TutorialSS3FogIsland4P,sS4ThroughTheDesert3P:E.Qy.SS4ThroughTheDesert3P,sS4ThroughTheDesert4P:E.Qy.SS4ThroughTheDesert4P,sS4ThroughTheDesert56P:E.Qy.SS4ThroughTheDesert56P,tutorialSS4ThroughTheDesert4P:E.Qy.TutorialSS4ThroughTheDesert4P,kingOfTheHill:E.Qy.KingOfTheHill,earth:E.Qy.Earth,earthSeafarers:E.Qy.EarthSeafarers,uSA:E.Qy.USA,uK:E.Qy.UK,uKSeafarers:E.Qy.UKSeafarers,diamond:E.Qy.Diamond,gear:E.Qy.Gear,lakes:E.Qy.Lakes,pond:E.Qy.Pond,twirl:E.Qy.Twirl,shuffleBoard:E.Qy.ShuffleBoard,blackForest:E.Qy.BlackForest,volcano:E.Qy.Volcano,circle:E.Qy.Circle,kite:E.Qy.Kite,romania:E.Qy.Romania,miniBase:E.Qy.MiniBase,monopoly:E.Qy.Monopoly,mountainOfRiches:E.Qy.MountainOfRiches,doggo:E.Qy.Doggo,duel:E.Qy.Duel,tradeIslands:E.Qy.TradeIslands,tradeIslandsSeafarers:E.Qy.TradeIslandsSeafarers,vietnam:E.Qy.Vietnam,turningTidesSeafarers:E.Qy.TurningTidesSeafarers,turningTidesClassic:E.Qy.TurningTidesClassic,twoIsles:E.Qy.TwoIsles,jellyFish:E.Qy.JellyFish,goldRush:E.Qy.GoldRush,istanbul:E.Qy.Istanbul,istanbulSeafarers:E.Qy.IstanbulSeafarers,europe:E.Qy.Europe,europeSeafarers:E.Qy.EuropeSeafarers,stripes:E.Qy.Stripes,monopolyIslands:E.Qy.MonopolyIslands,monopolyIslandsSeafarers:E.Qy.MonopolyIslandsSeafarers,campaignLevel1:E.Qy.CampaignLevel1,campaignLevel2:E.Qy.CampaignLevel2,campaignRoadRace:E.Qy.CampaignRoadRace,campaignRoadRace2:E.Qy.CampaignRoadRace2},ze={[E.ZP.Random]:"random",[E.ZP.Balanced]:"balanced",[E.ZP.StressTestSequence]:"stressTestSequence",[E.ZP.PredefinedDiceSequenceDeleted]:"predefinedDiceSequenceDeleted"},$e={random:E.ZP.Random,balanced:E.ZP.Balanced,stressTestSequence:E.ZP.StressTestSequence,predefinedDiceSequenceDeleted:E.ZP.PredefinedDiceSequenceDeleted},Ye={[Ge.ro.Base15s]:"base15s",[Ge.ro.Base30s]:"base30s",[Ge.ro.Base60s]:"base60s",[Ge.ro.Base120s]:"base120s",[Ge.ro.Base240s]:"base240s",[Ge.ro.Base12000s]:"base12000s",[Ge.ro.Rush5s]:"rush5s",[Ge.ro.Rush8s]:"rush8s",[Ge.ro.Rush10s]:"rush10s",[Ge.ro.Rush15s]:"rush15s",[Ge.ro.Rush20s]:"rush20s"},Ze={base15s:Ge.ro.Base15s,base30s:Ge.ro.Base30s,base60s:Ge.ro.Base60s,base120s:Ge.ro.Base120s,base240s:Ge.ro.Base240s,base12000s:Ge.ro.Base12000s,rush5s:Ge.ro.Rush5s,rush8s:Ge.ro.Rush8s,rush10s:Ge.ro.Rush10s,rush15s:Ge.ro.Rush15s,rush20s:Ge.ro.Rush20s},Je=(Ge.K4.Fast,Ge.K4.Normal,Ge.K4.Slow,{fast:Ge.K4.Fast,normal:Ge.K4.Normal,slow:Ge.K4.Slow}),Xe={[Ge.R1.BotEasy]:"easy",[Ge.R1.BotMedium]:"medium",[Ge.R1.BotHard]:"hard"},et={easy:Ge.R1.BotEasy,medium:Ge.R1.BotMedium,hard:Ge.R1.BotHard},tt={none:Ne.None,clickReady:Ne.ClickReady,premiumItemSelected:Ne.PremiumItemSelected},st={settings:p.yF.EditSettings,playOrder:p.yF.PlayOrderSelection,seedOrder:p.yF.SeedOrderSelection};if(837!=s.j)var it=s(94226);var nt=s(53829);class rt{connect(){this.controller.enableConnect(),this.reconnectionController.start()}constructor(e){this.actionController=e,this.controller=new ie(I.l.socketServerWSS()),this.reconnectionController=new re(this.controller),this.activeGameRoomMonitor=new Oe.i,this.gameListener=new Ie({socketController:this.controller,socketActionController:this.actionController,socketReconnectionController:this.reconnectionController,activeGameRoomMonitor:this.activeGameRoomMonitor}),this.lobbyListener=new Se(this.controller,this.actionController),this.shuffleListener=new Ee(this.controller),this.monitor=new Be(this.controller),this.reconnectionControllers=[this.reconnectionController,this.gameListener.gameClientRestorationController],this.controller.setStateHandler($.zd.State.RoomEvent,e=>{this.roomProtocolClient.emitEvent(e.type,e)}),this.controller.setStateHandler($.zd.State.MatchmakingEvent,e=>{this.matchmakingProtocolClient.emitEvent(e.type,e)});this.roomProtocolClient=new it.c(e=>{this.controller.sender.sendToServerType(E.lo.RoomCommand,"lobby",e)}),this.roomClient=new He({protocol:this.roomProtocolClient,activeGameRoomMonitor:this.activeGameRoomMonitor}),this.matchmakingProtocolClient=new it.c(e=>{this.controller.sender.sendToServerType(E.lo.MatchmakingCommand,"lobby",e,["joinQueue","leaveCurrentQueue"].includes(e.type))}),this.matchmakingClient=new nt.b(this.matchmakingProtocolClient)}}var ot=s(2658),at=s(85801);class ct{observe(e){e.onTriggered(()=>ct.removeDisconnectBanners()),e.onStarted(()=>this.handleStarted()),e.onMaxDisconnectExceeded(()=>ct.handleMaxDisconnectExceeded()),e.onConnected(()=>this.handleConnected()),e.onFailed(()=>this.handleFailed())}handleStarted(){this.timeDisconnected=Date.now(),this.showReconnectingOverlay()}get canDisplayOverlay(){return!!this.isAnyReconnecting&&(!!this.activeGameRoomMonitor.isInActiveGameOrRoom||this.commandQueuer.isPrimaryCommandQueued)}showReconnectingOverlay(){this.canDisplayOverlay&&ot.D.show({key:"strings:game.gameState.gameLogs.gameDisconnected.reconnecting"})}static handleMaxDisconnectExceeded(){i.r.isUserOnMobileAppOrWeb||ct.displayReconnectBanner()}handleFailed(){this.removeUI(),ct.displayReconnectBanner()}handleConnected(){at.N.instance.clearAllKeyBinds(),this.canDisplayOverlay||this.removeWarnings()}get isAnyReconnecting(){return this.reconnectionControllers.some(e=>e.isReconnecting)}static removeDisconnectBanners(){null==vt||vt.removeDisconnectBanners()}static displayReconnectBanner(){null==vt||vt.removeSocketErrorBanners();const e={key:"strings:homePage.loadingError.prompt",options:{context:i.r.isUserOnDiscord||i.r.isUserOnMobileAppOrWeb?"activity":"browser"}};if(i.r.socketDebugActive&&(0,J.vV)("connect",[e]),bt.serverUpdated){const e={key:"strings:popups.errors.newVersion.newVersionReleasedWarningLostConnection"};null==vt||vt.show(e,de.n.SocketError,e,void 0,void 0,!1)}else null==vt||vt.show(e,de.n.SocketError,{key:"strings:colonistCommon.buttons.reload"},()=>location.reload(),void 0,!1)}removeWarnings(){var e;const t=null!==(e=this.timeDisconnected)&&void 0!==e?e:Date.now(),s=v.R$.secondsAsMilliseconds(1),i=Date.now()-t;setTimeout(()=>{this.removeUI()},s-i),this.timeDisconnected=void 0}removeUI(){this.canDisplayOverlay||(ot.D.remove(),null==vt||vt.removeSocketErrorBanners())}constructor({reconnectionControllers:e,commandQueuer:t,activeGameRoomMonitor:s}){this.reconnectionControllers=e,this.commandQueuer=t,this.activeGameRoomMonitor=s;for(const t of e)this.observe(t);t.onPrimaryCommandQueued(()=>this.showReconnectingOverlay())}}class lt{start(){this.createElements(),this.updateTimer=setInterval(()=>this.update(),100),yt.monitor.activate()}stop(){clearInterval(this.updateTimer),this.container.remove()}createElements(){this.container=(0,O.Le)(document.body,""),this.container.style.position="absolute",this.container.style.backgroundColor="gray",this.container.style.display="flex",this.container.style.opacity="0.9",this.container.style.top="5px",this.container.style.left="5px",this.container.style.zIndex="99999999",(0,O.G0)(this.container,()=>{console.log("Socket stats",yt.monitor.getFinalStats())}),this.mediumLatency=(0,O.Le)(this.container,"hidden"),this.mediumLatency.title="Medium latency pings",this.mediumLatency.style.marginRight="5px",this.mediumLatency.style.color="orange",this.highLatency=(0,O.Le)(this.container,"hidden"),this.highLatency.title="High latency pings",this.highLatency.style.marginRight="5px",this.highLatency.style.color="red",this.droppedLatency=(0,O.Le)(this.container,"hidden"),this.droppedLatency.title="Dropped pings",this.droppedLatency.style.marginRight="5px",this.droppedLatency.style.color="red",this.reconnects=(0,O.Le)(this.container,"hidden"),this.reconnects.title="Reconnects",this.reconnects.style.marginRight="5px",this.reconnects.style.color="red",this.latency=(0,O.Le)(this.container,""),this.latency.title="Last latency reading",this.latency.style.minWidth="65px",this.latency.style.textAlign="right"}update(){const e=yt.monitor.stats;this.mediumLatency.textContent=`${e.medium}`,this.mediumLatency.classList.toggle("hidden",0==e.medium),this.highLatency.textContent=`${e.high}`,this.highLatency.classList.toggle("hidden",0==e.high),this.droppedLatency.textContent=`${e.dropped}`,this.droppedLatency.classList.toggle("hidden",0==e.dropped),this.reconnects.textContent=`${e.reconnects}`,this.reconnects.classList.toggle("hidden",0==e.reconnects);const t=10*Math.ceil(yt.monitor.lastLatency/10);this.latency.textContent=`${t}ms`}}window.startSocketMonitor=()=>{const e=new lt;return e.start(),e};var dt=s(13359),ut=s(90676),ht=s(96990);class pt{static handlePlatformRedirection(){ht.N.isUserOnMobileWebBrowser()&&(this.shouldSkipAnyRedirection()||this.handleRedirectToMobileWeb())}static isUserOnLandingPage(){var e,t,s;if(!dt.q.isUrlPathRoot())return!1;if(this.isOnMobilePath())return!1;if(null===(e=r._.userState)||void 0===e?void 0:e.isLoggedIn)return!1;return!((null!==(s=null===(t=r._.userState)||void 0===t?void 0:t.totalCompletedGameCount)&&void 0!==s?s:0)>0)}static shouldSkipAnyRedirection(){if(!ht.N.isUserOnMobileDevice()
1)return!0;if(ht.N.isUserOnTabletDevice())return!0;if(this.isUserOnLandingPage()){return null==dt.q.getRoomIdFromUrl()}if(window.location.pathname.includes("/catan-rules"))return!0;return!!window.location.pathname.includes("/timer")}static isOnMobilePath(){return window.location.pathname.includes("/mobile")}static handleRedirectToMobileWeb(){if(g.p.setPortraitGamePlayEnabled(!0),this.isOnMobilePath())return;const e=dt.q.getLanguagePrefix()+"/mobile"+dt.q.getRelativeUrlWithoutLanguagePrefix();window.location.href=this.removeTrailingSlash(e)}static removeTrailingSlash(e){return e.replace(/\/([?#])/,"$1")}}if(837!=s.j)var mt=s(87069);let gt,ft,yt,vt,St,bt,Ct;class Pt{async initializeSoundAndVersionController(){k.j.setVersionNumber(i.r.versionNumber),Pt.initializeAudio(),await n.CA.initLogRocket(),n.CA.initializeSessionRecorder(),gt=new P(g.p.getVersionNo,i.r.versionNumber,g.p.setVersionNo)}initializeGameManager(e){ft=e}initializeUIManagerEvents(e){kt(e)}static initializeSocket(e){yt=new rt(e),new ct({reconnectionControllers:yt.reconnectionControllers,commandQueuer:yt.controller.sender,activeGameRoomMonitor:yt.activeGameRoomMonitor}),yt.controller.registerSessionEstablishedObserver(()=>{null==vt||vt.removeSocketErrorBanners()})}static initializeNotification(e){vt=e}completeInitialization(){L.displayAllPendingNotifications(),W.S.init(),m.init()}static async initializeEntry(){await o.aA.init();if(!await r._.init()){(0,ae.B)({title:{key:"strings:popups.errors.initializationError.title"},body:{key:"strings:popups.errors.initializationError.initializationFailed"},onConfirm:()=>window.location.reload()});const e=2147483647;await(0,v.cb)(e)}pt.handlePlatformRedirection(),r._.registerChangeListener(()=>{G.init(),F.init(),this.scheduleAdSdkLoading(),this.eagerlyObtainTurnstilePreClearance()}),T.Zt.initProducts(i.r.discordSKUIds),K.Z.initProducts(i.r.discordSKUIds),A.AB.initProducts(i.r.discordSKUIds),w.f.initProducts(i.r.discordSKUIds),R.N.fetchShouldShowFeedbackForm(),St=B.a.createTabCommunication(),St.onEvent(B.s.ReloadWebsite,()=>window.location.reload()),(0,ut.Dc)()}static scheduleAdSdkLoading(){(0,mt.O)(()=>{N.init(),H.init()})}initializeSentry(){const e="localhost"===window.location.hostname,t=i.r.isUserOnMobileAppOrWeb?i.r.mobileAppSentryDSN:i.r.frontendSentryDSN;if(e||!t)return void(window.onunhandledrejection=e=>{e.reason instanceof E.lc&&e.preventDefault()});a.Ts({dsn:t,release:`Colonist:v${i.r.versionNumber}`,integrations:[c.dp()],tracesSampleRate:i.r.frontendSentryTraceSampleRate,replaysSessionSampleRate:.5,replaysOnErrorSampleRate:.5,allowUrls:[window.location.hostname],environment:i.r.frontendSentryEnvironment,ignoreErrors:[/^AbortError$/],beforeSend:(e,t)=>{var s,i,n,o,a,c;return"Failed to start the audio device"===(e.message||(null===(n=e.exception)||void 0===n||null===(i=n.values)||void 0===i||null===(s=i[0])||void 0===s?void 0:s.value))?null:(null!==(l=(c=e).user)&&void 0!==l||(c.user={}),(null===(o=r._.userState)||void 0===o?void 0:o.id)&&(e.user.id=r._.userState.id),(null===(a=r._.userState)||void 0===a?void 0:a.username)&&(e.user.username=r._.userState.username),e);var l},beforeSendTransaction:function(e){if(null==e.spans)return null;return e.spans=e.spans.filter(e=>{if(null==e.timestamp)return!0;switch(e.origin){case"auto.ui.browser.metrics":return e.timestamp-e.start_timestamp>.05;case"auto.resource.browser.metrics":return e.timestamp-e.start_timestamp>.25}return!0}),e}}),Pt.lazyLoadSentryReplay()}static async lazyLoadSentryReplay(){if(!(Math.random()>=.001))try{const e=await l.b("replayIntegration");d.Q8(e({maskAllText:!1,blockAllMedia:!1}))}catch(e){(0,J.vV)("EntryShared.lazyLoadSentryReplay",[e])}}static sendPageVisitAnalyticEvent(e){const t=null!=e?e:dt.q.getPathnameWithoutLanguagePrefix(),s={type:Pe.k0.PageVisit,category:Pe.eX.PageVisit,stringValue:t};n.CA.sendAnalyticEvent(s)}static eagerlyObtainTurnstilePreClearance(){if(i.r.isUserOnDiscord)return;null==r._.userState&&!r._.isStale()&&ee.F.obtainPreClearanceCookie()}static initializeAudio(){const e=g.p.getEffectiveVolume(),t=y.getHasUserInteracted();Te.A9.init({volume:e,startAudioContextOnInit:t}),this.initializeUserInteractionTracking()}static initializeUserInteractionTracking(){document.addEventListener("click",()=>y.setHasUserInteracted(!0),{once:!0})}constructor(){this.initializeSentry(),bt=new x.S,async function(){if("serviceWorker"
1in navigator)try{const e=`${i.r.isUserOnDiscord?"/.proxy/":"/"}service-worker${i.r.isUserOnMobile?"?mobile":""}`;await navigator.serviceWorker.register(e)}catch(e){(0,J.vV)("registerServiceWorker",[`Service Worker registration failed with error: '${e}'`])}}(),Pt.sendPageVisitAnalyticEvent()}}function kt(e){Ct=e}},55803:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_check.25cd255d370bed6f507b.svg"},55828:(e,t,s)=>{"use strict";e.exports=s.p+"assets/settlement_red.22949197b57f9cfd968b.svg"},55853:(e,t,s)=>{"use strict";s.d(t,{Y:()=>u});var i=s(36872),n=s(9127),r=s(34668),o=s(75589),a=s(72239),c=s(4508),l=s(55547),d=s(16611);class u{init(){l.sZ.controller.registerSessionEstablishedObserver(()=>{this.removeAllInvites(),u.registerToFriendService()})}static registerToFriendService(){r.Q.registerToFriendService(),r.Q.changedOnlineStatus(this.lastOnlineStatus),o.G.delayNotificationDataRequest(()=>r.Q.getAllFriendRoomInvitesReceived())}static setOnlineStatus(e){this.lastOnlineStatus=e,r.Q.changedOnlineStatus(e)}static userOnlineAndIdle(){this.setOnlineStatus(n.WA.OnlineAndIdle)}static userEnteredRoom(){this.setOnlineStatus(n.WA.InRoom),o.G.delayNotificationDataRequest(()=>r.Q.getAllFriendsOnlineStatus())}static userEnteredGame(){this.setOnlineStatus(n.WA.InGame)}static inviteFriendToRoom(e,t){r.Q.inviteFriendToRoom(e,t)}static respondToFriendRoomInvite(e,t,s){t&&l.P_.leaveRoomAndJoinRoom(e),r.Q.respondToFriendRoomInvite(e,t,s)}updateFriendOnlineStatus(e){this.displayNotificationIfUserCameOnline(e)}updateAllFriendsOnlineStatus(e){this.onlineFriendUsers.clear();for(const t of e)this.onlineFriendUsers.set(t.userId,t)}friendRespondedToRoomInvite(e){if(e.response)return;const t={key:"strings:roomPage.declinedInvite",options:{username:e.responderUsername}};this.showNotification(i.am.Lightning,t)}receivedRoomInvites(e){e.length>0&&d.A9.play(d.hc.RoomSettingUpdated);for(const t of e)this.showRoomInvitePopupNotification(t),this.addRoomInviteNotificationToPanel(t)}receivedFriendRequest(e){d.A9.play(d.hc.RoomSettingUpdated),this.showFriendRequestPopupNotification(e),this.addFriendRequestNotificationToPanel(e)}addRoomInviteNotificationToPanel(e){const t={type:c.jI.LiveRoomInvite,roomId:e.roomId,senderUsername:e.senderUsername,senderUserId:e.senderUserId,senderIcon:e.senderIcon};this.addCTANotificationToPanel(t,e.dateCreated,e.roomId,this.roomInviteNotifications)}addFriendRequestNotificationToPanel(e){const t={type:c.jI.FriendRequestReceived,userId:e.userId,username:e.username};this.addCTANotificationToPanel(t,e.dateCreated,e.userId,this.friendRequestNotifications)}addCTANotificationToPanel(e,t,s,i){if(null==this.notificationPanelController)return;const n=this.notificationPanelController.addCTANotification({typeData:e,dateReceived:t}),r=i.get(s);r?r.push(n):i.set(s,[n])}showRoomInvitePopupNotification(e){const t={key:"strings:roomPage.userInvitedToRoom",options:{context:"checkNotifications",username:e.senderUsername,roomId:e.roomId}};this.showJoinRoomNotification(e.senderIcon,t,e)}showFriendRequestPopupNotification(e){const t={key:"strings:popups.notification.userSentYouFriendRequest",options:{context:"noLink",username:e.username}};this.showNotification(i.am.Friends,t)}removeRoomInvitesWithRoomId(e){var t;const s=this.roomInviteNotifications.get(e);if(s){for(const e of s)null===(t=this.notificationPanelController)||void 0===t||t.removeCTANotification(e);this.roomInviteNotifications.delete(e)}}removeAllInvites(){for(const e of this.roomInviteNotifications.keys())this.removeRoomInvitesWithRoomId(e)}displayNotificationIfUserCameOnline(e){const t=this.enoughTimePassedSinceLastNotificationForUser(e.userId),s=this.didUserComeOnline(e);t&&s&&this.showNotification(e.icon,{key:"strings:roomPage.friendOnline",options:{username:e.username}}),this.lastNotificationTimeForUser.set(e.userId,Date.now());e.onlineStatus==n.WA.Offline?this.onlineFriendUsers.delete(e.userId):this.onlineFriendUsers.set(e.userId,e)}enoughTimePassedSinceLastNotificationForUser(e){const t=this.lastNotificationTimeForUser.get(e);if(null==t)return!0;return Date.now()-t>this.ONLINE_NOTIFICATION_THROTTLE_MS}didUserComeOnline(e){const t=this.onlineFriendUsers.get(e.userId),s=e.onlineStatus==n.WA.OnlineAndIdle,i=(null==t?void 0:t.onlineStatus)==n.WA.Offline||null==t;return s&&i}constructor(e){this.roomInviteNotifications=new Map,this.friendRequestNotifications=new Map,this.onlineFriendUsers=new Map,this.lastNotificationTimeForUser=new Map,this.ONLINE_NOTIFICATION_THROTTLE_MS=a.Re.SECONDS_IN_MINUTE*a.Re.MILLISECONDS,this.notificationPanelController=e}}u.lastOnlineStatus=n.WA.OnlineAndIdle},55935:(e,t,s)=>{"use strict";s.d(t,{DS:()=>u});var i=s(63359),n=s(13567),r=s(68924),o=s(72239),a=s(87952),c=s(30817);const l=o.h4.getEnumValues(n.O3),d=(0,a.Qc)(l,i.aig().int().positive());var u=function(e){return e[e.None=0]="None",e[e.Red=1]="Red",e[e.Blue=2]="Blue",e[e.Orange=3]="Orange",e[e.Green=4]="Green",e[e.Black=5]="Black",e[e.Bronze=6]="Bronze",e[e.Silver=7]="Silver",e[e.Gold=8]="Gold",e[e.White=9]="White",e[e.Purple=10]="Purple",e[e.MysticBlue=11]="MysticBlue",e[e.Pink=12]="Pink",e}({});const h=i.Ikc({color:i.k5n(u).readonly(),victoryPointsState:c.P.readonly(),bankTradeRatiosState:d.readonly(),resourceCards:n.qT.readonly(),cardDiscardLimit:i.aig().int().nonnegative(),isTakingAction:i.zMY(),isConnected:i.zMY()}).strict();const p=o.h4.getEnumValues(u);(0,a.Qc)(p,h);const m=(0,r.e)(h);(0,a.Qc)(p,m,{requireAtLeastOneEntry:!0})},56088:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_science_engineer.74d8a72304f6de0ba9f6.svg"},56116:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_cactus.2f57f6570b80f25c42f2.svg"},56145:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_active_white.c92efa08f11f54541c76.svg"},56820:(e,t,s)=>{"use strict";s.d(t,{M:()=>a});var i=s(16611),n=s(9029),r=s(80708),o=s(76092);class a{setTabAnnual(e){if(e)return this.monthlyTab.classList.remove("active"),void this.annualTab.classList.add("active");this.monthlyTab.classList.add("active"),this.annualTab.classList.remove("active")}static getDiscountString(){return"20"}constructor(e){this.monthlyTab=document.getElementById("store_page_membership_monthly_tab"),this.annualTab=document.getElementById("store_page_membership_annual_tab");const t=a.getDiscountString();(0,n.oB)(this.annualTab,{key:"strings:storePage.membership.frequency.annual",options:{context:"store",discount:`${t}`}}),(0,n.G0)(this.monthlyTab,()=>{i.A9.play(i.hc.Click),e.membershipToggleYearlyActive=!1,r.CA.sendAnalyticEvent({type:o.k0.MonthlyYearlyToggleSwitched,category:o.eX.Store,stringValue:"monthly"})}),(0,n.G0)(this.annualTab,()=>{i.A9.play(i.hc.Click),e.membershipToggleYearlyActive=!0,r.CA.sendAnalyticEvent({type:o.k0.MonthlyYearlyToggleSwitched,category:o.eX.Store,stringValue:"yearly"})})}}},56961:(e,t,s)=>{"use strict";s.d(t,{SK:()=>n,Xk:()=>o,zk:()=>r});var i=s(46581);const n=new Set([i.Nw.RankedCitiesAndKnights4P,i.Nw.RankedClassic4P,i.Nw.RankedClassic1v1,i.Nw.RankedRush4P]),r=new Set([i.Nw.RankedCitiesAndKnights4P]),o=new Set([i.Nw.UnrankedClassic4P,i.Nw.RankedClassic4P,i.Nw.UnrankedClassic1v1,i.Nw.RankedClassic1v1,i.Nw.RankedCitiesAndKnights4P,i.Nw.UnrankedShuffle,i.Nw.RankedRush4P])},57229:(e,t,s)=>{"use strict";s.d(t,{o:()=>a});var i=s(35078),n=s(55547),r=s(5201),o=s(15055);function a(e){if(e==i.J.Game)return;let t;switch(e){case i.J.Leaderboard:t="/leaderboards";break;case i.J.Lobby:t="/lobby";break;case i.J.Homepage:t="/";break;case i.J.Store:t="/store";break;case i.J.More:t="/more"}n.gC.sendPageVisitAnalyticEvent(t),e==i.J.Store&&r.z.captureEvent(o.x.StoreVisited)}},57363:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_6.68f39630050519374015.svg"},57385:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_game_started.361e1eda1fa0223d7a25.mp3"},57566:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_active_pink.63f1a1d85e1b4f6ef618.svg"},57795:(e,t,s)=>{"use strict";e.exports=s.p+"assets/settlement_bronze.f7d653aba54121d33d8f.svg"},58416:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_science_smith.4b4e3536542567a917bf.svg"},58533:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_politics_warlord.fa116cf5a8b6b6082d2d.svg"},58602:(e,t,s)=>{"use strict";s.d(t,{$k:()=>l,Gf:()=>h,Ak:()=>c,je:()=>u,Tb:()=>d});var i=s(66935),n=s(36872);
1class r extends Error{constructor(e,t,s,i,n){super(t.key),this.logError=!0,this.title=e,this.description=t,this.httpStatusCode=s,this.logSeverity=i,this.redirectUrl=n}}var o=s(69508),a=s(45655);class c extends r{static deserialize(e){return new c(e.title,e.description,e.httpStatusCode,e.logSeverity,e.redirectUrl)}constructor(e,t,s,i=a.S.JL2,n){super(e,t,s,i,n),this.type=o.w.DefaultError}}class l extends r{getDisplayMessage(){const e=this.description.key,t={key:"strings:popups.errors.authError.standardErrorMessage",options:{email:n.gq.SUPPORT_EMAIL}};return(0,i.dN)({key:"strings:popups.errors.authError.displayMessage"},{errorMessage:{key:e},standardErrorMessage:t})}static deserialize(e){return new l(e.title,e.description,e.httpStatusCode)}constructor(e,t,s,i=a.S.JL4,n){super(e,t,s,i,n),this.type=o.w.AuthError}}class d extends r{static deserialize(e){return new d(e.title,e.description,e.httpStatusCode)}constructor(e,t,s,i=a.S.JL2){super(e,t,s,i),this.type=o.w.MustLogin}}class u extends r{static deserialize(e){return new u(e.title,e.description,e.httpStatusCode,e.logSeverity)}constructor(e,t,s,i=a.S.JL2){super(e,t,s,i),this.type=o.w.MustBeMember}}class h extends r{static deserialize(e){return new h(e.title,e.description,e.httpStatusCode,e.logSeverity)}constructor(e,t,s,i=a.S.JL2){super(e,t,s,i),this.type=o.w.Blocking}}},58699:(e,t,s)=>{"use strict";e.exports=s.p+"assets/gif_remove_ads_boxedshape_desert.13501b36f37e7f524c4f.gif"},58961:(e,t,s)=>{"use strict";e.exports=s.p+"assets/settlement_orange.774ddafc8cc0595acdb7.svg"},59011:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_robber_lunar.3eb491a44c7dec0b0084.png"},59138:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_uk_preview.ce7d20e61604be794645.png"},59179:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ship_green_north_west.714b14c17875fd12ce96.svg"},59200:(e,t,s)=>{"use strict";s.d(t,{f:()=>i});var i,n=s(70908);!function(e){e.tLeaderboardTabName=function(e){if("string"==typeof e){const t=n.vX.getCountryName(e);if(null!=t)return t;return e}return n.a7.t(e.key,e.options)}}(i||(i={}))},59518:(e,t,s)=>{"use strict";s.d(t,{y:()=>h});var i=s(71763),n=s(46507),r=s(66935),o=s(72239),a=s(70908),c=s(44529),l=s(18587),d=s(655),u=s(32398);const h=(0,s(11445).K)(({onClose:e})=>{const t=l.r.language,s=(0,i.useMemo)(()=>function(){const e=[];
1return r.F2.languages.forEach(t=>{const s=a.vX.getLanguageName(t);if(null==s)return;const i=a.vX.getLanguageName(t,t);if(null==i)return;const n=`${o.$x.capitalizeFirstLetter(s)} (${o.$x.capitalizeFirstLetter(i)})`;e.push({code:t,label:n})}),e}(),[]);return i.createElement(n.hb,{languages:s,currentLanguage:t,onClose:e,onConfirm:s=>{(async s=>{if(e(),c.p.setLanguagePreferenceSelected(!0),c.p.setLanguage(s),s==t)return;const i={language:s};await d.m.postRequestHandler(u.l.apiSetUserLanguage(),void 0,i,"application/json"),window.location.pathname=(0,a.nJ)(window.location.pathname,s)})(s)}})})},59533:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_cc26.f365c72ca77fff0c5c3d.png"},59541:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_players.781fa31dd447df4a8639.svg"},59548:(e,t,s)=>{"use strict";e.exports=s.p+"assets/settlement_black.c687de87c2493d1624ea.svg"},59712:(e,t,s)=>{"use strict";s.d(t,{x:()=>o});var i=s(17326),n=s(61896);let r;function o(e=i.zz.Classic4P){null==r&&(r=new n.k(e)),r.setDefaultPage(e),r.show()}},59803:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_science_mining.57f4a09fa706b3f62909.svg"},59968:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_no_troll.ed865239dc53debe111e.svg"},59991:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_trade_merchant.98ddd9f811d73325d94d.svg"},60085:(e,t,s)=>{"use strict";e.exports=s.p+"assets/colonist_rush_ranked.0466339098b6dbe0926e.svg"},60144:(e,t,s)=>{"use strict";s.d(t,{a:()=>r});var i=s(655),n=s(32398);class r{static async updateUsername(e,t=!1){const s={username:e,shouldPurchaseIfNoAttemptsLeft:t};return this.updateProfile("username",s)}static async getUsernameChangeInfo(){const e=await i.m.getRequestHandler(n.l.apiUsernameChangeInfo());if(null!=e)return e.json}static async getEditProfileInfo(){const e=await i.m.getRequestHandler(n.l.apiEditProfileInfo());if(null!=e)return e.json}static async updatePreferredColor(e){const t={preferredColor:e};await this.updateProfile("preferred-color",t)}static async updateIcon(e){const t={icon:e};await this.updateProfile("icon",t)}static async updateProfile(e,t){return null!=await i.m.postRequestHandler(`${n.l.apiUpdateProfile()}/${e}`,void 0,t,this.contentType)}}r.contentType="application/json"},60178:(e,t,s)=>{"use strict";e.exports=s.p+"assets/road_pink.0a287c206a9b096b239f.svg"},60190:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ship_gold_north_west.0c4bcc9094f99289f59d.svg"},60341:(e,t,s)=>{"use strict";s.d(t,{c:()=>m});var i=s(17326),n=s(30792),r=s(3844),o=s(44529),a=s(18587),c=s(13359),l=s(35742),d=s(13618),u=s(9029),h=s(95107),p=s(35078);class m extends l.u{updateNavigationVisibility(e){if(null==this.navigationWrapper)return;const t=e.scrollTop,s=t-this.lastScrollTop;if(Math.abs(s)<m.SCROLL_DELTA_THRESHOLD)return;const i=s>0;this.navigationWrapper.classList.toggle(m.NAVIGATION_HIDDEN_CLASS,i),this.lastScrollTop=t}static setupRushVideoPlaceholderListener(){const e=document.getElementById("rulebook-rush-video-placeholder");null!=e&&(0,u.G0)(e,()=>m.openRushVideo())}static openRushVideo(){var e,t;if(a.r.isUserOnDiscordMobile)return null!==(t=(e=m).discordCommunicationHandler)&&void 0!==t||(e.discordCommunicationHandler=new r.H),void m.discordCommunicationHandler.openExternalLink(n.Hs);window.parent.open(n.Hs,"_blank")}static setupBackButtonListener(){const e=document.getElementById("rulebook-header-back-button");null!=e&&(0,u.G0)(e,()=>m.goBack())}static setupLogoButtonListener(){const e=document.getElementById("rulebook-header-logo-button");null!=e&&(0,u.G0)(e,()=>m.goBack())}static goBack(){const e=m.getRulebookHomepageUrl();o.p.clearLastScene(),(0,d.Yf)(e)}setupLinkListener(){document.body.addEventListener("click",e=>{if(null==e.target)return;const t=e.target.closest("a");(null==t?void 0:t.href.includes("#"))&&null!==t&&this.onSidebarClick(e)})}static setRulebookLinksStyle(){if(null==m.rulebookStyle)return;const e=m.rulebookStyle;document.querySelectorAll('a[href*="/catan-rules"]').forEach(t=>{t.origin==location.origin&&(t.pathname=(0,i.iU)(t.pathname,e))})}static getRulebookHomepageUrl(){if(m.rulebookStyle!=i.RD.Mobile)return(0,d.mE)();const e=o.p.getLastScene();if(null==e)return(0,d.mE)();const t=m.getMobileSceneParameter(e);return`${(0,d.mE)()}#${t}=${h.v.DEFAULT_PARAMETER_VALUE}`}static getMobileSceneParameter(e){switch(e){case p.J.Leaderboard:return c.T.MobileLeaderboard;case p.J.Lobby:return c.T.MobileLobby;case p.J.Store:return c.T.MobileStore;case p.J.More:return c.T.MobileMore;default:return c.T.MobileHomepage}}constructor(){var e;m.rulebookStyle=null!==(e=window.rulebookStyle)&&void 0!==e?e:null,m.setupBackButtonListener(),m.setupLogoButtonListener();const t=document.getElementById("rulebook-content");super(t.getElementsByClassName("rulebook-content-container")[0],document.getElementById("rulebook-side-navigation"),t,"side-navigation-link-current-section"),this.navigationWrapper=document.getElementById("rulebook-top-navigation-wrapper"),this.lastScrollTop=0,t.addEventListener("scroll",()=>{this.onContentScroll(),this.updateNavigationVisibility(t)}),this.setupLinkListener(),m.setRulebookLinksStyle(),m.setupRushVideoPlaceholderListener()}}m.NAVIGATION_HIDDEN_CLASS="rulebook-top-navigation-hidden",m.SCROLL_DELTA_THRESHOLD=8},60342:(e,t,s)=>{"use strict";s.d(t,{Q:()=>l});var i=s(9029),n=s(655),r=s(32398),o=s(18587),a=s(70908);function c(e){if(null!=e)try{const t=e instanceof Date?e:new Date(e);if(isNaN(t.getTime()))return;return new Date(t.getFullYear(),t.getMonth(),t.getDate())}catch(e){return}}class l{showHost(){this.hostToggleBtn.classList.add("active"),this.joinToggleBtn.classList.remove("active"),this.hostPanel.classList.remove("hidden"),this.playerPanel.classList.add("hidden")}showPlayer(){this.joinToggleBtn.classList.add("active"),this.hostToggleBtn.classList.remove("active"),this.playerPanel.classList.remove("hidden"),this.hostPanel.classList.add("hidden")}static async loadContent(){try{const e=await n.m.getRequestHandler(r.l.apiChampionship26Content(),void 0);if(null==e)return;const t=e.json;if(null==t)return;if(Array.isArray(t.qualifiers)){const e=function(e){const t=e.map(e=>{var t,s,i;return{title:null!==(t=null==e?void 0:e.title)&&void 0!==t?t:"",location:null!==(s=null==e?void 0:e.location)&&void 0!==s?s:"",date:c(null==e?void 0:e.date),joinUrl:null!==(i=null==e?void 0:e.joinUrl)&&void 0!==i?i:""}}),s=new Date,i=new Date(s.getFullYear(),s.getMonth(),s.getDate()),n=[],r=[],l=[];for(const e of t)null!=e.date?e.date<i?l.push(e):n.push(e):r.push(e);n.sort((e,t)=>
1e.date.getTime()-t.date.getTime()),l.sort((e,t)=>t.date.getTime()-e.date.getTime());const d=e=>{const t=null==e.date?a.a7.t("strings:championship26Page.qualifiers.dateTbd"):e.date.toLocaleDateString(o.r.language,{month:"long",day:"numeric"}),s={key:"strings:championship26Page.qualifiers.details",options:{location:e.location,date:t}};return{title:e.title,description:s,joinUrl:e.joinUrl}};return[{title:{key:"strings:championship26Page.qualifiers.upcoming"},openByDefault:!0,showJoinBtns:!0,qualifiers:[...n.map(d),...r.map(d)],contentId:"championship26-qualifiers-section-upcoming",toggleId:"championship26-qualifiers-upcoming-toggle-btn"},{title:{key:"strings:championship26Page.qualifiers.completed"},openByDefault:!1,showJoinBtns:!1,qualifiers:l.map(d),contentId:"championship26-qualifiers-section-completed",toggleId:"championship26-qualifiers-completed-toggle-btn"}]}(t.qualifiers);l.renderQualifiers(e),l.bindQualifiersToggle(e)}Array.isArray(t.partners)&&l.renderPartners(t.partners)}catch(e){return}}static renderQualifiers(e){const t=document.getElementById("championship26-qualifiers-toggle-container"),s=document.getElementById("championship26-qualifiers-sections-container");(0,i.RH)(t,{key:"strings:colonistCommon.utils.emptyString"}),(0,i.RH)(s,{key:"strings:colonistCommon.utils.emptyString"});const n=(0,i.Le)(t,"toggle-tab","championship26-qualifiers-all-toggle-btn");(0,i.oB)(n,{key:"strings:championship26Page.qualifiers.all"});for(const n of e){const e=(0,i.Le)(t,"toggle-tab"+(n.openByDefault?" active":""),n.toggleId);(0,i.oB)(e,n.title);const r=(0,i.Le)(s,"qualifiers-section"+(n.openByDefault?"":" hidden"),n.contentId);if(0==n.qualifiers.length){(0,i.Wr)(r,{key:"strings:championship26Page.qualifiers.empty"},"");continue}const o=(0,i.Le)(r,"qualifiers-section-content");for(const e of n.qualifiers){const t=(0,i.Le)(o,"qualifier-card"),s=(0,i.Le)(t,"qualifier-content");(0,i.Wr)(s,{key:"strings:colonistCommon.utils.#buffer",options:{value:e.title}},"qualifier-title"),(0,i.Wr)(s,e.description,""),n.showJoinBtns&&e.joinUrl&&(0,i.cE)(t,e.joinUrl,{key:"strings:championship26Page.qualifiers.join"},"button_cta_sub","",!0)}}}static bindQualifiersToggle(e){const t=document.getElementById("championship26-qualifiers-all-toggle-btn"),s=document.getElementById("championship26-qualifiers-upcoming-toggle-btn"),n=document.getElementById("championship26-qualifiers-completed-toggle-btn"),r=document.getElementById("championship26-qualifiers-section-upcoming"),o=document.getElementById("championship26-qualifiers-section-completed");null!=s&&null!=n&&null!=r&&null!=o&&((0,i.G0)(t,()=>{var i,a,c;t.classList.add("active"),s.classList.remove("active"),n.classList.remove("active");const l=(null!==(c=null===(i=e.find(e=>"championship26-qualifiers-section-upcoming"==e.contentId))||void 0===i?void 0:i.qualifiers.length)&&void 0!==c?c:0)>0;var d;const u=(null!==(d=null===(a=e.find(e=>"championship26-qualifiers-section-completed"==e.contentId))||void 0===a?void 0:a.qualifiers.length)&&void 0!==d?d:0)>0;r.classList.toggle("hidden",!l&&u),o.classList.toggle("hidden",l&&!u)},!0),(0,i.G0)(s,()=>{t.classList.remove("active"),s.classList.add("active"),n.classList.remove("active"),r.classList.remove("hidden"),o.classList.add("hidden")},!0),(0,i.G0)(n,()=>{t.classList.remove("active"),s.classList.remove("active"),n.classList.add("active"),o.classList.remove("hidden"),r.classList.add("hidden")},!0))}static renderPartners(e){const t=document.getElementById("championship26-partners-title"),s=document.getElementById("championship26-view-all-partners-btn"),n=document.getElementById("championship26-partners-grid");(0,i.oB)(t,{key:"strings:championship26Page.organization.partnersWithCount",options:{count:e.length}}),(0,i.RH)(n,{key:"strings:colonistCommon.utils.emptyString"});for(const t of e){const e=(0,i.Le)(n,"partner-item");if(!o.r.isUserOnDiscord&&null!=t.imageUrl&&t.imageUrl.length>0){const s=document.createElement("img");s.src=t.imageUrl,s.alt=t.name,e.appendChild(s)}const s=(0,i.Le)(e,"partner-name");(0,i.oB)(s,{key:"strings:colonistCommon.utils.#buffer",options:{value:t.name}})}(0,i.G0)(s,()=>n.classList.add("expanded"),!0)}constructor(){this.hostToggleBtn=document.getElementById("championship26-host-toggle-btn"),this.joinToggleBtn=document.getElementById("championship26-join-toggle-btn"),this.hostPanel=document.getElementById("championship26-host-panel"),this.playerPanel=document.getElementById("championship26-player-panel"),(0,i.G0)(this.hostToggleBtn,()=>this.showHost(),!0),(0,i.G0)(this.joinToggleBtn,()=>this.showPlayer(),!0),l.loadContent()}}},60411:(e,t,s)=>{"use strict";e.exports=s.p+"assets/prob_6.ada0b8434cfe315beb72.svg"},60674:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_pencil.9d4a73f29f331378c4b5.svg"},60793:(e,t,s)=>{"use strict";e.exports=s.p+"assets/prob_4.a2af3d909fad884353df.svg"},60949:(e,t,s)=>{"use strict";s.d(t,{FY:()=>d,PL:()=>u});var i=s(46581),n=s(66935),r=s(72239),o=s(44529);const a=new Set([i.Nw.RankedClassic4P,i.Nw.UnrankedClassic4P]),c=new Set([i.Nw.RankedRush4P]),l=[{key:"strings:homePage.matchmakingTips.buildNearHighNumbers",kind:"advice"},{key:"strings:homePage.matchmakingTips.cityCost",kind:"advice"},{key:"strings:homePage.matchmakingTips.tradeEarly",kind:"advice"},{key:"strings:homePage.matchmakingTips.robberOnLeader",kind:"advice"},{key:"strings:homePage.matchmakingTips.getAPort",kind:"advice"},{key:"strings:homePage.matchmakingTips.dontHoardCards",kind:"advice",matchTypes:a},{key:"strings:homePage.matchmakingTips.placementDiversity",kind:"advice"},{key:"strings:homePage.matchmakingTips.assumeLeaderVictoryPoint",kind:"advice"},{key:"strings:homePage.matchmakingTips.planAhead",kind:"advice"},{key:"strings:homePage.matchmakingTips.upgradeToCity",kind:"advice"},{key:"strings:homePage.matchmakingTips.bankTrades",kind:"advice"},{key:"strings:homePage.matchmakingTips.rushDecisionSpeed",kind:"advice",matchTypes:c},{key:"strings:homePage.matchmakingTips.tryRushTenMinutes",kind:"advice",excludedMatchTypes:c,requiresNeverPlayedRush:!0},{key:"strings:homePage.matchmakingTips.rushNoTurns",kind:"advice",excludedMatchTypes:c,requiresNeverPlayedRush:!0},{key:"strings:homePage.matchmakingTips.watchReplays",kind:"advice"},{key:"strings:homePage.matchmakingTips.beNiceMakeFriends",kind:"advice"},{key:"strings:homePage.matchmakingTips.statGamesPlayed",kind:"fact"},{key:"strings:homePage.matchmakingTips.statCountries",kind:"fact"}];function d(e){return h(l.filter(t=>function(e,t){return!(null!=e.matchTypes&&!e.matchTypes.has(t))&&((null==e.excludedMatchTypes||!e.excludedMatchTypes.has(t))&&(!e.requiresNeverPlayedRush||!p()))}(t,e)))}function u(){var e;return null!==(e=h(l.filter(e=>!e.requiresNeverPlayedRush||!p())))&&void 0!==e?e:n.hs}function h(e){if(0==e.length)return;const t=r.lv.randomElementFromArray(e);return"fact"==t.kind?{key:t.key}:(0,n.dN)({key:"strings:homePage.matchmakingTips.prefix"},{tip:{key:t.key}})}function p(){return o.p.getRushGamesPlayed()>0}},61193:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_inactive_blue.d3bfa760722ab1dcdf65.svg"},61235:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_politics_saboteur.91dd28c2c711daa19a5a.svg"},61495:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_play.97d68898ef2f164d9249.svg"},61570:(e,t,s)=>{"use strict";s.d(t,{t:()=>y,b:()=>v});var i=s(36872),n=s(53015),r=s(30911),o=s(95078),a=s(50482),c=s(72239),l=s(55935),d=s(22030),u=s(51988);const h=c.h4.loopEnums;class p{static deserialize(e){const t=new p;return t.colonistCoins=e.colonistCoins,t.presalePacks=e.presalePacks,t.expansions=e.expansions,t.maps=e.maps,t.icons=e.icons,t.colors=e.colors,t.giftedMemberships=e.giftedMemberships,t.membership=e.membership,t.membershipPending=e.membershipPending,t.membershipEndDate=e.membershipEndDate,t.membershipPaymentMethod=e.membershipPaymentMethod,t}hasAccessToStoreMap(e){if(0==e.length)return!0;for(const t of this.maps)if(o.l.elementInArray(e,t.type))return!0;return!1}hasAccessToExpansion(e){if(0==e.length)return!0;for(const t of this.expansions)if(o.l.elementInArray(e,t.type))return!0;return!1}hasAccessToPremiumMap(e){if(this.isPerkAvailable(d.gr.AllMaps))return!0;
1if(!e.isMapPremium())return!0;if(e.isMapRestrictedByPremiumGameMode()&&!this.hasAccessToExpansion(e.premiumExpansionAccess))return!1;return!(e.isMapRestrictedByPremiumMap()&&!this.hasAccessToStoreMap(e.premiumMapAccess))}hasAccessToPremiumMode(e){return!!this.isPerkAvailable(d.gr.AllExpansions)||(!e.isGameModePremium()||this.hasAccessToExpansion(e.premiumExpansionAccess))}hasAccessToColor(e){if(this.isPerkAvailable(d.gr.AllColors))return!0;if([l.DS.Red,l.DS.Blue,l.DS.Green,l.DS.Orange].includes(e))return!0;for(const t of this.colors)if(r.k.getStorePlayerColorOfPlayerColor(e)==t.type)return!0;return!1}hasAccessToNoTrolls(){return!!this.isNoTrollsAvailable}hasMembership(){return null!=this.membership}hasFoundersPack(){return this.presalePacks.findIndex(e=>e.type==n.h8.FounderPack&&e.category==n.n9.PresalePack)>=0}addGiftedMembership(e){var t;(null!==(t=e.expiresAt)&&void 0!==t?t:c.Re.addYears(e.giftedAt,r.Z))<new Date||this.giftedMemberships.push(e)}addStoreItem(e,t){const s=u.F.getItemDetail(e,t);if(s)switch(s.category){case n.n9.PresalePack:return void this.presalePacks.push(s);case n.n9.Expansion:return void this.expansions.push(s);case n.n9.Map:return void this.maps.push(s);case n.n9.Icon:return void this.icons.push(s);case n.n9.Color:return void this.colors.push(s);case n.n9.Consumable:case n.n9.Membership:return}}getAvailableColors(){const e=[];return h(l.DS,(t,s)=>{this.hasAccessToColor(s)&&e.push(s)}),e}isPerkAvailable(e){if(null==this.membership)return!1;return a.Zt.getMembershipProduct(this.membership).perks.filter(t=>t.type==e).length>0}get isNoTrollsAvailable(){return null!=this.membership}getCurrentMembership(){const e=this.membership;if(null==e)return;const t=a.Zt.getMembershipProduct(e);return{type:e,image:t.lobbyImage,pending:this.membershipPending,title:t.membershipTitle}}getItems(){return[...this.presalePacks,...this.expansions,...this.maps,...this.icons,...this.colors]}hideAds(){return!!this.hasMembership()||this.presalePacks.length>0}constructor(){this.colonistCoins=0,this.presalePacks=[],this.expansions=[],this.maps=[],this.icons=[],this.colors=[],this.giftedMemberships=[],this.membership=void 0,this.membershipPending=!1,this.membershipStartDate=void 0,this.membershipEndDate=void 0,this.membershipPaymentMethod=void 0,this.membershipGiftedByUsername=void 0}}var m=s(52955),g=s(92524);const f=c.Re.toDate,y="Deleted User";class v{getPlayerKarmaStatusText(){return{key:"strings:homePage.header.playerKarma",options:{totalCompleted:this.karma,totalGames:this.karmaCompletedGameCount}}}isBeginner(){return this.totalCompletedGameCount<2}hasZeroCompletedGames(){return 0==this.totalCompletedGameCount}constructor(e){this.id=(0,m.TO)(e.id,1,100),this.username=(0,m.TO)(e.username,1,100),this.language=S(m.to,void 0,e.language,1,5),this.isLoggedIn=S(m.mF,!1,e.isLoggedIn),this.interactedWithSite=S(m.mF,!1,e.interactedWithSite),this.icon=S(m._k,i.am.Players,e.icon,i.am),this.profilePictureUrl=S(m.xd,void 0,e.profilePictureUrl),this.karma=S(m.Li,0,e.karma),this.karmaCompletedGameCount=S(m.Li,0,e.karmaCompletedGameCount),this.preferredColor=S(m._k,void 0,e.preferredColor,l.DS),this.usernameChangeAttemptsLeft=S(m.Li,0,e.usernameChangeAttemptsLeft),this.totalCompletedGameCount=S(m.Li,0,e.totalCompletedGameCount),this.ckTotalGameCount=S(m.Li,0,e.ckTotalGameCount),this.hasJoinedColonistDiscordServer=S(m.mF,!1,e.hasJoinedColonistDiscordServer),this.forceSubscription=S(m.mF,!0,e.forceSubscription),this.accessLevel=S(m._k,i.hx.User,e.accessLevel,i.hx),this.regionUpdated=(0,m.M2)(e.regionUpdated)?f(e.regionUpdated):void 0,this.vliHash=S(m.xd,void 0,e.vliHash),this.colonistVersion=S(m.Li,0,e.colonistVersion),this.items=new p,this.items.colonistCoins=S(m.Li,0,e.colonistCoins),this.items.membership=S(m._k,void 0,e.membership,i.Qb),this.items.membershipStartDate=(0,m.M2)(e.membershipStartDate)?f(e.membershipStartDate):void 0,this.items.membershipEndDate=(0,m.M2)(e.membershipEndDate)?f(e.membershipEndDate):void 0,this.items.membershipGiftedByUsername=(0,m.xd)(e.membershipGiftedByUsername)?e.membershipGiftedByUsername:void 0,this.items.membershipPaymentMethod=S(m._k,void 0,e.membershipPaymentMethod,g.g5),this.items.membershipPending=S(m.mF,!1,e.membershipPending),this.items.giftedMemberships=S(m.P8,[],e.giftedMemberships).filter(e=>(0,m.BI)(e)).filter(e=>(0,m._k)(e.membershipType,i.Qb)).filter(e=>(0,m.M2)(e.giftedAt)).filter(e=>(0,m.Li)(e.periods)||(0,m.Li)(e.periodDays)).map(e=>({id:e.id,membershipType:e.membershipType,giftedAt:f(e.giftedAt),peri
1ods:e.periods,periodDays:e.periodDays,expiresAt:(0,m.M2)(e.expiresAt)?f(e.expiresAt):void 0}));for(const t of S(m.P8,[],e.ownedItems))(0,m.BI)(t)&&this.items.addStoreItem(t.category,t.type)}}function S(e,t,s,...i){return e(s,...i)?s:t}},61651:(e,t,s)=>{"use strict";function i(){let e,t;const s=new Promise((s,i)=>{e=s,t=i});return s.pending=!0,s.resolve=t=>{s.pending=!1,e(t)},s.reject=e=>{s.pending=!1,t(e)},s}s.d(t,{p:()=>i})},61896:(e,t,s)=>{"use strict";s.d(t,{k:()=>d});var i=s(36872),n=s(17326),r=s(9029),o=s(85801);class a{containerClicked(e){e.target===this.container&&this.hide()}show(){this.container.style.display="block"}hide(){this.container.style.display="none"}isHidden(){return"none"==this.container.style.display}setEscapeKeyBind(){o.N.bindKey("Escape",()=>this.hide(),()=>!this.isHidden(),o.g.General)}removePopup(){this.container.style.display="none",null!=this.container.parentElement&&this.container.parentElement.removeChild(this.container)}constructor(){this.container=(0,r.Le)(document.body,"popup"),(0,r.G0)(this.container,e=>this.containerClicked(e))}}var c=s(18587),l=s(70908);class d extends a{setDefaultPage(e){this.defaultPage=e}show(){this.isRulebookPopupCreated||this.createRulebookPopup(),super.show()}createRulebookPopup(){const e=d.getRulebookPageSrc(this.defaultPage),t=(0,r.Le)(this.container,"popup-rulebook");(0,r.w8)(t,"100%","100%",e);const s=(0,r.Le)(t,"close-button");(0,r.zO)(s,i.am.XMark);(0,r.G0)(s,()=>this.hide()),this.setEscapeKeyBind(),this.isRulebookPopupCreated=!0}static getRulebookPageSrc(e){const t=c.r.isUserOnDiscord?"/.proxy":"",s=c.r.isUserOnDiscord?n.RD.Discord:n.RD.Popup,i=`${t}/catan-rules${(0,n.Lo)(e)}${(0,n.j3)(s)}`,r=new URL((0,l.nJ)(i,c.r.language),location.origin);return r.search=location.search,r.href}constructor(e){super(),this.isRulebookPopupCreated=!1,this.defaultPage=e}}},61925:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_gift_box.a9c59d3eb03efb0408c1.svg"},62254:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_achievement_longest_road.f73b7c0ccdd0df577bca.mp3"},62302:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_longest_road.5cfdeb3352b20463e64b.svg"},62374:(e,t,s)=>{"use strict";s.d(t,{m:()=>a});var i=s(655),n=s(9902),r=s(32398),o=s(81888);class a{static async purchaseItem(e,t,s){const a=`${e.category}/${e.type}`,c=await i.m.postRequestHandler(`${r.l.apiPayPurchaseItem()}/${a}`,void 0,void 0);if(null==c)throw new Error("Failed to purchase item");if(!c.isSuccess)return;const l=c.json;await o._.refresh();const d=l.status?{key:"strings:storePage.success.success"}:{key:"strings:popups.errors.general.title"};return l.status?t?t(l.message):void 0:s?s(l.message):(0,n.C)({title:d,body:l.message})}static async activateGiftedMembership(e){if(null==await i.m.postRequestHandler(r.l.apiActivateGiftMembership(),void 0,{itemId:e}))return;await o._.refresh();return(0,n.C)({title:{key:"strings:storePage.success.success"},body:{key:"strings:storePage.sections.membership.activated"}})}static async cancelGiftedMembership(){null!=await i.m.postRequestHandler(r.l.apiCancelGiftMembership(),void 0,void 0)&&await o._.refresh()}static async getSocialProof(){const e=await i.m.getRequestHandler(r.l.apiStoreSocialProof(),void 0,void 0,!1);return null==e?void 0:e.json}}},62585:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_science_alchemist.84e49fb459b1e915e039.svg"},62640:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ship_pink_north_west.0450a4a4af7f1f813332.svg"},62681:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_wall_mysticblue.d7cc943ea55d20f7c7a8.svg"},62713:(e,t,s)=>{"use strict";e.exports=s.p+"assets/road_mysticblue.1bd2cb96a192adecf018.svg"},62945:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_active_silver.69037099b19435065fde.svg"},62948:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_premium.d2299e81b122908c5a45.png"},62949:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_colors.ed73fda03be3a06c43b9.svg"},63116:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_twirl_preview.158112043235b9f5adb5.png"},63247:(e,t,s)=>{"use strict";e.exports=s.p+"assets/platinum.175fcbe15d9d768c5417.svg"},63406:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_mountain_of_riches_preview.29d53c89f50c2f0960fc.png"},63482:(e,t,s)=>{"use strict";s.d(t,{D:()=>l});var i=s(46507),n=s(70908),r=s(7893),o=s(60949),a=s(18587);const c="loading_screen_root";class l{show(e){if(!a.r.isUserOnDiscord)return;this.showGeneration+=1;const t=this.showGeneration;this.mountWhenI18nInitialized(e,t)}async mountWhenI18nInitialized(e,t){await n.aA.init(),t==this.showGeneration&&this.mount(e)}hide(){this.showGeneration+=1,this.unmountView(),d(!0)}mount(e){this.unmountView(),d(!1),this.view=(0,r.y)(c,i.xx),this.view.render({showProgress:e,tip:this.tip})}unmountView(){var e;null===(e=this.view)||void 0===e||e.unmount(),this.view=void 0}constructor(){this.tip=(0,o.PL)(),this.showGeneration=0}}function d(e){document.getElementById(c).classList.toggle("hidden",e)}},64038:(e,t,s)=>{"use strict";s.d(t,{RU:()=>ce,RF:()=>b,ac:()=>S,W1:()=>y,Hl:()=>P,Ge:()=>T,ef:()=>C,fB:()=>v,Ph:()=>k,__:()=>d,bf:()=>u,kD:()=>h,L$:()=>p,r8:()=>o,D8:()=>a,xm:()=>f,$G:()=>g,SN:()=>c,ZZ:()=>l,LK:()=>m,Vk:()=>le,hK:()=>E,hd:()=>D,FK:()=>M,qD:()=>Q,Jt:()=>B,bZ:()=>_,bE:()=>G,Gi:()=>q,lY:()=>L,pk:()=>F,p7:()=>W,j6:()=>I,z3:()=>V,lQ:()=>A,Ke:()=>R,rf:()=>w,XP:()=>N,yI:()=>j,G:()=>U,NH:()=>O,SV:()=>x,YU:()=>H,yT:()=>K,Zc:()=>ne,jU:()=>Z,b6:()=>z,Ms:()=>J,xU:()=>oe,lt:()=>X,As:()=>ee,dZ:()=>se,yl:()=>ie,Ry:()=>te,dS:()=>Y,qW:()=>$,Xf:()=>re,l2:()=>ae,v$:()=>de});var i=s(53015),n=s(36872),r=s(30911);class o extends r.k{constructor(...e){super(...e),this.category=i.n9.Expansion,this.type=n.$y.Classic56P,this.name={key:"strings:colonistCommon.gameModes.classic56P.title"},this.description="strings:colonistCommon.gameModes.classic56P.description",this.price=2800,this.image=n.am.StoreItemExpansionClassic56P,this.activeInStore=!0}}class a extends r.k{constructor(...e){super(...e),this.category=i.n9.Expansion,this.type=n.$y.Classic78P,this.name={key:"strings:colonistCommon.gameModes.classic78P.title"},this.description="strings:colonistCommon.gameModes.classic78P.description",this.price=2800,this.image=n.am.StoreItemExpansionClassic78P,this.activeInStore=!0}}class c extends r.k{constructor(...e){super(...e),this.category=i.n9.Expansion,this.type=n.$y.Seafarers4P,this.name={key:"strings:colonistCommon.gameModes.seafarers4P.title"},this.description="strings:colonistCommon.gameModes.seafarers4P.description",this.price=2800,this.image=n.am.StoreItemSeafarers4P,this.activeInStore=!0}}class l extends r.k{constructor(...e){super(...e),this.category=i.n9.Expansion,this.type=n.$y.Seafarers56P,this.name={key:"strings:colonistCommon.gameModes.seafarers56P.title"},this.description="strings:colonistCommon.gameModes.seafarers56P.description",this.price=2800,this.image=n.am.StoreItemSeafarers56P,this.activeInStore=!0}}class d extends r.k{constructor(...e){super(...e),this.category=i.n9.Expansion,this.type=n.$y.CitiesAndKnights4P,this.name={key:"strings:colonistCommon.gameModes.citiesAndKnights4P.title"},this.description="strings:colonistCommon.gameModes.citiesAndKnights4P.description",this.price=2800,this.image=n.am.StoreItemCitiesAndKnights4P,this.activeInStore=!0}}class u extends r.k{constructor(...e){super(...e),this.category=i.n9.Expansion,this.type=n.$y.CitiesAndKnights56P,this.name={key:"strings:colonistCommon.gameModes.citiesAndKnights56P.title"},this.description="strings:colonistCommon.gameModes.citiesAndKnights56P.description",this.price=2800,this.image=n.am.StoreItemCitiesAndKnights56P,this.activeInStore=!0}}class h extends r.k{constructor(...e){super(...e),this.category=i.n9.Expansion,this.type=n.$y.CitiesAndKnightsSeafarers4P,this.name={key:"strings:colonistCommon.gameModes.seafarersAndCitiesAndKnights4P.title"},this.description="strings:colonistCommon.gameModes.seafarersAndCitiesAndKnights4P.description",this.price=2800,this.image=n.am.StoreItemCitiesAndKnightsSeafarers4P,this.activeInStore=!0}}class p extends r.k{constructor(...e){super(...e),this.category=i.n9.Expansion,this.type=n.$y.CitiesAndKnightsSeafarers56P,this.name={key:"strings:colonistCommon.gameModes.seafarersAndCitiesAndKnights56P.title"},this.description="strings:colonistCommon.gameModes.seafarersAndCitiesAndKnights56P.description",this.price=2800,this.image=n.am.StoreItemCitiesAndKnightsSeafarers56P,this.activeInStore=!0}}class m extends r.k{constructor(...e){super(...e),this.category=i.n9.Expansion,this.type=n.$y.TradersAndBarbarians,this.name={key:"strings:colonistCommon.gameModes.tradersAndBarbarians.title"},this.description="strings:colonistCommon.gameModes.tradersAndBarbarians.description",this.price=2800,this.image=n.am.XMark}}class g extends r.k{constructor(...e){super(...e),this.category=i.n9.Expansion,this.type=n.$y.ExplorersAndPirates,this.name={key:"strings:colonistCommon.gameModes.explorersAndPirates.title"},this.description="strings:colonistCommon.gameModes.explorersAndPirates.description",this.price=2800,this.image=n.am.XMark}}class f extends r.k{constructor(...e){super(...e),this.category=i.n9.Expansion,this.type=n.$y.ColonistRush4P,this.name={key:"strings:colonistCommon.gameModes.colonistRush.title"},this.description="strings:colonistCommon.gameModes.colonistRush.description",this.price=2800,this.image=n.am.StoreItemColonistRush,this.activeInStore=!0}}class y extends r.k{constructor(...e){super(...e),this.category=i.n9.Color,this.type=i.WB.Gold,this.name={key:"strings:colonistCommon.playerColors.Gold"},this.price=5e3,this.image=n.am.StoreColorGold,this.activeInStore=!0,this.subscriptionOnly=!0}}class v extends r.k{constructor(...e){super(...e),this.category=i.n9.Color,this.type=i.WB.Silver,this.name={key:"strings:colonistCommon.playerColors.Silver"},this.price=5e3,this.image=n.am.StoreColorSilver,this.activeInStore=!0,this.subscriptionOnly=!0}}class S extends r.k{constructor(...e){super(...e),this.category=i.n9.Color,this.type=i.WB.Bronze,this.name={key:"strings:colonistCommon.playerColors.Bronze"},this.price=5e3,this.image=n.am.StoreColorBronze,this.activeInStore=!0,this.subscriptionOnly=!0}}class b extends r.k{constructor(...e){super(...e),this.category=i.n9.Color,this.type=i.WB.Black,this.name={key:"strings:colonistCommon.playerColors.Black"},this.price=0,this.image=n.am.StoreColorBlack,this.activeInStore=!0}}class C extends r.k{constructor(...e){super(...e),this.category=i.n9.Color,this.type=i.WB.Purple,this.name={key:"strings:colonistCommon.playerColors.Purple"},this.price=2500,this.image=n.am.StoreColorPurple,this.activeInStore=!0}}class P extends r.k{constructor(...e){super(...e),this.category=i.n9.Color,this.type=i.WB.MysticBlue,this.name={key:"strings:colonistCommon.playerColors.MysticBlue"},this.price=5e3,this.image=n.am.StoreColorMysticBlue,this.activeInStore=!0}}class k extends r.k{constructor(...e){super(...e),this.category=i.n9.Color,this.type=i.WB.White,this.name={key:"strings:colonistCommon.playerColors.White"},this.price=1e3,this.image=n.am.StoreColorWhite,this.activeInStore=!0}}class T extends r.k{constructor(...e){super(...e),this.category=i.n9.Color,this.type=i.WB.Pink,this.name={key:"strings:colonistCommon.playerColors.Pink"},this.price=5e3,this.image=n.am.StoreColorPink,this.activeInStore=!0,this.subscriptionOnly=!0}}class A extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.RobberCupid,this.name={key:"strings:storePage.icons.cupidRobber"},this.price=250,this.image=n.am.IconRobberCupid,this.activeInStore=!0}}class R extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.RobberLunar,this.name={key:"strings:storePage.icons.lunarRobber"},this.price=250,this.image=n.am.IconRobberLunar,this.activeInStore=!0}}class w extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.RobberSanta,this.name={key:"strings:storePage.icons.santaRobber"},this.price=250,this.image=n.am.IconRobberSanta,this.activeInStore=!1}}class I extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.PirateShip,this.name={key:"strings:storePage.icons.pirateShip"},this.price=250,this.image=n.am.IconPirateShip,this.activeInStore=!0}}class M extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.ChristmasHat,this.name={key:"strings:storePage.icons.christmasHat"},this.price=250,this.image=n.am.IconChristmasHat,this.activeInStore=!0}}class _ extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.Elephant,this.name={key:"strings:storePage.icons.elephant"},this.price=250,this.image=n.am.IconElephant,this.activeInStore=!1}}class E extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.Avocado,this.name={key:"strings:storePage.icons.avocado"},this.price=250,this.image=n.am.IconAvocado,this.activeInStore=!0}}class D extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.Cactus,this.name={key:"strings:storePage.icons.cactus"},this.price=250,this.image=n.am.IconCactus,this.activeInStore=!0}}class L extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.Gifter,this.name={key:"strings:storePage.icons.gifter"},this.text={key:"strings:storePage.sections.avatar.unlockByGifting"},this.image=n.am.IconGifter,this.activeInStore=!0,this.bannerText={key:"strings:storePage.newItem"},this.hideOnDiscordMobile=!0}}class B extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.Crown,this.name={key:"strings:storePage.icons.crown"},this.price=250,this.image=n.am.IconCrown,this.activeInStore=!0}}class x extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.Swords,this.name={key:"strings:storePage.icons.swords"},this.price=250,this.image=n.am.IconSwords,this.activeInStore=!0}}class O extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.Sombrero,this.name={key:"strings:storePage.icons.sombrero"},this.price=100,this.image=n.am.IconSombrero,this.activeInStore=!0}}class G extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.Farmer,this.name={key:"strings:storePage.icons.farmer"},this.price=100,this.image=n.am.IconFarmer,this.activeInStore=!0}}class F extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.Helmet,this.name={key:"strings:storePage.icons.helmet"},this.price=100,this.image=n.am.IconHelmet,this.activeInStore=!0}}class U extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.Snorkel,this.name={key:"strings:storePage.icons.snorkel"},this.price=100,this.image=n.am.IconSnorkel,this.activeInStore=!0}}class N extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.Scarf,this.name={key:"strings:storePage.icons.scarf"},this.price=100,this.image=n.am.IconScarf,this.activeInStore=!0}}class H extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.Tie,this.name={key:"strings:storePage.icons.tie"},this.price=100,this.image=n.am.IconTie,this.activeInStore=!0}}class K extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.Worker,this.name={key:"strings:storePage.icons.worker"},this.price=100,this.image=n.am.IconWorker,this.activeInStore=!0}}class W extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.Mummy,this.name={key:"strings:storePage.icons.mummy"},this.price=400,this.image=n.am.IconMummy,this.activeInStore=!1}}class V extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.Player,this.name={key:"strings:storePage.icons.colonist"},this.price=0,this.image=n.am.User,this.activeInStore=!0}}class q extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.FounderHat,this.name={key:"strings:storePage.icons.founderHat"},this.price=1e5,this.image=n.am.IconFounderHat,this.activeInStore=!1}}class Q extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.ColonistHat,this.name={key:"strings:storePage.icons.colonisthat"},this.price=5e4,this.image=n.am.IconColonistHat,this.activeInStore=!1}}class j extends r.k{constructor(...e){super(...e),this.category=i.n9.Icon,this.type=i.l1.SettlerHat,this.name={key:"strings:storePage.icons.settlerHat"},this.price=25e3,this.image=n.am.IconSettlerHat,this.activeInStore=!1
1}}r.k;r.k;r.k;class z extends r.k{constructor(...e){super(...e),this.category=i.n9.Map,this.type=i.ai.Earth,this.name={key:"strings:colonistCommon.gameMaps.fun.earth.title"},this.description="strings:colonistCommon.gameMaps.fun.earth.description",this.price=500,this.image=n.am.MapEarthPreview,this.activeInStore=!0}}class $ extends r.k{constructor(...e){super(...e),this.category=i.n9.Map,this.type=i.ai.USA,this.name={key:"strings:colonistCommon.gameMaps.fun.usa.title"},this.description="strings:colonistCommon.gameMaps.fun.usa.description",this.price=500,this.image=n.am.MapUSAPreview,this.activeInStore=!0}}class Y extends r.k{constructor(...e){super(...e),this.category=i.n9.Map,this.type=i.ai.UK,this.name={key:"strings:colonistCommon.gameMaps.fun.uk.title"},this.description="strings:colonistCommon.gameMaps.fun.uk.description",this.price=500,this.image=n.am.MapUKPreview,this.activeInStore=!0}}class Z extends r.k{constructor(...e){super(...e),this.category=i.n9.Map,this.type=i.ai.Diamond,this.name={key:"strings:colonistCommon.gameMaps.fun.diamond.title"},this.description="strings:colonistCommon.gameMaps.fun.diamond.description",this.price=500,this.image=n.am.MapDiamondPreview,this.activeInStore=!0}}class J extends r.k{constructor(...e){super(...e),this.category=i.n9.Map,this.type=i.ai.Gear,this.name={key:"strings:colonistCommon.gameMaps.fun.gear.title"},this.description="strings:colonistCommon.gameMaps.fun.gear.description",this.price=500,this.image=n.am.MapGearPreview,this.activeInStore=!0}}class X extends r.k{constructor(...e){super(...e),this.category=i.n9.Map,this.type=i.ai.Lakes,this.name={key:"strings:colonistCommon.gameMaps.fun.lakes.title"},this.description="strings:colonistCommon.gameMaps.fun.lakes.description",this.price=500,this.image=n.am.MapLakesPreview,this.activeInStore=!0}}class ee extends r.k{constructor(...e){super(...e),this.category=i.n9.Map,this.type=i.ai.Pond,this.name={key:"strings:colonistCommon.gameMaps.fun.pond.title"},this.description="strings:colonistCommon.gameMaps.fun.pond.description",this.price=500,this.image=n.am.MapPondPreview,this.activeInStore=!0}}class te extends r.k{constructor(...e){super(...e),this.category=i.n9.Map,this.type=i.ai.Twirl,this.name={key:"strings:colonistCommon.gameMaps.fun.twirl.title"},this.description="strings:colonistCommon.gameMaps.fun.twirl.description",this.price=500,this.image=n.am.MapTwirlPreview,this.activeInStore=!0}}class se extends r.k{constructor(...e){super(...e),this.category=i.n9.Map,this.type=i.ai.Classic4PRandom,this.name={key:"strings:colonistCommon.gameMaps.classic.random4P.title"},this.description="strings:colonistCommon.gameMaps.classic.random4P.description",this.price=500,this.image=n.am.MapRandomBasePreview,this.activeInStore=!0}}class ie extends r.k{constructor(...e){super(...e),this.category=i.n9.Map,this.type=i.ai.ShuffleBoard,this.name={key:"strings:colonistCommon.gameMaps.fun.shuffleBoard.title"},this.description="strings:colonistCommon.gameMaps.fun.shuffleBoard.description",this.price=500,this.image=n.am.MapShuffleBoardPreview,this.activeInStore=!0}}class ne extends r.k{constructor(...e){super(...e),this.category=i.n9.Map,this.type=i.ai.BlackForest,this.name={key:"strings:colonistCommon.gameMaps.fun.blackForest.title"},this.description="strings:colonistCommon.gameMaps.fun.blackForest.description",this.price=500,this.image=n.am.MapBlackForestPreview,this.activeInStore=!0}}class re extends r.k{constructor(...e){super(...e),this.category=i.n9.Map,this.type=i.ai.Volcano,this.name={key:"strings:colonistCommon.gameMaps.fun.volcano.title"},this.description="strings:colonistCommon.gameMaps.fun.volcano.description",this.price=500,this.image=n.am.MapVolcanoPreview,this.activeInStore=!0}}class oe extends r.k{constructor(...e){super(...e),this.category=i.n9.Map,this.type=i.ai.GoldRush,this.name={key:"strings:colonistCommon.gameMaps.fun.goldRush.title"},this.description="strings:colonistCommon.gameMaps.fun.goldRush.description",this.price=500,this.image=n.am.MapGoldRushPreview,this.activeInStore=!0}}class ae extends r.k{constructor(...e){super(...e),this.category=i.n9.PresalePack,this.type=i.h8.SettlerPack,this.name={key:"strings:storePage.packs.settler.title"},this.description="strings:storePage.packs.settler.description",this.price=999999999,this.image=n.am.SettlerPack}}class ce extends r.k{constructor(...e){super(...e),this.category=i.n9.PresalePack,this.type=i.h8.ColonistPack,this.name={key:"strings:storePage.packs.colonist.title"},this.description="strings:storePage.packs.colonist.description",this.price=999999999,this.image=n.am.ColonistPack}}class le extends r.k{constructor(...e){super(...e),this.category=i.n9.PresalePack,this.type=i.h8.FounderPack,this.name={key:"strings:storePage.packs.founder.title"},this.description="strings:storePage.packs.founder.description",this.price=999999999,this.image=n.am.FounderPack}}class de extends r.k{constructor(...e){super(...e),this.category=i.n9.Consumable,this.type=i.nx.UsernameChange,this.name={key:"strings:storePage.consumables.usernameChange.title"},this.description="strings:storePage.consumables.usernameChange.description",this.price=1300,this.image=n.am.Guest}}},64141:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_log.ab006193243703eee2ff.svg"},64265:(e,t,s)=>{"use strict";s.d(t,{AB:()=>o,lg:()=>r});var i=s(36872),n=s(92524),r=function(e){return e[e.CoinType1=0]="CoinType1",e[e.CoinType2=1]="CoinType2",e[e.CoinType3=2]="CoinType3",e[e.CoinType4=3]="CoinType4",e[e.CoinType5=4]="CoinType5",e[e.CoinType6=5]="CoinType6",e}({});class o{getProductName(){return{key:"strings:storePage.coins.title",options:{count:this.getTotalCoinAmount()}}}getDefaultPrice(){return this.getUSDPriceWithSign()}getTotalCoinAmount(){return this.baseCoinAmount+this.bonusCoinAmount}getUSDPrice(){return this.price/100}getUSDPriceWithSign(){return`$${this.getUSDPrice()}`}static getAllCoinProducts(){return this.products.values()}static getPurchaseProduct(e){return this.products.get(e)}static getPurchaseProductFromMobileSKUId(e){return Array.from(this.products.values()).find(t=>t.mobileIAPSKUId===e)}static initProducts(e){this.products.set(0,new o({type:0,baseCoinAmount:650,bonusCoinAmount:0,price:499,discordSKUId:e.coin1,mobileIAPSKUId:"coin_id_1",lobbyImage:i.am.CoinStack1,bannerText:void 0,isActive:()=>!0})),this.products.set(1,new o({type:1,baseCoinAmount:1300,bonusCoinAmount:80,price:999,discordSKUId:e.coin2,mobileIAPSKUId:"coin_id_2",lobbyImage:i.am.CoinStack2,bannerText:void 0,isActive:()=>!0})),this.products.set(2,new o({type:2,baseCoinAmount:2600,bonusCoinAmount:400,price:1999,discordSKUId:e.coin3,mobileIAPSKUId:"coin_id_3",lobbyImage:i.am.CoinStack3,bannerText:void 0,isActive:()=>!0})),this.products.set(3,new o({type:3,baseCoinAmount:4500,bonusCoinAmount:800,price:3499,discordSKUId:e.coin4,mobileIAPSKUId:"coin_id_4",lobbyImage:i.am.CoinStack4,bannerText:{key:"strings:storePage.bestSeller"},isActive:()=>!0})),this.products.set(4,new o({type:4,baseCoinAmount:6500,bonusCoinAmount:1300,price:4999,discordSKUId:e.coin5,mobileIAPSKUId:"coin_id_5",lobbyImage:i.am.CoinStack5,bannerText:void 0,isActive:()=>!0})),this.products.set(5,new o({type:5,baseCoinAmount:13e3,bonusCoinAmount:3e3,price:9999,discordSKUId:e.coin6,mobileIAPSKUId:"coin_id_6",lobbyImage:i.am.CoinStack6,bannerText:{key:"strings:storePage.bestValue"},isActive:()=>!0}))}constructor(e){this.storeProductType=n.l6.Coin,this.stripeCheckoutType=n.hg.Payment,this.itemQuantity=1,Object.assign(this,e)}}o.products=new Map},64323:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_trophy.bc5c68a7464f0462721d.svg"},64458:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_active_blue.e81ed2239a2cae997e58.svg"},64475:(e,t,s)=>{"use strict";async function i(e=0){await new Promise(t=>setTimeout(t,e))}s.d(t,{c:()=>i})},64733:(e,t,s)=>{"use strict";s.d(t,{X:()=>r,ih:()=>o,jH:()=>c,vF:()=>l});const i=12,n=100;function r(e){return a(Math.round(e*n))}function o(e){const t=Math.round(e*n);return a(Math.floor(t/i))}function a(e){const t=Number((e/n).toFixed(2));return t%1==0?String(t):t.toFixed(2)}function c(e){return d(e,i)}function l(e){return d(e,1/i)}function d(e,t){var s;if(null==e.price)return"";const i=null===(s=e.displayPrice.match(/[\d.,\u00A0\u202F ]*\d/))||void 0===s?void 0:s[0];if(null==i)return e.displayPrice;const n=function(e,t){const s=t.match(/([.,])(\d{1,2})$/);var i;const n=null!==(i=null==s?void 0:s[1])&&void 0!==i?i:"";var r;const o=null!==(r=null==s?void 0:s[2].length)&&void 0!==r?r:0,a=function(e,t){var s;const i=null!==(s=e.match(/[.,\u00A0\u202F ]/g))&&void 0!==s?s:[];for(const e of i)if(e!=t)return e;return""}(t,n),[c,l]=e.toFixed(o).split("."),d=""==a?c:function(e,t){return e.replace(/\B(?=(\d{3})+(?!\d))/g,t)}(c,a);return 0==o?d:`${d}${n}${l}`}(e.price*t,i);return e.displayPrice.replace(i,n)}},64907:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_pink.fd2e1fb7cd38190ba29a.svg"},65019:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_blue.43d846e83515f35f51f6.svg"},65223:(e,t,s)=>{"use strict";function i(e,t){const s=e.safeParse(t);return s.success?{success:!0,data:s.data,error:null}:{success:!1,data:null,error:s.error}}s.d(t,{o:()=>i})},65410:(e,t,s)=>{"use strict";e.exports=s.p+"assets/subdivisions_ii.859a2e1273532a85b5f0.svg"},65429:(e,t,s)=>{"use strict";s.d(t,{Y:()=>u,j:()=>d});var i=s(36872),n=s(38854),r=s(55547),o=s(46169),a=s(29249),c=s(18587),l=s(9029),d=function(e){return e[e.PrivateRoom=0]="PrivateRoom",e[e.HideBankCards=1]="HideBankCards",e[e.FriendlyRobber=2]="FriendlyRobber",e[e.BalancedDice=3]="BalancedDice",e[e.NoTrolls=4]="NoTrolls",e}({});class u{load(e,t){this.roomState=e,this.rulesData=null!=t?t:new Map;const s=document.getElementById("room_center_rules_info_icon"),i=this.roomState.isTournament;null!=s&&(0,l.G0)(s,()=>{(0,o.d)(i)}),null!=this.rulesSelector?this.updateRulesSelector():this.createRulesSelector()}update(e,t){const s=this.shouldUpdate(e);this.roomState=e,t&&(this.rulesData=t),s&&this.updateRulesSelector()}updateInteractabilityOfElements(e){this.rulesSelector.updateInteractabilityOfElements(e)}overrideRuleAvailableState(e,t){const s=this.rulesData.get(e);null!=s&&(s.available=t,this.updateRulesSelector())}overrideRuleSelectedState(e,t){const s=this.rulesData.get(e);null!=s&&(s.selected=t,this.updateRulesSelector())}createRulesSelector(){const e=this.getRulesItemData();this.rulesSelector=new n.M(this.container,e,!1)}updateRulesSelector(){const e=this.getRulesItemData();this.rulesSelector.update(e)}getRulesItemData(){var e,t,s,n,o,a;return[{name:{key:"strings:roomPage.options.privateGame.title"},image:i.am.PrivateGame,available:!0,selected:null!==(n=null===(e=this.rulesData.get(0))||void 0===e?void 0:e.selected)&&void 0!==n?n:this.roomState.gameSetting.privateGame,canToggle:!0,clickAction:()=>this.onClickPrivateGame(),visible:!this.isTournamentRoom()},{name:{key:"strings:roomPage.options.hideBankCards.title"},image:i.am.HideBankCards,available:!0,selected:this.roomState.gameSetting.hideBankCards,canToggle:!0,clickAction:()=>this.onClickHideBankCards(),visible:!0},{name:{key:"strings:roomPage.options.friendlyRobber.title"},image:i.am.Robber,available:!0,selected:this.roomState.gameSetting.friendlyRobber,canToggle:!0,clickAction:()=>
1this.onClickFriendlyRobber(),visible:!0},{name:{key:"strings:roomPage.options.dice.titleMobile"},image:i.am.Dice6,available:!0,selected:this.roomState.gameSetting.diceSetting==i.ZP.Balanced,canToggle:!0,clickAction:()=>this.onClickBalancedDice(),visible:!0},{name:{key:"strings:roomPage.options.noTrollsGame.title"},image:i.am.IconNoTroll,available:null!==(o=null===(t=this.rulesData.get(4))||void 0===t?void 0:t.available)&&void 0!==o?o:!this.isNoTrollsDisabled(),selected:null!==(a=null===(s=this.rulesData.get(4))||void 0===s?void 0:s.selected)&&void 0!==a?a:this.roomState.isNoTrollsGame(),canToggle:!0,clickAction:()=>this.onClickNoTrolls(),infoAction:()=>this.sendNoTrollsNotification(),visible:!this.isTournamentRoom()&&!c.r.shouldHideStoreOnMobile},{name:{key:"strings:roomPage.orderSelection.title"},image:i.am.ProfileRanked,available:!0,selected:this.roomState.gameSetting.playOrderSelectionActive,canToggle:!0,clickAction:()=>r.sZ.roomClient.togglePlayOrderSelection(),visible:this.isTournamentRoom()}].filter(e=>e.visible)}onClickPrivateGame(){var e;const t=null===(e=this.rulesData.get(0))||void 0===e?void 0:e.onClick;if(null!=t)return void t();const s=!this.roomState.gameSetting.privateGame;r.sZ.roomClient.setPrivateGame(s)}onClickHideBankCards(){const e=!this.roomState.gameSetting.hideBankCards;r.sZ.roomClient.setHideBankCards(e)}onClickFriendlyRobber(){const e=this.roomState.gameSetting.friendlyRobber;r.sZ.roomClient.setFriendlyRobber(!e)}onClickBalancedDice(){const e=this.roomState.gameSetting.diceSetting==i.ZP.Balanced?i.ZP.Random:i.ZP.Balanced;r.sZ.roomClient.setDiceType(e)}onClickNoTrolls(){var e;const t=null===(e=this.rulesData.get(4))||void 0===e?void 0:e.onClick;null==t?r.sZ.roomClient.toggleNoTrolls():t()}shouldUpdate(e){return this.roomState.hostSession.userId!=e.hostSession.userId||(this.roomState.gameSetting.privateGame!=e.gameSetting.privateGame||(this.roomState.gameSetting.hideBankCards!=e.gameSetting.hideBankCards||(this.roomState.gameSetting.friendlyRobber!=e.gameSetting.friendlyRobber||(this.roomState.gameSetting.diceSetting!=e.gameSetting.diceSetting||(this.roomState.isNoTrollsGame()!=e.isNoTrollsGame()||this.roomState.gameSetting.playOrderSelectionActive!=e.gameSetting.playOrderSelectionActive)))))}isTournamentRoom(){return!c.r.isUserOnMobileAppOrWeb&&this.roomState.isTournament}isNoTrollsDisabled(){return!this.roomState.isHostSubscribed()||!!this.roomState.isPrivateGame()}sendNoTrollsNotification(){var e;const t=null===(e=this.rulesData.get(4))||void 0===e?void 0:e.onInfoClick;if(null!=t)return void t();const s=this.roomState.gameSetting.privateGame?{key:"strings:roomPage.notifications.noTrollsGameDisabledWhenPrivate"}:{key:"strings:roomPage.options.noTrollsGame.becomeAMember"};c.r.isUserOnMobileAppOrWeb?r.OV.show(s,a.n.Information,void 0,void 0,void 0,void 0,3e3):r.OV.showNotification(i.am.Lightning,s)}constructor(e){this.container=e}}},65432:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_wall_purple.2bbf47ba3b4f4684fb17.svg"},65780:(e,t,s)=>{"use strict";s.d(t,{X:()=>$});var i=s(72239),n=s(7893),r=s(71763),o=s(46507),a=s(49293);if(/^(269|630|651|85)$/.test(s.j))var c=s(86434);if(/^(269|630|651|85)$/.test(s.j))var l=s(27838);if(/^(269|630|651|85)$/.test(s.j))var d=s(70239);var u=s(66935),h=s(17399),p=s(35883);function m(e){return e.map(e=>({tabId:e.tabId,cards:e.cards.map(g)}))}function g(e){return{modeId:e.modeId,title:e.title,mapImage:null==e.mapImage?void 0:(0,h.tu)(e.mapImage),modeImage:null==e.modeImage?void 0:(0,h.tu)(e.modeImage),description:e.description,estimatedTime:e.estimatedTime,playerCount:e.playerCount,botCount:e.botCount,rotationTime:null==e.rotationEndsAt?void 0:new Date(e.rotationEndsAt),placementProgress:null==e.placement?void 0:{gamesPlayed:e.placement.gamesPlayed,gamesToUnlock:e.placement.gamesRequired},rank:null==e.rank?void 0:{division:{src:(0,h.tu)(p.j.getRankedDivisionImage(e.rank.division)),alt:u.hs},rating:e.rank.rating},freePlay:null==e.freePlay?void 0:y(e.freePlay),unlockRedirectModeId:e.unlockRedirectModeId,content:f(e.content)}}function f(e){switch(e.type){case"single":return{type:"single",icon:(0,h.lx)(e.icon),details:e.details};case"variants":return{type:"variants",variants:e.variants.map(e=>({id:e.id,label:e.label,icon:(0,h.lx)(e.icon),details:e.details}))}}}function y(e){return"dailyFreePlayIn"==e.variant?{variant:"dailyFreePlayIn",nextPlayTime:new Date(e.nextPlayTime)}:e}function v(){return{status:"loading",membership:void 0,tabs:void 0,queueErrors:void 0,newModes:new Set,rankedStates:[]}}function S({requestModeSelectorState:e,requestQueueErrors:t,subscribeToShuffleQueueUpdated:s,getRushGamesPlayed:n}){const r=(0,i.ph)();let o,a,c=!1,u=!1,h=!1;const p=(0,l.y)(()=>({...v(),waitUntilReady:()=>r,init:async()=>{o=s(()=>{u||h&&g()}),await g(),h=!0,r.resolve()},dispose:()=>{u=!0,f(),null==o||o(),o=void 0}}));async function g(){if(!u&&!c){c=!0;try{const[s,i]=await Promise.all([e(),t()]);if(u)return;if(null==s)return f(),void p.setState({...v(),status:"error"});!function(e,t){const s=b(e.tabs,"shuffle"),i=b(e.tabs,"casual4p");var r,o;p.setState({status:"ready",membership:e.membership,tabs:m(e.tabs),queueErrors:t,newModes:(0,d.I)({isLoggedIn:e.isLoggedIn,casualGamesPlayed:null!==(r=null==i?void 0:i.gamesPlayed)&&void 0!==r?r:0,hasPlayedRush:n()>0,hasPlayedShuffle:(null!==(o=null==s?void 0:s.gamesPlayed)&&void 0!==o?o:0)>0}),rankedStates:e.rankedStates});const c=null==s?void 0:s.freePlay;!function(e){if(f(),null==e)return;const t=new Date(e).getTime()-Date.now();if(t<=0)return;a=setTimeout(()=>{a=void 0,u||g()},t)}("dailyFreePlayIn"==(null==c?void 0:c.variant)?c.nextPlayTime:void 0)}(s,i)}finally{c=!1}}}function f(){null!=a&&(clearTimeout(a),a=void 0)}return p}function b(e,t){for(const s of e){const e=s.cards.find(e=>e.modeId==t);if(null!=e)return e}}var C=s(6822),P=s(36872),k=s(81888),T=s(55547),A=s(53829);const R={unrankedClassic1v1:"casual1v1",unrankedClassic4P:"casual4p",unrankedShuffle:"shuffle",rankedClassic1v1:"ranked1v1",rankedClassic4P:"ranked4p",rankedRush4P:"rankedRush",rankedCitiesAndKnights4P:"rankedCitiesAndKnights"},w={shuffle:{type:"notLoggedIn"},ranked1v1:{type:"notLoggedIn"},ranked4p:{type:"notLoggedIn"},rankedRush:{type:"notLoggedIn"},rankedCitiesAndKnights:{type:"notLoggedIn"}};function I(e){switch(e.type){case"notLoggedIn":return{type:"notLoggedIn"};case"noFreeGamesRemaining":case"noCitiesAndKnightsAccess":return{type:"requiresMembership"};case"ranked.notEnoughGamesPlayed":case"shuffle.notEnoughGamesPlayed":return{type:"notEnoughGamesPlayed",gamesPlayed:e.gamesPlayed,gamesRequired:e.gamesRequired};default:{const t=(0,A.i)(e);
1return{type:"unavailable",title:t.title,description:t.description}}}}function M(){if(!k._.hasUser())return Promise.resolve(w);const e=(0,i.ph)(),t=setTimeout(()=>{s(),e.resolve(void 0)},i.R$.secondsAsMilliseconds(3)),s=T.sZ.matchmakingClient.onQueueAccess(n=>{clearTimeout(t),s(),e.resolve(function(e){if(null==e)return;const t={};for(const[s,n]of i.BF.typedEntries(e))null!=n&&(t[R[s]]=I(n));return t}(n))});return T.sZ.matchmakingClient.requestQueueAccess(P.$m),e}var _=s(51309),E=s(44529),D=s(655),L=s(32398),B=s(46456),x=s(18587),O=s(13618),G=s(26876);if(/^(269|630|651|85)$/.test(s.j))var F=s(32349);var U=s(46581),N=s(22194);const H=Date.parse("2027-01-18T00:00:00.000Z"),K={[U.um.VisibleRanked1v1]:U.Nw.RankedClassic1v1,[U.um.VisibleRanked4PClassic]:U.Nw.RankedClassic4P,[U.um.VisibleRankedCitiesAndKnights4P]:U.Nw.RankedCitiesAndKnights4P,[U.um.VisibleRanked4PRush]:U.Nw.RankedRush4P};function W(e,t,s=Date.now()){return!!e.some(e=>e.hadRankLastSeason)&&(!function(e){for(const t of e){const e=t.rankedState;if(null!=e){if(e.type==N.Ob.Placement){if(e.numberOfPlacementGamesFinished>0)return!0;continue}if(e.type==N.Ob.Ranked)return!0}}return!1}(e)&&(t!=e[0].endedSeasonId&&!(s>=H)))}var V=s(76092),q=s(80708);function Q(e){const t={type:e,category:V.eX.MainFunnel};q.CA.sendAnalyticEvent(t)}const j=({isRankedTabSelected:e,rankedStates:t,selectedMatchType:s,onPlayRanked:i})=>{const[n,a]=(0,r.useState)(!1),c=(0,r.useRef)(!1);if((0,r.useEffect)(()=>{if(!e)return;const s=E.p.getNewSeasonPopupSeenSeasonId();W(t,s)&&(E.p.setNewSeasonPopupSeenSeasonId(t[0].endedSeasonId),Q(V.k0.NewSeasonPopupShown),a(!0))},[e,t]),!n)return null;return r.createElement(o.uG,{onClose:()=>{c.current||Q(V.k0.NewSeasonPopupDismissed),a(!1)},onPlayRanked:()=>{c.current=!0,Q(V.k0.NewSeasonPopupPlayClicked),a(!1),i(function(e,t){const s=e.filter(e=>e.hadRankLastSeason);if(1!=s.length)return t;const i=K[s[0].eloType];return null==i?t:i}(t,s))},onLinkClick:()=>{Q(V.k0.NewSeasonPopupFaqLinkClicked),window.open(F.DE,"_blank","noopener,noreferrer")}})},z=({onStartGame:e,onHandleReady:t})=>{var s,i;const n=(0,r.useMemo)(()=>S({requestModeSelectorState:async()=>{const e=await D.m.getRequestHandler(L.l.apiModeSelector(),void 0,void 0,!1);if(null!=e&&e.isSuccess)return e.json},requestQueueErrors:M,subscribeToShuffleQueueUpdated:e=>B.y.registerQueueUpdatedListener(e),getRushGamesPlayed:()=>E.p.getRushGamesPlayed()}),[]),l=(0,c.P)(n),[d,u]=(0,r.useState)(()=>(0,C.pA)()),h=e=>{u(e),(0,C.RC)(e)},p=(0,o.Tj)(d,l.tabs),m=null===(i=l.tabs)||void 0===i||null===(s=i.find(e=>e.cards.some(e=>e.modeId==(null==p?void 0:p.modeId))))||void 0===s?void 0:s.tabId,g=t=>{(0,C.RC)(t),e(t)};if((0,r.useEffect)(()=>(n.getState().init(),()=>n.getState().dispose()),[n]),(0,r.useEffect)(()=>{t({selectByMatchType:e=>{h((0,C.zl)(e))},selectTab:e=>{const t=n.getState().tabs;if(null==t)return;const s=t.find(t=>t.tabId==e);if(null==s)return;const i=s.cards[0];null!=i&&h({modeId:i.modeId})},getRankedStates:()=>n.getState().rankedStates,hasFreePlayAvailable:e=>function(e,t){const s=function(e,t){if(null==e)return;for(const s of e){const e=s.cards.find(e=>e.modeId==t);if(null!=e)return e.freePlay}return}(e,t);return null!=s&&("freeGames"==s.variant?s.remainingCount>0:"dailyFreePlay"==s.variant)}(n.getState().tabs,e),waitUntilReady:()=>n.getState().waitUntilReady()})},[t,n]),"loading"==l.status)return r.createElement(o.kH,null);if("error"==l.status)return null;if(null==l.tabs)return null;if(null==p)return null;return r.createElement(r.Fragment,null,r.createElement(o.LW,{tabs:l.tabs,queueErrors:l.queueErrors,membership:null==l.membership?void 0:a.LO[l.membership],newModes:l.newModes,selection:p,rushRules:{hasPlayedRush:E.p.getRushGamesPlayed()>0,showVideo:!x.r.isUserOnDiscord,onExternalClick:e=>{(0,G.eJ)(),(0,O.Yf)(e,!0)},onShown:G.b4,onDismissed:G.Ly,onConfirmed:G.hc},onSelectionChange:h,onStartGame:g,onLogin:()=>{new _.L},onBecomeMember:()=>{T.P_.premiumMembershipCheckAction()}}),r.createElement(j,{isRankedTabSelected:"ranked"==m,rankedStates:l.rankedStates,selectedMatchType:(0,C.Hs)(p),onPlayRanked:e=>{const t=(0,C.zl)(e);h(t),g(t)}}))};class ${static hasFreePlayAvailable(e){var t,s,i;return null!==(i=null===(s=$.activeController)||void 0===s||null===(t=s.handle)||void 0===t?void 0:t.hasFreePlayAvailable(e))&&void 0!==i&&i}get rankedStates(){var e,t;return null!==(t=null===(e=this.handle)||void 0===e?void 0:e.getRankedStates())&&void 0!==t?t:[]}selectCardByMatchType(e){var t;null===(t=this.handle)||void 0===t||t.selectByMatchType(e)}selectTab(e){var t;null===(t=this.handle)||void 0===t||t.selectTab(e)}constructor(e){this.readyDeferred=(0,i.ph)(),this.onStartGame=e,$.activeController=this,this.waitUntilInitialized=this.readyDeferred,this.view=(0,n.y)("mode_selector_root",z),this.view.render({onStartGame:this.onStartGame,onHandleReady:async e=>
1{this.handle=e,await e.waitUntilReady(),this.readyDeferred.resolve()}})}}},65944:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_paper.42eb7a7b91cc9cf155f3.svg"},65976:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_politics_deserter.8559ed0fe5d6e61c399d.svg"},66217:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_room_get_ready.4645252f794ab5277916.mp3"},66350:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_dice_roll_1.72357fea36268b4d2746.mp3"},66435:(e,t,s)=>{"use strict";s.d(t,{d:()=>r});var i=s(46507);const n=(0,s(11445).K)(i.OF);function r({type:e,beforeImagePath:t,afterImagePath:s}){n({type:e,beforeImagePath:t,afterImagePath:s})}},66516:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_politics_diplomat.a8aebecc914f804e9308.svg"},66710:(e,t,s)=>{"use strict";s.d(t,{j:()=>i});const i=s(63359).YjP().length(4).regex(/^[A-HJ-NP-Za-km-z2-9]{4}$/)},66730:(e,t,s)=>{"use strict";e.exports=s.p+"assets/metropolis_science.a9d436136ce39a5ee1d4.svg"},66873:(e,t,s)=>{"use strict";s.d(t,{C:()=>o});var i=s(18587),n=s(81888),r=s(1863);const o=()=>{const e=a();return c()?{isAdPlatformAvailable:e,canUserSeeAds:!0,canUserSeeLobbyAds:r.z.shouldShowLobbyAds()}:{isAdPlatformAvailable:e,canUserSeeAds:!1}},a=()=>!!i.r.vliPublicKey&&(!!i.r.vliAdvKey&&null!=window.vitag),c=()=>{var e;return!i.r.isUserOnDiscord&&((!i.r.isUserOnMobile||!i.r.shouldHideAdsOnMobile)&&(!n._.isStale()&&!(null===(e=n._.userState)||void 0===e?void 0:e.items.hideAds())))}},66935:(e,t,s)=>{"use strict";s.d(t,{oL:()=>h,zj:()=>l,F2:()=>u,fQ:()=>r,Cv:()=>n,WO:()=>i,hs:()=>c,dN:()=>o.d,Im:()=>d,Co:()=>a.C});var i=function(e){return e.Strings="strings",e}({});const n="î",r="î";var o=s(23813);s(52955);var a=s(91531);const c={key:"strings:colonistCommon.utils.emptyString"};var l=function(e){return e.BaseGame="",e.Seafarers="seafarers",e.CitiesAndKnights="c&k",e.CitiesAndKnightsSeafarers="c&kSeafarers",e}({});function d(e){return"c&k"===e||"c&kSeafarers"===e}var u;s(70925);class h{t(e,t){const s="Invalid Translation";try{const i=this.instance.t(e,t);return"string"==typeof i?i:s}catch(e){return s}}tArray(e,t){const s=["Invalid Translation"];try{const i=h.addReturnObjectOption(t),n=this.instance.t(e,i);return Array.isArray(n)?n:s}catch(e){return s}}static addReturnObjectOption(e){return null==e?{returnObjects:!0}:{...e,returnObjects:!0}}constructor(e){this.instance=e}}!function(e){e.defaultLanguage="en",e.languages=["en","af","ar","ca","cs","da","de","el","es","fi","fr","he","hi","hu","it","ja","ko","nl","no","pl","pt-BR","pt-PT","ro","ru","sr","sv","th","tr","uk","vi","zh-CN","zh-TW"],e.languageEnglishNames={en:"English",af:"Afrikaans",ar:"Arabic",ca:"Catalan",cs:"Czech",da:"Danish",de:"German",el:"Greek",es:"Spanish",fi:"Finnish",fr:"French",he:"Hebrew",hi:"Hindi",hu:"Hungarian",it:"Italian",ja:"Japanese",ko:"Korean",nl:"Dutch",no:"Norwegian",pl:"Polish","pt-BR":"Brazilian Portuguese","pt-PT":"European Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sv:"Swedish",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese","zh-CN":"Chinese (China Mainland)","zh-TW":"Chinese (Taiwan)"}}(u||(u={}))},66987:(e,t,s)=>{"use strict";e.exports=s.p+"assets/road_red.41c6cbd9278108542715.svg"},67523:(e,t,s)=>{"use strict";
1e.exports=s.p+"assets/ship_black_north_west.5588f4dd89afb0902210.svg"},67707:(e,t,s)=>{"use strict";s.d(t,{E:()=>i});class i{static deserialize(e){const t=new i;return t.id=e.id,t}}},67842:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_hamburger.ab3c15acd28022d7636d.svg"},67846:(e,t,s)=>{"use strict";s.d(t,{Mj:()=>l,i4:()=>c,sm:()=>a});var i=s(44529);const n="internalVideoAd",r=36e5,o=24*r;function a(e){const t={source:n,exposedAt:Date.now(),abVariant:e.abVariant,creativeId:e.creativeId,durationMs:e.durationMs,matchType:e.matchType,surface:e.surface};i.p.setInternalVideoAdAttribution(t)}function c(){const e=function(){const e=i.p.getInternalVideoAdAttribution();if(!function(e){if("object"!=typeof e||null==e)return!1;const t=e;if(t.source!=n)return!1;if("number"!=typeof t.exposedAt)return!1;if("string"!=typeof t.abVariant)return!1;if("string"!=typeof t.creativeId)return!1;if("number"!=typeof t.durationMs)return!1;if("string"!=typeof t.matchType)return!1;const s="matchmaking"==t.surface||"rushBots"==t.surface;return s}(e))return void(null!=e&&i.p.clearInternalVideoAdAttribution());const t=Date.now()-e.exposedAt,s=t>o;if(t<0||s)return void i.p.clearInternalVideoAdAttribution();return e}();if(null!=e)return{source:e.source,abVariant:e.abVariant,creativeId:e.creativeId,durationMs:e.durationMs,matchType:e.matchType,surface:e.surface,hoursSinceExposure:(Date.now()-e.exposedAt)/r}}function l(){i.p.clearInternalVideoAdAttribution()}},67900:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_rush_bot.c2a5b1219f04f67eecae.svg"},67908:(e,t,s)=>{"use strict";s.d(t,{Cz:()=>a,Dw:()=>p,FP:()=>P,Qy:()=>f,Wu:()=>u,Wz:()=>l,Zd:()=>v,g1:()=>g,mt:()=>C,o8:()=>b,p9:()=>c,um:()=>d,zd:()=>S});var i=s(72239),n=s(46581),r=s(36872),o=s(78134);!function(e){var t,s,i,n,o;(t=e.State||(e.State={}))[t.GameStateUpdate=r.Vd]="GameStateUpdate",t[t.LobbyStateUpdate=133]="LobbyStateUpdate",t[t.ChannelStateUpdate=134]="ChannelStateUpdate",t[t.GeneralStateUpdate=135]="GeneralStateUpdate",t[t.SocketMonitorUpdate=136]="SocketMonitorUpdate",t[t.RoomEvent=137]="RoomEvent",t[t.SocketEvent=r.Lj]="SocketEvent",t[t.ShuffleStateUpdate=139]="ShuffleStateUpdate",t[t.ReplaceSocket=140]="ReplaceSocket",t[t.MatchmakingEvent=141]="MatchmakingEvent",(s=e.ShuffleState||(e.ShuffleState={}))[s.ShuffleQueueData=1]="ShuffleQueueData",s[s.ShufflePlayerData=2]="ShufflePlayerData",(i=e.GeneralState||(e.GeneralState={}))[i.UpdateOnlineStatus=1]="UpdateOnlineStatus",i[i.ReceivedRoomInvites=2]="ReceivedRoomInvites",i[i.RoomInviteResponse=3]="RoomInviteResponse",i[i.RemoveRoomInvite=4]="RemoveRoomInvite",i[i.RoomInviteSentSuccessfully=5]="RoomInviteSentSuccessfully",i[i.Notifications=6]="Notifications",i[i.MarkedAsRead=7]="MarkedAsRead",i[i.ReceivedFriendRequest=8]="ReceivedFriendRequest",(n=e.LobbyState||(e.LobbyState={}))[n.AutoRejoinGame=1]="AutoRejoinGame",n[n.SessionState=2]="SessionState",n[n.UserStateUpdate=3]="UserStateUpdate",n[n.LobbyDisconnectData=4]="LobbyDisconnectData",n[n.SendPopup=5]="SendPopup",n[n.ShowCornerPopup=6]="ShowCornerPopup",
1n[n.SendBroadcast=7]="SendBroadcast",n[n.SocketTest=8]="SocketTest",n[n.ServerUpdating=9]="ServerUpdating",n[n.ReloadClient=10]="ReloadClient",n[n.ServerUpdated=11]="ServerUpdated",n[n.RoomListUpdate=12]="RoomListUpdate",n[n.ItemPurchaseSuccessPopup=13]="ItemPurchaseSuccessPopup",(o=e.ChannelState||(e.ChannelState={}))[o.ChannelRoomUpdate=1]="ChannelRoomUpdate"}(S||(S={})),function(e){var t;(t=e.UIGameEventEnums||(e.UIGameEventEnums={}))[t.FinishedBuildingGame=0]="FinishedBuildingGame",t[t.GameStateUpdated=1]="GameStateUpdated",t[t.PlayerControllerStateUpdated=2]="PlayerControllerStateUpdated",t[t.DiceStateUpdated=3]="DiceStateUpdated",t[t.BankStateUpdated=4]="BankStateUpdated",t[t.BankTradeRatioStateUpdated=5]="BankTradeRatioStateUpdated",t[t.MapStateUpdated=6]="MapStateUpdated",t[t.KarmaUpdated=7]="KarmaUpdated",t[t.CanResign=8]="CanResign",t[t.AmountOfCardsToDiscardUpdated=9]="AmountOfCardsToDiscardUpdated",t[t.AmountOfCardsToSelect=10]="AmountOfCardsToSelect",t[t.SelectCardsToDiscard=11]="SelectCardsToDiscard",t[t.SelectCardsFromBankUsingDevelopmentCard=12]="SelectCardsFromBankUsingDevelopmentCard",t[t.SelectCardsForPendingDistribution=13]="SelectCardsForPendingDistribution",t[t.SelectCardToGiveToAnotherPlayer=14]="SelectCardToGiveToAnotherPlayer",t[t.ConfirmUseDevelopmentCard=15]="ConfirmUseDevelopmentCard",t[t.StealDevelopmentCardFromPlayer=16]="StealDevelopmentCardFromPlayer",t[t.StealResourceCardFromPlayer=17]="StealResourceCardFromPlayer",t[t.SelectPlayer=18]="SelectPlayer",t[t.SelectPlayerForDevelopmentCard=19]="SelectPlayerForDevelopmentCard",t[t.SelectPlayerAndCard=20]="SelectPlayerAndCard",t[t.SelectDice=21]="SelectDice",t[t.GivePlayerCardFromTile=22]="GivePlayerCardFromTile",t[t.ExchangeCards=23]="ExchangeCards",t[t.GivePlayerGrantedCards=24]="GivePlayerGrantedCards",t[t.CloseTradeUI=25]="CloseTradeUI",t[t.ShowTradeUI=26]="ShowTradeUI",t[t.TradeStateUpdated=27]="TradeStateUpdated",t[t.EmbargoStatusUpdated=28]="EmbargoStatusUpdated",t[t.RemoveTradeOffer=29]="RemoveTradeOffer",t[t.TradeResetStateAtEndOfTurn=30]="TradeResetStateAtEndOfTurn",t[t.TradeResponseState=31]="TradeResponseState",t[t.NewTradeOfferReceived=32]="NewTradeOfferReceived",t[t.TradePlayersCreatingCounterOfferState=33]="TradePlayersCreatingCounterOfferState",t[t.BoldTextInTradeWindow=34]="BoldTextInTradeWindow",t[t.CloseDiscardCardUI=35]="CloseDiscardCardUI",t[t.ShowDiscardCardUI=36]="ShowDiscardCardUI",t[t.ClosePopupUI=37]="ClosePopupUI",t[t.SpecialBuildPhaseStateUpdated=38]="SpecialBuildPhaseStateUpdated",t[t.SetRoadEdgeHighlight=39]="SetRoadEdgeHighlight",t[t.SetShipEdgeHighlight=40]="SetShipEdgeHighlight",t[t.SetCornerHighlight=41]="SetCornerHighlight",t[t.SetTileHighlight=42]="SetTileHighlight",t[t.HighlightDiceNumbersForInventor=43]="HighlightDiceNumbersForInventor",t[t.HighlightedTileTapped=44]="HighlightedTileTapped",t[t.VoteReceived=45]="VoteReceived",t[t.PlayerReceivedAchievement=46]="PlayerReceivedAchievement",t[t.CanvasResized=47]="CanvasResized",t[t.ClickedMultiButton=48]="ClickedMultiButton",t[t.SpectatorDataUpdated=49]="SpectatorDataUpdated",t[t.KnightStateUpdated=50]="KnightStateUpdated",t[t.CityImprovementStateReceived=51]="CityImprovementStateReceived",t[t.CityImprovementStateUpdated=52]="CityImprovementStateUpdated",t[t.ForceShowCityImprovementButtons=53]="ForceShowCityImprovementButtons",t[t.MerchantStateUpdated=54]="MerchantStateUpdated",t[t.GameEnd=55]="GameEnd",t[t.GameEndRematchTextUpdated=56]="GameEndRematchTextUpdated",t[t.RobberMoved=57]="RobberMoved",t[t.MerchantBankTradeRatioActive=58]="MerchantBankTradeRatioActive",t[t.GamePauseToggled=59]="GamePauseToggled",t[t.NewChatMessageReceived=60]="NewChatMessageReceived",t[t.TemporaryPlayerStuckInEmbargoState=61]="TemporaryPlayerStuckInEmbargoState",t[t.BeginnerHintReceived=62]="BeginnerHintReceived",t[t.HighlightTradeOffer=63]="HighlightTradeOffer",t[t.PopupActive=64]="PopupActive",t[t.FeedbackFormSubmitted=65]="FeedbackFormSubmitted",t[t.FloatingNotification=66]="FloatingNotification",t[t.BeginnerModeStart=67]="BeginnerModeStart",t[t.BeginnerModeInteractWithGuide=68]="BeginnerModeInteractWithGuide",t[t.BeginnerModeForceOpenGuideBubble=69]="BeginnerModeForceOpenGuideBubble",t[t.BeginnerModeActionUpdated=70]="BeginnerModeActionUpdated",t[t.BeginnerModeLevelEnd=71]="BeginnerModeLevelEnd",t[t.GameInformationPopupActive=72]="GameInformationPopupActive",t[t.BeginnerModeClickedDisabledElement=73]="BeginnerModeClickedDisabledElement",t[t.SuggestAction=74]="SuggestAction",t[t.SelectDiceNumbersConfirmation=75]="SelectDiceNumbersConfirmation",t[t.DiceNumberAnimationEnd=76]="DiceNumberAnimationEnd",t[t.TileNumberAnimationEnd=77]="TileNumberAnimationEnd",t[t.CardAnimationEnd=78]="CardAnimationEnd",t[t.ClientReconnectionTriggered=79]="ClientReconnectionTriggered",t[t.GameVisibilityUpdated=80]="GameVisibilityUpdated"}(b||(b={}));const a=n.Cz,c=n.p9;var l=function(e){return e[e.Classic4P=0]="Classic4P",e[e.Classic1v1=1]="Classic1v1",e[e.Seafarerers4P=2]="Seafarerers4P",e[e.CitiesAndKnights4P=3]="CitiesAndKnights4P",e[e.Rush4P=4]="Rush4P",e}({});const d=n.um;var u=function(e){return e[e.Development=0]="Development",e[e.Alpha=1]="Alpha",e[e.Beta1=2]="Beta1",e[e.Beta2=3]="Beta2",e[e.Season1=4]="Season1",e[e.Season2=5]="Season2",e[e.Season3=6]="Season3",e[e.Season4=7]="Season4",e[e.Season5=8]="Season5",e[e.Season6=9]="Season6",e[e.Season7=10]="Season7",e[e.Season8=11]="Season8",e[e.Season9=12]="Season9",e[e.Season10=13]="Season10",e[e.Season11=14]="Season11",e[e.Season12=15]="Season12",e[e.Season13=16]="Season13",e[e.Season14=17]="Season14",e[e.Season15=18]="Season15",e[e.Season16=19]="Season16",e[e.Season17=20]="Season17",e[e.Season18=21]="Season18",e}({});const h=n.Ly;function p(e){return{key:`strings:game.settings.gameInfoTab.extension.options.${i.h4.getEnumKey(e,h)}`}}const m=n.ec;function g(e){return{key:`strings:colonistCommon.gameMaps.seafarers.scenarios.${i.h4.getEnumKey(e,m)}`}}const f=n.Qy,y=n.ZP;function v(e){switch(e){case y.Balanced:return{key:"strings:colonistCommon.DiceSettingEnum.Balanced"};case y.Random:return{key:"strings:colonistCommon.DiceSettingEnum.Random"};case y.PredefinedDiceSequenceDeleted:case y.StressTestSequence:return{key:"strings:colonistCommon.utils.bug"}}}var S,b,C,P=function(e){return e[e.NumberOfGamesToUnlockRanked=5]="NumberOfGamesToUnlockRanked",e}({});!function(e){var t,s,i;e.GameSpeedSettings=n.ro,e.getSpeedSettingText=function(e){return{key:o.M1[e].labelTranslationKey}},(t=e.RoomJoinStatus||(e.RoomJoinStatus={}))[t.Joined=0]="Joined",t[t.CannotJoinKicked=1]="CannotJoinKicked",t[t.CannotJoinFull=2]="CannotJoinFull",t[t.CannotJoinKarma=3]="CannotJoinKarma",(s=e.ChannelStatus||(e.ChannelStatus={}))[s.Game=0]="Game",s[s.Room=1]="Room",s[s.Closed=2]="Closed",s[s.Reconnect=3]="Reconnect",(i=e.RoomInfoMessage||(e.RoomInfoMessage={}))[i.None=0]="None",i[i.ClickReady=1]="ClickReady",i[i.PremiumItemSelected=2]="PremiumItemSelected"}(C||(C={}))},68066:(e,t,s)=>{"use strict";s.d(t,{R:()=>a,j:()=>o});var i=s(76092),n=s(80708);function r(e,t,s){const r={type:e,category:i.eX.AdsPerformance,dimensions:{source:t,variant:s}};n.CA.sendAnalyticEvent(r)}function o(e,t){r(i.k0.RushAdImpression,e,t)}function a(e,t){r(i.k0.RushAdClicked,e,t)}},68084:(e,t,s)=>{"use strict";s.d(t,{Cj:()=>o,VD:()=>a,wU:()=>r});var i=s(63359),n=s(55935);const r=i.aig().int().min(1).max(6),o=i.aig().int().min(2).max(12),a=i.YOg(i.k5n(n.DS)).refine(e=>new Set(e).size==e.length,{message:"Player colors must not contain duplicate entries"})},68160:(e,t,s)=>{"use strict";e.exports=s.p+"assets/silver.f683d809422aa364b262.svg"},68282:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_settler.c12ef5c70a711d7b0918.svg"},68492:(e,t,s)=>{"use strict";s.d(t,{F:()=>r});var i=s(69508),n=s(58602);class r{static deserializeErrorData(e){switch(e.type){case i.w.DefaultError:return n.Ak.deserialize(e);case i.w.AuthError:return n.$k.deserialize(e);case i.w.MustLogin:return n.Tb.deserialize(e);case i.w.MustBeMember:return n.je.deserialize(e);case i.w.Blocking:return n.Gf.deserialize(e);default:return}}}},68924:(e,t,s)=>{"use strict";if(s.d(t,{e:()=>r}),517!=s.j)var i=s(63359);const n="At least one property must be provided";function r(e){const t=e.shape,s={};for(const e of Object.keys(t))s[e]=t[e].exactOptional();return i.Ikc(s).strict().refine(e=>Object.keys(e).length>0,{message:n})}},68988:(e,t,s)=>{"use strict";s.d(t,{X:()=>n});var i=s(9029);class n{scale(e){this.mainBlock.style.transform=`scale(${e})`}setWidth(e){this.container.style.width=e+"px"}setHeight(e){this.container.style.height=e+"px"}setPositionLeft(e){this.mainBlock.style.left=e+"px"}setPositionRight(e){this.mainBlock.style.right=e+"px"}setPositionTop(e){this.mainBlock.style.top=e+"px"}setPositionBottom(e){this.mainBlock.style.bottom=e+"px"}setVisibility(e){this.mainBlock.style.visibility=e?"visible":"hidden"}setFullWidth(){this.mainBlock.style.width="100%"}constructor(e,t,s){this.mainBlock=(0,i.Le)(document.body,"main_block "+(t||"")),this.container=(0,i.Le)(this.mainBlock,"game_chat_text_div "+(s||""),e),this.mainBlock.style.position="absolute"}}},69045:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_gifting_christmas.61e50b4ba608edc73a5e.png"},69362:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_offer_rejected.9195821ea4c2ce7ae8a5.mp3"},69508:(e,t,s)=>{"use strict";s.d(t,{R:()=>n,w:()=>i});var i=function(e){return e[e.DefaultError=0]="DefaultError",e[e.AuthError=1
1]="AuthError",e[e.MustLogin=2]="MustLogin",e[e.MustBeMember=3]="MustBeMember",e[e.Blocking=4]="Blocking",e}({}),n=function(e){return e[e.Ok=200]="Ok",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.Conflict=409]="Conflict",e[e.TooManyRequests=429]="TooManyRequests",e[e.InternalServerError=500]="InternalServerError",e[e.ServiceUnavailable=503]="ServiceUnavailable",e}({})},69971:(e,t,s)=>{"use strict";s.d(t,{K:()=>c});var i=s(76092),n=s(80708),r=s(36872);const o="/",a=328;function c(e,t){if(r.$m>a)return;if(e.startsWith(o))return;const s={type:i.k0.UserSentRoomChatMessage,category:i.eX.Room,stringValue:t};n.CA.sendAnalyticEvent(s)}},70014:(e,t,s)=>{"use strict";e.exports=s.p+"assets/social_icon_youtube.8fee61e345ad35610b4c.svg"},70239:(e,t,s)=>{"use strict";function i(e){const t=new Set;return e.isLoggedIn?e.casualGamesPlayed<=0?t:e.hasPlayedRush?(e.hasPlayedShuffle||t.add("shuffle"),t):(t.add("rushBots"),t.add("rankedRush"),t):t}s.d(t,{I:()=>i})},70248:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_inactive_white.6260c1d303ee850b0d41.svg"},70746:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_your_turn.a14bdbd78995b7bec794.mp3"},70908:(e,t,s)=>{"use strict";s.d(t,{aA:()=>$,a7:()=>Q,vX:()=>j,nJ:()=>z});var i=s(88082),n=s(83057),r=s(66935),o=s(9029),a=s(18587),c=s(81888),l=s(44529);const d=s.p+"locales/af_strings.cfde714b4b87ff386995.json",u=s.p+"locales/ar_strings.870ff203bb7ff8961f0b.json",h=s.p+"locales/ca_strings.f3bc1238c35a18c0584b.json",p=s.p+"locales/cs_strings.ddeb2328e05cdec388a7.json",m=s.p+"locales/da_strings.81156049878059b8f248.json",g=s.p+"locales/de_strings.200033229aade967aeb0.json",f=s.p+"locales/el_strings.a0d5f9818d7c911f345b.json";var y=s(70925);const v=s.p+"locales/es_strings.c51bcd4d4c17ef24195e.json",S=s.p+"locales/fi_strings.27b03324e30eaf1bf590.json",b=s.p+"locales/fr_strings.edc376a01f0303b77d2f.json",C=s.p+"locales/he_strings.f83ad5541cb8c15e0203.json",P=s.p+"locales/hi_strings.31ad39080887a4aec4b1.json",k=s.p+"locales/hu_strings.b36cb3843b72915e1242.json",T=s.p+"locales/it_strings.43078d65b42254344b8c.json",A=s.p+"locales/ja_strings.f3ee1e900e564313c32b.json",R=s.p+"locales/ko_strings.70c55af0202feef3bbc2.json",w=s.p+"locales/nl_strings.2d993f1e32ab053b16a4.json",I=s.p+"locales/no_strings.3506b8062a195a7bfdc8.json",M=s.p+"locales/pl_strings.20aee88b2a91e7fd4717.json",_=s.p+"locales/pt-BR_strings.3db1ce8a4ac9c79c4f4f.json",E=s.p+"locales/pt-PT_strings.4c2f5c839ab70cd3e945.json",D=s.p+"locales/ro_strings.1fb87a1afc9e4cccb9bf.json",L=s.p+"locales/ru_strings.6d4d011a5c3f559e85a1.json",B=s.p+"locales/sr_strings.2502d04e82fe7f5f943c.json",x=s.p+"locales/sv_strings.0de8dc58b5354551f8af.json",O=s.p+"locales/th_strings.1bcc9efb450d8acd1935.json",G=s.p+"locales/tr_strings.2a1130c26f6ded2d8edf.json",F=s.p+"locales/uk_strings.1e0bf035dbfb97c952c1.json",U=s.p+"locales/vi_strings.dc00e457382bd86aaaff.json",N=s.p+"locales/zh-CN_strings.dcc538bd938e60423ad8.json",H=s.p+"locales/zh-TW_strings.c6d24363c8f97b46d7a3.json";var K=s(13160);function W(){var e;const t=K.I.getDeviceLanguages();if(0==t.length)return;if(l.p.isLanguagePreferenceSelected())return;if(null!=(null===(e=c._.userState)||void 0===e?void 0:e.language))return;const s=function(e){for(const t of e){const e=V(t);if(null!=e)return e}return r.F2.defaultLanguage}(t);l.p.getLanguage()!=s&&l.p.setLanguage(s),a.r.language!=s&&(window.location.pathname=z(window.location.pathname,s))}function V(e){const t=e.toLowerCase(),s=r.F2.languages.find(e=>e.toLowerCase()==t);if(null!=s)return s;const i=t.split("-"),n=i[0];if("pt"==n)return i.includes("br")?"pt-BR":"pt-PT";if("zh"==n)return function(e){const t=["hant","tw","hk","mo"];return e.some(e=>t.includes(e))}(i)?"zh-TW":"zh-CN";return r.F2.languages.find(e=>e.toLowerCase().split("-")[0]==n)}const q={strings:{af:d,ar:u,ca:h,cs:p,da:m,de:g,el:f,en:y,es:v,fi:S,fr:b,he:C,hi:P,hu:k,it:T,ja:A,ko:R,nl:w,no:I,pl:M,"pt-BR":_,"pt-PT":E,ro:D,ru:L,sr:B,sv:x,th:O,tr:G,uk:F,vi:U,"zh-CN":N,"zh-TW":H}};!function(e){const t=i.Ay;let s;e.init=async function(){return null==s&&(s=async function(){W(),(0,o.i9)((e,t)=>Q.t(e,t)),await t.use(n.A).init({lng:a.r.language,fallbackLng:r.F2.defaultLanguage,ns:r.WO.Strings,backend:{loadPath:(e,t)=>{const s=e[0],i=t[0];return function(e){if("en"===e)return!1;if("string"!=typeof y)return!1;if(String(y).startsWith("/.proxy/"))return!1;const t=!String(y).startsWith("http"),s=String(y).includes("cdn.k
1atan.io")||String(y).includes("testing.colonist.io");return t||s}(s)?`https://cdn.katan.io/development/locales/${s}/${i}.json`:q[i][s]}},defaultNS:r.WO.Strings,interpolation:{skipOnVariables:!1}}),c._.registerChangeListener(e=>{if(null==e)return;if(c._.isStale())return;const t=e.language;null!=t&&(l.p.getLanguage()!=t&&(l.p.setLanguage(t),l.p.setLanguagePreferenceSelected(!0)),a.r.language!=t&&a.r.language==r.F2.defaultLanguage&&(window.location.pathname=z(window.location.pathname,t)))})}()),s}}($||($={}));const Q=new r.oL(i.Ay);const j=new class{getLanguageName(e,t){const s=null!=t?t:this.defaultLocale;try{return new Intl.DisplayNames(s,{type:"language"}).of(e)}catch(t){return r.F2.languageEnglishNames[e]}}getCountryName(e,t){const s=null!=t?t:this.defaultLocale;try{return new Intl.DisplayNames(s,{type:"region"}).of(e)}catch(e){return}}getLanguagePathPrefix(){return this.defaultLocale===r.F2.defaultLanguage?"":`/${this.defaultLocale}`}constructor(e){this.defaultLocale=e}}(a.r.language);function z(e,t){var s;const i=e.split("/"),n=[];var o,a;""==i[0]&&n.push(null!==(o=i.shift())&&void 0!==o?o:"");".proxy"==i[0]&&n.push(null!==(a=i.shift())&&void 0!==a?a:"");return(null===(s=i[0])||void 0===s?void 0:s.match(/^[a-z]{2}(-[a-z]{2})?$/i))&&i.shift(),t!=r.F2.defaultLanguage&&n.push(t),n.push(...i),""==n[n.length-1]&&n.pop(),n.join("/")}var $},70925:(e,t,s)=>{"use strict";e.exports=s.p+"locales/en_strings.9a5d864bf1120c05077d.json"},70970:(e,t,s)=>{"use strict";s.d(t,{F:()=>n});var i=s(72239);class n{static async generateClearanceCookie(){return await this.waitUntilTurnstileIsLoaded(),new Promise((e,t)=>{turnstile.reset(),turnstile.execute("#turnstile-widget",{callback:(t,s)=>e(s),"error-callback":t})})}static async getToken(){return await this.waitUntilTurnstileIsLoaded(),new Promise((e,t)=>{turnstile.reset(),turnstile.execute("#turnstile-widget",{callback:t=>e(t),"error-callback":t})})}static isChallengeResponse(e){return"challenge"==e["cf-mitigated"]}static isTokenResponse(e){return"token"==e["cf-mitigated"]}static async obtainPreClearanceCookie(){return null!=this.preClearanceCookiePromise||(this.preClearanceCookiePromise=(0,i.ph)(),this.getClearanceCookie().then(()=>{var e;return null===(e=this.preClearanceCookiePromise)||void 0===e?void 0:e.resolve()},e=>{var t;return null===(t=this.preClearanceCookiePromise)||void 0===t?void 0:t.reject(e)}).finally(()=>this.preClearanceCookiePromise=void 0)),this.preClearanceCookiePromise}static async getClearanceCookie(){let e=1;for(;e<=5;){try{if(await this.generateClearanceCookie())return}catch(t){if(5==e)throw t}e+=1}}static async waitUntilTurnstileIsLoaded(){if(this.isTurnstileLoaded)return;const e=(0,i.ph)();setTimeout(()=>{e.reject(new Error("Unable to load required script"))},5e3);const t=setInterval(()=>{null!=window.turnstile&&1==turnstile.loaded&&(this.isTurnstileLoaded=!0,e.resolve())},5);return e.finally(()=>clearInterval(t)),e}}n.isTurnstileLoaded=!1},70995:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_privacy.8d16c78288c803e213b2.svg"},71068:(e,t,s)=>{"use strict";s.d(t,{dY:()=>i,eT:()=>r,DL:()=>n,$v:()=>c,_O:()=>d,NF:()=>a,CL:()=>l,VT:()=>u});class i{}i.WAIT_MS_TO_FIT_DICE_NUMBER_ANIMATION=5500,i.WAIT_MS_BEFORE_AUTO_DICE_ROLL=2300,i.BASE_WAIT_MS_FOR_CARD_FLY_ANIMATION=500;var n=function(e){return e[e.Trade=0]="Trade",e[e.Dice=1]="Dice",e[e.TileProbabilityViews=2]="TileProbabilityViews",e[e.RoadActionButton=3]="RoadActionButton",e[e.SettlementActionButton=4]="SettlementActionButton",e[e.CityActionButton=5]="CityActionButton",e[e.BuyDevCardActionButton=6]="BuyDevCardActionButton",e[e.EndTurnActionButton=7]="EndTurnActionButton",e[e.Bank=8]="Bank",e[e.PlayerViewResourceCards=9]="PlayerViewResourceCards",e[e.HowToWinFloatingVP=10]="HowToWinFloatingVP",e[e.InformationButton=11]="InformationButton",e}({}),r=function(e){return e[e.Level1=0]="Level1",e[e.Level2=1]="Level2",e[e.End=2]="End",e}({}),o=s(46581);function a(e){switch(e){case r.Level1:return o.Qy.CampaignLevel1;case r.Level2:return o.Qy.CampaignLevel2;case r.End:throw new Error(`Invalid beginner mode level: ${e}`)}}function c(e){switch(e){case r.Level1:return[];case r.Level2:return[o.R1.BotEasy];case r.End:throw new Error(`Invalid beginner mode level: ${e}`)}}function l(e){switch(e){case r.Level1:return 4;case r.Level2:return 5;case r.End:throw new Error(`Invalid beginner mode level: ${e}`)}}function d(e){switch(e){case r.Level1:return 20;case r.Level2:return 7;case r.End:throw new Error(`Invalid beginner mode level: ${e}`)}}function u(e,t){const s=e/3;if(t>=6)return s;return s+s/6*(6-t)}},71161:(e,t,s)=>{"use strict";e.exports=s.p+"assets/logo_mobile.8106f9eb9cf485b842d2.svg"}
1,71168:(e,t,s)=>{"use strict";s.d(t,{G:()=>r});var i=s(46581);const n=new Set([i.Qy.Classic4P,i.Qy.Classic4PRandom,i.Qy.TutorialSS1HeadingForNewShores4P,i.Qy.TutorialSS2FourIslands4P,i.Qy.TutorialSS3FogIsland4P,i.Qy.TutorialSS4ThroughTheDesert4P]);new Set([i.p9.Classic4P,i.p9.ServerStressTestClassic4P,i.p9.BeginnerModeClassic4P]);class r{sort(e,t){const s=[...e];if(null==t)return this.sortGameList(s);const i=s.filter(e=>t>=e.minimumKarma),n=s.filter(e=>t<e.minimumKarma),r=this.sortGameList(i),o=this.sortGameList(n);return r.concat(o)}sortGameList(e){return[...e].sort((e,t)=>this.getScore(t)-this.getScore(e))}getScore(e){let t=0;return t+=this.getNoTrollsScore(e),t+=this.getModeScore(e),t+=this.getMapScore(e),t+=this.getPlayerCountScore(e),t}getNoTrollsScore(e){return e.minimumKarma!=i.Zt.DEFAULT_KARMA_THRESHOLD?this.NO_TROLLS_GAME_STRENGTH:0}getModeScore(e){const t=e.gameModeSetting;return r.getModePriority(t)*this.MODE_PRIORITY_STRENGTH}getMapScore(e){return!n.has(e.gameMapSetting)?this.MAP_PRIORITY_STRENGTH:0}getPlayerCountScore(e){const t=e.players.length/e.maxPlayers;return t<1?t*this.PLAYER_COUNT_PRIORITY_STRENGTH:this.PLAYER_COUNT_PRIORITY_PENALTY}static getModePriority(e){switch(e){case i.p9.ColonistRush4P:return 5;case i.p9.CitiesAndKnightsSeafarers4P:case i.p9.CitiesAndKnightsSeafarers56P:return 4;case i.p9.CitiesAndKnights4P:case i.p9.CitiesAndKnights56P:return 3;case i.p9.Seafarers4P:case i.p9.Seafarers56P:return 2;case i.p9.Classic56P:case i.p9.Classic78P:return 1;default:return 0}}constructor(){this.NO_TROLLS_GAME_STRENGTH=90,this.MODE_PRIORITY_STRENGTH=30,this.MAP_PRIORITY_STRENGTH=20,this.PLAYER_COUNT_PRIORITY_STRENGTH=10,this.PLAYER_COUNT_PRIORITY_PENALTY=-100}}},71318:(e,t,s)=>{"use strict";s.d(t,{W:()=>P});var i=s(54801),n=s(85801),r=s(55547),o=s(72589),a=s(76092),c=s(87220),l=s(13567),d=s(46581);function u(e){let t=[];return t=t.concat(function(e){const t=[];for(let n=0;n<e.events.length;n++){var s;const r=e.events[n];for(const e in null===(s=r.stateChange.mechanicDevelopmentCardsState)||void 0===s?void 0:s.players){var i;const s=Number(e),o=null===(i=r.stateChange.mechanicDevelopmentCardsState)||void 0===i?void 0:i.players[s];null!=o&&(null!=o.developmentCardsUsed&&o.developmentCardsUsed[o.developmentCardsUsed.length-1]==l.O3.Monopoly&&t.pu
1sh({actionIndex:n,type:"monopolyPlayed"}))}}return t}(e)).concat(function(e){const t=[];let s,i;for(let t=0;t<e.events.length;t++){const n=e.events[t];for(const e in n.stateChange.playerStates){const r=Number(e),o=n.stateChange.playerStates[r];if(null!=(null==o?void 0:o.victoryPointsState))for(const e of Object.keys(o.victoryPointsState)){const n=Number(e),r=o.victoryPointsState[n];if(!1===Boolean(r))continue;const a=d.pO.getVictoryPointByType(n);(null==a?void 0:a.victoryPointType)==d.uj.LargestArmy&&(s=t),(null==a?void 0:a.victoryPointType)==d.uj.LongestRoad&&(i=t)}}}null!=s&&t.push({actionIndex:s,type:"largestArmy"});null!=i&&t.push({actionIndex:i,type:"longestRoad"});return t}(e)),t}var h,p=s(17130),m=s(10369),g=s(58602),f=s(69508),y=s(66935);function v(e){return(0,y.dN)({key:"strings:popups.errors.replay.errorAndMembershipPrompt"},{errorMessage:e,membershipPrompt:{key:"strings:popups.errors.replay.storePurchaseMembershipPrompt"}})}function S(e){return(0,y.dN)({key:"strings:popups.errors.replay.errorAndMembershipPrompt"},{errorMessage:e,membershipPrompt:{key:"strings:popups.errors.replay.storeUpgradeMembershipPrompt"}})}!function(e){class t extends g.Ak{constructor(){super({key:"strings:popups.errors.replay.title"},{key:"strings:popups.errors.replay.invalidPlayerColor"},f.R.BadRequest)}}e.InvalidPlayerColor=t;class s extends g.Ak{constructor(){super({key:"strings:popups.errors.replay.title"},{key:"strings:popups.errors.replay.invalidGameId"},f.R.BadRequest)}}e.InvalidGameId=s;class i extends g.Ak{constructor(){super({key:"strings:popups.errors.replay.title"},{key:"strings:popups.errors.replay.invalidUrlSlug"},f.R.BadRequest)}}e.InvalidUrlSlug=i;class n extends g.Ak{constructor(){super({key:"strings:popups.errors.replay.title"},{key:"strings:popups.errors.replay.gameNotFound"},f.R.BadRequest)}}e.GameNotFound=n;class r extends g.Ak{constructor(){super({key:"strings:popups.errors.replay.title"},{key:"strings:popups.errors.replay.userNotInGame"},f.R.BadRequest)}}e.UserNotInGame=r;class o extends g.je{constructor(){super({key:"strings:popups.errors.replay.title"},v({key:"strings:popups.errors.replay.noMembershipTryingToCreateReplayLink"}),f.R.BadRequest)}}e.NoMembershipTryingToCreateReplayLink=o;class a extends g.je{constructor(){super({key:"strings:popups.errors.replay.title"},v({key:"strings:popups.errors.replay.noMembershipTryingToWatchOwnReplay"}),f.R.BadRequest)}}e.NoMembershipTryingToWatchOwnReplay=a;class c extends g.je{constructor(){super({key:"strings:popups.errors.replay.title"},v({key:"strings:popups.errors.replay.noMembershipTryingToWatchAnotherPlayerReplay"}),f.R.BadRequest)}}e.NoMembershipTryingToWatchAnotherPlayerReplay=c;class l extends g.je{constructor(){super({key:"strings:popups.errors.replay.title"},v({key:"strings:popups.errors.replay.noMembershipTryingToChangeReplayPerspective"}),f.R.BadRequest)}}e.NoMembershipTryingToChangeReplayPerspective=l;class d extends g.je{constructor(){super({key:"strings:popups.errors.replay.title"},v({key:"strings:popups.errors.replay.invalidMembershipTryingToWatchAnotherPlayerReplay"}),f.R.BadRequest)}}e.InvalidMembershipTryingToWatchAnotherPlayerReplay=d;class u extends g.je{constructor(e){super({key:"strings:popups.errors.replay.title"},S({key:"strings:popups.errors.replay.plusMembershipLimitReach",options:{limit:e}}),f.R.BadRequest)}}e.PlusMembershipReplayLimitReached=u;class h extends g.je{constructor(){super({key:"strings:popups.errors.replay.title"},S({key:"strings:popups.errors.replay.invalidMembership"}),f.R.BadRequest)}}e.InvalidMembership=h}(h||(h={}));var b=s(80708),C=s(18587);class P{setupReplayControls(){const e=u(this.replayData.eventHistory);this.uiGameManager.gameStore.getState().gameReplay.setReplayControls({onPreviousTurn:()=>this.previousTurn(),onPreviousAction:()=>this.previousAction(),onNextAction:()=>this.nextAction(),onNextTurn:()=>this.nextTurn(),onChangePerspective:e=>this.onClickChangePerspective(e),currentPlayerPerspective:this.playerPerspective,onShare:()=>p.x.shareOrCopyLink(this.uiGameManager.gameController,this),numberOfActions:this.replayData.eventHistory.events.length,highlightData:e,onChangeActionIndex:e=>this.setAction(e,!1),onClickLog:e=>this.clickedGameLogWithIndex(e)})}bindKeys(){const e=!1;n.N.bindKey("ArrowLeft",()=>this.previousAction(),()=>!0,n.g.InGame,e,0),n.N.bindKey("ArrowRight",()=>this.nextAction(),()=>!0,n.g.InGame,e,0);const t=!0;n.N.bindKey("ArrowLeft",()=>this.previousTurn(),()=>!0,n.g.InGame,t,0),n.N.bindKey("ArrowRight",()=>this.nextTurn(),()=>!0,n.g.InGame,t,0)}filterGameHistory(){for(const t of this.replayData.eventHistory.events){var e;null!=t.stateChange.tradeState&&delete t.stateChange.tradeState,null!=(null===(e=t.stateChange.mechanicSpecialBuildPhaseState)||void 0===e?void 0:e.playerStates)&&(delete t.stateChange.mechanicSpecialBuildPhaseState.playerStates,0==Object.keys(t.stateChange.mechanicSpecialBuildPhaseState).length&&delete t.stateChange.mechanicSpecialBuildPhaseState),this.isLiveGame&&null!=t.stateChange.gameChatState&&delete t.stateChange.gameChatState}this.replayData.eventHistory.events=this.replayData.eventHistory.events.filter(e=>0!==Object.keys(e.stateChange).length)}getReverseGameStateChanges(){const e=[],t=structuredClone(this.replayData.eventHistory.initialState),s=structuredClone(this.replayData.eventHistory.initialState);for(const[n,r]of this.replayData.eventHistory.events.entries()){const r=this.replayData.eventHistory.events[n].stateChange;(0,i.p_)(s,[r]);const o=(0,i.cy)(s,t);if(null==o)throw new Error("Error loading replay data");e[n-1]=o,(0,i.p_)(t,[r])}return e}getBuildGameConfigurations(e,t){const s=structuredClone(this.replayData.eventHistory.initialState);return s.gameLogState=this.getFullGameLogForPlayer(e),this.buildGameConfigurations={gameState:s,playOrder:this.replayData.playOrder,playerColor:e,playerUserStates:this.replayData.playerUserStates,gameDetails:this.replayData.gameDetails,gameSettings:this.replayData.gameSettings,timeLeftInState:0,isReplay:!0,isAfterLiveGame:t},this.buildGameConfigurations}get playerPerspective(){return this.buildGameConfigurations.playerColor}isPlayerPerspectiveAvailable(e){return this.replayData.eventHistory.eventsPerspectives.includes(e)}onClickChangePerspective(e){if(C.r.shouldHideStoreOnMobile)return;b.CA.sendAnalyticEvent({type:a.k0.ReplayClickedChangePerspective,category:a.eX.Replay,floatValue:this.replayAccessMethod});if(!this.isPlayerPerspectiveAvailable(e))return m.r.handleError(new h.NoMembershipTryingToChangeReplayPerspective);this.changePlayerPerspective(e)}changePlayerPerspective(e){this.uiGameManager.resetGameUIToRebuildOnReconnect(),this.buildGameConfigurations.playerColor=e;const t=structuredClone(this.replayData.eventHistory.initialState);for(let e=0;e<=this.actionIndex;e++){const s=this.replayData.eventHistory.events[e].stateChange,n=(0,i.O1)(s,[this.playerPerspective]);(0,i.p_)(t,[n])}this.buildGameConfigurations.gameState={...t,gameLogState:this.getFullGameLogForPlayer(this.playerPerspective),gameChatState:this.buildGameConfigurations.gameState.gameChatState},this.socketActionController.onBuildGame(this.buildGameConfigurations),this.setupReplayControls(),this.updateGameLogPosition(),this.resetEndGameScreen(),this.createEndGameScreen(),this.actionIndex==this.actionIndexForEndgame?this.showEndGameScreen():this.hideEndGameScreen(),this.uiGameManager.gameStore.getState().gameReplay.setActionIndex(this.actionIndex)}previousAction(){this.setAction(this.actionIndex-1,!1)}nextAction(){this.setAction(this.actionIndex+1,!0)}previousTurn(){this.setAction(this.findPreviousTurn(),!1)}nextTurn(){this.setAction(this.findNextTurn(),!1)}getCurrentAction(){return this.actionIndex}findNextTurn(){for(let t=this.actionIndex+1;t<this.replayData.eventHistory.events.length;t++){var e;if(null!=(null===(e=this.replayData.eventHistory.events[t].stateChange.currentState)||void 0===e?void 0:e.completedTurns))return t}return this.replayData.eventHistory.events.length-1}findPreviousTurn(){for(let t=this.actionIndex-1;t>=0;t--){var e;if(null!=(null===(e=this.replayData.eventHistory.events[t].stateChange.currentState)||void 0===e?void 0:e.completedTurns))return t}return this.initialStateIndex}setAction(e,t){(e=o.c.clamp(e,this.initialStateIndex,this.actionIndexForEndgame))!=this.actionIndex&&(e>this.actionIndex?this.advanceToAction(e,t):this.rewindToAction(e,t),this.actionIndex=e,this.updateGameLogPosition(),this.actionIndex==this.actionIndexForEndgame?this.showEndGameScreen():this.hideEndGameScreen(),this.uiGameManager.gameStore.getState().gameReplay.setActionIndex(e))}advanceToAction(e,t){const s=[];for(let t=this.actionIndex+1;t<=e;t++){const e=this.replayData.eventHistory.events[t].stateChange,n=(0,i.O1)(e,[this.playerPerspective]);s.push(n)}const n=(0,i.mg)(s);delete n.gameLogState,this.socketActionController.gameStateUpdated({diff:n,timeLeftInState:0},t)}rewindToAction(e,t){const s=[];for(let t=this.actionIndex-1;t>=e;t--){const e=this.reverseGameStateChanges[t],n=(0,i.O1)(e,[this.playerPerspective]);s.push(n)}const n=(0,i.mg)(s);delete n.gameLogState,this.socketActionController.gameStateUpdated({diff:n,timeLeftInState:0},t)}showEndGameScreen(){this.uiGameManager.mapController.setInteractionEnabled(!1),null==this.endGameScreen?this.createEndGameScreen():this.uiGameManager.gameStore.getState().gameEnd.setIsVisible(!0)}createEndGameScreen(){null!=this.replayData.eventHistory.endGameState&&null==this.endGameScreenPromise&&(this.endGameScreenPromise=this.loadEndGameScreen())}async loadEndGameScreen(){const e=this.replayData.eventHistory.endGameState;null!=e&&(this.endGameScreen=await this.socketActionController.onGameEndState({endGameState:e,isReplayAvailable:!0,rankedUserStates:this.replayData.rankedUserStates},this.isLiveGame),this.actionIndex!=this.actionIndexForEndgame&&this.hideEndGameScreen())}hideEndGameScreen(){null!=this.endGameScreen&&(this.uiGameManager.mapController.setInteractionEnabled(!0),this.uiGameManager.gameStore.getState().gameEnd.setIsVisible(!1))}resetEndGameScreen(){null!=this.endGameScreen&&(this.endGameScreen.destroy(),this.endGameScreen=void 0,this.endGameScreenPromise=void 0)}destroy(){n.N.instance.clearAllKeyBinds(),this.resetEndGameScreen(),this.uiGameManager.mapController.setInteractionEnabled(!0)}clickedGameLogWithIndex(e){const t=this.getActionIndexByGameLogIndex(e);null!=t&&this.setAction(t,!1)}getActionIndexByGameLogIndex(e){if(0==e)return this.initialStateIndex;for(let t=0;t<this.replayData.eventHistory.events.length;t++){const s=this.replayData.eventHistory.events[t].stateChange.gameLogState;for(const i in s){if(Number(i)==e)return t}}}getLastGameLogIndexByActionIndex(){const e=this.actionIndex;if(e==this.initialStateIndex)return 0;if(e<0)return;const t=structuredClone(this.replayData.eventHistory.events[e].stateChange.gameLogState);if(null==t)return;(0,i.KB)(t,[this.buildGameConfigurations.playerColor]);const s=Object.keys(t);return 0!=s.length?Number(s[s.length-1]):void 0}getFullGameLogForPlayer(e){const t=structuredClone(this.replayData.eventHistory.initialState.gameLogState);for(const s of this.replayData.eventHistory.events){const n=s.stateChange.gameLogState;if(null==n)continue;const r=structuredClone(n);(0,i.KB)(r,[e]),Object.assign(t,r)}return t}updateGameLogPosition(){const e=this.getLastGameLogIndexByActionIndex();null!=e&&this.uiGameManager.gameStore.getState().gameReplay.setFocusedLogIndex(e)}constructor(e,t,s,i){this.initialStateIndex=-1,this.socketActionController=t,this.uiGameManager=r.IH,this.isLiveGame=s,this.replayData=e,this.replayAccessMethod=(0,c.t3)(window.location.href);const n=null!=i?i:this.initialStateIndex;this.filterGameHistory(),this.actionIndexForEndgame=this.replayData.eventHistory.events.length-1,this.reverseGameStateChanges=this.getReverseGameStateChanges(),this.actionIndex=this.initialStateIndex,this.buildGameConfigurations=this.getBuildGameConfigurations(this.replayData.playerPerspective,this.isLiveGame),this.uiGameManager.canvasController.buildGame(),this.isLiveGame&&(this.buildGameConfigurations.gameState.gameChatState=this.uiGameManager.gameController.stateController.state.gameChatState),this.socketActionController.onBuildGame(this.buildGameConfigurations),this.updateGameLogPosition(),this.setAction(n,!1),this.bindKeys(),this.createEndGameScreen(),this.actionIndex==this.actionIndexForEndgame?this.showEndGameScreen():this.hideEndGameScreen(),this.setupReplayControls()}}},71568:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_europe_preview.3b8db5e3bd77042b62a6.png"},71704:(e,t,s)=>{s.p=window.assetPath},71806:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_player_count.73a05b7564bc560a87e9.svg"},71894:(e,t,s)=>{"use strict";e.exports=s.p+"assets/store_item_78player.e3c22749967d25b6adf1.png"},71902:(e,t,s)=>{"use strict";e.exports=s.p+"assets/subdivisions_v.7a381b6f8fc8bd4d0d77.svg"},71937:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ship_silver_north_west.9c4a8b26d1721758a8b2.svg"},72046:(e,t,s)=>{"use strict";s.d(t,{x:()=>T,F:()=>k});var i=s(46507),n=s(9029),r=s(36872),o=s(32398),a=s(13618),c=s(40279),l=s(7099),d=s(42003),u=s(39588),h=s(50482),p=s(93581),m=s(18587),g=s(7893),f=s(25783),y=s(55547),v=s(13506);class S{init(e){this.profileLinkController.showSection(e),this.setStickyPlayerInfo(),this.makeApiCall()}onTabSelected(e){this.profileLinkController.showSection(e),this.makeApiCall()}async setStickyPlayerInfo(){S.setUserIcon(this.stickyPlayerInfo.iconImageId),S.setMembershipIcon(this.stickyPlayerInfo.currentMembershipType),S.setStickyUsername(this.stickyPlayerInfo.username)}async makeApiCall(){switch(this.profileLinkController.activeTabId){case i.F_.Overview:null==this.overviewView&&(this.overviewView=(0,g.y)("profile_popup_overview_div",i.Lr),this.overviewView.render({stats:void 0,badges:void 0})),await this.profileLinkController.genericApiCallWrapper(i.F_.Overview,o.l.apiUserProfile.overview(this.username),e=>{var t;null===(t=this.overviewView)||void 0===t||t.render({stats:(0,c.s)(e),badges:(0,c.l)(e.userId)})});break;case i.F_.History:await this.profileLinkController.genericApiCallWrapper(i.F_.History,o.l.apiUserProfile.history(this.username),e=>{this.setHistory(e)});break;case i.F_.Items:await this.profileLinkController.genericApiCallWrapper(i.F_.Items,o.l.apiUserProfile.items(this.username),e=>{this.setItems(e)});break;case i.F_.Ranked:await this.profileLinkController.genericApiCallWrapper(i.F_.Ranked,o.l.apiUserProfileRankedSeasons(),e=>{this.setRankedSeasons(e)})}}static setStickyUsername(e){const t=document.getElementById("profile_popup_sticky_player_info_username");(0,n.RH)(t,{key:"strings:colonistCommon.utils.#buffer",options:{value:e}})}static setUserIcon(e){const t=document.getElementById("profile_popup_sticky_player_info_
1icon"),s=null!=e?e:r.am.Guest;(0,n.zO)(t,s,"profile-icon")}static setMembershipIcon(e){const t=document.getElementById("profile_popup_sticky_player_info_icon");if(null==e)return;const s=h.Zt.getMembershipProduct(e).lobbyImage;(0,n.zO)(t,s,"profile-membership-icon","profile_popup_sticky_player_membership_icon")}setHistory(e){const{gameDatas:t,profileUserId:s}=e,n=(0,v.Ci)(t,s,{isPopup:!0}),r=k("game-history-table",!0);null==this.historyView&&(this.historyView=(0,g.y)(r,i.PV)),this.historyView.render({games:n,profileUsername:decodeURIComponent(this.username),showReplayColumn:!m.r.shouldHideStoreOnMobile,onReplayClick:v.Ip,onUsernameClick:e=>T.init(e)})}setRankedSeasons(e){new d.h(e,this.rankedController,!0)}setItems(e){null==this.itemsView&&(this.itemsView=(0,g.y)("profile_popup_profile_items_div",i.at));const t=m.r.isUserOnMobileAppOrWeb&&y.P_.isSceneGame(),s=m.r.isUserOnDiscord?"https://colonist.io/store":"/store",n=t?void 0:e=>(0,a.Yf)(`${s}#${e.categorySlug}`);this.itemsView.render({items:(0,f.y)(e),onItemClick:n})}constructor(e,t,s){this.username=e,this.stickyPlayerInfo=t,this.profileLinkController=new u.K(!0,e,e=>this.onTabSelected(e)),this.rankedController=new l.T(this.username,!0);const i=document.getElementById("profile_popup_sticky_player_info_text_container");this.friendsController=new p.N(this.username,this.profileLinkController,i,!0),this.init(s)}}var b=s(655),C=s(42466);const P=(0,s(11445).K)(i.aV);function k(e,t){return""+(t?"profile_popup_":"")+e}class T{static init(e,t){T.previousUsernames[T.previousUsernames.length-1]!=e&&(T.removeUsernameFromHistory(e),T.previousUsernames.push(e),T.create(e,t))}static removeUsernameFromHistory(e){T.previousUsernames=T.previousUsernames.filter(t=>t!=e)}static async create(e,t=i.F_.Overview){T.isNavigating=!0,C.y.closeAllPopups();const s=await T.getStickyPlayerInfo(e);if(null==s)return T.removeUsernameFromHistory(e),void(T.isNavigating=!1);var n;n={username:e,showBackButton:T.previousUsernames.length>1,onBack:()=>T.handleBack(),onMount:i=>{T.isNavigating=!1,T.createProfileHTML(i,e),new S(e,s,t)},onDialogClosed:()=>T.handleDialogClosed()},P(n)}static handleBack(){if(T.previousUsernames.length<2)return;T.previousUsernames.pop();const e=T.previousUsernames[T.previousUsernames.length-1];T.create(e)}static handleDialogClosed(){T.isNavigating||(T.previousUsernames.length=0)}static async getStickyPlayerInfo(e){const t=await b.m.getRequestHandler(o.l.apiUserProfile.stickyPlayerInfo(e),void 0);if(null!=t)return t.json}static createProfileHTML(e,t){const s=(0,n.Le)(e,"main_container_block main_container_singleton_page profile-page-main-container profile-popup-container");(0,n.Le)(s,"profile-page-sidebar","profile_popup_profile_sidebar");const i=(0,n.Le)(s,"singleton_page_main_section");T.createStickyPlayerInfo(i,t),T.createOverviewSection(i),T.createRankedSection(i),T.createHistorySection(i),T.createItemsSection(i)}static createStickyPlayerInfo(e,t){const s=(0,n.Le)(e,"sticky_player_info"),i=(0,n.Le)(s,"sticky_player_info_text_container","profile_popup_sticky_player_info_text_container");(0,n.Le)(i,"profile-icon-wrapper","profile_popup_sticky_player_info_icon"),(0,n.n8)(i,{key:"strings:colonistCommon.utils.#buffer",options:{value:t}},"sticky_player_info_username","profile_popup_sticky_player_info_username","H1");const o=(0,n.Le)(i,"component-dropdown-container","profile_popup_sticky_player_info_dropdown"),a=(0,n.Le)(o,"component-dropdown-arrow","profile_popup_sticky_player_info_dropdown_button");(0,n.zO)(a,r.am.DownArrow,"component-icon-down-arrow"),(0,n.Le)(o,"component-dropdown-content")}static createOverviewSection(e){const t=(0,n.Le)(e,"hidden static_center_scroll_profile","profile_popup_overview-container");(0,n.n8)(t,{key:"strings:profilePage.overview.title"},"","","H2"),(0,n.Le)(t,"","profile_popup_overview_div")}static createRankedSection(e){const t=(0,n.Le)(e,"hidden static_center_scroll_profile","profile_popup_ranked-container"),s=(0,n.Le)(t,"profile_ranked_section_header");(0,n.n8)(s,{key:"strings:profilePage.navigationTabs.ranked"},"","","H2"),(0,n.Kr)(s,"","profile_popup_profile_ranked_season_dropdown",()=>{});const i=(0,n.Le)(t,"ranked_mode_player_info_cards_container");T.createRankedCard(i,"profile_popup_ranked_mode_player_info_card_base",r.am.GameModeBase,"settlers of c
1atan base game icon",{key:"strings:leaderboardPage.gameModes.baseGame"},"base"),T.createRankedCard(i,"profile_popup_ranked_mode_player_info_card_1v1",r.am.GameMode1v1,"colonist 1v1 game mode icon",{key:"strings:leaderboardPage.gameModes.1v1"},"1v1"),this.createRankedCard(i,"profile_popup_ranked_mode_player_info_card_rush",r.am.GameModeRankedRush,"colonist rush ranked game mode icon",{key:"strings:leaderboardPage.gameModes.rush"},"rush"),this.createRankedCard(i,"profile_popup_ranked_mode_player_info_card_citiesandknights",r.am.GameModeCnK,"settlers of catan cities and knights icon",{key:"strings:leaderboardPage.gameModes.citiesAndKnights"},"citiesandknights")}static createRankedCard(e,t,s,i,r,o){const a=(0,n.Le)(e,"ranked_mode_player_info_card");a.id=t;const c=(0,n.Le)(a,"ranked-card-header"),l=(0,n.Le)(c,"ranked-card-header-title");(0,n.zO)(l,s,i),(0,n.i5)(l,"",r);const d=(0,n.Le)(a,"ranked-card-content");(0,n.Le)(d,"ranked_mode_player_progress_container",`profile_popup_ranked_mode_player_progress_${o}_container`),(0,n.Le)(d,"ranked_mode_player_stats_container",`profile_popup_ranked_mode_player_stats_${o}_container`)}static createHistorySection(e){const t=(0,n.Le)(e,"hidden static_center_scroll_profile","profile_popup_game-history-container");(0,n.n8)(t,{key:"strings:profilePage.history.title"},"","","H2"),(0,n.Le)(t,"game-history-table-mount","profile_popup_game-history-table")}static createItemsSection(e){const t=(0,n.Le)(e,"hidden static_center_scroll_profile","profile_popup_items-container");(0,n.n8)(t,{key:"strings:profilePage.navigationTabs.items"},"","","H2");const s=(0,n.Le)(t,"profile_container");(0,n.Le)(s,"","profile_popup_profile_items_div")}}T.previousUsernames=[],T.isNavigating=!1},72239:(e,t,s)=>{"use strict";var i,n,r,o,a,c,l;s.d(t,{lv:()=>n,gp:()=>p,R$:()=>a,h4:()=>c,xU:()=>y,BF:()=>r,n:()=>l,N_:()=>h.N,$x:()=>i,Re:()=>o,qE:()=>g.qE,ph:()=>m.p,cb:()=>d.c,Yf:()=>g.Yf,Qn:()=>u.Q,Cc:()=>g.Cc}),function(e){function t(e,t=""){return e.replace(/(<([^>]+)>)/gi,t)}e.replaceHTMLCharacters=t,e.replaceStringAt=function(e,t,s){const i=e.split("");return i[t]=s,i.join("")},e.capitalizeFirstLetter=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},e.getNonAlphanumericCharacterCount=function(e){var t,s;return null!==(s=null===(t=e.match(/[^a-zA-Z0-9]/g))||void 0===t?void 0:t.length)&&void 0!==s?s:0},e.removeUnrenderableCharacters=function(e){return t(e).replace(/['"&<>/()]/g,"")},e.parseFormattedNumber=function(e){return parseInt((null==e?void 0:e.replace(/\D/g,""))||"0",10)}}(i||(i={})),function(e){function t(e,t,s){return e.length<2?1:Math.sqrt(e.map(e=>Math.pow(e-t,2)).reduce((e,t)=>e+t)/(s-1))}function s(e){return e[Math.floor(Math.random()*e.length)]}function i(e,t){const s=e.indexOf(t);return s>-1&&(e.splice(s,1),!0)}e.arraysEqual=function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!=t.length)return!1;for(let s=0;s<e.length;s+=1)if(e[s]!==t[s])return!1;return!0},e.shuffle=function(e){const t=[...e];let s=t.length;for(;s>0;){const e=Math.floor(Math.random()*s);s-=1;const i=t[s];t[s]=t[e],t[e]=i}return t},e.arrayMean=function(e){const t=e.length;return e.length<1?0:e.reduce((e,t)=>e+t)/t},e.arrayStandardDeviation=t,e.arrayStandardError=function(e,t){return e/Math.sqrt(t)},e.calculateConfidenceInterval95=function(s){return 1.96*t(s,e.arrayMean(s),s.length)/Math.sqrt(s.length)},e.arrayPercentile=function(e,t){e.sort((e,t)=>e-t);const s=t/100*(e.length-1),i=Math.floor(s),n=Math.ceil(s);if(i===n)return e[i];{const t=s-i;return e[i]*(1-t)+e[n]*t}},e.randomElementFromArray=s,e.randomElementsKeepInArray=function e(t,i){if(i==t.length)return t;const n=[...t];return n.splice(n.indexOf(s(n)),1),e(n,i)},e.randomElementsThrowFromArray=function e(t,i){if(0==i)return t;const n=[...t];return n.splice(n.indexOf(s(n)),1),e(n,i-1)},e.removeElementFromArray=i,e.removeOneElement=function(e,t){const s=e.indexOf(t);if(-1===s)return e;const i=[...e];return i.splice(s,1),i},e.removeElementsFromArray=function(e,t){for(const s of t)i(e,s)},e.removeDuplicatesFromArray=function(e){return e.filter((e,t,s)=>t==s.indexOf(e))},e.removeAllOccurrenceFromArray=function(e,t){return e.filter(e=>e!==t)},e.countOccurenceOfValueInArray=function(e,t){return e.reduce((e,s)=>s===t?e+1:e,0)},e.elementInArray=function(e,t){for(const s of e)if(s==t)return!0;return!1},e.differenceOfTwoArrays=function(e,t){return e.filter(e=>!t.includes(e))},e.swapElementOfArray=function(e,t,s){const i=e[t];return e[t]=e[s],e[s]=i,e},e.removeAllInstancesOfElementInArray=function(e,t){return e.filter(e=>e!=t)},e.findIndexGreaterThanOrEqual=function(e,t){if(0==e.length)return-1;let s=0,i=e.length-1;for(;i-s>1;){const n=Math.floor((s+i)/2);e[n]<t?s=n:i=n}return e[s]>=t?s:e[i]>=t?i:e[i]<t?-1:s},e.findMaximumIndexLessThanOrEqual=function(e,t){if(0==e.length)return-1;let s=0,i=e.length-1;for(;i-s>1;){const n=Math.floor((s+i)/2);e[n]<=t?s=n:i=n}return e[i]<=t?i:e[s]<=t?s:e[i]>t?-1:s},e.getNElementIfExistsOrClosestLower=function(e,t){if(0!=e.length)return e.length<=t?e[e.length-1]:e[t]},e.sortNumberArrayAscending=function(e){return e.sort((e,t)=>
1e-t)},e.sortNumberArrayDescending=function(e){return e.sort((e,t)=>t-e)},e.isSomeElementIncluded=function(e,t){return t.some(t=>e.includes(t))},e.getUniqueElements=function(e){return Array.from(new Set(e))},e.last=function(e){return e[e.length-1]}}(n||(n={})),function(e){e.isObjectEqual=function(e,t){const s=Object.getOwnPropertyNames(e),i=Object.getOwnPropertyNames(t);if(s.length!=i.length)return!1;for(const i of s)if(e[i]!==t[i])return!1;return!0},e.arrayToObjectWithIndexesAsKeys=function(e){const t={};for(let s=0;s<e.length;s++)t[s]=e[s];return t},e.removeAllPropertiesEqualTo=function(e,t){for(const s in e)e[s]===t&&delete e[s]},e.isNestedObjectEmpty=function e(t){for(const s in t){const i=t[s];if(Array.isArray(i))return!1;if(!("object"==typeof i&&null!==i))return!1;if(!e(i))return!1}return!0},e.createBidirectionalRecord=function(e){const t={},s={};for(const[i,n]of e)t[i]=n,s[n]=i;return{leftToRight:t,rightToLeft:s}},e.typedEntries=function(e){return Object.entries(e)}}(r||(r={})),function(e){var t;function s(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function i(t,s){let i=(t.getTime()-s.getTime())/e.MILLISECONDS;const n=Math.floor(i/a.daysAsSeconds(1));i-=a.daysAsSeconds(n);const r=Math.floor(i/a.hoursAsSeconds(1))%e.HOURS_IN_DAY;i-=a.hoursAsSeconds(r);const o=Math.floor(i/a.minutesAsSeconds(1))%e.SECONDS_IN_MINUTE;return i-=a.minutesAsSeconds(o),{days:n,hours:r,minutes:o}}function n(e,t=new Date){return new Date(t.getTime()+a.daysAsMilliseconds(e))}function r(t,s){return Math.abs(t.getTime()-s.getTime())/(e.MILLISECONDS*e.SECONDS_IN_MINUTE*e.MINUTES_IN_HOUR*e.HOURS_IN_DAY)}e.MILLISECONDS=1e3,e.SECONDS_IN_MINUTE=60,e.SECONDS_IN_HOUR=3600,e.MINUTES_IN_HOUR=60,e.SECONDS_IN_DAY=86400,e.HOURS_IN_DAY=24,e.DAYS_IN_WEEK=7,e.DAYS_IN_MONTH=30,e.DAYS_IN_YEAR=365.25,e.WEEKS_IN_MONTH=e.DAYS_IN_MONTH/e.DAYS_IN_WEEK,e.MONTHS_IN_YEAR=12,(t=e.TimeType||(e.TimeType={})).Day="day",t.Hour="hour",t.Minute="minute",e.isDatePassed=function(e){const t=new Date(e);return new Date>t},e.isDateInTheFuture=function(e){return null!=e&&new Date<e},e.millisecondsLeftInUTCDay=function(t){const s=e.HOURS_IN_DAY-t.getUTCHours()-1,i=e.MINUTES_IN_HOUR-t.getUTCMinutes()-1,n=e.SECONDS_IN_MINUTE-t.getUTCSeconds()-1,r=e.MILLISECONDS-t.getUTCMilliseconds()-1;return(n+i*e.SECONDS_IN_MINUTE+s*e.SECONDS_IN_HOUR)*e.MILLISECONDS+r},e.getDate=s,e.getDateTime=function(e){return`${s(e)}-${String(e.getHours()).padStart(2,"0")}-${String(e.getMinutes()).padStart(2,"0")}-${String(e.getSeconds()).padStart(2,"0")}`},e.getHoursAgoInTimestampFormat=function(t){const s=t*e.MINUTES_IN_HOUR*e.SECONDS_IN_MINUTE*e.MILLISECONDS;return Math.floor((Date.now()-s)/e.MILLISECONDS)},e.convertTimestampToDateTimeText=function(e){return{key:"strings:colonistCommon.utils.#date",options:{value:new Date(Number(e)),formatParams:{value:{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}}}}},e.timeToString=function(t){const s=t/e.MILLISECONDS,i=Math.floor(s/(e.MINUTES_IN_HOUR*e.SECONDS_IN_MINUTE)),n=Math.floor(s%e.SECONDS_IN_HOUR/e.SECONDS_IN_MINUTE),r=Math.floor(s%e.SECONDS_IN_MINUTE);let o="";return o=i<10?("0"+i).slice(-2):i.toString(),o+":"+("0"+n).slice(-2)+":"+("0"+r).slice(-2)},e.timePadding=function(e){return e<10?"0"+e.toString():e.toString()},e.getUTCTimeString=function(e){return new Date(e).toUTCString()},e.minutesPassedSince=function(t){const s=(Date.now()-t)/e.MILLISECONDS;return Math.round(s/e.SECONDS_IN_MINUTE)},e.millisecondsPassedSince=function(e){return Date.now()-e},e.isThisLastMonth=function(t,s=Date.now()){return t>s-e.MILLISECONDS*e.SECONDS_IN_MINUTE*e.MINUTES_IN_HOUR*e.HOURS_IN_DAY*e.DAYS_IN_MONTH},e.isThisLastYear=function(t,s=Date.now()){return t>s-e.MILLISECONDS*e.SECONDS_IN_MINUTE*e.MINUTES_IN_HOUR*e.HOURS_IN_DAY*e.DAYS_IN_MONTH*e.MONTHS_IN_YEAR},e.secondsLeftForCurrentState=function(e){return e<0?0:Math.round(e)},e.yesterdayDate=function(){return n(-1)},e.getWeekNumber=function(e){const t=new Date(e);t.setUTCDate(t.getUTCDate()+4-(t.getUTCDay()||7));const s=new Date(Date.UTC(t.getUTCFullYear(),0,1));return[Math.ceil(((+t-+s)/864e5+1)/7),t.getUTCFullYear()]}
1,e.getDaysHoursMinutesBetweenDates=i,e.getDaysHoursMinutesBetweenDatesString=function(e,t){const s=i(e,t);return`${s.days} days ${s.hours} hours ${s.minutes} minutes`},e.getDaysHoursOrMinutesBetweenDates=function(e,t){const s=i(e,t),{days:n,hours:r,minutes:o}=s;return n>0?{dateType:"day",duration:n}:r>0?{dateType:"hour",duration:r}:{dateType:"minute",duration:o}},e.getOneWeekInThePast=function(){return n(-e.DAYS_IN_WEEK)},e.getOneWeekInTheFuture=function(){return n(e.DAYS_IN_WEEK)},e.getNDaysInThePast=function(e){return n(-e)},e.adjustDateByDays=n,e.adjustDateByMinutes=function(e,t=new Date){return new Date(t.getTime()+a.minutesAsMilliseconds(e))},e.adjustDateByMilliseconds=function(e,t=new Date){return new Date(t.getTime()+e)},e.formatSecondsToElapsedString=function(t){const s=Math.floor(t/e.SECONDS_IN_HOUR),i=Math.floor((t-s*e.SECONDS_IN_HOUR)/e.SECONDS_IN_MINUTE),n=Math.floor(t-s*e.SECONDS_IN_HOUR-i*e.SECONDS_IN_MINUTE);let r=i.toString().padStart(2,"0")+":"+n.toString().padStart(2,"0");return s&&(r=s.toString().padStart(2,"0")+":"+r),r},e.absoluteDifferenceInDays=r,e.differenceInDays=function(t,s){return(s.getTime()-t.getTime())/(e.MILLISECONDS*e.SECONDS_IN_MINUTE*e.MINUTES_IN_HOUR*e.HOURS_IN_DAY)},e.getDifferenceInSeconds=function(t,s=Date.now()){const i="number"==typeof t?t:t.getTime();return(("number"==typeof s?s:s.getTime())-i)/e.MILLISECONDS},e.isDateInBetween=function(e,t,s){return e<=s&&s<=t},e.addYears=function(e,t){const s=new Date(e.getTime());return s.setUTCFullYear(s.getUTCFullYear()+t),s},e.toDate=function(e){return e instanceof Date?e:new Date(e)},e.getStartOfDay=function(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),0,0,0,0))},e.getEndOfDay=function(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),23,59,59,999))},e.formatDateDistance=function(t,s){const i=r(t,s);if(i<1)return{key:"strings:colonistCommon.dates.day",options:{count:1}};if(i<e.DAYS_IN_MONTH)return{key:"strings:colonistCommon.dates.day",options:{count:Math.round(i)}};const n=i/e.DAYS_IN_MONTH;return{key:"strings:colonistCommon.dates.month",options:{count:Math.round(n)}}},e.formatCountdownString=function(t){const s=new Date,i=(t.getTime()-s.getTime())/e.MILLISECONDS,n=i/e.SECONDS_IN_DAY;if(n>=1)return`${Math.floor(n)}d`;const r=i/e.SECONDS_IN_HOUR;if(r>=1)return`${Math.floor(r)}h`;const o=i/e.SECONDS_IN_MINUTE;if(o>=1)return`${Math.floor(o)}m`;const a=i%e.SECONDS_IN_MINUTE;return a>=1?`${Math.floor(a)}s`:"0s"},e.getAdaptiveCountdownPollIntervalMs=function(e,t=Date.now()){const s=a.daysAsMilliseconds(1),i=a.hoursAsMilliseconds(1),n=a.minutesAsMilliseconds(1),r=a.secondsAsMilliseconds(1);if(e>=s)return i;if(e>=i)return n;if(e<=n){const e=t%r;return 0==e?r:r-e}return Math.min(n,e-n)},e.getTimeAgoTextFromDate=function(t){const s=new Date,i=Math.floor((s.getTime()-t.getTime())/e.MILLISECONDS);if(i<e.SECONDS_IN_MINUTE)return{key:"strings:popups.notification.timeAbbreviations.second",options:{count:i}};const n=Math.floor(i/e.SECONDS_IN_MINUTE);if(n<e.MINUTES_IN_HOUR)return{key:"strings:popups.notification.timeAbbreviations.minute",options:{count:n}};const r=Math.floor(n/e.MINUTES_IN_HOUR);if(r<e.HOURS_IN_DAY)return{key:"strings:popups.notification.timeAbbreviations.hour",options:{count:r}};const o=Math.floor(r/e.HOURS_IN_DAY);if(o<e.DAYS_IN_WEEK)return{key:"strings:popups.notification.timeAbbreviations.day",options:{count:o}};const a=Math.floor(o/e.DAYS_IN_WEEK);if(a<e.WEEKS_IN_MONTH)return{key:"strings:popups.notification.timeAbbreviations.week",options:{count:a}};const c=Math.floor(o/e.DAYS_IN_MONTH);return c<e.MONTHS_IN_YEAR?{key:"strings:popups.notification.timeAbbreviations.month",options:{count:c}}:{key:"strings:popups.notification.timeAbbreviations.year",options:{count:Math.floor(o/e.DAYS_IN_YEAR)}}}}(o||(o={})),function(e){function t(e){return e*o.MILLISECONDS}function s(e){return e*t(o.SECONDS_IN_MINUTE)}function i(e){return e*s(o.MINUTES_IN_HOUR)}function n(e){return e*i(o.HOURS_IN_DAY)}function r(e){return e*o.SECONDS_IN_MINUTE}function a(e){return e*r(o.MINUTES_IN_HOUR)}function c(e){return e*a(o.HOURS_IN_DAY)}e.secondsAsMilliseconds=t,e.minutesAsMilliseconds=s,e.hoursAsMilliseconds=i,e.daysAsMilliseconds=n,e.weeksAsMilliseconds=function(e){return e*n(o.DAYS_IN_WEEK)},e.monthsAsMilliseconds=function(e){return e*n(o.DAYS_IN_MONTH)},e.minutesAsSeconds=r,e.hoursAsSeconds=a,e.daysAsSeconds=c,e.weeksAsSeconds=function(e){return e*c(o.DAYS_IN_WEEK)},e.monthsAsSeconds=function(e){return e*c(o.DAYS_IN_MONTH)}}(a||(a={})),function(e){e.loopEnums=function(e,t){for(const s in e){const e=Number(s);isNaN(e)||t(s,e)}},e.iterateEnum=function(e,t){for(const s in e)isNaN(Number(s))&&t(e[s])},e.getLength=function(e){return Object.keys(e).filter(e=>isNaN(Number(e))).length},e.getEnumKey=function(e,t){return t[e]},e.getEnumValue=function(e,t){if(null!=e)return isNaN(Number(e))?t[e]:void 0!==t[Number(e)]?Number(e):void 0},e.getEnumKeys=function(e){return Object.keys(e).filter(e=>isNaN(Number(e)))},e.getEnumValues=function(e){return Object.keys(e).filter(e=>isNaN(Number(e))).map(t=>e[t])}}(c||(c={})),function(e){function t(e,t){return Math.floor(Math.random()*(t-e+1))+e}e.randomIntBetween=t,e.randomNumberBetweenFloat=function(e,t){return Math.random()*(t-e)+e},e.randomUniqueIndicesFromLength=function(e,s){const i=new Set;if(0===e)return[];s>e&&(s=e);for(let n=0;n<s;n+=1){const s=t(0,e-1);i.has(s)?n-=1:i.add(s)}return Array.from(i)};const s=n.differenceOfTwoArrays(["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"],["1","I","l","O","0"]);function i(){return Math.random()<.5?-1:1}e.randomStringId=function(e){let t="";for(let i=0;i<e;i+=1)t+=s[Math.floor(Math.random()*s.length)];return t},e.randomNumberExcept=function e(s,i,n){const r=t(s,i);return r!=n?r:e(s,i,n)},e.randomBool=function(){return Math.random()>=.5},e.randomAngle=function(){return 2*Math.PI*Math.random()},e.randomSign=i,e.randomNegativePositive=function(e){return e*Math.random()*i()},e.randomWeightedValue=function(e,t){const s=t.reduce((e,t)=>
1e+t,0),i=Math.random()*s;let n=0;for(let s=0;s<e.length;s+=1)if(n+=t[s],i<=n)return e[s];return e[e.length-1]}}(l||(l={}));var d=s(64475);if(837!=s.j)var u=s(32294);if(837!=s.j)var h=s(42845);class p{add(e,...t){return e(...t),this.addWithoutCallback(e)}addWithoutCallback(e){return this.changeListeners.push(e),()=>{n.removeElementFromArray(this.changeListeners,e)}}trigger(...e){for(const t of[...this.changeListeners])t(...e)}clear(){this.changeListeners.length=0}constructor(){this.changeListeners=[]}}var m=s(61651);if(!/^(251|837)$/.test(s.j))var g=s(10968);var f=s(36872);class y{static getLowTimeThresholdSeconds(e){if("fixed"===e.type)return 5;if(e.allocatedTimeSeconds<=0)return 0;const t=Math.ceil(.25*e.allocatedTimeSeconds),s=Math.min(t,5);return Math.max(s,2)}static shouldDisable10SecondRuleFor(e){switch(e){case f.ro.Base15s:case f.ro.Base30s:case f.ro.Base60s:case f.ro.Rush5s:case f.ro.Rush8s:case f.ro.Rush10s:case f.ro.Rush15s:case f.ro.Rush20s:return!0;case f.ro.Base120s:case f.ro.Base240s:case f.ro.Base12000s:return!1}}static getDefaultTradeAutoRejectionTimeByGameSpeed(e){switch(e){case f.ro.Base15s:return 6*o.MILLISECONDS;case f.ro.Base30s:return 8*o.MILLISECONDS;case f.ro.Base60s:return 10*o.MILLISECONDS;case f.ro.Base120s:return 13*o.MILLISECONDS;case f.ro.Base240s:return 15*o.MILLISECONDS;case f.ro.Base12000s:return 20*o.MILLISECONDS;case f.ro.Rush5s:return 4*o.MILLISECONDS;case f.ro.Rush8s:return 6*o.MILLISECONDS;case f.ro.Rush10s:return 8*o.MILLISECONDS;case f.ro.Rush15s:return 12*o.MILLISECONDS;case f.ro.Rush20s:return 15*o.MILLISECONDS}}}},72248:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_jellyfish_preview.11e41b21ff189e73e808.png"},72311:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_active_red.c3f8cee3b33acb5380dc.svg"},72589:(e,t,s)=>{"use strict";var i;s.d(t,{c:()=>i}),function(e){function t(e,t,s){return Math.max(Math.min(e,s),t)}e.isNumberBetween=function(e,t,s){return!(e<t)&&!(e>s)},e.lerp=function(e,t,s,i,n){return(n-e)/(t-e)*(i-s)+s},e.calculatePercentage=function(e,t,s){return 100*(e-t)/(s-t)},e.clampBetweenZeroAndOne=function(e){return t(e,0,1)},e.clamp=t}(i||(i={}))},72611:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_grain.09c9d82146a64bce69b5.svg"},72957:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_knight.a58573f2154fa93a6319.svg"},73023:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_inactive_orange.f7ef7762a682203c66aa.svg"},73050:(e,t,s)=>{"use strict";e.exports=s.p+"assets/settlement_white.a642a431b4bb73d63dae.svg"},73264:(e,t,s)=>{"use strict";s.d(t,{O:()=>f});var i=s(9029),n=s(80708),r=s(84445),o=s(32398),a=s(76092),c=s(24127),l=s(73745),d=s(9557),u=s(36872),h=s(13618),p=s(16611),m=s(766),g=s(39853);class f extends c.r{getDisclaimerKey(){return this.pricing.billingNote}getPriceKey(){const e="year"==this.pricing.period?"strings:storePage.sections.membership.billing.yearlyPayment":"strings:storePage.sections.membership.billing.paidMonthly";return this.pricing.isLocalized?{key:e,options:{context:"localized",amount:this.pricing.amount}}:{key:e,options:{context:"biggerPrice",amount:this.pricing.amount,currency:"$"}}}createDefaultAction(){(0,i.G0)(this.productDiv,()=>{p.A9.play(p.hc.Click),this.sendClickAnalytic(),(0,g.yq)(this.getColonistMembershipType()),(0,r.E8)()?(0,r.Lj)():(0,r.Uf)(()=>{this.sendToCheckout()})})}showStrikeThroughPrice(){if(null==this.pricing.strikethroughAmount)return;const e="year"==this.pricing.period?"strings:storePage.sections.membership.billing.yearlyPayment":"strings:storePage.sections.membership.billing.paidMonthly",t=this.pricing.isStrikethroughLocalized?"strikethroughLocalized":"strikethrough",s=(0,i.Wr)(this.priceDiv,{key:e,options:{context:t,amount:this.pricing.strikethroughAmount}},"strikethrough-price","");this.priceDiv.insertBefore(s,this.priceDiv.firstChild)}sendToCheckout(){(0,r.E8)()?(0,r.Lj)():((0,m.i)({storeProductType:this.membershipProduct.storeProductType,productType:this.membershipProduct.type,method:"stripeCheckout"}),null==this.membershipProduct.oneTimePurchaseType?(0,h.Yf)(o.l.checkoutMembershipUrl(this.getColonistMembershipType())):(0,h.Yf)(o.l.checkoutOneTimePurchaseUrl(this.membershipProduct.oneTimePurchaseType)))}sendClickAnalytic(){(0,g.W4)(this.getColonistMembershipType())}
1getColonistMembershipType(){if(this.storeState.membershipToggleYearlyActive){if(this.membershipProduct.type==u.Qb.PlusMonthly)return u.Qb.PlusYearly;if(this.membershipProduct.type==u.Qb.PremiumMonthly)return u.Qb.PremiumYearly;if(this.membershipProduct.type==u.Qb.EliteMonthly)return u.Qb.EliteYearly}return this.membershipProduct.type}changeToDowngradeButton(){this.removeButtonStyling(),(0,i.RH)(this.subscribeButtonText,{key:"strings:storePage.sections.membership.action.downgrade"}),(0,i.G0)(this.productDiv,()=>{p.A9.play(p.hc.Click),this.sendClickAnalytic(),(0,r.Uf)(()=>{this.manageSubscription()})})}changeToManageButton(){this.removeButtonStyling(),(0,i.RH)(this.subscribeButtonText,{key:"strings:storePage.sections.membership.action.manage"}),this.subscribeButton.classList.add("button_owned"),(0,i.G0)(this.productDiv,()=>{p.A9.play(p.hc.Click),this.sendClickAnalytic(),(0,r.Uf)(()=>{this.manageSubscription()})})}changeToUpgradeButton(){this.removeButtonStyling(),(0,i.RH)(this.subscribeButtonText,{key:"strings:storePage.sections.membership.action.upgrade"}),this.subscribeButton.classList.add("button_upgrade"),(0,i.G0)(this.productDiv,()=>{p.A9.play(p.hc.Click),this.sendClickAnalytic(),(0,r.Uf)(()=>{this.manageSubscription()})})}changeToGoAnnualButton(){this.removeButtonStyling(),(0,i.RH)(this.subscribeButtonText,{key:"strings:storePage.sections.membership.action.goAnnual"}),this.subscribeButton.classList.add("button_upgrade"),(0,i.G0)(this.productDiv,()=>{p.A9.play(p.hc.Click),this.sendClickAnalytic(),(0,r.Uf)(()=>{this.manageSubscription()})})}changeToOwnedButton(){this.removeButtonStyling(),(0,i.RH)(this.subscribeButtonText,{key:"strings:popups.owned.title"}),this.subscribeButton.classList.add("button_owned"),(0,i.G0)(this.productDiv,()=>{})}changeToCancelButton(){this.removeButtonStyling(),(0,i.RH)(this.subscribeButtonText,{key:"strings:storePage.sections.membership.action.cancel"}),this.subscribeButton.classList.add("button_owned"),(0,i.G0)(this.productDiv,()=>(0,d.Yh)())}removeButton(){this.subscribeButton.classList.add("hidden"),(0,i.G0)(this.productDiv,()=>{})}removeButtonStyling(){this.subscribeButton.classList.contains("button_upgrade")&&this.subscribeButton.classList.remove("button_upgrade"),this.subscribeButton.classList.contains("button_owned")&&this.subscribeButton.classList.remove("button_owned")}manageSubscription(){(0,d.dF)()}constructor(e,t,s,o){var c;super(e,s),this.storeState=t,this.localizedPriceData=null==o?void 0:o.localizedPriceData,this.localizedMonthlyPriceData=null==o?void 0:o.localizedMonthlyPriceData,this.createDefaultAction(),this.pricing=(0,l.F)({product:s,localizedPrice:this.localizedPriceData,localizedMonthlyPrice:this.localizedMonthlyPriceData,showsYearlyTotalOnAnnual:null!==(c=null==o?void 0:o.showsYearlyTotalOnAnnual)&&void 0!==c&&c}),this.priceDiv=(0,i.Le)(this.productDiv,"store-page-membership-price",""),this.membershipPrice=(0,i.Wr)(this.priceDiv,this.getPriceKey(),"",""),null!=this.pricing.strikethroughAmount&&this.showStrikeThroughPrice(),this.disclaimerText=(0,i.Wr)(this.productDiv,{key:"strings:colonistCommon.utils.emptyString"},"store_page_membership_disclaimer","");const d=this.getDisclaimerKey();(0,i.RH)(this.disclaimerText,d),this.buttonsContainer=(0,i.Le)(this.productDiv,"store-button-membership-container"),this.subscribeButton=(0,i.Le)(this.buttonsContainer,"store-button-membership"),this.subscribeButtonText=(0,i.Wr)(this.subscribeButton,{key:"strings:storePage.sections.membership.action.subscribe"},"","");const h=null==o?void 0:o.giftOverlay;if(!h)return;this.giftButton=(0,i.Le)(this.buttonsContainer,"store-button-gift"),(0,i.zO)(this.giftButton,u.am.StoreGiftMembership);const p={type:a.k0.ABTestClickAnalytics,category:a.eX.GiftMembershipOverlay,floatValue:a.s8.Store};(0,i.G0)(this.giftButton,()=>{n.CA.sendAnalyticEvent(p),(0,r.E8)()?(0,r.Lj)():(0,r.b4)(()=>{h.show(),h.reorderPages(!1),h.selectGiftTier(this.membershipProduct.type)})},!1,!0)}}},73316:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ship_blue_north_west.d7ed559470e207c16a17.svg"},73324:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_1.6828d855c054bbb331d3.svg"},73461:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_inactive_pink.ce851c244a9775abae15.svg"},73484:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_arrow_up.4839fbb15857a82d3799.svg"},73503:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_apple.75aeec31cee57bb85a48.svg"},73697:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_purple.a9868c1fc12671447ea3.svg"},73745:(e,t,s)=>{"use strict";s.d(t,{F:()=>a});var i=s(50482);if(!/^(251|517|837)$/.test(s.j))var n=s(64733);const r=12,o=100;function a(e){return function(e){return!!e.showsYearlyTotalOnAnnual&&(!!e.product.billedAnnually&&null!=i.Zt.getBaseAnnualPriceOfAnnualMembership(e.product.type))}(e)?function(e){const t=l(e.localizedPrice),s=l(e.localizedMonthlyPrice);var r;return{amount:null!==(r=null==t?void 0:t.displayPrice)&&void 0!==r?r:d(e,"annual"),isLocalized:null!=t,period:"year",strikethroughAmount:null!=s?(0,n.jH)(s):i.Zt.getBaseAnnualPriceOfAnnualMembership(e.product.type),isStrikethroughLocalized:null!=s,billingNote:{key:"strings:storePage.sections.membership.billing.monthlyEqual",options:{context:null!=t?"localized":"",amount:null!=t?(0,n.vF)(t):d(e,"monthly")}}}}(e):function(e){const t=function(e){var t;return null==(null===(t=e.localizedPrice)||void 0===t?void 0:t.price)?void 0:e.product.billedAnnually?(0,n.vF)(e.localizedPrice):e.localizedPrice.displayPrice}(e),s=l(e.localizedMonthlyPrice),r=e.product.billedAnnually?i.Zt.getMonthlyPriceOfAnnualMembership(e.product.type):void 0;var o;return{amount:null!=t?t:d(e,"monthly"),isLocalized:null!=t,period:"month",strikethroughAmount:null==r?void 0:null!==(o=null==s?void 0:s.displayPrice)&&void 0!==o?o:r,isStrikethroughLocalized:null!=r&&null!=s,billingNote:c(e)}}(e)}function c(e){if(!e.product.billedAnnually)return{key:"strings:storePage.sections.membership.billing.monthly"};const t=l(e.localizedPrice);var s;return{key:"strings:storePage.sections.membership.billing.annually",options:{context:null!=t?"localized":"",amount:null!==(s=null==t?void 0:t.displayPrice)&&void 0!==s?s:d(e,"annual")}}}function l(e){return null!=(null==e?void 0:e.price)?e:void 0}function d(e,t){var s;const i=null===(s=e.localizedPrice)||void 0===s?void 0:s.price;if(null!=i)return e.product.billedAnnually?(0,n.ih)(i):(0,n.X)(i);const a=e.product.price/o;return"annual"==t?""+a*r:`${a}`}},73798:(e,t,s)=>{"use strict";
1e.exports=s.p+"assets/icon_player_hub.607a83c8f5f5ddd44764.svg"},74058:(e,t,s)=>{"use strict";s.d(t,{MJ:()=>E,Ss:()=>M,eo:()=>I,go:()=>D,q7:()=>w,xT:()=>_,zl:()=>R});var i=s(67908),n=s(46581),r=s(22030),o=s(81888),a=s(51309),c=s(90407),l=s(76092),d=s(1863),u=s(14159),h=s(9902),p=s(89878),m=s(56961),g=s(36872),f=s(22194),y=s(18587),v=s(34668),S=s(44529),b=s(43486),C=s(46456),P=s(65780);const k={[n.Nw.RankedClassic1v1]:g.um.VisibleRanked1v1,[n.Nw.RankedClassic4P]:g.um.VisibleRanked4PClassic,[n.Nw.RankedCitiesAndKnights4P]:g.um.VisibleRankedCitiesAndKnights4P,[n.Nw.RankedRush4P]:g.um.VisibleRanked4PRush},T=new Set([n.Nw.RankedClassic1v1,n.Nw.RankedClassic4P,n.Nw.RankedRush4P]),A=10;function R(e,t,s){var i;if(!y.r.rankedPrerollAdsEnabled)return;if(null===(i=o._.userState)||void 0===i?void 0:i.items.hideAds())return;if(!E(e,t))return;return!y.r.isUserOnMobileAppOrWeb&&!y.r.isUserOnDiscord?function(e,t,s){return s?s&&T.has(e)?"internal":void 0:"vli"}(e,0,s):T.has(e)?"internal":void 0}function w(e){switch(e){case n._M.BeginnerMode:return{playerCount:1,botCount:0};case n._M.ColonistRush:return{playerCount:1,botCount:3};case n.Nw.UnrankedClassic1v1:case n.Nw.RankedClassic1v1:return{playerCount:2,botCount:0};case n.Nw.UnrankedClassic4P:case n.Nw.RankedClassic4P:case n.Nw.RankedCitiesAndKnights4P:case n.Nw.RankedRush4P:return{playerCount:4,botCount:0};case n.Nw.UnrankedShuffle:{const e=C.y.shuffleQueueData;if(null==e)return{playerCount:0,botCount:0};const t=e.playerCount;return 1==e.isBotGame?{playerCount:1,botCount:t-1}:{playerCount:t,botCount:0}}default:return{playerCount:0,botCount:0}}}function I(e){var t,s,r;const h={isEligible:!0,createPopup:void 0};if((0,n.V1)(e))return h;const g=_(e),f=e==n.Nw.UnrankedShuffle;if(!g&&!f)return h;if(!(null===(t=o._.userState)||void 0===t?void 0:t.isLoggedIn))return{isEligible:!1,createPopup:()=>new a.L};if(f){if(!d.z.userEligibleForRanked()){const e=new u.U.ShuffleLocked(o._.userState.totalCompletedGameCount,i.FP.NumberOfGamesToUnlockRanked);return{isEligible:!1,createPopup:()=>M(e)}}return o._.userState.items.hasMembership()||P.X.hasFreePlayAvailable("shuffle")?h:{isEligible:!1,createPopup:()=>{(0,c.z)("gameplay",l.Jd.PopupMembershipIncentivesShuffleQueue)}}}const y=function(e){return m.zk.has(e)}(e),v=(0,p.kV)(null===(s=o._.userState)||void 0===s?void 0:s.items,null===(r=o._.userState)||void 0===r?void 0:r.ckTotalGameCount);if(y&&v)return{isEligible:!1,createPopup:()=>{(0,c.z)("gameplay",l.Jd.PopupMembershipIncentivesRankedCitiesAndKnights)}};if(d.z.userEligibleForRanked())return h;const S=i.FP.NumberOfGamesToUnlockRanked,b=new u.U.RankedLocked(o._.userState.totalCompletedGameCount,S);return{isEligible:!1,createPopup:()=>M(b)}}function M(e){(0,h.C)({title:e.title,body:e.description})}function _(e){return m.SK.has(e)}function E(e,t){const s=k[e];if(null==s)return!1;const i=t.find(e=>e.eloType==s);if(null==(null==i?void 0:i.rankedState))return!1;const n=f.Gb.deserialize(i.rankedState);if(n.type==f.Ob.Placement){return n.finishedPlacementGames()}return!0}function D(e,t){if(e==n._M.BeginnerMode)return void v.Q.continueCampaignMode();const s=null!=t?t:n.R1.BotMedium;var i;e==n._M.ColonistRush?!(null===(i=o._.userState)||void 0===i?void 0:i.items.hideAds())&&S.p.getRushBotGameCompletionCount()>=A?b.I.start(n._M.ColonistRush,()=>{v.Q.clickedStartBotGame(s,r.Dj.ClickedRushBotGame)}):v.Q.clickedStartBotGame(s,r.Dj.ClickedRushBotGame):v.Q.clickedStartBotGame(s,r.Dj.ClickedBotGame)}},74369:(e,t,s)=>{"use strict";s.d(t,{Q:()=>i});function i(e){if(null==e)return{key:"strings:colonistCommon.utils.emptyString"};switch(e){case"Playing Cities & Knights 4P":return{key:"strings:profilePage.statusActivity.playingCitiesAndKnights4P"};case"Playing Cities & Knights 5-6P":return{key:"strings:profilePage.statusActivity.playingCitiesAndKnights56P"};case"Playing SF + C&K 4P":return{key:"strings:profilePage.statusActivity.playingCitiesAndKnightsSeafarers4P"};case"Playing SF + C&K 5-6P":return{key:"strings:profilePage.statusActivity.playingCitiesAndKnightsSeafarers56P"};case"Playing Base Game 4P":return{key:"strings:profilePage.statusActivity.playingClassic4P"};case"Playing Base Game 5-6P":return{key:"strings:profilePage.statusActivity.playingClassic5678P"};case"Playing Seafarers 4P":return{key:"strings:profilePage.statusActivity.playingSeafarers4P"};case"Playing Seafarers 5-6P":return{key:"strings:profilePage.statusActivity.playingSeafarers56P"};case"In Private Room":return{key:"strings:profilePage.statusActivity.inPrivateRoom"};case"In Public Room":return{key:"strings:profilePage.statusActivity.inPublicRoom"};case"Idle":return{key:"strings:profilePage.statusActivity.isOnlineAndIdle"}}}},74524:(e,t,s)=>{"use strict";e.exports=s.p+"assets/prob_9.0dce1d649976660b463a.svg"},74589:(e,t,s)=>{"use strict";s.d(t,{i:()=>l});var i=s(46581),n=s(55547),r=s(9029);class o{setMaxPlayerCount(e,t){(0,r.RH)(this.maxPlayersInput,{key:"strings:colonistCommon.utils.#buffer",options:{value:`${e}/${t}`}})}constructor(e){this.container=e,this.maxPlayersInput=e.querySelector("#room_center_maxplayers_settings_input"),this.maxPlayersRightArrow=e.querySelector("#maxplayers_settings_right_arrow"),this.maxPlayersLeftArrow=e.querySelector("#maxplayers_settings_left_arrow"),this.maxPlayersDivBody=e.querySelector("#maxplayers_settings_body")}}var a=s(78134),c=s(18587);class l{update(e){var t,s;this.currentMaxPlayerCount=e.gameSetting.maxPlayers;const n=null!==(s=null===(t=a.qq.getModeDataForMode(e.gameSetting.modeSetting))||void 0===t?void 0:t.defaultPlayerCount)&&void 0!==s?s:i.Zt.DEFAULT_PLAYER_COUNT,r=l.getEffectiveMaxPlayerCount(e);
1this.view.setMaxPlayerCount(this.currentMaxPlayerCount,r),this.view.container.classList.toggle("selected",this.currentMaxPlayerCount!=n)}load(e){this.initSpeedSettings(e)}initSpeedSettings(e){const{maxPlayersDivBody:t,maxPlayersRightArrow:s,maxPlayersLeftArrow:i}=this.view;this.gameModeMaxPlayerCount=l.getEffectiveMaxPlayerCount(e),this.view.setMaxPlayerCount(this.currentMaxPlayerCount,this.gameModeMaxPlayerCount);const o=this.currentMaxPlayerCount==this.minPlayerCount,a=this.currentMaxPlayerCount==this.gameModeMaxPlayerCount;if(i.classList.toggle("disabled",o),s.classList.toggle("disabled",a),l.isGuest(e))return t.className="option_body guest",s.classList.toggle("hidden",!0),i.classList.toggle("hidden",!0),(0,r.G0)(s,()=>{}),void(0,r.G0)(i,()=>{});t.className="option_body",s.classList.toggle("hidden",!1),i.classList.toggle("hidden",!1),(0,r.G0)(s,()=>{this.currentMaxPlayerCount>=this.gameModeMaxPlayerCount||n.sZ.roomClient.setMaxPlayers(this.currentMaxPlayerCount+1)}),(0,r.G0)(i,()=>{this.currentMaxPlayerCount<=this.minPlayerCount||n.sZ.roomClient.setMaxPlayers(this.currentMaxPlayerCount-1)})}updateInteractabilityOfElements(e){this.load(e)}static getEffectiveMaxPlayerCount(e){if(c.r.shouldHideStoreOnMobile)return i.Zt.DEFAULT_PLAYER_COUNT;return a.qq.getMaxAllowablePlayerCountForMode(e.gameSetting.modeSetting)}static isGuest(e){return n.sZ.controller.session.id!=e.hostSession.userSessionId}constructor(e){this.minPlayerCount=i.Zt.MIN_PLAYER_COUNT,this.gameModeMaxPlayerCount=i.Zt.MAX_PLAYER_COUNT,this.currentMaxPlayerCount=i.Zt.DEFAULT_PLAYER_COUNT,this.view=new o(e)}}},74611:(e,t,s)=>{"use strict";e.exports=s.p+"assets/announcement_cc26_qualifier.322b74f2fbca7cba3f9f.png"},75127:(e,t,s)=>{"use strict";e.exports=s.p+"assets/subdivisions_iii.a55e015debf15544d914.svg"},75279:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ship_red_north_west.feef384f11209b09f273.svg"},75589:(e,t,s)=>{"use strict";s.d(t,{G:()=>r});var i=s(81888),n=s(36872);class r{static setShareLinkHandler(e){r.shareLinkHandler=e}static hasShareLinkHandler(){return null!=r.shareLinkHandler}static shareLink(e){var t;null===(t=r.shareLinkHandler)||void 0===t||t.call(r,e)}static canUseLiveNotificationService(){var e;return!!(null===(e=i._.userState)||void 0===e?void 0:e.isLoggedIn)}static delayNotificationDataRequest(e){setTimeout(e,this.REQUEST_DATA_DELAY_MS)}static getMembershipTitleFromType(e){switch(e){case n.Qb.EliteMonthly:case n.Qb.EliteYearly:return{key:"strings:storePage.membership.title.elite"};case n.Qb.PlusMonthly:case n.Qb.PlusYearly:return{key:"strings:storePage.membership.title.plus"};case n.Qb.PremiumMonthly:case n.Qb.PremiumYearly:return{key:"strings:storePage.membership.title.premium"};case n.Qb.Holiday2023AllAccessPass:return{key:"strings:colonistCommon.utils.bug"}}}}r.REQUEST_DATA_DELAY_MS=500},75602:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_inactive_red.edd8c074adebbb34dac4.svg"},75615:(e,t,s)=>{"use strict";e.exports=s.p+"assets/gift.554509f94c963668844f.svg"},75757:(e,t,s)=>{"use strict";e.exports=s.p+"assets/prob_11.102e16ed661168ddeec8.svg"},75784:(e,t,s)=>{"use strict";s.d(t,{Z:()=>B});var i=s(46581),n=s(9029),r=s(36872),o=s(18587),a=s(70908),c=s(55935),l=s(17399),d=s(84029),u=s(90676),h=s(32581),p=s(35883),m=s(55547),g=s(16611),f=s(28844),y=s(7893);class v{renderUserInfo(){this.profilePic=v.createIconIn(this.nameContainer,r.am.Guest,this.PLAYER_ICON_SIZE),this.usernameAndKarmaContainer=(0,n.Le)(this.nameContainer,"room_player_username_and_karma"),this.usernameContainer=(0,n.Le)(this.usernameAndKarmaContainer,"room_player_username_container"),this.userName=(0,n.i5)(this.usernameContainer,"room_player_username",{key:"strings:profilePage.friends.tableHeaders.player"}),this.renderUsernameInfoIcon(),this.karmaContainer=(0,n.Le)(this.usernameAndKarmaContainer,"room_player_karma"),this.renderKarma()}renderUsernameInfoIcon(){this.usernameInfoIcon=(0,n.Le)(this.usernameContainer,"room_player_username_info_icon"),v.createIconIn(this.usernameInfoIcon,r.am.InfoIcon,this.ICON_SIZE),(0,u.vy)(this.usernameInfoIcon,{key:"strings:roomPage.onlineUsernameTooltip"}),(0,n.G0)(this.usernameInfoIcon,()=>{(0,d.m)()},!1,!0),this.hideUsernameInfoIcon()}renderKarma(){this.karmaText=(0,n.Wr)(this.karmaContainer,{key:"strings:colonistCommon.utils.emptyString"},"room_player_karma_text"),(0,u.vy)(this.karmaContainer,{key:"strings:homePage.overview.karma"},void 0,void 0,"small"),(0,n.G0)(this.karmaContainer,()=>{},!1,!0)}createBotDifficultyControl(){this.difficultyContainer=(0,n.Le)(this.colorAndDifficultyRow,"room_player_difficulty hidden");const e=`room-bot-difficulty-segmentedcontrol-${v.nextViewId}`;v.nextViewId+=1,this.segmentedControlContainer=(0,n.Le)(this.difficultyContainer,"room-bot-difficulty-segmentedcontrol",e),this.botDifficultyLabel=(0,n.i5)(this.difficultyContainer,"room_player_difficulty_badge hidden",{key:"strings:colonistCommon.utils.emptyString"})}renderReadinessState(){this.actionIconsContainer=(0,n.Le)(this.readyContainer,"room-player-actions-container"),this.readinessContainer=(0,n.Le)(this.readyContainer,"room_player_ready"),this.statusText=(0,n.i5)(this.readinessContainer,"",{key:"strings:roomPage.notReady"})}createAddBotButton(){this.addBotButton=(0,n.Le)(this.container,"btn_general btn_add_bot","add-bot-button"),(0,n.zO)(this.addBotButton,r.am.Bot),(0,n.i5)(this.addBotButton,"",{key:"strings:roomPage.addBot"}),(0,n.G0)(this.addBotButton,()=>{g.A9.play(g.hc.Click),m.sZ.roomClient.addBot()})}removePlayer(){this.infoContainer.style.display="none",this.readyContainer.style.display="none",this.addBotButton.style.display="flex",this.state=void 0,this.container.onclick=()=>{}}update(e){this.colorChanged(e)&&this.updateColor(e.selectedColor),this.updateKarma(e),this.statusChanged(e)&&this.updateStatus(e),this.statusChanged(e)&&this.updateReadyContainerClass(e),this.state=e,this.updateProfilePic(),this.updateUsernameInfoIcon(),this.showPlayer()}updateProfilePic(){if(null==this.state)return;var e;const t=null!==(e=this.state.profilePictureUrl)&&void 0!==e?e:(0,l.tu)(this.state.icon);this.profilePic.src!=t&&(this.profilePic.src=t),this.profilePic.classList.toggle("profile-picture",null!=this.state.profilePictureUrl)}updateActionIcons(e){(0,n.RH)(this.actionIconsContainer,{key:"strings:colonistCommon.utils.emptyString"});for(const t of e){const e=(0,n.Le)(this.actionIconsContainer,"room-player-action-icon-container"),s=(0,n.zO)(e,t.icon,"darken-on-hover");if(null!=t.action){const e=t.action;(0,n.G0)(s,()=>e(),!1,!0)}null!=t.tooltip&&(o.r.isUserOnMobileAppOrWeb||(0,u.vy)(e,t.tooltip))}}updateColor(e){if(e==c.DS.None)return this.colorRoad.src=h,this.colorSettlement.src=h,void(this.colorCity.src=h);this.colorRoad.src=p.j.roadsByColor[e],this.colorSettlement.src=p.j.settlementsByColor[e],this.colorCity.src=p.j.citiesByColor[e]}updateKarma(e){e.isBot?this.karmaContainer.style.display="none":null==e.profilePictureUrl?((0,n.RH)(this.karmaText,{key:"strings:homePage.header.playerKarma",options:{totalCompleted:e.karmaCompletedGames,totalGames:e.karmaTotalGames}}
1),(0,u.iy)(this.karmaContainer,{key:"strings:roomPage.karmaPlayerTooltip"}),this.karmaContainer.style.display="flex"):this.karmaContainer.style.display="none"}setBotDifficultyVisibility(e){this.difficultyContainer.classList.toggle("hidden",!e)}renderBotDifficultyAsSegmentedControl(e,t){this.botDifficultyLabel.classList.add("hidden"),this.segmentedControlContainer.classList.remove("hidden"),null==this.botDifficultySegmentedControlView&&(this.botDifficultySegmentedControlView=(0,y.y)(this.segmentedControlContainer.id,f.SegmentedControl)),this.botDifficultySegmentedControlView.render({size:"sm",activeId:e,options:[{id:i.R1.BotEasy,label:{key:"strings:roomPage.botDifficulty.segmentedControl.easy"}},{id:i.R1.BotMedium,label:{key:"strings:roomPage.botDifficulty.segmentedControl.medium"}},{id:i.R1.BotHard,label:{key:"strings:roomPage.botDifficulty.segmentedControl.hard"}}],onTabChange:t})}renderBotDifficultyAsBadge(e){this.segmentedControlContainer.classList.add("hidden"),this.botDifficultyLabel.classList.remove("hidden");const t={[i.R1.BotEasy]:"strings:roomPage.botDifficulty.label.easy",[i.R1.BotMedium]:"str
1ings:roomPage.botDifficulty.label.medium",[i.R1.BotHard]:"strings:roomPage.botDifficulty.label.hard"};(0,n.RH)(this.botDifficultyLabel,{key:t[e]})}setUsername(e){(0,n.RH)(this.userName,{key:"strings:colonistCommon.utils.#buffer",options:{value:` ${e} `}})}updateStatus(e){if(e.isReadyToPlay)return this.statusText.innerText=a.a7.t("strings:roomPage.ready").toLocaleUpperCase(),void this.container.classList.remove("room_player_name_not_ready");this.statusText.innerText=a.a7.t("strings:roomPage.notReady"),this.container.classList.add("room_player_name_not_ready")}updateReadyContainerClass(e){e.isReadyToPlay?this.readyContainer.classList.remove("room_player_not_ready_color"):this.readyContainer.classList.add("room_player_not_ready_color")}showPlayer(){this.infoContainer.style.display="flex",this.readyContainer.style.display="flex",this.hideBotButton()}setColorOnclick(e){(0,n.G0)(this.colorContainer,()=>{g.A9.play(g.hc.Click),e()})}setOnclick(e){this.container.onclick=t=>{t.target!=this.colorContainer&&(g.A9.play(g.hc.Click),e())}}toggleColorSelector(e){e?this.colorContainer.classList.add("can_edit_color"):this.colorContainer.classList.remove("can_edit_color")}hideView(){"none"!=this.container.style.display&&(this.container.style.display="none")}showView(){"flex"!=this.container.style.display&&(this.container.style.display="flex")}displayBotButton(){null==this.state&&(this.addBotButton.style.display="flex")}hideBotButton(){this.addBotButton.style.display="none"}showUsernameInfoIcon(){this.usernameInfoIcon.style.display="inherit"}hideUsernameInfoIcon(){this.usernameInfoIcon.style.display="none"}isShowingPlayer(){return"flex"==this.infoContainer.style.display}enableHover(){this.container.classList.add("hover-enabled")}disableHover(){this.container.classList.remove("hover-enabled")}updateUsernameInfoIcon(){this.shouldShowUsernameInfoIcon()?this.showUsernameInfoIcon():this.hideUsernameInfoIcon()}shouldShowUsernameInfoIcon(){var e;return!!o.r.isUserOnDiscord&&(null==(null===(e=this.state)||void 0===e?void 0:e.profilePictureUrl)&&this.isItMe())}colorChanged(e){return null==this.state||this.state.selectedColor!=e.selectedColor}statusChanged(e){return null==this.state||this.state.isReadyToPlay!=e.isReadyToPlay}static createIconIn(e,t,s){const i=(0,n.zO)(e,t);return i.width=s,i.height=s,i}isItMe(){return null!=this.state&&B.isItMe(this.state)}constructor(e){this.PLAYER_ICON_SIZE=28,this.ACTION_ICON_SIZE=18,this.ICON_SIZE=17,this.container=(0,n.Le)(e,"room_player_name"),this.infoContainer=(0,n.Le)(this.container,"room_player_info"),this.readyContainer=(0,n.Le)(this.container,"room_player_ready_container room_player_not_ready_color"),this.nameContainer=(0,n.Le)(this.infoContainer,"room_player_user"),this.colorAndDifficultyRow=(0,n.Le)(this.infoContainer,"room_player_color_and_difficulty"),this.colorContainer=(0,n.Le)(this.colorAndDifficultyRow,"room_player_color"),this.renderUserInfo(),this.colorRoad=v.createIconIn(this.colorContainer,r.am.RoadBronze,this.ICON_SIZE),this.colorSettlement=v.createIconIn(this.colorContainer,r.am.SettlementBronze,this.ICON_SIZE),this.colorCity=v.createIconIn(this.colorContainer,r.am.CityBronze,this.ICON_SIZE),this.createBotDifficultyControl(),this.renderReadinessState(),this.createAddBotButton(),this.removePlayer()}}v.nextViewId=0;var S=s(46507);const b=(0,s(11445).K)(S.oR);var C=s(9902);const P=s.p+"assets/favicon_orange.e02ce02025b0c3694e91.png";class k{static resetTabTitleAndFavIcon(){(0,n.oB)(this.pageTitle,{key:"strings:colonistCommon.utils.#buffer",options:{value:this.defaultTitle}}),this.favicon.href=this.defaultFavIcon}static blinkTab(e){(0,n.oB)(this.pageTitle,e),this.favicon.href=P,setTimeout(()=>this.resetTabTitleAndFavIcon(),1e3)}}k.pageTitle=document.getElementById("browser_tab"),k.favicon=document.getElementById("favicon"),k.defaultTitle=k.pageTitle.innerHTML,k.defaultFavIcon=k.favicon.href;var T=s(81888),A=s(76092),R=s(80708),w=s(84445),I=s(13618),M=s(655),_=s(32398);async function E(e,t){if(!o.r.isUserOnDiscord)return e;if(null==t)return e;const s=await M.m.getRequestHandler(_.l.apiUserProfile.username(t),void 0);if(null==s)return e;var i;return null!==(i=s.json.username)&&void 0!==i?i:e}var D=s(76349),L=s(72046);
1class B{clear(){(0,n.RH)(this.playerListContainer,{key:"strings:colonistCommon.utils.emptyString"}),this.guestViews.splice(0,this.guestViews.length)}load(e){this.hostView=new v(this.playerListContainer),this.createGuestViews(),this.update(e)}update(e){this.roomState=e,this.updateHostView(e),this.updateGuestSessionViews(e),this.updateBotButtonViews(e)}createGuestViews(){for(let e=1;e<i.Zt.MAX_PLAYER_COUNT;e+=1){const e=new v(this.playerListContainer);this.guestViews.push(e)}}updateHostView(e){this.hostView.update(e.hostSession),this.hostView.updateActionIcons(B.getActionIconsToDisplay(e,e.hostSession)),this.hostView.setUsername(B.getUsername(e,e.hostSession));const t=this.playerClickAction(e.hostSession,e.hostSession);B.togglePlayerHover(this.hostView,null==t),this.hostView.setOnclick(()=>{g.A9.play(g.hc.Click),null==t||t()});const s=B.shouldShowColorSelectorBackground(e,e.hostSession);this.updateColorSelector(s,this.hostView)}updateGuestSessionViews(e){const t=e.getGuestSessions();for(const[n,r]of this.guestViews.entries()){const o=t[n];if(e.gameSetting.maxPlayers-1<n+1&&r.hideView(),e.gameSetting.maxPlayers-1>=n+1&&r.showView(),null==o){r.isShowingPlayer()&&(r.removePlayer(),k.blinkTab({key:"strings:roomPage.left",options:{count:e.getSessionCount(),maxCount:e.gameSetting.maxPlayers}}),g.A9.play(g.hc.LeaveRoom,B.leaveSoundVolume));continue}r.isShowingPlayer()||(k.blinkTab({key:"strings:roomPage.joined",options:{count:e.getSessionCount(),maxCount:e.gameSetting.maxPlayers}}),g.A9.play(g.hc.JoinRoom)),r.update(o);const a=this.playerClickAction(e.hostSession,o);B.togglePlayerHover(r,null==a),r.setOnclick(()=>{g.A9.play(g.hc.Click),null==a||a()});const c=B.shouldShowColorSelectorBackground(e,o);if(this.updateColorSelector(c,r),r.updateActionIcons(B.getActionIconsToDisplay(e,o)),r.setBotDifficultyVisibility(o.isBot),o.isBot){var s;const t=null!==(s=o.botDifficulty)&&void 0!==s?s:i.R1.BotMedium;B.isItMe(e.hostSession)?r.renderBotDifficultyAsSegmentedControl(t,e=>{m.sZ.roomClient.setBotDifficulty(o.roomSessionId,e)}):r.renderBotDifficultyAsBadge(t)}r.setUsername(B.getUsername(e,o))}}updateBotButtonViews(e){if(e.hostSession.userSessionId!=m.sZ.controller.session.id)for(const e of this.guestViews)e.hideBotButton();else for(const e of this.guestViews)e.displayBotButton()}updateColorSelector(e,t){t.setColorOnclick(e?()=>this.openEditProfileForPlayer(t.state):()=>{}),t.toggleColorSelector(e)}static isItMe(e){return m.sZ.controller.session.id==e.userSessionId}static isItCurrentUserId(e){var t;return(null===(t=T._.userState)||void 0===t?void 0:t.id)==e.userId}static isItHost(e,t){return e.hostSession.userSessionId==t.userSessionId}static shouldShowColorSelectorBackground(e,t){return!(!t.isBot||!this.isItMe(e.hostSession))||this.isItMe(t)}playerClickAction(e,t){if(t.isBot)return;if(B.isItMe(t))return()=>this.openEditProfilePage(t);return B.isItMe(e)?()=>B.showHostActionsPopup(t):()=>B.openProfilePage(t)}openEditProfilePage(e){(0,w.Uf)(()=>this.openEditProfileForPlayer(e))}static kickPlayer(e){m.sZ.roomClient.kickPlayer(e.roomSessionId)}static showHostActionsPopup(e){b({username:e.username,onKick:()=>{B.kickPlayer(e)},onViewProfile:async()=>{const t=await E(e.username,e.userId);L.x.init(t)}})}static showKickPlayerPopup(e){const t={key:"strings:roomPage.hostActions.kickPlayer",options:{username:e.username}};(0,C.C)({title:{key:"strings:roomPage.hostActions.kick"},body:t,onConfirm:()=>{B.kickPlayer(e)},confirmLabel:{key:"strings:roomPage.hostActions.kick"},showCancelBtn:!0})}static async openProfilePage(e){const t=await E(e.username,e.userId);L.x.init(t)}static getActionIconsToDisplay(e,t){const s=[],i=this.isItMe(t),n=this.isItCurrentUserId(t),a=this.isGuestPlayer(t),c=!(t.isBot||a||i||n||o.r.isUserOnDiscordMobile);if(this.canShowAddFriendIcon(t)&&s.push({icon:r.am.AddFriend,action:async()=>{const e=await E(t.username,t.userId);if(this.alreadyFriends(e))return void m.OV.showNotification(r.am.Friends,{key:"strings:popups.errors.friendError.alreadyFriends"});if(this.alreadySentFriendRequest(e))return void m.OV.showNotification(r.am.Friends,{key:"strings:popups.errors.friendError.alreadySentFriendRequest"});const s={type:A.k0.Friends,category:A.eX.Room,floatValue:A.Jd.RoomAddFriendAction};R.CA.sendAnalyticEvent(s),D.v.addFriendAction({username:e})},tooltip:{key:"strings:game.playerOptionsPopup.addFriend"}}),c){const e={type:A.k0.ABTestClickAnalytics,category:A.eX.GiftMembershipOverlay,floatValue:A.s8.Room};s.push({icon:r.am.StoreGiftMembership,action:()=>{R.CA.sendAnalyticEvent(e),(0,w.b4)(()=>{const e=()=>(0,I.Yf)(`/store?username=${t.username}#gift`,!0);o.r.isUserOnMobileAppOrWeb?(0,C.C)({title:{key:"strings:roomPage.leaveRoom.title"},body:{key:"strings:roomPage.leaveRoom.body"},onConfirm:e,showCancelBtn:!0}):e()},t.username)},tooltip:{key:"strings:game.tooltips.giftMembership",options:{username:t.username}}})}if(i)s.push({icon:r.am.Pencil,tooltip:{key:"strings:homePage.header.editProfile"}}
1);else if(this.isItMe(e.hostSession)){const e=t.isBot?()=>B.kickPlayer(t):()=>B.showKickPlayerPopup(t);s.push({icon:r.am.XMark,action:e,tooltip:{key:"strings:game.tooltips.kickPlayer",options:{username:t.username}}})}return s}static getUsername(e,t){return this.isItMe(t)?`${t.username} ${a.a7.t("strings:roomPage.you")}`:this.isItHost(e,t)?`${t.username} ${a.a7.t("strings:roomPage.host")}`:t.username}static togglePlayerHover(e,t){t?e.disableHover():e.enableHover()}static isGuestPlayer(e){return!e.isLoggedIn}static canShowAddFriendIcon(e){return!e.isBot&&(!this.isGuestPlayer(e)&&(!B.isItCurrentUserId(e)&&(!this.alreadyFriends(e.username)&&!this.alreadySentFriendRequest(e.username))))}static alreadyFriends(e){var t;return null!==(t=D.v.state.friends.some(t=>t.username===e))&&void 0!==t&&t}static alreadySentFriendRequest(e){var t;return null!==(t=D.v.state.friendRequestsSent.some(t=>t.username==e))&&void 0!==t&&t}constructor(e){this.guestViews=[],this.playerListContainer=e,D.v.state.registerChangeListener(()=>{null!=this.roomState&&this.update(this.roomState)}),T._.registerChangeListener(async()=>{D.v.state.loadFriends(T._.userState)})}}B.leaveSoundVolume=.6},76092:(e,t,s)=>{"use strict";s.d(t,{Jd:()=>o,Td:()=>m,d5:()=>y,dN:()=>f,e3:()=>l,eX:()=>r,k0:()=>n,kd:()=>a,lB:()=>v,lb:()=>d,pi:()=>g,s8:()=>h,sG:()=>c,tV:()=>p,x:()=>u,yi:()=>S});var i=s(36872);i.hx;var n=function(e){return e[e.StartedGame=0]="StartedGame",e[e.ClickedStore=1]="ClickedStore",e[e.FinishedGame=2]="FinishedGame",e[e.QuitMatchmakingQueue=3]="QuitMatchmakingQueue",e[e.StoreClickedPurchaseItem=4]="StoreClickedPurchaseItem",e[e.LobbyClickedStoreAd=5]="LobbyClickedStoreAd",e[e.MatchmakingFoundGame=6]="MatchmakingFoundGame",e[e.MatchmakingDisconnected=7]="MatchmakingDisconnected",e[e.MatchmakingForceMatched=8]="MatchmakingForceMatched",e[e.MatchmakingRequestRate=9]="MatchmakingRequestRate",e[e.FirstSignIn=10]="FirstSignIn",e[e.LobbyCTADefault=11]="LobbyCTADefault",e[e.LobbyCTAType1=12]="LobbyCTAType1",e[e.LobbyCTAType2=13]="LobbyCTAType2",e[e.LobbyCTAType3=14]="LobbyCTAType3",e[e.ABTestSubscriptionDefault=15]="ABTestSubscriptionDefault",e[e.ABTestSubscription5D1v1=16]="ABTestSubscription5D1v1",e[e.ABTestSubscription5D4p=17]="ABTestSubscription5D4p",e[e.ABTestSubscription5DAds=18]="ABTestSubscription5DAds",e[e.ABTestSubscription5DAICoaching=19]="ABTestSubscription5DAICoaching",e[e.ABTestSubscription5DBlock=20]="ABTestSubscription5DBlock",e[e.ABTestSubscription5DCheat=21]="ABTestSubscription5DCheat",e[e.ABTestSubscription5DExport=22]="ABTestSubscription5DExport",e[e.ABTestSubscription5DHistory=23]="ABTestSubscription5DHistory",e[e.ABTestSubscription5DLink=24]="ABTestSubscription5DLink",e[e.ABTestSubscription5DLiveStats=25]="ABTestSubscription5DLiveStats",e[e.ABTestSubscription5DPause=26]="ABTestSubscription5DPause",e[e.ABTestSubscription5DReplay=27]="ABTestSubscription5DReplay",e[e.ABTestSubscription5DRewards=28]="ABTestSubscription5DRewards",e[e.ABTestSubscription5DTrolls=29]="ABTestSubscription5DTrolls",e[e.ABTestSubscription1D1v1=30]="ABTestSubscription1D1v1",e[e.ABTestSubscription1D4p=31]="ABTestSubscription1D4p",e[e.ABTestSubscription1DAds=32]="ABTestSubscription1DAds",e[e.ABTestSubscription1DAICoaching=33]="ABTestSubscription1DAICoaching",e[e.ABTestSubscription1DBlock=34]="ABTestSubscription1DBlock",e[e.ABTestSubscription1DCheat=35]="ABTestSubscription1DCheat",e[e.ABTestSubscription1DExport=36]="ABTestSubscription1DExport",e[e.ABTestSubscription1DHistory=37]="ABTestSubscription1DHistory",e[e.ABTestSubscription1DLink=38]="ABTestSubscription1DLink",e[e.ABTestSubscription1DLiveStats=39]="ABTestSubscription1DLiveStats",e[e.ABTestSubscription1DPause=40]="ABTestSubscription1DPause",e[e.ABTestSubscription1DReplay=41]="ABTestSubscription1DReplay",e[e.ABTestSubscription1DRewards=42]="ABTestSubscription1DRewards",e[e.ABTestSubscription1DTrolls=43]="ABTestSubscription1DTrolls",e[e.ABTestSubscriptionPriceDefault=44]="ABTestSubscriptionPriceDefault",e[e.ABTestSubsAll5D=45]="ABTestSubsAll5D",e[e.ABTestSubsAll9D=46]="ABTestSubsAll9D",e[e.ABTestSubsAll19D=47]="ABTestSubsAll19D",e[e.ABTestSubsAll29D=48]="ABTestSubsAll29D",e[e.ABTestSubsExpansion5D=49]="ABTestSubsExpansion5D",e[e.ABTestSubsExpansion9D=50]="ABTestSubsExpansion9D",e[e.ABTestSubsExpansion19D=51]="ABTestSubsExpansion19D",e[e.ABTestSubsExpansion29D=52]="ABTestSubsExpansion29D",e[e.ABTestSubsMap5D=53]="ABTestSubsMap5D",e[e.ABTestSubsMap9D=54]="ABTestSubsMap9D",e[e.ABTestSubsMap19D=55]="ABTestSubsMap19D",e[e.ABTestSubsMap29D=56]="ABTestSubsMap29D",e[e.ABTestSubsRanked5D=57]="ABTestSubsRanked5D",e[e.ABTestSubsRanked9D=58]="ABTestSubsRanked9D",e[e.ABTestSubsRanked19D=59]="ABTestSubsRanked19D",e[e.ABTestSubsRanked29D=60]="ABTestSubsRanked29D",e[e.ABTestSubsExpMap5D=61]="ABTestSubsExpMap5D",e[e.ABTestSubsExpMap9D=62]="ABTestSubsExpMap9D",e[e.ABTestSubsExpMap19D=63]="ABTestSubsExpMap19D",e[e.ABTestSubsExpMap29D=64]="ABTestSubsExpMap29D",e[e.ABTestSubs2Ranked4D=65]="ABTestSubs2Ranked4D",e[e.ABTestSubs2Ranked8D=66]="ABTestSubs2Ranked8D",e[e.ABTestSubs2Ranked14D=67]="ABTestSubs2Ranked14D",e[e.ABTestSubs2Ranked19D=68]="ABTestSubs2Ranked19D",e[e.ABTestSubs2All8D=69]="ABTestSubs2All8D",e[e.ABTestSubs2All14D=70]="ABTestSubs2All14D",e[e.ABTestSubs2All19D=71]="ABTestSubs2All19D",e[e.ABTestSubs2All24D=72]="ABTestSubs2All24D",e[e.ABTestCTADefault=73]="ABTestCTADefault",e[e.ABTestCTA1=74]="ABTestCTA1",e[e.ABTestCTA2=75]="ABTestCTA2",e[e.ABTestCTA3=76]="ABTestCTA3",e[e.ABTestCTA4=77]="ABTestCTA4",e[e.ABTestCTA5=78]="ABTestCTA5",e[e.ABTestCTA6=79]="ABTestCTA6",e[e.ABTestCTA7=80]="ABTestCTA7",e[e.ABTestCTA8=81]="ABTestCTA8",e[e.ABTestCTA9=82]="ABTestCTA9",e[e.ABTestCTA10=83]="ABTestCTA10",e[e.ABTestCTA11=84]="ABTestCTA11",e[e.ABTestSubs3Ranked699=86]="ABTestSubs3Ranked699",e[e.ABTestSubs3Ranked899=87]="ABTestSubs3Ranked899",e[e.ABTestSubs3Ranked1099=88]="ABTestSubs3Ranked1099",e[e.ABTestSubs3Ranked1299=89]="ABTestSubs3Ranked1299",e[e.ABTestSubs3Ranked1499=90]="ABTestSubs3Ranked1499",e[e.ABTestSubs3All1899=91]="ABTestSubs3All1899",e[e.ABTestSubs3All2099=92]="ABTestSubs3All2099",e[e.ABTestSubs3All2299=93]="ABTestSubs3All2299",e[e.ABTestSubs3All2499=94]="ABTestSubs3All2499",e[e.ABTestSubs3All2699=95]="ABTestSubs3All2699",e[e.MatchmakingSkillGapMax=96]="MatchmakingSkillGapMax",e[e.MatchmakingSkillStandardDeviation=97]="MatchmakingSkillStandardDeviation",e[e.MatchmakingPercentileGapMax=98]="MatchmakingPercentileGapMax",e[e.MatchmakingPercentileStandardDeviation=99]="MatchmakingPercentileStandardDeviation",e[e.ABTestDefaultYearly=100]="ABTestDefaultYearly",e[e.ABTestDefaultMonthly=101]="ABTestDefaultMonthly",e[e.ABTestCancelPurchaseActive=102]="ABTestCancelPurchaseActive",e[e.ABTestCancelPurcahseInactive=103]="ABTestCancelPurcahseInactive",e[e.ABTestCheckoutBackButtonActive=104]="ABTestCheckoutBackButtonActive",e[e.ABTestCheckoutBackButtonInactive=10
15]="ABTestCheckoutBackButtonInactive",e[e.ABTestClickAnalytics=106]="ABTestClickAnalytics",e[e.PageVisit=107]="PageVisit",e[e.ABTestImpressionAnalytics=108]="ABTestImpressionAnalytics",e[e.RankedDemotion=109]="RankedDemotion",e[e.RankedPromotion=110]="RankedPromotion",e[e.StartPreRollCalled=111]="StartPreRollCalled",e[e.VideoAdsCalled=112]="VideoAdsCalled",e[e.VideoAdsComplete=113]="VideoAdsComplete",e[e.VideoAdsError=114]="VideoAdsError",e[e.VideoAdsHidden=115]="VideoAdsHidden",e[e.H5AdsCalled=116]="H5AdsCalled",e[e.H5AdsViewed=117]="H5AdsViewed",e[e.H5AdsDismissed=118]="H5AdsDismissed",e[e.H5AdsError=119]="H5AdsError",e[e.MatchmakingEnteredQueue=120]="MatchmakingEnteredQueue",e[e.MatchmakingFailedToWatchVideoAd=121]="MatchmakingFailedToWatchVideoAd",e[e.MatchmakingServerRequestToStartGame=122]="MatchmakingServerRequestToStartGame",e[e.MatchmakingServerFailedToStartGame=123]="MatchmakingServerFailedToStartGame",e[e.DiscordActivityAuthError=124]="DiscordActivityAuthError",e[e.ChannelListLength=125]="ChannelListLength",e[e.UserChannelLength=126]="UserChannelLength",e[e.PremiumRoomEnabled=127]="PremiumRoomEnabled",e[e.PremiumRoomStarted=128]="PremiumRoomStarted",e[e.GameCreateTrade=129]="GameCreateTrade",e[e.GamePassedTurn=130]="GamePassedTurn",e[e.GameClickedDice=131]="GameClickedDice",e[e.GameBuiltCity=132]="GameBuiltCity",e[e.InitialPipCount=133]="InitialPipCount",e[e.CopiedRoomLink=134]="CopiedRoomLink",e[e.GameBoughtDevCard=135]="GameBoughtDevCard",e[e.GameUsedHoverActions=136]="GameUsedHoverActions",e[e.ClickedChangeMobileOrientation=137]="ClickedChangeMobileOrientation",e[e.InteractedWithLandingPageHowToPlaySection=138]="InteractedWithLandingPageHowToPlaySection",e[e.LostWebGLContext=139]="LostWebGLContext",e[e.VLIAdFailedToLoad=140]="VLIAdFailedToLoad",e[e.UserAccessedLog=141]="UserAccessedLog",e[e.UserAccessedChat=142]="UserAccessedChat",e[e.UserNavigationPlay=143]="UserNavigationPlay",e[e.UserNavigationLobby=144]="UserNavigationLobby",e[e.UserSceneChange=145]="UserSceneChange",e[e.UserCopiedLink=146]="UserCopiedLink",e[e.BeginnerPlacedRoad=147]="BeginnerPlacedRoad",e[e.BeginnerPlacedSettlement=148]="BeginnerPlacedSettlement",e[e.BeginnerModeFirstRoadUnlocked=149]="BeginnerModeFirstRoadUnlocked",e[e.BeginnerModeDiceUnlocked=151]="BeginnerModeDiceUnlocked",e[e.BeginnerModeSecondRoadUnlocked=152]="BeginnerModeSecondRoadUnlocked",e[e.BeginnerModeTradeUnlocked=153]="BeginnerModeTradeUnlocked",e[e.BeginnerModeSettlementUnlocked=154]="BeginnerModeSettlementUnlocked",e[e.BeginnerModeCityUnlocked=155]="BeginnerModeCityUnlocked",e[e.BeginnerModeSecondCityUnlocked=156]="BeginnerModeSecondCityUnlocked",e[e.BeginnerModeClickedNextLevel=157]="BeginnerModeClickedNextLevel",e[e.BeginnerModeLevel1=158]="BeginnerModeLevel1",e[e.BeginnerModeLevel2=159]="BeginnerModeLevel2",e[e.MobileGameStarted=160]="MobileGameStarted",e[e.MobileGameUserInteractedWithFeedView=161]="MobileGameUserInteractedWithFeedView",e[e.MobileGameUserPausedGame=162]="MobileGameUserPausedGame",e[e.MobileGameUserEnteredSettings=163]="MobileGameUserEnteredSettings",e[e.MobileGameUserCompletedGame=164]="MobileGameUserCompletedGame",e[e.MobileGameUserOpenedRulebook=165]="MobileGameUserOpenedRulebook",e[e.MobileGameUserLeftGame=166]="MobileGameUserLeftGame",e[e.BeginnerModeSuggestedOnMultiplayerClick=167]="BeginnerModeSuggestedOnMultiplayerClick",e[e.BeginnerModeStartedThroughSuggestion=168]="BeginnerModeStartedThroughSuggestion",e[e.EndGameReturnToMapButton=191]="EndGameReturnToMapButton",e[e.Replay=180]="Replay",e[e.EndGameShareButton=169]="EndGameShareButton",e[e.VideoAdsEmpty=170]="VideoAdsEmpty",e[e.VideoAdsBlocked=171]="VideoAdsBlocked",e[e.VideoAdsNeverLoaded=172]="VideoAdsNeverLoaded",e[e.VideoAdsSkipped=173]="VideoAdsSkipped",e[e.ClickedJoinColonistDiscordCTA=174]="ClickedJoinColonistDiscordCTA",e[e.ClickedOfficialDiscordServerLink=175]="ClickedOfficialDiscordServerLink",e[e.AcceptedJoinOurDiscordPopup=176]="AcceptedJoinOurDiscordPopup",e[e.EndGameShareTitle=177]="EndGameShareTitle",e[e.MobileUserSwitchedApp=178]="MobileUserSwitchedApp",e[e.UserSentSuspiciousMessage=179]="UserSentSuspiciousMessage",e[e.ReplayClickedViewFromProfileGameHistory=185]="ReplayClickedViewFromProfileGameHistory",e[e.ReplayClickedChangePerspective=186]="ReplayClickedChangePerspective",e[e.ReplayClickedCreateShareableLink=187]="ReplayClickedCreateShareableLink",e[e.ReplayClickedOpenStats=192]="ReplayClickedOpenStats",e[e.ReplayControlsFirstInteraction=193]="ReplayControlsFirstInteraction",e[e.JoinedRoom=181]="JoinedRoom",e[e.BeginnerModeClickedRetry=182]="BeginnerModeClickedRetry",e[e.Re
1spondToFriendRoomInvite=183]="RespondToFriendRoomInvite",e[e.CreateFriendRoomInvite=184]="CreateFriendRoomInvite",e[e.ClickedInviteFriendButton=201]="ClickedInviteFriendButton",e[e.ProfilePageVisitSection=188]="ProfilePageVisitSection",e[e.ABTestVeteranAgreedOnDiscount=189]="ABTestVeteranAgreedOnDiscount",e[e.ABTestVeteranRejectedDiscount=190]="ABTestVeteranRejectedDiscount",e[e.DiscordPopupKeepPlayingOnWeb=194]="DiscordPopupKeepPlayingOnWeb",e[e.EndGameReplayAPIDelay=195]="EndGameReplayAPIDelay",e[e.GiftingFlowAnalytic=196]="GiftingFlowAnalytic",e[e.SelectedGiftTier=197]="SelectedGiftTier",e[e.CatanMasterpieceAdClicks=198]="CatanMasterpieceAdClicks",e[e.SocialMediaFooterLink=199]="SocialMediaFooterLink",e[e.SocketStatsAfterGame=200]="SocketStatsAfterGame",e[e.ABTestRoomLifecycleData=202]="ABTestRoomLifecycleData",e[e.ReferralAnalytics=203]="ReferralAnalytics",e[e.ABTestBeginnerMode=204]="ABTestBeginnerMode",e[e.ReactivationAnalytics=205]="ReactivationAnalytics",e[e.Friends=206]="Friends",e[e.RateChatExperience=207]="RateChatExperience",e[e.EndGameWasDiceUnfair=208]="EndGameWasDiceUnfair",e[e.SocketSequenceError=209]="SocketSequenceError",e[e.MatchmakingPlayButtonClicked=210]="MatchmakingPlayButtonClicked",e[e.MatchmakingPlayButtonTimeToFirstClick=211]="MatchmakingPlayButtonTimeToFirstClick",e[e.MatchmakingUITimeToFirstQueueStart=212]="MatchmakingUITimeToFirstQueueStart",e[e.MatchmakingUIPageView=213]="MatchmakingUIPageView",e[e.NotificationAnalytics=214]="NotificationAnalytics",e[e.ClickedLandingPagePlayWithFriends=215]="ClickedLandingPagePlayWithFriends",e[e.ClickedLandingPageExploreModes=216]="ClickedLandingPageExploreModes",e[e.ClickedLandingPageOpenApp=217]="ClickedLandingPageOpenApp",e[e.ClickedLandingPagePlayOnMobileWeb=218]="ClickedLandingPagePlayOnMobileWeb",e[e.ClickedHeaderLogin=219]="ClickedHeaderLogin",e[e.ClickedLandingPageLanguageSelector=220]="ClickedLandingPageLanguageSelector",e[e.ClickedLandingPageFooterRules=221]="ClickedLandingPageFooterRules",e[e.ClickedLandingPageFooterPrivacy=222]="ClickedLandingPageFooterPrivacy",e[e.UserLoggedIn=223]="UserLoggedIn",e[e.GetReplayDataFromGameId=224]="GetReplayDataFromGameId",e[e.InGameSettingsOpened=225]="InGameSettingsOpened",e[e.InGameSettingsClosed=226]="InGameSettingsClosed",e[e.InGameSettingsGameInfoClicked=227]="InGameSettingsGameInfoClicked",e[e.InGameSettingsDisplayClicked=228]="InGameSettingsDisplayClicked",e[e.InGameSettingsAudioClicked=229]="InGameSettingsAudioClicked",e[e.InGameSettingsControlsClicked=230]="InGameSettingsControlsClicked",e[e.InGameSettingsValueChanged=231]="InGameSettingsValueChanged",e[e.ClickedRushGameEndTurn=232]="ClickedRushGameEndTurn",e[e.MobileGameUserResumedGame=233]="MobileGameUserResumedGame",e[e.InternalVideoAdStarted=234]="InternalVideoAdStarted",e[e.InternalVideoAdCompleted=235]="InternalVideoAdCompleted",e[e.InternalVideoAdFailed=236]="InternalVideoAdFailed",e[e.InternalVideoAdStoreClicked=237]="InternalVideoAdStoreClicked",e[e.GuestPopupShown=238]="GuestPopupShown",e[e.GuestPopupLoginClicked=239]="GuestPopupLoginClicked",e[e.GuestPopupContinueAsGuest=240]="GuestPopupContinueAsGuest",e[e.RushPitchPopupShown=241]="RushPitchPopupShown",e[e.RushPitchPopupCtaClicked=242]="RushPitchPopupCtaClicked",e[e.RushPitchPopupDismissed=243]="RushPitchPopupDismissed",e[e.RushLobbyPreselectImpression=244]="RushLobbyPreselectImpression",e[e.RushLobbyCardSwitch=245]="RushLobbyCardSwitch",e[e.ColonistRushTimerStarted=246]="ColonistRushTimerStarted",e[e.ColonistRushTimerPlayed=247]="ColonistRushTimerPlayed",e[e.RushRulesPopupShown=248]="RushRulesPopupShown",e[e.RushRulesPopupStartGameClicked=249]="RushRulesPopupStartGameClicked",e[e.RushRulesPopupDismissed=250]="RushRulesPopupDismissed",e[e.RushRulesPopupVideoClicked=251]="RushRulesPopupVideoClicked",e[e.RushAdImpression=252]="RushAdImpression",e[e.RushAdClicked=253]="RushAdClicked",e[e.BotsTabMapSelected=254]="BotsTabMapSelected",e[e.BotsTabMembershipCTAClicked=255]="BotsTabMembershipCTAClicked",e[e.EndGameRushIncentivePopupShown=256]="EndGameRushIncentivePopupShown",e[e.EndGameRushIncentivePopupTryRushClicked=257]="EndGameRushIncentivePopupTryRushClicked",e[e.InGameInfoWindowViewed=258]="InGameInfoWindowViewed",e[e.InGameInfoWindowClosed=259]="InGameInfoWindowClosed",e[e.InGameInfoWindowTabChanged=260]="InGameInfoWindowTabChanged",e[e.ItemInfoSubscribeClicked=261]="ItemInfoSubscribeClicked",e[e.BotsTabRushDifficultySelected=262]="BotsTabRushDifficultySelected",e[e.RushInitialPlacementTimedOut=263]="RushInitialPlacementTimedOut",e[e.SubscriptionOverlayShown=264]="SubscriptionOverlayShown",e[e.SubscriptionOverlayPurchaseSuccess=265]="SubscriptionOverlayPurchaseSuccess",e[e.StoreTabsClicked=266]="StoreTabsClicked",e[e.MonthlyYearlyToggleSwitched=267]="MonthlyYearlyToggleSwitched",e[e.PurchaseSessionStarted=268]="PurchaseSessionStarted",e[e.DoubleTapPaymentAbandoned=269]="DoubleTapPaymentAbandoned",e[e.DoubleTapPaymentFallback=271]="DoubleTapPaymentFallback",e[e.UserSentChatMessage=270]="UserSentChatMessage",e[e.MembershipSectionViewed=272]="MembershipSectionViewed",e[e.MembershipTierSelected=273]="MembershipTierSelected",e[e.MembershipSubscribeClicked=274]="MembershipSubscribeClicked",e[e.MembershipPurchased=275]="MembershipPurchased",e[e.NewSeasonPopupShown=276]="NewSeasonPopupShown",e[e.NewSeasonPopupPlayClicked=277]="NewSeasonPopupPlayClicked",e[e.NewSeasonPopupDismissed=278]="NewSeasonPopupDismissed",e[e.NewSeasonPopupFaqLinkClicked=279]="NewSeasonPopupFaqLinkClicked",e[e.InGameBankTradeToggleClicked=280]="InGameBankTradeToggleClicked",e[e.StoreSocialProofShown=281]="StoreSocialProofShown",e[e.RobberPlacementResolved=282]="RobberPlacementResolved",e[e.UserSentRoomChatMessage=283]="UserSentRoomChatMessage",e}({}),r=function(e){return e[e.Game=0]="Game",e[e.Store=1]="Store",e[e.Matchmaking=2]="Matchmaking",e[e.Lobby=3]="Lobby",e[e.MatchmakingUnrankedClassic4P=4]="MatchmakingUnrankedClassic4P",e[e.MatchmakingUnrankedClassic1v1=5]="MatchmakingUnrankedClassic1v1",e[e.MatchmakingUnrankedClassicFreeMapRotation=6]="MatchmakingUnrankedClassicFreeMapRotation",e[e.MainFunnel=7]="MainFunnel",e[e.LobbyCTA=8]="LobbyCTA",e[e.ABTestSubscription=9]="ABTestSubscription",e[e.ABTestSubscriptionPrice=10]="ABTestSubscriptionPrice",e[e.MatchmakingRankedClassic1v1=11]="MatchmakingRankedClassic1v1",e[e.ABTestSubscriptionPrice2=12]="ABTestSubscriptionPrice2",e[e.ABTestCTA=13]="ABTestCTA",e[e.MatchmakingRankedClassic4P=14]="MatchmakingRankedClassic4P",e[e.ABTestSubscriptionPrice3=16]="ABTestSubscriptionPrice3",e[e.ABTestDefaultYearly=17]="ABTestDefaultYearly",e[e.AdblockActivity=18]="AdblockActivity",e[e.ABTestCancelPurchase=19]="ABTestCancelPurchase",e[e.ABTestCheckoutBackButton=20]="ABTestCheckoutBackButton",e[e.ABTestClickAnalytics=21]="ABTestClickAnalytics",e[e.PageVisit=22]="PageVisit",e[e.ABTestImpressionAnalytics=23]="ABTestImpressionAnalytics",e[e.Ranked=24]="Ranked",e[e.MatchmakingRankedCitiesAndKnights4P=25]="MatchmakingRankedCitiesAndKnights4P",e[e.AdsPerformance=26]="AdsPerformance",e[e.AuthError=27]="AuthError",e[e.Channel=28]="Channel",e[e.PremiumRoom=29]="PremiumRoom",e[e.WebGL=30]="WebGL",e[e.MobileAnalytics=31]="MobileAnalytics",e[e.Virality=32]="Virality",e[e.DiscordServer=33]="DiscordServer",e[e.Chat=34]="Chat",e[e.Room=35]="Room",e[e.Replay=36]="Replay",e[e.Profile=37]="Profile",e[e.DiscordConvertToWeb=38]="DiscordConvertToWeb",e[e.GiftMembershipOverlay=39]="GiftMembershipOverlay",e[e.ABTestNoTrollsOption=40]="ABTestNoTrollsOption",e[e.Socket=41]="Socket",e[e.ABTestHighKarmaName=42]="ABTestHighKarmaName",e[e.Footer=43]="Footer",e[e.ABTestPushNotificationsPopup=44]="ABTestPushNotificationsPopup",e[e.ShareActivityLink=45]="ShareActivityLink",e[e.ABTestBeginnerMode=46]="ABTestBeginnerMode",e[e.ABTestReferralProgram=47]="ABTestReferralProgram",e[e.ABTestDiscordMainCTA=48]="ABTestDiscordMainCTA",e[e.BotShareActivityLink=49]="BotShareActivityLink",e[e.UserActionAgainstDiscordBot=50]="UserActionAgainstDiscordBot",e[e.BotShareActivityLinkSent=51]="BotShareActivityLinkSent",e[e.ABTestRedeemFreeAvatar=52]="ABTestRedeemFreeAvatar",e[e.ABTestShareActivityLinkText=53]="ABTestShareActivityLinkText",e[e.ABTestShareGameResults=54]="ABTestShareGameResults",e[e.ABTestBotEndGameRankedCTA=55]="ABTestBotEndGameRankedCTA",e[e.ABTestPushReferrersToInviteMorePlayers=56]="ABTestPushReferrersToInviteMorePlayers",e[e.MatchmakingUnrankedShuffle=57]="MatchmakingUnrankedShuffle",e[e.NotificationPanel=58]="NotificationPanel",e[e.LandingPage=59]="LandingPage",e[e.Header=60]="Header",e[e.Auth=61]="Auth",e[e.MobilePushNotificationSent=62]="MobilePushNotificationSent",e[e.MobilePushNotificationOpened=63]="MobilePushNotificationOpened",e[e.WebStoreReferralProgramReferFriends=64]="WebStoreReferralProgramReferFriends",e[e.MobileStoreReferralProgramReferFriends=65]="MobileStoreReferralProgramReferFriends",e[e.ABTestReferralProgramWebMobile=66]="ABTestReferralProgramWebMobile",e[e.MobileImageSharing=67]="MobileImageSharing",e[e.MatchmakingRankedRush4P=68]="MatchmakingRankedRush4P",e}({}),o=function(e){return e[e.AdblockPopupDisableAction=1]="AdblockPopupDisableAction",e[e.AdblockPopupBecomeMemberAction=2]="AdblockPopupBecomeMemberAction",e[e.AdblockPopupContinueAction=3]="AdblockPopupContinueAction",e[e.InGameRemoveAdButtonLeft=4]="InGameRemoveAdButtonLeft",e[e.InGameRemoveAdButtonRight=5]="InGameRemoveAdButtonRight",e[e.PopupMembershipIncentiveSubscription=6]="PopupMembershipIncentiveSubscription",e[e.PopupMembershipIncentiveAvatars=7]="PopupMembershipIncentiveAvatars",e[e.PopupMembershipIncentiveMaps=8]="PopupMembershipIncentiveMaps",e[e.PopupMembershipIncentiveAllItems=9]="PopupMembershipIncentiveAllItems",e[e.PopupMembershipIncentiveSubscriptionRoom=10]="PopupMembershipIncentiveSubscriptionRoom",e[e.PopupMembershipIncentiveAvatarsRoom=11]="PopupMembershipIncentiveAvatarsRoom",e[e.PopupMembershipIncentiveMapsRoom=12]="PopupMembershipIncentiveMapsRoom",e[e.PopupMembershipIncentiveAllItemsR
1oom=13]="PopupMembershipIncentiveAllItemsRoom",e[e.PopupMembershipIncentiveExpansions=14]="PopupMembershipIncentiveExpansions",e[e.PopupMembershipIncentiveExpansionsRoom=15]="PopupMembershipIncentiveExpansionsRoom",e[e.PopupMembershipIncentiveEndgame=16]="PopupMembershipIncentiveEndgame",e[e.ItemBoxMembershipEndgame=18]="ItemBoxMembershipEndgame",e[e.StoreMembershipPlusMonthly=19]="StoreMembershipPlusMonthly",e[e.StoreMembershipPremiumMonthly=20]="StoreMembershipPremiumMonthly",e[e.StoreMembershipEliteMonthly=21]="StoreMembershipEliteMonthly",e[e.StoreMembershipPlusYearly=22]="StoreMembershipPlusYearly",e[e.StoreMembershipPremiumYearly=23]="StoreMembershipPremiumYearly",e[e.StoreMembershipEliteYearly=24]="StoreMembershipEliteYearly",e[e.PopupMembershipIncentiveVisitStoreMonthly=25]="PopupMembershipIncentiveVisitStoreMonthly",e[e.PopupMembershipIncentiveVisitStoreYearly=26]="PopupMembershipIncentiveVisitStoreYearly",e[e.PopupMembershipIncentiveVisitCheckoutYearly=27]="PopupMembershipIncentiveVisitCheckoutYearly",e[e.PopupMembershipIncentiveVisitCheckoutMonthly=28]="PopupMembershipIncentiveVisitCheckoutMonthly",e[e.LobbyAdViewMemberships=29]="LobbyAdViewMemberships",e[e.LobbyAdViewLeaderboards=30]="LobbyAdViewLeaderboards",e[e.ABTestImplementGifLeaderboards=31]="ABTestImplementGifLeaderboards",e[e.ABTestImplementGifMemberships=32]="ABTestImplementGifMemberships",e[e.LobbyAdViewCatanCommunityCashTournament=33]="LobbyAdViewCatanCommunityCashTournament",e[e.LobbyAdViewSignIn=34]="LobbyAdViewSignIn",e[e.LobbyAdDownloadMobile=35]="LobbyAdDownloadMobile",e[e.LobbyAdDiscordLogin=36]="LobbyAdDiscordLogin",e[e.PopupMembershipIncentiveFullScreen=37]="PopupMembershipIncentiveFullScreen",e[e.LobbyAdHire=38]="LobbyAdHire",e[e.RoomKarmaFilterIcon=39]="RoomKarmaFilterIcon",e[e.RoomBecomeAMemberButton=40]="RoomBecomeAMemberButton",e[e.RoomPremiumItemPopupBecomeAMemberButton=41]="RoomPremiumItemPopupBecomeAMemberButton",e[e.RoomPremiumItemInfoMessageBecomeAMemberText=42]="RoomPremiumItemInfoMessageBecomeAMemberText",e[e.StoreMembershipHoliday2023AllAccessPass=43]="StoreMembershipHoliday2023AllAccessPass",e[e.PopupMatchmakingHolidaySale=44]="PopupMatchmakingHolidaySale",e[e.RoomHolidaySale=45]="RoomHolidaySale",e[e.LobbyAdFreeColor=46]="LobbyAdFreeColor",e[e.LobbyAdPlayCitiesAndKnights=47]="LobbyAdPlayCitiesAndKnights",e[e.LobbyAdPlay1v1=48]="LobbyAdPlay1v1",e[e.EndGameShareButton=49]="EndGameShareButton",e[e.InviteFriendButtonCenter=50]="InviteFriendButtonCenter",e[e.InviteFriendButtonLeft=51]="InviteFriendButtonLeft",e[e.EndGameShareButtonHover=52]="EndGameShareButtonHover",e[e.EndGameShareCopyButton=53]="EndGameShareCopyButton",e[e.EndGameShareDownloadButton=54]="EndGameShareDownloadButton",e[e.EndGameShareDiscordButton=55]="EndGameShareDiscordButton",e[e.EndGameReplayEndgameButton=56]="EndGameReplayEndgameButton",e[e.MainPageRankedSubscribeCTA=57]="MainPageRankedSubscribeCTA",e[e.HeaderCoinPlusButton=58]="HeaderCoinPlusButton",e[e.PopupMembershipIncentiveDiscordGeneral=59]="PopupMembershipIncentiveDiscordGeneral",e[e.PopupMembershipIncentivesRankedCitiesAndKnights=60]="PopupMembershipIncentivesRankedCitiesAndKnights",e[e.LeaderboardYoutubeSubscribe=61]="LeaderboardYoutubeSubscribe",e[e.InviteFriendButtonLeftAnimated=62]="InviteFriendButtonLeftAnimated",e[e.StartedBeginnerModeGame=63]="StartedBeginnerModeGame",e[e.Started1v1EasyBotGame=64]="Started1v1EasyBotGame",e[e.TShirtSurvey=65]="TShirtSurvey",e[e.RoomAddFriendAction=66]="RoomAddFriendAction",e[e.LobbyAdRewardsProgram=67]="LobbyAdRewardsProgram",e[e.HomepageRankedInfoIcon=68]="HomepageRankedInfoIcon",e[e.MatchmakingPopupRankedCitiesAndKnightsSubscribeCTA=69]="MatchmakingPopupRankedCitiesAndKnightsSubscribeCTA",e[e.LandingPageBecomeAMemberButton=70]="LandingPageBecomeAMemberButton",e[e.MobileLandingPageBecomeAMemberBanner=71]="MobileLandingPageBecomeAMemberBanner",e[e.MobileProfilePageBecomeAMemberBanner=72]="MobileProfilePageBecomeAMemberBanner",e[e.MobileLeaderboardPageBannerQualifier=73]="MobileLeaderboardPageBannerQualifier",e[e.LobbyAdChampionship25=74]="LobbyAdChampionship25",e[e.PopupMembershipIncentivesShuffleQueue=75]="PopupMembershipIncentivesShuffleQueue",e[e.LobbyAdShuffle=76]="LobbyAdShuffle",e[e.MobileLeaderboardPageBannerShuffle=77]="MobileLeaderboardPageBannerShuffle",e[e.MobileLandingPageShuffleBanner=78]="MobileLandingPageShuffleBanner",e[e.MobileProfilePageShuffleBanner=79]="MobileProfilePageShuffleBanner",e[e.NotificationPanelShuffleClickPlayNow=80]="NotificationPanelShuffleClickPlayNow",e[e.EndGameShareMobileButton=81]="EndGameShareMobileButton",e[e.PopupMembershipIncentiveMobileRoomEdit=82]="PopupMembershipIncentiveMobileRoomEdit",e[e.LobbyAdPlayColonistRush=83]="LobbyAdPlayColonistRush",e[e.EndGameAddFriendAction=84]="EndGameAddFriendAction",e[e.InGameSideAdChampionship26=85]="InGameSideAdChampionship26",e[e.InGameBottomAdChampionship26=86]="InGameBottomAdChampionship26",e[e.PatchNotesAnnouncementChampionship26=87]="PatchNotesAnnouncementChampionship26",e[e.LobbyAdChampionship26=88]="LobbyAdChampionship26",e}({}),a=function(e){return e[e.AdblockPopupFormal=1]="AdblockPopupFormal",e[e.AdblockPopupSupportive=2]="AdblockPopupSupportive",e[e.AdblockPopupHumorous=3]="AdblockPopupHumorous",e[e.AdblockPopupDramatic=4]="AdblockPopupDramatic",e[e.AdblockPopupTypeHard=5]="AdblockPopupTypeHard",e[e.AdblockPopupTypeSoft=6]="AdblockPopupTypeSoft",e[e.ABTestShowLeaderboardPointBleedPopup=7]="ABTestShowLeaderboardPointBleedPopup",e}({}),c=function(e){return e[e.Google=1]="Google",e[e.Discord=2]="Discord",e[e.Apple=3]="Apple",e}({}),l=function(e){return e[e.EndGame=1]="EndGame",e[e.Homepage=2]="Homepage",e[e.QuitGame=3]="QuitGame",e[e.BeginnerModeEnd=4]="BeginnerModeEnd",e}({}),d=function(e){return e[e.ClickedCreateRoom=1]="ClickedCreateRoom",e[e.ClickedLobbyRoom=2]="ClickedLobbyRoom",e[e.EnteredRoomLink=3]="EnteredRoomLink",e}({}),u=function(e){return e[e.EndGame=0]="EndGame",e[e.DirectLink=1]="DirectLink",e[e.ShareableLink=2]="ShareableLink",e}({}),h=function(e){return e[e.Store=0]="Store",e[e.PlayerProfile=1]="PlayerProfile",e[e.ProfileFriendsTab=2]="ProfileFriendsTab",e[e.InGame=3]="InGame",e[e.LobbyAd=4]="LobbyAd",e[e.Room=5]="Room",e[e.GifterAvatar=6]="GifterAvatar",e[e.InGameAd=7]="InGameAd",e}({}),p=function(e){return e[e.SuccessfulPageCompletion=0]="SuccessfulPageCompletion",e[e.SuccessfulCheckoutClick=1]="SuccessfulCheckoutClick",e}({}),m=function(e){return e[e.DiscordRoomInvitation=0]="DiscordRoomInvitation",e[e.ShareActivityReturnToHomeAfterGameEnd=1]="ShareActivityReturnToHomeAfterGameEnd",e[e.RoomInvitationInviteFriendsButtonAnimated=2]="RoomInvitationInviteFriendsButtonAnimated",e[e.RoomInvitationMainCTAInverted=3]="RoomInvitationMainCTAInverted",e[e.DiscordShareActivityReferralProgramStore=4]="DiscordShareActivityReferralProgramStore",e[e.DiscordShareActivityReturnToHomeAfterGameEndPopup=5]="DiscordShareActivityReturnToHomeAfterGameEndPopup",e[e.DiscordRoomInvitationUsingShareActivityLink=6]="DiscordRoomInvitationUsingShareActivityLink",e[e.WebRoomInvitation=7]="WebRoomInvitation",e[e.MobileRoomInvitation=8]="MobileRoomInvitation",e[e.WebShareReferralProgramStore=9]="WebShareReferralProgramStore",e[e.MobileShareReferralProgramStore=10]="MobileShareReferralProgramStore",e}({}),g=function(e){return e[e.Reactivation24HoursAfterLastActivityLaunch=0]="Reactivation24HoursAfterLastActivityLaunch",e[e.Reactivation1WeekAfterLastActivityLaunch=1]="Reactivation1WeekAfterLastActivityLaunch",e[e.Reactivation1MonthAfterLastActivityLaunch=2]="Reactivation1MonthAfterLastActivityLaunch",e[e.Reactivation3MonthsAfterLastActivityLaunch=3]="Reactivation3MonthsAfterLastActivityLaunch",e[e.Reactivation6MonthsAfterLastActivityLaunch=4]="Reactivation6MonthsAfterLastActivityLaunch",e[e.Reactivation1YearAfterLastActivityLaunch=5]="Reactivation1YearAfterLastActivityLaunch",e[e.Reactivation2YearsAfterLastActivityLaunch=6]="Reactivation2YearsAfterLastActivityLaunch",e[e.ABTestStart=7]="ABTestStart",e[e.ABTestNow=8]="ABTestNow",e[e.ABTest2D=9]="ABTest2D",e[e.ABTest4D=10]="ABTest4D",e[e.ABTest7D=11]="ABTest7D",e[e.ABTest15D=12]="ABTest15D",e[e.ABTestPushReferrersToInviteMorePlayers=13]="ABTestPushReferrersToInviteMorePlayers",e}({}),f=function(e){return e[e.ReturnToHomeAfterGameEndPopupTriggered=0]="ReturnToHomeAfterGameEndPopupTriggered",e[e.ReturnToHomeAfterGameEndSuccessfullyShared=1]="ReturnToHomeAfterGameEndSuccessfullyShared",e[e.ReturnToHomeAfterGameEndPrePopupTriggered=2]="ReturnToHomeAfterGameEndPrePopupTriggered",e[e.ReferralProgramStorePopupTriggeredLevel1=3]="ReferralProgramStorePopupTriggeredLevel1",e[e.ReferralProgramStoreSuccessfullySharedLevel1=4]="ReferralProgramStoreSuccessfullySharedLevel1",e[e.ReferralProgramStorePopupTriggeredLevel2=5]="ReferralProgramStorePopupTriggeredLevel2",e[e.ReferralProgramStoreSuccessfullySharedLevel2=6]="ReferralProgramStoreSuccessfullySharedLevel2",e[e.ReferralProgramStorePopupTriggeredLevel3=7]="ReferralProgramStorePopupTriggeredLevel3",e[e.ReferralProgramStoreSuccessfullySharedLevel3=8]="ReferralProgramStoreSuccessfullySharedLevel3",e[e.ReferralProgramStorePopupTriggeredLevel4=9]="ReferralProgramStorePopupTriggeredLevel4",e[e.ReferralProgramStoreSuccessfullySharedLevel4=10]="ReferralProgramStoreSuccessfullySharedLevel4",e[e.ReturnToHomeAfterGameEndReferralProgramPrePopupTriggered=11]="ReturnToHomeAfterGameEndReferralProgramPrePopupTriggered",e[e.ReturnToHomeAfterGameEndReferralProgramPopupTriggered=12]="ReturnToHomeAfterGameEndReferralProgramPopupTriggered",e[e.ReturnToHomeAfterGameEndReferralProgramSuccessfullyShared=13]="ReturnToHomeAfterGameEndReferralProgramSuccessfullyShared",e[e.RoomInvitationUsingShareActivityLinkPopupTriggered=14]="RoomInvitationUsingShareActivityLinkPopupTriggered",e[e.RoomInvitationUsingShareActivityLinkSuccessfullyShared=15]="RoomInvitationUsingShareActivityLinkSuccessfullyShared",e[e.ABTestReactivateUserBaseReferralProgramPrePopupTriggered=16]="ABTestReactivateUserBaseReferralProgramPrePopupTriggered",e[e.ABTestReactivateUserBaseReferralProgramPopupTriggered=17]="ABTestReactivateUserBaseReferralProgramPopupTriggered",e[e.ABTestReactivateUserBaseReferralProgramSuccessfullyShared=18]="ABTestReactivateUserBaseReferralProgramSuccessfullyShared",e[e.ReferralProgramStorePopupTriggeredLevel5=19]="ReferralProgramStorePopupTriggeredLevel5",e[e.ReferralProgramStoreSuccessfullySharedLevel5=20]="ReferralProgramStoreSuccessfullySharedLevel5",e[e.ABTestPushReferrersToInviteMorePlayersGroupAPopupTriggered=21]="ABTestPushReferrersToInviteMorePlayersGroupAPopupTriggered",e[e.ABTestPushReferrersToInviteMorePlayersGroupASuccessfullyShared=22]="ABTestPushReferrersToInviteMorePlayersGroupASuccessfullyShared",e[e.ABTestPushReferrersToInviteMorePlayersGroupBPrePopupTriggered=23]="ABTestPushReferrersToInviteMorePlayersGroupBPrePopupTriggered",e[e.ABTestPushReferrersToInviteMorePlayersGroupBPopupTriggered=24]="ABTestPushReferrersToInviteMorePlayersGroupBPopupTriggered",e[e.ABTestPushReferrersToInviteMorePlayersGroupBSuccessfullyShared=25]="ABTestPushReferrersToInviteMorePlayersGroupBSuccessfullyShared",e[e.ABTestPushReferrersToInviteMorePlayersGroupCPrePopupTriggered=26]="ABTestPushReferrersToInviteMorePlayersGroupCPrePopupTriggered",e[e.ABTestPushReferrersToInviteMorePlayersGroupCPopupTriggered=27]="ABTestPushReferrersToInviteMorePlayersGroupCPopupTriggered",e[e.ABTestPushReferrersToInviteMorePlayersGroupCSuccessfullyShared=28]="ABTestPushReferrersToInviteMorePlayersGroupCSuccessfullyShared",e[e.PushReferrersToInviteMorePlayersPopupTriggered=29]="PushReferrersToInviteMorePlayersPopupTriggered",e[e.PushReferrersToInviteMorePlayersSuccessfullyShared=30]="PushReferrersToInviteMorePlayersSuccessfullyShared",e}({}),y=function(e){return e[e.Reactivation24HoursAfterLastActivityLaunch=0]="Reactivation24HoursAfterLastActivityLaunch",e[e.Reactivation1WeekAfterLastActivityLaunch=1]="Reactivation1WeekAfterLastActivityLaunch",e[e.Reactivation1MonthAfterLastActivityLaunch=2]="Reactivation1MonthAfterLastActivityLaunch",e[e.Reactivation3MonthsAfterLastActivityLaunch=3]="Reactivation3MonthsAfterLastActivityLaunch",e[e.Reactivation6MonthsAfterLastActivityLaunch=4]="Reactivation6MonthsAfterLastActivityLaunch",e[e.Reactivation1YearAfterLastActivityLaunch=5]="Reactivation1YearAfterLastActivityLaunch",e[e.Reactivation2YearsAfterLastActivityLaunch=6]="Reactivation2YearsAfterLastActivityLaunch",e[e.ABTestGroupAStart=7]="ABTestGroupAStart",e[e.ABTestGroupANow=8]="ABTestGroupANow",e[e.ABTestGroupA2D=9]="ABTestGroupA2D",e[e.ABTestGroupA4D=10]="ABTestGroupA4D",e[e.ABTestGroupA7D=11]="ABTestGroupA7D",e[e.ABTestGroupA15D=12]="ABTestGroupA15D",e[e.ABTestGroupBStart=13]="ABTestGroupBStart",e[e.ABTestGroupBNow=14]="ABTestGroupBNow",e[e.ABTestGroupB2D=15]="ABTestGroupB2D",e[e.ABTestGroupB4D=16]="ABTestGroupB4D",e[e.ABTestGroupB7D=17]="ABTestGroupB7D",e[e.ABTestGroupB15D=18]="ABTestGroupB15D",e[e.ABTestGroupCStart=19]="ABTestGroupCStart",e[e.ABTestGroupCNow=20]="ABTestGroupCNow",e[e.ABTestGroupC2D=21]="ABTestGroupC2D",e[e.ABTestGroupC4D=22]="ABTestGroupC4D",e[e.ABTestGroupC7D=23]="ABTestGroupC7D",e[e.ABTestGroupC15D=24]="ABTestGroupC15D",e}({}
1),v=function(e){return e[e.Unhandled=-1]="Unhandled",e[e.Dm=1]="Dm",e[e.GroupDm=3]="GroupDm",e[e.GuildText=0]="GuildText",e[e.GuildVoice=2]="GuildVoice",e[e.GuildCategory=4]="GuildCategory",e[e.GuildAnnouncement=5]="GuildAnnouncement",e[e.GuildStore=6]="GuildStore",e[e.AnnouncementThread=10]="AnnouncementThread",e[e.PublicThread=11]="PublicThread",e[e.PrivateThread=12]="PrivateThread",e[e.GuildStageVoice=13]="GuildStageVoice",e[e.GuildDirectory=14]="GuildDirectory",e[e.GuildForum=15]="GuildForum",e}({}),S=function(e){return e[e.GameResultsSharedFromGameEndScreen=0]="GameResultsSharedFromGameEndScreen",e}({})},76349:(e,t,s)=>{"use strict";var i;s.d(t,{v:()=>u}),function(e){e.isIStripeCheckoutRequestStatus=function(e){return"boolean"==typeof e.status&&"string"==typeof e.message};e.PublicProfileDataStickyPlayerInfo=class{constructor(){this.username=""}};e.PublicProfileDataOverview=class{constructor(){this.username="",this.karma="",this.gameData=new t}};class t{constructor(){this.pointsInLast100Games=0,this.totalGames=0,this.winPercent="0",this.pointsPerGame="0"}}e.PublicProfileGameDataOverview=t;e.UserFriendsData=class{constructor(){this.friends=[],this.friendRequestsSent=[],this.friendRequestsReceived=[]}};e.FriendRequestReceivedData=class{}}(i||(i={}));var n=s(36872),r=s(55547),o=s(655),a=s(32398),c=s(9902),l=s(81888),d=s(72239);class u{static async addFriendAction(e,t){const s="userId"in e?{userId:e.userId}:{username:e.username},i=await o.m.postRequestHandler(a.l.apiUserProfileAddFriend(),void 0,s,"application/json");if(null==i)return;l._.refresh();const c=i.json;u.state.setFriendsData(c);const d="userId"in e?c.friends.find(t=>t.userId==e.userId):c.friends.find(t=>t.username==e.username),h=null!=d;var p;const m=null!==(p=null==d?void 0:d.username)&&void 0!==p?p:e.username,g=h?{key:"strings:popups.notification.youAreNowFriendsWith",options:{username:m}}:{key:"strings:profilePage.friends.friendRequestSent"};r.OV.showNotification(n.am.Friends,g),t&&t(h);for(const e of u.callbackActionOnFriendRequestSent)e();u.notifyFriendsChanged()}static async removeFriendAction(e,t){const s={username:e};null!=await o.m.postRequestHandler(a.l.apiUserProfileRemoveFriend(),void 0,s,"application/json")&&(l._.refresh(),r.OV.showNotification(n.am.Friends,{key:"strings:popups.friendRequests.removed",options:{username:e}}),"function"==typeof t&&t(),u.notifyFriendsChanged())}static async cancelFriendRequest(e){const t={userId:e};return null!=await o.m.postRequestHandler(a.l.apiUserProfileRemoveFriend(),void 0,t,"application/json")&&(u.notifyFriendsChanged(),!0)}static showRemoveFriendPopup(e,t){const s={key:"strings:profilePage.friends.removeFriend.body",options:{username:e}};(0,c.C)({title:{key:"strings:profilePage.friends.removeFriend.title"},body:s,onConfirm:t,showCancelBtn:!0})}static async getFriends(){const e=await o.m.getRequestHandler(a.l.apiUserProfile.friends(),void 0);return null==e?new i.UserFriendsData:e.json}static async getFriendRequestsReceived(e){if(!(null==e?void 0:e.isLoggedIn))return[];const t=await o.m.getRequestHandler(a.l.apiFriendRequestsReceived(),void 0);return null==t?[]:t.json}static async respondToFriendRequest(e,t){const s={userId:e.userId},i=t?a.l.apiUserProfileAcceptFriend():a.l.apiUserProfileRemoveFriend();if(null!=await o.m.postRequestHandler(i,void 0,s,"application/json")){l._.refresh();for(const s of u.callbackNotificationFriendRequestResponded)await s(e,t);u.notifyFriendsChanged()}}static notifyFriendsChanged(){for(const e of u.callbackFriendsChanged)e()}static canUseOnlineFriendService(){var e;return!!(null===(e=l._.userState)||void 0===e?void 0:e.isLoggedIn)}static setCallbackFriendRequestResponded(e){u.callbackNotificationFriendRequestResponded.push(e)}}u.state=new class{get friends(){return this._friends}get friendRequestsSent(){return this._friendRequestsSent}get friendRequestsReceived(){return this._friendRequestsReceived}async loadFriends(e){if(void 0===e)return;if(!e.isLoggedIn)return;const t=e.id;if(this.currentUserId===t)return void(null!=this.currentLoadingPromise&&await this.currentLoadingPromise);this.currentUserId=t;const s=await this.loadData();this.currentUserId===t&&this.setFriendsData(s)}setFriendsData(e){this._friends=e.friends,this._friendRequestsSent=e.friendRequestsSent,this._friendRequestsReceived=e.friendRequestsReceived,this.changeListeners.trigger()}async loadData(){this.currentLoadingPromise=this.load();try{return await this.currentLoadingPromise}catch(e){throw this.currentUserId=void 0,e}finally{this.currentLoadingPromise=void 0}}
1addFriend(e){const t=this._friends.findIndex(t=>t.userId==e.userId);-1==t?this._friends.push(e):this._friends[t]=e,this.changeListeners.trigger()}removeSentFriendRequest(e){const t=this._friendRequestsSent.findIndex(t=>t.userId==e);-1!=t&&(this._friendRequestsSent.splice(t,1),this.changeListeners.trigger())}removeReceivedFriendRequest(e){const t=this._friendRequestsReceived.findIndex(t=>t.userId==e);-1!=t&&(this._friendRequestsReceived.splice(t,1),this.changeListeners.trigger())}registerChangeListener(e){return this.changeListeners.add(e)}constructor(e){this._friends=[],this._friendRequestsSent=[],this._friendRequestsReceived=[],this.currentUserId=void 0,this.currentLoadingPromise=void 0,this.changeListeners=new d.gp,this.load=e}}(()=>u.getFriends()),u.callbackActionOnFriendRequestSent=[],u.callbackFriendsChanged=[],u.callbackNotificationFriendRequestResponded=[]},76812:(e,t,s)=>{"use strict";e.exports=s.p+"assets/prob_10.d145f244ff011dd7a427.svg"},76861:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_join_room.5961c5707bc03a482185.mp3"},77110:(e,t,s)=>{"use strict";e.exports=s.p+"assets/prob_3.94270f97a8b15ab8d3ec.svg"},77183:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_knight_equip.b4884adc22ad2f5ac252.mp3"},77691:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_science_irrigation.8e3b3e037cb13e3c6ccd.svg"},77885:(e,t,s)=>{"use strict";s.d(t,{d:()=>u});var i=s(16611),n=s(9029),r=s(18587),o=s(80708),a=s(76092),c=s(70908),l=s(13618),d=s(81888);class u{setCoins(e){(0,n.RH)(this.userCoinsDiv,{key:"strings:colonistCommon.utils.#buffer",options:{value:e}})}initCoinClick(){(0,n.G0)(this.headerCoinsContainer,()=>{i.A9.play(i.hc.Click),this.sendCoinClickAnalytic();const e=(0,c.nJ)("/store",r.r.language);(0,l.Yf)(e)})}sendCoinClickAnalytic(){const e={type:a.k0.ABTestClickAnalytics,category:a.eX.ABTestClickAnalytics,floatValue:a.Jd.HeaderCoinPlusButton};o.CA.sendAnalyticEvent(e)}constructor(){this.userCoinsDiv=document.getElementById("header_coins"),this.headerCoinsContainer=document.getElementById("header_coins_container"),d._.registerChangeListener(e=>{null!=e&&this.setCoins(e.items.colonistCoins)}),this.initCoinClick()}}},77921:(e,t,s)=>{"use strict";e.exports=s.p+"assets/social_icon_discord.0da5642f971a1b0b916a.svg"},77950:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_science_back.679df2124294270a9fdf.svg"},77954:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_vote_reminder.7373523cf3465ee3fd99.mp3"},77999:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_inactive_purple.cd740a2f10ca8a51d274.svg"},78018:(e,t,s)=>{"use strict";s.d(t,{c:()=>u});var i=s(73264),n=s(50482),r=s(9029),o=s(16611),a=s(9902),c=s(72239),l=s(30911),d=s(70908);class u extends i.O{addBestValueHint(){}constructor(e,t,s,i,u){const p=n.Zt.getMembershipProduct(s.membershipType);var m,g;super(e,t,p,{localizedPriceData:u});const f=null!==(g=null!==(m=s.periodDays)&&void 0!==m?m:s.periods)&&void 0!==g?g:0;var y;(0,r.RH)(this.priceDiv,{key:h(s,p.billedAnnually),options:{count:f}});const v=null!==(y=s.expiresAt)&&void 0!==y?y:c.Re.addYears(c.Re.toDate(s.giftedAt),l.Z),S=c.Re.formatDateDistance(new Date,v),b=d.a7.t(S.key,S.options);(0,r.RH)(this.disclaimerText,{key:"strings:storePage.sections.membership.giftWithExpiry",options:{expiry:b}}),(0,r.RH)(this.subscribeButtonText,{key:"strings:storePage.sections.membership.action.activate"}),(0,r.G0)(this.productDiv,()=>{o.A9.play(o.hc.Click),(0,a.C)({title:{key:"strings:storePage.sections.membership.activateConfirmation.title"},body:{key:"strings:storePage.sections.membership.activateConfirmation.body"},onConfirm:()=>i(s.id),showCancelBtn:!0})})}}function h(e,t){return null!=e.periodDays?"strings:colonistCommon.dates.day":t?"strings:colonistCommon.dates.year":"strings:colonistCommon.dates.month"}},78119:(e,t,s)=>{"use strict";e.exports=s.p+"assets/membership_icon_elite.bccacba2f392d83069ea.svg"},78134:(e,t,s)=>{"use strict";s.d(t,{M1:()=>r,qq:()=>S});class i{}var n=s(46581);const r={[n.ro.Base15s]:{key:n.ro.Base15s,labelTranslationKey:"strings:colonistCommon.SpeedSettings.Base15s"},[n.ro.Base30s]:{key:n.ro.Base30s,labelTranslationKey:"strings:colonistCommon.SpeedSettings.Base30s"},[n.ro.Base60s]:{key:n.ro.Base60s,labelTranslationKey:"strings:colonistCommon.SpeedSettings.Base60s",isDefault:!0},[n.ro.Base120s]:{key:n.ro.Base120s,labelTranslationKey:"strings:colonistCommon.SpeedSettings.Base120s"},[n.ro.Base240s]:{key:n.ro.Base240s,labelTranslationKey:"strings:colonistCommon.SpeedSettings.Base240s"},[n.ro.Base12000s]:{key:n.ro.Base12000s,labelTranslationKey:"strings:colonistCommon.SpeedSettings.Base12000s"},[n.ro.Rush5s]:{key:n.ro.Rush5s,labelTranslationKey:"strings:colonistCommon.SpeedSettings.Rush5s",isDefault:!0},[n.ro.Rush8s]:{key:n.ro.Rush8s,labelTranslationKey:"strings:colonistCommon.SpeedSettings.Rush8s"},[n.ro.Rush10s]:{key:n.ro.Rush10s,labelTranslationKey:"strings:colonistCommon.SpeedSettings.Rush10s"},[n.ro.Rush15s]:{key:n.ro.Rush15s,labelTranslationKey:"strings:colonistCommon.SpeedSettings.Rush15s"},[n.ro.Rush20s]:{key:n.ro.Rush20s,labelTranslationKey:"strings:colonistCommon.SpeedSettings.Rush20s"}},o=[n.ro.Base15s,n.ro.Base30s,n.ro.Base60s,n.ro.Base120s,n.ro.Base12000s],a=[n.ro.Rush5s,n.ro.Rush8s,n.ro.Rush10s,n.ro.Rush15s,n.ro.Rush20s];class c{isGameModePremium(){return 0!=this.premiumExpansionAccess.length}getAllowablePlayerCount(){switch(this.extensionSetting){case n.Ly.Players4:return[1,2,3,4];case n.Ly.Players56:return[5,6];case n.Ly.Players78:return[7,8]}}getNewInstanceOfData(){return new this.constructor}constructor(){this.defaultCardDiscardLimit=7,this.defaultFriendlyRobber=!1,this.minimumPlayerCount=2,this.allowedGameTimers=o}}var l=s(72239),d=s(36872),u=s(66935),h=s(13567);class p{}p.developmentCardsClassic4P=[...Array(14).fill(h.O3.Knight),...Array(5).fill(h.O3.VictoryPoint),...Array(2).fill(h.O3.RoadBuilding),...Array(2).fill(h.O3.Monopoly),...Array(2).fill(h.O3.YearOfPlenty)],p.developmentCardsClassic56P=[...Array(20).fill(h.O3.Knight),...Array(5).fill(h.O3.VictoryPoint),...Array(3).fill(h.O3.RoadBuilding),...Array(3).fill(h.O3.Monopoly),...Array(3).fill(h.O3.YearOfPlenty)],p.developmentCardsClassic78P=[...Array(26).fill(h.O3.Knight),...Array(5).fill(h.O3.VictoryPoint),...Array(4).fill(h.O3.RoadBuilding),...Array(4).fill(h.O3.Monopoly),...Array(4).fill(h.O3.YearOfPlenty)],p.progressCardsCitiesAndKnights4P=[...Array(2).fill(h.O3.ProgressCardScienceAlchemist),...Array(2).fill(h.O3.ProgressCardScienceCrane),...Array(1).fill(h.O3.ProgressCardScienceEngineer),...Array(2).fill(h.O3.ProgressCardScienceInventor),...Array(2).fill(h.O3.ProgressCardScienceIrr
1igation),...Array(2).fill(h.O3.ProgressCardScienceMedicine),...Array(2).fill(h.O3.ProgressCardScienceMining),...Array(1).fill(h.O3.ProgressCardSciencePrinter),...Array(2).fill(h.O3.ProgressCardScienceRoadBuilding),...Array(2).fill(h.O3.ProgressCardScienceSmith),...Array(2).fill(h.O3.ProgressCardPoliticsBishop),...Array(1).fill(h.O3.ProgressCardPoliticsConstitution),...Array(2).fill(h.O3.ProgressCardPoliticsDeserter),...Array(2).fill(h.O3.ProgressCardPoliticsDiplomat),...Array(2).fill(h.O3.ProgressCardPoliticsIntrigue),...Array(2).fill(h.O3.ProgressCardPoliticsSaboteur),...Array(3).fill(h.O3.ProgressCardPoliticsSpy),...Array(2).fill(h.O3.ProgressCardPoliticsWarlord),...Array(2).fill(h.O3.ProgressCardPoliticsWedding),...Array(2).fill(h.O3.ProgressCardTradeCommercialHarbor),...Array(2).fill(h.O3.ProgressCardTradeMasterMerchant),...Array(6).fill(h.O3.ProgressCardTradeMerchant),...Array(2).fill(h.O3.ProgressCardTradeMerchantFleet),...Array(4).fill(h.O3.ProgressCardTradeResourceMonopoly),...Array(2).fill(h.O3.ProgressCardTradeCommodityMonopoly)];var m=s(15123),g=s(13627);class f{getProductionForCornerPieceAndTile(e,t){switch(e){case m.um.KnightActiveLevel1:case m.um.KnightActiveLevel2:case m.um.KnightActiveLevel3:case m.um.KnightInactiveLevel1:case m.um.KnightInactiveLevel2:case m.um.KnightInactiveLevel3:return[];case m.um.DestroyedCity:case m.um.Settlement:return this.getProductionForSettlement(t);case m.um.City:return this.getProductionForCity(t)}}getProductionForSettlement(e){switch(e){case g.m1.Lumber:return this.settlementLumberProduction;case g.m1.Brick:return this.settlementBrickProduction;case g.m1.Wool:return this.settlementWoolProduction;case g.m1.Grain:return this.settlementGrainProduction;case g.m1.Ore:return this.settlementOreProduction;case g.m1.Gold:return this.settlementGoldProduction;case g.m1.Sea:return this.settlementSeaProduction;case g.m1.Desert:return this.settlementDesertProduction;case g.m1.Fog:return this.settlementFogProduction}}getProductionForCity(e){switch(e){case g.m1.Lumber:return this.cityLumberProduction;case g.m1.Brick:return this.cityBrickProduction;case g.m1.Wool:return this.cityWoolProduction;case g.m1.Grain:return this.cityGrainProduction;case g.m1.Ore:return this.cityOreProduction;case g.m1.Gold:return this.cityGoldProduction;case g.m1.Sea:return this.citySeaProduction;case g.m1.Desert:return this.cityDesertProduction;case g.m1.Fog:return this.cityFogProduction}}}class y extends f{constructor(...e){super(...e),this.settlementLumberProduction=[h.O3.
1Lumber],this.settlementBrickProduction=[h.O3.Brick],this.settlementWoolProduction=[h.O3.Wool],this.settlementGrainProduction=[h.O3.Grain],this.settlementOreProduction=[h.O3.Ore],this.settlementGoldProduction=[],this.settlementSeaProduction=[],this.settlementDesertProduction=[],this.settlementFogProduction=[],this.cityLumberProduction=[h.O3.Lumber,h.O3.Lumber],this.cityBrickProduction=[h.O3.Brick,h.O3.Brick],this.cityWoolProduction=[h.O3.Wool,h.O3.Wool],this.cityGrainProduction=[h.O3.Grain,h.O3.Grain],this.cityOreProduction=[h.O3.Ore,h.O3.Ore],this.cityGoldProduction=[],this.citySeaProduction=[],this.cityDesertProduction=[],this.cityFogProduction=[]}}class v extends f{constructor(...e){super(...e),this.settlementLumberProduction=[h.O3.Lumber],this.settlementBrickProduction=[h.O3.Brick],this.settlementWoolProduction=[h.O3.Wool],this.settlementGrainProduction=[h.O3.Grain],this.settlementOreProduction=[h.O3.Ore],this.settlementGoldProduction=[],this.settlementSeaProduction=[],this.settlementDesertProduction=[],this.settlementFogProduction=[],this.cityLumberProduction=[h.O3.
1Lumber,h.O3.Paper],this.cityBrickProduction=[h.O3.Brick,h.O3.Brick],this.cityWoolProduction=[h.O3.Wool,h.O3.Cloth],this.cityGrainProduction=[h.O3.Grain,h.O3.Grain],this.cityOreProduction=[h.O3.Ore,h.O3.Coin],this.cityGoldProduction=[],this.citySeaProduction=[],this.cityDesertProduction=[],this.cityFogProduction=[]}}class S{static getModeDataForMode(e){for(const t of S.privateGameModeDataList)if(t.modeSetting==e)return t.getNewInstanceOfData()}static getModeName(e){var t;const s=null===(t=this.getModeDataForMode(e))||void 0===t?void 0:t.name,i=(0,u.Co)(n.p9[e]);return null!=s?s:i}static getScenarioDataForScenario(e){return new(0,this.scenarioDataClasses[e])}static getMaxAllowablePlayerCountForMode(e){const t=[],s=S.getAvailableGameModeDataForTemporaryMode(e);for(const e of s){const s=e.getAllowablePlayerCount();t.push(...s)}return Math.max(...t)}static getAvailableGameModeDataForTemporaryMode(e){const t=[],s=S.getModeDataForMode(e);if(null==s)return t;const i=s.temporaryModeSetting;for(const e of S.privateGameModeDataList)e.temporaryModeSetting==i&&t.push(e);return t}static getAvailableExtensionsForTemporaryMode(e){const t=[];
1for(const s of S.privateGameModeDataList)s.temporaryModeSetting==e&&(l.lv.elementInArray(t,s.extensionSetting)||t.push(s.extensionSetting));return t}static getGameModeDataForPlayerCountAndMode(e,t){const s=S.getAvailableGameModeDataForTemporaryMode(t);for(const t of s){const s=t.getAllowablePlayerCount();if(l.lv.elementInArray(s,e))return t}}static isModeCitiesAndKnights(e){return e==n.p9.CitiesAndKnights4P||(e==n.p9.CitiesAndKnights56P||(e==n.p9.CitiesAndKnightsSeafarers4P||e==n.p9.CitiesAndKnightsSeafarers56P))}}S.publicGameModeDataList=[new class extends c{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.modeSetting=n.p9.Classic4P,this.extensionSetting=n.Ly.Players4,this.startingSettlementPlacements=[m.um.Settlement,m.um.Settlement],this.activeResourceCardTypes=[h.Q4.Resource],this.activeDevelopmentCardTypes=[h.Q4.Development],this.startingDevelopmentCards=p.developmentCardsClassic4P,this.productionController=new y,this.name={key:"strings:colonistCommon.gameModes.classic4P.title"},this.active=!0,this.defaultMap=n.Qy.Classic4P,this.defaultPlayerCount=4,this.defaultVPsToWin=10,this.additionalVPsForGameModeCombinations=0,this.icon=d.am.GameModeBase,this.translationKeyContext=u.zj.BaseGame,this.temporaryMo
1deSetting=n.w$.Classic,this.currentStateControllerType=n.gO.Default}},new class extends c{constructor(...e){super(...e),this.premiumExpansionAccess=[d.$y.ColonistRush4P],this.modeSetting=n.p9.ColonistRush4P,this.extensionSetting=n.Ly.Players4,this.startingSettlementPlacements=[m.um.Settlement,m.um.Settlement],this.activeResourceCardTypes=[h.Q4.Resource],this.activeDevelopmentCardTypes=[h.Q4.Development],this.startingDevelopmentCards=p.developmentCardsClassic4P,this.productionController=new y,this.name={key:"strings:colonistCommon.gameModes.colonistRush.title"},this.active=!0,this.defaultMap=n.Qy.Classic4P,this.defaultPlayerCount=4,this.defaultVPsToWin=10,this.additionalVPsForGameModeCombinations=0,this.icon=d.am.GameModeColonistRush,this.translationKeyContext=u.zj.BaseGame,this.allowedGameTimers=a,this.defaultCardDiscardLimit=9,this.defaultFriendlyRobber=!0,this.currentStateControllerType=n.gO.ColonistRush,this.temporaryModeSetting=n.w$.Classic}},new class extends c{constructor(...e){super(...e),this.premiumExpansionAccess=[d.$y.Classic56P],this.modeSetting=n.p9.Classic56P,this.extensionSetting=n.Ly.Players56,this.startingSettlementPlacements=[m.um.Settlement,m.um.Settlement],this.activeResourceCardTypes=[h.Q4.Resource],this.activeDevelopmentCardTypes=[h.Q4.Development],this.startingDevelopmentCards=p.developmentCardsClassic56P,this.productionController=new y,this.name={key:"strings:colonistCommon.gameModes.classic56P.title"},this.active=!0,this.defaultMap=n.Qy.Classic56P,this.defaultPlayerCount=6,this.defaultVPsToWin=10,this.additionalVPsForGameModeCombinations=0,this.icon=d.am.GameModeBase56P,this.translationKeyContext=u.zj.BaseGame,this.currentStateControllerType=n.gO.Default,this.temporaryMo
1deSetting=n.w$.Classic}},new class extends c{constructor(...e){super(...e),this.premiumExpansionAccess=[d.$y.Classic78P],this.modeSetting=n.p9.Classic78P,this.extensionSetting=n.Ly.Players78,this.startingSettlementPlacements=[m.um.Settlement,m.um.Settlement],this.activeResourceCardTypes=[h.Q4.Resource],this.activeDevelopmentCardTypes=[h.Q4.Development],this.startingDevelopmentCards=p.developmentCardsClassic78P,this.productionController=new y,this.name={key:"strings:colonistCommon.gameModes.classic78P.title"},this.active=!0,this.defaultMap=n.Qy.Classic78P,this.minimumPlayerCount=7,this.defaultPlayerCount=8,this.defaultVPsToWin=10,this.additionalVPsForGameModeCombinations=0,this.icon=d.am.GameModeBase78P,this.translationKeyContext=u.zj.BaseGame,this.currentStateControllerType=n.gO.Default,this.temporaryModeSetting=n.w$.Classic}},new class extends c{constructor(...e){super(...e),this.premiumExpansionAccess=[d.$y.CitiesAndKnights4P],this.modeSetting=n.p9.CitiesAndKnights4P,this.extensionSetting=n.Ly.Players4,this.startingSettlementPlacements=[m.um.Settlement,m.um.City],this.activeResourceCardTypes=[h.Q4.Resource,h.Q4.Commodity],this.activeDevelopmentCardTypes=[h.Q4.ProgressPolitics,h.Q4.ProgressScience,h.Q4.ProgressTrade],this.startingDevelopmentCards=p.progressCardsCitiesAndKnights4P,this.productionController=new v,this.name={key:"strings:colonistCommon.gameModes.citiesAndKnights4P.title"},this.active=!0,this.defaultMap=n.Qy.Classic4P,this.defaultPlayerCount=4,this.defaultVPsToWin=13,this.additionalVPsForGameModeCombinations=0,this.icon=d.am.GameModeCnK,this.translationKeyContext=u.zj.CitiesAndKnights,this.currentStateControllerType=n.gO.Default,this.temporaryMo
1deSetting=n.w$.CitiesAndKnights}},new class extends c{constructor(...e){super(...e),this.premiumExpansionAccess=[d.$y.CitiesAndKnights56P],this.modeSetting=n.p9.CitiesAndKnights56P,this.extensionSetting=n.Ly.Players56,this.startingSettlementPlacements=[m.um.Settlement,m.um.City],this.activeResourceCardTypes=[h.Q4.Resource,h.Q4.Commodity],this.activeDevelopmentCardTypes=[h.Q4.ProgressPolitics,h.Q4.ProgressScience,h.Q4.ProgressTrade],this.startingDevelopmentCards=p.progressCardsCitiesAndKnights4P,this.productionController=new v,this.name={key:"strings:colonistCommon.gameModes.citiesAndKnights56P.title"},this.active=!0,this.defaultMap=n.Qy.Classic56P,this.defaultPlayerCount=6,this.defaultVPsToWin=13,this.additionalVPsForGameModeCombinations=0,this.icon=d.am.GameModeCitiesAndKnights56P,this.translationKeyContext=u.zj.CitiesAndKnights,this.currentStateControllerType=n.gO.Default,this.temporaryModeSetting=n.w$.CitiesAndKnights}},new class extends c{constructor(...e){super(...e),this.premiumExpansionAccess=[d.$y.Seafarers4P],this.modeSetting=n.p9.Seafarers4P,this.extensionSetting=n.Ly.Players4,this.startingSettlementPlacements=[m.um.Settlement,m.um.Settlement],this.activeResourceCardTypes=[h.Q4.Resource],this.activeDevelopmentCardTypes=[h.Q4.Development],this.startingDevelopmentCards=p.developmentCardsClassic4P,this.productionController=new y,this.name={key:"strings:colonistCommon.gameModes.seafarers4P.title"},this.active=!0,this.defaultMap=n.Qy.SS1HeadingForNewShores4P,this.defaultPlayerCount=4,this.defaultVPsToWin=14,this.additionalVPsForGameModeCombinations=0,this.icon=d.am.GameModeSeafarers,this.translationKeyContext=u.zj.Seafarers,this.currentStateControllerType=n.gO.Default,this.temporaryMo
1deSetting=n.w$.Seafarers}},new class extends c{constructor(...e){super(...e),this.premiumExpansionAccess=[d.$y.Seafarers56P],this.modeSetting=n.p9.Seafarers56P,this.extensionSetting=n.Ly.Players56,this.startingSettlementPlacements=[m.um.Settlement,m.um.Settlement],this.activeResourceCardTypes=[h.Q4.Resource],this.activeDevelopmentCardTypes=[h.Q4.Development],this.startingDevelopmentCards=p.developmentCardsClassic56P,this.productionController=new y,this.name={key:"strings:colonistCommon.gameModes.seafarers56P.title"},this.active=!0,this.defaultMap=n.Qy.SS1HeadingForNewShores56P,this.defaultPlayerCount=6,this.defaultVPsToWin=14,this.additionalVPsForGameModeCombinations=0,this.icon=d.am.GameModeSeafarers56P,this.translationKeyContext=u.zj.Seafarers,this.currentStateControllerType=n.gO.Default,this.temporaryModeSetting=n.w$.Seafarers}},new class extends c{constructor(...e){super(...e),this.premiumExpansionAccess=[d.$y.CitiesAndKnightsSeafarers4P],this.modeSetting=n.p9.CitiesAndKnightsSeafarers4P,this.extensionSetting=n.Ly.Players4,this.startingSettlementPlacements=[m.um.Settlement,m.um.City],this.activeResourceCardTypes=[h.Q4.Resource,h.Q4.Commodity],this.activeDevelopmentCardTypes=[h.Q4.ProgressPolitics,h.Q4.ProgressScience,h.Q4.ProgressTrade],this.startingDevelopmentCards=p.progressCardsCitiesAndKnights4P,this.productionController=new v,this.name={key:"strings:colonistCommon.gameModes.seafarersAndCitiesAndKnights4P.title"},this.active=!0,this.defaultMap=n.Qy.SS1HeadingForNewShores4P,this.defaultPlayerCount=4,this.defaultVPsToWin=14,this.additionalVPsForGameModeCombinations=2,this.icon=d.am.GameModeCnKSeafarers,this.translationKeyContext=u.zj.CitiesAndKnightsSeafarers,this.currentStateControllerType=n.gO.Default,this.temporaryMo
1deSetting=n.w$.CitiesAndKnightsSeafarers}},new class extends c{constructor(...e){super(...e),this.premiumExpansionAccess=[d.$y.CitiesAndKnightsSeafarers56P],this.modeSetting=n.p9.CitiesAndKnightsSeafarers56P,this.extensionSetting=n.Ly.Players56,this.startingSettlementPlacements=[m.um.Settlement,m.um.City],this.activeResourceCardTypes=[h.Q4.Resource,h.Q4.Commodity],this.activeDevelopmentCardTypes=[h.Q4.ProgressPolitics,h.Q4.ProgressScience,h.Q4.ProgressTrade],this.startingDevelopmentCards=p.progressCardsCitiesAndKnights4P,this.productionController=new v,this.name={key:"strings:colonistCommon.gameModes.seafarersAndCitiesAndKnights56P.title"},this.active=!0,this.defaultMap=n.Qy.SS1HeadingForNewShores56P,this.defaultPlayerCount=6,this.defaultVPsToWin=14,this.additionalVPsForGameModeCombinations=2,this.icon=d.am.GameModeSeafarersCitiesAndKnights56P,this.translationKeyContext=u.zj.CitiesAndKnightsSeafarers,this.currentStateControllerType=n.gO.Default,this.temporaryModeSetting=n.w$.CitiesAndKnightsSeafarers}},new class extends c{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.modeSetting=n.p9.ServerStressTestClassic4P,this.extensionSetting=n.Ly.Players4,this.startingSettlementPlacements=[],this.activeResourceCardTypes=[h.Q4.Resource],this.activeDevelopmentCardTypes=[],this.startingDevelopmentCards=[],this.productionController=new y,this.name={key:"strings:colonistCommon.gameModes.serverStressTestClassic4P.title"},this.active=!0,this.defaultMap=n.Qy.TutorialClassic4P,this.defaultPlayerCount=4,this.defaultVPsToWin=10,this.additionalVPsForGameModeCombinations=0,this.icon=d.am.GameModeBase,this.translationKeyContext=u.zj.BaseGame,this.currentStateControllerType=n.gO.Default,this.temporaryMo
1deSetting=n.w$.ServerStressTest}}],S.privateGameModeDataList=[...S.publicGameModeDataList,new class extends c{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.modeSetting=n.p9.BeginnerModeClassic4P,this.extensionSetting=n.Ly.Players4,this.startingSettlementPlacements=[],this.activeResourceCardTypes=[h.Q4.Resource],this.activeDevelopmentCardTypes=[h.Q4.Development],this.startingDevelopmentCards=p.developmentCardsClassic4P,this.productionController=new y,this.name={key:"strings:homePage.matchmakingPopup.beginnerMode.title"},this.active=!0,this.defaultMap=n.Qy.CampaignLevel1,this.defaultPlayerCount=4,this.defaultVPsToWin=4,this.additionalVPsForGameModeCombinations=0,this.icon=d.am.GameModeBase,this.translationKeyContext=u.zj.BaseGame,this.defaultCardDiscardLimit=20,this.currentStateControllerType=n.gO.Default,this.temporaryModeSetting=n.w$.TutorialClassic}},new class extends c{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.modeSetting=n.p9.TutorialClassic4P,this.extensionSetting=n.Ly.Players4,this.startingSettlementPlacements=[],this.activeResourceCardTypes=[h.Q4.Resource],this.activeDevelopmentCardTypes=[h.Q4.Development],this.startingDevelopmentCards=p.developmentCardsClassic4P,this.productionController=new y,this.name={key:"strings:colonistCommon.gameModes.classicTutorial4P.title"},this.active=!0,this.defaultMap=n.Qy.TutorialClassic4P,this.defaultPlayerCount=4,this.defaultVPsToWin=10,this.additionalVPsForGameModeCombinations=0,this.icon=d.am.GameModeBase,this.translationKeyContext=u.zj.BaseGame,this.temporaryMo
1deSetting=n.w$.TutorialClassic,this.currentStateControllerType=n.gO.Default}}],S.scenarioDataClasses={[n.ec.None]:class extends i{constructor(...e){super(...e),this.scenarioSetting=n.ec.None,this.defaultVPsToWin=10}},[n.ec.SS1HeadingForNewShores]:class extends i{constructor(...e){super(...e),this.scenarioSetting=n.ec.SS1HeadingForNewShores,this.defaultVPsToWin=14}},[n.ec.SS2TheFourIslands]:class extends i{constructor(...e){super(...e),this.scenarioSetting=n.ec.SS2TheFourIslands,this.defaultVPsToWin=13}},[n.ec.SS3TheFogIslands]:class extends i{constructor(...e){super(...e),this.scenarioSetting=n.ec.SS3TheFogIslands,this.defaultVPsToWin=12}},[n.ec.SS4ThroughTheDesert]:class extends i{constructor(...e){super(...e),this.scenarioSetting=n.ec.SS4ThroughTheDesert,this.defaultVPsToWin=14}}}},78158:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_refresh.4cbb225c893b7397a299.svg"},78491:(e,t,s)=>{"use strict";s.d(t,{V:()=>r});var i=s(9029),n=s(35742);class r extends n.u{constructor(e){const t=e?document.getElementById(e):document,s=t.querySelector(".content_singleton_page"),n=t.querySelector(".singleton_page_sidebar");var r;const o=null!==(r=s.closest(".web-layout-content"))&&void 0!==r?r:s;super(s,n,o),o.addEventListener("scroll",()=>this.onContentScroll()),(0,i.G0)(n,e=>this.onSidebarClick(e))}}},78524:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});var i=s(36872),n=s(50482);class r extends n.Zt{static getAllMembershipProducts(){return Array.from(this.products.values())}getFrequencyTranslation(){return{key:n.Zt.isAnnualMembership(this.type)?"strings:storePage.membership.frequency.oneYear":"strings:storePage.membership.frequency.oneMonth",options:{context:"gift"}}}static initProducts(e){const t=new r({type:i.Qb.PlusMonthly,price:899,discordSKUId:e.giftMembershipPlus,membershipTitle:{key:"strings:storePage.membership.title.plus"},membershipColor:"membership_type1",lobbyImage:i.am.StoreMembershipPlus,perks:[new n.vN,new n.WM,new n.Io],billedAnnually:!1,bestValue:!1,mobileIAPSKUId:n.a8.PlusMonthly,discount:0,isActive:()=>!0});t.oneTimePurchaseType=i.IM.GiftPlusMonthly,this.products.set(i.Qb.PlusMonthly,t);const s=new r({type:i.Qb.PremiumMonthly,price:1899,discordSKUId:e.giftMembershipPremium,mobileIAPSKUId:n.a8.PremiumMonthly,membershipTitle:{key:"strings:storePage.membership.title.premium"},membershipColor:"membership_type2",lobbyImage:i.am.StoreMembershipPremium,perks:[new n.vN,new n.WM,new n.FN,new n.ky,new n.Z5],billedAnnually:!1,bestValue:!0,discount:0,isActive:()=>!0});s.oneTimePurchaseType=i.IM.GiftPremiumMonthly,this.products.set(i.Qb.PremiumMonthly,s);const o=new r({type:i.Qb.EliteMonthly,price:2499,discordSKUId:e.giftMembershipElite,mobileIAPSKUId:n.a8.EliteMonthly,membershipTitle:{key:"strings:storePage.membership.title.elite"},membershipColor:"membership_type3",lobbyImage:i.am.StoreMembershipElite,perks:[new n.vN,new n.WM,new n.FN,new n.ky,new n.Z5,new n.s9],billedAnnually:!1,bestValue:!1,discount:0,isActive:()=>!0});o.oneTimePurchaseType=i.IM.GiftEliteMonthly,this.products.set(i.Qb.EliteMonthly,o);const a=new r({type:i.Qb.PlusYearly,price:8388,discordSKUId:e.giftMembershipPlusYearly,mobileIAPSKUId:n.a8.PlusYearly,membershipTitle:{key:"strings:storePage.membership.title.plus"},membershipColor:"membership_type1",lobbyImage:i.am.StoreMembershipPlus,perks:[new n.vN,new n.WM,new n.Io],billedAnnually:!1,bestValue:!1,discount:24,isActive:()=>!0});a.oneTimePurchaseType=i.IM.GiftPlusYearly,this.products.set(i.Qb.PlusYearly,a);const c=new r({type:i.Qb.PremiumYearly,price:17988,discordSKUId:e.giftMembershipPremiumYearly,mobileIAPSKUId:n.a8.PremiumYearly,membershipTitle:{key:"strings:storePage.membership.title.premium"},membershipColor:"membership_type2",lobbyImage:i.am.StoreMembershipPremium,perks:[new n.vN,new n.WM,new n.FN,new n.ky,new n.Z5],billedAnnually:!1,bestValue:!0,discount:48,isActive:()=>!0});c.oneTimePurchaseType=i.IM.GiftPremiumYearly,this.products.set(i.Qb.PremiumYearly,c);const l=new r({type:i.Qb.EliteYearly,price:23988,discordSKUId:e.giftMembershipEliteYearly,mobileIAPSKUId:n.a8.EliteYearly,membershipTitle:{key:"strings:storePage.membership.title.elite"},membershipColor:"membership_type3",lobbyImage:i.am.StoreMembershipElite,perks:[new n.vN,new n.WM,new n.FN,new n.ky,new n.Z5,new n.s9],billedAnnually:!1,bestValue:!1,discount:60,isActive:()=>!0});l.oneTimePurchaseType=i.IM.GiftEliteYearly,this.products.set(i.Qb.EliteYearly,l)}}r.products=new Map},78876:(e,t,s)=>{"use strict";s.d(t,{l:()=>u});var i=s(36872),n=s(78134),r=s(46581),o=s(52955),a=s(84235),c=s(81888),l=s(44529),d=s(55547);class u{static snapshotRoomSettings(e,t){if(!e.isHost(t))return;const s=e.gameSetting;l.p.setRoomSettingsSnapshot({modeSetting:s.modeSetting,mapSetting:s.mapSetting,maxPlayers:s.maxPlayers,hideBankCards:s.hideBankCards,noTrolls:e.isNoTrollsGame(),victoryPointsToWin:s.victoryPointsToWin,
1cardDiscardLimit:s.cardDiscardLimit,diceSetting:s.diceSetting,friendlyRobber:s.friendlyRobber,gameSpeed:s.gameSpeed})}static initRoomSettingFromLocalStorage(e){var t;const s=u.readSnapshot();if(null==s)return;const l=u.readEnum(s.modeSetting,i.p9);null!=l&&d.sZ.roomClient.setGameMode(l);const h=null!=l?l:e,p=u.readEnum(s.mapSetting,i.Qy);if(null!=p){const e=a.X.getMapDataForMap(p);var m;null!==(m=null==e?void 0:e.compatibleGameModes.includes(h))&&void 0!==m&&m&&d.sZ.roomClient.setMap(p)}const g=s.maxPlayers;if((0,o.Xx)(g,r.Zt.MIN_PLAYER_COUNT,r.Zt.MAX_PLAYER_COUNT)){g<=n.qq.getMaxAllowablePlayerCountForMode(h)&&d.sZ.roomClient.setMaxPlayers(g)}const f=s.hideBankCards;(0,o.mF)(f)&&d.sZ.roomClient.setHideBankCards(f);const y=s.noTrolls;var v;const S=null!==(v=null===(t=c._.userState)||void 0===t?void 0:t.items.hasMembership())&&void 0!==v&&v;!0===y&&S&&d.sZ.roomClient.toggleNoTrolls();const b=s.victoryPointsToWin;if((0,o.Li)(b)){const e=Math.max(b,r.Zt.MIN_VP_TO_WIN);d.sZ.roomClient.setVictoryPointsToWin(e)}const C=s.cardDiscardLimit;if((0,o.Li)(C)){const e=Math.min(Math.max(C,r.Zt.MIN_CARD_DISCARD_LIMIT),r.Zt.MAX_CARD_DISCARD_LIMIT);d.sZ.roomClient.setCardDiscardLimit(e)}const P=u.readEnum(s.diceSetting,i.ZP);null!=P&&d.sZ.roomClient.setDiceType(P);const k=s.friendlyRobber;(0,o.mF)(k)&&d.sZ.roomClient.setFriendlyRobber(k);const T=u.readEnum(s.gameSpeed,i.ro);if(null!=T){const e=u.getSpeedSettingToUse(h,T);d.sZ.roomClient.setGameSpeed(e)}}static readSnapshot(){const e=l.p.getRoomSettingsSnapshotRaw();return null==e||"object"!=typeof e?null:e}static readEnum(e,t){return(0,o._k)(e,t)?e:null}static getSpeedSettingToUse(e,t){const s=n.qq.getModeDataForMode(e);if(null==s)return t;var i;const r=null!==(i=s.allowedGameTimers.find(e=>n.M1[e].isDefault))&&void 0!==i?i:s.allowedGameTimers[0];return s.allowedGameTimers.some(e=>e===t)?t:r}}},79048:(e,t,s)=>{"use strict";e.exports=s.p+"assets/prob_5.17073f845fcfa2267dd9.svg"},79080:(e,t,s)=>{"use strict";e.exports=s.p+"assets/generated_tile_gold.f79a9704ef4ae263058d.svg"},79462:(e,t,s)=>{"use strict";s.d(t,{_:()=>c});var i=s(18587),n=s(81888),r=s(655),o=s(32398),a=s(17399);class c{static init(){var e;window.useHelply&&(this.initialized?!this.isUserIdentified&&(null===(e=n._.userState)||void 0===e?void 0:e.isLoggedIn)&&this.identifyUser():this.loadIfReady())}static initForFaqPage(){var e;if(this.initialized)return this.show(),void(!this.isUserIdentified&&(null===(e=n._.userState)||void 0===e?void 0:e.isLoggedIn)&&this.identifyUser());this.loadIfReady()}static show(){var e;null===(e=this.container)||void 0===e||e.classList.remove("hidden")}static hide(){var e;null===(e=this.container)||void 0===e||e.classList.add("hidden")}static loadIfReady(){this.initialized||i.r.helplyWidgetId&&(this.initialized=!0,this.loadWidget())}static loadWidget(){const e=document.createElement("script");e.async=!0,e.setAttribute("data-agent",i.r.helplyWidgetId),e.src="https://cdn.helply.com/helply-agent.js",document.head.appendChild(e),window.addEventListener("helplyAgentLoaded",()=>{var e;this.container=document.getElementById("helply-agent-root-container"),this.injectSafeAreaStyles(),(null===(e=n._.userState)||void 0===e?void 0:e.isLoggedIn)&&this.identifyUser()})}static injectSafeAreaStyles(){var e;if(!(null===(e=this.container)||void 0===e?void 0:e.shadowRoot))return;const t=document.createElement("style"),s="max(env(safe-area-inset-top, 60px), 60px)";t.textContent=`\n ${this.BODY_SELECTOR} { top: ${s} !important; height: calc(100% - ${s}) !important; }\n [part="helply-agent-trigger"] { background-color: #ffffff !important; color: #167FDE !important; }\n `,this.container.shadowRoot.appendChild(t)}static async identifyUser(){try{var e,t,s,i,n;const a=await r.m.getRequestHandler(o.l.apiHelplyToken(),void 0,void 0,!1);if(null==(null==a||null===(e=a.json)||void 0===e?void 0:e.token))return;await(null===(t=window.helplyAgentWidget)||void 0===t?void 0:t.identify({token:a.json.token,user_metadata:a.json.user_metadata})),this.isUserIdentified=!0,null===(n=window.helplyAgentWidget)||void 0===n||n.setEscalationForm({name:null===(s=a.json.user_metadata)||void 0===s?void 0:s.username,email:null===(i=a.json.user_metadata)||void 0===i?void 0:i.email})}
1catch(e){(0,a.vV)("HelplyLoader",["Failed to identify user with Helply",e])}}}c.BODY_SELECTOR='[part="helply-agent-body"]',c.initialized=!1,c.isUserIdentified=!1,c.container=null},79824:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_merchant_blue.34deea466de9ce537dce.svg"},80003:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_hiring_ux.259e0c8c3b2b61e7e48f.png"},80232:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_sombrero.075f73b10eefaaed4aa2.svg"},80420:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_active_purple.d67ba2cdd5372a43dfa0.svg"},80641:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_dice_roll_2.16053a8fd04ea7609f96.mp3"},80708:(e,t,s)=>{"use strict";s.d(t,{CA:()=>g});var i=s(72239),n=s(36872),r=s(18587),o=s(44529),a=s(70908),c=s(81888);class l{async init(){if(!this.active)return;if(null!=this.logRocket)return;const{default:e}=await s.e(283).then(s.t.bind(s,91355,23));this.logRocket=e,await this.logRocket.init(r.r.logRocketId)}set(e){var t;if(null==this.logRocket)return;if(null==c._.userState)return;const s=c._.userState.getPlayerKarmaStatusText();s.options={...s.options,lng:"en"};const i=a.a7.t(s.key,s.options);this.logRocket.identify(e.id,{name:c._.userState.username,loggedIn:String(null===(t=c._.userState)||void 0===t?void 0:t.isLoggedIn),karmaTextStatus:i,icon:String(n.am[c._.userState.icon])})}constructor(){if(this.active=!1,this.USER_SELECTION_DENOMINATOR=1e4,""==r.r.logRocketId)return;const e=o.p.getLogRocket();if(0==e)return;const t=i.n.randomIntBetween(0,this.USER_SELECTION_DENOMINATOR);this.active=e||1==t,e||o.p.setLogRocket(this.active)}}var d=s(81431),u=s(32398),h=s(655),p=s(46581);class m{async init(){if(this.shouldRecordThisSession&&null==this.highlightController)try{const e=await s.e(117).then(s.bind(s,34946));this.highlightController=e.H}catch(e){console.error("Failed to load highlight.run",e),this.shouldRecordThisSession=!1}}async conditionallyStartRecording(e){p.p9.ColonistRush4P}async startRecording(e){var t;await this.init(),null!=this.highlightController&&(this.highlightController.init(this.APP_ID,this.RECORDER_OPTIONS),this.highlightController.identify(null===(t=c._.userState)||void 0===t?void 0:t.id,{context:e.context}))}stopRecording(){null!=this.highlightController&&this.highlightController.stop()}getShouldRecordThisSession(){if(!r.r.isProduction)return!1;return Math.random()<this.RECORDING_LIMIT_PER_MONTH/this.OUR_CURRENT_USAGE}constructor(){this.APP_ID="1epp9p7e",this.FRAME_RATE=5,this.RESOLUTION=720,this.RECORDING_LIMIT_PER_MONTH=500,this.AVG_BEGINNER_MODE_USERS_PER_MONTH=16e3,this.OUR_CURRENT_USAGE=this.AVG_BEGINNER_MODE_USERS_PER_MONTH,this.DISCORD_SCRIPT_PROXY_URL="/.proxy/highlight-static/v8.9.1/index.js",this.DISCORD_BACKEND_PROXY_URL="/.proxy/highlight-pub",this.RECORDER_OPTIONS={enableCanvasRecording:!0,samplingStrategy:{canvas:this.FRAME_RATE,canvasMaxSnapshotDimension:this.RESOLUTION},environment:r.r.isProduction?"production":"test",version:r.r.versionNumber.toString(),networkRecording:{enabled:!0,recordHeadersAndBody:!0,urlBlocklist:[]},scriptUrl:r.r.isUserOnDiscord?this.DISCORD_SCRIPT_PROXY_URL:void 0,backendUrl:r.r.isUserOnDiscord?this.DISCORD_BACKEND_PROXY_URL:void 0},this.shouldRecordThisSession=this.getShouldRecordThisSession()}}var g,f=s(55547),y=s(96990);!function(e){var t;(t=e.GoogleTagManagerEvent||(e.GoogleTagManagerEvent={})).GameStarted="game_started",t.GameFinished="game_finished",t.UserClickedLoginButton="user_clicked_login",t.PurchaseCompleted="purchase_completed";const s=new Map,i=new Set,n=Date.now().valueOf();async function o(e){r.r.analyticsActive&&((0,d.H)()||await h.m.postRequestWhenReady(u.l.apiAnalytics(),e,void 0))}e.initLogRocket=async function(){e.logRocket=new l,await e.logRocket.init()},e.initializeSessionRecorder=function(){e.sessionRecorder=new m},e.sendAnalyticEvent=o,e.sendAnalyticEventsWithMobileDimensions=async function(e){var t,s,i,n;if(!r.r.analyticsActive)return;if((0,d.H)())return;const a={isApp:r.r.isUserOnMobileAppOrWeb,isTablet:y.N.isUserOnTabletApp(),isAndroid:navigator.userAgent.includes("Android"),isPortrait:r.r.shouldDisplayNewMobileGameUI,gameType:null===f.IH||void 0===f.IH||null===(s=f.IH.gameController)||void 0===s||null===(t=s.gameSettings)||void 0===t?void 0:t.gameType,eloType:null===f.IH||void 0===f.IH||null===(n=f.IH.gameController)||void 0===n||null===(i=n.gameSettings)||void 0===i?void 0:i.eloType,...e.dimensions};await o({...e,dimensions:a})},e.sendAnalyticEventOnce=async function(e){if(null==e.floatValue&&s.has(e.type))return;if(s.has(e.type)||s.set(e.type,new Set),null==e.floatValue)return o(e);const t=s.get(e.type);return(null==t?void 0:t.has(e.floatValue))?void 0:(null==t||t.add(e.floatValue),o(e))},e.sendTimedAnalyticEventOnce=async function(e){const t=`${e.type}_${e.stringValue||""}`;if(i.has(t))return;i.add(t);const s=Date.now().valueOf();return e.floatValue=(s-n)/1e3,o(e)},e.sendGoogleTagManagerEvent=function(e){var t;
1r.r.analyticsActive&&(r.r.isUserOnDiscord||(0,d.H)()||null===(t=window.dataLayer)||void 0===t||t.push({event:e}))}}(g||(g={}))},81145:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_monopoly.dfac189aaff62e271093.svg"},81431:(e,t,s)=>{"use strict";s.d(t,{H:()=>o});var i=s(72282),n=s(72239);const r=[{browserName:"Chrome",browserVersion:"15.0.87",osName:"Linux"}];function o(){const e={browserName:i.name,browserVersion:i.version,osName:null===(t=i.os)||void 0===t?void 0:t.family};var t;for(const t of r)if(n.BF.isObjectEqual(t,e))return!0;return!1}},81665:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_robber_place.0636480d74972f958ca9.mp3"},81808:(e,t,s)=>{"use strict";s.d(t,{k:()=>c});var i=s(50482),n=s(29962),r=s(9029),o=s(56820),a=s(36872);class c extends o.M{setAnnualTabText(){const e=12*i.Zt.getMembershipProduct(a.Qb.PremiumMonthly).price,t=Math.round(100*(1-n.O.PREMIUM/e));(0,r.oB)(this.annualTab,{key:"strings:storePage.membership.frequency.annual",options:{context:"store",discount:t}})}constructor(e){super(e),this.setAnnualTabText()}}},81876:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_trade_master_merchant.ce137f115247a6cb678e.svg"},81888:(e,t,s)=>{"use strict";s.d(t,{_:()=>c});var i=s(61570),n=s(655),r=s(32398),o=s(72239),a=s(44529);class c{static isStale(){return this._stale}static get userState(){return this._userState}static get abTests(){var e;return null!==(e=this._abTests)&&void 0!==e?e:{}}static get haveAbTestsLoaded(){return null!=this._abTests}static hasUser(){return void 0!==this._userState}static async _fetchUserState(){const e=await this.fetchUserStateFromServer();return 0!=e&&(this._stale=!1,this.update(e),this.waitUntilFresh.resolve(),!0)}static async fetchUserStateFromServer(){const e=await n.m.getRequestHandler(r.l.apiUserState(),void 0);if(this._abTests=void 0,null==e)return!1;const t=e.json;return this._abTests=t.abTests,n.m.csrfToken=t.csrfToken,t.userState}static async createUser(){if(null!=this.createUserPromise)return this.createUserPromise;this.createUserPromise=(0,o.ph)();try{const e=await n.m.postRequestHandler(r.l.apiUserStateCreate(),void 0,void 0),t=null==e?void 0:e.json;return null==(null==t?void 0:t.userState)?(this.createUserPromise.resolve(!1),this.createUserPromise):(this._abTests=null==t?void 0:t.abTests,this.createUserPromise.resolve(t.userState),this.createUserPromise)}finally{this.createUserPromise=void 0}}static async requireUser(){if(null!=this.userState)return;const e=await this.createUser();if(0==e)throw new Error("Unable to create user");this.update(e)}static async refresh(){await this._fetchUserState()}static update(e){1==((null==e?void 0:e.expiresAt)&&new Date(e.expiresAt)<new Date)&&(e=void 0),null!=e?(a.p.setUserState(e),this._userState=new i.b(e)):(a.p.clearUserState(),this._userState=void 0),this.changeListeners.trigger(c._userState)}static registerChangeListener(e){return this.changeListeners.add(e,this._userState)}static registerChangeListenerWithoutCallback(e){return this.changeListeners.addWithoutCallback(e)}static async init(){return this.loadInitialStateFromStorage()?(this.initFetchLoop(),!0):this.initFetchLoop()}static loadInitialStateFromStorage(){try{const e=a.p.getUserState();return null!=e&&(this.update(e),!0)}catch{return!1}}static async initFetchLoop(){for(let e=0;e<10;e++){if(await this._fetchUserState())return!0;await(0,o.cb)(100)}return!1}}c.changeListeners=new o.gp,c._stale=!0,c.waitUntilFresh=(0,o.ph)()},81895:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_red_6.57d310132e9d3493a140.svg"},82216:(e,t,s)=>{"use strict";s.d(t,{c:()=>n});var i=s(81888);function n(){return"SHOW_MEMBER_SOCIAL_PROOF"==i._.abTests.STORE_SOCIAL_PROOF}},82535:(e,t,s)=>{"use strict";s.d(t,{B:()=>c});var i=s(92524),n=s(655),r=s(32398),o=s(9902),a=s(13618);class c{static async executeStripeColonistProductPurchaseSession(e,t,s=1){const i=`${r.l.apiPayGetStoreStripeSession()}/${e}/${t}/${s}`,o=await n.m.postRequestHandler(i,void 0,void 0);null!=o&&this.gotCheckoutSession(o.json)}static async executeStripeColonistGiftPurchaseSession(e,t){const s=i.l6.OneTimePurchase,o=`${r.l.apiPayGetStoreStripeSession()}/${s}/${e}/${t.duration}`,a=await n.m.postRequestHandler(o,void 0,t);null!=a&&this.gotCheckoutSession(a.json)}static async fetchStripePaymentClientSecret(e,t,s=1,i){const o=`${r.l.apiPayGetStripePaymentClientSecret()}/${e}/${t}/${s}`,a=await n.m.postRequestHandler(o,void 0,i);if(null!=a)return a.json}static gotCheckoutSession(e){var t;if(!e.status)return void(0,o.C)({title:{key:"strings:storePage.errors.fail"},body:e.message});const s=null===(t=e.session)||void 0===t?void 0:t.url;null!=s?(0,a.Yf)(s):(0,o.C)({title:{key:"strings:storePage.errors.fail"},body:{key:"strings:storePage.errors.fail"}})}static async executeXsollaColonistCoinPurchaseSession(e,t){const s=`${r.l.apiPayGetStoreXsollaSession()}/${e}/${t}`,i=await n.m.postRequestHandler(s,void 0,void 0);null!=i&&(0,a.Yf)(i.json)}static async executeStripeCustomerPortalSession(){const e=await n.m.postRequestHandler(r.l.apiPayCreateCustomerPortalSession(),void 0,void 0);null!=e&&(0,a.Yf)(e.json)}}},82671:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_clock_tick.c0b0debac3d7298788e7.mp3"},82969:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_4x.909cc36dddf23f72376e.svg"},83078:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_founder.c5030be56a7e8b60a995.svg"},83082:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_red_3.895fe5cb3cdd0567b824.svg"},83337:(e,t,s)=>{"use strict";e.exports=s.p+"assets/subdivisions_i.cb2eb65c31ee95290061.svg"},83476:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_message_notification.fe8a6a7ac76a97cc7ae4.mp3"},83927:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_ship_place.bce9c3babbf749b26fb7.mp3"},84029:(e,t,s)=>{"use strict";s.d(t,{m:()=>k});var i=s(28844),n=s(9029),r=s(7893),o=s(71763),a=s(76770),c=s(46507),l=s(77434),d=s(36872),u=s(60144),h=s(655),p=s(32398),m=s(18587),g=s(13618),f=s(35387),y=s(51309),v=s(55547);const S=({onClose:e})=>{const[t,s]=(0,o.useState)(null),i=(0,o.useRef)(e);i.current=e;const[n]=(0,o.useState)(()=>{const e=(0,a.A)((e,t)=>{(async()=>{const s=await h.m.postRequestHandler(p.l.apiValidateUsername(e),void 0,void 0),i=null==s?void 0:s.json;if(null!=i)if(i.containsToxicWord)t({type:"hasBadWords"});else{if(!i.isAvailable){const s=i.suggestedPostfixes.map(t=>e+t);return void t({type:"isTaken",suggestedUsernames:s})}t({type:"valid"})}else t({type:"isSame"})})()},400);return new c.W({onStateChange:s,validateUsername:t=>(e.cancel(),new Promise(s=>{e(t,s)})),submitUsernameChange:async(e,t)=>{await u.a.updateUsername(e,t)&&(v.OV.showNotification(d.am.InfoIcon,{key:"strings:homePage.header.changeUsername.confirm.notification"}),i.current({type:"ok",username:e}))},onCancel:()=>{i.current({type:"cancelled"})}})});if((0,o.useEffect)(()=>{let e=!1;return(async()=>{const t=await u.a.getUsernameChangeInfo();e||null!=t&&n.setInitialData({currentUsername:t.currentUsername,isGuest:t.isGuest,freeChangesLeft:t.usernameChangeAttemptsLeft,maxLength:t.isGuest?l.aq:l.Tk,colonistCoins:t.colonistCoins,changePrice:t.changePrice})})(),()=>{e=!0}},[n]),(0,o.useEffect)(()=>()=>n.dispose(),[n]),null==t)return null;const r=(0,f.X)(()=>n.submit()),g=(0,f.X)(()=>n.cancel()),S=(0,f.X)(()=>{i.current({type:"goToStore"}),b()}),P=(0,f.X)(()=>{n.cancel(),new y.L});return o.createElement(c.PH,{onCancel:g,input:{value:t.username,maxLength:t.maxLength,autoFocus:!m.r.isUserOnDiscordMobile,onChange:e=>n.setUsername(e)},validation:{result:t.validationResult,isValidating:t.isValidating,hasEdited:t.hasEdited},suggestions:{items:t.suggestedUsernames,onClick:e=>n.setUsername(e,!0)},usernameChange:{freeChangesLeft:t.freeChangesLeft,colonistCoins:t.colonistCoins,price:t.changePrice,changeScenario:n.getChangeScenario()},title:C(),onConfirm:r,onGoToStore:S,onLogin:P})},b=()=>{if("/store"==window.location.pathname){const e=document.getElementById("coins");return void(null==e||e.scrollIntoView({behavior:"smooth"}))}(0,g.Yf)("/store#coins",!0,!0)},C=()=>({key:"strings:homePage.header.changeUsername.title",options:{context:m.r.isUserOnDiscord?"discord":""}});let P=0;const k=e=>{const t=`change-username-dialog-container-${P}`;P+=1;const s=(0,n.Le)((0,i.getDialogRoot)(),"",t),o=(0,r.y)(t,S);let a=!1;o.render({onClose:t=>{a||(a=!0,o.unmount(),s.remove(),null==e||e(t))}})}},84192:(e,t,s)=>{"use strict";s.d(t,{z:()=>p});var i=s(16611),n=s(61114),r=s(59712),o=s(9029),a=s(70908),c=s(9511);
1class l{createTextInPost(e){this.shouldColorAndBoldUsernames&&(this.text=c.S.colorAndBoldUsernames(this.text)),this.text=c.S.replaceKeywordsWithImages(this.text),this.prefixWithUsername();const t=this.italics?" italics":"",s=(0,o.i5)(e,t,{key:"strings:colonistCommon.utils.#buffer",options:{value:this.text,interpolation:{escapeValue:!1}}});this.handleVPText(s)}prefixWithUsername(){null==this.username||this.isLog||(this.text=c.S.getHighlightedUsername(this.username)+": "+this.text)}handleVPText(e){const t=e.getElementsByClassName("vp-text")[0];null!=t&&(t.style.color=c.S.getTextColor(""+this.username,n.i.getColor(this.textColor)))}constructor(e,t,s,i){this.text=a.a7.t(t.text.key,t.text.options),this.username=t.username,this.italics=1==t.italics,this.shouldColorAndBoldUsernames=1==t.colorAndBoldUsernames,this.textColor=s,this.isLog=i,this.createTextInPost(e)}}var d=s(18587),u=s(55547);class h{createPostDiv(){const e=(0,o.Le)(this.container,"message-post","");return d.r.isUserOnMobileAppOrWeb&&d.r.shouldDisplayNewMobileGameUI||(e.style.color=this.isMessageSentInGame?n.i.getColor(this.textColorInGame):n.i.getColor(this.textColorInRoom)),(0,o.G0)(e,()=>i.A9.play(i.hc.Click)),1!=this.chatData.isCentered||(e.classList.add("victory-text"),e.style.color=c.S.getTextColor(""+this.chatData.username,n.i.getColor(this.textColorInGame))),e}setEventHandlersForHelpLinks(){const e=this.post.getElementsByTagName("a");for(const t of e){new URL(t.href).hash!=c.S.OPEN_RULEBOOK_LINK_HASH||(0,o.G0)(t,()=>{u.IH.pauseController.pauseIfSinglePlayer(),(0,r.x)()},!0,!0)}}constructor(e,t){if(this.textColorInGame=n.i.Color.Gray0,this.textColorInRoom=n.i.Color.White,this.iconSize=20,this.container=e,this.chatData=t,this.isMessageSentInGame=e.className.includes("game_chat"),this.post=this.createPostDiv(),t.profilePictureUrl){const e=(0,o.WL)(this.post,t.profilePictureUrl,{key:"strings:colonistCommon.utils.emptyString"});e.style.borderRadius="50%",e.width=this.iconSize,e.height=this.iconSize}else if(null!=t.icon){const e=(0,o.zO)(this.post,t.icon);e.width=this.iconSize,e.height=this.iconSize}const s="game-log-text"==this.container.id;new l(this.post,this.chatData,this.textColorInGame,s),this.setEventHandlersForHelpLinks()}}class p{static post(e,t,s=!1,n=!0){const r=new h(e,t);return n&&i.A9.play(i.hc.MessageNotification),s||(e.scrollTop=e.scrollHeight),r.post}}},84235:(e,t,s)=>{"use strict";s.d(t,{X:()=>g});class i{isMapPremium(){return!!this.isMapRestrictedByPremiumGameMode()||!!this.isMapRestrictedByPremiumMap()}isMapRestrictedByPremiumGameMode(){return 0!=this.premiumExpansionAccess.length}isMapRestrictedByPremiumMap(){return 0!=this.premiumMapAccess.length}getNewInstanceOfData(){return new this.constructor}}var n=s(53015),r=s(36872);class o extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.CampaignLevel1,this.name={key:"strings:colonistCommon.gameMaps.classic.tutorial4P.title"},this.image=r.am.MapClassic4PPreview,this.compatibleGameModes=[r.p9.BeginnerModeClassic4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=19,this.scenario=r.ec.None}}class a extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[n.ai.Earth],this.mapEnum=r.Qy.Earth,this.name={key:"strings:colonistCommon.gameMaps.fun.earth.title"},this.image=r.am.MapEarthPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P,r.p9.ColonistRush4P],this.includeInFreeMapRotationIfActive=!0,this.isActive=!0,this.numberOfLandTiles=81,this.scenario=r.ec.None}}class c extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[n.ai.UK],this.mapEnum=r.Qy.UK,this.name={key:"strings:colonistCommon.gameMaps.fun.uk.title"},this.image=r.am.MapUKPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P,r.p9.ColonistRush4P],this.includeInFreeMapRotationIfActive=!0,this.isActive=!0,this.numberOfLandTiles=63,this.scenario=r.ec.None}}class l extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.TradeIslands,this.name={key:"strings:colonistCommon.gameMaps.fun.tradeIslands.title"},this.image=r.am.MapTradeIslandsPreview,this.compatibleGameModes=[r.p9.Classic4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=27,this.scenario=r.ec.None}}class d extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.Istanbul,this.name={key:"strings:colonistCommon.gameMaps.fun.istanbul.title"},this.image=r.am.MapIstanbulPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=45,this.scenario=r.ec.None}}class u extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.Europe,this.name={key:"strings:colonistCommon.gameMaps.fun.europe.title"},this.image=r.am.MapEuropePreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=96,this.scenario=r.ec.None}}class h extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.MonopolyIslands,this.name={key:"strings:colonistCommon.gameMaps.fun.monopolyIslands.title"},this.image=r.am.MapMonopolyIslandsPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=49,this.scenario=r.ec.None}}var p=s(67908),m=s(72239);
1class g{static getMapDataForMap(e){for(const t of g.mapDataList)if(t.mapEnum==e)return t.getNewInstanceOfData()}static getMapName(e){var t;const s=null===(t=this.getMapDataForMap(e))||void 0===t?void 0:t.name,i={key:"strings:colonistCommon.utils.#buffer",options:{value:p.Qy[e]}};return null!=s?s:i}static getMapDataCompatibleWithGameMode(e){const t=[];for(const s of g.mapDataList)m.lv.elementInArray(s.compatibleGameModes,e)&&t.push(s);return t}static getMapDataCompatibleWithGameModes(e){const t=[];for(const s of g.mapDataList)for(const i of s.compatibleGameModes)if(m.lv.elementInArray(e,i)){t.push(s);break}return t}static isMapActive(e){for(const t of g.mapDataList)if(t.mapEnum==e)return t.isActive;return!1}}g.mapDataList=[new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.Classic4P,this.name={key:"strings:colonistCommon.gameMaps.classic.4P.title"},this.image=r.am.MapClassic4PPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P,r.p9.ColonistRush4P],this.isActive=!0,this.numberOfLandTiles=19,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.TutorialClassic4P,this.name={key:"strings:colonistCommon.gameMaps.classic.tutorial4P.title"},this.image=r.am.MapClassic4PPreview,this.compatibleGameModes=[r.p9.TutorialClassic4P,r.p9.ServerStressTestClassic4P,r.p9.BeginnerModeClassic4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=19,this.scenario=r.ec.None}},new o,new class extends o{constructor(...e){super(...e),this.mapEnum=r.Qy.CampaignLevel2}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[n.ai.Classic4PRandom],this.mapEnum=r.Qy.Classic4PRandom,this.name={key:"strings:colonistCommon.gameMaps.classic.random4P.title"},this.image=r.am.MapRandomBasePreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P,r.p9.ColonistRush4P],this.isActive=!0,this.numberOfLandTiles=19,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Classic56P,r.$y.CitiesAndKnights56P],this.premiumMapAccess=[],this.mapEnum=r.Qy.Classic56P,this.name={key:"strings:colonistCommon.gameMaps.classic.56P.title"},this.image=r.am.MapClassic56PPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P,r.p9.ColonistRush4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=30,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Classic78P],this.premiumMapAccess=[],this.mapEnum=r.Qy.Classic78P,this.name={key:"strings:colonistCommon.gameMaps.classic.78P.title"},this.image=r.am.MapClassic78PPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P,r.p9.ColonistRush4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=37,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers4P,r.$y.CitiesAndKnightsSeafarers4P],this.premiumMapAccess=[],this.mapEnum=r.Qy.SS1HeadingForNewShores3P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.headingForNewShores",options:{count:3}},this.image=r.am.MapSS1HeadingForNewShores3PPreview,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.CitiesAndKnightsSeafarers4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=22,this.scenario=r.ec.SS1HeadingForNewShores}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers4P,r.$y.CitiesAndKnightsSeafarers4P],this.premiumMapAccess=[],this.mapEnum=r.Qy.SS2FourIslands3P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.fourIslands",options:{count:3}},this.image=r.am.MapSS2FourIslands3PPreview,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.CitiesAndKnightsSeafarers4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=20,this.scenario=r.ec.SS2TheFourIslands}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers4P,r.$y.CitiesAndKnightsSeafarers4P],this.premiumMapAccess=[],this.mapEnum=r.Qy.SS3FogIslands3P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.fogIslands",options:{count:3}},this.image=r.am.MapSS3FogIslands3PPreview,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.CitiesAndKnightsSeafarers4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=24,this.scenario=r.ec.SS3TheFogIslands}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers4P,r.$y.CitiesAndKnightsSeafarers4P],this.premiumMapAccess=[],this.mapEnum=r.Qy.SS4ThroughTheDesert3P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.throughTheDesert",options:{count:3}},this.image=r.am.MapSS4ThroughTheDesert3PPreview,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.CitiesAndKnightsSeafarers4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=25,this.scenario=r.ec.SS4ThroughTheDesert}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers4P,r.$y.CitiesAndKnightsSeafarers4P],this.premiumMapAccess=[],this.mapEnum=r.Qy.SS1HeadingForNewShores4P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.headingForNewShores",options:{count:4}},this.image=r.am.MapSS1HeadingForNewShores4PPreview,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.Seafarers56P,r.p9.CitiesAndKnightsSeafarers4P,r.p9.CitiesAndKnightsSeafarers56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=28,this.scenario=r.ec.SS1HeadingForNewShores}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers4P,r.$y.CitiesAndKnightsSeafarers4P],this.premiumMapAccess=[],this.mapEnum=r.Qy.SS2FourIslands4P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.fourIslands",options:{count:4}},this.image=r.am.MapSS2FourIslands4PPreview,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.Seafarers56P,r.p9.CitiesAndKnightsSeafarers4P,r.p9.CitiesAndKnightsSeafarers56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=23,this.scenario=r.ec.SS2TheFourIslands}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers4P,r.$y.CitiesAndKnightsSeafarers4P],this.premiumMapAccess=[],this.mapEnum=r.Qy.SS3FogIslands4P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.fogIslands",options:{count:4}},this.image=r.am.MapSS3FogIslands4PPreview,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.Seafarers56P,r.p9.CitiesAndKnightsSeafarers4P,r.p9.CitiesAndKnightsSeafarers56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=27,this.scenario=r.ec.SS3TheFogIslands}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers4P,r.$y.CitiesAndKnightsSeafarers4P],this.premiumMapAccess=[],this.mapEnum=r.Qy.SS4ThroughTheDesert4P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.throughTheDesert",options:{count:4}},this.image=r.am.MapSS4ThroughTheDesert4PPreview,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.Seafarers56P,r.p9.CitiesAndKnightsSeafarers4P,r.p9.CitiesAndKnightsSeafarers56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=30,this.scenario=r.ec.SS4ThroughTheDesert}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers4P,r.$y.CitiesAndKnightsSeafarers4P],this.premiumMapAccess=[],this.mapEnum=r.Qy.TutorialSS1HeadingForNewShores4P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.tutorialHeadingForNewShores4P"},this.image=r.am.MapSS1HeadingForNewShores4PPreview,this.compatibleGameModes=[],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=28,this.scenario=r.ec.SS1HeadingForNewShores}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers4P,r.$y.CitiesAndKnightsSeafarers4P],this.premiumMapAccess=[],this.mapEnum=r.Qy.TutorialSS2FourIslands4P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.tutorialFourIslands4P"},this.image=r.am.MapSS2FourIslands4PPreview,this.compatibleGameModes=[],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=23,this.scenario=r.ec.SS2TheFourIslands}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers4P,r.$y.CitiesAndKnightsSeafarers4P],this.premiumMapAccess=[],this.mapEnum=r.Qy.TutorialSS3FogIsland4P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.tutorialFogIslands4P"},this.image=r.am.MapSS3FogIslands4PPreview,this.compatibleGameModes=[],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=27,this.scenario=r.ec.SS3TheFogIslands}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers4P,r.$y.CitiesAndKnightsSeafarers4P],this.premiumMapAccess=[],this.mapEnum=r.Qy.TutorialSS4ThroughTheDesert4P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.tutorialThroughTheDesert4P"},this.image=r.am.MapSS4ThroughTheDesert4PPreview,this.compatibleGameModes=[],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=30,this.scenario=r.ec.SS4ThroughTheDesert}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers56P,r.$y.CitiesAndKnightsSeafarers56P],this.premiumMapAccess=[],this.mapEnum=r.Qy.SS1HeadingForNewShores56P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.headingForNewShores",options:{count:6}},this.image=r.am.MapSS1HeadingForNewShores56PPreview,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.Seafarers56P,r.p9.CitiesAndKnightsSeafarers4P,r.p9.CitiesAndKnightsSeafarers56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=40,this.scenario=r.ec.SS1HeadingForNewShores}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers56P,r.$y.CitiesAndKnightsSeafarers56P],this.premiumMapAccess=[],this.mapEnum=r.Qy.SS2SixIslands56P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.sixIslands"},this.image=r.am.MapSS2SixIslands56PPreview,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.Seafarers56P,r.p9.CitiesAndKnightsSeafarers4P,r.p9.CitiesAndKnightsSeafarers56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=32,this.scenario=r.ec.SS2TheFourIslands}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers56P,r.$y.CitiesAndKnightsSeafarers56P],this.premiumMapAccess=[],this.mapEnum=r.Qy.SS3FogIslands56P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.fogIslands",options:{count:6}},this.image=r.am.MapSS3FogIslands56PPreview,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.Seafarers56P,r.p9.CitiesAndKnightsSeafarers4P,r.p9.CitiesAndKnightsSeafarers56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=39,this.scenario=r.ec.SS3TheFogIslands}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[r.$y.Seafarers56P,r.$y.CitiesAndKnightsSeafarers56P],this.premiumMapAccess=[],this.mapEnum=r.Qy.SS4ThroughTheDesert56P,this.name={key:"strings:colonistCommon.gameMaps.seafarers.throughTheDesert",options:{count:6}},this.image=r.am.MapSS4ThroughTheDesert56PPreview,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.Seafarers56P,r.p9.CitiesAndKnightsSeafarers4P,r.p9.CitiesAndKnightsSeafarers56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!0,this.numberOfLandTiles=43,this.scenario=r.ec.SS4ThroughTheDesert}},new a,new class extends a{constructor(...e){super(...e),this.mapEnum=r.Qy.EarthSeafarers,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.Seafarers56P,r.p9.CitiesAndKnightsSeafarers4P,r.p9.CitiesAndKnightsSeafarers56P],this.includeInFreeMapRotationIfActive=!1,this.numberOfLandTiles=81,this.scenario=r.ec.SS1HeadingForNewShores}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[n.ai.USA],this.mapEnum=r.Qy.USA,this.name={key:"strings:colonistCommon.gameMaps.fun.usa.title"},this.image=r.am.MapUSAPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P,r.p9.ColonistRush4P],this.includeInFreeMapRotationIfActive=!0,this.isActive=!0,this.numberOfLandTiles=144,this.scenario=r.ec.None}},new c,new class extends c{constructor(...e){super(...e),this.mapEnum=r.Qy.UKSeafarers,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.Seafarers56P,r.p9.CitiesAndKnightsSeafarers4P,r.p9.CitiesAndKnightsSeafarers56P],this.includeInFreeMapRotationIfActive=!1,this.numberOfLandTiles=63,this.scenario=r.ec.SS1HeadingForNewShores}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[n.ai.Diamond],this.mapEnum=r.Qy.Diamond,this.name={key:"strings:colonistCommon.gameMaps.fun.diamond.title"},this.image=r.am.MapDiamondPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P,r.p9.ColonistRush4P],this.includeInFreeMapRotationIfActive=!0,this.isActive=!0,this.numberOfLandTiles=24,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[n.ai.Gear],this.mapEnum=r.Qy.Gear,this.name={key:"strings:colonistCommon.gameMaps.fun.gear.title"},this.image=r.am.MapGearPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P,r.p9.ColonistRush4P],this.includeInFreeMapRotationIfActive=!0,this.isActive=!0,this.numberOfLandTiles=43,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[n.ai.Lakes],this.mapEnum=r.Qy.Lakes,this.name={key:"strings:colonistCommon.gameMaps.fun.lakes.title"},this.image=r.am.MapLakesPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P,r.p9.ColonistRush4P],this.includeInFreeMapRotationIfActive=!0,this.isActive=!0,this.numberOfLandTiles=39,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[n.ai.Pond],this.mapEnum=r.Qy.Pond,this.name={key:"strings:colonistCommon.gameMaps.fun.pond.title"},this.image=r.am.MapPondPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P,r.p9.ColonistRush4P],this.includeInFreeMapRotationIfActive=!0,this.isActive=!0,this.numberOfLandTiles=24,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[n.ai.Twirl],this.mapEnum=r.Qy.Twirl,this.name={key:"strings:colonistCommon.gameMaps.fun.twirl.title"},this.image=r.am.MapTwirlPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P,r.p9.ColonistRush4P],this.includeInFreeMapRotationIfActive=!0,this.isActive=!0,this.numberOfLandTiles=42,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[n.ai.ShuffleBoard],this.mapEnum=r.Qy.ShuffleBoard,this.name={key:"strings:colonistCommon.gameMaps.fun.shuffleBoard.title"},this.image=r.am.MapShuffleBoardPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P,r.p9.ColonistRush4P],this.includeInFreeMapRotationIfActive=!0,this.isActive=!0,this.numberOfLandTiles=25,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[n.ai.BlackForest],this.mapEnum=r.Qy.BlackForest,this.name={key:"strings:colonistCommon.gameMaps.fun.blackForest.title"},this.image=r.am.MapBlackForestP
1review,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P],this.includeInFreeMapRotationIfActive=!0,this.isActive=!0,this.numberOfLandTiles=55,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[n.ai.Volcano],this.mapEnum=r.Qy.Volcano,this.name={key:"strings:colonistCommon.gameMaps.fun.volcano.title"},this.image=r.am.MapVolcanoPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P],this.includeInFreeMapRotationIfActive=!0,this.isActive=!0,this.numberOfLandTiles=71,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.Circle,this.name={key:"strings:colonistCommon.gameMaps.fun.circle.title"},this.image=r.am.MapCirclePreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=30,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.Kite,this.name={key:"strings:colonistCommon.gameMaps.fun.kite.title"},this.image=r.am.MapKitePreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=31,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.Duel,this.name={key:"strings:colonistCommon.gameMaps.fun.duel.title"},this.image=r.am.MapDuelPreview,this.compatibleGameModes=[r.p9.Classic4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=11,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.MiniBase,this.name={key:"strings:colonistCommon.gameMaps.fun.miniBase.title"},this.image=r.am.MapMiniBasePreview,this.compatibleGameModes=[r.p9.Classic4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=14,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.KingOfTheHill,this.name={key:"strings:colonistCommon.gameMaps.fun.kingOfTheHill.title"},this.image=r.am.MapKingOfTheHillPreview,this.compatibleGameModes=[r.p9.Classic4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=26,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.MountainOfRiches,this.name={key:"strings:colonistCommon.gameMaps.fun.mountainOfRiches.title"},this.image=r.am.MapMountainOfRichesPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.CitiesAndKnights4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=24,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.Doggo,this.name={key:"strings:colonistCommon.gameMaps.fun.doggo.title"},this.image=r.am.MapDoggoPreview,this.compatibleGameModes=[r.p9.Classic4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=46,this.scenario=r.ec.None}},new l,new class extends l{constructor(...e){super(...e),this.mapEnum=r.Qy.TradeIslandsSeafarers,this.compatibleGameModes=[r.p9.Seafarers4P],this.includeInFreeMapRotationIfActive=!1,this.numberOfLandTiles=27,this.scenario=r.ec.SS1HeadingForNewShores}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.Vietnam,this.name={key:"strings:colonistCommon.gameMaps.fun.vietnam.title"},this.image=r.am.MapVietnamPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.Classic78P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=98,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.TurningTidesClassic,this.name={key:"strings:colonistCommon.gameMaps.fun.turningTidesClassic.title"},this.image=r.am.MapTurningTidesPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=77,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.TurningTidesSeafarers,this.name={key:"strings:colonistCommon.gameMaps.fun.turningTidesSeafarers.title"},this.image=r.am.MapTurningTidesPreview,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.Seafarers56P,r.p9.CitiesAndKnightsSeafarers4P,r.p9.CitiesAndKnightsSeafarers56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=54,this.scenario=r.ec.SS4ThroughTheDesert}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.TwoIsles,this.name={key:"strings:colonistCommon.gameMaps.fun.twoIsles.title"},this.image=r.am.MapTwoIslesPreview,this.compatibleGameModes=[r.p9.Classic4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=25,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.JellyFish,this.name={key:"strings:colonistCommon.gameMaps.fun.jellyFish.title"},this.image=r.am.MapJellyFishPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=30,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.Romania,this.name={key:"strings:colonistCommon.gameMaps.fun.romania.title"},this.image=r.am.MapRomaniaPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=56,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.Monopoly,this.name={key:"strings:colonistCommon.gameMaps.fun.monopoly.title"},this.image=r.am.MapMonopolyPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=19,this.scenario=r.ec.None}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[n.ai.GoldRush],this.mapEnum=r.Qy.GoldRush,this.name={key:"strings:colonistCommon.gameMaps.fun.goldRush.title"},this.image=r.am.MapGoldRushPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.Classic56P,r.p9.CitiesAndKnights4P,r.p9.CitiesAndKnights56P],this.includeInFreeMapRotationIfActive=!0,this.isActive=!0,this.numberOfLandTiles=31,this.scenario=r.ec.None}},new d,new class extends d{constructor(...e){super(...e),this.mapEnum=r.Qy.IstanbulSeafarers,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.Seafarers56P,r.p9.CitiesAndKnightsSeafarers4P,r.p9.CitiesAndKnightsSeafarers56P],this.includeInFreeMapRotationIfActive=!1,this.numberOfLandTiles=45,this.scenario=r.ec.SS1HeadingForNewShores}},new u,new class extends u{constructor(...e){super(...e),this.mapEnum=r.Qy.EuropeSeafarers,this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.Seafarers56P,r.p9.CitiesAndKnightsSeafarers4P,r.p9.CitiesAndKnightsSeafarers56P],this.includeInFreeMapRotationIfActive=!1,this.numberOfLandTiles=96,this.scenario=r.ec.SS1HeadingForNewShores}},new class extends i{constructor(...e){super(...e),this.premiumExpansionAccess=[],this.premiumMapAccess=[],this.mapEnum=r.Qy.Stripes,this.name={key:"strings:colonistCommon.gameMaps.fun.stripes.title"},this.image=r.am.MapStripesPreview,this.compatibleGameModes=[r.p9.Classic4P,r.p9.CitiesAndKnights4P],this.includeInFreeMapRotationIfActive=!1,this.isActive=!1,this.numberOfLandTiles=20,this.scenario=r.ec.None}},new h,new class extends h{constructor(...e){super(...e),this.compatibleGameModes=[r.p9.Seafarers4P,r.p9.Seafarers56P],this.mapEnum=r.Qy.MonopolyIslandsSeafarers,this.scenario=r.ec.SS1HeadingForNewShores,this.isActive=!1,this.numberOfLandTiles=43}}]},84240:(e,t,s)=>{"use strict";s.d(t,{S:()=>i});class i{constructor(){this.serverUpdated=!1}}},84317:(e,t,s)=>{"use strict";e.exports=s.p+"assets/metropolis_politics.019fa9b62312f8d45314.svg"},84324:(e,t,s)=>{"use strict";s.d(t,{i:()=>i});var i,n,r=s(72239);!function(e){e.MILLISECONDS=1e3,e.SECONDS_IN_MINUTE=60,e.SECONDS_IN_HOUR=3600,e.MINUTES_IN_HOUR=60,e.HOURS_IN_DAY=24,e.DAYS_IN_WEEK=7,e.DAYS_IN_MONTH=30,e.MONTHS_IN_YEAR=12,e.isDatePassed=function(e){return r.Re.isDatePassed(e)},e.millisecondsLeftInUTCDay=function(e){return r.Re.millisecondsLeftInUTCDay(e)},e.getDate=function(e){return r.Re.getDate(e)},e.getDateTime=function(e){return r.Re.getDateTime(e)},e.getHoursAgoInTimestampFormat=function(e){return r.Re.getHoursAgoInTimestampFormat(e)},e.convertTimestampToDateTimeText=function(e){return r.Re.convertTimestampToDateTimeText(e)},e.timeToString=function(e){return r.Re.timeToString(e)},e.timePadding=function(e){return r.Re.timePadding(e)},e.getUTCTimeString=function(e){return r.Re.getUTCTimeString(e)},e.minutesPassedSince=function(e){return r.Re.minutesPassedSince(e)},e.millisecondsPassedSince=function(e){return r.Re.millisecondsPassedSince(e)},e.isThisLastMonth=function(e,t=Date.now()){return r.Re.isThisLastMonth(e,t)},e.isThisLastYear=function(e,t=Date.now()){return r.Re.isThisLastYear(e,t)},e.yesterdayDate=function(){return r.Re.yesterdayDate()},e.getWeekNumber=function(e){return r.Re.getWeekNumber(e)}
1,e.getDaysHoursMinutesBetweenDates=function(e,t){return r.Re.getDaysHoursMinutesBetweenDates(e,t)},e.getDaysHoursMinutesBetweenDatesString=function(e,t){return r.Re.getDaysHoursMinutesBetweenDatesString(e,t)},e.getOneWeekInThePast=function(){return r.Re.getOneWeekInThePast()},e.getOneWeekInTheFuture=function(){return r.Re.getOneWeekInTheFuture()},e.adjustDateByDays=function(e,t=new Date){return r.Re.adjustDateByDays(e,t)},e.formatSecondsToElapsedString=function(e){return r.Re.formatSecondsToElapsedString(e)}}(i||(i={})),function(e){e.secondsAsMilliseconds=function(e){return r.R$.secondsAsMilliseconds(e)},e.minutesAsMilliseconds=function(e){return r.R$.minutesAsMilliseconds(e)},e.hoursAsMilliseconds=function(e){return r.R$.hoursAsMilliseconds(e)},e.daysAsMilliseconds=function(e){return r.R$.daysAsMilliseconds(e)},e.weeksAsMilliseconds=function(e){return r.R$.weeksAsMilliseconds(e)},e.minutesAsSeconds=function(e){return r.R$.minutesAsSeconds(e)},e.hoursAsSeconds=function(e){return r.R$.hoursAsSeconds(e)},e.daysAsSeconds=function(e){return r.R$.daysAsSeconds(e)},e.weeksAsSeconds=function(e){return r.R$.weeksAsSeconds(e)}}(n||(n={}))},84445:(e,t,s)=>{"use strict";s.d(t,{E8:()=>f,Hw:()=>v,Lj:()=>y,Oi:()=>h,Uf:()=>u,aE:()=>p,b4:()=>m,bl:()=>S,n5:()=>g});var i=s(18587),n=s(51309),r=s(9902),o=s(66935),a=s(81888),c=s(92524),l=s(50482),d=s(53015);function u(e){var t;(null===(t=a._.userState)||void 0===t?void 0:t.isLoggedIn)||i.r.isUserOnDiscord?e():new n.L}function h(e,t,s){const i=null==e.salePrice?e.price:e.salePrice;if(!function(e){return null!=a._.userState&&(null==a._.userState.items.colonistCoins||a._.userState.items.colonistCoins>=e)}(i)){if(s)return void s();const e=document.getElementById("coins");return void(null==e||e.scrollIntoView({behavior:"smooth"}))}const n=(0,o.dN)({key:"strings:storePage.purchaseItem?.body",options:{price:i}},{itemName:e.name});(0,r.C)({title:{key:"strings:storePage.purchaseItem?.title"},body:n,onConfirm:t,showCancelBtn:!0})}function p(e,t){(0,r.C)({title:{key:"strings:storePage.purchaseItem?.title"},body:{key:"strings:storePage.purchaseItem?.body",options:{context:"founder"}},onConfirm:t,showCancelBtn:!0})}function m(e,t){var s;(null===(s=a._.userState)||void 0===s?void 0:s.isLoggedIn)?(null==t?void 0:t.includes("#"))?(0,r.C)({title:{key:"strings:popups.errors.giftMembership.title"},body:{key:"strings:popups.errors.giftMembership.guestsCantReceiveGifts"}}):e():new n.L}function g(){var e,t;const s=null===(e=a._.userState)||void 0===e?void 0:e.items.membershipPaymentMethod;if(s==c.g5.Apple)return{key:"strings:storePage.manageMembership.body",options:{context:"updateOnAppStore"}};if(s==c.g5.Android)return{key:"strings:storePage.manageMembership.body",options:{context:"updateOnGooglePlay"}};if(s!=c.g5.Discord)return{key:"strings:storePage.manageMembership.body",options:{context:"updateOnWeb"}};const i=null===(t=a._.userState)||void 0===t?void 0:t.items.getCurrentMembership();if(null==i)throw new Error("Membership not found");return l.Zt.isAnnualMembership(i.type)?{key:"strings:storePage.manageMembership.body",options:{context:"waitForExpiration"}}:{key:"strings:storePage.manageMembership.body"}}function f(){return i.r.isUserOnDiscordMobile}function y(){(0,r.C)({title:{key:"strings:popups.unavailableOnMobile.title"},body:{key:"strings:popups.unavailableOnMobile.body"}})}function v(e){return!!i.r.isUserOnDiscord&&!(i.r.canPurchaseCoinsOnDiscord||!e)}function S(e){switch(e){case d.n9.PresalePack:return"presale";case d.n9.Expansion:return"expansions";case d.n9.Map:return"maps";case d.n9.Icon:return"avatars";case d.n9.Color:return"colors";case d.n9.Consumable:return"consumables";case d.n9.Membership:return"membership"}}},84486:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_event_science.00858cf84bdfe317154d.svg"},84832:(e,t,s)=>{"use strict";s.d(t,{p:()=>r});var i=s(76092),n=s(80708);function r(){const e={type:i.k0.ABTestClickAnalytics,category:i.eX.ABTestClickAnalytics,floatValue:i.Jd.RoomBecomeAMemberButton};n.CA.sendAnalyticEvent(e)}},85111:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_discordlogin.0215156ccf1477804f95.png"},85424:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_black.7d1ff2a9a5057982225b.svg"},85452:(e,t,s)=>{"use strict";s.d(t,{Q:()=>p});var i=s(18587),n=s(67908),r=s(70908),o=s(9029),a=s(16611),c=s(34668),l=s(22030),d=s(648),u=s(23336),h=s(71657);class p{static getDiscordCtaContent(e){const t=e.type==n.mt.ChannelStatus.Closed;return{label:this.getDiscordCtaLabel(e),onClick:()=>this.defaultMultiplayerCTAAction(t)}}static updateDiscordCTAContent(e,t){if(!i.r.isUserOnDiscord)throw new Error("This should only be called on the discord integration server");const{label:s,onClick:n}=this.getDiscordCtaContent(t);(0,o.G0)(e,n),e.innerText=r.a7.t(s.key,s.options)}static getDiscordCtaLabel(e){if(e.type==n.mt.ChannelStatus.Closed)return{key:"strings:homePage.ctas.play.title",options:{context:"discord"}};if(e.type==n.mt.ChannelStatus.Game)return{key:"strings:homePage.ctas.spectate"};if(e.type==n.mt.ChannelStatus.Reconnect)return{key:"strings:homePage.ctas.rejoinGame"};return e.playersInRoom>=e.maxPlayers?{key:"strings:homePage.ctas.roomFull"}:{key:"strings:homePage.ctas.joinRoom"}}static shouldTriggerInviteFriendsPopup(e,t){return!!e&&u.l.canOpenInviteFriendsDialog({inDiscordServer:t.inDiscordServer,canInviteFriends:t.canInviteFriends})}static defaultMultiplayerCTAAction(e){a.A9.play(a.hc.Click);const t=h.u.getDiscordInstance().voiceChannelId;c.Q.clickedJoinChannelRoomOrGame(t,l.CJ.DiscordActivity),this.shouldTriggerInviteFriendsPopup(e,h.u.getDiscordInstance())&&h.u.getDiscordInstance().sendSDKRequest(d.uC.InviteFriends)}}},85740:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_cc26_qualifier.75c05600207f911a7e82.png"},85763:(e,t,s)=>{"use strict";s.d(t,{H:()=>l});var i=s(9029),n=s(55547),r=s(46581),o=s(78134);class a{initGameSpeedSettings(){this.speedInput=this.container.querySelector("#room_center_gamespeed_settings_input"),this.speedRightArrow=this.container.querySelector("#gamespeed_settings_right_arrow"),this.speedLeftArrow=this.container.querySelector("#gamespeed_settings_left_arrow"),this.speedDivBody=this.container.querySelector("#gamespeed_settings_body"),this.speedSettings=r.ro,this.speedDefaultSetting=r.Zt.DEFAULT_GAME_SPEED_SETTING,this.speedSocketCommand=e=>n.sZ.roomClient.setGameSpeed(e)}updateOptions(e){const t=o.qq.getModeDataForMode(e.gameSetting.modeSetting);var s;this.speedOptions=null!==(s=null==t?void 0:t.allowedGameTimers)&&void 0!==s?s:[]}constructor(e){this.container=e,this.initGameSpeedSettings(),this.speedOptions=[]}}var c=s(67908);class l{get currentSetting(){return this._currentSetting}set currentSetting(e){this._currentSetting=e;const t=this.view.speedOptions.find(t=>t===e),s=null!=t?c.mt.getSpeedSettingText(t).key:"strings:colonistCommon.utils.bug";(0,i.RH)(this.view.speedInput,{key:s})}update(e){this.view.updateOptions(e),this.currentSetting=e.gameSetting.gameSpeed,this.view.container.classList.toggle("selected",this.currentSetting!=this.view.speedDefaultSetting)}load(e){this.initSpeedSettings(e)}initSpeedSettings(e){const{speedDivBody:t,speedRightArrow:s,speedLeftArrow:n,speedSocketCommand:r}=this.view;if(l.isGuest(e))return t.className="option_body guest",s.classList.toggle("hidden",!0),n.classList.toggle("hidden",!0),(0,i.G0)(s,()=>{}),void(0,i.G0)(n,()=>{});t.className="option_body",n.classList.toggle("hidden",!1),s.classList.toggle("hidden",!1),(0,i.G0)(n,()=>{const e=this.view.speedOptions;let t=e.findIndex(e=>e===this.currentSetting)-1;t<0&&(t=e.length-1),this.currentSetting=e[t],r(this.currentSetting)}),(0,i.G0)(s,()=>{const e=this.view.speedOptions;let t=e.findIndex(e=>e===this.currentSetting)+1;t>=e.length&&(t=0),this.currentSetting=e[t],r(this.currentSetting)})}updateInteractabilityOfElements(e){this.load(e)}static isGuest(e){return n.sZ.controller.session.id!=e.hostSession.userSessionId}constructor(e){this.view=new a(e),this.currentSetting=this.view.speedDefaultSetting}}},85801:(e,t,s)=>{"use strict";s.d(t,{N:()=>r,g:()=>n});var i=s(44529),n=function(e){return e[e.InGame=0]="InGame",e[e.InLobby=1]="InLobby",e[e.General=2]="General",e}({});class r{static get instance(){return null==r._instance&&(r._instance=new r),r._instance}static bindKey(e,t,s,i,n=!1,o=500){r.instance.bindKey(e,t,s,i,o,n)}onKeyDown(e,t){if(function(){const e=document.activeElement;return"INPUT"==e.nodeName&&"text"==e.type}())return;if(!this.areKeyBindsEnabled)return;const s=Date.now();for(const n of this.keyBinds){const{keyboardEventCode:r,onTrigger:o,isListening:a,shortcutLocation:c,withShift:l}=n,d=!0===i.p.getKeyboardShortcuts();if(0===c&&!d)continue;if(r!=e)continue;if(l&&!t)continue;if(t&&!l)continue;if(0==a())continue;const u=s-this.lastUnixTimeEachKeyWasPressed[r];u<n.minWaitBetweenSameKeyPressInMilliseconds&&0!=u||(this.lastUnixTimeEachKeyWasPressed[e]=s,o())}}bindKey(e,t,s,i,n,r=!1){const o={keyboardEventCode:e,onTrigger:t,isListening:s,shortcutLocation:i,minWaitBetweenSameKeyPressInMilliseconds:n,withShift:r};this.keyBinds.push(o)}clearAllKeyBinds(){this.keyBinds=[]}disableKeyBindings(){this.areKeyBindsEnabled=!1}enableKeyBindings(){this.areKeyBindsEnabled=!0}constructor(){this.keyBinds=[],this.lastUnixTimeEachKeyWasPressed={},this.onKeyDownListener=e=>this.onKeyDown(e.code,e.shiftKey),document.addEventListener("keydown",this.onKeyDownListener),this.areKeyBindsEnabled=!0}}},85877:(e,t,s)=>{"use strict";e.exports=s.p+"assets/subdivisions_iv.e3f34d15c97b25f5d6ad.svg"},85919:(e,t,s)=>{"use strict";e.exports=s.p+"assets/settlement_blue.bad4cdb43d65c329deda.svg"},86020:(e,t,s)=>{"use strict";s.d(t,{N:()=>i});class i{}},86421:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_easter.dd3a8c8725f7ebce318f.png"},86464:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_5.e2e4c9085fa4a5ed783a.svg"},86717:(e,t,s)=>{"use strict";e.exports=s.p+"assets/prob_8.ca0de6260ba265cc479f.svg"},87069:(e,t,s)=>{"use strict";s.d(t,{O:()=>r});const i=3e3;function n(e){"function"!=typeof window.requestIdleCallback?e():window.requestIdleCallback(e,{timeout:i})}function r(e){"complete"!=document.readyState?window.addEventListener("load",()=>n(e),{once:!0}):n(e)}},87220:(e,t,s)=>{"use strict";s.d(t,{Ak:()=>l,FI:()=>c,Fc:()=>u,KV:()=>a,qe:()=>
1o,t3:()=>h});var i=s(76092),n=s(32398),r=s(655);const o="action";async function a(e){const t=c(e),s=await r.m.getRequestHandler(t,void 0),i=null==s?void 0:s.json.data;if(void 0===i)throw new Error("Missing replayData");return i}function c(e){const t=l(e);if(void 0!==t)return n.l.apiReplayDataFromSlug(t);const s=d(e),i=function(e){const t=new URL(e),s=t.searchParams.get("playerColor");return null===s?void 0:Number(s)}(e);if(void 0!==s&&void 0!==i)return n.l.apiReplayDataFromGameId(s,i);throw new Error("Missing replayUrlSlug and replayUrlGameId")}function l(e){const t=e.match(/https?:\/\/[^/]+(?:\/[^/]+)*\/replay\/([^/?]+)/);if(void 0!==(null==t?void 0:t[1]))return t[1]}function d(e){const t=new URL(e).searchParams.get("gameId");if(null!==t)return t}function u(e){const t=new URL(e).searchParams.get(o);if(null===t)return-1;const s=Number(t);return Number.isInteger(s)?s<0?-1:s:-1}function h(e){return void 0!==l(e)?i.x.ShareableLink:void 0!==d(e)?i.x.DirectLink:i.x.EndGame}},87239:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_discord.a403d24bdc8a66f840c9.svg"},87283:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_offer_accepted.1db63c4d77a3569babd7.mp3"},87290:(e,t,s)=>{"use strict";s.d(t,{KY:()=>c,Yt:()=>a,ie:()=>o,os:()=>r});s(66935);var i=s(72239),n=s(22194);const r=n.os;function o(e){return{key:`strings:leaderboardPage.rankedDivision.${i.h4.getEnumKey(e,r)}`}}const a=n.Yt;var c=function(e){return e.Global="Global",e.Continent="Continent",e.Country="Country",e.CountryRegion="Country_Region",e.Friends="Friends",e}({})},87321:(e,t,s)=>{"use strict";s.d(t,{e:()=>a});var i=s(67908),n=s(45973),r=s(87290),o=s(90429);class a{subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getState(){return this.state}async init(){if(null!=this.initPromise)return this.initPromise;this.initPromise=this.performInit();try{await this.initPromise}catch(e){throw this.initPromise=void 0,e}}async performInit(){if(this.parseStateFromUrl){const e=(0,o.U)(this.deps.getCurrentUrl());this.updateState(e)}this.deps.updateBrowserTitle(this.state.rankedModeType,this.state.leaderboardUrl),this.unsubscribePopState=this.deps.subscribePopState(e=>{this.handlePopState(e)}),await Promise.all([this.fetchNewTabs(),this.fetchMyStickyRowData(),this.fetchScrollOrSearch()])}dispose(){var e;null===(e=this.unsubscribePopState)||void 0===e||e.call(this),this.unsubscribePopState=void 0,this.initPromise=void 0}async changeRankedMode(e){await this.switchRankingCategoryTypeData(e,this.state.leaderboardUrl,this.state.searchTerm,!0),await this.fetchMyStickyRowData()}async changeLeaderboardUrl(e){await this.switchRankingCategoryTypeData(this.state.rankedModeType,e,this.state.searchTerm,!0),await Promise.all([this.fetchNewTabs(),this.fetchMyStickyRowData()])}async changeSearch(e){await this.switchRankingCategoryTypeData(this.state.rankedModeType,this.state.leaderboardUrl,e,!0),await this.fetchMyStickyRowData()}async fetchMoreData(){await this.fetchScrollData()}getMyRowData(){const e=this.state.myStickyRowData;if(null==e)return;const t=this.state.searchTerm!=n.B.emptyUsernameSearch,s=this.state.leaderboardUrl==r.KY.Friends;if(t||s){const t=this.state.rowData.findIndex(e=>e.myData);if(t<0)return;return{index:t,data:e}}return{index:e.rank==n.B.emptyRank?1/0:e.rank-1,data:e}}async switchRankingCategoryTypeData(e,t,s,i){if(this.updateState({rankedModeType:e,leaderboardUrl:t,searchTerm:s,rowData:[],moreDataAvailable:!0,noFriendsEmpty:!1}),i){const i=this.buildUrl(e,t,s);this.deps.pushHistoryState({rankedModeType:e,leaderboardUrl:t,searchTerm:s},i)}this.deps.updateBrowserTitle(e,t),this.fetchEpoch+=1,this.isLoadingDataAfterScroll=!1,await this.fetchScrollOrSearch()}async fetchScrollOrSearch(){this.state.searchTerm==n.B.emptyUsernameSearch?await this.fetchScrollData():await this.fetchSearchData()}maskMembership(e){return this.hideMembership?{...e,membershipType:void 0}:e}buildUrl(e,t,s){const r=s==n.B.emptyUsernameSearch?"":`?q=${encodeURIComponent(s)}`,o=t?`/${t}`:"";return`${this.deps.getLanguagePathPrefix()}/leaderboards/${i.Wz[e]}${o}${r}`}async fetchScrollData(){if(this.state.searchTerm!=n.B.emptyUsernameSearch&&this.state.rowData.length>0)return;if(this.isLoadingDataAfterScroll)return;this.isLoadingDataAfterScroll=!0;
1const e=this.fetchEpoch,t=this.state.rowData.length+1,s=t+n.B.maximumLeaderboardAPIRankingRangeLimit-1,i=await this.deps.requestScrollData(this.state.rankedModeType,this.state.leaderboardUrl,t,s,this.state.searchTerm);if(e!=this.fetchEpoch)return;if(this.isLoadingDataAfterScroll=!1,null==i)return;const o=this.state.leaderboardUrl==r.KY.Friends,a=0==i.length&&0==this.state.rowData.length;o&&a?this.updateState({noFriendsEmpty:!0,moreDataAvailable:!1}):0!=i.length?this.isReturnedDataInValidOrder(i)?this.updateState({rowData:[...this.state.rowData,...i.map(e=>this.maskMembership(e))],moreDataAvailable:i.length==n.B.maximumLeaderboardAPIRankingRangeLimit}):await this.fetchScrollData():this.updateState({moreDataAvailable:!1})}isReturnedDataInValidOrder(e){if(this.state.leaderboardUrl==r.KY.Friends)return!0;return e[0].rank==this.state.rowData.length+1}async fetchSearchData(){const e=this.fetchEpoch,t=await this.deps.requestSearchData(this.state.rankedModeType,this.state.leaderboardUrl,this.state.searchTerm);e==this.fetchEpoch&&null!=t&&this.updateState({rowData:t.map(e=>this.maskMembership(e)),moreDataAvailable:!1})}async fetchNewTabs(){const e=await this.deps.requestTabs(this.state.leaderboardUrl);null!=e&&this.updateState({tableTabs:e.tableTabs,enabledTabIds:e.activeRankedModeTypes.map(e=>i.Wz[e]),seasonStartDate:null!=e.activeSeasonData?new Date(e.activeSeasonData.startDate):void 0,seasonEndDate:null!=e.activeSeasonData?new Date(e.activeSeasonData.endDate):void 0})}async fetchMyStickyRowData(){const e=await this.deps.requestStickyRow(this.state.rankedModeType,this.state.leaderboardUrl);this.updateState({myStickyRowData:null!=e?this.maskMembership(e):void 0})}async handlePopState(e){if(null==e){const e=(0,o.U)(this.deps.getCurrentUrl());var t,s,i;return void await this.switchRankingCategoryTypeData(null!==(t=e.rankedModeType)&&void 0!==t?t:this.state.rankedModeType,null!==(s=e.leaderboardUrl)&&void 0!==s?s:this.state.leaderboardUrl,null!==(i=e.searchTerm)&&void 0!==i?i:this.state.searchTerm,!1)}await this.switchRankingCategoryTypeData(e.rankedModeType,e.leaderboardUrl,e.searchTerm,!1)}updateState(e){this.state={...this.state,...e};for(const e of this.listeners)e(this.state)}constructor(e,t={}){var s,r;this.listeners=new Set,this.isLoadingDataAfterScroll=!1,this.fetchEpoch=0,this.deps=e,this.hideMembership=null!==(s=t.hideMembership)&&void 0!==s&&s,this.state={rankedModeType:i.Wz.Classic4P,leaderboardUrl:n.B.globalLeaderboardUrl,searchTerm:"",tableTabs:[],enabledTabIds:[],rowData:[],myStickyRowData:void 0,moreDataAvailable:!0,noFriendsEmpty:!1,seasonStartDate:void 0,seasonEndDate:void 0,...t.initialState},this.parseStateFromUrl=null!==(r=t.parseStateFromUrl)&&void 0!==r&&r}}},87354:(e,t,s)=>{"use strict";e.exports=s.p+"assets/road_bronze.c12f42e2d39817ec4346.svg"},87506:(e,t,s)=>{"use strict";s.d(t,{O:()=>o});var i=s(55547),n=s(36872),r=s(24674);class o{static sendFindGame(){null!=this.lastRequestedQueue&&i.sZ.matchmakingClient.joinQueue(this.lastRequestedQueue,n.$m)}static enterMatchmaker(e,t=!0){this.lastRequestedQueue=e,this.clearDelayMatchmakingTimeout(),t?this.delayMatchmakingTimeout=setTimeout(()=>{this.sendFindGameAfterEngineReady()},this.matchmakingRequestDelayMs):this.sendFindGameAfterEngineReady()}static async sendFindGameAfterEngineReady(){await r.c.ensureReady(),this.sendFindGame()}static storeMatchmakingRequest(e){this.lastRequestedQueue=e,this.clearDelayMatchmakingTimeout()}static sendCancelFindGame(){this.lastRequestedQueue=void 0,this.clearDelayMatchmakingTimeout(),i.sZ.matchmakingClient.leaveCurrentQueue()}static clearDelayMatchmakingTimeout(){clearTimeout(this.delayMatchmakingTimeout),this.delayMatchmakingTimeout=void 0}}o.matchmakingRequestDelayMs=1e3},87541:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_orange.f49c8fb13a589f8d0c68.svg"},87542:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_offer_not_acceptable.d7ca1b7b5f9dc94c6ec5.mp3"},87770:(e,t,s)=>{"use strict";s.d(t,{w:()=>a});var i=s(46507),n=s(11445),r=s(13618);const o=(0,n.K)(i.rn);function a(){o({onConfirm:()=>(0,r.Yf)("/faq",!1,!0)})}},87868:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_dice_roll_3.61bd4619a24415ce2725.mp3"},87887:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_longest_road_highlight.50dc66b851ecee9a8662.svg"},87952:(e,t,s)=>{"use strict";s.d(t,{Jg:()=>c,Qc:()=>l,rd:()=>a});var i=s(63359);
1if(517!=s.j)var n=s(66710);const r=i.auy.number().int().nonnegative(),o="At least one entry must be provided";function a(e,t){const s=i.g1P(r,e);return(null==t?void 0:t.requireAtLeastOneEntry)?s.refine(e=>Object.keys(e).length>0,{message:o}):s}function c(e,t){const s=i.g1P(n.j,e);return(null==t?void 0:t.requireAtLeastOneEntry)?s.refine(e=>Object.keys(e).length>0,{message:o}):s}function l(e,t,s){const n={};e.forEach(e=>{n[e]=t.exactOptional()});const r=i.Ikc(n).strict();return(null==s?void 0:s.requireAtLeastOneEntry)?r.refine(e=>Object.keys(e).length>0,{message:o}):r}},88112:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_merchant_pink.a7c02ca492c1d55bebd6.svg"},88225:(e,t,s)=>{"use strict";s.d(t,{A:()=>h});var i=s(71763),n=s(46507),r=s(70908),o=s(655),a=s(32398),c=s(55547),l=s(44517);const d=e=>{const t=[];for(const s of e){const e=r.vX.getCountryName(s.countryCode);null!=e&&t.push({continentCode:s.continentCode,continentName:r.a7.t(`strings:leaderboardPage.tabs.continents.${s.continentCode}`),countryCode:s.countryCode,countryName:e,regionCode:s.regionCode,regionName:s.regionName})}return t},u=async(e,t)=>{const s={continentCode:""===e.continentCode?void 0:e.continentCode,countryCode:""===e.countryCode?void 0:e.countryCode,stateCode:""===e.regionCode?void 0:e.regionCode},i=await o.m.postRequestHandler(a.l.apiChangeRegion(),void 0,s);null!=i&&i.isSuccess&&t()};const h=(0,s(11445).K)(({onClose:e})=>{const[t,s]=(0,i.useState)(void 0),[r,h]=(0,i.useState)("form");(0,i.useEffect)(()=>{void 0===t&&(async()=>{const e=await o.m.getRequestHandler(a.l.apiGetRegions());if(null==(null==e?void 0:e.json))return;const{regions:t}=e.json;s(d(t))})()},[t]);const p=()=>{window.location.reload(),c.i0.sendEvent(l.s.ReloadWebsite)};return"success"==r?i.createElement(n.mM,{onConfirm:p}):i.createElement(n.Ng,{loading:void 0===t,regions:null!=t?t:[],onCancel:e,onSubmit:e=>{u(e,()=>h("success"))}})})},88429:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_gold.ae8ea43a6dc22d3aace7.svg"},88478:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_event_barbarian.7e94f122cb8dd1d3bd98.svg"},88758:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ship_purple_north_west.fa25519831b07b63a916.svg"},88834:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_inactive_silver.8c3ce55cafdeed369416.svg"},88949:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_bottom_cc26_qualifier.bbec6ad1e1be93fe3fc7.png"},89010:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_player_loggedin.0269225ae4f7db8480ca.svg"},89100:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_stripes_preview.1dedd5259d159ebe37e2.png"},89173:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_merchant_green.6bf7c73ffc7e3eded03b.svg"},89179:(e,t,s)=>{"use strict";e.exports=s.p+"assets/knight_level1_active_green.9ac96ee394a4f651d137.svg"},89449:(e,t,s)=>{"use strict";e.exports=s.p+"assets/lobby_ad_rush_4_player_10_min.42d17e434b21b57404b3.svg"},89483:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_knight_upgrade.a8d6b3cf7c071b167732.mp3"},89544:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_defender.479f0f4f6cbd89ba9cf8.svg"},89546:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_ck_ranked.e5b272dbdf22120ac12b.png"},89569:(e,t,s)=>{"use strict";s.d(t,{x:()=>c});var i=s(16611),n=s(81888),r=s(46507);const o=(0,s(11445).K)(r.mb);var a=s(13618);function c({onCreateRoom:e,onJoinRoom:t,useDiscordCta:s}){const r=(0,a.BA)(async()=>{i.A9.play(i.hc.JoinRoom),await n._.requireUser(),await e()}),c=(0,a.BA)(()=>{o({onJoin:e=>{t(e)}})});return s?{onClickPlayWithFriends:()=>{c()}}:{onClickCreateRoom:()=>{r()},onClickJoinRoom:()=>{c()}}}},89844:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_bot.551858c518b9f2f8357a.svg"},89878:(e,t,s)=>{"use strict";s.d(t,{aU:()=>o,kV:()=>a});var i=s(46581),n=s(78134);const r=5;function o(e,t){const s=c(e,t);return 1==s||2==s}function a(e,t){return 0==c(e,t)}function c(e,t){return function(e){if(null==e)return!1;const t=n.qq.getModeDataForMode(i.p9.CitiesAndKnights4P);return null!=t&&(null!=e.membership||!!e.hasAccessToPremiumMode(t))}(e)?1:function(e){return null!=e&&e<r}(t)?2:0}},89941:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_red_4.6c02858d953864c2c9cf.svg"},90051:(e,t,s)=>{"use strict";s.d(t,{K:()=>n});var i=s(16611);
1class n{addNotificationsToPanel(e){this.notificationPanel.addNotifications(e.notifications),this.notificationPanel.displayNumberOfUnreadNotifications(e.unreadNotificationCount),e.isExistingNotifications||i.A9.play(i.hc.RoomSettingUpdated)}markNotificationAsRead(e){return this.notificationPanel.displayNumberOfUnreadNotifications(e.unreadNotificationCount),e.markAllAsRead?this.notificationPanel.markAllNotificationsAsRead():e.notificationMarkedAsRead?this.notificationPanel.markNotificationAsRead(e.notificationMarkedAsRead.id):void 0}constructor(e){this.notificationPanel=e}}},90272:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_eye.fb4c25c86efbc2143a66.svg"},90407:(e,t,s)=>{"use strict";s.d(t,{z:()=>h});var i=s(46507),n=s(36872),r=s(11445),o=s(76092),a=s(80708),c=s(18587),l=s(50482),d=s(55547);const u=(0,r.K)(i.af);function h(e,t){const s=c.r.isUserOnDiscord?l.Zt.getMembershipProduct(n.Qb.PremiumMonthly).getDefaultPrice():void 0;u({type:e,price:s,onConfirm:()=>{d.P_.premiumMembershipCheckAction(),function(e){const t={type:o.k0.ABTestClickAnalytics,category:o.eX.ABTestClickAnalytics,floatValue:e};a.CA.sendAnalyticEvent(t)}(t)}})}},90429:(e,t,s)=>{"use strict";s.d(t,{U:()=>o});var i=s(72239),n=s(67908),r=s(45973);function o(e){const[t]=e.split("#"),[s,o]=t.split("?"),a=s.split("/"),c=a.indexOf("leaderboards");if(c<0)return{};const l={},d=i.h4.getEnumValue(a[c+1],n.Wz);null!=d&&(l.rankedModeType=d);const u=a.slice(c+2).join("/");l.leaderboardUrl=u||r.B.globalLeaderboardUrl;const h=new URLSearchParams(null!=o?o:"");var p;return l.searchTerm=null!==(p=h.get("q"))&&void 0!==p?p:"",l}},90676:(e,t,s)=>{"use strict";if(s.d(t,{Dc:()=>m,iy:()=>f,vy:()=>g,w7:()=>y}),!/^(51|83)7$/.test(s.j))var i=s(71494);var n=s(9029),r=(s(70908),s(96990));let o=null,a=null,c=null,l=null,d=null,u="bottom";const h=[".scene_room_left",".scene_room_mid",".scene_room_right"].map(e=>document.querySelector(e)).filter(Boolean),p=r.N.isUserOnSafariOrIOS();function m(){!function(){if(null!=document.getElementById("tooltip"))return;a=document.createElement("div"),a.className="floating-tooltip",c=(0,n.Le)(a,"floating-tooltip-arrow"),d=(0,n.Le)(a,"tooltip-content"),document.body.appendChild(a)}(),document.querySelectorAll("[data-tooltip]").forEach(e=>{e instanceof HTMLElement&&v(e)})}function g(e,t,s,i,r){var o;const a="strings:colonistCommon.utils.#buffer"===t.key?null===(o=t.options)||void 0===o?void 0:o.value:(0,n.Tl)(t.key,t.options);e.setAttribute("data-tooltip",a),null!=s&&e.setAttribute("data-tooltip-position",s),null!=r&&e.setAttribute("data-tooltip-width",r),null!=i&&e.setAttribute("data-tooltip-fontsize",i),v(e)}function f(e,t){var s;const i="strings:colonistCommon.utils.#buffer"===t.key?null===(s=t.options)||void 0===s?void 0:s.value:(0,n.Tl)(t.key,t.options);e.setAttribute("data-tooltip",i)}function y(){null!=a&&(a.classList.remove("visible"),l=null,o&&(o(),o=null))}function v(e){e.hasAttribute("data-tooltip-listeners")||(e.addEventListener("mouseover",t=>{"true"!==e.getAttribute("data-tooltip-hidden")&&function(e){if(null==a)return;if(null==d)return;if(!function(e){if(!p)return!0;return!h.some(e=>"1"!==window.getComputedStyle(e).zoom)||!h.some(t=>t.contains(e))}(e))return;l=e,u=function(e){const t=e.getAttribute("data-tooltip-position");return["top","top-start","top-end","bottom","bottom-start","bottom-end","right","right-start","right-end","left","left-start","left-end"].includes(t)?t:"bottom"}(e),(0,n.RH)(d,{key:"strings:colonistCommon.utils.emptyString"});const t=e.getAttribute("data-tooltip-list");if(t)try{!function(e){if(null==d)return;(0,n.n8)(d,{key:"strings:colonistCommon.utils.#buffer",options:{value:e.listTitle}},"tooltip-list-title",void 0,"H4");const t=(0,n.uk)(d,"tooltip-list");e.list.forEach(e=>{(0,n.t2)(t,{key:"strings:colonistCommon.utils.#buffer",options:{value:e}},"")})}(JSON.parse(t))}catch(e){d.innerText="Error displaying tooltip"}else{const t=e.getAttribute("data-tooltip");if(null==t)return;d.innerText=t}a.style.maxWidth=function(e){const t=e.getAttribute("data-tooltip-width");switch(["small","medium","large"].includes(t)?t:"medium"){case"small":return"112px";case"medium":return"224px";case"large":return"304px"}}(e),a.style.padding=function(e){switch(S(e)){case"small":return"4px";case"medium":return"8px"}}(e),d.style.fontSize=function(e){switch(S(e)){case"small":return"10px";case"medium":return"12px"}}(e),a.classList.add("visible"),async function(){if(null==a)return;if(null==l)return;o&&o();o=(0,i.ll)(l,a,async()=>{try{var e;if(null==a)return;if(null==c)return;if(null==l)return;const t=8,s={placement:u,middleware:[(0,i.cY)(t),(0,i.UU)({padding:t}),(0,i.BN)({padding:t}),(0,i.UE)({element:c}),(0,i.jD)()]},n=await(0,i.rD)(l,a,s),{x:r,y:o,placement:d,middlewareData:h}=n;
1if(null===(e=h.hide)||void 0===e?void 0:e.referenceHidden)return void y();if((()=>{null!=a&&Object.assign(a.style,{left:`${r}px`,top:`${o}px`})})(),null==h.arrow)return;const{x:p,y:m}=h.arrow,g={top:"bottom",right:"left",bottom:"top",left:"right"}[d.split("-")[0]];if(null==g)return;(()=>{null!=c&&Object.assign(c.style,{left:null!=p?`${p}px`:"",top:null!=m?`${m}px`:"",right:"",bottom:"",[g]:"-4px"})})()}catch(e){return}})}()}(e)}),e.addEventListener("mouseout",e=>{y()}),e.setAttribute("data-tooltip-listeners","true"))}function S(e){const t=e.getAttribute("data-tooltip-fontsize");return["small","medium"].includes(t)?t:"medium"}},90712:(e,t,s)=>{"use strict";e.exports=s.p+"assets/bank.825b2690b4b1b694d646.svg"},90872:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_replay.e1976b11819bc0794f50.svg"},90878:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_merchant_gold.e8adb5c1af7f4016b494.svg"},91082:(e,t,s)=>{"use strict";e.exports=s.p+"assets/gif_remove_ads_boxedshape_gold.f13b62439a01b6f60113.gif"},91190:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_politics_wedding.2c9f495b42607cdf48b1.svg"},91265:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_city_improvement.13c4b06a6bf61ca39459.mp3"},91456:(e,t,s)=>{"use strict";e.exports=s.p+"assets/store_item_cities_and_knights.91c3b808c79eca8f97b1.png"},91531:(e,t,s)=>{"use strict";function i(e){return{key:"strings:colonistCommon.utils.#buffer",options:{value:e}}}s.d(t,{C:()=>i})},91678:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_first_reminder.de262110f332233e6bab.mp3"},91767:(e,t,s)=>{"use strict";e.exports=s.p+"assets/map_usa_preview.0680565e23a86c6cb450.png"},91933:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ab_mobileapp.eb62d819a5f37aee44ff.png"},92469:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_achievement_largest_army.ae919f6488a4e63c52fe.mp3"},92524:(e,t,s)=>{"use strict";s.d(t,{g5:()=>i,hg:()=>r,l6:()=>n});s(64265),s(50482),s(17972);var i=function(e){return e[e.Stripe=0]="Stripe",e[e.Xsolla=1]="Xsolla",e[e.Discord=2]="Discord",e[e.None=3]="None",e[e.Apple=4]="Apple",e[e.Android=5]="Android",e}({}),n=function(e){return e[e.Coin=0]="Coin",e[e.Membership=1]="Membership",e[e.OneTimePurchase=2]="OneTimePurchase",e}({}),r=function(e){return e.Payment="payment",e.Subscription="subscription",e}({})},92626:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_colonist.1a9af14f55d4ab1dae1f.svg"},92712:(e,t,s)=>{"use strict";e.exports=s.p+"assets/dice_red_1.7d2c41c4365b430c7d20.svg"},93047:(e,t,s)=>{"use strict";e.exports=s.p+"assets/gif_remove_ads_hexedshape_desert.47ff3ecb4bf8dc83fced.gif"},93189:(e,t,s)=>{"use strict";e.exports=s.p+"assets/road_silver.7408c660e9b9bbc3d29d.svg"},93291:(e,t,s)=>{"use strict";s.d(t,{S:()=>r});var i=s(76092),n=s(80708);function r(e){const t={type:i.k0.StoreTabsClicked,category:i.eX.Store,stringValue:e};n.CA.sendAnalyticEvent(t)}},93359:(e,t,s)=>{"use strict";s.d(t,{L:()=>f});var i=s(66935),n=s(36872),r=s(78134),o=s(46581),a=s(67908),c=s(84235),l=s(50482),d=s(17399),u=s(72046);function h(e){var t;const s=e.modePlayable?e.gameModeSetting:a.p9.Classic4P;var n;return null!==(n=null===(t=r.qq.getModeDataForMode(s))||void 0===t?void 0:t.name)&&void 0!==n?n:i.hs}function p(e){var t;const s=e.modePlayable?e.gameModeSetting:a.p9.Classic4P,r=e.mapPlayable?e.gameMapSetting:(0,n.sP)(s);var o;return null!==(o=null===(t=c.X.getMapDataForMap(r))||void 0===t?void 0:t.name)&&void 0!==o?o:i.hs}function m(e){if(null!=e.karmaCompletedGames&&null!=e.karmaTotalGames)return{key:"strings:homePage.header.playerKarma",options:{totalCompleted:e.karmaCompletedGames,totalGames:e.karmaTotalGames}}}function g(e){const t=null==e.membership?void 0:l.Zt.getMembershipProduct(e.membership);return{username:e.username,avatar:(0,d.lx)(e.icon),isBot:e.isBot,membershipIcon:null==t?void 0:(0,d.lx)(t.lobbyImage),karmaText:m(e),onClick:e.isBot?void 0:()=>u.x.init(e.username)}}function f(e,t={}){const{isUnavailable:s=!1,userKarma:i}=t,n=null!=i&&i<e.minimumKarma;return{id:e.id,modeText:h(e),mapText:p(e),speedText:a.mt.getSpeedSettingText(e.speed),isNoTrolls:(r=e.minimumKarma,r==o.Zt.NO_TROLLS_KARMA_THRESHOLD),players:e.players.map(g),maxPlayers:e.maxPlayers,isUnavailable:s||n};var r}},93581:(e,t,s)=>{"use strict";s.d(t,{N:()=>k}
1);var i=s(46507),n=s(9029),r=s(16611);class o{createDropdownContent(e){this.dropdownView.replaceChildren(),e.forEach(e=>{this.createDropdownContentElement(e)})}createDropdownContentElement(e){const t=(0,n.Le)(this.dropdownView,"",e.id);null!=e.icon&&(0,n.zO)(t,e.icon),(0,n.Wr)(t,e.text,e.class),(0,n.G0)(t,()=>{e.class.includes("component-dropdown-disabled")||(null!=e.action&&e.action(),this.hideDropdownMenuIfShown())},!0)}dropdownButtonAction(){r.A9.play(r.hc.Click),this.dropdownView.classList.toggle("show")}hideDropdownMenuIfShown(){this.dropdownView.classList.contains("show")&&this.dropdownView.classList.toggle("show")}updateDropdownState(e){var t;null!=(null===(t=this.dropdownView)||void 0===t?void 0:t.replaceChildren)&&(this.dropdownView.replaceChildren(),this.createDropdownContent(e))}constructor(e,t,s,i){const r=document.getElementsByClassName("component-dropdown-container");for(const e of r){e.parentElement.id==t&&(this.dropdownContainer=e,this.dropdownButton=i,this.dropdownView=this.dropdownContainer.children[1])}s?this.dropdownContainer.style.display="none":(this.dropdownContainer.style.display="inline-block",null!=this.dropdownButton&&null!=this.dropdownView&&(this.createDropdownContent(e),(0,n.G0)(this.dropdownButton,e=>{const t=e.target;this.dropdownView.contains(t)||this.dropdownButtonAction()}),document.addEventListener("pointerdown",e=>{const t=e.target,s=this.dropdownContainer.contains(t),n=i.contains(t);s||n||this.hideDropdownMenuIfShown()})))}}var a=s(74369),c=s(76092),l=s(655),d=s(32398),u=s(80708),h=s(84445),p=s(72239),m=s(13618),g=s(76349),f=s(18587),y=s(7893),v=s(72046);class S{render(){null==this.view&&(this.view=(0,y.y)("profile-friends-tab",i.ZS)),this.view.render({friends:this.buildFriendRows(),requests:structuredClone([...g.v.state.friendRequestsReceived]),sentRequests:structuredClone([...g.v.state.friendRequestsSent]),onUserClick:(e,t)=>v.x.init(t),onGiftClick:(e,t)=>S.onGiftClick(t),onAccept:(e,t)=>
1S.onAccept(e,t),onDecline:(e,t)=>S.onDecline(e,t),onCancel:e=>{this.onCancel(e)}})}buildFriendRows(){const e=[...g.v.state.friends].sort((e,t)=>{const s=S.getFriendLastOnlineTime(e.onlineStatus);return S.getFriendLastOnlineTime(t.onlineStatus)>s?1:-1}),t=!f.r.isUserOnDiscordMobile&&!f.r.shouldHideStoreOnMobile;return e.map(e=>{const s=e.onlineStatus;return{userId:e.userId,username:e.username,statusText:S.getStatusText(s),activityText:(0,a.Q)(s.activity),showGift:t}})}static onAccept(e,t){g.v.respondToFriendRequest({userId:e,username:t},!0)}static onDecline(e,t){g.v.respondToFriendRequest({userId:e,username:t},!1)}onFriendRequestResponded(e,t){const s=this.findFriendRequest(e);return null==s||(g.v.state.removeReceivedFriendRequest(s.userId),t&&g.v.state.addFriend({userId:s.userId,username:s.username,onlineStatus:{isOnline:!1}}),this.render()),Promise.resolve()}findFriendRequest(e){return g.v.state.friendRequestsReceived.find(t=>t.userId==e.userId)}async onCancel(e){const t={userId:e};null!=await l.m.postRequestHandler(d.l.apiUserProfileRemoveFriend(),void 0,t,"application/json")&&(g.v.state.removeSentFriendRequest(e),this.render())}static onGiftClick(e){const t={type:c.k0.ABTestClickAnalytics,category:c.eX.GiftMembershipOverlay,floatValue:c.s8.ProfileFriendsTab};u.CA.sendAnalyticEvent(t),(0,h.b4)(()=>(0,m.Yf)(`/store?username=${e}#gift`,!0),e)}static getFriendLastOnlineTime(e){return e.isOnline?(new Date).getTime():null==e.lastOnlineDate?0:new Date(e.lastOnlineDate).getTime()}static getStatusText(e){if(e.isOnline)return{key:"strings:profilePage.friends.status.online"};if(!e.lastOnlineDate)return{key:"strings:profilePage.friends.status.offline"};const t=p.Re.getDaysHoursMinutesBetweenDates(new Date,new Date(e.lastOnlineDate));if(t.days>4*p.Re.DAYS_IN_MONTH)return{key:"strings:profilePage.friends.status.lastOnlineMoreThan3Months"};
1if(t.days>p.Re.DAYS_IN_MONTH){const e=Math.floor(t.days/p.Re.DAYS_IN_MONTH);return S.getLastOnlineText(e,"month")}return t.days>0?S.getLastOnlineText(t.days,"day"):t.hours>0?S.getLastOnlineText(t.hours,"hour"):S.getLastOnlineText(t.minutes,"minute")}static getLastOnlineText(e,t){return{key:"strings:profilePage.friends.status.lastOnline",options:{context:t,count:-e}}}constructor(){this.render(),g.v.setCallbackFriendRequestResponded((e,t)=>this.onFriendRequestResponded(e,t))}}var b=s(81888),C=s(36872),P=s(94795);class k{async init(){this.profileIsCurrentUser=this.isProfileCurrentUser(),this.profileIsCurrentUser||(this.hideFriendsTab(),this.redirectIfFriendSectionIsActive()),await g.v.state.loadFriends(b._.userState),this.isPopup||this.profileLinkController.markApiCallMade(i.F_.Friends),await this.createDropdown(),this.isPopup||new S}setUsername(e){this.username=e}hideFriendsTab(){this.profileLinkController.setTabVisible(i.F_.Friends,!1)}showFriendsTab(){this.profileLinkController.setTabVisible(i.F_.Friends,!0)}redirectIfFriendSectionIsActive(){this.profileLinkController.activeTabId==i.F_.Friends&&(0,m.Yf)(`/profile/${this.username}`)}isProfileCurrentUser(){var e;return(null===(e=b._.userState)||void 0===e?void 0:e.username.toLowerCase())==decodeURIComponent(this.username.toLowerCase())}async createDropdown(){const e=this.getInitialDropdownContentForUserFriendsData();if(this.profileDropdownContent=this.getDropdownContent(e),null==this.toggleVisibilityComponent)return;const t=(0,v.F)("sticky_player_info_text_container",this.isPopup);this.dropdownController=new o(this.profileDropdownContent,t,this.profileIsCurrentUser,this.toggleVisibilityComponent),this.dropdownController.dropdownView.style.left="0"}getDropdownContent(e){const t=[];return f.r.isUserOnDiscordMobile||t.push({id:(0,v.F)("profile_dropdown_gift_membership",this.isPopup),class:"",text:{key:"strings:storePage.sendGift"},action:()=>this.sendGiftDropdownAction(),icon:C.am.StoreGiftMembershipDark}),t.push({id:(0,v.F)("profile_dropdown_report",this.isPopup),class:"component-dropdown-red",text:{key:"strings:game.endGame.report"},action:()=>{var e,t;return(0,P.d)(this.username,null!==(t=null===(e=b._.userState)||void 0===e?void 0:e.isLoggedIn)&&void 0!==t&&t)}}),b._.hasUser()?(this.isFriendOrPending?t.push(e):t.unshift(e),t):t}getInitialDropdownContentForUserFriendsData(){return g.v.state.friends.some(e=>e.username==this.username)?(this.isFriendOrPending=!0,this.friendStateDropdownContent.friend):g.v.state.friendRequestsSent.some(e=>e.username==this.username)?(this.isFriendOrPending=!0,this.friendStateDropdownContent.pending):this.friendStateDropdownContent.notFriend}sendGiftDropdownAction(){const e={type:c.k0.ABTestClickAnalytics,category:c.eX.GiftMembershipOverlay,floatValue:c.s8.PlayerProfile};u.CA.sendAnalyticEvent(e);const t=(f.r.isUserOnDiscord&&this.isPopup?"https://colonist.io":"")+`/store?username=${this.username}#gift`;(0,h.b4)(()=>(0,m.Yf)(t,!0),this.username)}async addFriendDropdownAction(){g.v.addFriendAction({username:decodeURIComponent(this.username)},e=>{const t=document.getElementById((0,v.F)("profile_dropdown_add_friend",this.isPopup));if(null==t)return;t.remove();const s=e?this.friendStateDropdownContent.friend:this.friendStateDropdownContent.pending;this.dropdownController.createDropdownContentElement(s)})}showRemoveFriendPopup(){g.v.showRemoveFriendPopup(this.username,()=>{g.v.removeFriendAction(this.username,()=>{const e=document.getElementById((0,v.F)("profile_dropdown_removeFriend",this.isPopup));null!=e&&(e.remove(),this.dropdownController.createDropdownContentElement(this.friendStateDropdownContent.notFriend))})})}constructor(e,t,s,i=!1){this.profileDropdownContent=[],this.isFriendOrPending=!1,this.username=e,this.profileLinkController=t,this.toggleVisibilityComponent=s,this.isPopup=i,this.friendStateDropdownContent={friend:{id:(0,v.F)("profile_dropdown_removeFriend",this.isPopup),class:"component-dropdown-red",text:{key:"strings:profilePage.friends.removeFriend.title"},action:()=>{this.showRemoveFriendPopup()}},notFriend:{id:(0,v.F)("profile_dropdown_add_friend",this.isPopup),class:"",text:{key:"strings:game.playerOptionsPopup.addFriend"},action:()=>{this.addFriendDropdownAction()}}
1,pending:{id:(0,v.F)("profile_dropdown_pending",this.isPopup),class:"component-dropdown-disabled",text:{key:"strings:profilePage.friends.friendRequestSent"}}},this.init()}}},93640:(e,t,s)=>{"use strict";s.d(t,{i:()=>i});class i{get isInActiveGameOrRoom(){return!!this.hasActiveGame||!!this.hasActiveRoom}startGame(){this.hasActiveGame=!0}endGame(){this.hasActiveGame=!1,this.hasActiveRoom=!1}enterRoom(){this.hasActiveRoom=!0}leaveRoom(){this.hasActiveRoom=!1}constructor(){this.hasActiveGame=!1,this.hasActiveRoom=!1}}},93896:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_politics_spy.19442bf93b99600979cb.svg"},93950:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_game_started_guitar.2f90057d4fb02d884afa.mp3"},94226:(e,t,s)=>{"use strict";s.d(t,{c:()=>i});class i{emitEvent(e,t){var s;null===(s=this.eventHandlers.get(e))||void 0===s||s(t)}onEvent(e,t){if(null!=this.eventHandlers.get(e))throw new Error(`Event type ${e} already has a handler`);this.eventHandlers.set(e,t)}removeListener(e){this.eventHandlers.delete(e)}send(e,t){this.sendFromClientToServer({type:e,...t})}constructor(e){this.eventHandlers=new Map,this.sendFromClientToServer=e}}},94795:(e,t,s)=>{"use strict";s.d(t,{d:()=>a});var i=s(655),n=s(32398),r=s(23359),o=s(51309);function a(e,t){if(!t)return void new o.L;(0,r.Z)(e,(e,t)=>{const s={reason:t};i.m.postRequestHandler(n.l.apiReportPlayer(e),void 0,s,"application/json")},!1)}},95078:(e,t,s)=>{"use strict";s.d(t,{l:()=>i});var i,n=s(72239);!function(e){e.shuffle=function(e){return n.lv.shuffle(e)},e.randomElementFromArray=function(e){return n.lv.randomElementFromArray(e)},e.removeElementFromArray=function(e,t){return n.lv.removeElementFromArray(e,t)},e.countOccurenceOfValueInArray=function(e,t){return n.lv.countOccurenceOfValueInArray(e,t)},e.elementInArray=function(e,t){return n.lv.elementInArray(e,t)}}(i||(i={}))},95107:(e,t,s)=>{"use strict";s.d(t,{v:()=>i});class i{}i.DEFAULT_PARAMETER_VALUE="1",i.suppressPopupsOnLoad=!1},95176:(e,t,s)=>{"use strict";s.d(t,{y:()=>d});var i=s(9029),n=s(85801),r=s(42466),o=s(36872),a=s(18587),c=s(90676),l=s(16611);class d{makeLarge(){this.body.className="popup-body-large",this.contentContainer.className="popup-content-large"}changeCheckButtonText(e){(0,i.RH)(this.checkButton,e),this.checkButton.className="btn_general"}disableCheckButton(){this.checkButton.style.opacity="0.5",this.checkButton.style.pointerEvents="none"}enableCheckButton(){this.checkButton.style.opacity="1.0",this.checkButton.style.pointerEvents="auto"}changeXButtonText(e){(0,i.RH)(this.xButton,e),this.xButton.classList.remove("btn_general_x")}isRemoved(){return"none"==this.container.style.display}show(){this.container.style.display="block",(0,c.w7)()}removePopup(){this.removeAction(),this.container.style.display="none",null!=this.container.parentElement&&this.container.parentElement.removeChild(this.container),r.y.untrackPopup(this)}isPopupRemoved(){return!r.y.isPopupTracked(this)}setCancel(){if(this.container.addEventListener("touchend",e=>{if(this.preventClicksOutsideOfPopupFromClosingPopup)return;e.target==this.container&&(e.preventDefault(),this.removePopup())}),a.r.isUserOnMobileAppOrWeb)return;if(a.r.isUserOnDiscordMobile)return;let e=!1;window.addEventListener("pointerdown",t=>{this.preventClicksOutsideOfPopupFromClosingPopup||(e=t.target==this.container)}),window.addEventListener("pointerup",t=>{if(!e)return;t.target==this.container&&this.removePopup()}),this.setEscapeKeyBind()}removeCheckButton(){this.checkButton.remove()}removeXButton(){this.xButton.remove()}setEscapeKeyBind(){this.preventClicksOutsideOfPopupFromClosingPopup||n.N.bindKey("Escape",()=>this.removePopup(),()=>!this.isRemoved(),n.g.General)}removeFooter(){this.footer.style.display="none",this.body.style.border="0px"}applyOptions(e){var t;null!=e&&(!1===e.showXButton&&this.removeXButton(),!1===e.showCheckButton&&this.removeCheckButton(),!0===e.showXonHeader&&this.addXOnHeader(),!0===(null===(t=e.backButton)||void 0===t?void 0:t.showBackButton)&&this.addBackButton(),null!=e.xButtonCustomContent&&(this.xButton.classList.remove("btn_general_x"),(0,i.RH)(this.xButton,e.xButtonCustomContent)),null!=e.checkButtonCustomContent&&(this.checkButton.classList.remove("btn_general_check"),(0,i.RH)(this.checkButton,e.checkButtonCustomContent)))}addXOnHeader(){const e=(0,i.zO)(this.header,o.am.XMark,"popup-close");(0,i.G0)(e,()=>{l.A9.play(l.hc.Click),this.removePopup()})}addBackButton(){const e=(0,i.zO)(this.header,o.am.LeftArrow,"popup-back");(0,i.G0)(e,()=>{var e,t,s;l.A9.play(l.hc.Click),null===(s=this.options)||void 0===s||null===(t=s.backButton)||void 0===t||null===(e=t.backButtonAction)||void 0===e||e.call(t)})}addBodyContent(e){(0,i.Wr)(this.body,e,"")}setFocusStyles(e,t=!1){a.r.isUserOnDiscordMobile&&(e.addEventListener("focus",()=>{this.container.classList.add("popup-focus-mobile"),t&&setTimeout(()=>{e.scrollIntoView({behavior:"smooth",block:"center"})},100)}),e.addEventListener("focusout",()=>{this.container.classList.remove("popup-focus-mobile")}))}constructor(e,t,s,n,o,a){this.removeAction=()=>{},this.container=(0,i.Le)(document.body,"popup"),this.contentContainer=(0,i.Le)(this.container,"popup-content"),this.header=(0,i.Le)(this.contentContainer,"popup-header"),this.body=(0,i.Le)(this.contentContainer,"popup-body"),this.footer=(0,i.Le)(this.contentContainer,"popup-footer"),this.options=a,this.xButton=(0,i.Le)(this.footer,"btn_general btn_general_secondary btn_general_x"),(0,i.G0)(this.xButton,()=>{l.A9.play(l.hc.Click),n(),this.removePopup()}),this.checkButton=(0,i.Le)(this.footer,"btn_general btn_general_check"),(0,i.G0)(this.checkButton,()=>{l.A9.play(l.hc.Click),s(),this.removePopup()}),this.preventClicksOutsideOfPopupFromClosingPopup=!1,o&&this.setCancel(),this.headerTitle=(0,i.n8)(this.header,e,"","","H2"),null!=t&&(0,i.Wr)(this.body,t,""),this.applyOptions(a),r.y.trackPopup(this)}}},95621:(e,t,s)=>{"use strict";e.exports=s.p+"assets/star.558d5200fbdda73a6465.svg"},96072:(e,t,s)=>{"use strict";e.exports=s.p+"assets/sfx_devcard_monopoly.8f00fbe4b24463a668b4.mp3"},96104:(e,t,s)=>{"use strict";s.d(t,{o:()=>p});var i=s(655),n=s(32398),r=s(46507),o=s(39588),a=s(7893),c=s(40279),l=s(81888),d=s(18587),u=s(25783),h=s(13618);class p{refreshProfileForUsernameChange(e){this.username=e,this.profileLinkController.setUsername(e),this.profileLinkController.resetApiCalls(),this.makeApiCall(),this.get
1StickyPlayerInfo()}init(){0==this.profileLinkController.showSectionFromHash()&&this.profileLinkController.showSection(r.F_.Overview),this.makeApiCall(),this.getStickyPlayerInfo()}onTabSelected(e){this.profileLinkController.showSection(e),this.makeApiCall()}setItems(e){null==this.itemsView&&(this.itemsView=(0,a.y)("profile_items_div",r.at));const t=d.r.shouldHideStoreOnMobile?void 0:e=>(0,h.Yf)(`/store#${e.categorySlug}`);this.itemsView.render({items:(0,u.y)(e),onItemClick:t})}async getStickyPlayerInfo(){var e;const t=await i.m.getRequestHandler(n.l.apiUserProfile.stickyPlayerInfo(this.username),void 0);if(null==t)return void this.accountDoesNotExist();const s=t.json,r=null!=l._.userState&&l._.userState.username==this.username?null===(e=l._.userState)||void 0===e?void 0:e.icon:s.iconImageId;this.setUserIcon(r),this.setMembershipIcon(s.currentMembershipType),this.setStickyUsername(s.username)}async makeApiCall(){switch(this.profileLinkController.activeTabId){case r.F_.Overview:null==this.overviewView&&(this.overviewView=(0,a.y)("profile_overview_div",r.Lr),this.overviewView.render({stats:void 0,badges:void 0})),await this.profileLinkController.genericApiCallWrapper(r.F_.Overview,n.l.apiUserProfile.overview(this.username),e=>{var t;null===(t=this.overviewView)||void 0===t||t.render({stats:(0,c.s)(e),badges:(0,c.l)(e.userId)})});break;case r.F_.History:await this.profileLinkController.genericApiCallWrapper(r.F_.History,n.l.apiUserProfile.history(this.username),e=>{this.setHistory(e)});break;case r.F_.Items:await this.profileLinkController.genericApiCallWrapper(r.F_.Items,n.l.apiUserProfile.items(this.username),e=>{this.setItems(e)});break;case r.F_.Ranked:await this.profileLinkController.genericApiCallWrapper(r.F_.Ranked,n.l.apiUserProfileRankedSeasons(),e=>{this.setRankedSeasons(e)});break;case r.F_.Friends:break;case r.F_.Settings:await this.profileLinkController.genericApiCallWrapper(r.F_.Settings,n.l.apiUserLoginState(),e=>{this.setProfileSettings(e)})}}constructor(){var e;this.profileLinkController=new o.K(!1,"",e=>this.onTabSelected(e)),l._.registerChangeListener(()=>{null!=this.username&&null!=l._.userState&&l._.userState.username==this.username&&this.getStickyPlayerInfo()}),this.lastKnownUsername=null===(e=l._.userState)||void 0===e?void 0:e.username,l._.registerChangeListener(()=>{var e,t;const s=null===(e=l._.userState)||void 0===e?void 0:e.username;if(null==s)return;if(s==this.lastKnownUsername)return;const i=this.username.toLowerCase()==(null===(t=this.lastKnownUsername)||void 0===t?void 0:t.toLowerCase());this.lastKnownUsername=s,i&&this.refreshProfileForUsernameChange(s)})}}},96144:(e,t,s)=>{"use strict";e.exports=s.p+"assets/settlement_mysticblue.0bd8f4f37c6262fecccc.svg"},96197:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_8x.f8c804c76a62eb4d0ded.svg"},96328:(e,t,s)=>{"use strict";s.d(t,{o:()=>d});var i=s(9029),n=s(84445),r=s(32398),o=s(13618),a=s(18587),c=s(16611),l=s(766);class d{handleBuyButtonClicked(e){c.A9.play(c.hc.Click),(0,n.E8)()?(0,n.Lj)():(e&&e(),(0,n.Uf)(()=>{a.r.isUserOnMobileAppOrWeb||((0,l.i)({storeProductType:this.product.storeProductType,productType:this.product.type,method:"stripeCheckout"}),(0,o.Yf)(this.productUrl))}))}constructor(e,t,s,n){this.product=t;const o=(0,i.Le)(e,"store_page_coin_product",""),c=(0,i.Le)(o,"store_page_coin_product_body",""),l=((0,i.zO)(c,t.lobbyImage,"","",{loading:"lazy"}),(0,i.Le)(o,"store_page_coin_product_header")),d={key:"strings:storePage.coins.title",options:{count:t.baseCoinAmount+t.bonusCoinAmount}};(0,i.n8)(l,d,"","","H2");if(0!=t.bonusCoinAmount){const e=(0,i.Wr)(l,{key:"strings:colonistCommon.utils.#buffer",options:{value:t.baseCoinAmount+" "}},"");(0,i.Wr)(e,{key:"strings:storePage.coins.bonusAmount",options:{count:t.bonusCoinAmount}},"store_page_coin_product_bonus")}var u;this.productUrl=r.l.checkoutProductUrl(t.type);const h={key:"strings:colonistCommon.utils.#buffer",options:{value:null!==(u=null==n?void 0:n.displayPrice)&&void 0!==u?u:t.getUSDPriceWithSign()}};if(this.buyButton=(0,i.cE)(o,"#",h,"store_button btn_general"),(0,i.G0)(this.buyButton,()=>this.handleBuyButtonClicked(s)),null!=t.bannerText){const e=a.r.isUserOnMobileAppOrWeb,s=(0,i.Le)(o,e?"badge-orange badge-md":"badge-orange badge-lg");(0,i.Wr)(s,t.bannerText,"")}}}},96396:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_wall_orange.b757cd76678f5d71470a.svg"},96625:(e,t,s)=>{"use strict";e.exports=s.p+"assets/master.04e4bcf128950beae7c9.svg"},96990:(e,t,s)=>{"use strict";s.d(t,{N:()=>n});var i=s(33832);class n{static isUserOnTabletApp(){if(window.location.hostname.includes("discordsays"))return!1;if(this.isUserOnMobileAppOrWeb()&&window.location.search.includes("tablet=1"))return!0;const e=navigator.userAgent;return[i.UA.IPAD_APP_USER_AGENT,i.UA.TABLET_APP_USER_AGENT].includes(e)}static isUserOnMobileAppOrWeb(){if(window.location.hostname.includes("discordsays"))return!1;const e=navigator.userAgent;if(i.UA.isMobileAppUserAgent(e))return!0;return window.location.pathname.includes("/mobile")}static isUserOnIOSApp(){if(window.location.hostname.includes("discordsays"))return!1;const e=navigator.userAgent;return[i.UA.IPHONE_APP_USER_AGENT,i.UA.IPAD_APP_USER_AGENT].includes(e)}static isUserOnAndroidApp(){if(window.location.hostname.includes("discordsays"))return!1;const e=navigator.userAgent;return[i.UA.ANDROID_APP_USER_AGENT,i.UA.TABLET_APP_USER_AGENT].includes(e)}static isUserOnDiscordMobile(){return!!this.isUserOnDiscord()&&(!!this.isDiscordMountLaunchedAsMobile()||this.isUserOnMobileDevice()
1)}static isUserOnDiscord(){return window.location.hostname.includes("discordsays")}static isDiscordMountLaunchedAsMobile(){return"mobile"===new URLSearchParams(window.location.search).get("platform")}static isUserOnFirefox(){const e=navigator.userAgent;return e.includes("Firefox")||e.includes("FxiOS")}static isUserOnSafariOrIOS(){const e=navigator.userAgent.toLowerCase(),t=/ipad|iphone|ipod/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,s=e.includes("safari")&&!e.includes("chrome");return t||s}static isUserOnMobileWebview(){return null!=this._isUserOnMobileWebview||(this._isUserOnMobileWebview=this.isUserOnMobileAppOrWeb()||this.isUserOnTabletApp()||this.isUserOnDiscordMobile()),this._isUserOnMobileWebview}static isCypressTest(){return null!=this._isCypressTest||(this._isCypressTest=void 0!==window.Cypress),this._isCypressTest}static isUserOnMobileDevice(){const e=navigator.userAgent;return i.UA.isMobileDeviceUserAgent(e)}static isUserOnPhoneDevice(){return!this.isUserOnTabletDevice()&&this.isUserOnMobileDevice()}static isUserOnTabletDevice(){const e=navigator.userAgent;return!!i.UA.isTabletDeviceUserAgent(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1}static isUserOnMobileWebBrowser(){if(window.location.hostname.includes("discordsays"))return!1;if(!this.isUserOnMobileDevice())return!1;const e=navigator.userAgent;return!i.UA.isMobileAppUserAgent(e)}static isUserOnIOSMobileWeb(){return!!this.isUserOnMobileWebBrowser()&&i.UA.isIOSDeviceUserAgent(navigator.userAgent)}static isUserOnAndroidMobileWeb(){return!!this.isUserOnMobileWebBrowser()&&i.UA.isAndroidDeviceUserAgent(navigator.userAgent)}static isUserOnIOSMobileAppOrWeb(){return this.isUserOnIOSApp()||this.isUserOnIOSMobileWeb()}static isUserOnAndroidMobileAppOrWeb(){return this.isUserOnAndroidApp()||this.isUserOnAndroidMobileWeb()}static isUserOnMobileOrTabletWebBrowser(){return!!this.isUserOnMobileWebBrowser()||!(!this.isUserOnTabletDevice()||this.isUserOnTabletApp())}}n._isUserOnMobileWebview=void 0,n._isCypressTest=void 0},97077:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_tie.0c3a9f90f86be7a19447.svg"},97861:(e,t,s)=>{"use strict";s.d(t,{X:()=>i});class i{subscribe(e,t){return null==this.events[e]&&(this.events[e]=[]),this.events[e].push(t),{unsubscribe:()=>this.unsubscribe(e,t)}}subscribeOnce(e,t){const s=this.subscribe(e,(...e)=>{s.unsubscribe(),t.apply(null,[...e])})}listenerCount(e){return null==this.events[e]?0:this.events[e].length}unsubscribe(e,t){null!=this.events[e]&&(this.events[e]=this.events[e].filter(e=>e!==t))}emit(e,...t){null!=this.events[e]&&this.events[e].forEach(e=>e.apply(null,[...t]))}constructor(e={}){this.events=e}}},98e3:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_devcardback.92569a1abd04a8c1c17e.svg"},98299:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_profile_membership.36f8e042d54d3bb48b1c.svg"},98389:(e,t,s)=>{"use strict";s.d(t,{I:()=>I,y:()=>w});var i=s(11445),n=s(60144),r=s(71763),o=s(46507),a=s(66935),c=s(16611),l=s(53015),d=s(51988),u=s(17399),h=s(18587),p=s(13618),m=s(55547),g=s(84029),f=s(55935),y=s(72239),v=s(35883);const S=e=>{const t=[];return y.h4.loopEnums(f.DS,(s,i)=>{if(i==f.DS.None)return;const n=v.j.getPlayerColorBuildings(i).settlement,r=`strings:colonistCommon.playerColors.${y.h4.getEnumKey(i,f.DS)}`;t.push({colorId:o.Rd.toColorId(i),name:{key:r},imageUrl:(0,u.tu)(n),disabled:!e.includes(i),freeAtStore:i==f.DS.Black})}),b(t)},b=e=>e.sort((e,t)=>e.disabled==t.disabled?0:e.disabled?1:-1),C=({selectColorAction:e,isRoomColor:t,onColorSelected:s})=>async i=>{const n=o.Rd.fromColorId(i);c.A9.play(c.hc.Click),s(i),await e(n),t||k(n)},P=()=>m.P_.performRoomLeavingAction(()=>(0,p.Yf)("/store#colors",!0,!0)),k=e=>{const t=`strings:colonistCommon.playerColors.${y.h4.getEnumKey(e,f.DS)}`,s=(0,a.dN)({key:"strings:homePage.header.defaultColorSelector.colorChanged"},{color:{key:t}}),i=v.j.getPlayerColorBuildings(e).settlement;null===m.OV||void 0===m.OV||m.OV.showNotification(i,s)};var T=s(36872);const A=(0,i.K)(({onClose:e,selectColorAction:t,selectedColor:s,initialTab:i,info:f})=>{const[y,v]=(0,r.useState)(f.username),[k,T]=(0,r.useState)((0,u.tu)(f.icon)),[A,R]=(0,r.useState)((e=>{if(null!=e)return o.Rd.toColorId(e)})(null!=s?s:f.preferredColor)),[w,I]=(0,r.useState)((e=>{const t=d.F.getItemsInCategory(l.n9.Icon,!1).find(t=>t.image==e);if(null!=t)return o.Rd.toAvatarId(t.type)})(f.icon)),M=S(f.availableColors),_=(e=>{const t=d.F.getItemsInCategory(l.n9.Icon,!1).map(t=>{const s=e.includes(t.type);return{avatarId:o.Rd.toAvatarId(t.type),name:t.name,imageUrl:(0,u.tu)(t.
1image),disabled:!s}});return b(t)})(f.ownedIconTypes),E=null!=s,D=h.r.shouldHideStoreOnMobile,L=C({selectColorAction:t,isRoomColor:E,onColorSelected:R});return r.createElement(o.R_,{onClose:e,username:y,icon:k,colors:M,selectedColor:A,onColorSelect:L,avatars:_,selectedAvatar:w,onAvatarSelect:e=>{const t=d.F.getItemsInCategory(l.n9.Icon,!1).find(t=>t.type==o.Rd.fromAvatarId(e));if(null==t)return;c.A9.play(c.hc.Click),n.a.updateIcon(t.type);const s=(0,a.dN)({key:"strings:homePage.header.avatarSelector.avatarChanged"},{icon:t.name});null===m.OV||void 0===m.OV||m.OV.showNotification(t.image,s),T((0,u.tu)(t.image)),I(e)},onUsernameClick:e=>{(0,g.m)(e=>{"ok"==e.type&&v(e.username)})},shouldHideStoreActions:D,onGoToStoreColors:P,onGoToStoreAvatars:()=>m.P_.performRoomLeavingAction(()=>(0,p.Yf)("/store#avatars",!0,!0)),initialTab:null!=i?i:E?"color":"avatar"})}),R=(0,i.K)(({onClose:e,selectColorAction:t,selectedColor:s,username:i,availableColors:n})=>{const[a,c]=(0,r.useState)(o.Rd.toColorId(s)),l=S(n),d=h.r.shouldHideStoreOnMobile,p=C({selectColorAction:t,isRoomColor:!0,onColorSelected:c});return r.createElement(o.NN,{onClose:e,username:i,icon:(0,u.tu)(T.am.Bot),colors:l,selectedColor:a,onColorSelect:p,shouldHideStoreActions:d,onGoToStoreColors:P})}),w=(e,t)=>{(async()=>{const s=await n.a.getEditProfileInfo();null!=s&&A({selectColorAction:e.selectColorAction,selectedColor:e.selectedColor,initialTab:t,info:s})})()},I=e=>{R({username:e.username,selectColorAction:e.selectColorAction,selectedColor:e.selectedColor,availableColors:e.availableColors})}},98560:(e,t,s)=>{"use strict";s.d(t,{_:()=>a});var i=s(46507),n=s(70908),r=s(17399);const o=(0,s(11445).K)(i.y3);function a(e){let t="";if(null!=e.bodyItems){t="<ul>"+n.a7.tArray(e.bodyItems).map(e=>`<li>${e}</li>`).join("")+"</ul>"}else t=e.bodyText;o({title:e.title,imageUrl:(0,r.tu)(e.image),description:t,onSubscribe:e.onSubscribe})}},98734:(e,t,s)=>{"use strict";e.exports=s.p+"assets/city_white.cca576079023a2bdc80f.svg"},98978:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_progress_science_crane.3b398a2d1bfa8d679dfe.svg"},99059:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_merchant_white.c93f5f627ac64a69bd6e.svg"},99273:(e,t,s)=>{"use strict";e.exports=s.p+"assets/ship_white_north_west.13e30ef284ecac032768.svg"},99527:(e,t,s)=>{"use strict";e.exports=s.p+"assets/icon_worker.25e11d6287814b06325d.svg"},99812:(e,t,s)=>{"use strict";e.exports=s.p+"assets/card_roadbuilding.994e8f21698ce6c350bd.svg"}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.