/*__ESM_BODY_START__*/
var wt=Object.create,bn=Object.defineProperty;var Ot=Object.getOwnPropertyDescriptor;var kt=Object.getOwnPropertyNames;var Lt=Object.getPrototypeOf,It=Object.prototype.hasOwnProperty;var Nt=a=>bn(a,"__esModule",{value:!0});var j=(a,o)=>()=>(o||a((o={exports:{}}).exports,o),o.exports);var Rt=(a,o,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let E of kt(o))!It.call(a,E)&&E!=="default"&&bn(a,E,{get:()=>o[E],enumerable:!(l=Ot(o,E))||l.enumerable});return a},Dt=a=>Rt(Nt(bn(a!=null?wt(Lt(a)):{},"default",a&&a.__esModule&&"default"in a?{get:()=>a.default,enumerable:!0}:{value:a,enumerable:!0})),a);var _e=j(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.default=be.TOKEN_MANAGEMENT_EXTENSION=be.WEBSOCKET_TYPE_NAME=void 0;var Mt={servletPath:"amb",logLevel:"info",loginWindow:"true",wsConnectTimeout:1e4,overlayStyle:"",subscribeCommandsFlow:{enable:!1,maxInflight:1,maxWait:1e4,retries:3,retryDelay:{min:2e3,max:3e5,increaseFactor:2}}},At="websocket";be.WEBSOCKET_TYPE_NAME=At;var Ft="tokenManagementExtension";be.TOKEN_MANAGEMENT_EXTENSION=Ft;var Bt=Mt;be.default=Bt});var ae=j(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.default=void 0;var qt=Ut(_e());function Ut(a){return a&&a.__esModule?a:{default:a}}var Gt=function(o){function l(E){window.console&&console.log(o+" "+E)}return{debug:function(x){qt.default.logLevel==="debug"&&l("[DEBUG] "+x)},addInfoMessage:function(x){l("[INFO] "+x)},addErrorMessage:function(x){l("[ERROR] "+x)},addWarnMessage:function(x){l("[WARN] "+x)}}},Pt=Gt;qe.default=Pt});var vn=j(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.default=void 0;var Ht=function(o){var l=[],E=0;return{subscribe:function(u,S){var p=E++;return l.push({event:u,callback:S,id:p}),p},unsubscribe:function(u){for(var S=0;S<l.length;S++)u===l[S].id&&l.splice(S,1)},publish:function(u,S){for(var p=this._getSubscriptions(u),h=0;h<p.length;h++)p[h].callback.apply(null,S)},getEvents:function(){return o},_getSubscriptions:function(u){for(var S=[],p=0;p<l.length;p++)l[p].event===u&&S.push(l[p]);return S}}},Wt=Ht;Ge.default=Wt});var He=j(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.default=void 0;var Qt=zt(ae());function zt(a){return a&&a.__esModule?a:{default:a}}var Vt=function(o,l,E){var x,u,S=new Qt.default("amb.ChannelListener"),p=o;return{getCallback:function(){return u},getSubscriptionCallback:function(){return E},getID:function(){return x},setNewChannel:function(d){p.unsubscribe(this),p=d,this.subscribe(u)},subscribe:function(d){return u=d,x=p.subscribe(this),this},resubscribe:function(){return this.subscribe(u)},unsubscribe:function(){return p.unsubscribe(this),S.debug("Unsubscribed from channel: "+p.getName()),this},publish:function(d){p.publish(d)},getName:function(){return p.getName()}}},Xt=Vt;Pe.default=Xt});var pn=j(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.default=void 0;var Kt=qn(ae()),Jt=qn(He());function qn(a){return a&&a.__esModule?a:{default:a}}var Yt=function(o,l){var E,x=o,u=new Kt.default("amb.ChannelRedirect");function S(h,d){for(var k=h.getChannelListeners(),c=0;c<k.length;c++){var t=k[c];t.setNewChannel(d)}}function p(h){u.debug("_onAdvice:"+h.data.clientId);var d=l.getChannel(h.data.fromChannel),k=l.getChannel(h.data.toChannel);if(!d||!k){u.debug("Could not redirect from "+h.data.fromChannel+" to "+h.data.toChannel);return}S(d,k),u.debug("published channel switch event, fromChannel:"+d.getName()+", toChannel:"+k.getName())}return{initialize:function(d){var k="/sn/meta/channel_redirect/"+x.getClientId(),c=l.getChannel(k);!E||c!==E?(E&&l.removeChannel(E.getName()),E=c,new Jt.default(E,l,d).subscribe(p)):E.subscribeToCometD(),u.debug("ChannelRedirect initialized: "+k)},_onAdvice:p}},jt=Yt;We.default=jt});var Qe=j(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.isEmptyObject=ie.isObject=ie.isNil=ie.isNull=ie.isUndefined=void 0;function ze(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ze=function(l){return typeof l}:ze=function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},ze(a)}var Gn=function(o){return o===void 0};ie.isUndefined=Gn;var Pn=function(o){return o===null};ie.isNull=Pn;var Zt=function(o){return Pn(o)||Gn(o)};ie.isNil=Zt;var Hn=function(o){return o!=null&&ze(o)==="object"};ie.isObject=Hn;var $t=function(o){return Hn(o)&&Object.keys(o).length===0};ie.isEmptyObject=$t});var zn=j((mn,Wn)=>{(function(a,o){typeof mn=="object"?Wn.exports=o():typeof define=="function"&&define.amd?define([],o):(a.org=a.org||{},a.org.cometd=o())})(mn,function(){var a={isString:function(c){return c==null?!1:typeof c=="string"||c instanceof String},isArray:function(c){return c==null?!1:c instanceof Array},inArray:function(c,t){for(var _=0;_<t.length;++_)if(c===t[_])return _;return-1},setTimeout:function(c,t,_){return window.setTimeout(function(){try{c._debug("Invoking timed function",t),t()}catch(g){c._debug("Exception invoking timed function",t,g)}},_)},clearTimeout:function(c){window.clearTimeout(c)}},o=function(){var c=[],t={};this.getTransportTypes=function(){return c.slice(0)},this.findTransportTypes=function(_,g,r){for(var n=[],m=0;m<c.length;++m){var y=c[m];t[y].accept(_,g,r)===!0&&n.push(y)}return n},this.negotiateTransport=function(_,g,r,n){for(var m=0;m<c.length;++m)for(var y=c[m],L=0;L<_.length;++L)if(y===_[L]){var N=t[y];if(N.accept(g,r,n)===!0)return N}return null},this.add=function(_,g,r){for(var n=!1,m=0;m<c.length;++m)if(c[m]===_){n=!0;break}return n||(typeof r!="number"?c.push(_):c.splice(r,0,_),t[_]=g),!n},this.find=function(_){for(var g=0;g<c.length;++g)if(c[g]===_)return t[_];return null},this.remove=function(_){for(var g=0;g<c.length;++g)if(c[g]===_){c.splice(g,1);var r=t[_];return delete t[_],r}return null},this.clear=function(){c=[],t={}},this.reset=function(_){for(var g=0;g<c.length;++g)t[c[g]].reset(_)}},l=function(){var c,t,_;this.registered=function(g,r){c=g,t=r},this.unregistered=function(){c=null,t=null},this._debug=function(){t._debug.apply(t,arguments)},this._mixin=function(){return t._mixin.apply(t,arguments)},this.getConfiguration=function(){return t.getConfiguration()},this.getAdvice=function(){return t.getAdvice()},this.setTimeout=function(g,r){return a.setTimeout(t,g,r)},this.clearTimeout=function(g){a.clearTimeout(g)},this.convertToMessages=function(g){if(a.isString(g))try{return JSON.parse(g)}catch(r){throw this._debug("Could not convert to JSON the following string",'"'+g+'"'),r}if(a.isArray(g))return g;if(g==null)return[];if(g instanceof Object)return[g];throw"Conversion Error "+g+", typeof "+typeof g},this.accept=function(g,r,n){throw"Abstract"},this.getType=function(){return c},this.getURL=function(){return _},this.setURL=function(g){_=g},this.send=function(g,r){throw"Abstract"},this.reset=function(g){this._debug("Transport",c,"reset",g?"initial":"retry")},this.abort=function(){this._debug("Transport",c,"aborted")},this.toString=function(){return this.getType()}};l.derive=function(c){function t(){}return t.prototype=c,new t};var E=function(){var c=new l,t=l.derive(c),_=0,g=null,r=[],n=[];function m(O){for(;n.length>0;){var w=n[0],I=w[0],V=w[1];if(I.url===O.url&&I.sync===O.sync){n.shift(),O.messages=O.messages.concat(I.messages),this._debug("Coalesced",I.messages.length,"messages from request",V.id);continue}break}}function y(O,w){if(this.transportSend(O,w),w.expired=!1,!O.sync){var I=this.getConfiguration().maxNetworkDelay,V=I;w.metaConnect===!0&&(V+=this.getAdvice().timeout),this._debug("Transport",this.getType(),"waiting at most",V,"ms for the response, maxNetworkDelay",I);var s=this;w.timeout=this.setTimeout(function(){w.expired=!0;var b="Request "+w.id+" of transport "+s.getType()+" exceeded "+V+" ms max network delay",R={reason:b},M=w.xhr;R.httpCode=s.xhrStatus(M),s.abortXHR(M),s._debug(b),s.complete(w,!1,w.metaConnect),O.onFailure(M,O.messages,R)},V)}}function L(O){var w=++_,I={id:w,metaConnect:!1,envelope:O};r.length<this.getConfiguration().maxConnections-1?(r.push(I),y.call(this,O,I)):(this._debug("Transport",this.getType(),"queueing request",w,"envelope",O),n.push([O,I]))}function N(O){var w=O.id;if(this._debug("Transport",this.getType(),"metaConnect complete, request",w),g!==null&&g.id!==w)throw"Longpoll request mismatch, completing request "+w;g=null}function B(O,w){var I=a.inArray(O,r);if(I>=0&&r.splice(I,1),n.length>0){var V=n.shift(),s=V[0],b=V[1];if(this._debug("Transport dequeued request",b.id),w)this.getConfiguration().autoBatch&&m.call(this,s),L.call(this,s),this._debug("Transport completed request",O.id,s);else{var R=this;this.setTimeout(function(){R.complete(b,!1,b.metaConnect);var M={reason:"Previous request failed"},A=b.xhr;M.httpCode=R.xhrStatus(A),s.onFailure(A,s.messages,M)},0)}}}t.complete=function(O,w,I){I?N.call(this,O):B.call(this,O,w)},t.transportSend=function(O,w){throw"Abstract"},t.transportSuccess=function(O,w,I){w.expired||(this.clearTimeout(w.timeout),this.complete(w,!0,w.metaConnect),I&&I.length>0?O.onSuccess(I):O.onFailure(w.xhr,O.messages,{httpCode:204}))},t.transportFailure=function(O,w,I){w.expired||(this.clearTimeout(w.timeout),this.complete(w,!1,w.metaConnect),O.onFailure(w.xhr,O.messages,I))};function H(O){if(g!==null)throw"Concurrent metaConnect requests not allowed, request id="+g.id+" not yet completed";var w=++_;this._debug("Transport",this.getType(),"metaConnect send, request",w,"envelope",O);var I={id:w,metaConnect:!0,envelope:O};y.call(this,O,I),g=I}return t.send=function(O,w){w?H.call(this,O):L.call(this,O)},t.abort=function(){c.abort();for(var O=0;O<r.length;++O){var w=r[O];w&&(this._debug("Aborting request",w),this.abortXHR(w.xhr)||this.transportFailure(w.envelope,w,{reason:"abort"}))}var I=g;I&&(this._debug("Aborting metaConnect request",I),this.abortXHR(I.xhr)||this.transportFailure(I.envelope,I,{reason:"abort"})),this.reset(!0)},t.reset=function(O){c.reset(O),g=null,r=[],n=[]},t.abortXHR=function(O){if(O)try{var w=O.readyState;return O.abort(),w!==window.XMLHttpRequest.UNSENT}catch(I){this._debug(I)}return!1},t.xhrStatus=function(O){if(O)try{return O.status}catch(w){this._debug(w)}return-1},t},x=function(){var c=new E,t=l.derive(c),_=!0;return t.accept=function(g,r,n){return _||!r},t.newXMLHttpRequest=function(){return new window.XMLHttpRequest},t.xhrSend=function(g){var r=t.newXMLHttpRequest();r.context=t.context,r.withCredentials=!0,r.open("POST",g.url,g.sync!==!0);var n=g.headers;if(n)for(var m in n)n.hasOwnProperty(m)&&r.setRequestHeader(m,n[m]);return r.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.onload=function(){r.status===200?g.onSuccess(r.responseText):g.onError(r.statusText)},r.onerror=function(){g.onError(r.statusText)},r.send(g.body),r},t.transportSend=function(g,r){this._debug("Transport",this.getType(),"sending request",r.id,"envelope",g);var n=this;try{var m=!0;r.xhr=this.xhrSend({transport:this,url:g.url,sync:g.sync,headers:this.getConfiguration().requestHeaders,body:JSON.stringify(g.messages),onSuccess:function(y){n._debug("Transport",n.getType(),"received response",y);var L=!1;try{var N=n.convertToMessages(y);N.length===0?(_=!1,n.transportFailure(g,r,{httpCode:204})):(L=!0,n.transportSuccess(g,r,N))}catch(H){if(n._debug(H),!L){_=!1;var B={exception:H};B.httpCode=n.xhrStatus(r.xhr),n.transportFailure(g,r,B)}}},onError:function(y,L){n._debug("Transport",n.getType(),"received error",y,L),_=!1;var N={reason:y,exception:L};N.httpCode=n.xhrStatus(r.xhr),m?n.setTimeout(function(){n.transportFailure(g,r,N)},0):n.transportFailure(g,r,N)}}),m=!1}catch(y){_=!1,this.setTimeout(function(){n.transportFailure(g,r,{exception:y})},0)}},t.reset=function(g){c.reset(g),_=!0},t},u=function(){var c=new E,t=l.derive(c),_=0;t.accept=function(r,n,m){return!0},t.jsonpSend=function(r){var n=document.getElementsByTagName("head")[0],m=document.createElement("script"),y="_cometd_jsonp_"+_++;window[y]=function(N){n.removeChild(m),delete window[y],r.onSuccess(N)};var L=r.url;L+=L.indexOf("?")<0?"?":"&",L+="jsonp="+y,L+="&message="+encodeURIComponent(r.body),m.src=L,m.async=r.sync!==!0,m.type="application/javascript",m.onerror=function(N){r.onError("jsonp "+N.type)},n.appendChild(m)};function g(r,n,m){var y=this;return function(){y.transportFailure(r,n,"error",m)}}return t.transportSend=function(r,n){for(var m=this,y=0,L=r.messages.length,N=[];L>0;){var B=JSON.stringify(r.messages.slice(y,y+L)),H=r.url.length+encodeURI(B).length,O=this.getConfiguration().maxURILength;if(H>O){if(L===1){var w="Bayeux message too big ("+H+" bytes, max is "+O+") for transport "+this.getType();this.setTimeout(g.call(this,r,n,w),0);return}--L;continue}N.push(L),y+=L,L=r.messages.length-y}var I=r;if(N.length>1){var V=0,s=N[0];this._debug("Transport",this.getType(),"split",r.messages.length,"messages into",N.join(" + ")),I=this._mixin(!1,{},r),I.messages=r.messages.slice(V,s),I.onSuccess=r.onSuccess,I.onFailure=r.onFailure;for(var b=1;b<N.length;++b){var R=this._mixin(!1,{},r);V=s,s+=N[b],R.messages=r.messages.slice(V,s),R.onSuccess=r.onSuccess,R.onFailure=r.onFailure,this.send(R,n.metaConnect)}}this._debug("Transport",this.getType(),"sending request",n.id,"envelope",I);try{var M=!0;this.jsonpSend({transport:this,url:I.url,sync:I.sync,headers:this.getConfiguration().requestHeaders,body:JSON.stringify(I.messages),onSuccess:function(A){var q=!1;try{var W=m.convertToMessages(A);W.length===0?m.transportFailure(I,n,{httpCode:204}):(q=!0,m.transportSuccess(I,n,W))}catch(Z){m._debug(Z),q||m.transportFailure(I,n,{exception:Z})}},onError:function(A,q){var W={reason:A,exception:q};M?m.setTimeout(function(){m.transportFailure(I,n,W)},0):m.transportFailure(I,n,W)}}),M=!1}catch(A){this.setTimeout(function(){m.transportFailure(I,n,{exception:A})},0)}},t},S=function(){var c=new l,t=l.derive(c),_,g=!0,r=!1,n=!0,m=null,y=null,L=!1,N=null;t.reset=function(s){c.reset(s),g=!0,s&&(r=!1),n=!0,m=null,y=null,L=!1};function B(s,b){s&&(this.webSocketClose(s,b.code,b.reason),this.onClose(s,b))}function H(s){return s===y||s===m}function O(s,b,R){for(var M=[],A=0;A<b.messages.length;++A){var q=b.messages[A];q.id&&M.push(q.id)}s.envelopes[M.join(",")]=[b,R],this._debug("Transport",this.getType(),"stored envelope, envelopes",s.envelopes)}function w(s){if(!y){var b=_.getURL().replace(/^http/,"ws");this._debug("Transport",this.getType(),"connecting to URL",b);try{var R=_.getConfiguration().protocol;s.webSocket=R?new window.WebSocket(b,R):new window.WebSocket(b),y=s}catch(X){throw g=!1,this._debug("Exception while creating WebSocket object",X),X}n=_.getConfiguration().stickyReconnect!==!1;var M=this,A=_.getConfiguration().connectTimeout;A>0&&(s.connectTimer=this.setTimeout(function(){_._debug("Transport",M.getType(),"timed out while connecting to URL",b,":",A,"ms"),B.call(M,s,{code:1e3,reason:"Connect Timeout"})},A));var q=function(){_._debug("WebSocket onopen",s),s.connectTimer&&M.clearTimeout(s.connectTimer),H(s)?(y=null,m=s,r=!0,M.onOpen(s)):(_._warn("Closing extra WebSocket connection",this,"active connection",m),B.call(M,s,{code:1e3,reason:"Extra Connection"}))},W=function(X){X=X||{code:1e3},_._debug("WebSocket onclose",s,X,"connecting",y,"current",m),s.connectTimer&&M.clearTimeout(s.connectTimer),M.onClose(s,X)},Z=function(X){_._debug("WebSocket onmessage",X,s),M.onMessage(s,X)};s.webSocket.onopen=q,s.webSocket.onclose=W,s.webSocket.onerror=function(){W({code:1e3,reason:"Error"})},s.webSocket.onmessage=Z,this._debug("Transport",this.getType(),"configured callbacks on",s)}}function I(s,b,R){var M=JSON.stringify(b.messages);s.webSocket.send(M),this._debug("Transport",this.getType(),"sent",b,"metaConnect =",R);var A=this.getConfiguration().maxNetworkDelay,q=A;R&&(q+=this.getAdvice().timeout,L=!0);for(var W=this,Z=[],X=0;X<b.messages.length;++X)(function(){var K=b.messages[X];K.id&&(Z.push(K.id),s.timeouts[K.id]=W.setTimeout(function(){_._debug("Transport",W.getType(),"timing out message",K.id,"after",q,"on",s),B.call(W,s,{code:1e3,reason:"Message Timeout"})},q))})();this._debug("Transport",this.getType(),"waiting at most",q,"ms for messages",Z,"maxNetworkDelay",A,", timeouts:",s.timeouts)}t._notifySuccess=function(s,b){s.call(this,b)},t._notifyFailure=function(s,b,R,M){s.call(this,b,R,M)};function V(s,b,R){try{s===null?(s=y||{envelopes:{},timeouts:{}},O.call(this,s,b,R),w.call(this,s)):(O.call(this,s,b,R),I.call(this,s,b,R))}catch(A){var M=this;this.setTimeout(function(){B.call(M,s,{code:1e3,reason:"Exception",exception:A})},0)}}return t.onOpen=function(s){var b=s.envelopes;this._debug("Transport",this.getType(),"opened",s,"pending messages",b);for(var R in b)if(b.hasOwnProperty(R)){var M=b[R],A=M[0],q=M[1];N=A.onSuccess,I.call(this,s,A,q)}},t.onMessage=function(s,b){this._debug("Transport",this.getType(),"received websocket message",b,s);for(var R=!1,M=this.convertToMessages(b.data),A=[],q=0;q<M.length;++q){var W=M[q];if((/^\/meta\//.test(W.channel)||W.data===void 0)&&W.id){A.push(W.id);var Z=s.timeouts[W.id];Z&&(this.clearTimeout(Z),delete s.timeouts[W.id],this._debug("Transport",this.getType(),"removed timeout for message",W.id,", timeouts",s.timeouts))}W.channel==="/meta/connect"&&(L=!1),W.channel==="/meta/disconnect"&&!L&&(R=!0)}for(var X=!1,K=s.envelopes,z=0;z<A.length;++z){var pe=A[z];for(var ee in K)if(K.hasOwnProperty(ee)){var G=ee.split(","),oe=a.inArray(pe,G);if(oe>=0){X=!0,G.splice(oe,1);var ge=K[ee][0],le=K[ee][1];delete K[ee],G.length>0&&(K[G.join(",")]=[ge,le]);break}}}X&&this._debug("Transport",this.getType(),"removed envelope, envelopes",K),this._notifySuccess(N,M),R&&this.webSocketClose(s,1e3,"Disconnect")},t.onClose=function(s,b){this._debug("Transport",this.getType(),"closed",s,b),H(s)&&(g=n&&r,y=null,m=null);var R=s.timeouts;s.timeouts={};for(var M in R)R.hasOwnProperty(M)&&this.clearTimeout(R[M]);var A=s.envelopes;s.envelopes={};for(var q in A)if(A.hasOwnProperty(q)){var W=A[q][0],Z=A[q][1];Z&&(L=!1);var X={websocketCode:b.code,reason:b.reason};b.exception&&(X.exception=b.exception),this._notifyFailure(W.onFailure,s,W.messages,X)}},t.registered=function(s,b){c.registered(s,b),_=b},t.accept=function(s,b,R){return this._debug("Transport",this.getType(),"accept, supported:",g),g&&!!window.WebSocket&&_.websocketEnabled!==!1},t.send=function(s,b){this._debug("Transport",this.getType(),"sending",s,"metaConnect =",b),V.call(this,m,s,b)},t.webSocketClose=function(s,b,R){try{s.webSocket&&s.webSocket.close(b,R)}catch(M){this._debug(M)}},t.abort=function(){c.abort(),B.call(this,m,{code:1e3,reason:"Abort"}),this.reset(!0)},t},p=function(c){var t=this,_=c||"default",g=!1,r=new o,n,m="disconnected",y=0,L=null,N=0,B=[],H=!1,O=0,w={},I=0,V=null,s=[],b={},R,M,A={},q={},W=!1,Z=!1,X=0,K=0,z={protocol:null,stickyReconnect:!0,connectTimeout:0,maxConnections:2,backoffIncrement:1e3,maxBackoff:6e4,logLevel:"info",maxNetworkDelay:1e4,requestHeaders:{},appendMessageTypeToURL:!0,autoBatch:!1,urls:{},maxURILength:2e3,advice:{timeout:6e4,interval:0,reconnect:void 0,maxInterval:0}};function pe(e,i){try{return e[i]}catch(f){return}}this._mixin=function(e,i,f){for(var v=i||{},C=2;C<arguments.length;++C){var D=arguments[C];if(D!=null){for(var P in D)if(D.hasOwnProperty(P)){var U=pe(D,P),$=pe(v,P);if(U===i||U===void 0)continue;if(e&&typeof U=="object"&&U!==null)if(U instanceof Array)v[P]=this._mixin(e,$ instanceof Array?$:[],U);else{var ue=typeof $=="object"&&!($ instanceof Array)?$:{};v[P]=this._mixin(e,ue,U)}else v[P]=U}}}return v};function ee(e){return a.isString(e)}function G(e){return e==null?!1:typeof e=="function"}function oe(e,i){for(var f="";--i>0&&!(e>=Math.pow(10,i));)f+="0";return f+=e,f}function ge(e,i){if(window.console){var f=window.console[e];if(G(f)){var v=new Date;[].splice.call(i,0,0,oe(v.getHours(),2)+":"+oe(v.getMinutes(),2)+":"+oe(v.getSeconds(),2)+"."+oe(v.getMilliseconds(),3)),f.apply(window.console,i)}}}this._warn=function(){ge("warn",arguments)},this._info=function(){z.logLevel!=="warn"&&ge("info",arguments)},this._debug=function(){z.logLevel==="debug"&&ge("debug",arguments)};function le(e){return/(^https?:\/\/)?(((\[[^\]]+\])|([^:\/\?#]+))(:(\d+))?)?([^\?#]*)(.*)?/.exec(e)}this._isCrossDomain=function(e){return window.location&&window.location.host&&e?e!==window.location.host:!1};function un(e){t._debug("Configuring cometd object with",e),ee(e)&&(e={url:e}),e||(e={}),z=t._mixin(!1,z,e);var i=t.getURL();if(!i)throw"Missing required configuration parameter 'url' specifying the Bayeux server URL";var f=le(i),v=f[2],C=f[8],D=f[9];if(g=t._isCrossDomain(v),z.appendMessageTypeToURL)if(D!==void 0&&D.length>0)t._info("Appending message type to URI "+C+D+" is not supported, disabling 'appendMessageTypeToURL' configuration"),z.appendMessageTypeToURL=!1;else{var P=C.split("/"),U=P.length-1;C.match(/\/$/)&&(U-=1),P[U].indexOf(".")>=0&&(t._info("Appending message type to URI "+C+" is not supported, disabling 'appendMessageTypeToURL' configuration"),z.appendMessageTypeToURL=!1)}}function Ne(e){if(e){var i=w[e.channel];i&&i[e.id]&&(delete i[e.id],t._debug("Removed",e.listener?"listener":"subscription",e))}}function Re(e){e&&!e.listener&&Ne(e)}function De(){for(var e in w)if(w.hasOwnProperty(e)){var i=w[e];if(i)for(var f in i)i.hasOwnProperty(f)&&Re(i[f])}}function fe(e){m!==e&&(t._debug("Status",m,"->",e),m=e)}function ne(){return m==="disconnecting"||m==="disconnected"}function de(){var e=++y;return""+e}function xe(e,i,f,v,C){try{return i.call(e,v)}catch(P){var D=t.onExtensionException;if(G(D)){t._debug("Invoking extension exception handler",f,P);try{D.call(t,P,f,C,v)}catch(U){t._info("Exception during execution of extension exception handler",f,U)}}else t._info("Exception during execution of extension",f,P);return v}}function cn(e){for(var i=0;i<s.length&&e!=null;++i){var f=s[i],v=f.extension.incoming;if(G(v)){var C=xe(f.extension,v,f.name,e,!1);e=C===void 0?e:C}}return e}function ln(e){for(var i=s.length-1;i>=0&&e!=null;--i){var f=s[i],v=f.extension.outgoing;if(G(v)){var C=xe(f.extension,v,f.name,e,!0);e=C===void 0?e:C}}return e}function Ee(e,i){var f=w[e];if(f){for(var v in f)if(f.hasOwnProperty(v)){var C=f[v];if(C)try{C.callback.call(C.scope,i)}catch(P){var D=t.onListenerException;if(G(D)){t._debug("Invoking listener exception handler",C,P);try{D.call(t,P,C,C.listener,i)}catch(U){t._info("Exception during execution of listener exception handler",C,U)}}else t._info("Exception during execution of listener",C,i,P)}}}}function Y(e,i){Ee(e,i);for(var f=e.split("/"),v=f.length-1,C=v;C>0;--C){var D=f.slice(0,C).join("/")+"/*";C===v&&Ee(D,i),D+="*",Ee(D,i)}}function Me(){V!==null&&a.clearTimeout(V),V=null}function Ae(e,i){Me();var f=b.interval+i;t._debug("Function scheduled in",f,"ms, interval =",b.interval,"backoff =",I,e),V=a.setTimeout(t,e,f)}var Fe,we;function te(e,i,f,v){for(var C=0;C<i.length;++C){var D=i[C],P=D.id;L&&(D.clientId=L),D=ln(D),D!=null?(D.id=P,i[C]=D):(delete A[P],i.splice(C--,1))}if(i.length!==0){var U=t.getURL();z.appendMessageTypeToURL&&(U.match(/\/$/)||(U=U+"/"),v&&(U=U+v));var $={url:U,sync:e,messages:i,onSuccess:function(ue){try{Fe.call(t,ue)}catch(ye){t._info("Exception during handling of messages",ye)}},onFailure:function(ue,ye,Le){try{var Ue=t.getTransport();Le.connectionType=Ue?Ue.getType():"unknown",we.call(t,ue,ye,Le)}catch(gn){t._info("Exception during handling of failure",gn)}}};t._debug("Send",$),n.send($,f)}}function me(e){N>0||H===!0?B.push(e):te(!1,[e],!1)}this.send=me;function Te(){I=0}function T(){return I<z.maxBackoff&&(I+=z.backoffIncrement),I}function F(){++N,t._debug("Starting batch, depth",N)}function Q(){var e=B;B=[],e.length>0&&te(!1,e,!1)}function re(){if(--N,t._debug("Ending batch, depth",N),N<0)throw"Calls to startBatch() and endBatch() are not paired";N===0&&!ne()&&!H&&Q()}function Oe(){if(!ne()){var e={id:de(),channel:"/meta/connect",connectionType:n.getType()};Z||(e.advice={timeout:0}),fe("connecting"),t._debug("Connect sent",e),te(!1,[e],!0,"connect"),fe("connected")}}function Be(e){fe("connecting"),Ae(function(){Oe()},e)}function wn(e){e&&(b=t._mixin(!1,{},z.advice,e),t._debug("New advice",b))}function ke(e){if(Me(),e&&n&&n.abort(),L=null,fe("disconnected"),N=0,Te(),n=null,W=!1,Z=!1,B.length>0){var i=B;B=[],we.call(t,void 0,i,{reason:"Disconnected"})}}function fn(e,i,f){var v=t.onTransportException;if(G(v)){t._debug("Invoking transport exception handler",e,i,f);try{v.call(t,f,e,i)}catch(C){t._info("Exception during execution of transport exception handler",C)}}}function On(e,i){G(e)&&(i=e,e=void 0),L=null,De(),ne()&&r.reset(!0),wn({}),N=0,H=!0,R=e,M=i;var f="1.0",v=t.getURL(),C=r.findTransportTypes(f,g,v),D={id:de(),version:f,minimumVersion:f,channel:"/meta/handshake",supportedConnectionTypes:C,advice:{timeout:b.timeout,interval:b.interval}},P=t._mixin(!1,{},R,D);if(t._putCallback(P.id,i),!n&&(n=r.negotiateTransport(C,f,g,v),!n)){var U="Could not find initial transport among: "+r.getTransportTypes();throw t._warn(U),U}t._debug("Initial transport is",n.getType()),fe("handshaking"),t._debug("Handshake sent",P),te(!1,[P],!1,"handshake")}function ht(e){fe("handshaking"),H=!0,Ae(function(){On(R,M)},e)}function kn(e,i){try{e.call(t,i)}catch(v){var f=t.onCallbackException;if(G(f)){t._debug("Invoking callback exception handler",v);try{f.call(t,v,i)}catch(C){t._info("Exception during execution of callback exception handler",C)}}else t._info("Exception during execution of message callback",v)}}this._getCallback=function(e){return A[e]},this._putCallback=function(e,i){var f=this._getCallback(e);return G(i)&&(A[e]=i),f};function se(e){var i=t._getCallback([e.id]);G(i)&&(delete A[e.id],kn(i,e))}function Ln(e){var i=q[e.id];if(delete q[e.id],i){t._debug("Handling remote call response for",e,"with context",i);var f=i.timeout;f&&a.clearTimeout(f);var v=i.callback;if(G(v))return kn(v,e),!0}return!1}this.onTransportFailure=function(e,i,f){this._debug("Transport failure",i,"for",e);var v=this.getTransportRegistry(),C=this.getURL(),D=this._isCrossDomain(le(C)[2]),P="1.0",U=v.findTransportTypes(P,D,C);if(i.action==="none"){if(e.channel==="/meta/handshake"&&!i.transport){var $="Could not negotiate transport, client=["+U+"], server=["+e.supportedConnectionTypes+"]";this._warn($),fn(n.getType(),null,{reason:$,connectionType:n.getType(),transport:n})}}else if(i.delay=this.getBackoffPeriod(),e.channel==="/meta/handshake"){if(!i.transport){var ue=v.negotiateTransport(U,P,D,C);ue?(this._debug("Transport",n.getType(),"->",ue.getType()),fn(n.getType(),ue.getType(),e.failure),i.action="handshake",i.transport=ue):(this._warn("Could not negotiate transport, client=["+U+"]"),fn(n.getType(),null,e.failure),i.action="none")}i.action!=="none"&&this.increaseBackoffPeriod()}else{var ye=new Date().getTime();if(X===0&&(X=ye),i.action==="retry"){i.delay=this.increaseBackoffPeriod();var Le=b.maxInterval;if(Le>0){var Ue=b.timeout+b.interval+Le,gn=ye-X;gn+I>Ue&&(i.action="handshake")}}i.action==="handshake"&&(i.delay=0,v.reset(!1),this.resetBackoffPeriod())}f.call(t,i)};function In(e){t._debug("Transport failure handling",e),e.transport&&(n=e.transport),e.url&&n.setURL(e.url);var i=e.action,f=e.delay||0;switch(i){case"handshake":ht(f);break;case"retry":Be(f);break;case"none":ke(!0);break;default:throw"Unknown action "+i}}function dn(e,i){se(e),Y("/meta/handshake",e),Y("/meta/unsuccessful",e),ne()&&(i.action="none"),t.onTransportFailure.call(t,e,i,In)}function gt(e){var i=t.getURL();if(e.successful){var f=t._isCrossDomain(le(i)[2]),v=r.negotiateTransport(e.supportedConnectionTypes,e.version,f,i);if(v===null){e.successful=!1,dn(e,{cause:"negotiation",action:"none",transport:null});return}else n!==v&&(t._debug("Transport",n.getType(),"->",v.getType()),n=v);L=e.clientId,H=!1,Q(),e.reestablish=W,W=!0,se(e),Y("/meta/handshake",e),K=e["x-messages"]||0;var C=ne()?"none":b.reconnect||"retry";switch(C){case"retry":Te(),K===0?Be(0):t._debug("Processing",K,"handshake-delivered messages");break;case"none":ke(!0);break;default:throw"Unrecognized advice action "+C}}else dn(e,{cause:"unsuccessful",action:b.reconnect||"handshake",transport:n})}function bt(e){dn(e,{cause:"failure",action:"handshake",transport:null})}function Nn(e,i){Y("/meta/connect",e),Y("/meta/unsuccessful",e),ne()&&(i.action="none"),t.onTransportFailure.call(t,e,i,In)}function vt(e){if(Z=e.successful,Z){Y("/meta/connect",e);var i=ne()?"none":b.reconnect||"retry";switch(i){case"retry":Te(),Be(I);break;case"none":ke(!1);break;default:throw"Unrecognized advice action "+i}}else Nn(e,{cause:"unsuccessful",action:b.reconnect||"retry",transport:n})}function pt(e){Z=!1,Nn(e,{cause:"failure",action:"retry",transport:null})}function Rn(e){ke(!0),se(e),Y("/meta/disconnect",e),Y("/meta/unsuccessful",e)}function mt(e){e.successful?(ke(!1),se(e),Y("/meta/disconnect",e)):Rn(e)}function _t(e){Rn(e)}function Dn(e){var i=w[e.subscription];if(i){for(var f in i)if(i.hasOwnProperty(f)){var v=i[f];v&&!v.listener&&(delete i[f],t._debug("Removed failed subscription",v))}}se(e),Y("/meta/subscribe",e),Y("/meta/unsuccessful",e)}function Ct(e){e.successful?(se(e),Y("/meta/subscribe",e)):Dn(e)}function St(e){Dn(e)}function Mn(e){se(e),Y("/meta/unsubscribe",e),Y("/meta/unsuccessful",e)}function Tt(e){e.successful?(se(e),Y("/meta/unsubscribe",e)):Mn(e)}function yt(e){Mn(e)}function hn(e){Ln(e)||(se(e),Y("/meta/publish",e),Y("/meta/unsuccessful",e))}function xt(e){e.data!==void 0?Ln(e)||(Y(e.channel,e),K>0&&(--K,K===0&&(t._debug("Processed last handshake-delivered message"),Be(0)))):e.successful===void 0?t._warn("Unknown Bayeux Message",e):e.successful?(se(e),Y("/meta/publish",e)):hn(e)}function Et(e){hn(e)}function An(e){if(X=0,e=cn(e),e!=null){wn(e.advice);var i=e.channel;switch(i){case"/meta/handshake":gt(e);break;case"/meta/connect":vt(e);break;case"/meta/disconnect":mt(e);break;case"/meta/subscribe":Ct(e);break;case"/meta/unsubscribe":Tt(e);break;default:xt(e);break}}}this.receive=An,Fe=function(e){t._debug("Received",e);for(var i=0;i<e.length;++i){var f=e[i];An(f)}},we=function(e,i,f){t._debug("handleFailure",e,i,f),f.transport=e;for(var v=0;v<i.length;++v){var C=i[v],D={id:C.id,successful:!1,channel:C.channel,failure:f};switch(f.message=C,C.channel){case"/meta/handshake":bt(D);break;case"/meta/connect":pt(D);break;case"/meta/disconnect":_t(D);break;case"/meta/subscribe":D.subscription=C.subscription,St(D);break;case"/meta/unsubscribe":D.subscription=C.subscription,yt(D);break;default:Et(D);break}}};function Fn(e){var i=w[e];if(i){for(var f in i)if(i.hasOwnProperty(f)&&i[f])return!0}return!1}function Bn(e,i){var f={scope:e,method:i};if(G(e))f.scope=void 0,f.method=e;else if(ee(i)){if(!e)throw"Invalid scope "+e;if(f.method=e[i],!G(f.method))throw"Invalid callback "+i+" for scope "+e}else if(!G(i))throw"Invalid callback "+i;return f}function Un(e,i,f,v){var C=Bn(i,f);t._debug("Adding",v?"listener":"subscription","on",e,"with scope",C.scope,"and callback",C.method);var D=++O,P={id:D,channel:e,scope:C.scope,callback:C.method,listener:v},U=w[e];return U||(U={},w[e]=U),U[D]=P,t._debug("Added",v?"listener":"subscription",P),P}this.registerTransport=function(e,i,f){var v=r.add(e,i,f);return v&&(this._debug("Registered transport",e),G(i.registered)&&i.registered(e,this)),v},this.unregisterTransport=function(e){var i=r.remove(e);return i!==null&&(this._debug("Unregistered transport",e),G(i.unregistered)&&i.unregistered()),i},this.unregisterTransports=function(){r.clear()},this.getTransportTypes=function(){return r.getTransportTypes()},this.findTransport=function(e){return r.find(e)},this.getTransportRegistry=function(){return r},this.configure=function(e){un.call(this,e)},this.init=function(e,i){this.configure(e),this.handshake(i)},this.handshake=function(e,i){if(m!=="disconnected")throw"Illegal state: handshaken";On(e,i)},this.disconnect=function(e,i,f){if(!ne()){typeof e!="boolean"&&(f=i,i=e,e=!1),G(i)&&(f=i,i=void 0);var v={id:de(),channel:"/meta/disconnect"},C=this._mixin(!1,{},i,v);t._putCallback(C.id,f),fe("disconnecting"),te(e===!0,[C],!1,"disconnect")}},this.startBatch=function(){F()},this.endBatch=function(){re()},this.batch=function(e,i){var f=Bn(e,i);this.startBatch();try{f.method.call(f.scope),this.endBatch()}catch(v){throw this._info("Exception during execution of batch",v),this.endBatch(),v}},this.addListener=function(e,i,f){if(arguments.length<2)throw"Illegal arguments number: required 2, got "+arguments.length;if(!ee(e))throw"Illegal argument type: channel must be a string";return Un(e,i,f,!0)},this.removeListener=function(e){if(!e||!e.channel||!("id"in e))throw"Invalid argument: expected subscription, not "+e;Ne(e)},this.clearListeners=function(){w={}},this.subscribe=function(e,i,f,v,C){if(arguments.length<2)throw"Illegal arguments number: required 2, got "+arguments.length;if(!ee(e))throw"Illegal argument type: channel must be a string";if(ne())throw"Illegal state: disconnected";G(i)&&(C=v,v=f,f=i,i=void 0),G(v)&&(C=v,v=void 0);var D=!Fn(e),P=Un(e,i,f,!1);if(D){var U={id:de(),channel:"/meta/subscribe",subscription:e},$=this._mixin(!1,{},v,U);t._putCallback($.id,C),me($)}return P},this.unsubscribe=function(e,i,f){if(arguments.length<1)throw"Illegal arguments number: required 1, got "+arguments.length;if(ne())throw"Illegal state: disconnected";G(i)&&(f=i,i=void 0),this.removeListener(e);var v=e.channel;if(!Fn(v)){var C={id:de(),channel:"/meta/unsubscribe",subscription:v},D=this._mixin(!1,{},i,C);t._putCallback(D.id,f),me(D)}},this.resubscribe=function(e,i){if(Re(e),e)return this.subscribe(e.channel,e.scope,e.callback,i)},this.clearSubscriptions=function(){De()},this.publish=function(e,i,f,v){if(arguments.length<1)throw"Illegal arguments number: required 1, got "+arguments.length;if(!ee(e))throw"Illegal argument type: channel must be a string";if(/^\/meta\//.test(e))throw"Illegal argument: cannot publish to meta channels";if(ne())throw"Illegal state: disconnected";G(i)?(v=i,i={},f=void 0):G(f)&&(v=f,f=void 0);var C={id:de(),channel:e,data:i},D=this._mixin(!1,{},f,C);t._putCallback(D.id,v),me(D)},this.publishBinary=function(e,i,f,v,C){G(i)?(C=i,i=new ArrayBuffer(0),f=!0,v=void 0):G(f)?(C=f,f=!0,v=void 0):G(v)&&(C=v,v=void 0);var D={meta:v,data:i,last:f},P={ext:{binary:{}}};this.publish(e,D,P,C)},this.remoteCall=function(e,i,f,v,C){if(arguments.length<1)throw"Illegal arguments number: required 1, got "+arguments.length;if(!ee(e))throw"Illegal argument type: target must be a string";if(ne())throw"Illegal state: disconnected";if(G(i)?(C=i,i={},f=z.maxNetworkDelay,v=void 0):G(f)?(C=f,f=z.maxNetworkDelay,v=void 0):G(v)&&(C=v,v=void 0),typeof f!="number")throw"Illegal argument type: timeout must be a number";e.match(/^\//)||(e="/"+e);var D="/service"+e,P={id:de(),channel:D,data:i},U=this._mixin(!1,{},v,P),$={callback:C};f>0&&($.timeout=a.setTimeout(t,function(){t._debug("Timing out remote call",U,"after",f,"ms"),hn({id:U.id,error:"406::timeout",successful:!1,failure:{message:U,reason:"Remote Call Timeout"}})},f),t._debug("Scheduled remote call timeout",U,"in",f,"ms")),q[U.id]=$,me(U)},this.remoteCallBinary=function(e,i,f,v,C,D){G(i)?(D=i,i=new ArrayBuffer(0),f=!0,v=void 0,C=z.maxNetworkDelay):G(f)?(D=f,f=!0,v=void 0,C=z.maxNetworkDelay):G(v)?(D=v,v=void 0,C=z.maxNetworkDelay):G(C)&&(D=C,C=z.maxNetworkDelay);var P={meta:v,data:i,last:f},U={ext:{binary:{}}};this.remoteCall(e,P,C,U,D)},this.getStatus=function(){return m},this.isDisconnected=ne,this.setBackoffIncrement=function(e){z.backoffIncrement=e},this.getBackoffIncrement=function(){return z.backoffIncrement},this.getBackoffPeriod=function(){return I},this.increaseBackoffPeriod=function(){return T()},this.resetBackoffPeriod=function(){Te()},this.setLogLevel=function(e){z.logLevel=e},this.registerExtension=function(e,i){if(arguments.length<2)throw"Illegal arguments number: required 2, got "+arguments.length;if(!ee(e))throw"Illegal argument type: extension name must be a string";for(var f=!1,v=0;v<s.length;++v){var C=s[v];if(C.name===e){f=!0;break}}return f?(this._info("Could not register extension with name",e,"since another extension with the same name already exists"),!1):(s.push({name:e,extension:i}),this._debug("Registered extension",e),G(i.registered)&&i.registered(e,this),!0)},this.unregisterExtension=function(e){if(!ee(e))throw"Illegal argument type: extension name must be a string";for(var i=!1,f=0;f<s.length;++f){var v=s[f];if(v.name===e){s.splice(f,1),i=!0,this._debug("Unregistered extension",e);var C=v.extension;G(C.unregistered)&&C.unregistered();break}}return i},this.getExtension=function(e){for(var i=0;i<s.length;++i){var f=s[i];if(f.name===e)return f.extension}return null},this.getName=function(){return _},this.getClientId=function(){return L},this.getURL=function(){if(n){var e=n.getURL();if(e||(e=z.urls[n.getType()],e))return e}return z.url},this.getTransport=function(){return n},this.getConfiguration=function(){return this._mixin(!0,{},z)},this.getAdvice=function(){return this._mixin(!0,{},b)},window.WebSocket&&this.registerTransport("websocket",new S),this.registerTransport("long-polling",new x),this.registerTransport("callback-polling",new u)},h=["0","1","2","3","4","5","6","7","8","9","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",".","-",":","+","=","^","!","/","*","?","&","<",">","(",")","[","]","{","}","@","%","$","#"],d=[0,68,0,84,83,82,72,0,75,76,70,65,0,63,62,69,0,1,2,3,4,5,6,7,8,9,64,0,73,66,74,71,81,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,77,0,78,67,0,0,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,79,0,80,0,0],k={encode:function(c){var t=null;if(c instanceof ArrayBuffer?t=c:c.buffer instanceof ArrayBuffer?t=c.buffer:Array.isArray(c)&&(t=new Uint8Array(c).buffer),t==null)throw"Cannot Z85 encode "+c;for(var _=t.byteLength,g=_%4,r=4-(g===0?4:g),n=new DataView(t),m="",y=0,L=0;L<_+r;++L){var N=L>=_;if(y=y*256+(N?0:n.getUint8(L)),(L+1)%4==0){for(var B=85*85*85*85,H=5;H>0;--H){if(!N||H>r){var O=Math.floor(y/B)%85;m+=h[O]}B/=85}y=0}}return m},decode:function(c){for(var t=c.length%5,_=5-(t===0?5:t),g=0;g<_;++g)c+=h[h.length-1];for(var r=c.length,n=new ArrayBuffer(r*4/5-_),m=new DataView(n),y=0,L=0,N=0,B=0;B<r;++B){var H=c.charCodeAt(L++)-32;if(y=y*85+d[H],L%5==0){for(var O=256*256*256;O>=1;)N<m.byteLength&&m.setUint8(N++,Math.floor(y/O)%256),O/=256;y=0}}return n}};return{CometD:p,Transport:l,RequestTransport:E,LongPollingTransport:x,CallbackPollingTransport:u,WebSocketTransport:S,Utils:a,Z85:k}})});var Qn=j(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.default=void 0;var nr=er(ae());function er(a){return a&&a.__esModule?a:{default:a}}var tr=function(){var o=new nr.default("amb.GraphQLSubscriptionExtension"),l="/rw/graphql",E="/meta/subscribe",x={};this.isGraphQLChannel=function(u){return u&&u.startsWith(l)},this.addGraphQLChannel=function(u,S){x[u]=S},this.removeGraphQLChannel=function(u){delete x[u]},this.getGraphQLSubscriptions=function(){return x},this.outgoing=function(u){return u.channel===E&&this.isGraphQLChannel(u.subscription)&&(u.ext||(u.ext={}),x[u.subscription]&&(o.debug("Subscribing with GraphQL subscription:"+x[u.subscription]),u.ext.serializedGraphQLSubscription=x[u.subscription])),u}},rr=tr;Ve.default=rr});var Vn=j(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.default=void 0;var ar=ir(ae());function ir(a){return a&&a.__esModule?a:{default:a}}var or=function(){var o=new ar.default("amb.SessionExtension"),l="/meta/connect",E=!1;this.extendSession=function(){E=!0},this.outgoing=function(x){return x.channel===l&&E&&(x.ext||(x.ext={}),o.debug("extendSession"),x.ext.extendSession=!0,E=!1),x}},sr=or;Xe.default=sr});var Kn=j(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.default=void 0;var ur=Xn(ae()),Ie=Xn(_e());function Xn(a){return a&&a.__esModule?a:{default:a}}var cr=function(){var o=new ur.default("amb.TokenManagementExtension"),l="/meta/subscribe",E="/meta/unsubscribe",x="/meta/handshake",u=Ie.default.subscribeCommandsFlow.maxInflight,S=[];this.updateTokenCount=function(c){u=c},this.refillTokens=function(){u=Ie.default.subscribeCommandsFlow.maxInflight,k(),o.debug("refillTokens -- tokenCount : "+u)};function p(c){return c.channel==l||c.channel==E}function h(c){if(!c.ext)return!1;var t=c.ext.received_by_glide;return t?t&&p(t):!1}function d(c){return c.channel===x}this.outgoing=function(c){return d(c)&&(c.ext||(c.ext={}),c.ext.supportsSubscribeCommandFlow=!0),Ie.default.subscribeCommandsFlow.enable&&p(c)&&u>0&&u--,c},this.incoming=function(c){return Ie.default.subscribeCommandsFlow.enable&&(p(c)?(u<Ie.default.subscribeCommandsFlow.maxInflight&&u++,k()):h(c)&&(c=null)),c},this.getTokenCount=function(){return u},this.addTokenAvailabilityListener=function(c){!c||(o.debug("addTokenAvailabilityListener - tokenEventListener : "+c),S.push(c))},this.removeTokenAvailabilityListener=function(c){if(!!c){o.debug("removeTokenAvailabilityListener - tokenEventListener : "+c);var t=S.findIndex(function(_){return c===_});t!==-1&&(o.debug("removeTokenAvailabilityListener - removing listener at index : "+t),S.splice(t,1))}};function k(){o.debug("notifyOnAvailabilityOfToken - current tokenCount: "+u);try{S.forEach(function(c){c()})}catch(c){o.addErrorMessage("notifyOnAvailabilityOfToken - failed to call tokenEventListeners. Error Details : "+c)}}},lr=cr;Ke.default=lr});var Sn=j(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.default=void 0;var _n=Ce(zn()),fr=Ce(Cn()),dr=Ce(ae()),hr=Ce(He()),gr=Ce(Qn()),Jn=_e(),br=Ce(Vn()),vr=Ce(Kn());function Ce(a){return a&&a.__esModule?a:{default:a}}var pr=function(){var o=new _n.default.CometD;o.registerTransport(Jn.WEBSOCKET_TYPE_NAME,new _n.default.WebSocketTransport,0),o.registerTransport("long-polling",new _n.default.LongPollingTransport,1),o.unregisterTransport("callback-polling");var l=new gr.default;o.registerExtension("graphQLSubscription",l);var E=new br.default;o.registerExtension("sessionExtension",E);var x=new vr.default;o.registerExtension(Jn.TOKEN_MANAGEMENT_EXTENSION,x);var u=new fr.default(o),S=new dr.default("amb.MessageClient"),p=!1;return{getServerConnection:function(){return u},isLoggedIn:function(){return u.isLoggedIn()},loginComplete:function(){u.loginComplete()},reestablishSession:function(){u.reestablishSession()},connect:function(){if(p){S.addInfoMessage(">>> connection exists, request satisfied");return}p=!0,u.connect()},reload:function(){p=!1,u.reload()},abort:function(){p=!1,u.abort()},disconnect:function(){p=!1,u.disconnect()},isConnected:function(){return p},getConnectionEvents:function(){return u.getEvents()},subscribeToEvent:function(d,k){return u.subscribeToEvent(d,k)},unsubscribeFromEvent:function(d){u.unsubscribeFromEvent(d)},getConnectionState:function(){return u.getConnectionState()},getClientId:function(){return o.getClientId()},getChannel:function(d,k){var c=k||{},t=c.subscriptionCallback,_=c.serializedGraphQLSubscription,g=c.subscribeOptionsCallback,r=u.getChannel(d,g);return l.isGraphQLChannel(d)&&(_?l.addGraphQLChannel(d,_):S.addErrorMessage("Serialized subscription not present for GraphQL channel "+d)),new hr.default(r,u,t)},removeChannel:function(d){u.removeChannel(d),l.isGraphQLChannel(d)&&l.removeGraphQLChannel(d)},getChannels:function(){return u.getChannels()},extendSession:function(){E.extendSession()},getTokenManagementExtension:function(){return x},registerExtension:function(d,k){o.registerExtension(d,k)},unregisterExtension:function(d){o.unregisterExtension(d)},batch:function(d){o.batch(d)}}},mr=pr;Je.default=mr});var Tn=j((Ye,Yn)=>{(function(a,o){typeof Ye=="object"?Yn.exports=Ye=o():typeof define=="function"&&define.amd?define([],o):a.CryptoJS=o()})(Ye,function(){var a=a||function(o,l){var E=Object.create||function(){function r(){}return function(n){var m;return r.prototype=n,m=new r,r.prototype=null,m}}(),x={},u=x.lib={},S=u.Base=function(){return{extend:function(r){var n=E(this);return r&&n.mixIn(r),(!n.hasOwnProperty("init")||this.init===n.init)&&(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var r=this.extend();return r.init.apply(r,arguments),r},init:function(){},mixIn:function(r){for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);r.hasOwnProperty("toString")&&(this.toString=r.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),p=u.WordArray=S.extend({init:function(r,n){r=this.words=r||[],n!=l?this.sigBytes=n:this.sigBytes=r.length*4},toString:function(r){return(r||d).stringify(this)},concat:function(r){var n=this.words,m=r.words,y=this.sigBytes,L=r.sigBytes;if(this.clamp(),y%4)for(var N=0;N<L;N++){var B=m[N>>>2]>>>24-N%4*8&255;n[y+N>>>2]|=B<<24-(y+N)%4*8}else for(var N=0;N<L;N+=4)n[y+N>>>2]=m[N>>>2];return this.sigBytes+=L,this},clamp:function(){var r=this.words,n=this.sigBytes;r[n>>>2]&=4294967295<<32-n%4*8,r.length=o.ceil(n/4)},clone:function(){var r=S.clone.call(this);return r.words=this.words.slice(0),r},random:function(r){for(var n=[],m=function(B){var B=B,H=987654321,O=4294967295;return function(){H=36969*(H&65535)+(H>>16)&O,B=18e3*(B&65535)+(B>>16)&O;var w=(H<<16)+B&O;return w/=4294967296,w+=.5,w*(o.random()>.5?1:-1)}},y=0,L;y<r;y+=4){var N=m((L||o.random())*4294967296);L=N()*987654071,n.push(N()*4294967296|0)}return new p.init(n,r)}}),h=x.enc={},d=h.Hex={stringify:function(r){for(var n=r.words,m=r.sigBytes,y=[],L=0;L<m;L++){var N=n[L>>>2]>>>24-L%4*8&255;y.push((N>>>4).toString(16)),y.push((N&15).toString(16))}return y.join("")},parse:function(r){for(var n=r.length,m=[],y=0;y<n;y+=2)m[y>>>3]|=parseInt(r.substr(y,2),16)<<24-y%8*4;return new p.init(m,n/2)}},k=h.Latin1={stringify:function(r){for(var n=r.words,m=r.sigBytes,y=[],L=0;L<m;L++){var N=n[L>>>2]>>>24-L%4*8&255;y.push(String.fromCharCode(N))}return y.join("")},parse:function(r){for(var n=r.length,m=[],y=0;y<n;y++)m[y>>>2]|=(r.charCodeAt(y)&255)<<24-y%4*8;return new p.init(m,n)}},c=h.Utf8={stringify:function(r){try{return decodeURIComponent(escape(k.stringify(r)))}catch(n){throw new Error("Malformed UTF-8 data")}},parse:function(r){return k.parse(unescape(encodeURIComponent(r)))}},t=u.BufferedBlockAlgorithm=S.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(r){typeof r=="string"&&(r=c.parse(r)),this._data.concat(r),this._nDataBytes+=r.sigBytes},_process:function(r){var n=this._data,m=n.words,y=n.sigBytes,L=this.blockSize,N=L*4,B=y/N;r?B=o.ceil(B):B=o.max((B|0)-this._minBufferSize,0);var H=B*L,O=o.min(H*4,y);if(H){for(var w=0;w<H;w+=L)this._doProcessBlock(m,w);var I=m.splice(0,H);n.sigBytes-=O}return new p.init(I,O)},clone:function(){var r=S.clone.call(this);return r._data=this._data.clone(),r},_minBufferSize:0}),_=u.Hasher=t.extend({cfg:S.extend(),init:function(r){this.cfg=this.cfg.extend(r),this.reset()},reset:function(){t.reset.call(this),this._doReset()},update:function(r){return this._append(r),this._process(),this},finalize:function(r){r&&this._append(r);var n=this._doFinalize();return n},blockSize:512/32,_createHelper:function(r){return function(n,m){return new r.init(m).finalize(n)}},_createHmacHelper:function(r){return function(n,m){return new g.HMAC.init(r,m).finalize(n)}}}),g=x.algo={};return x}(Math);return a})});var Zn=j((je,jn)=>{(function(a,o){typeof je=="object"?jn.exports=je=o(Tn()):typeof define=="function"&&define.amd?define(["./core"],o):o(a.CryptoJS)})(je,function(a){return function(){var o=a,l=o.lib,E=l.WordArray,x=o.enc,u=x.Base64={stringify:function(p){var h=p.words,d=p.sigBytes,k=this._map;p.clamp();for(var c=[],t=0;t<d;t+=3)for(var _=h[t>>>2]>>>24-t%4*8&255,g=h[t+1>>>2]>>>24-(t+1)%4*8&255,r=h[t+2>>>2]>>>24-(t+2)%4*8&255,n=_<<16|g<<8|r,m=0;m<4&&t+m*.75<d;m++)c.push(k.charAt(n>>>6*(3-m)&63));var y=k.charAt(64);if(y)for(;c.length%4;)c.push(y);return c.join("")},parse:function(p){var h=p.length,d=this._map,k=this._reverseMap;if(!k){k=this._reverseMap=[];for(var c=0;c<d.length;c++)k[d.charCodeAt(c)]=c}var t=d.charAt(64);if(t){var _=p.indexOf(t);_!==-1&&(h=_)}return S(p,h,k)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function S(p,h,d){for(var k=[],c=0,t=0;t<h;t++)if(t%4){var _=d[p.charCodeAt(t-1)]<<t%4*2,g=d[p.charCodeAt(t)]>>>6-t%4*2;k[c>>>2]|=(_|g)<<24-c%4*8,c++}return E.create(k,c)}}(),a.enc.Base64})});var et=j((Ze,$n)=>{(function(a,o){typeof Ze=="object"?$n.exports=Ze=o(Tn()):typeof define=="function"&&define.amd?define(["./core"],o):o(a.CryptoJS)})(Ze,function(a){return a.enc.Utf8})});var xn=j($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.default=void 0;var _r=yn(Sn()),Cr=yn(Zn()),Sr=yn(et());function yn(a){return a&&a.__esModule?a:{default:a}}var Er=function(){var o=Tr(window);if(!o){var l=nt(window)&&window.frameElement!==null;o=tt(xr(l),window),yr(o)}return tt(o,window)};function Tr(a){try{if(!nt(a))for(;a!==a.parent&&!a.g_ambClient;)a=a.parent;if(a.g_ambClient)return a.g_ambClient}catch(o){console.log("AMB getClient() tried to access parent from an iFrame. Caught error: "+o)}return null}function nt(a){return a.MSInputMethodContext&&a.document.documentMode}function tt(a,o){if(typeof a.getClientWindow!="undefined"){var l=a.getClientWindow();if(l===o)return a}var E=wr({},a);return E.getChannel=function(x,u,S){return a.getChannel(x,u,S||o)},E.getRecordWatcherChannel=function(x,u,S,p,h){return a.getRecordWatcherChannel(x,u,S,p,h||o)},E.subscribeToEvent=function(x,u,S){return a.subscribeToEvent(x,u,S||o)},E.unsubscribeFromEvent=function(x,u){return a.unsubscribeFromEvent(x,u||o)},E.getClientWindow=function(){return o},E}function wr(a,o){for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&(a[l]=o[l]);return a}function yr(a){var o=window.self;o.g_ambClient=a,o.addEventListener("unload",function(){o.g_ambClient.disconnect()});var l=1e4,E=o.NOW&&o.NOW.hasOwnProperty("deferAmbConnection")?o.NOW.deferAmbConnection:!1,x=o.NOW&&o.NOW.hasOwnProperty("deferredAmbConnectionTimeout")&&d(o.NOW.deferredAmbConnectionTimeout)?o.NOW.deferredAmbConnectionTimeout:l;if(E)o.setTimeout(p,x);else{var u=o.document?o.document.readyState:null;u==="complete"?p():o.addEventListener("load",p),o.setTimeout(p,l)}var S=!1;function p(){S||(S=!0,o.g_ambClient.connect())}function h(k){return parseInt(k,10)===k}function d(k){return h(k)&&k>0}}function xr(a){return function(){var l=new _r.default,E=o(),x=l.getServerConnection();return a&&x.setLoginWindowEnabled(!1),{getServerConnection:function(){return x},connect:function(){l.connect()},abort:function(){l.abort()},disconnect:function(){l.disconnect()},getConnectionState:function(){return l.getConnectionState()},getState:function(){return l.getConnectionState()},getClientId:function(){return l.getClientId()},getChannel:function(S,p,h){var d=l.getChannel(S,p),k=d.subscribe,c=d.unsubscribe;return h=h||window,d.subscribe=function(t){return E.add(h,d,t,function(){d.unsubscribe(t)}),k.call(d,t),d},d.unsubscribe=function(t){E.remove(h,d,t);var _=c.call(d,t);return x.getChannel(S).getChannelListeners().length===0&&l.removeChannel(S),_},d},getChannel0:function(S,p){return l.getChannel(S,p)},getRecordWatcherChannel:function(S,p,h,d,k){var c=Cr.default.stringify(Sr.default.parse(p)).replace(/=/g,"-");return h=h||"default",this.getChannel("/rw/"+h+"/"+S+"/"+c,d,k)},registerExtension:function(S,p){l.registerExtension(S,p)},unregisterExtension:function(S){l.unregisterExtension(S)},batch:function(S){l.batch(S)},subscribeToEvent:function(S,p,h){h=h||window;var d=l.subscribeToEvent(S,p);return E.add(h,d,!0,function(){l.unsubscribeFromEvent(d)}),d},unsubscribeFromEvent:function(S,p){p=p||window,E.remove(p,S,!0),l.unsubscribeFromEvent(S)},isLoggedIn:function(){return l.isLoggedIn()},getConnectionEvents:function(){return l.getConnectionEvents()},getEvents:function(){return l.getConnectionEvents()},reestablishSession:function(){l.reestablishSession()},loginComplete:function(){l.loginComplete()},getChannels:function(){return l.getChannels()},extendSession:function(){return l.extendSession()},getTokenManagementExtension:function(){return l.getTokenManagementExtension()}}}();function o(){var l=[];function E(h,d,k,c){if(!(!h||!k||!c)){x(h,d,k);var t=u(h);t||(t=S(h)),!t.unloading&&t.subscriptions.push({id:d,callback:k,unsubscribe:c})}}function x(h,d,k){if(!(!h||!k)){var c=u(h);if(!!c)for(var t=c.subscriptions,_=t.length-1;_>=0;_--)t[_].id===d&&t[_].callback===k&&t.splice(_,1)}}function u(h){for(var d=0,k=l.length;d<k;d++)if(l[d].window===h)return l[d];return null}function S(h){var d={window:h,onUnload:function(){d.unloading=!0;for(var c=d.subscriptions,t;t=c.pop();)t.unsubscribe();p(d)},unloading:!1,subscriptions:[]};return h.addEventListener("unload",d.onUnload),l.push(d),d}function p(h){for(var d=0,k=l.length;d<k;d++)if(l[d].window===h.window){l.splice(d,1);break}h.subscriptions=[],h.window.removeEventListener("unload",h.onUnload),h.onUnload=null,h.window=null}return{add:E,remove:x}}}var Or=Er;$e.default=Or});var En=j(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.default=void 0;var kr=rt(ae()),it=Qe(),Lr=rt(xn());function rt(a){return a&&a.__esModule?a:{default:a}}var Ir=function(o,l,E){var x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){return{}},u=null,S=null,p=[],h=[],d=new kr.default("amb.Channel"),k=0,c=E;function t(){var g=o.getStatus();return g==="disconnecting"||g==="disconnected"}function _(){return(0,Lr.default)().getServerConnection().getSubscriptionCommandSender()}return{subscribe:function(r){if(!r.getCallback()){d.addErrorMessage("Cannot subscribe to channel: "+l+", callback not provided");return}for(var n=0;n<p.length;n++)if(p[n]===r)return d.debug("Channel listener already in the list"),r.getID();p.push(r);var m=r.getSubscriptionCallback();if(m&&(S?m(S):h.push(m)),!u&&c)try{this.subscribeToCometD()}catch(y){d.addErrorMessage(y);return}return++k},resubscribe:function(){u=null;for(var r=0;r<p.length;r++)p[r].resubscribe()},_handleResponse:function(r){for(var n=0;n<p.length;n++)p[n].getCallback()(r)},unsubscribe:function(r){if(!r){d.addErrorMessage("Cannot unsubscribe from channel: "+l+", listener argument does not exist");return}for(var n=0;n<p.length;n++)if(p[n].getID()===r.getID()){p.splice(n,1);break}p.length<1&&u&&!t()&&this.unsubscribeFromCometD()},publish:function(r){o.publish(l,r)},subscribeToCometD:function(){d.debug("subscribeToCometD channelName : "+l+", subscription : "+u),_()?_().subscribeToChannel(this):this._subscribeToCometD(this.subscriptionCallback)},_subscribeToCometD:function(r){d.debug("_subscribeToCometD channelName : "+l);var n=x();if((0,it.isNil)(n)||(0,it.isEmptyObject)(n))u=o.subscribe(l,this._handleResponse.bind(this),r);else{var m={subscribeOptions:n};u=o.subscribe(l,this._handleResponse.bind(this),m,r)}d.debug("Successfully subscribed to channel: "+l+", Subscribe options: "+n)},subscriptionCallback:function(r){d.debug("Cometd subscription callback completed for channel: "+l),d.debug("Listener callback queue size: "+h.length),S=r,h.map(function(n){n(S)}),h=[]},unsubscribeFromCometD:function(){d.debug("unsubscribeFromCometD  from : "+l+", subscription : "+u),u!==null&&(_()?_().unsubscribeToChannel(this):this._unsubscribeFromCometD())},_unsubscribeFromCometD:function(){d.debug("_unsubscribeFromCometD  from : "+l+", subscription : "+u),u!==null&&(o.unsubscribe(u),u=null,S=null,d.debug("Successfully unsubscribed from channel: "+l))},resubscribeToCometD:function(){d.debug("Resubscribe to "+l),_()?_().subscribeToChannel(this):this._subscribeToCometD(this.subscriptionCallback)},getSubscribeOptionsCallback:function(){return x},getName:function(){return l},getChannelListeners:function(){return p},getListenerCallbackQueue:function(){return h},setSubscriptionCallbackResponse:function(r){S=r}}},Nr=Ir;en.default=Nr});var ot=j(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.default=void 0;function Rr(a,o){if(!(a instanceof o))throw new TypeError("Cannot call a class as a function")}function at(a,o,l){return o in a?Object.defineProperty(a,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[o]=l,a}var Dr=function a(){Rr(this,a),at(this,"emit",function(o,l){window.localStorage.setItem(o,JSON.stringify(l)),window.localStorage.removeItem(o)}),at(this,"on",function(o,l){window.addEventListener("storage",function(E){var x=E.key,u=E.newValue;x===o&&u&&l(JSON.parse(u))})})},Mr=Dr;nn.default=Mr});var st=j(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.default=void 0;var Ar=134217727,Fr=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ar,l=[],E=Math.max(1,Math.floor(o));return{enqueue:function(u){return this.getAvailableSpace()>0?(l.push(u),!0):!1},enqueueMultiple:function(u){return this.getAvailableSpace()>=u.length?(l=l.concat(u),!0):!1},dequeue:function(){var u;return l.length>0&&(u=l.shift()),u},dequeueMultiple:function(u){var S;return u>=0&&l.length>=u&&(S=[],u>0&&(S=l.slice(0,u),l=l.slice(u))),S},clear:function(){l=[]},getSize:function(){return l.length},getCapacity:function(){return E},getAvailableSpace:function(){return E-l.length},getQueueBuffer:function(){return l}}},Br=Fr;tn.default=Br});var ct=j(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.default=void 0;var ce=ut(_e()),ve=Qe(),Ur=ut(ae());function ut(a){return a&&a.__esModule?a:{default:a}}var qr=function(o,l){var E={SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"},x=202,u=429,S=5*60*1e3,p=new Ur.default("amb.SubscriptionCommandSender");_();var h=!ce.default.subscribeCommandsFlow.enable,d=null;function k(s,b,R){return Math.min(R,Math.max(b,s))}function c(){return k(l.getTokenCount(),0,ce.default.subscribeCommandsFlow.maxInflight)}function t(){return l.getTokenCount()>=ce.default.subscribeCommandsFlow.maxInflight}function _(){l.addTokenAvailabilityListener(function(){V()})}function g(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(s||(0,ve.isNil)(d)){var b=k(ce.default.subscribeCommandsFlow.maxWait,0,S);p.debug("restartTimer - force: "+s+", timerObject : "+d+", timeInterval : "+b),r(),d=setTimeout(function(){B()},b)}}function r(){(0,ve.isNil)(d)||(p.debug("stopTimer"),clearTimeout(d),d=null)}function n(){p.debug("signalStop - stopping : "+h),h||(h=!0,r(),o.clear())}function m(){var s=parseInt(ce.default.subscribeCommandsFlow.retryDelay.min);return s=k(s,0,S),s}function y(s,b,R,M){p.debug("scheduleRetry - channel : "+s.getName()+", triesLeft : "+b+", mode : "+R);var A,q=N(M);switch(R){case E.SUBSCRIBE:{A=function(){return O(s,b,q)};break}case E.UNSUBSCRIBE:{A=function(){return w(s,b,q)};break}}(0,ve.isNil)(A)||setTimeout(A,M)}function L(s,b,R,M,A){p.debug("onResponse - response ".concat(JSON.stringify(s),", channel ").concat(JSON.stringify(b),", mode : ").concat(R,`, 
			triesLeft `).concat(M,", stopping : ").concat(h,", tokenCount : ").concat(l.getTokenCount(),", isBucketFull - ").concat(t(),", retryDelay - ").concat(A)),h?b.subscriptionCallback(s):(M=M-1,t()&&r(),M>0&&I(s)?y(b,M,R,A):b.subscriptionCallback(s),V())}function N(s){return k(ce.default.subscribeCommandsFlow.retryDelay.increaseFactor*s,ce.default.subscribeCommandsFlow.retryDelay.min,ce.default.subscribeCommandsFlow.retryDelay.max)}function B(){d=null,p.debug("onTimer - stopping : "+h),h||(l.refillTokens(),V())}function H(s){return p.debug("addItemToQueue - item : "+s),o.enqueue(s)?(V(),!0):!1}function O(s){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m();if(p.debug("enqueueSubscribe - channel: "+s.getName()+", triesLeft : "+b+", stopping : "+h+", retryDelay : "+R),!h&&(0,ve.isObject)(s)&&((0,ve.isNil)(b)&&(b=1+Math.floor(ce.default.subscribeCommandsFlow.retries)),b>0)){var M=function(){p.debug("enqueueSubscribe - inside the item execution. Calling channel._subscribeToCometD - channel: "+s.getName()+", triesLeft : "+b),s._subscribeToCometD(function(q){return L(q,s,E.SUBSCRIBE,b,R)})};return H(M)}return!1}function w(s){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m();if(p.debug("enqueueUnsubscribe - channel: "+s.getName()+", triesLeft : "+b+", stopping : "+h+", retryDelay : "+R),!h&&(0,ve.isObject)(s)&&((0,ve.isNil)(b)&&(b=1+Math.floor(ce.default.subscribeCommandsFlow.retries)),b>0)){var M=function(){s._unsubscribeFromCometD(function(q){return L(q,s,E.UNSUBSCRIBE,b,R)})};return H(M)}return!1}function I(s){if(p.debug("isRetriable - response : "+s),s&&s.ext){var b=s.ext.rejected_by_glide;if(b){var R=parseInt(s.ext["glide.amb.reply.status.code"]);if(p.addWarnMessage("isRetriable - rejected_by_glide : "+b+", glide.amb.reply.status.code : "+R),!isNaN(R))return R==u||R==x}}return p.debug("isRetriable -  "+!1),!1}function V(){var s=Math.min(o.getSize(),c());if(p.debug("processQueue - numberToProcess : "+s),s>0){var b=o.dequeueMultiple(s);b.forEach(function(R){return(0,ve.isNil)(R)||R()}),g(!1)}}return{subscribeToChannel:function(b){return p.debug("subscribeToChannel - to : "+b.getName()),O(b)},unsubscribeToChannel:function(b){return p.debug("unsubscribeToChannel - from : "+b.getName()),w(b)},stop:function(){p.debug("stop"),n()},isStopping:function(){return h},getQueue:function(){return o},isBucketEmpty:function(){return!t()},getTimerObject:function(){return d},getTokenCountFromTokenManager:function(){return l.getTokenCount()}}},Gr=qr;rn.default=Gr});var Cn=j(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.default=void 0;var Pr=Se(vn()),Hr=Se(ae()),J=Wr(_e()),zr=Se(pn()),Qr=Se(En()),Vr=Se(ot()),lt=Qe(),Xr=Se(st()),Kr=Se(ct());function ft(){if(typeof WeakMap!="function")return null;var a=new WeakMap;return ft=function(){return a},a}function Wr(a){if(a&&a.__esModule)return a;var o=ft();if(o&&o.has(a))return o.get(a);var l={};if(a!=null){var E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in a)if(Object.prototype.hasOwnProperty.call(a,x)){var u=E?Object.getOwnPropertyDescriptor(a,x):null;u&&(u.get||u.set)?Object.defineProperty(l,x,u):l[x]=a[x]}}return l.default=a,o&&o.set(a,l),l}function Se(a){return a&&a.__esModule?a:{default:a}}var Jr=function(o){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Vr.default,E=!1,x=!1,u=new Pr.default({CONNECTION_INITIALIZED:"connection.initialized",CONNECTION_OPENED:"connection.opened",CONNECTION_CLOSED:"connection.closed",CONNECTION_BROKEN:"connection.broken",SESSION_LOGGED_IN:"session.logged.in",SESSION_LOGGED_OUT:"session.logged.out",SESSION_INVALIDATED:"session.invalidated",SESSION_REESTABLISHED:"session.reestablished"}),S={SESSION_LOGGED_IN:"session.logged.in",SESSION_LOGGED_OUT:"session.logged.out",SESSION_INVALIDATED:"session.invalidated"},p="closed",h={},d=new Hr.default("amb.ServerConnection");V();var k=S.SESSION_INVALIDATED,c=null,t=J.default.loginWindow==="true",_=null,g={UNKNOWN_CLIENT:"402::Unknown client"},r=!1,n={},m=!1,y=new zr.default(o,n),L=!1,N="glide.amb.session.logout.overlay.style",B="glide.session.status",H="session.touch.http",O="amb.ServerConnection.reestablish.session",w=o.getExtension(J.TOKEN_MANAGEMENT_EXTENSION),I=null;n.connect=function(){if(E){d.debug(">>> connection exists, request satisfied");return}d.debug("Connecting to glide amb server -> "+J.default.servletURI),o.configure({url:n.getURL(J.default.servletPath),logLevel:J.default.logLevel,connectTimeout:J.default.wsConnectTimeout}),o.handshake(),l.on(O,function(){n._reestablishSession(!1)})},n.reload=function(){o.reload()},n.abort=function(){o.getTransport().abort()},n.disconnect=function(){d.debug("Disconnecting from glide amb server.."),x=!0,o.disconnect()},n.getURL=function(T){return window.location.protocol+"//"+window.location.host+"/"+T};function V(){o.addListener("/meta/handshake",this,s),o.addListener("/meta/connect",this,pe),o.addListener("/meta/subscribe",this,A),o.addListener("/meta/unsubscribe",this,A)}function s(T){A(T);var F=b(T,N);F&&(J.default.overlayStyle=F),k=b(T,B),Z(T),setTimeout(function(){T.successful&&oe()},0)}function b(T,F){if((0,lt.isObject)(T.ext))return T.ext[F]}function R(T,F){if(T in h)return h[T];var Q=new Qr.default(o,T,L,F);return h[T]=Q,Q}function M(T){delete h[T]}function A(T){if(T.ext){T.ext["glide.amb.active"]===!1&&n.disconnect();var F=b(T,"glide.amb.client.log.level");F&&(J.default.logLevel=F,o.setLogLevel(J.default.logLevel))}}function q(T,F){var Q=Math.floor(parseInt(T));return(isNaN(Q)||Q<0)&&(Q=F),Q}function W(T,F){var Q=F;return(0,lt.isNil)(T)||(Q=!!T),Q}function Z(T){if(!!T.ext){var F=T.ext.subscribeCommandsFlow;if(!!F){var Q=J.default.subscribeCommandsFlow;if(J.default.subscribeCommandsFlow.enable=W(F.enable,Q.enable),J.default.subscribeCommandsFlow.enable){J.default.subscribeCommandsFlow.retries=q(F.retries,Q.retries),J.default.subscribeCommandsFlow.maxInflight=q(F.maxInflight,Q.maxInflight),J.default.subscribeCommandsFlow.maxWait=q(F.maxWait,Q.maxWait);var re=F.retryDelay;if(re){var Oe=J.default.subscribeCommandsFlow.retryDelay;J.default.subscribeCommandsFlow.retryDelay.min=q(re.min,Oe.min),J.default.subscribeCommandsFlow.retryDelay.max=q(re.max,Oe.max),J.default.subscribeCommandsFlow.retryDelay.increaseFactor=q(re.increaseFactor,Oe.increaseFactor)}}X()}}}function X(){J.default.subscribeCommandsFlow.enable&&(d.addInfoMessage("_initializeSubscriptionCommandSender: SubscriptionCommandSender is enabled"),w!=null&&w.updateTokenCount(J.default.subscribeCommandsFlow.maxInflight),I&&I.stop(),I=new Kr.default(new Xr.default(1e4),w))}function K(){d.debug("Resubscribing to all!");for(var T in h){var F=h[T];F&&F.resubscribeToCometD()}}function z(){d.debug("Unsubscribing from all!");for(var T in h){var F=h[T];F&&F.unsubscribeFromCometD()}}function pe(T){if(A(T),x){setTimeout(function(){E=!1,De()},0);return}var F=b(T,H);ee()&&F===!0&&n._touchHttpSession();var Q=T.error;Q&&(_=Q),de(T);var re=E;E=T.successful===!0,!re&&E?ge():re&&!E&&fe()}function ee(){return J.WEBSOCKET_TYPE_NAME===o.getTransport().getType()}function G(){var T=new XMLHttpRequest;T.open("POST","/amb",!0),T.setRequestHeader("Content-type","application/json"),T.send()}function oe(){d.debug("Connection initialized"),L=!0,p="initialized",te(u.getEvents().CONNECTION_INITIALIZED)}function ge(){d.debug("Connection opened"),m?un():y.initialize(le)}function le(){K(),p="opened",te(u.getEvents().CONNECTION_OPENED)}function un(){n.getLastError()===n.getErrorMessages().UNKNOWN_CLIENT&&(n.setLastError(null),n._sendSessionSetupRequest(function(T){var F=T.status;F===200&&(m=!1,y.initialize(le))}))}function Ne(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},F=Re();F.onload=function(){return T(F)},F.send()}function Re(){d.debug("sending /amb_session_setup.do!");var T=new XMLHttpRequest;return T.open("POST","/amb_session_setup.do",!0),T.setRequestHeader("Content-type","application/json;charset=UTF-8"),T.setRequestHeader("X-UserToken",window.g_ck),T.setRequestHeader("X-CometD_SessionID",o.getClientId()),T}function De(){d.debug("Connection closed"),p="closed",te(u.getEvents().CONNECTION_CLOSED)}function fe(){d.addErrorMessage("Connection broken"),p="broken",m=!0,te(u.getEvents().CONNECTION_BROKEN),ne()}function ne(){I&&(I.stop(),I=null)}function de(T){var F=b(T,B);!F||F===k||(r=b(T,"glide.amb.login.window.override")===!0,xe(F))}function xe(T){d.debug("session.status - "+T),Y(T)?we():ln(T)?Ae():Ee(T)?Fe():cn(T)&&Me(),k=T}function cn(T){return(k===S.SESSION_INVALIDATED||k===S.SESSION_LOGGED_OUT)&&T===S.SESSION_LOGGED_IN}function ln(T){return k===S.SESSION_LOGGED_IN&&T===S.SESSION_LOGGED_OUT}function Ee(T){return k===S.SESSION_INVALIDATED&&T===S.SESSION_LOGGED_OUT}function Y(T){return(k===S.SESSION_LOGGED_IN||k===S.SESSION_LOGGED_OUT)&&T===S.SESSION_INVALIDATED}function Me(){d.debug("LOGGED_IN event fire!"),K(),te(u.getEvents().SESSION_LOGGED_IN),n.loginHide()}function Ae(){d.debug("LOGGED_OUT event fire!"),z(),te(u.getEvents().SESSION_LOGGED_OUT),t&&!r&&n.loginShow()}function Fe(){d.debug("REESTABLISHED event fire!"),K(),te(u.getEvents().SESSION_REESTABLISHED)}function we(){d.debug("INVALIDATED event fire!"),z(),te(u.getEvents().SESSION_INVALIDATED)}function te(T){try{u.publish(T)}catch(F){d.addErrorMessage("error publishing '"+T+"' - "+F)}}function me(){l.emit(O,O)}n.unsubscribeAll=function(){z()},n.resubscribeAll=function(){K()},n.removeChannel=function(T){M(T)},n.getEvents=function(){return u.getEvents()},n.getConnectionState=function(){return p},n.getLastError=function(){return _},n.setLastError=function(T){_=T},n.getErrorMessages=function(){return g},n.isLoggedIn=function(){return k===S.SESSION_LOGGED_IN},n.isSessionActive=function(){return k!==S.SESSION_INVALIDATED},n.getChannelRedirect=function(){return y},n.getChannel=function(T,F){return R(T,F)},n.getChannels=function(){return h},n.getState=function(){return p},n.getLoginWindowOverlayStyle=function(){return J.default.overlayStyle},n.loginShow=function(){d.debug("Show login window");var T='<iframe src="/amb_login.do" frameborder="0" height="400px" width="405px" scrolling="no"></iframe>',F='<div id="amb_disconnect_modal" tabindex="-1" aria-hidden="true" class="modal" role="dialog" style="'.concat(J.default.overlayStyle,`">
				<div class="modal-dialog small-modal" style="width:450px">
				   <div class="modal-content">
					  <header class="modal-header">
						 <h4 id="small_modal1_title" class="modal-title">Login</h4>
					  </header>
					  <div class="modal-body">
					  </div>
				   </div>
				</div>
			</div>`);try{var Q=new GlideModal("amb_disconnect_modal");Q.renderWithContent?(Q.template=F,Q.renderWithContent(T)):(Q.setBody(T),Q.render()),c=Q}catch(re){d.debug(re)}},n.loginHide=function(){!c||(c.destroy(),c=null)},n.loginComplete=function(){n.reestablishSession()};function Te(T){n._sendSessionSetupRequest(function(F){var Q=F.response;if(!!Q){var re=JSON.parse(Q)["glide.session.status"];xe(re)}}),T&&me()}return n.reestablishSession=function(){n._reestablishSession(!0)},n.subscribeToEvent=function(T,F){return u.getEvents().CONNECTION_OPENED===T&&E&&F(),u.subscribe(T,F)},n.unsubscribeFromEvent=function(T){u.unsubscribe(T)},n.isLoginWindowEnabled=function(){return t},n.setLoginWindowEnabled=function(T){t=T},n.isLoginWindowOverride=function(){return r},n.getSubscriptionCommandSender=function(){return I},n._metaConnect=pe,n._metaHandshake=s,n._sendSessionSetupRequest=Ne,n._onChannelRedirectSubscriptionComplete=le,n._getChannel=R,n._removeChannel=M,n._connectionInitialized=oe,n._connectionOpened=ge,n._reestablishSession=Te,n._touchHttpSession=G,n},Yr=Jr;an.default=Yr});var dt=j(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.default=void 0;var jr=he(_e()),Zr=he(ae()),$r=he(vn()),ei=he(Cn()),ni=he(pn()),ti=he(He()),ri=he(En()),ii=he(Sn()),ai=he(xn());function he(a){return a&&a.__esModule?a:{default:a}}var oi={properties:jr.default,Logger:Zr.default,EventManager:$r.default,ServerConnection:ei.default,ChannelRedirect:ni.default,ChannelListener:ti.default,Channel:ri.default,MessageClient:ii.default,getClient:ai.default},si=oi;on.default=si});var sn=Dt(dt());window.__TECTONIC__amb_client_js=sn.default;window.amb=sn.default;var Oi=sn.default;
/*__ESM_BODY_END__*/
export{Oi as default};
//# sourceMappingURL=/scripts/externals/amb-client-js/index.min.js.map
