Module 111162

3,158 characters · in no known chunk
Dependencies
Source Raw
function(e,t,n){"use strict";let i,r,a,s;n.r(t),n.d(t,{default:()=>O}),n(938796);var l=n(158390),o=n(247775),d=n(17928),c=n(636537),u=n(506774),_=n(228366),E=n(926919),A=n(927813),h=n(38405),I=n(652215);let f=(i=`${location.protocol}//${location.host}/__development/source_maps`,r=null,a=new l.A(5*A.A.Millis.SECOND,+A.A.Millis.MINUTE,!0),s=()=>{c.Bo.put({url:i,headers:{Authorization:o.getToken()},oldFormErrors:!0,rejectWithError:!0}).then(e=>{401===e.status||403===e.status?(r=null,(0,E.x)({sourceMapsEnabled:!1})):200!==e.status?r=setTimeout(s,a.fail()):(a.succeed(),r=setTimeout(s,e.body.sourceMapCookieTTLSeconds*A.A.Millis.SECOND*.75))},()=>{r=setTimeout(s,a.fail())})},{set:e=>{e!==(null!=r)&&(e?r=setTimeout(s,0):(clearTimeout(r),r=null,c.Bo.del({url:i,headers:{Authorization:o.getToken()},oldFormErrors:!0,rejectWithError:!0})))}}),p="DeveloperOptionsStore",T={trace:!1,canary:!1,logGatewayEvents:!1,logOverlayEvents:!1,logAnalyticsEvents:!1,sourceMapsEnabled:!1,axeEnabled:!1,cssDebuggingEnabled:!1,layoutDebuggingEnabled:!1,bugReporterEnabled:!0,idleStatusIndicatorEnabled:!1,onlyShowPreviewAppCollections:!1,disableAppCollectionsCache:!1,isStreamInfoOverlayEnabled:!1,preventPopoutClose:!1,logKeyboardMismatches:!1,alertStartupMetrics:!1,logQuestEvents:!1},m={...T},g="DeveloperOptionsRoutingKey",S=[];function N(e){m={...T,...m,...e},f.set(m.sourceMapsEnabled),u.w.set(p,m)}function C(e){S=e,u.w.set(g,S)}class R extends d.Ay.Store{static displayName="DeveloperOptionsStore";initialize(){let e=u.w.get(p);null!=e&&(m={...T,...e});let t=u.w.get(g);null!=t&&(S=t)}get isTracingRequests(){return m.trace}get isForcedCanary(){return m.canary}get isLoggingGatewayEvents(){return m.logGatewayEvents}get isLoggingOverlayEvents(){return m.logOverlayEvents}get isLoggingAnalyticsEvents(){return m.logAnalyticsEvents}get isAxeEnabled(){return m.axeEnabled}get cssDebuggingEnabled(){return m.cssDebuggingEnabled}get layoutDebuggingEnabled(){return m.layoutDebuggingEnabled}get sourceMapsEnabled(){return m.sourceMapsEnabled}get isBugReporterEnabled(){return m.bugReporterEnabled}get isIdleStatusIndicatorEnabled(){return m.idleStatusIndicatorEnabled}get onlyShowPreviewAppCollections(){return m.onlyShowPreviewAppCollections}get disableAppCollectionsCache(){return m.disableAppCollectionsCache}get isStreamInfoOverlayEnabled(){return m.isStreamInfoOverlayEnabled}get preventPopoutClose(){return m.preventPopoutClose}get logKeyboardMismatches(){return m.logKeyboardMismatches}get alertStartupMetrics(){return m.alertStartupMetrics}get isLoggingQuestEvents(){return m.logQuestEvents}getDebugOptionsHeaderValue(){return Object.keys(m).map(e=>m[e]),Object.keys(m).filter(e=>m[e]).join(",")}get routingKeyTags(){return S}getRoutingKeyHeaderValue(){return 0===S.length?null:S.join(",")}}let O=new R(_.h,{LOGOUT:function(e){N(T),C([])},CONNECTION_OPEN:function(e){let t=((e.user.flags??0)&I.nhx.STAFF)===I.nhx.STAFF,n=t||null!=e.user.personal_connection_id;t&&f.set(m.sourceMapsEnabled),h.A.setTags({isStaff:n.toString()})},DEVELOPER_OPTIONS_UPDATE_SETTINGS:function(e){let{settings:t}=e;N(t)},DEVELOPER_OPTIONS_SET_ROUTING_KEY:function(e){let{tags:t}=e;C(t)}})}