@braze/web-sdk
Advanced tools
Comparing version 4.4.0 to 4.5.0
{ | ||
"name": "@braze/web-sdk", | ||
"version": "4.4.0", | ||
"version": "4.5.0", | ||
"description": "Braze SDK for web sites and other JS platforms.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -7,3 +7,3 @@ import ve from "./encoding-utils.js"; | ||
import Ue from "./supported-options.js"; | ||
const r = { vn: ve, A: De, qr: Be, it: Ae, qt: Ge, xt: Ge.ep, D: Oe, Fo: Ue }; | ||
const r = { kn: ve, A: De, qr: Be, it: Ae, qt: Ge, xt: Ge.ep, D: Oe, Vo: Ue }; | ||
export default r; |
const ve = { | ||
yn: function(t) { | ||
vn: function(t) { | ||
const r = (t + "=".repeat((4 - (t.length % 4)) % 4)) | ||
@@ -4,0 +4,0 @@ .replace(/\-/g, "+") |
const De = { | ||
CustomEvent: "ce", | ||
Pr: "p", | ||
Ul: "pc", | ||
xl: "pc", | ||
cc: "ca", | ||
Aa: "i", | ||
za: "i", | ||
qs: "ie", | ||
@@ -19,8 +19,8 @@ T: "cci", | ||
ro: "iec", | ||
Ol: "lr", | ||
Nl: "uae", | ||
Ul: "lr", | ||
Ol: "uae", | ||
U: "ci", | ||
F: "cc", | ||
Wl: "lcaa", | ||
Kl: "lcar", | ||
Bl: "lcaa", | ||
Wl: "lcar", | ||
Fn: "inc", | ||
@@ -30,5 +30,5 @@ Un: "add", | ||
An: "set", | ||
Bl: "sgu" | ||
Gl: "sgu" | ||
}, | ||
Be = { Fr: "feed_displayed", dc: "content_cards_displayed" }; | ||
export { De as EventTypes, Be as InternalEventTypes }; |
@@ -304,3 +304,3 @@ export default class Ge { | ||
$t: { | ||
xl: "data", | ||
Kl: "data", | ||
jr: "pushClicks", | ||
@@ -307,0 +307,0 @@ cu: "pushSubscribed", |
@@ -27,3 +27,3 @@ const Oe = { | ||
if (Oe.zg) { | ||
const o = "Braze SDK Warning: " + n + " (v4.4.0)"; | ||
const o = "Braze SDK Warning: " + n + " (v4.5.0)"; | ||
null != Oe.nd ? Oe.nd(o) : console.warn(o); | ||
@@ -34,3 +34,3 @@ } | ||
if (Oe.zg) { | ||
const o = "Braze SDK Error: " + n + " (v4.4.0)"; | ||
const o = "Braze SDK Error: " + n + " (v4.5.0)"; | ||
null != Oe.nd ? Oe.nd(o) : console.error(o); | ||
@@ -37,0 +37,0 @@ } |
export default { | ||
Yn: "allowCrawlerActivity", | ||
Zn: "baseUrl", | ||
ho: "noCookies", | ||
po: "devicePropertyAllowlist", | ||
Zn: "allowCrawlerActivity", | ||
ho: "baseUrl", | ||
po: "noCookies", | ||
Eo: "devicePropertyAllowlist", | ||
ta: "disablePushTokenMaintenance", | ||
Eo: "enableLogging", | ||
_o: "enableSdkAuthentication", | ||
_o: "enableLogging", | ||
Io: "enableSdkAuthentication", | ||
ia: "manageServiceWorkerExternally", | ||
Io: "minimumIntervalBetweenTriggerActionsInSeconds", | ||
Ao: "sessionTimeoutInSeconds", | ||
So: "appVersion", | ||
Ao: "minimumIntervalBetweenTriggerActionsInSeconds", | ||
So: "sessionTimeoutInSeconds", | ||
No: "appVersion", | ||
na: "serviceWorkerLocation", | ||
@@ -17,4 +17,4 @@ ra: "safariWebsitePushId", | ||
ao: "contentSecurityNonce", | ||
No: "enableHtmlInAppMessages", | ||
wo: "allowUserSuppliedJavascript", | ||
wo: "enableHtmlInAppMessages", | ||
To: "allowUserSuppliedJavascript", | ||
no: "inAppMessageZIndex", | ||
@@ -24,5 +24,5 @@ lo: "openInAppMessagesInNewTab", | ||
qi: "requireExplicitInAppMessageDismissal", | ||
To: "doNotLoadFontAwesome", | ||
Oo: "sdkFlavor", | ||
Oo: "doNotLoadFontAwesome", | ||
vo: "sdkFlavor", | ||
tn: "openCardsInNewTab" | ||
}; |
@@ -27,2 +27,3 @@ import { | ||
(this.clicked = S || !1), | ||
(this.isControl = !1), | ||
(this.test = !1), | ||
@@ -29,0 +30,0 @@ (this.lt = null), |
import Card from "./card.js"; | ||
export default class ControlCard extends Card { | ||
constructor(l, t, s, n, u, i) { | ||
constructor(l, t, s, n, i, u) { | ||
super( | ||
@@ -17,6 +17,7 @@ l, | ||
null, | ||
i, | ||
u, | ||
i, | ||
null | ||
), | ||
(this.isControl = !0), | ||
(this.Y = "ab-control-card"), | ||
@@ -23,0 +24,0 @@ (this.Z = !1); |
import e from "../managers/braze-instance.js"; | ||
import InAppMessage from "./models/in-app-message.js"; | ||
import pe from "./in-app-message-manager-factory.js"; | ||
import { logInAppMessageImpression } from "./log-in-app-message-impression.js"; | ||
import { MUST_BE_IN_APP_MESSAGE_WARNING as or } from "../common/constants.js"; | ||
@@ -12,6 +13,8 @@ import r from "../../shared-lib/braze-shared-lib.js"; | ||
const s = pe.m().G(o, r.A.pi); | ||
if (s) | ||
if (s) { | ||
o.Cr() || logInAppMessageImpression(o); | ||
for (let r = 0; r < s.ve.length; r++) | ||
W.er().je(V.Ar, [o.triggerId], s.ve[r]); | ||
} | ||
return s.S; | ||
} |
export default class ControlMessage { | ||
constructor(t) { | ||
this.triggerId = t; | ||
(this.triggerId = t), (this.extras = {}), (this.isControl = !0); | ||
} | ||
@@ -5,0 +5,0 @@ static fromJson(t) { |
@@ -38,4 +38,4 @@ import e, { OPTIONS as T } from "../../managers/braze-instance.js"; | ||
P, | ||
C, | ||
U | ||
p, | ||
C | ||
) { | ||
@@ -71,4 +71,5 @@ (this.message = t), | ||
(this.orientation = P), | ||
(this.htmlId = C), | ||
(this.css = U), | ||
(this.htmlId = p), | ||
(this.css = C), | ||
(this.isControl = !1), | ||
(this.Ri = !1), | ||
@@ -113,2 +114,5 @@ (this.nl = !1), | ||
} | ||
Cr() { | ||
return this.Ri; | ||
} | ||
k() { | ||
@@ -115,0 +119,0 @@ return !this.nl && ((this.nl = !0), this.lt.St(), !0); |
@@ -33,12 +33,12 @@ import { STORAGE_KEYS as o } from "./storage-manager.js"; | ||
} | ||
Rn(t) { | ||
Vn(t) { | ||
this.zn.St(t); | ||
} | ||
Vn() { | ||
Wn() { | ||
this.qn.removeAllSubscriptions(); | ||
} | ||
Wn() { | ||
Xn() { | ||
this.Gn += 1; | ||
} | ||
Xn() { | ||
Yn() { | ||
return this.Gn; | ||
@@ -45,0 +45,0 @@ } |
@@ -27,13 +27,13 @@ import St from "./auth-manager.js"; | ||
const T = { | ||
Yn: "allowCrawlerActivity", | ||
Zn: "baseUrl", | ||
ho: "noCookies", | ||
po: "devicePropertyAllowlist", | ||
Zn: "allowCrawlerActivity", | ||
ho: "baseUrl", | ||
po: "noCookies", | ||
Eo: "devicePropertyAllowlist", | ||
ta: "disablePushTokenMaintenance", | ||
Eo: "enableLogging", | ||
_o: "enableSdkAuthentication", | ||
_o: "enableLogging", | ||
Io: "enableSdkAuthentication", | ||
ia: "manageServiceWorkerExternally", | ||
Io: "minimumIntervalBetweenTriggerActionsInSeconds", | ||
Ao: "sessionTimeoutInSeconds", | ||
So: "appVersion", | ||
Ao: "minimumIntervalBetweenTriggerActionsInSeconds", | ||
So: "sessionTimeoutInSeconds", | ||
No: "appVersion", | ||
na: "serviceWorkerLocation", | ||
@@ -43,4 +43,4 @@ ra: "safariWebsitePushId", | ||
ao: "contentSecurityNonce", | ||
No: "enableHtmlInAppMessages", | ||
wo: "allowUserSuppliedJavascript", | ||
wo: "enableHtmlInAppMessages", | ||
To: "allowUserSuppliedJavascript", | ||
no: "inAppMessageZIndex", | ||
@@ -51,35 +51,35 @@ lo: "openInAppMessagesInNewTab", | ||
qi: "requireExplicitInAppMessageDismissal", | ||
To: "doNotLoadFontAwesome", | ||
Oo: "sdkFlavor" | ||
Oo: "doNotLoadFontAwesome", | ||
vo: "sdkFlavor" | ||
}; | ||
class jt { | ||
constructor() { | ||
(this.vo = !1), | ||
(this.Co = !1), | ||
(this.Lo = new u()), | ||
(this.Co = !1), | ||
(this.Lo = !1), | ||
(this.Po = new u()), | ||
(this.Ro = {}), | ||
(this.Mo = []), | ||
(this.Ro = new u()), | ||
(this.Mo = {}), | ||
(this.jo = []), | ||
(this.yo = []), | ||
(this.Pe = []), | ||
(this.yo = "4.4.0"); | ||
(this.Do = "4.5.0"); | ||
} | ||
Do(t) { | ||
this.Lo.ut(t); | ||
Uo(t) { | ||
this.Po.ut(t); | ||
} | ||
Zi(t) { | ||
this.Po.ut(t); | ||
this.Ro.ut(t); | ||
} | ||
initialize(t, i) { | ||
if (this.Uo()) | ||
if (this.zo()) | ||
return ( | ||
r.D.info("Braze has already been initialized with an API key."), !0 | ||
); | ||
this.Ro = i || {}; | ||
let s = this.nn(T.Eo); | ||
const e = it(H.bn()); | ||
this.Mo = i || {}; | ||
let s = this.nn(T._o); | ||
const e = it(H.gn()); | ||
if ( | ||
(e && "true" === e.brazeLogging && (s = !0), | ||
r.D.init(s), | ||
r.D.info(`Initialization Options: ${JSON.stringify(this.Ro, null, 2)}`), | ||
r.D.info(`Initialization Options: ${JSON.stringify(this.Mo, null, 2)}`), | ||
null == t || "" === t || "string" != typeof t) | ||
@@ -89,3 +89,3 @@ ) | ||
this._r = t; | ||
let n = this.nn(T.Zn); | ||
let n = this.nn(T.ho); | ||
if (null == n || "" === n || "string" != typeof n) | ||
@@ -99,28 +99,28 @@ return r.D.error("Braze requires a valid baseUrl to be initialized."), !1; | ||
"/" === n.pathname && (n = `${n}api/v3`), | ||
(this.zo = n.toString()), | ||
ot.Bo && !this.nn(T.Yn)) | ||
(this.Bo = n.toString()), | ||
ot.Wo && !this.nn(T.Zn)) | ||
) | ||
return ( | ||
r.D.info("Ignoring activity from crawler bot " + navigator.userAgent), | ||
(this.Co = !0), | ||
(this.Lo = !0), | ||
!1 | ||
); | ||
const h = this.nn(jt.ho) || !1; | ||
if (((this.h = Mt.Wo(t, h)), new G.ne(null, !0).lr(o.ae))) | ||
const h = this.nn(jt.po) || !1; | ||
if (((this.h = Mt.Fo(t, h)), new G.ne(null, !0).lr(o.ae))) | ||
return ( | ||
r.D.info("Ignoring all activity due to previous opt out"), | ||
(this.Co = !0), | ||
(this.Lo = !0), | ||
!1 | ||
); | ||
for (const t of rr(this.Ro)) | ||
-1 === At(r.Fo).indexOf(t) && | ||
for (const t of rr(this.Mo)) | ||
-1 === At(r.Vo).indexOf(t) && | ||
r.D.warn(`Ignoring unknown initialization option '${t}'.`); | ||
const l = ["mparticle", "wordpress", "tealium"]; | ||
if (null != this.nn(T.Oo)) { | ||
const t = this.nn(T.Oo); | ||
if (null != this.nn(T.vo)) { | ||
const t = this.nn(T.vo); | ||
-1 !== l.indexOf(t) | ||
? (this.Vo = t) | ||
? (this.Go = t) | ||
: r.D.error("Invalid sdk flavor passed: " + t); | ||
} | ||
let f = this.nn(r.Fo.po); | ||
let f = this.nn(r.Vo.Eo); | ||
if (null != f) | ||
@@ -145,6 +145,6 @@ if (p(f)) { | ||
(this.v = new bt(this.gt, this.h)), | ||
(this.j = new Rt(this.h, this.v, this.gt, this.nn(T.Ao))); | ||
(this.j = new Rt(this.h, this.v, this.gt, this.nn(T.So))); | ||
const m = new u(); | ||
return ( | ||
(this.Go = new St(this.h, this.nn(T._o), m)), | ||
(this.Ko = new St(this.h, this.nn(T.Io), m)), | ||
this.jt(m), | ||
@@ -154,3 +154,3 @@ (this.vt = new Ot( | ||
this.h, | ||
this.Go, | ||
this.Ko, | ||
this.v, | ||
@@ -160,10 +160,10 @@ this.j, | ||
this._r, | ||
this.zo, | ||
this.yo, | ||
this.Vo, | ||
this.nn(T.So) | ||
this.Bo, | ||
this.Do, | ||
this.Go, | ||
this.nn(T.No) | ||
)), | ||
(this.si = new Lt( | ||
this._r, | ||
this.zo, | ||
this.Bo, | ||
this.j, | ||
@@ -175,5 +175,5 @@ this.Ur, | ||
t => { | ||
if (this.Uo()) for (const i of this.re()) i.Rs(t); | ||
if (this.zo()) for (const i of this.re()) i.Rs(t); | ||
}, | ||
this.Go, | ||
this.Ko, | ||
this.vt | ||
@@ -184,6 +184,6 @@ )), | ||
`Initialized for the Braze backend at "${this.nn( | ||
T.Zn | ||
T.ho | ||
)}" with API key "${this._r}".` | ||
), | ||
null != this.nn(T.No) && | ||
null != this.nn(T.wo) && | ||
D( | ||
@@ -207,4 +207,4 @@ "enableHtmlInAppMessages", | ||
}), | ||
this.Lo.St(this.Ro), | ||
(this.vo = !0), | ||
this.Po.St(this.Mo), | ||
(this.Co = !0), | ||
!0 | ||
@@ -214,8 +214,8 @@ ); | ||
destroy(t) { | ||
if ((r.D.destroy(), this.Uo())) { | ||
this.Po.St(), this.Po.removeAllSubscriptions(); | ||
for (const t of this.Mo) t.destroy(); | ||
this.Mo = []; | ||
for (const t of this.jo) t.clearData(!1); | ||
(this.jo = []), | ||
if ((r.D.destroy(), this.zo())) { | ||
this.Ro.St(), this.Ro.removeAllSubscriptions(); | ||
for (const t of this.jo) t.destroy(); | ||
this.jo = []; | ||
for (const t of this.yo) t.clearData(!1); | ||
(this.yo = []), | ||
this.removeAllSubscriptions(), | ||
@@ -225,3 +225,3 @@ (this.Pe = []), | ||
(this.si = null), | ||
(this.Go = null), | ||
(this.Ko = null), | ||
(this.Ur = null), | ||
@@ -232,6 +232,6 @@ (this.vt = null), | ||
(this.v = null), | ||
(this.Ro = {}), | ||
(this.Vo = void 0), | ||
(this.vo = !1), | ||
(this.Mo = {}), | ||
(this.Go = void 0), | ||
(this.Co = !1), | ||
(this.Lo = !1), | ||
t && (this.h = null); | ||
@@ -241,4 +241,4 @@ } | ||
rr() { | ||
if (this.Ko()) return !1; | ||
if (!this.Uo()) | ||
if (this.Ho()) return !1; | ||
if (!this.zo()) | ||
throw new Error("Braze must be initialized before calling methods."); | ||
@@ -251,6 +251,6 @@ return !0; | ||
ii() { | ||
return this.Go; | ||
return this.Ko; | ||
} | ||
Ks() { | ||
return this.zo; | ||
return this.Bo; | ||
} | ||
@@ -264,6 +264,6 @@ ce() { | ||
nn(t) { | ||
return this.Ro[t]; | ||
return this.Mo[t]; | ||
} | ||
re() { | ||
return this.jo; | ||
return this.yo; | ||
} | ||
@@ -289,13 +289,13 @@ mr() { | ||
tr() { | ||
return !0 === this.nn(T.wo) || !0 === this.nn(T.No); | ||
return !0 === this.nn(T.To) || !0 === this.nn(T.wo); | ||
} | ||
u(t) { | ||
let i = !1; | ||
for (const s of this.Mo) s === t && (i = !0); | ||
i || this.Mo.push(t); | ||
for (const s of this.jo) s === t && (i = !0); | ||
i || this.jo.push(t); | ||
} | ||
ar(t) { | ||
let i = !1; | ||
for (const s of this.jo) s.constructor === t.constructor && (i = !0); | ||
t instanceof y && !i && this.jo.push(t); | ||
for (const s of this.yo) s.constructor === t.constructor && (i = !0); | ||
t instanceof y && !i && this.yo.push(t); | ||
} | ||
@@ -312,12 +312,12 @@ jt(t) { | ||
le(t) { | ||
this.Co = t; | ||
this.Lo = t; | ||
} | ||
Uo() { | ||
return this.vo; | ||
} | ||
Ko() { | ||
zo() { | ||
return this.Co; | ||
} | ||
Ho() { | ||
return this.Lo; | ||
} | ||
Ds() { | ||
return this.yo; | ||
return this.Do; | ||
} | ||
@@ -324,0 +324,0 @@ } |
@@ -35,3 +35,3 @@ import ot from "../util/browser-detector.js"; | ||
case DeviceProperties.TIME_ZONE: | ||
t[r] = this.Ho(new Date()); | ||
t[r] = this.Qo(new Date()); | ||
break; | ||
@@ -45,7 +45,7 @@ case DeviceProperties.USER_AGENT: | ||
qo() { | ||
if (ot.Qo()) return ot.Qo(); | ||
const e = this.h.I(o.q.Xo); | ||
return e && e.os_version ? e.os_version : ot.Yo(); | ||
if (ot.Xo()) return ot.Xo(); | ||
const e = this.h.I(o.q.Yo); | ||
return e && e.os_version ? e.os_version : ot.Zo(); | ||
} | ||
Ho(e) { | ||
Qo(e) { | ||
if ("undefined" != typeof Intl && "function" == typeof Intl.DateTimeFormat) | ||
@@ -66,5 +66,5 @@ try { | ||
const t = e.getTimezoneOffset(); | ||
return this.Zo(t); | ||
return this.$o(t); | ||
} | ||
Zo(e) { | ||
$o(e) { | ||
const t = parseInt(e / 60), | ||
@@ -71,0 +71,0 @@ r = parseInt(e % 60); |
@@ -15,3 +15,3 @@ import qt from "../models/backend-errors.js"; | ||
(this.h = e), | ||
(this.Go = s), | ||
(this.Ko = s), | ||
(this.v = i), | ||
@@ -21,7 +21,7 @@ (this.j = r), | ||
(this._r = n), | ||
(this.zo = a), | ||
(this.yo = u), | ||
(this.Vo = h), | ||
(this.$o = c), | ||
(this.sa = ["npm"]); | ||
(this.Bo = a), | ||
(this.Do = u), | ||
(this.Go = h), | ||
(this.sa = c), | ||
(this.oa = ["npm"]); | ||
} | ||
@@ -31,15 +31,15 @@ Ps(t, e) { | ||
i = s.Mi(), | ||
r = this.h.I(o.q.Xo); | ||
r = this.h.I(o.q.Yo); | ||
ii(r, i) || (t.device = i), | ||
(t.api_key = this._r), | ||
(t.time = l(new Date().valueOf(), !0)); | ||
const n = this.h.I(o.q.oa) || [], | ||
a = this.h.I(o.q.ua) || ""; | ||
const n = this.h.I(o.q.ua) || [], | ||
a = this.h.I(o.q.ha) || ""; | ||
if ( | ||
(this.sa.length > 0 && | ||
(!ii(n, this.sa) || a !== this.j.ha()) && | ||
(t.sdk_metadata = this.sa), | ||
(t.sdk_version = this.yo), | ||
this.Vo && (t.sdk_flavor = this.Vo), | ||
(t.app_version = this.$o), | ||
(this.oa.length > 0 && | ||
(!ii(n, this.oa) || a !== this.j.ca()) && | ||
(t.sdk_metadata = this.oa), | ||
(t.sdk_version = this.Do), | ||
this.Go && (t.sdk_flavor = this.Go), | ||
(t.app_version = this.sa), | ||
(t.device_id = s.id), | ||
@@ -59,3 +59,3 @@ e) | ||
let e; | ||
this.Go.Wn(); | ||
this.Ko.Xn(); | ||
const s = { errorCode: o.error_code }; | ||
@@ -72,8 +72,8 @@ for (const t of i) | ||
: (e = `with error code ${o.error_code}.`), | ||
this.Go.Jn() || | ||
this.Ko.Jn() || | ||
(e += | ||
' Please use the "enableSdkAuthentication" initialization option to enable authentication.'), | ||
r.D.error(`SDK Authentication failed ${e}`), | ||
this.ca(t.events, t.attributes), | ||
this.Go.Rn(s), | ||
this.la(t.events, t.attributes), | ||
this.Ko.Vn(s), | ||
!1 | ||
@@ -85,16 +85,16 @@ ); | ||
switch (i) { | ||
case qt.la: | ||
case qt.fa: | ||
const o = "Received successful response with empty body."; | ||
return s.G(r.A.qs, { e: o }), r.D.info(o), !1; | ||
case qt.fa: | ||
case qt.ma: | ||
const n = "Received successful response with invalid JSON"; | ||
return s.G(r.A.qs, { e: n + ": " + e.response }), r.D.info(n), !1; | ||
case qt.ma: | ||
i = `The API key "${t.api_key}" is invalid for the baseUrl ${this.zo}`; | ||
case qt.pa: | ||
i = `The API key "${t.api_key}" is invalid for the baseUrl ${this.Bo}`; | ||
break; | ||
case qt.pa: | ||
case qt.Ra: | ||
i = | ||
"Sorry, we are not currently accepting your requests. If you think this is in error, please contact us."; | ||
break; | ||
case qt.Ra: | ||
case qt.ba: | ||
i = "No device identifier. Please contact support@braze.com"; | ||
@@ -106,6 +106,6 @@ } | ||
} | ||
ba(t, e, s, i) { | ||
ga(t, e, s, i) { | ||
return !!((t && 0 !== t.length) || (e && 0 !== e.length) || s || i); | ||
} | ||
ga(t, e, s, i) { | ||
qa(t, e, s, i) { | ||
const r = [], | ||
@@ -122,3 +122,3 @@ o = t => t || "", | ||
for (const e of s) { | ||
if (((a = e.Mi()), this.Go.Jn())) { | ||
if (((a = e.Mi()), this.Ko.Jn())) { | ||
if (n && !a.user_id) { | ||
@@ -140,3 +140,3 @@ c || ((c = {}), (c.events = [])), c.events.push(a); | ||
for (const e of i) | ||
this.Go.Jn() && o(e.user_id) !== n | ||
this.Ko.Jn() && o(e.user_id) !== n | ||
? (h || (h = []), h.push(e)) | ||
@@ -146,3 +146,3 @@ : t.push(e); | ||
} | ||
if ((this.ca(u, h), (l = this.Ps(l, !0)), c)) { | ||
if ((this.la(u, h), (l = this.Ps(l, !0)), c)) { | ||
c = this.Ps(c, !1); | ||
@@ -152,7 +152,7 @@ const t = { requestData: c, headers: this.Bs(c) }; | ||
} | ||
if (l && !this.ba(l.events, l.attributes, t, e)) return c ? r : null; | ||
if (l && !this.ga(l.events, l.attributes, t, e)) return c ? r : null; | ||
const f = { requestData: l, headers: this.Bs(l) }; | ||
return r.push(f), r; | ||
} | ||
ca(t, e) { | ||
la(t, e) { | ||
if (t) { | ||
@@ -166,3 +166,3 @@ const e = []; | ||
} | ||
if (e) for (const t of e) this.h.qa(t); | ||
if (e) for (const t of e) this.h.Aa(t); | ||
} | ||
@@ -174,3 +174,3 @@ Vs(t, e) { | ||
yr(t) { | ||
return s.G(r.A.Aa, { n: t }); | ||
return s.G(r.A.za, { n: t }); | ||
} | ||
@@ -208,5 +208,5 @@ Ai(t, e, s) { | ||
n && r.push(["X-Braze-DataRequest", "true"]), | ||
this.Go.Jn()) | ||
this.Ko.Jn()) | ||
) { | ||
const t = this.Go.Kn(); | ||
const t = this.Ko.Kn(); | ||
null != t && r.push(["X-Braze-Auth-Signature", t]); | ||
@@ -225,10 +225,10 @@ } | ||
Qs() { | ||
this.Go.Qs(); | ||
this.Ko.Qs(); | ||
} | ||
Ks() { | ||
return this.zo; | ||
return this.Bo; | ||
} | ||
addSdkMetadata(t) { | ||
for (const e of t) -1 === this.sa.indexOf(e) && this.sa.push(e); | ||
for (const e of t) -1 === this.oa.indexOf(e) && this.oa.push(e); | ||
} | ||
} |
@@ -17,3 +17,3 @@ import { STORAGE_KEYS as o } from "./storage-manager.js"; | ||
const t = this.h.I(o.q.ol); | ||
this.rl = null != t ? Ft.Dn(t) : new Ft(); | ||
this.rl = null != t ? Ft.Sn(t) : new Ft(); | ||
} | ||
@@ -40,3 +40,3 @@ return this.rl; | ||
let s = !1; | ||
null != t.gl && this.gn() !== t.gl && (s = !0); | ||
null != t.gl && this.wn() !== t.gl && (s = !0); | ||
let i = !1; | ||
@@ -54,3 +54,3 @@ null != t.ml.enabled && this.Ys() !== t.ml.enabled && (i = !0); | ||
} | ||
wn(t) { | ||
yn(t) { | ||
let e = this.tl.ut(t); | ||
@@ -77,3 +77,3 @@ return this.fl && this.tl.removeSubscription(this.fl), (this.fl = e), e; | ||
} | ||
gn() { | ||
wn() { | ||
return this.hl().gl; | ||
@@ -80,0 +80,0 @@ } |
@@ -28,3 +28,3 @@ import { STORAGE_KEYS as o } from "../managers/storage-manager.js"; | ||
} | ||
ha() { | ||
ca() { | ||
const s = this.h.tu(o.eu.ph); | ||
@@ -31,0 +31,0 @@ return null == s ? null : s.iu; |
import G, { STORAGE_KEYS as o } from "./storage-manager.js"; | ||
import r from "../../shared-lib/braze-shared-lib.js"; | ||
const Mt = { | ||
Wo: (e, t) => { | ||
Fo: (e, t) => { | ||
let a = !1; | ||
@@ -6,0 +6,0 @@ try { |
@@ -23,6 +23,6 @@ import ot from "../util/browser-detector.js"; | ||
Ka: "ab.storage.attributes.anonymous_user", | ||
Xo: "ab.storage.device", | ||
oa: "ab.storage.sdk_metadata", | ||
ua: "ab.storage.session_id_for_cached_metadata", | ||
kn: "ab.storage.pushToken", | ||
Yo: "ab.storage.device", | ||
ua: "ab.storage.sdk_metadata", | ||
ha: "ab.storage.session_id_for_cached_metadata", | ||
Pn: "ab.storage.pushToken", | ||
ei: "ab.storage.newsFeed", | ||
@@ -65,3 +65,3 @@ hi: "ab.storage.lastNewsFeedRefresh", | ||
tu(t) { | ||
return _t.Dn(this.Ma.lr(t)); | ||
return _t.Sn(this.Ma.lr(t)); | ||
} | ||
@@ -90,3 +90,3 @@ Nh(t) { | ||
for (let s = 0; s < t.length; s++) | ||
ue.Fa(t[s]) ? e.push(ue.Dn(t[s])) : (o = s); | ||
ue.Fa(t[s]) ? e.push(ue.Sn(t[s])) : (o = s); | ||
else s = !0; | ||
@@ -153,10 +153,10 @@ if (s || null != o) { | ||
} | ||
qa(t) { | ||
Aa(t) { | ||
let e = this.Ca.lr(STORAGE_KEYS.q.Ia); | ||
null == e && (e = {}); | ||
const s = this.La(t[User.Ln]); | ||
const s = this.La(t[User.Rn]); | ||
for (let r in t) | ||
r === User.Ln || | ||
r === User.Rn || | ||
(null != e[s] && null != e[s][r]) || | ||
this.mu(t[User.Ln], r, t[r]); | ||
this.mu(t[User.Rn], r, t[r]); | ||
} | ||
@@ -169,3 +169,3 @@ mu(t, e, s) { | ||
if ( | ||
(null == n && ((n = {}), null != t && (n[User.Ln] = t)), e === User.lu) | ||
(null == n && ((n = {}), null != t && (n[User.Rn] = t)), e === User.lu) | ||
) { | ||
@@ -192,4 +192,4 @@ null == n[e] && (n[e] = {}); | ||
this.Ca.store(STORAGE_KEYS.q.Ia, e), | ||
(r[User.Ln] = t), | ||
this.qa(r)); | ||
(r[User.Rn] = t), | ||
this.Aa(r)); | ||
} | ||
@@ -243,3 +243,3 @@ const s = this.tu(STORAGE_KEYS.eu.ph); | ||
constructor(t, e) { | ||
(this._r = t), (this.Va = this.za()), (this.Qa = 576e3), (this.Ha = !!e); | ||
(this._r = t), (this.Va = this.Qa()), (this.Ha = 576e3), (this.Wa = !!e); | ||
} | ||
@@ -249,3 +249,3 @@ ka(t) { | ||
} | ||
za() { | ||
Qa() { | ||
let t = 0, | ||
@@ -267,5 +267,5 @@ e = document.location.hostname; | ||
const t = new Date(); | ||
return t.setTime(t.getTime() + 60 * this.Qa * 1e3), t.getFullYear(); | ||
return t.setTime(t.getTime() + 60 * this.Ha * 1e3), t.getFullYear(); | ||
} | ||
Wa() { | ||
Xa() { | ||
const t = At(STORAGE_KEYS.eu), | ||
@@ -284,3 +284,3 @@ e = document.cookie.split(";"); | ||
const t = r.split("=")[0]; | ||
-1 === t.indexOf("." + this._r) && this.Xa(t); | ||
-1 === t.indexOf("." + this._r) && this.Za(t); | ||
} | ||
@@ -290,9 +290,9 @@ } | ||
store(t, e) { | ||
this.Wa(); | ||
this.Xa(); | ||
const s = new Date(); | ||
s.setTime(s.getTime() + 60 * this.Qa * 1e3); | ||
s.setTime(s.getTime() + 60 * this.Ha * 1e3); | ||
const o = "expires=" + s.toUTCString(), | ||
n = "domain=" + this.Va; | ||
let i; | ||
i = this.Ha ? e : encodeURIComponent(JSON.stringify(e)); | ||
i = this.Wa ? e : encodeURIComponent(JSON.stringify(e)); | ||
const a = this.ka(t) + "=" + i + ";" + o + ";" + n + ";path=/"; | ||
@@ -318,3 +318,3 @@ return a.length >= 4093 | ||
let t; | ||
(t = this.Ha | ||
(t = this.Wa | ||
? i.substring(s.length, i.length) | ||
@@ -334,5 +334,5 @@ : JSON.parse(decodeURIComponent(i.substring(s.length, i.length)))), | ||
remove(t) { | ||
this.Xa(this.ka(t)); | ||
this.Za(this.ka(t)); | ||
} | ||
Xa(t) { | ||
Za(t) { | ||
const e = t + "=;expires=" + new Date(0).toGMTString(); | ||
@@ -346,8 +346,8 @@ (document.cookie = e), (document.cookie = e + ";path=/"); | ||
constructor() { | ||
(this.Za = {}), (this.$a = 5242880), (this.xa = 3); | ||
(this.$a = {}), (this.El = 5242880), (this.xa = 3); | ||
} | ||
store(t, e) { | ||
const s = { value: e }, | ||
o = this.El(e); | ||
return o > this.$a | ||
o = this.Sl(e); | ||
return o > this.El | ||
? (r.D.info( | ||
@@ -357,8 +357,8 @@ "Storage failure: object is ≈" + | ||
" bytes which is greater than the max of " + | ||
this.$a | ||
this.El | ||
), | ||
!1) | ||
: ((this.Za[t] = s), !0); | ||
: ((this.$a[t] = s), !0); | ||
} | ||
El(t) { | ||
Sl(t) { | ||
const e = [], | ||
@@ -380,7 +380,7 @@ s = [t]; | ||
lr(t) { | ||
const e = this.Za[t]; | ||
const e = this.$a[t]; | ||
return null == e ? null : e.value; | ||
} | ||
remove(t) { | ||
this.Za[t] = null; | ||
this.$a[t] = null; | ||
} | ||
@@ -390,15 +390,15 @@ }; | ||
constructor(t, e, s) { | ||
(this.Sl = []), | ||
e && this.Sl.push(new G.ne(t)), | ||
s && this.Sl.push(new G._a(t)), | ||
this.Sl.push(new G.Oa(t)); | ||
(this._l = []), | ||
e && this._l.push(new G.ne(t)), | ||
s && this._l.push(new G._a(t)), | ||
this._l.push(new G.Oa(t)); | ||
} | ||
store(t, e) { | ||
let s = !0; | ||
for (let r = 0; r < this.Sl.length; r++) s = this.Sl[r].store(t, e) && s; | ||
for (let r = 0; r < this._l.length; r++) s = this._l[r].store(t, e) && s; | ||
return s; | ||
} | ||
lr(t) { | ||
for (let e = 0; e < this.Sl.length; e++) { | ||
const s = this.Sl[e].lr(t); | ||
for (let e = 0; e < this._l.length; e++) { | ||
const s = this._l[e].lr(t); | ||
if (null != s) return s; | ||
@@ -409,4 +409,4 @@ } | ||
remove(t) { | ||
for (let e = 0; e < this.Sl.length; e++) this.Sl[e].remove(t); | ||
for (let e = 0; e < this._l.length; e++) this._l[e].remove(t); | ||
} | ||
}; |
export default { | ||
ma: "invalid_api_key", | ||
pa: "blacklisted", | ||
Ra: "no_device_identifier", | ||
fa: "invalid_json_response", | ||
la: "empty_response", | ||
pa: "invalid_api_key", | ||
Ra: "blacklisted", | ||
ba: "no_device_identifier", | ||
ma: "invalid_json_response", | ||
fa: "empty_response", | ||
__: "sdk_auth_error" | ||
}; |
@@ -38,5 +38,5 @@ import { isObject as Jt } from "../util/code-utils.js"; | ||
} | ||
static Dn(t) { | ||
static Sn(t) { | ||
return new ue(t.u, t.t, t.ts, t.s, t.d); | ||
} | ||
} |
@@ -15,3 +15,3 @@ import r from "../../shared-lib/braze-shared-lib.js"; | ||
} | ||
static Dn(t) { | ||
static Sn(t) { | ||
if (null == t || null == t.g) return null; | ||
@@ -18,0 +18,0 @@ const e = new _t(t.g, t.e, t.c); |
@@ -5,3 +5,3 @@ import { rehydrateDateAfterJsonization as w } from "../util/date-utils.js"; | ||
(this.endpoint = t || null), | ||
(this.Pn = i || null), | ||
(this.Dn = i || null), | ||
(this.publicKey = l || null), | ||
@@ -14,3 +14,3 @@ (this.zl = s || null), | ||
e: this.endpoint, | ||
c: this.Pn, | ||
c: this.Dn, | ||
p: this.publicKey, | ||
@@ -21,5 +21,5 @@ u: this.zl, | ||
} | ||
static Dn(t) { | ||
static Sn(t) { | ||
return new ei(t.e, w(t.c), t.p, t.u, t.v); | ||
} | ||
} |
@@ -15,3 +15,3 @@ export default class Ft { | ||
return { | ||
s: "4.4.0", | ||
s: "4.5.0", | ||
l: this.ul, | ||
@@ -27,8 +27,8 @@ e: this.bl, | ||
} | ||
static Dn(t) { | ||
static Sn(t) { | ||
let s = t.l; | ||
return ( | ||
"4.4.0" !== t.s && (s = 0), new Ft(s, t.e, t.a, t.p, t.m, t.v, t.c, t.f) | ||
"4.5.0" !== t.s && (s = 0), new Ft(s, t.e, t.a, t.p, t.m, t.v, t.c, t.f) | ||
); | ||
} | ||
} |
@@ -18,15 +18,15 @@ import { isArray as p, isEqual as ii } from "../util/code-utils.js"; | ||
(this.Vr = u || !1), | ||
(this.Cr = a || !1), | ||
(this.Er = a || !1), | ||
(this.h = h), | ||
(this.Er = dt.Or()), | ||
(this.Br = dt.Mr()); | ||
(this.Or = dt.Br()), | ||
(this.Mr = dt.Yr()); | ||
} | ||
Yr() { | ||
return this.Cr; | ||
Gr() { | ||
return this.Er; | ||
} | ||
Gr(i, e, t, s, n) { | ||
Hr(i, e, t, s, n) { | ||
i.unsubscribe() | ||
.then(i => { | ||
i | ||
? this.Hr(e, t, s, n) | ||
? this.Jr(e, t, s, n) | ||
: (r.D.error("Failed to unsubscribe device from push."), | ||
@@ -40,3 +40,3 @@ "function" == typeof n && n(!1)); | ||
} | ||
Jr(i, e, t) { | ||
Kr(i, e, t) { | ||
const s = (i => { | ||
@@ -48,5 +48,5 @@ if ("string" == typeof i) return i; | ||
return ( | ||
i.Kr && | ||
-1 === i.endpoint.indexOf(i.Kr) && | ||
(e = i.endpoint + "/" + i.Kr), | ||
i.Lr && | ||
-1 === i.endpoint.indexOf(i.Lr) && | ||
(e = i.endpoint + "/" + i.Lr), | ||
e | ||
@@ -79,11 +79,11 @@ ); | ||
})(i); | ||
this.Sr.Lr(s, t, r, n, o), s && "function" == typeof e && e(s, r, n); | ||
this.Sr.Qr(s, t, r, n, o), s && "function" == typeof e && e(s, r, n); | ||
} | ||
Qr() { | ||
this.Sr.Xr(!0); | ||
Xr() { | ||
this.Sr.Zr(!0); | ||
} | ||
Zr(i, e) { | ||
this.Sr.Xr(!1), r.D.info(i), "function" == typeof e && e(!1); | ||
hn(i, e) { | ||
this.Sr.Zr(!1), r.D.info(i), "function" == typeof e && e(!1); | ||
} | ||
hn(i, e, t, s) { | ||
fn(i, e, t, s) { | ||
if ("default" === e.permission) | ||
@@ -100,11 +100,11 @@ try { | ||
), | ||
this.hn(i, e, t, s); | ||
this.fn(i, e, t, s); | ||
} | ||
); | ||
} catch (i) { | ||
this.Zr("Could not request permission for push: " + i, s); | ||
this.hn("Could not request permission for push: " + i, s); | ||
} | ||
else | ||
"denied" === e.permission | ||
? this.Zr( | ||
? this.hn( | ||
"The user has blocked notifications from this site, or Safari push is not configured in the Braze dashboard.", | ||
@@ -115,5 +115,5 @@ s | ||
(r.D.info("Device successfully subscribed to push."), | ||
this.Jr(e.deviceToken, t, new Date())); | ||
this.Kr(e.deviceToken, t, new Date())); | ||
} | ||
fn(i, e, t) { | ||
dn(i, e, t) { | ||
const s = s => { | ||
@@ -141,3 +141,3 @@ switch (s) { | ||
} | ||
Hr(i, e, t, s) { | ||
Jr(i, e, t, s) { | ||
const n = { userVisibleOnly: !0 }; | ||
@@ -149,3 +149,3 @@ null != e && (n.applicationServerKey = e), | ||
r.D.info("Device successfully subscribed to push."), | ||
this.Jr(i, t, new Date()); | ||
this.Kr(i, t, new Date()); | ||
}) | ||
@@ -159,3 +159,3 @@ .catch(i => { | ||
} | ||
dn() { | ||
pn() { | ||
return this.Vr | ||
@@ -176,3 +176,3 @@ ? navigator.serviceWorker.getRegistration() | ||
} | ||
pn(i) { | ||
bn(i) { | ||
this.Vr || | ||
@@ -183,3 +183,3 @@ (i.unregister(), r.D.info("Service worker successfully unregistered.")); | ||
if (dt.isPushSupported()) { | ||
if (this.Er) { | ||
if (this.Or) { | ||
if (!this.Vr && null != window.location) { | ||
@@ -192,3 +192,3 @@ let i = this.Nr; | ||
const e = i.substr(0, i.lastIndexOf("/") + 1); | ||
if (0 !== H.bn().indexOf(e)) | ||
if (0 !== H.gn().indexOf(e)) | ||
return void r.D.error( | ||
@@ -203,7 +203,7 @@ "Cannot subscribe to push from a path higher than the service worker location (tried to subscribe from " + | ||
if (dt.isPushBlocked()) | ||
return void this.Zr( | ||
return void this.hn( | ||
"Notifications from this site are blocked. This may be a temporary embargo or a permanent denial.", | ||
e | ||
); | ||
if (this.gt && !this.gt.gn() && 0 === this.gt.Zs()) | ||
if (this.gt && !this.gt.wn() && 0 === this.gt.Zs()) | ||
return ( | ||
@@ -213,3 +213,3 @@ r.D.info( | ||
), | ||
void this.gt.wn(() => { | ||
void this.gt.yn(() => { | ||
this.subscribe(i, e); | ||
@@ -236,3 +236,3 @@ }) | ||
), | ||
this.dn() | ||
this.pn() | ||
.then(t => { | ||
@@ -252,4 +252,4 @@ if (null == t) | ||
(this.gt && | ||
null != this.gt.gn() && | ||
(n = r.vn.yn(this.gt.gn())), | ||
null != this.gt.wn() && | ||
(n = r.kn.vn(this.gt.wn())), | ||
s) | ||
@@ -259,7 +259,7 @@ ) { | ||
a = null; | ||
const h = this.h.I(o.q.kn); | ||
const h = this.h.I(o.q.Pn); | ||
if (h && !p(h)) { | ||
let i; | ||
try { | ||
i = ei.Dn(h).Pn; | ||
i = ei.Sn(h).Dn; | ||
} catch (e) { | ||
@@ -288,3 +288,3 @@ i = null; | ||
), | ||
this.Gr(s, t, n, i, e)) | ||
this.Hr(s, t, n, i, e)) | ||
: s.expirationTime && | ||
@@ -295,5 +295,5 @@ new Date(s.expirationTime) <= new Date().valueOf() | ||
), | ||
this.Gr(s, t, n, i, e)) | ||
this.Hr(s, t, n, i, e)) | ||
: h && p(h) | ||
? this.Gr(s, t, n, i, e) | ||
? this.Hr(s, t, n, i, e) | ||
: null == a | ||
@@ -303,3 +303,3 @@ ? (r.D.info( | ||
), | ||
this.Gr(s, t, n, i, e)) | ||
this.Hr(s, t, n, i, e)) | ||
: a <= new Date().valueOf() | ||
@@ -309,8 +309,8 @@ ? (r.D.info( | ||
), | ||
this.Gr(s, t, n, i, e)) | ||
this.Hr(s, t, n, i, e)) | ||
: (r.D.info( | ||
"Device already subscribed to push, sending existing subscription to backend." | ||
), | ||
this.Jr(s, i, u)); | ||
} else this.Hr(t, n, i, e); | ||
this.Kr(s, i, u)); | ||
} else this.Jr(t, n, i, e); | ||
}) | ||
@@ -327,4 +327,4 @@ .catch(i => { | ||
}; | ||
this.fn(u, s, t); | ||
} else if (this.Br) { | ||
this.dn(u, s, t); | ||
} else if (this.Mr) { | ||
if (null == this.Ir || "" === this.Ir) | ||
@@ -335,9 +335,9 @@ return void r.D.error( | ||
const t = window.safari.pushNotification.permission(this.Ir); | ||
this.hn(this.Ir, t, i, e); | ||
this.fn(this.Ir, t, i, e); | ||
} | ||
} else r.D.info(this.Sn); | ||
} else r.D.info(this._n); | ||
} | ||
unsubscribe(i, e) { | ||
dt.isPushSupported() | ||
? this.Er | ||
? this.Or | ||
? navigator.serviceWorker.getRegistration().then(t => { | ||
@@ -349,3 +349,3 @@ t | ||
s && | ||
(this.Qr(), | ||
(this.Xr(), | ||
s | ||
@@ -363,3 +363,3 @@ .unsubscribe() | ||
"function" == typeof e && e()), | ||
this.pn(t); | ||
this.bn(t); | ||
}) | ||
@@ -378,9 +378,9 @@ .catch(i => { | ||
}) | ||
: this.Br && | ||
(this.Qr(), | ||
: this.Mr && | ||
(this.Xr(), | ||
r.D.info("Device unsubscribed from push."), | ||
"function" == typeof i && i()) | ||
: r.D.info(this.Sn); | ||
: r.D.info(this._n); | ||
} | ||
} | ||
aa.Sn = "Push notifications are not supported in this browser."; | ||
aa._n = "Push notifications are not supported in this browser."; |
const dt = { | ||
Or: () => | ||
Br: () => | ||
"serviceWorker" in navigator && | ||
@@ -7,3 +7,3 @@ "undefined" != typeof ServiceWorkerRegistration && | ||
"PushManager" in window, | ||
Mr: () => | ||
Yr: () => | ||
"safari" in window && | ||
@@ -13,3 +13,3 @@ "pushNotification" in window.safari && | ||
"function" == typeof window.safari.pushNotification.requestPermission, | ||
isPushSupported: () => dt.Or() || dt.Mr(), | ||
isPushSupported: () => dt.Br() || dt.Yr(), | ||
isPushBlocked: () => { | ||
@@ -16,0 +16,0 @@ const i = |
@@ -13,3 +13,3 @@ import b from "./util/net.js"; | ||
(this._r = t), | ||
(this.zo = s), | ||
(this.Bo = s), | ||
(this.kl = 0), | ||
@@ -23,3 +23,3 @@ (this.yl = h.Pa()), | ||
(this.h = h), | ||
(this.Go = r), | ||
(this.Ko = r), | ||
(this.vt = a), | ||
@@ -30,6 +30,6 @@ (this.$l = o), | ||
} | ||
_l(t, s) { | ||
return !t && !s && this.Go.Xn() >= this.Tl; | ||
ql(t, s) { | ||
return !t && !s && this.Ko.Yn() >= this.Tl; | ||
} | ||
ql(t) { | ||
Fl(t) { | ||
let s = this.j.gh(); | ||
@@ -45,4 +45,4 @@ if (t.length > 0) { | ||
} | ||
Fl(t, s, i, e, n, l, h) { | ||
null == i && (i = !0), i && this.Dl(); | ||
Dl(t, s, i, e, n, l, h) { | ||
null == i && (i = !0), i && this.Ll(); | ||
const u = this.h.Ua(), | ||
@@ -54,3 +54,3 @@ a = this.h.Ba(); | ||
b.Hs({ | ||
url: this.zo + "/data/", | ||
url: this.Bo + "/data/", | ||
data: t, | ||
@@ -63,10 +63,10 @@ headers: s, | ||
this.vt.Os(t, i, s) | ||
? (this.Go.Qs(), | ||
? (this.Ko.Qs(), | ||
this.gt.al(i), | ||
(null != t.respond_with && | ||
t.respond_with.user_id != this.v.getUserId()) || | ||
(null != t.device && this.h.B(o.q.Xo, t.device), | ||
(null != t.device && this.h.B(o.q.Yo, t.device), | ||
null != t.sdk_metadata && | ||
(this.h.B(o.q.oa, t.sdk_metadata), | ||
this.h.B(o.q.ua, this.j.ha())), | ||
(this.h.B(o.q.ua, t.sdk_metadata), | ||
this.h.B(o.q.ha, this.j.ca())), | ||
this.$l(i), | ||
@@ -80,12 +80,12 @@ "function" == typeof e && e())) | ||
(this.kl = Math.max(this.kl - 1, 0)), | ||
this.vt.ca(t.events, t.attributes), | ||
this.vt.la(t.events, t.attributes), | ||
"function" == typeof n && n(); | ||
}, | ||
Ll: t => { | ||
Pl: t => { | ||
if (("function" == typeof l && l(t), i && !c)) { | ||
if (t && !h) this.Pl(); | ||
if (t && !h) this.Rl(); | ||
else { | ||
let t = this.jl; | ||
(null == t || t < 1e3 * this.yl) && (t = 1e3 * this.yl), | ||
this.Pl(Math.min(3e5, pt(1e3 * this.yl, 3 * t))); | ||
this.Rl(Math.min(3e5, pt(1e3 * this.yl, 3 * t))); | ||
} | ||
@@ -97,11 +97,11 @@ c = !0; | ||
}, | ||
m = this.ql(u), | ||
m = this.Fl(u), | ||
f = s || m; | ||
if (this._l(h, m)) | ||
if (this.ql(h, m)) | ||
return void r.D.info( | ||
"Declining to flush data due to 50 consecutive authentication failures" | ||
); | ||
if (i && !this.vt.ba(u, a, t, f)) | ||
return this.Pl(), void ("function" == typeof l && l(!0)); | ||
const g = this.vt.ga(t, f, u, a); | ||
if (i && !this.vt.ga(u, a, t, f)) | ||
return this.Rl(), void ("function" == typeof l && l(!0)); | ||
const g = this.vt.qa(t, f, u, a); | ||
f && this.kl++; | ||
@@ -112,14 +112,14 @@ let p = !1; | ||
this.vt.Gs(t.requestData, () => d(t.requestData, t.headers)), (p = !0); | ||
this.Go.Jn() && i && !p | ||
? this.Pl() | ||
this.Ko.Jn() && i && !p | ||
? this.Rl() | ||
: m && (r.D.info("Invoking new session subscriptions"), this.Al.St()); | ||
} | ||
Rl() { | ||
Ml() { | ||
return this.kl > 0; | ||
} | ||
Pl(t) { | ||
this.Ml || | ||
Rl(t) { | ||
this.Il || | ||
(null == t && (t = 1e3 * this.yl), | ||
this.Dl(), | ||
(this.Il = setTimeout(() => { | ||
this.Ll(), | ||
(this.Nl = setTimeout(() => { | ||
if (document.hidden) { | ||
@@ -129,22 +129,22 @@ const t = "visibilitychange", | ||
document.hidden || | ||
(document.removeEventListener(t, s, !1), this.Fl()); | ||
(document.removeEventListener(t, s, !1), this.Dl()); | ||
}; | ||
document.addEventListener(t, s, !1); | ||
} else this.Fl(); | ||
} else this.Dl(); | ||
}, t)), | ||
(this.jl = t)); | ||
} | ||
Dl() { | ||
null != this.Il && (clearTimeout(this.Il), (this.Il = null)); | ||
Ll() { | ||
null != this.Nl && (clearTimeout(this.Nl), (this.Nl = null)); | ||
} | ||
initialize() { | ||
(this.Ml = !1), this.Pl(); | ||
(this.Il = !1), this.Rl(); | ||
} | ||
destroy() { | ||
this.Al.removeAllSubscriptions(), | ||
this.Go.Vn(), | ||
this.Dl(), | ||
(this.Ml = !0), | ||
this.Fl(null, null, !1), | ||
(this.Il = null); | ||
this.Ko.Wn(), | ||
this.Ll(), | ||
(this.Il = !0), | ||
this.Dl(null, null, !1), | ||
(this.Nl = null); | ||
} | ||
@@ -155,9 +155,9 @@ cr(t) { | ||
openSession() { | ||
const t = this.j.ha() !== this.j.mo(); | ||
const t = this.j.ca() !== this.j.mo(); | ||
t && (this.h.ya(o.eu.Jo), this.h.ya(o.eu.su)), | ||
this.Fl(null, !1, null, null, null), | ||
this.Bn(), | ||
this.Dl(null, !1, null, null, null), | ||
this.Ln(), | ||
t && | ||
import("./Push/push-manager-factory.js").then(t => { | ||
if (this.Ml) return; | ||
if (this.Il) return; | ||
const s = t.default.aa(); | ||
@@ -169,3 +169,3 @@ if ( | ||
const t = () => { | ||
s.Yr() | ||
s.Gr() | ||
? r.D.info( | ||
@@ -180,3 +180,3 @@ "Push token maintenance is disabled, not refreshing token for backend." | ||
e = () => { | ||
const s = this.h.I(o.q.kn); | ||
const s = this.h.I(o.q.Pn); | ||
(null == s || s) && t(); | ||
@@ -193,8 +193,8 @@ }, | ||
this.j.Gh(), | ||
null != e && this.Fl(null, !1, null, null, null), | ||
null != e && this.Dl(null, !1, null, null, null), | ||
this.v.uu(t), | ||
i ? this.Go.setSdkAuthenticationSignature(i) : this.Go.Qn(); | ||
i ? this.Ko.setSdkAuthenticationSignature(i) : this.Ko.Qn(); | ||
for (let t = 0; t < s.length; t++) s[t].changeUser(null == e); | ||
null != e && this.h.Xs(o.q.P), | ||
this.h.Xs(o.q.Xo), | ||
this.h.Xs(o.q.Yo), | ||
this.openSession(), | ||
@@ -205,4 +205,4 @@ r.D.info('Changed user to "' + t + '".'); | ||
i && | ||
this.Go.Kn() !== i && | ||
(this.Go.setSdkAuthenticationSignature(i), | ||
this.Ko.Kn() !== i && | ||
(this.Ko.setSdkAuthenticationSignature(i), | ||
(s = "Updated SDK authentication signature")), | ||
@@ -213,4 +213,4 @@ r.D.info(`Current user is already ${t}. ${s}`); | ||
requestImmediateDataFlush(t) { | ||
this.Dl(), this.j.mo(); | ||
this.Fl( | ||
this.Ll(), this.j.mo(); | ||
this.Dl( | ||
null, | ||
@@ -230,3 +230,3 @@ null, | ||
requestFeedRefresh() { | ||
this.j.mo(), this.Fl(!0); | ||
this.j.mo(), this.Dl(!0); | ||
} | ||
@@ -236,6 +236,6 @@ zr(t, s) { | ||
r.D.info("Requesting explicit trigger refresh."), | ||
this.Fl(null, !0, null, t, s); | ||
this.Dl(null, !0, null, t, s); | ||
} | ||
Nn(t, i) { | ||
const e = r.A.Nl, | ||
const e = r.A.Ol, | ||
n = { a: t, l: i }, | ||
@@ -259,3 +259,3 @@ l = s.G(e, n); | ||
null != h && (o.alt_accuracy = h); | ||
const u = s.G(r.A.Ol, o, t); | ||
const u = s.G(r.A.Ul, o, t); | ||
return ( | ||
@@ -271,11 +271,11 @@ u && | ||
const i = this.j.mo(); | ||
return new ue(this.v.getUserId(), r.A.Ul, t, i, { cid: s }); | ||
return new ue(this.v.getUserId(), r.A.xl, t, i, { cid: s }); | ||
} | ||
Bn() { | ||
Ln() { | ||
const t = r.xt.Ft; | ||
new r.qt(t, r.D).setItem(t.$t.xl, 1, { | ||
baseUrl: this.zo, | ||
new r.qt(t, r.D).setItem(t.$t.Kl, 1, { | ||
baseUrl: this.Bo, | ||
data: { api_key: this._r, device_id: this.Ur.te().id }, | ||
userId: this.v.getUserId(), | ||
sdkAuthEnabled: this.Go.Jn() | ||
sdkAuthEnabled: this.Ko.Jn() | ||
}); | ||
@@ -285,3 +285,3 @@ } | ||
for (const s of t) | ||
if (s.api_key === this._r) this.vt.ca(s.events, s.attributes); | ||
if (s.api_key === this._r) this.vt.la(s.events, s.attributes); | ||
else { | ||
@@ -300,4 +300,4 @@ const t = r.xt.Ft; | ||
null === e && null === n | ||
? ((l = r.A.Kl), (h = { key: i })) | ||
: ((l = r.A.Wl), (h = { key: i, latitude: e, longitude: n })), | ||
? ((l = r.A.Wl), (h = { key: i })) | ||
: ((l = r.A.Bl), (h = { key: i, latitude: e, longitude: n })), | ||
s.G(l, h) | ||
@@ -308,4 +308,4 @@ ); | ||
const e = { group_id: t, status: i }; | ||
return s.G(r.A.Bl, e); | ||
return s.G(r.A.Gl, e); | ||
} | ||
} |
@@ -5,3 +5,3 @@ export default class xt { | ||
} | ||
Gl(t) { | ||
Hl(t) { | ||
return null == this.Jl || this.Jl === t[0]; | ||
@@ -8,0 +8,0 @@ } |
import kt from "./filter-set.js"; | ||
export default class Dt { | ||
constructor(t, s) { | ||
(this.Jl = t), (this.Hl = s); | ||
(this.Jl = t), (this.Ql = s); | ||
} | ||
Gl(t) { | ||
if (null == this.Jl || null == this.Hl) return !1; | ||
Hl(t) { | ||
if (null == this.Jl || null == this.Ql) return !1; | ||
const s = t[0], | ||
r = t[1]; | ||
return s === this.Jl && this.Hl.Gl(r); | ||
return s === this.Jl && this.Ql.Hl(r); | ||
} | ||
@@ -19,4 +19,4 @@ static fromJson(t) { | ||
ss() { | ||
return { e: this.Jl, pf: this.Hl.ss() }; | ||
return { e: this.Jl, pf: this.Ql.ss() }; | ||
} | ||
} |
@@ -7,3 +7,3 @@ import Gt from "./filter.js"; | ||
} | ||
Gl(t) { | ||
Hl(t) { | ||
let r = !0; | ||
@@ -14,3 +14,3 @@ for (let e = 0; e < this.filters.length; e++) { | ||
for (let r = 0; r < o.length; r++) | ||
if (o[r].Gl(t)) { | ||
if (o[r].Hl(t)) { | ||
s = !0; | ||
@@ -47,3 +47,3 @@ break; | ||
} | ||
static Dn(t) { | ||
static Sn(t) { | ||
const r = []; | ||
@@ -53,3 +53,3 @@ for (let e = 0; e < t.length; e++) { | ||
s = t[e]; | ||
for (let t = 0; t < s.length; t++) o.push(Gt.Dn(s[t])); | ||
for (let t = 0; t < s.length; t++) o.push(Gt.Sn(s[t])); | ||
r.push(o); | ||
@@ -56,0 +56,0 @@ } |
@@ -10,53 +10,53 @@ import { isDate as yt } from "../../util/code-utils.js"; | ||
constructor(t, s, e, i) { | ||
(this.Ql = t), | ||
(this.Xl = s), | ||
(this.Xl = t), | ||
(this.Vl = s), | ||
(this.comparator = e), | ||
(this.Vl = i), | ||
this.Xl === Gt.Zl.Yl && | ||
this.comparator !== Gt.Ah.Th && | ||
this.comparator !== Gt.Ah._h && | ||
this.comparator !== Gt.Ah.yh && | ||
this.comparator !== Gt.Ah.Mh && | ||
(this.Vl = h(this.Vl)); | ||
(this.Yl = i), | ||
this.Vl === Gt.Th.Zl && | ||
this.comparator !== Gt._h.Ah && | ||
this.comparator !== Gt._h.yh && | ||
this.comparator !== Gt._h.Mh && | ||
this.comparator !== Gt._h.Rh && | ||
(this.Yl = h(this.Yl)); | ||
} | ||
Gl(t) { | ||
Hl(t) { | ||
let s = null; | ||
switch ((null != t && (s = t[this.Ql]), this.comparator)) { | ||
case Gt.Ah.Rh: | ||
return null != s && s.valueOf() === this.Vl.valueOf(); | ||
case Gt.Ah.Hh: | ||
return null == s || s.valueOf() !== this.Vl.valueOf(); | ||
case Gt.Ah.Lh: | ||
return typeof s == typeof this.Vl && s > this.Vl; | ||
case Gt.Ah.Th: | ||
return this.Xl === Gt.Zl.Yl | ||
? null != s && yt(s) && Ht(s) <= this.Vl | ||
: typeof s == typeof this.Vl && s >= this.Vl; | ||
case Gt.Ah.Ih: | ||
return typeof s == typeof this.Vl && s < this.Vl; | ||
case Gt.Ah._h: | ||
return this.Xl === Gt.Zl.Yl | ||
? null != s && yt(s) && Ht(s) >= this.Vl | ||
: typeof s == typeof this.Vl && s <= this.Vl; | ||
case Gt.Ah.Oh: | ||
switch ((null != t && (s = t[this.Xl]), this.comparator)) { | ||
case Gt._h.Hh: | ||
return null != s && s.valueOf() === this.Yl.valueOf(); | ||
case Gt._h.Lh: | ||
return null == s || s.valueOf() !== this.Yl.valueOf(); | ||
case Gt._h.Ih: | ||
return typeof s == typeof this.Yl && s > this.Yl; | ||
case Gt._h.Ah: | ||
return this.Vl === Gt.Th.Zl | ||
? null != s && yt(s) && Ht(s) <= this.Yl | ||
: typeof s == typeof this.Yl && s >= this.Yl; | ||
case Gt._h.Oh: | ||
return typeof s == typeof this.Yl && s < this.Yl; | ||
case Gt._h.yh: | ||
return this.Vl === Gt.Th.Zl | ||
? null != s && yt(s) && Ht(s) >= this.Yl | ||
: typeof s == typeof this.Yl && s <= this.Yl; | ||
case Gt._h.Uh: | ||
return ( | ||
null != s && | ||
"string" == typeof s && | ||
typeof s == typeof this.Vl && | ||
null != s.match(this.Vl) | ||
typeof s == typeof this.Yl && | ||
null != s.match(this.Yl) | ||
); | ||
case Gt.Ah.Uh: | ||
case Gt._h.Qh: | ||
return null != s; | ||
case Gt.Ah.Qh: | ||
case Gt._h.Xh: | ||
return null == s; | ||
case Gt.Ah.yh: | ||
return null != s && yt(s) && Ut(s) < this.Vl; | ||
case Gt.Ah.Mh: | ||
return null != s && yt(s) && Ut(s) > this.Vl; | ||
case Gt.Ah.Xh: | ||
case Gt._h.Mh: | ||
return null != s && yt(s) && Ut(s) < this.Yl; | ||
case Gt._h.Rh: | ||
return null != s && yt(s) && Ut(s) > this.Yl; | ||
case Gt._h.Bh: | ||
return ( | ||
null == s || | ||
typeof s != typeof this.Vl || | ||
typeof s != typeof this.Yl || | ||
"string" != typeof s || | ||
null == s.match(this.Vl) | ||
null == s.match(this.Yl) | ||
); | ||
@@ -75,26 +75,26 @@ } | ||
ss() { | ||
let t = this.Vl; | ||
let t = this.Yl; | ||
return ( | ||
yt(this.Vl) && (t = l(t.valueOf())), | ||
{ k: this.Ql, t: this.Xl, c: this.comparator, v: t } | ||
yt(this.Yl) && (t = l(t.valueOf())), | ||
{ k: this.Xl, t: this.Vl, c: this.comparator, v: t } | ||
); | ||
} | ||
static Dn(t) { | ||
static Sn(t) { | ||
return new Gt(t.k, t.t, t.c, t.v); | ||
} | ||
} | ||
(Gt.Ah = { | ||
Rh: 1, | ||
Hh: 2, | ||
Lh: 3, | ||
Th: 4, | ||
Ih: 5, | ||
_h: 6, | ||
Oh: 10, | ||
Uh: 11, | ||
Qh: 12, | ||
yh: 15, | ||
Mh: 16, | ||
Xh: 17 | ||
(Gt._h = { | ||
Hh: 1, | ||
Lh: 2, | ||
Ih: 3, | ||
Ah: 4, | ||
Oh: 5, | ||
yh: 6, | ||
Uh: 10, | ||
Qh: 11, | ||
Xh: 12, | ||
Mh: 15, | ||
Rh: 16, | ||
Bh: 17 | ||
}), | ||
(Gt.Zl = { Bh: "boolean", Fh: "number", kh: "string", Yl: "date" }); | ||
(Gt.Th = { Fh: "boolean", kh: "number", Jh: "string", Zl: "date" }); |
@@ -6,3 +6,3 @@ import Kt from "./trigger-condition.js"; | ||
} | ||
Gl(t) { | ||
Hl(t) { | ||
if (null == this.fu) return !1; | ||
@@ -9,0 +9,0 @@ const i = Kt.du(t[0], this.fu); |
@@ -5,3 +5,3 @@ export default class Wt { | ||
} | ||
Gl(t) { | ||
Hl(t) { | ||
return null == this.productId || t[0] === this.productId; | ||
@@ -8,0 +8,0 @@ } |
import kt from "./filter-set.js"; | ||
export default class Xt { | ||
constructor(t, s) { | ||
(this.productId = t), (this.Hl = s); | ||
(this.productId = t), (this.Ql = s); | ||
} | ||
Gl(t) { | ||
if (null == this.productId || null == this.Hl) return !1; | ||
Hl(t) { | ||
if (null == this.productId || null == this.Ql) return !1; | ||
const s = t[0], | ||
i = t[1]; | ||
return s === this.productId && this.Hl.Gl(i); | ||
return s === this.productId && this.Ql.Hl(i); | ||
} | ||
@@ -19,4 +19,4 @@ static fromJson(t) { | ||
ss() { | ||
return { id: this.productId, pf: this.Hl.ss() }; | ||
return { id: this.productId, pf: this.Ql.ss() }; | ||
} | ||
} |
@@ -6,3 +6,3 @@ import Kt from "./trigger-condition.js"; | ||
} | ||
Gl(t) { | ||
Hl(t) { | ||
return null == this.fu || Kt.du(t[0], this.fu); | ||
@@ -9,0 +9,0 @@ } |
@@ -15,3 +15,3 @@ import xt from "./custom-event-data.js"; | ||
ec(e, t) { | ||
return Kt.tc[this.type] === e && (null == this.data || this.data.Gl(t)); | ||
return Kt.tc[this.type] === e && (null == this.data || this.data.Hl(t)); | ||
} | ||
@@ -62,3 +62,3 @@ static du(e, t) { | ||
} | ||
static Dn(e) { | ||
static Sn(e) { | ||
let t, r; | ||
@@ -73,3 +73,3 @@ switch (e.t) { | ||
case Kt.rc.ac: | ||
(r = e.d || {}), (t = new Xt(r.id, kt.Dn(r.pf || []))); | ||
(r = e.d || {}), (t = new Xt(r.id, kt.Sn(r.pf || []))); | ||
break; | ||
@@ -83,3 +83,3 @@ case Kt.rc.vr: | ||
case Kt.rc.sc: | ||
(r = e.d || {}), (t = new Dt(r.e, kt.Dn(r.pf || []))); | ||
(r = e.d || {}), (t = new Dt(r.e, kt.Sn(r.pf || []))); | ||
break; | ||
@@ -86,0 +86,0 @@ case Kt.rc.Ar: |
@@ -22,20 +22,20 @@ import { | ||
(this.data = o), | ||
null == h && (h = mt.Jh), | ||
(this.Vh = h), | ||
(this.qh = u), | ||
(this.Kh = d || null); | ||
null == h && (h = mt.Vh), | ||
(this.qh = h), | ||
(this.Kh = u), | ||
(this.Wh = d || null); | ||
} | ||
Wh(t) { | ||
Yh(t) { | ||
return ( | ||
null == this.Kh || (this.Vh !== mt.Jh && t - this.Kh >= 1e3 * this.Vh) | ||
null == this.Wh || (this.qh !== mt.Vh && t - this.Wh >= 1e3 * this.qh) | ||
); | ||
} | ||
Yh(t) { | ||
this.Kh = t; | ||
Zh(t) { | ||
this.Wh = t; | ||
} | ||
Zh(t) { | ||
gu(t) { | ||
const i = t + 1e3 * this.$h; | ||
return Math.max(i - new Date().valueOf(), 0); | ||
} | ||
gu(t) { | ||
pu(t) { | ||
const i = new Date().valueOf() - t, | ||
@@ -86,11 +86,11 @@ s = null == t || isNaN(i) || null == this.$i || i < this.$i; | ||
d: this.$h, | ||
r: this.Vh, | ||
r: this.qh, | ||
tm: this.$i, | ||
ss: this.qh, | ||
ld: this.Kh | ||
ss: this.Kh, | ||
ld: this.Wh | ||
}; | ||
} | ||
static Dn(t) { | ||
static Sn(t) { | ||
const i = []; | ||
for (let s = 0; s < t.c.length; s++) i.push(Kt.Dn(t.c[s])); | ||
for (let s = 0; s < t.c.length; s++) i.push(Kt.Sn(t.c[s])); | ||
return new mt( | ||
@@ -112,2 +112,2 @@ t.i, | ||
} | ||
(mt.Jh = -1), (mt._i = { Ti: "inapp", pu: "templated_iam" }); | ||
(mt.Vh = -1), (mt._i = { Ti: "inapp", Tu: "templated_iam" }); |
@@ -10,3 +10,3 @@ import pe from "../InAppMessage/in-app-message-manager-factory.js"; | ||
if (!TriggersProviderFactory.provider) { | ||
const r = e.nn(T.Io); | ||
const r = e.nn(T.Ao); | ||
(TriggersProviderFactory.provider = new gr( | ||
@@ -13,0 +13,0 @@ null != r ? r : 30, |
@@ -37,3 +37,3 @@ import y from "../common/base-provider.js"; | ||
const i = this.cg[t]; | ||
null != this.ng[i.id] && i.Yh(this.ng[i.id]); | ||
null != this.ng[i.id] && i.Zh(this.ng[i.id]); | ||
} | ||
@@ -45,3 +45,3 @@ } | ||
i = []; | ||
for (let s = 0; s < t.length; s++) i.push(mt.Dn(t[s])); | ||
for (let s = 0; s < t.length; s++) i.push(mt.Sn(t[s])); | ||
(this.cg = i), this.gg(); | ||
@@ -66,3 +66,3 @@ } | ||
const o = t[e], | ||
n = r.Zh(o.Si); | ||
n = r.gu(o.Si); | ||
if (n > 0) { | ||
@@ -72,3 +72,3 @@ let t, e; | ||
null != o.dg && (t = o.dg), | ||
null != o.mg && ue.Fa(o.mg) && (e = ue.Dn(o.mg)); | ||
null != o.mg && ue.Fa(o.mg) && (e = ue.Sn(o.mg)); | ||
const a = []; | ||
@@ -111,3 +111,3 @@ if (p(o.pg)) | ||
null != this.ng[h.id] && | ||
(h.Yh(this.ng[h.id]), (s[h.id] = this.ng[h.id])), | ||
(h.Zh(this.ng[h.id]), (s[h.id] = this.ng[h.id])), | ||
null != this.og[h.id] && (e[h.id] = this.og[h.id]); | ||
@@ -137,3 +137,3 @@ for (let t = 0; t < h.Ph.length; t++) | ||
const h = new Date().valueOf(); | ||
if (!t.gu(i)) | ||
if (!t.pu(i)) | ||
return !1 === navigator.onLine && t.type === mt._i.Ti && e.imageUrl | ||
@@ -144,3 +144,3 @@ ? (r.D.info( | ||
void this.ig.ni(t.id, InAppMessage.li.nh)) | ||
: void (t.Wh(h) && this.yg(t, h, s) | ||
: void (t.Yh(h) && this.yg(t, h, s) | ||
? 0 === this.yt.bu() | ||
@@ -154,3 +154,3 @@ ? r.D.info( | ||
)); | ||
t.type === mt._i.pu | ||
t.type === mt._i.Tu | ||
? this.ig.ni(t.id, InAppMessage.li.zi) | ||
@@ -163,3 +163,3 @@ : this.ig.ni(t.id, InAppMessage.li.rh); | ||
if (null != o) | ||
if ((this.wg(o, i, s, e, h), o.gu(i))) { | ||
if ((this.wg(o, i, s, e, h), o.pu(i))) { | ||
let t = `Server aborted in-app message display, but the timeout on fallback trigger ${o.id} has already elapsed.`; | ||
@@ -201,3 +201,3 @@ h.length > 0 && (t += " Continuing to fall back."), | ||
break; | ||
case mt._i.pu: | ||
case mt._i.Tu: | ||
const l = wt.fromJson(t.data, o, n, i, t.$i); | ||
@@ -222,3 +222,3 @@ if (null == l) { | ||
if (!F(V, t, "Cannot fire trigger action.", "TriggerEvents")) return; | ||
if (this.si.Rl()) | ||
if (this.si.Ml()) | ||
return ( | ||
@@ -240,3 +240,3 @@ r.D.info( | ||
if ( | ||
r.Wh(h) && | ||
r.Yh(h) && | ||
(null == r.startTime || r.startTime <= e) && | ||
@@ -299,3 +299,3 @@ (null == r.endTime || r.endTime >= e) | ||
); | ||
let e = t.qh; | ||
let e = t.Kh; | ||
return null == e && (e = this.tg), i - this.hg >= 1e3 * e; | ||
@@ -314,3 +314,3 @@ } | ||
this.gg(), | ||
t.Yh(i), | ||
t.Zh(i), | ||
(this.hg = i), | ||
@@ -317,0 +317,0 @@ this.h.B(o.q.Na, i), |
import e, { OPTIONS as T } from "../../managers/braze-instance.js"; | ||
export function attachCSS(n, t, o) { | ||
const c = n || document.querySelector("head"), | ||
s = `ab-${t}-css-definitions-${"4.4.0".replace(/\./g, "-")}`, | ||
s = `ab-${t}-css-definitions-${"4.5.0".replace(/\./g, "-")}`, | ||
a = c.ownerDocument || document; | ||
@@ -6,0 +6,0 @@ if (null == a.getElementById(s)) { |
import e, { OPTIONS as T } from "../../managers/braze-instance.js"; | ||
export function loadFontAwesome() { | ||
if (e.nn(T.To)) return; | ||
if (e.nn(T.Oo)) return; | ||
const t = "https://use.fontawesome.com/7f85a56ba4.css"; | ||
@@ -5,0 +5,0 @@ if ( |
@@ -47,3 +47,3 @@ import _t from "../models/identifier.js"; | ||
} | ||
Lr(t, s, e, i, u) { | ||
Qr(t, s, e, i, u) { | ||
this.nu("push_token", t, !1, !0), | ||
@@ -56,5 +56,5 @@ this.nu("custom_push_public_key", e, !1, !0), | ||
l = new ei(t, s, e, i, u); | ||
this.h.B(o.q.kn, l.ss()), n.setItem(h.$t.cu, h.se, !0); | ||
this.h.B(o.q.Pn, l.ss()), n.setItem(h.$t.cu, h.se, !0); | ||
} | ||
Xr(t) { | ||
Zr(t) { | ||
if ( | ||
@@ -69,5 +69,5 @@ (this.nu("push_token", null, !1, !0), | ||
s = new r.qt(t, r.D); | ||
this.h.B(o.q.kn, !1), s.setItem(t.$t.cu, t.se, !1); | ||
this.h.B(o.q.Pn, !1), s.setItem(t.$t.cu, t.se, !1); | ||
} | ||
} | ||
} |
@@ -239,3 +239,3 @@ import { | ||
!1) | ||
: this.si.$n(t, User._n.SUBSCRIBED).S; | ||
: this.si.$n(t, User.Bn.SUBSCRIBED).S; | ||
} | ||
@@ -253,9 +253,9 @@ removeFromSubscriptionGroup(t) { | ||
!1) | ||
: this.si.$n(t, User._n.UNSUBSCRIBED).S; | ||
: this.si.$n(t, User.Bn.UNSUBSCRIBED).S; | ||
} | ||
Lr(t, e, s, r, i) { | ||
this.v.Lr(t, e, s, r, i), this.si.Bn(); | ||
Qr(t, e, s, r, i) { | ||
this.v.Qr(t, e, s, r, i), this.si.Ln(); | ||
} | ||
Xr(t) { | ||
this.v.Xr(t); | ||
Zr(t) { | ||
this.v.Zr(t); | ||
} | ||
@@ -277,5 +277,5 @@ } | ||
}), | ||
(User._n = { SUBSCRIBED: "subscribed", UNSUBSCRIBED: "unsubscribed" }), | ||
(User.Ln = "user_id"), | ||
(User.Bn = { SUBSCRIBED: "subscribed", UNSUBSCRIBED: "unsubscribed" }), | ||
(User.Rn = "user_id"), | ||
(User.lu = "custom"), | ||
(User.ee = 997); |
@@ -6,3 +6,3 @@ import { isArray as p } from "./code-utils.js"; | ||
ef() {} | ||
Yo(t) {} | ||
Zo(t) {} | ||
static rf(t, e) { | ||
@@ -9,0 +9,0 @@ if (t && e) |
@@ -11,3 +11,3 @@ import ti from "./client-hints-parser.js"; | ||
(this.version = this.Sg.ef()), | ||
this.Yo().then(t => (this.OS = t)), | ||
this.Zo().then(t => (this.OS = t)), | ||
(this.language = ( | ||
@@ -20,3 +20,3 @@ navigator.userLanguage || | ||
).toLowerCase()), | ||
(this.Bo = si.Bg(this.userAgent)); | ||
(this.Wo = si.Bg(this.userAgent)); | ||
} | ||
@@ -29,9 +29,9 @@ Og() { | ||
} | ||
Qo() { | ||
Xo() { | ||
return this.OS || null; | ||
} | ||
Yo() { | ||
Zo() { | ||
return this.OS | ||
? Promise.resolve(this.OS) | ||
: this.Sg.Yo(si.xg).then(t => ((this.OS = t), t)); | ||
: this.Sg.Zo(si.xg).then(t => ((this.OS = t), t)); | ||
} | ||
@@ -38,0 +38,0 @@ static Bg(t) { |
@@ -21,3 +21,3 @@ import Se from "./base-device-parser.js"; | ||
} | ||
Yo(t) { | ||
Zo(t) { | ||
if (this.OS) return Promise.resolve(this.OS); | ||
@@ -24,0 +24,0 @@ const r = r => { |
@@ -16,3 +16,3 @@ import r from "../../shared-lib/braze-shared-lib.js"; | ||
"function" == typeof t.error && t.error(e.status), | ||
"function" == typeof t.Ll && t.Ll(!1); | ||
"function" == typeof t.Pl && t.Pl(!1); | ||
}; | ||
@@ -32,3 +32,3 @@ (e.onload = () => { | ||
const n = { | ||
error: "" === e.responseText ? qt.la : qt.fa, | ||
error: "" === e.responseText ? qt.fa : qt.ma, | ||
response: e.responseText | ||
@@ -40,3 +40,3 @@ }; | ||
} | ||
"function" == typeof t.Ll && t.Ll(!0); | ||
"function" == typeof t.Pl && t.Pl(!0); | ||
} else r(); | ||
@@ -43,0 +43,0 @@ }), |
@@ -13,3 +13,3 @@ import Se from "./base-device-parser.js"; | ||
} | ||
Yo(r) { | ||
Zo(r) { | ||
for (let e = 0; e < r.length; e++) { | ||
@@ -16,0 +16,0 @@ let n = r[e].string, |
@@ -34,3 +34,3 @@ export const ORIENTATION = { PORTRAIT: 0, LANDSCAPE: 1 }; | ||
io: _getOrientation, | ||
bn: _getCurrentUrl | ||
gn: _getCurrentUrl | ||
}; |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
422919
11301
0