text: !function(e){var t={};function n(o){if(t[o])return t[o].exports;var s=t[o]={i:o,l:!1,exports:{}};return e[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(o,s,function(t){return e[t]}.bind(null,s));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=473)}({160:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const o="photon",s="-photon";let r=0;class i{constructor(){this.requests={},this._onMessage=({requestId:e,data:t,error:n})=>{if(this.requests[e])return n?this.requests[e].reject(n):this.requests[e].resolve(t),void delete this.requests[e]},window.transport.on(s,this._onMessage)}connect(e){return this._execute("connect",{credentials:e})}disconnect(){return this._execute("disconnect")}request(e){return this._execute("request",{query:e})}_execute(e,t={}){return new Promise(async(n,s)=>{this.requests[r]={resolve:n,reject:s},window.transport.send(o,{requestId:r,action:e,data:t}),r++})}}},161:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const o="project",s="-project";class r{async open(e){window.transport.send(o,{action:"open",data:{id:e}})}async create(e,t){window.transport.send(o,{action:"create",data:Object.assign({credentials:e},t)})}async connectOnly(e){window.transport.send(o,{action:"connect",data:{credentials:e}})}async validate(e){return new Promise(async t=>{window.transport.once(s,({error:e})=>t({error:e})),window.transport.send(o,{action:"validate",data:{credentials:e}})})}async getProject(){return new Promise(async(e,t)=>{window.transport.once(s,({error:n,data:o})=>n?t(n):e(o)),window.transport.send(o,{action:"get",data:{}})})}async getAll(){return new Promise(async(e,t)=>{window.transport.once(s,({error:n,data:o})=>n?t(n):e(o)),window.transport.send(o,{action:"get-all",data:{}})})}}},182:function(e,t,n){(function(e){("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"0.135.0"}}).call(this,n(92))},473:function(e,t,n){n(182),e.exports=n(479)},479:function(e,t,n){"use strict";n.r(t);const o=15;var s=n(160),r=n(161);window.transport=new class{constructor(){this.type="websocket",this.listeners={},this.queuedEvents=[],this.once=(e,t)=>{this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push({once:!0,callback:t})},this.on=(e,t)=>{this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push({once:!1,callback:t})},this.send=(e,t)=>{if(this.socket.readyState!==WebSocket.OPEN)return console.log("Websocket not open. Queueing this event:",JSON.stringify(t)),void this.queuedEvents.push({channel:e,payload:t});this.socket.send(JSON.stringify({channel:e,payload:t}))},this.onOpen=()=>{console.log("Socket connection established"),this.fireListenersForChannel("connect"),this.reconnectTimeoutHandle&&(clearTimeout(this.reconnectTimeoutHandle),this.reconnectTimeoutHandle=void 0,this.fireListenersForChannel("reconnect")),this.queuedEvents.length>0&&(console.log("Replaying queued events"),this.queuedEvents.forEach(e=>this.send(e.channel,e.payload)),this.queuedEvents=[])},this.onClose=()=>{this.reconnectTimeoutHandle||(console.log("Socket connection interrupted"),this.fireListenersForChannel("disconnect"))},this.onMessage=e=>{try{const{channel:t,payload:n={}}=JSON.parse(e.data);this.fireListenersForChannel(t,n)}catch(t){console.log("Malformed response from server, ignoring",e.data,t)}},this.fireListenersForChannel=(e,t={})=>{const n=this.listeners[e];n&&(this.listeners[e]=n.filter(({once:e,callback:n})=>(n(t),!e)))},this.connect()}reconnect(){console.log("Attempting to reconnect");let e=0;clearTimeout(this.reconnectTimeoutHandle),this.reconnectTimeoutHandle=void 0;const t=()=>{const n=100*Math.pow(2,e);e!==o?(console.log(`Retry connect after ${n}ms`),this.connect(),this.reconnectTimeoutHandle=setTimeout(()=>{e++,t()},n)):console.log(`${o} retry attempts failed. Giving up.`)};t()}connect(){const{protocol:e,host:t}=window.location,n=`${e.replace(/http/,"ws")}//${t}`;this.socket=new WebSocket(n),this.socket.addEventListener("open",this.onOpen),this.socket.addEventListener("message",this.onMessage),this.socket.addEventListener("close",this.onClose)}},window.bus={photon:new s.a,project:new r.a,window:{resize:async()=>{}},update:{install:async()=>{}}}},92:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n}});
  //# sourceMappingURL=serverBus.js.map