@enegelai/bot-widget 1.9.5 → 1.10.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/enegelaibot.umd.js +236 -213
- package/dist/index.es.js +691 -645
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var ja = (c, e, a) => e in c ?
|
|
3
|
-
var
|
|
4
|
-
import { css as
|
|
5
|
-
import { property as v, customElement as
|
|
6
|
-
import { unsafeHTML as
|
|
7
|
-
import { when as
|
|
1
|
+
var za = Object.defineProperty;
|
|
2
|
+
var ja = (c, e, a) => e in c ? za(c, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : c[e] = a;
|
|
3
|
+
var ge = (c, e, a) => ja(c, typeof e != "symbol" ? e + "" : e, a);
|
|
4
|
+
import { css as X, LitElement as ut, html as g, svg as be } from "lit";
|
|
5
|
+
import { property as v, customElement as J, queryAll as Kt, query as xe, eventOptions as Mt } from "lit/decorators.js";
|
|
6
|
+
import { unsafeHTML as Y } from "lit-html/directives/unsafe-html.js";
|
|
7
|
+
import { when as ce } from "lit/directives/when.js";
|
|
8
8
|
import { registerIconLibrary as Ha } from "@shoelace-style/shoelace";
|
|
9
9
|
import "@shoelace-style/shoelace/dist/components/button/button.js";
|
|
10
10
|
import "@shoelace-style/shoelace/dist/components/avatar/avatar.js";
|
|
@@ -23,14 +23,15 @@ import "@shoelace-style/shoelace/dist/components/tooltip/tooltip.js";
|
|
|
23
23
|
import "@shoelace-style/shoelace/dist/components/spinner/spinner.js";
|
|
24
24
|
import "@shoelace-style/shoelace/dist/components/alert/alert.js";
|
|
25
25
|
import "@shoelace-style/shoelace/dist/components/progress-bar/progress-bar.js";
|
|
26
|
+
import "@shoelace-style/shoelace/dist/components/badge/badge.js";
|
|
26
27
|
import { repeat as Ye } from "lit/directives/repeat.js";
|
|
27
|
-
import { until as
|
|
28
|
+
import { until as Dt } from "lit-html/directives/until.js";
|
|
28
29
|
import Ba from "markdown-it";
|
|
29
30
|
import Ra from "markdown-it-link-attributes";
|
|
30
31
|
import vt from "highlight.js";
|
|
31
32
|
import "@shoelace-style/shoelace/dist/components/popup/popup.js";
|
|
32
33
|
import "@shoelace-style/shoelace/dist/components/rating/rating.js";
|
|
33
|
-
function
|
|
34
|
+
function Qt(c) {
|
|
34
35
|
return typeof c == "function" ? c() : c;
|
|
35
36
|
}
|
|
36
37
|
const ht = class ht extends Event {
|
|
@@ -45,8 +46,8 @@ const ht = class ht extends Event {
|
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
ht.eventName = "lit-state-changed";
|
|
48
|
-
let
|
|
49
|
-
const Va = (c, e) => e !== c && (e === e || c === c),
|
|
49
|
+
let Pe = ht;
|
|
50
|
+
const Va = (c, e) => e !== c && (e === e || c === c), Lt = class Lt extends EventTarget {
|
|
50
51
|
static initPropertyMap() {
|
|
51
52
|
this.propertyMap || (this.propertyMap = /* @__PURE__ */ new Map());
|
|
52
53
|
}
|
|
@@ -59,7 +60,7 @@ const Va = (c, e) => e !== c && (e === e || c === c), qt = class qt extends Even
|
|
|
59
60
|
constructor() {
|
|
60
61
|
super(), this.hookMap = /* @__PURE__ */ new Map(), this.constructor.finalize(), this.propertyMap && [...this.propertyMap].forEach(([e, a]) => {
|
|
61
62
|
if (a.initialValue !== void 0) {
|
|
62
|
-
const s =
|
|
63
|
+
const s = Qt(a.initialValue);
|
|
63
64
|
this[e] = s, a.value = s;
|
|
64
65
|
}
|
|
65
66
|
});
|
|
@@ -114,26 +115,26 @@ const Va = (c, e) => e !== c && (e === e || c === c), qt = class qt extends Even
|
|
|
114
115
|
const n = (d) => {
|
|
115
116
|
(!a || a.includes(d.key)) && e(d.key, d.value, this);
|
|
116
117
|
};
|
|
117
|
-
return this.addEventListener(
|
|
118
|
+
return this.addEventListener(Pe.eventName, n, s), () => this.removeEventListener(Pe.eventName, n);
|
|
118
119
|
}
|
|
119
120
|
dispatchStateEvent(e, a, s) {
|
|
120
|
-
this.dispatchEvent(new
|
|
121
|
+
this.dispatchEvent(new Pe(e, a, s));
|
|
121
122
|
}
|
|
122
123
|
};
|
|
123
|
-
|
|
124
|
-
let kt =
|
|
124
|
+
Lt.finalized = !1;
|
|
125
|
+
let kt = Lt;
|
|
125
126
|
class pt {
|
|
126
127
|
constructor(e, a, s) {
|
|
127
128
|
this.host = e, this.state = a, this.callback = s || (() => this.host.requestUpdate()), this.host.addController(this);
|
|
128
129
|
}
|
|
129
130
|
hostConnected() {
|
|
130
|
-
this.state.addEventListener(
|
|
131
|
+
this.state.addEventListener(Pe.eventName, this.callback), this.callback();
|
|
131
132
|
}
|
|
132
133
|
hostDisconnected() {
|
|
133
|
-
this.state.removeEventListener(
|
|
134
|
+
this.state.removeEventListener(Pe.eventName, this.callback);
|
|
134
135
|
}
|
|
135
136
|
}
|
|
136
|
-
function
|
|
137
|
+
function q(c) {
|
|
137
138
|
return (e, a) => {
|
|
138
139
|
if (Object.getOwnPropertyDescriptor(e, a))
|
|
139
140
|
throw new Error("@property must be called before all state decorators");
|
|
@@ -160,7 +161,7 @@ new URL(location.href);
|
|
|
160
161
|
const Fa = {
|
|
161
162
|
prefix: "_ls"
|
|
162
163
|
};
|
|
163
|
-
function
|
|
164
|
+
function de(c) {
|
|
164
165
|
return c = { ...Fa, ...c }, (e, a) => {
|
|
165
166
|
const s = Object.getOwnPropertyDescriptor(e, a);
|
|
166
167
|
if (!s)
|
|
@@ -168,26 +169,26 @@ function le(c) {
|
|
|
168
169
|
const n = `${(c == null ? void 0 : c.prefix) || ""}_${(c == null ? void 0 : c.key) || String(a)}`, d = e.constructor, f = d.propertyMap.get(a), x = f == null ? void 0 : f.type;
|
|
169
170
|
if (f) {
|
|
170
171
|
const F = f.initialValue;
|
|
171
|
-
f.initialValue = () => Da(localStorage.getItem(n), x) ??
|
|
172
|
+
f.initialValue = () => Da(localStorage.getItem(n), x) ?? Qt(F), d.propertyMap.set(a, { ...f, ...c });
|
|
172
173
|
}
|
|
173
|
-
const S = s == null ? void 0 : s.set,
|
|
174
|
+
const S = s == null ? void 0 : s.set, K = {
|
|
174
175
|
...s,
|
|
175
176
|
set: function(F) {
|
|
176
177
|
F !== void 0 && localStorage.setItem(n, x === Object || x === Array ? JSON.stringify(F) : F), S && S.call(this, F);
|
|
177
178
|
}
|
|
178
179
|
};
|
|
179
|
-
Object.defineProperty(d.prototype, a,
|
|
180
|
+
Object.defineProperty(d.prototype, a, K);
|
|
180
181
|
};
|
|
181
182
|
}
|
|
182
|
-
var
|
|
183
|
-
function
|
|
183
|
+
var ea = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
184
|
+
function ta(c) {
|
|
184
185
|
return c && c.__esModule && Object.prototype.hasOwnProperty.call(c, "default") ? c.default : c;
|
|
185
186
|
}
|
|
186
|
-
var
|
|
187
|
+
var aa = { exports: {} };
|
|
187
188
|
(function(c) {
|
|
188
189
|
(function(e, a) {
|
|
189
190
|
c.exports ? c.exports = a() : e.log = a();
|
|
190
|
-
})(
|
|
191
|
+
})(ea, function() {
|
|
191
192
|
var e = function() {
|
|
192
193
|
}, a = "undefined", s = typeof window !== a && typeof window.navigator !== a && /Trident\/|MSIE /.test(window.navigator.userAgent), n = [
|
|
193
194
|
"trace",
|
|
@@ -214,7 +215,7 @@ var ca = { exports: {} };
|
|
|
214
215
|
function _($) {
|
|
215
216
|
return $ === "debug" && ($ = "log"), typeof console === a ? !1 : $ === "trace" && s ? S : console[$] !== void 0 ? x(console, $) : console.log !== void 0 ? x(console, "log") : e;
|
|
216
217
|
}
|
|
217
|
-
function
|
|
218
|
+
function K() {
|
|
218
219
|
for (var $ = this.getLevel(), V = 0; V < n.length; V++) {
|
|
219
220
|
var C = n[V];
|
|
220
221
|
this[C] = V < $ ? e : this.methodFactory(C, $, this.name);
|
|
@@ -224,64 +225,64 @@ var ca = { exports: {} };
|
|
|
224
225
|
}
|
|
225
226
|
function F($) {
|
|
226
227
|
return function() {
|
|
227
|
-
typeof console !== a && (
|
|
228
|
+
typeof console !== a && (K.call(this), this[$].apply(this, arguments));
|
|
228
229
|
};
|
|
229
230
|
}
|
|
230
|
-
function
|
|
231
|
+
function T($, V, C) {
|
|
231
232
|
return _($) || F.apply(this, arguments);
|
|
232
233
|
}
|
|
233
234
|
function N($, V) {
|
|
234
|
-
var C = this, Ee, Ae,
|
|
235
|
-
typeof $ == "string" ?
|
|
236
|
-
function mt(
|
|
237
|
-
var
|
|
238
|
-
if (!(typeof window === a || !
|
|
235
|
+
var C = this, Ee, Ae, ne, se = "loglevel";
|
|
236
|
+
typeof $ == "string" ? se += ":" + $ : typeof $ == "symbol" && (se = void 0);
|
|
237
|
+
function mt(z) {
|
|
238
|
+
var R = (n[z] || "silent").toUpperCase();
|
|
239
|
+
if (!(typeof window === a || !se)) {
|
|
239
240
|
try {
|
|
240
|
-
window.localStorage[
|
|
241
|
+
window.localStorage[se] = R;
|
|
241
242
|
return;
|
|
242
243
|
} catch {
|
|
243
244
|
}
|
|
244
245
|
try {
|
|
245
|
-
window.document.cookie = encodeURIComponent(
|
|
246
|
+
window.document.cookie = encodeURIComponent(se) + "=" + R + ";";
|
|
246
247
|
} catch {
|
|
247
248
|
}
|
|
248
249
|
}
|
|
249
250
|
}
|
|
250
|
-
function
|
|
251
|
-
var
|
|
252
|
-
if (!(typeof window === a || !
|
|
251
|
+
function ze() {
|
|
252
|
+
var z;
|
|
253
|
+
if (!(typeof window === a || !se)) {
|
|
253
254
|
try {
|
|
254
|
-
|
|
255
|
+
z = window.localStorage[se];
|
|
255
256
|
} catch {
|
|
256
257
|
}
|
|
257
|
-
if (typeof
|
|
258
|
+
if (typeof z === a)
|
|
258
259
|
try {
|
|
259
|
-
var
|
|
260
|
-
We !== -1 && (
|
|
261
|
-
|
|
260
|
+
var R = window.document.cookie, Ie = encodeURIComponent(se), We = R.indexOf(Ie + "=");
|
|
261
|
+
We !== -1 && (z = /^([^;]+)/.exec(
|
|
262
|
+
R.slice(We + Ie.length + 1)
|
|
262
263
|
)[1]);
|
|
263
264
|
} catch {
|
|
264
265
|
}
|
|
265
|
-
return C.levels[
|
|
266
|
+
return C.levels[z] === void 0 && (z = void 0), z;
|
|
266
267
|
}
|
|
267
268
|
}
|
|
268
269
|
function Qe() {
|
|
269
|
-
if (!(typeof window === a || !
|
|
270
|
+
if (!(typeof window === a || !se)) {
|
|
270
271
|
try {
|
|
271
|
-
window.localStorage.removeItem(
|
|
272
|
+
window.localStorage.removeItem(se);
|
|
272
273
|
} catch {
|
|
273
274
|
}
|
|
274
275
|
try {
|
|
275
|
-
window.document.cookie = encodeURIComponent(
|
|
276
|
+
window.document.cookie = encodeURIComponent(se) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
|
|
276
277
|
} catch {
|
|
277
278
|
}
|
|
278
279
|
}
|
|
279
280
|
}
|
|
280
|
-
function
|
|
281
|
-
var
|
|
282
|
-
if (typeof
|
|
283
|
-
return
|
|
284
|
-
throw new TypeError("log.setLevel() called with invalid level: " +
|
|
281
|
+
function ve(z) {
|
|
282
|
+
var R = z;
|
|
283
|
+
if (typeof R == "string" && C.levels[R.toUpperCase()] !== void 0 && (R = C.levels[R.toUpperCase()]), typeof R == "number" && R >= 0 && R <= C.levels.SILENT)
|
|
284
|
+
return R;
|
|
285
|
+
throw new TypeError("log.setLevel() called with invalid level: " + z);
|
|
285
286
|
}
|
|
286
287
|
C.name = $, C.levels = {
|
|
287
288
|
TRACE: 0,
|
|
@@ -290,27 +291,27 @@ var ca = { exports: {} };
|
|
|
290
291
|
WARN: 3,
|
|
291
292
|
ERROR: 4,
|
|
292
293
|
SILENT: 5
|
|
293
|
-
}, C.methodFactory = V ||
|
|
294
|
-
return
|
|
295
|
-
}, C.setLevel = function(
|
|
296
|
-
return
|
|
297
|
-
}, C.setDefaultLevel = function(
|
|
298
|
-
Ae =
|
|
294
|
+
}, C.methodFactory = V || T, C.getLevel = function() {
|
|
295
|
+
return ne ?? Ae ?? Ee;
|
|
296
|
+
}, C.setLevel = function(z, R) {
|
|
297
|
+
return ne = ve(z), R !== !1 && mt(ne), K.call(C);
|
|
298
|
+
}, C.setDefaultLevel = function(z) {
|
|
299
|
+
Ae = ve(z), ze() || C.setLevel(z, !1);
|
|
299
300
|
}, C.resetLevel = function() {
|
|
300
|
-
|
|
301
|
-
}, C.enableAll = function(
|
|
302
|
-
C.setLevel(C.levels.TRACE,
|
|
303
|
-
}, C.disableAll = function(
|
|
304
|
-
C.setLevel(C.levels.SILENT,
|
|
301
|
+
ne = null, Qe(), K.call(C);
|
|
302
|
+
}, C.enableAll = function(z) {
|
|
303
|
+
C.setLevel(C.levels.TRACE, z);
|
|
304
|
+
}, C.disableAll = function(z) {
|
|
305
|
+
C.setLevel(C.levels.SILENT, z);
|
|
305
306
|
}, C.rebuild = function() {
|
|
306
|
-
if (f !== C && (Ee =
|
|
307
|
-
for (var
|
|
308
|
-
d[
|
|
309
|
-
}, Ee =
|
|
307
|
+
if (f !== C && (Ee = ve(f.getLevel())), K.call(C), f === C)
|
|
308
|
+
for (var z in d)
|
|
309
|
+
d[z].rebuild();
|
|
310
|
+
}, Ee = ve(
|
|
310
311
|
f ? f.getLevel() : "WARN"
|
|
311
312
|
);
|
|
312
|
-
var
|
|
313
|
-
|
|
313
|
+
var P = ze();
|
|
314
|
+
P != null && (ne = ve(P)), K.call(C);
|
|
314
315
|
}
|
|
315
316
|
f = new N(), f.getLogger = function(V) {
|
|
316
317
|
if (typeof V != "symbol" && typeof V != "string" || V === "")
|
|
@@ -321,16 +322,16 @@ var ca = { exports: {} };
|
|
|
321
322
|
f.methodFactory
|
|
322
323
|
)), C;
|
|
323
324
|
};
|
|
324
|
-
var
|
|
325
|
+
var Q = typeof window !== a ? window.log : void 0;
|
|
325
326
|
return f.noConflict = function() {
|
|
326
|
-
return typeof window !== a && window.log === f && (window.log =
|
|
327
|
+
return typeof window !== a && window.log === f && (window.log = Q), f;
|
|
327
328
|
}, f.getLoggers = function() {
|
|
328
329
|
return d;
|
|
329
330
|
}, f.default = f, f;
|
|
330
331
|
});
|
|
331
|
-
})(
|
|
332
|
-
var Na =
|
|
333
|
-
const Ke = /* @__PURE__ */
|
|
332
|
+
})(aa);
|
|
333
|
+
var Na = aa.exports;
|
|
334
|
+
const Ke = /* @__PURE__ */ ta(Na), Ua = X`
|
|
334
335
|
:host {
|
|
335
336
|
font-size: 16px;
|
|
336
337
|
}
|
|
@@ -401,7 +402,7 @@ const Ke = /* @__PURE__ */ aa(Na), Ua = Y`
|
|
|
401
402
|
border-radius: 0;
|
|
402
403
|
}
|
|
403
404
|
}
|
|
404
|
-
`,
|
|
405
|
+
`, me = X`
|
|
405
406
|
:host {
|
|
406
407
|
--primary-color: var(--sl-color-primary-600);
|
|
407
408
|
}
|
|
@@ -468,8 +469,8 @@ const Ke = /* @__PURE__ */ aa(Na), Ua = Y`
|
|
|
468
469
|
.text-button:hover {
|
|
469
470
|
text-decoration: underline;
|
|
470
471
|
}
|
|
471
|
-
`,
|
|
472
|
-
${
|
|
472
|
+
`, ca = X`
|
|
473
|
+
${me}
|
|
473
474
|
|
|
474
475
|
:host {
|
|
475
476
|
/*
|
|
@@ -493,7 +494,7 @@ const Ke = /* @__PURE__ */ aa(Na), Ua = Y`
|
|
|
493
494
|
color: white;
|
|
494
495
|
}
|
|
495
496
|
`;
|
|
496
|
-
var Wa = Object.defineProperty, Ya = Object.getOwnPropertyDescriptor,
|
|
497
|
+
var Wa = Object.defineProperty, Ya = Object.getOwnPropertyDescriptor, Tt = (c, e, a, s) => {
|
|
497
498
|
for (var n = s > 1 ? void 0 : s ? Ya(e, a) : e, d = c.length - 1, f; d >= 0; d--)
|
|
498
499
|
(f = c[d]) && (n = (s ? f(e, a, n) : f(n)) || n);
|
|
499
500
|
return s && n && Wa(e, a, n), n;
|
|
@@ -503,18 +504,18 @@ let Ge = class extends ut {
|
|
|
503
504
|
super(...arguments), this.color = "primary", this.svg = "";
|
|
504
505
|
}
|
|
505
506
|
render() {
|
|
506
|
-
return g`<span class="cb-icon" part="base">${
|
|
507
|
+
return g`<span class="cb-icon" part="base">${Y(this.svg)}</span>`;
|
|
507
508
|
}
|
|
508
509
|
};
|
|
509
|
-
Ge.styles =
|
|
510
|
-
|
|
510
|
+
Ge.styles = ca;
|
|
511
|
+
Tt([
|
|
511
512
|
v({ type: String })
|
|
512
513
|
], Ge.prototype, "color", 2);
|
|
513
|
-
|
|
514
|
+
Tt([
|
|
514
515
|
v({ type: String })
|
|
515
516
|
], Ge.prototype, "svg", 2);
|
|
516
|
-
Ge =
|
|
517
|
-
|
|
517
|
+
Ge = Tt([
|
|
518
|
+
J("cb-icon")
|
|
518
519
|
], Ge);
|
|
519
520
|
let Xa = (c) => crypto.getRandomValues(new Uint8Array(c)), Ga = (c, e, a) => {
|
|
520
521
|
let s = (2 << Math.log2(c.length - 1)) - 1, n = -~(1.6 * s * e / c.length);
|
|
@@ -551,26 +552,26 @@ function Qa(c = !0) {
|
|
|
551
552
|
}), a.click();
|
|
552
553
|
});
|
|
553
554
|
}
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
const
|
|
555
|
+
const Z = Ke.noConflict();
|
|
556
|
+
Z.setLevel("info");
|
|
557
|
+
const Ft = 3e4;
|
|
557
558
|
class ec {
|
|
558
559
|
constructor(e = {}) {
|
|
559
|
-
this.id = 0, this.url = (e == null ? void 0 : e.url) || null, this.orgId = (e == null ? void 0 : e.orgId) || null, this.botId = (e == null ? void 0 : e.botId) || null, this.convId = (e == null ? void 0 : e.convId) || null, this._options = e || {}, this._ws = null, this.started = !1, this.connected = !1, this.connecting = !1, this.suspendDetected = !1, this.onMessage = (e == null ? void 0 : e.onMessage) || null, this.onConnecting = (e == null ? void 0 : e.onConnecting) || null, this.queue = [], this.pause = (a) => new Promise((s) => setTimeout(s, a)), this.lastTickTs = 0, this.lastAckTs = 0, this.tickInterval = null,
|
|
560
|
+
this.id = 0, this.url = (e == null ? void 0 : e.url) || null, this.orgId = (e == null ? void 0 : e.orgId) || null, this.botId = (e == null ? void 0 : e.botId) || null, this.convId = (e == null ? void 0 : e.convId) || null, this._options = e || {}, this._ws = null, this.started = !1, this.connected = !1, this.connecting = !1, this.suspendDetected = !1, this.onMessage = (e == null ? void 0 : e.onMessage) || null, this.onConnecting = (e == null ? void 0 : e.onConnecting) || null, this.queue = [], this.pause = (a) => new Promise((s) => setTimeout(s, a)), this.lastTickTs = 0, this.lastAckTs = 0, this.tickInterval = null, Z.info(`WSC: Created, url: ${this.url}`);
|
|
560
561
|
}
|
|
561
562
|
connect(e = {}) {
|
|
562
563
|
if (this._ws)
|
|
563
|
-
return
|
|
564
|
+
return Z.info("WSC: connect - already connecting"), null;
|
|
564
565
|
if (this.url = (e == null ? void 0 : e.url) || this.url, this.connected = !1, !this.url)
|
|
565
|
-
return
|
|
566
|
+
return Z.error("WSC: URL must be provided to connect"), null;
|
|
566
567
|
this.setConnecting(!0);
|
|
567
568
|
const a = this.url;
|
|
568
|
-
|
|
569
|
+
Z.info(`WSC: ${Date.now()}: Connecting to ${a} ...`), this._ws = new WebSocket(a);
|
|
569
570
|
let s = setTimeout(() => {
|
|
570
|
-
|
|
571
|
+
Z.error(`WSC: ${Date.now()}: connected message not received in time - closing ...`), this._ws.close(), this._ws = null, this.connected = !1;
|
|
571
572
|
}, 3e4);
|
|
572
573
|
this._ws.onopen = () => {
|
|
573
|
-
|
|
574
|
+
Z.info(`WSC: ${Date.now()}: Connection to ${a} opened`);
|
|
574
575
|
}, this._ws.onmessage = (n) => {
|
|
575
576
|
let d = (n == null ? void 0 : n.data) || null;
|
|
576
577
|
if (!d)
|
|
@@ -579,20 +580,20 @@ class ec {
|
|
|
579
580
|
try {
|
|
580
581
|
f = JSON.parse(d);
|
|
581
582
|
} catch {
|
|
582
|
-
|
|
583
|
+
Z.error(`WSC: ${Date.now()}: Failed to parse message: ${d}`);
|
|
583
584
|
return;
|
|
584
585
|
}
|
|
585
586
|
if ((f == null ? void 0 : f.type) === "connected")
|
|
586
|
-
|
|
587
|
+
Z.info(`WSC: ${Date.now()}: Got connected message`, f), clearTimeout(s), this.connected = !0, this.suspendDetected = !1, this.lastTickTs = Date.now(), this.setConnecting(!1), this.sendClientInfoMessage(), this.sendQueuedMessages();
|
|
587
588
|
else if ((f == null ? void 0 : f.type) === "ack") {
|
|
588
589
|
const x = Date.now();
|
|
589
590
|
this.lastAckTs = x;
|
|
590
591
|
}
|
|
591
592
|
this.handleWscMessage(f);
|
|
592
593
|
}, this._ws.onerror = (n) => {
|
|
593
|
-
|
|
594
|
+
Z.error(`WSC: ${Date.now()}: Socket error`), clearTimeout(s), this.connected = !1, this._ws = null, this.setConnecting(!1);
|
|
594
595
|
}, this._ws.onclose = (n) => {
|
|
595
|
-
|
|
596
|
+
Z.info(`WSC: ${Date.now()}: Closed - code:${n.code}, reason:"${n.reason}"`), this.connected = !1, this._ws = null, this.setConnecting(!1), this.reconnect();
|
|
596
597
|
};
|
|
597
598
|
}
|
|
598
599
|
reconnect(e = 1e3) {
|
|
@@ -602,10 +603,10 @@ class ec {
|
|
|
602
603
|
}
|
|
603
604
|
disconnect() {
|
|
604
605
|
if (this.connected = !1, !this._ws) {
|
|
605
|
-
|
|
606
|
+
Z.info("WSC: already disconnected");
|
|
606
607
|
return;
|
|
607
608
|
}
|
|
608
|
-
|
|
609
|
+
Z.info("WSC: disconnect"), this._ws.close();
|
|
609
610
|
}
|
|
610
611
|
setConnecting(e = !1) {
|
|
611
612
|
this.connecting !== e && (this.connecting = e, this.onConnecting && typeof this.onConnecting == "function" && this.onConnecting(this.connecting));
|
|
@@ -619,7 +620,7 @@ class ec {
|
|
|
619
620
|
async start() {
|
|
620
621
|
this.started = !0, this.connect(), this.lastTickTs = Date.now(), this.tickInterval = setInterval(() => {
|
|
621
622
|
this.tick();
|
|
622
|
-
},
|
|
623
|
+
}, Ft);
|
|
623
624
|
}
|
|
624
625
|
async stop() {
|
|
625
626
|
this.started = !1, this.disconnect(), this.tickInterval && (clearInterval(this.tickInterval), this.tickInterval = null);
|
|
@@ -628,11 +629,11 @@ class ec {
|
|
|
628
629
|
async startOld() {
|
|
629
630
|
let e = 1, a = !0;
|
|
630
631
|
for (; a; ) {
|
|
631
|
-
if (
|
|
632
|
-
return
|
|
632
|
+
if (Z.info(`WSC: start: connecting, attempt ${e}`), await this.connect(), this.connected)
|
|
633
|
+
return Z.info("WSC: connected"), !0;
|
|
633
634
|
e++, a = e <= 4, a && await this.pause(1e3);
|
|
634
635
|
}
|
|
635
|
-
return
|
|
636
|
+
return Z.error(`WSC: start: failed to connect after ${e} attempts, exiting`), !1;
|
|
636
637
|
}
|
|
637
638
|
handleWscMessage(e) {
|
|
638
639
|
this.onMessage && typeof this.onMessage == "function" && this.onMessage(e);
|
|
@@ -656,7 +657,7 @@ class ec {
|
|
|
656
657
|
const e = Date.now();
|
|
657
658
|
let a = !1;
|
|
658
659
|
const s = e - this.lastAckTs;
|
|
659
|
-
s >
|
|
660
|
+
s > Ft + 5e3 && (a = !0, Z.info(`WSC: checkConnection: connection loss detected - last ack delay ${s} msec, reconnecting`)), a && this.disconnect();
|
|
660
661
|
}
|
|
661
662
|
sendMessage(e) {
|
|
662
663
|
if (this.checkConnection(), !this.connected) {
|
|
@@ -668,7 +669,7 @@ class ec {
|
|
|
668
669
|
sendQueuedMessages() {
|
|
669
670
|
if (Array.isArray(this.queue) && this.queue.length > 0)
|
|
670
671
|
for (let e = 0; e < this.queue.length; e++)
|
|
671
|
-
|
|
672
|
+
Z.info("Sending queued message", this.queue[e]), this._ws.send(this.queue[e]);
|
|
672
673
|
this.queue = [];
|
|
673
674
|
}
|
|
674
675
|
// Request assumes that response will be received.
|
|
@@ -706,7 +707,7 @@ class ec {
|
|
|
706
707
|
function D(c) {
|
|
707
708
|
return c != null && typeof c == "object" && c["@@functional/placeholder"] === !0;
|
|
708
709
|
}
|
|
709
|
-
function
|
|
710
|
+
function Oe(c) {
|
|
710
711
|
return function e(a) {
|
|
711
712
|
return arguments.length === 0 || D(a) ? e : c.apply(this, arguments);
|
|
712
713
|
};
|
|
@@ -717,13 +718,13 @@ function qe(c) {
|
|
|
717
718
|
case 0:
|
|
718
719
|
return e;
|
|
719
720
|
case 1:
|
|
720
|
-
return D(a) ? e :
|
|
721
|
+
return D(a) ? e : Oe(function(n) {
|
|
721
722
|
return c(a, n);
|
|
722
723
|
});
|
|
723
724
|
default:
|
|
724
|
-
return D(a) && D(s) ? e : D(a) ?
|
|
725
|
+
return D(a) && D(s) ? e : D(a) ? Oe(function(n) {
|
|
725
726
|
return c(n, s);
|
|
726
|
-
}) : D(s) ?
|
|
727
|
+
}) : D(s) ? Oe(function(n) {
|
|
727
728
|
return c(a, n);
|
|
728
729
|
}) : c(a, s);
|
|
729
730
|
}
|
|
@@ -743,7 +744,7 @@ function tc(c) {
|
|
|
743
744
|
return c(d, s, f);
|
|
744
745
|
}) : D(s) ? qe(function(d, f) {
|
|
745
746
|
return c(a, d, f);
|
|
746
|
-
}) :
|
|
747
|
+
}) : Oe(function(d) {
|
|
747
748
|
return c(a, s, d);
|
|
748
749
|
});
|
|
749
750
|
default:
|
|
@@ -753,11 +754,11 @@ function tc(c) {
|
|
|
753
754
|
return c(d, s, f);
|
|
754
755
|
}) : D(s) && D(n) ? qe(function(d, f) {
|
|
755
756
|
return c(a, d, f);
|
|
756
|
-
}) : D(a) ?
|
|
757
|
+
}) : D(a) ? Oe(function(d) {
|
|
757
758
|
return c(d, s, n);
|
|
758
|
-
}) : D(s) ?
|
|
759
|
+
}) : D(s) ? Oe(function(d) {
|
|
759
760
|
return c(a, d, n);
|
|
760
|
-
}) : D(n) ?
|
|
761
|
+
}) : D(n) ? Oe(function(d) {
|
|
761
762
|
return c(a, s, d);
|
|
762
763
|
}) : c(a, s, n);
|
|
763
764
|
}
|
|
@@ -796,8 +797,8 @@ var rc = Object.defineProperty, O = (c, e, a, s) => {
|
|
|
796
797
|
};
|
|
797
798
|
const I = Ke.noConflict();
|
|
798
799
|
I.setLevel("info");
|
|
799
|
-
const
|
|
800
|
-
class
|
|
800
|
+
const ie = "cb_";
|
|
801
|
+
class L extends kt {
|
|
801
802
|
constructor() {
|
|
802
803
|
super(...arguments), this.actionIdCounter = 0, this.prefilledFormValues = {}, this.wsClient = null, this.replyMessage = null, this.streamingResponseInProgress = !1, this.streamingResponseLastText = null, this.streamingResponseBuffer = null, this.streamingResponseTagStartPos = 0, this.streamingResponseCurrentTag = null;
|
|
803
804
|
}
|
|
@@ -872,7 +873,7 @@ class P extends kt {
|
|
|
872
873
|
}
|
|
873
874
|
clearConversation() {
|
|
874
875
|
this.wsClient && (this.wsClient.stop().then(() => {
|
|
875
|
-
}), this.wsClient = null), this.conversationId = Ve(), this.lastConversationUpdate = Date.now(), this.connectWs = "false", this.shouldEngage = "true", this.messages = [], this.actions = [], this.form = null, this.addMessage({
|
|
876
|
+
}), this.wsClient = null), this.conversationId = Ve(), this.lastConversationUpdate = Date.now(), this.connectWs = "false", this.shouldEngage = "true", this.messages = [], this.unreadMessages = 0, this.actions = [], this.form = null, this.addMessage({
|
|
876
877
|
author: "assistant",
|
|
877
878
|
type: "text",
|
|
878
879
|
data: {
|
|
@@ -903,7 +904,7 @@ class P extends kt {
|
|
|
903
904
|
I.info("form has no fields", e);
|
|
904
905
|
return;
|
|
905
906
|
}
|
|
906
|
-
const d = `${
|
|
907
|
+
const d = `${ie}${this.setting.botId}.${this.conversationId}.form.${s}`, f = localStorage.getItem(d);
|
|
907
908
|
if (f) {
|
|
908
909
|
let x = null;
|
|
909
910
|
try {
|
|
@@ -924,9 +925,9 @@ class P extends kt {
|
|
|
924
925
|
this.engage = !1, this.shouldEngage = "false";
|
|
925
926
|
}
|
|
926
927
|
showEngagePopup() {
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
928
|
+
this.open || (I.info("Engaging User !"), this.engage = !0, this.playAudioNotification());
|
|
929
|
+
}
|
|
930
|
+
playAudioNotification() {
|
|
930
931
|
const e = (d) => {
|
|
931
932
|
const f = new Uint8Array(d.length / 2);
|
|
932
933
|
for (let x = 0; x < f.length; x++)
|
|
@@ -989,6 +990,7 @@ class P extends kt {
|
|
|
989
990
|
const n = this.formatMessage(s);
|
|
990
991
|
this.messages = this.messages.concat([n]);
|
|
991
992
|
}
|
|
993
|
+
this.open || (this.unreadMessages++, this.playAudioNotification());
|
|
992
994
|
break;
|
|
993
995
|
}
|
|
994
996
|
case "message-chunk": {
|
|
@@ -1185,7 +1187,7 @@ class P extends kt {
|
|
|
1185
1187
|
I.info("submitForm: No form is active - ignored");
|
|
1186
1188
|
return;
|
|
1187
1189
|
}
|
|
1188
|
-
const a = `${
|
|
1190
|
+
const a = `${ie}${this.setting.botId}.${this.conversationId}.form.${this.form.name}`;
|
|
1189
1191
|
await this.sendFormData(this.form.name, e), localStorage.setItem(a, JSON.stringify(e)), "name" in e && (this.feedbackName = e.name), "email" in e && (this.feedbackEmail = e.email), this.form = null;
|
|
1190
1192
|
}
|
|
1191
1193
|
async sendFormData(e, a) {
|
|
@@ -1241,39 +1243,43 @@ class P extends kt {
|
|
|
1241
1243
|
}
|
|
1242
1244
|
}
|
|
1243
1245
|
O([
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
],
|
|
1246
|
+
de({ prefix: ie }),
|
|
1247
|
+
q({ value: "en" })
|
|
1248
|
+
], L.prototype, "language");
|
|
1249
|
+
O([
|
|
1250
|
+
de({ prefix: ie }),
|
|
1251
|
+
q({ value: "light" })
|
|
1252
|
+
], L.prototype, "theme");
|
|
1247
1253
|
O([
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
],
|
|
1254
|
+
de({ prefix: ie }),
|
|
1255
|
+
q({ type: Boolean, value: !1 })
|
|
1256
|
+
], L.prototype, "open");
|
|
1251
1257
|
O([
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
], P.prototype, "open");
|
|
1258
|
+
q({ type: Boolean, value: !1 })
|
|
1259
|
+
], L.prototype, "alwaysOpen");
|
|
1255
1260
|
O([
|
|
1256
|
-
|
|
1257
|
-
|
|
1261
|
+
de({ prefix: ie }),
|
|
1262
|
+
q({ value: "false" })
|
|
1263
|
+
], L.prototype, "connectWs");
|
|
1258
1264
|
O([
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
],
|
|
1265
|
+
de({ prefix: ie }),
|
|
1266
|
+
q({ value: Ve() })
|
|
1267
|
+
], L.prototype, "conversationId");
|
|
1262
1268
|
O([
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
],
|
|
1269
|
+
de({ prefix: ie }),
|
|
1270
|
+
q({ value: 0 })
|
|
1271
|
+
], L.prototype, "lastConversationUpdate");
|
|
1266
1272
|
O([
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
],
|
|
1273
|
+
de({ prefix: ie }),
|
|
1274
|
+
q({ type: Array, value: [] })
|
|
1275
|
+
], L.prototype, "messages");
|
|
1270
1276
|
O([
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
],
|
|
1277
|
+
de({ prefix: ie }),
|
|
1278
|
+
q({ value: 0 })
|
|
1279
|
+
], L.prototype, "unreadMessages");
|
|
1274
1280
|
O([
|
|
1275
|
-
|
|
1276
|
-
|
|
1281
|
+
de({ prefix: ie }),
|
|
1282
|
+
q({
|
|
1277
1283
|
type: Array,
|
|
1278
1284
|
value: []
|
|
1279
1285
|
/*
|
|
@@ -1315,35 +1321,35 @@ O([
|
|
|
1315
1321
|
},
|
|
1316
1322
|
],*/
|
|
1317
1323
|
})
|
|
1318
|
-
],
|
|
1324
|
+
], L.prototype, "actions");
|
|
1319
1325
|
O([
|
|
1320
|
-
|
|
1321
|
-
],
|
|
1326
|
+
q({ type: Object, value: null })
|
|
1327
|
+
], L.prototype, "form");
|
|
1322
1328
|
O([
|
|
1323
|
-
|
|
1324
|
-
],
|
|
1329
|
+
q({ type: Boolean, value: !1 })
|
|
1330
|
+
], L.prototype, "botSettingsInitialized");
|
|
1325
1331
|
O([
|
|
1326
|
-
|
|
1327
|
-
],
|
|
1332
|
+
q({ type: Number, value: 5 })
|
|
1333
|
+
], L.prototype, "botSettingsRetryTimeout");
|
|
1328
1334
|
O([
|
|
1329
|
-
|
|
1330
|
-
],
|
|
1335
|
+
q({ type: Object, value: null })
|
|
1336
|
+
], L.prototype, "botSettings");
|
|
1331
1337
|
O([
|
|
1332
|
-
|
|
1333
|
-
],
|
|
1338
|
+
q({ type: Boolean, value: !0 })
|
|
1339
|
+
], L.prototype, "disabled");
|
|
1334
1340
|
O([
|
|
1335
|
-
|
|
1336
|
-
],
|
|
1341
|
+
q({ type: Boolean, value: !1 })
|
|
1342
|
+
], L.prototype, "connecting");
|
|
1337
1343
|
O([
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
],
|
|
1344
|
+
de({ prefix: ie }),
|
|
1345
|
+
q({ value: "true" })
|
|
1346
|
+
], L.prototype, "shouldEngage");
|
|
1341
1347
|
O([
|
|
1342
|
-
|
|
1343
|
-
],
|
|
1348
|
+
q({ type: Boolean, value: !1 })
|
|
1349
|
+
], L.prototype, "engage");
|
|
1344
1350
|
O([
|
|
1345
|
-
|
|
1346
|
-
|
|
1351
|
+
de({ prefix: ie }),
|
|
1352
|
+
q({
|
|
1347
1353
|
type: Object,
|
|
1348
1354
|
value: {
|
|
1349
1355
|
orgId: null,
|
|
@@ -1354,44 +1360,47 @@ O([
|
|
|
1354
1360
|
feedbackEnabled: !1
|
|
1355
1361
|
}
|
|
1356
1362
|
})
|
|
1357
|
-
],
|
|
1363
|
+
], L.prototype, "setting");
|
|
1364
|
+
O([
|
|
1365
|
+
q({ type: String, value: "top-end" })
|
|
1366
|
+
], L.prototype, "appearanceAnchorPopupPosition");
|
|
1358
1367
|
O([
|
|
1359
|
-
|
|
1360
|
-
],
|
|
1368
|
+
q({ type: String, value: "danger" })
|
|
1369
|
+
], L.prototype, "appearanceAnchorBadgeVariant");
|
|
1361
1370
|
O([
|
|
1362
|
-
|
|
1363
|
-
],
|
|
1371
|
+
q({ type: String, value: "right" })
|
|
1372
|
+
], L.prototype, "appearanceUserMessageAvatarPosition");
|
|
1364
1373
|
O([
|
|
1365
|
-
|
|
1366
|
-
],
|
|
1374
|
+
q({ type: Boolean, value: !1 })
|
|
1375
|
+
], L.prototype, "feedback");
|
|
1367
1376
|
O([
|
|
1368
|
-
|
|
1369
|
-
],
|
|
1377
|
+
q({ type: Number, value: 5 })
|
|
1378
|
+
], L.prototype, "feedbackScore");
|
|
1370
1379
|
O([
|
|
1371
|
-
|
|
1372
|
-
],
|
|
1380
|
+
q({ type: String, value: "" })
|
|
1381
|
+
], L.prototype, "feedbackUserMessage");
|
|
1373
1382
|
O([
|
|
1374
|
-
|
|
1375
|
-
],
|
|
1383
|
+
q({ type: String, value: "" })
|
|
1384
|
+
], L.prototype, "feedbackAnswerMessageId");
|
|
1376
1385
|
O([
|
|
1377
|
-
|
|
1378
|
-
],
|
|
1386
|
+
q({ type: String, value: "" })
|
|
1387
|
+
], L.prototype, "feedbackAnswer");
|
|
1379
1388
|
O([
|
|
1380
|
-
|
|
1381
|
-
],
|
|
1389
|
+
q({ type: String, value: "" })
|
|
1390
|
+
], L.prototype, "feedbackAnswerUserName");
|
|
1382
1391
|
O([
|
|
1383
|
-
|
|
1384
|
-
],
|
|
1392
|
+
q({ type: Array, value: [] })
|
|
1393
|
+
], L.prototype, "feedbackMessages");
|
|
1385
1394
|
O([
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
],
|
|
1395
|
+
de({ prefix: ie }),
|
|
1396
|
+
q({ type: String, value: "" })
|
|
1397
|
+
], L.prototype, "feedbackName");
|
|
1389
1398
|
O([
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
],
|
|
1393
|
-
const p = new
|
|
1394
|
-
${
|
|
1399
|
+
de({ prefix: ie }),
|
|
1400
|
+
q({ type: String, value: "" })
|
|
1401
|
+
], L.prototype, "feedbackEmail");
|
|
1402
|
+
const p = new L(), dc = X`
|
|
1403
|
+
${me}
|
|
1395
1404
|
:host {
|
|
1396
1405
|
position: relative;
|
|
1397
1406
|
font-weight: bold;
|
|
@@ -1491,7 +1500,7 @@ class ee extends ut {
|
|
|
1491
1500
|
lc([
|
|
1492
1501
|
v({ type: String })
|
|
1493
1502
|
], ee.prototype, "lang");
|
|
1494
|
-
var bc = Object.defineProperty, hc = Object.getOwnPropertyDescriptor,
|
|
1503
|
+
var bc = Object.defineProperty, hc = Object.getOwnPropertyDescriptor, ia = (c, e, a, s) => {
|
|
1495
1504
|
for (var n = s > 1 ? void 0 : s ? hc(e, a) : e, d = c.length - 1, f; d >= 0; d--)
|
|
1496
1505
|
(f = c[d]) && (n = (s ? f(e, a, n) : f(n)) || n);
|
|
1497
1506
|
return s && n && bc(e, a, n), n;
|
|
@@ -1508,31 +1517,31 @@ let ot = class extends ee {
|
|
|
1508
1517
|
*/
|
|
1509
1518
|
renderExp() {
|
|
1510
1519
|
return g` <header class="cb-header" part="header">
|
|
1511
|
-
${
|
|
1520
|
+
${ce(
|
|
1512
1521
|
p.setting.logoUrl !== "",
|
|
1513
1522
|
() => g`<img class="cb-header-logo" part="header-logo" src="${p.setting.logoUrl}" />`,
|
|
1514
|
-
() => g`<div class="cb-header-logo" part="header-logo">${
|
|
1523
|
+
() => g`<div class="cb-header-logo" part="header-logo">${Y(p.setting.logoSvg)}</div>`
|
|
1515
1524
|
)}
|
|
1516
1525
|
<div class="cb-header-title" part="header-title">${this.title}</div>
|
|
1517
|
-
${
|
|
1526
|
+
${ce(
|
|
1518
1527
|
p.alwaysOpen,
|
|
1519
1528
|
() => g``,
|
|
1520
|
-
() => g`<div class="cb-header-close" part="header-close">${
|
|
1529
|
+
() => g`<div class="cb-header-close" part="header-close">${Y(uc)}</div>`
|
|
1521
1530
|
)}
|
|
1522
1531
|
</header>`;
|
|
1523
1532
|
}
|
|
1524
1533
|
render() {
|
|
1525
1534
|
return g` <header class="cb-header" part="header">
|
|
1526
|
-
${
|
|
1535
|
+
${ce(
|
|
1527
1536
|
p.setting.logoUrl !== "",
|
|
1528
1537
|
() => g`<img class="cb-header-img" part="header-logo" src="${p.setting.logoUrl}" />`,
|
|
1529
|
-
() => g`<div class="cb-header-logo" part="header-logo">${
|
|
1538
|
+
() => g`<div class="cb-header-logo" part="header-logo">${Y(p.setting.logoSvg)}</div>`
|
|
1530
1539
|
)}
|
|
1531
1540
|
<div class="cb-header-title" part="header-title">${this.title}</div>
|
|
1532
|
-
${
|
|
1541
|
+
${ce(
|
|
1533
1542
|
p.alwaysOpen,
|
|
1534
1543
|
() => g`<div></div>`,
|
|
1535
|
-
() => g`<div @click=${this._clickCloseHandler} class="cb-header-close" part="header-close">${
|
|
1544
|
+
() => g`<div @click=${this._clickCloseHandler} class="cb-header-close" part="header-close">${Y(p.setting.closeSvg)}</div>`
|
|
1536
1545
|
)}
|
|
1537
1546
|
</header>`;
|
|
1538
1547
|
}
|
|
@@ -1560,14 +1569,14 @@ let ot = class extends ee {
|
|
|
1560
1569
|
}
|
|
1561
1570
|
};
|
|
1562
1571
|
ot.styles = dc;
|
|
1563
|
-
|
|
1572
|
+
ia([
|
|
1564
1573
|
v({ type: String, attribute: "title" })
|
|
1565
1574
|
], ot.prototype, "title", 2);
|
|
1566
|
-
ot =
|
|
1567
|
-
|
|
1575
|
+
ot = ia([
|
|
1576
|
+
J("cb-header")
|
|
1568
1577
|
], ot);
|
|
1569
|
-
const pc =
|
|
1570
|
-
${
|
|
1578
|
+
const pc = X`
|
|
1579
|
+
${me}
|
|
1571
1580
|
.cb-footer {
|
|
1572
1581
|
line-height: 60px;
|
|
1573
1582
|
font-size: 16px;
|
|
@@ -1623,10 +1632,10 @@ let Ct = class extends ee {
|
|
|
1623
1632
|
};
|
|
1624
1633
|
Ct.styles = pc;
|
|
1625
1634
|
Ct = yc([
|
|
1626
|
-
|
|
1635
|
+
J("cb-footer")
|
|
1627
1636
|
], Ct);
|
|
1628
|
-
const vc =
|
|
1629
|
-
${
|
|
1637
|
+
const vc = X`
|
|
1638
|
+
${me}
|
|
1630
1639
|
|
|
1631
1640
|
:host {
|
|
1632
1641
|
width: 100%;
|
|
@@ -1790,11 +1799,11 @@ const vc = Y`
|
|
|
1790
1799
|
transition: background 0s;
|
|
1791
1800
|
}
|
|
1792
1801
|
`;
|
|
1793
|
-
var
|
|
1802
|
+
var na = { exports: {} };
|
|
1794
1803
|
(function(c, e) {
|
|
1795
1804
|
(function(a, s) {
|
|
1796
1805
|
c.exports = s();
|
|
1797
|
-
})(
|
|
1806
|
+
})(ea, function() {
|
|
1798
1807
|
function a(t) {
|
|
1799
1808
|
var i = function(o, r) {
|
|
1800
1809
|
if (typeof o != "object" || !o) return o;
|
|
@@ -1840,35 +1849,35 @@ var sa = { exports: {} };
|
|
|
1840
1849
|
return t;
|
|
1841
1850
|
}
|
|
1842
1851
|
function _(t, i) {
|
|
1843
|
-
if ((
|
|
1852
|
+
if ((R(t) || t === window || t === document) && (t = [t]), We(t) || Ce(t) || (t = [t]), qt(t) != 0) {
|
|
1844
1853
|
if (We(t) && !Ce(t)) for (var o = t.length, r = 0; r < o && i.call(t[r], t[r], r, t) !== !1; r++) ;
|
|
1845
1854
|
else if (Ce(t)) {
|
|
1846
1855
|
for (var l in t) if (W(t, l) && i.call(t[l], t[l], l, t) === !1) break;
|
|
1847
1856
|
}
|
|
1848
1857
|
}
|
|
1849
1858
|
}
|
|
1850
|
-
function
|
|
1859
|
+
function K(t) {
|
|
1851
1860
|
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null, o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, r = t[x] = t[x] || [], l = { all: r, evt: null, found: null };
|
|
1852
|
-
return i && o &&
|
|
1861
|
+
return i && o && qt(r) > 0 && _(r, function(h, b) {
|
|
1853
1862
|
if (h.eventName == i && h.fn.toString() == o.toString()) return l.found = !0, l.evt = b, !1;
|
|
1854
1863
|
}), l;
|
|
1855
1864
|
}
|
|
1856
1865
|
function F(t) {
|
|
1857
1866
|
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = i.onElement, r = i.withCallback, l = i.avoidDuplicate, h = l === void 0 || l, b = i.once, u = b !== void 0 && b, y = i.useCapture, m = y !== void 0 && y, w = arguments.length > 2 ? arguments[2] : void 0, k = o || [];
|
|
1858
|
-
function
|
|
1859
|
-
|
|
1867
|
+
function M(E) {
|
|
1868
|
+
P(r) && r.call(w, E, this), u && M.destroy();
|
|
1860
1869
|
}
|
|
1861
|
-
return
|
|
1870
|
+
return z(k) && (k = document.querySelectorAll(k)), M.destroy = function() {
|
|
1862
1871
|
_(k, function(E) {
|
|
1863
|
-
var A =
|
|
1864
|
-
A.found && A.all.splice(A.evt, 1), E.removeEventListener && E.removeEventListener(t,
|
|
1872
|
+
var A = K(E, t, M);
|
|
1873
|
+
A.found && A.all.splice(A.evt, 1), E.removeEventListener && E.removeEventListener(t, M, m);
|
|
1865
1874
|
});
|
|
1866
1875
|
}, _(k, function(E) {
|
|
1867
|
-
var A =
|
|
1868
|
-
(E.addEventListener && h && !A.found || !h) && (E.addEventListener(t,
|
|
1869
|
-
}),
|
|
1876
|
+
var A = K(E, t, M);
|
|
1877
|
+
(E.addEventListener && h && !A.found || !h) && (E.addEventListener(t, M, m), A.all.push({ eventName: t, fn: M }));
|
|
1878
|
+
}), M;
|
|
1870
1879
|
}
|
|
1871
|
-
function
|
|
1880
|
+
function T(t, i) {
|
|
1872
1881
|
_(i.split(" "), function(o) {
|
|
1873
1882
|
return t.classList.add(o);
|
|
1874
1883
|
});
|
|
@@ -1878,7 +1887,7 @@ var sa = { exports: {} };
|
|
|
1878
1887
|
return t.classList.remove(o);
|
|
1879
1888
|
});
|
|
1880
1889
|
}
|
|
1881
|
-
function
|
|
1890
|
+
function Q(t, i) {
|
|
1882
1891
|
return t.classList.contains(i);
|
|
1883
1892
|
}
|
|
1884
1893
|
function $(t, i) {
|
|
@@ -1890,14 +1899,14 @@ var sa = { exports: {} };
|
|
|
1890
1899
|
function V(t) {
|
|
1891
1900
|
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", o = arguments.length > 2 && arguments[2] !== void 0 && arguments[2];
|
|
1892
1901
|
if (!t || i === "") return !1;
|
|
1893
|
-
if (i === "none") return
|
|
1902
|
+
if (i === "none") return P(o) && o(), !1;
|
|
1894
1903
|
var r = mt(), l = i.split(" ");
|
|
1895
1904
|
_(l, function(h) {
|
|
1896
|
-
|
|
1905
|
+
T(t, "g" + h);
|
|
1897
1906
|
}), F(r, { onElement: t, avoidDuplicate: !1, once: !0, withCallback: function(h, b) {
|
|
1898
1907
|
_(l, function(u) {
|
|
1899
1908
|
N(b, "g" + u);
|
|
1900
|
-
}),
|
|
1909
|
+
}), P(o) && o();
|
|
1901
1910
|
} });
|
|
1902
1911
|
}
|
|
1903
1912
|
function C(t) {
|
|
@@ -1911,19 +1920,19 @@ var sa = { exports: {} };
|
|
|
1911
1920
|
function Ae(t) {
|
|
1912
1921
|
t.style.display = "none";
|
|
1913
1922
|
}
|
|
1914
|
-
function
|
|
1923
|
+
function ne(t) {
|
|
1915
1924
|
var i = document.createDocumentFragment(), o = document.createElement("div");
|
|
1916
1925
|
for (o.innerHTML = t; o.firstChild; ) i.appendChild(o.firstChild);
|
|
1917
1926
|
return i;
|
|
1918
1927
|
}
|
|
1919
|
-
function
|
|
1928
|
+
function se() {
|
|
1920
1929
|
return { width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight };
|
|
1921
1930
|
}
|
|
1922
1931
|
function mt() {
|
|
1923
1932
|
var t, i = document.createElement("fakeelement"), o = { animation: "animationend", OAnimation: "oAnimationEnd", MozAnimation: "animationend", WebkitAnimation: "webkitAnimationEnd" };
|
|
1924
1933
|
for (t in o) if (i.style[t] !== void 0) return o[t];
|
|
1925
1934
|
}
|
|
1926
|
-
function
|
|
1935
|
+
function ze(t, i, o, r) {
|
|
1927
1936
|
if (t()) i();
|
|
1928
1937
|
else {
|
|
1929
1938
|
var l;
|
|
@@ -1935,17 +1944,17 @@ var sa = { exports: {} };
|
|
|
1935
1944
|
}
|
|
1936
1945
|
function Qe(t, i, o) {
|
|
1937
1946
|
if (oe(t)) console.error("Inject assets error");
|
|
1938
|
-
else if (
|
|
1947
|
+
else if (P(i) && (o = i, i = !1), z(i) && i in window) P(o) && o();
|
|
1939
1948
|
else {
|
|
1940
1949
|
var r;
|
|
1941
1950
|
if (t.indexOf(".css") !== -1) {
|
|
1942
|
-
if ((r = document.querySelectorAll('link[href="' + t + '"]')) && r.length > 0) return void (
|
|
1951
|
+
if ((r = document.querySelectorAll('link[href="' + t + '"]')) && r.length > 0) return void (P(o) && o());
|
|
1943
1952
|
var l = document.getElementsByTagName("head")[0], h = l.querySelectorAll('link[rel="stylesheet"]'), b = document.createElement("link");
|
|
1944
|
-
return b.rel = "stylesheet", b.type = "text/css", b.href = t, b.media = "all", h ? l.insertBefore(b, h[0]) : l.appendChild(b), void (
|
|
1953
|
+
return b.rel = "stylesheet", b.type = "text/css", b.href = t, b.media = "all", h ? l.insertBefore(b, h[0]) : l.appendChild(b), void (P(o) && o());
|
|
1945
1954
|
}
|
|
1946
1955
|
if ((r = document.querySelectorAll('script[src="' + t + '"]')) && r.length > 0) {
|
|
1947
|
-
if (
|
|
1948
|
-
if (
|
|
1956
|
+
if (P(o)) {
|
|
1957
|
+
if (z(i)) return ze(function() {
|
|
1949
1958
|
return window[i] !== void 0;
|
|
1950
1959
|
}, function() {
|
|
1951
1960
|
o();
|
|
@@ -1955,8 +1964,8 @@ var sa = { exports: {} };
|
|
|
1955
1964
|
} else {
|
|
1956
1965
|
var u = document.createElement("script");
|
|
1957
1966
|
u.type = "text/javascript", u.src = t, u.onload = function() {
|
|
1958
|
-
if (
|
|
1959
|
-
if (
|
|
1967
|
+
if (P(o)) {
|
|
1968
|
+
if (z(i)) return ze(function() {
|
|
1960
1969
|
return window[i] !== void 0;
|
|
1961
1970
|
}, function() {
|
|
1962
1971
|
o();
|
|
@@ -1967,16 +1976,16 @@ var sa = { exports: {} };
|
|
|
1967
1976
|
}
|
|
1968
1977
|
}
|
|
1969
1978
|
}
|
|
1970
|
-
function
|
|
1979
|
+
function ve() {
|
|
1971
1980
|
return "navigator" in window && window.navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i);
|
|
1972
1981
|
}
|
|
1973
|
-
function
|
|
1982
|
+
function P(t) {
|
|
1974
1983
|
return typeof t == "function";
|
|
1975
1984
|
}
|
|
1976
|
-
function
|
|
1985
|
+
function z(t) {
|
|
1977
1986
|
return typeof t == "string";
|
|
1978
1987
|
}
|
|
1979
|
-
function
|
|
1988
|
+
function R(t) {
|
|
1980
1989
|
return !(!t || !t.nodeType || t.nodeType != 1);
|
|
1981
1990
|
}
|
|
1982
1991
|
function Ie(t) {
|
|
@@ -1986,7 +1995,7 @@ var sa = { exports: {} };
|
|
|
1986
1995
|
return t && t.length && isFinite(t.length);
|
|
1987
1996
|
}
|
|
1988
1997
|
function Ce(t) {
|
|
1989
|
-
return s(t) === "object" && t != null && !
|
|
1998
|
+
return s(t) === "object" && t != null && !P(t) && !Ie(t);
|
|
1990
1999
|
}
|
|
1991
2000
|
function oe(t) {
|
|
1992
2001
|
return t == null;
|
|
@@ -1994,7 +2003,7 @@ var sa = { exports: {} };
|
|
|
1994
2003
|
function W(t, i) {
|
|
1995
2004
|
return t !== null && hasOwnProperty.call(t, i);
|
|
1996
2005
|
}
|
|
1997
|
-
function
|
|
2006
|
+
function qt(t) {
|
|
1998
2007
|
if (Ce(t)) {
|
|
1999
2008
|
if (t.keys) return t.keys().length;
|
|
2000
2009
|
var i = 0;
|
|
@@ -2006,7 +2015,7 @@ var sa = { exports: {} };
|
|
|
2006
2015
|
function et(t) {
|
|
2007
2016
|
return !isNaN(parseFloat(t)) && isFinite(t);
|
|
2008
2017
|
}
|
|
2009
|
-
function
|
|
2018
|
+
function Ot() {
|
|
2010
2019
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1, i = document.querySelectorAll(".gbtn[data-taborder]:not(.disabled)");
|
|
2011
2020
|
if (!i.length) return !1;
|
|
2012
2021
|
if (i.length == 1) return i[0];
|
|
@@ -2038,11 +2047,11 @@ var sa = { exports: {} };
|
|
|
2038
2047
|
var b = document.querySelectorAll(".gbtn[data-taborder]");
|
|
2039
2048
|
if (!b || b.length <= 0) return;
|
|
2040
2049
|
if (!l) {
|
|
2041
|
-
var u =
|
|
2042
|
-
return void (u && (u.focus(),
|
|
2050
|
+
var u = Ot();
|
|
2051
|
+
return void (u && (u.focus(), T(u, "focused")));
|
|
2043
2052
|
}
|
|
2044
|
-
var y =
|
|
2045
|
-
N(l, "focused"), y && (y.focus(),
|
|
2053
|
+
var y = Ot(l.getAttribute("data-taborder"));
|
|
2054
|
+
N(l, "focused"), y && (y.focus(), T(y, "focused"));
|
|
2046
2055
|
}
|
|
2047
2056
|
r == 39 && t.nextSlide(), r == 37 && t.prevSlide(), r == 27 && t.close();
|
|
2048
2057
|
} });
|
|
@@ -2089,16 +2098,16 @@ var sa = { exports: {} };
|
|
|
2089
2098
|
t.style.transform = "translate3d(" + i + "px, " + o + "px, 0)";
|
|
2090
2099
|
} }, { key: "widowWidth", value: function() {
|
|
2091
2100
|
return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
|
|
2092
|
-
} }]),
|
|
2101
|
+
} }]), Pt = f(function t() {
|
|
2093
2102
|
var i = this, o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2094
2103
|
n(this, t);
|
|
2095
2104
|
var r = o.dragEl, l = o.toleranceX, h = l === void 0 ? 40 : l, b = o.toleranceY, u = b === void 0 ? 65 : b, y = o.slide, m = y === void 0 ? null : y, w = o.instance, k = w === void 0 ? null : w;
|
|
2096
|
-
this.el = r, this.active = !1, this.dragging = !1, this.currentX = null, this.currentY = null, this.initialX = null, this.initialY = null, this.xOffset = 0, this.yOffset = 0, this.direction = null, this.lastDirection = null, this.toleranceX = h, this.toleranceY = u, this.toleranceReached = !1, this.dragContainer = this.el, this.slide = m, this.instance = k, this.el.addEventListener("mousedown", function(
|
|
2097
|
-
return i.dragStart(
|
|
2098
|
-
}, !1), this.el.addEventListener("mouseup", function(
|
|
2099
|
-
return i.dragEnd(
|
|
2100
|
-
}, !1), this.el.addEventListener("mousemove", function(
|
|
2101
|
-
return i.drag(
|
|
2105
|
+
this.el = r, this.active = !1, this.dragging = !1, this.currentX = null, this.currentY = null, this.initialX = null, this.initialY = null, this.xOffset = 0, this.yOffset = 0, this.direction = null, this.lastDirection = null, this.toleranceX = h, this.toleranceY = u, this.toleranceReached = !1, this.dragContainer = this.el, this.slide = m, this.instance = k, this.el.addEventListener("mousedown", function(M) {
|
|
2106
|
+
return i.dragStart(M);
|
|
2107
|
+
}, !1), this.el.addEventListener("mouseup", function(M) {
|
|
2108
|
+
return i.dragEnd(M);
|
|
2109
|
+
}, !1), this.el.addEventListener("mousemove", function(M) {
|
|
2110
|
+
return i.drag(M);
|
|
2102
2111
|
}, !1);
|
|
2103
2112
|
}, [{ key: "dragStart", value: function(t) {
|
|
2104
2113
|
if (this.slide.classList.contains("zoomed")) this.active = !1;
|
|
@@ -2144,40 +2153,40 @@ var sa = { exports: {} };
|
|
|
2144
2153
|
function wa(t, i, o, r) {
|
|
2145
2154
|
var l = t.querySelector(".gslide-media"), h = new Image(), b = "gSlideTitle_" + o, u = "gSlideDesc_" + o;
|
|
2146
2155
|
h.addEventListener("load", function() {
|
|
2147
|
-
|
|
2156
|
+
P(r) && r();
|
|
2148
2157
|
}, !1), h.src = i.href, i.sizes != "" && i.srcset != "" && (h.sizes = i.sizes, h.srcset = i.srcset), h.alt = "", oe(i.alt) || i.alt === "" || (h.alt = i.alt), i.title !== "" && h.setAttribute("aria-labelledby", b), i.description !== "" && h.setAttribute("aria-describedby", u), i.hasOwnProperty("_hasCustomWidth") && i._hasCustomWidth && (h.style.width = i.width), i.hasOwnProperty("_hasCustomHeight") && i._hasCustomHeight && (h.style.height = i.height), l.insertBefore(h, l.firstChild);
|
|
2149
2158
|
}
|
|
2150
2159
|
function xa(t, i, o, r) {
|
|
2151
2160
|
var l = this, h = t.querySelector(".ginner-container"), b = "gvideo" + o, u = t.querySelector(".gslide-media"), y = this.getAllPlayers();
|
|
2152
|
-
|
|
2161
|
+
T(h, "gvideo-container"), u.insertBefore(ne('<div class="gvideo-wrapper"></div>'), u.firstChild);
|
|
2153
2162
|
var m = t.querySelector(".gvideo-wrapper");
|
|
2154
2163
|
Qe(this.settings.plyr.css, "Plyr");
|
|
2155
|
-
var w = i.href, k = i == null ? void 0 : i.videoProvider,
|
|
2164
|
+
var w = i.href, k = i == null ? void 0 : i.videoProvider, M = !1;
|
|
2156
2165
|
u.style.maxWidth = i.width, Qe(this.settings.plyr.js, "Plyr", function() {
|
|
2157
2166
|
if (!k && w.match(/vimeo\.com\/([0-9]*)/) && (k = "vimeo"), !k && (w.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/) || w.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/) || w.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/) || w.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/)) && (k = "youtube"), k === "local" || !k) {
|
|
2158
2167
|
k = "local";
|
|
2159
2168
|
var E = '<video id="' + b + '" ';
|
|
2160
|
-
E += 'style="background:#000; max-width: '.concat(i.width, ';" '), E += 'preload="metadata" ', E += 'x-webkit-airplay="allow" ', E += "playsinline ", E += "controls ", E += 'class="gvideo-local">', E += '<source src="'.concat(w, '">'),
|
|
2169
|
+
E += 'style="background:#000; max-width: '.concat(i.width, ';" '), E += 'preload="metadata" ', E += 'x-webkit-airplay="allow" ', E += "playsinline ", E += "controls ", E += 'class="gvideo-local">', E += '<source src="'.concat(w, '">'), M = ne(E += "</video>");
|
|
2161
2170
|
}
|
|
2162
|
-
var A =
|
|
2163
|
-
|
|
2164
|
-
var U = W(l.settings.plyr, "config") ? l.settings.plyr.config : {},
|
|
2165
|
-
|
|
2166
|
-
y[b] = re.detail.plyr,
|
|
2167
|
-
}),
|
|
2171
|
+
var A = M || ne('<div id="'.concat(b, '" data-plyr-provider="').concat(k, '" data-plyr-embed-id="').concat(w, '"></div>'));
|
|
2172
|
+
T(m, "".concat(k, "-video gvideo")), m.appendChild(A), m.setAttribute("data-id", b), m.setAttribute("data-index", o);
|
|
2173
|
+
var U = W(l.settings.plyr, "config") ? l.settings.plyr.config : {}, fe = new Plyr("#" + b, U);
|
|
2174
|
+
fe.on("ready", function(re) {
|
|
2175
|
+
y[b] = re.detail.plyr, P(r) && r();
|
|
2176
|
+
}), ze(function() {
|
|
2168
2177
|
return t.querySelector("iframe") && t.querySelector("iframe").dataset.ready == "true";
|
|
2169
2178
|
}, function() {
|
|
2170
2179
|
l.resize(t);
|
|
2171
|
-
}),
|
|
2180
|
+
}), fe.on("enterfullscreen", zt), fe.on("exitfullscreen", zt);
|
|
2172
2181
|
});
|
|
2173
2182
|
}
|
|
2174
|
-
function
|
|
2183
|
+
function zt(t) {
|
|
2175
2184
|
var i = $(t.target, ".gslide-media");
|
|
2176
|
-
t.type === "enterfullscreen" &&
|
|
2185
|
+
t.type === "enterfullscreen" && T(i, "fullscreen"), t.type === "exitfullscreen" && N(i, "fullscreen");
|
|
2177
2186
|
}
|
|
2178
2187
|
function ka(t, i, o, r) {
|
|
2179
2188
|
var l, h = this, b = t.querySelector(".gslide-media"), u = !(!W(i, "href") || !i.href) && i.href.split("#").pop().trim(), y = !(!W(i, "content") || !i.content) && i.content;
|
|
2180
|
-
if (y && (
|
|
2189
|
+
if (y && (z(y) && (l = ne('<div class="ginlined-content">'.concat(y, "</div>"))), R(y))) {
|
|
2181
2190
|
y.style.display == "none" && (y.style.display = "block");
|
|
2182
2191
|
var m = document.createElement("div");
|
|
2183
2192
|
m.className = "ginlined-content", m.appendChild(y), l = m;
|
|
@@ -2186,18 +2195,18 @@ var sa = { exports: {} };
|
|
|
2186
2195
|
var w = document.getElementById(u);
|
|
2187
2196
|
if (!w) return !1;
|
|
2188
2197
|
var k = w.cloneNode(!0);
|
|
2189
|
-
k.style.height = i.height, k.style.maxWidth = i.width,
|
|
2198
|
+
k.style.height = i.height, k.style.maxWidth = i.width, T(k, "ginlined-content"), l = k;
|
|
2190
2199
|
}
|
|
2191
2200
|
if (!l) return console.error("Unable to append inline slide content", i), !1;
|
|
2192
|
-
b.style.height = i.height, b.style.width = i.width, b.appendChild(l), this.events["inlineclose" + u] = F("click", { onElement: b.querySelectorAll(".gtrigger-close"), withCallback: function(
|
|
2193
|
-
|
|
2194
|
-
} }),
|
|
2201
|
+
b.style.height = i.height, b.style.width = i.width, b.appendChild(l), this.events["inlineclose" + u] = F("click", { onElement: b.querySelectorAll(".gtrigger-close"), withCallback: function(M) {
|
|
2202
|
+
M.preventDefault(), h.close();
|
|
2203
|
+
} }), P(r) && r();
|
|
2195
2204
|
}
|
|
2196
2205
|
function Ca(t, i, o, r) {
|
|
2197
2206
|
var l = t.querySelector(".gslide-media"), h = function(b) {
|
|
2198
2207
|
var u = b.url, y = b.allow, m = b.callback, w = b.appendTo, k = document.createElement("iframe");
|
|
2199
2208
|
return k.className = "vimeo-video gvideo", k.src = u, k.style.width = "100%", k.style.height = "100%", y && k.setAttribute("allow", y), k.onload = function() {
|
|
2200
|
-
k.onload = null,
|
|
2209
|
+
k.onload = null, T(k, "node-ready"), P(m) && m();
|
|
2201
2210
|
}, w && w.appendChild(k), k;
|
|
2202
2211
|
}({ url: i.href, callback: r });
|
|
2203
2212
|
l.parentNode.style.maxWidth = i.width, l.parentNode.style.height = i.height, l.appendChild(h);
|
|
@@ -2210,7 +2219,7 @@ var sa = { exports: {} };
|
|
|
2210
2219
|
return (t = t.toLowerCase()).match(/\.(jpeg|jpg|jpe|gif|png|apn|webp|avif|svg)/) !== null ? "image" : t.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/) || t.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/) || t.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/) || t.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/) || t.match(/vimeo\.com\/([0-9]*)/) || t.match(/\.(mp4|ogg|webm|mov)/) !== null ? "video" : t.match(/\.(mp3|wav|wma|aac|ogg)/) !== null ? "audio" : t.indexOf("#") > -1 && i.split("#").pop().trim() !== "" ? "inline" : t.indexOf("goajax=true") > -1 ? "ajax" : "external";
|
|
2211
2220
|
} }, { key: "parseConfig", value: function(t, i) {
|
|
2212
2221
|
var o = this, r = S({ descPosition: i.descPosition }, this.defaults);
|
|
2213
|
-
if (Ce(t) && !
|
|
2222
|
+
if (Ce(t) && !R(t)) {
|
|
2214
2223
|
W(t, "type") || (W(t, "content") && t.content ? t.type = "inline" : W(t, "href") && (t.type = this.sourceType(t.href)));
|
|
2215
2224
|
var l = S(r, t);
|
|
2216
2225
|
return this.setSize(l, i), l;
|
|
@@ -2234,10 +2243,10 @@ var sa = { exports: {} };
|
|
|
2234
2243
|
_(r, function(E, A) {
|
|
2235
2244
|
w.push(";\\s?" + A);
|
|
2236
2245
|
}), w = w.join("\\s?:|"), b.trim() !== "" && _(r, function(E, A) {
|
|
2237
|
-
var U = b,
|
|
2246
|
+
var U = b, fe = new RegExp("s?" + A + "s?:s?(.*?)(" + w + "s?:|$)"), re = U.match(fe);
|
|
2238
2247
|
if (re && re.length && re[1]) {
|
|
2239
|
-
var
|
|
2240
|
-
r[A] = o.sanitizeValue(
|
|
2248
|
+
var G = re[1].trim().replace(/;\s*$/, "");
|
|
2249
|
+
r[A] = o.sanitizeValue(G);
|
|
2241
2250
|
}
|
|
2242
2251
|
});
|
|
2243
2252
|
}
|
|
@@ -2251,8 +2260,8 @@ var sa = { exports: {} };
|
|
|
2251
2260
|
k && (r.description = k);
|
|
2252
2261
|
}
|
|
2253
2262
|
if (!r.description) {
|
|
2254
|
-
var
|
|
2255
|
-
|
|
2263
|
+
var M = t.querySelector(".glightbox-desc");
|
|
2264
|
+
M && (r.description = M.innerHTML);
|
|
2256
2265
|
}
|
|
2257
2266
|
return this.setSize(r, i, t), this.slideConfig = r, r;
|
|
2258
2267
|
} }, { key: "setSize", value: function(t, i) {
|
|
@@ -2266,21 +2275,21 @@ var sa = { exports: {} };
|
|
|
2266
2275
|
n(this, t), this.element = i, this.instance = o, this.index = r;
|
|
2267
2276
|
}, [{ key: "setContent", value: function() {
|
|
2268
2277
|
var t = this, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, o = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
|
|
2269
|
-
if (
|
|
2270
|
-
var r = this.instance.settings, l = this.slideConfig, h =
|
|
2271
|
-
|
|
2272
|
-
var b = l.type, u = l.descPosition, y = i.querySelector(".gslide-media"), m = i.querySelector(".gslide-title"), w = i.querySelector(".gslide-desc"), k = i.querySelector(".gdesc-inner"),
|
|
2273
|
-
if (
|
|
2274
|
-
|
|
2275
|
-
}), l.title == "" && l.description == "" ? k && k.parentNode.parentNode.removeChild(k.parentNode) : (m && l.title !== "" ? (m.id = E, m.innerHTML = l.title) : m.parentNode.removeChild(m), w && l.description !== "" ? (w.id = A, h && r.moreLength > 0 ? (l.smallDescription = this.slideShortDesc(l.description, r.moreLength, r.moreText), w.innerHTML = l.smallDescription, this.descriptionEvents(w, l)) : w.innerHTML = l.description) : w.parentNode.removeChild(w),
|
|
2276
|
-
if (b !== "external") return b === "inline" ? (ka.apply(this.instance, [i, l, this.index,
|
|
2278
|
+
if (Q(i, "loaded")) return !1;
|
|
2279
|
+
var r = this.instance.settings, l = this.slideConfig, h = ve();
|
|
2280
|
+
P(r.beforeSlideLoad) && r.beforeSlideLoad({ index: this.index, slide: i, player: !1 });
|
|
2281
|
+
var b = l.type, u = l.descPosition, y = i.querySelector(".gslide-media"), m = i.querySelector(".gslide-title"), w = i.querySelector(".gslide-desc"), k = i.querySelector(".gdesc-inner"), M = o, E = "gSlideTitle_" + this.index, A = "gSlideDesc_" + this.index;
|
|
2282
|
+
if (P(r.afterSlideLoad) && (M = function() {
|
|
2283
|
+
P(o) && o(), r.afterSlideLoad({ index: t.index, slide: i, player: t.instance.getSlidePlayerInstance(t.index) });
|
|
2284
|
+
}), l.title == "" && l.description == "" ? k && k.parentNode.parentNode.removeChild(k.parentNode) : (m && l.title !== "" ? (m.id = E, m.innerHTML = l.title) : m.parentNode.removeChild(m), w && l.description !== "" ? (w.id = A, h && r.moreLength > 0 ? (l.smallDescription = this.slideShortDesc(l.description, r.moreLength, r.moreText), w.innerHTML = l.smallDescription, this.descriptionEvents(w, l)) : w.innerHTML = l.description) : w.parentNode.removeChild(w), T(y.parentNode, "desc-".concat(u)), T(k.parentNode, "description-".concat(u))), T(y, "gslide-".concat(b)), T(i, "loaded"), b !== "video") {
|
|
2285
|
+
if (b !== "external") return b === "inline" ? (ka.apply(this.instance, [i, l, this.index, M]), void (l.draggable && new Pt({ dragEl: i.querySelector(".gslide-inline"), toleranceX: r.dragToleranceX, toleranceY: r.dragToleranceY, slide: i, instance: this.instance }))) : void (b !== "image" ? P(M) && M() : wa(i, l, this.index, function() {
|
|
2277
2286
|
var U = i.querySelector("img");
|
|
2278
|
-
l.draggable && new
|
|
2287
|
+
l.draggable && new Pt({ dragEl: U, toleranceX: r.dragToleranceX, toleranceY: r.dragToleranceY, slide: i, instance: t.instance }), l.zoomable && U.naturalWidth > U.offsetWidth && (T(U, "zoomable"), new va(U, i, function() {
|
|
2279
2288
|
t.instance.resize();
|
|
2280
|
-
})),
|
|
2289
|
+
})), P(M) && M();
|
|
2281
2290
|
}));
|
|
2282
|
-
Ca.apply(this, [i, l, this.index,
|
|
2283
|
-
} else xa.apply(this.instance, [i, l, this.index,
|
|
2291
|
+
Ca.apply(this, [i, l, this.index, M]);
|
|
2292
|
+
} else xa.apply(this.instance, [i, l, this.index, M]);
|
|
2284
2293
|
} }, { key: "slideShortDesc", value: function(t) {
|
|
2285
2294
|
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 50, o = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], r = document.createElement("div");
|
|
2286
2295
|
r.innerHTML = t;
|
|
@@ -2295,17 +2304,17 @@ var sa = { exports: {} };
|
|
|
2295
2304
|
l.preventDefault();
|
|
2296
2305
|
var b = document.body, u = $(h, ".gslide-desc");
|
|
2297
2306
|
if (!u) return !1;
|
|
2298
|
-
u.innerHTML = i.description,
|
|
2307
|
+
u.innerHTML = i.description, T(b, "gdesc-open");
|
|
2299
2308
|
var y = F("click", { onElement: [b, $(u, ".gslide-description")], withCallback: function(m, w) {
|
|
2300
|
-
m.target.nodeName.toLowerCase() !== "a" && (N(b, "gdesc-open"),
|
|
2309
|
+
m.target.nodeName.toLowerCase() !== "a" && (N(b, "gdesc-open"), T(b, "gdesc-closed"), u.innerHTML = i.smallDescription, o.descriptionEvents(u, i), setTimeout(function() {
|
|
2301
2310
|
N(b, "gdesc-closed");
|
|
2302
2311
|
}, 400), y.destroy());
|
|
2303
2312
|
} });
|
|
2304
2313
|
} });
|
|
2305
2314
|
} }, { key: "create", value: function() {
|
|
2306
|
-
return
|
|
2315
|
+
return ne(this.instance.settings.slideHTML);
|
|
2307
2316
|
} }, { key: "getConfig", value: function() {
|
|
2308
|
-
|
|
2317
|
+
R(this.element) || this.element.hasOwnProperty("draggable") || (this.element.draggable = this.instance.settings.draggable);
|
|
2309
2318
|
var t = new Sa(this.instance.settings.slideExtraAttributes);
|
|
2310
2319
|
return this.slideConfig = t.parseConfig(this.element, this.instance.settings), this.slideConfig;
|
|
2311
2320
|
} }]);
|
|
@@ -2342,7 +2351,7 @@ var sa = { exports: {} };
|
|
|
2342
2351
|
var o = new $a(t);
|
|
2343
2352
|
return o.add(i), o;
|
|
2344
2353
|
}
|
|
2345
|
-
var
|
|
2354
|
+
var Ma = f(function t(i, o) {
|
|
2346
2355
|
n(this, t), this.element = typeof i == "string" ? document.querySelector(i) : i, this.start = this.start.bind(this), this.move = this.move.bind(this), this.end = this.end.bind(this), this.cancel = this.cancel.bind(this), this.element.addEventListener("touchstart", this.start, !1), this.element.addEventListener("touchmove", this.move, !1), this.element.addEventListener("touchend", this.end, !1), this.element.addEventListener("touchcancel", this.cancel, !1), this.preV = { x: null, y: null }, this.pinchStartLen = null, this.zoom = 1, this.isDoubleTap = !1;
|
|
2347
2356
|
var r = function() {
|
|
2348
2357
|
};
|
|
@@ -2410,34 +2419,34 @@ var sa = { exports: {} };
|
|
|
2410
2419
|
var i = function() {
|
|
2411
2420
|
var b, u = document.createElement("fakeelement"), y = { transition: "transitionend", OTransition: "oTransitionEnd", MozTransition: "transitionend", WebkitTransition: "webkitTransitionEnd" };
|
|
2412
2421
|
for (b in y) if (u.style[b] !== void 0) return y[b];
|
|
2413
|
-
}(), o = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, r =
|
|
2414
|
-
o > 769 && (r = l),
|
|
2422
|
+
}(), o = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, r = Q(t, "gslide-media") ? t : t.querySelector(".gslide-media"), l = $(r, ".ginner-container"), h = t.querySelector(".gslide-description");
|
|
2423
|
+
o > 769 && (r = l), T(r, "greset"), C(r, "translate3d(0, 0, 0)"), F(i, { onElement: r, once: !0, withCallback: function(b, u) {
|
|
2415
2424
|
N(r, "greset");
|
|
2416
2425
|
} }), r.style.opacity = "", h && (h.style.opacity = "");
|
|
2417
2426
|
}
|
|
2418
|
-
function
|
|
2427
|
+
function Ta(t) {
|
|
2419
2428
|
if (t.events.hasOwnProperty("touch")) return !1;
|
|
2420
|
-
var i, o, r, l =
|
|
2421
|
-
if (u = !0, (
|
|
2422
|
-
if (Le =
|
|
2423
|
-
|
|
2429
|
+
var i, o, r, l = se(), h = l.width, b = l.height, u = !1, y = null, m = null, w = null, k = !1, M = 1, E = 1, A = !1, U = !1, fe = null, re = null, G = null, Se = null, ue = 0, je = 0, He = !1, Be = !1, pe = {}, Le = {}, Rt = 0, Vt = 0, Ia = document.getElementById("glightbox-slider"), ct = document.querySelector(".goverlay"), La = new Ma(Ia, { touchStart: function(B) {
|
|
2430
|
+
if (u = !0, (Q(B.targetTouches[0].target, "ginner-container") || $(B.targetTouches[0].target, ".gslide-desc") || B.targetTouches[0].target.nodeName.toLowerCase() == "a") && (u = !1), $(B.targetTouches[0].target, ".gslide-inline") && !Q(B.targetTouches[0].target.parentNode, "gslide-inline") && (u = !1), u) {
|
|
2431
|
+
if (Le = B.targetTouches[0], pe.pageX = B.targetTouches[0].pageX, pe.pageY = B.targetTouches[0].pageY, Rt = B.targetTouches[0].clientX, Vt = B.targetTouches[0].clientY, y = t.activeSlide, m = y.querySelector(".gslide-media"), r = y.querySelector(".gslide-inline"), w = null, Q(m, "gslide-image") && (w = m.querySelector("img")), (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) > 769 && (m = y.querySelector(".ginner-container")), N(ct, "greset"), B.pageX > 20 && B.pageX < window.innerWidth - 20) return;
|
|
2432
|
+
B.preventDefault();
|
|
2424
2433
|
}
|
|
2425
|
-
}, touchMove: function(
|
|
2426
|
-
if (u && (Le =
|
|
2434
|
+
}, touchMove: function(B) {
|
|
2435
|
+
if (u && (Le = B.targetTouches[0], !A && !U)) {
|
|
2427
2436
|
if (r && r.offsetHeight > b) {
|
|
2428
|
-
var ae =
|
|
2437
|
+
var ae = pe.pageX - Le.pageX;
|
|
2429
2438
|
if (Math.abs(ae) <= 13) return !1;
|
|
2430
2439
|
}
|
|
2431
2440
|
k = !0;
|
|
2432
|
-
var _e, it =
|
|
2433
|
-
if (Math.abs(
|
|
2434
|
-
C(m, "translate3d(".concat(
|
|
2441
|
+
var _e, it = B.targetTouches[0].clientX, qa = B.targetTouches[0].clientY, Oa = Rt - it, Pa = Vt - qa;
|
|
2442
|
+
if (Math.abs(Oa) > Math.abs(Pa) ? (He = !1, Be = !0) : (Be = !1, He = !0), i = Le.pageX - pe.pageX, ue = 100 * i / h, o = Le.pageY - pe.pageY, je = 100 * o / b, He && w && (_e = 1 - Math.abs(o) / b, ct.style.opacity = _e, t.settings.touchFollowAxis && (ue = 0)), Be && (_e = 1 - Math.abs(i) / h, m.style.opacity = _e, t.settings.touchFollowAxis && (je = 0)), !w) return C(m, "translate3d(".concat(ue, "%, 0, 0)"));
|
|
2443
|
+
C(m, "translate3d(".concat(ue, "%, ").concat(je, "%, 0)"));
|
|
2435
2444
|
}
|
|
2436
2445
|
}, touchEnd: function() {
|
|
2437
2446
|
if (u) {
|
|
2438
|
-
if (k = !1, U || A) return
|
|
2439
|
-
var
|
|
2440
|
-
if (!(
|
|
2447
|
+
if (k = !1, U || A) return G = fe, void (Se = re);
|
|
2448
|
+
var B = Math.abs(parseInt(je)), ae = Math.abs(parseInt(ue));
|
|
2449
|
+
if (!(B > 29 && w)) return B < 29 && ae < 25 ? (T(ct, "greset"), ct.style.opacity = 1, yt(m)) : void 0;
|
|
2441
2450
|
t.close();
|
|
2442
2451
|
}
|
|
2443
2452
|
}, multipointEnd: function() {
|
|
@@ -2445,28 +2454,28 @@ var sa = { exports: {} };
|
|
|
2445
2454
|
A = !1;
|
|
2446
2455
|
}, 50);
|
|
2447
2456
|
}, multipointStart: function() {
|
|
2448
|
-
A = !0,
|
|
2449
|
-
}, pinch: function(
|
|
2457
|
+
A = !0, M = E || 1;
|
|
2458
|
+
}, pinch: function(B) {
|
|
2450
2459
|
if (!w || k) return !1;
|
|
2451
|
-
A = !0, w.scaleX = w.scaleY =
|
|
2452
|
-
var ae =
|
|
2453
|
-
if (U = !0, ae <= 1) return U = !1, ae = 1, Se = null,
|
|
2460
|
+
A = !0, w.scaleX = w.scaleY = M * B.zoom;
|
|
2461
|
+
var ae = M * B.zoom;
|
|
2462
|
+
if (U = !0, ae <= 1) return U = !1, ae = 1, Se = null, G = null, fe = null, re = null, void w.setAttribute("style", "");
|
|
2454
2463
|
ae > 4.5 && (ae = 4.5), w.style.transform = "scale3d(".concat(ae, ", ").concat(ae, ", 1)"), E = ae;
|
|
2455
|
-
}, pressMove: function(
|
|
2464
|
+
}, pressMove: function(B) {
|
|
2456
2465
|
if (U && !A) {
|
|
2457
|
-
var ae = Le.pageX -
|
|
2458
|
-
|
|
2466
|
+
var ae = Le.pageX - pe.pageX, _e = Le.pageY - pe.pageY;
|
|
2467
|
+
G && (ae += G), Se && (_e += Se), fe = ae, re = _e;
|
|
2459
2468
|
var it = "translate3d(".concat(ae, "px, ").concat(_e, "px, 0)");
|
|
2460
2469
|
E && (it += " scale3d(".concat(E, ", ").concat(E, ", 1)")), C(w, it);
|
|
2461
2470
|
}
|
|
2462
|
-
}, swipe: function(
|
|
2471
|
+
}, swipe: function(B) {
|
|
2463
2472
|
if (!U) if (A) A = !1;
|
|
2464
2473
|
else {
|
|
2465
|
-
if (
|
|
2474
|
+
if (B.direction == "Left") {
|
|
2466
2475
|
if (t.index == t.elements.length - 1) return yt(m);
|
|
2467
2476
|
t.nextSlide();
|
|
2468
2477
|
}
|
|
2469
|
-
if (
|
|
2478
|
+
if (B.direction == "Right") {
|
|
2470
2479
|
if (t.index == 0) return yt(m);
|
|
2471
2480
|
t.prevSlide();
|
|
2472
2481
|
}
|
|
@@ -2474,7 +2483,7 @@ var sa = { exports: {} };
|
|
|
2474
2483
|
} });
|
|
2475
2484
|
t.events.touch = La;
|
|
2476
2485
|
}
|
|
2477
|
-
var
|
|
2486
|
+
var jt = ve(), Ht = ve() !== null || document.createTouch !== void 0 || "ontouchstart" in window || "onmsgesturechange" in window || navigator.msMaxTouchPoints, Bt = document.getElementsByTagName("html")[0], Ea = { selector: ".glightbox", elements: null, skin: "clean", theme: "clean", closeButton: !0, startAt: null, autoplayVideos: !0, autofocusVideos: !0, descPosition: "bottom", width: "900px", height: "506px", videosWidth: "960px", beforeSlideChange: null, afterSlideChange: null, beforeSlideLoad: null, afterSlideLoad: null, slideInserted: null, slideRemoved: null, slideExtraAttributes: null, onOpen: null, onClose: null, loop: !1, zoomable: !0, draggable: !0, dragAutoSnap: !1, dragToleranceX: 40, dragToleranceY: 65, preload: !0, oneSlidePerOpen: !1, touchNavigation: !0, touchFollowAxis: !0, keyboardNavigation: !0, closeOnOutsideClick: !0, plugins: !1, plyr: { css: "https://cdn.plyr.io/3.6.12/plyr.css", js: "https://cdn.plyr.io/3.6.12/plyr.js", config: { ratio: "16:9", fullscreen: { enabled: !0, iosNative: !0 }, youtube: { noCookie: !0, rel: 0, showinfo: 0, iv_load_policy: 3 }, vimeo: { byline: !1, portrait: !1, title: !1, transparent: !1 } } }, openEffect: "zoom", closeEffect: "zoom", slideEffect: "slide", moreText: "See more", moreLength: 60, cssEfects: { fade: { in: "fadeIn", out: "fadeOut" }, zoom: { in: "zoomIn", out: "zoomOut" }, slide: { in: "slideInRight", out: "slideOutLeft" }, slideBack: { in: "slideInLeft", out: "slideOutRight" }, none: { in: "none", out: "none" } }, svg: { close: '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" xml:space="preserve"><g><g><path d="M505.943,6.058c-8.077-8.077-21.172-8.077-29.249,0L6.058,476.693c-8.077,8.077-8.077,21.172,0,29.249C10.096,509.982,15.39,512,20.683,512c5.293,0,10.586-2.019,14.625-6.059L505.943,35.306C514.019,27.23,514.019,14.135,505.943,6.058z"/></g></g><g><g><path d="M505.942,476.694L35.306,6.059c-8.076-8.077-21.172-8.077-29.248,0c-8.077,8.076-8.077,21.171,0,29.248l470.636,470.636c4.038,4.039,9.332,6.058,14.625,6.058c5.293,0,10.587-2.019,14.624-6.057C514.018,497.866,514.018,484.771,505.942,476.694z"/></g></g></svg>', next: '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"> <g><path d="M360.731,229.075l-225.1-225.1c-5.3-5.3-13.8-5.3-19.1,0s-5.3,13.8,0,19.1l215.5,215.5l-215.5,215.5c-5.3,5.3-5.3,13.8,0,19.1c2.6,2.6,6.1,4,9.5,4c3.4,0,6.9-1.3,9.5-4l225.1-225.1C365.931,242.875,365.931,234.275,360.731,229.075z"/></g></svg>', prev: '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"><g><path d="M145.188,238.575l215.5-215.5c5.3-5.3,5.3-13.8,0-19.1s-13.8-5.3-19.1,0l-225.1,225.1c-5.3,5.3-5.3,13.8,0,19.1l225.1,225c2.6,2.6,6.1,4,9.5,4s6.9-1.3,9.5-4c5.3-5.3,5.3-13.8,0-19.1L145.188,238.575z"/></g></svg>' }, slideHTML: `<div class="gslide">
|
|
2478
2487
|
<div class="gslide-inner-content">
|
|
2479
2488
|
<div class="ginner-container">
|
|
2480
2489
|
<div class="gslide-media">
|
|
@@ -2509,7 +2518,7 @@ var sa = { exports: {} };
|
|
|
2509
2518
|
if (this.elements.length === 0) return !1;
|
|
2510
2519
|
this.activeSlide = null, this.prevActiveSlideIndex = null, this.prevActiveSlide = null;
|
|
2511
2520
|
var o = et(i) ? i : this.settings.startAt;
|
|
2512
|
-
if (
|
|
2521
|
+
if (R(t)) {
|
|
2513
2522
|
var r = t.getAttribute("data-gallery");
|
|
2514
2523
|
r && (this.fullElementsList = this.elements, this.elements = this.getGalleryElements(this.elements, r)), oe(o) && (o = this.getElementIndex(t)) < 0 && (o = 0);
|
|
2515
2524
|
}
|
|
@@ -2517,9 +2526,9 @@ var sa = { exports: {} };
|
|
|
2517
2526
|
var l = document.body, h = window.innerWidth - document.documentElement.clientWidth;
|
|
2518
2527
|
if (h > 0) {
|
|
2519
2528
|
var b = document.createElement("style");
|
|
2520
|
-
b.type = "text/css", b.className = "gcss-styles", b.innerText = ".gscrollbar-fixer {margin-right: ".concat(h, "px}"), document.head.appendChild(b),
|
|
2529
|
+
b.type = "text/css", b.className = "gcss-styles", b.innerText = ".gscrollbar-fixer {margin-right: ".concat(h, "px}"), document.head.appendChild(b), T(l, "gscrollbar-fixer");
|
|
2521
2530
|
}
|
|
2522
|
-
|
|
2531
|
+
T(l, "glightbox-open"), T(Bt, "glightbox-open"), jt && (T(document.body, "glightbox-mobile"), this.settings.slideEffect = "slide"), this.showSlide(o, !0), this.elements.length === 1 ? (T(this.prevButton, "glightbox-button-hidden"), T(this.nextButton, "glightbox-button-hidden")) : (N(this.prevButton, "glightbox-button-hidden"), N(this.nextButton, "glightbox-button-hidden")), this.lightboxOpen = !0, this.trigger("open"), P(this.settings.onOpen) && this.settings.onOpen(), Ht && this.settings.touchNavigation && Ta(this), this.settings.keyboardNavigation && ya(this);
|
|
2523
2532
|
} }, { key: "openAt", value: function() {
|
|
2524
2533
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
2525
2534
|
this.open(null, t);
|
|
@@ -2529,7 +2538,7 @@ var sa = { exports: {} };
|
|
|
2529
2538
|
var r = this.slidesContainer.querySelector(".current");
|
|
2530
2539
|
r && N(r, "current"), this.slideAnimateOut();
|
|
2531
2540
|
var l = this.slidesContainer.querySelectorAll(".gslide")[i];
|
|
2532
|
-
if (
|
|
2541
|
+
if (Q(l, "loaded")) this.slideAnimateIn(l, o), Ae(this.loader);
|
|
2533
2542
|
else {
|
|
2534
2543
|
Ee(this.loader);
|
|
2535
2544
|
var h = this.elements[i], b = { index: this.index, slide: l, slideNode: l, slideConfig: h.slideConfig, slideIndex: this.index, trigger: h.node, player: null };
|
|
@@ -2537,12 +2546,12 @@ var sa = { exports: {} };
|
|
|
2537
2546
|
Ae(t.loader), t.resize(), t.slideAnimateIn(l, o), t.trigger("slide_after_load", b);
|
|
2538
2547
|
});
|
|
2539
2548
|
}
|
|
2540
|
-
this.slideDescription = l.querySelector(".gslide-description"), this.slideDescriptionContained = this.slideDescription &&
|
|
2549
|
+
this.slideDescription = l.querySelector(".gslide-description"), this.slideDescriptionContained = this.slideDescription && Q(this.slideDescription.parentNode, "gslide-media"), this.settings.preload && (this.preloadSlide(i + 1), this.preloadSlide(i - 1)), this.updateNavigationClasses(), this.activeSlide = l;
|
|
2541
2550
|
} }, { key: "preloadSlide", value: function(t) {
|
|
2542
2551
|
var i = this;
|
|
2543
2552
|
if (t < 0 || t > this.elements.length - 1 || oe(this.elements[t])) return !1;
|
|
2544
2553
|
var o = this.slidesContainer.querySelectorAll(".gslide")[t];
|
|
2545
|
-
if (
|
|
2554
|
+
if (Q(o, "loaded")) return !1;
|
|
2546
2555
|
var r = this.elements[t], l = r.type, h = { index: t, slide: o, slideNode: o, slideConfig: r.slideConfig, slideIndex: t, trigger: r.node, player: null };
|
|
2547
2556
|
this.trigger("slide_before_load", h), l === "video" || l === "external" ? setTimeout(function() {
|
|
2548
2557
|
r.instance.setContent(o, function() {
|
|
@@ -2573,32 +2582,32 @@ var sa = { exports: {} };
|
|
|
2573
2582
|
}
|
|
2574
2583
|
(this.settings.preload && this.index == 0 && i == 0 || this.index - 1 == i || this.index + 1 == i) && this.preloadSlide(i), this.index === 0 && i === 0 && (this.index = 1), this.updateNavigationClasses(), u = this.slidesContainer.querySelectorAll(".gslide")[i], y = this.getSlidePlayerInstance(i), l.slideNode = u;
|
|
2575
2584
|
}
|
|
2576
|
-
this.trigger("slide_inserted", { index: i, slide: u, slideNode: u, slideConfig: r, slideIndex: i, trigger: null, player: y }),
|
|
2585
|
+
this.trigger("slide_inserted", { index: i, slide: u, slideNode: u, slideConfig: r, slideIndex: i, trigger: null, player: y }), P(this.settings.slideInserted) && this.settings.slideInserted({ index: i, slide: u, player: y });
|
|
2577
2586
|
} }, { key: "removeSlide", value: function() {
|
|
2578
2587
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1;
|
|
2579
2588
|
if (t < 0 || t > this.elements.length - 1) return !1;
|
|
2580
2589
|
var i = this.slidesContainer && this.slidesContainer.querySelectorAll(".gslide")[t];
|
|
2581
|
-
i && (this.getActiveSlideIndex() == t && (t == this.elements.length - 1 ? this.prevSlide() : this.nextSlide()), i.parentNode.removeChild(i)), this.elements.splice(t, 1), this.trigger("slide_removed", t),
|
|
2590
|
+
i && (this.getActiveSlideIndex() == t && (t == this.elements.length - 1 ? this.prevSlide() : this.nextSlide()), i.parentNode.removeChild(i)), this.elements.splice(t, 1), this.trigger("slide_removed", t), P(this.settings.slideRemoved) && this.settings.slideRemoved(t);
|
|
2582
2591
|
} }, { key: "slideAnimateIn", value: function(t, i) {
|
|
2583
2592
|
var o = this, r = t.querySelector(".gslide-media"), l = t.querySelector(".gslide-description"), h = { index: this.prevActiveSlideIndex, slide: this.prevActiveSlide, slideNode: this.prevActiveSlide, slideIndex: this.prevActiveSlide, slideConfig: oe(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].slideConfig, trigger: oe(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].node, player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) }, b = { index: this.index, slide: this.activeSlide, slideNode: this.activeSlide, slideConfig: this.elements[this.index].slideConfig, slideIndex: this.index, trigger: this.elements[this.index].node, player: this.getSlidePlayerInstance(this.index) };
|
|
2584
2593
|
if (r.offsetWidth > 0 && l && (Ae(l), l.style.display = ""), N(t, this.effectsClasses), i) V(t, this.settings.cssEfects[this.settings.openEffect].in, function() {
|
|
2585
|
-
o.settings.autoplayVideos && o.slidePlayerPlay(t), o.trigger("slide_changed", { prev: h, current: b }),
|
|
2594
|
+
o.settings.autoplayVideos && o.slidePlayerPlay(t), o.trigger("slide_changed", { prev: h, current: b }), P(o.settings.afterSlideChange) && o.settings.afterSlideChange.apply(o, [h, b]);
|
|
2586
2595
|
});
|
|
2587
2596
|
else {
|
|
2588
2597
|
var u = this.settings.slideEffect, y = u !== "none" ? this.settings.cssEfects[u].in : u;
|
|
2589
2598
|
this.prevActiveSlideIndex > this.index && this.settings.slideEffect == "slide" && (y = this.settings.cssEfects.slideBack.in), V(t, y, function() {
|
|
2590
|
-
o.settings.autoplayVideos && o.slidePlayerPlay(t), o.trigger("slide_changed", { prev: h, current: b }),
|
|
2599
|
+
o.settings.autoplayVideos && o.slidePlayerPlay(t), o.trigger("slide_changed", { prev: h, current: b }), P(o.settings.afterSlideChange) && o.settings.afterSlideChange.apply(o, [h, b]);
|
|
2591
2600
|
});
|
|
2592
2601
|
}
|
|
2593
2602
|
setTimeout(function() {
|
|
2594
2603
|
o.resize(t);
|
|
2595
|
-
}, 100),
|
|
2604
|
+
}, 100), T(t, "current");
|
|
2596
2605
|
} }, { key: "slideAnimateOut", value: function() {
|
|
2597
2606
|
if (!this.prevActiveSlide) return !1;
|
|
2598
2607
|
var t = this.prevActiveSlide;
|
|
2599
|
-
N(t, this.effectsClasses),
|
|
2608
|
+
N(t, this.effectsClasses), T(t, "prev");
|
|
2600
2609
|
var i = this.settings.slideEffect, o = i !== "none" ? this.settings.cssEfects[i].out : i;
|
|
2601
|
-
this.slidePlayerPause(t), this.trigger("slide_before_change", { prev: { index: this.prevActiveSlideIndex, slide: this.prevActiveSlide, slideNode: this.prevActiveSlide, slideIndex: this.prevActiveSlideIndex, slideConfig: oe(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].slideConfig, trigger: oe(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].node, player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) }, current: { index: this.index, slide: this.activeSlide, slideNode: this.activeSlide, slideIndex: this.index, slideConfig: this.elements[this.index].slideConfig, trigger: this.elements[this.index].node, player: this.getSlidePlayerInstance(this.index) } }),
|
|
2610
|
+
this.slidePlayerPause(t), this.trigger("slide_before_change", { prev: { index: this.prevActiveSlideIndex, slide: this.prevActiveSlide, slideNode: this.prevActiveSlide, slideIndex: this.prevActiveSlideIndex, slideConfig: oe(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].slideConfig, trigger: oe(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].node, player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) }, current: { index: this.index, slide: this.activeSlide, slideNode: this.activeSlide, slideIndex: this.index, slideConfig: this.elements[this.index].slideConfig, trigger: this.elements[this.index].node, player: this.getSlidePlayerInstance(this.index) } }), P(this.settings.beforeSlideChange) && this.settings.beforeSlideChange.apply(this, [{ index: this.prevActiveSlideIndex, slide: this.prevActiveSlide, player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) }, { index: this.index, slide: this.activeSlide, player: this.getSlidePlayerInstance(this.index) }]), this.prevActiveSlideIndex > this.index && this.settings.slideEffect == "slide" && (o = this.settings.cssEfects.slideBack.out), V(t, o, function() {
|
|
2602
2611
|
var r = t.querySelector(".ginner-container"), l = t.querySelector(".gslide-media"), h = t.querySelector(".gslide-description");
|
|
2603
2612
|
r.style.transform = "", l.style.transform = "", N(l, "greset"), l.style.opacity = "", h && (h.style.opacity = ""), N(t, "prev");
|
|
2604
2613
|
});
|
|
@@ -2608,7 +2617,7 @@ var sa = { exports: {} };
|
|
|
2608
2617
|
var i = "gvideo" + t, o = this.getAllPlayers();
|
|
2609
2618
|
return !(!W(o, i) || !o[i]) && o[i];
|
|
2610
2619
|
} }, { key: "stopSlideVideo", value: function(t) {
|
|
2611
|
-
if (
|
|
2620
|
+
if (R(t)) {
|
|
2612
2621
|
var i = t.querySelector(".gvideo-wrapper");
|
|
2613
2622
|
i && (t = i.getAttribute("data-index"));
|
|
2614
2623
|
}
|
|
@@ -2616,14 +2625,14 @@ var sa = { exports: {} };
|
|
|
2616
2625
|
var o = this.getSlidePlayerInstance(t);
|
|
2617
2626
|
o && o.playing && o.pause();
|
|
2618
2627
|
} }, { key: "slidePlayerPause", value: function(t) {
|
|
2619
|
-
if (
|
|
2628
|
+
if (R(t)) {
|
|
2620
2629
|
var i = t.querySelector(".gvideo-wrapper");
|
|
2621
2630
|
i && (t = i.getAttribute("data-index"));
|
|
2622
2631
|
}
|
|
2623
2632
|
var o = this.getSlidePlayerInstance(t);
|
|
2624
2633
|
o && o.playing && o.pause();
|
|
2625
2634
|
} }, { key: "playSlideVideo", value: function(t) {
|
|
2626
|
-
if (
|
|
2635
|
+
if (R(t)) {
|
|
2627
2636
|
var i = t.querySelector(".gvideo-wrapper");
|
|
2628
2637
|
i && (t = i.getAttribute("data-index"));
|
|
2629
2638
|
}
|
|
@@ -2632,8 +2641,8 @@ var sa = { exports: {} };
|
|
|
2632
2641
|
o && !o.playing && o.play();
|
|
2633
2642
|
} }, { key: "slidePlayerPlay", value: function(t) {
|
|
2634
2643
|
var i;
|
|
2635
|
-
if (!
|
|
2636
|
-
if (
|
|
2644
|
+
if (!jt || (i = this.settings.plyr.config) !== null && i !== void 0 && i.muted) {
|
|
2645
|
+
if (R(t)) {
|
|
2637
2646
|
var o = t.querySelector(".gvideo-wrapper");
|
|
2638
2647
|
o && (t = o.getAttribute("data-index"));
|
|
2639
2648
|
}
|
|
@@ -2648,7 +2657,7 @@ var sa = { exports: {} };
|
|
|
2648
2657
|
var h = new tt(r, i, l), b = h.getConfig(), u = S({}, b);
|
|
2649
2658
|
u.slideConfig = b, u.instance = h, u.index = l, o.push(u);
|
|
2650
2659
|
}), this.elements = o, this.lightboxOpen && (this.slidesContainer.innerHTML = "", this.elements.length && (_(this.elements, function() {
|
|
2651
|
-
var r =
|
|
2660
|
+
var r = ne(i.settings.slideHTML);
|
|
2652
2661
|
i.slidesContainer.appendChild(r);
|
|
2653
2662
|
}), this.showSlide(0, !0)));
|
|
2654
2663
|
} }, { key: "getElementIndex", value: function(t) {
|
|
@@ -2692,47 +2701,47 @@ var sa = { exports: {} };
|
|
|
2692
2701
|
m.parentNode == document.body && m.nodeName.charAt(0) !== "#" && m.hasAttribute && !m.hasAttribute("aria-hidden") && (o.push(m), m.setAttribute("aria-hidden", "true"));
|
|
2693
2702
|
});
|
|
2694
2703
|
var r = W(this.settings.svg, "next") ? this.settings.svg.next : "", l = W(this.settings.svg, "prev") ? this.settings.svg.prev : "", h = W(this.settings.svg, "close") ? this.settings.svg.close : "", b = this.settings.lightboxHTML;
|
|
2695
|
-
b =
|
|
2704
|
+
b = ne(b = (b = (b = b.replace(/{nextSVG}/g, r)).replace(/{prevSVG}/g, l)).replace(/{closeSVG}/g, h)), document.body.appendChild(b);
|
|
2696
2705
|
var u = document.getElementById("glightbox-body");
|
|
2697
2706
|
this.modal = u;
|
|
2698
2707
|
var y = u.querySelector(".gclose");
|
|
2699
|
-
this.prevButton = u.querySelector(".gprev"), this.nextButton = u.querySelector(".gnext"), this.overlay = u.querySelector(".goverlay"), this.loader = u.querySelector(".gloader"), this.slidesContainer = document.getElementById("glightbox-slider"), this.bodyHiddenChildElms = o, this.events = {},
|
|
2708
|
+
this.prevButton = u.querySelector(".gprev"), this.nextButton = u.querySelector(".gnext"), this.overlay = u.querySelector(".goverlay"), this.loader = u.querySelector(".gloader"), this.slidesContainer = document.getElementById("glightbox-slider"), this.bodyHiddenChildElms = o, this.events = {}, T(this.modal, "glightbox-" + this.settings.skin), this.settings.closeButton && y && (this.events.close = F("click", { onElement: y, withCallback: function(m, w) {
|
|
2700
2709
|
m.preventDefault(), t.close();
|
|
2701
2710
|
} })), y && !this.settings.closeButton && y.parentNode.removeChild(y), this.nextButton && (this.events.next = F("click", { onElement: this.nextButton, withCallback: function(m, w) {
|
|
2702
2711
|
m.preventDefault(), t.nextSlide();
|
|
2703
2712
|
} })), this.prevButton && (this.events.prev = F("click", { onElement: this.prevButton, withCallback: function(m, w) {
|
|
2704
2713
|
m.preventDefault(), t.prevSlide();
|
|
2705
2714
|
} })), this.settings.closeOnOutsideClick && (this.events.outClose = F("click", { onElement: u, withCallback: function(m, w) {
|
|
2706
|
-
t.preventOutsideClick ||
|
|
2715
|
+
t.preventOutsideClick || Q(document.body, "glightbox-mobile") || $(m.target, ".ginner-container") || $(m.target, ".gbtn") || Q(m.target, "gnext") || Q(m.target, "gprev") || t.close();
|
|
2707
2716
|
} })), _(this.elements, function(m, w) {
|
|
2708
2717
|
t.slidesContainer.appendChild(m.instance.create()), m.slideNode = t.slidesContainer.querySelectorAll(".gslide")[w];
|
|
2709
|
-
}),
|
|
2718
|
+
}), Ht && T(document.body, "glightbox-touch"), this.events.resize = F("resize", { onElement: window, withCallback: function() {
|
|
2710
2719
|
t.resize();
|
|
2711
2720
|
} }), this.built = !0;
|
|
2712
2721
|
} }, { key: "resize", value: function() {
|
|
2713
2722
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
|
|
2714
|
-
if ((t = t || this.activeSlide) && !
|
|
2715
|
-
var i =
|
|
2716
|
-
if (h <= 768 ?
|
|
2723
|
+
if ((t = t || this.activeSlide) && !Q(t, "zoomed")) {
|
|
2724
|
+
var i = se(), o = t.querySelector(".gvideo-wrapper"), r = t.querySelector(".gslide-image"), l = this.slideDescription, h = i.width, b = i.height;
|
|
2725
|
+
if (h <= 768 ? T(document.body, "glightbox-mobile") : N(document.body, "glightbox-mobile"), o || r) {
|
|
2717
2726
|
var u = !1;
|
|
2718
|
-
if (l && (
|
|
2727
|
+
if (l && (Q(l, "description-bottom") || Q(l, "description-top")) && !Q(l, "gabsolute") && (u = !0), r) {
|
|
2719
2728
|
if (h <= 768) r.querySelector("img");
|
|
2720
2729
|
else if (u) {
|
|
2721
|
-
var y, m = l.offsetHeight, w = r.querySelector("img"), k = this.elements[this.index].node,
|
|
2722
|
-
w.setAttribute("style", "max-height: calc(".concat(
|
|
2730
|
+
var y, m = l.offsetHeight, w = r.querySelector("img"), k = this.elements[this.index].node, M = (y = k.getAttribute("data-height")) !== null && y !== void 0 ? y : "100vh";
|
|
2731
|
+
w.setAttribute("style", "max-height: calc(".concat(M, " - ").concat(m, "px)")), l.setAttribute("style", "max-width: ".concat(w.offsetWidth, "px;"));
|
|
2723
2732
|
}
|
|
2724
2733
|
}
|
|
2725
2734
|
if (o) {
|
|
2726
2735
|
var E = W(this.settings.plyr.config, "ratio") ? this.settings.plyr.config.ratio : "";
|
|
2727
2736
|
if (!E) {
|
|
2728
|
-
var A = o.clientWidth, U = o.clientHeight,
|
|
2729
|
-
E = "".concat(A /
|
|
2737
|
+
var A = o.clientWidth, U = o.clientHeight, fe = A / U;
|
|
2738
|
+
E = "".concat(A / fe, ":").concat(U / fe);
|
|
2730
2739
|
}
|
|
2731
|
-
var re = E.split(":"),
|
|
2732
|
-
if (
|
|
2733
|
-
var je = o.offsetWidth, He = o.offsetHeight, Be = b / He,
|
|
2734
|
-
o.parentNode.setAttribute("style", "max-width: ".concat(
|
|
2735
|
-
} else o.parentNode.style.maxWidth = "".concat(
|
|
2740
|
+
var re = E.split(":"), G = this.settings.videosWidth, Se = this.settings.videosWidth, ue = (Se = et(G) || G.indexOf("px") !== -1 ? parseInt(G) : G.indexOf("vw") !== -1 ? h * parseInt(G) / 100 : G.indexOf("vh") !== -1 ? b * parseInt(G) / 100 : G.indexOf("%") !== -1 ? h * parseInt(G) / 100 : parseInt(o.clientWidth)) / (parseInt(re[0]) / parseInt(re[1]));
|
|
2741
|
+
if (ue = Math.floor(ue), u && (b -= l.offsetHeight), Se > h || ue > b || b < ue && h > Se) {
|
|
2742
|
+
var je = o.offsetWidth, He = o.offsetHeight, Be = b / He, pe = { width: je * Be, height: He * Be };
|
|
2743
|
+
o.parentNode.setAttribute("style", "max-width: ".concat(pe.width, "px")), u && l.setAttribute("style", "max-width: ".concat(pe.width, "px;"));
|
|
2744
|
+
} else o.parentNode.style.maxWidth = "".concat(G), u && l.setAttribute("style", "max-width: ".concat(G, ";"));
|
|
2736
2745
|
}
|
|
2737
2746
|
}
|
|
2738
2747
|
}
|
|
@@ -2740,7 +2749,7 @@ var sa = { exports: {} };
|
|
|
2740
2749
|
this.init();
|
|
2741
2750
|
} }, { key: "updateNavigationClasses", value: function() {
|
|
2742
2751
|
var t = this.loop();
|
|
2743
|
-
N(this.nextButton, "disabled"), N(this.prevButton, "disabled"), this.index == 0 && this.elements.length - 1 == 0 ? (
|
|
2752
|
+
N(this.nextButton, "disabled"), N(this.prevButton, "disabled"), this.index == 0 && this.elements.length - 1 == 0 ? (T(this.prevButton, "disabled"), T(this.nextButton, "disabled")) : this.index !== 0 || t ? this.index !== this.elements.length - 1 || t || T(this.nextButton, "disabled") : T(this.prevButton, "disabled");
|
|
2744
2753
|
} }, { key: "loop", value: function() {
|
|
2745
2754
|
var t = W(this.settings, "loopAtEnd") ? this.settings.loopAtEnd : null;
|
|
2746
2755
|
return t = W(this.settings, "loop") ? this.settings.loop : t, t;
|
|
@@ -2756,13 +2765,13 @@ var sa = { exports: {} };
|
|
|
2756
2765
|
if (this.closing) return !1;
|
|
2757
2766
|
this.closing = !0, this.slidePlayerPause(this.activeSlide), this.fullElementsList && (this.elements = this.fullElementsList), this.bodyHiddenChildElms.length && _(this.bodyHiddenChildElms, function(o) {
|
|
2758
2767
|
o.removeAttribute("aria-hidden");
|
|
2759
|
-
}),
|
|
2768
|
+
}), T(this.modal, "glightbox-closing"), V(this.overlay, this.settings.openEffect == "none" ? "none" : this.settings.cssEfects.fade.out), V(this.activeSlide, this.settings.cssEfects[this.settings.closeEffect].out, function() {
|
|
2760
2769
|
if (t.activeSlide = null, t.prevActiveSlideIndex = null, t.prevActiveSlide = null, t.built = !1, t.events) {
|
|
2761
2770
|
for (var o in t.events) t.events.hasOwnProperty(o) && t.events[o].destroy();
|
|
2762
2771
|
t.events = null;
|
|
2763
2772
|
}
|
|
2764
2773
|
var r = document.body;
|
|
2765
|
-
N(
|
|
2774
|
+
N(Bt, "glightbox-open"), N(r, "glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"), t.modal.parentNode.removeChild(t.modal), t.trigger("close"), P(t.settings.onClose) && t.settings.onClose();
|
|
2766
2775
|
var l = document.querySelector(".gcss-styles");
|
|
2767
2776
|
l && l.parentNode.removeChild(l), t.lightboxOpen = !1, t.closing = null;
|
|
2768
2777
|
});
|
|
@@ -2770,7 +2779,7 @@ var sa = { exports: {} };
|
|
|
2770
2779
|
this.close(), this.clearAllEvents(), this.baseEvents && this.baseEvents.destroy();
|
|
2771
2780
|
} }, { key: "on", value: function(t, i) {
|
|
2772
2781
|
var o = arguments.length > 2 && arguments[2] !== void 0 && arguments[2];
|
|
2773
|
-
if (!t || !
|
|
2782
|
+
if (!t || !P(i)) throw new TypeError("Event name and callback must be defined");
|
|
2774
2783
|
this.apiEvents.push({ evt: t, once: o, callback: i });
|
|
2775
2784
|
} }, { key: "once", value: function(t, i) {
|
|
2776
2785
|
this.on(t, i, !0);
|
|
@@ -2792,9 +2801,9 @@ var sa = { exports: {} };
|
|
|
2792
2801
|
return i.init(), i;
|
|
2793
2802
|
};
|
|
2794
2803
|
});
|
|
2795
|
-
})(
|
|
2796
|
-
var wc =
|
|
2797
|
-
const xc = /* @__PURE__ */
|
|
2804
|
+
})(na);
|
|
2805
|
+
var wc = na.exports;
|
|
2806
|
+
const xc = /* @__PURE__ */ ta(wc);
|
|
2798
2807
|
var kc = Object.defineProperty, Cc = Object.getOwnPropertyDescriptor, Sc = (c, e, a, s) => {
|
|
2799
2808
|
for (var n = s > 1 ? void 0 : s ? Cc(e, a) : e, d = c.length - 1, f; d >= 0; d--)
|
|
2800
2809
|
(f = c[d]) && (n = (s ? f(e, a, n) : f(n)) || n);
|
|
@@ -2805,7 +2814,7 @@ let St = class extends ut {
|
|
|
2805
2814
|
return g` <div class="cb-thinking"><span></span><span></span><span></span></div>`;
|
|
2806
2815
|
}
|
|
2807
2816
|
};
|
|
2808
|
-
St.styles =
|
|
2817
|
+
St.styles = X`
|
|
2809
2818
|
.cb-thinking {
|
|
2810
2819
|
text-align: center;
|
|
2811
2820
|
}
|
|
@@ -2844,9 +2853,9 @@ St.styles = Y`
|
|
|
2844
2853
|
}
|
|
2845
2854
|
`;
|
|
2846
2855
|
St = Sc([
|
|
2847
|
-
|
|
2856
|
+
J("cb-thinking")
|
|
2848
2857
|
], St);
|
|
2849
|
-
var _c = Object.defineProperty, $c = Object.getOwnPropertyDescriptor,
|
|
2858
|
+
var _c = Object.defineProperty, $c = Object.getOwnPropertyDescriptor, sa = (c, e, a, s) => {
|
|
2850
2859
|
for (var n = s > 1 ? void 0 : s ? $c(e, a) : e, d = c.length - 1, f; d >= 0; d--)
|
|
2851
2860
|
(f = c[d]) && (n = (s ? f(e, a, n) : f(n)) || n);
|
|
2852
2861
|
return s && n && _c(e, a, n), n;
|
|
@@ -2867,7 +2876,7 @@ let rt = class extends ee {
|
|
|
2867
2876
|
</div>`;
|
|
2868
2877
|
}
|
|
2869
2878
|
};
|
|
2870
|
-
rt.styles =
|
|
2879
|
+
rt.styles = X`
|
|
2871
2880
|
.cb-uploading {
|
|
2872
2881
|
text-align: left;
|
|
2873
2882
|
}
|
|
@@ -2885,14 +2894,14 @@ rt.styles = Y`
|
|
|
2885
2894
|
margin-right: 5px;
|
|
2886
2895
|
}
|
|
2887
2896
|
`;
|
|
2888
|
-
|
|
2897
|
+
sa([
|
|
2889
2898
|
v({ type: Array })
|
|
2890
2899
|
], rt.prototype, "files", 2);
|
|
2891
|
-
rt =
|
|
2892
|
-
|
|
2900
|
+
rt = sa([
|
|
2901
|
+
J("cb-uploading")
|
|
2893
2902
|
], rt);
|
|
2894
|
-
const
|
|
2895
|
-
${
|
|
2903
|
+
const Mc = X`
|
|
2904
|
+
${me}
|
|
2896
2905
|
:host {
|
|
2897
2906
|
}
|
|
2898
2907
|
|
|
@@ -2912,10 +2921,10 @@ const Tc = Y`
|
|
|
2912
2921
|
margin-right: 0.2em;
|
|
2913
2922
|
}
|
|
2914
2923
|
`;
|
|
2915
|
-
var
|
|
2924
|
+
var Tc = Object.defineProperty, Ec = Object.getOwnPropertyDescriptor, Et = (c, e, a, s) => {
|
|
2916
2925
|
for (var n = s > 1 ? void 0 : s ? Ec(e, a) : e, d = c.length - 1, f; d >= 0; d--)
|
|
2917
2926
|
(f = c[d]) && (n = (s ? f(e, a, n) : f(n)) || n);
|
|
2918
|
-
return s && n &&
|
|
2927
|
+
return s && n && Tc(e, a, n), n;
|
|
2919
2928
|
};
|
|
2920
2929
|
let Ze = class extends ut {
|
|
2921
2930
|
constructor() {
|
|
@@ -2937,7 +2946,7 @@ let Ze = class extends ut {
|
|
|
2937
2946
|
`;
|
|
2938
2947
|
}
|
|
2939
2948
|
};
|
|
2940
|
-
Ze.styles =
|
|
2949
|
+
Ze.styles = X`
|
|
2941
2950
|
:host {
|
|
2942
2951
|
--primary-color: var(--sl-color-primary-600);
|
|
2943
2952
|
}
|
|
@@ -2962,29 +2971,29 @@ Ze.styles = Y`
|
|
|
2962
2971
|
text-decoration: underline;
|
|
2963
2972
|
}
|
|
2964
2973
|
`;
|
|
2965
|
-
|
|
2974
|
+
Et([
|
|
2966
2975
|
v({ type: String })
|
|
2967
2976
|
], Ze.prototype, "url", 2);
|
|
2968
|
-
|
|
2977
|
+
Et([
|
|
2969
2978
|
v({ type: Boolean })
|
|
2970
2979
|
], Ze.prototype, "inverse", 2);
|
|
2971
|
-
Ze =
|
|
2972
|
-
|
|
2980
|
+
Ze = Et([
|
|
2981
|
+
J("cb-external-link")
|
|
2973
2982
|
], Ze);
|
|
2974
|
-
const Ac = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2h-2v-1h2a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM1.928 15.849v-3.337h1.136v-.662H0v.662h1.134v3.337zm4.689-3.999h-.894L4.9 13.289h-.035l-.832-1.439h-.932l1.228 1.983l-1.24 2.016h.862l.853-1.415h.035l.85 1.415h.907l-1.253-1.992zm1.93.662v3.337h-.794v-3.337H6.619v-.662h3.064v.662H8.546Z"/></svg>', Ic = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM1.6 11.85H0v3.999h.791v-1.342h.803q.43 0 .732-.173q.305-.175.463-.474a1.4 1.4 0 0 0 .161-.677q0-.375-.158-.677a1.2 1.2 0 0 0-.46-.477q-.3-.18-.732-.179m.545 1.333a.8.8 0 0 1-.085.38a.57.57 0 0 1-.238.241a.8.8 0 0 1-.375.082H.788V12.48h.66q.327 0 .512.181q.185.183.185.522m1.217-1.333v3.999h1.46q.602 0 .998-.237a1.45 1.45 0 0 0 .595-.689q.196-.45.196-1.084q0-.63-.196-1.075a1.43 1.43 0 0 0-.589-.68q-.396-.234-1.005-.234zm.791.645h.563q.371 0 .609.152a.9.9 0 0 1 .354.454q.118.302.118.753a2.3 2.3 0 0 1-.068.592a1.1 1.1 0 0 1-.196.422a.8.8 0 0 1-.334.252a1.3 1.3 0 0 1-.483.082h-.563zm3.743 1.763v1.591h-.79V11.85h2.548v.653H7.896v1.117h1.606v.638z"/></svg>', Lc = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2H9v-1h3a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM.706 13.189v2.66H0V11.85h.806l1.14 2.596h.026l1.14-2.596h.8v3.999h-.716v-2.66h-.038l-.946 2.159h-.516l-.952-2.16H.706Zm3.919 2.66V11.85h1.459q.609 0 1.005.234t.589.68q.195.445.196 1.075q0 .634-.196 1.084q-.197.451-.595.689q-.396.237-1 .237H4.626Zm1.353-3.354h-.562v2.707h.562q.279 0 .484-.082a.8.8 0 0 0 .334-.252a1.1 1.1 0 0 0 .196-.422q.067-.252.067-.592a2.1 2.1 0 0 0-.117-.753a.9.9 0 0 0-.354-.454q-.238-.152-.61-.152"/></svg>', qc = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM3.517 14.841a1.13 1.13 0 0 0 .401.823q.195.162.478.252q.284.091.665.091q.507 0 .859-.158q.354-.158.539-.44q.187-.284.187-.656q0-.336-.134-.56a1 1 0 0 0-.375-.357a2 2 0 0 0-.566-.21l-.621-.144a1 1 0 0 1-.404-.176a.37.37 0 0 1-.144-.299q0-.234.185-.384q.188-.152.512-.152q.214 0 .37.068a.6.6 0 0 1 .246.181a.56.56 0 0 1 .12.258h.75a1.1 1.1 0 0 0-.2-.566a1.2 1.2 0 0 0-.5-.41a1.8 1.8 0 0 0-.78-.152q-.439 0-.776.15q-.337.149-.527.421q-.19.273-.19.639q0 .302.122.524q.124.223.352.367q.228.143.539.213l.618.144q.31.073.463.193a.39.39 0 0 1 .152.326a.5.5 0 0 1-.085.29a.56.56 0 0 1-.255.193q-.167.07-.413.07q-.175 0-.32-.04a.8.8 0 0 1-.248-.115a.58.58 0 0 1-.255-.384zM.806 13.693q0-.373.102-.633a.87.87 0 0 1 .302-.399a.8.8 0 0 1 .475-.137q.225 0 .398.097a.7.7 0 0 1 .272.26a.85.85 0 0 1 .12.381h.765v-.072a1.33 1.33 0 0 0-.466-.964a1.4 1.4 0 0 0-.489-.272a1.8 1.8 0 0 0-.606-.097q-.534 0-.911.223q-.375.222-.572.632q-.195.41-.196.979v.498q0 .568.193.976q.197.407.572.626q.375.217.914.217q.439 0 .785-.164t.55-.454a1.27 1.27 0 0 0 .226-.674v-.076h-.764a.8.8 0 0 1-.118.363a.7.7 0 0 1-.272.25a.9.9 0 0 1-.401.087a.85.85 0 0 1-.478-.132a.83.83 0 0 1-.299-.392a1.7 1.7 0 0 1-.102-.627zm8.239 2.238h-.953l-1.338-3.999h.917l.896 3.138h.038l.888-3.138h.879z"/></svg>',
|
|
2975
|
-
var jc = Object.defineProperty, Hc = Object.getOwnPropertyDescriptor,
|
|
2983
|
+
const Ac = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2h-2v-1h2a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM1.928 15.849v-3.337h1.136v-.662H0v.662h1.134v3.337zm4.689-3.999h-.894L4.9 13.289h-.035l-.832-1.439h-.932l1.228 1.983l-1.24 2.016h.862l.853-1.415h.035l.85 1.415h.907l-1.253-1.992zm1.93.662v3.337h-.794v-3.337H6.619v-.662h3.064v.662H8.546Z"/></svg>', Ic = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM1.6 11.85H0v3.999h.791v-1.342h.803q.43 0 .732-.173q.305-.175.463-.474a1.4 1.4 0 0 0 .161-.677q0-.375-.158-.677a1.2 1.2 0 0 0-.46-.477q-.3-.18-.732-.179m.545 1.333a.8.8 0 0 1-.085.38a.57.57 0 0 1-.238.241a.8.8 0 0 1-.375.082H.788V12.48h.66q.327 0 .512.181q.185.183.185.522m1.217-1.333v3.999h1.46q.602 0 .998-.237a1.45 1.45 0 0 0 .595-.689q.196-.45.196-1.084q0-.63-.196-1.075a1.43 1.43 0 0 0-.589-.68q-.396-.234-1.005-.234zm.791.645h.563q.371 0 .609.152a.9.9 0 0 1 .354.454q.118.302.118.753a2.3 2.3 0 0 1-.068.592a1.1 1.1 0 0 1-.196.422a.8.8 0 0 1-.334.252a1.3 1.3 0 0 1-.483.082h-.563zm3.743 1.763v1.591h-.79V11.85h2.548v.653H7.896v1.117h1.606v.638z"/></svg>', Lc = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2H9v-1h3a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM.706 13.189v2.66H0V11.85h.806l1.14 2.596h.026l1.14-2.596h.8v3.999h-.716v-2.66h-.038l-.946 2.159h-.516l-.952-2.16H.706Zm3.919 2.66V11.85h1.459q.609 0 1.005.234t.589.68q.195.445.196 1.075q0 .634-.196 1.084q-.197.451-.595.689q-.396.237-1 .237H4.626Zm1.353-3.354h-.562v2.707h.562q.279 0 .484-.082a.8.8 0 0 0 .334-.252a1.1 1.1 0 0 0 .196-.422q.067-.252.067-.592a2.1 2.1 0 0 0-.117-.753a.9.9 0 0 0-.354-.454q-.238-.152-.61-.152"/></svg>', qc = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM3.517 14.841a1.13 1.13 0 0 0 .401.823q.195.162.478.252q.284.091.665.091q.507 0 .859-.158q.354-.158.539-.44q.187-.284.187-.656q0-.336-.134-.56a1 1 0 0 0-.375-.357a2 2 0 0 0-.566-.21l-.621-.144a1 1 0 0 1-.404-.176a.37.37 0 0 1-.144-.299q0-.234.185-.384q.188-.152.512-.152q.214 0 .37.068a.6.6 0 0 1 .246.181a.56.56 0 0 1 .12.258h.75a1.1 1.1 0 0 0-.2-.566a1.2 1.2 0 0 0-.5-.41a1.8 1.8 0 0 0-.78-.152q-.439 0-.776.15q-.337.149-.527.421q-.19.273-.19.639q0 .302.122.524q.124.223.352.367q.228.143.539.213l.618.144q.31.073.463.193a.39.39 0 0 1 .152.326a.5.5 0 0 1-.085.29a.56.56 0 0 1-.255.193q-.167.07-.413.07q-.175 0-.32-.04a.8.8 0 0 1-.248-.115a.58.58 0 0 1-.255-.384zM.806 13.693q0-.373.102-.633a.87.87 0 0 1 .302-.399a.8.8 0 0 1 .475-.137q.225 0 .398.097a.7.7 0 0 1 .272.26a.85.85 0 0 1 .12.381h.765v-.072a1.33 1.33 0 0 0-.466-.964a1.4 1.4 0 0 0-.489-.272a1.8 1.8 0 0 0-.606-.097q-.534 0-.911.223q-.375.222-.572.632q-.195.41-.196.979v.498q0 .568.193.976q.197.407.572.626q.375.217.914.217q.439 0 .785-.164t.55-.454a1.27 1.27 0 0 0 .226-.674v-.076h-.764a.8.8 0 0 1-.118.363a.7.7 0 0 1-.272.25a.9.9 0 0 1-.401.087a.85.85 0 0 1-.478-.132a.83.83 0 0 1-.299-.392a1.7 1.7 0 0 1-.102-.627zm8.239 2.238h-.953l-1.338-3.999h.917l.896 3.138h.038l.888-3.138h.879z"/></svg>', Oc = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM1.6 11.85H0v3.999h.791v-1.342h.803q.43 0 .732-.173q.305-.175.463-.474a1.4 1.4 0 0 0 .161-.677q0-.375-.158-.677a1.2 1.2 0 0 0-.46-.477q-.3-.18-.732-.179m.545 1.333a.8.8 0 0 1-.085.38a.57.57 0 0 1-.238.241a.8.8 0 0 1-.375.082H.788V12.48h.66q.327 0 .512.181q.185.183.185.522m2.817-1.333h-1.6v3.999h.791v-1.342h.803q.43 0 .732-.173q.305-.175.463-.474q.162-.302.161-.677q0-.375-.158-.677a1.2 1.2 0 0 0-.46-.477q-.3-.18-.732-.179m.545 1.333a.8.8 0 0 1-.085.38a.57.57 0 0 1-.238.241a.8.8 0 0 1-.375.082H4.15V12.48h.66q.327 0 .512.181q.185.183.185.522m2.767-.67v3.336H7.48v-3.337H6.346v-.662h3.065v.662z"/></svg>', Pc = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2v-1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zm-7.839 9.166v.522q0 .384-.117.641a.86.86 0 0 1-.322.387a.9.9 0 0 1-.469.126a.9.9 0 0 1-.471-.126a.87.87 0 0 1-.32-.386a1.55 1.55 0 0 1-.117-.642v-.522q0-.386.117-.641a.87.87 0 0 1 .32-.387a.87.87 0 0 1 .471-.129q.264 0 .469.13a.86.86 0 0 1 .322.386q.117.255.117.641m.803.519v-.513q0-.565-.205-.972a1.46 1.46 0 0 0-.589-.63q-.381-.22-.917-.22q-.533 0-.92.22a1.44 1.44 0 0 0-.589.627q-.204.406-.205.975v.513q0 .563.205.973q.205.406.59.627q.386.216.92.216q.535 0 .916-.216q.383-.22.59-.627q.204-.41.204-.973M0 11.926v4h1.459q.603 0 .999-.238a1.45 1.45 0 0 0 .595-.689q.196-.45.196-1.084q0-.63-.196-1.075a1.43 1.43 0 0 0-.59-.68q-.395-.234-1.004-.234zm.791.645h.563q.371 0 .609.152a.9.9 0 0 1 .354.454q.118.302.118.753a2.3 2.3 0 0 1-.068.592a1.1 1.1 0 0 1-.196.422a.8.8 0 0 1-.334.252a1.3 1.3 0 0 1-.483.082H.79V12.57Zm7.422.483a1.7 1.7 0 0 0-.103.633v.495q0 .369.103.627a.83.83 0 0 0 .298.393a.85.85 0 0 0 .478.131a.9.9 0 0 0 .401-.088a.7.7 0 0 0 .273-.248a.8.8 0 0 0 .117-.364h.765v.076a1.27 1.27 0 0 1-.226.674q-.205.29-.55.454a1.8 1.8 0 0 1-.786.164q-.54 0-.914-.216a1.4 1.4 0 0 1-.571-.627q-.194-.408-.194-.976v-.498q0-.568.197-.978q.195-.411.571-.633q.378-.223.911-.223q.328 0 .607.097q.28.093.489.272a1.33 1.33 0 0 1 .466.964v.073H9.78a.85.85 0 0 0-.12-.38a.7.7 0 0 0-.273-.261a.8.8 0 0 0-.398-.097a.8.8 0 0 0-.475.138a.87.87 0 0 0-.301.398"/></svg>', zc = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V11h-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zm-6.839 9.688v-.522a1.5 1.5 0 0 0-.117-.641a.86.86 0 0 0-.322-.387a.86.86 0 0 0-.469-.129a.87.87 0 0 0-.471.13a.87.87 0 0 0-.32.386a1.5 1.5 0 0 0-.117.641v.522q0 .384.117.641a.87.87 0 0 0 .32.387a.9.9 0 0 0 .471.126a.9.9 0 0 0 .469-.126a.86.86 0 0 0 .322-.386a1.55 1.55 0 0 0 .117-.642m.803-.516v.513q0 .563-.205.973a1.47 1.47 0 0 1-.589.627q-.381.216-.917.216a1.86 1.86 0 0 1-.92-.216a1.46 1.46 0 0 1-.589-.627a2.15 2.15 0 0 1-.205-.973v-.513q0-.569.205-.975q.205-.411.59-.627q.386-.22.92-.22q.535 0 .916.22q.383.219.59.63q.204.406.204.972M1 15.925v-3.999h1.459q.609 0 1.005.235q.396.233.589.68q.196.445.196 1.074q0 .634-.196 1.084q-.197.451-.595.689q-.396.237-.999.237zm1.354-3.354H1.79v2.707h.563q.277 0 .483-.082a.8.8 0 0 0 .334-.252q.132-.17.196-.422a2.3 2.3 0 0 0 .068-.592q0-.45-.118-.753a.9.9 0 0 0-.354-.454q-.237-.152-.61-.152Zm6.756 1.116q0-.373.103-.633a.87.87 0 0 1 .301-.398a.8.8 0 0 1 .475-.138q.225 0 .398.097a.7.7 0 0 1 .273.26a.85.85 0 0 1 .12.381h.765v-.073a1.33 1.33 0 0 0-.466-.964a1.4 1.4 0 0 0-.49-.272a1.8 1.8 0 0 0-.606-.097q-.534 0-.911.223q-.375.222-.571.633q-.197.41-.197.978v.498q0 .568.194.976q.195.406.571.627q.375.216.914.216q.44 0 .785-.164t.551-.454a1.27 1.27 0 0 0 .226-.674v-.076h-.765a.8.8 0 0 1-.117.364a.7.7 0 0 1-.273.248a.9.9 0 0 1-.401.088a.85.85 0 0 1-.478-.131a.83.83 0 0 1-.298-.393a1.7 1.7 0 0 1-.103-.627zm5.092-1.76h.894l-1.275 2.006l1.254 1.992h-.908l-.85-1.415h-.035l-.852 1.415h-.862l1.24-2.015l-1.228-1.984h.932l.832 1.439h.035z"/></svg>';
|
|
2984
|
+
var jc = Object.defineProperty, Hc = Object.getOwnPropertyDescriptor, At = (c, e, a, s) => {
|
|
2976
2985
|
for (var n = s > 1 ? void 0 : s ? Hc(e, a) : e, d = c.length - 1, f; d >= 0; d--)
|
|
2977
2986
|
(f = c[d]) && (n = (s ? f(e, a, n) : f(n)) || n);
|
|
2978
2987
|
return s && n && jc(e, a, n), n;
|
|
2979
2988
|
};
|
|
2980
|
-
const
|
|
2989
|
+
const Nt = {
|
|
2981
2990
|
pdf: Ic,
|
|
2982
2991
|
txt: Ac,
|
|
2983
2992
|
md: Lc,
|
|
2984
2993
|
csv: qc,
|
|
2985
|
-
ppd:
|
|
2986
|
-
doc:
|
|
2987
|
-
docx:
|
|
2994
|
+
ppd: Oc,
|
|
2995
|
+
doc: Pc,
|
|
2996
|
+
docx: zc
|
|
2988
2997
|
};
|
|
2989
2998
|
let Je = class extends ee {
|
|
2990
2999
|
constructor() {
|
|
@@ -3011,22 +3020,22 @@ let Je = class extends ee {
|
|
|
3011
3020
|
return g`
|
|
3012
3021
|
<cb-icon
|
|
3013
3022
|
class="cb-file-icon"
|
|
3014
|
-
svg="${
|
|
3023
|
+
svg="${Nt[this.type] || Nt.txt}"
|
|
3015
3024
|
></cb-icon>
|
|
3016
3025
|
`;
|
|
3017
3026
|
}
|
|
3018
3027
|
};
|
|
3019
|
-
Je.styles =
|
|
3020
|
-
|
|
3028
|
+
Je.styles = Mc;
|
|
3029
|
+
At([
|
|
3021
3030
|
v({ type: String })
|
|
3022
3031
|
], Je.prototype, "filename", 2);
|
|
3023
|
-
|
|
3032
|
+
At([
|
|
3024
3033
|
v({ type: String })
|
|
3025
3034
|
], Je.prototype, "url", 2);
|
|
3026
|
-
Je =
|
|
3027
|
-
|
|
3035
|
+
Je = At([
|
|
3036
|
+
J("cb-file")
|
|
3028
3037
|
], Je);
|
|
3029
|
-
const Bc = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><g fill="currentColor"><path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"/><path d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4L4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"/></g></svg>', Rc = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 8a3 3 0 1 0 0-6a3 3 0 0 0 0 6m2-3a2 2 0 1 1-4 0a2 2 0 0 1 4 0m4 8c0 1-1 1-1 1H3s-1 0-1-1s1-4 6-4s6 3 6 4m-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10s-3.516.68-4.168 1.332c-.678.678-.83 1.418-.832 1.664z"/></svg>',
|
|
3038
|
+
const Bc = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><g fill="currentColor"><path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"/><path d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4L4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"/></g></svg>', Rc = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 8a3 3 0 1 0 0-6a3 3 0 0 0 0 6m2-3a2 2 0 1 1-4 0a2 2 0 0 1 4 0m4 8c0 1-1 1-1 1H3s-1 0-1-1s1-4 6-4s6 3 6 4m-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10s-3.516.68-4.168 1.332c-.678.678-.83 1.418-.832 1.664z"/></svg>', oa = '<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 9v12H1V9zm4 12a2 2 0 0 1-2-2V9c0-.55.22-1.05.59-1.41L14.17 1l1.06 1.06c.27.27.44.64.44 1.05l-.03.32L14.69 8H21a2 2 0 0 1 2 2v2c0 .26-.05.5-.14.73l-3.02 7.05C19.54 20.5 18.83 21 18 21zm0-2h9.03L21 12v-2h-8.79l1.13-5.32L9 9.03z"/></svg>', ra = '<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M19 15V3h4v12zM15 3a2 2 0 0 1 2 2v10c0 .55-.22 1.05-.59 1.41L9.83 23l-1.06-1.06c-.27-.27-.44-.64-.44-1.06l.03-.31l.95-4.57H3a2 2 0 0 1-2-2v-2c0-.26.05-.5.14-.73l3.02-7.05C4.46 3.5 5.17 3 6 3zm0 2H5.97L3 12v2h8.78l-1.13 5.32L15 14.97z"/></svg>', Vc = X`
|
|
3030
3039
|
pre code.hljs {
|
|
3031
3040
|
display: block;
|
|
3032
3041
|
overflow-x: auto;
|
|
@@ -4241,8 +4250,8 @@ const Bc = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><g fill="curr
|
|
|
4241
4250
|
white-space: pre-wrap;
|
|
4242
4251
|
color: var(--n-text-color);
|
|
4243
4252
|
}
|
|
4244
|
-
`, Dc =
|
|
4245
|
-
${
|
|
4253
|
+
`, Dc = X`
|
|
4254
|
+
${me}
|
|
4246
4255
|
${Vc}
|
|
4247
4256
|
|
|
4248
4257
|
.cb-message-row {
|
|
@@ -4447,7 +4456,7 @@ const Bc = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><g fill="curr
|
|
|
4447
4456
|
filter: alpha(opacity=80);
|
|
4448
4457
|
}
|
|
4449
4458
|
`;
|
|
4450
|
-
function
|
|
4459
|
+
function Ut(c, e) {
|
|
4451
4460
|
return `<pre class="code-block-wrapper"><div class="code-block-header"><span class="code-block-header__lang">${e}</span><span class="code-block-header__copy">Copy</span></div><code class="hljs code-block-body ${e}">${c}</code></pre>`;
|
|
4452
4461
|
}
|
|
4453
4462
|
function Fc() {
|
|
@@ -4458,16 +4467,16 @@ function Fc() {
|
|
|
4458
4467
|
highlight(e, a) {
|
|
4459
4468
|
if (!!(a && vt.getLanguage(a))) {
|
|
4460
4469
|
const n = a ?? "";
|
|
4461
|
-
return
|
|
4470
|
+
return Ut(vt.highlight(e, { language: n }).value, n);
|
|
4462
4471
|
}
|
|
4463
|
-
return
|
|
4472
|
+
return Ut(vt.highlightAuto(e).value, "");
|
|
4464
4473
|
}
|
|
4465
4474
|
});
|
|
4466
4475
|
return c.use(Ra, { attrs: { target: "_blank", rel: "noopener" } }), c;
|
|
4467
4476
|
}
|
|
4468
|
-
async function
|
|
4477
|
+
async function Wt(c) {
|
|
4469
4478
|
const a = Fc().render(c);
|
|
4470
|
-
return g`${
|
|
4479
|
+
return g`${Y(a)}`;
|
|
4471
4480
|
}
|
|
4472
4481
|
var Nc = Object.defineProperty, Uc = Object.getOwnPropertyDescriptor, Fe = (c, e, a, s) => {
|
|
4473
4482
|
for (var n = s > 1 ? void 0 : s ? Uc(e, a) : e, d = c.length - 1, f; d >= 0; d--)
|
|
@@ -4557,12 +4566,12 @@ let $e = class extends ee {
|
|
|
4557
4566
|
});
|
|
4558
4567
|
}
|
|
4559
4568
|
render() {
|
|
4560
|
-
return
|
|
4569
|
+
return ce(
|
|
4561
4570
|
this.message.data || this.message.isThinking,
|
|
4562
4571
|
() => g`
|
|
4563
4572
|
<div class="cb-message-row" part="bot-message">
|
|
4564
4573
|
<!-- message -->
|
|
4565
|
-
${
|
|
4574
|
+
${ce(
|
|
4566
4575
|
this._isBot,
|
|
4567
4576
|
() => this.renderBotMessage(this.message),
|
|
4568
4577
|
() => this.renderUserMessage(this.message)
|
|
@@ -4595,17 +4604,17 @@ let $e = class extends ee {
|
|
|
4595
4604
|
`;
|
|
4596
4605
|
}
|
|
4597
4606
|
async _getMessageText(c) {
|
|
4598
|
-
return
|
|
4607
|
+
return this._isBot ? Wt(c.data.text) : c.data.text;
|
|
4599
4608
|
}
|
|
4600
4609
|
renderMessageContent(c) {
|
|
4601
4610
|
var e;
|
|
4602
4611
|
return c.isThinking ? g`<cb-thinking></cb-thinking>` : c.isUploading ? g`<cb-uploading .files="${c.data.files || []}"></cb-uploading>` : c.type === "text" ? g`<div class="cb-message-text">
|
|
4603
|
-
${
|
|
4612
|
+
${ce(
|
|
4604
4613
|
c.data.userName,
|
|
4605
4614
|
() => g`<div style="font-size: 12px; color:#9ca3af">${c.data.userName}</div>`,
|
|
4606
4615
|
() => null
|
|
4607
4616
|
)}
|
|
4608
|
-
${
|
|
4617
|
+
${Dt(
|
|
4609
4618
|
this._getMessageText(c).then((a) => g`${a}`)
|
|
4610
4619
|
)}
|
|
4611
4620
|
</div>` : c.type === "file" ? g`${Ye(
|
|
@@ -4613,8 +4622,8 @@ let $e = class extends ee {
|
|
|
4613
4622
|
(a) => a.id,
|
|
4614
4623
|
(a) => g`<cb-file filename="${a.name}" url="${a.url}"></cb-file>`
|
|
4615
4624
|
)}` : g`<div class="cb-message-text">
|
|
4616
|
-
${
|
|
4617
|
-
|
|
4625
|
+
${Dt(
|
|
4626
|
+
Wt(((e = c.data.text) == null ? void 0 : e.toString()) || "").then((a) => g`${a}`)
|
|
4618
4627
|
)}
|
|
4619
4628
|
</div>`;
|
|
4620
4629
|
}
|
|
@@ -4622,9 +4631,9 @@ let $e = class extends ee {
|
|
|
4622
4631
|
var e;
|
|
4623
4632
|
if (c.data.userName && c.data.userName !== "") {
|
|
4624
4633
|
const a = ((e = c.data) == null ? void 0 : e.userAvatar) || "";
|
|
4625
|
-
return a !== "" ? g` <img src="${a}" style="width: 24px;height: 24px;" /> ` :
|
|
4634
|
+
return a !== "" ? g` <img src="${a}" style="width: 24px;height: 24px;" /> ` : be`${Y(p.setting.agentIconSvg)}`;
|
|
4626
4635
|
}
|
|
4627
|
-
return c.author === "system" ?
|
|
4636
|
+
return c.author === "system" ? be`${Y(p.setting.systemIconSvg)}` : be`${Y(p.setting.botIconSvg)}`;
|
|
4628
4637
|
}
|
|
4629
4638
|
renderBotMessage(c) {
|
|
4630
4639
|
return g`
|
|
@@ -4638,8 +4647,8 @@ let $e = class extends ee {
|
|
|
4638
4647
|
renderBotMessageFeedback(c) {
|
|
4639
4648
|
return this.suppressFeedback || !p.setting.feedbackEnabled ? null : g`
|
|
4640
4649
|
<div class="cb-message-feedback-tools">
|
|
4641
|
-
<div class="cb-message-feedback-icon cb-feedback-up" @click="${() => this.startFeedback(!0, c)}">${
|
|
4642
|
-
<div class="cb-message-feedback-icon cb-feedback-down" @click="${() => this.startFeedback(!1, c)}">${
|
|
4650
|
+
<div class="cb-message-feedback-icon cb-feedback-up" @click="${() => this.startFeedback(!0, c)}">${be`${Y(oa)}`}</div>
|
|
4651
|
+
<div class="cb-message-feedback-icon cb-feedback-down" @click="${() => this.startFeedback(!1, c)}">${be`${Y(ra)}`}</div>
|
|
4643
4652
|
</div>
|
|
4644
4653
|
`;
|
|
4645
4654
|
}
|
|
@@ -4653,15 +4662,15 @@ let $e = class extends ee {
|
|
|
4653
4662
|
<cb-icon slot="icon" svg="${Rc}" color="white"></cb-icon>
|
|
4654
4663
|
//appState.appearanceUserMessageAvatarPosition
|
|
4655
4664
|
</sl-avatar>-->
|
|
4656
|
-
${
|
|
4665
|
+
${ce(
|
|
4657
4666
|
p.appearanceUserMessageAvatarPosition === "left",
|
|
4658
4667
|
() => g`
|
|
4659
|
-
<div class="avatar user-avatar">${
|
|
4668
|
+
<div class="avatar user-avatar">${Y(p.setting.userIconSvg)}</div>
|
|
4660
4669
|
${this.renderMessage(c, "user-message-content")}
|
|
4661
4670
|
`,
|
|
4662
4671
|
() => g`
|
|
4663
4672
|
${this.renderMessage(c, "user-message-content")}
|
|
4664
|
-
<div class="avatar user-avatar">${
|
|
4673
|
+
<div class="avatar user-avatar">${Y(p.setting.userIconSvg)}</div>
|
|
4665
4674
|
`
|
|
4666
4675
|
)}
|
|
4667
4676
|
</div>
|
|
@@ -4679,22 +4688,22 @@ Fe([
|
|
|
4679
4688
|
v({ type: Boolean })
|
|
4680
4689
|
], $e.prototype, "suppressFeedback", 2);
|
|
4681
4690
|
Fe([
|
|
4682
|
-
|
|
4691
|
+
Kt(".code-block-header__copy")
|
|
4683
4692
|
], $e.prototype, "copyBtns", 2);
|
|
4684
4693
|
Fe([
|
|
4685
|
-
|
|
4694
|
+
Kt("img")
|
|
4686
4695
|
], $e.prototype, "glightboxImages", 2);
|
|
4687
4696
|
$e = Fe([
|
|
4688
|
-
|
|
4697
|
+
J("cb-message")
|
|
4689
4698
|
], $e);
|
|
4690
|
-
var Wc = Object.defineProperty, Yc = Object.getOwnPropertyDescriptor,
|
|
4699
|
+
var Wc = Object.defineProperty, Yc = Object.getOwnPropertyDescriptor, ye = (c, e, a, s) => {
|
|
4691
4700
|
for (var n = s > 1 ? void 0 : s ? Yc(e, a) : e, d = c.length - 1, f; d >= 0; d--)
|
|
4692
4701
|
(f = c[d]) && (n = (s ? f(e, a, n) : f(n)) || n);
|
|
4693
4702
|
return s && n && Wc(e, a, n), n;
|
|
4694
4703
|
};
|
|
4695
|
-
const
|
|
4696
|
-
|
|
4697
|
-
let
|
|
4704
|
+
const we = Ke.noConflict();
|
|
4705
|
+
we.setLevel("info");
|
|
4706
|
+
let le = class extends ee {
|
|
4698
4707
|
constructor() {
|
|
4699
4708
|
super(...arguments), this.messages = [], this.actions = [], this.form = null, this.suppressFeedback = !1, this.calendlyInjected = !1, this.activeCalendlyAction = -1, this.hubspotMeetingInjected = !1, this.activeHubspotMeetingAction = -1;
|
|
4700
4709
|
}
|
|
@@ -4720,7 +4729,7 @@ let fe = class extends ee {
|
|
|
4720
4729
|
}
|
|
4721
4730
|
renderForm() {
|
|
4722
4731
|
return this.form ? g` <form class="cb-input-form" part="form" @submit="${this.handleFormSubmit.bind(this)}">
|
|
4723
|
-
<div class="cb-input-form-title">${this.form.title}</div>
|
|
4732
|
+
<div class="cb-input-form-title" part="form-title">${this.form.title}</div>
|
|
4724
4733
|
${Ye(
|
|
4725
4734
|
this.form.fields,
|
|
4726
4735
|
(c, e) => e,
|
|
@@ -4728,9 +4737,18 @@ let fe = class extends ee {
|
|
|
4728
4737
|
const e = (c == null ? void 0 : c.required) || !1, a = p.getPrefilledFormFieldValue(c.name);
|
|
4729
4738
|
switch (c.type) {
|
|
4730
4739
|
case "string":
|
|
4731
|
-
return g`<sl-input
|
|
4740
|
+
return g`<sl-input
|
|
4741
|
+
value="${a}"
|
|
4742
|
+
part="form-input"
|
|
4743
|
+
class="cb-input-form-input"
|
|
4744
|
+
id="${"cb-form-field" + c.name}"
|
|
4745
|
+
name="${c.name}"
|
|
4746
|
+
label="${c.title}"
|
|
4747
|
+
?required="${e}"
|
|
4748
|
+
></sl-input>`;
|
|
4732
4749
|
case "email":
|
|
4733
4750
|
return g`<sl-input
|
|
4751
|
+
part="form-input"
|
|
4734
4752
|
value="${a}"
|
|
4735
4753
|
class="cb-input-form-input"
|
|
4736
4754
|
id="${"cb-form-field" + c.name}"
|
|
@@ -4741,6 +4759,7 @@ let fe = class extends ee {
|
|
|
4741
4759
|
></sl-input>`;
|
|
4742
4760
|
case "phone":
|
|
4743
4761
|
return g`<sl-input
|
|
4762
|
+
part="form-input"
|
|
4744
4763
|
value="${a}"
|
|
4745
4764
|
class="cb-input-form-input"
|
|
4746
4765
|
id="${"cb-form-field" + c.name}"
|
|
@@ -4754,13 +4773,13 @@ let fe = class extends ee {
|
|
|
4754
4773
|
return a || s[0], g`<div class="cb-form-field">
|
|
4755
4774
|
<label class="cb-form-field-label"
|
|
4756
4775
|
>${c.title}
|
|
4757
|
-
${
|
|
4776
|
+
${ce(
|
|
4758
4777
|
e,
|
|
4759
4778
|
() => g`*`,
|
|
4760
4779
|
() => g``
|
|
4761
4780
|
)}
|
|
4762
4781
|
</label>
|
|
4763
|
-
<select id="${"cb-form-field" + c.name}" class="cb-form-field-select" name="${c.name}">
|
|
4782
|
+
<select id="${"cb-form-field" + c.name}" class="cb-form-field-select" part="form-input" name="${c.name}">
|
|
4764
4783
|
${Ye(
|
|
4765
4784
|
s,
|
|
4766
4785
|
(n, d) => d,
|
|
@@ -4772,7 +4791,7 @@ let fe = class extends ee {
|
|
|
4772
4791
|
}
|
|
4773
4792
|
}
|
|
4774
4793
|
)}
|
|
4775
|
-
<sl-button class="cb-input-form-submit" variant="primary" pill type="submit">Send</sl-button>
|
|
4794
|
+
<sl-button class="cb-input-form-submit" part="form-submit" variant="primary" pill type="submit">Send</sl-button>
|
|
4776
4795
|
</form>` : null;
|
|
4777
4796
|
}
|
|
4778
4797
|
handleFormSubmit(c) {
|
|
@@ -4790,13 +4809,13 @@ let fe = class extends ee {
|
|
|
4790
4809
|
}
|
|
4791
4810
|
}
|
|
4792
4811
|
p.submitForm(e).then(() => {
|
|
4793
|
-
|
|
4812
|
+
we.info("Form submitted", e), this.emit("form:submit", {
|
|
4794
4813
|
detail: {
|
|
4795
4814
|
formData: e
|
|
4796
4815
|
}
|
|
4797
4816
|
});
|
|
4798
4817
|
}).catch((a) => {
|
|
4799
|
-
|
|
4818
|
+
we.error(`Error when submitting form: ${a.message}`);
|
|
4800
4819
|
});
|
|
4801
4820
|
}
|
|
4802
4821
|
/* Form sample
|
|
@@ -4836,7 +4855,7 @@ let fe = class extends ee {
|
|
|
4836
4855
|
return null;
|
|
4837
4856
|
}
|
|
4838
4857
|
handleCalendlyEvent(c) {
|
|
4839
|
-
switch (
|
|
4858
|
+
switch (we.info("Got Calendly Event:", c.data), c.data.event) {
|
|
4840
4859
|
case "calendly.event_scheduled": {
|
|
4841
4860
|
const e = this.activeCalendlyAction;
|
|
4842
4861
|
e >= 0 && (p.removeAction(e, !0, c.data), p.addSystemMessage("Your meeting has been scheduled!"), this.activeCalendlyAction = -1);
|
|
@@ -4844,10 +4863,10 @@ let fe = class extends ee {
|
|
|
4844
4863
|
}
|
|
4845
4864
|
}
|
|
4846
4865
|
invokeLinkAction(c = {}) {
|
|
4847
|
-
|
|
4866
|
+
we.info("invokeLinkAction:", c), window.open(c.url, "_blank");
|
|
4848
4867
|
}
|
|
4849
4868
|
invokeCalendlyAction(c = {}) {
|
|
4850
|
-
return
|
|
4869
|
+
return we.info("invokeCalendlyAction:", c), "Calendly" in window && (this.activeCalendlyAction = c.internalId, window.Calendly.initPopupWidget({ url: c.url })), !1;
|
|
4851
4870
|
}
|
|
4852
4871
|
renderCalendlyAction(c) {
|
|
4853
4872
|
if (!("Calendly" in window) && !this.calendlyInjected) {
|
|
@@ -4894,10 +4913,10 @@ let fe = class extends ee {
|
|
|
4894
4913
|
var a, s;
|
|
4895
4914
|
const e = Date.now();
|
|
4896
4915
|
if (this.activeHubspotMeetingAction !== -1) {
|
|
4897
|
-
|
|
4916
|
+
we.info(`invokeHubspotMeetingAction: action ${this.activeHubspotMeetingAction} is already active - ignored`);
|
|
4898
4917
|
return;
|
|
4899
4918
|
}
|
|
4900
|
-
if (
|
|
4919
|
+
if (we.info("invokeHubspotMeetingAction:", c), "hbspt" in window && typeof ((s = (a = window.hbspt) == null ? void 0 : a.meetings) == null ? void 0 : s.create) == "function") {
|
|
4901
4920
|
const n = document.getElementById("enegelai-bot-hubspot-meeting-container"), d = document.querySelector(".enegelai-bot-hubspot-meeting-widget");
|
|
4902
4921
|
if (n && d) {
|
|
4903
4922
|
const f = c.url + "?embed=true";
|
|
@@ -4910,7 +4929,7 @@ let fe = class extends ee {
|
|
|
4910
4929
|
}
|
|
4911
4930
|
handleHubspotEvent(c) {
|
|
4912
4931
|
var s;
|
|
4913
|
-
if (
|
|
4932
|
+
if (we.info("Got Hubspot Event:", c.data), !(((s = c == null ? void 0 : c.data) == null ? void 0 : s.meetingBookSucceeded) || !1))
|
|
4914
4933
|
return;
|
|
4915
4934
|
const a = this.activeHubspotMeetingAction;
|
|
4916
4935
|
if (a >= 0) {
|
|
@@ -4962,39 +4981,39 @@ let fe = class extends ee {
|
|
|
4962
4981
|
`;
|
|
4963
4982
|
}
|
|
4964
4983
|
};
|
|
4965
|
-
|
|
4966
|
-
|
|
4984
|
+
le.styles = vc;
|
|
4985
|
+
ye([
|
|
4967
4986
|
v({ type: Array })
|
|
4968
|
-
],
|
|
4969
|
-
|
|
4987
|
+
], le.prototype, "messages", 2);
|
|
4988
|
+
ye([
|
|
4970
4989
|
v({ type: Array })
|
|
4971
|
-
],
|
|
4972
|
-
|
|
4990
|
+
], le.prototype, "actions", 2);
|
|
4991
|
+
ye([
|
|
4973
4992
|
v({ type: Object })
|
|
4974
|
-
],
|
|
4975
|
-
|
|
4993
|
+
], le.prototype, "form", 2);
|
|
4994
|
+
ye([
|
|
4976
4995
|
v({ type: Boolean })
|
|
4977
|
-
],
|
|
4978
|
-
|
|
4996
|
+
], le.prototype, "suppressFeedback", 2);
|
|
4997
|
+
ye([
|
|
4979
4998
|
xe("#cb-message-list-bottom-anchor")
|
|
4980
|
-
],
|
|
4981
|
-
|
|
4999
|
+
], le.prototype, "_messageListBottomAnchor", 2);
|
|
5000
|
+
ye([
|
|
4982
5001
|
xe(".cb-input-form")
|
|
4983
|
-
],
|
|
4984
|
-
|
|
5002
|
+
], le.prototype, "_inputForm", 2);
|
|
5003
|
+
ye([
|
|
4985
5004
|
Mt({ capture: !1, passive: !0 })
|
|
4986
|
-
],
|
|
4987
|
-
|
|
5005
|
+
], le.prototype, "invokeLinkAction", 1);
|
|
5006
|
+
ye([
|
|
4988
5007
|
Mt({ capture: !1, passive: !0 })
|
|
4989
|
-
],
|
|
4990
|
-
|
|
5008
|
+
], le.prototype, "invokeCalendlyAction", 1);
|
|
5009
|
+
ye([
|
|
4991
5010
|
Mt({ capture: !1, passive: !0 })
|
|
4992
|
-
],
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
],
|
|
4996
|
-
const Xc =
|
|
4997
|
-
${
|
|
5011
|
+
], le.prototype, "invokeHubspotMeetingAction", 1);
|
|
5012
|
+
le = ye([
|
|
5013
|
+
J("cb-message-list")
|
|
5014
|
+
], le);
|
|
5015
|
+
const Xc = X`
|
|
5016
|
+
${me}
|
|
4998
5017
|
|
|
4999
5018
|
:host {
|
|
5000
5019
|
width: 100%;
|
|
@@ -5040,7 +5059,7 @@ var Jc = Object.defineProperty, Kc = Object.getOwnPropertyDescriptor, ke = (c, e
|
|
|
5040
5059
|
(f = c[d]) && (n = (s ? f(e, a, n) : f(n)) || n);
|
|
5041
5060
|
return s && n && Jc(e, a, n), n;
|
|
5042
5061
|
};
|
|
5043
|
-
let
|
|
5062
|
+
let he = class extends ee {
|
|
5044
5063
|
constructor() {
|
|
5045
5064
|
super(...arguments), this.placeholder = "Type a message...", this.sendButtonLabel = "Send", this.enableFileUpload = !1, this.value = "", this.loading = !1, this.disabled = !1, this.currentKey = "";
|
|
5046
5065
|
}
|
|
@@ -5085,7 +5104,7 @@ let be = class extends ee {
|
|
|
5085
5104
|
}
|
|
5086
5105
|
render() {
|
|
5087
5106
|
return g`
|
|
5088
|
-
${
|
|
5107
|
+
${ce(
|
|
5089
5108
|
this.loading,
|
|
5090
5109
|
() => g`<sl-progress-bar style="--height: 2px;" indeterminate></sl-progress-bar>`,
|
|
5091
5110
|
() => g``
|
|
@@ -5108,7 +5127,7 @@ let be = class extends ee {
|
|
|
5108
5127
|
></sl-textarea>
|
|
5109
5128
|
|
|
5110
5129
|
<span class="cb-input-buttons">
|
|
5111
|
-
${
|
|
5130
|
+
${ce(
|
|
5112
5131
|
this.enableFileUpload,
|
|
5113
5132
|
() => g`
|
|
5114
5133
|
<sl-button @click=${this._sendFileHandler} name="paperclip" label="Attachment" size="large" class="paperclip-button" variant="text" circle>
|
|
@@ -5130,36 +5149,36 @@ let be = class extends ee {
|
|
|
5130
5149
|
c.key === "Enter" && !c.shiftKey && this._sendHandler();
|
|
5131
5150
|
}
|
|
5132
5151
|
};
|
|
5133
|
-
|
|
5152
|
+
he.styles = Xc;
|
|
5134
5153
|
ke([
|
|
5135
5154
|
v({ type: String, attribute: "placeholder" })
|
|
5136
|
-
],
|
|
5155
|
+
], he.prototype, "placeholder", 2);
|
|
5137
5156
|
ke([
|
|
5138
5157
|
v({ type: String, attribute: "send-button-label" })
|
|
5139
|
-
],
|
|
5158
|
+
], he.prototype, "sendButtonLabel", 2);
|
|
5140
5159
|
ke([
|
|
5141
5160
|
v({ type: Boolean, attribute: "enable-file-upload" })
|
|
5142
|
-
],
|
|
5161
|
+
], he.prototype, "enableFileUpload", 2);
|
|
5143
5162
|
ke([
|
|
5144
5163
|
v({ type: String })
|
|
5145
|
-
],
|
|
5164
|
+
], he.prototype, "value", 2);
|
|
5146
5165
|
ke([
|
|
5147
5166
|
v({ type: Boolean })
|
|
5148
|
-
],
|
|
5167
|
+
], he.prototype, "loading", 2);
|
|
5149
5168
|
ke([
|
|
5150
5169
|
v({ type: Boolean })
|
|
5151
|
-
],
|
|
5170
|
+
], he.prototype, "disabled", 2);
|
|
5152
5171
|
ke([
|
|
5153
5172
|
v({ type: String })
|
|
5154
|
-
],
|
|
5173
|
+
], he.prototype, "currentKey", 2);
|
|
5155
5174
|
ke([
|
|
5156
5175
|
xe("sl-textarea")
|
|
5157
|
-
],
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
],
|
|
5161
|
-
const
|
|
5162
|
-
${
|
|
5176
|
+
], he.prototype, "inputElement", 2);
|
|
5177
|
+
he = ke([
|
|
5178
|
+
J("cb-user-input")
|
|
5179
|
+
], he);
|
|
5180
|
+
const da = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"/></svg>', Qc = X`
|
|
5181
|
+
${me}
|
|
5163
5182
|
|
|
5164
5183
|
sl-dialog::part(base) {
|
|
5165
5184
|
z-index: 1000;
|
|
@@ -5229,7 +5248,7 @@ let De = class extends ee {
|
|
|
5229
5248
|
<cb-icon
|
|
5230
5249
|
color="default"
|
|
5231
5250
|
style="font-size: 1em;"
|
|
5232
|
-
svg="${
|
|
5251
|
+
svg="${da}"
|
|
5233
5252
|
></cb-icon>
|
|
5234
5253
|
</sl-button>
|
|
5235
5254
|
</header>
|
|
@@ -5253,7 +5272,7 @@ gt([
|
|
|
5253
5272
|
v({ type: Number })
|
|
5254
5273
|
], De.prototype, "zindex", 2);
|
|
5255
5274
|
De = gt([
|
|
5256
|
-
|
|
5275
|
+
J("cb-dialog")
|
|
5257
5276
|
], De);
|
|
5258
5277
|
var ai = Object.defineProperty, ci = Object.getOwnPropertyDescriptor, fa = (c, e, a, s) => {
|
|
5259
5278
|
for (var n = s > 1 ? void 0 : s ? ci(e, a) : e, d = c.length - 1, f; d >= 0; d--)
|
|
@@ -5294,7 +5313,7 @@ let dt = class extends ee {
|
|
|
5294
5313
|
this.emit("cancel");
|
|
5295
5314
|
}
|
|
5296
5315
|
};
|
|
5297
|
-
dt.styles =
|
|
5316
|
+
dt.styles = X`
|
|
5298
5317
|
.cb-clear-message-dialog {
|
|
5299
5318
|
}
|
|
5300
5319
|
|
|
@@ -5306,9 +5325,9 @@ fa([
|
|
|
5306
5325
|
v({ type: Boolean })
|
|
5307
5326
|
], dt.prototype, "open", 2);
|
|
5308
5327
|
dt = fa([
|
|
5309
|
-
|
|
5328
|
+
J("cb-clear-message-dialog")
|
|
5310
5329
|
], dt);
|
|
5311
|
-
const ii =
|
|
5330
|
+
const ii = X`
|
|
5312
5331
|
:host {
|
|
5313
5332
|
// width: 380px;
|
|
5314
5333
|
|
|
@@ -5373,7 +5392,7 @@ var ni = Object.defineProperty, si = Object.getOwnPropertyDescriptor, Ne = (c, e
|
|
|
5373
5392
|
(f = c[d]) && (n = (s ? f(e, a, n) : f(n)) || n);
|
|
5374
5393
|
return s && n && ni(e, a, n), n;
|
|
5375
5394
|
};
|
|
5376
|
-
let
|
|
5395
|
+
let Me = class extends ee {
|
|
5377
5396
|
constructor() {
|
|
5378
5397
|
super(...arguments), this.open = !1, this.clearMessageDialogOpen = !1, this.customRequest = !1;
|
|
5379
5398
|
}
|
|
@@ -5406,7 +5425,7 @@ let Te = class extends ee {
|
|
|
5406
5425
|
Enable it for your own backend.
|
|
5407
5426
|
</sl-switch>
|
|
5408
5427
|
</div> -->
|
|
5409
|
-
${
|
|
5428
|
+
${ce(
|
|
5410
5429
|
this.customRequest,
|
|
5411
5430
|
() => null,
|
|
5412
5431
|
() => this.renderInternalServices()
|
|
@@ -5493,27 +5512,27 @@ let Te = class extends ee {
|
|
|
5493
5512
|
});
|
|
5494
5513
|
}
|
|
5495
5514
|
};
|
|
5496
|
-
|
|
5515
|
+
Me.styles = ii;
|
|
5497
5516
|
Ne([
|
|
5498
5517
|
v({ type: Boolean })
|
|
5499
|
-
],
|
|
5518
|
+
], Me.prototype, "open", 2);
|
|
5500
5519
|
Ne([
|
|
5501
5520
|
v({ type: Object })
|
|
5502
|
-
],
|
|
5521
|
+
], Me.prototype, "setting", 2);
|
|
5503
5522
|
Ne([
|
|
5504
5523
|
v({ type: Boolean })
|
|
5505
|
-
],
|
|
5524
|
+
], Me.prototype, "clearMessageDialogOpen", 2);
|
|
5506
5525
|
Ne([
|
|
5507
5526
|
xe("sl-dialog")
|
|
5508
|
-
],
|
|
5527
|
+
], Me.prototype, "dialog", 2);
|
|
5509
5528
|
Ne([
|
|
5510
5529
|
v({ type: Boolean })
|
|
5511
|
-
],
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
],
|
|
5515
|
-
const oi =
|
|
5516
|
-
${
|
|
5530
|
+
], Me.prototype, "customRequest", 2);
|
|
5531
|
+
Me = Ne([
|
|
5532
|
+
J("cb-setting")
|
|
5533
|
+
], Me);
|
|
5534
|
+
const oi = X`
|
|
5535
|
+
${me}
|
|
5517
5536
|
:host {
|
|
5518
5537
|
--primary-color: var(--sl-color-primary-600);
|
|
5519
5538
|
|
|
@@ -5543,6 +5562,11 @@ const oi = Y`
|
|
|
5543
5562
|
|
|
5544
5563
|
.cb-anchor-icon {
|
|
5545
5564
|
color: var(--enegelai-bot-anchor-color, rgb(255, 255, 255));
|
|
5565
|
+
display: flex;
|
|
5566
|
+
align-items: center;
|
|
5567
|
+
justify-content: center;
|
|
5568
|
+
height: 100%;
|
|
5569
|
+
width: 100%;
|
|
5546
5570
|
}
|
|
5547
5571
|
|
|
5548
5572
|
.cb-anchor:hover {
|
|
@@ -5559,6 +5583,9 @@ const oi = Y`
|
|
|
5559
5583
|
//border-color: var(--enegelai-bot-anchor-border-color, rgba(122, 78, 191, 1));
|
|
5560
5584
|
background: var(--enegelai-bot-anchor-background, rgb(0, 208, 117));
|
|
5561
5585
|
border-color: var(--enegelai-bot-anchor-border-color, rgb(0, 208, 117));
|
|
5586
|
+
display: flex;
|
|
5587
|
+
align-items: center;
|
|
5588
|
+
justify-content: center;
|
|
5562
5589
|
}
|
|
5563
5590
|
|
|
5564
5591
|
.cb-engage-popup {
|
|
@@ -5613,11 +5640,15 @@ const oi = Y`
|
|
|
5613
5640
|
align-items: start;
|
|
5614
5641
|
gap: 10px;
|
|
5615
5642
|
}
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5643
|
+
|
|
5644
|
+
.cb-anchor-badge {
|
|
5645
|
+
margin: 4px 4px 0px 0px;
|
|
5646
|
+
}
|
|
5647
|
+
`;
|
|
5648
|
+
var ri = Object.defineProperty, di = Object.getOwnPropertyDescriptor, la = (c, e, a, s) => {
|
|
5649
|
+
for (var n = s > 1 ? void 0 : s ? di(e, a) : e, d = c.length - 1, f; d >= 0; d--)
|
|
5619
5650
|
(f = c[d]) && (n = (s ? f(e, a, n) : f(n)) || n);
|
|
5620
|
-
return s && n &&
|
|
5651
|
+
return s && n && ri(e, a, n), n;
|
|
5621
5652
|
};
|
|
5622
5653
|
let ft = class extends ee {
|
|
5623
5654
|
constructor() {
|
|
@@ -5646,24 +5677,33 @@ let ft = class extends ee {
|
|
|
5646
5677
|
let c = "top-end";
|
|
5647
5678
|
return c = p.appearanceAnchorPopupPosition, c;
|
|
5648
5679
|
}
|
|
5680
|
+
getBadgeVariant() {
|
|
5681
|
+
let c = "danger";
|
|
5682
|
+
return c = p.appearanceAnchorBadgeVariant, c;
|
|
5683
|
+
}
|
|
5649
5684
|
render() {
|
|
5650
5685
|
return g`
|
|
5651
5686
|
<div class="cb-anchor ${this.open ? "open" : ""}" part="anchor" @click=${this._clickHandler.bind(this)}>
|
|
5652
5687
|
<sl-popup placement="${this.getPopupPlacement()}" distance="16" ?active="${p.engage && !p.open}">
|
|
5653
|
-
<sl-button slot="anchor" label="Start" size="large" variant="primary" class="
|
|
5654
|
-
${
|
|
5688
|
+
<sl-button slot="anchor" label="Start" size="large" variant="primary" class="anchor-button" circle>
|
|
5689
|
+
${ce(
|
|
5655
5690
|
this.open,
|
|
5656
|
-
() => g`<
|
|
5657
|
-
() => g`<
|
|
5691
|
+
() => g`<div class="cb-anchor-icon" part="anchor-icon">${be`${Y(p.setting.anchorCloseSvg)}`}</div>`,
|
|
5692
|
+
() => g`<div class="cb-anchor-icon" part="anchor-icon">${be`${Y(p.setting.anchorOpenSvg)}`}</div>`
|
|
5693
|
+
)}
|
|
5694
|
+
${ce(
|
|
5695
|
+
!this.open && p.unreadMessages > 0,
|
|
5696
|
+
() => g`<sl-badge part="anchor-badge" class="cb-anchor-badge" variant="${this.getBadgeVariant()}" pill>${p.unreadMessages}</sl-badge>`,
|
|
5697
|
+
() => null
|
|
5658
5698
|
)}
|
|
5659
5699
|
</sl-button>
|
|
5660
5700
|
<div class="cb-engage-popup">
|
|
5661
|
-
<div class="cb-engage-popup-close" @click=${this._engageClickHandler.bind(this)}>${
|
|
5701
|
+
<div class="cb-engage-popup-close" @click=${this._engageClickHandler.bind(this)}>${be`${Y(da)}`}</div>
|
|
5662
5702
|
<div class="cb-engage-popup-content">
|
|
5663
|
-
${
|
|
5703
|
+
${ce(
|
|
5664
5704
|
p.setting.logoUrl !== "",
|
|
5665
5705
|
() => g`<img class="cb-engage-popup-img" src="${p.setting.logoUrl}" />`,
|
|
5666
|
-
() => g`<div class="cb-engage-popup-logo">${
|
|
5706
|
+
() => g`<div class="cb-engage-popup-logo">${be`${Y(p.setting.logoSvg)}`}</div>`
|
|
5667
5707
|
)}
|
|
5668
5708
|
<!--<cb-icon class="cb-engage-popup-logo" svg="${p.setting.logoSvg}"></cb-icon>-->
|
|
5669
5709
|
<div>${p.setting.engageMessage}</div>
|
|
@@ -5679,36 +5719,36 @@ la([
|
|
|
5679
5719
|
v({ type: Boolean })
|
|
5680
5720
|
], ft.prototype, "open", 2);
|
|
5681
5721
|
ft = la([
|
|
5682
|
-
|
|
5722
|
+
J("cb-anchor")
|
|
5683
5723
|
], ft);
|
|
5684
|
-
const
|
|
5685
|
-
${
|
|
5686
|
-
`,
|
|
5687
|
-
var
|
|
5688
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
5724
|
+
const fi = X`
|
|
5725
|
+
${me}
|
|
5726
|
+
`, Yt = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><g fill="currentColor"><path d="M4.54.146A.5.5 0 0 1 4.893 0h6.214a.5.5 0 0 1 .353.146l4.394 4.394a.5.5 0 0 1 .146.353v6.214a.5.5 0 0 1-.146.353l-4.394 4.394a.5.5 0 0 1-.353.146H4.893a.5.5 0 0 1-.353-.146L.146 11.46A.5.5 0 0 1 0 11.107V4.893a.5.5 0 0 1 .146-.353zM5.1 1L1 5.1v5.8L5.1 15h5.8l4.1-4.1V5.1L10.9 1z"/><path d="M7.002 11a1 1 0 1 1 2 0a1 1 0 0 1-2 0M7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0z"/></g></svg>', li = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><g fill="currentColor"><path d="M7.938 2.016A.13.13 0 0 1 8.002 2a.13.13 0 0 1 .063.016a.15.15 0 0 1 .054.057l6.857 11.667c.036.06.035.124.002.183a.2.2 0 0 1-.054.06a.1.1 0 0 1-.066.017H1.146a.1.1 0 0 1-.066-.017a.2.2 0 0 1-.054-.06a.18.18 0 0 1 .002-.183L7.884 2.073a.15.15 0 0 1 .054-.057m1.044-.45a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767z"/><path d="M7.002 12a1 1 0 1 1 2 0a1 1 0 0 1-2 0M7.1 5.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0z"/></g></svg>', bi = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><g fill="currentColor"><path d="M2.5 8a5.5 5.5 0 0 1 8.25-4.764a.5.5 0 0 0 .5-.866A6.5 6.5 0 1 0 14.5 8a.5.5 0 0 0-1 0a5.5 5.5 0 1 1-11 0"/><path d="M15.354 3.354a.5.5 0 0 0-.708-.708L8 9.293L5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/></g></svg>', hi = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><g fill="currentColor"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/><path d="m8.93 6.588l-2.29.287l-.082.38l.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319c.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246c-.275 0-.375-.193-.304-.533zM9 4.5a1 1 0 1 1-2 0a1 1 0 0 1 2 0"/></g></svg>';
|
|
5727
|
+
var ui = Object.defineProperty, pi = Object.getOwnPropertyDescriptor, ba = (c, e, a, s) => {
|
|
5728
|
+
for (var n = s > 1 ? void 0 : s ? pi(e, a) : e, d = c.length - 1, f; d >= 0; d--)
|
|
5689
5729
|
(f = c[d]) && (n = (s ? f(e, a, n) : f(n)) || n);
|
|
5690
|
-
return s && n &&
|
|
5730
|
+
return s && n && ui(e, a, n), n;
|
|
5691
5731
|
};
|
|
5692
|
-
const
|
|
5732
|
+
const Xt = {
|
|
5693
5733
|
error: {
|
|
5694
5734
|
variant: "danger",
|
|
5695
|
-
icon:
|
|
5735
|
+
icon: Yt
|
|
5696
5736
|
},
|
|
5697
5737
|
danger: {
|
|
5698
5738
|
variant: "danger",
|
|
5699
|
-
icon:
|
|
5739
|
+
icon: Yt
|
|
5700
5740
|
},
|
|
5701
5741
|
warning: {
|
|
5702
5742
|
variant: "warning",
|
|
5703
|
-
icon:
|
|
5743
|
+
icon: li
|
|
5704
5744
|
},
|
|
5705
5745
|
success: {
|
|
5706
5746
|
variant: "success",
|
|
5707
|
-
icon:
|
|
5747
|
+
icon: bi
|
|
5708
5748
|
},
|
|
5709
5749
|
info: {
|
|
5710
5750
|
variant: "primary",
|
|
5711
|
-
icon:
|
|
5751
|
+
icon: hi
|
|
5712
5752
|
}
|
|
5713
5753
|
};
|
|
5714
5754
|
let lt = class extends ee {
|
|
@@ -5716,23 +5756,23 @@ let lt = class extends ee {
|
|
|
5716
5756
|
super(...arguments), this.status = "info";
|
|
5717
5757
|
}
|
|
5718
5758
|
render() {
|
|
5719
|
-
const { variant: c, icon: e } =
|
|
5759
|
+
const { variant: c, icon: e } = Xt[this.status] || Xt.info;
|
|
5720
5760
|
return g`<cb-icon svg=${e} color="${c}"></cb-icon>`;
|
|
5721
5761
|
}
|
|
5722
5762
|
};
|
|
5723
|
-
lt.styles =
|
|
5763
|
+
lt.styles = ca;
|
|
5724
5764
|
ba([
|
|
5725
5765
|
v({ type: String })
|
|
5726
5766
|
], lt.prototype, "status", 2);
|
|
5727
5767
|
lt = ba([
|
|
5728
|
-
|
|
5768
|
+
J("cb-status-icon")
|
|
5729
5769
|
], lt);
|
|
5730
|
-
var
|
|
5731
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
5770
|
+
var gi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, yi = (c, e, a, s) => {
|
|
5771
|
+
for (var n = s > 1 ? void 0 : s ? mi(e, a) : e, d = c.length - 1, f; d >= 0; d--)
|
|
5732
5772
|
(f = c[d]) && (n = (s ? f(e, a, n) : f(n)) || n);
|
|
5733
|
-
return s && n &&
|
|
5773
|
+
return s && n && gi(e, a, n), n;
|
|
5734
5774
|
};
|
|
5735
|
-
let
|
|
5775
|
+
let _t = class extends ee {
|
|
5736
5776
|
render() {
|
|
5737
5777
|
return g` <sl-alert variant="danger" open>
|
|
5738
5778
|
<cb-status-icon status="error" slot="icon"></cb-status-icon>
|
|
@@ -5748,11 +5788,11 @@ let $t = class extends ee {
|
|
|
5748
5788
|
this.emit("setting:show");
|
|
5749
5789
|
}
|
|
5750
5790
|
};
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
],
|
|
5755
|
-
const
|
|
5791
|
+
_t.styles = fi;
|
|
5792
|
+
_t = yi([
|
|
5793
|
+
J("cb-auth-alert")
|
|
5794
|
+
], _t);
|
|
5795
|
+
const vi = X`
|
|
5756
5796
|
sl-dialog::part(base) {
|
|
5757
5797
|
z-index: 1000;
|
|
5758
5798
|
}
|
|
@@ -5826,25 +5866,25 @@ const wi = Y`
|
|
|
5826
5866
|
filter: alpha(opacity=80);
|
|
5827
5867
|
}
|
|
5828
5868
|
`;
|
|
5829
|
-
var
|
|
5830
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
5869
|
+
var wi = Object.defineProperty, xi = Object.getOwnPropertyDescriptor, Ue = (c, e, a, s) => {
|
|
5870
|
+
for (var n = s > 1 ? void 0 : s ? xi(e, a) : e, d = c.length - 1, f; d >= 0; d--)
|
|
5831
5871
|
(f = c[d]) && (n = (s ? f(e, a, n) : f(n)) || n);
|
|
5832
|
-
return s && n &&
|
|
5872
|
+
return s && n && wi(e, a, n), n;
|
|
5833
5873
|
};
|
|
5834
|
-
const
|
|
5835
|
-
let
|
|
5874
|
+
const Gt = Ke.noConflict(), ki = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16"><path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/></svg>';
|
|
5875
|
+
let Te = class extends ee {
|
|
5836
5876
|
constructor() {
|
|
5837
5877
|
super(...arguments), this.store = new pt(this, p), this.zindex = 100;
|
|
5838
5878
|
}
|
|
5839
5879
|
connectedCallback() {
|
|
5840
|
-
super.connectedCallback(),
|
|
5880
|
+
super.connectedCallback(), Gt.info("connectedCallback");
|
|
5841
5881
|
}
|
|
5842
5882
|
firstUpdated() {
|
|
5843
|
-
this._rating.getSymbol = () =>
|
|
5883
|
+
this._rating.getSymbol = () => ki;
|
|
5844
5884
|
}
|
|
5845
5885
|
_stateEventHandler(c) {
|
|
5846
5886
|
const e = c.detail, a = (e == null ? void 0 : e.type) || null;
|
|
5847
|
-
|
|
5887
|
+
Gt.info(`FEEDBACK: stateEvent: ${a}`, e);
|
|
5848
5888
|
}
|
|
5849
5889
|
_cancelHandler() {
|
|
5850
5890
|
p.feedback && (console.log("Feedback dialog cancelled"), p.feedback = !1);
|
|
@@ -5865,7 +5905,7 @@ let Me = class extends ee {
|
|
|
5865
5905
|
p.feedbackScore = 0;
|
|
5866
5906
|
}}"
|
|
5867
5907
|
>
|
|
5868
|
-
${
|
|
5908
|
+
${be`${Y(ra)}`}
|
|
5869
5909
|
</div>
|
|
5870
5910
|
<sl-rating id="cb-feedback-rating-el" class="cb-feedback-rating" @sl-change="${this._ratingChangeHandler}" label="Rating" precision="1" .value=${p.feedbackScore}></sl-rating>
|
|
5871
5911
|
<div
|
|
@@ -5874,7 +5914,7 @@ let Me = class extends ee {
|
|
|
5874
5914
|
p.feedbackScore = 5;
|
|
5875
5915
|
}}"
|
|
5876
5916
|
>
|
|
5877
|
-
${
|
|
5917
|
+
${be`${Y(oa)}`}
|
|
5878
5918
|
</div>
|
|
5879
5919
|
</div>
|
|
5880
5920
|
<div style="display: flex">
|
|
@@ -5896,39 +5936,39 @@ let Me = class extends ee {
|
|
|
5896
5936
|
this._comments.value = "", await p.submitFeedback(c, e, a);
|
|
5897
5937
|
}
|
|
5898
5938
|
};
|
|
5899
|
-
|
|
5939
|
+
Te.styles = vi;
|
|
5900
5940
|
Ue([
|
|
5901
5941
|
v({ type: Number })
|
|
5902
|
-
],
|
|
5942
|
+
], Te.prototype, "zindex", 2);
|
|
5903
5943
|
Ue([
|
|
5904
5944
|
xe("#cb-feedback-rating-el")
|
|
5905
|
-
],
|
|
5945
|
+
], Te.prototype, "_rating", 2);
|
|
5906
5946
|
Ue([
|
|
5907
5947
|
xe("#cb-feedback-comments-el")
|
|
5908
|
-
],
|
|
5948
|
+
], Te.prototype, "_comments", 2);
|
|
5909
5949
|
Ue([
|
|
5910
5950
|
xe("#cb-feedback-name-el")
|
|
5911
|
-
],
|
|
5951
|
+
], Te.prototype, "_name", 2);
|
|
5912
5952
|
Ue([
|
|
5913
5953
|
xe("#cb-feedback-email-el")
|
|
5914
|
-
],
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
],
|
|
5918
|
-
class
|
|
5954
|
+
], Te.prototype, "_email", 2);
|
|
5955
|
+
Te = Ue([
|
|
5956
|
+
J("cb-dialog-feedback")
|
|
5957
|
+
], Te);
|
|
5958
|
+
class Zt extends Error {
|
|
5919
5959
|
constructor(a, s, n) {
|
|
5920
5960
|
const d = a.status || a.status === 0 ? a.status : "", f = a.statusText || "", x = `${d} ${f}`.trim(), S = x ? `status code ${x}` : "an unknown error";
|
|
5921
5961
|
super(`Request failed with ${S}: ${s.method} ${s.url}`);
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5962
|
+
ge(this, "response");
|
|
5963
|
+
ge(this, "request");
|
|
5964
|
+
ge(this, "options");
|
|
5925
5965
|
this.name = "HTTPError", this.response = a, this.request = s, this.options = n;
|
|
5926
5966
|
}
|
|
5927
5967
|
}
|
|
5928
5968
|
class ha extends Error {
|
|
5929
5969
|
constructor(a) {
|
|
5930
5970
|
super(`Request timed out: ${a.method} ${a.url}`);
|
|
5931
|
-
|
|
5971
|
+
ge(this, "request");
|
|
5932
5972
|
this.name = "TimeoutError", this.request = a;
|
|
5933
5973
|
}
|
|
5934
5974
|
}
|
|
@@ -5936,7 +5976,7 @@ const Xe = (c) => c !== null && typeof c == "object", nt = (...c) => {
|
|
|
5936
5976
|
for (const e of c)
|
|
5937
5977
|
if ((!Xe(e) || Array.isArray(e)) && e !== void 0)
|
|
5938
5978
|
throw new TypeError("The `options` argument must be an object");
|
|
5939
|
-
return
|
|
5979
|
+
return It({}, ...c);
|
|
5940
5980
|
}, ua = (c = {}, e = {}) => {
|
|
5941
5981
|
const a = new globalThis.Headers(c), s = e instanceof globalThis.Headers, n = new globalThis.Headers(e);
|
|
5942
5982
|
for (const [d, f] of n.entries())
|
|
@@ -5944,25 +5984,25 @@ const Xe = (c) => c !== null && typeof c == "object", nt = (...c) => {
|
|
|
5944
5984
|
return a;
|
|
5945
5985
|
};
|
|
5946
5986
|
function st(c, e, a) {
|
|
5947
|
-
return Object.hasOwn(e, a) && e[a] === void 0 ? [] :
|
|
5987
|
+
return Object.hasOwn(e, a) && e[a] === void 0 ? [] : It(c[a] ?? [], e[a] ?? []);
|
|
5948
5988
|
}
|
|
5949
5989
|
const pa = (c = {}, e = {}) => ({
|
|
5950
5990
|
beforeRequest: st(c, e, "beforeRequest"),
|
|
5951
5991
|
beforeRetry: st(c, e, "beforeRetry"),
|
|
5952
5992
|
afterResponse: st(c, e, "afterResponse"),
|
|
5953
5993
|
beforeError: st(c, e, "beforeError")
|
|
5954
|
-
}),
|
|
5994
|
+
}), It = (...c) => {
|
|
5955
5995
|
let e = {}, a = {}, s = {};
|
|
5956
5996
|
for (const n of c)
|
|
5957
5997
|
if (Array.isArray(n))
|
|
5958
5998
|
Array.isArray(e) || (e = []), e = [...e, ...n];
|
|
5959
5999
|
else if (Xe(n)) {
|
|
5960
6000
|
for (let [d, f] of Object.entries(n))
|
|
5961
|
-
Xe(f) && d in e && (f =
|
|
6001
|
+
Xe(f) && d in e && (f = It(e[d], f)), e = { ...e, [d]: f };
|
|
5962
6002
|
Xe(n.hooks) && (s = pa(s, n.hooks), e.hooks = s), Xe(n.headers) && (a = ua(a, n.headers), e.headers = a);
|
|
5963
6003
|
}
|
|
5964
6004
|
return e;
|
|
5965
|
-
},
|
|
6005
|
+
}, Ci = (() => {
|
|
5966
6006
|
let c = !1, e = !1;
|
|
5967
6007
|
const a = typeof globalThis.ReadableStream == "function", s = typeof globalThis.Request == "function";
|
|
5968
6008
|
if (a && s)
|
|
@@ -5981,13 +6021,13 @@ const pa = (c = {}, e = {}) => ({
|
|
|
5981
6021
|
throw n;
|
|
5982
6022
|
}
|
|
5983
6023
|
return c && !e;
|
|
5984
|
-
})(),
|
|
6024
|
+
})(), Si = typeof globalThis.AbortController == "function", _i = typeof globalThis.ReadableStream == "function", $i = typeof globalThis.FormData == "function", ga = ["get", "post", "put", "patch", "head", "delete"], Mi = {
|
|
5985
6025
|
json: "application/json",
|
|
5986
6026
|
text: "text/*",
|
|
5987
6027
|
formData: "multipart/form-data",
|
|
5988
6028
|
arrayBuffer: "*/*",
|
|
5989
6029
|
blob: "*/*"
|
|
5990
|
-
}, xt = 2147483647, ma = Symbol("stop"),
|
|
6030
|
+
}, xt = 2147483647, ma = Symbol("stop"), Ti = {
|
|
5991
6031
|
json: !0,
|
|
5992
6032
|
parseJson: !0,
|
|
5993
6033
|
stringifyJson: !0,
|
|
@@ -5999,7 +6039,7 @@ const pa = (c = {}, e = {}) => ({
|
|
|
5999
6039
|
throwHttpErrors: !0,
|
|
6000
6040
|
onDownloadProgress: !0,
|
|
6001
6041
|
fetch: !0
|
|
6002
|
-
},
|
|
6042
|
+
}, Ei = {
|
|
6003
6043
|
method: !0,
|
|
6004
6044
|
headers: !0,
|
|
6005
6045
|
body: !0,
|
|
@@ -6016,18 +6056,18 @@ const pa = (c = {}, e = {}) => ({
|
|
|
6016
6056
|
dispatcher: !0,
|
|
6017
6057
|
duplex: !0,
|
|
6018
6058
|
priority: !0
|
|
6019
|
-
},
|
|
6059
|
+
}, Ai = (c) => ga.includes(c) ? c.toUpperCase() : c, Ii = ["get", "put", "head", "delete", "options", "trace"], Li = [408, 413, 429, 500, 502, 503, 504], qi = [413, 429, 503], Jt = {
|
|
6020
6060
|
limit: 2,
|
|
6021
|
-
methods:
|
|
6022
|
-
statusCodes:
|
|
6023
|
-
afterStatusCodes:
|
|
6061
|
+
methods: Ii,
|
|
6062
|
+
statusCodes: Li,
|
|
6063
|
+
afterStatusCodes: qi,
|
|
6024
6064
|
maxRetryAfter: Number.POSITIVE_INFINITY,
|
|
6025
6065
|
backoffLimit: Number.POSITIVE_INFINITY,
|
|
6026
6066
|
delay: (c) => 0.3 * 2 ** (c - 1) * 1e3
|
|
6027
|
-
},
|
|
6067
|
+
}, Oi = (c = {}) => {
|
|
6028
6068
|
if (typeof c == "number")
|
|
6029
6069
|
return {
|
|
6030
|
-
...
|
|
6070
|
+
...Jt,
|
|
6031
6071
|
limit: c
|
|
6032
6072
|
};
|
|
6033
6073
|
if (c.methods && !Array.isArray(c.methods))
|
|
@@ -6035,11 +6075,11 @@ const pa = (c = {}, e = {}) => ({
|
|
|
6035
6075
|
if (c.statusCodes && !Array.isArray(c.statusCodes))
|
|
6036
6076
|
throw new Error("retry.statusCodes must be an array");
|
|
6037
6077
|
return {
|
|
6038
|
-
...
|
|
6078
|
+
...Jt,
|
|
6039
6079
|
...c
|
|
6040
6080
|
};
|
|
6041
6081
|
};
|
|
6042
|
-
async function
|
|
6082
|
+
async function Pi(c, e, a, s) {
|
|
6043
6083
|
return new Promise((n, d) => {
|
|
6044
6084
|
const f = setTimeout(() => {
|
|
6045
6085
|
a && a.abort(), d(new ha(c));
|
|
@@ -6049,7 +6089,7 @@ async function Oi(c, e, a, s) {
|
|
|
6049
6089
|
});
|
|
6050
6090
|
});
|
|
6051
6091
|
}
|
|
6052
|
-
async function
|
|
6092
|
+
async function zi(c, { signal: e }) {
|
|
6053
6093
|
return new Promise((a, s) => {
|
|
6054
6094
|
e && (e.throwIfAborted(), e.addEventListener("abort", n, { once: !0 }));
|
|
6055
6095
|
function n() {
|
|
@@ -6060,20 +6100,20 @@ async function ji(c, { signal: e }) {
|
|
|
6060
6100
|
}, c);
|
|
6061
6101
|
});
|
|
6062
6102
|
}
|
|
6063
|
-
const
|
|
6103
|
+
const ji = (c, e) => {
|
|
6064
6104
|
const a = {};
|
|
6065
6105
|
for (const s in e)
|
|
6066
|
-
!(s in
|
|
6106
|
+
!(s in Ei) && !(s in Ti) && !(s in c) && (a[s] = e[s]);
|
|
6067
6107
|
return a;
|
|
6068
6108
|
};
|
|
6069
6109
|
class bt {
|
|
6070
6110
|
// eslint-disable-next-line complexity
|
|
6071
6111
|
constructor(e, a = {}) {
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6112
|
+
ge(this, "request");
|
|
6113
|
+
ge(this, "abortController");
|
|
6114
|
+
ge(this, "_retryCount", 0);
|
|
6115
|
+
ge(this, "_input");
|
|
6116
|
+
ge(this, "_options");
|
|
6077
6117
|
var s, n;
|
|
6078
6118
|
if (this._input = e, this._options = {
|
|
6079
6119
|
...a,
|
|
@@ -6084,10 +6124,10 @@ class bt {
|
|
|
6084
6124
|
beforeError: [],
|
|
6085
6125
|
afterResponse: []
|
|
6086
6126
|
}, a.hooks),
|
|
6087
|
-
method:
|
|
6127
|
+
method: Ai(a.method ?? this._input.method),
|
|
6088
6128
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
6089
6129
|
prefixUrl: String(a.prefixUrl || ""),
|
|
6090
|
-
retry:
|
|
6130
|
+
retry: Oi(a.retry),
|
|
6091
6131
|
throwHttpErrors: a.throwHttpErrors !== !1,
|
|
6092
6132
|
timeout: a.timeout ?? 1e4,
|
|
6093
6133
|
fetch: a.fetch ?? globalThis.fetch.bind(globalThis)
|
|
@@ -6098,16 +6138,16 @@ class bt {
|
|
|
6098
6138
|
throw new Error("`input` must not begin with a slash when using `prefixUrl`");
|
|
6099
6139
|
this._options.prefixUrl.endsWith("/") || (this._options.prefixUrl += "/"), this._input = this._options.prefixUrl + this._input;
|
|
6100
6140
|
}
|
|
6101
|
-
if (
|
|
6141
|
+
if (Si) {
|
|
6102
6142
|
this.abortController = new globalThis.AbortController();
|
|
6103
6143
|
const d = this._options.signal ?? this._input.signal;
|
|
6104
6144
|
d == null || d.addEventListener("abort", () => {
|
|
6105
6145
|
this.abortController.abort(d.reason);
|
|
6106
6146
|
}), this._options.signal = this.abortController.signal;
|
|
6107
6147
|
}
|
|
6108
|
-
if (
|
|
6148
|
+
if (Ci && (this._options.duplex = "half"), this._options.json !== void 0 && (this._options.body = ((n = (s = this._options).stringifyJson) == null ? void 0 : n.call(s, this._options.json)) ?? JSON.stringify(this._options.json), this._options.headers.set("content-type", this._options.headers.get("content-type") ?? "application/json")), this.request = new globalThis.Request(this._input, this._options), this._options.searchParams) {
|
|
6109
6149
|
const f = "?" + (typeof this._options.searchParams == "string" ? this._options.searchParams.replace(/^\?/, "") : new URLSearchParams(this._options.searchParams).toString()), x = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, f);
|
|
6110
|
-
(
|
|
6150
|
+
($i && this._options.body instanceof globalThis.FormData || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers["content-type"]) && this.request.headers.delete("content-type"), this.request = new globalThis.Request(new globalThis.Request(x, { ...this.request }), this._options);
|
|
6111
6151
|
}
|
|
6112
6152
|
}
|
|
6113
6153
|
static create(e, a) {
|
|
@@ -6121,7 +6161,7 @@ class bt {
|
|
|
6121
6161
|
_ instanceof globalThis.Response && (x = _);
|
|
6122
6162
|
}
|
|
6123
6163
|
if (s._decorateResponse(x), !x.ok && s._options.throwHttpErrors) {
|
|
6124
|
-
let S = new
|
|
6164
|
+
let S = new Zt(x, s.request, s._options);
|
|
6125
6165
|
for (const _ of s._options.hooks.beforeError)
|
|
6126
6166
|
S = await _(S);
|
|
6127
6167
|
throw S;
|
|
@@ -6129,7 +6169,7 @@ class bt {
|
|
|
6129
6169
|
if (s._options.onDownloadProgress) {
|
|
6130
6170
|
if (typeof s._options.onDownloadProgress != "function")
|
|
6131
6171
|
throw new TypeError("The `onDownloadProgress` option must be a function");
|
|
6132
|
-
if (
|
|
6172
|
+
if (!_i)
|
|
6133
6173
|
throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
|
|
6134
6174
|
return s._stream(x.clone(), s._options.onDownloadProgress);
|
|
6135
6175
|
}
|
|
@@ -6138,21 +6178,21 @@ class bt {
|
|
|
6138
6178
|
for (const [x, S] of Object.entries(Mi))
|
|
6139
6179
|
f[x] = async () => {
|
|
6140
6180
|
s.request.headers.set("accept", s.request.headers.get("accept") || S);
|
|
6141
|
-
const
|
|
6181
|
+
const K = (await f).clone();
|
|
6142
6182
|
if (x === "json") {
|
|
6143
|
-
if (
|
|
6183
|
+
if (K.status === 204 || (await K.clone().arrayBuffer()).byteLength === 0)
|
|
6144
6184
|
return "";
|
|
6145
6185
|
if (a.parseJson)
|
|
6146
|
-
return a.parseJson(await
|
|
6186
|
+
return a.parseJson(await K.text());
|
|
6147
6187
|
}
|
|
6148
|
-
return
|
|
6188
|
+
return K[x]();
|
|
6149
6189
|
};
|
|
6150
6190
|
return f;
|
|
6151
6191
|
}
|
|
6152
6192
|
_calculateRetryDelay(e) {
|
|
6153
6193
|
if (this._retryCount++, this._retryCount > this._options.retry.limit || e instanceof ha)
|
|
6154
6194
|
throw e;
|
|
6155
|
-
if (e instanceof
|
|
6195
|
+
if (e instanceof Zt) {
|
|
6156
6196
|
if (!this._options.retry.statusCodes.includes(e.response.status))
|
|
6157
6197
|
throw e;
|
|
6158
6198
|
const s = e.response.headers.get("Retry-After") ?? e.response.headers.get("RateLimit-Reset") ?? e.response.headers.get("X-RateLimit-Reset") ?? e.response.headers.get("X-Rate-Limit-Reset");
|
|
@@ -6178,7 +6218,7 @@ class bt {
|
|
|
6178
6218
|
const s = Math.min(this._calculateRetryDelay(a), xt);
|
|
6179
6219
|
if (this._retryCount < 1)
|
|
6180
6220
|
throw a;
|
|
6181
|
-
await
|
|
6221
|
+
await zi(s, { signal: this._options.signal });
|
|
6182
6222
|
for (const n of this._options.hooks.beforeRetry)
|
|
6183
6223
|
if (await n({
|
|
6184
6224
|
request: this.request,
|
|
@@ -6200,8 +6240,8 @@ class bt {
|
|
|
6200
6240
|
if (n instanceof Response)
|
|
6201
6241
|
return n;
|
|
6202
6242
|
}
|
|
6203
|
-
const e =
|
|
6204
|
-
return this.request = a.clone(), this._options.timeout === !1 ? this._options.fetch(a, e) :
|
|
6243
|
+
const e = ji(this.request, this._options), a = this.request;
|
|
6244
|
+
return this.request = a.clone(), this._options.timeout === !1 ? this._options.fetch(a, e) : Pi(a, e, this.abortController, this._options);
|
|
6205
6245
|
}
|
|
6206
6246
|
/* istanbul ignore next */
|
|
6207
6247
|
_stream(e, a) {
|
|
@@ -6223,8 +6263,8 @@ class bt {
|
|
|
6223
6263
|
}
|
|
6224
6264
|
if (a) {
|
|
6225
6265
|
n += _.byteLength;
|
|
6226
|
-
const
|
|
6227
|
-
a({ percent:
|
|
6266
|
+
const K = s === 0 ? 0 : n / s;
|
|
6267
|
+
a({ percent: K, transferredBytes: n, totalBytes: s }, _);
|
|
6228
6268
|
}
|
|
6229
6269
|
d.enqueue(_), await x();
|
|
6230
6270
|
}
|
|
@@ -6238,12 +6278,12 @@ class bt {
|
|
|
6238
6278
|
}
|
|
6239
6279
|
}
|
|
6240
6280
|
/*! MIT License © Sindre Sorhus */
|
|
6241
|
-
const
|
|
6281
|
+
const $t = (c) => {
|
|
6242
6282
|
const e = (a, s) => bt.create(a, nt(c, s));
|
|
6243
6283
|
for (const a of ga)
|
|
6244
6284
|
e[a] = (s, n) => bt.create(s, nt(c, n, { method: a }));
|
|
6245
|
-
return e.create = (a) =>
|
|
6246
|
-
},
|
|
6285
|
+
return e.create = (a) => $t(nt(a)), e.extend = (a) => (typeof a == "function" && (a = a(c ?? {})), $t(nt(c, a))), e.stop = ma, e;
|
|
6286
|
+
}, Hi = $t(), Bi = Hi.extend({
|
|
6247
6287
|
hooks: {
|
|
6248
6288
|
beforeRequest: [
|
|
6249
6289
|
() => {
|
|
@@ -6251,7 +6291,7 @@ const Tt = (c) => {
|
|
|
6251
6291
|
]
|
|
6252
6292
|
}
|
|
6253
6293
|
});
|
|
6254
|
-
async function
|
|
6294
|
+
async function Ri(c, e) {
|
|
6255
6295
|
const { onmessage: a, onclose: s, ...n } = e, d = async (f, x) => {
|
|
6256
6296
|
const { value: S, done: _ } = await x.read();
|
|
6257
6297
|
_ ? (f.close(), s == null || s()) : (a == null || a(S), f.enqueue(S), d(f, x));
|
|
@@ -6272,11 +6312,11 @@ async function Vi(c, e) {
|
|
|
6272
6312
|
}).text()
|
|
6273
6313
|
);
|
|
6274
6314
|
}
|
|
6275
|
-
async function
|
|
6315
|
+
async function Vi(c, e) {
|
|
6276
6316
|
const a = new FormData();
|
|
6277
6317
|
for (let n = 0; n < e.length; n++)
|
|
6278
6318
|
a.append("files", e[n]);
|
|
6279
|
-
const s = await
|
|
6319
|
+
const s = await Bi.post(c, {
|
|
6280
6320
|
body: a
|
|
6281
6321
|
});
|
|
6282
6322
|
try {
|
|
@@ -6289,10 +6329,10 @@ async function Di(c, e) {
|
|
|
6289
6329
|
};
|
|
6290
6330
|
}
|
|
6291
6331
|
}
|
|
6292
|
-
var
|
|
6293
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
6332
|
+
var Di = Object.defineProperty, Fi = Object.getOwnPropertyDescriptor, H = (c, e, a, s) => {
|
|
6333
|
+
for (var n = s > 1 ? void 0 : s ? Fi(e, a) : e, d = c.length - 1, f; d >= 0; d--)
|
|
6294
6334
|
(f = c[d]) && (n = (s ? f(e, a, n) : f(n)) || n);
|
|
6295
|
-
return s && n &&
|
|
6335
|
+
return s && n && Di(e, a, n), n;
|
|
6296
6336
|
};
|
|
6297
6337
|
const Re = Ke.noConflict();
|
|
6298
6338
|
Re.setLevel("info");
|
|
@@ -6324,11 +6364,11 @@ let j = class extends ee {
|
|
|
6324
6364
|
<rect width="400" height="400" fill="white"/>
|
|
6325
6365
|
</clipPath>
|
|
6326
6366
|
</defs>
|
|
6327
|
-
</svg>`, this.popupLogoSvg = "", this.popupLogoUrl = "", this.botIconSvg = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24"> <path d="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z" /></svg>', this.userIconSvg = '<svg fill="currentColor" viewBox="0 0 24 24" width="24" height="24"> <path d="M12 4a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m0 10c4.42 0 8 1.79 8 4v2H4v-2c0-2.21 3.58-4 8-4Z" /></svg>', this.systemIconSvg = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24"> <path d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z"/></svg>', this.agentIconSvg = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24"> <path d="M18.72,14.76C19.07,13.91 19.26,13 19.26,12C19.26,11.28 19.15,10.59 18.96,9.95C18.31,10.1 17.63,10.18 16.92,10.18C13.86,10.18 11.15,8.67 9.5,6.34C8.61,8.5 6.91,10.26 4.77,11.22C4.73,11.47 4.73,11.74 4.73,12A7.27,7.27 0 0,0 12,19.27C13.05,19.27 14.06,19.04 14.97,18.63C15.54,19.72 15.8,20.26 15.78,20.26C14.14,20.81 12.87,21.08 12,21.08C9.58,21.08 7.27,20.13 5.57,18.42C4.53,17.38 3.76,16.11 3.33,14.73H2V10.18H3.09C3.93,6.04 7.6,2.92 12,2.92C14.4,2.92 16.71,3.87 18.42,5.58C19.69,6.84 20.54,8.45 20.89,10.18H22V14.67H22V14.69L22,14.73H21.94L18.38,18L13.08,17.4V15.73H17.91L18.72,14.76M9.27,11.77C9.57,11.77 9.86,11.89 10.07,12.11C10.28,12.32 10.4,12.61 10.4,12.91C10.4,13.21 10.28,13.5 10.07,13.71C9.86,13.92 9.57,14.04 9.27,14.04C8.64,14.04 8.13,13.54 8.13,12.91C8.13,12.28 8.64,11.77 9.27,11.77M14.72,11.77C15.35,11.77 15.85,12.28 15.85,12.91C15.85,13.54 15.35,14.04 14.72,14.04C14.09,14.04 13.58,13.54 13.58,12.91A1.14,1.14 0 0,1 14.72,11.77Z" /></svg>', this.stream = !1, this.customRequest = !1, this.enableFileUpload = !1, this.uploadFileUrl = "", this.open = !1, this.alwaysOpen = !1, this.prefilledFormFields = "{}", this.loading = !1, this.showSetting = !1, this.showAuthAlert = !1, this.handleAddMessage = (c) => {
|
|
6367
|
+
</svg>`, this.popupLogoSvg = "", this.popupLogoUrl = "", this.botIconSvg = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24"> <path d="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z" /></svg>', this.userIconSvg = '<svg fill="currentColor" viewBox="0 0 24 24" width="24" height="24"> <path d="M12 4a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m0 10c4.42 0 8 1.79 8 4v2H4v-2c0-2.21 3.58-4 8-4Z" /></svg>', this.systemIconSvg = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24"> <path d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z"/></svg>', this.agentIconSvg = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24"> <path d="M18.72,14.76C19.07,13.91 19.26,13 19.26,12C19.26,11.28 19.15,10.59 18.96,9.95C18.31,10.1 17.63,10.18 16.92,10.18C13.86,10.18 11.15,8.67 9.5,6.34C8.61,8.5 6.91,10.26 4.77,11.22C4.73,11.47 4.73,11.74 4.73,12A7.27,7.27 0 0,0 12,19.27C13.05,19.27 14.06,19.04 14.97,18.63C15.54,19.72 15.8,20.26 15.78,20.26C14.14,20.81 12.87,21.08 12,21.08C9.58,21.08 7.27,20.13 5.57,18.42C4.53,17.38 3.76,16.11 3.33,14.73H2V10.18H3.09C3.93,6.04 7.6,2.92 12,2.92C14.4,2.92 16.71,3.87 18.42,5.58C19.69,6.84 20.54,8.45 20.89,10.18H22V14.67H22V14.69L22,14.73H21.94L18.38,18L13.08,17.4V15.73H17.91L18.72,14.76M9.27,11.77C9.57,11.77 9.86,11.89 10.07,12.11C10.28,12.32 10.4,12.61 10.4,12.91C10.4,13.21 10.28,13.5 10.07,13.71C9.86,13.92 9.57,14.04 9.27,14.04C8.64,14.04 8.13,13.54 8.13,12.91C8.13,12.28 8.64,11.77 9.27,11.77M14.72,11.77C15.35,11.77 15.85,12.28 15.85,12.91C15.85,13.54 15.35,14.04 14.72,14.04C14.09,14.04 13.58,13.54 13.58,12.91A1.14,1.14 0 0,1 14.72,11.77Z" /></svg>', this.anchorOpenSvg = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" d="M16 8c0 3.866-3.582 7-8 7a9 9 0 0 1-2.347-.306c-.584.296-1.925.864-4.181 1.234c-.2.032-.352-.176-.273-.362c.354-.836.674-1.95.77-2.966C.744 11.37 0 9.76 0 8c0-3.866 3.582-7 8-7s8 3.134 8 7M5 8a1 1 0 1 0-2 0a1 1 0 0 0 2 0m4 0a1 1 0 1 0-2 0a1 1 0 0 0 2 0m3 1a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>', this.anchorCloseSvg = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"/></svg>', this.stream = !1, this.customRequest = !1, this.enableFileUpload = !1, this.uploadFileUrl = "", this.open = !1, this.alwaysOpen = !1, this.prefilledFormFields = "{}", this.loading = !1, this.showSetting = !1, this.showAuthAlert = !1, this.handleAddMessage = (c) => {
|
|
6328
6368
|
this._addMessageHandler(c);
|
|
6329
6369
|
}, this.handleStateEvent = (c) => {
|
|
6330
6370
|
this._stateEventHandler(c);
|
|
6331
|
-
}, this.fetchStream =
|
|
6371
|
+
}, this.fetchStream = Ri;
|
|
6332
6372
|
}
|
|
6333
6373
|
/**
|
|
6334
6374
|
* decodeStreamData
|
|
@@ -6367,11 +6407,11 @@ let j = class extends ee {
|
|
|
6367
6407
|
.messages=${p.messages}
|
|
6368
6408
|
.actions=${p.actions}
|
|
6369
6409
|
.form=${p.form}
|
|
6370
|
-
exportparts="bot-message-list, bot-message, cb-message, bot-message-content, user-message-content"
|
|
6410
|
+
exportparts="bot-message-list, bot-message, cb-message, bot-message-content, user-message-content, form, form-title, form-input, form-submit"
|
|
6371
6411
|
></cb-message-list>
|
|
6372
6412
|
${this.renderUserInput()} ${this.renderFeedbackDialog()}
|
|
6373
6413
|
</div>
|
|
6374
|
-
<cb-anchor ?open=${p.open} exportparts="anchor"></cb-anchor>
|
|
6414
|
+
<cb-anchor ?open=${p.open} exportparts="anchor, anchor-badge, anchor-icon"></cb-anchor>
|
|
6375
6415
|
`;
|
|
6376
6416
|
}
|
|
6377
6417
|
renderFeedbackDialog() {
|
|
@@ -6398,7 +6438,7 @@ let j = class extends ee {
|
|
|
6398
6438
|
// Extract css variables that control the appearance of the chatbot
|
|
6399
6439
|
initCssVariables() {
|
|
6400
6440
|
let c = getComputedStyle(this);
|
|
6401
|
-
p.appearanceAnchorPopupPosition = this.extractCssVariable(c, "--enegelai-bot-anchor-popup-position", "top-end"), p.appearanceUserMessageAvatarPosition = this.extractCssVariable(c, "--enegelai-bot-user-message-avatar-position", "left");
|
|
6441
|
+
p.appearanceAnchorPopupPosition = this.extractCssVariable(c, "--enegelai-bot-anchor-popup-position", "top-end"), p.appearanceAnchorBadgeVariant = this.extractCssVariable(c, "--enegelai-bot-anchor-badge-variant", p.appearanceAnchorBadgeVariant), p.appearanceUserMessageAvatarPosition = this.extractCssVariable(c, "--enegelai-bot-user-message-avatar-position", "left");
|
|
6402
6442
|
}
|
|
6403
6443
|
/*
|
|
6404
6444
|
private getPopupPlacement() {
|
|
@@ -6432,7 +6472,7 @@ let j = class extends ee {
|
|
|
6432
6472
|
_initSetting() {
|
|
6433
6473
|
Re.info("_initSetting");
|
|
6434
6474
|
const c = p.setting;
|
|
6435
|
-
c.orgId = this.orgId, c.botId = this.botId, c.url = this.url, c.logoUrl = this.logoUrl, c.logoSvg = this.logoSvg, c.closeSvg = this.closeSvg, c.popupLogoSvg = this.popupLogoSvg, c.popupLogoUrl = this.popupLogoUrl, c.botIconSvg = this.botIconSvg, c.userIconSvg = this.userIconSvg, c.systemIconSvg = this.systemIconSvg, c.agentIconSvg = this.agentIconSvg, p.setSetting(c);
|
|
6475
|
+
c.orgId = this.orgId, c.botId = this.botId, c.url = this.url, c.logoUrl = this.logoUrl, c.logoSvg = this.logoSvg, c.closeSvg = this.closeSvg, c.popupLogoSvg = this.popupLogoSvg, c.popupLogoUrl = this.popupLogoUrl, c.botIconSvg = this.botIconSvg, c.userIconSvg = this.userIconSvg, c.systemIconSvg = this.systemIconSvg, c.agentIconSvg = this.agentIconSvg, c.anchorOpenSvg = this.anchorOpenSvg, c.anchorCloseSvg = this.anchorCloseSvg, p.setSetting(c);
|
|
6436
6476
|
let e = {};
|
|
6437
6477
|
try {
|
|
6438
6478
|
e = JSON.parse(this.prefilledFormFields);
|
|
@@ -6518,7 +6558,7 @@ let j = class extends ee {
|
|
|
6518
6558
|
}
|
|
6519
6559
|
_chatbotToggleHandler(c) {
|
|
6520
6560
|
const e = c.detail;
|
|
6521
|
-
p.open = e.open, p.suppressEngagePopup();
|
|
6561
|
+
p.open = e.open, p.unreadMessages = 0, p.suppressEngagePopup();
|
|
6522
6562
|
}
|
|
6523
6563
|
_deleteMessageHandler(c) {
|
|
6524
6564
|
const e = c.detail;
|
|
@@ -6540,7 +6580,7 @@ let j = class extends ee {
|
|
|
6540
6580
|
}
|
|
6541
6581
|
};
|
|
6542
6582
|
if (p.addMessage(s), this.uploadFileUrl) {
|
|
6543
|
-
const n = await
|
|
6583
|
+
const n = await Vi(this.uploadFileUrl, e.files);
|
|
6544
6584
|
n.code === 0 && n.data && (s.isUploading = !1, s.data = {
|
|
6545
6585
|
files: n.data
|
|
6546
6586
|
}, p.updateMessage(s));
|
|
@@ -6566,83 +6606,89 @@ let j = class extends ee {
|
|
|
6566
6606
|
}
|
|
6567
6607
|
};
|
|
6568
6608
|
j.styles = Ua;
|
|
6569
|
-
|
|
6609
|
+
H([
|
|
6570
6610
|
v({ type: Boolean, attribute: "display-license" })
|
|
6571
6611
|
], j.prototype, "displayLicense", 2);
|
|
6572
|
-
|
|
6612
|
+
H([
|
|
6573
6613
|
v({ type: String, attribute: "name" })
|
|
6574
6614
|
], j.prototype, "name", 2);
|
|
6575
|
-
|
|
6615
|
+
H([
|
|
6576
6616
|
v({ type: String, attribute: "org-id" })
|
|
6577
6617
|
], j.prototype, "orgId", 2);
|
|
6578
|
-
|
|
6618
|
+
H([
|
|
6579
6619
|
v({ type: String, attribute: "bot-id" })
|
|
6580
6620
|
], j.prototype, "botId", 2);
|
|
6581
|
-
|
|
6621
|
+
H([
|
|
6582
6622
|
v({ type: String, attribute: "url" })
|
|
6583
6623
|
], j.prototype, "url", 2);
|
|
6584
|
-
|
|
6624
|
+
H([
|
|
6585
6625
|
v({ type: String, attribute: "logo-url" })
|
|
6586
6626
|
], j.prototype, "logoUrl", 2);
|
|
6587
|
-
|
|
6627
|
+
H([
|
|
6588
6628
|
v({ type: String, attribute: "logo-svg" })
|
|
6589
6629
|
], j.prototype, "logoSvg", 2);
|
|
6590
|
-
|
|
6630
|
+
H([
|
|
6591
6631
|
v({ type: String, attribute: "close-svg" })
|
|
6592
6632
|
], j.prototype, "closeSvg", 2);
|
|
6593
|
-
|
|
6633
|
+
H([
|
|
6594
6634
|
v({ type: String, attribute: "popup-logo-svg" })
|
|
6595
6635
|
], j.prototype, "popupLogoSvg", 2);
|
|
6596
|
-
|
|
6636
|
+
H([
|
|
6597
6637
|
v({ type: String, attribute: "popup-logo-url" })
|
|
6598
6638
|
], j.prototype, "popupLogoUrl", 2);
|
|
6599
|
-
|
|
6639
|
+
H([
|
|
6600
6640
|
v({ type: String, attribute: "bot-icon-svg" })
|
|
6601
6641
|
], j.prototype, "botIconSvg", 2);
|
|
6602
|
-
|
|
6642
|
+
H([
|
|
6603
6643
|
v({ type: String, attribute: "user-icon-svg" })
|
|
6604
6644
|
], j.prototype, "userIconSvg", 2);
|
|
6605
|
-
|
|
6645
|
+
H([
|
|
6606
6646
|
v({ type: String, attribute: "system-icon-svg" })
|
|
6607
6647
|
], j.prototype, "systemIconSvg", 2);
|
|
6608
|
-
|
|
6648
|
+
H([
|
|
6609
6649
|
v({ type: String, attribute: "agent-icon-svg" })
|
|
6610
6650
|
], j.prototype, "agentIconSvg", 2);
|
|
6611
|
-
|
|
6651
|
+
H([
|
|
6652
|
+
v({ type: String, attribute: "anchor-open-svg" })
|
|
6653
|
+
], j.prototype, "anchorOpenSvg", 2);
|
|
6654
|
+
H([
|
|
6655
|
+
v({ type: String, attribute: "anchor-close-svg" })
|
|
6656
|
+
], j.prototype, "anchorCloseSvg", 2);
|
|
6657
|
+
H([
|
|
6612
6658
|
v({ type: Boolean, attribute: "stream" })
|
|
6613
6659
|
], j.prototype, "stream", 2);
|
|
6614
|
-
|
|
6660
|
+
H([
|
|
6615
6661
|
v({ type: Boolean, attribute: "custom-request" })
|
|
6616
6662
|
], j.prototype, "customRequest", 2);
|
|
6617
|
-
|
|
6663
|
+
H([
|
|
6618
6664
|
v({ type: Boolean, attribute: "enable-file-upload" })
|
|
6619
6665
|
], j.prototype, "enableFileUpload", 2);
|
|
6620
|
-
|
|
6666
|
+
H([
|
|
6621
6667
|
v({ type: String, attribute: "upload-file-url" })
|
|
6622
6668
|
], j.prototype, "uploadFileUrl", 2);
|
|
6623
|
-
|
|
6669
|
+
H([
|
|
6624
6670
|
v({ type: Boolean, attribute: "open" })
|
|
6625
6671
|
], j.prototype, "open", 2);
|
|
6626
|
-
|
|
6672
|
+
H([
|
|
6627
6673
|
v({ type: Boolean, attribute: "always-open" })
|
|
6628
6674
|
], j.prototype, "alwaysOpen", 2);
|
|
6629
|
-
|
|
6675
|
+
H([
|
|
6630
6676
|
v({ type: String, attribute: "prefilled-form-fields" })
|
|
6631
6677
|
], j.prototype, "prefilledFormFields", 2);
|
|
6632
|
-
|
|
6678
|
+
H([
|
|
6633
6679
|
v({ type: Boolean })
|
|
6634
6680
|
], j.prototype, "loading", 2);
|
|
6635
|
-
|
|
6681
|
+
H([
|
|
6636
6682
|
v({ type: Boolean })
|
|
6637
6683
|
], j.prototype, "showSetting", 2);
|
|
6638
|
-
|
|
6684
|
+
H([
|
|
6639
6685
|
v({ type: Boolean })
|
|
6640
6686
|
], j.prototype, "showAuthAlert", 2);
|
|
6641
|
-
|
|
6687
|
+
H([
|
|
6642
6688
|
xe("cb-message-list")
|
|
6643
6689
|
], j.prototype, "_messageList", 2);
|
|
6644
|
-
j =
|
|
6645
|
-
|
|
6690
|
+
j = H([
|
|
6691
|
+
J("enegelai-bot")
|
|
6646
6692
|
], j);
|
|
6647
6693
|
export {
|
|
6648
6694
|
j as default
|