@brainfish-ai/widgets-initiator 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/web.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Te = Object.defineProperty, Fe = Object.defineProperties;
|
|
2
2
|
var Le = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var pe = Object.getOwnPropertySymbols;
|
|
4
|
-
var $e = Object.prototype.hasOwnProperty,
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
$e.call(t,
|
|
4
|
+
var $e = Object.prototype.hasOwnProperty, Ke = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var F = (a, t, r) => t in a ? Te(a, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[t] = r, L = (a, t) => {
|
|
6
|
+
for (var r in t || (t = {}))
|
|
7
|
+
$e.call(t, r) && F(a, r, t[r]);
|
|
8
8
|
if (pe)
|
|
9
|
-
for (var
|
|
10
|
-
|
|
9
|
+
for (var r of pe(t))
|
|
10
|
+
Ke.call(t, r) && F(a, r, t[r]);
|
|
11
11
|
return a;
|
|
12
|
-
}, $ = (a, t) =>
|
|
13
|
-
var
|
|
14
|
-
var m = (a, t,
|
|
15
|
-
var
|
|
12
|
+
}, $ = (a, t) => Fe(a, Le(t));
|
|
13
|
+
var S = (a, t, r) => F(a, typeof t != "symbol" ? t + "" : t, r);
|
|
14
|
+
var m = (a, t, r) => new Promise((d, o) => {
|
|
15
|
+
var n = (s) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
o(
|
|
17
|
+
i(r.next(s));
|
|
18
|
+
} catch (l) {
|
|
19
|
+
o(l);
|
|
20
20
|
}
|
|
21
21
|
}, e = (s) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
o(
|
|
23
|
+
i(r.throw(s));
|
|
24
|
+
} catch (l) {
|
|
25
|
+
o(l);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, i = (s) => s.done ? d(s.value) : Promise.resolve(s.value).then(n, e);
|
|
28
|
+
i((r = r.apply(a, t)).next());
|
|
29
29
|
});
|
|
30
|
-
var _,
|
|
30
|
+
var _, H;
|
|
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] = "6fbe27fe-8181-435f-9330-4e9fec48bb6a", a._sentryDebugIdIdentifier = "sentry-dbid-6fbe27fe-8181-435f-9330-4e9fec48bb6a");
|
|
35
|
+
} catch (r) {
|
|
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: "e4d978c3b1cd863f6b5fc1b2b532cb51a3d1ad81" }, function(a) {
|
|
38
38
|
a.Sidebar = "sidebar", a.Searchbar = "searchbar";
|
|
39
39
|
}(_ || (_ = {})), _.Sidebar, _.Searchbar;
|
|
40
40
|
class ie extends Error {
|
|
41
|
-
constructor(
|
|
42
|
-
super(
|
|
43
|
-
|
|
44
|
-
this.name = "BrainfishWidgetError", this.cause =
|
|
41
|
+
constructor(r, d) {
|
|
42
|
+
super(r, d);
|
|
43
|
+
S(this, "cause");
|
|
44
|
+
this.name = "BrainfishWidgetError", this.cause = d == null ? void 0 : d.cause, Error.captureStackTrace && Error.captureStackTrace(this, ie), 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,136 @@ 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
|
+
})(H || (H = {}));
|
|
54
|
+
const x = (a, t, r, d) => {
|
|
55
|
+
let o = r, n = {};
|
|
56
56
|
if (t instanceof Error) try {
|
|
57
|
-
|
|
57
|
+
n = JSON.parse(t.message), o += ` - ${n.message || t.message}`;
|
|
58
58
|
} catch (e) {
|
|
59
59
|
o += ` - ${t.message}`;
|
|
60
60
|
}
|
|
61
61
|
else o += ` - ${String(t)}`;
|
|
62
|
-
((e,
|
|
62
|
+
((e, i, s) => {
|
|
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": s }, body: JSON.stringify({ error: `WebWidgetVersion: 1.6.
|
|
66
|
-
})(a, new ie(o, { cause:
|
|
67
|
-
},
|
|
68
|
-
let { widgetKey: t, apiHost:
|
|
69
|
-
return function(
|
|
64
|
+
const l = i.toJSON();
|
|
65
|
+
fetch(`${e || "https://app.brainfi.sh"}/api/trackError.widget.create`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": s }, body: JSON.stringify({ error: `WebWidgetVersion: 1.6.1. ${i.message}`, stack: i.stack, cause: { message: l.message, stack: l.stack, cause: l.cause } }) });
|
|
66
|
+
})(a, new ie(o, { cause: n }), d);
|
|
67
|
+
}, We = (a) => m(void 0, null, function* () {
|
|
68
|
+
let { widgetKey: t, apiHost: r } = a;
|
|
69
|
+
return function(d, o, n) {
|
|
70
70
|
return m(this, null, function* () {
|
|
71
|
-
let e,
|
|
72
|
-
for (;
|
|
73
|
-
const s = yield fetch(`${
|
|
71
|
+
let e, i = 0;
|
|
72
|
+
for (; i < 3; ) try {
|
|
73
|
+
const s = yield fetch(`${d}${o}`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": n } });
|
|
74
74
|
if (!s.ok) throw new Error(`API call failed with status: ${s.status}`);
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
77
|
-
return
|
|
75
|
+
const l = yield s.json();
|
|
76
|
+
if (!l) throw new Error("Error loading config: empty response");
|
|
77
|
+
return l;
|
|
78
78
|
} catch (s) {
|
|
79
|
-
if (e = s,
|
|
80
|
-
yield new Promise((
|
|
79
|
+
if (e = s, i++, i >= 3) throw x(d, s, "Error fetching config", n), e;
|
|
80
|
+
yield new Promise((l) => setTimeout(l, 500));
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
-
}(
|
|
84
|
-
}),
|
|
85
|
-
let { config: t, apiKey:
|
|
83
|
+
}(r, "/api/searchWidgets.getConfigByKey", t);
|
|
84
|
+
}), He = (a) => {
|
|
85
|
+
let { config: t, apiKey: r, apiHost: d } = a;
|
|
86
86
|
const o = t.settings || {};
|
|
87
|
-
return ["bodyActionButtons", "footerActionButtons", "nextBestActions"].forEach((
|
|
88
|
-
o[
|
|
89
|
-
}), $(L({}, t), { settings: o, apiHost:
|
|
90
|
-
}, se = (a) => (a == null ? void 0 : a.apiHost) || "https://app.brainfi.sh",
|
|
87
|
+
return ["bodyActionButtons", "footerActionButtons", "nextBestActions"].forEach((n) => {
|
|
88
|
+
o[n] && (o[n] = o[n].map((e) => e.type === H.CALLBACK && e.value ? $(L({}, e), { value: new Function(`return ${e.value}`)() }) : e));
|
|
89
|
+
}), $(L({}, t), { settings: o, apiHost: d, widgetMode: t.widgetType, apiKey: r });
|
|
90
|
+
}, se = (a) => (a == null ? void 0 : a.apiHost) || "https://app.brainfi.sh", K = (() => {
|
|
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
|
-
})(),
|
|
97
|
-
let { apiHost: t, widgetKey:
|
|
96
|
+
})(), ze = (a) => m(void 0, null, function* () {
|
|
97
|
+
let { apiHost: t, widgetKey: r, version: d } = 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((s,
|
|
102
|
-
const
|
|
103
|
-
|
|
99
|
+
const o = `https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${d}/dist/web.js`, n = K ? o.replace("web.js", "web.umd.js") : o;
|
|
100
|
+
return { widget: yield ((i) => m(void 0, null, function* () {
|
|
101
|
+
return document.getElementById("brainfish-widget") ? window.Brainfish : new Promise((s, l) => {
|
|
102
|
+
const u = document.createElement("script");
|
|
103
|
+
u.id = "brainfish-widget", u.src = i, u.type = K ? "text/javascript" : "module", u.async = !0, u.crossOrigin = "anonymous", u.onload = () => {
|
|
104
104
|
setTimeout(() => {
|
|
105
105
|
const c = window.Brainfish;
|
|
106
|
-
c ? s(c) :
|
|
106
|
+
c ? s(c) : l(new Error("Failed to load Brainfish module"));
|
|
107
107
|
}, 200);
|
|
108
|
-
},
|
|
109
|
-
const f = c,
|
|
110
|
-
|
|
111
|
-
},
|
|
108
|
+
}, u.onerror = (c) => {
|
|
109
|
+
const f = c, g = { message: `Failed to load script: ${i}`, type: f.type, fileName: f.filename, lineNumber: f.lineno, columnNumber: f.colno, error: f.error ? f.error.toString() : "Unknown error" };
|
|
110
|
+
l(new Error(JSON.stringify(g)));
|
|
111
|
+
}, K || document.head.appendChild(u);
|
|
112
112
|
});
|
|
113
|
-
}))(
|
|
113
|
+
}))(n) };
|
|
114
114
|
} catch (o) {
|
|
115
|
-
x(t, o, o.message,
|
|
115
|
+
x(t, o, o.message, r);
|
|
116
116
|
}
|
|
117
|
-
}), ge = /* @__PURE__ */ new Set(),
|
|
118
|
-
const
|
|
117
|
+
}), ge = /* @__PURE__ */ new Set(), Ne = (a, t) => m(void 0, null, function* () {
|
|
118
|
+
const r = se(a.overrides);
|
|
119
119
|
try {
|
|
120
120
|
if (ge.has(a.widgetKey)) return;
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
const { widget: o } =
|
|
121
|
+
const d = yield ze({ apiHost: r, widgetKey: a.widgetKey, version: t.version || "latest" });
|
|
122
|
+
if (d) {
|
|
123
|
+
const { widget: o } = d, n = He({ config: t, apiKey: a.widgetKey, apiHost: r });
|
|
124
124
|
return a.overrides && t.settings && Object.entries(a.overrides).forEach((e) => {
|
|
125
|
-
let [
|
|
126
|
-
t.settings &&
|
|
127
|
-
let
|
|
128
|
-
const
|
|
129
|
-
return
|
|
130
|
-
}(t.settings[
|
|
131
|
-
}), function(e,
|
|
132
|
-
|
|
133
|
-
}(o,
|
|
125
|
+
let [i, s] = e;
|
|
126
|
+
t.settings && i in t.settings && (t.settings[i] = function() {
|
|
127
|
+
let l = arguments.length > 1 ? arguments[1] : void 0;
|
|
128
|
+
const u = new Map((arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).map((c) => [c.label, c]));
|
|
129
|
+
return l.forEach((c) => u.set(c.label, c)), Array.from(u.values());
|
|
130
|
+
}(t.settings[i], s));
|
|
131
|
+
}), function(e, i) {
|
|
132
|
+
i.widgetType === _.Searchbar || i.widgetType === "Search" ? e.SearchWidget.initStandard(i) : e.HelpWidget.initPopup(i);
|
|
133
|
+
}(o, n), ge.add(a.widgetKey), o;
|
|
134
134
|
}
|
|
135
|
-
} catch (
|
|
136
|
-
x(
|
|
135
|
+
} catch (d) {
|
|
136
|
+
x(r, d, d.message, a.widgetKey);
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
139
|
let he = !1;
|
|
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(
|
|
140
|
+
const qe = function(d, o, n) {
|
|
141
|
+
return m(this, arguments, function* (a, t, r) {
|
|
142
|
+
let e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "", i = arguments.length > 4 && arguments[4] !== void 0 && arguments[4];
|
|
143
|
+
if (t || x(r, new Error("Access key is required"), "Access key is required", a), !he) try {
|
|
144
144
|
const s = (() => {
|
|
145
145
|
if (typeof window == "undefined" || typeof navigator == "undefined") return !1;
|
|
146
|
-
const
|
|
146
|
+
const l = navigator, u = window, c = (l.doNotTrack || u.doNotTrack || l.msDoNotTrack || "0").toString().toLowerCase();
|
|
147
147
|
return ["1", "yes", "true"].includes(c);
|
|
148
148
|
})();
|
|
149
|
-
window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !s, trackAttributes: !s, trackOutgoingLinks: !s, enableRecording: !s &&
|
|
149
|
+
window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !s, trackAttributes: !s, trackOutgoingLinks: !s, enableRecording: !s && i }), he = !0, yield ((l, 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(l, new Error(`Failed to load script: ${c.src}`), `Failed to load script: ${c.src}`, u);
|
|
154
154
|
}, document.head.appendChild(c);
|
|
155
|
-
}))(
|
|
155
|
+
}))(r, a);
|
|
156
156
|
} catch (s) {
|
|
157
|
-
x(
|
|
157
|
+
x(r, s, "Failed to initialize BrainfishAnalytics", a);
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
160
|
};
|
|
161
161
|
function M(a, t) {
|
|
162
|
-
let
|
|
163
|
-
const
|
|
164
|
-
return
|
|
165
|
-
let [
|
|
166
|
-
|
|
167
|
-
}),
|
|
162
|
+
let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
163
|
+
const d = document.createElement(a);
|
|
164
|
+
return d.className = t, Object.entries(r).forEach((o) => {
|
|
165
|
+
let [n, e] = o;
|
|
166
|
+
d.setAttribute(n, e);
|
|
167
|
+
}), d;
|
|
168
168
|
}
|
|
169
|
-
const j = "bf-iframe-container",
|
|
169
|
+
const j = "bf-iframe-container", T = "bf-trigger-button";
|
|
170
170
|
class v {
|
|
171
171
|
static get isWidgetOpen() {
|
|
172
172
|
return this.isOpen;
|
|
173
173
|
}
|
|
174
|
-
static initialize(t,
|
|
175
|
-
this.button = t, this.icon =
|
|
174
|
+
static initialize(t, r) {
|
|
175
|
+
this.button = t, this.icon = r, t.addEventListener("click", () => this.toggleIframeVisibility());
|
|
176
176
|
}
|
|
177
177
|
static toggleIframeVisibility() {
|
|
178
178
|
if (!this.button || !this.icon) return;
|
|
179
179
|
this.isOpen = !this.isOpen;
|
|
180
|
-
const t = this.icon.querySelector(".fish-icon"),
|
|
181
|
-
var
|
|
182
|
-
this.isOpen ? (
|
|
180
|
+
const t = this.icon.querySelector(".fish-icon"), r = this.icon.querySelector(".close-icon"), d = document.querySelector(".bf-iframe-container"), o = d == null ? void 0 : d.querySelector("iframe");
|
|
181
|
+
var n;
|
|
182
|
+
this.isOpen ? (d == null || d.classList.add("open"), d == null || d.setAttribute("aria-hidden", "false"), this.button.setAttribute("aria-expanded", "true"), t.classList.remove("visible"), r.classList.add("visible"), o == null || (n = o.contentWindow) === null || n === void 0 || n.postMessage({ type: "FOCUS_SEARCH_FIELD" }, "*"), window.BrainfishAnalytics("track", "Open Widget"), document.body.clientWidth <= 576 && this.hideTriggerButton()) : (d == null || d.classList.remove("open"), d == null || d.setAttribute("aria-hidden", "true"), this.button.setAttribute("aria-expanded", "false"), r.classList.remove("visible"), t.classList.add("visible"), this.showTriggerButton(), window.BrainfishAnalytics("track", "Close Widget"));
|
|
183
183
|
}
|
|
184
184
|
static showTriggerButton() {
|
|
185
185
|
var t;
|
|
@@ -190,99 +190,110 @@ class v {
|
|
|
190
190
|
(t = this.button) === null || t === void 0 || t.classList.add("hidden");
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
|
|
194
|
-
function
|
|
193
|
+
S(v, "isOpen", !1), S(v, "button", null), S(v, "icon", null);
|
|
194
|
+
function De(a) {
|
|
195
|
+
let { widgetHost: t, apiHost: r, widgetKey: d, signal: o } = a;
|
|
195
196
|
window.addEventListener("message", (n) => {
|
|
196
|
-
if (n.origin !==
|
|
197
|
-
const { type:
|
|
198
|
-
if (
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
}(),
|
|
197
|
+
if (n.origin !== t) return;
|
|
198
|
+
const { type: e } = n.data;
|
|
199
|
+
if (e === "TOGGLE_WIDGET_SIZE" && function() {
|
|
200
|
+
const i = document.querySelector(`.${j}`);
|
|
201
|
+
i.classList.contains("expanded") ? i.classList.remove("expanded") : i.classList.add("expanded");
|
|
202
|
+
}(), e === "TRACK_EVENT") {
|
|
202
203
|
if (!window.BrainfishAnalytics) return;
|
|
203
|
-
const { eventName:
|
|
204
|
-
window.BrainfishAnalytics("track",
|
|
204
|
+
const { eventName: i, data: s } = n.data;
|
|
205
|
+
window.BrainfishAnalytics("track", i, s);
|
|
205
206
|
}
|
|
206
|
-
|
|
207
|
-
|
|
207
|
+
if (e === "CLOSE_WIDGET" && (window.BrainfishAnalytics("track", "Close Widget"), v.toggleIframeVisibility()), e === "NEXT_BEST_ACTION_CLICKED") {
|
|
208
|
+
const { action: i, searchQueryId: s, query: l, answer: u } = n.data, c = { action: i, searchQueryId: s };
|
|
209
|
+
if (!["function", "callback"].includes(i.type)) return void console.error("Invalid action type", i);
|
|
210
|
+
if (window.__bfCallbacks = window.__bfCallbacks || {}, window.__bfCallbacks[i.id]) return void window.__bfCallbacks[i.id](l, u, c);
|
|
211
|
+
const f = `${r}/api/searchWidgets.callback.codeblocks?apiKey=${d}&codeblockId=${i.id}`, g = document.createElement("script");
|
|
212
|
+
g.src = f, document.head.appendChild(g), g.onload = () => {
|
|
213
|
+
window.__bfCallbacks[i.id](l, u, c), setTimeout(() => {
|
|
214
|
+
document.head.removeChild(g);
|
|
215
|
+
}, 300);
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
}, { signal: o });
|
|
208
219
|
}
|
|
209
|
-
function
|
|
220
|
+
function de(a) {
|
|
210
221
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
211
222
|
}
|
|
212
|
-
var
|
|
223
|
+
var z = { exports: {} }, N = { exports: {} }, q = { exports: {} };
|
|
213
224
|
(function(a, t) {
|
|
214
|
-
function
|
|
225
|
+
function r(o) {
|
|
215
226
|
return Math.round(255 * o);
|
|
216
227
|
}
|
|
217
|
-
function
|
|
218
|
-
return
|
|
228
|
+
function d(o, n, e) {
|
|
229
|
+
return r(o) + "," + r(n) + "," + r(e);
|
|
219
230
|
}
|
|
220
|
-
t.__esModule = !0, t.default = void 0, t.default = function(o,
|
|
221
|
-
if (
|
|
222
|
-
var s = (o % 360 + 360) % 360 / 60,
|
|
223
|
-
s >= 0 && s < 1 ? (c =
|
|
224
|
-
var
|
|
225
|
-
return
|
|
231
|
+
t.__esModule = !0, t.default = void 0, t.default = function(o, n, e, i) {
|
|
232
|
+
if (i === void 0 && (i = d), n === 0) return i(e, e, e);
|
|
233
|
+
var s = (o % 360 + 360) % 360 / 60, l = (1 - Math.abs(2 * e - 1)) * n, u = l * (1 - Math.abs(s % 2 - 1)), c = 0, f = 0, g = 0;
|
|
234
|
+
s >= 0 && s < 1 ? (c = l, f = u) : s >= 1 && s < 2 ? (c = u, f = l) : s >= 2 && s < 3 ? (f = l, g = u) : s >= 3 && s < 4 ? (f = u, g = l) : s >= 4 && s < 5 ? (c = u, g = l) : s >= 5 && s < 6 && (c = l, g = u);
|
|
235
|
+
var h = e - l / 2;
|
|
236
|
+
return i(c + h, f + h, g + h);
|
|
226
237
|
}, a.exports = t.default;
|
|
227
|
-
})(
|
|
228
|
-
var le =
|
|
238
|
+
})(q, q.exports);
|
|
239
|
+
var le = q.exports, D = { exports: {} };
|
|
229
240
|
(function(a, t) {
|
|
230
241
|
t.__esModule = !0, t.default = void 0;
|
|
231
|
-
var
|
|
232
|
-
t.default = function(
|
|
233
|
-
if (typeof
|
|
234
|
-
var o =
|
|
235
|
-
return
|
|
242
|
+
var r = { 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" };
|
|
243
|
+
t.default = function(d) {
|
|
244
|
+
if (typeof d != "string") return d;
|
|
245
|
+
var o = d.toLowerCase();
|
|
246
|
+
return r[o] ? "#" + r[o] : d;
|
|
236
247
|
}, a.exports = t.default;
|
|
237
|
-
})(
|
|
238
|
-
var Re =
|
|
248
|
+
})(D, D.exports);
|
|
249
|
+
var Re = D.exports, R = { exports: {} };
|
|
239
250
|
(function(a, t) {
|
|
240
|
-
function
|
|
241
|
-
var
|
|
242
|
-
return
|
|
243
|
-
if (
|
|
251
|
+
function r(s) {
|
|
252
|
+
var l = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
253
|
+
return r = function(u) {
|
|
254
|
+
if (u === null || !function(f) {
|
|
244
255
|
try {
|
|
245
256
|
return Function.toString.call(f).indexOf("[native code]") !== -1;
|
|
246
|
-
} catch (
|
|
257
|
+
} catch (g) {
|
|
247
258
|
return typeof f == "function";
|
|
248
259
|
}
|
|
249
|
-
}(
|
|
250
|
-
if (typeof
|
|
251
|
-
if (
|
|
252
|
-
if (
|
|
253
|
-
|
|
260
|
+
}(u)) return u;
|
|
261
|
+
if (typeof u != "function") throw new TypeError("Super expression must either be null or a function");
|
|
262
|
+
if (l !== void 0) {
|
|
263
|
+
if (l.has(u)) return l.get(u);
|
|
264
|
+
l.set(u, c);
|
|
254
265
|
}
|
|
255
266
|
function c() {
|
|
256
|
-
return function(f,
|
|
257
|
-
if (
|
|
267
|
+
return function(f, g, h) {
|
|
268
|
+
if (d()) return Reflect.construct.apply(null, arguments);
|
|
258
269
|
var p = [null];
|
|
259
|
-
p.push.apply(p,
|
|
270
|
+
p.push.apply(p, g);
|
|
260
271
|
var b = new (f.bind.apply(f, p))();
|
|
261
|
-
return
|
|
262
|
-
}(
|
|
272
|
+
return h && o(b, h.prototype), b;
|
|
273
|
+
}(u, arguments, n(this).constructor);
|
|
263
274
|
}
|
|
264
|
-
return c.prototype = Object.create(
|
|
265
|
-
},
|
|
275
|
+
return c.prototype = Object.create(u.prototype, { constructor: { value: c, enumerable: !1, writable: !0, configurable: !0 } }), o(c, u);
|
|
276
|
+
}, r(s);
|
|
266
277
|
}
|
|
267
|
-
function
|
|
278
|
+
function d() {
|
|
268
279
|
try {
|
|
269
280
|
var s = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
270
281
|
}));
|
|
271
|
-
} catch (
|
|
282
|
+
} catch (l) {
|
|
272
283
|
}
|
|
273
|
-
return (
|
|
284
|
+
return (d = function() {
|
|
274
285
|
return !!s;
|
|
275
286
|
})();
|
|
276
287
|
}
|
|
277
|
-
function o(s,
|
|
278
|
-
return o = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(
|
|
279
|
-
return
|
|
280
|
-
}, o(s,
|
|
288
|
+
function o(s, l) {
|
|
289
|
+
return o = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(u, c) {
|
|
290
|
+
return u.__proto__ = c, u;
|
|
291
|
+
}, o(s, l);
|
|
281
292
|
}
|
|
282
|
-
function
|
|
283
|
-
return
|
|
284
|
-
return
|
|
285
|
-
},
|
|
293
|
+
function n(s) {
|
|
294
|
+
return n = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(l) {
|
|
295
|
+
return l.__proto__ || Object.getPrototypeOf(l);
|
|
296
|
+
}, n(s);
|
|
286
297
|
}
|
|
287
298
|
t.__esModule = !0, t.default = void 0;
|
|
288
299
|
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 }).
|
|
@@ -434,213 +445,213 @@ To pass a single animation please supply them in simple values, e.g. animation('
|
|
|
434
445
|
|
|
435
446
|
`, 78: `base must be set in "px" or "%" but you set it in "%s".
|
|
436
447
|
` };
|
|
437
|
-
function
|
|
438
|
-
for (var s = arguments.length,
|
|
439
|
-
var c, f =
|
|
440
|
-
for (c = 1; c <
|
|
441
|
-
return
|
|
442
|
-
f = f.replace(/%[a-z]/,
|
|
448
|
+
function i() {
|
|
449
|
+
for (var s = arguments.length, l = new Array(s), u = 0; u < s; u++) l[u] = arguments[u];
|
|
450
|
+
var c, f = l[0], g = [];
|
|
451
|
+
for (c = 1; c < l.length; c += 1) g.push(l[c]);
|
|
452
|
+
return g.forEach(function(h) {
|
|
453
|
+
f = f.replace(/%[a-z]/, h);
|
|
443
454
|
}), f;
|
|
444
455
|
}
|
|
445
456
|
t.default = function(s) {
|
|
446
|
-
var
|
|
457
|
+
var l, u;
|
|
447
458
|
function c(f) {
|
|
448
|
-
var
|
|
449
|
-
if (process.env.NODE_ENV === "production")
|
|
459
|
+
var g;
|
|
460
|
+
if (process.env.NODE_ENV === "production") g = s.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + f + " for more information.") || this;
|
|
450
461
|
else {
|
|
451
|
-
for (var
|
|
452
|
-
|
|
462
|
+
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 = s.call(this, i.apply(void 0, [e[f]].concat(p))) || this;
|
|
453
464
|
}
|
|
454
465
|
return function(C) {
|
|
455
466
|
if (C === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
456
467
|
return C;
|
|
457
|
-
}(
|
|
468
|
+
}(g);
|
|
458
469
|
}
|
|
459
|
-
return
|
|
460
|
-
}(
|
|
470
|
+
return u = s, (l = c).prototype = Object.create(u.prototype), l.prototype.constructor = l, o(l, u), c;
|
|
471
|
+
}(r(Error)), a.exports = t.default;
|
|
461
472
|
})(R, R.exports);
|
|
462
|
-
var
|
|
473
|
+
var k = R.exports;
|
|
463
474
|
(function(a, t) {
|
|
464
|
-
t.__esModule = !0, t.default = function(
|
|
465
|
-
if (typeof
|
|
466
|
-
var p = (0,
|
|
475
|
+
t.__esModule = !0, t.default = function(h) {
|
|
476
|
+
if (typeof h != "string") throw new o.default(3);
|
|
477
|
+
var p = (0, d.default)(h);
|
|
467
478
|
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) };
|
|
468
|
-
if (p.match(
|
|
479
|
+
if (p.match(i)) {
|
|
469
480
|
var b = parseFloat((parseInt("" + p[7] + p[8], 16) / 255).toFixed(2));
|
|
470
481
|
return { red: parseInt("" + p[1] + p[2], 16), green: parseInt("" + p[3] + p[4], 16), blue: parseInt("" + p[5] + p[6], 16), alpha: b };
|
|
471
482
|
}
|
|
472
483
|
if (p.match(s)) return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16) };
|
|
473
|
-
if (p.match(
|
|
484
|
+
if (p.match(l)) {
|
|
474
485
|
var C = parseFloat((parseInt("" + p[4] + p[4], 16) / 255).toFixed(2));
|
|
475
486
|
return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16), alpha: C };
|
|
476
487
|
}
|
|
477
|
-
var E =
|
|
488
|
+
var E = u.exec(p);
|
|
478
489
|
if (E) return { red: parseInt("" + E[1], 10), green: parseInt("" + E[2], 10), blue: parseInt("" + E[3], 10) };
|
|
479
490
|
var y = c.exec(p.substring(0, 50));
|
|
480
491
|
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]) };
|
|
481
492
|
var A = f.exec(p);
|
|
482
493
|
if (A) {
|
|
483
|
-
var
|
|
484
|
-
if (!
|
|
485
|
-
return { red: parseInt("" +
|
|
494
|
+
var Oe = parseInt("" + A[1], 10), Ie = parseInt("" + A[2], 10) / 100, Me = parseInt("" + A[3], 10) / 100, fe = "rgb(" + (0, r.default)(Oe, Ie, Me) + ")", O = u.exec(fe);
|
|
495
|
+
if (!O) throw new o.default(4, p, fe);
|
|
496
|
+
return { red: parseInt("" + O[1], 10), green: parseInt("" + O[2], 10), blue: parseInt("" + O[3], 10) };
|
|
486
497
|
}
|
|
487
|
-
var w =
|
|
498
|
+
var w = g.exec(p.substring(0, 50));
|
|
488
499
|
if (w) {
|
|
489
|
-
var Be = parseInt("" + w[1], 10), Pe = parseInt("" + w[2], 10) / 100, je = parseInt("" + w[3], 10) / 100, ce = "rgb(" + (0,
|
|
490
|
-
if (!
|
|
491
|
-
return { red: parseInt("" +
|
|
500
|
+
var Be = parseInt("" + w[1], 10), Pe = parseInt("" + w[2], 10) / 100, je = parseInt("" + w[3], 10) / 100, ce = "rgb(" + (0, r.default)(Be, Pe, je) + ")", I = u.exec(ce);
|
|
501
|
+
if (!I) throw new o.default(4, p, ce);
|
|
502
|
+
return { red: parseInt("" + I[1], 10), green: parseInt("" + I[2], 10), blue: parseInt("" + I[3], 10), alpha: parseFloat("" + w[4]) > 1 ? parseFloat("" + w[4]) / 100 : parseFloat("" + w[4]) };
|
|
492
503
|
}
|
|
493
504
|
throw new o.default(5);
|
|
494
505
|
};
|
|
495
|
-
var
|
|
496
|
-
function
|
|
497
|
-
return
|
|
506
|
+
var r = n(le), d = n(Re), o = n(k);
|
|
507
|
+
function n(h) {
|
|
508
|
+
return h && h.__esModule ? h : { default: h };
|
|
498
509
|
}
|
|
499
|
-
var e = /^#[a-fA-F0-9]{6}$/,
|
|
510
|
+
var e = /^#[a-fA-F0-9]{6}$/, i = /^#[a-fA-F0-9]{8}$/, s = /^#[a-fA-F0-9]{3}$/, l = /^#[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;
|
|
500
511
|
a.exports = t.default;
|
|
501
|
-
})(
|
|
502
|
-
var
|
|
512
|
+
})(N, N.exports);
|
|
513
|
+
var ue = N.exports;
|
|
503
514
|
(function(a, t) {
|
|
504
515
|
t.__esModule = !0, t.default = function(o) {
|
|
505
516
|
if (o === "transparent") return 0;
|
|
506
|
-
var
|
|
507
|
-
var c =
|
|
517
|
+
var n = (0, d.default)(o), e = Object.keys(n).map(function(u) {
|
|
518
|
+
var c = n[u] / 255;
|
|
508
519
|
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
509
|
-
}),
|
|
510
|
-
return parseFloat((0.2126 *
|
|
520
|
+
}), i = e[0], s = e[1], l = e[2];
|
|
521
|
+
return parseFloat((0.2126 * i + 0.7152 * s + 0.0722 * l).toFixed(3));
|
|
511
522
|
};
|
|
512
|
-
var
|
|
523
|
+
var r, d = (r = ue) && r.__esModule ? r : { default: r };
|
|
513
524
|
a.exports = t.default;
|
|
514
|
-
})(
|
|
515
|
-
const Ye =
|
|
525
|
+
})(z, z.exports);
|
|
526
|
+
const Ye = de(z.exports);
|
|
516
527
|
var Y = { exports: {} }, J = { exports: {} };
|
|
517
528
|
(function(a, t) {
|
|
518
|
-
function
|
|
529
|
+
function r(d, o, n) {
|
|
519
530
|
return function() {
|
|
520
|
-
var e =
|
|
521
|
-
return e.length >= o ?
|
|
531
|
+
var e = n.concat(Array.prototype.slice.call(arguments));
|
|
532
|
+
return e.length >= o ? d.apply(this, e) : r(d, o, e);
|
|
522
533
|
};
|
|
523
534
|
}
|
|
524
|
-
t.__esModule = !0, t.default = function(
|
|
525
|
-
return
|
|
535
|
+
t.__esModule = !0, t.default = function(d) {
|
|
536
|
+
return r(d, d.length, []);
|
|
526
537
|
}, a.exports = t.default;
|
|
527
538
|
})(J, J.exports);
|
|
528
539
|
var me, B, we = J.exports, U = { exports: {} };
|
|
529
|
-
me = U, (B = U.exports).__esModule = !0, B.default = void 0, B.default = function(a, t,
|
|
530
|
-
return Math.max(a, Math.min(t,
|
|
540
|
+
me = U, (B = U.exports).__esModule = !0, B.default = void 0, B.default = function(a, t, r) {
|
|
541
|
+
return Math.max(a, Math.min(t, r));
|
|
531
542
|
}, me.exports = B.default;
|
|
532
543
|
var xe = U.exports, G = { exports: {} }, V = { exports: {} };
|
|
533
544
|
(function(a, t) {
|
|
534
|
-
t.__esModule = !0, t.default = void 0, t.default = function(
|
|
535
|
-
var
|
|
536
|
-
if (
|
|
537
|
-
var
|
|
538
|
-
switch (
|
|
545
|
+
t.__esModule = !0, t.default = void 0, t.default = function(r) {
|
|
546
|
+
var d, o = r.red / 255, n = r.green / 255, e = r.blue / 255, i = Math.max(o, n, e), s = Math.min(o, n, e), l = (i + s) / 2;
|
|
547
|
+
if (i === s) return r.alpha !== void 0 ? { hue: 0, saturation: 0, lightness: l, alpha: r.alpha } : { hue: 0, saturation: 0, lightness: l };
|
|
548
|
+
var u = i - s, c = l > 0.5 ? u / (2 - i - s) : u / (i + s);
|
|
549
|
+
switch (i) {
|
|
539
550
|
case o:
|
|
540
|
-
|
|
551
|
+
d = (n - e) / u + (n < e ? 6 : 0);
|
|
541
552
|
break;
|
|
542
|
-
case
|
|
543
|
-
|
|
553
|
+
case n:
|
|
554
|
+
d = (e - o) / u + 2;
|
|
544
555
|
break;
|
|
545
556
|
default:
|
|
546
|
-
|
|
557
|
+
d = (o - n) / u + 4;
|
|
547
558
|
}
|
|
548
|
-
return
|
|
559
|
+
return d *= 60, r.alpha !== void 0 ? { hue: d, saturation: c, lightness: l, alpha: r.alpha } : { hue: d, saturation: c, lightness: l };
|
|
549
560
|
}, a.exports = t.default;
|
|
550
561
|
})(V, V.exports);
|
|
551
562
|
var Je = V.exports;
|
|
552
563
|
(function(a, t) {
|
|
553
|
-
t.__esModule = !0, t.default = function(
|
|
554
|
-
return (0,
|
|
564
|
+
t.__esModule = !0, t.default = function(n) {
|
|
565
|
+
return (0, d.default)((0, r.default)(n));
|
|
555
566
|
};
|
|
556
|
-
var
|
|
557
|
-
function o(
|
|
558
|
-
return
|
|
567
|
+
var r = o(ue), d = o(Je);
|
|
568
|
+
function o(n) {
|
|
569
|
+
return n && n.__esModule ? n : { default: n };
|
|
559
570
|
}
|
|
560
571
|
a.exports = t.default;
|
|
561
572
|
})(G, G.exports);
|
|
562
|
-
var
|
|
573
|
+
var ke = G.exports, Z = { exports: {} }, Q = { exports: {} }, X = { exports: {} }, ee = { exports: {} };
|
|
563
574
|
(function(a, t) {
|
|
564
|
-
t.__esModule = !0, t.default = void 0, t.default = function(
|
|
565
|
-
return
|
|
575
|
+
t.__esModule = !0, t.default = void 0, t.default = function(r) {
|
|
576
|
+
return r.length === 7 && r[1] === r[2] && r[3] === r[4] && r[5] === r[6] ? "#" + r[1] + r[3] + r[5] : r;
|
|
566
577
|
}, a.exports = t.default;
|
|
567
578
|
})(ee, ee.exports);
|
|
568
|
-
var
|
|
579
|
+
var Se = ee.exports, te = { exports: {} };
|
|
569
580
|
(function(a, t) {
|
|
570
|
-
t.__esModule = !0, t.default = void 0, t.default = function(
|
|
571
|
-
var
|
|
572
|
-
return
|
|
581
|
+
t.__esModule = !0, t.default = void 0, t.default = function(r) {
|
|
582
|
+
var d = r.toString(16);
|
|
583
|
+
return d.length === 1 ? "0" + d : d;
|
|
573
584
|
}, a.exports = t.default;
|
|
574
585
|
})(te, te.exports);
|
|
575
586
|
var _e = te.exports;
|
|
576
587
|
(function(a, t) {
|
|
577
588
|
t.__esModule = !0, t.default = void 0;
|
|
578
|
-
var
|
|
579
|
-
function
|
|
589
|
+
var r = n(le), d = n(Se), o = n(_e);
|
|
590
|
+
function n(s) {
|
|
580
591
|
return s && s.__esModule ? s : { default: s };
|
|
581
592
|
}
|
|
582
593
|
function e(s) {
|
|
583
594
|
return (0, o.default)(Math.round(255 * s));
|
|
584
595
|
}
|
|
585
|
-
function
|
|
586
|
-
return (0,
|
|
596
|
+
function i(s, l, u) {
|
|
597
|
+
return (0, d.default)("#" + e(s) + e(l) + e(u));
|
|
587
598
|
}
|
|
588
|
-
t.default = function(s,
|
|
589
|
-
return (0,
|
|
599
|
+
t.default = function(s, l, u) {
|
|
600
|
+
return (0, r.default)(s, l, u, i);
|
|
590
601
|
}, a.exports = t.default;
|
|
591
602
|
})(X, X.exports);
|
|
592
603
|
var Ce = X.exports;
|
|
593
604
|
(function(a, t) {
|
|
594
|
-
t.__esModule = !0, t.default = function(
|
|
595
|
-
if (typeof
|
|
596
|
-
if (typeof
|
|
597
|
-
throw new
|
|
605
|
+
t.__esModule = !0, t.default = function(n, e, i) {
|
|
606
|
+
if (typeof n == "number" && typeof e == "number" && typeof i == "number") return (0, r.default)(n, e, i);
|
|
607
|
+
if (typeof n == "object" && e === void 0 && i === void 0) return (0, r.default)(n.hue, n.saturation, n.lightness);
|
|
608
|
+
throw new d.default(1);
|
|
598
609
|
};
|
|
599
|
-
var
|
|
600
|
-
function o(
|
|
601
|
-
return
|
|
610
|
+
var r = o(Ce), d = o(k);
|
|
611
|
+
function o(n) {
|
|
612
|
+
return n && n.__esModule ? n : { default: n };
|
|
602
613
|
}
|
|
603
614
|
a.exports = t.default;
|
|
604
615
|
})(Q, Q.exports);
|
|
605
616
|
var Ue = Q.exports, ne = { exports: {} };
|
|
606
617
|
(function(a, t) {
|
|
607
|
-
t.__esModule = !0, t.default = function(e,
|
|
608
|
-
if (typeof e == "number" && typeof
|
|
609
|
-
if (typeof e == "object" &&
|
|
618
|
+
t.__esModule = !0, t.default = function(e, i, s, l) {
|
|
619
|
+
if (typeof e == "number" && typeof i == "number" && typeof s == "number" && typeof l == "number") return l >= 1 ? (0, r.default)(e, i, s) : "rgba(" + (0, d.default)(e, i, s) + "," + l + ")";
|
|
620
|
+
if (typeof e == "object" && i === void 0 && s === void 0 && l === void 0) return e.alpha >= 1 ? (0, r.default)(e.hue, e.saturation, e.lightness) : "rgba(" + (0, d.default)(e.hue, e.saturation, e.lightness) + "," + e.alpha + ")";
|
|
610
621
|
throw new o.default(2);
|
|
611
622
|
};
|
|
612
|
-
var
|
|
613
|
-
function
|
|
623
|
+
var r = n(Ce), d = n(le), o = n(k);
|
|
624
|
+
function n(e) {
|
|
614
625
|
return e && e.__esModule ? e : { default: e };
|
|
615
626
|
}
|
|
616
627
|
a.exports = t.default;
|
|
617
628
|
})(ne, ne.exports);
|
|
618
629
|
var Ge = ne.exports, re = { exports: {} };
|
|
619
630
|
(function(a, t) {
|
|
620
|
-
t.__esModule = !0, t.default = function(e,
|
|
621
|
-
if (typeof e == "number" && typeof
|
|
622
|
-
if (typeof e == "object" &&
|
|
631
|
+
t.__esModule = !0, t.default = function(e, i, s) {
|
|
632
|
+
if (typeof e == "number" && typeof i == "number" && typeof s == "number") return (0, r.default)("#" + (0, d.default)(e) + (0, d.default)(i) + (0, d.default)(s));
|
|
633
|
+
if (typeof e == "object" && i === void 0 && s === void 0) return (0, r.default)("#" + (0, d.default)(e.red) + (0, d.default)(e.green) + (0, d.default)(e.blue));
|
|
623
634
|
throw new o.default(6);
|
|
624
635
|
};
|
|
625
|
-
var
|
|
626
|
-
function
|
|
636
|
+
var r = n(Se), d = n(_e), o = n(k);
|
|
637
|
+
function n(e) {
|
|
627
638
|
return e && e.__esModule ? e : { default: e };
|
|
628
639
|
}
|
|
629
640
|
a.exports = t.default;
|
|
630
641
|
})(re, re.exports);
|
|
631
642
|
var Ee = re.exports, ae = { exports: {} };
|
|
632
643
|
(function(a, t) {
|
|
633
|
-
t.__esModule = !0, t.default = function(e,
|
|
634
|
-
if (typeof e == "string" && typeof
|
|
635
|
-
var
|
|
636
|
-
return "rgba(" +
|
|
644
|
+
t.__esModule = !0, t.default = function(e, i, s, l) {
|
|
645
|
+
if (typeof e == "string" && typeof i == "number") {
|
|
646
|
+
var u = (0, r.default)(e);
|
|
647
|
+
return "rgba(" + u.red + "," + u.green + "," + u.blue + "," + i + ")";
|
|
637
648
|
}
|
|
638
|
-
if (typeof e == "number" && typeof
|
|
639
|
-
if (typeof e == "object" &&
|
|
649
|
+
if (typeof e == "number" && typeof i == "number" && typeof s == "number" && typeof l == "number") return l >= 1 ? (0, d.default)(e, i, s) : "rgba(" + e + "," + i + "," + s + "," + l + ")";
|
|
650
|
+
if (typeof e == "object" && i === void 0 && s === void 0 && l === void 0) return e.alpha >= 1 ? (0, d.default)(e.red, e.green, e.blue) : "rgba(" + e.red + "," + e.green + "," + e.blue + "," + e.alpha + ")";
|
|
640
651
|
throw new o.default(7);
|
|
641
652
|
};
|
|
642
|
-
var
|
|
643
|
-
function
|
|
653
|
+
var r = n(ue), d = n(Ee), o = n(k);
|
|
654
|
+
function n(e) {
|
|
644
655
|
return e && e.__esModule ? e : { default: e };
|
|
645
656
|
}
|
|
646
657
|
a.exports = t.default;
|
|
@@ -649,21 +660,21 @@ var Ve = ae.exports;
|
|
|
649
660
|
(function(a, t) {
|
|
650
661
|
t.__esModule = !0, t.default = function(f) {
|
|
651
662
|
if (typeof f != "object") throw new e.default(8);
|
|
652
|
-
if (
|
|
663
|
+
if (l(f)) return (0, n.default)(f);
|
|
653
664
|
if (s(f)) return (0, o.default)(f);
|
|
654
|
-
if (c(f)) return (0,
|
|
655
|
-
if (
|
|
665
|
+
if (c(f)) return (0, d.default)(f);
|
|
666
|
+
if (u(f)) return (0, r.default)(f);
|
|
656
667
|
throw new e.default(8);
|
|
657
668
|
};
|
|
658
|
-
var
|
|
659
|
-
function
|
|
669
|
+
var r = i(Ue), d = i(Ge), o = i(Ee), n = i(Ve), e = i(k);
|
|
670
|
+
function i(f) {
|
|
660
671
|
return f && f.__esModule ? f : { default: f };
|
|
661
672
|
}
|
|
662
673
|
var s = function(f) {
|
|
663
674
|
return typeof f.red == "number" && typeof f.green == "number" && typeof f.blue == "number" && (typeof f.alpha != "number" || f.alpha === void 0);
|
|
664
|
-
},
|
|
675
|
+
}, l = function(f) {
|
|
665
676
|
return typeof f.red == "number" && typeof f.green == "number" && typeof f.blue == "number" && typeof f.alpha == "number";
|
|
666
|
-
},
|
|
677
|
+
}, u = function(f) {
|
|
667
678
|
return typeof f.hue == "number" && typeof f.saturation == "number" && typeof f.lightness == "number" && (typeof f.alpha != "number" || f.alpha === void 0);
|
|
668
679
|
}, c = function(f) {
|
|
669
680
|
return typeof f.hue == "number" && typeof f.saturation == "number" && typeof f.lightness == "number" && typeof f.alpha == "number";
|
|
@@ -673,111 +684,111 @@ var Ve = ae.exports;
|
|
|
673
684
|
var Ae = Z.exports;
|
|
674
685
|
(function(a, t) {
|
|
675
686
|
t.__esModule = !0, t.default = void 0;
|
|
676
|
-
var
|
|
677
|
-
function e(
|
|
678
|
-
return
|
|
679
|
-
}
|
|
680
|
-
function
|
|
681
|
-
return
|
|
682
|
-
for (var
|
|
683
|
-
var c = arguments[
|
|
684
|
-
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (
|
|
687
|
+
var r = e(we), d = e(xe), o = e(ke), n = e(Ae);
|
|
688
|
+
function e(l) {
|
|
689
|
+
return l && l.__esModule ? l : { default: l };
|
|
690
|
+
}
|
|
691
|
+
function i() {
|
|
692
|
+
return i = Object.assign ? Object.assign.bind() : function(l) {
|
|
693
|
+
for (var u = 1; u < arguments.length; u++) {
|
|
694
|
+
var c = arguments[u];
|
|
695
|
+
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (l[f] = c[f]);
|
|
685
696
|
}
|
|
686
|
-
return
|
|
687
|
-
},
|
|
697
|
+
return l;
|
|
698
|
+
}, i.apply(this, arguments);
|
|
688
699
|
}
|
|
689
|
-
var s = (0,
|
|
690
|
-
if (
|
|
691
|
-
var c = (0, o.default)(
|
|
692
|
-
return (0,
|
|
700
|
+
var s = (0, r.default)(function(l, u) {
|
|
701
|
+
if (u === "transparent") return u;
|
|
702
|
+
var c = (0, o.default)(u);
|
|
703
|
+
return (0, n.default)(i({}, c, { lightness: (0, d.default)(0, 1, c.lightness - parseFloat(l)) }));
|
|
693
704
|
});
|
|
694
705
|
t.default = s, a.exports = t.default;
|
|
695
706
|
})(Y, Y.exports);
|
|
696
|
-
const Ze =
|
|
707
|
+
const Ze = de(Y.exports);
|
|
697
708
|
var oe = { exports: {} };
|
|
698
709
|
(function(a, t) {
|
|
699
710
|
t.__esModule = !0, t.default = void 0;
|
|
700
|
-
var
|
|
701
|
-
function e(
|
|
702
|
-
return
|
|
703
|
-
}
|
|
704
|
-
function
|
|
705
|
-
return
|
|
706
|
-
for (var
|
|
707
|
-
var c = arguments[
|
|
708
|
-
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (
|
|
711
|
+
var r = e(we), d = e(xe), o = e(ke), n = e(Ae);
|
|
712
|
+
function e(l) {
|
|
713
|
+
return l && l.__esModule ? l : { default: l };
|
|
714
|
+
}
|
|
715
|
+
function i() {
|
|
716
|
+
return i = Object.assign ? Object.assign.bind() : function(l) {
|
|
717
|
+
for (var u = 1; u < arguments.length; u++) {
|
|
718
|
+
var c = arguments[u];
|
|
719
|
+
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (l[f] = c[f]);
|
|
709
720
|
}
|
|
710
|
-
return
|
|
711
|
-
},
|
|
721
|
+
return l;
|
|
722
|
+
}, i.apply(this, arguments);
|
|
712
723
|
}
|
|
713
|
-
var s = (0,
|
|
714
|
-
if (
|
|
715
|
-
var c = (0, o.default)(
|
|
716
|
-
return (0,
|
|
724
|
+
var s = (0, r.default)(function(l, u) {
|
|
725
|
+
if (u === "transparent") return u;
|
|
726
|
+
var c = (0, o.default)(u);
|
|
727
|
+
return (0, n.default)(i({}, c, { lightness: (0, d.default)(0, 1, c.lightness + parseFloat(l)) }));
|
|
717
728
|
});
|
|
718
729
|
t.default = s, a.exports = t.default;
|
|
719
730
|
})(oe, oe.exports);
|
|
720
|
-
const Qe =
|
|
731
|
+
const Qe = de(oe.exports);
|
|
721
732
|
function Xe(a) {
|
|
722
733
|
if (!document.querySelector("style[data-widget-styles]")) {
|
|
723
|
-
var t,
|
|
734
|
+
var t, r;
|
|
724
735
|
(function() {
|
|
725
|
-
let
|
|
726
|
-
const
|
|
727
|
-
|
|
728
|
-
const e = Ye(
|
|
729
|
-
|
|
736
|
+
let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "#000", o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "FFF";
|
|
737
|
+
const n = document.createElement("style");
|
|
738
|
+
n.attributes.setNamedItem(document.createAttribute("data-widget-styles"));
|
|
739
|
+
const e = Ye(d) > 0.5;
|
|
740
|
+
n.textContent = `
|
|
730
741
|
.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))}}
|
|
731
|
-
.${
|
|
732
|
-
.${
|
|
733
|
-
background: ${e ? Ze(0.05,
|
|
742
|
+
.${T} { background: ${d}; }
|
|
743
|
+
.${T}:hover {
|
|
744
|
+
background: ${e ? Ze(0.05, d) : Qe(0.05, d)};
|
|
734
745
|
}
|
|
735
746
|
.trigger-button-icon { color: ${o}; }
|
|
736
|
-
`, document.head.appendChild(
|
|
737
|
-
})((a == null || (t = a.theme) === null || t === void 0 ? void 0 : t.inputButtonBgColor) || "#007bff", (a == null || (
|
|
747
|
+
`, document.head.appendChild(n);
|
|
748
|
+
})((a == null || (t = a.theme) === null || t === void 0 ? void 0 : t.inputButtonBgColor) || "#007bff", (a == null || (r = a.theme) === null || r === void 0 ? void 0 : r.textBaseColor) || "#ffffff");
|
|
738
749
|
}
|
|
739
750
|
}
|
|
740
751
|
function et(a, t) {
|
|
741
|
-
const
|
|
742
|
-
((
|
|
752
|
+
const r = () => {
|
|
753
|
+
((d) => {
|
|
743
754
|
var o;
|
|
744
|
-
(o = a.contentWindow) === null || o === void 0 || o.postMessage({ type: "UPDATE_BODY_CLASS", isDarkMode:
|
|
755
|
+
(o = a.contentWindow) === null || o === void 0 || o.postMessage({ type: "UPDATE_BODY_CLASS", isDarkMode: d }, "*");
|
|
745
756
|
})(document.body.classList.contains("dark"));
|
|
746
757
|
};
|
|
747
|
-
|
|
748
|
-
const
|
|
749
|
-
|
|
758
|
+
r(), (() => {
|
|
759
|
+
const d = new MutationObserver(r);
|
|
760
|
+
d.observe(document.body, { attributes: !0, attributeFilter: ["class"] }), t.addEventListener("abort", () => d.disconnect());
|
|
750
761
|
})();
|
|
751
762
|
}
|
|
752
763
|
function tt(a, t) {
|
|
753
|
-
let
|
|
754
|
-
const
|
|
755
|
-
((
|
|
764
|
+
let r;
|
|
765
|
+
const d = () => {
|
|
766
|
+
((n) => {
|
|
756
767
|
var e;
|
|
757
|
-
const
|
|
758
|
-
(e = a.contentWindow) === null || e === void 0 || e.postMessage(
|
|
768
|
+
const i = { type: "UPDATE_BODY_CLASS", isMobile: n };
|
|
769
|
+
(e = a.contentWindow) === null || e === void 0 || e.postMessage(i, "*"), n && (v.isWidgetOpen ? v.hideTriggerButton() : v.showTriggerButton());
|
|
759
770
|
})(document.body.clientWidth <= 576);
|
|
760
771
|
}, o = () => {
|
|
761
|
-
|
|
772
|
+
r && clearTimeout(r), r = window.setTimeout(d, 300);
|
|
762
773
|
};
|
|
763
|
-
|
|
764
|
-
const
|
|
765
|
-
|
|
774
|
+
d(), (() => {
|
|
775
|
+
const n = new ResizeObserver(o);
|
|
776
|
+
n.observe(document.body), t.addEventListener("abort", () => n.disconnect());
|
|
766
777
|
})();
|
|
767
778
|
}
|
|
768
779
|
function be(a) {
|
|
769
780
|
const t = new TextEncoder().encode(a);
|
|
770
781
|
if (typeof window != "undefined" && typeof window.btoa == "function") {
|
|
771
|
-
const
|
|
772
|
-
return btoa(
|
|
782
|
+
const r = Array.from(t, (d) => String.fromCharCode(d)).join("");
|
|
783
|
+
return btoa(r);
|
|
773
784
|
}
|
|
774
785
|
if (typeof Buffer != "undefined") return Buffer.from(t).toString("base64");
|
|
775
786
|
throw new Error("[utils.base64Encode]: Unsupported environment");
|
|
776
787
|
}
|
|
777
788
|
const ve = /* @__PURE__ */ new Set();
|
|
778
789
|
function nt(a, t) {
|
|
779
|
-
const
|
|
780
|
-
const
|
|
790
|
+
const r = document.createDocumentFragment(), d = function(e) {
|
|
791
|
+
const i = M("button", T, { id: `trigger-button-${e}`, "aria-controls": j, "aria-expanded": "false", "data-name": T }), s = M("div", "trigger-button-icon", { "aria-hidden": "true" });
|
|
781
792
|
return s.innerHTML = `
|
|
782
793
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">
|
|
783
794
|
<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>
|
|
@@ -785,107 +796,107 @@ function nt(a, t) {
|
|
|
785
796
|
<svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">
|
|
786
797
|
<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"/>
|
|
787
798
|
</svg>
|
|
788
|
-
`,
|
|
789
|
-
}(a), { iframeContainer: o, iframe:
|
|
790
|
-
const
|
|
791
|
-
return
|
|
799
|
+
`, i.setAttribute("aria-label", "Open Brainfish widget"), i.appendChild(s), v.initialize(i, s), i;
|
|
800
|
+
}(a), { iframeContainer: o, iframe: n } = function(e) {
|
|
801
|
+
const i = M("div", j, { id: j, "aria-live": "polite", "aria-hidden": "true" }), s = M("iframe", "trigger-iframe", { src: e, sandbox: "allow-scripts allow-same-origin allow-popups allow-forms", allow: "clipboard-write", role: "dialog" });
|
|
802
|
+
return i.appendChild(s), { iframeContainer: i, iframe: s };
|
|
792
803
|
}(t);
|
|
793
|
-
return
|
|
804
|
+
return r.appendChild(d), r.appendChild(o), { fragment: r, iframe: n };
|
|
794
805
|
}
|
|
795
806
|
const rt = (a, t) => {
|
|
796
|
-
const
|
|
807
|
+
const r = se(a.overrides), d = ((o = a.overrides) == null ? void 0 : o.widgetHost) || "https://agent.brainfi.sh";
|
|
797
808
|
var o;
|
|
798
|
-
const { theme:
|
|
809
|
+
const { theme: n, settings: e } = t, i = `${d}/?widgetKey=${a.widgetKey}&themeParam=${be(JSON.stringify(n))}&settingsParam=${be(JSON.stringify(e))}`;
|
|
799
810
|
try {
|
|
800
|
-
if (s = a.widgetKey, ve.has(s) || function(
|
|
801
|
-
return !!document.getElementById(`trigger-button-${
|
|
811
|
+
if (s = a.widgetKey, ve.has(s) || function(h) {
|
|
812
|
+
return !!document.getElementById(`trigger-button-${h}`);
|
|
802
813
|
}(a.widgetKey)) return;
|
|
803
814
|
Xe(t);
|
|
804
|
-
const { fragment:
|
|
805
|
-
|
|
815
|
+
const { fragment: l, iframe: u } = nt(a.widgetKey, i), c = new AbortController(), { signal: f } = c;
|
|
816
|
+
u.onload = () => {
|
|
806
817
|
setTimeout(() => {
|
|
807
|
-
et(
|
|
818
|
+
et(u, f), De({ widgetHost: d, apiHost: r, widgetKey: a.widgetKey, signal: f }), tt(u, f);
|
|
808
819
|
}, 0);
|
|
809
|
-
}, document.body.appendChild(
|
|
810
|
-
const
|
|
811
|
-
c.abort(), window.removeEventListener("beforeunload",
|
|
820
|
+
}, document.body.appendChild(l), ve.add(a.widgetKey);
|
|
821
|
+
const g = () => {
|
|
822
|
+
c.abort(), window.removeEventListener("beforeunload", g);
|
|
812
823
|
};
|
|
813
|
-
return void window.addEventListener("beforeunload",
|
|
814
|
-
} catch (
|
|
815
|
-
(function(
|
|
816
|
-
x(
|
|
817
|
-
})(
|
|
824
|
+
return void window.addEventListener("beforeunload", g);
|
|
825
|
+
} catch (l) {
|
|
826
|
+
(function(u, c, f) {
|
|
827
|
+
x(u, c, c.message, f);
|
|
828
|
+
})(r, l, a.widgetKey);
|
|
818
829
|
}
|
|
819
830
|
var s;
|
|
820
831
|
};
|
|
821
832
|
let P = null;
|
|
822
833
|
const ye = typeof window != "undefined" && window.Brainfish ? window.Brainfish : (P || (P = /* @__PURE__ */ function() {
|
|
823
834
|
let a = [], t = null;
|
|
824
|
-
function
|
|
835
|
+
function r(o, n) {
|
|
825
836
|
if (t) {
|
|
826
837
|
const e = o.split(".");
|
|
827
|
-
let
|
|
828
|
-
for (let
|
|
829
|
-
const s =
|
|
830
|
-
if (typeof s == "function") return s.apply(
|
|
831
|
-
} else a.push([o,
|
|
838
|
+
let i = t;
|
|
839
|
+
for (let l = 0; l < e.length - 1; l++) i = i[e[l]];
|
|
840
|
+
const s = i[e[e.length - 1]];
|
|
841
|
+
if (typeof s == "function") return s.apply(i, n);
|
|
842
|
+
} else a.push([o, n]);
|
|
832
843
|
}
|
|
833
844
|
return { Widgets: { init: function() {
|
|
834
|
-
for (var o = arguments.length,
|
|
835
|
-
return
|
|
845
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
846
|
+
return r("Widgets.init", n);
|
|
836
847
|
} }, SearchWidget: { initStandard: function() {
|
|
837
|
-
for (var o = arguments.length,
|
|
838
|
-
return
|
|
848
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
849
|
+
return r("SearchWidget.initStandard", n);
|
|
839
850
|
} }, HelpWidget: { initPopup: function() {
|
|
840
|
-
for (var o = arguments.length,
|
|
841
|
-
return
|
|
851
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
852
|
+
return r("HelpWidget.initPopup", n);
|
|
842
853
|
}, close: function() {
|
|
843
|
-
for (var o = arguments.length,
|
|
844
|
-
return
|
|
854
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
855
|
+
return r("HelpWidget.close", n);
|
|
845
856
|
}, open: function() {
|
|
846
|
-
for (var o = arguments.length,
|
|
847
|
-
return
|
|
857
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
858
|
+
return r("HelpWidget.open", n);
|
|
848
859
|
}, toggle: function() {
|
|
849
|
-
for (var o = arguments.length,
|
|
850
|
-
return
|
|
860
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
861
|
+
return r("HelpWidget.toggle", n);
|
|
851
862
|
} }, _setRealBrainfish: function(o) {
|
|
852
863
|
for (t = o; a.length > 0; ) {
|
|
853
|
-
const [
|
|
854
|
-
n
|
|
864
|
+
const [n, e] = a.shift();
|
|
865
|
+
r(n, e);
|
|
855
866
|
}
|
|
856
867
|
} };
|
|
857
868
|
}(), typeof window != "undefined" && (window.Brainfish = P)), P);
|
|
858
|
-
let
|
|
869
|
+
let W = null;
|
|
859
870
|
ye.Widgets.init = (a) => m(void 0, null, function* () {
|
|
860
871
|
window && (window.BrainfishAnalytics = window.BrainfishAnalytics || function() {
|
|
861
|
-
for (var
|
|
872
|
+
for (var n = arguments.length, e = new Array(n), i = 0; i < n; i++) e[i] = arguments[i];
|
|
862
873
|
(window.BrainfishAnalytics.q = window.BrainfishAnalytics.q || []).push(e);
|
|
863
874
|
});
|
|
864
|
-
const t = se(a.overrides),
|
|
865
|
-
var
|
|
875
|
+
const t = se(a.overrides), r = ((d = a.overrides) == null ? void 0 : d.analyticsApiHost) || "";
|
|
876
|
+
var d;
|
|
866
877
|
let o;
|
|
867
|
-
if (a.config) o = JSON.parse(((
|
|
878
|
+
if (a.config) o = JSON.parse(((n) => {
|
|
868
879
|
if (typeof window != "undefined" && typeof window.atob == "function") {
|
|
869
|
-
const e = atob(
|
|
870
|
-
for (let
|
|
880
|
+
const e = atob(n), i = e.length, s = new Uint8Array(i);
|
|
881
|
+
for (let l = 0; l < i; l++) s[l] = e.charCodeAt(l);
|
|
871
882
|
return new TextDecoder().decode(s);
|
|
872
883
|
}
|
|
873
|
-
if (typeof Buffer != "undefined") return Buffer.from(
|
|
884
|
+
if (typeof Buffer != "undefined") return Buffer.from(n, "base64").toString("utf-8");
|
|
874
885
|
throw new Error("[utils.base64Decode]: Unsupported environment");
|
|
875
886
|
})(a.config));
|
|
876
887
|
else {
|
|
877
|
-
const { config:
|
|
878
|
-
o =
|
|
888
|
+
const { config: n } = yield We({ widgetKey: a.widgetKey, apiHost: t });
|
|
889
|
+
o = n;
|
|
879
890
|
}
|
|
880
|
-
|
|
891
|
+
W || (W = function(n, e, i, s) {
|
|
881
892
|
return m(this, null, function* () {
|
|
882
|
-
var
|
|
883
|
-
const f = ((
|
|
884
|
-
|
|
885
|
-
const [p] = yield Promise.allSettled(
|
|
893
|
+
var l, u, c;
|
|
894
|
+
const f = ((l = n.overrides) === null || l === void 0 ? void 0 : l.enableRecording) || (e == null || (u = e.settings) === null || u === void 0 ? void 0 : u.enableRecording) || !1, g = ((c = n.overrides) === null || c === void 0 ? void 0 : c.version) || (e == null ? void 0 : e.version), h = [];
|
|
895
|
+
g != null && g.startsWith("2.") ? rt(n, e) : h.push(Ne(n, e)), h.push(qe(n.widgetKey, e.trackingToken || "", i, s, f));
|
|
896
|
+
const [p] = yield Promise.allSettled(h);
|
|
886
897
|
p && p.status === "fulfilled" && p.value && ye._setRealBrainfish(p.value);
|
|
887
898
|
});
|
|
888
|
-
}(a, o, t,
|
|
899
|
+
}(a, o, t, r)), yield W;
|
|
889
900
|
});
|
|
890
901
|
const ot = function() {
|
|
891
902
|
typeof window != "undefined" && window.BrainfishAnalytics && window.BrainfishAnalytics(...arguments);
|