@braze/web-sdk
Version:
Braze SDK for web sites and other JS platforms.
52 lines (51 loc) • 1.05 kB
JavaScript
import { STORAGE_KEYS as s } from "./storage-manager.js";
import u from "./subscription-manager.js";
import { logger as E, IndexedDBAdapter as it } from "../../shared-lib/index.js";
export default class Bt {
constructor(t, i, s) {
(this.j = t),
(this.gh = i),
(this.ph = s),
(this.j = t),
(this.gh = i || !1),
(this.ph = s),
(this.Fh = new u()),
(this.kh = 0),
(this.fh = 1);
}
wh() {
return this.gh;
}
jh() {
return this.j.lt(s.ct.xh);
}
setSdkAuthenticationSignature(t) {
const i = this.jh();
this.j.ft(s.ct.xh, t);
const e = it.Us.Rs;
new it(e, E).setItem(e.Fs.qh, this.fh, t), i !== t && this.Z();
}
yh() {
this.j.Nt(s.ct.xh);
const t = it.Us.Rs;
new it(t, E).be(t.Fs.qh, this.fh);
}
subscribeToSdkAuthenticationFailures(t) {
return this.ph.wt(t);
}
Bh(t) {
this.ph.L(t);
}
Gh() {
this.Fh.removeAllSubscriptions();
}
Hh() {
this.kh += 1;
}
Jh() {
return this.kh;
}
Z() {
this.kh = 0;
}
}