@entur-partner/app-shell 6.5.0 → 6.5.1

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/index.mjs CHANGED
@@ -29,30 +29,27 @@ function T(e) {
29
29
  return e({ logoutParams: { returnTo: `${t}//${n}:${r}` } });
30
30
  }
31
31
  var te = ({ children: e, decorateUser: i, getReturnPath: l, isPublicView: u }) => {
32
- let [d, f] = y(void 0), [p, m] = y(!1), [h, _] = y(void 0), { user: v, getAccessTokenSilently: C, loginWithRedirect: w, logout: ee, isLoading: te, isAuthenticated: E, error: D } = t();
32
+ let [d, f] = y(void 0), [p, m] = y(void 0), { user: h, getAccessTokenSilently: _, loginWithRedirect: v, logout: C, isLoading: w, isAuthenticated: ee, error: te } = t();
33
33
  return g(() => {
34
- E && (async () => {
35
- m(!0);
34
+ ee && (async () => {
36
35
  try {
37
- f(await i(v, await C()));
36
+ f(await i(h, await _()));
38
37
  } catch (e) {
39
- _(e);
40
- } finally {
41
- m(!1);
38
+ m(e);
42
39
  }
43
40
  })();
44
41
  }, [
45
42
  i,
46
- C,
47
- E,
48
- v
49
- ]), te || p || E && !d && !h ? /* @__PURE__ */ x(r, {
43
+ _,
44
+ ee,
45
+ h
46
+ ]), w || ee && !d && !p ? /* @__PURE__ */ x(r, {
50
47
  style: { marginTop: a.extraLarge9 },
51
48
  children: "Authenticating"
52
- }) : !E && !u ? (w({ appState: { returnTo: l() } }), /* @__PURE__ */ x(r, {
49
+ }) : !ee && !u ? (v({ appState: { returnTo: l() } }), /* @__PURE__ */ x(r, {
53
50
  style: { marginTop: a.extraLarge9 },
54
51
  children: "Redirecting to login page"
55
- })) : h ? (process.env.NODE_ENV !== "production" && console.error(h), /* @__PURE__ */ x(n, {
52
+ })) : p ? (process.env.NODE_ENV !== "production" && console.error(p), /* @__PURE__ */ x(n, {
56
53
  variant: "error",
57
54
  title: "Authentication failed",
58
55
  style: {
@@ -68,7 +65,7 @@ var te = ({ children: e, decorateUser: i, getReturnPath: l, isPublicView: u }) =
68
65
  }),
69
66
  " to get it resolved."
70
67
  ] })
71
- })) : D ? (process.env.NODE_ENV !== "production" && console.error(D), /* @__PURE__ */ S(n, {
68
+ })) : te ? (process.env.NODE_ENV !== "production" && console.error(te), /* @__PURE__ */ S(n, {
72
69
  variant: "error",
73
70
  title: "Authentication failed",
74
71
  style: {
@@ -83,14 +80,14 @@ var te = ({ children: e, decorateUser: i, getReturnPath: l, isPublicView: u }) =
83
80
  children: "support@entur.org"
84
81
  }),
85
82
  " to get it resolved."
86
- ] }), /* @__PURE__ */ S(c, { children: ["Authentication failed with: ", /* @__PURE__ */ x(o, { children: D?.toString() })] })]
83
+ ] }), /* @__PURE__ */ S(c, { children: ["Authentication failed with: ", /* @__PURE__ */ x(o, { children: te?.toString() })] })]
87
84
  })) : /* @__PURE__ */ x(b, { children: e({
88
85
  user: d,
89
- logout: () => T(ee),
90
- loginWithRedirect: w,
91
- getToken: C
86
+ logout: () => T(C),
87
+ loginWithRedirect: v,
88
+ getToken: _
92
89
  }) });
93
- }, E = ({ children: t, audience: n, domain: r, clientId: i, decorateUser: a, environment: o, redirectUri: s, navigate: c, isPublicView: u = !1 }) => /* @__PURE__ */ x(e, {
90
+ }, ne = ({ children: t, audience: n, domain: r, clientId: i, decorateUser: a, environment: o, redirectUri: s, navigate: c, isPublicView: u = !1 }) => /* @__PURE__ */ x(e, {
94
91
  domain: r,
95
92
  clientId: i,
96
93
  authorizationParams: {
@@ -107,22 +104,22 @@ var te = ({ children: e, decorateUser: i, getReturnPath: l, isPublicView: u }) =
107
104
  isPublicView: u,
108
105
  children: (e) => /* @__PURE__ */ S(b, { children: [o && o !== l.Production && /* @__PURE__ */ x(ee, { environment: o }), t(e)] })
109
106
  })
110
- }), D = "EP::activeOrgId", ne = {
111
- get: () => localStorage.getItem(D),
112
- set: (e) => localStorage.setItem(D, e)
113
- }, re = "EP::locale", ie = {
107
+ }), re = "EP::activeOrgId", E = {
114
108
  get: () => localStorage.getItem(re),
115
109
  set: (e) => localStorage.setItem(re, e)
116
- }, O = "ucData", ae = { get: () => localStorage.getItem(O) }, oe = {
110
+ }, ie = "EP::locale", ae = {
111
+ get: () => localStorage.getItem(ie),
112
+ set: (e) => localStorage.setItem(ie, e)
113
+ }, D = "ucData", oe = { get: () => localStorage.getItem(D) }, se = {
117
114
  Usercentrics: "Usercentrics Consent Management Platform",
118
115
  PostHog: "PostHog.com",
119
116
  Sentry: "Sentry"
120
- }, se = {
117
+ }, ce = {
121
118
  Usercentrics: { consentGiven: !1 },
122
119
  PostHog: { consentGiven: !1 },
123
120
  Sentry: { consentGiven: !1 }
124
- }, ce = (e) => e.map((e) => {
125
- let t = Object.entries(oe).find((t) => t[1] === e.name)?.[0];
121
+ }, le = (e) => e.map((e) => {
122
+ let t = Object.entries(se).find((t) => t[1] === e.name)?.[0];
126
123
  if (C(t, `Service name ${e.name} not found in SERVICE_NAMES`), typeof e.consent == "boolean") {
127
124
  let n = e.consent;
128
125
  return { [t]: { consentGiven: n } };
@@ -134,51 +131,51 @@ var te = ({ children: e, decorateUser: i, getReturnPath: l, isPublicView: u }) =
134
131
  }).reduce((e, t) => ({
135
132
  ...e,
136
133
  ...t
137
- }), se), le = p(se), ue = () => h(le), de = ({ children: e }) => {
138
- let [t, n] = y(se);
134
+ }), ce), ue = p(ce), de = () => h(ue), fe = ({ children: e }) => {
135
+ let [t, n] = y(ce);
139
136
  return g(() => {
140
137
  if (typeof window > "u") return;
141
- let e = ae.get();
138
+ let e = oe.get();
142
139
  if (e) {
143
140
  let t = JSON.parse(e);
144
- n(ce(Object.values(t.consent.services)));
141
+ n(le(Object.values(t.consent.services)));
145
142
  }
146
143
  }, []), g(() => {
147
144
  let e = async (e) => {
148
- typeof window > "u" || n(ce(Object.values(e.detail.services)));
145
+ typeof window > "u" || n(le(Object.values(e.detail.services)));
149
146
  };
150
147
  return window.addEventListener("UC_CONSENT", e), () => window.removeEventListener("UC_CONSENT", e);
151
- }, []), /* @__PURE__ */ x(le.Provider, {
148
+ }, []), /* @__PURE__ */ x(ue.Provider, {
152
149
  value: t,
153
150
  children: e
154
151
  });
155
- }, k = p(void 0), fe = (e) => {
152
+ }, O = p(void 0), pe = (e) => {
156
153
  let [t, n] = y(e);
157
154
  return g(() => {
158
- ie.set(t);
155
+ ae.set(t);
159
156
  }, [t]), [t, n];
160
- }, pe = () => {
161
- let e = h(k);
157
+ }, me = () => {
158
+ let e = h(O);
162
159
  return C(e), e;
163
- }, me = ({ children: e, language: t }) => {
164
- let [n, r] = fe(t);
165
- return /* @__PURE__ */ x(k.Provider, {
160
+ }, he = ({ children: e, language: t }) => {
161
+ let [n, r] = pe(t);
162
+ return /* @__PURE__ */ x(O.Provider, {
166
163
  value: {
167
164
  language: n,
168
165
  setLanguage: r
169
166
  },
170
167
  children: e
171
168
  });
172
- }, he = p({
169
+ }, ge = p({
173
170
  addItems: () => {},
174
171
  getItemsForPath: () => [],
175
172
  getMFNavigate: () => void 0,
176
173
  setMFNavigate: () => {},
177
174
  getItemGroupsPerPath: () => ({})
178
- }), ge = (e) => h(he).getItemsForPath(e), _e = () => h(he), ve = (e) => {
179
- let { getMFNavigate: t } = _e();
175
+ }), _e = (e) => h(ge).getItemsForPath(e), ve = () => h(ge), ye = (e) => {
176
+ let { getMFNavigate: t } = ve();
180
177
  return t(e);
181
- }, ye = ({ children: e }) => {
178
+ }, be = ({ children: e }) => {
182
179
  let [t, n] = y({}), [r, i] = y({}), a = m((e, t) => {
183
180
  n((n) => ({
184
181
  ...n,
@@ -188,7 +185,7 @@ var te = ({ children: e, decorateUser: i, getReturnPath: l, isPublicView: u }) =
188
185
  items: e
189
186
  }));
190
187
  }, []);
191
- return /* @__PURE__ */ x(he.Provider, {
188
+ return /* @__PURE__ */ x(ge.Provider, {
192
189
  value: {
193
190
  addItems: a,
194
191
  getItemGroupsPerPath: () => t,
@@ -204,47 +201,47 @@ var te = ({ children: e, decorateUser: i, getReturnPath: l, isPublicView: u }) =
204
201
  };
205
202
  //#endregion
206
203
  //#region src/MicroFrontendLink.tsx
207
- function be(e) {
204
+ function xe(e) {
208
205
  return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
209
206
  }
210
- var xe = ({ navigate: e, children: t, onClick: n, target: r, ...i }) => /* @__PURE__ */ x("a", {
207
+ var Se = ({ navigate: e, children: t, onClick: n, target: r, ...i }) => /* @__PURE__ */ x("a", {
211
208
  onClick: (t) => {
212
209
  try {
213
210
  n && n(t);
214
211
  } catch (e) {
215
212
  throw t.preventDefault(), e;
216
213
  }
217
- !t.defaultPrevented && t.button === 0 && (!r || r === "_self") && !be(t) && (t.preventDefault(), e());
214
+ !t.defaultPrevented && t.button === 0 && (!r || r === "_self") && !xe(t) && (t.preventDefault(), e());
218
215
  },
219
216
  target: r,
220
217
  ...i,
221
218
  children: t
222
- }), Se = p(void 0), Ce = () => {
223
- let e = h(Se);
219
+ }), Ce = p(void 0), we = () => {
220
+ let e = h(Ce);
224
221
  return C(e), e;
225
- }, we = () => {
226
- let e = h(Se);
222
+ }, Te = () => {
223
+ let e = h(Ce);
227
224
  return C(e), e.organisationId;
228
- }, Te = (e) => {
225
+ }, Ee = (e) => {
229
226
  let [t, n] = y(Number(e));
230
227
  return g(() => {
231
- ne.set(t.toString());
228
+ E.set(t.toString());
232
229
  }, [t]), [t, n];
233
- }, Ee = ({ children: e, organisationId: t }) => {
234
- let [n, r] = Te(t);
235
- return /* @__PURE__ */ x(Se.Provider, {
230
+ }, De = ({ children: e, organisationId: t }) => {
231
+ let [n, r] = Ee(t);
232
+ return /* @__PURE__ */ x(Ce.Provider, {
236
233
  value: {
237
234
  organisationId: n,
238
235
  setOrganisationId: r
239
236
  },
240
237
  children: e
241
238
  });
242
- }, De = class extends Error {
239
+ }, Oe = class extends Error {
243
240
  constructor(...e) {
244
241
  super(...e), this.message = "Failed fetching organisations";
245
242
  }
246
- }, Oe = ({ getToken: e, getOrganisations: t, selectedOrganisationId: n, onChange: r, ...a }) => {
247
- let [o, s] = y([]), { language: c } = pe(), [l, d] = y("LOADING");
243
+ }, ke = ({ getToken: e, getOrganisations: t, selectedOrganisationId: n, onChange: r, ...a }) => {
244
+ let [o, s] = y([]), { language: c } = me(), [l, d] = y("LOADING");
248
245
  switch (g(() => {
249
246
  (async () => {
250
247
  let n = await e(), r;
@@ -267,18 +264,18 @@ var xe = ({ navigate: e, children: t, onClick: n, target: r, ...i }) => /* @__PU
267
264
  onChange: r,
268
265
  ...a
269
266
  });
270
- case "ERROR": throw new De();
267
+ case "ERROR": throw new Oe();
271
268
  default: return null;
272
269
  }
273
- }, A = typeof window < "u" ? window : void 0, j = typeof globalThis < "u" ? globalThis : A;
274
- typeof self > "u" && (j.self = j), typeof File > "u" && (j.File = function() {});
275
- var ke = j?.navigator, M = j?.document, Ae = j?.location, je = j?.fetch, Me = j != null && j.XMLHttpRequest && "withCredentials" in new j.XMLHttpRequest() ? j.XMLHttpRequest : void 0, Ne = j?.AbortController, Pe = j?.CompressionStream, Fe = ke?.userAgent, N = A ?? {}, Ie = "1.372.6", P = {
270
+ }, k = typeof window < "u" ? window : void 0, A = typeof globalThis < "u" ? globalThis : k;
271
+ typeof self > "u" && (A.self = A), typeof File > "u" && (A.File = function() {});
272
+ var Ae = A?.navigator, j = A?.document, je = A?.location, Me = A?.fetch, Ne = A != null && A.XMLHttpRequest && "withCredentials" in new A.XMLHttpRequest() ? A.XMLHttpRequest : void 0, Pe = A?.AbortController, Fe = A?.CompressionStream, Ie = Ae?.userAgent, M = k ?? {}, Le = "1.372.6", N = {
276
273
  DEBUG: !1,
277
- LIB_VERSION: Ie,
274
+ LIB_VERSION: Le,
278
275
  LIB_NAME: "web",
279
- JS_SDK_VERSION: Ie
276
+ JS_SDK_VERSION: Le
280
277
  };
281
- function Le(e, t, n, r, i, a, o) {
278
+ function Re(e, t, n, r, i, a, o) {
282
279
  try {
283
280
  var s = e[a](o), c = s.value;
284
281
  } catch (e) {
@@ -287,31 +284,31 @@ function Le(e, t, n, r, i, a, o) {
287
284
  }
288
285
  s.done ? t(c) : Promise.resolve(c).then(r, i);
289
286
  }
290
- function Re(e) {
287
+ function ze(e) {
291
288
  return function() {
292
289
  var t = this, n = arguments;
293
290
  return new Promise((function(r, i) {
294
291
  var a = e.apply(t, n);
295
292
  function o(e) {
296
- Le(a, r, i, o, s, "next", e);
293
+ Re(a, r, i, o, s, "next", e);
297
294
  }
298
295
  function s(e) {
299
- Le(a, r, i, o, s, "throw", e);
296
+ Re(a, r, i, o, s, "throw", e);
300
297
  }
301
298
  o(void 0);
302
299
  }));
303
300
  };
304
301
  }
305
- function F() {
306
- return F = Object.assign ? Object.assign.bind() : function(e) {
302
+ function P() {
303
+ return P = Object.assign ? Object.assign.bind() : function(e) {
307
304
  for (var t = 1; arguments.length > t; t++) {
308
305
  var n = arguments[t];
309
306
  for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
310
307
  }
311
308
  return e;
312
- }, F.apply(null, arguments);
309
+ }, P.apply(null, arguments);
313
310
  }
314
- function ze(e, t) {
311
+ function Be(e, t) {
315
312
  if (e == null) return {};
316
313
  var n = {};
317
314
  for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
@@ -320,12 +317,12 @@ function ze(e, t) {
320
317
  }
321
318
  return n;
322
319
  }
323
- function Be() {
324
- return Be = Re((function* (e, t, n) {
320
+ function Ve() {
321
+ return Ve = ze((function* (e, t, n) {
325
322
  t === void 0 && (t = !0);
326
323
  try {
327
324
  var r = new CompressionStream("gzip"), i = r.writable.getWriter(), a = i.write(new TextEncoder().encode(e)).then((() => i.close())).catch(function() {
328
- var e = Re((function* (e) {
325
+ var e = ze((function* (e) {
329
326
  try {
330
327
  yield i.abort(e);
331
328
  } catch {}
@@ -340,16 +337,16 @@ function Be() {
340
337
  if (n != null && n.rethrow) throw e;
341
338
  return t && console.error("Failed to gzip compress data", e), null;
342
339
  }
343
- })), Be.apply(this, arguments);
340
+ })), Ve.apply(this, arguments);
344
341
  }
345
- var Ve = /* @__PURE__ */ "amazonbot,amazonproductbot,app.hypefactors.com,applebot,archive.org_bot,awariobot,backlinksextendedbot,baiduspider,bingbot,bingpreview,chrome-lighthouse,dataforseobot,deepscan,duckduckbot,facebookexternal,facebookcatalog,http://yandex.com/bots,hubspot,ia_archiver,leikibot,linkedinbot,meta-externalagent,mj12bot,msnbot,nessus,petalbot,pinterest,prerender,rogerbot,screaming frog,sebot-wa,sitebulb,slackbot,slurp,trendictionbot,turnitin,twitterbot,vercel-screenshot,vercelbot,yahoo! slurp,yandexbot,zoombot,bot.htm,bot.php,(bot;,bot/,crawler,ahrefsbot,ahrefssiteaudit,semrushbot,siteauditbot,splitsignalbot,gptbot,oai-searchbot,chatgpt-user,perplexitybot,better uptime bot,sentryuptimebot,uptimerobot,headlesschrome,cypress,google-hoteladsverifier,adsbot-google,apis-google,duplexweb-google,feedfetcher-google,google favicon,google web preview,google-read-aloud,googlebot,googleother,google-cloudvertexbot,googleweblight,mediapartners-google,storebot-google,google-inspectiontool,bytespider".split(","), He = function(e, t) {
342
+ var He = /* @__PURE__ */ "amazonbot,amazonproductbot,app.hypefactors.com,applebot,archive.org_bot,awariobot,backlinksextendedbot,baiduspider,bingbot,bingpreview,chrome-lighthouse,dataforseobot,deepscan,duckduckbot,facebookexternal,facebookcatalog,http://yandex.com/bots,hubspot,ia_archiver,leikibot,linkedinbot,meta-externalagent,mj12bot,msnbot,nessus,petalbot,pinterest,prerender,rogerbot,screaming frog,sebot-wa,sitebulb,slackbot,slurp,trendictionbot,turnitin,twitterbot,vercel-screenshot,vercelbot,yahoo! slurp,yandexbot,zoombot,bot.htm,bot.php,(bot;,bot/,crawler,ahrefsbot,ahrefssiteaudit,semrushbot,siteauditbot,splitsignalbot,gptbot,oai-searchbot,chatgpt-user,perplexitybot,better uptime bot,sentryuptimebot,uptimerobot,headlesschrome,cypress,google-hoteladsverifier,adsbot-google,apis-google,duplexweb-google,feedfetcher-google,google favicon,google web preview,google-read-aloud,googlebot,googleother,google-cloudvertexbot,googleweblight,mediapartners-google,storebot-google,google-inspectiontool,bytespider".split(","), Ue = function(e, t) {
346
343
  if (t === void 0 && (t = []), !e) return !1;
347
344
  var n = e.toLowerCase();
348
- return Ve.concat(t).some(((e) => {
345
+ return He.concat(t).some(((e) => {
349
346
  var t = e.toLowerCase();
350
347
  return n.indexOf(t) !== -1;
351
348
  }));
352
- }, Ue = [
349
+ }, We = [
353
350
  "$snapshot",
354
351
  "$pageview",
355
352
  "$pageleave",
@@ -365,29 +362,29 @@ var Ve = /* @__PURE__ */ "amazonbot,amazonproductbot,app.hypefactors.com,applebo
365
362
  "$feature_enrollment_update",
366
363
  "$feature_flag_called"
367
364
  ];
368
- function I(e, t) {
365
+ function F(e, t) {
369
366
  return e.indexOf(t) !== -1;
370
367
  }
371
- var We = function(e) {
368
+ var Ge = function(e) {
372
369
  return e.trim();
373
- }, Ge = function(e) {
370
+ }, Ke = function(e) {
374
371
  return e.replace(/^\$/, "");
375
- }, Ke = Object.prototype, qe = Ke.hasOwnProperty, Je = Ke.toString, L = Array.isArray || function(e) {
376
- return Je.call(e) === "[object Array]";
377
- }, Ye = (e) => typeof e == "function", R = (e) => e === Object(e) && !L(e), Xe = (e) => {
378
- if (R(e)) {
379
- for (var t in e) if (qe.call(e, t)) return !1;
372
+ }, qe = Object.prototype, Je = qe.hasOwnProperty, Ye = qe.toString, I = Array.isArray || function(e) {
373
+ return Ye.call(e) === "[object Array]";
374
+ }, Xe = (e) => typeof e == "function", L = (e) => e === Object(e) && !I(e), Ze = (e) => {
375
+ if (L(e)) {
376
+ for (var t in e) if (Je.call(e, t)) return !1;
380
377
  return !0;
381
378
  }
382
379
  return !1;
383
- }, z = (e) => e === void 0, B = (e) => Je.call(e) == "[object String]", Ze = (e) => B(e) && e.trim().length === 0, Qe = (e) => e === null, V = (e) => z(e) || Qe(e), $e = (e) => Je.call(e) == "[object Number]" && e == e, et = (e) => $e(e) && e > 0, tt = (e) => Je.call(e) === "[object Boolean]", nt = (e) => e instanceof FormData, rt = (e) => I(Ue, e);
384
- function it(e) {
380
+ }, R = (e) => e === void 0, z = (e) => Ye.call(e) == "[object String]", Qe = (e) => z(e) && e.trim().length === 0, $e = (e) => e === null, B = (e) => R(e) || $e(e), et = (e) => Ye.call(e) == "[object Number]" && e == e, tt = (e) => et(e) && e > 0, nt = (e) => Ye.call(e) === "[object Boolean]", rt = (e) => e instanceof FormData, it = (e) => F(We, e);
381
+ function at(e) {
385
382
  return typeof e != "object" || !e;
386
383
  }
387
- function at(e, t) {
384
+ function ot(e, t) {
388
385
  return {}.toString.call(e) === "[object " + t + "]";
389
386
  }
390
- function ot(e) {
387
+ function st(e) {
391
388
  return typeof Event < "u" && function(e, t) {
392
389
  try {
393
390
  return e instanceof t;
@@ -396,25 +393,25 @@ function ot(e) {
396
393
  }
397
394
  }(e, Event);
398
395
  }
399
- var st = [
396
+ var ct = [
400
397
  !0,
401
398
  "true",
402
399
  1,
403
400
  "1",
404
401
  "yes"
405
- ], ct = (e) => I(st, e), lt = [
402
+ ], lt = (e) => F(ct, e), ut = [
406
403
  !1,
407
404
  "false",
408
405
  0,
409
406
  "0",
410
407
  "no"
411
408
  ];
412
- function ut(e, t, n, r, i) {
413
- return t > n && (r.warn("min cannot be greater than max."), t = n), $e(e) ? e > n ? (r.warn(" cannot be greater than max: " + n + ". Using max value instead."), n) : t > e ? (r.warn(" cannot be less than min: " + t + ". Using min value instead."), t) : e : (r.warn(" must be a number. using max or fallback. max: " + n + ", fallback: " + i), ut(i || n, t, n, r));
409
+ function dt(e, t, n, r, i) {
410
+ return t > n && (r.warn("min cannot be greater than max."), t = n), et(e) ? e > n ? (r.warn(" cannot be greater than max: " + n + ". Using max value instead."), n) : t > e ? (r.warn(" cannot be less than min: " + t + ". Using min value instead."), t) : e : (r.warn(" must be a number. using max or fallback. max: " + n + ", fallback: " + i), dt(i || n, t, n, r));
414
411
  }
415
- var dt = class {
412
+ var ft = class {
416
413
  constructor(e) {
417
- this.$t = {}, this.zt = e.zt, this.Ut = ut(e.bucketSize, 0, 100, e.Gt), this.Wt = ut(e.refillRate, 0, this.Ut, e.Gt), this.Xt = ut(e.refillInterval, 0, 864e5, e.Gt);
414
+ this.$t = {}, this.zt = e.zt, this.Ut = dt(e.bucketSize, 0, 100, e.Gt), this.Wt = dt(e.refillRate, 0, this.Ut, e.Gt), this.Xt = dt(e.refillInterval, 0, 864e5, e.Gt);
418
415
  }
419
416
  Jt(e, t) {
420
417
  var n = Math.floor((t - e.lastAccess) / this.Xt);
@@ -430,7 +427,7 @@ var dt = class {
430
427
  stop() {
431
428
  this.$t = {};
432
429
  }
433
- }, ft, pt, mt, ht = (e, t, n) => {
430
+ }, pt, mt, ht, gt = (e, t, n) => {
434
431
  function r(r) {
435
432
  for (var i = arguments.length, a = Array(i > 1 ? i - 1 : 0), o = 1; i > o; o++) a[o - 1] = arguments[o];
436
433
  t((() => {
@@ -458,9 +455,9 @@ var dt = class {
458
455
  for (var t = arguments.length, r = Array(t), i = 0; t > i; i++) r[i] = arguments[i];
459
456
  n.error(e, ...r);
460
457
  },
461
- createLogger: (r) => ht(e + " " + r, t, n)
458
+ createLogger: (r) => gt(e + " " + r, t, n)
462
459
  };
463
- }, gt = "Mobile", _t = "iOS", vt = "Android", yt = "Tablet", bt = vt + " " + yt, xt = "iPad", St = "Apple", Ct = St + " Watch", wt = "Safari", Tt = "BlackBerry", Et = "Samsung", Dt = Et + "Browser", Ot = Et + " Internet", kt = "Chrome", At = kt + " OS", jt = kt + " " + _t, Mt = "Internet Explorer", Nt = Mt + " " + gt, Pt = "Opera", Ft = Pt + " Mini", It = "Edge", Lt = "Microsoft " + It, Rt = "Firefox", zt = Rt + " " + _t, Bt = "Nintendo", Vt = "PlayStation", Ht = "Xbox", Ut = vt + " " + gt, Wt = gt + " " + wt, Gt = "Windows", Kt = Gt + " Phone", qt = "Nokia", Jt = "Ouya", Yt = "Generic", Xt = Yt + " " + gt.toLowerCase(), Zt = Yt + " " + yt.toLowerCase(), Qt = "Konqueror", H = "(\\d+(\\.\\d+)?)", $t = RegExp("Version/" + H), en = new RegExp(Ht, "i"), tn = RegExp(Vt + " \\w+", "i"), nn = RegExp(Bt + " \\w+", "i"), rn = RegExp(Tt + "|PlayBook|BB10", "i"), an = {
460
+ }, V = "Mobile", _t = "iOS", vt = "Android", yt = "Tablet", bt = vt + " " + yt, xt = "iPad", St = "Apple", Ct = St + " Watch", wt = "Safari", Tt = "BlackBerry", Et = "Samsung", Dt = Et + "Browser", Ot = Et + " Internet", kt = "Chrome", At = kt + " OS", jt = kt + " " + _t, Mt = "Internet Explorer", Nt = Mt + " " + V, Pt = "Opera", Ft = Pt + " Mini", It = "Edge", Lt = "Microsoft " + It, Rt = "Firefox", zt = Rt + " " + _t, Bt = "Nintendo", Vt = "PlayStation", Ht = "Xbox", Ut = vt + " " + V, Wt = V + " " + wt, Gt = "Windows", Kt = Gt + " Phone", qt = "Nokia", Jt = "Ouya", Yt = "Generic", Xt = Yt + " " + V.toLowerCase(), Zt = Yt + " " + yt.toLowerCase(), Qt = "Konqueror", H = "(\\d+(\\.\\d+)?)", $t = RegExp("Version/" + H), en = new RegExp(Ht, "i"), tn = RegExp(Vt + " \\w+", "i"), nn = RegExp(Bt + " \\w+", "i"), rn = RegExp(Tt + "|PlayBook|BB10", "i"), an = {
464
461
  "NT3.51": "NT 3.11",
465
462
  "NT4.0": "NT 4.0",
466
463
  "5.0": "2000",
@@ -473,9 +470,9 @@ var dt = class {
473
470
  6.4: "10",
474
471
  "10.0": "10"
475
472
  }, on = function(e, t) {
476
- return t ||= "", I(e, " OPR/") && I(e, "Mini") ? Ft : I(e, " OPR/") ? Pt : rn.test(e) ? Tt : I(e, "IE" + gt) || I(e, "WPDesktop") ? Nt : I(e, Dt) ? Ot : I(e, It) || I(e, "Edg/") ? Lt : I(e, "FBIOS") ? "Facebook " + gt : I(e, "UCWEB") || I(e, "UCBrowser") ? "UC Browser" : I(e, "CriOS") ? jt : I(e, "CrMo") || I(e, kt) ? kt : I(e, vt) && I(e, wt) ? Ut : I(e, "FxiOS") ? zt : I(e.toLowerCase(), Qt.toLowerCase()) ? Qt : ((e, t) => t && I(t, St) || function(e) {
477
- return I(e, wt) && !I(e, kt) && !I(e, vt);
478
- }(e))(e, t) ? I(e, gt) ? Wt : wt : I(e, Rt) ? Rt : I(e, "MSIE") || I(e, "Trident/") ? Mt : I(e, "Gecko") ? Rt : "";
473
+ return t ||= "", F(e, " OPR/") && F(e, "Mini") ? Ft : F(e, " OPR/") ? Pt : rn.test(e) ? Tt : F(e, "IE" + V) || F(e, "WPDesktop") ? Nt : F(e, Dt) ? Ot : F(e, It) || F(e, "Edg/") ? Lt : F(e, "FBIOS") ? "Facebook " + V : F(e, "UCWEB") || F(e, "UCBrowser") ? "UC Browser" : F(e, "CriOS") ? jt : F(e, "CrMo") || F(e, kt) ? kt : F(e, vt) && F(e, wt) ? Ut : F(e, "FxiOS") ? zt : F(e.toLowerCase(), Qt.toLowerCase()) ? Qt : ((e, t) => t && F(t, St) || function(e) {
474
+ return F(e, wt) && !F(e, kt) && !F(e, vt);
475
+ }(e))(e, t) ? F(e, V) ? Wt : wt : F(e, Rt) ? Rt : F(e, "MSIE") || F(e, "Trident/") ? Mt : F(e, "Gecko") ? Rt : "";
479
476
  }, sn = {
480
477
  [Nt]: [RegExp("rv:" + H)],
481
478
  [Lt]: [RegExp(It + "?\\/" + H)],
@@ -495,7 +492,7 @@ var dt = class {
495
492
  Mozilla: [RegExp("rv:" + H)]
496
493
  }, cn = function(e, t) {
497
494
  var n = sn[on(e, t)];
498
- if (z(n)) return null;
495
+ if (R(n)) return null;
499
496
  for (var r = 0; n.length > r; r++) {
500
497
  var i = e.match(n[r]);
501
498
  if (i) return parseFloat(i[i.length - 2]);
@@ -508,7 +505,7 @@ var dt = class {
508
505
  [rn, [Tt, ""]],
509
506
  [new RegExp(Gt, "i"), (e, t) => {
510
507
  if (/Phone/.test(t) || /WPDesktop/.test(t)) return [Kt, ""];
511
- if (new RegExp(gt).test(t) && !/IEMobile\b/.test(t)) return [Gt + " " + gt, ""];
508
+ if (new RegExp(V).test(t) && !/IEMobile\b/.test(t)) return [Gt + " " + V, ""];
512
509
  var n = /Windows NT ([0-9.]+)/i.exec(t);
513
510
  if (n && n[1]) {
514
511
  var r = an[n[1]] || "";
@@ -523,7 +520,7 @@ var dt = class {
523
520
  ].join(".")] : [_t, ""]],
524
521
  [/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i, (e) => {
525
522
  var t = "";
526
- return e && e.length >= 3 && (t = z(e[2]) ? e[3] : e[2]), ["watchOS", t];
523
+ return e && e.length >= 3 && (t = R(e[2]) ? e[3] : e[2]), ["watchOS", t];
527
524
  }],
528
525
  [RegExp("(" + vt + " (\\d+)\\.(\\d+)\\.?(\\d+)?|" + vt + ")", "i"), (e) => e && e[2] ? [vt, [
529
526
  e[2],
@@ -542,7 +539,7 @@ var dt = class {
542
539
  [/CrOS/, [At, ""]],
543
540
  [/Linux|debian/i, ["Linux", ""]]
544
541
  ], un = function(e) {
545
- return nn.test(e) ? Bt : tn.test(e) ? Vt : en.test(e) ? Ht : new RegExp(Jt, "i").test(e) ? Jt : RegExp("(" + Kt + "|WPDesktop)", "i").test(e) ? Kt : /iPad/.test(e) ? xt : /iPod/.test(e) ? "iPod Touch" : /iPhone/.test(e) ? "iPhone" : /(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e) ? Ct : rn.test(e) ? Tt : /(kobo)\s(ereader|touch)/i.test(e) ? "Kobo" : new RegExp(qt, "i").test(e) ? qt : /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e) || /(kf[a-z]+)( bui|\)).+silk\//i.test(e) ? "Kindle Fire" : /(Android|ZTE)/i.test(e) ? new RegExp(gt).test(e) && !/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e) || /pixel[\daxl ]{1,6}/i.test(e) && !/pixel c/i.test(e) || /(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e) || /lmy47v/i.test(e) && !/QTAQZ3/i.test(e) ? vt : bt : RegExp("(pda|" + gt + ")", "i").test(e) ? Xt : new RegExp(yt, "i").test(e) && !RegExp(yt + " pc", "i").test(e) ? Zt : "";
542
+ return nn.test(e) ? Bt : tn.test(e) ? Vt : en.test(e) ? Ht : new RegExp(Jt, "i").test(e) ? Jt : RegExp("(" + Kt + "|WPDesktop)", "i").test(e) ? Kt : /iPad/.test(e) ? xt : /iPod/.test(e) ? "iPod Touch" : /iPhone/.test(e) ? "iPhone" : /(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e) ? Ct : rn.test(e) ? Tt : /(kobo)\s(ereader|touch)/i.test(e) ? "Kobo" : new RegExp(qt, "i").test(e) ? qt : /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e) || /(kf[a-z]+)( bui|\)).+silk\//i.test(e) ? "Kindle Fire" : /(Android|ZTE)/i.test(e) ? new RegExp(V).test(e) && !/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e) || /pixel[\daxl ]{1,6}/i.test(e) && !/pixel c/i.test(e) || /(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e) || /lmy47v/i.test(e) && !/QTAQZ3/i.test(e) ? vt : bt : RegExp("(pda|" + V + ")", "i").test(e) ? Xt : new RegExp(yt, "i").test(e) && !RegExp(yt + " pc", "i").test(e) ? Zt : "";
546
543
  }, dn = (e) => e instanceof Error, fn = {
547
544
  trace: {
548
545
  text: "TRACE",
@@ -570,10 +567,10 @@ var dt = class {
570
567
  }
571
568
  }, pn = fn.info;
572
569
  function mn(e) {
573
- if (tt(e)) return { boolValue: e };
570
+ if (nt(e)) return { boolValue: e };
574
571
  if (typeof e == "number") return Number.isFinite(e) ? Number.isInteger(e) ? { intValue: e } : { doubleValue: e } : { stringValue: String(e) };
575
572
  if (typeof e == "string") return { stringValue: e };
576
- if (L(e)) return { arrayValue: { values: e.map(((e) => mn(e))) } };
573
+ if (I(e)) return { arrayValue: { values: e.map(((e) => mn(e))) } };
577
574
  try {
578
575
  return { stringValue: JSON.stringify(e) };
579
576
  } catch {
@@ -584,7 +581,7 @@ function hn(e) {
584
581
  var t = [];
585
582
  for (var n in e) {
586
583
  var r = e[n];
587
- Qe(r) || z(r) || t.push({
584
+ $e(r) || R(r) || t.push({
588
585
  key: n,
589
586
  value: mn(r)
590
587
  });
@@ -595,19 +592,19 @@ function gn(e) {
595
592
  var t = globalThis._posthogChunkIds;
596
593
  if (t) {
597
594
  var n = Object.keys(t);
598
- return mt && n.length === pt || (pt = n.length, mt = n.reduce(((n, r) => {
599
- ft ||= {};
600
- var i = ft[r];
595
+ return ht && n.length === mt || (mt = n.length, ht = n.reduce(((n, r) => {
596
+ pt ||= {};
597
+ var i = pt[r];
601
598
  if (i) n[i[0]] = i[1];
602
599
  else for (var a = e(r), o = a.length - 1; o >= 0; o--) {
603
600
  var s = a[o]?.filename, c = t[r];
604
601
  if (s && c) {
605
- n[s] = c, ft[r] = [s, c];
602
+ n[s] = c, pt[r] = [s, c];
606
603
  break;
607
604
  }
608
605
  }
609
606
  return n;
610
- }), {})), mt;
607
+ }), {})), ht;
611
608
  }
612
609
  }
613
610
  var _n = class {
@@ -627,8 +624,8 @@ var _n = class {
627
624
  }
628
625
  modifyFrames(e) {
629
626
  var t = this;
630
- return Re((function* () {
631
- for (var n of e) n.stacktrace && n.stacktrace.frames && L(n.stacktrace.frames) && (n.stacktrace.frames = yield t.applyModifiers(n.stacktrace.frames));
627
+ return ze((function* () {
628
+ for (var n of e) n.stacktrace && n.stacktrace.frames && I(n.stacktrace.frames) && (n.stacktrace.frames = yield t.applyModifiers(n.stacktrace.frames));
632
629
  return e;
633
630
  }))();
634
631
  }
@@ -642,7 +639,7 @@ var _n = class {
642
639
  }
643
640
  parseStacktrace(e, t) {
644
641
  var n, r;
645
- return e.cause != null && (n = this.parseStacktrace(e.cause, t)), e.stack != "" && e.stack != null && (r = this.applyChunkIds(this.stackParser(e.stack, e.synthetic ? t.skipFirstLines : 0), t.chunkIdMap)), F({}, e, {
642
+ return e.cause != null && (n = this.parseStacktrace(e.cause, t)), e.stack != "" && e.stack != null && (r = this.applyChunkIds(this.stackParser(e.stack, e.synthetic ? t.skipFirstLines : 0), t.chunkIdMap)), P({}, e, {
646
643
  cause: n,
647
644
  stack: r
648
645
  });
@@ -656,7 +653,7 @@ var _n = class {
656
653
  }
657
654
  applyModifiers(e) {
658
655
  var t = this;
659
- return Re((function* () {
656
+ return ze((function* () {
660
657
  var n = e;
661
658
  for (var r of t.modifiers) n = yield r(n);
662
659
  return n;
@@ -677,7 +674,7 @@ var _n = class {
677
674
  frames: e.stack
678
675
  });
679
676
  var a = [i];
680
- return e.cause != null && a.push(...this.convertToExceptionList(e.cause, F({}, t, { handled: !0 }))), a;
677
+ return e.cause != null && a.push(...this.convertToExceptionList(e.cause, P({}, t, { handled: !0 }))), a;
681
678
  }
682
679
  buildParsingContext(e) {
683
680
  return {
@@ -693,7 +690,7 @@ var _n = class {
693
690
  return this.applyCoercers(n, i);
694
691
  }
695
692
  };
696
- return F({}, t, {
693
+ return P({}, t, {
697
694
  syntheticException: n == 0 ? t.syntheticException : void 0,
698
695
  mechanism: e,
699
696
  apply: (e) => r(e, n),
@@ -708,7 +705,7 @@ function yn(e, t, n, r, i) {
708
705
  function: n === "<anonymous>" ? vn : n,
709
706
  in_app: !0
710
707
  };
711
- return z(r) || (a.lineno = r), z(i) || (a.colno = i), a;
708
+ return R(r) || (a.lineno = r), R(i) || (a.colno = i), a;
712
709
  }
713
710
  var bn = (e, t) => {
714
711
  var n = e.indexOf("safari-extension") !== -1, r = e.indexOf("safari-web-extension") !== -1;
@@ -743,7 +740,7 @@ var bn = (e, t) => {
743
740
  return this.isDOMException(e) || this.isDOMError(e);
744
741
  }
745
742
  coerce(e, t) {
746
- var n = B(e.stack);
743
+ var n = z(e.stack);
747
744
  return {
748
745
  type: this.getType(e),
749
746
  value: this.getValue(e),
@@ -760,10 +757,10 @@ var bn = (e, t) => {
760
757
  return e.message ? t + ": " + e.message : t;
761
758
  }
762
759
  isDOMException(e) {
763
- return at(e, "DOMException");
760
+ return ot(e, "DOMException");
764
761
  }
765
762
  isDOMError(e) {
766
- return at(e, "DOMError");
763
+ return ot(e, "DOMError");
767
764
  }
768
765
  }, An = class {
769
766
  match(e) {
@@ -791,7 +788,7 @@ var bn = (e, t) => {
791
788
  }, jn = class {
792
789
  constructor() {}
793
790
  match(e) {
794
- return at(e, "ErrorEvent") && e.error != null;
791
+ return ot(e, "ErrorEvent") && e.error != null;
795
792
  }
796
793
  coerce(e, t) {
797
794
  return t.apply(e.error) || {
@@ -851,7 +848,7 @@ var In = class {
851
848
  };
852
849
  }
853
850
  getType(e) {
854
- return ot(e) ? e.constructor.name : "Error";
851
+ return st(e) ? e.constructor.name : "Error";
855
852
  }
856
853
  getValue(e) {
857
854
  if ("name" in e && typeof e.name == "string") {
@@ -863,7 +860,7 @@ var In = class {
863
860
  return (n && n !== "Object" ? "'" + n + "'" : "Object") + " captured as exception with keys: " + Fn(e);
864
861
  }
865
862
  isSeverityLevel(e) {
866
- return B(e) && !Ze(e) && Pn.indexOf(e) >= 0;
863
+ return z(e) && !Qe(e) && Pn.indexOf(e) >= 0;
867
864
  }
868
865
  getErrorPropertyFromObject(e) {
869
866
  for (var t in e) if ({}.hasOwnProperty.call(e, t)) {
@@ -881,7 +878,7 @@ var In = class {
881
878
  }
882
879
  }, Ln = class {
883
880
  match(e) {
884
- return ot(e);
881
+ return st(e);
885
882
  }
886
883
  coerce(e, t) {
887
884
  var n = e.constructor.name;
@@ -894,7 +891,7 @@ var In = class {
894
891
  }
895
892
  }, Rn = class {
896
893
  match(e) {
897
- return it(e);
894
+ return at(e);
898
895
  }
899
896
  coerce(e, t) {
900
897
  return {
@@ -906,10 +903,10 @@ var In = class {
906
903
  }
907
904
  }, zn = class {
908
905
  match(e) {
909
- return at(e, "PromiseRejectionEvent") || this.isCustomEventWrappingRejection(e);
906
+ return ot(e, "PromiseRejectionEvent") || this.isCustomEventWrappingRejection(e);
910
907
  }
911
908
  isCustomEventWrappingRejection(e) {
912
- if (!ot(e)) return !1;
909
+ if (!st(e)) return !1;
913
910
  try {
914
911
  var t = e.detail;
915
912
  return typeof t == "object" && !!t && "reason" in t;
@@ -919,7 +916,7 @@ var In = class {
919
916
  }
920
917
  coerce(e, t) {
921
918
  var n = this.getUnhandledRejectionReason(e);
922
- return it(n) ? {
919
+ return at(n) ? {
923
920
  type: "UnhandledRejection",
924
921
  value: "Non-Error promise rejection captured with value: " + String(n),
925
922
  stack: t.syntheticException?.stack,
@@ -941,7 +938,7 @@ function Wn(e) {
941
938
  return e ? {
942
939
  enabled: e.enabled ?? Un.enabled,
943
940
  max_bytes: Kn(e.max_bytes, Un.max_bytes)
944
- } : F({}, Un);
941
+ } : P({}, Un);
945
942
  }
946
943
  var Gn = class {
947
944
  constructor(e) {
@@ -977,9 +974,9 @@ var Gn = class {
977
974
  }(e);
978
975
  if (t) try {
979
976
  var n = JSON.parse(t);
980
- if (!R(n)) return;
977
+ if (!L(n)) return;
981
978
  var r = n, i = r[Bn], a = r[Vn];
982
- return !B(i) || i.trim().length === 0 || !B(a) && !$e(a) ? void 0 : {
979
+ return !z(i) || i.trim().length === 0 || !z(a) && !et(a) ? void 0 : {
983
980
  step: r,
984
981
  json: t
985
982
  };
@@ -1016,15 +1013,15 @@ var Gn = class {
1016
1013
  }
1017
1014
  };
1018
1015
  function Kn(e, t) {
1019
- if (!$e(e) || e === Infinity || e === -Infinity) return t;
1016
+ if (!et(e) || e === Infinity || e === -Infinity) return t;
1020
1017
  var n = Math.floor(e);
1021
1018
  return 0 > n ? t : n;
1022
1019
  }
1023
1020
  var qn = function(e, t) {
1024
1021
  var { debugEnabled: n } = t === void 0 ? {} : t, r = {
1025
1022
  C(t) {
1026
- if (A && (P.DEBUG || N.POSTHOG_DEBUG || n) && !z(A.console) && A.console) {
1027
- for (var r = ("__rrweb_original__" in A.console[t]) ? A.console[t].__rrweb_original__ : A.console[t], i = arguments.length, a = Array(i > 1 ? i - 1 : 0), o = 1; i > o; o++) a[o - 1] = arguments[o];
1023
+ if (k && (N.DEBUG || M.POSTHOG_DEBUG || n) && !R(k.console) && k.console) {
1024
+ for (var r = ("__rrweb_original__" in k.console[t]) ? k.console[t].__rrweb_original__ : k.console[t], i = arguments.length, a = Array(i > 1 ? i - 1 : 0), o = 1; i > o; o++) a[o - 1] = arguments[o];
1028
1025
  r(e, ...a);
1029
1026
  }
1030
1027
  },
@@ -1056,7 +1053,7 @@ var qn = function(e, t) {
1056
1053
  return r;
1057
1054
  }, U = qn("[PostHog.js]"), W = U.createLogger, Jn = W("[ExternalScriptsLoader]"), Yn = (e, t, n) => {
1058
1055
  if (e.config.disable_external_dependency_loading) return Jn.warn(t + " was requested but loading of external scripts is disabled."), n("Loading of external scripts is disabled");
1059
- var r = M?.querySelectorAll("script");
1056
+ var r = j?.querySelectorAll("script");
1060
1057
  if (r) {
1061
1058
  for (var i, a = function() {
1062
1059
  if (r[o].src === t) {
@@ -1068,20 +1065,20 @@ var qn = function(e, t) {
1068
1065
  }, o = 0; r.length > o; o++) if (i = a()) return i.v;
1069
1066
  }
1070
1067
  var s = () => {
1071
- if (!M) return n("document not found");
1072
- var r = M.createElement("script");
1068
+ if (!j) return n("document not found");
1069
+ var r = j.createElement("script");
1073
1070
  if (r.type = "text/javascript", r.crossOrigin = "anonymous", r.src = t, r.onload = (e) => {
1074
1071
  r.__posthog_loading_callback_fired = !0, n(void 0, e);
1075
1072
  }, r.onerror = (e) => n(e), e.config.prepare_external_dependency_script && (r = e.config.prepare_external_dependency_script(r)), !r) return n("prepare_external_dependency_script returned null");
1076
- if (e.config.external_scripts_inject_target === "head") M.head.appendChild(r);
1073
+ if (e.config.external_scripts_inject_target === "head") j.head.appendChild(r);
1077
1074
  else {
1078
- var i, a = M.querySelectorAll("body > script");
1079
- a.length > 0 ? (i = a[0].parentNode) == null || i.insertBefore(r, a[0]) : M.body.appendChild(r);
1075
+ var i, a = j.querySelectorAll("body > script");
1076
+ a.length > 0 ? (i = a[0].parentNode) == null || i.insertBefore(r, a[0]) : j.body.appendChild(r);
1080
1077
  }
1081
1078
  };
1082
- M != null && M.body ? s() : M?.addEventListener("DOMContentLoaded", s);
1079
+ j != null && j.body ? s() : j?.addEventListener("DOMContentLoaded", s);
1083
1080
  };
1084
- N.__PosthogExtensions__ = N.__PosthogExtensions__ || {}, N.__PosthogExtensions__.loadExternalDependency = (e, t, n) => {
1081
+ M.__PosthogExtensions__ = M.__PosthogExtensions__ || {}, M.__PosthogExtensions__.loadExternalDependency = (e, t, n) => {
1085
1082
  if (t !== "remote-config") {
1086
1083
  var r;
1087
1084
  if (e.config.__preview_external_dependency_versioned_paths) r = e.requestRouter.endpointFor("assets", "/static/" + e.version + "/" + t + ".js");
@@ -1095,17 +1092,17 @@ N.__PosthogExtensions__ = N.__PosthogExtensions__ || {}, N.__PosthogExtensions__
1095
1092
  }
1096
1093
  Yn(e, r, n);
1097
1094
  } else Yn(e, e.requestRouter.endpointFor("assets", "/array/" + e.config.token + "/config.js"), n);
1098
- }, N.__PosthogExtensions__.loadSiteApp = (e, t, n) => {
1095
+ }, M.__PosthogExtensions__.loadSiteApp = (e, t, n) => {
1099
1096
  Yn(e, e.requestRouter.endpointFor("api", t), n);
1100
1097
  };
1101
1098
  var Xn = "$people_distinct_id", Zn = "$device_id", Qn = "__alias", $n = "__timers", er = "$autocapture_disabled_server_side", tr = "$heatmaps_enabled_server_side", nr = "$exception_capture_enabled_server_side", rr = "$error_tracking_suppression_rules", ir = "$error_tracking_capture_extension_exceptions", ar = "$web_vitals_enabled_server_side", or = "$dead_clicks_enabled_server_side", sr = "$product_tours_enabled_server_side", cr = "$web_vitals_allowed_metrics", lr = "$session_recording_remote_config", ur = "$replay_override_sampling", dr = "$replay_override_linked_flag", fr = "$replay_override_url_trigger", pr = "$replay_override_event_trigger", mr = "$sesid", hr = "$session_is_sampled", gr = "$enabled_feature_flags", _r = "$active_feature_flags", vr = "$early_access_features", yr = "$feature_flag_details", br = "$feature_flag_payloads", xr = "$feature_flag_request_id", Sr = "$override_feature_flags", Cr = "$override_feature_flag_payloads", wr = "$stored_person_properties", Tr = "$stored_group_properties", Er = "$surveys", Dr = "$surveys_activated", Or = "ph_product_tours", kr = "$flag_call_reported", Ar = "$flag_call_reported_session_id", jr = "$feature_flag_errors", Mr = "$feature_flag_evaluated_at", Nr = "$user_state", Pr = "$client_session_props", Fr = "$capture_rate_limit", Ir = "$initial_campaign_params", Lr = "$initial_referrer_info", Rr = "$initial_person_info", zr = "$epp", Br = "__POSTHOG_TOOLBAR__", Vr = "$posthog_cookieless", Hr = "$sdk_debug_extensions_init_method", Ur = "$sdk_debug_extensions_init_time_ms", Wr = "$sdk_debug_recording_script_not_loaded", Gr = "PostHog loadExternalDependency extension not found.", Kr = "on_reject", qr = "always", Jr = "anonymous", Yr = "identified", Xr = "identified_only", Zr = "visibilitychange", Qr = "beforeunload", $r = "$pageview", ei = "$pageleave", ti = "$identify", ni = "$groupidentify";
1102
1099
  function ri(e, t) {
1103
- L(e) && e.forEach(t);
1100
+ I(e) && e.forEach(t);
1104
1101
  }
1105
1102
  function G(e, t) {
1106
- if (!V(e)) if (L(e)) e.forEach(t);
1107
- else if (nt(e)) e.forEach(((e, n) => t(e, n)));
1108
- else for (var n in e) qe.call(e, n) && t(e[n], n);
1103
+ if (!B(e)) if (I(e)) e.forEach(t);
1104
+ else if (rt(e)) e.forEach(((e, n) => t(e, n)));
1105
+ else for (var n in e) Je.call(e, n) && t(e[n], n);
1109
1106
  }
1110
1107
  var K = function(e) {
1111
1108
  for (var t = arguments.length, n = Array(t > 1 ? t - 1 : 0), r = 1; t > r; r++) n[r - 1] = arguments[r];
@@ -1134,7 +1131,7 @@ var ai = function(e) {
1134
1131
  }, si = function(e) {
1135
1132
  var t = {};
1136
1133
  return G(e, (function(e, n) {
1137
- (B(e) && e.length > 0 || $e(e)) && (t[n] = e);
1134
+ (z(e) && e.length > 0 || et(e)) && (t[n] = e);
1138
1135
  })), t;
1139
1136
  }, ci = [
1140
1137
  "herokuapp.com",
@@ -1143,7 +1140,7 @@ var ai = function(e) {
1143
1140
  ];
1144
1141
  function li(e) {
1145
1142
  var t = e?.hostname;
1146
- if (!B(t)) return !1;
1143
+ if (!z(t)) return !1;
1147
1144
  var n = t.split(".").slice(-2).join(".");
1148
1145
  for (var r of ci) if (n === r) return !1;
1149
1146
  return !0;
@@ -1161,7 +1158,7 @@ function ui(e) {
1161
1158
  Math.trunc || (Math.trunc = function(e) {
1162
1159
  return 0 > e ? Math.ceil(e) : Math.floor(e);
1163
1160
  }), Number.isInteger || (Number.isInteger = function(e) {
1164
- return $e(e) && isFinite(e) && Math.floor(e) === e;
1161
+ return et(e) && isFinite(e) && Math.floor(e) === e;
1165
1162
  });
1166
1163
  var di = class e {
1167
1164
  constructor(e) {
@@ -1196,10 +1193,10 @@ var di = class e {
1196
1193
  }
1197
1194
  generate() {
1198
1195
  var e = this.generateOrAbort();
1199
- if (z(e)) {
1196
+ if (R(e)) {
1200
1197
  this.I = 0;
1201
1198
  var t = this.generateOrAbort();
1202
- if (z(t)) throw Error("Could not generate UUID after timestamp reset");
1199
+ if (R(t)) throw Error("Could not generate UUID after timestamp reset");
1203
1200
  return t;
1204
1201
  }
1205
1202
  return e;
@@ -1221,7 +1218,7 @@ var di = class e {
1221
1218
  for (var t = 0; e.length > t; t++) e[t] = 65536 * Math.trunc(65536 * Math.random()) + Math.trunc(65536 * Math.random());
1222
1219
  return e;
1223
1220
  };
1224
- A && !z(A.crypto) && crypto.getRandomValues && (mi = (e) => crypto.getRandomValues(e));
1221
+ k && !R(k.crypto) && crypto.getRandomValues && (mi = (e) => crypto.getRandomValues(e));
1225
1222
  var hi = class {
1226
1223
  constructor() {
1227
1224
  this.T = new Uint32Array(8), this.N = Infinity;
@@ -1230,14 +1227,14 @@ var hi = class {
1230
1227
  return this.T.length > this.N || (mi(this.T), this.N = 0), this.T[this.N++];
1231
1228
  }
1232
1229
  }, gi = () => _i().toString(), _i = () => (pi ||= new fi()).generate(), vi = "", yi = /[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i, bi = {
1233
- R: () => !!M,
1230
+ R: () => !!j,
1234
1231
  B(e) {
1235
1232
  U.error("cookieStore error: " + e);
1236
1233
  },
1237
1234
  O(e) {
1238
- if (M) {
1235
+ if (j) {
1239
1236
  try {
1240
- for (var t = e + "=", n = M.cookie.split(";").filter(((e) => e.length)), r = 0; n.length > r; r++) {
1237
+ for (var t = e + "=", n = j.cookie.split(";").filter(((e) => e.length)), r = 0; n.length > r; r++) {
1241
1238
  for (var i = n[r]; i.charAt(0) == " ";) i = i.substring(1, i.length);
1242
1239
  if (i.indexOf(t) === 0) return decodeURIComponent(i.substring(t.length, i.length));
1243
1240
  }
@@ -1253,11 +1250,11 @@ var hi = class {
1253
1250
  return t;
1254
1251
  },
1255
1252
  M(e, t, n, r, i) {
1256
- if (M) try {
1253
+ if (j) try {
1257
1254
  var a = "", o = "", s = function(e, t) {
1258
1255
  if (t) {
1259
1256
  var n = function(e, t) {
1260
- if (t === void 0 && (t = M), vi) return vi;
1257
+ if (t === void 0 && (t = j), vi) return vi;
1261
1258
  if (!t || ["localhost", "127.0.0.1"].includes(e)) return "";
1262
1259
  for (var n = e.split("."), r = Math.min(n.length, 8), i = "dmn_chk_" + gi(); !vi && r--;) {
1263
1260
  var a = n.slice(r).join("."), o = i + "=1;domain=." + a + ";path=/";
@@ -1275,20 +1272,20 @@ var hi = class {
1275
1272
  return n ? "; domain=." + n : "";
1276
1273
  }
1277
1274
  return "";
1278
- }(M.location.hostname, r);
1275
+ }(j.location.hostname, r);
1279
1276
  if (n) {
1280
1277
  var c = /* @__PURE__ */ new Date();
1281
1278
  c.setTime(c.getTime() + 864e5 * n), a = "; expires=" + c.toUTCString();
1282
1279
  }
1283
1280
  i && (o = "; secure");
1284
1281
  var l = e + "=" + encodeURIComponent(JSON.stringify(t)) + a + "; SameSite=Lax; path=/" + s + o;
1285
- return l.length > 3686.4 && U.warn("cookieStore warning: large cookie, len=" + l.length), M.cookie = l, l;
1282
+ return l.length > 3686.4 && U.warn("cookieStore warning: large cookie, len=" + l.length), j.cookie = l, l;
1286
1283
  } catch {
1287
1284
  return;
1288
1285
  }
1289
1286
  },
1290
1287
  F(e, t) {
1291
- if (M != null && M.cookie) try {
1288
+ if (j != null && j.cookie) try {
1292
1289
  bi.M(e, "", -1, t);
1293
1290
  } catch {
1294
1291
  return;
@@ -1296,9 +1293,9 @@ var hi = class {
1296
1293
  }
1297
1294
  }, xi = null, J = {
1298
1295
  R() {
1299
- if (!Qe(xi)) return xi;
1296
+ if (!$e(xi)) return xi;
1300
1297
  var e = !0;
1301
- if (z(A)) e = !1;
1298
+ if (R(k)) e = !1;
1302
1299
  else try {
1303
1300
  var t = "__mplssupport__";
1304
1301
  J.M(t, "xyz"), J.O(t) !== "\"xyz\"" && (e = !1), J.F(t);
@@ -1312,7 +1309,7 @@ var hi = class {
1312
1309
  },
1313
1310
  O(e) {
1314
1311
  try {
1315
- return A?.localStorage.getItem(e);
1312
+ return k?.localStorage.getItem(e);
1316
1313
  } catch (e) {
1317
1314
  J.B(e);
1318
1315
  }
@@ -1326,14 +1323,14 @@ var hi = class {
1326
1323
  },
1327
1324
  M(e, t) {
1328
1325
  try {
1329
- A?.localStorage.setItem(e, JSON.stringify(t));
1326
+ k?.localStorage.setItem(e, JSON.stringify(t));
1330
1327
  } catch (e) {
1331
1328
  J.B(e);
1332
1329
  }
1333
1330
  },
1334
1331
  F(e) {
1335
1332
  try {
1336
- A?.localStorage.removeItem(e);
1333
+ k?.localStorage.removeItem(e);
1337
1334
  } catch (e) {
1338
1335
  J.B(e);
1339
1336
  }
@@ -1361,8 +1358,8 @@ var hi = class {
1361
1358
  }
1362
1359
  }, Ti = null, Y = {
1363
1360
  R() {
1364
- if (!Qe(Ti)) return Ti;
1365
- if (Ti = !0, z(A)) Ti = !1;
1361
+ if (!$e(Ti)) return Ti;
1362
+ if (Ti = !0, R(k)) Ti = !1;
1366
1363
  else try {
1367
1364
  var e = "__support__";
1368
1365
  Y.M(e, "xyz"), Y.O(e) !== "\"xyz\"" && (Ti = !1), Y.F(e);
@@ -1376,7 +1373,7 @@ var hi = class {
1376
1373
  },
1377
1374
  O(e) {
1378
1375
  try {
1379
- return A?.sessionStorage.getItem(e);
1376
+ return k?.sessionStorage.getItem(e);
1380
1377
  } catch (e) {
1381
1378
  Y.B(e);
1382
1379
  }
@@ -1390,14 +1387,14 @@ var hi = class {
1390
1387
  },
1391
1388
  M(e, t) {
1392
1389
  try {
1393
- A?.sessionStorage.setItem(e, JSON.stringify(t));
1390
+ k?.sessionStorage.setItem(e, JSON.stringify(t));
1394
1391
  } catch (e) {
1395
1392
  Y.B(e);
1396
1393
  }
1397
1394
  },
1398
1395
  F(e) {
1399
1396
  try {
1400
- A?.sessionStorage.removeItem(e);
1397
+ k?.sessionStorage.removeItem(e);
1401
1398
  } catch (e) {
1402
1399
  Y.B(e);
1403
1400
  }
@@ -1436,27 +1433,27 @@ var hi = class {
1436
1433
  }
1437
1434
  get ir() {
1438
1435
  var e = this.nr.O(this.sr);
1439
- return ct(e) ? 1 : I(lt, e) ? 0 : -1;
1436
+ return lt(e) ? 1 : F(ut, e) ? 0 : -1;
1440
1437
  }
1441
1438
  get nr() {
1442
1439
  var e = this.Bt.opt_out_capturing_persistence_type, t = e === "localStorage" ? J : bi;
1443
1440
  if (!this.ar || this.ar !== t) {
1444
1441
  this.ar = t;
1445
1442
  var n = e === "localStorage" ? bi : J;
1446
- n.O(this.sr) && (this.ar.O(this.sr) || this.optInOut(ct(n.O(this.sr))), n.F(this.sr, this.Bt.cross_subdomain_cookie));
1443
+ n.O(this.sr) && (this.ar.O(this.sr) || this.optInOut(lt(n.O(this.sr))), n.F(this.sr, this.Bt.cross_subdomain_cookie));
1447
1444
  }
1448
1445
  return this.ar;
1449
1446
  }
1450
1447
  rr() {
1451
1448
  return !!this.Bt.respect_dnt && [
1452
- ke?.doNotTrack,
1453
- ke?.msDoNotTrack,
1454
- N.doNotTrack
1455
- ].some(((e) => ct(e)));
1449
+ Ae?.doNotTrack,
1450
+ Ae?.msDoNotTrack,
1451
+ M.doNotTrack
1452
+ ].some(((e) => lt(e)));
1456
1453
  }
1457
1454
  }, Di = W("[Dead Clicks]"), Oi = () => !0, ki = (e) => {
1458
1455
  var t, n = !((t = e.instance.persistence) == null || !t.get_property(or)), r = e.instance.config.capture_dead_clicks;
1459
- return tt(r) ? r : !!R(r) || n;
1456
+ return nt(r) ? r : !!L(r) || n;
1460
1457
  }, Ai = class {
1461
1458
  get lazyLoadedDeadClicksAutocapture() {
1462
1459
  return this.lr;
@@ -1474,16 +1471,16 @@ var hi = class {
1474
1471
  }
1475
1472
  ur(e) {
1476
1473
  var t, n;
1477
- (t = N.__PosthogExtensions__) != null && t.initDeadClicksAutocapture && e(), (n = N.__PosthogExtensions__) == null || n.loadExternalDependency == null || n.loadExternalDependency(this.instance, "dead-clicks-autocapture", ((t) => {
1474
+ (t = M.__PosthogExtensions__) != null && t.initDeadClicksAutocapture && e(), (n = M.__PosthogExtensions__) == null || n.loadExternalDependency == null || n.loadExternalDependency(this.instance, "dead-clicks-autocapture", ((t) => {
1478
1475
  t ? Di.error("failed to load script", t) : e();
1479
1476
  }));
1480
1477
  }
1481
1478
  hr() {
1482
1479
  var e;
1483
- if (M) {
1484
- if (!this.lr && (e = N.__PosthogExtensions__) != null && e.initDeadClicksAutocapture) {
1485
- var t = R(this.instance.config.capture_dead_clicks) ? this.instance.config.capture_dead_clicks : {};
1486
- t.__onCapture = this.onCapture, this.lr = N.__PosthogExtensions__.initDeadClicksAutocapture(this.instance, t), this.lr.start(M), Di.info("starting...");
1480
+ if (j) {
1481
+ if (!this.lr && (e = M.__PosthogExtensions__) != null && e.initDeadClicksAutocapture) {
1482
+ var t = L(this.instance.config.capture_dead_clicks) ? this.instance.config.capture_dead_clicks : {};
1483
+ t.__onCapture = this.onCapture, this.lr = M.__PosthogExtensions__.initDeadClicksAutocapture(this.instance, t), this.lr.start(j), Di.info("starting...");
1487
1484
  }
1488
1485
  } else Di.error("`document` not found. Cannot start.");
1489
1486
  }
@@ -1498,9 +1495,9 @@ function Ni(e, t) {
1498
1495
  t.tags ||= {};
1499
1496
  var s = e.requestRouter.endpointFor("ui", "/project/" + e.config.token + "/person/" + e.get_distinct_id());
1500
1497
  t.tags["PostHog Person URL"] = s, e.sessionRecordingStarted() && (t.tags["PostHog Recording URL"] = e.get_session_replay_url({ withTimestamp: !0 }));
1501
- var c, l = t.exception?.values || [], u = l.map(((e) => F({}, e, { stacktrace: e.stacktrace ? F({}, e.stacktrace, {
1498
+ var c, l = t.exception?.values || [], u = l.map(((e) => P({}, e, { stacktrace: e.stacktrace ? P({}, e.stacktrace, {
1502
1499
  type: "raw",
1503
- frames: (e.stacktrace.frames || []).map(((e) => F({}, e, { platform: "web:javascript" })))
1500
+ frames: (e.stacktrace.frames || []).map(((e) => P({}, e, { platform: "web:javascript" })))
1504
1501
  }) : void 0 }))), d = {
1505
1502
  $exception_message: l[0]?.value || t.message,
1506
1503
  $exception_type: l[0]?.type,
@@ -1546,7 +1543,7 @@ var Pi = class {
1546
1543
  doPageView(e, t) {
1547
1544
  var n = this.gr(e, t);
1548
1545
  return this.dr = {
1549
- pathname: A?.location.pathname ?? "",
1546
+ pathname: k?.location.pathname ?? "",
1550
1547
  pageViewId: t,
1551
1548
  timestamp: e
1552
1549
  }, this._instance.scrollManager.resetContext(), n;
@@ -1566,9 +1563,9 @@ var Pi = class {
1566
1563
  }, i = this._instance.scrollManager.getContext();
1567
1564
  if (i && !this._instance.config.disable_scroll_properties) {
1568
1565
  var { maxScrollHeight: a, lastScrollY: o, maxScrollY: s, maxContentHeight: c, lastContentY: l, maxContentY: u } = i;
1569
- if (!(z(a) || z(o) || z(s) || z(c) || z(l) || z(u))) {
1566
+ if (!(R(a) || R(o) || R(s) || R(c) || R(l) || R(u))) {
1570
1567
  a = Math.ceil(a), o = Math.ceil(o), s = Math.ceil(s), c = Math.ceil(c), l = Math.ceil(l), u = Math.ceil(u);
1571
- var d = a > 1 ? ut(o / a, 0, 1, U) : 1, f = a > 1 ? ut(s / a, 0, 1, U) : 1, p = c > 1 ? ut(l / c, 0, 1, U) : 1, m = c > 1 ? ut(u / c, 0, 1, U) : 1;
1568
+ var d = a > 1 ? dt(o / a, 0, 1, U) : 1, f = a > 1 ? dt(s / a, 0, 1, U) : 1, p = c > 1 ? dt(l / c, 0, 1, U) : 1, m = c > 1 ? dt(u / c, 0, 1, U) : 1;
1572
1569
  r = K(r, {
1573
1570
  $prev_pageview_last_scroll: o,
1574
1571
  $prev_pageview_last_scroll_percentage: d,
@@ -1609,7 +1606,7 @@ var Pi = class {
1609
1606
  exposure: "derived",
1610
1607
  shouldSkipFromEventProperties: (e, t) => t(),
1611
1608
  transformToEventProperties(e) {
1612
- if (!R(e)) return {};
1609
+ if (!L(e)) return {};
1613
1610
  for (var t = {}, n = Object.keys(e), r = 0; n.length > r; r++) t["$feature/" + n[r]] = e[n[r]];
1614
1611
  return t;
1615
1612
  }
@@ -1661,8 +1658,8 @@ var Pi = class {
1661
1658
  ["$posthog_sr_group_url_trigger_", { exposure: "hidden" }],
1662
1659
  ["$posthog_sr_group_sampling_", { exposure: "hidden" }]
1663
1660
  ], Ri = (e) => {
1664
- var t = M?.createElement("a");
1665
- return z(t) ? null : (t.href = e, t);
1661
+ var t = j?.createElement("a");
1662
+ return R(t) ? null : (t.href = e, t);
1666
1663
  }, zi = function(e, t) {
1667
1664
  for (var n, r = ((e.split("#")[0] || "").split(/\?(.*)/)[1] || "").replace(/^\?+/g, "").split("&"), i = 0; r.length > i; i++) {
1668
1665
  var a = r[i].split("=");
@@ -1671,7 +1668,7 @@ var Pi = class {
1671
1668
  break;
1672
1669
  }
1673
1670
  }
1674
- if (!L(n) || 2 > n.length) return "";
1671
+ if (!I(n) || 2 > n.length) return "";
1675
1672
  var o = n[1];
1676
1673
  try {
1677
1674
  o = decodeURIComponent(o);
@@ -1683,7 +1680,7 @@ var Pi = class {
1683
1680
  if (!e || !t || !t.length) return e;
1684
1681
  for (var r = e.split("#"), i = r[1], a = (r[0] || "").split("?"), o = a[1], s = a[0], c = (o || "").split("&"), l = [], u = 0; c.length > u; u++) {
1685
1682
  var d = c[u].split("=");
1686
- L(d) && (t.includes(d[0]) ? l.push(d[0] + "=" + n) : l.push(c[u]));
1683
+ I(d) && (t.includes(d[0]) ? l.push(d[0] + "=" + n) : l.push(c[u]));
1687
1684
  }
1688
1685
  var f = s;
1689
1686
  return o != null && (f += "?" + l.join("&")), i != null && (f += "#" + i), f;
@@ -1719,8 +1716,8 @@ var Pi = class {
1719
1716
  ...Ui
1720
1717
  ], Gi = "<masked>", Ki = ["li_fat_id"];
1721
1718
  function qi(e, t, n) {
1722
- if (!M) return {};
1723
- var r, i = t ? [...Ui, ...n || []] : [], a = Ji(Bi(M.URL, i, Gi), e);
1719
+ if (!j) return {};
1720
+ var r, i = t ? [...Ui, ...n || []] : [], a = Ji(Bi(j.URL, i, Gi), e);
1724
1721
  return K((r = {}, G(Ki, (function(e) {
1725
1722
  var t = bi.O(e);
1726
1723
  r[e] = t || null;
@@ -1736,9 +1733,9 @@ function Yi(e) {
1736
1733
  var t = function(e) {
1737
1734
  return e ? e.search(Hi + "google.([^/?]*)") === 0 ? "google" : e.search(Hi + "bing.com") === 0 ? "bing" : e.search(Hi + "yahoo.com") === 0 ? "yahoo" : e.search(Hi + "duckduckgo.com") === 0 ? "duckduckgo" : null : null;
1738
1735
  }(e), n = t == "yahoo" ? "p" : "q", r = {};
1739
- if (!Qe(t)) {
1736
+ if (!$e(t)) {
1740
1737
  r.$search_engine = t;
1741
- var i = M ? zi(M.referrer, n) : "";
1738
+ var i = j ? zi(j.referrer, n) : "";
1742
1739
  i.length && (r.ph_keyword = i);
1743
1740
  }
1744
1741
  return r;
@@ -1748,10 +1745,10 @@ function Xi() {
1748
1745
  }
1749
1746
  var Zi = "$direct";
1750
1747
  function Qi() {
1751
- return M?.referrer || Zi;
1748
+ return j?.referrer || Zi;
1752
1749
  }
1753
1750
  function $i(e, t) {
1754
- var n = e ? [...Ui, ...t || []] : [], r = Ae?.href.substring(0, 1e3);
1751
+ var n = e ? [...Ui, ...t || []] : [], r = je?.href.substring(0, 1e3);
1755
1752
  return {
1756
1753
  r: Qi().substring(0, 1e3),
1757
1754
  u: r ? Bi(r, n, Gi) : void 0
@@ -1794,7 +1791,7 @@ var ra = [
1794
1791
  this.Bt = e, this.props = {}, this.mr = !1, this.yr = ((e) => {
1795
1792
  var t = "";
1796
1793
  return e.token && (t = e.token.replace(/\+/g, "PL").replace(/\//g, "SL").replace(/=/g, "EQ")), e.persistence_name ? "ph_" + e.persistence_name : "ph_" + t + "_posthog";
1797
- })(e), this.nr = this.br(e), this.load(), e.debug && U.info("Persistence loaded", e.persistence, F({}, this.props)), this.update_config(e, e, t), this.save();
1794
+ })(e), this.nr = this.br(e), this.load(), e.debug && U.info("Persistence loaded", e.persistence, P({}, this.props)), this.update_config(e, e, t), this.save();
1798
1795
  }
1799
1796
  isDisabled() {
1800
1797
  return !!this.wr;
@@ -1804,7 +1801,7 @@ var ra = [
1804
1801
  var t = function(e) {
1805
1802
  e === void 0 && (e = []);
1806
1803
  var t = [...Si, ...e];
1807
- return F({}, J, {
1804
+ return P({}, J, {
1808
1805
  Z(e) {
1809
1806
  try {
1810
1807
  var t = {};
@@ -1829,7 +1826,7 @@ var ra = [
1829
1826
  },
1830
1827
  F(e, t) {
1831
1828
  try {
1832
- A?.localStorage.removeItem(e), bi.F(e, t);
1829
+ k?.localStorage.removeItem(e), bi.F(e, t);
1833
1830
  } catch (e) {
1834
1831
  J.B(e);
1835
1832
  }
@@ -1874,8 +1871,8 @@ var ra = [
1874
1871
  this.remove(), this.props = {};
1875
1872
  }
1876
1873
  register_once(e, t, n) {
1877
- if (R(e)) {
1878
- z(t) && (t = "None"), this.Ir = z(n) ? this.kr : n;
1874
+ if (L(e)) {
1875
+ R(t) && (t = "None"), this.Ir = R(n) ? this.kr : n;
1879
1876
  var r = !1;
1880
1877
  if (G(e, ((e, n) => {
1881
1878
  this.props.hasOwnProperty(n) && this.props[n] !== t || (this.Tr(n, e), r = !0);
@@ -1884,8 +1881,8 @@ var ra = [
1884
1881
  return !1;
1885
1882
  }
1886
1883
  register(e, t) {
1887
- if (R(e)) {
1888
- this.Ir = z(t) ? this.kr : t;
1884
+ if (L(e)) {
1885
+ this.Ir = R(t) ? this.kr : t;
1889
1886
  var n = !1;
1890
1887
  if (G(e, ((t, r) => {
1891
1888
  e.hasOwnProperty(r) && this.props[r] !== t && (this.Tr(r, t), n = !0);
@@ -1899,17 +1896,17 @@ var ra = [
1899
1896
  update_campaign_params() {
1900
1897
  if (!this.mr) {
1901
1898
  var e = qi(this.Bt.custom_campaign_params, this.Bt.mask_personal_data_properties, this.Bt.custom_personal_data_properties);
1902
- Xe(si(e)) || this.register(e), this.mr = !0;
1899
+ Ze(si(e)) || this.register(e), this.mr = !0;
1903
1900
  }
1904
1901
  }
1905
1902
  update_search_keyword() {
1906
1903
  var e;
1907
- this.register((e = M?.referrer) ? Yi(e) : {});
1904
+ this.register((e = j?.referrer) ? Yi(e) : {});
1908
1905
  }
1909
1906
  update_referrer_info() {
1910
1907
  this.register_once({
1911
1908
  $referrer: Qi(),
1912
- $referring_domain: M != null && M.referrer && Ri(M.referrer)?.host || Zi
1909
+ $referring_domain: j != null && j.referrer && Ri(j.referrer)?.host || Zi
1913
1910
  }, void 0);
1914
1911
  }
1915
1912
  set_initial_person_info() {
@@ -1920,12 +1917,12 @@ var ra = [
1920
1917
  G([Lr, Ir], ((t) => {
1921
1918
  var n = this.props[t];
1922
1919
  n && G(n, (function(t, n) {
1923
- e["$initial_" + Ge(n)] = t;
1920
+ e["$initial_" + Ke(n)] = t;
1924
1921
  }));
1925
1922
  }));
1926
1923
  var t, n, r = this.props[Rr];
1927
1924
  return r && K(e, (t = ea(r), n = {}, G(t, (function(e, t) {
1928
- n["$initial_" + Ge(t)] = e;
1925
+ n["$initial_" + Ke(t)] = e;
1929
1926
  })), n)), e;
1930
1927
  }
1931
1928
  safe_merge(e) {
@@ -1958,7 +1955,7 @@ var ra = [
1958
1955
  }
1959
1956
  remove_event_timer(e) {
1960
1957
  var t = this.props[$n] || {}, n = t[e];
1961
- return z(n) || (delete t[e], this.Tr($n, t), this.save()), n;
1958
+ return R(n) || (delete t[e], this.Tr($n, t), this.save()), n;
1962
1959
  }
1963
1960
  get_property(e) {
1964
1961
  return this.props[e];
@@ -2086,11 +2083,11 @@ var ra = [
2086
2083
  }
2087
2084
  get remoteConfig() {
2088
2085
  var e;
2089
- return (e = N._POSTHOG_REMOTE_CONFIG) == null || (e = e[this._instance.config.token]) == null ? void 0 : e.config;
2086
+ return (e = M._POSTHOG_REMOTE_CONFIG) == null || (e = e[this._instance.config.token]) == null ? void 0 : e.config;
2090
2087
  }
2091
2088
  Er(e) {
2092
2089
  var t, n;
2093
- (t = N.__PosthogExtensions__) != null && t.loadExternalDependency ? (n = N.__PosthogExtensions__) == null || n.loadExternalDependency == null || n.loadExternalDependency(this._instance, "remote-config", (() => e(this.remoteConfig))) : e();
2090
+ (t = M.__PosthogExtensions__) != null && t.loadExternalDependency ? (n = M.__PosthogExtensions__) == null || n.loadExternalDependency == null || n.loadExternalDependency(this._instance, "remote-config", (() => e(this.remoteConfig))) : e();
2094
2091
  }
2095
2092
  Rr(e) {
2096
2093
  this._instance._send_request({
@@ -2119,7 +2116,7 @@ var ra = [
2119
2116
  this.Or &&= (clearInterval(this.Or), void 0);
2120
2117
  }
2121
2118
  refresh() {
2122
- this._instance.Fr() || M?.visibilityState === "hidden" || this._instance.reloadFeatureFlags();
2119
+ this._instance.Fr() || j?.visibilityState === "hidden" || this._instance.reloadFeatureFlags();
2123
2120
  }
2124
2121
  Mr() {
2125
2122
  if (!this.Or) {
@@ -2346,26 +2343,26 @@ var ja = Oa(ka, 9, 0), Ma = Oa(Aa, 5, 0), Na = function(e) {
2346
2343
  Fa(t, u++, n), ++i[256];
2347
2344
  for (var d = La(i, 15), f = d[0], p = d[1], m = La(a, 15), h = m[0], g = m[1], _ = za(f), v = _[0], y = _[1], b = za(h), x = b[0], S = b[1], C = new X(19), w = 0; v.length > w; ++w) C[31 & v[w]]++;
2348
2345
  for (w = 0; x.length > w; ++w) C[31 & x[w]]++;
2349
- for (var ee = La(C, 7), T = ee[0], te = ee[1], E = 19; E > 4 && !T[xa[E - 1]]; --E);
2350
- var D, ne, re, ie, O = l + 5 << 3, ae = Ba(i, ka) + Ba(a, Aa) + o, oe = Ba(i, f) + Ba(a, h) + o + 14 + 3 * E + Ba(C, T) + (2 * C[16] + 3 * C[17] + 7 * C[18]);
2351
- if (ae >= O && oe >= O) return Va(t, u, e.subarray(c, c + l));
2352
- if (Fa(t, u, 1 + (ae > oe)), u += 2, ae > oe) {
2353
- D = Oa(f, p, 0), ne = f, re = Oa(h, g, 0), ie = h;
2354
- var se = Oa(T, te, 0);
2355
- for (Fa(t, u, y - 257), Fa(t, u + 5, S - 1), Fa(t, u + 10, E - 4), u += 14, w = 0; E > w; ++w) Fa(t, u + 3 * w, T[xa[w]]);
2356
- u += 3 * E;
2357
- for (var ce = [v, x], le = 0; 2 > le; ++le) {
2358
- var ue = ce[le];
2359
- for (w = 0; ue.length > w; ++w) Fa(t, u, se[de = 31 & ue[w]]), u += T[de], de > 15 && (Fa(t, u, ue[w] >>> 5 & 127), u += ue[w] >>> 12);
2360
- }
2361
- } else D = ja, ne = ka, re = Ma, ie = Aa;
2346
+ for (var ee = La(C, 7), T = ee[0], te = ee[1], ne = 19; ne > 4 && !T[xa[ne - 1]]; --ne);
2347
+ var re, E, ie, ae, D = l + 5 << 3, oe = Ba(i, ka) + Ba(a, Aa) + o, se = Ba(i, f) + Ba(a, h) + o + 14 + 3 * ne + Ba(C, T) + (2 * C[16] + 3 * C[17] + 7 * C[18]);
2348
+ if (oe >= D && se >= D) return Va(t, u, e.subarray(c, c + l));
2349
+ if (Fa(t, u, 1 + (oe > se)), u += 2, oe > se) {
2350
+ re = Oa(f, p, 0), E = f, ie = Oa(h, g, 0), ae = h;
2351
+ var ce = Oa(T, te, 0);
2352
+ for (Fa(t, u, y - 257), Fa(t, u + 5, S - 1), Fa(t, u + 10, ne - 4), u += 14, w = 0; ne > w; ++w) Fa(t, u + 3 * w, T[xa[w]]);
2353
+ u += 3 * ne;
2354
+ for (var le = [v, x], ue = 0; 2 > ue; ++ue) {
2355
+ var de = le[ue];
2356
+ for (w = 0; de.length > w; ++w) Fa(t, u, ce[fe = 31 & de[w]]), u += T[fe], fe > 15 && (Fa(t, u, de[w] >>> 5 & 127), u += de[w] >>> 12);
2357
+ }
2358
+ } else re = ja, E = ka, ie = Ma, ae = Aa;
2362
2359
  for (w = 0; s > w; ++w) if (r[w] > 255) {
2363
- var de;
2364
- Ia(t, u, D[257 + (de = r[w] >>> 18 & 31)]), u += ne[de + 257], de > 7 && (Fa(t, u, r[w] >>> 23 & 31), u += ya[de]);
2365
- var k = 31 & r[w];
2366
- Ia(t, u, re[k]), u += ie[k], k > 3 && (Ia(t, u, r[w] >>> 5 & 8191), u += ba[k]);
2367
- } else Ia(t, u, D[r[w]]), u += ne[r[w]];
2368
- return Ia(t, u, D[256]), u + ne[256];
2360
+ var fe;
2361
+ Ia(t, u, re[257 + (fe = r[w] >>> 18 & 31)]), u += E[fe + 257], fe > 7 && (Fa(t, u, r[w] >>> 23 & 31), u += ya[fe]);
2362
+ var O = 31 & r[w];
2363
+ Ia(t, u, ie[O]), u += ae[O], O > 3 && (Ia(t, u, r[w] >>> 5 & 8191), u += ba[O]);
2364
+ } else Ia(t, u, re[r[w]]), u += E[r[w]];
2365
+ return Ia(t, u, re[256]), u + E[256];
2369
2366
  }, Ua = new va([
2370
2367
  65540,
2371
2368
  131080,
@@ -2409,38 +2406,38 @@ function Ka(e, t) {
2409
2406
  else {
2410
2407
  for (var f = Ua[t - 1], p = f >>> 13, m = 8191 & f, h = (1 << n) - 1, g = new X(32768), _ = new X(h + 1), v = Math.ceil(n / 3), y = 2 * v, b = function(t) {
2411
2408
  return (e[t] ^ e[t + 1] << v ^ e[t + 2] << y) & h;
2412
- }, x = new va(25e3), S = new X(288), C = new X(32), w = 0, ee = 0, T = (u = 0, 0), te = 0, E = 0; o > u; ++u) {
2413
- var D = b(u), ne = 32767 & u, re = _[D];
2414
- if (g[ne] = re, _[D] = ne, u >= te) {
2415
- var ie = o - u;
2416
- if ((w > 7e3 || T > 24576) && ie > 423) {
2417
- l = Ha(e, c, 0, x, S, C, ee, T, E, u - E, l), T = w = ee = 0, E = u;
2418
- for (var O = 0; 286 > O; ++O) S[O] = 0;
2419
- for (O = 0; 30 > O; ++O) C[O] = 0;
2409
+ }, x = new va(25e3), S = new X(288), C = new X(32), w = 0, ee = 0, T = (u = 0, 0), te = 0, ne = 0; o > u; ++u) {
2410
+ var re = b(u), E = 32767 & u, ie = _[re];
2411
+ if (g[E] = ie, _[re] = E, u >= te) {
2412
+ var ae = o - u;
2413
+ if ((w > 7e3 || T > 24576) && ae > 423) {
2414
+ l = Ha(e, c, 0, x, S, C, ee, T, ne, u - ne, l), T = w = ee = 0, ne = u;
2415
+ for (var D = 0; 286 > D; ++D) S[D] = 0;
2416
+ for (D = 0; 30 > D; ++D) C[D] = 0;
2420
2417
  }
2421
- var ae = 2, oe = 0, se = m, ce = ne - re & 32767;
2422
- if (ie > 2 && D == b(u - ce)) for (var le = Math.min(p, ie) - 1, ue = Math.min(32767, u), de = Math.min(258, ie); ue >= ce && --se && ne != re;) {
2423
- if (e[u + ae] == e[u + ae - ce]) {
2424
- for (var k = 0; de > k && e[u + k] == e[u + k - ce]; ++k);
2425
- if (k > ae) {
2426
- if (ae = k, oe = ce, k > le) break;
2427
- var fe = Math.min(ce, k - 2), pe = 0;
2428
- for (O = 0; fe > O; ++O) {
2429
- var me = u - ce + O + 32768 & 32767, he = me - g[me] + 32768 & 32767;
2430
- he > pe && (pe = he, re = me);
2418
+ var oe = 2, se = 0, ce = m, le = E - ie & 32767;
2419
+ if (ae > 2 && re == b(u - le)) for (var ue = Math.min(p, ae) - 1, de = Math.min(32767, u), fe = Math.min(258, ae); de >= le && --ce && E != ie;) {
2420
+ if (e[u + oe] == e[u + oe - le]) {
2421
+ for (var O = 0; fe > O && e[u + O] == e[u + O - le]; ++O);
2422
+ if (O > oe) {
2423
+ if (oe = O, se = le, O > ue) break;
2424
+ var pe = Math.min(le, O - 2), me = 0;
2425
+ for (D = 0; pe > D; ++D) {
2426
+ var he = u - le + D + 32768 & 32767, ge = he - g[he] + 32768 & 32767;
2427
+ ge > me && (me = ge, ie = he);
2431
2428
  }
2432
2429
  }
2433
2430
  }
2434
- ce += (ne = re) - (re = g[ne]) + 32768 & 32767;
2431
+ le += (E = ie) - (ie = g[E]) + 32768 & 32767;
2435
2432
  }
2436
- if (oe) {
2437
- x[T++] = 268435456 | wa[ae] << 18 | Ta[oe];
2438
- var ge = 31 & wa[ae], _e = 31 & Ta[oe];
2439
- ee += ya[ge] + ba[_e], ++S[257 + ge], ++C[_e], te = u + ae, ++w;
2433
+ if (se) {
2434
+ x[T++] = 268435456 | wa[oe] << 18 | Ta[se];
2435
+ var _e = 31 & wa[oe], ve = 31 & Ta[se];
2436
+ ee += ya[_e] + ba[ve], ++S[257 + _e], ++C[ve], te = u + oe, ++w;
2440
2437
  } else x[T++] = e[u], ++S[e[u]];
2441
2438
  }
2442
2439
  }
2443
- l = Ha(e, c, !0, x, S, C, ee, T, E, u - E, l);
2440
+ l = Ha(e, c, !0, x, S, C, ee, T, ne, u - ne, l);
2444
2441
  }
2445
2442
  return Pa(s, 0, r + Na(l) + i);
2446
2443
  }(a = e, (o = t).level == null ? 6 : o.level, o.mem == null ? Math.ceil(1.5 * Math.max(8, Math.min(13, Math.log(a.length)))) : 12 + o.mem, s, c)), u = l.length;
@@ -2452,9 +2449,9 @@ function Ka(e, t) {
2452
2449
  }
2453
2450
  }(l, t), Ga(l, u - 8, n.d()), Ga(l, u - 4, r), l;
2454
2451
  }
2455
- var qa = !!Me || !!je, Ja = "text/plain", Ya = !1, Xa = function(e, t, n) {
2452
+ var qa = !!Ne || !!Me, Ja = "text/plain", Ya = !1, Xa = function(e, t, n) {
2456
2453
  n === void 0 && (n = !0);
2457
- var [r, i] = e.split("?"), a = F({}, t), o = i?.split("&").map(((e) => {
2454
+ var [r, i] = e.split("?"), a = P({}, t), o = i?.split("&").map(((e) => {
2458
2455
  var t, [r, i] = e.split("="), o = n && (t = a[r]) != null ? t : i;
2459
2456
  return delete a[r], r + "=" + o;
2460
2457
  })) ?? [], s = function(e, t) {
@@ -2462,7 +2459,7 @@ var qa = !!Me || !!je, Ja = "text/plain", Ya = !1, Xa = function(e, t, n) {
2462
2459
  t === void 0 && (t = "&");
2463
2460
  var i = [];
2464
2461
  return G(e, (function(e, t) {
2465
- z(e) || z(t) || t === "undefined" || (n = encodeURIComponent(((e) => e instanceof File)(e) ? e.name : e.toString()), r = encodeURIComponent(t), i[i.length] = r + "=" + n);
2462
+ R(e) || R(t) || t === "undefined" || (n = encodeURIComponent(((e) => e instanceof File)(e) ? e.name : e.toString()), r = encodeURIComponent(t), i[i.length] = r + "=" + n);
2466
2463
  })), i.join(t);
2467
2464
  }(a);
2468
2465
  return s && o.push(s), r + "?" + o.join("&");
@@ -2510,13 +2507,13 @@ var qa = !!Me || !!je, Ja = "text/plain", Ya = !1, Xa = function(e, t, n) {
2510
2507
  };
2511
2508
  }
2512
2509
  }, $a = function() {
2513
- var e = Re((function* (e) {
2510
+ var e = ze((function* (e) {
2514
2511
  var t = yield function(e, t, n) {
2515
- return Be.apply(this, arguments);
2516
- }(Za(e.data), P.DEBUG, { rethrow: !0 });
2512
+ return Ve.apply(this, arguments);
2513
+ }(Za(e.data), N.DEBUG, { rethrow: !0 });
2517
2514
  if (!t) return e;
2518
2515
  var n = yield t.arrayBuffer();
2519
- return F({}, e, { tr: {
2516
+ return P({}, e, { tr: {
2520
2517
  contentType: Ja,
2521
2518
  body: n,
2522
2519
  estimatedSize: n.byteLength
@@ -2527,10 +2524,10 @@ var qa = !!Me || !!je, Ja = "text/plain", Ya = !1, Xa = function(e, t, n) {
2527
2524
  };
2528
2525
  }(), eo = (e, t) => Xa(e, {
2529
2526
  _: (/* @__PURE__ */ new Date()).getTime().toString(),
2530
- ver: P.JS_SDK_VERSION,
2527
+ ver: N.JS_SDK_VERSION,
2531
2528
  compression: t
2532
2529
  }), to = [];
2533
- je && to.push({
2530
+ Me && to.push({
2534
2531
  transport: "fetch",
2535
2532
  method(e) {
2536
2533
  var { contentType: t, body: n, estimatedSize: r } = Qa(e) ?? {}, i = new Headers();
@@ -2538,14 +2535,14 @@ je && to.push({
2538
2535
  i.append(t, e);
2539
2536
  })), t && i.append("Content-Type", t);
2540
2537
  var a = e.url, o = null;
2541
- if (Ne) {
2542
- var s = new Ne();
2538
+ if (Pe) {
2539
+ var s = new Pe();
2543
2540
  o = {
2544
2541
  signal: s.signal,
2545
2542
  timeout: setTimeout((() => s.abort()), e.timeout)
2546
2543
  };
2547
2544
  }
2548
- je(a, F({
2545
+ Me(a, P({
2549
2546
  method: e?.method || "GET",
2550
2547
  headers: i,
2551
2548
  keepalive: e.method === "POST" && 52428.8 > (r || 0),
@@ -2569,10 +2566,10 @@ je && to.push({
2569
2566
  });
2570
2567
  })).finally((() => o ? clearTimeout(o.timeout) : null));
2571
2568
  }
2572
- }), Me && to.push({
2569
+ }), Ne && to.push({
2573
2570
  transport: "XHR",
2574
2571
  method(e) {
2575
- var t = new Me();
2572
+ var t = new Ne();
2576
2573
  t.open(e.method || "GET", e.url, !0);
2577
2574
  var { contentType: n, body: r } = Qa(e) ?? {};
2578
2575
  G(e.headers, (function(e, n) {
@@ -2590,7 +2587,7 @@ je && to.push({
2590
2587
  }
2591
2588
  }, t.send(r);
2592
2589
  }
2593
- }), ke != null && ke.sendBeacon && to.push({
2590
+ }), Ae != null && Ae.sendBeacon && to.push({
2594
2591
  transport: "sendBeacon",
2595
2592
  method(e) {
2596
2593
  var t = Xa(e.url, { beacon: "1" });
@@ -2598,13 +2595,13 @@ je && to.push({
2598
2595
  var { contentType: n, body: r } = Qa(e) ?? {};
2599
2596
  if (!r) return;
2600
2597
  var i = r instanceof Blob ? r : new Blob([r], { type: n });
2601
- ke.sendBeacon(t, i);
2598
+ Ae.sendBeacon(t, i);
2602
2599
  } catch {}
2603
2600
  }
2604
2601
  });
2605
2602
  var no = 3e3, ro = class {
2606
2603
  constructor(e, t) {
2607
- this.Pr = !0, this.Lr = [], this.Dr = ut(t?.flush_interval_ms || no, 250, 5e3, U.createLogger("flush interval"), no), this.Br = e;
2604
+ this.Pr = !0, this.Lr = [], this.Dr = dt(t?.flush_interval_ms || no, 250, 5e3, U.createLogger("flush interval"), no), this.Br = e;
2608
2605
  }
2609
2606
  enqueue(e) {
2610
2607
  this.Lr.push(e), this.jr || this.$r();
@@ -2613,7 +2610,7 @@ var no = 3e3, ro = class {
2613
2610
  this.qr();
2614
2611
  var e = this.Lr.length > 0 ? this.Zr() : {}, t = Object.values(e);
2615
2612
  [...t.filter(((e) => e.url.indexOf("/e") === 0)), ...t.filter(((e) => e.url.indexOf("/e") !== 0))].map(((e) => {
2616
- this.Br(F({}, e, { transport: "sendBeacon" }));
2613
+ this.Br(P({}, e, { transport: "sendBeacon" }));
2617
2614
  }));
2618
2615
  }
2619
2616
  enable() {
@@ -2625,7 +2622,7 @@ var no = 3e3, ro = class {
2625
2622
  if (this.qr(), this.Lr.length > 0) {
2626
2623
  var t = this.Zr(), n = function() {
2627
2624
  var n = t[r], i = (/* @__PURE__ */ new Date()).getTime();
2628
- n.data && L(n.data) && G(n.data, ((e) => {
2625
+ n.data && I(n.data) && G(n.data, ((e) => {
2629
2626
  e.offset = Math.abs(e.timestamp - i), delete e.timestamp;
2630
2627
  })), e.Br(n);
2631
2628
  };
@@ -2640,24 +2637,24 @@ var no = 3e3, ro = class {
2640
2637
  var e = {};
2641
2638
  return G(this.Lr, ((t) => {
2642
2639
  var n, r = t, i = (r ? r.batchKey : null) || r.url;
2643
- z(e[i]) && (e[i] = F({}, r, { data: [] })), (n = e[i].data) == null || n.push(r.data);
2640
+ R(e[i]) && (e[i] = P({}, r, { data: [] })), (n = e[i].data) == null || n.push(r.data);
2644
2641
  })), this.Lr = [], e;
2645
2642
  }
2646
2643
  }, io = ["retriesPerformedSoFar"], ao = class {
2647
2644
  constructor(e) {
2648
- this.Hr = !1, this.Vr = 3e3, this.Lr = [], this._instance = e, this.Lr = [], this.zr = !0, !z(A) && "onLine" in A.navigator && (this.zr = A.navigator.onLine, this.Ur = () => {
2645
+ this.Hr = !1, this.Vr = 3e3, this.Lr = [], this._instance = e, this.Lr = [], this.zr = !0, !R(k) && "onLine" in k.navigator && (this.zr = k.navigator.onLine, this.Ur = () => {
2649
2646
  this.zr = !0, this.Yr();
2650
2647
  }, this.Gr = () => {
2651
2648
  this.zr = !1;
2652
- }, q(A, "online", this.Ur), q(A, "offline", this.Gr));
2649
+ }, q(k, "online", this.Ur), q(k, "offline", this.Gr));
2653
2650
  }
2654
2651
  get length() {
2655
2652
  return this.Lr.length;
2656
2653
  }
2657
2654
  retriableRequest(e) {
2658
- var { retriesPerformedSoFar: t } = e, n = ze(e, io);
2659
- et(t) && (n.url = Xa(n.url, { retry_count: t })), this._instance._send_request(F({}, n, { callback: (e) => {
2660
- e.statusCode === 200 || e.statusCode >= 400 && 500 > e.statusCode || (t ?? 0) >= 10 ? n.callback == null || n.callback(e) : this.Wr(F({ retriesPerformedSoFar: t }, n));
2655
+ var { retriesPerformedSoFar: t } = e, n = Be(e, io);
2656
+ tt(t) && (n.url = Xa(n.url, { retry_count: t })), this._instance._send_request(P({}, n, { callback: (e) => {
2657
+ e.statusCode === 200 || e.statusCode >= 400 && 500 > e.statusCode || (t ?? 0) >= 10 ? n.callback == null || n.callback(e) : this.Wr(P({ retriesPerformedSoFar: t }, n));
2661
2658
  } }));
2662
2659
  }
2663
2660
  Wr(e) {
@@ -2685,8 +2682,8 @@ var no = 3e3, ro = class {
2685
2682
  if (this.Lr = t, n.length > 0) for (var { requestOptions: r } of n) this.retriableRequest(r);
2686
2683
  }
2687
2684
  unload() {
2688
- for (var { requestOptions: e } of (this.Jr &&= (clearTimeout(this.Jr), void 0), this.Hr = !1, z(A) || (this.Ur &&= (A.removeEventListener("online", this.Ur), void 0), this.Gr &&= (A.removeEventListener("offline", this.Gr), void 0)), this.Lr)) try {
2689
- this._instance._send_request(F({}, e, { transport: "sendBeacon" }));
2685
+ for (var { requestOptions: e } of (this.Jr &&= (clearTimeout(this.Jr), void 0), this.Hr = !1, R(k) || (this.Ur &&= (k.removeEventListener("online", this.Ur), void 0), this.Gr &&= (k.removeEventListener("offline", this.Gr), void 0)), this.Lr)) try {
2686
+ this._instance._send_request(P({}, e, { transport: "sendBeacon" }));
2690
2687
  } catch (e) {
2691
2688
  U.error(e);
2692
2689
  }
@@ -2711,12 +2708,12 @@ var no = 3e3, ro = class {
2711
2708
  return setTimeout(this.Kr, 0), e;
2712
2709
  }
2713
2710
  startMeasuringScrollPosition() {
2714
- q(A, "scroll", this.Kr, { capture: !0 }), q(A, "scrollend", this.Kr, { capture: !0 }), q(A, "resize", this.Kr);
2711
+ q(k, "scroll", this.Kr, { capture: !0 }), q(k, "scrollend", this.Kr, { capture: !0 }), q(k, "resize", this.Kr);
2715
2712
  }
2716
2713
  scrollElement() {
2717
- if (!this.ei) return A?.document.documentElement;
2718
- for (var e of L(this.ei) ? this.ei : [this.ei]) {
2719
- var t = A?.document.querySelector(e);
2714
+ if (!this.ei) return k?.document.documentElement;
2715
+ for (var e of I(this.ei) ? this.ei : [this.ei]) {
2716
+ var t = k?.document.querySelector(e);
2720
2717
  if (t) return t;
2721
2718
  }
2722
2719
  }
@@ -2725,14 +2722,14 @@ var no = 3e3, ro = class {
2725
2722
  var e = this.scrollElement();
2726
2723
  return e && e.scrollTop || 0;
2727
2724
  }
2728
- return A && (A.scrollY || A.pageYOffset || A.document.documentElement.scrollTop) || 0;
2725
+ return k && (k.scrollY || k.pageYOffset || k.document.documentElement.scrollTop) || 0;
2729
2726
  }
2730
2727
  scrollX() {
2731
2728
  if (this.ei) {
2732
2729
  var e = this.scrollElement();
2733
2730
  return e && e.scrollLeft || 0;
2734
2731
  }
2735
- return A && (A.scrollX || A.pageXOffset || A.document.documentElement.scrollLeft) || 0;
2732
+ return k && (k.scrollX || k.pageXOffset || k.document.documentElement.scrollLeft) || 0;
2736
2733
  }
2737
2734
  }, so = (e) => $i(e?.config.mask_personal_data_properties, e?.config.custom_personal_data_properties), co = class {
2738
2735
  constructor(e, t, n, r) {
@@ -2765,7 +2762,7 @@ var no = 3e3, ro = class {
2765
2762
  getSessionProps() {
2766
2763
  var e = {};
2767
2764
  return G(si(this.getSetOnceProps()), ((t, n) => {
2768
- n === "$current_url" && (n = "url"), e["$session_entry_" + Ge(n)] = t;
2765
+ n === "$current_url" && (n = "url"), e["$session_entry_" + Ke(n)] = t;
2769
2766
  })), e;
2770
2767
  }
2771
2768
  }, lo = class {
@@ -2787,11 +2784,11 @@ var no = 3e3, ro = class {
2787
2784
  }
2788
2785
  constructor(e, t, n) {
2789
2786
  var r;
2790
- if (this.li = [], this.ui = void 0, this.ai = new lo(), this.hi = (e, t) => !(!et(e) || !et(t)) && Math.abs(e - t) > this.sessionTimeoutMs, !e.persistence) throw Error("SessionIdManager requires a PostHogPersistence instance");
2787
+ if (this.li = [], this.ui = void 0, this.ai = new lo(), this.hi = (e, t) => !(!tt(e) || !tt(t)) && Math.abs(e - t) > this.sessionTimeoutMs, !e.persistence) throw Error("SessionIdManager requires a PostHogPersistence instance");
2791
2788
  if (e.config.cookieless_mode === qr) throw Error("SessionIdManager cannot be used with cookieless_mode=\"always\"");
2792
2789
  this.Bt = e.config, this.ni = e.persistence, this.ci = void 0, this.di = void 0, this._sessionStartTimestamp = null, this._sessionActivityTimestamp = null, this.vi = t || gi, this.fi = n || gi;
2793
2790
  var i = this.Bt.persistence_name || this.Bt.token;
2794
- if (this._sessionTimeoutMs = 1e3 * ut(this.Bt.session_idle_timeout_seconds || 1800, 60, 36e3, uo.createLogger("session_idle_timeout_seconds"), 1800), e.register({ $configured_session_timeout_ms: this._sessionTimeoutMs }), this.pi(), this.gi = "ph_" + i + "_window_id", this.mi = "ph_" + i + "_primary_window_exists", this.yi()) {
2791
+ if (this._sessionTimeoutMs = 1e3 * dt(this.Bt.session_idle_timeout_seconds || 1800, 60, 36e3, uo.createLogger("session_idle_timeout_seconds"), 1800), e.register({ $configured_session_timeout_ms: this._sessionTimeoutMs }), this.pi(), this.gi = "ph_" + i + "_window_id", this.mi = "ph_" + i + "_primary_window_exists", this.yi()) {
2795
2792
  var a = Y.Z(this.gi), o = Y.Z(this.mi);
2796
2793
  a && !o ? this.ci = a : Y.F(this.gi), Y.M(this.mi, !0);
2797
2794
  }
@@ -2812,7 +2809,7 @@ var no = 3e3, ro = class {
2812
2809
  return this._sessionTimeoutMs;
2813
2810
  }
2814
2811
  onSessionId(e) {
2815
- return z(this.li) && (this.li = []), this.li.push(e), this.di && e(this.di, this.ci), () => {
2812
+ return R(this.li) && (this.li = []), this.li.push(e), this.di && e(this.di, this.ci), () => {
2816
2813
  this.li = this.li.filter(((t) => t !== e));
2817
2814
  };
2818
2815
  }
@@ -2834,7 +2831,7 @@ var no = 3e3, ro = class {
2834
2831
  }
2835
2832
  Si() {
2836
2833
  var e = this.ni.props[mr];
2837
- return L(e) && e.length === 2 && e.push(e[0]), e || [
2834
+ return I(e) && e.length === 2 && e.push(e[0]), e || [
2838
2835
  0,
2839
2836
  null,
2840
2837
  0
@@ -2844,16 +2841,16 @@ var no = 3e3, ro = class {
2844
2841
  this.bi(null, null, null);
2845
2842
  }
2846
2843
  destroy() {
2847
- clearTimeout(this.xi), this.xi = void 0, this.ui && A && (A.removeEventListener(Qr, this.ui, { capture: !1 }), this.ui = void 0), this.li = [];
2844
+ clearTimeout(this.xi), this.xi = void 0, this.ui && k && (k.removeEventListener(Qr, this.ui, { capture: !1 }), this.ui = void 0), this.li = [];
2848
2845
  }
2849
2846
  wi() {
2850
2847
  this.ui = () => {
2851
2848
  this.yi() && Y.F(this.mi);
2852
- }, q(A, Qr, this.ui, { capture: !1 });
2849
+ }, q(k, Qr, this.ui, { capture: !1 });
2853
2850
  }
2854
2851
  checkAndGetSessionAndWindowId(e, t) {
2855
2852
  if (e === void 0 && (e = !1), t === void 0 && (t = null), this.Bt.cookieless_mode === qr) throw Error("checkAndGetSessionAndWindowId should not be called with cookieless_mode=\"always\"");
2856
- var n = t || (/* @__PURE__ */ new Date()).getTime(), [r, i, a] = this.Si(), o = this.Ci(), s = et(a) && Math.abs(n - a) > 864e5, c = !1, l = !i, u = !l && !e && this.hi(n, r);
2853
+ var n = t || (/* @__PURE__ */ new Date()).getTime(), [r, i, a] = this.Si(), o = this.Ci(), s = tt(a) && Math.abs(n - a) > 864e5, c = !1, l = !i, u = !l && !e && this.hi(n, r);
2857
2854
  l || u || s ? (i = this.vi(), o = this.fi(), uo.info("new session ID generated", {
2858
2855
  sessionId: i,
2859
2856
  windowId: o,
@@ -2863,7 +2860,7 @@ var no = 3e3, ro = class {
2863
2860
  sessionPastMaximumLength: s
2864
2861
  }
2865
2862
  }), a = n, c = !0) : o || (o = this.fi(), c = !0);
2866
- var d = et(r) && e && !s ? r : n, f = et(a) ? a : (/* @__PURE__ */ new Date()).getTime();
2863
+ var d = tt(r) && e && !s ? r : n, f = tt(a) ? a : (/* @__PURE__ */ new Date()).getTime();
2867
2864
  return this.Ii(o), this.bi(i, d, f), e || this.pi(), c && this.li.forEach(((e) => e(i, o, c ? {
2868
2865
  noSessionId: l,
2869
2866
  activityTimeout: u,
@@ -2892,10 +2889,10 @@ var no = 3e3, ro = class {
2892
2889
  }, po = function(e, t) {
2893
2890
  if (!e) return !1;
2894
2891
  var n = e.userAgent;
2895
- if (n && He(n, t)) return !0;
2892
+ if (n && Ue(n, t)) return !0;
2896
2893
  try {
2897
2894
  var r = e?.userAgentData;
2898
- if (r != null && r.brands && r.brands.some(((e) => He(e?.brand, t)))) return !0;
2895
+ if (r != null && r.brands && r.brands.some(((e) => Ue(e?.brand, t)))) return !0;
2899
2896
  } catch {}
2900
2897
  return !!e.webdriver;
2901
2898
  }, mo = function(e, t) {
@@ -2939,7 +2936,7 @@ var go = {
2939
2936
  function vo(e, t) {
2940
2937
  return !e || Object.entries(e).every(((e) => {
2941
2938
  var [n, r] = e, i = t?.[n];
2942
- if (z(i) || Qe(i)) return !1;
2939
+ if (R(i) || $e(i)) return !1;
2943
2940
  var a = [String(i)], o = go[r.operator];
2944
2941
  return !!o && o(r.values, a);
2945
2942
  }));
@@ -3000,7 +2997,7 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3000
2997
  }
3001
2998
  ur(e, t) {
3002
2999
  var n;
3003
- (n = N.__PosthogExtensions__) == null || n.loadExternalDependency == null || n.loadExternalDependency(this._instance, e, ((e) => {
3000
+ (n = M.__PosthogExtensions__) == null || n.loadExternalDependency == null || n.loadExternalDependency(this._instance, e, ((e) => {
3004
3001
  if (e) return Oo.error("failed to load script", e);
3005
3002
  t();
3006
3003
  }));
@@ -3008,25 +3005,25 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3008
3005
  startIfEnabledOrStop() {
3009
3006
  var e = this, t = function(t) {
3010
3007
  var n, i, a;
3011
- !r || (n = N.__PosthogExtensions__) != null && (n = n.integrations) != null && n[t] || e.ur(ko[t], (() => {
3008
+ !r || (n = M.__PosthogExtensions__) != null && (n = n.integrations) != null && n[t] || e.ur(ko[t], (() => {
3012
3009
  var n;
3013
- (n = N.__PosthogExtensions__) == null || (n = n.integrations) == null || (n = n[t]) == null || n.start(e._instance);
3014
- })), !r && (i = N.__PosthogExtensions__) != null && (i = i.integrations) != null && i[t] && ((a = N.__PosthogExtensions__) == null || (a = a.integrations) == null || (a = a[t]) == null || a.stop());
3010
+ (n = M.__PosthogExtensions__) == null || (n = n.integrations) == null || (n = n[t]) == null || n.start(e._instance);
3011
+ })), !r && (i = M.__PosthogExtensions__) != null && (i = i.integrations) != null && i[t] && ((a = M.__PosthogExtensions__) == null || (a = a.integrations) == null || (a = a[t]) == null || a.stop());
3015
3012
  };
3016
3013
  for (var [n, r] of Object.entries((i = this._instance.config.integrations) ?? {})) {
3017
3014
  var i;
3018
3015
  t(n);
3019
3016
  }
3020
3017
  }
3021
- }, jo, Mo = {}, No = 0, Po = () => {}, Fo = "Consent opt in/out is not valid with cookieless_mode=\"always\" and will be ignored", Io = "Surveys module not available", Lo = "sanitize_properties is deprecated. Use before_send instead", Ro = "Invalid value for property_denylist config: ", zo = "posthog", Bo = !qa && Fe?.indexOf("MSIE") === -1 && Fe?.indexOf("Mozilla") === -1, Vo = (e) => {
3018
+ }, jo, Mo = {}, No = 0, Po = () => {}, Fo = "Consent opt in/out is not valid with cookieless_mode=\"always\" and will be ignored", Io = "Surveys module not available", Lo = "sanitize_properties is deprecated. Use before_send instead", Ro = "Invalid value for property_denylist config: ", zo = "posthog", Bo = !qa && Ie?.indexOf("MSIE") === -1 && Ie?.indexOf("Mozilla") === -1, Vo = (e) => {
3022
3019
  var t;
3023
- return F({
3020
+ return P({
3024
3021
  api_host: "https://us.i.posthog.com",
3025
3022
  flags_api_host: null,
3026
3023
  ui_host: null,
3027
3024
  token: "",
3028
3025
  autocapture: !0,
3029
- cross_subdomain_cookie: li(M?.location),
3026
+ cross_subdomain_cookie: li(j?.location),
3030
3027
  persistence: "localStorage+cookie",
3031
3028
  persistence_name: "",
3032
3029
  cookie_persisted_properties: [],
@@ -3039,7 +3036,7 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3039
3036
  defaults: e ?? "unset",
3040
3037
  __preview_deferred_init_extensions: !1,
3041
3038
  __preview_external_dependency_versioned_paths: !1,
3042
- debug: Ae && B(Ae?.search) && Ae.search.indexOf("__posthog_debug=true") !== -1 || !1,
3039
+ debug: je && z(je?.search) && je.search.indexOf("__posthog_debug=true") !== -1 || !1,
3043
3040
  cookie_expiration: 365,
3044
3041
  upgrade: !1,
3045
3042
  disable_session_recording: !1,
@@ -3051,7 +3048,7 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3051
3048
  disable_product_tours: !1,
3052
3049
  disable_external_dependency_loading: !1,
3053
3050
  enable_recording_console_log: void 0,
3054
- secure_cookie: (A == null || (t = A.location) == null ? void 0 : t.protocol) === "https:",
3051
+ secure_cookie: (k == null || (t = k.location) == null ? void 0 : t.protocol) === "https:",
3055
3052
  ip: !1,
3056
3053
  opt_out_capturing_by_default: !1,
3057
3054
  opt_out_persistence_by_default: !1,
@@ -3111,9 +3108,9 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3111
3108
  ["verbose", "debug"]
3112
3109
  ], Uo = (e) => {
3113
3110
  var t = {};
3114
- for (var [n, r] of Ho) z(e[n]) || (t[r] = e[n]);
3111
+ for (var [n, r] of Ho) R(e[n]) || (t[r] = e[n]);
3115
3112
  var i = K({}, t, e);
3116
- return L(e.property_blacklist) && (z(e.property_denylist) ? i.property_denylist = e.property_blacklist : L(e.property_denylist) ? i.property_denylist = [...e.property_blacklist, ...e.property_denylist] : U.error(Ro + e.property_denylist)), i;
3113
+ return I(e.property_blacklist) && (R(e.property_denylist) ? i.property_denylist = e.property_blacklist : I(e.property_denylist) ? i.property_denylist = [...e.property_blacklist, ...e.property_denylist] : U.error(Ro + e.property_denylist)), i;
3117
3114
  }, Wo = class {
3118
3115
  constructor() {
3119
3116
  this.__forceAllowLocalhost = !1;
@@ -3144,7 +3141,7 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3144
3141
  return (e = this.featureFlags?.hasLoadedFlags) != null && e;
3145
3142
  }
3146
3143
  constructor() {
3147
- this.webPerformance = new Wo(), this.Mi = !1, this.version = P.LIB_VERSION, this.Fi = new lo(), this.Ri = [], this._calculate_event_properties = this.calculateEventProperties.bind(this), this.config = Vo(), this.SentryIntegration = Pi, this.sentryIntegration = (e) => function(e, t) {
3144
+ this.webPerformance = new Wo(), this.Mi = !1, this.version = N.LIB_VERSION, this.Fi = new lo(), this.Ri = [], this._calculate_event_properties = this.calculateEventProperties.bind(this), this.config = Vo(), this.SentryIntegration = Pi, this.sentryIntegration = (e) => function(e, t) {
3148
3145
  var n = Ni(e, t);
3149
3146
  return {
3150
3147
  name: Mi,
@@ -3154,11 +3151,11 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3154
3151
  var t = e.__defaultExtensionClasses ?? {};
3155
3152
  this.featureFlags = t.featureFlags && new t.featureFlags(this), this.toolbar = t.toolbar && new t.toolbar(this), this.surveys = t.surveys && new t.surveys(this), this.conversations = t.conversations && new t.conversations(this), this.logs = t.logs && new t.logs(this), this.experiments = t.experiments && new t.experiments(this), this.exceptions = t.exceptions && new t.exceptions(this), this.people = {
3156
3153
  set: (e, t, n) => {
3157
- var r = B(e) ? { [e]: t } : e;
3154
+ var r = z(e) ? { [e]: t } : e;
3158
3155
  this.setPersonProperties(r), n?.({});
3159
3156
  },
3160
3157
  set_once: (e, t, n) => {
3161
- var r = B(e) ? { [e]: t } : e;
3158
+ var r = z(e) ? { [e]: t } : e;
3162
3159
  this.setPersonProperties(void 0, r), n?.({});
3163
3160
  }
3164
3161
  }, this.on("eventCaptured", ((e) => U.info("send \"" + e?.event + "\"", e)));
@@ -3172,26 +3169,26 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3172
3169
  }
3173
3170
  _init(e, t, n) {
3174
3171
  var r;
3175
- if (t === void 0 && (t = {}), z(e) || Ze(e)) return U.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"), this;
3172
+ if (t === void 0 && (t = {}), R(e) || Qe(e)) return U.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"), this;
3176
3173
  if (this.__loaded) return console.warn("[PostHog.js]", "You have already initialized PostHog! Re-initializing is a no-op"), this;
3177
3174
  this.__loaded = !0, this.config = {}, t.debug = this.Bi(t.debug), this.ji = t, this.$i = [], t.person_profiles ? this.Li = t.person_profiles : t.process_person && (this.Li = t.process_person), this.set_config(K({}, Vo(t.defaults), Uo(t), {
3178
3175
  name: n,
3179
3176
  token: e
3180
3177
  })), this.config.on_xhr_error && U.error("on_xhr_error is deprecated. Use on_request_error instead"), this.compression = t.disable_compression ? void 0 : ga.GZipJS;
3181
3178
  var i = this.qi();
3182
- this.persistence = new ia(this.config, i), this.sessionPersistence = this.config.persistence === "sessionStorage" || this.config.persistence === "memory" ? this.persistence : new ia(F({}, this.config, { persistence: "sessionStorage" }), i);
3183
- var a = F({}, this.persistence.props), o = F({}, this.sessionPersistence.props);
3179
+ this.persistence = new ia(this.config, i), this.sessionPersistence = this.config.persistence === "sessionStorage" || this.config.persistence === "memory" ? this.persistence : new ia(P({}, this.config, { persistence: "sessionStorage" }), i);
3180
+ var a = P({}, this.persistence.props), o = P({}, this.sessionPersistence.props);
3184
3181
  this.register({ $initialization_time: (/* @__PURE__ */ new Date()).toISOString() }), this.Zi = new ro(((e) => this.Hi(e)), this.config.request_queue_config), this.Vi = new ao(this), this.__request_queue = [];
3185
3182
  var s = this.Ni();
3186
3183
  if (s || (this.sessionManager = new fo(this), this.sessionPropsManager = new co(this, this.sessionManager, this.persistence)), this.config.__preview_deferred_init_extensions ? (U.info("Deferring extension initialization to improve startup performance"), setTimeout((() => {
3187
3184
  this.zi(s);
3188
- }), 0)) : (U.info("Initializing extensions synchronously"), this.zi(s)), P.DEBUG = P.DEBUG || this.config.debug, P.DEBUG && U.info("Starting in debug mode", {
3185
+ }), 0)) : (U.info("Initializing extensions synchronously"), this.zi(s)), N.DEBUG = N.DEBUG || this.config.debug, N.DEBUG && U.info("Starting in debug mode", {
3189
3186
  this: this,
3190
3187
  config: t,
3191
- thisC: F({}, this.config),
3188
+ thisC: P({}, this.config),
3192
3189
  p: a,
3193
3190
  s: o
3194
- }), !this.config.identity_distinct_id || (r = t.bootstrap) != null && r.distinctID || (t.bootstrap = F({}, t.bootstrap, {
3191
+ }), !this.config.identity_distinct_id || (r = t.bootstrap) != null && r.distinctID || (t.bootstrap = P({}, t.bootstrap, {
3195
3192
  distinctID: this.config.identity_distinct_id,
3196
3193
  isIdentifiedID: !0
3197
3194
  })), t.bootstrap?.distinctID !== void 0) {
@@ -3217,7 +3214,7 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3217
3214
  $device_id: p
3218
3215
  }, ""), this.persistence.set_property(Nr, Jr);
3219
3216
  }
3220
- return q(A, "onpagehide" in self ? "pagehide" : "unload", this._handle_unload.bind(this), { passive: !1 }), t.segment ? function(e, t) {
3217
+ return q(k, "onpagehide" in self ? "pagehide" : "unload", this._handle_unload.bind(this), { passive: !1 }), t.segment ? function(e, t) {
3221
3218
  var n = e.config.segment;
3222
3219
  if (!n) return t();
3223
3220
  (function(e, t) {
@@ -3230,7 +3227,7 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3230
3227
  $device_id: r()
3231
3228
  }), e.persistence.set_property(Nr, Yr)), t();
3232
3229
  }, i = n.user();
3233
- "then" in i && Ye(i.then) ? i.then(r) : r(i);
3230
+ "then" in i && Xe(i.then) ? i.then(r) : r(i);
3234
3231
  })(e, (() => {
3235
3232
  n.register(((e) => {
3236
3233
  Promise && Promise.resolve || ji.warn("This browser does not have Promise support, and can not use the segment integration");
@@ -3255,10 +3252,10 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3255
3252
  t();
3256
3253
  }));
3257
3254
  }));
3258
- }(this, (() => this.Ui())) : this.Ui(), Ye(this.config._onCapture) && this.config._onCapture !== Po && (U.warn("onCapture is deprecated. Please use `before_send` instead"), this.on("eventCaptured", ((e) => this.config._onCapture(e.event, e)))), this.config.ip && U.warn("The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or \"Discard IP data\" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information."), this;
3255
+ }(this, (() => this.Ui())) : this.Ui(), Xe(this.config._onCapture) && this.config._onCapture !== Po && (U.warn("onCapture is deprecated. Please use `before_send` instead"), this.on("eventCaptured", ((e) => this.config._onCapture(e.event, e)))), this.config.ip && U.warn("The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or \"Discard IP data\" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information."), this;
3259
3256
  }
3260
3257
  zi(t) {
3261
- var n = performance.now(), r = F({}, e.__defaultExtensionClasses, this.config.__extensionClasses), i = [];
3258
+ var n = performance.now(), r = P({}, e.__defaultExtensionClasses, this.config.__extensionClasses), i = [];
3262
3259
  r.featureFlags && this.Ri.push(this.featureFlags = this.featureFlags ?? new r.featureFlags(this)), r.exceptions && this.Ri.push(this.exceptions = this.exceptions ?? new r.exceptions(this)), r.historyAutocapture && this.Ri.push(this.historyAutocapture = new r.historyAutocapture(this)), r.tracingHeaders && this.Ri.push(new r.tracingHeaders(this)), r.siteApps && this.Ri.push(this.siteApps = new r.siteApps(this)), r.sessionRecording && !t && this.Ri.push(this.sessionRecording = new r.sessionRecording(this)), this.config.disable_scroll_properties || i.push((() => {
3263
3260
  this.scrollManager.startMeasuringScrollPosition();
3264
3261
  })), r.autocapture && this.Ri.push(this.autocapture = new r.autocapture(this)), r.surveys && this.Ri.push(this.surveys = this.surveys ?? new r.surveys(this)), r.logs && this.Ri.push(this.logs = this.logs ?? new r.logs(this)), r.conversations && this.Ri.push(this.conversations = this.conversations ?? new r.conversations(this)), r.productTours && this.Ri.push(this.productTours = new r.productTours(this)), r.heatmaps && this.Ri.push(this.heatmaps = new r.heatmaps(this)), r.webVitalsAutocapture && this.Ri.push(this.webVitalsAutocapture = new r.webVitalsAutocapture(this)), r.exceptionObserver && this.Ri.push(this.exceptionObserver = new r.exceptionObserver(this)), r.deadClicksAutocapture && this.Ri.push(this.deadClicksAutocapture = new r.deadClicksAutocapture(this, ki)), r.toolbar && this.Ri.push(this.toolbar = this.toolbar ?? new r.toolbar(this)), r.experiments && this.Ri.push(this.experiments = this.experiments ?? new r.experiments(this)), this.Ri.forEach(((e) => {
@@ -3292,10 +3289,10 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3292
3289
  }
3293
3290
  Nr(e) {
3294
3291
  var t;
3295
- if (!M || !M.body) return U.info("document not ready yet, trying again in 500 milliseconds..."), void setTimeout((() => {
3292
+ if (!j || !j.body) return U.info("document not ready yet, trying again in 500 milliseconds..."), void setTimeout((() => {
3296
3293
  this.Nr(e);
3297
3294
  }), 500);
3298
- this.config.__preview_deferred_init_extensions && (this.Yi = e), this.Wi = e, this.compression = void 0, e.supportedCompression && !this.config.disable_compression && (this.compression = I(e.supportedCompression, ga.GZipJS) ? ga.GZipJS : I(e.supportedCompression, ga.Base64) ? ga.Base64 : void 0), (t = e.analytics) != null && t.endpoint && (this.analyticsDefaultEndpoint = e.analytics.endpoint), this.set_config({ person_profiles: this.Li ? this.Li : Xr }), this.Ri.forEach(((t) => t.onRemoteConfig == null ? void 0 : t.onRemoteConfig(e)));
3295
+ this.config.__preview_deferred_init_extensions && (this.Yi = e), this.Wi = e, this.compression = void 0, e.supportedCompression && !this.config.disable_compression && (this.compression = F(e.supportedCompression, ga.GZipJS) ? ga.GZipJS : F(e.supportedCompression, ga.Base64) ? ga.Base64 : void 0), (t = e.analytics) != null && t.endpoint && (this.analyticsDefaultEndpoint = e.analytics.endpoint), this.set_config({ person_profiles: this.Li ? this.Li : Xr }), this.Ri.forEach(((t) => t.onRemoteConfig == null ? void 0 : t.onRemoteConfig(e)));
3299
3296
  }
3300
3297
  Ui() {
3301
3298
  try {
@@ -3303,8 +3300,8 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3303
3300
  } catch (e) {
3304
3301
  U.critical("`loaded` function failed", e);
3305
3302
  }
3306
- if (this.Xi(), this.config.internal_or_test_user_hostname && Ae != null && Ae.hostname) {
3307
- var e = Ae.hostname, t = this.config.internal_or_test_user_hostname;
3303
+ if (this.Xi(), this.config.internal_or_test_user_hostname && je != null && je.hostname) {
3304
+ var e = je.hostname, t = this.config.internal_or_test_user_hostname;
3308
3305
  (typeof t == "string" ? e === t : t.test(e)) && this.setInternalOrTestUser();
3309
3306
  }
3310
3307
  this.config.capture_pageview && setTimeout((() => {
@@ -3323,23 +3320,23 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3323
3320
  (e = this.surveys) == null || e.handlePageUnload(), this.config.request_batching ? (this.Qi() && this.capture(ei), (t = this.logs) == null || t.flushLogs("sendBeacon"), (n = this.Zi) == null || n.unload(), (r = this.Vi) == null || r.unload()) : this.Qi() && this.capture(ei, null, { transport: "sendBeacon" });
3324
3321
  }
3325
3322
  _send_request(e) {
3326
- this.__loaded && (Bo ? this.__request_queue.push(e) : this.rateLimiter.isServerRateLimited(e.batchKey) || (e.transport = e.transport || this.config.api_transport, e.url = Xa(e.url, { ip: +!!this.config.ip }), e.headers = F({}, this.config.request_headers, e.headers), e.compression = e.compression === "best-available" ? this.compression : e.compression, e.disableXHRCredentials = this.config.__preview_disable_xhr_credentials, this.config.__preview_disable_beacon && (e.disableTransport = ["sendBeacon"]), e.fetchOptions = e.fetchOptions || this.config.fetch_options, ((e) => {
3327
- var t = F({}, e);
3323
+ this.__loaded && (Bo ? this.__request_queue.push(e) : this.rateLimiter.isServerRateLimited(e.batchKey) || (e.transport = e.transport || this.config.api_transport, e.url = Xa(e.url, { ip: +!!this.config.ip }), e.headers = P({}, this.config.request_headers, e.headers), e.compression = e.compression === "best-available" ? this.compression : e.compression, e.disableXHRCredentials = this.config.__preview_disable_xhr_credentials, this.config.__preview_disable_beacon && (e.disableTransport = ["sendBeacon"]), e.fetchOptions = e.fetchOptions || this.config.fetch_options, ((e) => {
3324
+ var t = P({}, e);
3328
3325
  t.timeout = t.timeout || 6e4, t.url = eo(t.url, t.compression);
3329
3326
  var n = t.transport ?? "fetch", r = to.filter(((e) => !t.disableTransport || !e.transport || !t.disableTransport.includes(e.transport))), i = function(e, t) {
3330
3327
  for (var r = 0; e.length > r; r++) if (e[r].transport === n) return e[r];
3331
3328
  }(r)?.method ?? r[0].method;
3332
3329
  if (!i) throw Error("No available transport method");
3333
- n !== "sendBeacon" && t.data && t.compression === ga.GZipJS && Pe && !Ya ? $a(t).then(((e) => {
3330
+ n !== "sendBeacon" && t.data && t.compression === ga.GZipJS && Fe && !Ya ? $a(t).then(((e) => {
3334
3331
  i(e);
3335
3332
  })).catch(((n) => {
3336
- if (((e) => !(!e || typeof e != "object") && ("name" in e ? String(e.name) : "") === "NotReadableError")(n)) return Ya = !0, void i(F({}, t, {
3333
+ if (((e) => !(!e || typeof e != "object") && ("name" in e ? String(e.name) : "") === "NotReadableError")(n)) return Ya = !0, void i(P({}, t, {
3337
3334
  compression: void 0,
3338
3335
  url: eo(e.url, void 0)
3339
3336
  }));
3340
3337
  i(t);
3341
3338
  })) : i(t);
3342
- })(F({}, e, { callback: (t) => {
3339
+ })(P({}, e, { callback: (t) => {
3343
3340
  var n, r;
3344
3341
  this.rateLimiter.checkForLimiting(t), 400 > t.statusCode || (n = (r = this.config).on_request_error) == null || n.call(r, t), e.callback == null || e.callback(t);
3345
3342
  } }))));
@@ -3352,11 +3349,11 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3352
3349
  try {
3353
3350
  var t, n = [], r = [], i = [];
3354
3351
  ri(e, ((e) => {
3355
- e && (L(t = e[0]) ? i.push(e) : Ye(e) ? e.call(this) : L(e) && t === "alias" ? n.push(e) : L(e) && t.indexOf("capture") !== -1 && Ye(this[t]) ? i.push(e) : r.push(e));
3352
+ e && (I(t = e[0]) ? i.push(e) : Xe(e) ? e.call(this) : I(e) && t === "alias" ? n.push(e) : I(e) && t.indexOf("capture") !== -1 && Xe(this[t]) ? i.push(e) : r.push(e));
3356
3353
  }));
3357
3354
  var a = function(e, t) {
3358
3355
  ri(e, (function(e) {
3359
- if (L(e[0])) {
3356
+ if (I(e[0])) {
3360
3357
  var n = t;
3361
3358
  G(e, (function(e) {
3362
3359
  n = n[e[0]].apply(n, e.slice(1));
@@ -3370,20 +3367,20 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3370
3367
  }
3371
3368
  }
3372
3369
  push(t) {
3373
- if (No > 0 && L(t) && B(t[0])) {
3370
+ if (No > 0 && I(t) && z(t[0])) {
3374
3371
  var n = e.prototype[t[0]];
3375
- Ye(n) && n.apply(this, t.slice(1));
3372
+ Xe(n) && n.apply(this, t.slice(1));
3376
3373
  } else this._execute_array([t]);
3377
3374
  }
3378
3375
  capture(e, t, n) {
3379
3376
  var r, i, a, o;
3380
3377
  if (this.__loaded && this.persistence && this.sessionPersistence && this.Zi) {
3381
- if (this.is_capturing()) if (!z(e) && B(e)) {
3378
+ if (this.is_capturing()) if (!R(e) && z(e)) {
3382
3379
  var s = !this.config.opt_out_useragent_filter && this._is_bot();
3383
3380
  if (!s || this.config.__preview_capture_bot_pageviews) {
3384
3381
  var c = n != null && n.skip_client_rate_limiting ? void 0 : this.rateLimiter.clientRateLimitContext();
3385
3382
  if (c == null || !c.isRateLimited) {
3386
- t != null && t.$current_url && !B(t?.$current_url) && (U.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."), t == null || delete t.$current_url), e !== "$exception" || n != null && n.en || U.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."), this.sessionPersistence.update_search_keyword(), this.config.save_campaign_params && this.sessionPersistence.update_campaign_params(), this.config.save_referrer && this.sessionPersistence.update_referrer_info(), (this.config.save_campaign_params || this.config.save_referrer) && this.persistence.set_initial_person_info();
3383
+ t != null && t.$current_url && !z(t?.$current_url) && (U.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."), t == null || delete t.$current_url), e !== "$exception" || n != null && n.en || U.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."), this.sessionPersistence.update_search_keyword(), this.config.save_campaign_params && this.sessionPersistence.update_campaign_params(), this.config.save_referrer && this.sessionPersistence.update_referrer_info(), (this.config.save_campaign_params || this.config.save_referrer) && this.persistence.set_initial_person_info();
3387
3384
  var l = /* @__PURE__ */ new Date(), u = n?.timestamp || l, d = gi(), f = {
3388
3385
  uuid: d,
3389
3386
  event: e,
@@ -3391,14 +3388,14 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3391
3388
  };
3392
3389
  e === $r && this.config.__preview_capture_bot_pageviews && s && (f.event = "$bot_pageview", f.properties.$browser_type = "bot"), c && (f.properties.$lib_rate_limit_remaining_tokens = c.remainingTokens), n != null && n.$set && (f.$set = n?.$set);
3393
3390
  var p, m, h, g = this.tn(n?.$set_once, e !== ni, e === ti);
3394
- if (g && (f.$set_once = g), n != null && n._noTruncate || (r = this.config.properties_string_max_length, i = f, a = (e) => B(e) ? e.slice(0, r) : e, o = /* @__PURE__ */ new Set(), f = function e(t, n) {
3395
- return t === Object(t) ? o.has(t) ? void 0 : (o.add(t), L(t) ? (r = [], ri(t, ((t) => {
3391
+ if (g && (f.$set_once = g), n != null && n._noTruncate || (r = this.config.properties_string_max_length, i = f, a = (e) => z(e) ? e.slice(0, r) : e, o = /* @__PURE__ */ new Set(), f = function e(t, n) {
3392
+ return t === Object(t) ? o.has(t) ? void 0 : (o.add(t), I(t) ? (r = [], ri(t, ((t) => {
3396
3393
  r.push(e(t));
3397
3394
  }))) : (r = {}, G(t, ((t, n) => {
3398
3395
  o.has(t) || (r[n] = e(t, n));
3399
3396
  }))), r) : a ? a(t) : t;
3400
3397
  var r;
3401
- }(i)), f.timestamp = u, z(n?.timestamp) || (f.properties.$event_time_override_provided = !0, f.properties.$event_time_override_system_time = l), e === sa.DISMISSED || e === sa.SENT) {
3398
+ }(i)), f.timestamp = u, R(n?.timestamp) || (f.properties.$event_time_override_provided = !0, f.properties.$event_time_override_system_time = l), e === sa.DISMISSED || e === sa.SENT) {
3402
3399
  var _ = t?.[ca.SURVEY_ID], v = t?.[ca.SURVEY_ITERATION];
3403
3400
  ((e) => {
3404
3401
  try {
@@ -3414,17 +3411,17 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3414
3411
  })({
3415
3412
  id: _,
3416
3413
  current_iteration: v
3417
- }), f.$set = F({}, f.$set, { [(p = {
3414
+ }), f.$set = P({}, f.$set, { [(p = {
3418
3415
  id: _,
3419
3416
  current_iteration: v
3420
3417
  }, m = e === sa.SENT ? "responded" : "dismissed", h = "$survey_" + m + "/" + p.id, p.current_iteration && p.current_iteration > 0 && (h = "$survey_" + m + "/" + p.id + "/" + p.current_iteration), h)]: !0 });
3421
- } else e === sa.SHOWN && (f.$set = F({}, f.$set, { [ca.SURVEY_LAST_SEEN_DATE]: (/* @__PURE__ */ new Date()).toISOString() }));
3418
+ } else e === sa.SHOWN && (f.$set = P({}, f.$set, { [ca.SURVEY_LAST_SEEN_DATE]: (/* @__PURE__ */ new Date()).toISOString() }));
3422
3419
  if (e === ua.SHOWN) {
3423
3420
  var y = t?.[da.TOUR_TYPE];
3424
- y && (f.$set = F({}, f.$set, { [da.TOUR_LAST_SEEN_DATE + "/" + y]: (/* @__PURE__ */ new Date()).toISOString() }));
3421
+ y && (f.$set = P({}, f.$set, { [da.TOUR_LAST_SEEN_DATE + "/" + y]: (/* @__PURE__ */ new Date()).toISOString() }));
3425
3422
  }
3426
- var b = F({}, f.properties.$set, f.$set);
3427
- if (Xe(b) || this.setPersonPropertiesForFlags(b), !V(this.config.before_send)) {
3423
+ var b = P({}, f.properties.$set, f.$set);
3424
+ if (Ze(b) || this.setPersonPropertiesForFlags(b), !B(this.config.before_send)) {
3428
3425
  var x = this.rn(f);
3429
3426
  if (!x) return;
3430
3427
  f = x;
@@ -3449,49 +3446,49 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3449
3446
  }
3450
3447
  calculateEventProperties(e, t, n, r, i) {
3451
3448
  if (n ||= /* @__PURE__ */ new Date(), !this.persistence || !this.sessionPersistence) return t;
3452
- var a = i ? void 0 : this.persistence.remove_event_timer(e), o = F({}, t);
3449
+ var a = i ? void 0 : this.persistence.remove_event_timer(e), o = P({}, t);
3453
3450
  if (o.token = this.config.token, o.$config_defaults = this.config.defaults, this.Ni() && (o.$cookieless_mode = !0), e === "$snapshot") {
3454
- var s = F({}, this.persistence.properties(), this.sessionPersistence.properties());
3455
- return o.distinct_id = s.distinct_id, (!B(o.distinct_id) && !$e(o.distinct_id) || Ze(o.distinct_id)) && U.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"), o;
3451
+ var s = P({}, this.persistence.properties(), this.sessionPersistence.properties());
3452
+ return o.distinct_id = s.distinct_id, (!z(o.distinct_id) && !et(o.distinct_id) || Qe(o.distinct_id)) && U.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"), o;
3456
3453
  }
3457
3454
  var c, l = function(e, t) {
3458
3455
  var n, r, i;
3459
- if (!Fe) return {};
3456
+ if (!Ie) return {};
3460
3457
  var a, o, s, c, l = e ? [...Ui, ...t || []] : [], [u, d] = function(e) {
3461
3458
  for (var t = 0; ln.length > t; t++) {
3462
- var [n, r] = ln[t], i = n.exec(e), a = i && (Ye(r) ? r(i, e) : r);
3459
+ var [n, r] = ln[t], i = n.exec(e), a = i && (Xe(r) ? r(i, e) : r);
3463
3460
  if (a) return a;
3464
3461
  }
3465
3462
  return ["", ""];
3466
- }(Fe);
3463
+ }(Ie);
3467
3464
  return K(si({
3468
3465
  $os: u,
3469
3466
  $os_version: d,
3470
- $browser: on(Fe, navigator.vendor),
3471
- $device: un(Fe),
3472
- $device_type: (o = Fe, s = {
3467
+ $browser: on(Ie, navigator.vendor),
3468
+ $device: un(Ie),
3469
+ $device_type: (o = Ie, s = {
3473
3470
  userAgentDataPlatform: (n = navigator) == null || (n = n.userAgentData) == null ? void 0 : n.platform,
3474
3471
  maxTouchPoints: navigator?.maxTouchPoints,
3475
- screenWidth: A == null || (r = A.screen) == null ? void 0 : r.width,
3476
- screenHeight: A == null || (i = A.screen) == null ? void 0 : i.height,
3477
- devicePixelRatio: A?.devicePixelRatio
3478
- }, c = un(o), c === xt || c === bt || c === "Kobo" || c === "Kindle Fire" || c === Zt ? yt : c === Bt || c === Ht || c === Vt || c === Jt ? "Console" : c === Ct ? "Wearable" : c ? gt : s?.userAgentDataPlatform === "Android" && (s?.maxTouchPoints ?? 0) > 0 ? 600 > Math.min(s?.screenWidth ?? 0, s?.screenHeight ?? 0) / (s?.devicePixelRatio ?? 1) ? gt : yt : "Desktop"),
3472
+ screenWidth: k == null || (r = k.screen) == null ? void 0 : r.width,
3473
+ screenHeight: k == null || (i = k.screen) == null ? void 0 : i.height,
3474
+ devicePixelRatio: k?.devicePixelRatio
3475
+ }, c = un(o), c === xt || c === bt || c === "Kobo" || c === "Kindle Fire" || c === Zt ? yt : c === Bt || c === Ht || c === Vt || c === Jt ? "Console" : c === Ct ? "Wearable" : c ? V : s?.userAgentDataPlatform === "Android" && (s?.maxTouchPoints ?? 0) > 0 ? 600 > Math.min(s?.screenWidth ?? 0, s?.screenHeight ?? 0) / (s?.devicePixelRatio ?? 1) ? V : yt : "Desktop"),
3479
3476
  $timezone: ta(),
3480
3477
  $timezone_offset: na()
3481
3478
  }), {
3482
- $current_url: Bi(Ae?.href, l, Gi),
3483
- $host: Ae?.host,
3484
- $pathname: Ae?.pathname,
3485
- $raw_user_agent: Fe.length > 1e3 ? Fe.substring(0, 997) + "..." : Fe,
3486
- $browser_version: cn(Fe, navigator.vendor),
3479
+ $current_url: Bi(je?.href, l, Gi),
3480
+ $host: je?.host,
3481
+ $pathname: je?.pathname,
3482
+ $raw_user_agent: Ie.length > 1e3 ? Ie.substring(0, 997) + "..." : Ie,
3483
+ $browser_version: cn(Ie, navigator.vendor),
3487
3484
  $browser_language: Xi(),
3488
3485
  $browser_language_prefix: (a = Xi(), typeof a == "string" ? a.split("-")[0] : void 0),
3489
- $screen_height: A?.screen.height,
3490
- $screen_width: A?.screen.width,
3491
- $viewport_height: A?.innerHeight,
3492
- $viewport_width: A?.innerWidth,
3493
- $lib: P.LIB_NAME,
3494
- $lib_version: P.LIB_VERSION,
3486
+ $screen_height: k?.screen.height,
3487
+ $screen_width: k?.screen.width,
3488
+ $viewport_height: k?.innerHeight,
3489
+ $viewport_width: k?.innerWidth,
3490
+ $lib: N.LIB_NAME,
3491
+ $lib_version: N.LIB_VERSION,
3495
3492
  $insert_id: Math.random().toString(36).substring(2, 10) + Math.random().toString(36).substring(2, 10),
3496
3493
  $time: Date.now() / 1e3
3497
3494
  });
@@ -3506,11 +3503,11 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3506
3503
  } catch (e) {
3507
3504
  o.$sdk_debug_error_capturing_properties = String(e);
3508
3505
  }
3509
- if (this.requestRouter.region === xo && (o.$lib_custom_api_host = this.config.api_host), c = e !== $r || i ? e !== ei || i ? this.pageViewManager.doEvent() : this.pageViewManager.doPageLeave(n) : this.pageViewManager.doPageView(n, r), o = K(o, c), e === $r && M && (o.title = M.title), !z(a)) {
3506
+ if (this.requestRouter.region === xo && (o.$lib_custom_api_host = this.config.api_host), c = e !== $r || i ? e !== ei || i ? this.pageViewManager.doEvent() : this.pageViewManager.doPageLeave(n) : this.pageViewManager.doPageView(n, r), o = K(o, c), e === $r && j && (o.title = j.title), !R(a)) {
3510
3507
  var f = n.getTime() - a;
3511
3508
  o.$duration = parseFloat((f / 1e3).toFixed(3));
3512
3509
  }
3513
- Fe && this.config.opt_out_useragent_filter && (o.$browser_type = this._is_bot() ? "bot" : "browser"), (o = K({}, l, this.persistence.properties(), this.sessionPersistence.properties(), o)).$is_identified = this._isIdentified(), L(this.config.property_denylist) ? G(this.config.property_denylist, (function(e) {
3510
+ Ie && this.config.opt_out_useragent_filter && (o.$browser_type = this._is_bot() ? "bot" : "browser"), (o = K({}, l, this.persistence.properties(), this.sessionPersistence.properties(), o)).$is_identified = this._isIdentified(), I(this.config.property_denylist) ? G(this.config.property_denylist, (function(e) {
3514
3511
  delete o[e];
3515
3512
  })) : U.error(Ro + this.config.property_denylist + " or property_blacklist config: " + this.config.property_blacklist);
3516
3513
  var p = this.config.sanitize_properties;
@@ -3521,7 +3518,7 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3521
3518
  tn(e, t, n) {
3522
3519
  if (t === void 0 && (t = !0), n === void 0 && (n = !1), !this.persistence || !this.nn() || this.Mi && !n) return e;
3523
3520
  var r = K({}, this.persistence.get_initial_props(), this.sessionPropsManager?.getSetOnceProps() || {}, e || {}), i = this.config.sanitize_properties;
3524
- return i && (U.error(Lo), r = i(r, "$set_once")), t && (this.Mi = !0), Xe(r) ? void 0 : r;
3521
+ return i && (U.error(Lo), r = i(r, "$set_once")), t && (this.Mi = !0), Ze(r) ? void 0 : r;
3525
3522
  }
3526
3523
  register(e, t) {
3527
3524
  var n;
@@ -3625,11 +3622,11 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3625
3622
  });
3626
3623
  }
3627
3624
  ln(e) {
3628
- return !e || Ze(e) ? (U.critical("Unique user id has not been set in posthog.identify"), !1) : e === Vr ? (U.critical("The string \"" + e + "\" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value."), !1) : !["distinct_id", "distinctid"].includes(e.toLowerCase()) && !["undefined", "null"].includes(e.toLowerCase()) || (U.critical("The string \"" + e + "\" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string."), !1);
3625
+ return !e || Qe(e) ? (U.critical("Unique user id has not been set in posthog.identify"), !1) : e === Vr ? (U.critical("The string \"" + e + "\" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value."), !1) : !["distinct_id", "distinctid"].includes(e.toLowerCase()) && !["undefined", "null"].includes(e.toLowerCase()) || (U.critical("The string \"" + e + "\" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string."), !1);
3629
3626
  }
3630
3627
  identify(e, t, n) {
3631
3628
  if (!this.__loaded || !this.persistence) return U.uninitializedWarning("posthog.identify");
3632
- if ($e(e) && (e = e.toString(), U.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")), this.ln(e) && this.sn("posthog.identify")) {
3629
+ if (et(e) && (e = e.toString(), U.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")), this.ln(e) && this.sn("posthog.identify")) {
3633
3630
  var r = this.get_distinct_id();
3634
3631
  this.register({ $user_id: e }), this.get_property(Zn) || this.register_once({
3635
3632
  $had_persisted_distinct_id: !0,
@@ -3663,7 +3660,7 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3663
3660
  group(e, t, n) {
3664
3661
  if (e && t) {
3665
3662
  var r = this.getGroups(), i = r[e] !== t;
3666
- if (i && this.resetGroupPropertiesForFlags(e), this.register({ $groups: F({}, r, { [e]: t }) }), i || n) {
3663
+ if (i && this.resetGroupPropertiesForFlags(e), this.register({ $groups: P({}, r, { [e]: t }) }), i || n) {
3667
3664
  var a = {
3668
3665
  $group_type: e,
3669
3666
  $group_key: t
@@ -3737,28 +3734,28 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3737
3734
  return r;
3738
3735
  }
3739
3736
  alias(e, t) {
3740
- return e === this.get_property(Xn) ? (U.critical("Attempting to create alias for existing People user - aborting."), -2) : this.sn("posthog.alias") ? (z(t) && (t = this.get_distinct_id()), e === t ? (U.warn("alias matches current distinct_id - skipping api call."), this.identify(e), -1) : (this.an(Qn, e), this.capture("$create_alias", {
3737
+ return e === this.get_property(Xn) ? (U.critical("Attempting to create alias for existing People user - aborting."), -2) : this.sn("posthog.alias") ? (R(t) && (t = this.get_distinct_id()), e === t ? (U.warn("alias matches current distinct_id - skipping api call."), this.identify(e), -1) : (this.an(Qn, e), this.capture("$create_alias", {
3741
3738
  alias: e,
3742
3739
  distinct_id: t
3743
3740
  }))) : void 0;
3744
3741
  }
3745
3742
  set_config(e) {
3746
- var t = F({}, this.config);
3747
- if (R(e)) {
3743
+ var t = P({}, this.config);
3744
+ if (L(e)) {
3748
3745
  var n, r, i, a, o, s, c, l, u, d;
3749
3746
  K(this.config, Uo(e));
3750
3747
  var f = this.qi();
3751
- (n = this.persistence) == null || n.update_config(this.config, t, f), this.sessionPersistence = this.config.persistence === "sessionStorage" || this.config.persistence === "memory" ? this.persistence : new ia(F({}, this.config, { persistence: "sessionStorage" }), f);
3748
+ (n = this.persistence) == null || n.update_config(this.config, t, f), this.sessionPersistence = this.config.persistence === "sessionStorage" || this.config.persistence === "memory" ? this.persistence : new ia(P({}, this.config, { persistence: "sessionStorage" }), f);
3752
3749
  var p = this.Bi(this.config.debug);
3753
- tt(p) && (this.config.debug = p), tt(this.config.debug) && (this.config.debug ? (P.DEBUG = !0, J.R() && J.M("ph_debug", !0), U.info("set_config", {
3750
+ nt(p) && (this.config.debug = p), nt(this.config.debug) && (this.config.debug ? (N.DEBUG = !0, J.R() && J.M("ph_debug", !0), U.info("set_config", {
3754
3751
  config: e,
3755
3752
  oldConfig: t,
3756
- newConfig: F({}, this.config)
3757
- })) : (P.DEBUG = !1, J.R() && J.F("ph_debug"))), (r = this.exceptionObserver) == null || r.onConfigChange(), (i = this.exceptions) == null || i.onConfigChange(), (a = this.sessionRecording) == null || a.startIfEnabledOrStop(), (o = this.autocapture) == null || o.startIfEnabled(), (s = this.heatmaps) == null || s.startIfEnabled(), (c = this.exceptionObserver) == null || c.startIfEnabledOrStop(), (l = this.deadClicksAutocapture) == null || l.startIfEnabledOrStop(), (u = this.surveys) == null || u.loadIfEnabled(), this.cn(), (d = this.externalIntegrations) == null || d.startIfEnabledOrStop();
3753
+ newConfig: P({}, this.config)
3754
+ })) : (N.DEBUG = !1, J.R() && J.F("ph_debug"))), (r = this.exceptionObserver) == null || r.onConfigChange(), (i = this.exceptions) == null || i.onConfigChange(), (a = this.sessionRecording) == null || a.startIfEnabledOrStop(), (o = this.autocapture) == null || o.startIfEnabled(), (s = this.heatmaps) == null || s.startIfEnabled(), (c = this.exceptionObserver) == null || c.startIfEnabledOrStop(), (l = this.deadClicksAutocapture) == null || l.startIfEnabledOrStop(), (u = this.surveys) == null || u.loadIfEnabled(), this.cn(), (d = this.externalIntegrations) == null || d.startIfEnabledOrStop();
3758
3755
  }
3759
3756
  }
3760
3757
  _overrideSDKInfo(e, t) {
3761
- P.LIB_NAME = e, P.LIB_VERSION = t;
3758
+ N.LIB_NAME = e, N.LIB_VERSION = t;
3762
3759
  }
3763
3760
  startSessionRecording(e) {
3764
3761
  var t, n, r, i, a, o = !0 === e, s = {
@@ -3782,7 +3779,7 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3782
3779
  handled: !0,
3783
3780
  syntheticException: n
3784
3781
  });
3785
- return this.exceptions.sendExceptionEvent(F({}, r, t));
3782
+ return this.exceptions.sendExceptionEvent(P({}, r, t));
3786
3783
  }
3787
3784
  }
3788
3785
  addExceptionStep(e, t) {
@@ -3821,7 +3818,7 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3821
3818
  }
3822
3819
  nn() {
3823
3820
  var e, t;
3824
- return !(this.config.person_profiles === "never" || this.config.person_profiles === Xr && !this._isIdentified() && Xe(this.getGroups()) && ((e = this.persistence) == null || (e = e.props) == null || !e[Qn]) && ((t = this.persistence) == null || (t = t.props) == null || !t[zr]));
3821
+ return !(this.config.person_profiles === "never" || this.config.person_profiles === Xr && !this._isIdentified() && Ze(this.getGroups()) && ((e = this.persistence) == null || (e = e.props) == null || !e[Qn]) && ((t = this.persistence) == null || (t = t.props) == null || !t[zr]));
3825
3822
  }
3826
3823
  Qi() {
3827
3824
  return !0 === this.config.capture_pageleave || this.config.capture_pageleave === "if_capture_pageview" && (!0 === this.config.capture_pageview || this.config.capture_pageview === "history_change");
@@ -3854,7 +3851,7 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3854
3851
  o && (this.sessionRecording = this.Ei(this.sessionRecording, new o(this)), this.Wi && ((a = this.sessionRecording) == null || a.onRemoteConfig == null || a.onRemoteConfig(this.Wi)));
3855
3852
  }
3856
3853
  var s;
3857
- this.consent.optInOut(!0), this.cn(), this.Xi(), (n = this.sessionRecording) == null || n.startIfEnabledOrStop(), this.config.cookieless_mode == Kr && ((s = this.surveys) == null || s.loadIfEnabled()), (z(t?.captureEventName) || t != null && t.captureEventName) && this.capture(t?.captureEventName ?? "$opt_in", t?.captureProperties, { send_instantly: !0 }), this.config.capture_pageview && this.Ji();
3854
+ this.consent.optInOut(!0), this.cn(), this.Xi(), (n = this.sessionRecording) == null || n.startIfEnabledOrStop(), this.config.cookieless_mode == Kr && ((s = this.surveys) == null || s.loadIfEnabled()), (R(t?.captureEventName) || t != null && t.captureEventName) && this.capture(t?.captureEventName ?? "$opt_in", t?.captureProperties, { send_instantly: !0 }), this.config.capture_pageview && this.Ji();
3858
3855
  } else U.warn(Fo);
3859
3856
  }
3860
3857
  opt_out_capturing() {
@@ -3881,27 +3878,27 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3881
3878
  this.consent.reset(), this.cn();
3882
3879
  }
3883
3880
  _is_bot() {
3884
- return ke ? po(ke, this.config.custom_blocked_useragents) : void 0;
3881
+ return Ae ? po(Ae, this.config.custom_blocked_useragents) : void 0;
3885
3882
  }
3886
3883
  Ji() {
3887
- M && (M.visibilityState === "visible" ? this.Oi || (this.Oi = !0, this.capture($r, { title: M.title }, { send_instantly: !0 }), this.Pi &&= (M.removeEventListener(Zr, this.Pi), null)) : this.Pi || (this.Pi = this.Ji.bind(this), q(M, Zr, this.Pi)));
3884
+ j && (j.visibilityState === "visible" ? this.Oi || (this.Oi = !0, this.capture($r, { title: j.title }, { send_instantly: !0 }), this.Pi &&= (j.removeEventListener(Zr, this.Pi), null)) : this.Pi || (this.Pi = this.Ji.bind(this), q(j, Zr, this.Pi)));
3888
3885
  }
3889
3886
  debug(e) {
3890
- !1 === e ? (A?.console.log("You've disabled debug mode."), this.set_config({ debug: !1 })) : (A?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."), this.set_config({ debug: !0 }));
3887
+ !1 === e ? (k?.console.log("You've disabled debug mode."), this.set_config({ debug: !1 })) : (k?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."), this.set_config({ debug: !0 }));
3891
3888
  }
3892
3889
  Fr() {
3893
3890
  var e, t, n, r, i, a, o = this.ji || {};
3894
- return "advanced_disable_flags" in o ? !!o.advanced_disable_flags : !1 === this.config.advanced_disable_flags ? !0 === this.config.advanced_disable_decide ? (U.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."), !0) : (n = "advanced_disable_decide", r = U, i = (t = "advanced_disable_flags") in (e = o) && !V(e[t]), a = n in e && !V(e[n]), i ? e[t] : !!a && (r && r.warn("Config field '" + n + "' is deprecated. Please use '" + t + "' instead. The old field will be removed in a future major version."), e[n])) : !!this.config.advanced_disable_flags;
3891
+ return "advanced_disable_flags" in o ? !!o.advanced_disable_flags : !1 === this.config.advanced_disable_flags ? !0 === this.config.advanced_disable_decide ? (U.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."), !0) : (n = "advanced_disable_decide", r = U, i = (t = "advanced_disable_flags") in (e = o) && !B(e[t]), a = n in e && !B(e[n]), i ? e[t] : !!a && (r && r.warn("Config field '" + n + "' is deprecated. Please use '" + t + "' instead. The old field will be removed in a future major version."), e[n])) : !!this.config.advanced_disable_flags;
3895
3892
  }
3896
3893
  rn(e) {
3897
- if (V(this.config.before_send)) return e;
3898
- var t = L(this.config.before_send) ? this.config.before_send : [this.config.before_send], n = e;
3894
+ if (B(this.config.before_send)) return e;
3895
+ var t = I(this.config.before_send) ? this.config.before_send : [this.config.before_send], n = e;
3899
3896
  for (var r of t) {
3900
- if (n = r(n), V(n)) {
3897
+ if (n = r(n), B(n)) {
3901
3898
  var i = "Event '" + e.event + "' was rejected in beforeSend function";
3902
- return rt(e.event) ? U.warn(i + ". This can cause unexpected behavior.") : U.info(i), null;
3899
+ return it(e.event) ? U.warn(i + ". This can cause unexpected behavior.") : U.info(i), null;
3903
3900
  }
3904
- n.properties && !Xe(n.properties) || U.warn("Event '" + e.event + "' has no properties after beforeSend function, this is likely an error.");
3901
+ n.properties && !Ze(n.properties) || U.warn("Event '" + e.event + "' has no properties after beforeSend function, this is likely an error.");
3905
3902
  }
3906
3903
  return n;
3907
3904
  }
@@ -3922,7 +3919,7 @@ var Q = W("[Surveys]"), To = "seenSurvey_", Eo = [
3922
3919
  });
3923
3920
  }
3924
3921
  Bi(e) {
3925
- var t = tt(e) && !e, n = J.R() && J.O("ph_debug") === "true";
3922
+ var t = nt(e) && !e, n = J.R() && J.O("ph_debug") === "true";
3926
3923
  return !t && (!!n || e);
3927
3924
  }
3928
3925
  };
@@ -3953,10 +3950,10 @@ function $o(e) {
3953
3950
  return !!e && e.nodeType === Jo && Xo(e.host);
3954
3951
  }
3955
3952
  function es(e) {
3956
- return e ? We(e).split(/\s+/) : [];
3953
+ return e ? Ge(e).split(/\s+/) : [];
3957
3954
  }
3958
3955
  function ts(e) {
3959
- var t = A?.location.href;
3956
+ var t = k?.location.href;
3960
3957
  return !!(t && e && e.some(((e) => t.match(e))));
3961
3958
  }
3962
3959
  function ns(e) {
@@ -3973,16 +3970,16 @@ function ns(e) {
3973
3970
  return es(t);
3974
3971
  }
3975
3972
  function rs(e) {
3976
- return V(e) ? null : We(e).split(/(\s+)/).filter(((e) => xs(e))).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, 255);
3973
+ return B(e) ? null : Ge(e).split(/(\s+)/).filter(((e) => xs(e))).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, 255);
3977
3974
  }
3978
3975
  function is(e) {
3979
3976
  var t = "";
3980
3977
  return ps(e) && !ms(e) && e.childNodes && e.childNodes.length && G(e.childNodes, (function(e) {
3981
3978
  Qo(e) && e.textContent && (t += rs(e.textContent) ?? "");
3982
- })), We(t);
3979
+ })), Ge(t);
3983
3980
  }
3984
3981
  function as(e) {
3985
- return z(e.target) ? e.srcElement || null : (t = e.target) != null && t.shadowRoot ? e.composedPath()[0] || null : e.target || null;
3982
+ return R(e.target) ? e.srcElement || null : (t = e.target) != null && t.shadowRoot ? e.composedPath()[0] || null : e.target || null;
3986
3983
  var t;
3987
3984
  }
3988
3985
  var os = [
@@ -3995,7 +3992,7 @@ var os = [
3995
3992
  "label"
3996
3993
  ];
3997
3994
  function ss(e, t) {
3998
- if (z(t)) return !0;
3995
+ if (R(t)) return !0;
3999
3996
  var n, r = function(e) {
4000
3997
  if (t.some(((t) => e.matches(t)))) return { v: !0 };
4001
3998
  };
@@ -4013,7 +4010,7 @@ var ls = [
4013
4010
  ">",
4014
4011
  "<"
4015
4012
  ], us = [".ph-no-rageclick", ".ph-no-capture"], ds = (e) => !e || Zo(e, "html") || !Xo(e), fs = (e, t) => {
4016
- if (!A || ds(e)) return {
4013
+ if (!k || ds(e)) return {
4017
4014
  parentIsUsefulElement: !1,
4018
4015
  targetElementList: []
4019
4016
  };
@@ -4023,7 +4020,7 @@ var ls = [
4023
4020
  if (!a) break;
4024
4021
  if (t || os.indexOf(a.tagName.toLowerCase()) > -1) n = !0;
4025
4022
  else {
4026
- var o = A.getComputedStyle(a);
4023
+ var o = k.getComputedStyle(a);
4027
4024
  o && o.getPropertyValue("cursor") === "pointer" && (n = !0);
4028
4025
  }
4029
4026
  r.push(a), i = a;
@@ -4036,16 +4033,16 @@ var ls = [
4036
4033
  function ps(e) {
4037
4034
  for (var t = e; t.parentNode && !Zo(t, "body"); t = t.parentNode) {
4038
4035
  var n = ns(t);
4039
- if (I(n, "ph-sensitive") || I(n, "ph-no-capture")) return !1;
4036
+ if (F(n, "ph-sensitive") || F(n, "ph-no-capture")) return !1;
4040
4037
  }
4041
- if (I(ns(e), "ph-include")) return !0;
4038
+ if (F(ns(e), "ph-include")) return !0;
4042
4039
  var r = e.type || "";
4043
- if (B(r)) switch (r.toLowerCase()) {
4040
+ if (z(r)) switch (r.toLowerCase()) {
4044
4041
  case "hidden":
4045
4042
  case "password": return !1;
4046
4043
  }
4047
4044
  var i = e.name || e.id || "";
4048
- return !B(i) || !/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g, ""));
4045
+ return !z(i) || !/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g, ""));
4049
4046
  }
4050
4047
  function ms(e) {
4051
4048
  return !!(Zo(e, "input") && ![
@@ -4057,7 +4054,7 @@ function ms(e) {
4057
4054
  }
4058
4055
  var hs = "(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})", gs = RegExp("^(?:" + hs + ")$"), _s = new RegExp(hs), vs = "\\d{3}-?\\d{2}-?\\d{4}", ys = RegExp("^(" + vs + ")$"), bs = RegExp("(" + vs + ")");
4059
4056
  function xs(e, t) {
4060
- return t === void 0 && (t = !0), !(V(e) || B(e) && (e = We(e), (t ? gs : _s).test((e || "").replace(/[- ]/g, "")) || (t ? ys : bs).test(e)));
4057
+ return t === void 0 && (t = !0), !(B(e) || z(e) && (e = Ge(e), (t ? gs : _s).test((e || "").replace(/[- ]/g, "")) || (t ? ys : bs).test(e)));
4061
4058
  }
4062
4059
  function Ss(e) {
4063
4060
  var t = is(e);
@@ -4079,12 +4076,12 @@ function ws(e) {
4079
4076
  }
4080
4077
  function Ts(e) {
4081
4078
  var t = e.attr__class;
4082
- return t ? L(t) ? t : es(t) : void 0;
4079
+ return t ? I(t) ? t : es(t) : void 0;
4083
4080
  }
4084
4081
  var Es = class {
4085
4082
  constructor(e) {
4086
4083
  this.disabled = !1 === e;
4087
- var t = R(e) ? e : {};
4084
+ var t = L(e) ? e : {};
4088
4085
  this.thresholdPx = t.threshold_px || 30, this.timeoutMs = t.timeout_ms || 1e3, this.clickCount = t.click_count || 3, this.clicks = [];
4089
4086
  }
4090
4087
  isRageClick(e, t, n) {
@@ -4130,7 +4127,7 @@ function js(e, t) {
4130
4127
  var n = e.getAttribute("href");
4131
4128
  m = t && !!n && xs(n) && n;
4132
4129
  }
4133
- I(ns(e), "ph-no-capture") && (h = !0), f.push(function(e, t, n, r) {
4130
+ F(ns(e), "ph-no-capture") && (h = !0), f.push(function(e, t, n, r) {
4134
4131
  var i = e.tagName.toLowerCase(), a = { tag_name: i };
4135
4132
  os.indexOf(i) > -1 && !n && (a.$el_text = i.toLowerCase() === "a" || i.toLowerCase() === "button" ? ks(1024, Ss(e)) : ks(1024, is(e)));
4136
4133
  var o = ns(e);
@@ -4143,7 +4140,7 @@ function js(e, t) {
4143
4140
  "id",
4144
4141
  "class",
4145
4142
  "aria-label"
4146
- ].indexOf(n.name) !== -1) && (r == null || !r.includes(n.name)) && !t && xs(n.value) && (!B(i = n.name) || i.substring(0, 10) !== "_ngcontent" && i.substring(0, 7) !== "_nghost")) {
4143
+ ].indexOf(n.name) !== -1) && (r == null || !r.includes(n.name)) && !t && xs(n.value) && (!z(i = n.name) || i.substring(0, 10) !== "_ngcontent" && i.substring(0, 7) !== "_nghost")) {
4147
4144
  var o = n.value;
4148
4145
  n.name === "class" && (o = es(o).join(" ")), a["attr__" + n.name] = ks(1024, o);
4149
4146
  }
@@ -4167,7 +4164,7 @@ function js(e, t) {
4167
4164
  if (a || (f[0].$el_text = Zo(e, "a") || Zo(e, "button") ? Ss(e) : is(e)), m) {
4168
4165
  var g;
4169
4166
  f[0].attr__href = m;
4170
- var _ = Ri(m)?.host, v = A == null || (g = A.location) == null ? void 0 : g.host;
4167
+ var _ = Ri(m)?.host, v = k == null || (g = k.location) == null ? void 0 : g.host;
4171
4168
  _ && v && _ !== v && (u = m);
4172
4169
  }
4173
4170
  return { props: K({
@@ -4177,7 +4174,7 @@ function js(e, t) {
4177
4174
  return e.map(((e) => {
4178
4175
  var t = "";
4179
4176
  if (e.tag_name && (t += e.tag_name), e.attr_class) for (var n of (e.attr_class.sort(), e.attr_class)) t += "." + n.replace(/"/g, "");
4180
- var r = F({}, e.text ? { text: e.text } : {}, {
4177
+ var r = P({}, e.text ? { text: e.text } : {}, {
4181
4178
  "nth-child": e.nth_child ?? 0,
4182
4179
  "nth-of-type": e.nth_of_type ?? 0
4183
4180
  }, e.href ? { href: e.href } : {}, e.attr_id ? { attr_id: e.attr_id } : {}, e.attributes), i = {};
@@ -4219,7 +4216,7 @@ function Ns(e, t, n) {
4219
4216
  try {
4220
4217
  if (!(t in e)) return () => {};
4221
4218
  var r = e[t], i = n(r);
4222
- return Ye(i) && (i.prototype = i.prototype || {}, Object.defineProperties(i, { __posthog_wrapped__: {
4219
+ return Xe(i) && (i.prototype = i.prototype || {}, Object.defineProperties(i, { __posthog_wrapped__: {
4223
4220
  enumerable: !1,
4224
4221
  value: !0
4225
4222
  } })), e[t] = i, () => {
@@ -4233,11 +4230,11 @@ var Ps = W("[TracingHeaders]"), Fs = W("[Web Vitals]"), Is = 9e5, Ls = "disabled
4233
4230
  W("[SessionRecording]"), W("[SessionRecording]");
4234
4231
  var Vs = "[SessionRecording]", Hs = W(Vs), Us = W("[Heatmaps]");
4235
4232
  function Ws(e) {
4236
- return R(e) && "clientX" in e && "clientY" in e && $e(e.clientX) && $e(e.clientY);
4233
+ return L(e) && "clientX" in e && "clientY" in e && et(e.clientX) && et(e.clientY);
4237
4234
  }
4238
4235
  var Gs = W("[Product Tours]"), Ks = ["$set_once", "$set"], qs = W("[SiteApps]"), Js = "Error while initializing PostHog app with config id ";
4239
4236
  function Ys(e, t, n) {
4240
- if (V(e)) return !1;
4237
+ if (B(e)) return !1;
4241
4238
  switch (n) {
4242
4239
  case "exact": return e === t;
4243
4240
  case "contains":
@@ -4257,13 +4254,13 @@ var Xs = class {
4257
4254
  }
4258
4255
  init() {
4259
4256
  var e;
4260
- z(this._instance?._addCaptureHook) || (e = this._instance) == null || e._addCaptureHook(((e, t) => {
4257
+ R(this._instance?._addCaptureHook) || (e = this._instance) == null || e._addCaptureHook(((e, t) => {
4261
4258
  this.on(e, t);
4262
4259
  }));
4263
4260
  }
4264
4261
  register(e) {
4265
4262
  var t;
4266
- if (!z(this._instance?._addCaptureHook) && (e.forEach(((e) => {
4263
+ if (!R(this._instance?._addCaptureHook) && (e.forEach(((e) => {
4267
4264
  var t, n;
4268
4265
  (t = this.wn) == null || t.add(e), (n = e.steps) == null || n.forEach(((e) => {
4269
4266
  var t;
@@ -4320,7 +4317,7 @@ var Xs = class {
4320
4317
  if (r.length > 0) return r.some(((e) => Ys(e.text, t.text, t.text_matching || "exact") || Ys(e.$el_text, t.text, t.text_matching || "exact")));
4321
4318
  var i, a, o, s = (e == null || (n = e.properties) == null ? void 0 : n.$elements_chain) || "";
4322
4319
  return !!s && (i = function(e) {
4323
- for (var t, n = [], r = /(?::|")text="(.*?)"/g; !V(t = r.exec(e));) n.includes(t[1]) || n.push(t[1]);
4320
+ for (var t, n = [], r = /(?::|")text="(.*?)"/g; !B(t = r.exec(e));) n.includes(t[1]) || n.push(t[1]);
4324
4321
  return n;
4325
4322
  }(s), a = t.text, o = t.text_matching || "exact", i.some(((e) => Ys(e, a, o))));
4326
4323
  }
@@ -4343,7 +4340,7 @@ var Xs = class {
4343
4340
  }
4344
4341
  yn(e, t) {
4345
4342
  return t == null || !t.properties || t.properties.length === 0 || vo(t.properties.reduce(((e, t) => {
4346
- var n = L(t.value) ? t.value.map(String) : t.value == null ? [] : [String(t.value)];
4343
+ var n = I(t.value) ? t.value.map(String) : t.value == null ? [] : [String(t.value)];
4347
4344
  return e[t.key] = {
4348
4345
  values: n,
4349
4346
  operator: t.operator || "exact"
@@ -4379,7 +4376,7 @@ var Xs = class {
4379
4376
  }));
4380
4377
  }
4381
4378
  register(e) {
4382
- z(this._instance?._addCaptureHook) || (this.On(e), this.Pn(e));
4379
+ R(this._instance?._addCaptureHook) || (this.On(e), this.Pn(e));
4383
4380
  }
4384
4381
  Pn(e) {
4385
4382
  var t = e.filter(((e) => {
@@ -4498,7 +4495,7 @@ var Xs = class {
4498
4495
  getEventToSurveys() {
4499
4496
  return this.getEventToItemsMap();
4500
4497
  }
4501
- }, $s = "SDK is not enabled or survey functionality is not yet loaded", ec = "Disabled. Not loading surveys.", tc = A != null && A.location ? Vi(A.location.hash, "__posthog") || Vi(location.hash, "state") : null, nc = "_postHogToolbarParams", rc = W("[Toolbar]"), $ = W("[FeatureFlags]"), ic = W("[FeatureFlags]", { debugEnabled: !0 }), ac = "\" failed. Feature flags didn't load in time.", oc = (e) => {
4498
+ }, $s = "SDK is not enabled or survey functionality is not yet loaded", ec = "Disabled. Not loading surveys.", tc = k != null && k.location ? Vi(k.location.hash, "__posthog") || Vi(location.hash, "state") : null, nc = "_postHogToolbarParams", rc = W("[Toolbar]"), $ = W("[FeatureFlags]"), ic = W("[FeatureFlags]", { debugEnabled: !0 }), ac = "\" failed. Feature flags didn't load in time.", oc = (e) => {
4502
4499
  for (var t = {}, n = 0; e.length > n; n++) t[e[n]] = !0;
4503
4500
  return t;
4504
4501
  }, sc = (e) => {
@@ -4506,10 +4503,10 @@ var Xs = class {
4506
4503
  for (var [n, r] of ii(e || {})) r && (t[n] = r);
4507
4504
  return t;
4508
4505
  }, cc = W("[Error tracking]"), lc = "Refusing to render web experiment since the viewer is a likely bot", uc = {
4509
- icontains: (e, t) => !!A && t.href.toLowerCase().indexOf(e.toLowerCase()) > -1,
4510
- not_icontains: (e, t) => !!A && t.href.toLowerCase().indexOf(e.toLowerCase()) === -1,
4511
- regex: (e, t) => !!A && mo(t.href, e),
4512
- not_regex: (e, t) => !!A && !mo(t.href, e),
4506
+ icontains: (e, t) => !!k && t.href.toLowerCase().indexOf(e.toLowerCase()) > -1,
4507
+ not_icontains: (e, t) => !!k && t.href.toLowerCase().indexOf(e.toLowerCase()) === -1,
4508
+ regex: (e, t) => !!k && mo(t.href, e),
4509
+ not_regex: (e, t) => !!k && !mo(t.href, e),
4513
4510
  exact: (e, t) => t.href === e,
4514
4511
  is_not: (e, t) => t.href !== e
4515
4512
  }, dc = class e {
@@ -4525,7 +4522,7 @@ var Xs = class {
4525
4522
  var r;
4526
4523
  n.zn && (e.Vn("setting flag key ", t.feature_flag_key, " to web experiment ", t), (r = n.zn) == null || r.set(t.feature_flag_key, t));
4527
4524
  var i = n._instance.getFeatureFlag(t.feature_flag_key);
4528
- B(i) && t.variants[i] && n.Un(t.name, i, t.variants[i].transforms);
4525
+ z(i) && t.variants[i] && n.Un(t.name, i, t.variants[i].transforms);
4529
4526
  } else if (t.variants) for (var a in t.variants) {
4530
4527
  var o = t.variants[a];
4531
4528
  e.Yn(o) && n.Un(t.name, a, o.transforms);
@@ -4540,7 +4537,7 @@ var Xs = class {
4540
4537
  onFeatureFlags(t) {
4541
4538
  if (this._is_bot()) e.Vn(lc);
4542
4539
  else if (!this.Bt.disable_web_experiments) {
4543
- if (V(this.zn)) return this.zn = /* @__PURE__ */ new Map(), this.loadIfEnabled(), void this.previewWebExperiment();
4540
+ if (B(this.zn)) return this.zn = /* @__PURE__ */ new Map(), this.loadIfEnabled(), void this.previewWebExperiment();
4544
4541
  e.Vn("applying feature flags", t), t.forEach(((e) => {
4545
4542
  var t;
4546
4543
  if (this.zn && (t = this.zn) != null && t.has(e)) {
@@ -4577,18 +4574,18 @@ var Xs = class {
4577
4574
  i && i.length > 0 && (e.Vn("Previewing web experiment [" + i[0].name + "] with variant [" + n + "]"), this.Un(i[0].name, n, i[0].variants[n].transforms));
4578
4575
  }
4579
4576
  static Yn(t) {
4580
- return !V(t.conditions) && e.Wn(t) && e.Xn(t);
4577
+ return !B(t.conditions) && e.Wn(t) && e.Xn(t);
4581
4578
  }
4582
4579
  static Wn(t) {
4583
- if (V(t.conditions) || V(t.conditions?.url)) return !0;
4580
+ if (B(t.conditions) || B(t.conditions?.url)) return !0;
4584
4581
  var n, r = e.getWindowLocation();
4585
4582
  return !!r && ((n = t.conditions) == null || !n.url || uc[t.conditions?.urlMatchType ?? "icontains"](t.conditions.url, r));
4586
4583
  }
4587
4584
  static getWindowLocation() {
4588
- return A?.location;
4585
+ return k?.location;
4589
4586
  }
4590
4587
  static Xn(e) {
4591
- if (V(e.conditions) || V(e.conditions?.utm)) return !0;
4588
+ if (B(e.conditions) || B(e.conditions?.utm)) return !0;
4592
4589
  var t = qi();
4593
4590
  if (t.utm_source) {
4594
4591
  var n, r, i, a, o, s, c, l, u = (n = e.conditions) == null || (n = n.utm) == null || !n.utm_campaign || ((r = e.conditions) == null || (r = r.utm) == null ? void 0 : r.utm_campaign) == t.utm_campaign, d = (i = e.conditions) == null || (i = i.utm) == null || !i.utm_source || ((a = e.conditions) == null || (a = a.utm) == null ? void 0 : a.utm_source) == t.utm_source, f = (o = e.conditions) == null || (o = o.utm) == null || !o.utm_medium || ((s = e.conditions) == null || (s = s.utm) == null ? void 0 : s.utm_medium) == t.utm_medium, p = (c = e.conditions) == null || (c = c.utm) == null || !c.utm_term || ((l = e.conditions) == null || (l = l.utm) == null ? void 0 : l.utm_term) == t.utm_term;
@@ -4609,7 +4606,7 @@ var Xs = class {
4609
4606
  }));
4610
4607
  }
4611
4608
  _is_bot() {
4612
- return ke && this._instance ? po(ke, this.Bt.custom_blocked_useragents) : void 0;
4609
+ return Ae && this._instance ? po(Ae, this.Bt.custom_blocked_useragents) : void 0;
4613
4610
  }
4614
4611
  }, fc = W("[Conversations]"), pc = "Conversations not available yet.", mc = { featureFlags: class {
4615
4612
  constructor(e) {
@@ -4652,7 +4649,7 @@ var Xs = class {
4652
4649
  }
4653
4650
  }
4654
4651
  updateFlags(e, t, n) {
4655
- var r = n != null && n.merge ? this.getFlagVariants() : {}, i = n != null && n.merge ? this.getFlagPayloads() : {}, a = F({}, r, e), o = F({}, i, t), s = {};
4652
+ var r = n != null && n.merge ? this.getFlagVariants() : {}, i = n != null && n.merge ? this.getFlagPayloads() : {}, a = P({}, r, e), o = P({}, i, t), s = {};
4656
4653
  for (var [c, l] of Object.entries(a)) {
4657
4654
  var u = typeof l == "string";
4658
4655
  s[c] = {
@@ -4660,7 +4657,7 @@ var Xs = class {
4660
4657
  enabled: !!u || !!l,
4661
4658
  variant: u ? l : void 0,
4662
4659
  reason: void 0,
4663
- metadata: z(o?.[c]) ? void 0 : {
4660
+ metadata: R(o?.[c]) ? void 0 : {
4664
4661
  id: 0,
4665
4662
  version: void 0,
4666
4663
  description: void 0,
@@ -4681,11 +4678,11 @@ var Xs = class {
4681
4678
  if (!n && !t) return e || {};
4682
4679
  var r = K({}, e || {});
4683
4680
  for (var i of [...new Set([...Object.keys(n || {}), ...Object.keys(t || {})])]) {
4684
- var a, o, s = r[i], c = t?.[i], l = z(c) ? (a = s?.enabled) != null && a : !!c, u = z(c) ? s.variant : typeof c == "string" ? c : void 0, d = n?.[i], f = F({}, s, {
4681
+ var a, o, s = r[i], c = t?.[i], l = R(c) ? (a = s?.enabled) != null && a : !!c, u = R(c) ? s.variant : typeof c == "string" ? c : void 0, d = n?.[i], f = P({}, s, {
4685
4682
  enabled: l,
4686
4683
  variant: l ? u ?? s?.variant : void 0
4687
4684
  });
4688
- l !== s?.enabled && (f.original_enabled = s?.enabled), u !== s?.variant && (f.original_variant = s?.variant), d && (f.metadata = F({}, s?.metadata, {
4685
+ l !== s?.enabled && (f.original_enabled = s?.enabled), u !== s?.variant && (f.original_variant = s?.variant), d && (f.metadata = P({}, s?.metadata, {
4689
4686
  payload: d,
4690
4687
  original_payload: s == null || (o = s.metadata) == null ? void 0 : o.payload
4691
4688
  })), r[i] = f;
@@ -4741,11 +4738,11 @@ var Xs = class {
4741
4738
  distinct_id: this._instance.get_distinct_id(),
4742
4739
  groups: this._instance.getGroups(),
4743
4740
  $anon_distinct_id: this.$anon_distinct_id,
4744
- person_properties: F({}, this.ni?.get_initial_props() || {}, this.os(wr) || {}),
4741
+ person_properties: P({}, this.ni?.get_initial_props() || {}, this.os(wr) || {}),
4745
4742
  group_properties: this.os(Tr),
4746
4743
  timezone: ta()
4747
4744
  };
4748
- Qe(n) || z(n) || (r.$device_id = n), (e != null && e.disableFlags || this.Bt.advanced_disable_feature_flags) && (r.disable_flags = !0), this.cs() && (r.evaluation_contexts = this.hs());
4745
+ $e(n) || R(n) || (r.$device_id = n), (e != null && e.disableFlags || this.Bt.advanced_disable_feature_flags) && (r.disable_flags = !0), this.cs() && (r.evaluation_contexts = this.hs());
4749
4746
  var i = this._instance.requestRouter.endpointFor("flags", "/flags/?v=2" + (this.Bt.advanced_only_evaluate_survey_feature_flags ? "&only_evaluate_survey_feature_flags=true" : ""));
4750
4747
  this.Qn = !0, this._instance._send_request({
4751
4748
  method: "POST",
@@ -4793,9 +4790,9 @@ var Xs = class {
4793
4790
  }
4794
4791
  if ((t.send_event || !("send_event" in t)) && (!(e in l) || !l[e].includes(o))) {
4795
4792
  var p, m, h, g, _, v, y, b;
4796
- L(l[e]) ? l[e].push(o) : l[e] = [o], (p = this.ni) == null || p.register({ [kr]: l });
4793
+ I(l[e]) ? l[e].push(o) : l[e] = [o], (p = this.ni) == null || p.register({ [kr]: l });
4797
4794
  var x = this.getFeatureFlagDetails(e), S = [...this.os(jr) ?? []];
4798
- z(i) && S.push("flag_missing");
4795
+ R(i) && S.push("flag_missing");
4799
4796
  var C = {
4800
4797
  $feature_flag: e,
4801
4798
  $feature_flag_response: i,
@@ -4806,13 +4803,13 @@ var Xs = class {
4806
4803
  $feature_flag_bootstrapped_payload: ((h = this.Bt.bootstrap) == null || (h = h.featureFlagPayloads) == null ? void 0 : h[e]) || null,
4807
4804
  $used_bootstrap_value: !this.rs
4808
4805
  };
4809
- z(x == null || (g = x.metadata) == null ? void 0 : g.version) || (C.$feature_flag_version = x.metadata.version);
4806
+ R(x == null || (g = x.metadata) == null ? void 0 : g.version) || (C.$feature_flag_version = x.metadata.version);
4810
4807
  var w, ee = (x == null || (_ = x.reason) == null ? void 0 : _.description) ?? (x == null || (v = x.reason) == null ? void 0 : v.code);
4811
- ee && (C.$feature_flag_reason = ee), x != null && (y = x.metadata) != null && y.id && (C.$feature_flag_id = x.metadata.id), z(x?.original_variant) && z(x?.original_enabled) || (C.$feature_flag_original_response = z(x.original_variant) ? x.original_enabled : x.original_variant), x != null && (b = x.metadata) != null && b.original_payload && (C.$feature_flag_original_payload = x == null || (w = x.metadata) == null ? void 0 : w.original_payload), S.length && (C.$feature_flag_error = S.join(",")), this._instance.capture("$feature_flag_called", C);
4808
+ ee && (C.$feature_flag_reason = ee), x != null && (y = x.metadata) != null && y.id && (C.$feature_flag_id = x.metadata.id), R(x?.original_variant) && R(x?.original_enabled) || (C.$feature_flag_original_response = R(x.original_variant) ? x.original_enabled : x.original_variant), x != null && (b = x.metadata) != null && b.original_payload && (C.$feature_flag_original_payload = x == null || (w = x.metadata) == null ? void 0 : w.original_payload), S.length && (C.$feature_flag_error = S.join(",")), this._instance.capture("$feature_flag_called", C);
4812
4809
  }
4813
4810
  if (r) {
4814
4811
  var T = a;
4815
- if (!z(a)) try {
4812
+ if (!R(a)) try {
4816
4813
  T = JSON.parse(a);
4817
4814
  } catch {}
4818
4815
  return {
@@ -4846,7 +4843,7 @@ var Xs = class {
4846
4843
  if (t === void 0 && (t = {}), !t.fresh || this.rs) {
4847
4844
  if (this.Kn || this.getFlags() && this.getFlags().length > 0) {
4848
4845
  var n = this.getFeatureFlag(e, t);
4849
- return z(n) ? void 0 : !!n;
4846
+ return R(n) ? void 0 : !!n;
4850
4847
  }
4851
4848
  $.warn("isFeatureEnabled for key \"" + e + ac);
4852
4849
  }
@@ -4869,7 +4866,7 @@ var Xs = class {
4869
4866
  })(e), s = o.flags, c = o.featureFlags, l = o.featureFlagPayloads;
4870
4867
  if (c) {
4871
4868
  var u = e.requestId, d = e.evaluatedAt;
4872
- if (L(c)) {
4869
+ if (I(c)) {
4873
4870
  $.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");
4874
4871
  var f = {};
4875
4872
  if (c) for (var p = 0; c.length > p; p++) f[c[p]] = !0;
@@ -4879,24 +4876,24 @@ var Xs = class {
4879
4876
  });
4880
4877
  } else {
4881
4878
  var m = c, h = l, g = s;
4882
- if (a != null && a.partialResponse) m = F({}, n, m), h = F({}, r, h), g = F({}, i, g);
4879
+ if (a != null && a.partialResponse) m = P({}, n, m), h = P({}, r, h), g = P({}, i, g);
4883
4880
  else if (e.errorsWhileComputingFlags) if (s) {
4884
4881
  var _ = new Set(Object.keys(s).filter(((e) => {
4885
4882
  var t;
4886
4883
  return !((t = s[e]) != null && t.failed);
4887
4884
  })));
4888
- m = F({}, n, Object.fromEntries(Object.entries(m).filter(((e) => {
4885
+ m = P({}, n, Object.fromEntries(Object.entries(m).filter(((e) => {
4889
4886
  var [t] = e;
4890
4887
  return _.has(t);
4891
- })))), h = F({}, r, Object.fromEntries(Object.entries(h || {}).filter(((e) => {
4888
+ })))), h = P({}, r, Object.fromEntries(Object.entries(h || {}).filter(((e) => {
4892
4889
  var [t] = e;
4893
4890
  return _.has(t);
4894
- })))), g = F({}, i, Object.fromEntries(Object.entries(g || {}).filter(((e) => {
4891
+ })))), g = P({}, i, Object.fromEntries(Object.entries(g || {}).filter(((e) => {
4895
4892
  var [t] = e;
4896
4893
  return _.has(t);
4897
4894
  }))));
4898
- } else m = F({}, n, m), h = F({}, r, h), g = F({}, i, g);
4899
- t && t.register(F({
4895
+ } else m = P({}, n, m), h = P({}, r, h), g = P({}, i, g);
4896
+ t && t.register(P({
4900
4897
  [_r]: Object.keys(sc(m)),
4901
4898
  [gr]: m || {},
4902
4899
  [br]: h || {},
@@ -4916,7 +4913,7 @@ var Xs = class {
4916
4913
  overrideFeatureFlags(e) {
4917
4914
  if (!this._instance.__loaded || !this.ni) return $.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");
4918
4915
  if (!1 === e) return this.ni.unregister(Sr), this.ni.unregister(Cr), this.ps(), ic.info("All overrides cleared");
4919
- if (L(e)) {
4916
+ if (I(e)) {
4920
4917
  var t = oc(e);
4921
4918
  return this.ni.register({ [Sr]: t }), this.ps(), ic.info("Flag overrides set", { flags: e });
4922
4919
  }
@@ -4925,7 +4922,7 @@ var Xs = class {
4925
4922
  if (this.Jn = !!((n = r.suppressWarning) != null && n), "flags" in r) {
4926
4923
  if (!1 === r.flags) this.ni.unregister(Sr), ic.info("Flag overrides cleared");
4927
4924
  else if (r.flags) {
4928
- if (L(r.flags)) {
4925
+ if (I(r.flags)) {
4929
4926
  var i = oc(r.flags);
4930
4927
  this.ni.register({ [Sr]: i });
4931
4928
  } else this.ni.register({ [Sr]: r.flags });
@@ -4952,7 +4949,7 @@ var Xs = class {
4952
4949
  $set: a
4953
4950
  };
4954
4951
  i && (o.$early_access_feature_name = i.name), n && (o.$feature_enrollment_stage = n), this._instance.capture("$feature_enrollment_update", o), this.setPersonPropertiesForFlags(a, !1);
4955
- var s = F({}, this.getFlagVariants(), { [e]: t });
4952
+ var s = P({}, this.getFlagVariants(), { [e]: t });
4956
4953
  (r = this.ni) == null || r.register({
4957
4954
  [_r]: Object.keys(sc(s)),
4958
4955
  [gr]: s
@@ -4989,7 +4986,7 @@ var Xs = class {
4989
4986
  t === void 0 && (t = !0);
4990
4987
  var n = this.os(wr) || {}, r = e?.$set || (e != null && e.$set_once ? {} : e), i = e?.$set_once, a = {};
4991
4988
  if (i) for (var o in i) ({}).hasOwnProperty.call(i, o) && (o in n || (a[o] = i[o]));
4992
- this._instance.register({ [wr]: F({}, n, a, r) }), t && this._instance.reloadFeatureFlags();
4989
+ this._instance.register({ [wr]: P({}, n, a, r) }), t && this._instance.reloadFeatureFlags();
4993
4990
  }
4994
4991
  resetPersonPropertiesForFlags() {
4995
4992
  this._instance.unregister(wr);
@@ -4998,13 +4995,13 @@ var Xs = class {
4998
4995
  t === void 0 && (t = !0);
4999
4996
  var n = this.os(Tr) || {};
5000
4997
  Object.keys(n).length !== 0 && Object.keys(n).forEach(((t) => {
5001
- n[t] = F({}, n[t], e[t]), delete e[t];
5002
- })), this._instance.register({ [Tr]: F({}, n, e) }), t && this._instance.reloadFeatureFlags();
4998
+ n[t] = P({}, n[t], e[t]), delete e[t];
4999
+ })), this._instance.register({ [Tr]: P({}, n, e) }), t && this._instance.reloadFeatureFlags();
5003
5000
  }
5004
5001
  resetGroupPropertiesForFlags(e) {
5005
5002
  if (e) {
5006
5003
  var t = this.os(Tr) || {};
5007
- this._instance.register({ [Tr]: F({}, t, { [e]: {} }) });
5004
+ this._instance.register({ [Tr]: P({}, t, { [e]: {} }) });
5008
5005
  } else this._instance.unregister(Tr);
5009
5006
  }
5010
5007
  reset() {
@@ -5033,18 +5030,18 @@ var Xs = class {
5033
5030
  }
5034
5031
  get _s() {
5035
5032
  var e, t = !((e = this._instance.get_property(lr)) == null || !e.enabled), n = !this.Bt.disable_session_recording, r = this.Bt.disable_session_recording || this._instance.consent.isOptedOut();
5036
- return A && t && n && !r;
5033
+ return k && t && n && !r;
5037
5034
  }
5038
5035
  startIfEnabledOrStop(e) {
5039
5036
  var t;
5040
5037
  if (!this._s || (t = this.ys) == null || !t.isStarted) {
5041
- var n = !z(Object.assign) && !z(Array.from);
5038
+ var n = !R(Object.assign) && !R(Array.from);
5042
5039
  this._s && n ? (this.Is(e), Hs.info("starting")) : (this.bs = Ls, this.stopRecording());
5043
5040
  }
5044
5041
  }
5045
5042
  Is(e) {
5046
5043
  var t, n, r;
5047
- this._s && (this.bs !== zs && this.bs !== Bs && (this.bs = Rs), N != null && (t = N.__PosthogExtensions__) != null && (t = t.rrweb) != null && t.record && (n = N.__PosthogExtensions__) != null && n.initSessionRecording ? this.Cs(e) : (r = N.__PosthogExtensions__) == null || r.loadExternalDependency == null || r.loadExternalDependency(this._instance, this.Ss, ((t) => {
5044
+ this._s && (this.bs !== zs && this.bs !== Bs && (this.bs = Rs), M != null && (t = M.__PosthogExtensions__) != null && (t = t.rrweb) != null && t.record && (n = M.__PosthogExtensions__) != null && n.initSessionRecording ? this.Cs(e) : (r = M.__PosthogExtensions__) == null || r.loadExternalDependency == null || r.loadExternalDependency(this._instance, this.Ss, ((t) => {
5048
5045
  if (t) return Hs.error("could not load recorder", t);
5049
5046
  this.Cs(e);
5050
5047
  })));
@@ -5062,28 +5059,28 @@ var Xs = class {
5062
5059
  (e = this.ni) == null || e.unregister(hr);
5063
5060
  }
5064
5061
  Ts(e, t) {
5065
- if (V(e)) return null;
5066
- var n, r = $e(e) ? e : parseFloat(e);
5062
+ if (B(e)) return null;
5063
+ var n, r = et(e) ? e : parseFloat(e);
5067
5064
  return typeof (n = r) != "number" || !Number.isFinite(n) || 0 > n || n > 1 ? (Hs.warn(t + " must be between 0 and 1. Ignoring invalid value:", e), null) : r;
5068
5065
  }
5069
5066
  As(e) {
5070
5067
  if (this.ni) {
5071
5068
  var t, n = this.ni, r = () => {
5072
5069
  var t = !1 === e.sessionRecording ? void 0 : e.sessionRecording, r = this.Ts(this.Bt.session_recording?.sampleRate, "session_recording.sampleRate"), i = this.Ts(t?.sampleRate, "remote config sampleRate"), a = r ?? i;
5073
- V(a) && this.ks();
5070
+ B(a) && this.ks();
5074
5071
  var o = t?.minimumDurationMilliseconds;
5075
- n.register({ [lr]: F({
5072
+ n.register({ [lr]: P({
5076
5073
  cache_timestamp: Date.now(),
5077
5074
  enabled: !!t
5078
5075
  }, t, {
5079
- networkPayloadCapture: F({ capturePerformance: e.capturePerformance }, t?.networkPayloadCapture),
5076
+ networkPayloadCapture: P({ capturePerformance: e.capturePerformance }, t?.networkPayloadCapture),
5080
5077
  canvasRecording: {
5081
5078
  enabled: t?.recordCanvas,
5082
5079
  fps: t?.canvasFps,
5083
5080
  quality: t?.canvasQuality
5084
5081
  },
5085
5082
  sampleRate: a,
5086
- minimumDurationMilliseconds: z(o) ? null : o,
5083
+ minimumDurationMilliseconds: R(o) ? null : o,
5087
5084
  endpoint: t?.endpoint,
5088
5085
  triggerMatchType: t?.triggerMatchType,
5089
5086
  masking: t?.masking,
@@ -5114,8 +5111,8 @@ var Xs = class {
5114
5111
  }
5115
5112
  Cs(e) {
5116
5113
  var t;
5117
- if ((t = N.__PosthogExtensions__) == null || !t.initSessionRecording) return Hs.warn("Called on script loaded before session recording is available. This can be caused by adblockers."), void this._instance.register_for_session({ [Wr]: !0 });
5118
- if (this.ys || (this.ys = N.__PosthogExtensions__?.initSessionRecording(this._instance), this.ys._forceAllowLocalhostNetworkCapture = this._forceAllowLocalhostNetworkCapture), !this.Es()) {
5114
+ if ((t = M.__PosthogExtensions__) == null || !t.initSessionRecording) return Hs.warn("Called on script loaded before session recording is available. This can be caused by adblockers."), void this._instance.register_for_session({ [Wr]: !0 });
5115
+ if (this.ys || (this.ys = M.__PosthogExtensions__?.initSessionRecording(this._instance), this.ys._forceAllowLocalhostNetworkCapture = this._forceAllowLocalhostNetworkCapture), !this.Es()) {
5119
5116
  if (this.bs === Bs || this.bs === zs) return;
5120
5117
  this.bs = zs, Hs.info("persisted remote config is stale, requesting fresh config before starting"), new ha(this._instance).load();
5121
5118
  return;
@@ -5154,30 +5151,30 @@ var Xs = class {
5154
5151
  this.startIfEnabled();
5155
5152
  }
5156
5153
  get Bt() {
5157
- var e = R(this.instance.config.autocapture) ? this.instance.config.autocapture : {};
5154
+ var e = L(this.instance.config.autocapture) ? this.instance.config.autocapture : {};
5158
5155
  return e.url_allowlist = e.url_allowlist?.map(((e) => new RegExp(e))), e.url_ignorelist = e.url_ignorelist?.map(((e) => new RegExp(e))), e;
5159
5156
  }
5160
5157
  Os() {
5161
5158
  if (this.isBrowserSupported()) {
5162
- if (A && M) {
5159
+ if (k && j) {
5163
5160
  var e = (e) => {
5164
- e ||= A?.event;
5161
+ e ||= k?.event;
5165
5162
  try {
5166
5163
  this.Ps(e);
5167
5164
  } catch (e) {
5168
5165
  Os.error("Failed to capture event", e);
5169
5166
  }
5170
5167
  };
5171
- if (q(M, "submit", e, { capture: !0 }), q(M, "change", e, { capture: !0 }), q(M, "click", e, { capture: !0 }), this.Bt.capture_copied_text) {
5168
+ if (q(j, "submit", e, { capture: !0 }), q(j, "change", e, { capture: !0 }), q(j, "click", e, { capture: !0 }), this.Bt.capture_copied_text) {
5172
5169
  var t = (e) => {
5173
- e ||= A?.event;
5170
+ e ||= k?.event;
5174
5171
  try {
5175
5172
  this.Ps(e, Ds);
5176
5173
  } catch (e) {
5177
5174
  Os.error("Failed to capture copy/cut event", e);
5178
5175
  }
5179
5176
  };
5180
- q(M, "copy", t, { capture: !0 }), q(M, "cut", t, { capture: !0 });
5177
+ q(j, "copy", t, { capture: !0 }), q(j, "cut", t, { capture: !0 });
5181
5178
  }
5182
5179
  }
5183
5180
  } else Os.info("Disabling Automatic Event Collection because this browser is not supported");
@@ -5194,14 +5191,14 @@ var Xs = class {
5194
5191
  getElementSelectors(e) {
5195
5192
  var t, n = [];
5196
5193
  return (t = this.Fs) == null || t.forEach(((t) => {
5197
- (M?.querySelectorAll(t))?.forEach(((r) => {
5194
+ (j?.querySelectorAll(t))?.forEach(((r) => {
5198
5195
  e === r && n.push(t);
5199
5196
  }));
5200
5197
  })), n;
5201
5198
  }
5202
5199
  get isEnabled() {
5203
5200
  var e = this.instance.persistence?.props[er];
5204
- if (Qe(this.Ns) && !tt(e) && !this.instance.Fr()) return !1;
5201
+ if ($e(this.Ns) && !nt(e) && !this.instance.Fr()) return !1;
5205
5202
  var t = this.Ns ?? !!e;
5206
5203
  return !!this.instance.config.autocapture && !t;
5207
5204
  }
@@ -5209,16 +5206,16 @@ var Xs = class {
5209
5206
  if (t === void 0 && (t = "$autocapture"), this.isEnabled) {
5210
5207
  var n, r = as(e);
5211
5208
  Qo(r) && (r = r.parentNode || null), t === "$autocapture" && e.type === "click" && e instanceof MouseEvent && this.instance.config.rageclick && (n = this.rageclicks) != null && n.isRageClick(e.clientX, e.clientY, e.timeStamp || (/* @__PURE__ */ new Date()).getTime()) && function(e, t) {
5212
- if (!A || ds(e)) return !1;
5209
+ if (!k || ds(e)) return !1;
5213
5210
  var n, r;
5214
- if (tt(t) ? (n = !!t && us, r = void 0) : (n = t?.css_selector_ignorelist ?? us, r = t?.content_ignorelist), !1 === n) return !1;
5211
+ if (nt(t) ? (n = !!t && us, r = void 0) : (n = t?.css_selector_ignorelist ?? us, r = t?.content_ignorelist), !1 === n) return !1;
5215
5212
  var { targetElementList: i } = fs(e, !1);
5216
5213
  return !function(e, t) {
5217
- if (!1 === e || z(e)) return !1;
5214
+ if (!1 === e || R(e)) return !1;
5218
5215
  var n;
5219
5216
  if (!0 === e) n = ls;
5220
5217
  else {
5221
- if (!L(e)) return !1;
5218
+ if (!I(e)) return !1;
5222
5219
  if (e.length > 10) return U.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."), !1;
5223
5220
  n = e.map(((e) => e.toLowerCase()));
5224
5221
  }
@@ -5234,7 +5231,7 @@ var Xs = class {
5234
5231
  var i = t === Ds;
5235
5232
  if (r && function(e, t, n, r, i) {
5236
5233
  var a, o, s;
5237
- if (n === void 0 && (n = void 0), !A || ds(e) || (a = n) != null && a.url_allowlist && !ts(n.url_allowlist) || (o = n) != null && o.url_ignorelist && ts(n.url_ignorelist)) return !1;
5234
+ if (n === void 0 && (n = void 0), !k || ds(e) || (a = n) != null && a.url_allowlist && !ts(n.url_allowlist) || (o = n) != null && o.url_ignorelist && ts(n.url_ignorelist)) return !1;
5238
5235
  if ((s = n) != null && s.dom_event_allowlist) {
5239
5236
  var c = n.dom_event_allowlist;
5240
5237
  if (c && !c.some(((e) => t.type === e))) return !1;
@@ -5242,14 +5239,14 @@ var Xs = class {
5242
5239
  var { parentIsUsefulElement: l, targetElementList: u } = fs(e, r);
5243
5240
  if (!function(e, t) {
5244
5241
  var n = t?.element_allowlist;
5245
- if (z(n)) return !0;
5242
+ if (R(n)) return !0;
5246
5243
  var r, i = function(e) {
5247
5244
  if (n.some(((t) => e.tagName.toLowerCase() === t))) return { v: !0 };
5248
5245
  };
5249
5246
  for (var a of e) if (r = i(a)) return r.v;
5250
5247
  return !1;
5251
5248
  }(u, n) || !ss(u, n?.css_selector_allowlist)) return !1;
5252
- var d = A.getComputedStyle(e);
5249
+ var d = k.getComputedStyle(e);
5253
5250
  if (d && d.getPropertyValue("cursor") === "pointer" && t.type === "click") return !0;
5254
5251
  var f = e.tagName.toLowerCase();
5255
5252
  switch (f) {
@@ -5271,7 +5268,7 @@ var Xs = class {
5271
5268
  if (o) return !1;
5272
5269
  var s = this.getElementSelectors(r);
5273
5270
  if (s && s.length > 0 && (a.$element_selectors = s), t === Ds) {
5274
- var c, l = rs(A == null || (c = A.getSelection()) == null ? void 0 : c.toString()), u = e.type || "clipboard";
5271
+ var c, l = rs(k == null || (c = k.getSelection()) == null ? void 0 : c.toString()), u = e.type || "clipboard";
5275
5272
  if (!l) return !1;
5276
5273
  a.$selected_content = l, a.$copy_type = u;
5277
5274
  }
@@ -5280,13 +5277,13 @@ var Xs = class {
5280
5277
  }
5281
5278
  }
5282
5279
  isBrowserSupported() {
5283
- return Ye(M?.querySelectorAll);
5280
+ return Xe(j?.querySelectorAll);
5284
5281
  }
5285
5282
  },
5286
5283
  historyAutocapture: class {
5287
5284
  constructor(e) {
5288
5285
  var t;
5289
- this._instance = e, this.Ls = (A == null || (t = A.location) == null ? void 0 : t.pathname) || "";
5286
+ this._instance = e, this.Ls = (k == null || (t = k.location) == null ? void 0 : t.pathname) || "";
5290
5287
  }
5291
5288
  initialize() {
5292
5289
  this.startIfEnabled();
@@ -5302,18 +5299,18 @@ var Xs = class {
5302
5299
  }
5303
5300
  monitorHistoryChanges() {
5304
5301
  var e, t;
5305
- if (A && A.history) {
5302
+ if (k && k.history) {
5306
5303
  var n = this;
5307
- (e = A.history.pushState) != null && e.__posthog_wrapped__ || Ns(A.history, "pushState", ((e) => function(t, r, i) {
5304
+ (e = k.history.pushState) != null && e.__posthog_wrapped__ || Ns(k.history, "pushState", ((e) => function(t, r, i) {
5308
5305
  e.call(this, t, r, i), n.Bs("pushState");
5309
- })), (t = A.history.replaceState) != null && t.__posthog_wrapped__ || Ns(A.history, "replaceState", ((e) => function(t, r, i) {
5306
+ })), (t = k.history.replaceState) != null && t.__posthog_wrapped__ || Ns(k.history, "replaceState", ((e) => function(t, r, i) {
5310
5307
  e.call(this, t, r, i), n.Bs("replaceState");
5311
5308
  })), this.js();
5312
5309
  }
5313
5310
  }
5314
5311
  Bs(e) {
5315
5312
  try {
5316
- var t, n = A == null || (t = A.location) == null ? void 0 : t.pathname;
5313
+ var t, n = k == null || (t = k.location) == null ? void 0 : t.pathname;
5317
5314
  if (!n) return;
5318
5315
  n !== this.Ls && this.isEnabled && this._instance.capture($r, { navigation_type: e }), this.Ls = n;
5319
5316
  } catch (t) {
@@ -5325,8 +5322,8 @@ var Xs = class {
5325
5322
  var e = () => {
5326
5323
  this.Bs("popstate");
5327
5324
  };
5328
- q(A, "popstate", e), this.Ds = () => {
5329
- A && A.removeEventListener("popstate", e);
5325
+ q(k, "popstate", e), this.Ds = () => {
5326
+ k && k.removeEventListener("popstate", e);
5330
5327
  };
5331
5328
  }
5332
5329
  }
@@ -5344,10 +5341,10 @@ var Xs = class {
5344
5341
  }
5345
5342
  get flushIntervalMilliseconds() {
5346
5343
  var e = 5e3;
5347
- return R(this.Bt.capture_heatmaps) && this.Bt.capture_heatmaps.flush_interval_milliseconds && (e = this.Bt.capture_heatmaps.flush_interval_milliseconds), e;
5344
+ return L(this.Bt.capture_heatmaps) && this.Bt.capture_heatmaps.flush_interval_milliseconds && (e = this.Bt.capture_heatmaps.flush_interval_milliseconds), e;
5348
5345
  }
5349
5346
  get isEnabled() {
5350
- return V(this.Bt.capture_heatmaps) ? V(this.Bt.enable_heatmaps) ? this.$s : this.Bt.enable_heatmaps : !1 !== this.Bt.capture_heatmaps;
5347
+ return B(this.Bt.capture_heatmaps) ? B(this.Bt.enable_heatmaps) ? this.$s : this.Bt.enable_heatmaps : !1 !== this.Bt.capture_heatmaps;
5351
5348
  }
5352
5349
  startIfEnabled() {
5353
5350
  if (this.isEnabled) {
@@ -5369,20 +5366,20 @@ var Xs = class {
5369
5366
  this.Tt(e.originalEvent, "deadclick");
5370
5367
  }
5371
5368
  Lt() {
5372
- this.qs && clearInterval(this.qs), this.qs = M?.visibilityState === "visible" ? setInterval(this.Yr.bind(this), this.flushIntervalMilliseconds) : null;
5369
+ this.qs && clearInterval(this.qs), this.qs = j?.visibilityState === "visible" ? setInterval(this.Yr.bind(this), this.flushIntervalMilliseconds) : null;
5373
5370
  }
5374
5371
  Zs() {
5375
- A && M && (this.zs = this.Yr.bind(this), q(A, Qr, this.zs), this.Us = (e) => this.Tt(e || A?.event), q(M, "click", this.Us, { capture: !0 }), this.Ys = (e) => this.Gs(e || A?.event), q(M, "mousemove", this.Ys, { capture: !0 }), this.Ws = new Ai(this.instance, Oi, this.Vs.bind(this)), this.Ws.startIfEnabledOrStop(), this.Xs = this.Lt.bind(this), q(M, Zr, this.Xs), this.Rs = !0);
5372
+ k && j && (this.zs = this.Yr.bind(this), q(k, Qr, this.zs), this.Us = (e) => this.Tt(e || k?.event), q(j, "click", this.Us, { capture: !0 }), this.Ys = (e) => this.Gs(e || k?.event), q(j, "mousemove", this.Ys, { capture: !0 }), this.Ws = new Ai(this.instance, Oi, this.Vs.bind(this)), this.Ws.startIfEnabledOrStop(), this.Xs = this.Lt.bind(this), q(j, Zr, this.Xs), this.Rs = !0);
5376
5373
  }
5377
5374
  Hs() {
5378
5375
  var e;
5379
- A && M && (this.zs && A.removeEventListener(Qr, this.zs), this.Us && M.removeEventListener("click", this.Us, { capture: !0 }), this.Ys && M.removeEventListener("mousemove", this.Ys, { capture: !0 }), this.Xs && M.removeEventListener(Zr, this.Xs), clearTimeout(this.Js), (e = this.Ws) == null || e.stop(), this.Rs = !1);
5376
+ k && j && (this.zs && k.removeEventListener(Qr, this.zs), this.Us && j.removeEventListener("click", this.Us, { capture: !0 }), this.Ys && j.removeEventListener("mousemove", this.Ys, { capture: !0 }), this.Xs && j.removeEventListener(Zr, this.Xs), clearTimeout(this.Js), (e = this.Ws) == null || e.stop(), this.Rs = !1);
5380
5377
  }
5381
5378
  Ks(e, t) {
5382
5379
  var n = this.instance.scrollManager.scrollY(), r = this.instance.scrollManager.scrollX(), i = this.instance.scrollManager.scrollElement(), a = function(e, t, n) {
5383
5380
  for (var r = e; r && Xo(r) && !Zo(r, "body");) {
5384
5381
  if (r === n) return !1;
5385
- if (I(t, A?.getComputedStyle(r).position)) return !0;
5382
+ if (F(t, k?.getComputedStyle(r).position)) return !0;
5386
5383
  r = cs(r);
5387
5384
  }
5388
5385
  return !1;
@@ -5398,7 +5395,7 @@ var Xs = class {
5398
5395
  var n;
5399
5396
  if (t === void 0 && (t = "click"), !Yo(e.target) && Ws(e)) {
5400
5397
  var r = this.Ks(e, t);
5401
- (n = this.rageclicks) != null && n.isRageClick(e.clientX, e.clientY, (/* @__PURE__ */ new Date()).getTime()) && this.Qs(F({}, r, { type: "rageclick" })), this.Qs(r);
5398
+ (n = this.rageclicks) != null && n.isRageClick(e.clientX, e.clientY, (/* @__PURE__ */ new Date()).getTime()) && this.Qs(P({}, r, { type: "rageclick" })), this.Qs(r);
5402
5399
  }
5403
5400
  }
5404
5401
  Gs(e) {
@@ -5407,13 +5404,13 @@ var Xs = class {
5407
5404
  }), 500));
5408
5405
  }
5409
5406
  Qs(e) {
5410
- if (A) {
5411
- var t = A.location.href, n = this.Bt.custom_personal_data_properties, r = Bi(t, this.Bt.mask_personal_data_properties ? [...Ui, ...n || []] : [], Gi);
5407
+ if (k) {
5408
+ var t = k.location.href, n = this.Bt.custom_personal_data_properties, r = Bi(t, this.Bt.mask_personal_data_properties ? [...Ui, ...n || []] : [], Gi);
5412
5409
  this.T = this.T || {}, this.T[r] || (this.T[r] = []), this.T[r].push(e);
5413
5410
  }
5414
5411
  }
5415
5412
  Yr() {
5416
- this.T && !Xe(this.T) && this.instance.capture("$$heatmap", { $heatmap_data: this.getAndClearBuffer() });
5413
+ this.T && !Ze(this.T) && this.instance.capture("$$heatmap", { $heatmap_data: this.getAndClearBuffer() });
5417
5414
  }
5418
5415
  },
5419
5416
  deadClicksAutocapture: Ai,
@@ -5425,8 +5422,8 @@ var Xs = class {
5425
5422
  metrics: [],
5426
5423
  firstMetricTimestamp: void 0
5427
5424
  }, this.eo = () => {
5428
- clearTimeout(this.ro), this.T.metrics.length !== 0 && (this._instance.capture("$web_vitals", this.T.metrics.reduce(((e, t) => F({}, e, {
5429
- ["$web_vitals_" + t.name + "_event"]: F({}, t),
5425
+ clearTimeout(this.ro), this.T.metrics.length !== 0 && (this._instance.capture("$web_vitals", this.T.metrics.reduce(((e, t) => P({}, e, {
5426
+ ["$web_vitals_" + t.name + "_event"]: P({}, t),
5430
5427
  ["$web_vitals_" + t.name + "_value"]: t.value
5431
5428
  })), {})), this.T = {
5432
5429
  url: void 0,
@@ -5435,7 +5432,7 @@ var Xs = class {
5435
5432
  });
5436
5433
  }, this.ht = (e) => {
5437
5434
  var t = this._instance.sessionManager?.checkAndGetSessionAndWindowId(!0);
5438
- if (z(t)) Fs.error("Could not read session ID. Dropping metrics!");
5435
+ if (R(t)) Fs.error("Could not read session ID. Dropping metrics!");
5439
5436
  else {
5440
5437
  this.T = this.T || {
5441
5438
  url: void 0,
@@ -5443,7 +5440,7 @@ var Xs = class {
5443
5440
  firstMetricTimestamp: void 0
5444
5441
  };
5445
5442
  var n = this.io();
5446
- z(n) || (V(e?.name) || V(e?.value) ? Fs.error("Invalid metric received", e) : !this.no || this.no > e.value ? (this.T.url !== n && (this.eo(), this.ro = setTimeout(this.eo, this.flushToCaptureTimeoutMs)), z(this.T.url) && (this.T.url = n), this.T.firstMetricTimestamp = z(this.T.firstMetricTimestamp) ? Date.now() : this.T.firstMetricTimestamp, e.attribution && e.attribution.interactionTargetElement && (e.attribution.interactionTargetElement = void 0), this.T.metrics.push(F({}, e, {
5443
+ R(n) || (B(e?.name) || B(e?.value) ? Fs.error("Invalid metric received", e) : !this.no || this.no > e.value ? (this.T.url !== n && (this.eo(), this.ro = setTimeout(this.eo, this.flushToCaptureTimeoutMs)), R(this.T.url) && (this.T.url = n), this.T.firstMetricTimestamp = R(this.T.firstMetricTimestamp) ? Date.now() : this.T.firstMetricTimestamp, e.attribution && e.attribution.interactionTargetElement && (e.attribution.interactionTargetElement = void 0), this.T.metrics.push(P({}, e, {
5447
5444
  $current_url: n,
5448
5445
  $session_id: t.sessionId,
5449
5446
  $window_id: t.windowId,
@@ -5452,8 +5449,8 @@ var Xs = class {
5452
5449
  }
5453
5450
  }, this.so = () => {
5454
5451
  if (!this.Rs) {
5455
- var e, t, n, r, i = N.__PosthogExtensions__;
5456
- z(i) || z(i.postHogWebVitalsCallbacks) || ({onLCP: e, onCLS: t, onFCP: n, onINP: r} = i.postHogWebVitalsCallbacks), e && t && n && r ? (this.allowedMetrics.indexOf("LCP") > -1 && e(this.ht.bind(this)), this.allowedMetrics.indexOf("CLS") > -1 && t(this.ht.bind(this)), this.allowedMetrics.indexOf("FCP") > -1 && n(this.ht.bind(this)), this.allowedMetrics.indexOf("INP") > -1 && r(this.ht.bind(this)), this.Rs = !0) : Fs.error("web vitals callbacks not loaded - not starting");
5452
+ var e, t, n, r, i = M.__PosthogExtensions__;
5453
+ R(i) || R(i.postHogWebVitalsCallbacks) || ({onLCP: e, onCLS: t, onFCP: n, onINP: r} = i.postHogWebVitalsCallbacks), e && t && n && r ? (this.allowedMetrics.indexOf("LCP") > -1 && e(this.ht.bind(this)), this.allowedMetrics.indexOf("CLS") > -1 && t(this.ht.bind(this)), this.allowedMetrics.indexOf("FCP") > -1 && n(this.ht.bind(this)), this.allowedMetrics.indexOf("INP") > -1 && r(this.ht.bind(this)), this.Rs = !0) : Fs.error("web vitals callbacks not loaded - not starting");
5457
5454
  }
5458
5455
  }, this._instance = e, this.$s = !((t = this._instance.persistence) == null || !t.props[ar]), this.startIfEnabled();
5459
5456
  }
@@ -5461,8 +5458,8 @@ var Xs = class {
5461
5458
  return this._instance.config.capture_performance;
5462
5459
  }
5463
5460
  get allowedMetrics() {
5464
- var e = R(this.oo) ? this.oo?.web_vitals_allowed_metrics : void 0;
5465
- return V(e) ? this._instance.persistence?.props[cr] || [
5461
+ var e = L(this.oo) ? this.oo?.web_vitals_allowed_metrics : void 0;
5462
+ return B(e) ? this._instance.persistence?.props[cr] || [
5466
5463
  "CLS",
5467
5464
  "FCP",
5468
5465
  "INP",
@@ -5470,39 +5467,39 @@ var Xs = class {
5470
5467
  ] : e;
5471
5468
  }
5472
5469
  get flushToCaptureTimeoutMs() {
5473
- return (R(this.oo) ? this.oo.web_vitals_delayed_flush_ms : void 0) || 5e3;
5470
+ return (L(this.oo) ? this.oo.web_vitals_delayed_flush_ms : void 0) || 5e3;
5474
5471
  }
5475
5472
  get useAttribution() {
5476
- var e = R(this.oo) ? this.oo.web_vitals_attribution : void 0;
5473
+ var e = L(this.oo) ? this.oo.web_vitals_attribution : void 0;
5477
5474
  return e != null && e;
5478
5475
  }
5479
5476
  get no() {
5480
- var e = R(this.oo) && $e(this.oo.__web_vitals_max_value) ? this.oo.__web_vitals_max_value : Is;
5477
+ var e = L(this.oo) && et(this.oo.__web_vitals_max_value) ? this.oo.__web_vitals_max_value : Is;
5481
5478
  return e > 0 && 6e4 >= e ? Is : e;
5482
5479
  }
5483
5480
  get isEnabled() {
5484
- var e = Ae?.protocol;
5481
+ var e = je?.protocol;
5485
5482
  if (e !== "http:" && e !== "https:") return Fs.info("Web Vitals are disabled on non-http/https protocols"), !1;
5486
- var t = R(this.oo) ? this.oo.web_vitals : tt(this.oo) ? this.oo : void 0;
5487
- return tt(t) ? t : this.$s;
5483
+ var t = L(this.oo) ? this.oo.web_vitals : nt(this.oo) ? this.oo : void 0;
5484
+ return nt(t) ? t : this.$s;
5488
5485
  }
5489
5486
  startIfEnabled() {
5490
5487
  this.isEnabled && !this.Rs && (Fs.info("enabled, starting..."), this.ur(this.so));
5491
5488
  }
5492
5489
  onRemoteConfig(e) {
5493
5490
  if ("capturePerformance" in e) {
5494
- var t = R(e.capturePerformance) && !!e.capturePerformance.web_vitals, n = R(e.capturePerformance) ? e.capturePerformance.web_vitals_allowed_metrics : void 0;
5491
+ var t = L(e.capturePerformance) && !!e.capturePerformance.web_vitals, n = L(e.capturePerformance) ? e.capturePerformance.web_vitals_allowed_metrics : void 0;
5495
5492
  this._instance.persistence && (this._instance.persistence.register({ [ar]: t }), this._instance.persistence.register({ [cr]: n })), this.$s = t, this.startIfEnabled();
5496
5493
  }
5497
5494
  }
5498
5495
  ur(e) {
5499
5496
  var t, n;
5500
- (t = N.__PosthogExtensions__) != null && t.postHogWebVitalsCallbacks ? e() : (n = N.__PosthogExtensions__) == null || n.loadExternalDependency == null || n.loadExternalDependency(this._instance, this.useAttribution ? "web-vitals-with-attribution" : "web-vitals", ((t) => {
5497
+ (t = M.__PosthogExtensions__) != null && t.postHogWebVitalsCallbacks ? e() : (n = M.__PosthogExtensions__) == null || n.loadExternalDependency == null || n.loadExternalDependency(this._instance, this.useAttribution ? "web-vitals-with-attribution" : "web-vitals", ((t) => {
5501
5498
  t ? Fs.error("failed to load script", t) : e();
5502
5499
  }));
5503
5500
  }
5504
5501
  io() {
5505
- var e = A ? A.location.href : void 0;
5502
+ var e = k ? k.location.href : void 0;
5506
5503
  if (e) {
5507
5504
  var t = this._instance.config.custom_personal_data_properties;
5508
5505
  return Bi(e, this._instance.config.mask_personal_data_properties ? [...Ui, ...t || []] : [], Gi);
@@ -5516,15 +5513,15 @@ var Xs = class {
5516
5513
  var t;
5517
5514
  this.so = () => {
5518
5515
  var e;
5519
- if (A && this.isEnabled && (e = N.__PosthogExtensions__) != null && e.errorWrappingFunctions) {
5520
- var t = N.__PosthogExtensions__.errorWrappingFunctions.wrapOnError, n = N.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection, r = N.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;
5516
+ if (k && this.isEnabled && (e = M.__PosthogExtensions__) != null && e.errorWrappingFunctions) {
5517
+ var t = M.__PosthogExtensions__.errorWrappingFunctions.wrapOnError, n = M.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection, r = M.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;
5521
5518
  try {
5522
5519
  !this.ao && this.Bt.capture_unhandled_errors && (this.ao = t(this.captureException.bind(this))), !this.lo && this.Bt.capture_unhandled_rejections && (this.lo = n(this.captureException.bind(this))), !this.uo && this.Bt.capture_console_errors && (this.uo = r(this.captureException.bind(this)));
5523
5520
  } catch (e) {
5524
5521
  Ms.error("failed to start", e), this.ho();
5525
5522
  }
5526
5523
  }
5527
- }, this._instance = e, this.co = !((t = this._instance.persistence) == null || !t.props[nr]), this.do = new dt({
5524
+ }, this._instance = e, this.co = !((t = this._instance.persistence) == null || !t.props[nr]), this.do = new ft({
5528
5525
  refillRate: this._instance.config.error_tracking.__exceptionRateLimiterRefillRate ?? 1,
5529
5526
  bucketSize: this._instance.config.error_tracking.__exceptionRateLimiterBucketSize ?? 10,
5530
5527
  refillInterval: 1e4,
@@ -5537,7 +5534,7 @@ var Xs = class {
5537
5534
  capture_unhandled_rejections: !1,
5538
5535
  capture_console_errors: !1
5539
5536
  };
5540
- return R(e) ? t = F({}, t, e) : (z(e) ? this.co : e) && (t = F({}, t, {
5537
+ return L(e) ? t = P({}, t, e) : (R(e) ? this.co : e) && (t = P({}, t, {
5541
5538
  capture_unhandled_errors: !0,
5542
5539
  capture_unhandled_rejections: !0
5543
5540
  })), t;
@@ -5550,7 +5547,7 @@ var Xs = class {
5550
5547
  }
5551
5548
  ur(e) {
5552
5549
  var t, n;
5553
- (t = N.__PosthogExtensions__) != null && t.errorWrappingFunctions && e(), (n = N.__PosthogExtensions__) == null || n.loadExternalDependency == null || n.loadExternalDependency(this._instance, "exception-autocapture", ((t) => {
5550
+ (t = M.__PosthogExtensions__) != null && t.errorWrappingFunctions && e(), (n = M.__PosthogExtensions__) == null || n.loadExternalDependency == null || n.loadExternalDependency(this._instance, "exception-autocapture", ((t) => {
5554
5551
  if (t) return Ms.error("failed to load script", t);
5555
5552
  e();
5556
5553
  }));
@@ -5605,7 +5602,7 @@ var Xs = class {
5605
5602
  if (!e.length) return [];
5606
5603
  var t = Array.from(e);
5607
5604
  return t.reverse(), t.slice(0, 50).map(((e) => {
5608
- return F({}, e, {
5605
+ return P({}, e, {
5609
5606
  filename: e.filename || (n = t, n[n.length - 1] || {}).filename,
5610
5607
  function: e.function || vn
5611
5608
  });
@@ -5639,7 +5636,7 @@ var Xs = class {
5639
5636
  }
5640
5637
  addExceptionStep(e, t) {
5641
5638
  if (this.mo.enabled) try {
5642
- if (!B(e) || e.trim().length === 0) return void cc.warn("Ignoring exception step because message must be a non-empty string");
5639
+ if (!z(e) || e.trim().length === 0) return void cc.warn("Ignoring exception step because message must be a non-empty string");
5643
5640
  var { sanitizedProperties: n, droppedKeys: r } = function(e) {
5644
5641
  if (!e) return {
5645
5642
  sanitizedProperties: {},
@@ -5651,7 +5648,7 @@ var Xs = class {
5651
5648
  droppedKeys: t
5652
5649
  };
5653
5650
  }(this._o(t));
5654
- r.length > 0 && cc.warn("Ignoring reserved exception step fields", { droppedKeys: r }), this.bo.add(F({
5651
+ r.length > 0 && cc.warn("Ignoring reserved exception step fields", { droppedKeys: r }), this.bo.add(P({
5655
5652
  [Bn]: e,
5656
5653
  [Vn]: (/* @__PURE__ */ new Date()).toISOString()
5657
5654
  }, n));
@@ -5667,7 +5664,7 @@ var Xs = class {
5667
5664
  if (!this.wo && this.xo(t)) return this.So("Exception dropped: thrown by a browser extension"), void cc.info("Skipping exception capture because it was thrown by an extension");
5668
5665
  if (!this._instance.config.error_tracking.__capturePostHogExceptions && this.ko(t)) return this.So("Exception dropped: thrown by the PostHog SDK"), void cc.info("Skipping exception capture because it was thrown by the PostHog SDK");
5669
5666
  }
5670
- var n = this.mo.enabled && V(e.$exception_steps) ? this.To(e) : e;
5667
+ var n = this.mo.enabled && B(e.$exception_steps) ? this.To(e) : e;
5671
5668
  try {
5672
5669
  var r = this._instance.capture("$exception", n, {
5673
5670
  _noTruncate: !0,
@@ -5687,7 +5684,7 @@ var Xs = class {
5687
5684
  To(e) {
5688
5685
  try {
5689
5686
  var t = this.bo.getAttachable();
5690
- return t.length === 0 ? e : F({}, e, { $exception_steps: t });
5687
+ return t.length === 0 ? e : P({}, e, { $exception_steps: t });
5691
5688
  } catch (t) {
5692
5689
  return cc.error("Failed to read buffered exception steps. Capturing exception without steps.", t), e;
5693
5690
  }
@@ -5699,7 +5696,7 @@ var Xs = class {
5699
5696
  });
5700
5697
  }
5701
5698
  _o(e) {
5702
- return R(e) ? F({}, e) : {};
5699
+ return L(e) ? P({}, e) : {};
5703
5700
  }
5704
5701
  yo() {
5705
5702
  return this._instance.config.error_tracking?.exception_steps ?? {};
@@ -5708,14 +5705,14 @@ var Xs = class {
5708
5705
  if (e.length === 0) return !1;
5709
5706
  var t = e.reduce(((e, t) => {
5710
5707
  var { type: n, value: r } = t;
5711
- return B(n) && n.length > 0 && e.$exception_types.push(n), B(r) && r.length > 0 && e.$exception_values.push(r), e;
5708
+ return z(n) && n.length > 0 && e.$exception_types.push(n), z(r) && r.length > 0 && e.$exception_values.push(r), e;
5712
5709
  }), {
5713
5710
  $exception_types: [],
5714
5711
  $exception_values: []
5715
5712
  });
5716
5713
  return this.fo.some(((e) => {
5717
5714
  var n = e.values.map(((e) => {
5718
- var n = go[e.operator], r = L(e.value) ? e.value : [e.value], i = t[e.key] ?? [];
5715
+ var n = go[e.operator], r = I(e.value) ? e.value : [e.value], i = t[e.key] ?? [];
5719
5716
  return r.length > 0 && n(r, i);
5720
5717
  }));
5721
5718
  return e.type === "OR" ? n.some(Boolean) : n.every(Boolean);
@@ -5732,10 +5729,10 @@ var Xs = class {
5732
5729
  return !1;
5733
5730
  }
5734
5731
  Io(e) {
5735
- return !V(e) && L(e);
5732
+ return !B(e) && I(e);
5736
5733
  }
5737
5734
  }
5738
- }, vc = F({ productTours: class {
5735
+ }, vc = P({ productTours: class {
5739
5736
  get ni() {
5740
5737
  return this._instance.persistence;
5741
5738
  }
@@ -5754,20 +5751,20 @@ var Xs = class {
5754
5751
  }
5755
5752
  ur(e) {
5756
5753
  var t, n;
5757
- (t = N.__PosthogExtensions__) != null && t.generateProductTours ? e() : (n = N.__PosthogExtensions__) == null || n.loadExternalDependency == null || n.loadExternalDependency(this._instance, "product-tours", ((t) => {
5754
+ (t = M.__PosthogExtensions__) != null && t.generateProductTours ? e() : (n = M.__PosthogExtensions__) == null || n.loadExternalDependency == null || n.loadExternalDependency(this._instance, "product-tours", ((t) => {
5758
5755
  t ? Gs.error("Could not load product tours script", t) : e();
5759
5756
  }));
5760
5757
  }
5761
5758
  Ro() {
5762
5759
  var e;
5763
- !this.Ao && (e = N.__PosthogExtensions__) != null && e.generateProductTours && (this.Ao = N.__PosthogExtensions__.generateProductTours(this._instance, !0));
5760
+ !this.Ao && (e = M.__PosthogExtensions__) != null && e.generateProductTours && (this.Ao = M.__PosthogExtensions__.generateProductTours(this._instance, !0));
5764
5761
  }
5765
5762
  getProductTours(e, t) {
5766
- if (t === void 0 && (t = !1), !L(this.Eo) || t) {
5763
+ if (t === void 0 && (t = !1), !I(this.Eo) || t) {
5767
5764
  var n = this.ni;
5768
5765
  if (n) {
5769
5766
  var r = n.props[Or];
5770
- if (L(r) && !t) return this.Eo = r, void e(r, { isLoaded: !0 });
5767
+ if (I(r) && !t) return this.Eo = r, void e(r, { isLoaded: !0 });
5771
5768
  }
5772
5769
  this._instance._send_request({
5773
5770
  url: this._instance.requestRouter.endpointFor("api", "/api/product_tours/?token=" + this._instance.config.token),
@@ -5782,14 +5779,14 @@ var Xs = class {
5782
5779
  });
5783
5780
  return;
5784
5781
  }
5785
- var a = L(t.json.product_tours) ? t.json.product_tours : [];
5782
+ var a = I(t.json.product_tours) ? t.json.product_tours : [];
5786
5783
  this.Eo = a, n && n.register({ [Or]: a }), e(a, { isLoaded: !0 });
5787
5784
  }
5788
5785
  });
5789
5786
  } else e(this.Eo, { isLoaded: !0 });
5790
5787
  }
5791
5788
  getActiveProductTours(e) {
5792
- V(this.Ao) ? e([], {
5789
+ B(this.Ao) ? e([], {
5793
5790
  isLoaded: !1,
5794
5791
  error: "Product tours not loaded"
5795
5792
  }) : this.Ao.getActiveProductTours(e);
@@ -5847,7 +5844,7 @@ var Xs = class {
5847
5844
  }
5848
5845
  get siteAppLoaders() {
5849
5846
  var e;
5850
- return (e = N._POSTHOG_REMOTE_CONFIG) == null || (e = e[this._instance.config.token]) == null ? void 0 : e.siteApps;
5847
+ return (e = M._POSTHOG_REMOTE_CONFIG) == null || (e = e[this._instance.config.token]) == null ? void 0 : e.siteApps;
5851
5848
  }
5852
5849
  initialize() {
5853
5850
  if (this.isEnabled) {
@@ -5867,8 +5864,8 @@ var Xs = class {
5867
5864
  };
5868
5865
  var { $set_once: o, $set: s } = e;
5869
5866
  return {
5870
- event: F({}, ze(e, Ks), {
5871
- properties: F({}, e.properties, s ? { $set: F({}, e.properties?.$set ?? {}, s) } : {}, o ? { $set_once: F({}, e.properties?.$set_once ?? {}, o) } : {}),
5867
+ event: P({}, Be(e, Ks), {
5868
+ properties: P({}, e.properties, s ? { $set: P({}, e.properties?.$set ?? {}, s) } : {}, o ? { $set_once: P({}, e.properties?.$set_once ?? {}, o) } : {}),
5872
5869
  elements_chain: e.properties?.$elements_chain ?? "",
5873
5870
  distinct_id: e.properties?.distinct_id
5874
5871
  }),
@@ -5926,7 +5923,7 @@ var Xs = class {
5926
5923
  if ((n = this.Fo) == null || n.call(this), (r = e.siteApps) != null && r.length) if (this.isEnabled) {
5927
5924
  var a = function(e) {
5928
5925
  var t;
5929
- N["__$$ph_site_app_" + e] = i._instance, (t = N.__PosthogExtensions__) == null || t.loadSiteApp == null || t.loadSiteApp(i._instance, s, ((t) => {
5926
+ M["__$$ph_site_app_" + e] = i._instance, (t = M.__PosthogExtensions__) == null || t.loadSiteApp == null || t.loadSiteApp(i._instance, s, ((t) => {
5930
5927
  if (t) return qs.error(Js + e, t);
5931
5928
  }));
5932
5929
  };
@@ -5937,7 +5934,7 @@ var Xs = class {
5937
5934
  constructor(e) {
5938
5935
  this.Lo = void 0, this.Do = void 0, this.so = () => {
5939
5936
  var e, t, n = this.Bo() || [];
5940
- z(this.Lo) && ((e = N.__PosthogExtensions__) == null || (e = e.tracingHeadersPatchFns) == null || e._patchXHR(n, this._instance.get_distinct_id(), this._instance.sessionManager)), z(this.Do) && ((t = N.__PosthogExtensions__) == null || (t = t.tracingHeadersPatchFns) == null || t._patchFetch(n, this._instance.get_distinct_id(), this._instance.sessionManager));
5937
+ R(this.Lo) && ((e = M.__PosthogExtensions__) == null || (e = e.tracingHeadersPatchFns) == null || e._patchXHR(n, this._instance.get_distinct_id(), this._instance.sessionManager)), R(this.Do) && ((t = M.__PosthogExtensions__) == null || (t = t.tracingHeadersPatchFns) == null || t._patchFetch(n, this._instance.get_distinct_id(), this._instance.sessionManager));
5941
5938
  }, this._instance = e;
5942
5939
  }
5943
5940
  initialize() {
@@ -5945,7 +5942,7 @@ var Xs = class {
5945
5942
  }
5946
5943
  ur(e) {
5947
5944
  var t, n;
5948
- (t = N.__PosthogExtensions__) != null && t.tracingHeadersPatchFns && e(), (n = N.__PosthogExtensions__) == null || n.loadExternalDependency == null || n.loadExternalDependency(this._instance, "tracing-headers", ((t) => {
5945
+ (t = M.__PosthogExtensions__) != null && t.tracingHeadersPatchFns && e(), (n = M.__PosthogExtensions__) == null || n.loadExternalDependency == null || n.loadExternalDependency(this._instance, "tracing-headers", ((t) => {
5949
5946
  if (t) return Ps.error("failed to load script", t);
5950
5947
  e();
5951
5948
  }));
@@ -5957,7 +5954,7 @@ var Xs = class {
5957
5954
  var e, t;
5958
5955
  this.Bo() ? this.ur(this.so) : ((e = this.Lo) == null || e.call(this), (t = this.Do) == null || t.call(this), this.Lo = void 0, this.Do = void 0);
5959
5956
  }
5960
- } }, xc = F({ surveys: class {
5957
+ } }, xc = P({ surveys: class {
5961
5958
  get Bt() {
5962
5959
  return this._instance.config;
5963
5960
  }
@@ -5970,8 +5967,8 @@ var Xs = class {
5970
5967
  onRemoteConfig(e) {
5971
5968
  if (!this.Bt.disable_surveys) {
5972
5969
  var t = e.surveys;
5973
- if (V(t)) return Q.warn("Flags not loaded yet. Not loading surveys.");
5974
- var n = L(t);
5970
+ if (B(t)) return Q.warn("Flags not loaded yet. Not loading surveys.");
5971
+ var n = I(t);
5975
5972
  this.jo = n ? t.length > 0 : t, Q.info("flags response received, isSurveysEnabled: " + this.jo), this.loadIfEnabled();
5976
5973
  }
5977
5974
  }
@@ -5988,9 +5985,9 @@ var Xs = class {
5988
5985
  else if (this.Bt.disable_surveys) Q.info(ec);
5989
5986
  else if (this.Bt.cookieless_mode && this._instance.consent.isOptedOut()) Q.info("Not loading surveys in cookieless mode without consent.");
5990
5987
  else {
5991
- var e = N?.__PosthogExtensions__;
5988
+ var e = M?.__PosthogExtensions__;
5992
5989
  if (e) {
5993
- if (!z(this.jo) || this.Bt.advanced_enable_surveys) {
5990
+ if (!R(this.jo) || this.Bt.advanced_enable_surveys) {
5994
5991
  var t = this.jo || this.Bt.advanced_enable_surveys;
5995
5992
  this.$o = !0;
5996
5993
  try {
@@ -6081,7 +6078,7 @@ var Xs = class {
6081
6078
  }
6082
6079
  }
6083
6080
  getActiveMatchingSurveys(e, t) {
6084
- if (t === void 0 && (t = !1), !V(this._surveyManager)) return this._surveyManager.getActiveMatchingSurveys(e, t);
6081
+ if (t === void 0 && (t = !1), !B(this._surveyManager)) return this._surveyManager.getActiveMatchingSurveys(e, t);
6085
6082
  Q.warn("init was not called");
6086
6083
  }
6087
6084
  Uo(e) {
@@ -6091,7 +6088,7 @@ var Xs = class {
6091
6088
  })), t;
6092
6089
  }
6093
6090
  Yo(e) {
6094
- if (V(this._surveyManager)) return {
6091
+ if (B(this._surveyManager)) return {
6095
6092
  eligible: !1,
6096
6093
  reason: $s
6097
6094
  };
@@ -6102,7 +6099,7 @@ var Xs = class {
6102
6099
  };
6103
6100
  }
6104
6101
  canRenderSurvey(e) {
6105
- if (V(this._surveyManager)) return Q.warn("init was not called"), {
6102
+ if (B(this._surveyManager)) return Q.warn("init was not called"), {
6106
6103
  visible: !1,
6107
6104
  disabledReason: $s
6108
6105
  };
@@ -6113,7 +6110,7 @@ var Xs = class {
6113
6110
  };
6114
6111
  }
6115
6112
  canRenderSurveyAsync(e, t) {
6116
- return V(this._surveyManager) ? (Q.warn("init was not called"), Promise.resolve({
6113
+ return B(this._surveyManager) ? (Q.warn("init was not called"), Promise.resolve({
6117
6114
  visible: !1,
6118
6115
  disabledReason: $s
6119
6116
  })) : new Promise(((n) => {
@@ -6134,11 +6131,11 @@ var Xs = class {
6134
6131
  }
6135
6132
  renderSurvey(e, t, n) {
6136
6133
  var r;
6137
- if (V(this._surveyManager)) Q.warn("init was not called");
6134
+ if (B(this._surveyManager)) Q.warn("init was not called");
6138
6135
  else {
6139
6136
  var i = typeof e == "string" ? this.Uo(e) : e;
6140
6137
  if (i != null && i.id) if (Eo.includes(i.type)) {
6141
- var a = M?.querySelector(t);
6138
+ var a = j?.querySelector(t);
6142
6139
  if (a) return (r = i.appearance) != null && r.surveyPopupDelaySeconds ? (Q.info("Rendering survey " + i.id + " with delay of " + i.appearance.surveyPopupDelaySeconds + " seconds"), void setTimeout((() => {
6143
6140
  var e;
6144
6141
  Q.info("Rendering survey " + i.id + " with delay of " + i.appearance?.surveyPopupDelaySeconds + " seconds"), (e = this._surveyManager) == null || e.renderSurvey(i, a, n), Q.info("Survey " + i.id + " rendered");
@@ -6150,12 +6147,12 @@ var Xs = class {
6150
6147
  }
6151
6148
  displaySurvey(e, t) {
6152
6149
  var n;
6153
- if (V(this._surveyManager)) Q.warn("init was not called");
6150
+ if (B(this._surveyManager)) Q.warn("init was not called");
6154
6151
  else {
6155
6152
  var r = this.Uo(e);
6156
6153
  if (r) {
6157
6154
  var i = r;
6158
- if ((n = r.appearance) != null && n.surveyPopupDelaySeconds && t.ignoreDelay && (i = F({}, r, { appearance: F({}, r.appearance, { surveyPopupDelaySeconds: 0 }) })), t.displayType !== la.Popover && t.initialResponses && Q.warn("initialResponses is only supported for popover surveys. prefill will not be applied."), !1 === t.ignoreConditions) {
6155
+ if ((n = r.appearance) != null && n.surveyPopupDelaySeconds && t.ignoreDelay && (i = P({}, r, { appearance: P({}, r.appearance, { surveyPopupDelaySeconds: 0 }) })), t.displayType !== la.Popover && t.initialResponses && Q.warn("initialResponses is only supported for popover surveys. prefill will not be applied."), !1 === t.ignoreConditions) {
6159
6156
  var a = this.canRenderSurvey(r);
6160
6157
  if (!a.visible) return void Q.warn("Survey is not eligible to be displayed: ", a.disabledReason);
6161
6158
  }
@@ -6164,7 +6161,7 @@ var Xs = class {
6164
6161
  }
6165
6162
  }
6166
6163
  cancelPendingSurvey(e) {
6167
- V(this._surveyManager) ? Q.warn("init was not called") : this._surveyManager.cancelSurvey(e);
6164
+ B(this._surveyManager) ? Q.warn("init was not called") : this._surveyManager.cancelSurvey(e);
6168
6165
  }
6169
6166
  handlePageUnload() {
6170
6167
  var e;
@@ -6175,25 +6172,25 @@ var Xs = class {
6175
6172
  this.instance = e;
6176
6173
  }
6177
6174
  Go(e) {
6178
- N.ph_toolbar_state = e;
6175
+ M.ph_toolbar_state = e;
6179
6176
  }
6180
6177
  Wo() {
6181
- return N.ph_toolbar_state ?? 0;
6178
+ return M.ph_toolbar_state ?? 0;
6182
6179
  }
6183
6180
  initialize() {
6184
6181
  return this.maybeLoadToolbar();
6185
6182
  }
6186
6183
  maybeLoadToolbar(e, t, n) {
6187
- if (e === void 0 && (e = void 0), t === void 0 && (t = void 0), n === void 0 && (n = void 0), ui(this.instance.config) || !A || !M) return !1;
6188
- e ??= A.location, n ??= A.history;
6184
+ if (e === void 0 && (e = void 0), t === void 0 && (t = void 0), n === void 0 && (n = void 0), ui(this.instance.config) || !k || !j) return !1;
6185
+ e ??= k.location, n ??= k.history;
6189
6186
  try {
6190
6187
  if (!t) {
6191
6188
  try {
6192
- A.localStorage.setItem("test", "test"), A.localStorage.removeItem("test");
6189
+ k.localStorage.setItem("test", "test"), k.localStorage.removeItem("test");
6193
6190
  } catch {
6194
6191
  return !1;
6195
6192
  }
6196
- t = A?.localStorage;
6193
+ t = k?.localStorage;
6197
6194
  }
6198
6195
  var r, i = tc || Vi(e.hash, "__posthog") || Vi(e.hash, "state"), a = i ? ai((() => JSON.parse(atob(decodeURIComponent(i))))) || ai((() => JSON.parse(decodeURIComponent(i)))) : null;
6199
6196
  return a && a.action === "ph_authorize" ? ((r = a).source = "url", r && Object.keys(r).length > 0 && (a.desiredHash ? e.hash = a.desiredHash : n ? n.replaceState(n.state, "", e.pathname + e.search) : e.hash = "")) : ((r = JSON.parse(t.getItem(nc) || "{}")).source = "localstorage", delete r.userIntent), !(!r.token || this.instance.config.token !== r.token || (this.loadToolbar(r), 0));
@@ -6202,20 +6199,20 @@ var Xs = class {
6202
6199
  }
6203
6200
  }
6204
6201
  Xo(e) {
6205
- var t = N.ph_load_toolbar || N.ph_load_editor;
6206
- !V(t) && Ye(t) ? t(e, this.instance) : rc.warn("No toolbar load function found");
6202
+ var t = M.ph_load_toolbar || M.ph_load_editor;
6203
+ !B(t) && Xe(t) ? t(e, this.instance) : rc.warn("No toolbar load function found");
6207
6204
  }
6208
6205
  loadToolbar(e) {
6209
- var t = !(M == null || !M.getElementById(Br));
6210
- if (!A || t) return !1;
6211
- var n = this.instance.requestRouter.region === "custom" && this.instance.config.advanced_disable_toolbar_metrics, r = F({ token: this.instance.config.token }, e, { apiURL: this.instance.requestRouter.endpointFor("ui") }, n ? { instrument: !1 } : {});
6212
- if (A.localStorage.setItem(nc, JSON.stringify(F({}, r, { source: void 0 }))), this.Wo() === 2) this.Xo(r);
6206
+ var t = !(j == null || !j.getElementById(Br));
6207
+ if (!k || t) return !1;
6208
+ var n = this.instance.requestRouter.region === "custom" && this.instance.config.advanced_disable_toolbar_metrics, r = P({ token: this.instance.config.token }, e, { apiURL: this.instance.requestRouter.endpointFor("ui") }, n ? { instrument: !1 } : {});
6209
+ if (k.localStorage.setItem(nc, JSON.stringify(P({}, r, { source: void 0 }))), this.Wo() === 2) this.Xo(r);
6213
6210
  else if (this.Wo() === 0) {
6214
6211
  var i;
6215
- this.Go(1), (i = N.__PosthogExtensions__) == null || i.loadExternalDependency == null || i.loadExternalDependency(this.instance, "toolbar", ((e) => {
6212
+ this.Go(1), (i = M.__PosthogExtensions__) == null || i.loadExternalDependency == null || i.loadExternalDependency(this.instance, "toolbar", ((e) => {
6216
6213
  if (e) return rc.error("[Toolbar] Failed to load", e), void this.Go(0);
6217
6214
  this.Go(2), this.Xo(r);
6218
- })), q(A, "turbolinks:load", (() => {
6215
+ })), q(k, "turbolinks:load", (() => {
6219
6216
  this.Go(0), this.loadToolbar(r);
6220
6217
  }));
6221
6218
  }
@@ -6227,7 +6224,7 @@ var Xs = class {
6227
6224
  maybeLoadEditor(e, t, n) {
6228
6225
  return e === void 0 && (e = void 0), t === void 0 && (t = void 0), n === void 0 && (n = void 0), this.maybeLoadToolbar(e, t, n);
6229
6226
  }
6230
- } }, Cc = F({ experiments: dc }, mc), wc = F({}, mc, hc, gc, _c, vc, yc, xc, bc, Sc, Cc, { conversations: class {
6227
+ } }, Cc = P({ experiments: dc }, mc), wc = P({}, mc, hc, gc, _c, vc, yc, xc, bc, Sc, Cc, { conversations: class {
6231
6228
  constructor(e) {
6232
6229
  this.Ko = void 0, this._conversationsManager = null, this.Qo = !1, this.ea = null, this._instance = e;
6233
6230
  }
@@ -6237,7 +6234,7 @@ var Xs = class {
6237
6234
  onRemoteConfig(e) {
6238
6235
  if (!this._instance.config.disable_conversations) {
6239
6236
  var t = e.conversations;
6240
- V(t) || (tt(t) ? this.Ko = t : (this.Ko = t.enabled, this.ea = t), this.loadIfEnabled());
6237
+ B(t) || (nt(t) ? this.Ko = t : (this.Ko = t.enabled, this.ea = t), this.loadIfEnabled());
6241
6238
  }
6242
6239
  }
6243
6240
  reset() {
@@ -6246,8 +6243,8 @@ var Xs = class {
6246
6243
  }
6247
6244
  loadIfEnabled() {
6248
6245
  if (!(this._conversationsManager || this.Qo || this._instance.config.disable_conversations || ui(this._instance.config) || this._instance.config.cookieless_mode && this._instance.consent.isOptedOut())) {
6249
- var e = N?.__PosthogExtensions__;
6250
- if (e && !z(this.Ko) && this.Ko) if (this.ea && this.ea.token) {
6246
+ var e = M?.__PosthogExtensions__;
6247
+ if (e && !R(this.Ko) && this.Ko) if (this.ea && this.ea.token) {
6251
6248
  this.Qo = !0;
6252
6249
  try {
6253
6250
  var t = e.initConversations;
@@ -6281,7 +6278,7 @@ var Xs = class {
6281
6278
  this._conversationsManager && this._conversationsManager.hide();
6282
6279
  }
6283
6280
  isAvailable() {
6284
- return !0 === this.Ko && !Qe(this._conversationsManager);
6281
+ return !0 === this.Ko && !$e(this._conversationsManager);
6285
6282
  }
6286
6283
  isVisible() {
6287
6284
  var e;
@@ -6289,43 +6286,43 @@ var Xs = class {
6289
6286
  }
6290
6287
  sendMessage(e, t, n) {
6291
6288
  var r = this;
6292
- return Re((function* () {
6289
+ return ze((function* () {
6293
6290
  return r._conversationsManager ? r._conversationsManager.sendMessage(e, t, n) : (fc.warn(pc), null);
6294
6291
  }))();
6295
6292
  }
6296
6293
  getMessages(e, t) {
6297
6294
  var n = this;
6298
- return Re((function* () {
6295
+ return ze((function* () {
6299
6296
  return n._conversationsManager ? n._conversationsManager.getMessages(e, t) : (fc.warn(pc), null);
6300
6297
  }))();
6301
6298
  }
6302
6299
  markAsRead(e) {
6303
6300
  var t = this;
6304
- return Re((function* () {
6301
+ return ze((function* () {
6305
6302
  return t._conversationsManager ? t._conversationsManager.markAsRead(e) : (fc.warn(pc), null);
6306
6303
  }))();
6307
6304
  }
6308
6305
  getTickets(e) {
6309
6306
  var t = this;
6310
- return Re((function* () {
6307
+ return ze((function* () {
6311
6308
  return t._conversationsManager ? t._conversationsManager.getTickets(e) : (fc.warn(pc), null);
6312
6309
  }))();
6313
6310
  }
6314
6311
  requestRestoreLink(e) {
6315
6312
  var t = this;
6316
- return Re((function* () {
6313
+ return ze((function* () {
6317
6314
  return t._conversationsManager ? t._conversationsManager.requestRestoreLink(e) : (fc.warn(pc), null);
6318
6315
  }))();
6319
6316
  }
6320
6317
  restoreFromToken(e) {
6321
6318
  var t = this;
6322
- return Re((function* () {
6319
+ return ze((function* () {
6323
6320
  return t._conversationsManager ? t._conversationsManager.restoreFromToken(e) : (fc.warn(pc), null);
6324
6321
  }))();
6325
6322
  }
6326
6323
  restoreFromUrlToken() {
6327
6324
  var e = this;
6328
- return Re((function* () {
6325
+ return ze((function* () {
6329
6326
  return e._conversationsManager ? e._conversationsManager.restoreFromUrlToken() : (fc.warn(pc), null);
6330
6327
  }))();
6331
6328
  }
@@ -6353,14 +6350,14 @@ var Xs = class {
6353
6350
  }
6354
6351
  onRemoteConfig(e) {
6355
6352
  var t = e.logs?.captureConsoleLogs;
6356
- !V(t) && t && (this.ia = !0, this.loadIfEnabled());
6353
+ !B(t) && t && (this.ia = !0, this.loadIfEnabled());
6357
6354
  }
6358
6355
  reset() {
6359
6356
  this.sa = [], this.jr &&= (clearTimeout(this.jr), void 0), this.oa = 0, this.aa = 0, this.la = !1;
6360
6357
  }
6361
6358
  loadIfEnabled() {
6362
6359
  if (this.ia && !this.na) {
6363
- var e = N?.__PosthogExtensions__;
6360
+ var e = M?.__PosthogExtensions__;
6364
6361
  if (e) {
6365
6362
  var t = e.loadExternalDependency;
6366
6363
  t ? t(this._instance, "logs", ((t) => {
@@ -6378,7 +6375,7 @@ var Xs = class {
6378
6375
  var i = function(e, t) {
6379
6376
  var { text: n, number: r } = fn[e.level || "info"] || pn, i = String(Date.now()) + "000000", a = {};
6380
6377
  t.distinctId && (a.posthogDistinctId = t.distinctId), t.sessionId && (a.sessionId = t.sessionId), t.currentUrl && (a["url.full"] = t.currentUrl), t.screenName && (a["screen.name"] = t.screenName), t.appState && (a["app.state"] = t.appState), t.activeFeatureFlags && t.activeFeatureFlags.length > 0 && (a.feature_flags = t.activeFeatureFlags);
6381
- var o = F({}, a, e.attributes || {}), s = {
6378
+ var o = P({}, a, e.attributes || {}), s = {
6382
6379
  timeUnixNano: i,
6383
6380
  observedTimeUnixNano: i,
6384
6381
  severityNumber: r,
@@ -6386,7 +6383,7 @@ var Xs = class {
6386
6383
  body: { stringValue: e.body },
6387
6384
  attributes: hn(o)
6388
6385
  };
6389
- return e.trace_id && (s.traceId = e.trace_id), e.span_id && (s.spanId = e.span_id), z(e.trace_flags) || (s.flags = e.trace_flags), s;
6386
+ return e.trace_id && (s.traceId = e.trace_id), e.span_id && (s.spanId = e.span_id), R(e.trace_flags) || (s.flags = e.trace_flags), s;
6390
6387
  }(e, this.ua());
6391
6388
  this.sa.push({ record: i }), (this._instance.config.logs?.maxBufferSize ?? 100) > this.sa.length ? this.ha() : this.flushLogs();
6392
6389
  } else this.la ||= (this.Gt.warn("captureLog dropping logs: exceeded " + n + " logs per " + t + "ms"), !0);
@@ -6430,7 +6427,7 @@ var Xs = class {
6430
6427
  if (this.jr &&= (clearTimeout(this.jr), void 0), this.sa.length !== 0) {
6431
6428
  var t = this.sa;
6432
6429
  this.sa = [];
6433
- var n = this._instance.config.logs, r = F({ "service.name": n?.serviceName || "unknown_service" }, n?.environment && { "deployment.environment": n.environment }, n?.serviceVersion && { "service.version": n.serviceVersion }, n?.resourceAttributes), i = function(e, t, n, r) {
6430
+ var n = this._instance.config.logs, r = P({ "service.name": n?.serviceName || "unknown_service" }, n?.environment && { "deployment.environment": n.environment }, n?.serviceVersion && { "service.version": n.serviceVersion }, n?.resourceAttributes), i = function(e, t, n, r) {
6434
6431
  return { resourceLogs: [{
6435
6432
  resource: { attributes: hn(t) },
6436
6433
  scopeLogs: [{
@@ -6441,7 +6438,7 @@ var Xs = class {
6441
6438
  logRecords: e
6442
6439
  }]
6443
6440
  }] };
6444
- }(t.map(((e) => e.record)), r, P.LIB_NAME, P.LIB_VERSION), a = this._instance.requestRouter.endpointFor("api", "/i/v1/logs") + "?token=" + encodeURIComponent(this._instance.config.token);
6441
+ }(t.map(((e) => e.record)), r, N.LIB_NAME, N.LIB_VERSION), a = this._instance.requestRouter.endpointFor("api", "/i/v1/logs") + "?token=" + encodeURIComponent(this._instance.config.token);
6445
6442
  this._instance.Hi({
6446
6443
  method: "POST",
6447
6444
  url: a,
@@ -6463,21 +6460,21 @@ var Xs = class {
6463
6460
  var { sessionId: n } = this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);
6464
6461
  t.sessionId = n;
6465
6462
  }
6466
- if (N != null && (e = N.location) != null && e.href && (t.currentUrl = N.location.href), this._instance.featureFlags) {
6463
+ if (M != null && (e = M.location) != null && e.href && (t.currentUrl = M.location.href), this._instance.featureFlags) {
6467
6464
  var r = this._instance.featureFlags.getFlags();
6468
6465
  r && r.length > 0 && (t.activeFeatureFlags = r);
6469
6466
  }
6470
6467
  return t;
6471
6468
  }
6472
6469
  } });
6473
- Go.__defaultExtensionClasses = F({}, wc);
6470
+ Go.__defaultExtensionClasses = P({}, wc);
6474
6471
  var Tc, Ec = (Tc = Mo[zo] = new Go(), function() {
6475
6472
  function e() {
6476
6473
  e.done || (e.done = !0, Bo = !1, G(Mo, (function(e) {
6477
6474
  e._dom_loaded();
6478
6475
  })));
6479
6476
  }
6480
- M != null && M.addEventListener ? M.readyState === "complete" ? e() : q(M, "DOMContentLoaded", e, { capture: !1 }) : A && U.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized");
6477
+ j != null && j.addEventListener ? j.readyState === "complete" ? e() : q(j, "DOMContentLoaded", e, { capture: !1 }) : k && U.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized");
6481
6478
  }(), Tc), Dc;
6482
6479
  function Oc(e) {
6483
6480
  Dc = e;
@@ -6585,7 +6582,7 @@ var Ic = {
6585
6582
  //#endregion
6586
6583
  //#region src/PostHogProviderWrapper.tsx
6587
6584
  var Rc = ({ debug: e = !1, postHogApiKey: t, isStandalone: n, project: r, forceDisablePostHog: i = !1, children: a }) => {
6588
- let o = ue();
6585
+ let o = de();
6589
6586
  return g(() => {
6590
6587
  !t || i || (o?.PostHog.consentGiven ? Ec.opt_in_capturing() : Ec.opt_out_capturing());
6591
6588
  }, [
@@ -6604,6 +6601,6 @@ var Rc = ({ debug: e = !1, postHogApiKey: t, isStandalone: n, project: r, forceD
6604
6601
  }));
6605
6602
  };
6606
6603
  //#endregion
6607
- export { E as AppShell, de as ConsentManagerProvider, me as LanguageProvider, ye as MenuProvider, xe as MicroFrontendLink, Ee as OrganisationProvider, Oe as OrganisationSelector, De as OrganisationsError, Rc as PostHogProviderWrapper, ie as languageStorage, ne as organisationStorage, ue as useConsentManager, pe as useLanguage, ve as useMFNavigation, _e as useMenu, ge as useMenuGroupItems, Ce as useOrganisation, we as useOrganisationId };
6604
+ export { ne as AppShell, fe as ConsentManagerProvider, he as LanguageProvider, be as MenuProvider, Se as MicroFrontendLink, De as OrganisationProvider, ke as OrganisationSelector, Oe as OrganisationsError, Rc as PostHogProviderWrapper, ae as languageStorage, E as organisationStorage, de as useConsentManager, me as useLanguage, ye as useMFNavigation, ve as useMenu, _e as useMenuGroupItems, we as useOrganisation, Te as useOrganisationId };
6608
6605
 
6609
6606
  //# sourceMappingURL=index.mjs.map