github.com/minio/console@v1.4.1/web-app/build/static/js/843.454ac75f.chunk.js (about)

     1  "use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[843],{30843:(e,t,n)=>{n.r(t),n.d(t,{default:()=>b});var r=n(65043),o=n(24241),a=n(22166),c=n(89923),s=n(20554),u=n(56483),i=n(32511),l=n(65259),d=n(64159),f=n(6681),p=n(48793),v=n(55968),S=n(5332),h=n(70579);const b=()=>{const e=(0,s.jL)(),t=(0,a.d4)((e=>e.trace.messages)),n=(0,a.d4)((e=>e.trace.traceStarted)),[b,E]=(0,r.useState)(""),[y,O]=(0,r.useState)(""),[_,m]=(0,r.useState)(""),[g,T]=(0,r.useState)(""),[w,N]=(0,r.useState)(0),[C,R]=(0,r.useState)(!1),[x,I]=(0,r.useState)(!0),[k,A]=(0,r.useState)(!1),[j,P]=(0,r.useState)(!1),[L,M]=(0,r.useState)(!1),[W,D]=(0,r.useState)(!1),[U,F]=(0,r.useState)(!1),[J,G]=(0,r.useState)(!1),[B,z]=(0,r.useState)("");(0,r.useEffect)((()=>{const e=new URL(window.location.toString()),t=(0,i.nw)(e.protocol),n=e.port,r=C?"all":(()=>{const e=[];return x&&e.push("s3"),k&&e.push("internal"),j&&e.push("storage"),L&&e.push("os"),e.join(",")})(),o=new URL(document.baseURI).pathname,a=new URL("".concat(t,"://").concat(e.hostname,":").concat(n).concat(o,"ws/trace"));a.searchParams.append("calls",r),a.searchParams.append("threshold",w.toString()),a.searchParams.append("onlyErrors",W?"yes":"no"),a.searchParams.append("statusCode",b),a.searchParams.append("method",y),a.searchParams.append("funcname",_),a.searchParams.append("path",g),z(a.href)}),[C,x,k,j,L,w,W,b,y,_,g]);const{sendMessage:K,lastJsonMessage:V,readyState:H}=(0,S.Ay)(B,{heartbeat:{message:"ok",interval:1e4,timeout:31536e6}},J);return(0,r.useEffect)((()=>{H===S.vj.CONNECTING?e((0,l.rZ)()):H===S.vj.OPEN?e((0,l.p)(!0)):H===S.vj.CLOSED&&e((0,l.p)(!1))}),[H,e,K]),(0,r.useEffect)((()=>{V&&(V.ptime=o.c9.fromISO(V.time).toJSDate(),V.key=Math.random(),e((0,l.cI)(V)))}),[V,e]),(0,r.useEffect)((()=>{e((0,d.ph)("trace"))}),[]),(0,h.jsxs)(r.Fragment,{children:[(0,h.jsx)(p.A,{label:"Trace",actions:(0,h.jsx)(v.A,{})}),(0,h.jsx)(c.Mxu,{children:(0,h.jsx)(c.azJ,{withBorders:!0,children:(0,h.jsxs)(c.xA9,{container:!0,children:[(0,h.jsxs)(c.xA9,{item:!0,xs:12,sx:{display:"flex",flexFlow:"column","& .trace-Checkbox-label":{fontSize:"14px",fontWeight:"normal"}},children:[(0,h.jsx)(c.azJ,{sx:{fontSize:"16px",fontWeight:600,padding:"20px 0px 20px 0"},children:"Calls to Trace"}),(0,h.jsxs)(c.azJ,{className:"".concat(n?"inactive-state":""),sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,h.jsxs)(c.azJ,{sx:{display:"flex",flexFlow:"row","& .trace-checked-icon":{border:"1px solid red"},["@media (min-width: ".concat(c.nmC.md,"px)")]:{gap:30}},children:[(0,h.jsx)(c.Sc0,{checked:C,id:"all_calls",name:"all_calls",label:"All",onChange:()=>R(!C),value:"all",disabled:n}),(0,h.jsx)(c.Sc0,{checked:x||C,id:"s3_calls",name:"s3_calls",label:"S3",onChange:()=>I(!x),value:"s3",disabled:C||n}),(0,h.jsx)(c.Sc0,{checked:k||C,id:"internal_calls",name:"internal_calls",label:"Internal",onChange:()=>A(!k),value:"internal",disabled:C||n}),(0,h.jsx)(c.Sc0,{checked:j||C,id:"storage_calls",name:"storage_calls",label:"Storage",onChange:()=>P(!j),value:"storage",disabled:C||n}),(0,h.jsx)(c.Sc0,{checked:L||C,id:"os_calls",name:"os_calls",label:"OS",onChange:()=>M(!L),value:"os",disabled:C||n})]}),(0,h.jsxs)(c.azJ,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"15px"},children:[(0,h.jsx)(f.A,{tooltip:"More filter options",children:(0,h.jsx)(c.$nd,{id:"filter-toggle",onClick:()=>F(!U),label:"Filters",icon:(0,h.jsx)(c.YGH,{}),variant:"regular",className:"filters-toggle-button",style:{width:"118px",background:U?"rgba(8, 28, 66, 0.04)":""}})}),!n&&(0,h.jsx)(c.$nd,{id:"start-trace",label:"Start","data-test-id":"trace-start-button",variant:"callAction",onClick:()=>G(!0),style:{width:"118px"}}),n&&(0,h.jsx)(c.$nd,{id:"stop-trace",label:"Stop Trace","data-test-id":"trace-stop-button",variant:"callAction",onClick:()=>G(!1),style:{width:"118px"}})]})]})]}),U?(0,h.jsxs)(c.azJ,{useBackground:!0,className:"".concat(n?"inactive-state":""),sx:{marginTop:"25px",display:"flex",flexFlow:"column",padding:"30px",width:"100%","& .orient-vertical":{flexFlow:"column","& label":{marginBottom:"10px",fontWeight:600},"& .inputRebase":{width:"90%"}},"& .trace-Checkbox-label":{fontSize:"14px",fontWeight:"normal"}},children:[(0,h.jsxs)(c.azJ,{sx:{display:"flex"},children:[(0,h.jsx)(c.cl_,{className:"orient-vertical",id:"trace-status-code",name:"trace-status-code",label:"Status Code",placeholder:"e.g. 503",value:b,onChange:e=>E(e.target.value),disabled:n}),(0,h.jsx)(c.cl_,{className:"orient-vertical",id:"trace-function-name",name:"trace-function-name",label:"Function Name",placeholder:"e.g. FunctionName2055",value:_,onChange:e=>m(e.target.value),disabled:n}),(0,h.jsx)(c.cl_,{className:"orient-vertical",id:"trace-method",name:"trace-method",label:"Method",placeholder:"e.g. Method 2056",value:y,onChange:e=>O(e.target.value),disabled:n})]}),(0,h.jsxs)(c.azJ,{sx:{gap:"30px",display:"grid",gridTemplateColumns:"2fr 1fr",width:"100%",marginTop:"33px"},children:[(0,h.jsx)(c.azJ,{sx:{flex:2,width:"calc( 100% + 10px)"},children:(0,h.jsx)(c.cl_,{className:"orient-vertical",id:"trace-path",name:"trace-path",label:"Path",placeholder:"e.g. my-bucket/my-prefix/*",value:g,onChange:e=>T(e.target.value),disabled:n})}),(0,h.jsx)(c.azJ,{sx:{marginLeft:"15px"},children:(0,h.jsx)(c.cl_,{className:"orient-vertical",id:"trace-fthreshold",name:"trace-fthreshold",label:"Response Threshold",type:"number",placeholder:"e.g. website.io.3249.114.12",value:"".concat(w),onChange:e=>N(parseInt(e.target.value)),disabled:n})})]}),(0,h.jsx)(c.azJ,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",marginTop:"40px"},children:(0,h.jsx)(c.Sc0,{checked:W,id:"only_errors",name:"only_errors",label:"Display only Errors",onChange:()=>D(!W),value:"only_errors",disabled:n})})]}):null,(0,h.jsx)(c.xA9,{item:!0,xs:12,children:(0,h.jsx)(c.azJ,{sx:{fontSize:"16px",fontWeight:600,marginBottom:"30px",marginTop:"30px"},children:"Trace Results"})}),(0,h.jsx)(c.xA9,{item:!0,xs:12,children:(0,h.jsx)(c.bQt,{columns:[{label:"Time",elementKey:"ptime",renderFunction:e=>{const t=new Date(e);return(0,u.cj)(t)},width:100},{label:"Name",elementKey:"api"},{label:"Status",elementKey:"",renderFunction:e=>"".concat(e.statusCode," ").concat(e.statusMsg),renderFullObject:!0},{label:"Location",elementKey:"configuration_id",renderFunction:e=>"".concat(e.host," ").concat(e.client),renderFullObject:!0},{label:"Load Time",elementKey:"callStats.duration",width:150},{label:"Upload",elementKey:"callStats.rx",renderFunction:u.nO,width:150},{label:"Download",elementKey:"callStats.tx",renderFunction:u.nO,width:150}],isLoading:!1,records:t,entityName:"Traces",idField:"api",customEmptyMessage:n?"No Traced elements received yet":"Trace is not started yet",customPaperHeight:"calc(100vh - 292px)",autoScrollToBottom:!0})})]})})})]})}},5332:(e,t,n)=>{t.vj=t.Ay=void 0;var r=n(4061);Object.defineProperty(t,"Ay",{enumerable:!0,get:function(){return r.useWebSocket}});var o=n(32690);var a=n(7205);Object.defineProperty(t,"vj",{enumerable:!0,get:function(){return a.ReadyState}});var c=n(34386);var s=n(20858)},61360:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.attachListeners=void 0;var o=n(35304),a=n(98540),c=n(7205),s=n(20858);t.attachListeners=function(e,t,n,u,i,l){var d,f,p,v=t.setLastMessage,S=t.setReadyState;return n.current.fromSocketIO&&(d=(0,o.setUpSocketIOPing)(l)),function(e,t,n){var r;if(t.current.heartbeat&&e instanceof WebSocket){var o="boolean"===typeof t.current.heartbeat?void 0:t.current.heartbeat;r=(0,a.heartbeat)(e,o)}e.onmessage=function(e){var o;null===r||void 0===r||r(),t.current.onMessage&&t.current.onMessage(e),"function"===typeof t.current.filter&&!0!==t.current.filter(e)||t.current.heartbeat&&"boolean"!==typeof t.current.heartbeat&&(null===(o=t.current.heartbeat)||void 0===o?void 0:o.returnMessage)===e.data||n(e)}}(e,n,v),function(e,t,n,r){e.onopen=function(e){t.current.onOpen&&t.current.onOpen(e),r.current=0,n(c.ReadyState.OPEN)}}(e,n,S,i),f=function(e,t,n,r,o){return c.isEventSourceSupported&&e instanceof EventSource?function(){}:((0,s.assertIsWebSocket)(e,t.current.skipAssert),e.onclose=function(e){var s;if(t.current.onClose&&t.current.onClose(e),n(c.ReadyState.CLOSED),t.current.shouldReconnect&&t.current.shouldReconnect(e)){var u=null!==(s=t.current.reconnectAttempts)&&void 0!==s?s:c.DEFAULT_RECONNECT_LIMIT;if(o.current<u){var i="function"===typeof t.current.reconnectInterval?t.current.reconnectInterval(o.current):t.current.reconnectInterval;a=window.setTimeout((function(){o.current++,r()}),null!==i&&void 0!==i?i:c.DEFAULT_RECONNECT_INTERVAL_MS)}else t.current.onReconnectStop&&t.current.onReconnectStop(u),console.warn("Max reconnect attempts of ".concat(u," exceeded"))}},function(){return a&&window.clearTimeout(a)});var a}(e,n,S,u,i),p=function(e,t,n,o,a){var s;return e.onerror=function(u){var i;if(t.current.onError&&t.current.onError(u),c.isEventSourceSupported&&e instanceof EventSource&&(t.current.onClose&&t.current.onClose(r(r({},u),{code:1006,reason:"An error occurred with the EventSource: ".concat(u),wasClean:!1})),n(c.ReadyState.CLOSED),e.close()),t.current.retryOnError)if(a.current<(null!==(i=t.current.reconnectAttempts)&&void 0!==i?i:c.DEFAULT_RECONNECT_LIMIT)){var l="function"===typeof t.current.reconnectInterval?t.current.reconnectInterval(a.current):t.current.reconnectInterval;s=window.setTimeout((function(){a.current++,o()}),null!==l&&void 0!==l?l:c.DEFAULT_RECONNECT_INTERVAL_MS)}else t.current.onReconnectStop&&t.current.onReconnectStop(t.current.reconnectAttempts),console.warn("Max reconnect attempts of ".concat(t.current.reconnectAttempts," exceeded"))},function(){return s&&window.clearTimeout(s)}}(e,n,S,u,i),function(){S(c.ReadyState.CLOSING),f(),p(),e.close(),d&&clearInterval(d)}}},31961:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.attachSharedListeners=void 0;var o=n(59596),a=n(7205),c=n(1875),s=n(35304),u=n(98540);t.attachSharedListeners=function(e,t,n,i){var l;return n.current.fromSocketIO&&(l=(0,s.setUpSocketIOPing)(i)),function(e,t,n){var r;n&&e instanceof WebSocket&&(r=(0,u.heartbeat)(e,"boolean"===typeof n?void 0:n)),e.onmessage=function(e){null===r||void 0===r||r(),(0,c.getSubscribers)(t).forEach((function(t){t.optionsRef.current.onMessage&&t.optionsRef.current.onMessage(e),"function"===typeof t.optionsRef.current.filter&&!0!==t.optionsRef.current.filter(e)||n&&"boolean"!==typeof n&&(null===n||void 0===n?void 0:n.returnMessage)===e.data||t.setLastMessage(e)}))}}(e,t,n.current.heartbeat),function(e,t){e instanceof WebSocket&&(e.onclose=function(e){(0,c.getSubscribers)(t).forEach((function(t){t.optionsRef.current.onClose&&t.optionsRef.current.onClose(e),t.setReadyState(a.ReadyState.CLOSED)})),delete o.sharedWebSockets[t],(0,c.getSubscribers)(t).forEach((function(t){var n;if(t.optionsRef.current.shouldReconnect&&t.optionsRef.current.shouldReconnect(e)){var r=null!==(n=t.optionsRef.current.reconnectAttempts)&&void 0!==n?n:a.DEFAULT_RECONNECT_LIMIT;if(t.reconnectCount.current<r){var o="function"===typeof t.optionsRef.current.reconnectInterval?t.optionsRef.current.reconnectInterval(t.reconnectCount.current):t.optionsRef.current.reconnectInterval;setTimeout((function(){t.reconnectCount.current++,t.reconnect.current()}),null!==o&&void 0!==o?o:a.DEFAULT_RECONNECT_INTERVAL_MS)}else t.optionsRef.current.onReconnectStop&&t.optionsRef.current.onReconnectStop(t.optionsRef.current.reconnectAttempts),console.warn("Max reconnect attempts of ".concat(r," exceeded"))}}))})}(e,t),function(e,t){e.onopen=function(e){(0,c.getSubscribers)(t).forEach((function(t){t.reconnectCount.current=0,t.optionsRef.current.onOpen&&t.optionsRef.current.onOpen(e),t.setReadyState(a.ReadyState.OPEN)}))}}(e,t),function(e,t){e.onerror=function(n){(0,c.getSubscribers)(t).forEach((function(t){t.optionsRef.current.onError&&t.optionsRef.current.onError(n),a.isEventSourceSupported&&e instanceof EventSource&&(t.optionsRef.current.onClose&&t.optionsRef.current.onClose(r(r({},n),{code:1006,reason:"An error occurred with the EventSource: ".concat(n),wasClean:!1})),t.setReadyState(a.ReadyState.CLOSED))})),a.isEventSourceSupported&&e instanceof EventSource&&e.close()}}(e,t),function(){l&&clearInterval(l)}}},7205:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isEventSourceSupported=t.isReactNative=t.ReadyState=t.DEFAULT_HEARTBEAT=t.UNPARSABLE_JSON_OBJECT=t.DEFAULT_RECONNECT_INTERVAL_MS=t.DEFAULT_RECONNECT_LIMIT=t.SOCKET_IO_PING_CODE=t.SOCKET_IO_PATH=t.SOCKET_IO_PING_INTERVAL=t.DEFAULT_EVENT_SOURCE_OPTIONS=t.EMPTY_EVENT_HANDLERS=t.DEFAULT_OPTIONS=void 0;t.DEFAULT_OPTIONS={},t.EMPTY_EVENT_HANDLERS={},t.DEFAULT_EVENT_SOURCE_OPTIONS={withCredentials:!1,events:t.EMPTY_EVENT_HANDLERS},t.SOCKET_IO_PING_INTERVAL=25e3,t.SOCKET_IO_PATH="/socket.io/?EIO=3&transport=websocket",t.SOCKET_IO_PING_CODE="2",t.DEFAULT_RECONNECT_LIMIT=20,t.DEFAULT_RECONNECT_INTERVAL_MS=5e3,t.UNPARSABLE_JSON_OBJECT={},t.DEFAULT_HEARTBEAT={message:"ping",timeout:6e4,interval:25e3},function(e){e[e.UNINSTANTIATED=-1]="UNINSTANTIATED",e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(t.ReadyState||(t.ReadyState={}));t.isReactNative="undefined"!==typeof navigator&&"ReactNative"===navigator.product,t.isEventSourceSupported=!t.isReactNative&&function(){try{return"EventSource"in globalThis}catch(e){return!1}}()},63791:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createOrJoinSocket=void 0;var r=n(59596),o=n(7205),a=n(61360),c=n(31961),s=n(1875);t.createOrJoinSocket=function(e,t,n,u,i,l,d,f){if(!o.isEventSourceSupported&&u.current.eventSourceOptions)throw o.isReactNative?new Error("EventSource is not supported in ReactNative"):new Error("EventSource is not supported");if(u.current.share){var p=null;void 0===r.sharedWebSockets[t]?(r.sharedWebSockets[t]=u.current.eventSourceOptions?new EventSource(t,u.current.eventSourceOptions):new WebSocket(t,u.current.protocols),e.current=r.sharedWebSockets[t],n(o.ReadyState.CONNECTING),p=(0,c.attachSharedListeners)(r.sharedWebSockets[t],t,u,f)):(e.current=r.sharedWebSockets[t],n(r.sharedWebSockets[t].readyState));var v={setLastMessage:i,setReadyState:n,optionsRef:u,reconnectCount:d,reconnect:l};return(0,s.addSubscriber)(t,v),function(e,t,n,a,c){return function(){if((0,s.removeSubscriber)(e,t),!(0,s.hasSubscribers)(e)){try{var u=r.sharedWebSockets[e];u instanceof WebSocket&&(u.onclose=function(e){n.current.onClose&&n.current.onClose(e),a(o.ReadyState.CLOSED)}),u.close()}catch(i){}c&&c(),delete r.sharedWebSockets[e]}}}(t,v,u,n,p)}if(e.current=u.current.eventSourceOptions?new EventSource(t,u.current.eventSourceOptions):new WebSocket(t,u.current.protocols),n(o.ReadyState.CONNECTING),!e.current)throw new Error("WebSocket failed to be created");return(0,a.attachListeners)(e.current,{setLastMessage:i,setReadyState:n},u,l.current,d,f)}},12852:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function c(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r.throw(e))}catch(t){a(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,a,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(s){a=[6,s],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getUrl=void 0;var a=n(35304),c=n(7205);t.getUrl=function(e,n,s){return void 0===s&&(s=0),r(void 0,void 0,void 0,(function(){var r,u,i,l,d,f,p;return o(this,(function(o){switch(o.label){case 0:if("function"!==typeof e)return[3,10];o.label=1;case 1:return o.trys.push([1,3,,9]),[4,e()];case 2:return r=o.sent(),[3,9];case 3:return o.sent(),n.current.retryOnError?(u=null!==(d=n.current.reconnectAttempts)&&void 0!==d?d:c.DEFAULT_RECONNECT_LIMIT,s<u?(i="function"===typeof n.current.reconnectInterval?n.current.reconnectInterval(s):n.current.reconnectInterval,[4,(v=null!==i&&void 0!==i?i:c.DEFAULT_RECONNECT_INTERVAL_MS,new Promise((function(e){return window.setTimeout(e,v)})))]):[3,5]):[3,7];case 4:return o.sent(),[2,(0,t.getUrl)(e,n,s+1)];case 5:return null===(p=(f=n.current).onReconnectStop)||void 0===p||p.call(f,s),[2,null];case 6:return[3,8];case 7:return[2,null];case 8:return[3,9];case 9:return[3,11];case 10:r=e,o.label=11;case 11:return l=n.current.fromSocketIO?(0,a.parseSocketIOUrl)(r):r,[2,n.current.queryParams?(0,a.appendQueryParams)(l,n.current.queryParams):l]}var v}))}))}},59596:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resetWebSockets=t.sharedWebSockets=void 0,t.sharedWebSockets={};t.resetWebSockets=function(e){if(e&&t.sharedWebSockets.hasOwnProperty(e))delete t.sharedWebSockets[e];else for(var n in t.sharedWebSockets)t.sharedWebSockets.hasOwnProperty(n)&&delete t.sharedWebSockets[n]}},98540:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.heartbeat=void 0;var r=n(7205);t.heartbeat=function(e,t){var n=t||{},o=n.interval,a=void 0===o?r.DEFAULT_HEARTBEAT.interval:o,c=n.timeout,s=void 0===c?r.DEFAULT_HEARTBEAT.timeout:c,u=n.message,i=void 0===u?r.DEFAULT_HEARTBEAT.message:u,l=!1,d=setInterval((function(){try{"function"===typeof i?e.send(i()):e.send(i)}catch(t){}}),a),f=setInterval((function(){l?l=!1:e.close()}),s);return e.addEventListener("close",(function(){clearInterval(d),clearInterval(f)})),function(){l=!0}}},1875:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resetSubscribers=t.removeSubscriber=t.addSubscriber=t.hasSubscribers=t.getSubscribers=void 0;var n={},r=[];t.getSubscribers=function(e){return(0,t.hasSubscribers)(e)?Array.from(n[e]):r};t.hasSubscribers=function(e){var t;return(null===(t=n[e])||void 0===t?void 0:t.size)>0};t.addSubscriber=function(e,t){n[e]=n[e]||new Set,n[e].add(t)};t.removeSubscriber=function(e,t){n[e].delete(t)};t.resetSubscribers=function(e){if(e&&n.hasOwnProperty(e))delete n[e];else for(var t in n)n.hasOwnProperty(t)&&delete n[t]}},81808:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.websocketWrapper=void 0;t.websocketWrapper=function(e,t){return new Proxy(e,{get:function(e,n){var r=e[n];return"reconnect"===n?t:"function"===typeof r?(console.error("Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket."),function(){}):r},set:function(e,t,n){return/^on/.test(t)?(console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."),!1):(e[t]=n,!0)}})},t.default=t.websocketWrapper},35304:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setUpSocketIOPing=t.appendQueryParams=t.parseSocketIOUrl=void 0;var r=n(7205);t.parseSocketIOUrl=function(e){if(e){var t=/^https|wss/.test(e),n=e.replace(/^(https?|wss?)(:\/\/)?/,"").replace(/\/$/,"");return"".concat(o=t?"wss":"ws","://").concat(n).concat(r.SOCKET_IO_PATH)}if(""===e){var o=(t=/^https/.test(window.location.protocol))?"wss":"ws",a=window.location.port?":".concat(window.location.port):"";return"".concat(o,"://").concat(window.location.hostname).concat(a).concat(r.SOCKET_IO_PATH)}return e};t.appendQueryParams=function(e,t){void 0===t&&(t={});var n=/\?([\w]+=[\w]+)/.test(e),r="".concat(Object.entries(t).reduce((function(e,t){var n=t[0],r=t[1];return e+"".concat(n,"=").concat(r,"&")}),"").slice(0,-1));return"".concat(e).concat(n?"&":"?").concat(r)};t.setUpSocketIOPing=function(e,t){void 0===t&&(t=r.SOCKET_IO_PING_INTERVAL);return window.setInterval((function(){return e(r.SOCKET_IO_PING_CODE)}),t)}},34386:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.useEventSource=void 0;var a=n(65043),c=n(4061),s=n(7205);t.useEventSource=function(e,t,n){void 0===t&&(t=s.DEFAULT_EVENT_SOURCE_OPTIONS);var u=t.withCredentials,i=t.events,l=o(t,["withCredentials","events"]);void 0===n&&(n=!0);var d=r(r({},l),{eventSourceOptions:{withCredentials:u}}),f=(0,a.useRef)(s.EMPTY_EVENT_HANDLERS);i&&(f.current=i);var p=(0,c.useWebSocket)(e,d,n),v=p.lastMessage,S=p.readyState,h=p.getWebSocket;return(0,a.useEffect)((function(){(null===v||void 0===v?void 0:v.type)&&Object.entries(f.current).forEach((function(e){var t=e[0],n=e[1];t===v.type&&n(v)}))}),[v]),{lastEvent:v,readyState:S,getEventSource:h}}},32690:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.useSocketIO=void 0;var o=n(65043),a=n(4061),c=n(7205),s={type:"empty",payload:null};t.useSocketIO=function(e,t,n){void 0===t&&(t=c.DEFAULT_OPTIONS),void 0===n&&(n=!0);var u=(0,o.useMemo)((function(){return r(r({},t),{fromSocketIO:!0})}),[]),i=(0,a.useWebSocket)(e,u,n),l=i.sendMessage,d=i.sendJsonMessage,f=i.lastMessage,p=i.readyState,v=i.getWebSocket,S=(0,o.useMemo)((function(){return function(e){if(!e||!e.data)return s;var t=e.data.match(/\[.*]/);if(!t)return s;var n=JSON.parse(t);return Array.isArray(n)&&n[1]?{type:n[0],payload:n[1]}:s}(f)}),[f]);return{sendMessage:l,sendJsonMessage:d,lastMessage:S,lastJsonMessage:S,readyState:p,getWebSocket:v}}},4061:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function c(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r.throw(e))}catch(t){a(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,o,a,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(s){a=[6,s],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useWebSocket=void 0;var s=n(65043),u=n(97950),i=n(7205),l=n(63791),d=n(12852),f=c(n(81808)),p=n(20858);t.useWebSocket=function(e,t,n){void 0===t&&(t=i.DEFAULT_OPTIONS),void 0===n&&(n=!0);var c=(0,s.useState)(null),v=c[0],S=c[1],h=(0,s.useState)({}),b=h[0],E=h[1],y=(0,s.useMemo)((function(){if(v)try{return JSON.parse(v.data)}catch(e){return i.UNPARSABLE_JSON_OBJECT}return null}),[v]),O=(0,s.useRef)(null),_=(0,s.useRef)(null),m=(0,s.useRef)((function(){})),g=(0,s.useRef)(0),T=(0,s.useRef)([]),w=(0,s.useRef)(null),N=(0,s.useRef)(t);N.current=t;var C=O.current&&void 0!==b[O.current]?b[O.current]:null!==e&&!0===n?i.ReadyState.CONNECTING:i.ReadyState.UNINSTANTIATED,R=t.queryParams?JSON.stringify(t.queryParams):null,x=(0,s.useCallback)((function(e,t){var n;void 0===t&&(t=!0),i.isEventSourceSupported&&_.current instanceof EventSource?console.warn("Unable to send a message from an eventSource"):(null===(n=_.current)||void 0===n?void 0:n.readyState)===i.ReadyState.OPEN?((0,p.assertIsWebSocket)(_.current,N.current.skipAssert),_.current.send(e)):t&&T.current.push(e)}),[]),I=(0,s.useCallback)((function(e,t){void 0===t&&(t=!0),x(JSON.stringify(e),t)}),[x]),k=(0,s.useCallback)((function(){return!0!==N.current.share||i.isEventSourceSupported&&_.current instanceof EventSource?_.current:(null===w.current&&_.current&&((0,p.assertIsWebSocket)(_.current,N.current.skipAssert),w.current=(0,f.default)(_.current,m)),w.current)}),[]);return(0,s.useEffect)((function(){if(null!==e&&!0===n){var t,c=!1,s=!0,f=function(){return o(void 0,void 0,void 0,(function(){var n,o,f;return a(this,(function(a){switch(a.label){case 0:return n=O,[4,(0,d.getUrl)(e,N)];case 1:return n.current=a.sent(),null===O.current?(console.error("Failed to get a valid URL. WebSocket connection aborted."),O.current="ABORTED",(0,u.flushSync)((function(){return E((function(e){return r(r({},e),{ABORTED:i.ReadyState.CLOSED})}))})),[2]):(o=function(e){c||(0,u.flushSync)((function(){return S(e)}))},f=function(e){c||(0,u.flushSync)((function(){return E((function(t){var n;return r(r({},t),O.current&&((n={})[O.current]=e,n))}))}))},s&&(t=(0,l.createOrJoinSocket)(_,O.current,f,N,o,m,g,x)),[2])}}))}))};return m.current=function(){c||(w.current&&(w.current=null),null===t||void 0===t||t(),f())},f(),function(){c=!0,s=!1,w.current&&(w.current=null),null===t||void 0===t||t(),S(null)}}null!==e&&!1!==n||(g.current=0,E((function(e){var t;return r(r({},e),O.current&&((t={})[O.current]=i.ReadyState.CLOSED,t))})))}),[e,n,R,x]),(0,s.useEffect)((function(){C===i.ReadyState.OPEN&&T.current.splice(0).forEach((function(e){x(e)}))}),[C]),{sendMessage:x,sendJsonMessage:I,lastMessage:v,lastJsonMessage:y,readyState:C,getWebSocket:k}}},20858:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resetGlobalState=t.assertIsWebSocket=void 0;var r=n(59596),o=n(1875);t.assertIsWebSocket=function(e,t){if(!t&&e instanceof WebSocket===!1)throw new Error("")},t.resetGlobalState=function(e){(0,o.resetSubscribers)(e),(0,r.resetWebSockets)(e)}}}]);
     2  //# sourceMappingURL=843.454ac75f.chunk.js.map