UNPKG

@braze/web-sdk

Version:

Braze SDK for web sites and other JS platforms.

52 lines (51 loc) 1.05 kB
import { STORAGE_KEYS as s } from "./storage-manager.js"; import u from "./subscription-manager.js"; import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js"; export default class kt { constructor(t, i, s) { (this.C = t), (this.Zn = i), (this.gh = s), (this.C = t), (this.Zn = i || !1), (this.gh = s), (this.Fh = new u()), (this.kh = 0), (this.fh = 1); } wh() { return this.Zn; } jh() { return this.C.ft(s.gt.xh); } setSdkAuthenticationSignature(t) { const i = this.jh(); this.C.Bt(s.gt.xh, t); const e = tt.Ls.Fs; new tt(e, N).setItem(e.Ms.qh, this.fh, t), i !== t && this.it(); } yh() { this.C.Ut(s.gt.xh); const t = tt.Ls.Fs; new tt(t, N).ge(t.Ms.qh, this.fh); } subscribeToSdkAuthenticationFailures(t) { return this.gh.Ft(t); } Bh(t) { this.gh.X(t); } Gh() { this.Fh.removeAllSubscriptions(); } Hh() { this.kh += 1; } Jh() { return this.kh; } it() { this.kh = 0; } }