"use strict";(self.webpackChunk_postman_app_scratchpad=self.webpackChunk_postman_app_scratchpad||[]).push([[31],{7431:function(e,t,n){n.r(t),n.d(t,{default:function(){return h}});var a=n(1),o=n(4),i=n(8),r=n(522),l=n(7432),u=n(7151),c=n(2874),d=n(3339),s=n(3308),f=n(7434),m=n(7152);window.BroadcastChannel=window.BroadcastChannel||r.default,window.onpageshow=function(e){e.persisted&&window.location.reload()};let p=!1;window.requestIdleCallback=window.requestIdleCallback||function(e){return setTimeout(function(){var t=Date.now();e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)};const w=document.getElementById("app-root");function g(e){!function(){let e=document.getElementsByClassName("pm-loader")[0];e&&e.classList.add("is-hidden")}(),e?(0,o.render)(a.createElement(d.default,{showError:!0}),w):(0,o.render)(a.createElement(d.default,null,a.createElement(s.Theme,null,a.createElement(i.ToastProvider,null,a.createElement(m.default,null)))),w,()=>{let e=(0,u.getWindowLoadTime)();c.default.addEvent("app_performance_metric","requester_window_loaded",null,null,{load_time:e})})}function h(e){p||f.default.init(()=>{l.default.init(()=>{p=!0,g(),e&&e()})})}},7432:function(e,t,n){n.r(t);var a=n(528),o=n.n(a),i=n(1482),r=n(6710),l=n(6853),u=n(6860),c=n(6861),d=n(6924),s=n(6925),f=n(6933),m=n(6942),p=n(1781),w=n.n(p),g=n(2820),h=n(6945),k=n(6667),_=n(7433),E=n(6963),C=n(6964),v=n(7008),b=n(7009),S=n(7023),R=n(526);const y={process:"requester",ui:!0};window.pm=window.pm||{},window.process={},t.default={init:e=>{R.assign(window.pm,{windowConfig:y});const t=[C.default,h.initializeNavigationForDomains,u.bootWindowConfig,l.default,i.default,S.default,v.cleanupCookies,v.initializeCommunicationForCookies,r.default,s.default,f.default,E.default,c.default,b.default];o()(t,t=>{(0,d.default)(t);let n=w().Url.parse(location.href).query;if(R.find(n,{key:"access_token"})){console.log("Found access token in URL, logging user in...",n);let e=R.mapValues(R.keyBy(n,"key"),"value"),t={email:e.email,id:e.user_id,name:e.name,username:e.username,auth:{access_token:e.access_token}};pm.eventBus.channel("auth-handler-events").publish((0,g.createEvent)("authenticated","authentication",{userData:t,hasAccounts:!1}))}return t&&pm.logger.error("Error in requester boot sequence",t),(0,m.default)(),k.default.deleteOfflineWorkspace().catch(e=>{pm.logger.warn("Requester~init: Error while deleting default offline workspace",e)}).then(()=>{(0,_.setupSocketStatusReaction)(),e&&e(t)})})}}},7433:function(e,t,n){n.r(t),n.d(t,{setupSocketStatusReaction:function(){return s}});var a=n(1539),o=n(2996),i=n(6685),r=n(4457),l=n(526);const u="userOffline",c="You seem to be offline. Data in this workspace might not be up to date.",d=1e3;function s(){(0,a.reaction)(()=>(0,o.getStore)("SyncStatusStore").isSocketConnected,l.debounce(function(e){e?i.default.dismiss(u):i.default.trigger({id:u,message:c,meta:{targets:[r.WORKSPACE_PRIVATE,r.WORKSPACE_PERSONAL,r.WORKSPACE_TEAM,r.WORKSPACE_PUBLIC]}})},d,{leading:!1,trailing:!0}))}},7434:function(e,t,n){n.r(t);var a=n(528),o=n.n(a),i=(n(573),n(826),n(6711),n(6715),n(6722),n(6924)),r=(n(6934),n(7017),n(3784),n(7019),n(2874)),l=n(6942),u=n(6991);n(4836),n(7006),n(7020),n(7435);window.pm=window.pm||{},pm.init=e=>{u.default.markPoint("app_exec:start");const t=[];o()(t,t=>{(0,i.default)(t),t&&(pm.bulkAnalytics&&r.default.addEventV2AndPublish({category:"app_boot_failure",action:t.name,label:t.message},{noActiveWorkspace:!0}),pm.logger.error("Error in the app boot sequence",t)),(0,l.default)(),e&&e(t)})},t.default=pm},7435:function(e,t,n){n.r(t),t.default=function(e){"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then(function(e){for(let t of e)t.unregister()}),e&&"function"==typeof e&&e()}}}]);