@brainfish-ai/widgets-initiator 1.6.1 → 1.6.2
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/README.md +37 -0
- package/dist/types/initIframeTrigger/components/TriggerButton.d.ts +1 -1
- package/dist/types/initIframeTrigger/managers/IframeStateManager.d.ts +4 -1
- package/dist/web.cjs.js +6 -6
- package/dist/web.cjs.js.map +1 -1
- package/dist/web.js +438 -418
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
package/dist/web.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var F = (a, t,
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
1
|
+
var je = Object.defineProperty, Fe = Object.defineProperties;
|
|
2
|
+
var We = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var ge = Object.getOwnPropertySymbols;
|
|
4
|
+
var He = Object.prototype.hasOwnProperty, $e = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var F = (a, t, n) => t in a ? je(a, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[t] = n, W = (a, t) => {
|
|
6
|
+
for (var n in t || (t = {}))
|
|
7
|
+
He.call(t, n) && F(a, n, t[n]);
|
|
8
|
+
if (ge)
|
|
9
|
+
for (var n of ge(t))
|
|
10
|
+
$e.call(t, n) && F(a, n, t[n]);
|
|
11
11
|
return a;
|
|
12
|
-
},
|
|
13
|
-
var S = (a, t,
|
|
14
|
-
var m = (a, t,
|
|
15
|
-
var
|
|
12
|
+
}, H = (a, t) => Fe(a, We(t));
|
|
13
|
+
var S = (a, t, n) => F(a, typeof t != "symbol" ? t + "" : t, n);
|
|
14
|
+
var m = (a, t, n) => new Promise((i, o) => {
|
|
15
|
+
var r = (l) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
o(
|
|
17
|
+
d(n.next(l));
|
|
18
|
+
} catch (s) {
|
|
19
|
+
o(s);
|
|
20
20
|
}
|
|
21
|
-
}, e = (
|
|
21
|
+
}, e = (l) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
o(
|
|
23
|
+
d(n.throw(l));
|
|
24
|
+
} catch (s) {
|
|
25
|
+
o(s);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, d = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(r, e);
|
|
28
|
+
d((n = n.apply(a, t)).next());
|
|
29
29
|
});
|
|
30
|
-
var
|
|
30
|
+
var k, q;
|
|
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] = "
|
|
35
|
-
} catch (
|
|
34
|
+
t && (a._sentryDebugIds = a._sentryDebugIds || {}, a._sentryDebugIds[t] = "ec3dc36b-ca2f-4e8f-91bd-b84cd56642ce", a._sentryDebugIdIdentifier = "sentry-dbid-ec3dc36b-ca2f-4e8f-91bd-b84cd56642ce");
|
|
35
|
+
} catch (n) {
|
|
36
36
|
}
|
|
37
|
-
})(), (typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}).SENTRY_RELEASE = { id: "
|
|
37
|
+
})(), (typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}).SENTRY_RELEASE = { id: "8caaf781e1d718f459b9b3c07fdbcb4a119f0d01" }, function(a) {
|
|
38
38
|
a.Sidebar = "sidebar", a.Searchbar = "searchbar";
|
|
39
|
-
}(
|
|
40
|
-
class
|
|
41
|
-
constructor(
|
|
42
|
-
super(
|
|
39
|
+
}(k || (k = {})), k.Sidebar, k.Searchbar;
|
|
40
|
+
class se extends Error {
|
|
41
|
+
constructor(n, i) {
|
|
42
|
+
super(n, i);
|
|
43
43
|
S(this, "cause");
|
|
44
|
-
this.name = "BrainfishWidgetError", this.cause =
|
|
44
|
+
this.name = "BrainfishWidgetError", this.cause = i == null ? void 0 : i.cause, Error.captureStackTrace && Error.captureStackTrace(this, se), this.cause instanceof Error && this.cause.stack && (this.stack = this.stack + `
|
|
45
45
|
Caused by: ` + this.cause.stack);
|
|
46
46
|
}
|
|
47
47
|
toJSON() {
|
|
@@ -50,136 +50,156 @@ Caused by: ` + this.cause.stack);
|
|
|
50
50
|
}
|
|
51
51
|
(function(a) {
|
|
52
52
|
a.LINK = "link", a.CALLBACK = "callback", a.EMAIL = "email", a.PHONE = "phone";
|
|
53
|
-
})(
|
|
54
|
-
const x = (a, t,
|
|
55
|
-
let o =
|
|
53
|
+
})(q || (q = {}));
|
|
54
|
+
const x = (a, t, n, i) => {
|
|
55
|
+
let o = n, r = {};
|
|
56
56
|
if (t instanceof Error) try {
|
|
57
|
-
|
|
57
|
+
r = JSON.parse(t.message), o += ` - ${r.message || t.message}`;
|
|
58
58
|
} catch (e) {
|
|
59
59
|
o += ` - ${t.message}`;
|
|
60
60
|
}
|
|
61
61
|
else o += ` - ${String(t)}`;
|
|
62
|
-
((e,
|
|
62
|
+
((e, d, l) => {
|
|
63
63
|
if (!navigator || navigator.userAgent.toLowerCase().includes("headless")) return;
|
|
64
|
-
const
|
|
65
|
-
fetch(`${e || "https://app.brainfi.sh"}/api/trackError.widget.create`, { method: "POST", headers: { "Content-Type": "application/json", "api-key":
|
|
66
|
-
})(a, new
|
|
67
|
-
},
|
|
68
|
-
let { widgetKey: t, apiHost:
|
|
69
|
-
return function(
|
|
64
|
+
const s = 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.6.2. ${d.message}`, stack: d.stack, cause: { message: s.message, stack: s.stack, cause: s.cause } }) });
|
|
66
|
+
})(a, new se(o, { cause: r }), i);
|
|
67
|
+
}, Ke = (a) => m(void 0, null, function* () {
|
|
68
|
+
let { widgetKey: t, apiHost: n } = a;
|
|
69
|
+
return function(i, o, r) {
|
|
70
70
|
return m(this, null, function* () {
|
|
71
|
-
let e,
|
|
72
|
-
for (;
|
|
73
|
-
const
|
|
74
|
-
if (!
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
77
|
-
return
|
|
78
|
-
} catch (
|
|
79
|
-
if (e =
|
|
80
|
-
yield new Promise((
|
|
71
|
+
let e, d = 0;
|
|
72
|
+
for (; d < 3; ) try {
|
|
73
|
+
const l = yield fetch(`${i}${o}`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": r } });
|
|
74
|
+
if (!l.ok) throw new Error(`API call failed with status: ${l.status}`);
|
|
75
|
+
const s = yield l.json();
|
|
76
|
+
if (!s) throw new Error("Error loading config: empty response");
|
|
77
|
+
return s;
|
|
78
|
+
} catch (l) {
|
|
79
|
+
if (e = l, d++, d >= 3) throw x(i, l, "Error fetching config", r), e;
|
|
80
|
+
yield new Promise((s) => setTimeout(s, 500));
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
-
}(
|
|
84
|
-
}),
|
|
85
|
-
let { config: t, apiKey:
|
|
83
|
+
}(n, "/api/searchWidgets.getConfigByKey", t);
|
|
84
|
+
}), qe = (a) => {
|
|
85
|
+
let { config: t, apiKey: n, apiHost: i } = a;
|
|
86
86
|
const o = t.settings || {};
|
|
87
|
-
return ["bodyActionButtons", "footerActionButtons", "nextBestActions"].forEach((
|
|
88
|
-
o[
|
|
89
|
-
}),
|
|
90
|
-
},
|
|
87
|
+
return ["bodyActionButtons", "footerActionButtons", "nextBestActions"].forEach((r) => {
|
|
88
|
+
o[r] && (o[r] = o[r].map((e) => e.type === q.CALLBACK && e.value ? H(W({}, e), { value: new Function(`return ${e.value}`)() }) : e));
|
|
89
|
+
}), H(W({}, t), { settings: o, apiHost: i, widgetMode: t.widgetType, apiKey: n });
|
|
90
|
+
}, de = (a) => (a == null ? void 0 : a.apiHost) || "https://app.brainfi.sh", $ = (() => {
|
|
91
91
|
if (typeof window == "undefined") return;
|
|
92
92
|
const a = window.navigator.userAgent;
|
|
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
96
|
})(), ze = (a) => m(void 0, null, function* () {
|
|
97
|
-
let { apiHost: t, widgetKey:
|
|
97
|
+
let { apiHost: t, widgetKey: n, version: i } = a;
|
|
98
98
|
try {
|
|
99
|
-
const o = `https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${
|
|
100
|
-
return { widget: yield ((
|
|
101
|
-
return document.getElementById("brainfish-widget") ? window.Brainfish : new Promise((
|
|
99
|
+
const o = `https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${i}/dist/web.js`, r = $ ? o.replace("web.js", "web.umd.js") : o;
|
|
100
|
+
return { widget: yield ((d) => m(void 0, null, function* () {
|
|
101
|
+
return document.getElementById("brainfish-widget") ? window.Brainfish : new Promise((l, s) => {
|
|
102
102
|
const u = document.createElement("script");
|
|
103
|
-
u.id = "brainfish-widget", u.src =
|
|
103
|
+
u.id = "brainfish-widget", u.src = d, u.type = $ ? "text/javascript" : "module", u.async = !0, u.crossOrigin = "anonymous", u.onload = () => {
|
|
104
104
|
setTimeout(() => {
|
|
105
105
|
const c = window.Brainfish;
|
|
106
|
-
c ?
|
|
106
|
+
c ? l(c) : s(new Error("Failed to load Brainfish module"));
|
|
107
107
|
}, 200);
|
|
108
108
|
}, u.onerror = (c) => {
|
|
109
|
-
const f = c, g = { message: `Failed to load script: ${
|
|
110
|
-
|
|
111
|
-
},
|
|
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
|
+
s(new Error(JSON.stringify(g)));
|
|
111
|
+
}, $ || document.head.appendChild(u);
|
|
112
112
|
});
|
|
113
|
-
}))(
|
|
113
|
+
}))(r) };
|
|
114
114
|
} catch (o) {
|
|
115
|
-
x(t, o, o.message,
|
|
115
|
+
x(t, o, o.message, n);
|
|
116
116
|
}
|
|
117
|
-
}),
|
|
118
|
-
const
|
|
117
|
+
}), he = /* @__PURE__ */ new Set(), De = (a, t) => m(void 0, null, function* () {
|
|
118
|
+
const n = de(a.overrides);
|
|
119
119
|
try {
|
|
120
|
-
if (
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
const { widget: o } =
|
|
120
|
+
if (he.has(a.widgetKey)) return;
|
|
121
|
+
const i = yield ze({ apiHost: n, widgetKey: a.widgetKey, version: t.version || "latest" });
|
|
122
|
+
if (i) {
|
|
123
|
+
const { widget: o } = i, r = qe({ config: t, apiKey: a.widgetKey, apiHost: n });
|
|
124
124
|
return a.overrides && t.settings && Object.entries(a.overrides).forEach((e) => {
|
|
125
|
-
let [
|
|
126
|
-
t.settings &&
|
|
127
|
-
let
|
|
125
|
+
let [d, l] = e;
|
|
126
|
+
t.settings && d in t.settings && (t.settings[d] = function() {
|
|
127
|
+
let s = arguments.length > 1 ? arguments[1] : void 0;
|
|
128
128
|
const u = new Map((arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).map((c) => [c.label, c]));
|
|
129
|
-
return
|
|
130
|
-
}(t.settings[
|
|
131
|
-
}), function(e,
|
|
132
|
-
|
|
133
|
-
}(o,
|
|
129
|
+
return s.forEach((c) => u.set(c.label, c)), Array.from(u.values());
|
|
130
|
+
}(t.settings[d], l));
|
|
131
|
+
}), function(e, d) {
|
|
132
|
+
d.widgetType === k.Searchbar || d.widgetType === "Search" ? e.SearchWidget.initStandard(d) : e.HelpWidget.initPopup(d);
|
|
133
|
+
}(o, r), he.add(a.widgetKey), o;
|
|
134
134
|
}
|
|
135
|
-
} catch (
|
|
136
|
-
x(
|
|
135
|
+
} catch (i) {
|
|
136
|
+
x(n, i, i.message, a.widgetKey);
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
|
-
let
|
|
140
|
-
const
|
|
141
|
-
return m(this, arguments, function* (a, t,
|
|
142
|
-
let e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "",
|
|
143
|
-
if (t || x(
|
|
144
|
-
const
|
|
139
|
+
let me = !1;
|
|
140
|
+
const Ne = function(i, o, r) {
|
|
141
|
+
return m(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];
|
|
143
|
+
if (t || x(n, new Error("Access key is required"), "Access key is required", a), !me) try {
|
|
144
|
+
const l = (() => {
|
|
145
145
|
if (typeof window == "undefined" || typeof navigator == "undefined") return !1;
|
|
146
|
-
const
|
|
146
|
+
const s = navigator, u = window, c = (s.doNotTrack || u.doNotTrack || s.msDoNotTrack || "0").toString().toLowerCase();
|
|
147
147
|
return ["1", "yes", "true"].includes(c);
|
|
148
148
|
})();
|
|
149
|
-
window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !
|
|
149
|
+
window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !l, trackAttributes: !l, trackOutgoingLinks: !l, enableRecording: !l && d }), me = !0, yield ((s, u) => m(this, null, function* () {
|
|
150
150
|
if (document.getElementById("brainfish-analytics")) return window.BrainfishAnalytics;
|
|
151
151
|
const c = document.createElement("script");
|
|
152
152
|
c.id = "brainfish-analytics", c.src = "https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js", c.type = "module", c.async = !0, c.crossOrigin = "anonymous", c.onerror = () => {
|
|
153
|
-
x(
|
|
153
|
+
x(s, new Error(`Failed to load script: ${c.src}`), `Failed to load script: ${c.src}`, u);
|
|
154
154
|
}, document.head.appendChild(c);
|
|
155
|
-
}))(
|
|
156
|
-
} catch (
|
|
157
|
-
x(
|
|
155
|
+
}))(n, a);
|
|
156
|
+
} catch (l) {
|
|
157
|
+
x(n, l, "Failed to initialize BrainfishAnalytics", a);
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
160
|
};
|
|
161
|
-
function
|
|
162
|
-
let
|
|
163
|
-
const
|
|
164
|
-
return
|
|
165
|
-
let [
|
|
166
|
-
|
|
167
|
-
}),
|
|
161
|
+
function I(a, t) {
|
|
162
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
163
|
+
const i = document.createElement(a);
|
|
164
|
+
return i.className = t, Object.entries(n).forEach((o) => {
|
|
165
|
+
let [r, e] = o;
|
|
166
|
+
i.setAttribute(r, e);
|
|
167
|
+
}), i;
|
|
168
168
|
}
|
|
169
|
-
const
|
|
169
|
+
const P = "bf-iframe-container", j = "bf-trigger-button", L = 576;
|
|
170
170
|
class v {
|
|
171
171
|
static get isWidgetOpen() {
|
|
172
172
|
return this.isOpen;
|
|
173
173
|
}
|
|
174
|
-
static initialize(t,
|
|
175
|
-
|
|
174
|
+
static initialize(t, n, i) {
|
|
175
|
+
var o;
|
|
176
|
+
this.button = t, this.icon = n, this.isButtonHidden = i, t.addEventListener("click", () => this.toggleIframeVisibility()), i && this.hideTriggerButton(), (o = window.Brainfish) !== null && o !== void 0 && o.HelpWidget && (window.Brainfish.HelpWidget.close = () => this.closeWidget(), window.Brainfish.HelpWidget.open = () => this.openWidget());
|
|
176
177
|
}
|
|
177
178
|
static toggleIframeVisibility() {
|
|
178
179
|
if (!this.button || !this.icon) return;
|
|
179
180
|
this.isOpen = !this.isOpen;
|
|
180
|
-
const t = this.icon.querySelector(".fish-icon"),
|
|
181
|
-
var
|
|
182
|
-
this.isOpen ? (
|
|
181
|
+
const t = this.icon.querySelector(".fish-icon"), n = this.icon.querySelector(".close-icon"), i = document.querySelector(".bf-iframe-container"), o = i == null ? void 0 : i.querySelector("iframe");
|
|
182
|
+
var r;
|
|
183
|
+
this.isOpen ? (i == null || i.classList.add("open"), i == null || i.setAttribute("aria-hidden", "false"), this.button.setAttribute("aria-expanded", "true"), t.classList.remove("visible"), n.classList.add("visible"), o == null || (r = o.contentWindow) === null || r === void 0 || r.postMessage({ type: "FOCUS_SEARCH_FIELD" }, "*"), window.BrainfishAnalytics("track", "Open Widget"), document.body.clientWidth <= L && this.hideTriggerButton()) : (i == null || i.classList.remove("open"), i == null || i.setAttribute("aria-hidden", "true"), this.button.setAttribute("aria-expanded", "false"), n.classList.remove("visible"), t.classList.add("visible"), this.showTriggerButton(), window.BrainfishAnalytics("track", "Close Widget"));
|
|
184
|
+
}
|
|
185
|
+
static openWidget() {
|
|
186
|
+
var t;
|
|
187
|
+
if (!this.icon) return;
|
|
188
|
+
this.isOpen = !0;
|
|
189
|
+
const n = document.querySelector(".bf-iframe-container"), i = n == null ? void 0 : n.querySelector("iframe");
|
|
190
|
+
if (n == null || n.classList.add("open"), n == null || n.setAttribute("aria-hidden", "false"), i == null || (t = i.contentWindow) === null || t === void 0 || t.postMessage({ type: "FOCUS_SEARCH_FIELD" }, "*"), window.BrainfishAnalytics("track", "Open Widget"), this.button && this.icon && !this.isButtonHidden) {
|
|
191
|
+
const o = this.icon.querySelector(".fish-icon"), r = this.icon.querySelector(".close-icon");
|
|
192
|
+
this.button.setAttribute("aria-expanded", "true"), o.classList.remove("visible"), r.classList.add("visible"), window.BrainfishAnalytics("track", "Open Widget"), document.body.clientWidth <= L && this.hideTriggerButton();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
static closeWidget() {
|
|
196
|
+
this.isOpen = !1;
|
|
197
|
+
const t = document.querySelector(".bf-iframe-container");
|
|
198
|
+
if (t == null || t.classList.remove("open"), t == null || t.setAttribute("aria-hidden", "true"), window.BrainfishAnalytics("track", "Close Widget"), this.button && this.icon && !this.isButtonHidden) {
|
|
199
|
+
this.button.setAttribute("aria-expanded", "false");
|
|
200
|
+
const n = this.icon.querySelector(".fish-icon"), i = this.icon.querySelector(".close-icon");
|
|
201
|
+
n.classList.add("visible"), i.classList.remove("visible"), document.body.clientWidth <= L && this.showTriggerButton();
|
|
202
|
+
}
|
|
183
203
|
}
|
|
184
204
|
static showTriggerButton() {
|
|
185
205
|
var t;
|
|
@@ -190,67 +210,67 @@ class v {
|
|
|
190
210
|
(t = this.button) === null || t === void 0 || t.classList.add("hidden");
|
|
191
211
|
}
|
|
192
212
|
}
|
|
193
|
-
S(v, "isOpen", !1), S(v, "button", null), S(v, "icon", null);
|
|
194
|
-
function
|
|
195
|
-
let { widgetHost: t, apiHost:
|
|
196
|
-
window.addEventListener("message", (
|
|
197
|
-
if (
|
|
198
|
-
const { type: e } =
|
|
213
|
+
S(v, "isOpen", !1), S(v, "button", null), S(v, "icon", null), S(v, "isButtonHidden", !1);
|
|
214
|
+
function Re(a) {
|
|
215
|
+
let { widgetHost: t, apiHost: n, widgetKey: i, signal: o } = a;
|
|
216
|
+
window.addEventListener("message", (r) => {
|
|
217
|
+
if (r.origin !== t) return;
|
|
218
|
+
const { type: e } = r.data;
|
|
199
219
|
if (e === "TOGGLE_WIDGET_SIZE" && function() {
|
|
200
|
-
const
|
|
201
|
-
|
|
220
|
+
const d = document.querySelector(`.${P}`);
|
|
221
|
+
d.classList.contains("expanded") ? d.classList.remove("expanded") : d.classList.add("expanded");
|
|
202
222
|
}(), e === "TRACK_EVENT") {
|
|
203
223
|
if (!window.BrainfishAnalytics) return;
|
|
204
|
-
const { eventName:
|
|
205
|
-
window.BrainfishAnalytics("track",
|
|
224
|
+
const { eventName: d, data: l } = r.data;
|
|
225
|
+
window.BrainfishAnalytics("track", d, l);
|
|
206
226
|
}
|
|
207
227
|
if (e === "CLOSE_WIDGET" && (window.BrainfishAnalytics("track", "Close Widget"), v.toggleIframeVisibility()), e === "NEXT_BEST_ACTION_CLICKED") {
|
|
208
|
-
const { action:
|
|
209
|
-
if (!["function", "callback"].includes(
|
|
210
|
-
if (window.__bfCallbacks = window.__bfCallbacks || {}, window.__bfCallbacks[
|
|
211
|
-
const f = `${
|
|
228
|
+
const { action: d, searchQueryId: l, query: s, answer: u } = r.data, c = { action: d, searchQueryId: l };
|
|
229
|
+
if (!["function", "callback"].includes(d.type)) return void console.error("Invalid action type", d);
|
|
230
|
+
if (window.__bfCallbacks = window.__bfCallbacks || {}, window.__bfCallbacks[d.id]) return void window.__bfCallbacks[d.id](s, u, c);
|
|
231
|
+
const f = `${n}/api/searchWidgets.callback.codeblocks?apiKey=${i}&codeblockId=${d.id}`, g = document.createElement("script");
|
|
212
232
|
g.src = f, document.head.appendChild(g), g.onload = () => {
|
|
213
|
-
window.__bfCallbacks[
|
|
233
|
+
window.__bfCallbacks[d.id](s, u, c), setTimeout(() => {
|
|
214
234
|
document.head.removeChild(g);
|
|
215
235
|
}, 300);
|
|
216
236
|
};
|
|
217
237
|
}
|
|
218
238
|
}, { signal: o });
|
|
219
239
|
}
|
|
220
|
-
function
|
|
240
|
+
function le(a) {
|
|
221
241
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
222
242
|
}
|
|
223
|
-
var z = { exports: {} },
|
|
243
|
+
var z = { exports: {} }, D = { exports: {} }, N = { exports: {} };
|
|
224
244
|
(function(a, t) {
|
|
225
|
-
function
|
|
245
|
+
function n(o) {
|
|
226
246
|
return Math.round(255 * o);
|
|
227
247
|
}
|
|
228
|
-
function
|
|
229
|
-
return
|
|
248
|
+
function i(o, r, e) {
|
|
249
|
+
return n(o) + "," + n(r) + "," + n(e);
|
|
230
250
|
}
|
|
231
|
-
t.__esModule = !0, t.default = void 0, t.default = function(o,
|
|
232
|
-
if (
|
|
233
|
-
var
|
|
234
|
-
|
|
235
|
-
var h = e -
|
|
236
|
-
return
|
|
251
|
+
t.__esModule = !0, t.default = void 0, t.default = function(o, r, e, d) {
|
|
252
|
+
if (d === void 0 && (d = i), r === 0) return d(e, e, e);
|
|
253
|
+
var l = (o % 360 + 360) % 360 / 60, s = (1 - Math.abs(2 * e - 1)) * r, u = s * (1 - Math.abs(l % 2 - 1)), c = 0, f = 0, g = 0;
|
|
254
|
+
l >= 0 && l < 1 ? (c = s, f = u) : l >= 1 && l < 2 ? (c = u, f = s) : l >= 2 && l < 3 ? (f = s, g = u) : l >= 3 && l < 4 ? (f = u, g = s) : l >= 4 && l < 5 ? (c = u, g = s) : l >= 5 && l < 6 && (c = s, g = u);
|
|
255
|
+
var h = e - s / 2;
|
|
256
|
+
return d(c + h, f + h, g + h);
|
|
237
257
|
}, a.exports = t.default;
|
|
238
|
-
})(
|
|
239
|
-
var
|
|
258
|
+
})(N, N.exports);
|
|
259
|
+
var ue = N.exports, R = { exports: {} };
|
|
240
260
|
(function(a, t) {
|
|
241
261
|
t.__esModule = !0, t.default = void 0;
|
|
242
|
-
var
|
|
243
|
-
t.default = function(
|
|
244
|
-
if (typeof
|
|
245
|
-
var o =
|
|
246
|
-
return
|
|
262
|
+
var n = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "00ffff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000", blanchedalmond: "ffebcd", blue: "0000ff", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "00ffff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkgrey: "a9a9a9", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkslategrey: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dimgrey: "696969", dodgerblue: "1e90ff", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "ff00ff", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", grey: "808080", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgray: "d3d3d3", lightgreen: "90ee90", lightgrey: "d3d3d3", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslategray: "789", lightslategrey: "789", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "0f0", limegreen: "32cd32", linen: "faf0e6", magenta: "f0f", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370db", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "db7093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "639", red: "f00", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", slategrey: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", wheat: "f5deb3", white: "fff", whitesmoke: "f5f5f5", yellow: "ff0", yellowgreen: "9acd32" };
|
|
263
|
+
t.default = function(i) {
|
|
264
|
+
if (typeof i != "string") return i;
|
|
265
|
+
var o = i.toLowerCase();
|
|
266
|
+
return n[o] ? "#" + n[o] : i;
|
|
247
267
|
}, a.exports = t.default;
|
|
248
|
-
})(
|
|
249
|
-
var
|
|
268
|
+
})(R, R.exports);
|
|
269
|
+
var Ue = R.exports, U = { exports: {} };
|
|
250
270
|
(function(a, t) {
|
|
251
|
-
function
|
|
252
|
-
var
|
|
253
|
-
return
|
|
271
|
+
function n(l) {
|
|
272
|
+
var s = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
273
|
+
return n = function(u) {
|
|
254
274
|
if (u === null || !function(f) {
|
|
255
275
|
try {
|
|
256
276
|
return Function.toString.call(f).indexOf("[native code]") !== -1;
|
|
@@ -259,41 +279,41 @@ var Re = D.exports, R = { exports: {} };
|
|
|
259
279
|
}
|
|
260
280
|
}(u)) return u;
|
|
261
281
|
if (typeof u != "function") throw new TypeError("Super expression must either be null or a function");
|
|
262
|
-
if (
|
|
263
|
-
if (
|
|
264
|
-
|
|
282
|
+
if (s !== void 0) {
|
|
283
|
+
if (s.has(u)) return s.get(u);
|
|
284
|
+
s.set(u, c);
|
|
265
285
|
}
|
|
266
286
|
function c() {
|
|
267
287
|
return function(f, g, h) {
|
|
268
|
-
if (
|
|
288
|
+
if (i()) return Reflect.construct.apply(null, arguments);
|
|
269
289
|
var p = [null];
|
|
270
290
|
p.push.apply(p, g);
|
|
271
291
|
var b = new (f.bind.apply(f, p))();
|
|
272
292
|
return h && o(b, h.prototype), b;
|
|
273
|
-
}(u, arguments,
|
|
293
|
+
}(u, arguments, r(this).constructor);
|
|
274
294
|
}
|
|
275
295
|
return c.prototype = Object.create(u.prototype, { constructor: { value: c, enumerable: !1, writable: !0, configurable: !0 } }), o(c, u);
|
|
276
|
-
},
|
|
296
|
+
}, n(l);
|
|
277
297
|
}
|
|
278
|
-
function
|
|
298
|
+
function i() {
|
|
279
299
|
try {
|
|
280
|
-
var
|
|
300
|
+
var l = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
281
301
|
}));
|
|
282
|
-
} catch (
|
|
302
|
+
} catch (s) {
|
|
283
303
|
}
|
|
284
|
-
return (
|
|
285
|
-
return !!
|
|
304
|
+
return (i = function() {
|
|
305
|
+
return !!l;
|
|
286
306
|
})();
|
|
287
307
|
}
|
|
288
|
-
function o(
|
|
308
|
+
function o(l, s) {
|
|
289
309
|
return o = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(u, c) {
|
|
290
310
|
return u.__proto__ = c, u;
|
|
291
|
-
}, o(
|
|
311
|
+
}, o(l, s);
|
|
292
312
|
}
|
|
293
|
-
function
|
|
294
|
-
return
|
|
295
|
-
return
|
|
296
|
-
},
|
|
313
|
+
function r(l) {
|
|
314
|
+
return r = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(s) {
|
|
315
|
+
return s.__proto__ || Object.getPrototypeOf(s);
|
|
316
|
+
}, r(l);
|
|
297
317
|
}
|
|
298
318
|
t.__esModule = !0, t.default = void 0;
|
|
299
319
|
var e = { 1: `Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).
|
|
@@ -445,43 +465,43 @@ To pass a single animation please supply them in simple values, e.g. animation('
|
|
|
445
465
|
|
|
446
466
|
`, 78: `base must be set in "px" or "%" but you set it in "%s".
|
|
447
467
|
` };
|
|
448
|
-
function
|
|
449
|
-
for (var
|
|
450
|
-
var c, f =
|
|
451
|
-
for (c = 1; c <
|
|
468
|
+
function d() {
|
|
469
|
+
for (var l = arguments.length, s = new Array(l), u = 0; u < l; u++) s[u] = arguments[u];
|
|
470
|
+
var c, f = s[0], g = [];
|
|
471
|
+
for (c = 1; c < s.length; c += 1) g.push(s[c]);
|
|
452
472
|
return g.forEach(function(h) {
|
|
453
473
|
f = f.replace(/%[a-z]/, h);
|
|
454
474
|
}), f;
|
|
455
475
|
}
|
|
456
|
-
t.default = function(
|
|
457
|
-
var
|
|
476
|
+
t.default = function(l) {
|
|
477
|
+
var s, u;
|
|
458
478
|
function c(f) {
|
|
459
479
|
var g;
|
|
460
|
-
if (process.env.NODE_ENV === "production") g =
|
|
480
|
+
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;
|
|
461
481
|
else {
|
|
462
482
|
for (var h = arguments.length, p = new Array(h > 1 ? h - 1 : 0), b = 1; b < h; b++) p[b - 1] = arguments[b];
|
|
463
|
-
g =
|
|
483
|
+
g = l.call(this, d.apply(void 0, [e[f]].concat(p))) || this;
|
|
464
484
|
}
|
|
465
485
|
return function(C) {
|
|
466
486
|
if (C === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
467
487
|
return C;
|
|
468
488
|
}(g);
|
|
469
489
|
}
|
|
470
|
-
return u =
|
|
471
|
-
}(
|
|
472
|
-
})(
|
|
473
|
-
var
|
|
490
|
+
return u = l, (s = c).prototype = Object.create(u.prototype), s.prototype.constructor = s, o(s, u), c;
|
|
491
|
+
}(n(Error)), a.exports = t.default;
|
|
492
|
+
})(U, U.exports);
|
|
493
|
+
var _ = U.exports;
|
|
474
494
|
(function(a, t) {
|
|
475
495
|
t.__esModule = !0, t.default = function(h) {
|
|
476
496
|
if (typeof h != "string") throw new o.default(3);
|
|
477
|
-
var p = (0,
|
|
497
|
+
var p = (0, i.default)(h);
|
|
478
498
|
if (p.match(e)) return { red: parseInt("" + p[1] + p[2], 16), green: parseInt("" + p[3] + p[4], 16), blue: parseInt("" + p[5] + p[6], 16) };
|
|
479
|
-
if (p.match(
|
|
499
|
+
if (p.match(d)) {
|
|
480
500
|
var b = parseFloat((parseInt("" + p[7] + p[8], 16) / 255).toFixed(2));
|
|
481
501
|
return { red: parseInt("" + p[1] + p[2], 16), green: parseInt("" + p[3] + p[4], 16), blue: parseInt("" + p[5] + p[6], 16), alpha: b };
|
|
482
502
|
}
|
|
483
|
-
if (p.match(
|
|
484
|
-
if (p.match(
|
|
503
|
+
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) };
|
|
504
|
+
if (p.match(s)) {
|
|
485
505
|
var C = parseFloat((parseInt("" + p[4] + p[4], 16) / 255).toFixed(2));
|
|
486
506
|
return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16), alpha: C };
|
|
487
507
|
}
|
|
@@ -491,188 +511,188 @@ var k = R.exports;
|
|
|
491
511
|
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]) };
|
|
492
512
|
var A = f.exec(p);
|
|
493
513
|
if (A) {
|
|
494
|
-
var Oe = parseInt("" + A[1], 10), Ie = parseInt("" + A[2], 10) / 100, Me = parseInt("" + A[3], 10) / 100,
|
|
495
|
-
if (!
|
|
496
|
-
return { red: parseInt("" +
|
|
514
|
+
var Oe = parseInt("" + A[1], 10), Ie = parseInt("" + A[2], 10) / 100, Me = parseInt("" + A[3], 10) / 100, ce = "rgb(" + (0, n.default)(Oe, Ie, Me) + ")", B = u.exec(ce);
|
|
515
|
+
if (!B) throw new o.default(4, p, ce);
|
|
516
|
+
return { red: parseInt("" + B[1], 10), green: parseInt("" + B[2], 10), blue: parseInt("" + B[3], 10) };
|
|
497
517
|
}
|
|
498
518
|
var w = g.exec(p.substring(0, 50));
|
|
499
519
|
if (w) {
|
|
500
|
-
var
|
|
501
|
-
if (!
|
|
502
|
-
return { red: parseInt("" +
|
|
520
|
+
var Te = parseInt("" + w[1], 10), Pe = parseInt("" + w[2], 10) / 100, Le = parseInt("" + w[3], 10) / 100, pe = "rgb(" + (0, n.default)(Te, Pe, Le) + ")", O = u.exec(pe);
|
|
521
|
+
if (!O) throw new o.default(4, p, pe);
|
|
522
|
+
return { red: parseInt("" + O[1], 10), green: parseInt("" + O[2], 10), blue: parseInt("" + O[3], 10), alpha: parseFloat("" + w[4]) > 1 ? parseFloat("" + w[4]) / 100 : parseFloat("" + w[4]) };
|
|
503
523
|
}
|
|
504
524
|
throw new o.default(5);
|
|
505
525
|
};
|
|
506
|
-
var
|
|
507
|
-
function
|
|
526
|
+
var n = r(ue), i = r(Ue), o = r(_);
|
|
527
|
+
function r(h) {
|
|
508
528
|
return h && h.__esModule ? h : { default: h };
|
|
509
529
|
}
|
|
510
|
-
var e = /^#[a-fA-F0-9]{6}$/,
|
|
530
|
+
var e = /^#[a-fA-F0-9]{6}$/, d = /^#[a-fA-F0-9]{8}$/, l = /^#[a-fA-F0-9]{3}$/, s = /^#[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;
|
|
511
531
|
a.exports = t.default;
|
|
512
|
-
})(
|
|
513
|
-
var
|
|
532
|
+
})(D, D.exports);
|
|
533
|
+
var fe = D.exports;
|
|
514
534
|
(function(a, t) {
|
|
515
535
|
t.__esModule = !0, t.default = function(o) {
|
|
516
536
|
if (o === "transparent") return 0;
|
|
517
|
-
var
|
|
518
|
-
var c =
|
|
537
|
+
var r = (0, i.default)(o), e = Object.keys(r).map(function(u) {
|
|
538
|
+
var c = r[u] / 255;
|
|
519
539
|
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
520
|
-
}),
|
|
521
|
-
return parseFloat((0.2126 *
|
|
540
|
+
}), d = e[0], l = e[1], s = e[2];
|
|
541
|
+
return parseFloat((0.2126 * d + 0.7152 * l + 0.0722 * s).toFixed(3));
|
|
522
542
|
};
|
|
523
|
-
var
|
|
543
|
+
var n, i = (n = fe) && n.__esModule ? n : { default: n };
|
|
524
544
|
a.exports = t.default;
|
|
525
545
|
})(z, z.exports);
|
|
526
|
-
const Ye =
|
|
546
|
+
const Ye = le(z.exports);
|
|
527
547
|
var Y = { exports: {} }, J = { exports: {} };
|
|
528
548
|
(function(a, t) {
|
|
529
|
-
function
|
|
549
|
+
function n(i, o, r) {
|
|
530
550
|
return function() {
|
|
531
|
-
var e =
|
|
532
|
-
return e.length >= o ?
|
|
551
|
+
var e = r.concat(Array.prototype.slice.call(arguments));
|
|
552
|
+
return e.length >= o ? i.apply(this, e) : n(i, o, e);
|
|
533
553
|
};
|
|
534
554
|
}
|
|
535
|
-
t.__esModule = !0, t.default = function(
|
|
536
|
-
return
|
|
555
|
+
t.__esModule = !0, t.default = function(i) {
|
|
556
|
+
return n(i, i.length, []);
|
|
537
557
|
}, a.exports = t.default;
|
|
538
558
|
})(J, J.exports);
|
|
539
|
-
var
|
|
540
|
-
|
|
541
|
-
return Math.max(a, Math.min(t,
|
|
542
|
-
},
|
|
543
|
-
var
|
|
559
|
+
var be, M, xe = J.exports, G = { exports: {} };
|
|
560
|
+
be = G, (M = G.exports).__esModule = !0, M.default = void 0, M.default = function(a, t, n) {
|
|
561
|
+
return Math.max(a, Math.min(t, n));
|
|
562
|
+
}, be.exports = M.default;
|
|
563
|
+
var Se = G.exports, V = { exports: {} }, Z = { exports: {} };
|
|
544
564
|
(function(a, t) {
|
|
545
|
-
t.__esModule = !0, t.default = void 0, t.default = function(
|
|
546
|
-
var
|
|
547
|
-
if (
|
|
548
|
-
var u =
|
|
549
|
-
switch (
|
|
565
|
+
t.__esModule = !0, t.default = void 0, t.default = function(n) {
|
|
566
|
+
var i, o = n.red / 255, r = n.green / 255, e = n.blue / 255, d = Math.max(o, r, e), l = Math.min(o, r, e), s = (d + l) / 2;
|
|
567
|
+
if (d === l) return n.alpha !== void 0 ? { hue: 0, saturation: 0, lightness: s, alpha: n.alpha } : { hue: 0, saturation: 0, lightness: s };
|
|
568
|
+
var u = d - l, c = s > 0.5 ? u / (2 - d - l) : u / (d + l);
|
|
569
|
+
switch (d) {
|
|
550
570
|
case o:
|
|
551
|
-
|
|
571
|
+
i = (r - e) / u + (r < e ? 6 : 0);
|
|
552
572
|
break;
|
|
553
|
-
case
|
|
554
|
-
|
|
573
|
+
case r:
|
|
574
|
+
i = (e - o) / u + 2;
|
|
555
575
|
break;
|
|
556
576
|
default:
|
|
557
|
-
|
|
577
|
+
i = (o - r) / u + 4;
|
|
558
578
|
}
|
|
559
|
-
return
|
|
579
|
+
return i *= 60, n.alpha !== void 0 ? { hue: i, saturation: c, lightness: s, alpha: n.alpha } : { hue: i, saturation: c, lightness: s };
|
|
560
580
|
}, a.exports = t.default;
|
|
561
|
-
})(
|
|
562
|
-
var Je =
|
|
581
|
+
})(Z, Z.exports);
|
|
582
|
+
var Je = Z.exports;
|
|
563
583
|
(function(a, t) {
|
|
564
|
-
t.__esModule = !0, t.default = function(
|
|
565
|
-
return (0,
|
|
584
|
+
t.__esModule = !0, t.default = function(r) {
|
|
585
|
+
return (0, i.default)((0, n.default)(r));
|
|
566
586
|
};
|
|
567
|
-
var
|
|
568
|
-
function o(
|
|
569
|
-
return
|
|
587
|
+
var n = o(fe), i = o(Je);
|
|
588
|
+
function o(r) {
|
|
589
|
+
return r && r.__esModule ? r : { default: r };
|
|
570
590
|
}
|
|
571
591
|
a.exports = t.default;
|
|
572
|
-
})(
|
|
573
|
-
var
|
|
592
|
+
})(V, V.exports);
|
|
593
|
+
var _e = V.exports, Q = { exports: {} }, X = { exports: {} }, ee = { exports: {} }, te = { exports: {} };
|
|
574
594
|
(function(a, t) {
|
|
575
|
-
t.__esModule = !0, t.default = void 0, t.default = function(
|
|
576
|
-
return
|
|
595
|
+
t.__esModule = !0, t.default = void 0, t.default = function(n) {
|
|
596
|
+
return n.length === 7 && n[1] === n[2] && n[3] === n[4] && n[5] === n[6] ? "#" + n[1] + n[3] + n[5] : n;
|
|
577
597
|
}, a.exports = t.default;
|
|
578
|
-
})(
|
|
579
|
-
var
|
|
598
|
+
})(te, te.exports);
|
|
599
|
+
var ke = te.exports, ne = { exports: {} };
|
|
580
600
|
(function(a, t) {
|
|
581
|
-
t.__esModule = !0, t.default = void 0, t.default = function(
|
|
582
|
-
var
|
|
583
|
-
return
|
|
601
|
+
t.__esModule = !0, t.default = void 0, t.default = function(n) {
|
|
602
|
+
var i = n.toString(16);
|
|
603
|
+
return i.length === 1 ? "0" + i : i;
|
|
584
604
|
}, a.exports = t.default;
|
|
585
|
-
})(
|
|
586
|
-
var
|
|
605
|
+
})(ne, ne.exports);
|
|
606
|
+
var Ce = ne.exports;
|
|
587
607
|
(function(a, t) {
|
|
588
608
|
t.__esModule = !0, t.default = void 0;
|
|
589
|
-
var
|
|
590
|
-
function
|
|
591
|
-
return
|
|
609
|
+
var n = r(ue), i = r(ke), o = r(Ce);
|
|
610
|
+
function r(l) {
|
|
611
|
+
return l && l.__esModule ? l : { default: l };
|
|
592
612
|
}
|
|
593
|
-
function e(
|
|
594
|
-
return (0, o.default)(Math.round(255 *
|
|
613
|
+
function e(l) {
|
|
614
|
+
return (0, o.default)(Math.round(255 * l));
|
|
595
615
|
}
|
|
596
|
-
function
|
|
597
|
-
return (0,
|
|
616
|
+
function d(l, s, u) {
|
|
617
|
+
return (0, i.default)("#" + e(l) + e(s) + e(u));
|
|
598
618
|
}
|
|
599
|
-
t.default = function(
|
|
600
|
-
return (0,
|
|
619
|
+
t.default = function(l, s, u) {
|
|
620
|
+
return (0, n.default)(l, s, u, d);
|
|
601
621
|
}, a.exports = t.default;
|
|
602
|
-
})(
|
|
603
|
-
var
|
|
622
|
+
})(ee, ee.exports);
|
|
623
|
+
var Ee = ee.exports;
|
|
604
624
|
(function(a, t) {
|
|
605
|
-
t.__esModule = !0, t.default = function(
|
|
606
|
-
if (typeof
|
|
607
|
-
if (typeof
|
|
608
|
-
throw new
|
|
625
|
+
t.__esModule = !0, t.default = function(r, e, d) {
|
|
626
|
+
if (typeof r == "number" && typeof e == "number" && typeof d == "number") return (0, n.default)(r, e, d);
|
|
627
|
+
if (typeof r == "object" && e === void 0 && d === void 0) return (0, n.default)(r.hue, r.saturation, r.lightness);
|
|
628
|
+
throw new i.default(1);
|
|
609
629
|
};
|
|
610
|
-
var
|
|
611
|
-
function o(
|
|
612
|
-
return
|
|
630
|
+
var n = o(Ee), i = o(_);
|
|
631
|
+
function o(r) {
|
|
632
|
+
return r && r.__esModule ? r : { default: r };
|
|
613
633
|
}
|
|
614
634
|
a.exports = t.default;
|
|
615
|
-
})(
|
|
616
|
-
var
|
|
635
|
+
})(X, X.exports);
|
|
636
|
+
var Ge = X.exports, re = { exports: {} };
|
|
617
637
|
(function(a, t) {
|
|
618
|
-
t.__esModule = !0, t.default = function(e,
|
|
619
|
-
if (typeof e == "number" && typeof
|
|
620
|
-
if (typeof e == "object" &&
|
|
638
|
+
t.__esModule = !0, t.default = function(e, d, l, s) {
|
|
639
|
+
if (typeof e == "number" && typeof d == "number" && typeof l == "number" && typeof s == "number") return s >= 1 ? (0, n.default)(e, d, l) : "rgba(" + (0, i.default)(e, d, l) + "," + s + ")";
|
|
640
|
+
if (typeof e == "object" && d === void 0 && l === void 0 && s === void 0) return e.alpha >= 1 ? (0, n.default)(e.hue, e.saturation, e.lightness) : "rgba(" + (0, i.default)(e.hue, e.saturation, e.lightness) + "," + e.alpha + ")";
|
|
621
641
|
throw new o.default(2);
|
|
622
642
|
};
|
|
623
|
-
var
|
|
624
|
-
function
|
|
643
|
+
var n = r(Ee), i = r(ue), o = r(_);
|
|
644
|
+
function r(e) {
|
|
625
645
|
return e && e.__esModule ? e : { default: e };
|
|
626
646
|
}
|
|
627
647
|
a.exports = t.default;
|
|
628
|
-
})(
|
|
629
|
-
var
|
|
648
|
+
})(re, re.exports);
|
|
649
|
+
var Ve = re.exports, ae = { exports: {} };
|
|
630
650
|
(function(a, t) {
|
|
631
|
-
t.__esModule = !0, t.default = function(e,
|
|
632
|
-
if (typeof e == "number" && typeof
|
|
633
|
-
if (typeof e == "object" &&
|
|
651
|
+
t.__esModule = !0, t.default = function(e, d, l) {
|
|
652
|
+
if (typeof e == "number" && typeof d == "number" && typeof l == "number") return (0, n.default)("#" + (0, i.default)(e) + (0, i.default)(d) + (0, i.default)(l));
|
|
653
|
+
if (typeof e == "object" && d === void 0 && l === void 0) return (0, n.default)("#" + (0, i.default)(e.red) + (0, i.default)(e.green) + (0, i.default)(e.blue));
|
|
634
654
|
throw new o.default(6);
|
|
635
655
|
};
|
|
636
|
-
var
|
|
637
|
-
function
|
|
656
|
+
var n = r(ke), i = r(Ce), o = r(_);
|
|
657
|
+
function r(e) {
|
|
638
658
|
return e && e.__esModule ? e : { default: e };
|
|
639
659
|
}
|
|
640
660
|
a.exports = t.default;
|
|
641
|
-
})(
|
|
642
|
-
var
|
|
661
|
+
})(ae, ae.exports);
|
|
662
|
+
var Ae = ae.exports, ie = { exports: {} };
|
|
643
663
|
(function(a, t) {
|
|
644
|
-
t.__esModule = !0, t.default = function(e,
|
|
645
|
-
if (typeof e == "string" && typeof
|
|
646
|
-
var u = (0,
|
|
647
|
-
return "rgba(" + u.red + "," + u.green + "," + u.blue + "," +
|
|
664
|
+
t.__esModule = !0, t.default = function(e, d, l, s) {
|
|
665
|
+
if (typeof e == "string" && typeof d == "number") {
|
|
666
|
+
var u = (0, n.default)(e);
|
|
667
|
+
return "rgba(" + u.red + "," + u.green + "," + u.blue + "," + d + ")";
|
|
648
668
|
}
|
|
649
|
-
if (typeof e == "number" && typeof
|
|
650
|
-
if (typeof e == "object" &&
|
|
669
|
+
if (typeof e == "number" && typeof d == "number" && typeof l == "number" && typeof s == "number") return s >= 1 ? (0, i.default)(e, d, l) : "rgba(" + e + "," + d + "," + l + "," + s + ")";
|
|
670
|
+
if (typeof e == "object" && d === void 0 && l === void 0 && s === void 0) return e.alpha >= 1 ? (0, i.default)(e.red, e.green, e.blue) : "rgba(" + e.red + "," + e.green + "," + e.blue + "," + e.alpha + ")";
|
|
651
671
|
throw new o.default(7);
|
|
652
672
|
};
|
|
653
|
-
var
|
|
654
|
-
function
|
|
673
|
+
var n = r(fe), i = r(Ae), o = r(_);
|
|
674
|
+
function r(e) {
|
|
655
675
|
return e && e.__esModule ? e : { default: e };
|
|
656
676
|
}
|
|
657
677
|
a.exports = t.default;
|
|
658
|
-
})(
|
|
659
|
-
var
|
|
678
|
+
})(ie, ie.exports);
|
|
679
|
+
var Ze = ie.exports;
|
|
660
680
|
(function(a, t) {
|
|
661
681
|
t.__esModule = !0, t.default = function(f) {
|
|
662
682
|
if (typeof f != "object") throw new e.default(8);
|
|
663
|
-
if (
|
|
664
|
-
if (
|
|
665
|
-
if (c(f)) return (0,
|
|
666
|
-
if (u(f)) return (0,
|
|
683
|
+
if (s(f)) return (0, r.default)(f);
|
|
684
|
+
if (l(f)) return (0, o.default)(f);
|
|
685
|
+
if (c(f)) return (0, i.default)(f);
|
|
686
|
+
if (u(f)) return (0, n.default)(f);
|
|
667
687
|
throw new e.default(8);
|
|
668
688
|
};
|
|
669
|
-
var
|
|
670
|
-
function
|
|
689
|
+
var n = d(Ge), i = d(Ve), o = d(Ae), r = d(Ze), e = d(_);
|
|
690
|
+
function d(f) {
|
|
671
691
|
return f && f.__esModule ? f : { default: f };
|
|
672
692
|
}
|
|
673
|
-
var
|
|
693
|
+
var l = function(f) {
|
|
674
694
|
return typeof f.red == "number" && typeof f.green == "number" && typeof f.blue == "number" && (typeof f.alpha != "number" || f.alpha === void 0);
|
|
675
|
-
},
|
|
695
|
+
}, s = function(f) {
|
|
676
696
|
return typeof f.red == "number" && typeof f.green == "number" && typeof f.blue == "number" && typeof f.alpha == "number";
|
|
677
697
|
}, u = function(f) {
|
|
678
698
|
return typeof f.hue == "number" && typeof f.saturation == "number" && typeof f.lightness == "number" && (typeof f.alpha != "number" || f.alpha === void 0);
|
|
@@ -680,229 +700,229 @@ var Ve = ae.exports;
|
|
|
680
700
|
return typeof f.hue == "number" && typeof f.saturation == "number" && typeof f.lightness == "number" && typeof f.alpha == "number";
|
|
681
701
|
};
|
|
682
702
|
a.exports = t.default;
|
|
683
|
-
})(
|
|
684
|
-
var
|
|
703
|
+
})(Q, Q.exports);
|
|
704
|
+
var Be = Q.exports;
|
|
685
705
|
(function(a, t) {
|
|
686
706
|
t.__esModule = !0, t.default = void 0;
|
|
687
|
-
var
|
|
688
|
-
function e(
|
|
689
|
-
return
|
|
707
|
+
var n = e(xe), i = e(Se), o = e(_e), r = e(Be);
|
|
708
|
+
function e(s) {
|
|
709
|
+
return s && s.__esModule ? s : { default: s };
|
|
690
710
|
}
|
|
691
|
-
function
|
|
692
|
-
return
|
|
711
|
+
function d() {
|
|
712
|
+
return d = Object.assign ? Object.assign.bind() : function(s) {
|
|
693
713
|
for (var u = 1; u < arguments.length; u++) {
|
|
694
714
|
var c = arguments[u];
|
|
695
|
-
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (
|
|
715
|
+
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (s[f] = c[f]);
|
|
696
716
|
}
|
|
697
|
-
return
|
|
698
|
-
},
|
|
717
|
+
return s;
|
|
718
|
+
}, d.apply(this, arguments);
|
|
699
719
|
}
|
|
700
|
-
var
|
|
720
|
+
var l = (0, n.default)(function(s, u) {
|
|
701
721
|
if (u === "transparent") return u;
|
|
702
722
|
var c = (0, o.default)(u);
|
|
703
|
-
return (0,
|
|
723
|
+
return (0, r.default)(d({}, c, { lightness: (0, i.default)(0, 1, c.lightness - parseFloat(s)) }));
|
|
704
724
|
});
|
|
705
|
-
t.default =
|
|
725
|
+
t.default = l, a.exports = t.default;
|
|
706
726
|
})(Y, Y.exports);
|
|
707
|
-
const
|
|
727
|
+
const Qe = le(Y.exports);
|
|
708
728
|
var oe = { exports: {} };
|
|
709
729
|
(function(a, t) {
|
|
710
730
|
t.__esModule = !0, t.default = void 0;
|
|
711
|
-
var
|
|
712
|
-
function e(
|
|
713
|
-
return
|
|
731
|
+
var n = e(xe), i = e(Se), o = e(_e), r = e(Be);
|
|
732
|
+
function e(s) {
|
|
733
|
+
return s && s.__esModule ? s : { default: s };
|
|
714
734
|
}
|
|
715
|
-
function
|
|
716
|
-
return
|
|
735
|
+
function d() {
|
|
736
|
+
return d = Object.assign ? Object.assign.bind() : function(s) {
|
|
717
737
|
for (var u = 1; u < arguments.length; u++) {
|
|
718
738
|
var c = arguments[u];
|
|
719
|
-
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (
|
|
739
|
+
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (s[f] = c[f]);
|
|
720
740
|
}
|
|
721
|
-
return
|
|
722
|
-
},
|
|
741
|
+
return s;
|
|
742
|
+
}, d.apply(this, arguments);
|
|
723
743
|
}
|
|
724
|
-
var
|
|
744
|
+
var l = (0, n.default)(function(s, u) {
|
|
725
745
|
if (u === "transparent") return u;
|
|
726
746
|
var c = (0, o.default)(u);
|
|
727
|
-
return (0,
|
|
747
|
+
return (0, r.default)(d({}, c, { lightness: (0, i.default)(0, 1, c.lightness + parseFloat(s)) }));
|
|
728
748
|
});
|
|
729
|
-
t.default =
|
|
749
|
+
t.default = l, a.exports = t.default;
|
|
730
750
|
})(oe, oe.exports);
|
|
731
|
-
const
|
|
732
|
-
function
|
|
751
|
+
const Xe = le(oe.exports);
|
|
752
|
+
function et(a) {
|
|
733
753
|
if (!document.querySelector("style[data-widget-styles]")) {
|
|
734
|
-
var t,
|
|
754
|
+
var t, n;
|
|
735
755
|
(function() {
|
|
736
|
-
let
|
|
737
|
-
const
|
|
738
|
-
|
|
739
|
-
const e = Ye(
|
|
740
|
-
|
|
756
|
+
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "#000", o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "FFF";
|
|
757
|
+
const r = document.createElement("style");
|
|
758
|
+
r.attributes.setNamedItem(document.createAttribute("data-widget-styles"));
|
|
759
|
+
const e = Ye(i) > 0.5;
|
|
760
|
+
r.textContent = `
|
|
741
761
|
.bf-trigger-button{position:fixed;bottom:16px;right:16px;width:56px;height:56px;border-radius:50%;border:none;box-shadow:0 20px 25px -5px #1212171a,0 10px 10px -5px #1212170a;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:1000;padding:12px;gap:10px;overflow:hidden}.bf-trigger-button.hidden{display:none}.trigger-button-icon{width:36px;height:36px;position:relative}.trigger-button-icon svg{width:100%;height:100%;position:absolute;inset:0}.trigger-button-icon>svg>path{transition:transform .3s ease,opacity .3s ease;transform:scale(.5);transform-origin:center;opacity:0}.trigger-button-icon svg.visible{display:block}.trigger-button-icon>svg.visible>path{opacity:1;transform:scale(1)}.trigger-iframe{position:relative;width:100%;height:100%;border:none;outline:none;transform:translateZ(0)}.bf-iframe-container{position:fixed;bottom:0;right:0;width:100vw;height:100vh;border:none;overflow:hidden;z-index:999;opacity:0;pointer-events:none;transform:translateY(20px);transition:opacity .3s ease,transform .3s ease,width .2s ease-in-out,height .2s ease-in-out}.bf-iframe-container.open{opacity:1;transform:translateY(0);pointer-events:auto;top:0;left:0}@media (min-width: 576px){.bf-iframe-container{bottom:80px;right:24px;width:448px;height:min(750px,calc(100vh - 80px));border-radius:8px;border:1px solid var(--Dark-300, #D4D4D4);box-shadow:0 20px 25px -5px #1212171a,0 10px 10px -5px #1212170a}.bf-iframe-container.open{top:unset;left:unset}.bf-iframe-container.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}
|
|
742
|
-
.${
|
|
743
|
-
.${
|
|
744
|
-
background: ${e ?
|
|
762
|
+
.${j} { background: ${i}; }
|
|
763
|
+
.${j}:hover {
|
|
764
|
+
background: ${e ? Qe(0.05, i) : Xe(0.05, i)};
|
|
745
765
|
}
|
|
746
766
|
.trigger-button-icon { color: ${o}; }
|
|
747
|
-
`, document.head.appendChild(
|
|
748
|
-
})((a == null || (t = a.theme) === null || t === void 0 ? void 0 : t.inputButtonBgColor) || "#007bff", (a == null || (
|
|
767
|
+
`, document.head.appendChild(r);
|
|
768
|
+
})((a == null || (t = a.theme) === null || t === void 0 ? void 0 : t.inputButtonBgColor) || "#007bff", (a == null || (n = a.theme) === null || n === void 0 ? void 0 : n.textBaseColor) || "#ffffff");
|
|
749
769
|
}
|
|
750
770
|
}
|
|
751
|
-
function
|
|
752
|
-
const
|
|
753
|
-
((
|
|
771
|
+
function tt(a, t) {
|
|
772
|
+
const n = () => {
|
|
773
|
+
((i) => {
|
|
754
774
|
var o;
|
|
755
|
-
(o = a.contentWindow) === null || o === void 0 || o.postMessage({ type: "UPDATE_BODY_CLASS", isDarkMode:
|
|
775
|
+
(o = a.contentWindow) === null || o === void 0 || o.postMessage({ type: "UPDATE_BODY_CLASS", isDarkMode: i }, "*");
|
|
756
776
|
})(document.body.classList.contains("dark"));
|
|
757
777
|
};
|
|
758
|
-
|
|
759
|
-
const
|
|
760
|
-
|
|
778
|
+
n(), (() => {
|
|
779
|
+
const i = new MutationObserver(n);
|
|
780
|
+
i.observe(document.body, { attributes: !0, attributeFilter: ["class"] }), t.addEventListener("abort", () => i.disconnect());
|
|
761
781
|
})();
|
|
762
782
|
}
|
|
763
|
-
function
|
|
764
|
-
let
|
|
765
|
-
const
|
|
766
|
-
((
|
|
783
|
+
function nt(a, t) {
|
|
784
|
+
let n;
|
|
785
|
+
const i = () => {
|
|
786
|
+
((r) => {
|
|
767
787
|
var e;
|
|
768
|
-
const
|
|
769
|
-
(e = a.contentWindow) === null || e === void 0 || e.postMessage(
|
|
770
|
-
})(document.body.clientWidth <=
|
|
788
|
+
const d = { type: "UPDATE_BODY_CLASS", isMobile: r };
|
|
789
|
+
(e = a.contentWindow) === null || e === void 0 || e.postMessage(d, "*"), r && (v.isWidgetOpen ? v.hideTriggerButton() : v.showTriggerButton());
|
|
790
|
+
})(document.body.clientWidth <= L);
|
|
771
791
|
}, o = () => {
|
|
772
|
-
|
|
792
|
+
n && clearTimeout(n), n = window.setTimeout(i, 300);
|
|
773
793
|
};
|
|
774
|
-
|
|
775
|
-
const
|
|
776
|
-
|
|
794
|
+
i(), (() => {
|
|
795
|
+
const r = new ResizeObserver(o);
|
|
796
|
+
r.observe(document.body), t.addEventListener("abort", () => r.disconnect());
|
|
777
797
|
})();
|
|
778
798
|
}
|
|
779
|
-
function
|
|
799
|
+
function ve(a) {
|
|
780
800
|
const t = new TextEncoder().encode(a);
|
|
781
801
|
if (typeof window != "undefined" && typeof window.btoa == "function") {
|
|
782
|
-
const
|
|
783
|
-
return btoa(
|
|
802
|
+
const n = Array.from(t, (i) => String.fromCharCode(i)).join("");
|
|
803
|
+
return btoa(n);
|
|
784
804
|
}
|
|
785
805
|
if (typeof Buffer != "undefined") return Buffer.from(t).toString("base64");
|
|
786
806
|
throw new Error("[utils.base64Encode]: Unsupported environment");
|
|
787
807
|
}
|
|
788
|
-
const
|
|
789
|
-
function
|
|
790
|
-
const
|
|
791
|
-
const
|
|
792
|
-
return
|
|
808
|
+
const ye = /* @__PURE__ */ new Set();
|
|
809
|
+
function rt(a, t, n) {
|
|
810
|
+
const i = document.createDocumentFragment(), o = function(d, l) {
|
|
811
|
+
const s = I("button", j, { id: `trigger-button-${d}`, "aria-controls": P, "aria-expanded": "false", "data-name": j }), u = I("div", "trigger-button-icon", { "aria-hidden": "true" });
|
|
812
|
+
return u.innerHTML = `
|
|
793
813
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">
|
|
794
814
|
<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>
|
|
795
815
|
</svg>
|
|
796
816
|
<svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">
|
|
797
817
|
<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"/>
|
|
798
818
|
</svg>
|
|
799
|
-
`,
|
|
800
|
-
}(a), { iframeContainer:
|
|
801
|
-
const
|
|
802
|
-
return
|
|
819
|
+
`, s.setAttribute("aria-label", "Open Brainfish widget"), s.appendChild(u), v.initialize(s, u, l), s;
|
|
820
|
+
}(a, n), { iframeContainer: r, iframe: e } = function(d) {
|
|
821
|
+
const l = I("div", P, { id: P, "aria-live": "polite", "aria-hidden": "true" }), s = I("iframe", "trigger-iframe", { src: d, sandbox: "allow-scripts allow-same-origin allow-popups allow-forms", allow: "clipboard-write", role: "dialog" });
|
|
822
|
+
return l.appendChild(s), { iframeContainer: l, iframe: s };
|
|
803
823
|
}(t);
|
|
804
|
-
return
|
|
824
|
+
return i.appendChild(o), i.appendChild(r), { fragment: i, iframe: e };
|
|
805
825
|
}
|
|
806
|
-
const
|
|
807
|
-
const
|
|
826
|
+
const at = (a, t) => {
|
|
827
|
+
const n = de(a.overrides), i = ((o = a.overrides) == null ? void 0 : o.widgetHost) || "https://agent.brainfi.sh";
|
|
808
828
|
var o;
|
|
809
|
-
const { theme:
|
|
829
|
+
const { theme: r, settings: e } = t, d = `${i}/?widgetKey=${a.widgetKey}&themeParam=${ve(JSON.stringify(r))}&settingsParam=${ve(JSON.stringify(e))}`, l = e == null ? void 0 : e.hideTriggerButton;
|
|
810
830
|
try {
|
|
811
|
-
if (s = a.widgetKey,
|
|
812
|
-
return !!document.getElementById(`trigger-button-${
|
|
831
|
+
if (s = a.widgetKey, ye.has(s) || function(p) {
|
|
832
|
+
return !!document.getElementById(`trigger-button-${p}`);
|
|
813
833
|
}(a.widgetKey)) return;
|
|
814
|
-
|
|
815
|
-
const { fragment:
|
|
816
|
-
|
|
834
|
+
et(t);
|
|
835
|
+
const { fragment: u, iframe: c } = rt(a.widgetKey, d, l || !1), f = new AbortController(), { signal: g } = f;
|
|
836
|
+
c.onload = () => {
|
|
817
837
|
setTimeout(() => {
|
|
818
|
-
|
|
838
|
+
tt(c, g), Re({ widgetHost: i, apiHost: n, widgetKey: a.widgetKey, signal: g }), nt(c, g);
|
|
819
839
|
}, 0);
|
|
820
|
-
}, document.body.appendChild(
|
|
821
|
-
const
|
|
822
|
-
|
|
840
|
+
}, document.body.appendChild(u), ye.add(a.widgetKey);
|
|
841
|
+
const h = () => {
|
|
842
|
+
f.abort(), window.removeEventListener("beforeunload", h);
|
|
823
843
|
};
|
|
824
|
-
return void window.addEventListener("beforeunload",
|
|
825
|
-
} catch (
|
|
826
|
-
(function(
|
|
827
|
-
x(
|
|
828
|
-
})(
|
|
844
|
+
return void window.addEventListener("beforeunload", h);
|
|
845
|
+
} catch (u) {
|
|
846
|
+
(function(c, f, g) {
|
|
847
|
+
x(c, f, f.message, g);
|
|
848
|
+
})(n, u, a.widgetKey);
|
|
829
849
|
}
|
|
830
850
|
var s;
|
|
831
851
|
};
|
|
832
|
-
let
|
|
833
|
-
const
|
|
852
|
+
let T = null;
|
|
853
|
+
const we = typeof window != "undefined" && window.Brainfish ? window.Brainfish : (T || (T = /* @__PURE__ */ function() {
|
|
834
854
|
let a = [], t = null;
|
|
835
|
-
function
|
|
855
|
+
function n(o, r) {
|
|
836
856
|
if (t) {
|
|
837
857
|
const e = o.split(".");
|
|
838
|
-
let
|
|
839
|
-
for (let
|
|
840
|
-
const
|
|
841
|
-
if (typeof
|
|
842
|
-
} else a.push([o,
|
|
858
|
+
let d = t;
|
|
859
|
+
for (let s = 0; s < e.length - 1; s++) d = d[e[s]];
|
|
860
|
+
const l = d[e[e.length - 1]];
|
|
861
|
+
if (typeof l == "function") return l.apply(d, r);
|
|
862
|
+
} else a.push([o, r]);
|
|
843
863
|
}
|
|
844
864
|
return { Widgets: { init: function() {
|
|
845
|
-
for (var o = arguments.length,
|
|
846
|
-
return
|
|
865
|
+
for (var o = arguments.length, r = new Array(o), e = 0; e < o; e++) r[e] = arguments[e];
|
|
866
|
+
return n("Widgets.init", r);
|
|
847
867
|
} }, SearchWidget: { initStandard: function() {
|
|
848
|
-
for (var o = arguments.length,
|
|
849
|
-
return
|
|
868
|
+
for (var o = arguments.length, r = new Array(o), e = 0; e < o; e++) r[e] = arguments[e];
|
|
869
|
+
return n("SearchWidget.initStandard", r);
|
|
850
870
|
} }, HelpWidget: { initPopup: function() {
|
|
851
|
-
for (var o = arguments.length,
|
|
852
|
-
return
|
|
871
|
+
for (var o = arguments.length, r = new Array(o), e = 0; e < o; e++) r[e] = arguments[e];
|
|
872
|
+
return n("HelpWidget.initPopup", r);
|
|
853
873
|
}, close: function() {
|
|
854
|
-
for (var o = arguments.length,
|
|
855
|
-
return
|
|
874
|
+
for (var o = arguments.length, r = new Array(o), e = 0; e < o; e++) r[e] = arguments[e];
|
|
875
|
+
return n("HelpWidget.close", r);
|
|
856
876
|
}, open: function() {
|
|
857
|
-
for (var o = arguments.length,
|
|
858
|
-
return
|
|
877
|
+
for (var o = arguments.length, r = new Array(o), e = 0; e < o; e++) r[e] = arguments[e];
|
|
878
|
+
return n("HelpWidget.open", r);
|
|
859
879
|
}, toggle: function() {
|
|
860
|
-
for (var o = arguments.length,
|
|
861
|
-
return
|
|
880
|
+
for (var o = arguments.length, r = new Array(o), e = 0; e < o; e++) r[e] = arguments[e];
|
|
881
|
+
return n("HelpWidget.toggle", r);
|
|
862
882
|
} }, _setRealBrainfish: function(o) {
|
|
863
883
|
for (t = o; a.length > 0; ) {
|
|
864
|
-
const [
|
|
865
|
-
r
|
|
884
|
+
const [r, e] = a.shift();
|
|
885
|
+
n(r, e);
|
|
866
886
|
}
|
|
867
887
|
} };
|
|
868
|
-
}(), typeof window != "undefined" && (window.Brainfish =
|
|
869
|
-
let
|
|
870
|
-
|
|
888
|
+
}(), typeof window != "undefined" && (window.Brainfish = T)), T);
|
|
889
|
+
let K = null;
|
|
890
|
+
we.Widgets.init = (a) => m(void 0, null, function* () {
|
|
871
891
|
window && (window.BrainfishAnalytics = window.BrainfishAnalytics || function() {
|
|
872
|
-
for (var
|
|
892
|
+
for (var r = arguments.length, e = new Array(r), d = 0; d < r; d++) e[d] = arguments[d];
|
|
873
893
|
(window.BrainfishAnalytics.q = window.BrainfishAnalytics.q || []).push(e);
|
|
874
894
|
});
|
|
875
|
-
const t =
|
|
876
|
-
var
|
|
895
|
+
const t = de(a.overrides), n = ((i = a.overrides) == null ? void 0 : i.analyticsApiHost) || "";
|
|
896
|
+
var i;
|
|
877
897
|
let o;
|
|
878
|
-
if (a.config) o = JSON.parse(((
|
|
898
|
+
if (a.config) o = JSON.parse(((r) => {
|
|
879
899
|
if (typeof window != "undefined" && typeof window.atob == "function") {
|
|
880
|
-
const e = atob(
|
|
881
|
-
for (let
|
|
882
|
-
return new TextDecoder().decode(
|
|
900
|
+
const e = atob(r), d = e.length, l = new Uint8Array(d);
|
|
901
|
+
for (let s = 0; s < d; s++) l[s] = e.charCodeAt(s);
|
|
902
|
+
return new TextDecoder().decode(l);
|
|
883
903
|
}
|
|
884
|
-
if (typeof Buffer != "undefined") return Buffer.from(
|
|
904
|
+
if (typeof Buffer != "undefined") return Buffer.from(r, "base64").toString("utf-8");
|
|
885
905
|
throw new Error("[utils.base64Decode]: Unsupported environment");
|
|
886
906
|
})(a.config));
|
|
887
907
|
else {
|
|
888
|
-
const { config:
|
|
889
|
-
o =
|
|
908
|
+
const { config: r } = yield Ke({ widgetKey: a.widgetKey, apiHost: t });
|
|
909
|
+
o = r;
|
|
890
910
|
}
|
|
891
|
-
|
|
911
|
+
K || (K = function(r, e, d, l) {
|
|
892
912
|
return m(this, null, function* () {
|
|
893
|
-
var
|
|
894
|
-
const f = ((
|
|
895
|
-
g != null && g.startsWith("2.") ?
|
|
913
|
+
var s, u, c;
|
|
914
|
+
const f = ((s = r.overrides) === null || s === void 0 ? void 0 : s.enableRecording) || (e == null || (u = e.settings) === null || u === void 0 ? void 0 : u.enableRecording) || !1, g = ((c = r.overrides) === null || c === void 0 ? void 0 : c.version) || (e == null ? void 0 : e.version), h = [];
|
|
915
|
+
g != null && g.startsWith("2.") ? at(r, e) : h.push(De(r, e)), h.push(Ne(r.widgetKey, e.trackingToken || "", d, l, f));
|
|
896
916
|
const [p] = yield Promise.allSettled(h);
|
|
897
|
-
p && p.status === "fulfilled" && p.value &&
|
|
917
|
+
p && p.status === "fulfilled" && p.value && we._setRealBrainfish(p.value);
|
|
898
918
|
});
|
|
899
|
-
}(a, o, t,
|
|
919
|
+
}(a, o, t, n)), yield K;
|
|
900
920
|
});
|
|
901
921
|
const ot = function() {
|
|
902
922
|
typeof window != "undefined" && window.BrainfishAnalytics && window.BrainfishAnalytics(...arguments);
|
|
903
923
|
};
|
|
904
924
|
export {
|
|
905
925
|
ot as BrainfishAnalytics,
|
|
906
|
-
|
|
926
|
+
we as default
|
|
907
927
|
};
|
|
908
928
|
//# sourceMappingURL=web.js.map
|