@brainfish-ai/widgets-initiator 1.7.4 → 1.8.0

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/web.js CHANGED
@@ -10,8 +10,8 @@ var L = (a, t, n) => t in a ? Te(a, t, { enumerable: !0, configurable: !0, writa
10
10
  $e.call(t, n) && L(a, n, t[n]);
11
11
  return a;
12
12
  }, $ = (a, t) => We(a, Le(t));
13
- var _ = (a, t, n) => L(a, typeof t != "symbol" ? t + "" : t, n);
14
- var b = (a, t, n) => new Promise((s, i) => {
13
+ var S = (a, t, n) => L(a, typeof t != "symbol" ? t + "" : t, n);
14
+ var v = (a, t, n) => new Promise((s, i) => {
15
15
  var r = (l) => {
16
16
  try {
17
17
  d(n.next(l));
@@ -31,16 +31,16 @@ var B, R;
31
31
  (function() {
32
32
  try {
33
33
  var a = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}, t = new a.Error().stack;
34
- t && (a._sentryDebugIds = a._sentryDebugIds || {}, a._sentryDebugIds[t] = "de6234f7-c3b5-4101-84b9-7575b725e615", a._sentryDebugIdIdentifier = "sentry-dbid-de6234f7-c3b5-4101-84b9-7575b725e615");
34
+ t && (a._sentryDebugIds = a._sentryDebugIds || {}, a._sentryDebugIds[t] = "423fc5e7-e77d-4ece-88ce-b64db59d4b52", a._sentryDebugIdIdentifier = "sentry-dbid-423fc5e7-e77d-4ece-88ce-b64db59d4b52");
35
35
  } catch (n) {
36
36
  }
37
- })(), (typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}).SENTRY_RELEASE = { id: "79568b60a6dcead8ae3203baa697b7db5d6b3dbb" }, function(a) {
37
+ })(), (typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}).SENTRY_RELEASE = { id: "405229a86c7ca783bc02473d5c1ef91ad343dc5c" }, function(a) {
38
38
  a.Sidebar = "sidebar", a.Searchbar = "searchbar";
39
39
  }(B || (B = {})), B.Sidebar, B.Searchbar;
40
40
  class de extends Error {
41
41
  constructor(n, s) {
42
42
  super(n, s);
43
- _(this, "cause");
43
+ S(this, "cause");
44
44
  this.name = "BrainfishWidgetError", this.cause = s == null ? void 0 : s.cause, Error.captureStackTrace && Error.captureStackTrace(this, de), this.cause instanceof Error && this.cause.stack && (this.stack = this.stack + `
45
45
  Caused by: ` + this.cause.stack);
46
46
  }
@@ -51,7 +51,7 @@ Caused by: ` + this.cause.stack);
51
51
  (function(a) {
52
52
  a.LINK = "link", a.CALLBACK = "callback", a.EMAIL = "email", a.PHONE = "phone";
53
53
  })(R || (R = {}));
54
- const S = (a, t, n, s) => {
54
+ const k = (a, t, n, s) => {
55
55
  let i = n, r = {};
56
56
  if (t instanceof Error) try {
57
57
  r = JSON.parse(t.message), i += ` - ${r.message || t.message}`;
@@ -62,12 +62,12 @@ const S = (a, t, n, s) => {
62
62
  ((e, d, l) => {
63
63
  if (!navigator || navigator.userAgent.toLowerCase().includes("headless")) return;
64
64
  const o = d.toJSON();
65
- fetch(`${e || "https://app.brainfi.sh"}/api/trackError.widget.create`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": l }, body: JSON.stringify({ error: `WebWidgetVersion: 1.7.4. ${d.message}`, stack: d.stack, cause: { message: o.message, stack: o.stack, cause: o.cause } }) });
65
+ fetch(`${e || "https://app.brainfi.sh"}/api/trackError.widget.create`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": l }, body: JSON.stringify({ error: `WebWidgetVersion: 1.8.0. ${d.message}`, stack: d.stack, cause: { message: o.message, stack: o.stack, cause: o.cause } }) });
66
66
  })(a, new de(i, { cause: r }), s);
67
- }, He = (a) => b(void 0, null, function* () {
67
+ }, He = (a) => v(void 0, null, function* () {
68
68
  let { widgetKey: t, apiHost: n } = a;
69
69
  return function(s, i, r) {
70
- return b(this, null, function* () {
70
+ return v(this, null, function* () {
71
71
  let e, d = 0;
72
72
  for (; d < 3; ) try {
73
73
  const l = yield fetch(`${s}${i}`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": r } });
@@ -76,7 +76,7 @@ const S = (a, t, n, s) => {
76
76
  if (!o) throw new Error("Error loading config: empty response");
77
77
  return o;
78
78
  } catch (l) {
79
- if (e = l, d++, d >= 3) throw S(s, l, "Error fetching config", r), e;
79
+ if (e = l, d++, d >= 3) throw k(s, l, "Error fetching config", r), e;
80
80
  yield new Promise((o) => setTimeout(o, 500));
81
81
  }
82
82
  });
@@ -93,28 +93,28 @@ const S = (a, t, n, s) => {
93
93
  if (!(a.match(/iPad/i) || a.match(/iPhone/i))) return !1;
94
94
  const t = a.match(/OS (\d+)_/i);
95
95
  return t && parseInt(t[1], 10) <= 14;
96
- })(), ze = (a) => b(void 0, null, function* () {
96
+ })(), ze = (a) => v(void 0, null, function* () {
97
97
  let { apiHost: t, widgetKey: n, version: s } = a;
98
98
  try {
99
99
  const i = `https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${s}/dist/web.js`, r = H ? i.replace("web.js", "web.umd.js") : i;
100
- return { widget: yield ((d) => b(void 0, null, function* () {
100
+ return { widget: yield ((d) => v(void 0, null, function* () {
101
101
  return document.getElementById("brainfish-widget") ? window.Brainfish : new Promise((l, o) => {
102
- const f = document.createElement("script");
103
- f.id = "brainfish-widget", f.src = d, f.type = H ? "text/javascript" : "module", f.async = !0, f.crossOrigin = "anonymous", f.onload = () => {
102
+ const u = document.createElement("script");
103
+ u.id = "brainfish-widget", u.src = d, u.type = H ? "text/javascript" : "module", u.async = !0, u.crossOrigin = "anonymous", u.onload = () => {
104
104
  setTimeout(() => {
105
105
  const c = window.Brainfish;
106
106
  c ? l(c) : o(new Error("Failed to load Brainfish module"));
107
107
  }, 200);
108
- }, f.onerror = (c) => {
109
- const u = c, g = { message: `Failed to load script: ${d}`, type: u.type, fileName: u.filename, lineNumber: u.lineno, columnNumber: u.colno, error: u.error ? u.error.toString() : "Unknown error" };
108
+ }, u.onerror = (c) => {
109
+ const f = c, g = { message: `Failed to load script: ${d}`, type: f.type, fileName: f.filename, lineNumber: f.lineno, columnNumber: f.colno, error: f.error ? f.error.toString() : "Unknown error" };
110
110
  o(new Error(JSON.stringify(g)));
111
- }, H || document.head.appendChild(f);
111
+ }, H || document.head.appendChild(u);
112
112
  });
113
113
  }))(r) };
114
114
  } catch (i) {
115
- S(t, i, i.message, n);
115
+ k(t, i, i.message, n);
116
116
  }
117
- }), me = /* @__PURE__ */ new Set(), Re = (a, t) => b(void 0, null, function* () {
117
+ }), me = /* @__PURE__ */ new Set(), Re = (a, t) => v(void 0, null, function* () {
118
118
  const n = le(a.overrides);
119
119
  try {
120
120
  if (me.has(a.widgetKey)) return;
@@ -125,40 +125,40 @@ const S = (a, t, n, s) => {
125
125
  let [d, l] = e;
126
126
  t.settings && d in t.settings && (t.settings[d] = function() {
127
127
  let o = arguments.length > 1 ? arguments[1] : void 0;
128
- const f = new Map((arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).map((c) => [c.label, c]));
129
- return o.forEach((c) => f.set(c.label, c)), Array.from(f.values());
128
+ const u = new Map((arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).map((c) => [c.label, c]));
129
+ return o.forEach((c) => u.set(c.label, c)), Array.from(u.values());
130
130
  }(t.settings[d], l));
131
131
  }), function(e, d) {
132
132
  d.widgetType === B.Searchbar || d.widgetType === "Search" ? e.SearchWidget.initStandard(d) : e.HelpWidget.initPopup(d);
133
133
  }(i, r), me.add(a.widgetKey), i;
134
134
  }
135
135
  } catch (s) {
136
- S(n, s, s.message, a.widgetKey);
136
+ k(n, s, s.message, a.widgetKey);
137
137
  }
138
138
  });
139
139
  let be = !1;
140
140
  const qe = function(s, i, r) {
141
- return b(this, arguments, function* (a, t, n) {
142
- let e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "", d = arguments.length > 4 && arguments[4] !== void 0 && arguments[4], l = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : [];
143
- if (t || S(n, new Error("Access key is required"), "Access key is required", a), !be) try {
144
- const o = (() => {
141
+ return v(this, arguments, function* (a, t, n) {
142
+ let e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "", d = arguments.length > 4 && arguments[4] !== void 0 && arguments[4], l = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : [], o = arguments.length > 6 ? arguments[6] : void 0;
143
+ if (t || k(n, new Error("Access key is required"), "Access key is required", a), !be) try {
144
+ const u = (() => {
145
145
  if (typeof window == "undefined" || typeof navigator == "undefined") return !1;
146
- const f = navigator, c = window, u = (f.doNotTrack || c.doNotTrack || f.msDoNotTrack || "0").toString().toLowerCase();
147
- return ["1", "yes", "true"].includes(u);
146
+ const c = navigator, f = window, g = (c.doNotTrack || f.doNotTrack || c.msDoNotTrack || "0").toString().toLowerCase();
147
+ return ["1", "yes", "true"].includes(g);
148
148
  })();
149
- window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !o, trackAttributes: !o, trackOutgoingLinks: !o, enableRecording: !o && d, recordingBlocklist: l }), be = !0, yield ((f, c) => b(this, null, function* () {
149
+ window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !u, trackAttributes: !u, trackOutgoingLinks: !u, enableRecording: !u && d, recordingBlocklist: l, _allowLocalhostRecording: o }), be = !0, yield ((c, f) => v(this, null, function* () {
150
150
  if (document.getElementById("brainfish-analytics")) return window.BrainfishAnalytics;
151
- const u = document.createElement("script");
152
- u.id = "brainfish-analytics", u.src = "https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js", u.type = "module", u.async = !0, u.crossOrigin = "anonymous", u.onerror = () => {
153
- S(f, new Error(`Failed to load script: ${u.src}`), `Failed to load script: ${u.src}`, c);
154
- }, document.head.appendChild(u);
151
+ const g = document.createElement("script");
152
+ g.id = "brainfish-analytics", g.src = "https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js", g.type = "module", g.async = !0, g.crossOrigin = "anonymous", g.onerror = () => {
153
+ k(c, new Error(`Failed to load script: ${g.src}`), `Failed to load script: ${g.src}`, f);
154
+ }, document.head.appendChild(g);
155
155
  }))(n, a);
156
- } catch (o) {
157
- S(n, o, "Failed to initialize BrainfishAnalytics", a);
156
+ } catch (u) {
157
+ k(n, u, "Failed to initialize BrainfishAnalytics", a);
158
158
  }
159
159
  });
160
160
  };
161
- function x(a, t) {
161
+ function _(a, t) {
162
162
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
163
163
  const s = document.createElement(a);
164
164
  return s.className = t, Object.entries(n).forEach((i) => {
@@ -167,7 +167,7 @@ function x(a, t) {
167
167
  }), s;
168
168
  }
169
169
  const T = "bf-iframe-container", W = "bf-trigger-button";
170
- class v {
170
+ class y {
171
171
  static get isWidgetOpen() {
172
172
  return this.isOpen;
173
173
  }
@@ -208,7 +208,7 @@ class v {
208
208
  (t = this.button) === null || t === void 0 || t.classList.add("hidden");
209
209
  }
210
210
  }
211
- _(v, "isOpen", !1), _(v, "button", null), _(v, "icon", null), _(v, "isButtonHidden", !1);
211
+ S(y, "isOpen", !1), S(y, "button", null), S(y, "icon", null), S(y, "isButtonHidden", !1);
212
212
  function Ne(a) {
213
213
  let { widgetHost: t, apiHost: n, widgetKey: s, signal: i } = a;
214
214
  window.addEventListener("message", (r) => {
@@ -222,13 +222,13 @@ function Ne(a) {
222
222
  const { eventName: d, data: l } = r.data;
223
223
  window.BrainfishAnalytics("track", d, l);
224
224
  }
225
- if (e === "CLOSE_WIDGET" && (window.BrainfishAnalytics("track", "Close Widget"), v.toggleIframeVisibility()), e === "NEXT_BEST_ACTION_CLICKED") {
226
- const { action: d, searchQueryId: l, query: o, answer: f } = r.data, c = { action: d, searchQueryId: l };
225
+ if (e === "CLOSE_WIDGET" && (window.BrainfishAnalytics("track", "Close Widget"), y.toggleIframeVisibility()), e === "NEXT_BEST_ACTION_CLICKED") {
226
+ const { action: d, searchQueryId: l, query: o, answer: u } = r.data, c = { action: d, searchQueryId: l };
227
227
  if (!["function", "callback"].includes(d.type)) return void console.error("Invalid action type", d);
228
- if (window.__bfCallbacks = window.__bfCallbacks || {}, window.__bfCallbacks[d.id]) return void window.__bfCallbacks[d.id](o, f, c);
229
- const u = `${n}/api/searchWidgets.callback.codeblocks?apiKey=${s}&codeblockId=${d.id}`, g = document.createElement("script");
230
- g.src = u, document.head.appendChild(g), g.onload = () => {
231
- window.__bfCallbacks[d.id](o, f, c), setTimeout(() => {
228
+ if (window.__bfCallbacks = window.__bfCallbacks || {}, window.__bfCallbacks[d.id]) return void window.__bfCallbacks[d.id](o, u, c);
229
+ const f = `${n}/api/searchWidgets.callback.codeblocks?apiKey=${s}&codeblockId=${d.id}`, g = document.createElement("script");
230
+ g.src = f, document.head.appendChild(g), g.onload = () => {
231
+ window.__bfCallbacks[d.id](o, u, c), setTimeout(() => {
232
232
  document.head.removeChild(g);
233
233
  }, 300);
234
234
  };
@@ -248,10 +248,10 @@ var q = { exports: {} }, N = { exports: {} }, D = { exports: {} };
248
248
  }
249
249
  t.__esModule = !0, t.default = void 0, t.default = function(i, r, e, d) {
250
250
  if (d === void 0 && (d = s), r === 0) return d(e, e, e);
251
- var l = (i % 360 + 360) % 360 / 60, o = (1 - Math.abs(2 * e - 1)) * r, f = o * (1 - Math.abs(l % 2 - 1)), c = 0, u = 0, g = 0;
252
- l >= 0 && l < 1 ? (c = o, u = f) : l >= 1 && l < 2 ? (c = f, u = o) : l >= 2 && l < 3 ? (u = o, g = f) : l >= 3 && l < 4 ? (u = f, g = o) : l >= 4 && l < 5 ? (c = f, g = o) : l >= 5 && l < 6 && (c = o, g = f);
251
+ var l = (i % 360 + 360) % 360 / 60, o = (1 - Math.abs(2 * e - 1)) * r, u = o * (1 - Math.abs(l % 2 - 1)), c = 0, f = 0, g = 0;
252
+ l >= 0 && l < 1 ? (c = o, f = u) : l >= 1 && l < 2 ? (c = u, f = o) : l >= 2 && l < 3 ? (f = o, g = u) : l >= 3 && l < 4 ? (f = u, g = o) : l >= 4 && l < 5 ? (c = u, g = o) : l >= 5 && l < 6 && (c = o, g = u);
253
253
  var h = e - o / 2;
254
- return d(c + h, u + h, g + h);
254
+ return d(c + h, f + h, g + h);
255
255
  }, a.exports = t.default;
256
256
  })(D, D.exports);
257
257
  var fe = D.exports, J = { exports: {} };
@@ -268,29 +268,29 @@ var De = J.exports, Y = { exports: {} };
268
268
  (function(a, t) {
269
269
  function n(l) {
270
270
  var o = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
271
- return n = function(f) {
272
- if (f === null || !function(u) {
271
+ return n = function(u) {
272
+ if (u === null || !function(f) {
273
273
  try {
274
- return Function.toString.call(u).indexOf("[native code]") !== -1;
274
+ return Function.toString.call(f).indexOf("[native code]") !== -1;
275
275
  } catch (g) {
276
- return typeof u == "function";
276
+ return typeof f == "function";
277
277
  }
278
- }(f)) return f;
279
- if (typeof f != "function") throw new TypeError("Super expression must either be null or a function");
278
+ }(u)) return u;
279
+ if (typeof u != "function") throw new TypeError("Super expression must either be null or a function");
280
280
  if (o !== void 0) {
281
- if (o.has(f)) return o.get(f);
282
- o.set(f, c);
281
+ if (o.has(u)) return o.get(u);
282
+ o.set(u, c);
283
283
  }
284
284
  function c() {
285
- return function(u, g, h) {
285
+ return function(f, g, h) {
286
286
  if (s()) return Reflect.construct.apply(null, arguments);
287
287
  var p = [null];
288
288
  p.push.apply(p, g);
289
- var m = new (u.bind.apply(u, p))();
289
+ var m = new (f.bind.apply(f, p))();
290
290
  return h && i(m, h.prototype), m;
291
- }(f, arguments, r(this).constructor);
291
+ }(u, arguments, r(this).constructor);
292
292
  }
293
- return c.prototype = Object.create(f.prototype, { constructor: { value: c, enumerable: !1, writable: !0, configurable: !0 } }), i(c, f);
293
+ return c.prototype = Object.create(u.prototype, { constructor: { value: c, enumerable: !1, writable: !0, configurable: !0 } }), i(c, u);
294
294
  }, n(l);
295
295
  }
296
296
  function s() {
@@ -304,8 +304,8 @@ var De = J.exports, Y = { exports: {} };
304
304
  })();
305
305
  }
306
306
  function i(l, o) {
307
- return i = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(f, c) {
308
- return f.__proto__ = c, f;
307
+ return i = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(u, c) {
308
+ return u.__proto__ = c, u;
309
309
  }, i(l, o);
310
310
  }
311
311
  function r(l) {
@@ -464,28 +464,28 @@ To pass a single animation please supply them in simple values, e.g. animation('
464
464
  `, 78: `base must be set in "px" or "%" but you set it in "%s".
465
465
  ` };
466
466
  function d() {
467
- for (var l = arguments.length, o = new Array(l), f = 0; f < l; f++) o[f] = arguments[f];
468
- var c, u = o[0], g = [];
467
+ for (var l = arguments.length, o = new Array(l), u = 0; u < l; u++) o[u] = arguments[u];
468
+ var c, f = o[0], g = [];
469
469
  for (c = 1; c < o.length; c += 1) g.push(o[c]);
470
470
  return g.forEach(function(h) {
471
- u = u.replace(/%[a-z]/, h);
472
- }), u;
471
+ f = f.replace(/%[a-z]/, h);
472
+ }), f;
473
473
  }
474
474
  t.default = function(l) {
475
- var o, f;
476
- function c(u) {
475
+ var o, u;
476
+ function c(f) {
477
477
  var g;
478
- if (process.env.NODE_ENV === "production") g = l.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + u + " for more information.") || this;
478
+ if (process.env.NODE_ENV === "production") g = l.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + f + " for more information.") || this;
479
479
  else {
480
480
  for (var h = arguments.length, p = new Array(h > 1 ? h - 1 : 0), m = 1; m < h; m++) p[m - 1] = arguments[m];
481
- g = l.call(this, d.apply(void 0, [e[u]].concat(p))) || this;
481
+ g = l.call(this, d.apply(void 0, [e[f]].concat(p))) || this;
482
482
  }
483
- return function(k) {
484
- if (k === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
485
- return k;
483
+ return function(b) {
484
+ if (b === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
485
+ return b;
486
486
  }(g);
487
487
  }
488
- return f = l, (o = c).prototype = Object.create(f.prototype), o.prototype.constructor = o, i(o, f), c;
488
+ return u = l, (o = c).prototype = Object.create(u.prototype), o.prototype.constructor = o, i(o, u), c;
489
489
  }(n(Error)), a.exports = t.default;
490
490
  })(Y, Y.exports);
491
491
  var C = Y.exports;
@@ -500,24 +500,24 @@ var C = Y.exports;
500
500
  }
501
501
  if (p.match(l)) return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16) };
502
502
  if (p.match(o)) {
503
- var k = parseFloat((parseInt("" + p[4] + p[4], 16) / 255).toFixed(2));
504
- return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16), alpha: k };
503
+ var b = parseFloat((parseInt("" + p[4] + p[4], 16) / 255).toFixed(2));
504
+ return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16), alpha: b };
505
505
  }
506
- var A = f.exec(p);
506
+ var A = u.exec(p);
507
507
  if (A) return { red: parseInt("" + A[1], 10), green: parseInt("" + A[2], 10), blue: parseInt("" + A[3], 10) };
508
- var y = c.exec(p.substring(0, 50));
509
- if (y) return { red: parseInt("" + y[1], 10), green: parseInt("" + y[2], 10), blue: parseInt("" + y[3], 10), alpha: parseFloat("" + y[4]) > 1 ? parseFloat("" + y[4]) / 100 : parseFloat("" + y[4]) };
510
- var I = u.exec(p);
508
+ var w = c.exec(p.substring(0, 50));
509
+ if (w) return { red: parseInt("" + w[1], 10), green: parseInt("" + w[2], 10), blue: parseInt("" + w[3], 10), alpha: parseFloat("" + w[4]) > 1 ? parseFloat("" + w[4]) / 100 : parseFloat("" + w[4]) };
510
+ var I = f.exec(p);
511
511
  if (I) {
512
- var Ae = parseInt("" + I[1], 10), Ie = parseInt("" + I[2], 10) / 100, Oe = parseInt("" + I[3], 10) / 100, pe = "rgb(" + (0, n.default)(Ae, Ie, Oe) + ")", O = f.exec(pe);
512
+ var Ae = parseInt("" + I[1], 10), Ie = parseInt("" + I[2], 10) / 100, Oe = parseInt("" + I[3], 10) / 100, pe = "rgb(" + (0, n.default)(Ae, Ie, Oe) + ")", O = u.exec(pe);
513
513
  if (!O) throw new i.default(4, p, pe);
514
514
  return { red: parseInt("" + O[1], 10), green: parseInt("" + O[2], 10), blue: parseInt("" + O[3], 10) };
515
515
  }
516
- var w = g.exec(p.substring(0, 50));
517
- if (w) {
518
- var Me = parseInt("" + w[1], 10), je = parseInt("" + w[2], 10) / 100, Pe = parseInt("" + w[3], 10) / 100, ge = "rgb(" + (0, n.default)(Me, je, Pe) + ")", M = f.exec(ge);
516
+ var x = g.exec(p.substring(0, 50));
517
+ if (x) {
518
+ var Me = parseInt("" + x[1], 10), je = parseInt("" + x[2], 10) / 100, Pe = parseInt("" + x[3], 10) / 100, ge = "rgb(" + (0, n.default)(Me, je, Pe) + ")", M = u.exec(ge);
519
519
  if (!M) throw new i.default(4, p, ge);
520
- return { red: parseInt("" + M[1], 10), green: parseInt("" + M[2], 10), blue: parseInt("" + M[3], 10), alpha: parseFloat("" + w[4]) > 1 ? parseFloat("" + w[4]) / 100 : parseFloat("" + w[4]) };
520
+ return { red: parseInt("" + M[1], 10), green: parseInt("" + M[2], 10), blue: parseInt("" + M[3], 10), alpha: parseFloat("" + x[4]) > 1 ? parseFloat("" + x[4]) / 100 : parseFloat("" + x[4]) };
521
521
  }
522
522
  throw new i.default(5);
523
523
  };
@@ -525,15 +525,15 @@ var C = Y.exports;
525
525
  function r(h) {
526
526
  return h && h.__esModule ? h : { default: h };
527
527
  }
528
- var e = /^#[a-fA-F0-9]{6}$/, d = /^#[a-fA-F0-9]{8}$/, l = /^#[a-fA-F0-9]{3}$/, o = /^#[a-fA-F0-9]{4}$/, f = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i, c = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i, u = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i, g = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
528
+ var e = /^#[a-fA-F0-9]{6}$/, d = /^#[a-fA-F0-9]{8}$/, l = /^#[a-fA-F0-9]{3}$/, o = /^#[a-fA-F0-9]{4}$/, u = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i, c = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i, f = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i, g = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
529
529
  a.exports = t.default;
530
530
  })(N, N.exports);
531
531
  var ce = N.exports;
532
532
  (function(a, t) {
533
533
  t.__esModule = !0, t.default = function(i) {
534
534
  if (i === "transparent") return 0;
535
- var r = (0, s.default)(i), e = Object.keys(r).map(function(f) {
536
- var c = r[f] / 255;
535
+ var r = (0, s.default)(i), e = Object.keys(r).map(function(u) {
536
+ var c = r[u] / 255;
537
537
  return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
538
538
  }), d = e[0], l = e[1], o = e[2];
539
539
  return parseFloat((0.2126 * d + 0.7152 * l + 0.0722 * o).toFixed(3));
@@ -563,16 +563,16 @@ var xe = V.exports, Z = { exports: {} }, Q = { exports: {} };
563
563
  t.__esModule = !0, t.default = void 0, t.default = function(n) {
564
564
  var s, i = n.red / 255, r = n.green / 255, e = n.blue / 255, d = Math.max(i, r, e), l = Math.min(i, r, e), o = (d + l) / 2;
565
565
  if (d === l) return n.alpha !== void 0 ? { hue: 0, saturation: 0, lightness: o, alpha: n.alpha } : { hue: 0, saturation: 0, lightness: o };
566
- var f = d - l, c = o > 0.5 ? f / (2 - d - l) : f / (d + l);
566
+ var u = d - l, c = o > 0.5 ? u / (2 - d - l) : u / (d + l);
567
567
  switch (d) {
568
568
  case i:
569
- s = (r - e) / f + (r < e ? 6 : 0);
569
+ s = (r - e) / u + (r < e ? 6 : 0);
570
570
  break;
571
571
  case r:
572
- s = (e - i) / f + 2;
572
+ s = (e - i) / u + 2;
573
573
  break;
574
574
  default:
575
- s = (i - r) / f + 4;
575
+ s = (i - r) / u + 4;
576
576
  }
577
577
  return s *= 60, n.alpha !== void 0 ? { hue: s, saturation: c, lightness: o, alpha: n.alpha } : { hue: s, saturation: c, lightness: o };
578
578
  }, a.exports = t.default;
@@ -588,7 +588,7 @@ var Ye = Q.exports;
588
588
  }
589
589
  a.exports = t.default;
590
590
  })(Z, Z.exports);
591
- var Se = Z.exports, X = { exports: {} }, ee = { exports: {} }, te = { exports: {} }, ne = { exports: {} };
591
+ var _e = Z.exports, X = { exports: {} }, ee = { exports: {} }, te = { exports: {} }, ne = { exports: {} };
592
592
  (function(a, t) {
593
593
  t.__esModule = !0, t.default = void 0, t.default = function(n) {
594
594
  return n.length === 7 && n[1] === n[2] && n[3] === n[4] && n[5] === n[6] ? "#" + n[1] + n[3] + n[5] : n;
@@ -601,21 +601,21 @@ var ke = ne.exports, re = { exports: {} };
601
601
  return s.length === 1 ? "0" + s : s;
602
602
  }, a.exports = t.default;
603
603
  })(re, re.exports);
604
- var _e = re.exports;
604
+ var Se = re.exports;
605
605
  (function(a, t) {
606
606
  t.__esModule = !0, t.default = void 0;
607
- var n = r(fe), s = r(ke), i = r(_e);
607
+ var n = r(fe), s = r(ke), i = r(Se);
608
608
  function r(l) {
609
609
  return l && l.__esModule ? l : { default: l };
610
610
  }
611
611
  function e(l) {
612
612
  return (0, i.default)(Math.round(255 * l));
613
613
  }
614
- function d(l, o, f) {
615
- return (0, s.default)("#" + e(l) + e(o) + e(f));
614
+ function d(l, o, u) {
615
+ return (0, s.default)("#" + e(l) + e(o) + e(u));
616
616
  }
617
- t.default = function(l, o, f) {
618
- return (0, n.default)(l, o, f, d);
617
+ t.default = function(l, o, u) {
618
+ return (0, n.default)(l, o, u, d);
619
619
  }, a.exports = t.default;
620
620
  })(te, te.exports);
621
621
  var Ce = te.exports;
@@ -651,7 +651,7 @@ var Ge = ae.exports, ie = { exports: {} };
651
651
  if (typeof e == "object" && d === void 0 && l === void 0) return (0, n.default)("#" + (0, s.default)(e.red) + (0, s.default)(e.green) + (0, s.default)(e.blue));
652
652
  throw new i.default(6);
653
653
  };
654
- var n = r(ke), s = r(_e), i = r(C);
654
+ var n = r(ke), s = r(Se), i = r(C);
655
655
  function r(e) {
656
656
  return e && e.__esModule ? e : { default: e };
657
657
  }
@@ -661,8 +661,8 @@ var Ee = ie.exports, oe = { exports: {} };
661
661
  (function(a, t) {
662
662
  t.__esModule = !0, t.default = function(e, d, l, o) {
663
663
  if (typeof e == "string" && typeof d == "number") {
664
- var f = (0, n.default)(e);
665
- return "rgba(" + f.red + "," + f.green + "," + f.blue + "," + d + ")";
664
+ var u = (0, n.default)(e);
665
+ return "rgba(" + u.red + "," + u.green + "," + u.blue + "," + d + ")";
666
666
  }
667
667
  if (typeof e == "number" && typeof d == "number" && typeof l == "number" && typeof o == "number") return o >= 1 ? (0, s.default)(e, d, l) : "rgba(" + e + "," + d + "," + l + "," + o + ")";
668
668
  if (typeof e == "object" && d === void 0 && l === void 0 && o === void 0) return e.alpha >= 1 ? (0, s.default)(e.red, e.green, e.blue) : "rgba(" + e.red + "," + e.green + "," + e.blue + "," + e.alpha + ")";
@@ -676,48 +676,48 @@ var Ee = ie.exports, oe = { exports: {} };
676
676
  })(oe, oe.exports);
677
677
  var Ve = oe.exports;
678
678
  (function(a, t) {
679
- t.__esModule = !0, t.default = function(u) {
680
- if (typeof u != "object") throw new e.default(8);
681
- if (o(u)) return (0, r.default)(u);
682
- if (l(u)) return (0, i.default)(u);
683
- if (c(u)) return (0, s.default)(u);
684
- if (f(u)) return (0, n.default)(u);
679
+ t.__esModule = !0, t.default = function(f) {
680
+ if (typeof f != "object") throw new e.default(8);
681
+ if (o(f)) return (0, r.default)(f);
682
+ if (l(f)) return (0, i.default)(f);
683
+ if (c(f)) return (0, s.default)(f);
684
+ if (u(f)) return (0, n.default)(f);
685
685
  throw new e.default(8);
686
686
  };
687
687
  var n = d(Ue), s = d(Ge), i = d(Ee), r = d(Ve), e = d(C);
688
- function d(u) {
689
- return u && u.__esModule ? u : { default: u };
690
- }
691
- var l = function(u) {
692
- return typeof u.red == "number" && typeof u.green == "number" && typeof u.blue == "number" && (typeof u.alpha != "number" || u.alpha === void 0);
693
- }, o = function(u) {
694
- return typeof u.red == "number" && typeof u.green == "number" && typeof u.blue == "number" && typeof u.alpha == "number";
695
- }, f = function(u) {
696
- return typeof u.hue == "number" && typeof u.saturation == "number" && typeof u.lightness == "number" && (typeof u.alpha != "number" || u.alpha === void 0);
697
- }, c = function(u) {
698
- return typeof u.hue == "number" && typeof u.saturation == "number" && typeof u.lightness == "number" && typeof u.alpha == "number";
688
+ function d(f) {
689
+ return f && f.__esModule ? f : { default: f };
690
+ }
691
+ var l = function(f) {
692
+ return typeof f.red == "number" && typeof f.green == "number" && typeof f.blue == "number" && (typeof f.alpha != "number" || f.alpha === void 0);
693
+ }, o = function(f) {
694
+ return typeof f.red == "number" && typeof f.green == "number" && typeof f.blue == "number" && typeof f.alpha == "number";
695
+ }, u = function(f) {
696
+ return typeof f.hue == "number" && typeof f.saturation == "number" && typeof f.lightness == "number" && (typeof f.alpha != "number" || f.alpha === void 0);
697
+ }, c = function(f) {
698
+ return typeof f.hue == "number" && typeof f.saturation == "number" && typeof f.lightness == "number" && typeof f.alpha == "number";
699
699
  };
700
700
  a.exports = t.default;
701
701
  })(X, X.exports);
702
702
  var Be = X.exports;
703
703
  (function(a, t) {
704
704
  t.__esModule = !0, t.default = void 0;
705
- var n = e(we), s = e(xe), i = e(Se), r = e(Be);
705
+ var n = e(we), s = e(xe), i = e(_e), r = e(Be);
706
706
  function e(o) {
707
707
  return o && o.__esModule ? o : { default: o };
708
708
  }
709
709
  function d() {
710
710
  return d = Object.assign ? Object.assign.bind() : function(o) {
711
- for (var f = 1; f < arguments.length; f++) {
712
- var c = arguments[f];
713
- for (var u in c) Object.prototype.hasOwnProperty.call(c, u) && (o[u] = c[u]);
711
+ for (var u = 1; u < arguments.length; u++) {
712
+ var c = arguments[u];
713
+ for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (o[f] = c[f]);
714
714
  }
715
715
  return o;
716
716
  }, d.apply(this, arguments);
717
717
  }
718
- var l = (0, n.default)(function(o, f) {
719
- if (f === "transparent") return f;
720
- var c = (0, i.default)(f);
718
+ var l = (0, n.default)(function(o, u) {
719
+ if (u === "transparent") return u;
720
+ var c = (0, i.default)(u);
721
721
  return (0, r.default)(d({}, c, { lightness: (0, s.default)(0, 1, c.lightness - parseFloat(o)) }));
722
722
  });
723
723
  t.default = l, a.exports = t.default;
@@ -726,22 +726,22 @@ const Ze = ue(U.exports);
726
726
  var se = { exports: {} };
727
727
  (function(a, t) {
728
728
  t.__esModule = !0, t.default = void 0;
729
- var n = e(we), s = e(xe), i = e(Se), r = e(Be);
729
+ var n = e(we), s = e(xe), i = e(_e), r = e(Be);
730
730
  function e(o) {
731
731
  return o && o.__esModule ? o : { default: o };
732
732
  }
733
733
  function d() {
734
734
  return d = Object.assign ? Object.assign.bind() : function(o) {
735
- for (var f = 1; f < arguments.length; f++) {
736
- var c = arguments[f];
737
- for (var u in c) Object.prototype.hasOwnProperty.call(c, u) && (o[u] = c[u]);
735
+ for (var u = 1; u < arguments.length; u++) {
736
+ var c = arguments[u];
737
+ for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (o[f] = c[f]);
738
738
  }
739
739
  return o;
740
740
  }, d.apply(this, arguments);
741
741
  }
742
- var l = (0, n.default)(function(o, f) {
743
- if (f === "transparent") return f;
744
- var c = (0, i.default)(f);
742
+ var l = (0, n.default)(function(o, u) {
743
+ if (u === "transparent") return u;
744
+ var c = (0, i.default)(u);
745
745
  return (0, r.default)(d({}, c, { lightness: (0, s.default)(0, 1, c.lightness + parseFloat(o)) }));
746
746
  });
747
747
  t.default = l, a.exports = t.default;
@@ -784,7 +784,7 @@ function tt(a, t) {
784
784
  ((r) => {
785
785
  var e;
786
786
  const d = { type: "UPDATE_BODY_CLASS", isMobile: r };
787
- (e = a.contentWindow) === null || e === void 0 || e.postMessage(d, "*"), r && (v.isWidgetOpen ? v.hideTriggerButton() : v.showTriggerButton());
787
+ (e = a.contentWindow) === null || e === void 0 || e.postMessage(d, "*"), r && (y.isWidgetOpen ? y.hideTriggerButton() : y.showTriggerButton());
788
788
  })(document.body.clientWidth <= 576);
789
789
  }, i = () => {
790
790
  n && clearTimeout(n), n = window.setTimeout(s, 300);
@@ -807,10 +807,10 @@ const ye = /* @__PURE__ */ new Set();
807
807
  function nt(a, t, n) {
808
808
  let { isButtonHidden: s, triggerButtonIcon: i } = n;
809
809
  const r = document.createDocumentFragment();
810
- if (s) v.initialize({ isButtonHidden: s });
810
+ if (s) y.initialize({ isButtonHidden: s });
811
811
  else {
812
- const { button: l, icon: o } = function(f, c) {
813
- const u = x("button", W, { id: `trigger-button-${f}`, "aria-controls": T, "aria-expanded": "false", "data-name": W }), g = x("div", "trigger-button-icon", { "aria-hidden": "true" });
812
+ const { button: l, icon: o } = function(u, c) {
813
+ const f = _("button", W, { id: `trigger-button-${u}`, "aria-controls": T, "aria-expanded": "false", "data-name": W }), g = _("div", "trigger-button-icon", { "aria-hidden": "true" });
814
814
  return g.innerHTML = c ? `
815
815
  <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">
816
816
  <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>
@@ -823,47 +823,47 @@ function nt(a, t, n) {
823
823
  <svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">
824
824
  <path fill-rule="evenodd" clip-rule="evenodd" d="M1.71844 10.3882L4.60606 6.98384L1.71844 3.58375C1.4014 3.21362 1.44424 2.65841 1.81269 2.33993C1.97978 2.1979 2.65242 1.98701 3.04657 2.43461L5.78425 5.65824C6.14281 5.29523 6.51693 4.95924 6.90479 4.65114C8.88976 3.07437 11.2345 2.22803 13.6931 2.22803C16.9492 2.22803 20.0039 3.71718 22.2917 6.41142C22.5702 6.74282 22.5702 7.22916 22.2917 7.56056C20.0039 10.2591 16.9492 11.744 13.6931 11.744C11.2348 11.744 8.89035 10.8948 6.90554 9.31995C6.51741 9.01199 6.14304 8.67628 5.78425 8.31374L3.04657 11.5374C2.72953 11.9075 2.18114 11.9505 1.81269 11.632C1.44852 11.3179 1.40568 10.7584 1.71844 10.3882ZM5.93026 10.4683C8.17161 12.2599 10.8546 13.25 13.6931 13.25C17.4881 13.25 21.019 11.4034 23.4447 8.52942C24.1873 7.64571 24.1843 6.31801 23.4397 5.43663C20.8944 2.43919 17.4337 0.722025 13.6931 0.722025C10.8555 0.722025 8.17194 1.70845 5.92952 3.50276L4.17682 1.43933C3.57943 0.760929 2.79325 0.630009 2.25286 0.662947C1.98116 0.679506 1.73125 0.736852 1.51895 0.811846C1.26839 0.900352 1.03017 1.02718 0.827835 1.20058C-0.165283 2.05903 -0.283916 3.561 0.574656 4.56345L2.63075 6.98445L0.568104 9.41623C-0.272133 10.4106 -0.166523 11.9125 0.827835 12.7714C1.81372 13.6243 3.34308 13.5062 4.19036 12.5171L5.93026 10.4683Z" fill="currentColor"/>
825
825
  </svg>
826
- `, u.setAttribute("aria-label", "Open Brainfish widget"), u.appendChild(g), { button: u, icon: g };
826
+ `, f.setAttribute("aria-label", "Open Brainfish widget"), f.appendChild(g), { button: f, icon: g };
827
827
  }(a, i);
828
- r.appendChild(l), v.initialize({ button: l, icon: o });
828
+ r.appendChild(l), y.initialize({ button: l, icon: o });
829
829
  }
830
830
  const { iframeContainer: e, iframe: d } = function(l) {
831
- const o = x("div", T, { id: T, "aria-live": "polite", "aria-hidden": "true" }), f = x("div", "iframe-loading-indicator"), c = x("div", "spinner");
832
- f.setAttribute("aria-label", "Loading content"), f.setAttribute("role", "status"), f.appendChild(c), o.appendChild(f);
833
- const u = x("iframe", "trigger-iframe", { src: l, sandbox: "allow-scripts allow-same-origin allow-popups allow-forms", allow: "clipboard-write", role: "dialog" });
834
- return u.style.opacity = "0", u.addEventListener("load", () => {
835
- f.style.display = "none", u.style.opacity = "1";
836
- }), u.addEventListener("error", (g) => {
837
- console.error("Error loading iframe:", g), f.innerHTML = "";
838
- const h = x("div", "loading-error");
839
- f.appendChild(h), f.setAttribute("aria-label", "Failed to load content");
840
- }), o.appendChild(u), { iframeContainer: o, iframe: u };
831
+ const o = _("div", T, { id: T, "aria-live": "polite", "aria-hidden": "true" }), u = _("div", "iframe-loading-indicator"), c = _("div", "spinner");
832
+ u.setAttribute("aria-label", "Loading content"), u.setAttribute("role", "status"), u.appendChild(c), o.appendChild(u);
833
+ const f = _("iframe", "trigger-iframe", { src: l, sandbox: "allow-scripts allow-same-origin allow-popups allow-forms", allow: "clipboard-write", role: "dialog" });
834
+ return f.style.opacity = "0", f.addEventListener("load", () => {
835
+ u.style.display = "none", f.style.opacity = "1";
836
+ }), f.addEventListener("error", (g) => {
837
+ console.error("Error loading iframe:", g), u.innerHTML = "";
838
+ const h = _("div", "loading-error");
839
+ u.appendChild(h), u.setAttribute("aria-label", "Failed to load content");
840
+ }), o.appendChild(f), { iframeContainer: o, iframe: f };
841
841
  }(t);
842
842
  return r.appendChild(e), { fragment: r, iframe: d };
843
843
  }
844
844
  const rt = (a, t) => {
845
845
  const n = le(a.overrides), s = ((i = a.overrides) == null ? void 0 : i.widgetHost) || "https://agent.brainfi.sh";
846
846
  var i;
847
- const { theme: r, settings: e } = t, d = K(JSON.stringify(a.redirectRules)), l = `${s}/?widgetKey=${a.widgetKey}&themeParam=${K(JSON.stringify(r))}&settingsParam=${K(JSON.stringify(e))}${a.redirectRules ? `&redirectRulesParam=${d}` : ""}`, o = e == null ? void 0 : e.hideTriggerButton, f = e == null ? void 0 : e.triggerButtonIcon;
847
+ const { theme: r, settings: e } = t, d = K(JSON.stringify(a.redirectRules)), l = `${s}/?widgetKey=${a.widgetKey}&themeParam=${K(JSON.stringify(r))}&settingsParam=${K(JSON.stringify(e))}${a.redirectRules ? `&redirectRulesParam=${d}` : ""}`, o = e == null ? void 0 : e.hideTriggerButton, u = e == null ? void 0 : e.triggerButtonIcon;
848
848
  try {
849
- if (c = a.widgetKey, ye.has(c) || function(k) {
850
- return !!document.getElementById(`trigger-button-${k}`);
849
+ if (c = a.widgetKey, ye.has(c) || function(b) {
850
+ return !!document.getElementById(`trigger-button-${b}`);
851
851
  }(a.widgetKey)) return;
852
852
  Xe(t);
853
- const { fragment: u, iframe: g } = nt(a.widgetKey, l, { isButtonHidden: o || !1, triggerButtonIcon: f || "" }), h = new AbortController(), { signal: p } = h;
853
+ const { fragment: f, iframe: g } = nt(a.widgetKey, l, { isButtonHidden: o || !1, triggerButtonIcon: u || "" }), h = new AbortController(), { signal: p } = h;
854
854
  g.onload = () => {
855
855
  setTimeout(() => {
856
856
  et(g, p), Ne({ widgetHost: s, apiHost: n, widgetKey: a.widgetKey, signal: p }), tt(g, p);
857
857
  }, 0);
858
- }, document.body.appendChild(u), ye.add(a.widgetKey);
858
+ }, document.body.appendChild(f), ye.add(a.widgetKey);
859
859
  const m = () => {
860
860
  h.abort(), window.removeEventListener("beforeunload", m);
861
861
  };
862
862
  return void window.addEventListener("beforeunload", m);
863
- } catch (u) {
863
+ } catch (f) {
864
864
  (function(g, h, p) {
865
- S(g, h, h.message, p);
866
- })(n, u, a.widgetKey);
865
+ k(g, h, h.message, p);
866
+ })(n, f, a.widgetKey);
867
867
  }
868
868
  var c;
869
869
  };
@@ -910,7 +910,7 @@ const E = typeof window != "undefined" && window.Brainfish ? window.Brainfish :
910
910
  let z = null;
911
911
  E.Widgets.isReady = !1, E.Widgets.identify = (a) => {
912
912
  window.BrainfishAnalytics("identify", a);
913
- }, E.Widgets.init = (a) => b(void 0, null, function* () {
913
+ }, E.Widgets.init = (a) => v(void 0, null, function* () {
914
914
  window && (window.BrainfishAnalytics = window.BrainfishAnalytics || function() {
915
915
  for (var r = arguments.length, e = new Array(r), d = 0; d < r; d++) e[d] = arguments[d];
916
916
  (window.BrainfishAnalytics.q = window.BrainfishAnalytics.q || []).push(e);
@@ -932,12 +932,12 @@ E.Widgets.isReady = !1, E.Widgets.identify = (a) => {
932
932
  i = r;
933
933
  }
934
934
  z || (z = function(r, e, d, l) {
935
- return b(this, null, function* () {
936
- var o, f, c, u;
937
- const g = ((o = r.overrides) === null || o === void 0 ? void 0 : o.enableRecording) || (e == null || (f = e.settings) === null || f === void 0 ? void 0 : f.enableRecording) || !1, h = ((c = r.overrides) === null || c === void 0 ? void 0 : c.version) || (e == null ? void 0 : e.version), p = [];
938
- h != null && h.startsWith("2.") ? rt(r, e) : p.push(Re(r, e)), p.push(qe(r.widgetKey, e.trackingToken || "", d, l, g, (e == null || (u = e.settings) === null || u === void 0 ? void 0 : u.recordingBlocklist) || []));
939
- const [m] = yield Promise.allSettled(p);
940
- m && m.status === "fulfilled" && m.value && E._setRealBrainfish(m.value);
935
+ return v(this, null, function* () {
936
+ var o, u, c, f, g;
937
+ const h = ((o = r.overrides) === null || o === void 0 ? void 0 : o.enableRecording) || (e == null || (u = e.settings) === null || u === void 0 ? void 0 : u.enableRecording) || !1, p = ((c = r.overrides) === null || c === void 0 ? void 0 : c.version) || (e == null ? void 0 : e.version), m = [];
938
+ p != null && p.startsWith("2.") ? rt(r, e) : m.push(Re(r, e)), m.push(qe(r.widgetKey, e.trackingToken || "", d, l, h, (e == null || (f = e.settings) === null || f === void 0 ? void 0 : f.recordingBlocklist) || [], e == null || (g = e.settings) === null || g === void 0 ? void 0 : g._allowLocalhostRecording));
939
+ const [b] = yield Promise.allSettled(m);
940
+ b && b.status === "fulfilled" && b.value && E._setRealBrainfish(b.value);
941
941
  });
942
942
  }(a, i, t, n)), yield z, E.Widgets.isReady = !0, window.dispatchEvent(new Event("onBrainfishReady"));
943
943
  });