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