@knocklabs/client 0.18.4 → 0.18.6

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.
@@ -1,53 +1,96 @@
1
- var _ = Object.defineProperty;
2
- var b = (a, e, t) => e in a ? _(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
- var d = (a, e, t) => b(a, typeof e != "symbol" ? e + "" : e, t);
1
+ var b = Object.defineProperty;
2
+ var I = (u, e, t) => e in u ? b(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
3
+ var d = (u, e, t) => I(u, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { Store as C } from "@tanstack/store";
5
- import { URLPattern as I } from "urlpattern-polyfill";
6
- import { byKey as w, mockDefaultGroup as E, formatFilters as g, formatState as p, findDefaultGroup as S, DEFAULT_GROUP_KEY as k, checkIfThrottled as R, formatGroupStage as f, SelectionResult as A, newUrl as L, predicateUrlRules as P, predicateUrlPatterns as $ } from "./helpers.mjs";
7
- const D = 50, T = 30 * 1e3, O = 3, G = {
5
+ import { URLPattern as E } from "urlpattern-polyfill";
6
+ import { byKey as w, mockDefaultGroup as R, formatFilters as k, formatState as f, findDefaultGroup as v, DEFAULT_GROUP_KEY as S, checkIfThrottled as P, formatGroupStage as G, SelectionResult as A, newUrl as D, predicateUrlRules as K, predicateUrlPatterns as L } from "./helpers.mjs";
7
+ const O = 50, $ = 30 * 1e3, T = 3, g = {
8
8
  GUIDE_KEY: "knock_guide_key",
9
9
  PREVIEW_SESSION_ID: "knock_preview_session_id"
10
- }, l = () => {
10
+ }, p = "knock_guide_debug", l = () => {
11
11
  if (typeof window < "u")
12
12
  return window;
13
- }, K = (a) => `/v1/users/${a}/guides`, y = () => {
14
- const a = l();
15
- if (!a)
13
+ }, U = (u) => `/v1/users/${u}/guides`, y = () => {
14
+ const u = l();
15
+ if (!u)
16
16
  return { forcedGuideKey: null, previewSessionId: null };
17
- const e = new URLSearchParams(a.location.search), t = e.get(G.GUIDE_KEY), s = e.get(G.PREVIEW_SESSION_ID);
18
- return { forcedGuideKey: t, previewSessionId: s };
19
- }, m = (a, e = {}) => {
20
- const t = new A(), s = S(a.guideGroups);
17
+ const e = new URLSearchParams(u.location.search), t = e.get(g.GUIDE_KEY), s = e.get(
18
+ g.PREVIEW_SESSION_ID
19
+ );
20
+ if (t || s) {
21
+ if (u.localStorage)
22
+ try {
23
+ const r = {
24
+ forcedGuideKey: t,
25
+ previewSessionId: s
26
+ };
27
+ u.localStorage.setItem(p, JSON.stringify(r));
28
+ } catch {
29
+ }
30
+ return {
31
+ forcedGuideKey: t,
32
+ previewSessionId: s
33
+ };
34
+ }
35
+ let i = null, n = null;
36
+ if (u.localStorage)
37
+ try {
38
+ const r = u.localStorage.getItem(p);
39
+ if (r) {
40
+ const o = F(r);
41
+ i = o.forcedGuideKey, n = o.previewSessionId;
42
+ }
43
+ } catch {
44
+ }
45
+ return {
46
+ forcedGuideKey: i,
47
+ previewSessionId: n
48
+ };
49
+ }, F = (u) => {
50
+ try {
51
+ const e = JSON.parse(u);
52
+ return {
53
+ forcedGuideKey: (e == null ? void 0 : e.forcedGuideKey) ?? null,
54
+ previewSessionId: (e == null ? void 0 : e.previewSessionId) ?? null
55
+ };
56
+ } catch {
57
+ return {
58
+ forcedGuideKey: null,
59
+ previewSessionId: null
60
+ };
61
+ }
62
+ }, m = (u, e = {}) => {
63
+ const t = new A(), s = v(u.guideGroups);
21
64
  if (!s) return t;
22
- const i = [...s.display_sequence], r = a.location;
23
- if (a.debug.forcedGuideKey) {
24
- const n = i.indexOf(a.debug.forcedGuideKey);
25
- n > -1 && i.splice(n, 1), i.unshift(a.debug.forcedGuideKey);
26
- }
27
- for (const [n, o] of i.entries()) {
28
- let u = a.guides[o];
29
- a.debug.forcedGuideKey === o && a.previewGuides[o] && (u = a.previewGuides[o]), !(!u || !F(u, {
30
- location: r,
65
+ const i = [...s.display_sequence], n = u.location;
66
+ if (u.debug.forcedGuideKey) {
67
+ const r = i.indexOf(u.debug.forcedGuideKey);
68
+ r > -1 && i.splice(r, 1), i.unshift(u.debug.forcedGuideKey);
69
+ }
70
+ for (const [r, o] of i.entries()) {
71
+ let a = u.guides[o];
72
+ u.debug.forcedGuideKey === o && u.previewGuides[o] && (a = u.previewGuides[o]), !(!a || !N(a, {
73
+ location: n,
31
74
  filters: e,
32
- debug: a.debug
33
- })) && t.set(n, u);
75
+ debug: u.debug
76
+ })) && t.set(r, a);
34
77
  }
35
78
  return t.metadata = { guideGroup: s }, t;
36
- }, F = (a, { location: e, filters: t = {}, debug: s = {} }) => {
37
- if (t.type && t.type !== a.type || t.key && t.key !== a.key)
79
+ }, N = (u, { location: e, filters: t = {}, debug: s = {} }) => {
80
+ if (t.type && t.type !== u.type || t.key && t.key !== u.key)
38
81
  return !1;
39
- if (s.forcedGuideKey === a.key)
82
+ if (s.forcedGuideKey === u.key)
40
83
  return !0;
41
- if (!a.active || a.steps.every((o) => !!o.message.archived_at))
84
+ if (!u.active || u.steps.every((o) => !!o.message.archived_at))
42
85
  return !1;
43
- const i = e ? L(e) : void 0, r = a.activation_url_rules || [], n = a.activation_url_patterns || [];
44
- if (i && r.length > 0) {
45
- if (!P(i, r)) return !1;
46
- } else if (i && n.length > 0 && !$(i, n))
86
+ const i = e ? D(e) : void 0, n = u.activation_url_rules || [], r = u.activation_url_patterns || [];
87
+ if (i && n.length > 0) {
88
+ if (!K(i, n)) return !1;
89
+ } else if (i && r.length > 0 && !L(i, r))
47
90
  return !1;
48
91
  return !0;
49
92
  };
50
- class x {
93
+ class B {
51
94
  constructor(e, t, s = {}, i = {}) {
52
95
  d(this, "store");
53
96
  // Phoenix channels for real time guide updates over websocket
@@ -88,22 +131,22 @@ class x {
88
131
  });
89
132
  this.knock = e, this.channelId = t, this.targetParams = s, this.options = i;
90
133
  const {
91
- trackLocationFromWindow: r = !0,
92
- throttleCheckInterval: n = T
93
- } = i, o = l(), u = r ? o == null ? void 0 : o.location.href : void 0, h = y();
134
+ trackLocationFromWindow: n = !0,
135
+ throttleCheckInterval: r = $
136
+ } = i, o = l(), a = n ? o == null ? void 0 : o.location.href : void 0, h = y();
94
137
  this.store = new C({
95
138
  guideGroups: [],
96
139
  guideGroupDisplayLogs: {},
97
140
  guides: {},
98
141
  previewGuides: {},
99
142
  queries: {},
100
- location: u,
143
+ location: a,
101
144
  // Increment to update the state store and trigger re-selection.
102
145
  counter: 0,
103
146
  debug: h
104
147
  });
105
148
  const { socket: c } = this.knock.client();
106
- this.socket = c, this.socketChannelTopic = `guides:${t}`, r && this.listenForLocationChangesFromWindow(), n && this.startCounterInterval(n), this.knock.log("[Guide] Initialized a guide client");
149
+ this.socket = c, this.socketChannelTopic = `guides:${t}`, n && this.listenForLocationChangesFromWindow(), r && this.startCounterInterval(r), this.knock.log("[Guide] Initialized a guide client");
107
150
  }
108
151
  incrementCounter() {
109
152
  this.knock.log("[Guide] Incrementing the counter"), this.store.setState((e) => ({ ...e, counter: e.counter + 1 }));
@@ -124,30 +167,30 @@ class x {
124
167
  const t = this.buildQueryParams(e == null ? void 0 : e.filters), s = this.formatQueryKey(t), i = this.store.state.queries[s];
125
168
  if (i)
126
169
  return i;
127
- this.store.setState((n) => ({
128
- ...n,
129
- queries: { ...n.queries, [s]: { status: "loading" } }
170
+ this.store.setState((r) => ({
171
+ ...r,
172
+ queries: { ...r.queries, [s]: { status: "loading" } }
130
173
  }));
131
- let r;
174
+ let n;
132
175
  try {
133
176
  this.knock.log("[Guide] Fetching all eligible guides");
134
- const n = await this.knock.user.getGuides(this.channelId, t);
135
- r = { status: "ok" };
136
- const { entries: o, guide_groups: u, guide_group_display_logs: h } = n;
177
+ const r = await this.knock.user.getGuides(this.channelId, t);
178
+ n = { status: "ok" };
179
+ const { entries: o, guide_groups: a, guide_group_display_logs: h } = r;
137
180
  this.knock.log("[Guide] Loading fetched guides"), this.store.setState((c) => ({
138
181
  ...c,
139
- guideGroups: (u == null ? void 0 : u.length) > 0 ? u : [E(o)],
182
+ guideGroups: (a == null ? void 0 : a.length) > 0 ? a : [R(o)],
140
183
  guideGroupDisplayLogs: h || {},
141
- guides: w(o.map((v) => this.localCopy(v))),
142
- queries: { ...c.queries, [s]: r }
184
+ guides: w(o.map((_) => this.localCopy(_))),
185
+ queries: { ...c.queries, [s]: n }
143
186
  }));
144
- } catch (n) {
145
- r = { status: "error", error: n }, this.store.setState((o) => ({
187
+ } catch (r) {
188
+ n = { status: "error", error: r }, this.store.setState((o) => ({
146
189
  ...o,
147
- queries: { ...o.queries, [s]: r }
190
+ queries: { ...o.queries, [s]: n }
148
191
  }));
149
192
  }
150
- return r;
193
+ return n;
151
194
  }
152
195
  subscribe() {
153
196
  if (!this.socket) return;
@@ -159,7 +202,7 @@ class x {
159
202
  preview_session_id: e.previewSessionId || void 0
160
203
  }, s = this.socket.channel(this.socketChannelTopic, t);
161
204
  for (const i of this.socketEventTypes)
162
- s.on(i, (r) => this.handleSocketEvent(r));
205
+ s.on(i, (n) => this.handleSocketEvent(n));
163
206
  ["closed", "errored"].includes(s.state) && (this.subscribeRetryCount = 0, s.join().receive("ok", () => {
164
207
  this.knock.log("[Guide] Successfully joined channel");
165
208
  }).receive("error", (i) => {
@@ -171,7 +214,7 @@ class x {
171
214
  })), this.socketChannel = s;
172
215
  }
173
216
  handleChannelJoinError() {
174
- if (this.subscribeRetryCount >= O) {
217
+ if (this.subscribeRetryCount >= T) {
175
218
  this.knock.log(
176
219
  `[Guide] Channel join max retry limit reached: ${this.subscribeRetryCount}`
177
220
  ), this.unsubscribe();
@@ -207,8 +250,8 @@ class x {
207
250
  }
208
251
  setLocation(e, t = {}) {
209
252
  this.knock.log(`[Guide] .setLocation (loc=${e})`), this.clearGroupStage(), this.knock.log("[Guide] Updating the tracked location"), this.store.setState((s) => {
210
- var r;
211
- const i = (r = t == null ? void 0 : t.debug) != null && r.previewSessionId ? s.previewGuides : {};
253
+ var n;
254
+ const i = (n = t == null ? void 0 : t.debug) != null && n.previewSessionId ? s.previewGuides : {};
212
255
  return {
213
256
  ...s,
214
257
  ...t,
@@ -217,12 +260,30 @@ class x {
217
260
  };
218
261
  });
219
262
  }
263
+ exitDebugMode() {
264
+ this.knock.log("[Guide] Exiting debug mode");
265
+ const e = l();
266
+ if (e != null && e.localStorage)
267
+ try {
268
+ e.localStorage.removeItem(p);
269
+ } catch {
270
+ }
271
+ if (this.store.setState((t) => ({
272
+ ...t,
273
+ debug: { forcedGuideKey: null, previewSessionId: null },
274
+ previewGuides: {}
275
+ // Clear preview guides when exiting debug mode
276
+ })), e) {
277
+ const t = new URL(e.location.href);
278
+ (t.searchParams.has(g.GUIDE_KEY) || t.searchParams.has(g.PREVIEW_SESSION_ID)) && (t.searchParams.delete(g.GUIDE_KEY), t.searchParams.delete(g.PREVIEW_SESSION_ID), e.location.href = t.toString());
279
+ }
280
+ }
220
281
  //
221
282
  // Store selector
222
283
  //
223
284
  selectGuides(e, t = {}) {
224
285
  if (this.knock.log(
225
- `[Guide] .selectGuides (filters: ${g(t)}; state: ${p(e)})`
286
+ `[Guide] .selectGuides (filters: ${k(t)}; state: ${f(e)})`
226
287
  ), Object.keys(e.guides).length === 0 && Object.keys(e.previewGuides).length === 0)
227
288
  return this.knock.log("[Guide] Exiting selection (no guides)"), [];
228
289
  const s = m(e, t);
@@ -230,7 +291,7 @@ class x {
230
291
  }
231
292
  selectGuide(e, t = {}) {
232
293
  if (this.knock.log(
233
- `[Guide] .selectGuide (filters: ${g(t)}; state: ${p(e)})`
294
+ `[Guide] .selectGuide (filters: ${k(t)}; state: ${f(e)})`
234
295
  ), Object.keys(e.guides).length === 0 && Object.keys(e.previewGuides).length === 0) {
235
296
  this.knock.log("[Guide] Exiting selection (no guides)");
236
297
  return;
@@ -240,43 +301,43 @@ class x {
240
301
  this.knock.log("[Guide] Selection found zero result");
241
302
  return;
242
303
  }
243
- const [i, r] = [...s][0];
304
+ const [i, n] = [...s][0];
244
305
  if (this.knock.log(
245
- `[Guide] Selection found: \`${r.key}\` (total: ${s.size})`
246
- ), r.bypass_global_group_limit)
247
- return this.knock.log(`[Guide] Returning the unthrottled guide: ${r.key}`), r;
248
- const n = S(e.guideGroups), o = e.guideGroupDisplayLogs[k];
249
- if (n && n.display_interval && o && R(
306
+ `[Guide] Selection found: \`${n.key}\` (total: ${s.size})`
307
+ ), n.bypass_global_group_limit)
308
+ return this.knock.log(`[Guide] Returning the unthrottled guide: ${n.key}`), n;
309
+ const r = v(e.guideGroups), o = e.guideGroupDisplayLogs[S];
310
+ if (r && r.display_interval && o && P(
250
311
  o,
251
- n.display_interval
312
+ r.display_interval
252
313
  )) {
253
- this.knock.log(`[Guide] Throttling the selected guide: ${r.key}`);
314
+ this.knock.log(`[Guide] Throttling the selected guide: ${n.key}`);
254
315
  return;
255
316
  }
256
317
  switch (this.stage || (this.stage = this.openGroupStage()), this.stage.status) {
257
318
  case "open": {
258
- this.knock.log(`[Guide] Addng to the group stage: ${r.key}`), this.stage.ordered[i] = r.key;
319
+ this.knock.log(`[Guide] Adding to the group stage: ${n.key}`), this.stage.ordered[i] = n.key;
259
320
  return;
260
321
  }
261
322
  case "patch": {
262
- this.knock.log(`[Guide] Patching the group stage: ${r.key}`), this.stage.ordered[i] = r.key;
263
- const u = this.stage.resolved === r.key ? r : void 0;
323
+ this.knock.log(`[Guide] Patching the group stage: ${n.key}`), this.stage.ordered[i] = n.key;
324
+ const a = this.stage.resolved === n.key ? n : void 0;
264
325
  return this.knock.log(
265
- `[Guide] Returning \`${u == null ? void 0 : u.key}\` (stage: ${f(this.stage)})`
266
- ), u;
326
+ `[Guide] Returning \`${a == null ? void 0 : a.key}\` (stage: ${G(this.stage)})`
327
+ ), a;
267
328
  }
268
329
  case "closed": {
269
- const u = this.stage.resolved === r.key ? r : void 0;
330
+ const a = this.stage.resolved === n.key ? n : void 0;
270
331
  return this.knock.log(
271
- `[Guide] Returning \`${u == null ? void 0 : u.key}\` (stage: ${f(this.stage)})`
272
- ), u;
332
+ `[Guide] Returning \`${a == null ? void 0 : a.key}\` (stage: ${G(this.stage)})`
333
+ ), a;
273
334
  }
274
335
  }
275
336
  }
276
337
  openGroupStage() {
277
338
  this.knock.log("[Guide] Opening a new group stage");
278
339
  const {
279
- orderResolutionDuration: e = D
340
+ orderResolutionDuration: e = O
280
341
  } = this.options, t = setTimeout(() => {
281
342
  this.closePendingGroupStage(), this.incrementCounter();
282
343
  }, e);
@@ -363,16 +424,16 @@ class x {
363
424
  this.knock.log(
364
425
  `[Guide] Marking as interacted (Guide key: ${e.key}; Step ref:${t.ref})`
365
426
  );
366
- const i = (/* @__PURE__ */ new Date()).toISOString(), r = this.setStepMessageAttrs(e.key, t.ref, {
427
+ const i = (/* @__PURE__ */ new Date()).toISOString(), n = this.setStepMessageAttrs(e.key, t.ref, {
367
428
  read_at: i,
368
429
  interacted_at: i
369
430
  });
370
- if (!r) return;
371
- const n = {
372
- ...this.buildEngagementEventBaseParams(e, r),
431
+ if (!n) return;
432
+ const r = {
433
+ ...this.buildEngagementEventBaseParams(e, n),
373
434
  metadata: s
374
435
  };
375
- return this.knock.user.markGuideStepAs("interacted", n), r;
436
+ return this.knock.user.markGuideStepAs("interacted", r), n;
376
437
  }
377
438
  async markAsArchived(e, t) {
378
439
  if (t.message.archived_at) return;
@@ -403,9 +464,9 @@ class x {
403
464
  return t.store.state.debug.forcedGuideKey === this.key ? this.steps[0] : this.steps.find((i) => !i.message.archived_at);
404
465
  }
405
466
  };
406
- return s.getStep = s.getStep.bind(s), s.steps = e.steps.map(({ message: i, ...r }) => {
407
- const n = {
408
- ...r,
467
+ return s.getStep = s.getStep.bind(s), s.steps = e.steps.map(({ message: i, ...n }) => {
468
+ const r = {
469
+ ...n,
409
470
  message: { ...i },
410
471
  markAsSeen() {
411
472
  if (!this.message.seen_at)
@@ -419,10 +480,10 @@ class x {
419
480
  return t.markAsArchived(s, this);
420
481
  }
421
482
  };
422
- return n.markAsSeen = n.markAsSeen.bind(n), n.markAsInteracted = n.markAsInteracted.bind(n), n.markAsArchived = n.markAsArchived.bind(n), n;
483
+ return r.markAsSeen = r.markAsSeen.bind(r), r.markAsInteracted = r.markAsInteracted.bind(r), r.markAsArchived = r.markAsArchived.bind(r), r;
423
484
  }), s.activation_url_patterns = e.activation_url_patterns.map((i) => ({
424
485
  ...i,
425
- pattern: new I({ pathname: i.pathname })
486
+ pattern: new E({ pathname: i.pathname })
426
487
  })), s;
427
488
  }
428
489
  buildQueryParams(e = {}) {
@@ -433,34 +494,33 @@ class x {
433
494
  this.store.state.debug.forcedGuideKey && (t.force_all_guides = !0);
434
495
  let i = Object.fromEntries(
435
496
  Object.entries(t).filter(
436
- ([r, n]) => n != null
497
+ ([n, r]) => r != null
437
498
  )
438
499
  );
439
500
  return i = i.data ? { ...i, data: JSON.stringify(i.data) } : i, i;
440
501
  }
441
502
  formatQueryKey(e) {
442
503
  const s = Object.keys(e).sort().map(
443
- (r) => `${encodeURIComponent(r)}=${encodeURIComponent(e[r])}`
444
- ).join("&"), i = K(this.knock.userId);
504
+ (n) => `${encodeURIComponent(n)}=${encodeURIComponent(e[n])}`
505
+ ).join("&"), i = U(this.knock.userId);
445
506
  return s ? `${i}?${s}` : i;
446
507
  }
447
508
  setStepMessageAttrs(e, t, s) {
448
509
  let i;
449
- return s.archived_at && this.clearGroupStage(), this.store.setState((r) => {
450
- const n = r.guides[e];
451
- if (!n) return r;
452
- const o = n.steps.map((c) => (c.ref !== t || (c.message = { ...c.message, ...s }, i = c), c));
453
- n.steps = o;
454
- const u = { ...r.guides, [n.key]: n }, h = s.archived_at && !n.bypass_global_group_limit ? {
455
- ...r.guideGroupDisplayLogs,
456
- [k]: s.archived_at
457
- } : r.guideGroupDisplayLogs;
458
- return { ...r, guides: u, guideGroupDisplayLogs: h };
510
+ return s.archived_at && this.clearGroupStage(), this.store.setState((n) => {
511
+ let r = n.guides[e];
512
+ if (!r) return n;
513
+ const o = r.steps.map((c) => (c.ref !== t || (c.message = { ...c.message, ...s }, i = c), c));
514
+ r = i ? { ...r, steps: o } : r;
515
+ const a = { ...n.guides, [r.key]: r }, h = s.archived_at && !r.bypass_global_group_limit ? {
516
+ ...n.guideGroupDisplayLogs,
517
+ [S]: s.archived_at
518
+ } : n.guideGroupDisplayLogs;
519
+ return { ...n, guides: a, guideGroupDisplayLogs: h };
459
520
  }), i;
460
521
  }
461
522
  buildEngagementEventBaseParams(e, t) {
462
523
  return {
463
- message_id: t.message.id,
464
524
  channel_id: e.channel_id,
465
525
  guide_key: e.key,
466
526
  guide_id: e.id,
@@ -485,17 +545,17 @@ class x {
485
545
  data: e
486
546
  }) {
487
547
  this.patchClosedGroupStage(), this.store.setState((t) => {
488
- const s = [e.guide_group], i = e.guide_group.display_sequence_unthrottled || [], r = e.guide_group.display_sequence_throttled || [];
489
- let n = t.guides;
490
- return n = i.reduce((o, u) => {
491
- if (!o[u]) return o;
492
- const h = { ...o[u], bypass_global_group_limit: !0 };
493
- return { ...o, [u]: h };
494
- }, n), n = r.reduce((o, u) => {
495
- if (!o[u]) return o;
496
- const h = { ...o[u], bypass_global_group_limit: !1 };
497
- return { ...o, [u]: h };
498
- }, n), { ...t, guides: n, guideGroups: s };
548
+ const s = [e.guide_group], i = e.guide_group.display_sequence_unthrottled || [], n = e.guide_group.display_sequence_throttled || [];
549
+ let r = t.guides;
550
+ return r = i.reduce((o, a) => {
551
+ if (!o[a]) return o;
552
+ const h = { ...o[a], bypass_global_group_limit: !0 };
553
+ return { ...o, [a]: h };
554
+ }, r), r = n.reduce((o, a) => {
555
+ if (!o[a]) return o;
556
+ const h = { ...o[a], bypass_global_group_limit: !1 };
557
+ return { ...o, [a]: h };
558
+ }, r), { ...t, guides: r, guideGroups: s };
499
559
  });
500
560
  }
501
561
  updatePreviewGuide({ data: e }) {
@@ -516,14 +576,14 @@ class x {
516
576
  e.addEventListener("popstate", this.handleLocationChange), e.addEventListener("hashchange", this.handleLocationChange);
517
577
  const t = e.history.pushState, s = e.history.replaceState;
518
578
  e.history.pushState = new Proxy(t, {
519
- apply: (i, r, n) => {
520
- Reflect.apply(i, r, n), setTimeout(() => {
579
+ apply: (i, n, r) => {
580
+ Reflect.apply(i, n, r), setTimeout(() => {
521
581
  this.handleLocationChange();
522
582
  }, 0);
523
583
  }
524
584
  }), e.history.replaceState = new Proxy(s, {
525
- apply: (i, r, n) => {
526
- Reflect.apply(i, r, n), setTimeout(() => {
585
+ apply: (i, n, r) => {
586
+ Reflect.apply(i, n, r), setTimeout(() => {
527
587
  this.handleLocationChange();
528
588
  }, 0);
529
589
  }
@@ -539,8 +599,8 @@ class x {
539
599
  }
540
600
  }
541
601
  export {
542
- G as DEBUG_QUERY_PARAMS,
543
- x as KnockGuideClient,
544
- K as guidesApiRootPath
602
+ g as DEBUG_QUERY_PARAMS,
603
+ B as KnockGuideClient,
604
+ U as guidesApiRootPath
545
605
  };
546
606
  //# sourceMappingURL=client.mjs.map