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 st } from "../../shared-lib/index.js"; export default class qt { constructor(t, i, s) { (this.C = t), (this.gh = i), (this.Fh = s), (this.C = t), (this.gh = i || !1), (this.Fh = s), (this.kh = new u()), (this.fh = 0), (this.wh = 1); } jh() { return this.gh; } xh() { return this.C.ft(s.gt.qh); } setSdkAuthenticationSignature(t) { const i = this.xh(); this.C.Bt(s.gt.qh, t); const e = st.Ls.Fs; new st(e, N).setItem(e.Ms.yh, this.wh, t), i !== t && this.it(); } Bh() { this.C.Ut(s.gt.qh); const t = st.Ls.Fs; new st(t, N).ge(t.Ms.yh, this.wh); } subscribeToSdkAuthenticationFailures(t) { return this.Fh.Dt(t); } Gh(t) { this.Fh.X(t); } Hh() { this.kh.removeAllSubscriptions(); } Jh() { this.fh += 1; } Kh() { return this.fh; } it() { this.fh = 0; } }