@spot-flow/checkout-inline-js 0.1.42-dev.2 → 0.1.42-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/checkout-inline.es.js +25 -20
- package/dist/checkout-inline.js +2 -2
- package/package.json +1 -1
|
@@ -33268,20 +33268,23 @@ class ks {
|
|
|
33268
33268
|
this.container = e.container, this.onAction = e.onAction, this.onFail = e.onFail, this.initialTime = 1800, this.timeLeft = this.initialTime, this.timerId = null;
|
|
33269
33269
|
}
|
|
33270
33270
|
attachListener() {
|
|
33271
|
-
const e = this.container.querySelector("#transfer-acn"), i = this.container.querySelector("#copy-acn"),
|
|
33272
|
-
|
|
33273
|
-
P.track("copy_transferBank", {
|
|
33271
|
+
const e = this.container.querySelector("#transfer-acn"), i = this.container.querySelector("#transfer-bank"), t = this.container.querySelector("#copy-acn"), s = this.container.querySelector("#acn-tooltip"), o = this.container.querySelector("#transfer-amount"), a = this.container.querySelector("#copy-amount"), l = this.container.querySelector("#amount-tooltip"), d = this.container.querySelector("#transfer-button");
|
|
33272
|
+
t && e && t.addEventListener("click", () => {
|
|
33273
|
+
s && (i && P.track("copy_transferBank", {
|
|
33274
33274
|
payment_method: "Transfer",
|
|
33275
|
-
payment_process: "Payment Started"
|
|
33276
|
-
|
|
33277
|
-
|
|
33278
|
-
|
|
33279
|
-
|
|
33280
|
-
|
|
33281
|
-
|
|
33282
|
-
|
|
33283
|
-
)
|
|
33284
|
-
|
|
33275
|
+
payment_process: "Payment Started",
|
|
33276
|
+
account_number: e.innerHTML,
|
|
33277
|
+
bank_name: i.innerHTML
|
|
33278
|
+
}), this.copyToClipboard(e.innerHTML, s));
|
|
33279
|
+
}), a && o && a.addEventListener("click", () => {
|
|
33280
|
+
l && (P.track("copy_transferAmount", {
|
|
33281
|
+
payment_method: "Transfer",
|
|
33282
|
+
amount: o.innerHTML.split(" ")[1].replace(/,/g, "")
|
|
33283
|
+
}), this.copyToClipboard(
|
|
33284
|
+
o.innerHTML.split(" ")[1].replace(/,/g, ""),
|
|
33285
|
+
l
|
|
33286
|
+
));
|
|
33287
|
+
}), d && d.addEventListener("click", () => {
|
|
33285
33288
|
this.onAction(5), P.track("initiate_payment_verification", {
|
|
33286
33289
|
payment_method: "Transfer"
|
|
33287
33290
|
});
|
|
@@ -33443,17 +33446,19 @@ class Fd {
|
|
|
33443
33446
|
e && e.addEventListener("click", () => {
|
|
33444
33447
|
this.onAction(1), clearTimeout(this.timer);
|
|
33445
33448
|
});
|
|
33446
|
-
const i = this.container.querySelector("#transfer-acn-pr"),
|
|
33447
|
-
|
|
33449
|
+
const i = this.container.querySelector("#transfer-bank"), t = this.container.querySelector("#transfer-acn-pr"), s = this.container.querySelector("#copy-acn-pr"), o = this.container.querySelector("#acn-tooltip-pr");
|
|
33450
|
+
s && t && s.addEventListener("click", () => {
|
|
33448
33451
|
P.track("copy_transferBank", {
|
|
33449
33452
|
payment_method: "Transfer",
|
|
33450
|
-
payment_process: "Payment Verification"
|
|
33451
|
-
|
|
33453
|
+
payment_process: "Payment Verification",
|
|
33454
|
+
account_number: t.innerHTML,
|
|
33455
|
+
bank_name: i == null ? void 0 : i.innerHTML
|
|
33456
|
+
}), o && this.copyToClipboard(t.innerHTML, o);
|
|
33452
33457
|
}), this.initialTime = 300, this.timeLeft = this.initialTime;
|
|
33453
|
-
const
|
|
33458
|
+
const a = 3e4;
|
|
33454
33459
|
this.abortController = new AbortController(), setTimeout(() => {
|
|
33455
|
-
this.verifyTransfer(this.token,
|
|
33456
|
-
this.onAction(6), this.redirectTo(
|
|
33460
|
+
this.verifyTransfer(this.token, a, ({ data: l, headers: d }) => {
|
|
33461
|
+
this.onAction(6), this.redirectTo(l, d);
|
|
33457
33462
|
});
|
|
33458
33463
|
}, 5e3), this.startTimer();
|
|
33459
33464
|
}
|
package/dist/checkout-inline.js
CHANGED
|
@@ -1145,7 +1145,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
1145
1145
|
* Copyright 2020, Pusher
|
|
1146
1146
|
* Released under the MIT licence.
|
|
1147
1147
|
*/(function(n,e){(function(t,o){n.exports=o()})(window,function(){return function(i){var t={};function o(s){if(t[s])return t[s].exports;var a=t[s]={i:s,l:!1,exports:{}};return i[s].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=i,o.c=t,o.d=function(s,a,l){o.o(s,a)||Object.defineProperty(s,a,{enumerable:!0,get:l})},o.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},o.t=function(s,a){if(a&1&&(s=o(s)),a&8||a&4&&typeof s=="object"&&s&&s.__esModule)return s;var l=Object.create(null);if(o.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:s}),a&2&&typeof s!="string")for(var d in s)o.d(l,d,(function(v){return s[v]}).bind(null,d));return l},o.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(a,"a",a),a},o.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},o.p="",o(o.s=2)}([function(i,t,o){var s=this&&this.__extends||function(){var C=function(S,M){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,_){A.__proto__=_}||function(A,_){for(var T in _)_.hasOwnProperty(T)&&(A[T]=_[T])},C(S,M)};return function(S,M){C(S,M);function A(){this.constructor=S}S.prototype=M===null?Object.create(M):(A.prototype=M.prototype,new A)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=256,l=function(){function C(S){S===void 0&&(S="="),this._paddingCharacter=S}return C.prototype.encodedLength=function(S){return this._paddingCharacter?(S+2)/3*4|0:(S*8+5)/6|0},C.prototype.encode=function(S){for(var M="",A=0;A<S.length-2;A+=3){var _=S[A]<<16|S[A+1]<<8|S[A+2];M+=this._encodeByte(_>>>3*6&63),M+=this._encodeByte(_>>>2*6&63),M+=this._encodeByte(_>>>1*6&63),M+=this._encodeByte(_>>>0*6&63)}var T=S.length-A;if(T>0){var _=S[A]<<16|(T===2?S[A+1]<<8:0);M+=this._encodeByte(_>>>3*6&63),M+=this._encodeByte(_>>>2*6&63),T===2?M+=this._encodeByte(_>>>1*6&63):M+=this._paddingCharacter||"",M+=this._paddingCharacter||""}return M},C.prototype.maxDecodedLength=function(S){return this._paddingCharacter?S/4*3|0:(S*6+7)/8|0},C.prototype.decodedLength=function(S){return this.maxDecodedLength(S.length-this._getPaddingLength(S))},C.prototype.decode=function(S){if(S.length===0)return new Uint8Array(0);for(var M=this._getPaddingLength(S),A=S.length-M,_=new Uint8Array(this.maxDecodedLength(A)),T=0,I=0,K=0,G=0,V=0,F=0,oe=0;I<A-4;I+=4)G=this._decodeChar(S.charCodeAt(I+0)),V=this._decodeChar(S.charCodeAt(I+1)),F=this._decodeChar(S.charCodeAt(I+2)),oe=this._decodeChar(S.charCodeAt(I+3)),_[T++]=G<<2|V>>>4,_[T++]=V<<4|F>>>2,_[T++]=F<<6|oe,K|=G&a,K|=V&a,K|=F&a,K|=oe&a;if(I<A-1&&(G=this._decodeChar(S.charCodeAt(I)),V=this._decodeChar(S.charCodeAt(I+1)),_[T++]=G<<2|V>>>4,K|=G&a,K|=V&a),I<A-2&&(F=this._decodeChar(S.charCodeAt(I+2)),_[T++]=V<<4|F>>>2,K|=F&a),I<A-3&&(oe=this._decodeChar(S.charCodeAt(I+3)),_[T++]=F<<6|oe,K|=oe&a),K!==0)throw new Error("Base64Coder: incorrect characters for decoding");return _},C.prototype._encodeByte=function(S){var M=S;return M+=65,M+=25-S>>>8&6,M+=51-S>>>8&-75,M+=61-S>>>8&-15,M+=62-S>>>8&3,String.fromCharCode(M)},C.prototype._decodeChar=function(S){var M=a;return M+=(42-S&S-44)>>>8&-a+S-43+62,M+=(46-S&S-48)>>>8&-a+S-47+63,M+=(47-S&S-58)>>>8&-a+S-48+52,M+=(64-S&S-91)>>>8&-a+S-65+0,M+=(96-S&S-123)>>>8&-a+S-97+26,M},C.prototype._getPaddingLength=function(S){var M=0;if(this._paddingCharacter){for(var A=S.length-1;A>=0&&S[A]===this._paddingCharacter;A--)M++;if(S.length<4||M>2)throw new Error("Base64Coder: incorrect padding")}return M},C}();t.Coder=l;var d=new l;function v(C){return d.encode(C)}t.encode=v;function p(C){return d.decode(C)}t.decode=p;var g=function(C){s(S,C);function S(){return C!==null&&C.apply(this,arguments)||this}return S.prototype._encodeByte=function(M){var A=M;return A+=65,A+=25-M>>>8&6,A+=51-M>>>8&-75,A+=61-M>>>8&-13,A+=62-M>>>8&49,String.fromCharCode(A)},S.prototype._decodeChar=function(M){var A=a;return A+=(44-M&M-46)>>>8&-a+M-45+62,A+=(94-M&M-96)>>>8&-a+M-95+63,A+=(47-M&M-58)>>>8&-a+M-48+52,A+=(64-M&M-91)>>>8&-a+M-65+0,A+=(96-M&M-123)>>>8&-a+M-97+26,A},S}(l);t.URLSafeCoder=g;var f=new g;function y(C){return f.encode(C)}t.encodeURLSafe=y;function k(C){return f.decode(C)}t.decodeURLSafe=k,t.encodedLength=function(C){return d.encodedLength(C)},t.maxDecodedLength=function(C){return d.maxDecodedLength(C)},t.decodedLength=function(C){return d.decodedLength(C)}},function(i,t,o){Object.defineProperty(t,"__esModule",{value:!0});var s="utf8: invalid string",a="utf8: invalid source encoding";function l(p){for(var g=new Uint8Array(d(p)),f=0,y=0;y<p.length;y++){var k=p.charCodeAt(y);k<128?g[f++]=k:k<2048?(g[f++]=192|k>>6,g[f++]=128|k&63):k<55296?(g[f++]=224|k>>12,g[f++]=128|k>>6&63,g[f++]=128|k&63):(y++,k=(k&1023)<<10,k|=p.charCodeAt(y)&1023,k+=65536,g[f++]=240|k>>18,g[f++]=128|k>>12&63,g[f++]=128|k>>6&63,g[f++]=128|k&63)}return g}t.encode=l;function d(p){for(var g=0,f=0;f<p.length;f++){var y=p.charCodeAt(f);if(y<128)g+=1;else if(y<2048)g+=2;else if(y<55296)g+=3;else if(y<=57343){if(f>=p.length-1)throw new Error(s);f++,g+=4}else throw new Error(s)}return g}t.encodedLength=d;function v(p){for(var g=[],f=0;f<p.length;f++){var y=p[f];if(y&128){var k=void 0;if(y<224){if(f>=p.length)throw new Error(a);var C=p[++f];if((C&192)!==128)throw new Error(a);y=(y&31)<<6|C&63,k=128}else if(y<240){if(f>=p.length-1)throw new Error(a);var C=p[++f],S=p[++f];if((C&192)!==128||(S&192)!==128)throw new Error(a);y=(y&15)<<12|(C&63)<<6|S&63,k=2048}else if(y<248){if(f>=p.length-2)throw new Error(a);var C=p[++f],S=p[++f],M=p[++f];if((C&192)!==128||(S&192)!==128||(M&192)!==128)throw new Error(a);y=(y&15)<<18|(C&63)<<12|(S&63)<<6|M&63,k=65536}else throw new Error(a);if(y<k||y>=55296&&y<=57343)throw new Error(a);if(y>=65536){if(y>1114111)throw new Error(a);y-=65536,g.push(String.fromCharCode(55296|y>>10)),y=56320|y&1023}}g.push(String.fromCharCode(y))}return g.join("")}t.decode=v},function(i,t,o){i.exports=o(3).default},function(i,t,o){o.r(t);class s{constructor(r,c){this.lastId=0,this.prefix=r,this.name=c}create(r){this.lastId++;var c=this.lastId,b=this.prefix+c,w=this.name+"["+c+"]",L=!1,E=function(){L||(r.apply(null,arguments),L=!0)};return this[c]=E,{number:c,id:b,name:w,callback:E}}remove(r){delete this[r.number]}}var a=new s("_pusher_script_","Pusher.ScriptReceivers"),l={VERSION:"8.4.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},d=l;class v{constructor(r){this.options=r,this.receivers=r.receivers||a,this.loading={}}load(r,c,b){var w=this;if(w.loading[r]&&w.loading[r].length>0)w.loading[r].push(b);else{w.loading[r]=[b];var L=O.createScriptRequest(w.getPath(r,c)),E=w.receivers.create(function(D){if(w.receivers.remove(E),w.loading[r]){var R=w.loading[r];delete w.loading[r];for(var Z=function(pe){pe||L.cleanup()},X=0;X<R.length;X++)R[X](D,Z)}});L.send(E)}}getRoot(r){var c,b=O.getDocument().location.protocol;return r&&r.useTLS||b==="https:"?c=this.options.cdn_https:c=this.options.cdn_http,c.replace(/\/*$/,"")+"/"+this.options.version}getPath(r,c){return this.getRoot(c)+"/"+r+this.options.suffix+".js"}}var p=new s("_pusher_dependencies","Pusher.DependenciesReceivers"),g=new v({cdn_http:d.cdn_http,cdn_https:d.cdn_https,version:d.VERSION,suffix:d.dependency_suffix,receivers:p});const f={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}};var k={buildLogSuffix:function(u){const r="See:",c=f.urls[u];if(!c)return"";let b;return c.fullUrl?b=c.fullUrl:c.path&&(b=f.baseUrl+c.path),b?`${r} ${b}`:""}},C;(function(u){u.UserAuthentication="user-authentication",u.ChannelAuthorization="channel-authorization"})(C||(C={}));class S extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class M extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class A extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class _ extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class T extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class I extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class K extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class G extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class V extends Error{constructor(r,c){super(c),this.status=r,Object.setPrototypeOf(this,new.target.prototype)}}var oe=function(u,r,c,b,w){const L=O.createXHR();L.open("POST",c.endpoint,!0),L.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var E in c.headers)L.setRequestHeader(E,c.headers[E]);if(c.headersProvider!=null){let D=c.headersProvider();for(var E in D)L.setRequestHeader(E,D[E])}return L.onreadystatechange=function(){if(L.readyState===4)if(L.status===200){let D,R=!1;try{D=JSON.parse(L.responseText),R=!0}catch{w(new V(200,`JSON returned from ${b.toString()} endpoint was invalid, yet status code was 200. Data was: ${L.responseText}`),null)}R&&w(null,D)}else{let D="";switch(b){case C.UserAuthentication:D=k.buildLogSuffix("authenticationEndpoint");break;case C.ChannelAuthorization:D=`Clients must be authorized to join private or presence channels. ${k.buildLogSuffix("authorizationEndpoint")}`;break}w(new V(L.status,`Unable to retrieve auth string from ${b.toString()} endpoint - received status: ${L.status} from ${c.endpoint}. ${D}`),null)}},L.send(r),L};function ge(u){return en(Te(u))}var U=String.fromCharCode,_e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ue=function(u){var r=u.charCodeAt(0);return r<128?u:r<2048?U(192|r>>>6)+U(128|r&63):U(224|r>>>12&15)+U(128|r>>>6&63)+U(128|r&63)},Te=function(u){return u.replace(/[^\x00-\x7F]/g,ue)},Me=function(u){var r=[0,2,1][u.length%3],c=u.charCodeAt(0)<<16|(u.length>1?u.charCodeAt(1):0)<<8|(u.length>2?u.charCodeAt(2):0),b=[_e.charAt(c>>>18),_e.charAt(c>>>12&63),r>=2?"=":_e.charAt(c>>>6&63),r>=1?"=":_e.charAt(c&63)];return b.join("")},en=window.btoa||function(u){return u.replace(/[\s\S]{1,3}/g,Me)};class vn{constructor(r,c,b,w){this.clear=c,this.timer=r(()=>{this.timer&&(this.timer=w(this.timer))},b)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var nn=vn;function _n(u){window.clearTimeout(u)}function bn(u){window.clearInterval(u)}class Ee extends nn{constructor(r,c){super(setTimeout,_n,r,function(b){return c(),null})}}class tn extends nn{constructor(r,c){super(setInterval,bn,r,function(b){return c(),b})}}var Mn={now(){return Date.now?Date.now():new Date().valueOf()},defer(u){return new Ee(0,u)},method(u,...r){var c=Array.prototype.slice.call(arguments,1);return function(b){return b[u].apply(b,c.concat(arguments))}}},re=Mn;function fe(u,...r){for(var c=0;c<r.length;c++){var b=r[c];for(var w in b)b[w]&&b[w].constructor&&b[w].constructor===Object?u[w]=fe(u[w]||{},b[w]):u[w]=b[w]}return u}function Re(){for(var u=["Pusher"],r=0;r<arguments.length;r++)typeof arguments[r]=="string"?u.push(arguments[r]):u.push(An(arguments[r]));return u.join(" : ")}function Pe(u,r){var c=Array.prototype.indexOf;if(u===null)return-1;if(c&&u.indexOf===c)return u.indexOf(r);for(var b=0,w=u.length;b<w;b++)if(u[b]===r)return b;return-1}function we(u,r){for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&r(u[c],c,u)}function We(u){var r=[];return we(u,function(c,b){r.push(b)}),r}function B(u){var r=[];return we(u,function(c){r.push(c)}),r}function he(u,r,c){for(var b=0;b<u.length;b++)r.call(c||window,u[b],b,u)}function Q(u,r){for(var c=[],b=0;b<u.length;b++)c.push(r(u[b],b,u,c));return c}function me(u,r){var c={};return we(u,function(b,w){c[w]=r(b)}),c}function Ie(u,r){r=r||function(w){return!!w};for(var c=[],b=0;b<u.length;b++)r(u[b],b,u,c)&&c.push(u[b]);return c}function $(u,r){var c={};return we(u,function(b,w){(r&&r(b,w,u,c)||b)&&(c[w]=b)}),c}function fn(u){var r=[];return we(u,function(c,b){r.push([b,c])}),r}function si(u,r){for(var c=0;c<u.length;c++)if(r(u[c],c,u))return!0;return!1}function Oi(u,r){for(var c=0;c<u.length;c++)if(!r(u[c],c,u))return!1;return!0}function Vi(u){return me(u,function(r){return typeof r=="object"&&(r=An(r)),encodeURIComponent(ge(r.toString()))})}function Ui(u){var r=$(u,function(b){return b!==void 0}),c=Q(fn(Vi(r)),re.method("join","=")).join("&");return c}function ji(u){var r=[],c=[];return function b(w,L){var E,D,R;switch(typeof w){case"object":if(!w)return null;for(E=0;E<r.length;E+=1)if(r[E]===w)return{$ref:c[E]};if(r.push(w),c.push(L),Object.prototype.toString.apply(w)==="[object Array]")for(R=[],E=0;E<w.length;E+=1)R[E]=b(w[E],L+"["+E+"]");else{R={};for(D in w)Object.prototype.hasOwnProperty.call(w,D)&&(R[D]=b(w[D],L+"["+JSON.stringify(D)+"]"))}return R;case"number":case"string":case"boolean":return w}}(u,"$")}function An(u){try{return JSON.stringify(u)}catch{return JSON.stringify(ji(u))}}class ai{constructor(){this.globalLog=r=>{window.console&&window.console.log&&window.console.log(r)}}debug(...r){this.log(this.globalLog,r)}warn(...r){this.log(this.globalLogWarn,r)}error(...r){this.log(this.globalLogError,r)}globalLogWarn(r){window.console&&window.console.warn?window.console.warn(r):this.globalLog(r)}globalLogError(r){window.console&&window.console.error?window.console.error(r):this.globalLogWarn(r)}log(r,...c){var b=Re.apply(this,arguments);Pt.log?Pt.log(b):Pt.logToConsole&&r.bind(this)(b)}}var se=new ai,El=function(u,r,c,b,w){(c.headers!==void 0||c.headersProvider!=null)&&se.warn(`To send headers with the ${b.toString()} request, you must use AJAX, rather than JSONP.`);var L=u.nextAuthCallbackID.toString();u.nextAuthCallbackID++;var E=u.getDocument(),D=E.createElement("script");u.auth_callbacks[L]=function(X){w(null,X)};var R="Pusher.auth_callbacks['"+L+"']";D.src=c.endpoint+"?callback="+encodeURIComponent(R)+"&"+r;var Z=E.getElementsByTagName("head")[0]||E.documentElement;Z.insertBefore(D,Z.firstChild)},Pl=El;class Il{constructor(r){this.src=r}send(r){var c=this,b="Error loading "+c.src;c.script=document.createElement("script"),c.script.id=r.id,c.script.src=c.src,c.script.type="text/javascript",c.script.charset="UTF-8",c.script.addEventListener?(c.script.onerror=function(){r.callback(b)},c.script.onload=function(){r.callback(null)}):c.script.onreadystatechange=function(){(c.script.readyState==="loaded"||c.script.readyState==="complete")&&r.callback(null)},c.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(c.errorScript=document.createElement("script"),c.errorScript.id=r.id+"_error",c.errorScript.text=r.name+"('"+b+"');",c.script.async=c.errorScript.async=!1):c.script.async=!0;var w=document.getElementsByTagName("head")[0];w.insertBefore(c.script,w.firstChild),c.errorScript&&w.insertBefore(c.errorScript,c.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class Dl{constructor(r,c){this.url=r,this.data=c}send(r){if(!this.request){var c=Ui(this.data),b=this.url+"/"+r.number+"?"+c;this.request=O.createScriptRequest(b),this.request.send(r)}}cleanup(){this.request&&this.request.cleanup()}}var Bl=function(u,r){return function(c,b){var w="http"+(r?"s":"")+"://",L=w+(u.host||u.options.host)+u.options.path,E=O.createJSONPRequest(L,c),D=O.ScriptReceivers.create(function(R,Z){a.remove(D),E.cleanup(),Z&&Z.host&&(u.host=Z.host),b&&b(R,Z)});E.send(D)}},Nl={name:"jsonp",getAgent:Bl},Hl=Nl;function wt(u,r,c){var b=u+(r.useTLS?"s":""),w=r.useTLS?r.hostTLS:r.hostNonTLS;return b+"://"+w+c}function kt(u,r){var c="/app/"+u,b="?protocol="+d.PROTOCOL+"&client=js&version="+d.VERSION+(r?"&"+r:"");return c+b}var Rl={getInitial:function(u,r){var c=(r.httpPath||"")+kt(u,"flash=false");return wt("ws",r,c)}},Ol={getInitial:function(u,r){var c=(r.httpPath||"/pusher")+kt(u);return wt("http",r,c)}},Vl={getInitial:function(u,r){return wt("http",r,r.httpPath||"/pusher")},getPath:function(u,r){return kt(u)}};class Ul{constructor(){this._callbacks={}}get(r){return this._callbacks[St(r)]}add(r,c,b){var w=St(r);this._callbacks[w]=this._callbacks[w]||[],this._callbacks[w].push({fn:c,context:b})}remove(r,c,b){if(!r&&!c&&!b){this._callbacks={};return}var w=r?[St(r)]:We(this._callbacks);c||b?this.removeCallback(w,c,b):this.removeAllCallbacks(w)}removeCallback(r,c,b){he(r,function(w){this._callbacks[w]=Ie(this._callbacks[w]||[],function(L){return c&&c!==L.fn||b&&b!==L.context}),this._callbacks[w].length===0&&delete this._callbacks[w]},this)}removeAllCallbacks(r){he(r,function(c){delete this._callbacks[c]},this)}}function St(u){return"_"+u}class on{constructor(r){this.callbacks=new Ul,this.global_callbacks=[],this.failThrough=r}bind(r,c,b){return this.callbacks.add(r,c,b),this}bind_global(r){return this.global_callbacks.push(r),this}unbind(r,c,b){return this.callbacks.remove(r,c,b),this}unbind_global(r){return r?(this.global_callbacks=Ie(this.global_callbacks||[],c=>c!==r),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(r,c,b){for(var w=0;w<this.global_callbacks.length;w++)this.global_callbacks[w](r,c);var L=this.callbacks.get(r),E=[];if(b?E.push(c,b):c&&E.push(c),L&&L.length>0)for(var w=0;w<L.length;w++)L[w].fn.apply(L[w].context||window,E);else this.failThrough&&this.failThrough(r,c);return this}}class jl extends on{constructor(r,c,b,w,L){super(),this.initialize=O.transportConnectionInitializer,this.hooks=r,this.name=c,this.priority=b,this.key=w,this.options=L,this.state="new",this.timeline=L.timeline,this.activityTimeout=L.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var r=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(r,this.options)}catch(c){return re.defer(()=>{this.onError(c),this.changeState("closed")}),!1}return this.bindListeners(),se.debug("Connecting",{transport:this.name,url:r}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(r){return this.state==="open"?(re.defer(()=>{this.socket&&this.socket.send(r)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(r){this.emit("error",{type:"WebSocketError",error:r}),this.timeline.error(this.buildTimelineMessage({error:r.toString()}))}onClose(r){r?this.changeState("closed",{code:r.code,reason:r.reason,wasClean:r.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(r){this.emit("message",r)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=r=>{this.onError(r)},this.socket.onclose=r=>{this.onClose(r)},this.socket.onmessage=r=>{this.onMessage(r)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(r,c){this.state=r,this.timeline.info(this.buildTimelineMessage({state:r,params:c})),this.emit(r,c)}buildTimelineMessage(r){return fe({cid:this.id},r)}}class Gn{constructor(r){this.hooks=r}isSupported(r){return this.hooks.isSupported(r)}createConnection(r,c,b,w){return new jl(this.hooks,r,c,b,w)}}var Kl=new Gn({urls:Rl,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!O.getWebSocketAPI()},isSupported:function(){return!!O.getWebSocketAPI()},getSocket:function(u){return O.createWebSocket(u)}}),ss={urls:Ol,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},as=fe({getSocket:function(u){return O.HTTPFactory.createStreamingSocket(u)}},ss),rs=fe({getSocket:function(u){return O.HTTPFactory.createPollingSocket(u)}},ss),ls={isSupported:function(){return O.isXHRSupported()}},Fl=new Gn(fe({},as,ls)),Gl=new Gn(fe({},rs,ls)),zl={ws:Kl,xhr_streaming:Fl,xhr_polling:Gl},Ki=zl,ql=new Gn({file:"sockjs",urls:Vl,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(u,r){return new window.SockJS(u,null,{js_path:g.getPath("sockjs",{useTLS:r.useTLS}),ignore_null_origin:r.ignoreNullOrigin})},beforeOpen:function(u,r){u.send(JSON.stringify({path:r}))}}),ds={isSupported:function(u){var r=O.isXDRSupported(u.useTLS);return r}},Wl=new Gn(fe({},as,ds)),Zl=new Gn(fe({},rs,ds));Ki.xdr_streaming=Wl,Ki.xdr_polling=Zl,Ki.sockjs=ql;var Jl=Ki;class $l extends on{constructor(){super();var r=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){r.emit("online")},!1),window.addEventListener("offline",function(){r.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Yl=new $l;class Ql{constructor(r,c,b){this.manager=r,this.transport=c,this.minPingDelay=b.minPingDelay,this.maxPingDelay=b.maxPingDelay,this.pingDelay=void 0}createConnection(r,c,b,w){w=fe({},w,{activityTimeout:this.pingDelay});var L=this.transport.createConnection(r,c,b,w),E=null,D=function(){L.unbind("open",D),L.bind("closed",R),E=re.now()},R=Z=>{if(L.unbind("closed",R),Z.code===1002||Z.code===1003)this.manager.reportDeath();else if(!Z.wasClean&&E){var X=re.now()-E;X<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(X/2,this.minPingDelay))}};return L.bind("open",D),L}isSupported(r){return this.manager.isAlive()&&this.transport.isSupported(r)}}const cs={decodeMessage:function(u){try{var r=JSON.parse(u.data),c=r.data;if(typeof c=="string")try{c=JSON.parse(r.data)}catch{}var b={event:r.event,channel:r.channel,data:c};return r.user_id&&(b.user_id=r.user_id),b}catch(w){throw{type:"MessageParseError",error:w,data:u.data}}},encodeMessage:function(u){return JSON.stringify(u)},processHandshake:function(u){var r=cs.decodeMessage(u);if(r.event==="pusher:connection_established"){if(!r.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:r.data.socket_id,activityTimeout:r.data.activity_timeout*1e3}}else{if(r.event==="pusher:error")return{action:this.getCloseAction(r.data),error:this.getCloseError(r.data)};throw"Invalid handshake"}},getCloseAction:function(u){return u.code<4e3?u.code>=1002&&u.code<=1004?"backoff":null:u.code===4e3?"tls_only":u.code<4100?"refused":u.code<4200?"backoff":u.code<4300?"retry":"refused"},getCloseError:function(u){return u.code!==1e3&&u.code!==1001?{type:"PusherError",data:{code:u.code,message:u.reason||u.message}}:null}};var xn=cs;class Xl extends on{constructor(r,c){super(),this.id=r,this.transport=c,this.activityTimeout=c.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(r){return this.transport.send(r)}send_event(r,c,b){var w={event:r,data:c};return b&&(w.channel=b),se.debug("Event sent",w),this.send(xn.encodeMessage(w))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var r={message:b=>{var w;try{w=xn.decodeMessage(b)}catch(L){this.emit("error",{type:"MessageParseError",error:L,data:b.data})}if(w!==void 0){switch(se.debug("Event recd",w),w.event){case"pusher:error":this.emit("error",{type:"PusherError",data:w.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",w)}},activity:()=>{this.emit("activity")},error:b=>{this.emit("error",b)},closed:b=>{c(),b&&b.code&&this.handleCloseEvent(b),this.transport=null,this.emit("closed")}},c=()=>{we(r,(b,w)=>{this.transport.unbind(w,b)})};we(r,(b,w)=>{this.transport.bind(w,b)})}handleCloseEvent(r){var c=xn.getCloseAction(r),b=xn.getCloseError(r);b&&this.emit("error",b),c&&this.emit(c,{action:c,error:b})}}class ed{constructor(r,c){this.transport=r,this.callback=c,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=r=>{this.unbindListeners();var c;try{c=xn.processHandshake(r)}catch(b){this.finish("error",{error:b}),this.transport.close();return}c.action==="connected"?this.finish("connected",{connection:new Xl(c.id,this.transport),activityTimeout:c.activityTimeout}):(this.finish(c.action,{error:c.error}),this.transport.close())},this.onClosed=r=>{this.unbindListeners();var c=xn.getCloseAction(r)||"backoff",b=xn.getCloseError(r);this.finish(c,{error:b})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(r,c){this.callback(fe({transport:this.transport,action:r},c))}}class nd{constructor(r,c){this.timeline=r,this.options=c||{}}send(r,c){this.timeline.isEmpty()||this.timeline.send(O.TimelineTransport.getAgent(this,r),c)}}class _t extends on{constructor(r,c){super(function(b,w){se.debug("No callbacks on "+r+" for "+b)}),this.name=r,this.pusher=c,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(r,c){return c(null,{auth:""})}trigger(r,c){if(r.indexOf("client-")!==0)throw new S("Event '"+r+"' does not start with 'client-'");if(!this.subscribed){var b=k.buildLogSuffix("triggeringClientEvents");se.warn(`Client event triggered before channel 'subscription_succeeded' event . ${b}`)}return this.pusher.send_event(r,c,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(r){var c=r.event,b=r.data;if(c==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(r);else if(c==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(r);else if(c.indexOf("pusher_internal:")!==0){var w={};this.emit(c,b,w)}}handleSubscriptionSucceededEvent(r){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",r.data)}handleSubscriptionCountEvent(r){r.data.subscription_count&&(this.subscriptionCount=r.data.subscription_count),this.emit("pusher:subscription_count",r.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(r,c)=>{r?(this.subscriptionPending=!1,se.error(r.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:r.message},r instanceof V?{status:r.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:c.auth,channel_data:c.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class Mt extends _t{authorize(r,c){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:r},c)}}class id{constructor(){this.reset()}get(r){return Object.prototype.hasOwnProperty.call(this.members,r)?{id:r,info:this.members[r]}:null}each(r){we(this.members,(c,b)=>{r(this.get(b))})}setMyID(r){this.myID=r}onSubscription(r){this.members=r.presence.hash,this.count=r.presence.count,this.me=this.get(this.myID)}addMember(r){return this.get(r.user_id)===null&&this.count++,this.members[r.user_id]=r.user_info,this.get(r.user_id)}removeMember(r){var c=this.get(r.user_id);return c&&(delete this.members[r.user_id],this.count--),c}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var td=function(u,r,c,b){function w(L){return L instanceof c?L:new c(function(E){E(L)})}return new(c||(c=Promise))(function(L,E){function D(X){try{Z(b.next(X))}catch(pe){E(pe)}}function R(X){try{Z(b.throw(X))}catch(pe){E(pe)}}function Z(X){X.done?L(X.value):w(X.value).then(D,R)}Z((b=b.apply(u,r||[])).next())})};class od extends Mt{constructor(r,c){super(r,c),this.members=new id}authorize(r,c){super.authorize(r,(b,w)=>td(this,void 0,void 0,function*(){if(!b)if(w=w,w.channel_data!=null){var L=JSON.parse(w.channel_data);this.members.setMyID(L.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let E=k.buildLogSuffix("authorizationEndpoint");se.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${E}, or the user should be signed in.`),c("Invalid auth response");return}c(b,w)}))}handleEvent(r){var c=r.event;if(c.indexOf("pusher_internal:")===0)this.handleInternalEvent(r);else{var b=r.data,w={};r.user_id&&(w.user_id=r.user_id),this.emit(c,b,w)}}handleInternalEvent(r){var c=r.event,b=r.data;switch(c){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(r);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(r);break;case"pusher_internal:member_added":var w=this.members.addMember(b);this.emit("pusher:member_added",w);break;case"pusher_internal:member_removed":var L=this.members.removeMember(b);L&&this.emit("pusher:member_removed",L);break}}handleSubscriptionSucceededEvent(r){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(r.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var sd=o(1),At=o(0);class ad extends Mt{constructor(r,c,b){super(r,c),this.key=null,this.nacl=b}authorize(r,c){super.authorize(r,(b,w)=>{if(b){c(b,w);return}let L=w.shared_secret;if(!L){c(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(At.decode)(L),delete w.shared_secret,c(null,w)})}trigger(r,c){throw new I("Client events are not currently supported for encrypted channels")}handleEvent(r){var c=r.event,b=r.data;if(c.indexOf("pusher_internal:")===0||c.indexOf("pusher:")===0){super.handleEvent(r);return}this.handleEncryptedEvent(c,b)}handleEncryptedEvent(r,c){if(!this.key){se.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!c.ciphertext||!c.nonce){se.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+c);return}let b=Object(At.decode)(c.ciphertext);if(b.length<this.nacl.secretbox.overheadLength){se.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${b.length}`);return}let w=Object(At.decode)(c.nonce);if(w.length<this.nacl.secretbox.nonceLength){se.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${w.length}`);return}let L=this.nacl.secretbox.open(b,w,this.key);if(L===null){se.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(E,D)=>{if(E){se.error(`Failed to make a request to the authEndpoint: ${D}. Unable to fetch new key, so dropping encrypted event`);return}if(L=this.nacl.secretbox.open(b,w,this.key),L===null){se.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(r,this.getDataToEmit(L))});return}this.emit(r,this.getDataToEmit(L))}getDataToEmit(r){let c=Object(sd.decode)(r);try{return JSON.parse(c)}catch{return c}}}class rd extends on{constructor(r,c){super(),this.state="initialized",this.connection=null,this.key=r,this.options=c,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var b=O.getNetwork();b.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),b.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(r){return this.connection?this.connection.send(r):!1}send_event(r,c,b){return this.connection?this.connection.send_event(r,c,b):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var r=(c,b)=>{c?this.runner=this.strategy.connect(0,r):b.action==="error"?(this.emit("error",{type:"HandshakeError",error:b.error}),this.timeline.error({handshakeError:b.error})):(this.abortConnecting(),this.handshakeCallbacks[b.action](b))};this.runner=this.strategy.connect(0,r)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var r=this.abandonConnection();r.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(r){this.timeline.info({action:"retry",delay:r}),r>0&&this.emit("connecting_in",Math.round(r/1e3)),this.retryTimer=new Ee(r||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new Ee(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Ee(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new Ee(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(r){return fe({},r,{message:c=>{this.resetActivityCheck(),this.emit("message",c)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:c=>{this.emit("error",c)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(r){return fe({},r,{connected:c=>{this.activityTimeout=Math.min(this.options.activityTimeout,c.activityTimeout,c.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(c.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let r=c=>b=>{b.error&&this.emit("error",{type:"WebSocketError",error:b.error}),c(b)};return{tls_only:r(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:r(()=>{this.disconnect()}),backoff:r(()=>{this.retryIn(1e3)}),retry:r(()=>{this.retryIn(0)})}}setConnection(r){this.connection=r;for(var c in this.connectionCallbacks)this.connection.bind(c,this.connectionCallbacks[c]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var r in this.connectionCallbacks)this.connection.unbind(r,this.connectionCallbacks[r]);var c=this.connection;return this.connection=null,c}}updateState(r,c){var b=this.state;if(this.state=r,b!==r){var w=r;w==="connected"&&(w+=" with new socket ID "+c.socket_id),se.debug("State changed",b+" -> "+w),this.timeline.info({state:r,params:c}),this.emit("state_change",{previous:b,current:r}),this.emit(r,c)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class ld{constructor(){this.channels={}}add(r,c){return this.channels[r]||(this.channels[r]=dd(r,c)),this.channels[r]}all(){return B(this.channels)}find(r){return this.channels[r]}remove(r){var c=this.channels[r];return delete this.channels[r],c}disconnect(){we(this.channels,function(r){r.disconnect()})}}function dd(u,r){if(u.indexOf("private-encrypted-")===0){if(r.config.nacl)return sn.createEncryptedChannel(u,r,r.config.nacl);let c="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",b=k.buildLogSuffix("encryptedChannelSupport");throw new I(`${c}. ${b}`)}else{if(u.indexOf("private-")===0)return sn.createPrivateChannel(u,r);if(u.indexOf("presence-")===0)return sn.createPresenceChannel(u,r);if(u.indexOf("#")===0)throw new M('Cannot create a channel with name "'+u+'".');return sn.createChannel(u,r)}}var cd={createChannels(){return new ld},createConnectionManager(u,r){return new rd(u,r)},createChannel(u,r){return new _t(u,r)},createPrivateChannel(u,r){return new Mt(u,r)},createPresenceChannel(u,r){return new od(u,r)},createEncryptedChannel(u,r,c){return new ad(u,r,c)},createTimelineSender(u,r){return new nd(u,r)},createHandshake(u,r){return new ed(u,r)},createAssistantToTheTransportManager(u,r,c){return new Ql(u,r,c)}},sn=cd;class us{constructor(r){this.options=r||{},this.livesLeft=this.options.lives||1/0}getAssistant(r){return sn.createAssistantToTheTransportManager(this,r,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Ln{constructor(r,c){this.strategies=r,this.loop=!!c.loop,this.failFast=!!c.failFast,this.timeout=c.timeout,this.timeoutLimit=c.timeoutLimit}isSupported(){return si(this.strategies,re.method("isSupported"))}connect(r,c){var b=this.strategies,w=0,L=this.timeout,E=null,D=(R,Z)=>{Z?c(null,Z):(w=w+1,this.loop&&(w=w%b.length),w<b.length?(L&&(L=L*2,this.timeoutLimit&&(L=Math.min(L,this.timeoutLimit))),E=this.tryStrategy(b[w],r,{timeout:L,failFast:this.failFast},D)):c(!0))};return E=this.tryStrategy(b[w],r,{timeout:L,failFast:this.failFast},D),{abort:function(){E.abort()},forceMinPriority:function(R){r=R,E&&E.forceMinPriority(R)}}}tryStrategy(r,c,b,w){var L=null,E=null;return b.timeout>0&&(L=new Ee(b.timeout,function(){E.abort(),w(!0)})),E=r.connect(c,function(D,R){D&&L&&L.isRunning()&&!b.failFast||(L&&L.ensureAborted(),w(D,R))}),{abort:function(){L&&L.ensureAborted(),E.abort()},forceMinPriority:function(D){E.forceMinPriority(D)}}}}class xt{constructor(r){this.strategies=r}isSupported(){return si(this.strategies,re.method("isSupported"))}connect(r,c){return ud(this.strategies,r,function(b,w){return function(L,E){if(w[b].error=L,L){hd(w)&&c(!0);return}he(w,function(D){D.forceMinPriority(E.transport.priority)}),c(null,E)}})}}function ud(u,r,c){var b=Q(u,function(w,L,E,D){return w.connect(r,c(L,D))});return{abort:function(){he(b,md)},forceMinPriority:function(w){he(b,function(L){L.forceMinPriority(w)})}}}function hd(u){return Oi(u,function(r){return!!r.error})}function md(u){!u.error&&!u.aborted&&(u.abort(),u.aborted=!0)}class pd{constructor(r,c,b){this.strategy=r,this.transports=c,this.ttl=b.ttl||1800*1e3,this.usingTLS=b.useTLS,this.timeline=b.timeline}isSupported(){return this.strategy.isSupported()}connect(r,c){var b=this.usingTLS,w=vd(b),L=w&&w.cacheSkipCount?w.cacheSkipCount:0,E=[this.strategy];if(w&&w.timestamp+this.ttl>=re.now()){var D=this.transports[w.transport];D&&(["ws","wss"].includes(w.transport)||L>3?(this.timeline.info({cached:!0,transport:w.transport,latency:w.latency}),E.push(new Ln([D],{timeout:w.latency*2+1e3,failFast:!0}))):L++)}var R=re.now(),Z=E.pop().connect(r,function X(pe,zi){pe?(hs(b),E.length>0?(R=re.now(),Z=E.pop().connect(r,X)):c(pe)):(bd(b,zi.transport.name,re.now()-R,L),c(null,zi))});return{abort:function(){Z.abort()},forceMinPriority:function(X){r=X,Z&&Z.forceMinPriority(X)}}}}function Lt(u){return"pusherTransport"+(u?"TLS":"NonTLS")}function vd(u){var r=O.getLocalStorage();if(r)try{var c=r[Lt(u)];if(c)return JSON.parse(c)}catch{hs(u)}return null}function bd(u,r,c,b){var w=O.getLocalStorage();if(w)try{w[Lt(u)]=An({timestamp:re.now(),transport:r,latency:c,cacheSkipCount:b})}catch{}}function hs(u){var r=O.getLocalStorage();if(r)try{delete r[Lt(u)]}catch{}}class Fi{constructor(r,{delay:c}){this.strategy=r,this.options={delay:c}}isSupported(){return this.strategy.isSupported()}connect(r,c){var b=this.strategy,w,L=new Ee(this.options.delay,function(){w=b.connect(r,c)});return{abort:function(){L.ensureAborted(),w&&w.abort()},forceMinPriority:function(E){r=E,w&&w.forceMinPriority(E)}}}}class ri{constructor(r,c,b){this.test=r,this.trueBranch=c,this.falseBranch=b}isSupported(){var r=this.test()?this.trueBranch:this.falseBranch;return r.isSupported()}connect(r,c){var b=this.test()?this.trueBranch:this.falseBranch;return b.connect(r,c)}}class fd{constructor(r){this.strategy=r}isSupported(){return this.strategy.isSupported()}connect(r,c){var b=this.strategy.connect(r,function(w,L){L&&b.abort(),c(w,L)});return b}}function li(u){return function(){return u.isSupported()}}var gd=function(u,r,c){var b={};function w(Ss,fc,gc,yc,Cc){var _s=c(u,Ss,fc,gc,yc,Cc);return b[Ss]=_s,_s}var L=Object.assign({},r,{hostNonTLS:u.wsHost+":"+u.wsPort,hostTLS:u.wsHost+":"+u.wssPort,httpPath:u.wsPath}),E=Object.assign({},L,{useTLS:!0}),D=Object.assign({},r,{hostNonTLS:u.httpHost+":"+u.httpPort,hostTLS:u.httpHost+":"+u.httpsPort,httpPath:u.httpPath}),R={loop:!0,timeout:15e3,timeoutLimit:6e4},Z=new us({minPingDelay:1e4,maxPingDelay:u.activityTimeout}),X=new us({lives:2,minPingDelay:1e4,maxPingDelay:u.activityTimeout}),pe=w("ws","ws",3,L,Z),zi=w("wss","ws",3,E,Z),hc=w("sockjs","sockjs",1,D),fs=w("xhr_streaming","xhr_streaming",1,D,X),mc=w("xdr_streaming","xdr_streaming",1,D,X),gs=w("xhr_polling","xhr_polling",1,D),pc=w("xdr_polling","xdr_polling",1,D),ys=new Ln([pe],R),vc=new Ln([zi],R),bc=new Ln([hc],R),Cs=new Ln([new ri(li(fs),fs,mc)],R),ws=new Ln([new ri(li(gs),gs,pc)],R),ks=new Ln([new ri(li(Cs),new xt([Cs,new Fi(ws,{delay:4e3})]),ws)],R),It=new ri(li(ks),ks,bc),Dt;return r.useTLS?Dt=new xt([ys,new Fi(It,{delay:2e3})]):Dt=new xt([ys,new Fi(vc,{delay:2e3}),new Fi(It,{delay:5e3})]),new pd(new fd(new ri(li(pe),Dt,It)),b,{ttl:18e5,timeline:r.timeline,useTLS:r.useTLS})},yd=gd,Cd=function(){var u=this;u.timeline.info(u.buildTimelineMessage({transport:u.name+(u.options.useTLS?"s":"")})),u.hooks.isInitialized()?u.changeState("initialized"):u.hooks.file?(u.changeState("initializing"),g.load(u.hooks.file,{useTLS:u.options.useTLS},function(r,c){u.hooks.isInitialized()?(u.changeState("initialized"),c(!0)):(r&&u.onError(r),u.onClose(),c(!1))})):u.onClose()},wd={getRequest:function(u){var r=new window.XDomainRequest;return r.ontimeout=function(){u.emit("error",new A),u.close()},r.onerror=function(c){u.emit("error",c),u.close()},r.onprogress=function(){r.responseText&&r.responseText.length>0&&u.onChunk(200,r.responseText)},r.onload=function(){r.responseText&&r.responseText.length>0&&u.onChunk(200,r.responseText),u.emit("finished",200),u.close()},r},abortRequest:function(u){u.ontimeout=u.onerror=u.onprogress=u.onload=null,u.abort()}},kd=wd;const Sd=256*1024;class _d extends on{constructor(r,c,b){super(),this.hooks=r,this.method=c,this.url=b}start(r){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},O.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(r)}close(){this.unloader&&(O.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(r,c){for(;;){var b=this.advanceBuffer(c);if(b)this.emit("chunk",{status:r,data:b});else break}this.isBufferTooLong(c)&&this.emit("buffer_too_long")}advanceBuffer(r){var c=r.slice(this.position),b=c.indexOf(`
|
|
1148
|
-
`);return b!==-1?(this.position+=b+1,c.slice(0,b)):null}isBufferTooLong(r){return this.position===r.length&&r.length>Sd}}var Tt;(function(u){u[u.CONNECTING=0]="CONNECTING",u[u.OPEN=1]="OPEN",u[u.CLOSED=3]="CLOSED"})(Tt||(Tt={}));var Tn=Tt,Md=1;class Ad{constructor(r,c){this.hooks=r,this.session=ps(1e3)+"/"+Ed(8),this.location=xd(c),this.readyState=Tn.CONNECTING,this.openStream()}send(r){return this.sendRaw(JSON.stringify([r]))}ping(){this.hooks.sendHeartbeat(this)}close(r,c){this.onClose(r,c,!0)}sendRaw(r){if(this.readyState===Tn.OPEN)try{return O.createSocketRequest("POST",ms(Ld(this.location,this.session))).start(r),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(r,c,b){this.closeStream(),this.readyState=Tn.CLOSED,this.onclose&&this.onclose({code:r,reason:c,wasClean:b})}onChunk(r){if(r.status===200){this.readyState===Tn.OPEN&&this.onActivity();var c,b=r.data.slice(0,1);switch(b){case"o":c=JSON.parse(r.data.slice(1)||"{}"),this.onOpen(c);break;case"a":c=JSON.parse(r.data.slice(1)||"[]");for(var w=0;w<c.length;w++)this.onEvent(c[w]);break;case"m":c=JSON.parse(r.data.slice(1)||"null"),this.onEvent(c);break;case"h":this.hooks.onHeartbeat(this);break;case"c":c=JSON.parse(r.data.slice(1)||"[]"),this.onClose(c[0],c[1],!0);break}}}onOpen(r){this.readyState===Tn.CONNECTING?(r&&r.hostname&&(this.location.base=Td(this.location.base,r.hostname)),this.readyState=Tn.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(r){this.readyState===Tn.OPEN&&this.onmessage&&this.onmessage({data:r})}onActivity(){this.onactivity&&this.onactivity()}onError(r){this.onerror&&this.onerror(r)}openStream(){this.stream=O.createSocketRequest("POST",ms(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",r=>{this.onChunk(r)}),this.stream.bind("finished",r=>{this.hooks.onFinished(this,r)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(r){re.defer(()=>{this.onError(r),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function xd(u){var r=/([^\?]*)\/*(\??.*)/.exec(u);return{base:r[1],queryString:r[2]}}function Ld(u,r){return u.base+"/"+r+"/xhr_send"}function ms(u){var r=u.indexOf("?")===-1?"?":"&";return u+r+"t="+ +new Date+"&n="+Md++}function Td(u,r){var c=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(u);return c[1]+r+c[3]}function ps(u){return O.randomInt(u)}function Ed(u){for(var r=[],c=0;c<u;c++)r.push(ps(32).toString(32));return r.join("")}var Pd=Ad,Id={getReceiveURL:function(u,r){return u.base+"/"+r+"/xhr_streaming"+u.queryString},onHeartbeat:function(u){u.sendRaw("[]")},sendHeartbeat:function(u){u.sendRaw("[]")},onFinished:function(u,r){u.onClose(1006,"Connection interrupted ("+r+")",!1)}},Dd=Id,Bd={getReceiveURL:function(u,r){return u.base+"/"+r+"/xhr"+u.queryString},onHeartbeat:function(){},sendHeartbeat:function(u){u.sendRaw("[]")},onFinished:function(u,r){r===200?u.reconnect():u.onClose(1006,"Connection interrupted ("+r+")",!1)}},Nd=Bd,Hd={getRequest:function(u){var r=O.getXHRAPI(),c=new r;return c.onreadystatechange=c.onprogress=function(){switch(c.readyState){case 3:c.responseText&&c.responseText.length>0&&u.onChunk(c.status,c.responseText);break;case 4:c.responseText&&c.responseText.length>0&&u.onChunk(c.status,c.responseText),u.emit("finished",c.status),u.close();break}},c},abortRequest:function(u){u.onreadystatechange=null,u.abort()}},Rd=Hd,Od={createStreamingSocket(u){return this.createSocket(Dd,u)},createPollingSocket(u){return this.createSocket(Nd,u)},createSocket(u,r){return new Pd(u,r)},createXHR(u,r){return this.createRequest(Rd,u,r)},createRequest(u,r,c){return new _d(u,r,c)}},vs=Od;vs.createXDR=function(u,r){return this.createRequest(kd,u,r)};var Vd=vs,Ud={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:a,DependenciesReceivers:p,getDefaultStrategy:yd,Transports:Jl,transportConnectionInitializer:Cd,HTTPFactory:Vd,TimelineTransport:Hl,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(u){window.Pusher=u;var r=()=>{this.onDocumentBody(u.ready)};window.JSON?r():g.load("json2",{},r)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:oe,jsonp:Pl}},onDocumentBody(u){document.body?u():setTimeout(()=>{this.onDocumentBody(u)},0)},createJSONPRequest(u,r){return new Dl(u,r)},createScriptRequest(u){return new Il(u)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var u=this.getXHRAPI();return new u},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Yl},createWebSocket(u){var r=this.getWebSocketAPI();return new r(u)},createSocketRequest(u,r){if(this.isXHRSupported())return this.HTTPFactory.createXHR(u,r);if(this.isXDRSupported(r.indexOf("https:")===0))return this.HTTPFactory.createXDR(u,r);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var u=this.getXHRAPI();return!!u&&new u().withCredentials!==void 0},isXDRSupported(u){var r=u?"https:":"http:",c=this.getProtocol();return!!window.XDomainRequest&&c===r},addUnloadListener(u){window.addEventListener!==void 0?window.addEventListener("unload",u,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",u)},removeUnloadListener(u){window.addEventListener!==void 0?window.removeEventListener("unload",u,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",u)},randomInt(u){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*u)}},O=Ud,Et;(function(u){u[u.ERROR=3]="ERROR",u[u.INFO=6]="INFO",u[u.DEBUG=7]="DEBUG"})(Et||(Et={}));var Gi=Et;class jd{constructor(r,c,b){this.key=r,this.session=c,this.events=[],this.options=b||{},this.sent=0,this.uniqueID=0}log(r,c){r<=this.options.level&&(this.events.push(fe({},c,{timestamp:re.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(r){this.log(Gi.ERROR,r)}info(r){this.log(Gi.INFO,r)}debug(r){this.log(Gi.DEBUG,r)}isEmpty(){return this.events.length===0}send(r,c){var b=fe({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],r(b,(w,L)=>{w||this.sent++,c&&c(w,L)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class Kd{constructor(r,c,b,w){this.name=r,this.priority=c,this.transport=b,this.options=w||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(r,c){if(this.isSupported()){if(this.priority<r)return bs(new _,c)}else return bs(new G,c);var b=!1,w=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),L=null,E=function(){w.unbind("initialized",E),w.connect()},D=function(){L=sn.createHandshake(w,function(pe){b=!0,X(),c(null,pe)})},R=function(pe){X(),c(pe)},Z=function(){X();var pe;pe=An(w),c(new T(pe))},X=function(){w.unbind("initialized",E),w.unbind("open",D),w.unbind("error",R),w.unbind("closed",Z)};return w.bind("initialized",E),w.bind("open",D),w.bind("error",R),w.bind("closed",Z),w.initialize(),{abort:()=>{b||(X(),L?L.close():w.close())},forceMinPriority:pe=>{b||this.priority<pe&&(L?L.close():w.close())}}}}function bs(u,r){return re.defer(function(){r(u)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Fd}=O;var Gd=function(u,r,c,b,w,L){var E=Fd[c];if(!E)throw new K(c);var D=(!u.enabledTransports||Pe(u.enabledTransports,r)!==-1)&&(!u.disabledTransports||Pe(u.disabledTransports,r)===-1),R;return D?(w=Object.assign({ignoreNullOrigin:u.ignoreNullOrigin},w),R=new Kd(r,b,L?L.getAssistant(E):E,w)):R=zd,R},zd={isSupported:function(){return!1},connect:function(u,r){var c=re.defer(function(){r(new G)});return{abort:function(){c.ensureAborted()},forceMinPriority:function(){}}}};function qd(u){if(u==null)throw"You must pass an options object";if(u.cluster==null)throw"Options object must provide a cluster";"disableStats"in u&&se.warn("The disableStats option is deprecated in favor of enableStats")}const Wd=(u,r)=>{var c="socket_id="+encodeURIComponent(u.socketId);for(var b in r.params)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(r.params[b]);if(r.paramsProvider!=null){let w=r.paramsProvider();for(var b in w)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(w[b])}return c};var Zd=u=>{if(typeof O.getAuthorizers()[u.transport]>"u")throw`'${u.transport}' is not a recognized auth transport`;return(r,c)=>{const b=Wd(r,u);O.getAuthorizers()[u.transport](O,b,u,C.UserAuthentication,c)}};const Jd=(u,r)=>{var c="socket_id="+encodeURIComponent(u.socketId);c+="&channel_name="+encodeURIComponent(u.channelName);for(var b in r.params)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(r.params[b]);if(r.paramsProvider!=null){let w=r.paramsProvider();for(var b in w)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(w[b])}return c};var $d=u=>{if(typeof O.getAuthorizers()[u.transport]>"u")throw`'${u.transport}' is not a recognized auth transport`;return(r,c)=>{const b=Jd(r,u);O.getAuthorizers()[u.transport](O,b,u,C.ChannelAuthorization,c)}};const Yd=(u,r,c)=>{const b={authTransport:r.transport,authEndpoint:r.endpoint,auth:{params:r.params,headers:r.headers}};return(w,L)=>{const E=u.channel(w.channelName);c(E,b).authorize(w.socketId,L)}};function Qd(u,r){let c={activityTimeout:u.activityTimeout||d.activityTimeout,cluster:u.cluster,httpPath:u.httpPath||d.httpPath,httpPort:u.httpPort||d.httpPort,httpsPort:u.httpsPort||d.httpsPort,pongTimeout:u.pongTimeout||d.pongTimeout,statsHost:u.statsHost||d.stats_host,unavailableTimeout:u.unavailableTimeout||d.unavailableTimeout,wsPath:u.wsPath||d.wsPath,wsPort:u.wsPort||d.wsPort,wssPort:u.wssPort||d.wssPort,enableStats:tc(u),httpHost:Xd(u),useTLS:ic(u),wsHost:ec(u),userAuthenticator:oc(u),channelAuthorizer:ac(u,r)};return"disabledTransports"in u&&(c.disabledTransports=u.disabledTransports),"enabledTransports"in u&&(c.enabledTransports=u.enabledTransports),"ignoreNullOrigin"in u&&(c.ignoreNullOrigin=u.ignoreNullOrigin),"timelineParams"in u&&(c.timelineParams=u.timelineParams),"nacl"in u&&(c.nacl=u.nacl),c}function Xd(u){return u.httpHost?u.httpHost:u.cluster?`sockjs-${u.cluster}.pusher.com`:d.httpHost}function ec(u){return u.wsHost?u.wsHost:nc(u.cluster)}function nc(u){return`ws-${u}.pusher.com`}function ic(u){return O.getProtocol()==="https:"?!0:u.forceTLS!==!1}function tc(u){return"enableStats"in u?u.enableStats:"disableStats"in u?!u.disableStats:!1}function oc(u){const r=Object.assign(Object.assign({},d.userAuthentication),u.userAuthentication);return"customHandler"in r&&r.customHandler!=null?r.customHandler:Zd(r)}function sc(u,r){let c;return"channelAuthorization"in u?c=Object.assign(Object.assign({},d.channelAuthorization),u.channelAuthorization):(c={transport:u.authTransport||d.authTransport,endpoint:u.authEndpoint||d.authEndpoint},"auth"in u&&("params"in u.auth&&(c.params=u.auth.params),"headers"in u.auth&&(c.headers=u.auth.headers)),"authorizer"in u&&(c.customHandler=Yd(r,c,u.authorizer))),c}function ac(u,r){const c=sc(u,r);return"customHandler"in c&&c.customHandler!=null?c.customHandler:$d(c)}class rc extends on{constructor(r){super(function(c,b){se.debug(`No callbacks on watchlist events for ${c}`)}),this.pusher=r,this.bindWatchlistInternalEvent()}handleEvent(r){r.data.events.forEach(c=>{this.emit(c.name,c)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",r=>{var c=r.event;c==="pusher_internal:watchlist_events"&&this.handleEvent(r)})}}function lc(){let u,r;return{promise:new Promise((b,w)=>{u=b,r=w}),resolve:u,reject:r}}var dc=lc;class cc extends on{constructor(r){super(function(c,b){se.debug("No callbacks on user for "+c)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(c,b)=>{if(c){se.warn(`Error during signin: ${c}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:b.auth,user_data:b.user_data})},this.pusher=r,this.pusher.connection.bind("state_change",({previous:c,current:b})=>{c!=="connected"&&b==="connected"&&this._signin(),c==="connected"&&b!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new rc(r),this.pusher.connection.bind("message",c=>{var b=c.event;b==="pusher:signin_success"&&this._onSigninSuccess(c.data),this.serverToUserChannel&&this.serverToUserChannel.name===c.channel&&this.serverToUserChannel.handleEvent(c)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(r){try{this.user_data=JSON.parse(r.user_data)}catch{se.error(`Failed parsing user data after signin: ${r.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){se.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const r=c=>{c.subscriptionPending&&c.subscriptionCancelled?c.reinstateSubscription():!c.subscriptionPending&&this.pusher.connection.state==="connected"&&c.subscribe()};this.serverToUserChannel=new _t(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((c,b)=>{c.indexOf("pusher_internal:")===0||c.indexOf("pusher:")===0||this.emit(c,b)}),r(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:r,resolve:c,reject:b}=dc();r.done=!1;const w=()=>{r.done=!0};r.then(w).catch(w),this.signinDonePromise=r,this._signinDoneResolve=c}}class ye{static ready(){ye.isReady=!0;for(var r=0,c=ye.instances.length;r<c;r++)ye.instances[r].connect()}static getClientFeatures(){return We($({ws:O.Transports.ws},function(r){return r.isSupported({})}))}constructor(r,c){uc(r),qd(c),this.key=r,this.config=Qd(c,this),this.channels=sn.createChannels(),this.global_emitter=new on,this.sessionID=O.randomInt(1e9),this.timeline=new jd(this.key,this.sessionID,{cluster:this.config.cluster,features:ye.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Gi.INFO,version:d.VERSION}),this.config.enableStats&&(this.timelineSender=sn.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+O.TimelineTransport.name}));var b=w=>O.getDefaultStrategy(this.config,w,Gd);this.connection=sn.createConnectionManager(this.key,{getStrategy:b,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",w=>{var L=w.event,E=L.indexOf("pusher_internal:")===0;if(w.channel){var D=this.channel(w.channel);D&&D.handleEvent(w)}E||this.global_emitter.emit(w.event,w.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",w=>{se.warn(w)}),ye.instances.push(this),this.timeline.info({instances:ye.instances.length}),this.user=new cc(this),ye.isReady&&this.connect()}channel(r){return this.channels.find(r)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var r=this.connection.isUsingTLS(),c=this.timelineSender;this.timelineSenderTimer=new tn(6e4,function(){c.send(r)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(r,c,b){return this.global_emitter.bind(r,c,b),this}unbind(r,c,b){return this.global_emitter.unbind(r,c,b),this}bind_global(r){return this.global_emitter.bind_global(r),this}unbind_global(r){return this.global_emitter.unbind_global(r),this}unbind_all(r){return this.global_emitter.unbind_all(),this}subscribeAll(){var r;for(r in this.channels.channels)this.channels.channels.hasOwnProperty(r)&&this.subscribe(r)}subscribe(r){var c=this.channels.add(r,this);return c.subscriptionPending&&c.subscriptionCancelled?c.reinstateSubscription():!c.subscriptionPending&&this.connection.state==="connected"&&c.subscribe(),c}unsubscribe(r){var c=this.channels.find(r);c&&c.subscriptionPending?c.cancelSubscription():(c=this.channels.remove(r),c&&c.subscribed&&c.unsubscribe())}send_event(r,c,b){return this.connection.send_event(r,c,b)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}ye.instances=[],ye.isReady=!1,ye.logToConsole=!1,ye.Runtime=O,ye.ScriptReceivers=O.ScriptReceivers,ye.DependenciesReceivers=O.DependenciesReceivers,ye.auth_callbacks=O.auth_callbacks;var Pt=t.default=ye;function uc(u){if(u==null)throw"You must pass your app key when you instantiate Pusher."}O.setup(ye)}])})})(Zo);var Zr=Zo.exports;const Jr=Wr(Zr);class Jo{constructor(e){h(this,"container");h(this,"onAction");h(this,"onFail");h(this,"initialTime");h(this,"timeLeft");h(this,"timerId");h(this,"payment");this.container=e.container,this.onAction=e.onAction,this.onFail=e.onFail,this.initialTime=1800,this.timeLeft=this.initialTime,this.timerId=null}attachListener(){const e=this.container.querySelector("#transfer-acn"),i=this.container.querySelector("#copy-acn"),t=this.container.querySelector("#acn-tooltip"),o=this.container.querySelector("#transfer-amount"),s=this.container.querySelector("#copy-amount"),a=this.container.querySelector("#amount-tooltip"),l=this.container.querySelector("#transfer-button");i&&e&&i.addEventListener("click",()=>{P.track("copy_transferBank",{payment_method:"Transfer",payment_process:"Payment Started"}),t&&this.copyToClipboard(e.innerHTML,t)}),s&&o&&s.addEventListener("click",()=>{P.track("copy_transferAmount",{payment_method:"Transfer"}),a&&this.copyToClipboard(o.innerHTML.split(" ")[1].replace(/,/g,""),a)}),l&&l.addEventListener("click",()=>{this.onAction(5),P.track("initiate_payment_verification",{payment_method:"Transfer"})})}startTimer(e){this.stopTimer(),this.timerId=window.setInterval(()=>{if(this.timeLeft>0){this.timeLeft-=1;const i=this.container.querySelector("#time-left");i&&(i.innerHTML=zn(this.timeLeft))}else this.stopTimer(),e==="check"&&this.onAction(2)},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}copyToClipboard(e,i){navigator.clipboard.writeText(e).then(()=>{i.innerHTML="Copied!"}).catch(()=>{i.innerHTML="Failed to copy"})}renderComponent(e){var g,f,y,k,C,S;e&&(this.payment=e),this.container.innerHTML=this.render();const i=this.container.querySelector("#transfer-amount"),t=this.container.querySelector("#transfer-bank"),o=this.container.querySelector("#account-name"),s=this.container.querySelector("#transfer-acn"),a=this.container.querySelector("#time-left"),l=((g=this.payment)==null?void 0:g.currency)||"USD",d=l==="USD"?(f=this.payment)==null?void 0:f.localCurrency:l;if(i&&(i.innerHTML=`${d} ${xe(this.payment.totalTaxAmount?this.payment.totalLocalAmount:l==="USD"?(y=this.payment)==null?void 0:y.localAmount:(k=this.payment)==null?void 0:k.amount,2)}`),t&&this.payment.bankDetails&&(t.innerHTML=(C=this.payment.bankDetails)==null?void 0:C.bankName),o&&this.payment.bankDetails&&(o.innerHTML=(S=this.payment.bankDetails)==null?void 0:S.accountName),s&&this.payment.bankDetails&&(s.innerHTML=this.payment.bankDetails.accountNumber),a&&(a.innerHTML=zn(this.initialTime)),this.startTimer("poll"),e.status==="inProgress"){const M="45654f3ce4c9512ea9a4",A="us2";var v=new Jr(M,{cluster:A}),p=v.subscribe(e.reference);p.bind("payment_status",_=>{_.status==="successful"?(clearInterval(this.timerId||void 0),this.onAction(6),P.track("verify_payment",{payment_method:"Transfer",verification_status:"Success"}),_!=null&&_.redirectUrl&&setTimeout(()=>{const T=new URL(_.redirectUrl);T.searchParams.append("status",_.status),T.searchParams.append("reference",_.reference),window.location.href=T.toString()},1800)):_.status==="failed"&&(clearInterval(this.timerId||void 0),this.onFail(7,"Transfer failed"),P.track("verify_payment",{payment_method:"Transfer",verification_status:"Failed"}))})}this.attachListener()}render(){return qr}}const $r=`<div id="trasferConfirmationProgress">
|
|
1148
|
+
`);return b!==-1?(this.position+=b+1,c.slice(0,b)):null}isBufferTooLong(r){return this.position===r.length&&r.length>Sd}}var Tt;(function(u){u[u.CONNECTING=0]="CONNECTING",u[u.OPEN=1]="OPEN",u[u.CLOSED=3]="CLOSED"})(Tt||(Tt={}));var Tn=Tt,Md=1;class Ad{constructor(r,c){this.hooks=r,this.session=ps(1e3)+"/"+Ed(8),this.location=xd(c),this.readyState=Tn.CONNECTING,this.openStream()}send(r){return this.sendRaw(JSON.stringify([r]))}ping(){this.hooks.sendHeartbeat(this)}close(r,c){this.onClose(r,c,!0)}sendRaw(r){if(this.readyState===Tn.OPEN)try{return O.createSocketRequest("POST",ms(Ld(this.location,this.session))).start(r),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(r,c,b){this.closeStream(),this.readyState=Tn.CLOSED,this.onclose&&this.onclose({code:r,reason:c,wasClean:b})}onChunk(r){if(r.status===200){this.readyState===Tn.OPEN&&this.onActivity();var c,b=r.data.slice(0,1);switch(b){case"o":c=JSON.parse(r.data.slice(1)||"{}"),this.onOpen(c);break;case"a":c=JSON.parse(r.data.slice(1)||"[]");for(var w=0;w<c.length;w++)this.onEvent(c[w]);break;case"m":c=JSON.parse(r.data.slice(1)||"null"),this.onEvent(c);break;case"h":this.hooks.onHeartbeat(this);break;case"c":c=JSON.parse(r.data.slice(1)||"[]"),this.onClose(c[0],c[1],!0);break}}}onOpen(r){this.readyState===Tn.CONNECTING?(r&&r.hostname&&(this.location.base=Td(this.location.base,r.hostname)),this.readyState=Tn.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(r){this.readyState===Tn.OPEN&&this.onmessage&&this.onmessage({data:r})}onActivity(){this.onactivity&&this.onactivity()}onError(r){this.onerror&&this.onerror(r)}openStream(){this.stream=O.createSocketRequest("POST",ms(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",r=>{this.onChunk(r)}),this.stream.bind("finished",r=>{this.hooks.onFinished(this,r)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(r){re.defer(()=>{this.onError(r),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function xd(u){var r=/([^\?]*)\/*(\??.*)/.exec(u);return{base:r[1],queryString:r[2]}}function Ld(u,r){return u.base+"/"+r+"/xhr_send"}function ms(u){var r=u.indexOf("?")===-1?"?":"&";return u+r+"t="+ +new Date+"&n="+Md++}function Td(u,r){var c=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(u);return c[1]+r+c[3]}function ps(u){return O.randomInt(u)}function Ed(u){for(var r=[],c=0;c<u;c++)r.push(ps(32).toString(32));return r.join("")}var Pd=Ad,Id={getReceiveURL:function(u,r){return u.base+"/"+r+"/xhr_streaming"+u.queryString},onHeartbeat:function(u){u.sendRaw("[]")},sendHeartbeat:function(u){u.sendRaw("[]")},onFinished:function(u,r){u.onClose(1006,"Connection interrupted ("+r+")",!1)}},Dd=Id,Bd={getReceiveURL:function(u,r){return u.base+"/"+r+"/xhr"+u.queryString},onHeartbeat:function(){},sendHeartbeat:function(u){u.sendRaw("[]")},onFinished:function(u,r){r===200?u.reconnect():u.onClose(1006,"Connection interrupted ("+r+")",!1)}},Nd=Bd,Hd={getRequest:function(u){var r=O.getXHRAPI(),c=new r;return c.onreadystatechange=c.onprogress=function(){switch(c.readyState){case 3:c.responseText&&c.responseText.length>0&&u.onChunk(c.status,c.responseText);break;case 4:c.responseText&&c.responseText.length>0&&u.onChunk(c.status,c.responseText),u.emit("finished",c.status),u.close();break}},c},abortRequest:function(u){u.onreadystatechange=null,u.abort()}},Rd=Hd,Od={createStreamingSocket(u){return this.createSocket(Dd,u)},createPollingSocket(u){return this.createSocket(Nd,u)},createSocket(u,r){return new Pd(u,r)},createXHR(u,r){return this.createRequest(Rd,u,r)},createRequest(u,r,c){return new _d(u,r,c)}},vs=Od;vs.createXDR=function(u,r){return this.createRequest(kd,u,r)};var Vd=vs,Ud={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:a,DependenciesReceivers:p,getDefaultStrategy:yd,Transports:Jl,transportConnectionInitializer:Cd,HTTPFactory:Vd,TimelineTransport:Hl,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(u){window.Pusher=u;var r=()=>{this.onDocumentBody(u.ready)};window.JSON?r():g.load("json2",{},r)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:oe,jsonp:Pl}},onDocumentBody(u){document.body?u():setTimeout(()=>{this.onDocumentBody(u)},0)},createJSONPRequest(u,r){return new Dl(u,r)},createScriptRequest(u){return new Il(u)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var u=this.getXHRAPI();return new u},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Yl},createWebSocket(u){var r=this.getWebSocketAPI();return new r(u)},createSocketRequest(u,r){if(this.isXHRSupported())return this.HTTPFactory.createXHR(u,r);if(this.isXDRSupported(r.indexOf("https:")===0))return this.HTTPFactory.createXDR(u,r);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var u=this.getXHRAPI();return!!u&&new u().withCredentials!==void 0},isXDRSupported(u){var r=u?"https:":"http:",c=this.getProtocol();return!!window.XDomainRequest&&c===r},addUnloadListener(u){window.addEventListener!==void 0?window.addEventListener("unload",u,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",u)},removeUnloadListener(u){window.addEventListener!==void 0?window.removeEventListener("unload",u,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",u)},randomInt(u){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*u)}},O=Ud,Et;(function(u){u[u.ERROR=3]="ERROR",u[u.INFO=6]="INFO",u[u.DEBUG=7]="DEBUG"})(Et||(Et={}));var Gi=Et;class jd{constructor(r,c,b){this.key=r,this.session=c,this.events=[],this.options=b||{},this.sent=0,this.uniqueID=0}log(r,c){r<=this.options.level&&(this.events.push(fe({},c,{timestamp:re.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(r){this.log(Gi.ERROR,r)}info(r){this.log(Gi.INFO,r)}debug(r){this.log(Gi.DEBUG,r)}isEmpty(){return this.events.length===0}send(r,c){var b=fe({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],r(b,(w,L)=>{w||this.sent++,c&&c(w,L)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class Kd{constructor(r,c,b,w){this.name=r,this.priority=c,this.transport=b,this.options=w||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(r,c){if(this.isSupported()){if(this.priority<r)return bs(new _,c)}else return bs(new G,c);var b=!1,w=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),L=null,E=function(){w.unbind("initialized",E),w.connect()},D=function(){L=sn.createHandshake(w,function(pe){b=!0,X(),c(null,pe)})},R=function(pe){X(),c(pe)},Z=function(){X();var pe;pe=An(w),c(new T(pe))},X=function(){w.unbind("initialized",E),w.unbind("open",D),w.unbind("error",R),w.unbind("closed",Z)};return w.bind("initialized",E),w.bind("open",D),w.bind("error",R),w.bind("closed",Z),w.initialize(),{abort:()=>{b||(X(),L?L.close():w.close())},forceMinPriority:pe=>{b||this.priority<pe&&(L?L.close():w.close())}}}}function bs(u,r){return re.defer(function(){r(u)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Fd}=O;var Gd=function(u,r,c,b,w,L){var E=Fd[c];if(!E)throw new K(c);var D=(!u.enabledTransports||Pe(u.enabledTransports,r)!==-1)&&(!u.disabledTransports||Pe(u.disabledTransports,r)===-1),R;return D?(w=Object.assign({ignoreNullOrigin:u.ignoreNullOrigin},w),R=new Kd(r,b,L?L.getAssistant(E):E,w)):R=zd,R},zd={isSupported:function(){return!1},connect:function(u,r){var c=re.defer(function(){r(new G)});return{abort:function(){c.ensureAborted()},forceMinPriority:function(){}}}};function qd(u){if(u==null)throw"You must pass an options object";if(u.cluster==null)throw"Options object must provide a cluster";"disableStats"in u&&se.warn("The disableStats option is deprecated in favor of enableStats")}const Wd=(u,r)=>{var c="socket_id="+encodeURIComponent(u.socketId);for(var b in r.params)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(r.params[b]);if(r.paramsProvider!=null){let w=r.paramsProvider();for(var b in w)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(w[b])}return c};var Zd=u=>{if(typeof O.getAuthorizers()[u.transport]>"u")throw`'${u.transport}' is not a recognized auth transport`;return(r,c)=>{const b=Wd(r,u);O.getAuthorizers()[u.transport](O,b,u,C.UserAuthentication,c)}};const Jd=(u,r)=>{var c="socket_id="+encodeURIComponent(u.socketId);c+="&channel_name="+encodeURIComponent(u.channelName);for(var b in r.params)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(r.params[b]);if(r.paramsProvider!=null){let w=r.paramsProvider();for(var b in w)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(w[b])}return c};var $d=u=>{if(typeof O.getAuthorizers()[u.transport]>"u")throw`'${u.transport}' is not a recognized auth transport`;return(r,c)=>{const b=Jd(r,u);O.getAuthorizers()[u.transport](O,b,u,C.ChannelAuthorization,c)}};const Yd=(u,r,c)=>{const b={authTransport:r.transport,authEndpoint:r.endpoint,auth:{params:r.params,headers:r.headers}};return(w,L)=>{const E=u.channel(w.channelName);c(E,b).authorize(w.socketId,L)}};function Qd(u,r){let c={activityTimeout:u.activityTimeout||d.activityTimeout,cluster:u.cluster,httpPath:u.httpPath||d.httpPath,httpPort:u.httpPort||d.httpPort,httpsPort:u.httpsPort||d.httpsPort,pongTimeout:u.pongTimeout||d.pongTimeout,statsHost:u.statsHost||d.stats_host,unavailableTimeout:u.unavailableTimeout||d.unavailableTimeout,wsPath:u.wsPath||d.wsPath,wsPort:u.wsPort||d.wsPort,wssPort:u.wssPort||d.wssPort,enableStats:tc(u),httpHost:Xd(u),useTLS:ic(u),wsHost:ec(u),userAuthenticator:oc(u),channelAuthorizer:ac(u,r)};return"disabledTransports"in u&&(c.disabledTransports=u.disabledTransports),"enabledTransports"in u&&(c.enabledTransports=u.enabledTransports),"ignoreNullOrigin"in u&&(c.ignoreNullOrigin=u.ignoreNullOrigin),"timelineParams"in u&&(c.timelineParams=u.timelineParams),"nacl"in u&&(c.nacl=u.nacl),c}function Xd(u){return u.httpHost?u.httpHost:u.cluster?`sockjs-${u.cluster}.pusher.com`:d.httpHost}function ec(u){return u.wsHost?u.wsHost:nc(u.cluster)}function nc(u){return`ws-${u}.pusher.com`}function ic(u){return O.getProtocol()==="https:"?!0:u.forceTLS!==!1}function tc(u){return"enableStats"in u?u.enableStats:"disableStats"in u?!u.disableStats:!1}function oc(u){const r=Object.assign(Object.assign({},d.userAuthentication),u.userAuthentication);return"customHandler"in r&&r.customHandler!=null?r.customHandler:Zd(r)}function sc(u,r){let c;return"channelAuthorization"in u?c=Object.assign(Object.assign({},d.channelAuthorization),u.channelAuthorization):(c={transport:u.authTransport||d.authTransport,endpoint:u.authEndpoint||d.authEndpoint},"auth"in u&&("params"in u.auth&&(c.params=u.auth.params),"headers"in u.auth&&(c.headers=u.auth.headers)),"authorizer"in u&&(c.customHandler=Yd(r,c,u.authorizer))),c}function ac(u,r){const c=sc(u,r);return"customHandler"in c&&c.customHandler!=null?c.customHandler:$d(c)}class rc extends on{constructor(r){super(function(c,b){se.debug(`No callbacks on watchlist events for ${c}`)}),this.pusher=r,this.bindWatchlistInternalEvent()}handleEvent(r){r.data.events.forEach(c=>{this.emit(c.name,c)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",r=>{var c=r.event;c==="pusher_internal:watchlist_events"&&this.handleEvent(r)})}}function lc(){let u,r;return{promise:new Promise((b,w)=>{u=b,r=w}),resolve:u,reject:r}}var dc=lc;class cc extends on{constructor(r){super(function(c,b){se.debug("No callbacks on user for "+c)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(c,b)=>{if(c){se.warn(`Error during signin: ${c}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:b.auth,user_data:b.user_data})},this.pusher=r,this.pusher.connection.bind("state_change",({previous:c,current:b})=>{c!=="connected"&&b==="connected"&&this._signin(),c==="connected"&&b!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new rc(r),this.pusher.connection.bind("message",c=>{var b=c.event;b==="pusher:signin_success"&&this._onSigninSuccess(c.data),this.serverToUserChannel&&this.serverToUserChannel.name===c.channel&&this.serverToUserChannel.handleEvent(c)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(r){try{this.user_data=JSON.parse(r.user_data)}catch{se.error(`Failed parsing user data after signin: ${r.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){se.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const r=c=>{c.subscriptionPending&&c.subscriptionCancelled?c.reinstateSubscription():!c.subscriptionPending&&this.pusher.connection.state==="connected"&&c.subscribe()};this.serverToUserChannel=new _t(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((c,b)=>{c.indexOf("pusher_internal:")===0||c.indexOf("pusher:")===0||this.emit(c,b)}),r(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:r,resolve:c,reject:b}=dc();r.done=!1;const w=()=>{r.done=!0};r.then(w).catch(w),this.signinDonePromise=r,this._signinDoneResolve=c}}class ye{static ready(){ye.isReady=!0;for(var r=0,c=ye.instances.length;r<c;r++)ye.instances[r].connect()}static getClientFeatures(){return We($({ws:O.Transports.ws},function(r){return r.isSupported({})}))}constructor(r,c){uc(r),qd(c),this.key=r,this.config=Qd(c,this),this.channels=sn.createChannels(),this.global_emitter=new on,this.sessionID=O.randomInt(1e9),this.timeline=new jd(this.key,this.sessionID,{cluster:this.config.cluster,features:ye.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Gi.INFO,version:d.VERSION}),this.config.enableStats&&(this.timelineSender=sn.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+O.TimelineTransport.name}));var b=w=>O.getDefaultStrategy(this.config,w,Gd);this.connection=sn.createConnectionManager(this.key,{getStrategy:b,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",w=>{var L=w.event,E=L.indexOf("pusher_internal:")===0;if(w.channel){var D=this.channel(w.channel);D&&D.handleEvent(w)}E||this.global_emitter.emit(w.event,w.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",w=>{se.warn(w)}),ye.instances.push(this),this.timeline.info({instances:ye.instances.length}),this.user=new cc(this),ye.isReady&&this.connect()}channel(r){return this.channels.find(r)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var r=this.connection.isUsingTLS(),c=this.timelineSender;this.timelineSenderTimer=new tn(6e4,function(){c.send(r)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(r,c,b){return this.global_emitter.bind(r,c,b),this}unbind(r,c,b){return this.global_emitter.unbind(r,c,b),this}bind_global(r){return this.global_emitter.bind_global(r),this}unbind_global(r){return this.global_emitter.unbind_global(r),this}unbind_all(r){return this.global_emitter.unbind_all(),this}subscribeAll(){var r;for(r in this.channels.channels)this.channels.channels.hasOwnProperty(r)&&this.subscribe(r)}subscribe(r){var c=this.channels.add(r,this);return c.subscriptionPending&&c.subscriptionCancelled?c.reinstateSubscription():!c.subscriptionPending&&this.connection.state==="connected"&&c.subscribe(),c}unsubscribe(r){var c=this.channels.find(r);c&&c.subscriptionPending?c.cancelSubscription():(c=this.channels.remove(r),c&&c.subscribed&&c.unsubscribe())}send_event(r,c,b){return this.connection.send_event(r,c,b)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}ye.instances=[],ye.isReady=!1,ye.logToConsole=!1,ye.Runtime=O,ye.ScriptReceivers=O.ScriptReceivers,ye.DependenciesReceivers=O.DependenciesReceivers,ye.auth_callbacks=O.auth_callbacks;var Pt=t.default=ye;function uc(u){if(u==null)throw"You must pass your app key when you instantiate Pusher."}O.setup(ye)}])})})(Zo);var Zr=Zo.exports;const Jr=Wr(Zr);class Jo{constructor(e){h(this,"container");h(this,"onAction");h(this,"onFail");h(this,"initialTime");h(this,"timeLeft");h(this,"timerId");h(this,"payment");this.container=e.container,this.onAction=e.onAction,this.onFail=e.onFail,this.initialTime=1800,this.timeLeft=this.initialTime,this.timerId=null}attachListener(){const e=this.container.querySelector("#transfer-acn"),i=this.container.querySelector("#transfer-bank"),t=this.container.querySelector("#copy-acn"),o=this.container.querySelector("#acn-tooltip"),s=this.container.querySelector("#transfer-amount"),a=this.container.querySelector("#copy-amount"),l=this.container.querySelector("#amount-tooltip"),d=this.container.querySelector("#transfer-button");t&&e&&t.addEventListener("click",()=>{o&&(i&&P.track("copy_transferBank",{payment_method:"Transfer",payment_process:"Payment Started",account_number:e.innerHTML,bank_name:i.innerHTML}),this.copyToClipboard(e.innerHTML,o))}),a&&s&&a.addEventListener("click",()=>{l&&(P.track("copy_transferAmount",{payment_method:"Transfer",amount:s.innerHTML.split(" ")[1].replace(/,/g,"")}),this.copyToClipboard(s.innerHTML.split(" ")[1].replace(/,/g,""),l))}),d&&d.addEventListener("click",()=>{this.onAction(5),P.track("initiate_payment_verification",{payment_method:"Transfer"})})}startTimer(e){this.stopTimer(),this.timerId=window.setInterval(()=>{if(this.timeLeft>0){this.timeLeft-=1;const i=this.container.querySelector("#time-left");i&&(i.innerHTML=zn(this.timeLeft))}else this.stopTimer(),e==="check"&&this.onAction(2)},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}copyToClipboard(e,i){navigator.clipboard.writeText(e).then(()=>{i.innerHTML="Copied!"}).catch(()=>{i.innerHTML="Failed to copy"})}renderComponent(e){var g,f,y,k,C,S;e&&(this.payment=e),this.container.innerHTML=this.render();const i=this.container.querySelector("#transfer-amount"),t=this.container.querySelector("#transfer-bank"),o=this.container.querySelector("#account-name"),s=this.container.querySelector("#transfer-acn"),a=this.container.querySelector("#time-left"),l=((g=this.payment)==null?void 0:g.currency)||"USD",d=l==="USD"?(f=this.payment)==null?void 0:f.localCurrency:l;if(i&&(i.innerHTML=`${d} ${xe(this.payment.totalTaxAmount?this.payment.totalLocalAmount:l==="USD"?(y=this.payment)==null?void 0:y.localAmount:(k=this.payment)==null?void 0:k.amount,2)}`),t&&this.payment.bankDetails&&(t.innerHTML=(C=this.payment.bankDetails)==null?void 0:C.bankName),o&&this.payment.bankDetails&&(o.innerHTML=(S=this.payment.bankDetails)==null?void 0:S.accountName),s&&this.payment.bankDetails&&(s.innerHTML=this.payment.bankDetails.accountNumber),a&&(a.innerHTML=zn(this.initialTime)),this.startTimer("poll"),e.status==="inProgress"){const M="45654f3ce4c9512ea9a4",A="us2";var v=new Jr(M,{cluster:A}),p=v.subscribe(e.reference);p.bind("payment_status",_=>{_.status==="successful"?(clearInterval(this.timerId||void 0),this.onAction(6),P.track("verify_payment",{payment_method:"Transfer",verification_status:"Success"}),_!=null&&_.redirectUrl&&setTimeout(()=>{const T=new URL(_.redirectUrl);T.searchParams.append("status",_.status),T.searchParams.append("reference",_.reference),window.location.href=T.toString()},1800)):_.status==="failed"&&(clearInterval(this.timerId||void 0),this.onFail(7,"Transfer failed"),P.track("verify_payment",{payment_method:"Transfer",verification_status:"Failed"}))})}this.attachListener()}render(){return qr}}const $r=`<div id="trasferConfirmationProgress">
|
|
1149
1149
|
<div>
|
|
1150
1150
|
<div>
|
|
1151
1151
|
<div class=" grid grid-rows-[auto_1fr] gap-4 mx-5">
|
|
@@ -1226,7 +1226,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
1226
1226
|
</div>
|
|
1227
1227
|
</div>
|
|
1228
1228
|
</div>
|
|
1229
|
-
</div>`;class Yr{constructor(e){h(this,"container");h(this,"onAction");h(this,"ref");h(this,"token");h(this,"initialTime",300);h(this,"abortController");h(this,"timeLeft");h(this,"timer");h(this,"timerId",null);h(this,"rdtCode");h(this,"url");h(this,"callBackUrl");h(this,"payment");h(this,"setPaymentResponses");this.container=e.container,this.timeLeft=this.initialTime,this.onAction=e.onAction,this.ref=e.ref,this.token=e.token,this.rdtCode=e.rdtCode,this.url=e.url,this.callBackUrl=e.callBackUrl,this.setPaymentResponses=e.setPaymentResponses}attachListeners(){const e=this.container.querySelector("#show-acn");e&&e.addEventListener("click",()=>{this.onAction(1),clearTimeout(this.timer)});const i=this.container.querySelector("#transfer-acn-pr"),
|
|
1229
|
+
</div>`;class Yr{constructor(e){h(this,"container");h(this,"onAction");h(this,"ref");h(this,"token");h(this,"initialTime",300);h(this,"abortController");h(this,"timeLeft");h(this,"timer");h(this,"timerId",null);h(this,"rdtCode");h(this,"url");h(this,"callBackUrl");h(this,"payment");h(this,"setPaymentResponses");this.container=e.container,this.timeLeft=this.initialTime,this.onAction=e.onAction,this.ref=e.ref,this.token=e.token,this.rdtCode=e.rdtCode,this.url=e.url,this.callBackUrl=e.callBackUrl,this.setPaymentResponses=e.setPaymentResponses}attachListeners(){const e=this.container.querySelector("#show-acn");e&&e.addEventListener("click",()=>{this.onAction(1),clearTimeout(this.timer)});const i=this.container.querySelector("#transfer-bank"),t=this.container.querySelector("#transfer-acn-pr"),o=this.container.querySelector("#copy-acn-pr"),s=this.container.querySelector("#acn-tooltip-pr");o&&t&&o.addEventListener("click",()=>{P.track("copy_transferBank",{payment_method:"Transfer",payment_process:"Payment Verification",account_number:t.innerHTML,bank_name:i==null?void 0:i.innerHTML}),s&&this.copyToClipboard(t.innerHTML,s)}),this.initialTime=300,this.timeLeft=this.initialTime;const a=3e4;this.abortController=new AbortController,setTimeout(()=>{this.verifyTransfer(this.token,a,({data:l,headers:d})=>{this.onAction(6),this.redirectTo(l,d)})},5e3),this.startTimer()}updateProgressTimerContent(){const i=2*Math.PI*40,o=(this.initialTime-this.timeLeft)/this.initialTime*100/100*i,s=this.container.querySelector(".circle-progress");s&&(s.setAttribute("stroke-dasharray",`${i}`),s.setAttribute("stroke-dashoffset",`${o}`))}async verifyTransfer(e,i,t){let o=0,s=i,a=!0,l;this.abortController&&(l=this.abortController.signal);const d=async()=>{if(this.timeLeft<=0){a=!1,this.onAction(8);return}o+=1;try{const v=await an(e,this.ref,l,this.rdtCode,this.url);v.data.status==="inProgress"?(a&&(s=i*(o+1),this.timer=setTimeout(d,s)),this.setPaymentResponses(v.data,v.headers)):v.data.status==="successful"||v.data.status==="success"?(this.setPaymentResponses(v.data,v.headers),a=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),P.track("verify_payment",{payment_method:"Transfer",verification_status:"Success"}),t(v)):v.data.status==="failed"&&(this.setPaymentResponses(v.data,v.headers),a=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),this.onAction(7,"Transfer failed"),P.track("verify_payment",{payment_method:"Transfer",verification_status:"Failed"}))}catch{a&&(s=i*(o+1),this.timer=setTimeout(d,s))}};d()}redirectTo(e,i){const t=i.get("spf-redirect-url");this.callBackUrl=t||this.callBackUrl,this.callBackUrl&&setTimeout(()=>{const o=new URL(this.callBackUrl);o.searchParams.append("status",e.status),o.searchParams.append("reference",e.reference),window.location.href=o.toString()},1800)}startTimer(){const e=this.container.querySelector("#ctd-timer");this.stopTimer(),this.timerId=window.setInterval(()=>{this.timeLeft>0?(this.timeLeft-=1,e&&(e.innerHTML=zn(this.timeLeft),this.startTimer()),this.updateProgressTimerContent()):(this.stopTimer(),this.onAction(8))},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}renderTransferDetailsComponent(e){var s,a;e&&(this.payment=e),this.container.innerHTML=this.render();const i=this.container.querySelector("#transfer-bank"),t=this.container.querySelector("#transfer-acn-pr"),o=this.container.querySelector("#account-name");i&&e.bankDetails&&(i.innerHTML=(s=e.bankDetails)==null?void 0:s.bankName),t&&e.bankDetails&&(t.innerHTML=e.bankDetails.accountNumber),o&&e.bankDetails&&(o.innerHTML=(a=e.bankDetails)==null?void 0:a.accountName)}copyToClipboard(e,i){navigator.clipboard.writeText(e).then(()=>{i.innerHTML="Copied!"}).catch(()=>{i.innerHTML="Failed to copy"})}renderComponent(e){this.container.innerHTML=this.render(),this.renderTransferDetailsComponent(e),this.attachListeners()}render(){return $r}}const Qr=`<div id="paymenExpired">
|
|
1230
1230
|
<div class="container-center min-h-[30dvh]">
|
|
1231
1231
|
<div>
|
|
1232
1232
|
<div class="container-center mb-5">
|