@forgebuild/sidon-booking-widget 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/elements.d.ts +1 -0
- package/dist/sidon-booking-widget.js +540 -523
- package/package.json +1 -1
|
@@ -28,8 +28,8 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
28
28
|
typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add("5");
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region node_modules/svelte/src/constants.js
|
|
31
|
-
var d = {}, f = Symbol("uninitialized"), p = "http://www.w3.org/1999/xhtml", m = "http://www.w3.org/2000/svg", h = Array.isArray, g = Array.prototype.indexOf, _ = Array.prototype.includes, v = Array.from, y = Object.keys, b = Object.defineProperty, x = Object.getOwnPropertyDescriptor, S = Object.getOwnPropertyDescriptors,
|
|
32
|
-
function
|
|
31
|
+
var d = {}, f = Symbol("uninitialized"), p = "http://www.w3.org/1999/xhtml", m = "http://www.w3.org/2000/svg", h = Array.isArray, g = Array.prototype.indexOf, _ = Array.prototype.includes, v = Array.from, y = Object.keys, b = Object.defineProperty, x = Object.getOwnPropertyDescriptor, S = Object.getOwnPropertyDescriptors, ee = Object.prototype, C = Array.prototype, w = Object.getPrototypeOf, T = Object.isExtensible, E = () => {};
|
|
32
|
+
function D(e) {
|
|
33
33
|
for (var t = 0; t < e.length; t++) e[t]();
|
|
34
34
|
}
|
|
35
35
|
function O() {
|
|
@@ -184,7 +184,7 @@ function Ze() {
|
|
|
184
184
|
var Qe = [];
|
|
185
185
|
function $e() {
|
|
186
186
|
var e = Qe;
|
|
187
|
-
Qe = [],
|
|
187
|
+
Qe = [], D(e);
|
|
188
188
|
}
|
|
189
189
|
function et(e) {
|
|
190
190
|
if (Qe.length === 0 && !It) {
|
|
@@ -613,7 +613,7 @@ function kt(e) {
|
|
|
613
613
|
function At(e) {
|
|
614
614
|
if (e.effects !== null) for (let t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac !== null && pt(() => {
|
|
615
615
|
t.ac.abort(be), t.ac = null;
|
|
616
|
-
}), t.fn !== null && (t.teardown =
|
|
616
|
+
}), t.fn !== null && (t.teardown = E), fr(t, 0), Pn(t));
|
|
617
617
|
}
|
|
618
618
|
function jt(e) {
|
|
619
619
|
if (e.effects !== null) for (let t of e.effects) t.teardown && t.fn !== null && pr(t);
|
|
@@ -989,8 +989,8 @@ function rn(e, t, n) {
|
|
|
989
989
|
}
|
|
990
990
|
function an(e) {
|
|
991
991
|
if (typeof e != "object" || !e || fe in e) return e;
|
|
992
|
-
let t =
|
|
993
|
-
if (t !==
|
|
992
|
+
let t = w(e);
|
|
993
|
+
if (t !== ee && t !== C) return e;
|
|
994
994
|
var n = /* @__PURE__ */ new Map(), r = h(e), i = /* @__PURE__ */ V(0), a = null, o = ar, s = (e) => {
|
|
995
995
|
if (ar === o) return e();
|
|
996
996
|
var t = K, n = ar;
|
|
@@ -1088,7 +1088,7 @@ function un() {
|
|
|
1088
1088
|
if (on === void 0) {
|
|
1089
1089
|
on = window, sn = /Firefox/.test(navigator.userAgent);
|
|
1090
1090
|
var e = Element.prototype, t = Node.prototype, n = Text.prototype;
|
|
1091
|
-
cn = x(t, "firstChild").get, ln = x(t, "nextSibling").get,
|
|
1091
|
+
cn = x(t, "firstChild").get, ln = x(t, "nextSibling").get, T(e) && (e[ge] = void 0, e[he] = null, e[_e] = void 0, e.__e = void 0), T(n) && (n[ve] = void 0);
|
|
1092
1092
|
}
|
|
1093
1093
|
}
|
|
1094
1094
|
function dn(e = "") {
|
|
@@ -1520,7 +1520,7 @@ function yr(e, t = /* @__PURE__ */ new Set()) {
|
|
|
1520
1520
|
for (let n in e) try {
|
|
1521
1521
|
yr(e[n], t);
|
|
1522
1522
|
} catch {}
|
|
1523
|
-
let n =
|
|
1523
|
+
let n = w(e);
|
|
1524
1524
|
if (n !== Object.prototype && n !== Array.prototype && n !== Map.prototype && n !== Set.prototype && n !== Date.prototype) {
|
|
1525
1525
|
let t = S(n);
|
|
1526
1526
|
for (let n in t) {
|
|
@@ -1936,10 +1936,10 @@ function Qr(e, t, n, r, i) {
|
|
|
1936
1936
|
if (f.length < p.length) {
|
|
1937
1937
|
var b = p[0], x;
|
|
1938
1938
|
u = b.prev;
|
|
1939
|
-
var S = f[0],
|
|
1939
|
+
var S = f[0], ee = f[f.length - 1];
|
|
1940
1940
|
for (x = 0; x < f.length; x += 1) ei(f[x], b, n);
|
|
1941
1941
|
for (x = 0; x < p.length; x += 1) l.delete(p[x]);
|
|
1942
|
-
ti(e, S.prev,
|
|
1942
|
+
ti(e, S.prev, ee.next), ti(e, u, S), ti(e, ee, b), c = b, u = ee, --_, f = [], p = [];
|
|
1943
1943
|
} else l.delete(g), ei(g, c, n), ti(e, g.prev, g.next), ti(e, g, u === null ? e.effect.first : u.next), ti(e, u, g), u = g;
|
|
1944
1944
|
continue;
|
|
1945
1945
|
}
|
|
@@ -1953,17 +1953,17 @@ function Qr(e, t, n, r, i) {
|
|
|
1953
1953
|
e.outrogroups.size === 0 && (e.outrogroups = null);
|
|
1954
1954
|
}
|
|
1955
1955
|
if (c !== null || l !== void 0) {
|
|
1956
|
-
var
|
|
1957
|
-
if (l !== void 0) for (g of l) g.f & 8192 ||
|
|
1958
|
-
for (; c !== null;) !(c.f & 8192) && c !== e.fallback &&
|
|
1959
|
-
var
|
|
1960
|
-
if (
|
|
1961
|
-
var
|
|
1956
|
+
var C = [];
|
|
1957
|
+
if (l !== void 0) for (g of l) g.f & 8192 || C.push(g);
|
|
1958
|
+
for (; c !== null;) !(c.f & 8192) && c !== e.fallback && C.push(c), c = Zr(c.next);
|
|
1959
|
+
var w = C.length;
|
|
1960
|
+
if (w > 0) {
|
|
1961
|
+
var T = r & 4 && o === 0 ? n : null;
|
|
1962
1962
|
if (a) {
|
|
1963
|
-
for (_ = 0; _ <
|
|
1964
|
-
for (_ = 0; _ <
|
|
1963
|
+
for (_ = 0; _ < w; _ += 1) C[_].nodes?.a?.measure();
|
|
1964
|
+
for (_ = 0; _ < w; _ += 1) C[_].nodes?.a?.fix();
|
|
1965
1965
|
}
|
|
1966
|
-
qr(e,
|
|
1966
|
+
qr(e, C, T);
|
|
1967
1967
|
}
|
|
1968
1968
|
}
|
|
1969
1969
|
a && et(() => {
|
|
@@ -2171,7 +2171,7 @@ function Si(e) {
|
|
|
2171
2171
|
xi.set(t, n = []);
|
|
2172
2172
|
for (var r, i = e, a = Element.prototype; a !== i;) {
|
|
2173
2173
|
for (var o in r = S(i), r) r[o].set && o !== "innerHTML" && o !== "textContent" && o !== "innerText" && n.push(o);
|
|
2174
|
-
i =
|
|
2174
|
+
i = w(i);
|
|
2175
2175
|
}
|
|
2176
2176
|
return n;
|
|
2177
2177
|
}
|
|
@@ -3096,7 +3096,7 @@ function ha(e, t) {
|
|
|
3096
3096
|
var t = ie(), r = t.weekWrapper, i = t.weekNumbers;
|
|
3097
3097
|
n.innerContainer.appendChild(r), n.weekNumbers = i, n.weekWrapper = r;
|
|
3098
3098
|
}
|
|
3099
|
-
n.rContainer = Ki("div", "flatpickr-rContainer"), n.rContainer.appendChild(ne()), n.daysContainer || (n.daysContainer = Ki("div", "flatpickr-days"), n.daysContainer.tabIndex = -1),
|
|
3099
|
+
n.rContainer = Ki("div", "flatpickr-rContainer"), n.rContainer.appendChild(ne()), n.daysContainer || (n.daysContainer = Ki("div", "flatpickr-days"), n.daysContainer.tabIndex = -1), D(), n.rContainer.appendChild(n.daysContainer), n.innerContainer.appendChild(n.rContainer), e.appendChild(n.innerContainer);
|
|
3100
3100
|
}
|
|
3101
3101
|
n.config.enableTime && e.appendChild(te()), Gi(n.calendarContainer, "rangeMode", n.config.mode === "range"), Gi(n.calendarContainer, "animate", n.config.animate === !0), Gi(n.calendarContainer, "multiMonth", n.config.showMonths > 1), n.calendarContainer.appendChild(e);
|
|
3102
3102
|
var a = n.config.appendTo !== void 0 && n.config.appendTo.nodeType !== void 0;
|
|
@@ -3110,39 +3110,39 @@ function ha(e, t) {
|
|
|
3110
3110
|
var a = de(t, !0), o = Ki("span", e, t.getDate().toString());
|
|
3111
3111
|
return o.dateObj = t, o.$i = i, o.setAttribute("aria-label", n.formatDate(t, n.config.ariaDateFormat)), e.indexOf("hidden") === -1 && ia(t, n.now) === 0 && (n.todayDateElem = o, o.classList.add("today"), o.setAttribute("aria-current", "date")), a ? (o.tabIndex = -1, P(t) && (o.classList.add("selected"), n.selectedDateElem = o, n.config.mode === "range" && (Gi(o, "startRange", n.selectedDates[0] && ia(t, n.selectedDates[0], !0) === 0), Gi(o, "endRange", n.selectedDates[1] && ia(t, n.selectedDates[1], !0) === 0), e === "nextMonthDay" && o.classList.add("inRange")))) : o.classList.add("flatpickr-disabled"), n.config.mode === "range" && ze(t) && !P(t) && o.classList.add("inRange"), n.weekNumbers && n.config.showMonths === 1 && e !== "prevMonthDay" && i % 7 == 6 && n.weekNumbers.insertAdjacentHTML("beforeend", "<span class='flatpickr-day'>" + n.config.getWeek(t) + "</span>"), N("onDayCreate", o), o;
|
|
3112
3112
|
}
|
|
3113
|
-
function
|
|
3113
|
+
function ee(e) {
|
|
3114
3114
|
e.focus(), n.config.mode === "range" && he(e);
|
|
3115
3115
|
}
|
|
3116
|
-
function
|
|
3116
|
+
function C(e) {
|
|
3117
3117
|
for (var t = e > 0 ? 0 : n.config.showMonths - 1, r = e > 0 ? n.config.showMonths : -1, i = t; i != r; i += e) for (var a = n.daysContainer.children[i], o = e > 0 ? 0 : a.children.length - 1, s = e > 0 ? a.children.length : -1, c = o; c != s; c += e) {
|
|
3118
3118
|
var l = a.children[c];
|
|
3119
3119
|
if (l.className.indexOf("hidden") === -1 && de(l.dateObj)) return l;
|
|
3120
3120
|
}
|
|
3121
3121
|
}
|
|
3122
|
-
function
|
|
3122
|
+
function w(e, t) {
|
|
3123
3123
|
for (var r = e.className.indexOf("Month") === -1 ? e.dateObj.getMonth() : n.currentMonth, i = t > 0 ? n.config.showMonths : -1, a = t > 0 ? 1 : -1, o = r - n.currentMonth; o != i; o += a) for (var s = n.daysContainer.children[o], c = r - n.currentMonth === o ? e.$i + t : t < 0 ? s.children.length - 1 : 0, l = s.children.length, u = c; u >= 0 && u < l && u != (t > 0 ? l : -1); u += a) {
|
|
3124
3124
|
var d = s.children[u];
|
|
3125
|
-
if (d.className.indexOf("hidden") === -1 && de(d.dateObj) && Math.abs(e.$i - u) >= Math.abs(t)) return
|
|
3125
|
+
if (d.className.indexOf("hidden") === -1 && de(d.dateObj) && Math.abs(e.$i - u) >= Math.abs(t)) return ee(d);
|
|
3126
3126
|
}
|
|
3127
|
-
n.changeMonth(a),
|
|
3127
|
+
n.changeMonth(a), T(C(a), 0);
|
|
3128
3128
|
}
|
|
3129
|
-
function
|
|
3130
|
-
var r = a(), i = fe(r || document.body), o = e === void 0 ? i ? r : n.selectedDateElem !== void 0 && fe(n.selectedDateElem) ? n.selectedDateElem : n.todayDateElem !== void 0 && fe(n.todayDateElem) ? n.todayDateElem :
|
|
3131
|
-
o === void 0 ? n._input.focus() : i ?
|
|
3129
|
+
function T(e, t) {
|
|
3130
|
+
var r = a(), i = fe(r || document.body), o = e === void 0 ? i ? r : n.selectedDateElem !== void 0 && fe(n.selectedDateElem) ? n.selectedDateElem : n.todayDateElem !== void 0 && fe(n.todayDateElem) ? n.todayDateElem : C(t > 0 ? 1 : -1) : e;
|
|
3131
|
+
o === void 0 ? n._input.focus() : i ? w(o, t) : ee(o);
|
|
3132
3132
|
}
|
|
3133
|
-
function
|
|
3133
|
+
function E(e, t) {
|
|
3134
3134
|
for (var r = (new Date(e, t, 1).getDay() - n.l10n.firstDayOfWeek + 7) % 7, i = n.utils.getDaysInMonth((t - 1 + 12) % 12, e), a = n.utils.getDaysInMonth(t, e), o = window.document.createDocumentFragment(), s = n.config.showMonths > 1, c = s ? "prevMonthDay hidden" : "prevMonthDay", l = s ? "nextMonthDay hidden" : "nextMonthDay", u = i + 1 - r, d = 0; u <= i; u++, d++) o.appendChild(S("flatpickr-day " + c, new Date(e, t - 1, u), u, d));
|
|
3135
3135
|
for (u = 1; u <= a; u++, d++) o.appendChild(S("flatpickr-day", new Date(e, t, u), u, d));
|
|
3136
3136
|
for (var f = a + 1; f <= 42 - r && (n.config.showMonths === 1 || d % 7 != 0); f++, d++) o.appendChild(S("flatpickr-day " + l, new Date(e, t + 1, f % a), f, d));
|
|
3137
3137
|
var p = Ki("div", "dayContainer");
|
|
3138
3138
|
return p.appendChild(o), p;
|
|
3139
3139
|
}
|
|
3140
|
-
function
|
|
3140
|
+
function D() {
|
|
3141
3141
|
if (n.daysContainer !== void 0) {
|
|
3142
3142
|
qi(n.daysContainer), n.weekNumbers && qi(n.weekNumbers);
|
|
3143
3143
|
for (var e = document.createDocumentFragment(), t = 0; t < n.config.showMonths; t++) {
|
|
3144
3144
|
var r = new Date(n.currentYear, n.currentMonth, 1);
|
|
3145
|
-
r.setMonth(n.currentMonth + t), e.appendChild(
|
|
3145
|
+
r.setMonth(n.currentMonth + t), e.appendChild(E(r.getFullYear(), r.getMonth()));
|
|
3146
3146
|
}
|
|
3147
3147
|
n.daysContainer.appendChild(e), n.days = n.daysContainer.firstChild, n.config.mode === "range" && n.selectedDates.length === 1 && he();
|
|
3148
3148
|
}
|
|
@@ -3241,7 +3241,7 @@ function ha(e, t) {
|
|
|
3241
3241
|
function M(e, t) {
|
|
3242
3242
|
t === void 0 && (t = !0);
|
|
3243
3243
|
var r = t ? e : e - n.currentMonth;
|
|
3244
|
-
r < 0 && n._hidePrevMonthArrow === !0 || r > 0 && n._hideNextMonthArrow === !0 || (n.currentMonth += r, (n.currentMonth < 0 || n.currentMonth > 11) && (n.currentYear += n.currentMonth > 11 ? 1 : -1, n.currentMonth = (n.currentMonth + 12) % 12, N("onYearChange"), O()),
|
|
3244
|
+
r < 0 && n._hidePrevMonthArrow === !0 || r > 0 && n._hideNextMonthArrow === !0 || (n.currentMonth += r, (n.currentMonth < 0 || n.currentMonth > 11) && (n.currentYear += n.currentMonth > 11 ? 1 : -1, n.currentMonth = (n.currentMonth + 12) % 12, N("onYearChange"), O()), D(), N("onMonthChange"), Be());
|
|
3245
3245
|
}
|
|
3246
3246
|
function ae(e, t) {
|
|
3247
3247
|
if (e === void 0 && (e = !0), t === void 0 && (t = !0), n.input.value = "", n.altInput !== void 0 && (n.altInput.value = ""), n.mobileInput !== void 0 && (n.mobileInput.value = ""), n.selectedDates = [], n.latestSelectedDateObj = void 0, t === !0 && (n.currentYear = n._initialDate.getFullYear(), n.currentMonth = n._initialDate.getMonth()), n.config.enableTime === !0) {
|
|
@@ -3335,7 +3335,7 @@ function ha(e, t) {
|
|
|
3335
3335
|
var f = a();
|
|
3336
3336
|
if (n.daysContainer !== void 0 && (o === !1 || f && fe(f))) {
|
|
3337
3337
|
var p = t.keyCode === 39 ? 1 : -1;
|
|
3338
|
-
t.ctrlKey ? (t.stopPropagation(), M(p),
|
|
3338
|
+
t.ctrlKey ? (t.stopPropagation(), M(p), T(C(1), 0)) : T(void 0, p);
|
|
3339
3339
|
}
|
|
3340
3340
|
} else n.hourElement && n.hourElement.focus();
|
|
3341
3341
|
break;
|
|
@@ -3343,7 +3343,7 @@ function ha(e, t) {
|
|
|
3343
3343
|
case 40:
|
|
3344
3344
|
t.preventDefault();
|
|
3345
3345
|
var m = t.keyCode === 40 ? 1 : -1;
|
|
3346
|
-
n.daysContainer && r.$i !== void 0 || r === n.input || r === n.altInput ? t.ctrlKey ? (t.stopPropagation(), ue(n.currentYear - m),
|
|
3346
|
+
n.daysContainer && r.$i !== void 0 || r === n.input || r === n.altInput ? t.ctrlKey ? (t.stopPropagation(), ue(n.currentYear - m), T(C(1), 0)) : u || T(void 0, m * 7) : r === n.currentYearElement ? ue(n.currentYear - m) : n.config.enableTime && (!u && n.hourElement && n.hourElement.focus(), c(t), n._debouncedChange());
|
|
3347
3347
|
break;
|
|
3348
3348
|
case 9: if (u) {
|
|
3349
3349
|
var h = [
|
|
@@ -3533,8 +3533,8 @@ function ha(e, t) {
|
|
|
3533
3533
|
else {
|
|
3534
3534
|
var v = Ce();
|
|
3535
3535
|
if (v === void 0) return;
|
|
3536
|
-
var y = window.document.body.offsetWidth, b = Math.max(0, y / 2 - i / 2), x = ".flatpickr-calendar.centerMost:before", S = ".flatpickr-calendar.centerMost:after",
|
|
3537
|
-
Gi(n.calendarContainer, "rightMost", !1), Gi(n.calendarContainer, "centerMost", !0), v.insertRule(x + "," + S +
|
|
3536
|
+
var y = window.document.body.offsetWidth, b = Math.max(0, y / 2 - i / 2), x = ".flatpickr-calendar.centerMost:before", S = ".flatpickr-calendar.centerMost:after", ee = v.cssRules.length, C = "{left:" + c.left + "px;right:auto;}";
|
|
3537
|
+
Gi(n.calendarContainer, "rightMost", !1), Gi(n.calendarContainer, "centerMost", !0), v.insertRule(x + "," + S + C, ee), n.calendarContainer.style.left = b + "px", n.calendarContainer.style.right = "auto";
|
|
3538
3538
|
}
|
|
3539
3539
|
}
|
|
3540
3540
|
}
|
|
@@ -3559,7 +3559,7 @@ function ha(e, t) {
|
|
|
3559
3559
|
return document.head.appendChild(e), e.sheet;
|
|
3560
3560
|
}
|
|
3561
3561
|
function Te() {
|
|
3562
|
-
n.config.noCalendar || n.isMobile || (O(), Be(),
|
|
3562
|
+
n.config.noCalendar || n.isMobile || (O(), Be(), D());
|
|
3563
3563
|
}
|
|
3564
3564
|
function Ee() {
|
|
3565
3565
|
n._input.focus(), window.navigator.userAgent.indexOf("MSIE") !== -1 || navigator.msMaxTouchPoints !== void 0 ? setTimeout(n.close, 0) : n.close();
|
|
@@ -3582,7 +3582,7 @@ function ha(e, t) {
|
|
|
3582
3582
|
var s = n.currentYear !== i.getFullYear();
|
|
3583
3583
|
n.currentYear = i.getFullYear(), n.currentMonth = i.getMonth(), s && (N("onYearChange"), O()), N("onMonthChange");
|
|
3584
3584
|
}
|
|
3585
|
-
if (Be(),
|
|
3585
|
+
if (Be(), D(), Ve(), !a && n.config.mode !== "range" && n.config.showMonths === 1 ? ee(r) : n.selectedDateElem !== void 0 && n.hourElement === void 0 && n.selectedDateElem && n.selectedDateElem.focus(), n.hourElement !== void 0 && n.hourElement !== void 0 && n.hourElement.focus(), n.config.closeOnSelect) {
|
|
3586
3586
|
var c = n.config.mode === "single" && !n.config.enableTime, l = n.config.mode === "range" && n.selectedDates.length === 2 && !n.config.enableTime;
|
|
3587
3587
|
(c || l) && Ee();
|
|
3588
3588
|
}
|
|
@@ -4126,21 +4126,21 @@ function Pa(e, t) {
|
|
|
4126
4126
|
}
|
|
4127
4127
|
}, v = Ma(), y = U(v), b = W(U(y), 2), x = U(b), S = W(x, 2);
|
|
4128
4128
|
_i(S), On(() => Ci(S, n)), ii(S, (e, t) => h?.(e, t), n);
|
|
4129
|
-
var
|
|
4129
|
+
var ee = W(S, 2);
|
|
4130
4130
|
Ve(2), F(b), F(y);
|
|
4131
|
-
var
|
|
4132
|
-
F(
|
|
4133
|
-
var
|
|
4134
|
-
_i(
|
|
4135
|
-
var O = W(
|
|
4131
|
+
var C = W(y, 2), w = W(U(C), 2), T = U(w, !0);
|
|
4132
|
+
F(w), ii(w, (e, t) => h?.(e, t), a), F(C);
|
|
4133
|
+
var E = W(C, 2), D = W(U(E), 2);
|
|
4134
|
+
_i(D), Oi(D, (e) => d = e, () => d), F(E);
|
|
4135
|
+
var O = W(E, 2), k = (e) => {
|
|
4136
4136
|
var t = ja(), n = U(t), r = U(n, !0);
|
|
4137
4137
|
F(n), ii(n, (e, t) => h?.(e, t), o), F(t), G(() => Z(r, o())), X(e, t);
|
|
4138
4138
|
};
|
|
4139
4139
|
return Q(O, (e) => {
|
|
4140
4140
|
o() && e(k);
|
|
4141
4141
|
}), F(v), G(() => {
|
|
4142
|
-
x.disabled = u(), yi(S, "min", s()), yi(S, "max", c()), S.disabled = u(),
|
|
4143
|
-
}), Cr("click", x, () => m(-1)), Cr("click",
|
|
4142
|
+
x.disabled = u(), yi(S, "min", s()), yi(S, "max", c()), S.disabled = u(), ee.disabled = u(), Z(T, a()), vi(D, J(g)), D.disabled = u();
|
|
4143
|
+
}), Cr("click", x, () => m(-1)), Cr("click", ee, () => m(1)), X(e, v), Xe(_);
|
|
4144
4144
|
}
|
|
4145
4145
|
wr(["click"]), Pi(Pa, {
|
|
4146
4146
|
loa: {},
|
|
@@ -4407,37 +4407,37 @@ var fo = /* @__PURE__ */ Y("<div class=\"sbm-map svelte-yb07tk\"></div>"), po =
|
|
|
4407
4407
|
};
|
|
4408
4408
|
function mo(e, t) {
|
|
4409
4409
|
Ye(t, !0), ri(e, po);
|
|
4410
|
-
let n = $(t, "mapsApiKey", 7), r = $(t, "mapStyle", 7), i = $(t, "center", 7), a = $(t, "navy", 7), o = $(t, "gold", 7), s = $(t, "logoMark", 7, null), c = $(t, "marinaName", 7, ""), l = $(t, "otherMarinas", 7), u = $(t, "berths", 7), d = $(t, "overlays", 7), f = $(t, "layout", 7), p = $(t, "loa", 7), m = $(t, "selectedBerth", 7), h = $(t, "onBerthClick", 7), g = $(t, "staff", 7, !1), _, v = /* @__PURE__ */ V(null), y = /* @__PURE__ */ new Map(), b = [], x = [], S = !1,
|
|
4410
|
+
let n = $(t, "mapsApiKey", 7), r = $(t, "mapStyle", 7), i = $(t, "center", 7), a = $(t, "navy", 7), o = $(t, "gold", 7), s = $(t, "logoMark", 7, null), c = $(t, "marinaName", 7, ""), l = $(t, "otherMarinas", 7), u = $(t, "berths", 7), d = $(t, "overlays", 7), f = $(t, "layout", 7), p = $(t, "loa", 7), m = $(t, "selectedBerth", 7), h = $(t, "onBerthClick", 7), g = $(t, "staff", 7, !1), _, v = /* @__PURE__ */ V(null), y = /* @__PURE__ */ new Map(), b = [], x = [], S = !1, ee = /* @__PURE__ */ L(() => ({
|
|
4411
4411
|
fillColor: o(),
|
|
4412
4412
|
fillOpacity: .38,
|
|
4413
4413
|
strokeColor: o(),
|
|
4414
4414
|
strokeOpacity: 1,
|
|
4415
4415
|
strokeWeight: 1.6
|
|
4416
|
-
})),
|
|
4416
|
+
})), C = /* @__PURE__ */ L(() => ({
|
|
4417
4417
|
fillColor: o(),
|
|
4418
4418
|
fillOpacity: .62,
|
|
4419
4419
|
strokeColor: o(),
|
|
4420
4420
|
strokeOpacity: 1,
|
|
4421
4421
|
strokeWeight: 1.6
|
|
4422
|
-
})),
|
|
4422
|
+
})), w = /* @__PURE__ */ L(() => ({
|
|
4423
4423
|
fillColor: o(),
|
|
4424
4424
|
fillOpacity: .72,
|
|
4425
4425
|
strokeColor: "#252525",
|
|
4426
4426
|
strokeOpacity: 1,
|
|
4427
4427
|
strokeWeight: 2
|
|
4428
|
-
})),
|
|
4428
|
+
})), T = {
|
|
4429
4429
|
fillColor: "#b8b8b8",
|
|
4430
4430
|
fillOpacity: .08,
|
|
4431
4431
|
strokeColor: "#b8b8b8",
|
|
4432
4432
|
strokeOpacity: .5,
|
|
4433
4433
|
strokeWeight: 1
|
|
4434
|
-
},
|
|
4434
|
+
}, E = {
|
|
4435
4435
|
fillColor: "#888888",
|
|
4436
4436
|
fillOpacity: .15,
|
|
4437
4437
|
strokeColor: "#888888",
|
|
4438
4438
|
strokeOpacity: .4,
|
|
4439
4439
|
strokeWeight: 1
|
|
4440
|
-
},
|
|
4440
|
+
}, D = /* @__PURE__ */ L(() => ({
|
|
4441
4441
|
fillColor: a(),
|
|
4442
4442
|
fillOpacity: .85,
|
|
4443
4443
|
strokeColor: a(),
|
|
@@ -4753,11 +4753,11 @@ function mo(e, t) {
|
|
|
4753
4753
|
function se(e, t) {
|
|
4754
4754
|
let n = e.berth.status !== "available";
|
|
4755
4755
|
e.pickable = eo(e.berth, p(), g());
|
|
4756
|
-
let r = t === m() ? J(
|
|
4756
|
+
let r = t === m() ? J(w) : n ? g() ? J(D) : E : e.pickable ? J(ee) : T;
|
|
4757
4757
|
e.circle.setOptions({
|
|
4758
4758
|
...r,
|
|
4759
4759
|
clickable: e.pickable
|
|
4760
|
-
}), e.hull?.setOptions({ fillOpacity: r ===
|
|
4760
|
+
}), e.hull?.setOptions({ fillOpacity: r === T || r === E ? .2 : .85 });
|
|
4761
4761
|
}
|
|
4762
4762
|
Gr(() => {
|
|
4763
4763
|
let e = !1;
|
|
@@ -4796,11 +4796,11 @@ function mo(e, t) {
|
|
|
4796
4796
|
lng: t.lng
|
|
4797
4797
|
},
|
|
4798
4798
|
radius: O(t),
|
|
4799
|
-
...J(
|
|
4799
|
+
...J(ee)
|
|
4800
4800
|
}) : new n.Polygon({
|
|
4801
4801
|
map: J(v),
|
|
4802
4802
|
paths: uo(t, r, so),
|
|
4803
|
-
...J(
|
|
4803
|
+
...J(ee)
|
|
4804
4804
|
}), o = {
|
|
4805
4805
|
circle: i,
|
|
4806
4806
|
hull: r == null ? null : new n.Polygon({
|
|
@@ -4817,7 +4817,7 @@ function mo(e, t) {
|
|
|
4817
4817
|
pickable: !1
|
|
4818
4818
|
};
|
|
4819
4819
|
y.set(t.berthId, o), _r(() => se(o, t.berthId)), i.addListener("click", () => h()(t.berthId === m() ? null : t.berthId)), i.addListener("mouseover", () => {
|
|
4820
|
-
o.pickable && t.berthId !== m() && i.setOptions(J(
|
|
4820
|
+
o.pickable && t.berthId !== m() && i.setOptions(J(C));
|
|
4821
4821
|
}), i.addListener("mouseout", () => {
|
|
4822
4822
|
t.berthId !== m() && se(o, t.berthId);
|
|
4823
4823
|
}), e.extend({
|
|
@@ -5103,14 +5103,14 @@ function xo(e, t) {
|
|
|
5103
5103
|
Ve(), F(y);
|
|
5104
5104
|
var x = W(y, 2);
|
|
5105
5105
|
_i(x), F(v), F(p);
|
|
5106
|
-
var S = W(p, 2),
|
|
5107
|
-
Ve(), F(
|
|
5108
|
-
var
|
|
5109
|
-
_i(
|
|
5110
|
-
var
|
|
5111
|
-
F(
|
|
5112
|
-
var k = W(
|
|
5113
|
-
_i(k), F(
|
|
5106
|
+
var S = W(p, 2), ee = U(S), C = U(ee), w = U(C);
|
|
5107
|
+
Ve(), F(C);
|
|
5108
|
+
var T = W(C, 2);
|
|
5109
|
+
_i(T), F(ee);
|
|
5110
|
+
var E = W(ee, 2), D = U(E), O = U(D, !0);
|
|
5111
|
+
F(D);
|
|
5112
|
+
var k = W(D, 2);
|
|
5113
|
+
_i(k), F(E), F(S);
|
|
5114
5114
|
var A = W(S, 2), j = U(A), te = U(j), ne = U(te, !0);
|
|
5115
5115
|
F(te);
|
|
5116
5116
|
var re = W(te, 2);
|
|
@@ -5119,8 +5119,8 @@ function xo(e, t) {
|
|
|
5119
5119
|
F(M);
|
|
5120
5120
|
var oe = W(M, 2);
|
|
5121
5121
|
return dt(oe), F(ie), F(u), G(() => {
|
|
5122
|
-
Z(f, c().yourDetails), Z(g, `${c().skipperName ?? ""} `), Z(b, `${c().boatName ?? ""} `), Z(
|
|
5123
|
-
}), Ci(_, n), Ci(x, a), Ci(
|
|
5122
|
+
Z(f, c().yourDetails), Z(g, `${c().skipperName ?? ""} `), Z(b, `${c().boatName ?? ""} `), Z(w, `${c().email ?? ""} `), Z(O, c().phone), Z(ne, c().wizard.boatBeam), Z(ae, c().notes);
|
|
5123
|
+
}), Ci(_, n), Ci(x, a), Ci(T, r), Ci(k, i), Ci(re, o), Ci(oe, s), X(e, u), Xe(l);
|
|
5124
5124
|
}
|
|
5125
5125
|
Pi(xo, {
|
|
5126
5126
|
contactName: {},
|
|
@@ -5828,12 +5828,12 @@ function es(e, t) {
|
|
|
5828
5828
|
F(b);
|
|
5829
5829
|
var S = W(b, 2);
|
|
5830
5830
|
Oi(S, (e) => l = e, () => l);
|
|
5831
|
-
var
|
|
5831
|
+
var ee = W(S, 2), C = (e) => {
|
|
5832
5832
|
var t = Zo(), n = U(t, !0);
|
|
5833
5833
|
F(t), G(() => Z(n, J(d))), X(e, t);
|
|
5834
5834
|
};
|
|
5835
|
-
return Q(
|
|
5836
|
-
J(d) && e(
|
|
5835
|
+
return Q(ee, (e) => {
|
|
5836
|
+
J(d) && e(C);
|
|
5837
5837
|
}), F(m), G(() => {
|
|
5838
5838
|
Z(_, J(s).paymentHold), Z(y, `${J(s).total ?? ""} ${o() ?? ""}`), Z(x, J(s).paymentNote);
|
|
5839
5839
|
}), X(e, m), Xe(p);
|
|
@@ -6157,17 +6157,17 @@ function Rs(e, t) {
|
|
|
6157
6157
|
set onchange(e) {
|
|
6158
6158
|
l(e), B();
|
|
6159
6159
|
}
|
|
6160
|
-
}, x = Is(), S = U(x),
|
|
6160
|
+
}, x = Is(), S = U(x), ee = U(S, !0);
|
|
6161
6161
|
F(S);
|
|
6162
|
-
var
|
|
6162
|
+
var C = W(S, 2), w = (e) => {
|
|
6163
6163
|
var t = Ts(), n = U(t, !0);
|
|
6164
6164
|
F(t), G(() => Z(n, J(u).docsAfterSend)), X(e, t);
|
|
6165
6165
|
};
|
|
6166
|
-
Q(
|
|
6167
|
-
J(d) || e(
|
|
6166
|
+
Q(C, (e) => {
|
|
6167
|
+
J(d) || e(w);
|
|
6168
6168
|
});
|
|
6169
|
-
var
|
|
6170
|
-
Xr(
|
|
6169
|
+
var T = W(C, 2);
|
|
6170
|
+
Xr(T, 17, s, (e) => e.id, (e, t) => {
|
|
6171
6171
|
let n = /* @__PURE__ */ L(() => g(J(t).id)), r = /* @__PURE__ */ L(() => J(p)[J(t).id]), i = /* @__PURE__ */ L(() => J(d) && !J(r) && (!J(n) || J(n).status === "rejected"));
|
|
6172
6172
|
var a = Nr();
|
|
6173
6173
|
ni(mn(a), () => J(i) ? "label" : "div", !1, (e, a) => {
|
|
@@ -6192,46 +6192,46 @@ function Rs(e, t) {
|
|
|
6192
6192
|
Q(f, (e) => {
|
|
6193
6193
|
J(r) ? e(p) : J(n)?.status === "verified" ? e(m, 1) : J(n)?.status === "pending" ? e(h, 2) : e(g, -1);
|
|
6194
6194
|
}), F(l);
|
|
6195
|
-
var v = W(l, 2), b = U(v), x = U(b, !0), S = W(x),
|
|
6195
|
+
var v = W(l, 2), b = U(v), x = U(b, !0), S = W(x), ee = (e) => {
|
|
6196
6196
|
X(e, As());
|
|
6197
6197
|
};
|
|
6198
6198
|
Q(S, (e) => {
|
|
6199
|
-
J(t).mandatory && e(
|
|
6199
|
+
J(t).mandatory && e(ee);
|
|
6200
6200
|
});
|
|
6201
|
-
var
|
|
6201
|
+
var C = W(S, 2), w = (e) => {
|
|
6202
6202
|
var t = js(), r = U(t, !0);
|
|
6203
6203
|
F(t), G((e) => Z(r, e), [() => _(J(n).submittedAt)]), X(e, t);
|
|
6204
6204
|
};
|
|
6205
|
-
Q(
|
|
6206
|
-
J(n) && !J(r) && e(
|
|
6205
|
+
Q(C, (e) => {
|
|
6206
|
+
J(n) && !J(r) && e(w);
|
|
6207
6207
|
}), F(b);
|
|
6208
|
-
var
|
|
6209
|
-
F(
|
|
6210
|
-
var
|
|
6208
|
+
var T = W(b, 2), E = U(T, !0);
|
|
6209
|
+
F(T), F(v), F(c);
|
|
6210
|
+
var D = W(c, 2), O = (e) => {
|
|
6211
6211
|
var t = Ms(), i = U(t, !0);
|
|
6212
6212
|
F(t), G(() => Z(i, J(r) ? J(u).uploading : J(n) ? J(u).replace : J(u).upload)), X(e, t);
|
|
6213
6213
|
};
|
|
6214
|
-
Q(
|
|
6214
|
+
Q(D, (e) => {
|
|
6215
6215
|
(J(i) || J(r)) && e(O);
|
|
6216
6216
|
});
|
|
6217
|
-
var k = W(
|
|
6217
|
+
var k = W(D, 2), A = (e) => {
|
|
6218
6218
|
var n = Ns();
|
|
6219
6219
|
Cr("change", n, (e) => y(J(t), e)), X(e, n);
|
|
6220
6220
|
};
|
|
6221
6221
|
Q(k, (e) => {
|
|
6222
6222
|
J(i) && e(A);
|
|
6223
6223
|
}), G(() => {
|
|
6224
|
-
Z(x, J(t).name), Z(
|
|
6224
|
+
Z(x, J(t).name), Z(E, J(r) ? `${J(u).uploading} ${J(r)}` : J(n) ? J(u).docState[J(n).status] : J(t).description || (J(d) ? J(u).tapToUpload : ""));
|
|
6225
6225
|
}), X(a, s);
|
|
6226
6226
|
}), X(e, a);
|
|
6227
6227
|
});
|
|
6228
|
-
var
|
|
6228
|
+
var E = W(T, 2), D = (e) => {
|
|
6229
6229
|
var t = Fs(), n = U(t, !0);
|
|
6230
6230
|
F(t), G(() => Z(n, J(m))), X(e, t);
|
|
6231
6231
|
};
|
|
6232
|
-
return Q(
|
|
6233
|
-
J(m) && e(
|
|
6234
|
-
}), F(x), G(() => Z(
|
|
6232
|
+
return Q(E, (e) => {
|
|
6233
|
+
J(m) && e(D);
|
|
6234
|
+
}), F(x), G(() => Z(ee, J(u).documentsHeading)), X(e, x), Xe(b);
|
|
6235
6235
|
}
|
|
6236
6236
|
wr(["change"]), Pi(Rs, {
|
|
6237
6237
|
apiOrigin: {},
|
|
@@ -6313,12 +6313,12 @@ function Ws(e, t) {
|
|
|
6313
6313
|
}
|
|
6314
6314
|
}, y = Hs(), b = U(y), x = U(b, !0);
|
|
6315
6315
|
F(b);
|
|
6316
|
-
var S = W(b, 2),
|
|
6316
|
+
var S = W(b, 2), ee = U(S, !0);
|
|
6317
6317
|
F(S);
|
|
6318
|
-
var
|
|
6318
|
+
var C = W(S, 2), w = (e) => {
|
|
6319
6319
|
var t = zs(), n = U(t, !0);
|
|
6320
6320
|
F(t), G((e) => Z(n, e), [() => J(l).contractAgreedOn(g(J(m)))]), X(e, t);
|
|
6321
|
-
},
|
|
6321
|
+
}, T = (e) => {
|
|
6322
6322
|
var t = Bs(), n = mn(t), r = U(n);
|
|
6323
6323
|
_i(r);
|
|
6324
6324
|
var i = W(r, 2), a = U(i), o = W(a), s = U(o, !0);
|
|
@@ -6328,17 +6328,17 @@ function Ws(e, t) {
|
|
|
6328
6328
|
Z(a, `${J(l).readAgree ?? ""} `), Z(s, J(l).agreement), c.disabled = !J(u) || J(d), Z(f, J(d) ? J(l).sending : J(l).agree);
|
|
6329
6329
|
}), wi(r, () => J(u), (e) => H(u, e)), Cr("click", c, _), X(e, t);
|
|
6330
6330
|
};
|
|
6331
|
-
Q(
|
|
6332
|
-
J(m) ? e(
|
|
6331
|
+
Q(C, (e) => {
|
|
6332
|
+
J(m) ? e(w) : J(h) && e(T, 1);
|
|
6333
6333
|
});
|
|
6334
|
-
var
|
|
6334
|
+
var E = W(C, 2), D = (e) => {
|
|
6335
6335
|
var t = Vs(), n = U(t, !0);
|
|
6336
6336
|
F(t), G(() => Z(n, J(f))), X(e, t);
|
|
6337
6337
|
};
|
|
6338
|
-
return Q(
|
|
6339
|
-
J(f) && e(
|
|
6338
|
+
return Q(E, (e) => {
|
|
6339
|
+
J(f) && e(D);
|
|
6340
6340
|
}), F(y), G(() => {
|
|
6341
|
-
Z(x, J(l).contractHeading), Z(
|
|
6341
|
+
Z(x, J(l).contractHeading), Z(ee, s().renderedBody);
|
|
6342
6342
|
}), X(e, y), Xe(v);
|
|
6343
6343
|
}
|
|
6344
6344
|
wr(["click"]), Pi(Ws, {
|
|
@@ -6412,7 +6412,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
6412
6412
|
function S(e, t) {
|
|
6413
6413
|
return `${e}`.padStart(t ? 3 : 2, "0");
|
|
6414
6414
|
}
|
|
6415
|
-
function
|
|
6415
|
+
function ee(e) {
|
|
6416
6416
|
return b.Config.logTimestamps ? function(t) {
|
|
6417
6417
|
let n = new Date(b.Config.now());
|
|
6418
6418
|
e(S(n.getHours()) + ":" + S(n.getMinutes()) + ":" + S(n.getSeconds()) + "." + S(n.getMilliseconds(), 1) + " " + t);
|
|
@@ -6420,14 +6420,14 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
6420
6420
|
e(t);
|
|
6421
6421
|
};
|
|
6422
6422
|
}
|
|
6423
|
-
var
|
|
6423
|
+
var C = () => {
|
|
6424
6424
|
let e, t;
|
|
6425
6425
|
return typeof x?.console?.log == "function" ? (e = function(...e) {
|
|
6426
6426
|
console.log.apply(console, e);
|
|
6427
6427
|
}, t = console.warn ? function(...e) {
|
|
6428
6428
|
console.warn.apply(console, e);
|
|
6429
|
-
} : e) : e = t = function() {}, [e, t].map(
|
|
6430
|
-
},
|
|
6429
|
+
} : e) : e = t = function() {}, [e, t].map(ee);
|
|
6430
|
+
}, w = class e {
|
|
6431
6431
|
constructor() {
|
|
6432
6432
|
this.deprecated = (e, t) => {
|
|
6433
6433
|
this.deprecationWarning(`${e} is deprecated and will be removed in a future version. ${t}`);
|
|
@@ -6436,7 +6436,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
6436
6436
|
}, this.logLevel = e.defaultLogLevel, this.logHandler = e.defaultLogHandler, this.logErrorHandler = e.defaultLogErrorHandler;
|
|
6437
6437
|
}
|
|
6438
6438
|
static initLogHandlers() {
|
|
6439
|
-
let [t, n] =
|
|
6439
|
+
let [t, n] = C();
|
|
6440
6440
|
this.defaultLogHandler = t, this.defaultLogErrorHandler = n, this.defaultLogger = new e();
|
|
6441
6441
|
}
|
|
6442
6442
|
static logActionNoStrip(e, t, n, r) {
|
|
@@ -6458,11 +6458,11 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
6458
6458
|
this.shouldLog(1) && this.logErrorHandler(`Ably: Deprecation warning - ${e}`, 1);
|
|
6459
6459
|
}
|
|
6460
6460
|
};
|
|
6461
|
-
|
|
6462
|
-
|
|
6461
|
+
w.defaultLogLevel = 1, w.LOG_NONE = 0, w.LOG_ERROR = 1, w.LOG_MAJOR = 2, w.LOG_MINOR = 3, w.LOG_MICRO = 4, w.logAction = (e, t, n, r) => {
|
|
6462
|
+
w.logActionNoStrip(e, t, n, r);
|
|
6463
6463
|
};
|
|
6464
|
-
var
|
|
6465
|
-
m(
|
|
6464
|
+
var T = w, E = {};
|
|
6465
|
+
m(E, {
|
|
6466
6466
|
Format: () => ve,
|
|
6467
6467
|
allSame: () => _e,
|
|
6468
6468
|
allToLowerCase: () => Pe,
|
|
@@ -6513,7 +6513,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
6513
6513
|
whenPromiseSettles: () => je,
|
|
6514
6514
|
withTimeoutAsync: () => Ue
|
|
6515
6515
|
});
|
|
6516
|
-
function
|
|
6516
|
+
function D(e) {
|
|
6517
6517
|
let t = "[" + e.constructor.name;
|
|
6518
6518
|
return e.message && (t += ": " + e.message), e.statusCode && (t += "; statusCode=" + e.statusCode), e.code && (t += "; code=" + e.code), e.cause && (t += "; cause=" + Te(e.cause)), e.remediation && (t += "; remediation=" + e.remediation), e.detail && Object.keys(e.detail).length > 0 && (t += "; detail=" + JSON.stringify(e.detail)), e.href && !(e.message && e.message.indexOf("help.ably.io") > -1) && (t += "; see " + e.href + " "), t += "]", t;
|
|
6519
6519
|
}
|
|
@@ -6529,7 +6529,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
6529
6529
|
} else o(t), Object.setPrototypeOf !== void 0 && Object.setPrototypeOf(this, e.prototype), this.code = n, this.statusCode = r, this.cause = i, this.detail = a;
|
|
6530
6530
|
}
|
|
6531
6531
|
toString() {
|
|
6532
|
-
return
|
|
6532
|
+
return D(this);
|
|
6533
6533
|
}
|
|
6534
6534
|
static fromValues(t) {
|
|
6535
6535
|
let n = new e(t);
|
|
@@ -6547,7 +6547,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
6547
6547
|
} else o(t), Object.setPrototypeOf !== void 0 && Object.setPrototypeOf(this, e.prototype), this.code = n, this.statusCode = r, this.cause = i, this.detail = a;
|
|
6548
6548
|
}
|
|
6549
6549
|
toString() {
|
|
6550
|
-
return
|
|
6550
|
+
return D(this);
|
|
6551
6551
|
}
|
|
6552
6552
|
static fromValues(t) {
|
|
6553
6553
|
let n = new e(t);
|
|
@@ -6923,19 +6923,19 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
6923
6923
|
function it(e, t, n, r, i) {
|
|
6924
6924
|
if (e === void 0) {
|
|
6925
6925
|
let e = t ? `${n} must be initialized with either a client options object, an Ably API key, or an Ably Token` : `${n} must be initialized with a client options object`;
|
|
6926
|
-
throw
|
|
6926
|
+
throw T.logAction(r, T.LOG_ERROR, `${n}()`, e), Error(e);
|
|
6927
6927
|
}
|
|
6928
6928
|
let a;
|
|
6929
6929
|
if (typeof e == "string") if (e.indexOf(":") == -1) {
|
|
6930
6930
|
if (!t) {
|
|
6931
6931
|
let e = `${n} cannot be initialized with just an Ably Token; you must provide a client options object with a \`plugins\` property. (Set this Ably Token as the object\u2019s \`token\` property.)`;
|
|
6932
|
-
throw
|
|
6932
|
+
throw T.logAction(r, T.LOG_ERROR, `${n}()`, e), Error(e);
|
|
6933
6933
|
}
|
|
6934
6934
|
a = { token: e };
|
|
6935
6935
|
} else {
|
|
6936
6936
|
if (!t) {
|
|
6937
6937
|
let e = `${n} cannot be initialized with just an Ably API key; you must provide a client options object with a \`plugins\` property. (Set this Ably API key as the object\u2019s \`key\` property.)`;
|
|
6938
|
-
throw
|
|
6938
|
+
throw T.logAction(r, T.LOG_ERROR, `${n}()`, e), Error(e);
|
|
6939
6939
|
}
|
|
6940
6940
|
a = { key: e };
|
|
6941
6941
|
}
|
|
@@ -6957,8 +6957,8 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
6957
6957
|
});
|
|
6958
6958
|
}
|
|
6959
6959
|
function ot(e, t, n) {
|
|
6960
|
-
let r = n ??
|
|
6961
|
-
e.environment && r.deprecated("The `environment` client option", "Use the `endpoint` client option instead."), e.restHost && r.deprecated("The `restHost` client option", "Use the `endpoint` client option instead."), e.realtimeHost && r.deprecated("The `realtimeHost` client option", "Use the `endpoint` client option instead."), at(e), typeof e.recover == "function" && e.closeOnUnload === !0 && (
|
|
6960
|
+
let r = n ?? T.defaultLogger;
|
|
6961
|
+
e.environment && r.deprecated("The `environment` client option", "Use the `endpoint` client option instead."), e.restHost && r.deprecated("The `restHost` client option", "Use the `endpoint` client option instead."), e.realtimeHost && r.deprecated("The `realtimeHost` client option", "Use the `endpoint` client option instead."), at(e), typeof e.recover == "function" && e.closeOnUnload === !0 && (T.logAction(r, T.LOG_ERROR, "Defaults.normaliseOptions", "closeOnUnload was true and a session recovery function was set - these are mutually exclusive, so unsetting the latter"), e.recover = void 0), "closeOnUnload" in e || (e.closeOnUnload = !e.recover), "queueMessages" in e || (e.queueMessages = !0);
|
|
6962
6962
|
let i = e.endpoint || Ke.ENDPOINT;
|
|
6963
6963
|
!e.fallbackHosts && !e.restHost && !e.realtimeHost && !e.port && !e.tlsPort && (e.fallbackHosts = Ze(e.environment || i));
|
|
6964
6964
|
let a = e.environment && `${e.environment}.realtime.ably.net`, o = e.restHost || e.realtimeHost || a || Xe(i);
|
|
@@ -7030,7 +7030,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7030
7030
|
for (let n of this.members) if (n) try {
|
|
7031
7031
|
n(e, t);
|
|
7032
7032
|
} catch (e) {
|
|
7033
|
-
|
|
7033
|
+
T.logAction(this.logger, T.LOG_ERROR, "Multicaster multiple callback handler", "Unexpected exception: " + e + "; stack = " + e.stack);
|
|
7034
7034
|
}
|
|
7035
7035
|
}
|
|
7036
7036
|
push(...e) {
|
|
@@ -7086,13 +7086,13 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7086
7086
|
return JSON.stringify(t);
|
|
7087
7087
|
}
|
|
7088
7088
|
function Tt(e, t) {
|
|
7089
|
-
if (e.authCallback)
|
|
7090
|
-
else if (e.authUrl)
|
|
7091
|
-
else if (e.key)
|
|
7092
|
-
else if (e.tokenDetails)
|
|
7089
|
+
if (e.authCallback) T.logAction(t, T.LOG_MINOR, "Auth()", "using token auth with authCallback");
|
|
7090
|
+
else if (e.authUrl) T.logAction(t, T.LOG_MINOR, "Auth()", "using token auth with authUrl");
|
|
7091
|
+
else if (e.key) T.logAction(t, T.LOG_MINOR, "Auth()", "using token auth with client-side signing");
|
|
7092
|
+
else if (e.tokenDetails) T.logAction(t, T.LOG_MINOR, "Auth()", "using token auth with supplied token only");
|
|
7093
7093
|
else {
|
|
7094
7094
|
let e = "authOptions must include valid authentication parameters";
|
|
7095
|
-
throw
|
|
7095
|
+
throw T.logAction(t, T.LOG_ERROR, "Auth()", e), new O(e, 40106, 401);
|
|
7096
7096
|
}
|
|
7097
7097
|
}
|
|
7098
7098
|
function L(e) {
|
|
@@ -7110,18 +7110,18 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7110
7110
|
}
|
|
7111
7111
|
var At = class {
|
|
7112
7112
|
constructor(e, t) {
|
|
7113
|
-
if (this.authOptions = {}, this.client = e, this.tokenParams = t.defaultTokenParams || {}, this.currentTokenRequestId = null, this.waitingForTokenRequest = null, Et(t)) Dt(t) &&
|
|
7113
|
+
if (this.authOptions = {}, this.client = e, this.tokenParams = t.defaultTokenParams || {}, this.currentTokenRequestId = null, this.waitingForTokenRequest = null, Et(t)) Dt(t) && T.logAction(this.logger, T.LOG_ERROR, "Auth()", "Warning: library initialized with a token literal without any way to renew the token when it expires (no authUrl, authCallback, or key). See https://help.ably.io/error/40171 for help"), this._saveTokenOptions(t.defaultTokenParams, t), Tt(this.authOptions, this.logger);
|
|
7114
7114
|
else {
|
|
7115
7115
|
if (!t.key) {
|
|
7116
7116
|
let e = "No authentication options provided";
|
|
7117
|
-
throw
|
|
7117
|
+
throw T.logAction(this.logger, T.LOG_ERROR, "Auth()", e), new O({
|
|
7118
7118
|
message: e,
|
|
7119
7119
|
code: 40106,
|
|
7120
7120
|
statusCode: 401,
|
|
7121
7121
|
remediation: "Set one of the following in ClientOptions: key, authUrl, authCallback, token, or tokenDetails. For production use, prefer authUrl or authCallback for client-side (browser, mobile apps), or key for server-side."
|
|
7122
7122
|
});
|
|
7123
7123
|
}
|
|
7124
|
-
|
|
7124
|
+
T.logAction(this.logger, T.LOG_MINOR, "Auth()", "anonymous, using basic auth"), this._saveBasicOptions(t);
|
|
7125
7125
|
}
|
|
7126
7126
|
}
|
|
7127
7127
|
get logger() {
|
|
@@ -7159,16 +7159,16 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7159
7159
|
}
|
|
7160
7160
|
async _requestTokenImpl(e, t) {
|
|
7161
7161
|
let n = t || this.authOptions, r = e || te(this.tokenParams), i, a = this.client;
|
|
7162
|
-
if (n.authCallback)
|
|
7163
|
-
else if (n.authUrl)
|
|
7162
|
+
if (n.authCallback) T.logAction(this.logger, T.LOG_MINOR, "Auth.requestToken()", "using token auth with authCallback"), i = n.authCallback;
|
|
7163
|
+
else if (n.authUrl) T.logAction(this.logger, T.LOG_MINOR, "Auth.requestToken()", "using token auth with authUrl"), i = (e, t) => {
|
|
7164
7164
|
let r = j({ accept: "application/json, text/plain" }, n.authHeaders), i = n.authMethod && n.authMethod.toLowerCase() === "post", a, o = n.authUrl.indexOf("?");
|
|
7165
7165
|
o > -1 && (a = Se(n.authUrl.slice(o)), n.authUrl = n.authUrl.slice(0, o), i || (n.authParams = j(a, n.authParams)));
|
|
7166
7166
|
let s = j({}, n.authParams || {}, e), c = (e) => {
|
|
7167
7167
|
let n = e.body ?? null, r = null;
|
|
7168
|
-
if (e.error)
|
|
7168
|
+
if (e.error) T.logAction(this.logger, T.LOG_MICRO, "Auth.requestToken().tokenRequestCallback", "Received Error: " + Te(e.error));
|
|
7169
7169
|
else {
|
|
7170
7170
|
let t = e.headers["content-type"] ?? null;
|
|
7171
|
-
r = Array.isArray(t) ? t.join(", ") : t,
|
|
7171
|
+
r = Array.isArray(t) ? t.join(", ") : t, T.logAction(this.logger, T.LOG_MICRO, "Auth.requestToken().tokenRequestCallback", "Received; content-type: " + r + "; body: " + Ee(n));
|
|
7172
7172
|
}
|
|
7173
7173
|
if (e.error) {
|
|
7174
7174
|
t(e.error, null);
|
|
@@ -7216,17 +7216,17 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7216
7216
|
}
|
|
7217
7217
|
t(null, n, r);
|
|
7218
7218
|
};
|
|
7219
|
-
if (
|
|
7219
|
+
if (T.logAction(this.logger, T.LOG_MICRO, "Auth.requestToken().tokenRequestCallback", "Requesting token from " + n.authUrl + "; Params: " + JSON.stringify(s) + "; method: " + (i ? "POST" : "GET")), i) {
|
|
7220
7220
|
let e = r || {};
|
|
7221
7221
|
e["content-type"] = "application/x-www-form-urlencoded";
|
|
7222
7222
|
let t = be(s).slice(1);
|
|
7223
7223
|
je(this.client.http.doUri(ht.Post, n.authUrl, e, t, a), (e, t) => c(e || t));
|
|
7224
7224
|
} else je(this.client.http.doUri(ht.Get, n.authUrl, r || {}, null, s), (e, t) => c(e || t));
|
|
7225
7225
|
};
|
|
7226
|
-
else if (n.key)
|
|
7226
|
+
else if (n.key) T.logAction(this.logger, T.LOG_MINOR, "Auth.requestToken()", "using token auth with client-side signing"), i = (e, t) => {
|
|
7227
7227
|
je(this.createTokenRequest(e, n), (e, n) => t(e, n ?? null));
|
|
7228
7228
|
};
|
|
7229
|
-
else throw
|
|
7229
|
+
else throw T.logAction(this.logger, T.LOG_ERROR, "Auth()", "library initialized with a token literal without any way to renew the token when it expires (no authUrl, authCallback, or key). See https://help.ably.io/error/40171 for help"), new O({
|
|
7230
7230
|
message: "Need a new token, but authOptions does not include any way to request one (no authUrl, authCallback, or key)",
|
|
7231
7231
|
code: 40171,
|
|
7232
7232
|
statusCode: 403,
|
|
@@ -7237,13 +7237,13 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7237
7237
|
let r = "/keys/" + e.keyName + "/requestToken", i = function(e) {
|
|
7238
7238
|
return a.baseUri(e) + r;
|
|
7239
7239
|
}, o = I.defaultPostHeaders(this.client.options, { format: "json" });
|
|
7240
|
-
n.requestHeaders && j(o, n.requestHeaders),
|
|
7240
|
+
n.requestHeaders && j(o, n.requestHeaders), T.logAction(this.logger, T.LOG_MICRO, "Auth.requestToken().requestToken", "Sending POST to " + r + "; Token params: " + JSON.stringify(e)), je(this.client.http.do(ht.Post, i, o, JSON.stringify(e), null), (e, n) => e ? t(e) : t(n.error, n.body, n.unpacked));
|
|
7241
7241
|
};
|
|
7242
7242
|
return new Promise((e, t) => {
|
|
7243
7243
|
let a = !1, s = this.client.options.timeouts.realtimeRequestTimeout, c = b.Config.setTimeout(() => {
|
|
7244
7244
|
a = !0;
|
|
7245
7245
|
let e = "Token request via authCallback/authUrl did not complete within the configured timeout (" + s / 1e3 + " seconds)";
|
|
7246
|
-
|
|
7246
|
+
T.logAction(this.logger, T.LOG_ERROR, "Auth.requestToken()", e), t(new O({
|
|
7247
7247
|
message: e,
|
|
7248
7248
|
code: 40170,
|
|
7249
7249
|
statusCode: 401,
|
|
@@ -7253,7 +7253,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7253
7253
|
i(r, (r, i, s) => {
|
|
7254
7254
|
if (a) return;
|
|
7255
7255
|
if (b.Config.clearTimeout(c), r) {
|
|
7256
|
-
|
|
7256
|
+
T.logAction(this.logger, T.LOG_ERROR, "Auth.requestToken()", "token request signing call returned error; err = " + Te(r)), t(St(r));
|
|
7257
7257
|
return;
|
|
7258
7258
|
}
|
|
7259
7259
|
if (typeof i == "string") {
|
|
@@ -7282,7 +7282,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7282
7282
|
}
|
|
7283
7283
|
if (typeof i != "object" || !i) {
|
|
7284
7284
|
let e = "Expected token request callback to call back with a token string or token request/details object, but got a " + typeof i;
|
|
7285
|
-
|
|
7285
|
+
T.logAction(this.logger, T.LOG_ERROR, "Auth.requestToken()", e), t(new O({
|
|
7286
7286
|
message: e,
|
|
7287
7287
|
code: 40170,
|
|
7288
7288
|
statusCode: 401,
|
|
@@ -7306,7 +7306,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7306
7306
|
}
|
|
7307
7307
|
if (!("keyName" in i)) {
|
|
7308
7308
|
let e = "Expected token request callback to call back with a token string, token request object, or token details object. The returned object has neither a keyName nor an issued field.";
|
|
7309
|
-
|
|
7309
|
+
T.logAction(this.logger, T.LOG_ERROR, "Auth.requestToken()", e), t(new O({
|
|
7310
7310
|
message: e,
|
|
7311
7311
|
code: 40170,
|
|
7312
7312
|
statusCode: 401,
|
|
@@ -7316,10 +7316,10 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7316
7316
|
}
|
|
7317
7317
|
o(i, (n, r, i) => {
|
|
7318
7318
|
if (n) {
|
|
7319
|
-
|
|
7319
|
+
T.logAction(this.logger, T.LOG_ERROR, "Auth.requestToken()", "token request API call returned error; err = " + Te(n)), t(St(n));
|
|
7320
7320
|
return;
|
|
7321
7321
|
}
|
|
7322
|
-
i || (r = JSON.parse(r)),
|
|
7322
|
+
i || (r = JSON.parse(r)), T.logAction(this.logger, T.LOG_MINOR, "Auth.getToken()", "token received"), e(r);
|
|
7323
7323
|
});
|
|
7324
7324
|
});
|
|
7325
7325
|
});
|
|
@@ -7353,7 +7353,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7353
7353
|
let o = j({ keyName: i }, e), s = e.clientId || "", c = e.ttl || "", l = e.capability || "";
|
|
7354
7354
|
o.timestamp ||= await this._getTimestamp(t && t.queryTime);
|
|
7355
7355
|
let u = o.nonce ||= bt(), d = o.timestamp, f = o.keyName + "\n" + c + "\n" + l + "\n" + s + "\n" + d + "\n" + u + "\n";
|
|
7356
|
-
return o.mac = o.mac || Ct(f, a),
|
|
7356
|
+
return o.mac = o.mac || Ct(f, a), T.logAction(this.logger, T.LOG_MINOR, "Auth.getTokenRequest()", "generated signed request"), o;
|
|
7357
7357
|
}
|
|
7358
7358
|
async getAuthParams() {
|
|
7359
7359
|
if (this.method == "basic") return { key: this.key };
|
|
@@ -7386,8 +7386,8 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7386
7386
|
statusCode: 403,
|
|
7387
7387
|
remediation: "Issue the token with the same clientId as ClientOptions.clientId, or omit ClientOptions.clientId and let the token define it."
|
|
7388
7388
|
});
|
|
7389
|
-
if (!this.client.isTimeOffsetSet() || !t.expires || t.expires >= this.client.getTimestampUsingOffset()) return
|
|
7390
|
-
|
|
7389
|
+
if (!this.client.isTimeOffsetSet() || !t.expires || t.expires >= this.client.getTimestampUsingOffset()) return T.logAction(this.logger, T.LOG_MINOR, "Auth.getToken()", "using cached token; expires = " + t.expires), t;
|
|
7390
|
+
T.logAction(this.logger, T.LOG_MINOR, "Auth.getToken()", "deleting expired token"), this.tokenDetails = null;
|
|
7391
7391
|
}
|
|
7392
7392
|
let n = (this.waitingForTokenRequest ||= pt.create(this.logger)).createPromise();
|
|
7393
7393
|
if (this.currentTokenRequestId !== null && !e) return n;
|
|
@@ -7397,7 +7397,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7397
7397
|
} catch (e) {
|
|
7398
7398
|
a = e;
|
|
7399
7399
|
}
|
|
7400
|
-
if (this.currentTokenRequestId > r) return
|
|
7400
|
+
if (this.currentTokenRequestId > r) return T.logAction(this.logger, T.LOG_MINOR, "Auth._ensureValidAuthCredentials()", "Discarding token request response; overtaken by newer one"), n;
|
|
7401
7401
|
this.currentTokenRequestId = null;
|
|
7402
7402
|
let o = this.waitingForTokenRequest;
|
|
7403
7403
|
return this.waitingForTokenRequest = null, a ? (o?.rejectAll(a), n) : (o?.resolveAll(this.tokenDetails = i), n);
|
|
@@ -7428,7 +7428,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7428
7428
|
statusCode: 401,
|
|
7429
7429
|
remediation: "Issue the token with the matching clientId, or omit ClientOptions.clientId and let the token define it."
|
|
7430
7430
|
});
|
|
7431
|
-
return
|
|
7431
|
+
return T.logAction(this.logger, T.LOG_ERROR, "Auth._uncheckedSetClientId()", t), n;
|
|
7432
7432
|
}
|
|
7433
7433
|
return this.clientId = this.tokenParams.clientId = e, null;
|
|
7434
7434
|
}
|
|
@@ -7454,17 +7454,17 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7454
7454
|
return e + (t ? "?" : "") + jt(t);
|
|
7455
7455
|
}
|
|
7456
7456
|
function R(e, t, n, r, i) {
|
|
7457
|
-
e.error ?
|
|
7457
|
+
e.error ? T.logActionNoStrip(i, T.LOG_MICRO, "Http." + t + "()", "Received Error; " + Mt(n, r) + "; Error: " + Te(e.error)) : T.logActionNoStrip(i, T.LOG_MICRO, "Http." + t + "()", "Received; " + Mt(n, r) + "; Headers: " + jt(e.headers) + "; StatusCode: " + e.statusCode + "; Body" + (b.BufferUtils.isBuffer(e.body) ? " (Base64): " + b.BufferUtils.base64Encode(e.body) : ": " + e.body));
|
|
7458
7458
|
}
|
|
7459
7459
|
function Nt(e, t, n, r, i) {
|
|
7460
|
-
i.shouldLog(
|
|
7460
|
+
i.shouldLog(T.LOG_MICRO) && T.logActionNoStrip(i, T.LOG_MICRO, "Http." + e + "()", "Sending; " + Mt(t, r) + "; Body" + (b.BufferUtils.isBuffer(n) ? " (Base64): " + b.BufferUtils.base64Encode(n) : ": " + n));
|
|
7461
7461
|
}
|
|
7462
7462
|
var Pt = class {
|
|
7463
7463
|
constructor(e) {
|
|
7464
7464
|
this.client = e, this.platformHttp = new b.Http(e), this.checkConnectivity = this.platformHttp.checkConnectivity ? () => this.platformHttp.checkConnectivity() : void 0;
|
|
7465
7465
|
}
|
|
7466
7466
|
get logger() {
|
|
7467
|
-
return this.client?.logger ??
|
|
7467
|
+
return this.client?.logger ?? T.defaultLogger;
|
|
7468
7468
|
}
|
|
7469
7469
|
get supportsAuthHeaders() {
|
|
7470
7470
|
return this.platformHttp.supportsAuthHeaders;
|
|
@@ -7507,7 +7507,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7507
7507
|
try {
|
|
7508
7508
|
Nt(e, t, r, i, this.logger);
|
|
7509
7509
|
let a = await this.platformHttp.doUri(e, t, n, r, i);
|
|
7510
|
-
return this.logger.shouldLog(
|
|
7510
|
+
return this.logger.shouldLog(T.LOG_MICRO) && R(a, e, t, i, this.logger), a;
|
|
7511
7511
|
} catch (e) {
|
|
7512
7512
|
return { error: new O(`Unexpected error in Http.doUri: ${Te(e)}`, 500, 5e4) };
|
|
7513
7513
|
}
|
|
@@ -7517,7 +7517,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7517
7517
|
try {
|
|
7518
7518
|
n.apply(t, r);
|
|
7519
7519
|
} catch (t) {
|
|
7520
|
-
|
|
7520
|
+
T.logAction(e, T.LOG_ERROR, "EventEmitter.emit()", "Unexpected listener exception: " + t + "; stack = " + (t && t.stack));
|
|
7521
7521
|
}
|
|
7522
7522
|
}
|
|
7523
7523
|
function It(e, t, n) {
|
|
@@ -7875,13 +7875,13 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7875
7875
|
}
|
|
7876
7876
|
var H = class {}, $t = class {
|
|
7877
7877
|
constructor(e) {
|
|
7878
|
-
this.Platform = b, this.ErrorInfo = O, this.Logger =
|
|
7878
|
+
this.Platform = b, this.ErrorInfo = O, this.Logger = T, this.Defaults = I, this.Utils = E, this.EventEmitter = Lt, this.MessageEncoding = Zt, this._additionalHTTPRequestImplementations = e.plugins ?? null, this.logger = new T(), this.logger.setLog(e.logLevel, e.logHandler), T.logAction(this.logger, T.LOG_MICRO, "BaseClient()", "initialized with clientOptions " + b.Config.inspect(e)), this._MsgPack = e.plugins?.MsgPack ?? null;
|
|
7879
7879
|
let t = this.options = I.normaliseOptions(e, this._MsgPack, this.logger);
|
|
7880
7880
|
if (t.key) {
|
|
7881
7881
|
let e = t.key.match(/^([^:\s]+):([^:.\s]+)$/);
|
|
7882
7882
|
if (!e) {
|
|
7883
7883
|
let e = "invalid key parameter";
|
|
7884
|
-
throw
|
|
7884
|
+
throw T.logAction(this.logger, T.LOG_ERROR, "BaseClient()", e), new O({
|
|
7885
7885
|
message: e,
|
|
7886
7886
|
code: 40400,
|
|
7887
7887
|
statusCode: 404,
|
|
@@ -7904,7 +7904,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
7904
7904
|
remediation: "ClientOptions.clientId sets one fixed identity and cannot be \"*\". To let this client act as any clientId, request a wildcard token instead: set defaultTokenParams: { clientId: \"*\" } on the client. The \"*\" belongs in the token request, not in ClientOptions.clientId."
|
|
7905
7905
|
});
|
|
7906
7906
|
}
|
|
7907
|
-
|
|
7907
|
+
T.logAction(this.logger, T.LOG_MINOR, "BaseClient()", "started; version = " + I.version), this._currentFallback = null, this.serverTimeOffset = null, this.http = new Pt(this), this.auth = new At(this, t), this._rest = e.plugins?.Rest ? new e.plugins.Rest(this) : null, this._Crypto = e.plugins?.Crypto ?? null, this.__FilteredSubscriptions = e.plugins?.MessageInteractions ?? null, this._Annotations = e.plugins?.Annotations ?? null, this._liveObjectsPlugin = e.plugins?.LiveObjects ?? null;
|
|
7908
7908
|
}
|
|
7909
7909
|
get rest() {
|
|
7910
7910
|
return this._rest || He("Rest"), this._rest;
|
|
@@ -8055,7 +8055,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
8055
8055
|
};
|
|
8056
8056
|
}
|
|
8057
8057
|
function an(e, t, n, r, i) {
|
|
8058
|
-
e.err ?
|
|
8058
|
+
e.err ? T.logAction(i, T.LOG_MICRO, "Resource." + t + "()", "Received Error; " + Mt(n, r) + "; Error: " + Te(e.err)) : T.logAction(i, T.LOG_MICRO, "Resource." + t + "()", "Received; " + Mt(n, r) + "; Headers: " + jt(e.headers) + "; StatusCode: " + e.statusCode + "; Body: " + (b.BufferUtils.isBuffer(e.body) ? " (Base64): " + b.BufferUtils.base64Encode(e.body) : ": " + b.Config.inspect(e.body)));
|
|
8059
8059
|
}
|
|
8060
8060
|
var on = class e {
|
|
8061
8061
|
static async get(t, n, r, i, a, o) {
|
|
@@ -8077,14 +8077,14 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
8077
8077
|
o && ((a ||= {}).envelope = o);
|
|
8078
8078
|
let c = t.logger;
|
|
8079
8079
|
async function l(i, a) {
|
|
8080
|
-
if (c.shouldLog(
|
|
8080
|
+
if (c.shouldLog(T.LOG_MICRO)) {
|
|
8081
8081
|
let o = r;
|
|
8082
8082
|
if (i["content-type"]?.indexOf("msgpack") > 0) try {
|
|
8083
8083
|
t._MsgPack || He("MsgPack"), o = t._MsgPack.decode(r);
|
|
8084
8084
|
} catch (t) {
|
|
8085
|
-
|
|
8085
|
+
T.logAction(c, T.LOG_MICRO, "Resource." + e + "()", "Sending MsgPack Decoding Error: " + Te(t));
|
|
8086
8086
|
}
|
|
8087
|
-
|
|
8087
|
+
T.logAction(c, T.LOG_MICRO, "Resource." + e + "()", "Sending; " + Mt(n, a) + "; Body: " + o);
|
|
8088
8088
|
}
|
|
8089
8089
|
let o = await t.http.do(e, n, i, r, a);
|
|
8090
8090
|
return o.error && At.isTokenErr(o.error) ? (await t.auth.authorize(null, null), nn(t, i, a, l)) : {
|
|
@@ -8096,7 +8096,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
8096
8096
|
};
|
|
8097
8097
|
}
|
|
8098
8098
|
let u = await nn(t, i, a, l);
|
|
8099
|
-
if (o && (u = rn(u, t._MsgPack, o)), c.shouldLog(
|
|
8099
|
+
if (o && (u = rn(u, t._MsgPack, o)), c.shouldLog(T.LOG_MICRO) && an(u, e, n, a, c), s) {
|
|
8100
8100
|
if (u.err) throw u.err;
|
|
8101
8101
|
{
|
|
8102
8102
|
let e = d({}, u);
|
|
@@ -8153,7 +8153,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
8153
8153
|
return this.handlePage(n);
|
|
8154
8154
|
}
|
|
8155
8155
|
async handlePage(e) {
|
|
8156
|
-
if (e.err && ln(e.err, e.body, this.useHttpPaginatedResponse)) throw
|
|
8156
|
+
if (e.err && ln(e.err, e.body, this.useHttpPaginatedResponse)) throw T.logAction(this.logger, T.LOG_ERROR, "PaginatedResource.handlePage()", "Unexpected error getting resource: err = " + Te(e.err)), e.err;
|
|
8157
8157
|
let t, n, r;
|
|
8158
8158
|
try {
|
|
8159
8159
|
t = e.statusCode == vt.NoContent ? [] : await this.bodyHandler(e.body, e.headers || {}, e.unpacked);
|
|
@@ -8520,7 +8520,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
8520
8520
|
try {
|
|
8521
8521
|
await qt(n, e);
|
|
8522
8522
|
} catch (e) {
|
|
8523
|
-
|
|
8523
|
+
T.logAction(t, T.LOG_ERROR, "WirePresenceMessage.decode()", Te(e));
|
|
8524
8524
|
}
|
|
8525
8525
|
return n;
|
|
8526
8526
|
}
|
|
@@ -8535,12 +8535,12 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
8535
8535
|
return this.channel.logger;
|
|
8536
8536
|
}
|
|
8537
8537
|
async get(e) {
|
|
8538
|
-
|
|
8538
|
+
T.logAction(this.logger, T.LOG_MICRO, "RestPresence.get()", "channel = " + this.channel.name);
|
|
8539
8539
|
let t = this.channel.client, n = t.options.useBinaryProtocol ? "msgpack" : "json", r = this.channel.client.http.supportsLinkHeaders ? void 0 : n, i = I.defaultGetHeaders(t.options);
|
|
8540
8540
|
return j(i, t.options.headers), new pn(t, this.channel.client.rest.presenceMixin.basePath(this), i, r, async (e, r, i) => Dn(i ? e : Me(e, t._MsgPack, n), this.channel)).get(e);
|
|
8541
8541
|
}
|
|
8542
8542
|
async history(e) {
|
|
8543
|
-
return
|
|
8543
|
+
return T.logAction(this.logger, T.LOG_MICRO, "RestPresence.history()", "channel = " + this.channel.name), this.channel.client.rest.presenceMixin.history(this, e);
|
|
8544
8544
|
}
|
|
8545
8545
|
}, jn = [
|
|
8546
8546
|
"message.create",
|
|
@@ -8615,7 +8615,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
8615
8615
|
try {
|
|
8616
8616
|
await qt(n, e);
|
|
8617
8617
|
} catch (e) {
|
|
8618
|
-
|
|
8618
|
+
T.logAction(t, T.LOG_ERROR, "WireMessage.decode()", Te(e)), r = e;
|
|
8619
8619
|
}
|
|
8620
8620
|
return n.expandFields(), {
|
|
8621
8621
|
decoded: n,
|
|
@@ -8637,7 +8637,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
8637
8637
|
}
|
|
8638
8638
|
var Kn = class {
|
|
8639
8639
|
constructor(e, t, n) {
|
|
8640
|
-
this._annotations = null,
|
|
8640
|
+
this._annotations = null, T.logAction(e.logger, T.LOG_MINOR, "RestChannel()", "started; name = " + t), this.name = t, this.client = e, this.presence = new G(this), this.channelOptions = st(e._Crypto ?? null, this.logger, n), e.options.plugins?.Push && (this._push = new e.options.plugins.Push.PushChannel(this)), e._Annotations && (this._annotations = new e._Annotations.RestAnnotations(this)), e._liveObjectsPlugin && (this._object = new e._liveObjectsPlugin.RestObject(this));
|
|
8641
8641
|
}
|
|
8642
8642
|
get annotations() {
|
|
8643
8643
|
return this._annotations || He("Annotations"), this._annotations;
|
|
@@ -8655,7 +8655,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
8655
8655
|
this.channelOptions = st(this.client._Crypto ?? null, this.logger, e);
|
|
8656
8656
|
}
|
|
8657
8657
|
async history(e) {
|
|
8658
|
-
return
|
|
8658
|
+
return T.logAction(this.logger, T.LOG_MICRO, "RestChannel.history()", "channel = " + this.name), this.client.rest.channelMixin.history(this, e ?? null);
|
|
8659
8659
|
}
|
|
8660
8660
|
async publish(...e) {
|
|
8661
8661
|
let t = e[0], n = e[1], r, i;
|
|
@@ -8696,19 +8696,19 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
8696
8696
|
return this.client.rest.channelMixin.status(this);
|
|
8697
8697
|
}
|
|
8698
8698
|
async getMessage(e) {
|
|
8699
|
-
return
|
|
8699
|
+
return T.logAction(this.logger, T.LOG_MICRO, "RestChannel.getMessage()", "channel = " + this.name), this.client.rest.channelMixin.getMessage(this, e);
|
|
8700
8700
|
}
|
|
8701
8701
|
async updateMessage(e, t, n) {
|
|
8702
|
-
return
|
|
8702
|
+
return T.logAction(this.logger, T.LOG_MICRO, "RestChannel.updateMessage()", "channel = " + this.name), this.client.rest.channelMixin.updateDeleteMessage(this, "message.update", e, t, n);
|
|
8703
8703
|
}
|
|
8704
8704
|
async deleteMessage(e, t, n) {
|
|
8705
|
-
return
|
|
8705
|
+
return T.logAction(this.logger, T.LOG_MICRO, "RestChannel.deleteMessage()", "channel = " + this.name), this.client.rest.channelMixin.updateDeleteMessage(this, "message.delete", e, t, n);
|
|
8706
8706
|
}
|
|
8707
8707
|
async appendMessage(e, t, n) {
|
|
8708
|
-
return
|
|
8708
|
+
return T.logAction(this.logger, T.LOG_MICRO, "RestChannel.appendMessage()", "channel = " + this.name), this.client.rest.channelMixin.updateDeleteMessage(this, "message.append", e, t, n);
|
|
8709
8709
|
}
|
|
8710
8710
|
async getMessageVersions(e, t) {
|
|
8711
|
-
return
|
|
8711
|
+
return T.logAction(this.logger, T.LOG_MICRO, "RestChannel.getMessageVersions()", "channel = " + this.name), this.client.rest.channelMixin.getMessageVersions(this, e, t);
|
|
8712
8712
|
}
|
|
8713
8713
|
}, qn = class e {
|
|
8714
8714
|
constructor(e) {
|
|
@@ -8869,24 +8869,24 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
8869
8869
|
}
|
|
8870
8870
|
}, Xn = class extends en {
|
|
8871
8871
|
constructor(e) {
|
|
8872
|
-
super(I.objectifyOptions(e, !1, "BaseRest",
|
|
8872
|
+
super(I.objectifyOptions(e, !1, "BaseRest", T.defaultLogger, { Rest: Yn }));
|
|
8873
8873
|
}
|
|
8874
8874
|
}, Zn = { Rest: Yn }, Qn = class extends Un {
|
|
8875
8875
|
static async fromEncoded(e, t) {
|
|
8876
|
-
return Pn(
|
|
8876
|
+
return Pn(T.defaultLogger, b.Crypto, e, t);
|
|
8877
8877
|
}
|
|
8878
8878
|
static async fromEncodedArray(e, t) {
|
|
8879
|
-
return Fn(
|
|
8879
|
+
return Fn(T.defaultLogger, b.Crypto, e, t);
|
|
8880
8880
|
}
|
|
8881
8881
|
static fromValues(e) {
|
|
8882
8882
|
return Un.fromValues(e);
|
|
8883
8883
|
}
|
|
8884
8884
|
}, $n = class extends An {
|
|
8885
8885
|
static async fromEncoded(e, t) {
|
|
8886
|
-
return wn(
|
|
8886
|
+
return wn(T.defaultLogger, b.Crypto, e, t);
|
|
8887
8887
|
}
|
|
8888
8888
|
static async fromEncodedArray(e, t) {
|
|
8889
|
-
return Tn(
|
|
8889
|
+
return Tn(T.defaultLogger, b.Crypto, e, t);
|
|
8890
8890
|
}
|
|
8891
8891
|
static fromValues(e) {
|
|
8892
8892
|
return An.fromValues(e);
|
|
@@ -8936,7 +8936,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
8936
8936
|
try {
|
|
8937
8937
|
await qt(n, e);
|
|
8938
8938
|
} catch (e) {
|
|
8939
|
-
|
|
8939
|
+
T.logAction(t, T.LOG_ERROR, "WireAnnotation.decode()", Te(e));
|
|
8940
8940
|
}
|
|
8941
8941
|
return n;
|
|
8942
8942
|
}
|
|
@@ -8945,10 +8945,10 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
8945
8945
|
}
|
|
8946
8946
|
}, sr = ar, cr = class extends sr {
|
|
8947
8947
|
static async fromEncoded(e, t) {
|
|
8948
|
-
return tr(
|
|
8948
|
+
return tr(T.defaultLogger, e, t);
|
|
8949
8949
|
}
|
|
8950
8950
|
static async fromEncodedArray(e, t) {
|
|
8951
|
-
return nr(
|
|
8951
|
+
return nr(T.defaultLogger, e, t);
|
|
8952
8952
|
}
|
|
8953
8953
|
static fromValues(e) {
|
|
8954
8954
|
return sr.fromValues(e);
|
|
@@ -9020,7 +9020,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9020
9020
|
let s;
|
|
9021
9021
|
n && e.annotations && (s = n.WireAnnotation.fromValuesArray(e.annotations));
|
|
9022
9022
|
let c;
|
|
9023
|
-
return r && e.state && (c = r.WireObjectMessage.fromValuesArray(e.state,
|
|
9023
|
+
return r && e.state && (c = r.WireObjectMessage.fromValuesArray(e.state, E, Zt)), Object.assign(new yr(), f(d({}, e), {
|
|
9024
9024
|
presence: o,
|
|
9025
9025
|
messages: a,
|
|
9026
9026
|
annotations: s,
|
|
@@ -9055,7 +9055,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9055
9055
|
"timestamp"
|
|
9056
9056
|
], o;
|
|
9057
9057
|
for (let t = 0; t < a.length; t++) o = a[t], e[o] !== void 0 && (i += "; " + o + "=" + e[o]);
|
|
9058
|
-
if (e.messages && (i += "; messages=" + mr(Hn.fromValuesArray(e.messages))), e.presence && t && (i += "; presence=" + mr(t.WirePresenceMessage.fromValuesArray(e.presence))), e.annotations && n && (i += "; annotations=" + mr(n.WireAnnotation.fromValuesArray(e.annotations))), e.state && r && (i += "; state=" + mr(r.WireObjectMessage.fromValuesArray(e.state,
|
|
9058
|
+
if (e.messages && (i += "; messages=" + mr(Hn.fromValuesArray(e.messages))), e.presence && t && (i += "; presence=" + mr(t.WirePresenceMessage.fromValuesArray(e.presence))), e.annotations && n && (i += "; annotations=" + mr(n.WireAnnotation.fromValuesArray(e.annotations))), e.state && r && (i += "; state=" + mr(r.WireObjectMessage.fromValuesArray(e.state, E, Zt))), e.error && (i += "; error=" + O.fromValues(e.error).toString()), e.auth && e.auth.accessToken && (i += "; token=" + e.auth.accessToken), e.flags && (i += "; flags=" + Bt.filter(e.hasFlag).join(",")), e.params) {
|
|
9059
9059
|
let t = "";
|
|
9060
9060
|
ge(e.params, function(n) {
|
|
9061
9061
|
t.length > 0 && (t += "; "), t += n + "=" + e.params[n];
|
|
@@ -9117,7 +9117,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9117
9117
|
super(e.logger), this._annotations = null, this._mode = 0, this._silentSubscribeWarned = !1, this.retryCount = 0, this.history = function(...e) {
|
|
9118
9118
|
return we(e, 0), this._historyImpl(e[0]);
|
|
9119
9119
|
}, this._historyImpl = async function(e) {
|
|
9120
|
-
|
|
9120
|
+
T.logAction(this.logger, T.LOG_MICRO, "RealtimeChannel.history()", "channel = " + this.name);
|
|
9121
9121
|
let t = this.client.rest.channelMixin;
|
|
9122
9122
|
if (e && e.untilAttach) {
|
|
9123
9123
|
if (this.state !== "attached") throw new O({
|
|
@@ -9135,7 +9135,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9135
9135
|
delete e.untilAttach, e.from_serial = this.properties.attachSerial;
|
|
9136
9136
|
}
|
|
9137
9137
|
return t.history(this, e);
|
|
9138
|
-
}, this.whenState = (e) => Lt.prototype.whenState.call(this, e, this.state),
|
|
9138
|
+
}, this.whenState = (e) => Lt.prototype.whenState.call(this, e, this.state), T.logAction(this.logger, T.LOG_MINOR, "RealtimeChannel()", "started; name = " + t), this.name = t, this.channelOptions = st(e._Crypto ?? null, this.logger, n), this.client = e, this._presence = e._RealtimePresence ? new e._RealtimePresence.RealtimePresence(this) : null, e._Annotations && (this._annotations = new e._Annotations.RealtimeAnnotations(this)), this.connectionManager = e.connection.connectionManager, this.state = "initialized", this.subscriptions = new Lt(this.logger), this.syncChannelSerial = void 0, this.properties = {
|
|
9139
9139
|
attachSerial: void 0,
|
|
9140
9140
|
channelSerial: void 0
|
|
9141
9141
|
}, this.setOptions(n), this.errorReason = null, this._attachResume = !1, this._decodingContext = {
|
|
@@ -9221,7 +9221,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9221
9221
|
statusCode: 400,
|
|
9222
9222
|
remediation: "Split the publish into multiple calls so each batch is under the limit. If a single message exceeds the limit, reduce its payload size. To lift the account limit, contact Ably support."
|
|
9223
9223
|
});
|
|
9224
|
-
this.throwIfUnpublishableState(),
|
|
9224
|
+
this.throwIfUnpublishableState(), T.logAction(this.logger, T.LOG_MICRO, "RealtimeChannel.publish()", "sending message; channel state is " + this.state + ", message count = " + o.length);
|
|
9225
9225
|
let c = _r({
|
|
9226
9226
|
action: z.MESSAGE,
|
|
9227
9227
|
channel: this.name,
|
|
@@ -9235,7 +9235,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9235
9235
|
if (this.state === "failed" || this.state === "suspended") throw this.invalidStateError();
|
|
9236
9236
|
}
|
|
9237
9237
|
onEvent(e) {
|
|
9238
|
-
|
|
9238
|
+
T.logAction(this.logger, T.LOG_MICRO, "RealtimeChannel.onEvent()", "received message");
|
|
9239
9239
|
let t = this.subscriptions;
|
|
9240
9240
|
for (let n = 0; n < e.length; n++) {
|
|
9241
9241
|
let r = e[n];
|
|
@@ -9249,7 +9249,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9249
9249
|
}
|
|
9250
9250
|
_attach(e, t, n) {
|
|
9251
9251
|
n ||= (e) => {
|
|
9252
|
-
e &&
|
|
9252
|
+
e && T.logAction(this.logger, T.LOG_ERROR, "RealtimeChannel._attach()", "Channel attach failed: " + e.toString());
|
|
9253
9253
|
};
|
|
9254
9254
|
let r = this.connectionManager;
|
|
9255
9255
|
if (!r.activeState()) {
|
|
@@ -9271,7 +9271,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9271
9271
|
});
|
|
9272
9272
|
}
|
|
9273
9273
|
attachImpl() {
|
|
9274
|
-
|
|
9274
|
+
T.logAction(this.logger, T.LOG_MICRO, "RealtimeChannel.attachImpl()", "sending ATTACH message");
|
|
9275
9275
|
let e = _r({
|
|
9276
9276
|
action: z.ATTACH,
|
|
9277
9277
|
channel: this.name,
|
|
@@ -9317,7 +9317,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9317
9317
|
}
|
|
9318
9318
|
}
|
|
9319
9319
|
detachImpl() {
|
|
9320
|
-
|
|
9320
|
+
T.logAction(this.logger, T.LOG_MICRO, "RealtimeChannel.detach()", "sending DETACH message");
|
|
9321
9321
|
let e = _r({
|
|
9322
9322
|
action: z.DETACH,
|
|
9323
9323
|
channel: this.name
|
|
@@ -9340,7 +9340,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9340
9340
|
remediation: "Include \"subscribe\" in the channel modes: realtime.channels.get(name, { modes: [\"subscribe\", ...] }), or call channel.setOptions({ modes: [...] }) on an existing channel to trigger a reattach. Alternatively, omit modes entirely and ensure your token/API-key capability permits subscribe on this channel. If you have the Ably CLI installed, `ably auth keys list` shows your key's capabilities."
|
|
9341
9341
|
});
|
|
9342
9342
|
if (this.client.options.strictMode === !0) throw e;
|
|
9343
|
-
this._silentSubscribeWarned ||= (
|
|
9343
|
+
this._silentSubscribeWarned ||= (T.logActionNoStrip(this.logger, T.LOG_ERROR, "RealtimeChannel.subscribe()", e.message + "; remediation=" + e.remediation + T.silentFailureLogSuffix()), !0);
|
|
9344
9344
|
}
|
|
9345
9345
|
return i;
|
|
9346
9346
|
}
|
|
@@ -9444,14 +9444,14 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9444
9444
|
}
|
|
9445
9445
|
case z.MESSAGE: {
|
|
9446
9446
|
if (this.state !== "attached") {
|
|
9447
|
-
|
|
9447
|
+
T.logAction(this.logger, T.LOG_MAJOR, "RealtimeChannel.processMessage()", "Message \"" + e.id + "\" skipped as this channel \"" + this.name + "\" state is not \"attached\" (state is \"" + this.state + "\").");
|
|
9448
9448
|
return;
|
|
9449
9449
|
}
|
|
9450
9450
|
V(e);
|
|
9451
9451
|
let t = e.messages, n = t[0], r = t[t.length - 1];
|
|
9452
9452
|
if (n.extras && n.extras.delta && n.extras.delta.from !== this._lastPayload.messageId) {
|
|
9453
9453
|
let t = "Delta message decode failure - previous message not available for message \"" + e.id + "\" on this channel \"" + this.name + "\".";
|
|
9454
|
-
|
|
9454
|
+
T.logAction(this.logger, T.LOG_ERROR, "RealtimeChannel.processMessage()", t), this._startDecodeFailureRecovery(new O(t, 40018, 400));
|
|
9455
9455
|
break;
|
|
9456
9456
|
}
|
|
9457
9457
|
let i = [];
|
|
@@ -9484,36 +9484,36 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9484
9484
|
t && t.code == 80016 ? this.checkPendingState() : this.notifyState("failed", O.fromValues(t));
|
|
9485
9485
|
break;
|
|
9486
9486
|
}
|
|
9487
|
-
default:
|
|
9487
|
+
default: T.logAction(this.logger, T.LOG_MAJOR, "RealtimeChannel.processMessage()", "Protocol error: unrecognised message action (" + e.action + ")");
|
|
9488
9488
|
}
|
|
9489
9489
|
}
|
|
9490
9490
|
_startDecodeFailureRecovery(e) {
|
|
9491
|
-
this._lastPayload.decodeFailureRecoveryInProgress || (
|
|
9491
|
+
this._lastPayload.decodeFailureRecoveryInProgress || (T.logAction(this.logger, T.LOG_MAJOR, "RealtimeChannel.processMessage()", "Starting decode failure recovery process."), this._lastPayload.decodeFailureRecoveryInProgress = !0, this._attach(!0, e, () => {
|
|
9492
9492
|
this._lastPayload.decodeFailureRecoveryInProgress = !1;
|
|
9493
9493
|
}));
|
|
9494
9494
|
}
|
|
9495
9495
|
onAttached() {
|
|
9496
|
-
|
|
9496
|
+
T.logAction(this.logger, T.LOG_MINOR, "RealtimeChannel.onAttached", "activating channel; name = " + this.name);
|
|
9497
9497
|
}
|
|
9498
9498
|
notifyState(e, t, n, r, i, a) {
|
|
9499
|
-
if (
|
|
9499
|
+
if (T.logAction(this.logger, T.LOG_MICRO, "RealtimeChannel.notifyState", "name = " + this.name + ", current state = " + this.state + ", notifying state " + e), this.clearStateTimer(), [
|
|
9500
9500
|
"detached",
|
|
9501
9501
|
"suspended",
|
|
9502
9502
|
"failed"
|
|
9503
9503
|
].includes(e) && (this.properties.channelSerial = null), e === this.state) return;
|
|
9504
9504
|
this._presence && this._presence.actOnChannelState(e, r, t), this._object && this._object.actOnChannelState(e, a), e === "suspended" && this.connectionManager.state.sendEvents ? this.startRetryTimer() : this.cancelRetryTimer(), t && (this.errorReason = t);
|
|
9505
9505
|
let o = new xr(this.state, e, n, i, t), s = "Channel state for channel \"" + this.name + "\"", c = e + (t ? "; reason: " + t : "");
|
|
9506
|
-
e === "failed" ?
|
|
9506
|
+
e === "failed" ? T.logAction(this.logger, T.LOG_ERROR, s, c) : T.logAction(this.logger, T.LOG_MAJOR, s, c), e !== "attaching" && e !== "suspended" && (this.retryCount = 0), e === "attached" && this.onAttached(), e === "attached" ? this._attachResume = !0 : (e === "detaching" || e === "failed") && (this._attachResume = !1), this.state = e, this.emit(e, o);
|
|
9507
9507
|
}
|
|
9508
9508
|
requestState(e, t) {
|
|
9509
|
-
|
|
9509
|
+
T.logAction(this.logger, T.LOG_MINOR, "RealtimeChannel.requestState", "name = " + this.name + ", state = " + e), this.notifyState(e, t), this.checkPendingState();
|
|
9510
9510
|
}
|
|
9511
9511
|
checkPendingState() {
|
|
9512
9512
|
if (!this.connectionManager.state.sendEvents) {
|
|
9513
|
-
|
|
9513
|
+
T.logAction(this.logger, T.LOG_MINOR, "RealtimeChannel.checkPendingState", "sendEvents is false; state is " + this.connectionManager.state.state);
|
|
9514
9514
|
return;
|
|
9515
9515
|
}
|
|
9516
|
-
switch (
|
|
9516
|
+
switch (T.logAction(this.logger, T.LOG_MINOR, "RealtimeChannel.checkPendingState", "name = " + this.name + ", state = " + this.state), this.state) {
|
|
9517
9517
|
case "attaching":
|
|
9518
9518
|
this.startStateTimerIfNotRunning(), this.attachImpl();
|
|
9519
9519
|
break;
|
|
@@ -9550,7 +9550,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9550
9550
|
}
|
|
9551
9551
|
startStateTimerIfNotRunning() {
|
|
9552
9552
|
this.stateTimer ||= b.Config.setTimeout(() => {
|
|
9553
|
-
|
|
9553
|
+
T.logAction(this.logger, T.LOG_MINOR, "RealtimeChannel.startStateTimerIfNotRunning", "timer expired"), this.stateTimer = null, this.timeoutPendingState();
|
|
9554
9554
|
}, this.client.options.timeouts.realtimeRequestTimeout);
|
|
9555
9555
|
}
|
|
9556
9556
|
clearStateTimer() {
|
|
@@ -9562,7 +9562,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9562
9562
|
this.retryCount++;
|
|
9563
9563
|
let e = N(this.client.options.timeouts.channelRetryTimeout, this.retryCount);
|
|
9564
9564
|
this.retryTimer = b.Config.setTimeout(() => {
|
|
9565
|
-
this.state === "suspended" && this.connectionManager.state.sendEvents && (this.retryTimer = null,
|
|
9565
|
+
this.state === "suspended" && this.connectionManager.state.sendEvents && (this.retryTimer = null, T.logAction(this.logger, T.LOG_MINOR, "RealtimeChannel retry timer expired", "attempting a new attach"), this.requestState("attaching"));
|
|
9566
9566
|
}, e);
|
|
9567
9567
|
}
|
|
9568
9568
|
cancelRetryTimer() {
|
|
@@ -9578,22 +9578,22 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9578
9578
|
});
|
|
9579
9579
|
}
|
|
9580
9580
|
setChannelSerial(e) {
|
|
9581
|
-
|
|
9581
|
+
T.logAction(this.logger, T.LOG_MICRO, "RealtimeChannel.setChannelSerial()", "Updating channel serial; serial = " + e + "; previous = " + this.properties.channelSerial), e && (this.properties.channelSerial = e);
|
|
9582
9582
|
}
|
|
9583
9583
|
async status() {
|
|
9584
9584
|
return this.client.rest.channelMixin.status(this);
|
|
9585
9585
|
}
|
|
9586
9586
|
async getMessage(e) {
|
|
9587
|
-
return
|
|
9587
|
+
return T.logAction(this.logger, T.LOG_MICRO, "RealtimeChannel.getMessage()", "channel = " + this.name), this.client.rest.channelMixin.getMessage(this, e);
|
|
9588
9588
|
}
|
|
9589
9589
|
async updateMessage(e, t, n) {
|
|
9590
|
-
return
|
|
9590
|
+
return T.logAction(this.logger, T.LOG_MICRO, "RealtimeChannel.updateMessage()", "channel = " + this.name), this.sendUpdate(e, "message.update", t, n);
|
|
9591
9591
|
}
|
|
9592
9592
|
async deleteMessage(e, t, n) {
|
|
9593
|
-
return
|
|
9593
|
+
return T.logAction(this.logger, T.LOG_MICRO, "RealtimeChannel.deleteMessage()", "channel = " + this.name), this.sendUpdate(e, "message.delete", t, n);
|
|
9594
9594
|
}
|
|
9595
9595
|
async appendMessage(e, t, n) {
|
|
9596
|
-
return
|
|
9596
|
+
return T.logAction(this.logger, T.LOG_MICRO, "RealtimeChannel.appendMessage()", "channel = " + this.name), this.sendUpdate(e, "message.append", t, n);
|
|
9597
9597
|
}
|
|
9598
9598
|
async sendUpdate(e, t, n, r) {
|
|
9599
9599
|
if (!e.serial) throw new O({
|
|
@@ -9615,7 +9615,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9615
9615
|
return { versionSerial: (await this.sendAndAwaitAck(a)).serials[0] ?? null };
|
|
9616
9616
|
}
|
|
9617
9617
|
async getMessageVersions(e, t) {
|
|
9618
|
-
return
|
|
9618
|
+
return T.logAction(this.logger, T.LOG_MICRO, "RealtimeChannel.getMessageVersions()", "channel = " + this.name), this.client.rest.channelMixin.getMessageVersions(this, e, t);
|
|
9619
9619
|
}
|
|
9620
9620
|
async ensureAttached() {
|
|
9621
9621
|
switch (this.state) {
|
|
@@ -9641,7 +9641,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9641
9641
|
}
|
|
9642
9642
|
async publish(e, t) {
|
|
9643
9643
|
let n = this.channel.name, r = ur(e, t), i = await r.encode();
|
|
9644
|
-
this.channel.throwIfUnpublishableState(),
|
|
9644
|
+
this.channel.throwIfUnpublishableState(), T.logAction(this.logger, T.LOG_MICRO, "RealtimeAnnotations.publish()", "channelName = " + n + ", sending annotation with messageSerial = " + r.messageSerial + ", type = " + r.type);
|
|
9645
9645
|
let a = _r({
|
|
9646
9646
|
action: z.ANNOTATION,
|
|
9647
9647
|
channel: n,
|
|
@@ -9662,7 +9662,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9662
9662
|
statusCode: 400,
|
|
9663
9663
|
remediation: "Include \"annotation_subscribe\" in the channel modes: realtime.channels.get(name, { modes: [\"annotation_subscribe\", ...] }), or call channel.setOptions({ modes: [...] }) on an existing channel to trigger a reattach. Calling channels.get(name, { modes }) on an existing channel throws. The server only grants the mode if your key or token has the annotation-subscribe capability. Without it the attach succeeds but the server silently drops the mode and annotations are never delivered. `ably auth keys list` shows your key's capabilities."
|
|
9664
9664
|
});
|
|
9665
|
-
throw
|
|
9665
|
+
throw T.logActionNoStrip(this.logger, T.LOG_MAJOR, "RealtimeAnnotations.subscribe()", e.message + "; remediation=" + e.remediation), e;
|
|
9666
9666
|
}
|
|
9667
9667
|
}
|
|
9668
9668
|
unsubscribe(...e) {
|
|
@@ -9678,7 +9678,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9678
9678
|
}, Dr = class e extends Xn {
|
|
9679
9679
|
constructor(t) {
|
|
9680
9680
|
if (!e._MsgPack) throw Error("Expected DefaultRest._MsgPack to have been set");
|
|
9681
|
-
super(I.objectifyOptions(t, !0, "Rest",
|
|
9681
|
+
super(I.objectifyOptions(t, !0, "Rest", T.defaultLogger, f(d({}, Zn), {
|
|
9682
9682
|
Crypto: e.Crypto ?? void 0,
|
|
9683
9683
|
MsgPack: e._MsgPack ?? void 0,
|
|
9684
9684
|
Annotations: {
|
|
@@ -9724,7 +9724,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9724
9724
|
this.messages.unshift.apply(this.messages, e);
|
|
9725
9725
|
}
|
|
9726
9726
|
completeMessages(e, t, n) {
|
|
9727
|
-
|
|
9727
|
+
T.logAction(this.logger, T.LOG_MICRO, "MessageQueue.completeMessages()", e == "all" ? "(all)" : "serial = " + e.serial + "; count = " + e.count), t ||= null;
|
|
9728
9728
|
let r = this.messages;
|
|
9729
9729
|
if (r.length === 0) throw Error("MessageQueue.completeMessages(): completeMessages called on any empty MessageQueue");
|
|
9730
9730
|
let i = [];
|
|
@@ -9749,7 +9749,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9749
9749
|
for (let e of this.messages) e.sendAttempted = !1;
|
|
9750
9750
|
}
|
|
9751
9751
|
clear() {
|
|
9752
|
-
|
|
9752
|
+
T.logAction(this.logger, T.LOG_MICRO, "MessageQueue.clear()", "clearing " + this.messages.length + " messages"), this.messages = [], this.emit("idle");
|
|
9753
9753
|
}
|
|
9754
9754
|
}, Ar = class {
|
|
9755
9755
|
constructor(e, t) {
|
|
@@ -9771,13 +9771,13 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9771
9771
|
});
|
|
9772
9772
|
}
|
|
9773
9773
|
onAck(e, t, n) {
|
|
9774
|
-
|
|
9774
|
+
T.logAction(this.logger, T.LOG_MICRO, "Protocol.onAck()", "serial = " + e + "; count = " + t), this.messageQueue.completeMessages({
|
|
9775
9775
|
serial: e,
|
|
9776
9776
|
count: t
|
|
9777
9777
|
}, null, n);
|
|
9778
9778
|
}
|
|
9779
9779
|
onNack(e, t, n) {
|
|
9780
|
-
|
|
9780
|
+
T.logAction(this.logger, T.LOG_ERROR, "Protocol.onNack()", "serial = " + e + "; count = " + t + "; err = " + Te(n)), n ||= new O("Unable to send message; channel not responding", 50001, 500), this.messageQueue.completeMessages({
|
|
9781
9781
|
serial: e,
|
|
9782
9782
|
count: t
|
|
9783
9783
|
}, n);
|
|
@@ -9791,7 +9791,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9791
9791
|
t.once("idle", e);
|
|
9792
9792
|
}
|
|
9793
9793
|
send(e) {
|
|
9794
|
-
e.ackRequired && this.messageQueue.push(e), this.logger.shouldLog(
|
|
9794
|
+
e.ackRequired && this.messageQueue.push(e), this.logger.shouldLog(T.LOG_MICRO) && T.logActionNoStrip(this.logger, T.LOG_MICRO, "Protocol.send()", "sending msg; " + vr(e.message, this.transport.connectionManager.realtime._RealtimePresence, this.transport.connectionManager.realtime._Annotations, this.transport.connectionManager.realtime._liveObjectsPlugin)), e.sendAttempted = !0, this.transport.send(e.message);
|
|
9795
9795
|
}
|
|
9796
9796
|
getTransport() {
|
|
9797
9797
|
return this.transport;
|
|
@@ -9878,9 +9878,9 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9878
9878
|
this.isFinished || (this.isFinished = !0, this.isConnected = !1, this.maxIdleInterval = null, b.Config.clearTimeout(this.idleTimer ?? void 0), this.idleTimer = null, this.emit(e, t), this.dispose());
|
|
9879
9879
|
}
|
|
9880
9880
|
onProtocolMessage(e) {
|
|
9881
|
-
switch (this.logger.shouldLog(
|
|
9881
|
+
switch (this.logger.shouldLog(T.LOG_MICRO) && T.logActionNoStrip(this.logger, T.LOG_MICRO, "Transport.onProtocolMessage()", "received on " + this.shortName + ": " + vr(e, this.connectionManager.realtime._RealtimePresence, this.connectionManager.realtime._Annotations, this.connectionManager.realtime._liveObjectsPlugin) + "; connectionId = " + this.connectionManager.connectionId), this.onActivity(), e.action) {
|
|
9882
9882
|
case z.HEARTBEAT:
|
|
9883
|
-
|
|
9883
|
+
T.logActionNoStrip(this.logger, T.LOG_MICRO, "Transport.onProtocolMessage()", this.shortName + " heartbeat; connectionId = " + this.connectionManager.connectionId), this.emit("heartbeat", e.id);
|
|
9884
9884
|
break;
|
|
9885
9885
|
case z.CONNECTED:
|
|
9886
9886
|
this.onConnect(e), this.emit("connected", e.error, e.connectionId, e.connectionDetails, e);
|
|
@@ -9903,11 +9903,11 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9903
9903
|
case z.ACTIVATE: break;
|
|
9904
9904
|
case z.AUTH:
|
|
9905
9905
|
je(this.auth.authorize(), (e) => {
|
|
9906
|
-
e &&
|
|
9906
|
+
e && T.logAction(this.logger, T.LOG_ERROR, "Transport.onProtocolMessage()", "Ably requested re-authentication, but unable to obtain a new token: " + Te(e));
|
|
9907
9907
|
});
|
|
9908
9908
|
break;
|
|
9909
9909
|
case z.ERROR:
|
|
9910
|
-
if (
|
|
9910
|
+
if (T.logAction(this.logger, T.LOG_MINOR, "Transport.onProtocolMessage()", "received error action; connectionId = " + this.connectionManager.connectionId + "; err = " + b.Config.inspect(e.error) + (e.channel ? ", channel: " + e.channel : "")), e.channel === void 0) {
|
|
9911
9911
|
this.onFatalError(e);
|
|
9912
9912
|
break;
|
|
9913
9913
|
}
|
|
@@ -9923,28 +9923,28 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9923
9923
|
}
|
|
9924
9924
|
onDisconnect(e) {
|
|
9925
9925
|
let t = e && e.error;
|
|
9926
|
-
|
|
9926
|
+
T.logAction(this.logger, T.LOG_MINOR, "Transport.onDisconnect()", "err = " + Te(t)), this.finish("disconnected", t);
|
|
9927
9927
|
}
|
|
9928
9928
|
onFatalError(e) {
|
|
9929
9929
|
let t = e && e.error;
|
|
9930
|
-
|
|
9930
|
+
T.logAction(this.logger, T.LOG_MINOR, "Transport.onFatalError()", "err = " + Te(t)), this.finish("failed", t);
|
|
9931
9931
|
}
|
|
9932
9932
|
onClose(e) {
|
|
9933
9933
|
let t = e && e.error;
|
|
9934
|
-
|
|
9934
|
+
T.logAction(this.logger, T.LOG_MINOR, "Transport.onClose()", "err = " + Te(t)), this.finish("closed", t);
|
|
9935
9935
|
}
|
|
9936
9936
|
requestClose() {
|
|
9937
|
-
|
|
9937
|
+
T.logAction(this.logger, T.LOG_MINOR, "Transport.requestClose()", ""), this.send(Fr);
|
|
9938
9938
|
}
|
|
9939
9939
|
requestDisconnect() {
|
|
9940
|
-
|
|
9940
|
+
T.logAction(this.logger, T.LOG_MINOR, "Transport.requestDisconnect()", ""), this.send(Ir);
|
|
9941
9941
|
}
|
|
9942
9942
|
ping(e) {
|
|
9943
9943
|
let t = { action: z.HEARTBEAT };
|
|
9944
9944
|
e && (t.id = e), this.send(_r(t));
|
|
9945
9945
|
}
|
|
9946
9946
|
dispose() {
|
|
9947
|
-
|
|
9947
|
+
T.logAction(this.logger, T.LOG_MINOR, "Transport.dispose()", ""), this.isDisposed = !0, this.off();
|
|
9948
9948
|
}
|
|
9949
9949
|
onActivity() {
|
|
9950
9950
|
this.maxIdleInterval && (this.lastActivity = this.connectionManager.lastActivity = b.Config.now(), this.setIdleTimer(this.maxIdleInterval + 100));
|
|
@@ -9960,7 +9960,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9960
9960
|
let e = b.Config.now() - this.lastActivity, t = this.maxIdleInterval - e;
|
|
9961
9961
|
if (t <= 0) {
|
|
9962
9962
|
let t = "No activity seen from realtime in " + e + "ms; assuming connection has dropped";
|
|
9963
|
-
|
|
9963
|
+
T.logAction(this.logger, T.LOG_ERROR, "Transport.onIdleTimerExpire()", t), this.disconnect(new O(t, 80003, 408));
|
|
9964
9964
|
} else this.setIdleTimer(t + 100);
|
|
9965
9965
|
}
|
|
9966
9966
|
static tryConnect(e, t, n, r, i) {
|
|
@@ -9977,7 +9977,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
9977
9977
|
"failed"
|
|
9978
9978
|
]), a.dispose(), s.call({ event: "disconnected" }, new O("Timeout waiting for transport to indicate itself viable", 5e4, 500));
|
|
9979
9979
|
}, c), a.on(["failed", "disconnected"], s), a.on("preconnect", function() {
|
|
9980
|
-
|
|
9980
|
+
T.logAction(t.logger, T.LOG_MINOR, "Transport.tryConnect()", "viable transport " + a), b.Config.clearTimeout(o), a.off(["failed", "disconnected"], s), i(null, a);
|
|
9981
9981
|
}), a.connect(), a;
|
|
9982
9982
|
}
|
|
9983
9983
|
static isAvailable() {
|
|
@@ -10085,18 +10085,18 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10085
10085
|
sendEvents: !1,
|
|
10086
10086
|
failState: "failed"
|
|
10087
10087
|
}
|
|
10088
|
-
}, this.state = this.states.initialized, this.errorReason = null, this.queuedMessages = new kr(this.logger), this.msgSerial = 0, this.connectionDetails = void 0, this.connectionId = void 0, this.connectionKey = void 0, this.connectionStateTtl = n.connectionStateTtl, this.maxIdleInterval = null, this.transports = le(t.transports || I.defaultTransports, this.supportedTransports), this.transportPreference = null, this.transports.includes(Z.WebSocket) && (this.webSocketTransportAvailable = !0), this.transports.includes(Z.XhrPolling) ? this.baseTransport = Z.XhrPolling : this.transports.includes(Z.Comet) && (this.baseTransport = Z.Comet), this.domains = I.getHosts(t), this.activeProtocol = null, this.host = null, this.lastAutoReconnectAttempt = null, this.lastActivity = null, this.forceFallbackHost = !1, this.connectCounter = 0, this.wsCheckResult = null, this.webSocketSlowTimer = null, this.webSocketGiveUpTimer = null, this.abandonedWebSocket = !1,
|
|
10088
|
+
}, this.state = this.states.initialized, this.errorReason = null, this.queuedMessages = new kr(this.logger), this.msgSerial = 0, this.connectionDetails = void 0, this.connectionId = void 0, this.connectionKey = void 0, this.connectionStateTtl = n.connectionStateTtl, this.maxIdleInterval = null, this.transports = le(t.transports || I.defaultTransports, this.supportedTransports), this.transportPreference = null, this.transports.includes(Z.WebSocket) && (this.webSocketTransportAvailable = !0), this.transports.includes(Z.XhrPolling) ? this.baseTransport = Z.XhrPolling : this.transports.includes(Z.Comet) && (this.baseTransport = Z.Comet), this.domains = I.getHosts(t), this.activeProtocol = null, this.host = null, this.lastAutoReconnectAttempt = null, this.lastActivity = null, this.forceFallbackHost = !1, this.connectCounter = 0, this.wsCheckResult = null, this.webSocketSlowTimer = null, this.webSocketGiveUpTimer = null, this.abandonedWebSocket = !1, T.logAction(this.logger, T.LOG_MINOR, "Realtime.ConnectionManager()", "started"), T.logAction(this.logger, T.LOG_MICRO, "Realtime.ConnectionManager()", "requested transports = [" + (t.transports || I.defaultTransports) + "]"), T.logAction(this.logger, T.LOG_MICRO, "Realtime.ConnectionManager()", "available transports = [" + this.transports + "]"), T.logAction(this.logger, T.LOG_MICRO, "Realtime.ConnectionManager()", "http domains = [" + this.domains + "]"), !this.transports.length) {
|
|
10089
10089
|
let e = "no requested transports available";
|
|
10090
|
-
throw
|
|
10090
|
+
throw T.logAction(this.logger, T.LOG_ERROR, "realtime.ConnectionManager()", e), Error(e);
|
|
10091
10091
|
}
|
|
10092
10092
|
let i = b.Config.addEventListener;
|
|
10093
10093
|
i && (Br() && typeof t.recover == "function" && i("beforeunload", this.persistConnection.bind(this)), t.closeOnUnload === !0 && i("beforeunload", () => {
|
|
10094
|
-
|
|
10094
|
+
T.logAction(this.logger, T.LOG_MAJOR, "Realtime.ConnectionManager()", "beforeunload event has triggered the connection to close as closeOnUnload is true"), this.requestState({ state: "closing" });
|
|
10095
10095
|
}), i("online", () => {
|
|
10096
10096
|
var e;
|
|
10097
|
-
this.state == this.states.disconnected || this.state == this.states.suspended ? (
|
|
10097
|
+
this.state == this.states.disconnected || this.state == this.states.suspended ? (T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager caught browser ‘online’ event", "reattempting connection"), this.requestState({ state: "connecting" })) : this.state == this.states.connecting && ((e = this.pendingTransport) == null || e.off(), this.disconnectAllTransports(), this.startConnect());
|
|
10098
10098
|
}), i("offline", () => {
|
|
10099
|
-
this.state == this.states.connected && (
|
|
10099
|
+
this.state == this.states.connected && (T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager caught browser ‘offline’ event", "disconnecting active transport"), this.disconnectAllTransports());
|
|
10100
10100
|
}));
|
|
10101
10101
|
}
|
|
10102
10102
|
static supportedTransports(e) {
|
|
@@ -10128,7 +10128,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10128
10128
|
}
|
|
10129
10129
|
let t = this.options.recover, n = this.getSessionRecoverData(), r = this.sessionRecoveryName();
|
|
10130
10130
|
if (n && typeof t == "function") {
|
|
10131
|
-
|
|
10131
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.getTransportParams()", "Calling clientOptions-provided recover function with last session data (recovery scope: " + r + ")"), t(n, (t) => {
|
|
10132
10132
|
t ? (this.options.recover = n.recoveryKey, e("recover")) : e("clean");
|
|
10133
10133
|
});
|
|
10134
10134
|
return;
|
|
@@ -10137,22 +10137,22 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10137
10137
|
})((t) => {
|
|
10138
10138
|
let n = this.createTransportParams(null, t);
|
|
10139
10139
|
if (t === "recover") {
|
|
10140
|
-
|
|
10140
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.getTransportParams()", "Transport recovery mode = recover; recoveryKey = " + this.options.recover);
|
|
10141
10141
|
let e = Ur(this.options.recover);
|
|
10142
10142
|
e && (this.msgSerial = e.msgSerial);
|
|
10143
|
-
} else
|
|
10143
|
+
} else T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.getTransportParams()", "Transport params = " + n.toString());
|
|
10144
10144
|
e(n);
|
|
10145
10145
|
});
|
|
10146
10146
|
}
|
|
10147
10147
|
tryATransport(e, t, n) {
|
|
10148
|
-
|
|
10148
|
+
T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.tryATransport()", "trying " + t), this.proposedTransport = Lr.tryConnect(this.supportedTransports[t], this, this.realtime.auth, e, (r, i) => {
|
|
10149
10149
|
let a = this.state;
|
|
10150
10150
|
if (a == this.states.closing || a == this.states.closed || a == this.states.failed) {
|
|
10151
|
-
i && (
|
|
10151
|
+
i && (T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.tryATransport()", "connection " + a.state + " while we were attempting the transport; closing " + i), i.close()), n(!0);
|
|
10152
10152
|
return;
|
|
10153
10153
|
}
|
|
10154
10154
|
if (r) {
|
|
10155
|
-
|
|
10155
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.tryATransport()", "transport " + t + " " + r.event + ", err: " + r.error.toString()), At.isTokenErr(r.error) && !(this.errorReason && At.isTokenErr(this.errorReason)) ? (this.errorReason = r.error, je(this.realtime.auth._forceNewToken(null, null), (r) => {
|
|
10156
10156
|
if (r) {
|
|
10157
10157
|
this.actOnErrorFromAuthorize(r);
|
|
10158
10158
|
return;
|
|
@@ -10167,12 +10167,12 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10167
10167
|
}), n(!0)));
|
|
10168
10168
|
return;
|
|
10169
10169
|
}
|
|
10170
|
-
|
|
10170
|
+
T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.tryATransport()", "viable transport " + t + "; setting pending"), this.setTransportPending(i, e), n(null, i);
|
|
10171
10171
|
});
|
|
10172
10172
|
}
|
|
10173
10173
|
setTransportPending(e, t) {
|
|
10174
10174
|
let n = t.mode;
|
|
10175
|
-
|
|
10175
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.setTransportPending()", "transport = " + e + "; mode = " + n), this.pendingTransport = e, this.cancelWebSocketSlowTimer(), this.cancelWebSocketGiveUpTimer(), e.once("connected", (t, r, i) => {
|
|
10176
10176
|
this.activateTransport(t, e, r, i), n === "recover" && this.options.recover && (delete this.options.recover, this.unpersistConnection());
|
|
10177
10177
|
});
|
|
10178
10178
|
let r = this;
|
|
@@ -10185,10 +10185,10 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10185
10185
|
}), this.emit("transport.pending", e);
|
|
10186
10186
|
}
|
|
10187
10187
|
activateTransport(e, t, n, r) {
|
|
10188
|
-
|
|
10188
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.activateTransport()", "transport = " + t), e && T.logAction(this.logger, T.LOG_ERROR, "ConnectionManager.activateTransport()", "error = " + e), n && T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.activateTransport()", "connectionId = " + n), r && T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.activateTransport()", "connectionDetails = " + JSON.stringify(r)), this.persistTransportPreference(t);
|
|
10189
10189
|
let i = this.state, a = this.states.connected.state;
|
|
10190
|
-
if (
|
|
10191
|
-
if (delete this.pendingTransport, !t.isConnected) return
|
|
10190
|
+
if (T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.activateTransport()", "current state = " + i.state), i.state == this.states.closing.state || i.state == this.states.closed.state || i.state == this.states.failed.state) return T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.activateTransport()", "Disconnecting transport and abandoning"), t.disconnect(), !1;
|
|
10191
|
+
if (delete this.pendingTransport, !t.isConnected) return T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.activateTransport()", "Declining to activate transport " + t + " since it appears to no longer be connected"), !1;
|
|
10192
10192
|
let o = this.activeProtocol;
|
|
10193
10193
|
this.activeProtocol = new Y(t), this.host = t.params.host;
|
|
10194
10194
|
let s = r.connectionKey;
|
|
@@ -10199,15 +10199,15 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10199
10199
|
}), i.state === this.states.connected.state ? e && (this.errorReason = this.realtime.connection.errorReason = e, this.emit("update", new jr(a, a, null, e))) : (this.notifyState({
|
|
10200
10200
|
state: "connected",
|
|
10201
10201
|
error: e
|
|
10202
|
-
}), this.errorReason = this.realtime.connection.errorReason = e || null), this.emit("transport.active", t), o) if (o.messageQueue.count() > 0 &&
|
|
10202
|
+
}), this.errorReason = this.realtime.connection.errorReason = e || null), this.emit("transport.active", t), o) if (o.messageQueue.count() > 0 && T.logAction(this.logger, T.LOG_ERROR, "ConnectionManager.activateTransport()", "Previous active protocol (for transport " + o.transport.shortName + ", new one is " + t.shortName + ") finishing with " + o.messageQueue.count() + " messages still pending"), o.transport === t) {
|
|
10203
10203
|
let e = "Assumption violated: activating a transport that was also the transport for the previous active protocol; transport = " + t.shortName + "; stack = " + (/* @__PURE__ */ Error()).stack;
|
|
10204
|
-
|
|
10204
|
+
T.logAction(this.logger, T.LOG_ERROR, "ConnectionManager.activateTransport()", e);
|
|
10205
10205
|
} else o.finish();
|
|
10206
10206
|
return !0;
|
|
10207
10207
|
}
|
|
10208
10208
|
deactivateTransport(e, t, n) {
|
|
10209
10209
|
let r = this.activeProtocol, i = r && r.getTransport() === e, a = e === this.pendingTransport, o = this.noTransportsScheduledForActivation();
|
|
10210
|
-
if (
|
|
10210
|
+
if (T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.deactivateTransport()", "transport = " + e), T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.deactivateTransport()", "state = " + t + (i ? "; was active" : a ? "; was pending" : "") + (o ? "" : "; another transport is scheduled for activation")), n && n.message && T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.deactivateTransport()", "reason = " + n.message), i && (T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.deactivateTransport()", "Getting, clearing, and requeuing " + this.activeProtocol.messageQueue.count() + " pending messages"), this.queuePendingMessages(r.getPendingMessages()), r.clearPendingMessages(), this.activeProtocol = this.host = null), this.emit("transport.inactive", e), i && o || i && t === "failed" || t === "closed" || r === null && a) {
|
|
10211
10211
|
if (t === "disconnected" && n && n.statusCode > 500 && this.domains.length > 1) {
|
|
10212
10212
|
this.unpersistTransportPreference(), this.forceFallbackHost = !0, this.notifyState({
|
|
10213
10213
|
state: t,
|
|
@@ -10229,7 +10229,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10229
10229
|
}
|
|
10230
10230
|
setConnection(e, t, n) {
|
|
10231
10231
|
let r = this.connectionId;
|
|
10232
|
-
(r && r !== e || !r && n) && (
|
|
10232
|
+
(r && r !== e || !r && n) && (T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.setConnection()", "Resetting msgSerial"), this.msgSerial = 0, this.queuedMessages.resetSendAttempted()), this.connectionId !== e && T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.setConnection()", "New connectionId; reattaching any attached channels"), this.realtime.connection.id = this.connectionId = e, this.realtime.connection.key = this.connectionKey = t.connectionKey;
|
|
10233
10233
|
}
|
|
10234
10234
|
clearConnection() {
|
|
10235
10235
|
this.realtime.connection.id = this.connectionId = void 0, this.realtime.connection.key = this.connectionKey = void 0, this.msgSerial = 0, this.queuedMessages.resetSendAttempted(), this.unpersistConnection();
|
|
@@ -10244,7 +10244,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10244
10244
|
checkConnectionStateFreshness() {
|
|
10245
10245
|
if (!this.lastActivity || !this.connectionId) return;
|
|
10246
10246
|
let e = b.Config.now() - this.lastActivity;
|
|
10247
|
-
e > this.connectionStateTtl + this.maxIdleInterval && (
|
|
10247
|
+
e > this.connectionStateTtl + this.maxIdleInterval && (T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.checkConnectionStateFreshness()", "Last known activity from realtime was " + e + "ms ago; discarding connection state"), this.clearConnection(), this.states.connecting.failState = "suspended");
|
|
10248
10248
|
}
|
|
10249
10249
|
persistConnection() {
|
|
10250
10250
|
if (Br()) {
|
|
@@ -10279,21 +10279,21 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10279
10279
|
}
|
|
10280
10280
|
enactStateChange(e) {
|
|
10281
10281
|
let t = "Connection state", n = e.current + (e.reason ? "; reason: " + e.reason : "");
|
|
10282
|
-
e.current === "failed" ?
|
|
10282
|
+
e.current === "failed" ? T.logAction(this.logger, T.LOG_ERROR, t, n) : T.logAction(this.logger, T.LOG_MAJOR, t, n), T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.enactStateChange", "setting new state: " + e.current + "; reason = " + (e.reason && e.reason.message));
|
|
10283
10283
|
let r = this.state = this.states[e.current];
|
|
10284
10284
|
e.reason && (this.errorReason = e.reason, this.realtime.connection.errorReason = e.reason), (r.terminal || r.state === "suspended") && this.clearConnection(), this.emit("connectionstate", e);
|
|
10285
10285
|
}
|
|
10286
10286
|
startTransitionTimer(e) {
|
|
10287
|
-
|
|
10288
|
-
this.transitionTimer && (this.transitionTimer = null,
|
|
10287
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.startTransitionTimer()", "transitionState: " + e.state), this.transitionTimer && (T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.startTransitionTimer()", "clearing already-running timer"), b.Config.clearTimeout(this.transitionTimer)), this.transitionTimer = b.Config.setTimeout(() => {
|
|
10288
|
+
this.transitionTimer && (this.transitionTimer = null, T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager " + e.state + " timer expired", "requesting new state: " + e.failState), this.notifyState({ state: e.failState }));
|
|
10289
10289
|
}, e.retryDelay);
|
|
10290
10290
|
}
|
|
10291
10291
|
cancelTransitionTimer() {
|
|
10292
|
-
|
|
10292
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.cancelTransitionTimer()", ""), this.transitionTimer &&= (b.Config.clearTimeout(this.transitionTimer), null);
|
|
10293
10293
|
}
|
|
10294
10294
|
startSuspendTimer() {
|
|
10295
10295
|
this.suspendTimer ||= b.Config.setTimeout(() => {
|
|
10296
|
-
this.suspendTimer && (this.suspendTimer = null,
|
|
10296
|
+
this.suspendTimer && (this.suspendTimer = null, T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager suspend timer expired", "requesting new state: suspended"), this.states.connecting.failState = "suspended", this.notifyState({ state: "suspended" }));
|
|
10297
10297
|
}, this.connectionStateTtl);
|
|
10298
10298
|
}
|
|
10299
10299
|
checkSuspendTimer(e) {
|
|
@@ -10304,7 +10304,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10304
10304
|
}
|
|
10305
10305
|
startRetryTimer(e) {
|
|
10306
10306
|
this.retryTimer = b.Config.setTimeout(() => {
|
|
10307
|
-
|
|
10307
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager retry timer expired", "retrying"), this.retryTimer = null, this.requestState({ state: "connecting" });
|
|
10308
10308
|
}, e);
|
|
10309
10309
|
}
|
|
10310
10310
|
cancelRetryTimer() {
|
|
@@ -10312,15 +10312,15 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10312
10312
|
}
|
|
10313
10313
|
startWebSocketSlowTimer() {
|
|
10314
10314
|
this.webSocketSlowTimer = b.Config.setTimeout(() => {
|
|
10315
|
-
|
|
10316
|
-
|
|
10315
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager WebSocket slow timer", "checking connectivity"), this.checkWsConnectivity().then(() => {
|
|
10316
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager WebSocket slow timer", "ws connectivity check succeeded"), this.wsCheckResult = !0;
|
|
10317
10317
|
}).catch(() => {
|
|
10318
|
-
|
|
10318
|
+
T.logAction(this.logger, T.LOG_MAJOR, "ConnectionManager WebSocket slow timer", "ws connectivity check failed"), this.wsCheckResult = !1;
|
|
10319
10319
|
}), this.realtime.http.checkConnectivity && je(this.realtime.http.checkConnectivity(), (e, t) => {
|
|
10320
|
-
e || !t ? (
|
|
10320
|
+
e || !t ? (T.logAction(this.logger, T.LOG_MAJOR, "ConnectionManager WebSocket slow timer", "http connectivity check failed"), this.cancelWebSocketGiveUpTimer(), this.notifyState({
|
|
10321
10321
|
state: "disconnected",
|
|
10322
10322
|
error: new O("Unable to connect (network unreachable)", 80003, 404)
|
|
10323
|
-
})) :
|
|
10323
|
+
})) : T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager WebSocket slow timer", "http connectivity check succeeded");
|
|
10324
10324
|
});
|
|
10325
10325
|
}, this.options.timeouts.webSocketSlowTimeout);
|
|
10326
10326
|
}
|
|
@@ -10330,7 +10330,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10330
10330
|
startWebSocketGiveUpTimer(e) {
|
|
10331
10331
|
this.webSocketGiveUpTimer = b.Config.setTimeout(() => {
|
|
10332
10332
|
var t, n;
|
|
10333
|
-
this.wsCheckResult || (
|
|
10333
|
+
this.wsCheckResult || (T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager WebSocket give up timer", "websocket connection took more than 10s; " + (this.baseTransport ? "trying base transport" : "")), this.baseTransport ? (this.abandonedWebSocket = !0, (t = this.proposedTransport) == null || t.dispose(), (n = this.pendingTransport) == null || n.dispose(), this.connectBase(e, ++this.connectCounter)) : T.logAction(this.logger, T.LOG_MAJOR, "ConnectionManager WebSocket give up timer", "websocket connectivity appears to be unavailable but no other transports to try"));
|
|
10334
10334
|
}, this.options.timeouts.webSocketConnectTimeout);
|
|
10335
10335
|
}
|
|
10336
10336
|
cancelWebSocketGiveUpTimer() {
|
|
@@ -10339,7 +10339,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10339
10339
|
notifyState(e) {
|
|
10340
10340
|
var t;
|
|
10341
10341
|
let n = e.state, r = n === "disconnected" && (this.state === this.states.connected || e.retryImmediately || this.state === this.states.connecting && e.error && At.isTokenErr(e.error) && !(this.errorReason && At.isTokenErr(this.errorReason)));
|
|
10342
|
-
if (
|
|
10342
|
+
if (T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.notifyState()", "new state: " + n + (r ? "; will retry connection immediately" : "")), n == this.state.state || (this.cancelTransitionTimer(), this.cancelRetryTimer(), this.cancelWebSocketSlowTimer(), this.cancelWebSocketGiveUpTimer(), this.checkSuspendTimer(e.state), (n === "suspended" || n === "connected") && (this.disconnectedRetryCount = 0), this.state.terminal)) return;
|
|
10343
10343
|
let i = this.states[e.state], a = i.retryDelay;
|
|
10344
10344
|
i.state === "disconnected" && (this.disconnectedRetryCount++, a = N(i.retryDelay, this.disconnectedRetryCount));
|
|
10345
10345
|
let o = new jr(this.state.state, i.state, a, e.error || (t = Pr)[i.state]?.call(t));
|
|
@@ -10347,16 +10347,16 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10347
10347
|
let e = () => {
|
|
10348
10348
|
this.state === this.states.disconnected && (this.lastAutoReconnectAttempt = b.Config.now(), this.requestState({ state: "connecting" }));
|
|
10349
10349
|
}, t = this.lastAutoReconnectAttempt && b.Config.now() - this.lastAutoReconnectAttempt + 1;
|
|
10350
|
-
t && t < 1e3 ? (
|
|
10350
|
+
t && t < 1e3 ? (T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.notifyState()", "Last reconnect attempt was only " + t + "ms ago, waiting another " + (1e3 - t) + "ms before trying again"), b.Config.setTimeout(e, 1e3 - t)) : b.Config.nextTick(e);
|
|
10351
10351
|
} else (n === "disconnected" || n === "suspended") && this.startRetryTimer(a);
|
|
10352
10352
|
(n === "disconnected" && !r || n === "suspended" || i.terminal) && b.Config.nextTick(() => {
|
|
10353
10353
|
this.disconnectAllTransports();
|
|
10354
|
-
}), n == "connected" && !this.activeProtocol &&
|
|
10354
|
+
}), n == "connected" && !this.activeProtocol && T.logAction(this.logger, T.LOG_ERROR, "ConnectionManager.notifyState()", "Broken invariant: attempted to go into connected state, but there is no active protocol"), this.enactStateChange(o), this.state.sendEvents ? (this.queuedPresenceToChannelQueues(), this.sendQueuedMessages()) : this.state.queueEvents || (this.realtime.channels.propogateConnectionInterruption(n, o.reason), this.failQueuedMessages(o.reason));
|
|
10355
10355
|
}
|
|
10356
10356
|
requestState(e) {
|
|
10357
10357
|
var t;
|
|
10358
10358
|
let n = e.state;
|
|
10359
|
-
if (
|
|
10359
|
+
if (T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.requestState()", "requested state: " + n + "; current state: " + this.state.state), n == this.state.state || (this.cancelWebSocketSlowTimer(), this.cancelWebSocketGiveUpTimer(), this.cancelTransitionTimer(), this.cancelRetryTimer(), this.checkSuspendTimer(n), n == "connecting" && this.state.state == "connected") || n == "closing" && this.state.state == "closed") return;
|
|
10360
10360
|
let r = this.states[n], i = new jr(this.state.state, r.state, null, e.error || (t = Pr)[r.state]?.call(t));
|
|
10361
10361
|
this.enactStateChange(i), n == "connecting" && b.Config.nextTick(() => {
|
|
10362
10362
|
this.startConnect();
|
|
@@ -10364,7 +10364,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10364
10364
|
}
|
|
10365
10365
|
startConnect() {
|
|
10366
10366
|
if (this.state !== this.states.connecting) {
|
|
10367
|
-
|
|
10367
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.startConnect()", "Must be in connecting state to connect, but was " + this.state.state);
|
|
10368
10368
|
return;
|
|
10369
10369
|
}
|
|
10370
10370
|
let e = this.realtime.auth, t = ++this.connectCounter, n = () => {
|
|
@@ -10376,7 +10376,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10376
10376
|
t === this.connectCounter && this.connectImpl(e, t);
|
|
10377
10377
|
});
|
|
10378
10378
|
};
|
|
10379
|
-
if (
|
|
10379
|
+
if (T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.startConnect()", "starting connection"), this.startSuspendTimer(), this.startTransitionTimer(this.states.connecting), e.method === "basic") n();
|
|
10380
10380
|
else {
|
|
10381
10381
|
let r = (e) => {
|
|
10382
10382
|
t === this.connectCounter && (e ? this.actOnErrorFromAuthorize(e) : n());
|
|
@@ -10387,25 +10387,25 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10387
10387
|
connectImpl(e, t) {
|
|
10388
10388
|
let n = this.state.state;
|
|
10389
10389
|
if (n !== this.states.connecting.state) {
|
|
10390
|
-
|
|
10390
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.connectImpl()", "Must be in connecting state to connect, but was " + n);
|
|
10391
10391
|
return;
|
|
10392
10392
|
}
|
|
10393
10393
|
let r = this.getTransportPreference();
|
|
10394
10394
|
r && r === this.baseTransport && this.webSocketTransportAvailable && this.checkWsConnectivity().then(() => {
|
|
10395
|
-
this.unpersistTransportPreference(), this.state === this.states.connecting && (
|
|
10395
|
+
this.unpersistTransportPreference(), this.state === this.states.connecting && (T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.connectImpl():", "web socket connectivity available, cancelling connection attempt with " + this.baseTransport), this.disconnectAllTransports(), this.connectWs(e, ++this.connectCounter));
|
|
10396
10396
|
}).catch(Vr), r && r === this.baseTransport || this.baseTransport && !this.webSocketTransportAvailable ? this.connectBase(e, t) : this.connectWs(e, t);
|
|
10397
10397
|
}
|
|
10398
10398
|
connectWs(e, t) {
|
|
10399
|
-
|
|
10399
|
+
T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.connectWs()"), this.wsCheckResult = null, this.abandonedWebSocket = !1, this.startWebSocketSlowTimer(), this.startWebSocketGiveUpTimer(e), this.tryTransportWithFallbacks("web_socket", e, !0, t, () => this.wsCheckResult !== !1 && !this.abandonedWebSocket);
|
|
10400
10400
|
}
|
|
10401
10401
|
connectBase(e, t) {
|
|
10402
|
-
|
|
10402
|
+
T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.connectBase()"), this.baseTransport ? this.tryTransportWithFallbacks(this.baseTransport, e, !1, t, () => !0) : this.notifyState({
|
|
10403
10403
|
state: "disconnected",
|
|
10404
10404
|
error: new O("No transports left to try", 8e4, 404)
|
|
10405
10405
|
});
|
|
10406
10406
|
}
|
|
10407
10407
|
tryTransportWithFallbacks(e, t, n, r, i) {
|
|
10408
|
-
|
|
10408
|
+
T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.tryTransportWithFallbacks()", e);
|
|
10409
10409
|
let a = (e) => {
|
|
10410
10410
|
this.notifyState({
|
|
10411
10411
|
state: this.states.connecting.failState,
|
|
@@ -10455,12 +10455,12 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10455
10455
|
this.tryATransport(t, e, s);
|
|
10456
10456
|
}
|
|
10457
10457
|
closeImpl() {
|
|
10458
|
-
|
|
10458
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.closeImpl()", "closing connection"), this.cancelSuspendTimer(), this.startTransitionTimer(this.states.closing), this.pendingTransport && (T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.closeImpl()", "Closing pending transport: " + this.pendingTransport), this.pendingTransport.close()), this.activeProtocol && (T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.closeImpl()", "Closing active transport: " + this.activeProtocol.getTransport()), this.activeProtocol.getTransport().close()), this.notifyState({ state: "closed" });
|
|
10459
10459
|
}
|
|
10460
10460
|
onAuthUpdated(e, t) {
|
|
10461
10461
|
switch (this.state.state) {
|
|
10462
10462
|
case "connected": {
|
|
10463
|
-
|
|
10463
|
+
T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.onAuthUpdated()", "Sending AUTH message on active transport");
|
|
10464
10464
|
let n = this.activeProtocol?.getTransport();
|
|
10465
10465
|
n && n.onAuthUpdated && n.onAuthUpdated(e);
|
|
10466
10466
|
let r = _r({
|
|
@@ -10476,9 +10476,9 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10476
10476
|
this.once("connectiondetails", i), this.on("connectionstate", a);
|
|
10477
10477
|
break;
|
|
10478
10478
|
}
|
|
10479
|
-
case "connecting":
|
|
10479
|
+
case "connecting": T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.onAuthUpdated()", "Aborting current connection attempts in order to start again with the new auth details"), this.disconnectAllTransports();
|
|
10480
10480
|
default: {
|
|
10481
|
-
|
|
10481
|
+
T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.onAuthUpdated()", "Connection state is " + this.state.state + "; waiting until either connected or failed");
|
|
10482
10482
|
let n = (r) => {
|
|
10483
10483
|
switch (r.current) {
|
|
10484
10484
|
case "connected":
|
|
@@ -10494,21 +10494,21 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10494
10494
|
}
|
|
10495
10495
|
}
|
|
10496
10496
|
disconnectAllTransports() {
|
|
10497
|
-
|
|
10497
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.disconnectAllTransports()", "Disconnecting all transports"), this.connectCounter++, this.pendingTransport && (T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.disconnectAllTransports()", "Disconnecting pending transport: " + this.pendingTransport), this.pendingTransport.disconnect()), delete this.pendingTransport, this.proposedTransport && (T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.disconnectAllTransports()", "Disconnecting proposed transport: " + this.pendingTransport), this.proposedTransport.disconnect()), delete this.pendingTransport, this.activeProtocol && (T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.disconnectAllTransports()", "Disconnecting active transport: " + this.activeProtocol.getTransport()), this.activeProtocol.getTransport().disconnect());
|
|
10498
10498
|
}
|
|
10499
10499
|
send(e, t, n) {
|
|
10500
10500
|
n ||= Vr;
|
|
10501
10501
|
let r = this.state;
|
|
10502
10502
|
if (r.sendEvents) {
|
|
10503
|
-
|
|
10503
|
+
T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.send()", "sending event"), this.sendImpl(new Ar(e, n));
|
|
10504
10504
|
return;
|
|
10505
10505
|
}
|
|
10506
10506
|
if (!(t && r.queueEvents)) {
|
|
10507
10507
|
let e = "rejecting event, queueEvent was " + t + ", state was " + r.state;
|
|
10508
|
-
|
|
10508
|
+
T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.send()", e), n(this.errorReason || new O(e, 9e4, 400));
|
|
10509
10509
|
return;
|
|
10510
10510
|
}
|
|
10511
|
-
this.logger.shouldLog(
|
|
10511
|
+
this.logger.shouldLog(T.LOG_MICRO) && T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.send()", "queueing msg; " + vr(e, this.realtime._RealtimePresence, this.realtime._Annotations, this.realtime._liveObjectsPlugin)), this.queue(e, n);
|
|
10512
10512
|
}
|
|
10513
10513
|
sendImpl(e) {
|
|
10514
10514
|
let t = e.message;
|
|
@@ -10516,11 +10516,11 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10516
10516
|
try {
|
|
10517
10517
|
this.activeProtocol.send(e);
|
|
10518
10518
|
} catch (e) {
|
|
10519
|
-
|
|
10519
|
+
T.logAction(this.logger, T.LOG_ERROR, "ConnectionManager.sendImpl()", "Unexpected exception in transport.send(): " + e.stack);
|
|
10520
10520
|
}
|
|
10521
10521
|
}
|
|
10522
10522
|
queue(e, t) {
|
|
10523
|
-
|
|
10523
|
+
T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.queue()", "queueing event"), this.queuedMessages.push(new Ar(e, t));
|
|
10524
10524
|
}
|
|
10525
10525
|
queuedPresenceToChannelQueues() {
|
|
10526
10526
|
this.queuedMessages.messages = this.queuedMessages.messages.filter((e) => {
|
|
@@ -10530,16 +10530,16 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10530
10530
|
});
|
|
10531
10531
|
}
|
|
10532
10532
|
sendQueuedMessages() {
|
|
10533
|
-
|
|
10533
|
+
T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.sendQueuedMessages()", "sending " + this.queuedMessages.count() + " queued messages");
|
|
10534
10534
|
let e;
|
|
10535
10535
|
for (; e = this.queuedMessages.shift();) this.sendImpl(e);
|
|
10536
10536
|
}
|
|
10537
10537
|
queuePendingMessages(e) {
|
|
10538
|
-
e && e.length && (
|
|
10538
|
+
e && e.length && (T.logAction(this.logger, T.LOG_MICRO, "ConnectionManager.queuePendingMessages()", "queueing " + e.length + " pending messages"), this.queuedMessages.prepend(e));
|
|
10539
10539
|
}
|
|
10540
10540
|
failQueuedMessages(e) {
|
|
10541
10541
|
let t = this.queuedMessages.count();
|
|
10542
|
-
t > 0 && (
|
|
10542
|
+
t > 0 && (T.logAction(this.logger, T.LOG_ERROR, "ConnectionManager.failQueuedMessages()", "failing " + t + " queued messages, err = " + Te(e)), this.queuedMessages.completeAllMessages(e));
|
|
10543
10543
|
}
|
|
10544
10544
|
onChannelMessage(e, t) {
|
|
10545
10545
|
this.pendingChannelMessagesState.queue.push({
|
|
@@ -10552,7 +10552,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10552
10552
|
this.pendingChannelMessagesState.isProcessing = !0;
|
|
10553
10553
|
let e = this.pendingChannelMessagesState.queue.shift();
|
|
10554
10554
|
this.processChannelMessage(e.message).catch((e) => {
|
|
10555
|
-
|
|
10555
|
+
T.logAction(this.logger, T.LOG_ERROR, "ConnectionManager.processNextPendingChannelMessage() received error ", e);
|
|
10556
10556
|
}).finally(() => {
|
|
10557
10557
|
this.pendingChannelMessagesState.isProcessing = !1, this.processNextPendingChannelMessage();
|
|
10558
10558
|
});
|
|
@@ -10570,7 +10570,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10570
10570
|
});
|
|
10571
10571
|
let e = this.activeProtocol?.getTransport();
|
|
10572
10572
|
if (!e) throw this.getStateError();
|
|
10573
|
-
|
|
10573
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.ping()", "transport = " + e);
|
|
10574
10574
|
let t = b.Config.now(), n = Oe();
|
|
10575
10575
|
return Ue(new Promise((r) => {
|
|
10576
10576
|
let i = (a) => {
|
|
@@ -10605,7 +10605,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10605
10605
|
});
|
|
10606
10606
|
else if (e.statusCode === vt.Forbidden) {
|
|
10607
10607
|
let t = "Client configured authentication provider returned 403, failing the connection";
|
|
10608
|
-
|
|
10608
|
+
T.logAction(this.logger, T.LOG_ERROR, "ConnectionManager.actOnErrorFromAuthorize()", t);
|
|
10609
10609
|
let n = new O({
|
|
10610
10610
|
message: t,
|
|
10611
10611
|
code: 80019,
|
|
@@ -10619,7 +10619,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10619
10619
|
});
|
|
10620
10620
|
} else {
|
|
10621
10621
|
let t = "Client configured authentication provider request failed";
|
|
10622
|
-
|
|
10622
|
+
T.logAction(this.logger, T.LOG_MINOR, "ConnectionManager.actOnErrorFromAuthorize", t);
|
|
10623
10623
|
let n = new O({
|
|
10624
10624
|
message: t,
|
|
10625
10625
|
code: 80019,
|
|
@@ -10640,7 +10640,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10640
10640
|
if (n) {
|
|
10641
10641
|
let e = this.realtime.auth._uncheckedSetClientId(n);
|
|
10642
10642
|
if (e) {
|
|
10643
|
-
|
|
10643
|
+
T.logAction(this.logger, T.LOG_ERROR, "ConnectionManager.onConnectionDetailsUpdate()", e.message), t.fail(e);
|
|
10644
10644
|
return;
|
|
10645
10645
|
}
|
|
10646
10646
|
}
|
|
@@ -10687,16 +10687,16 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10687
10687
|
});
|
|
10688
10688
|
}
|
|
10689
10689
|
connect() {
|
|
10690
|
-
|
|
10690
|
+
T.logAction(this.logger, T.LOG_MINOR, "Connection.connect()", ""), this.connectionManager.requestState({ state: "connecting" });
|
|
10691
10691
|
}
|
|
10692
10692
|
ping(...e) {
|
|
10693
10693
|
return we(e, 0), this._pingImpl();
|
|
10694
10694
|
}
|
|
10695
10695
|
async _pingImpl() {
|
|
10696
|
-
return
|
|
10696
|
+
return T.logAction(this.logger, T.LOG_MINOR, "Connection.ping()", ""), this.connectionManager.ping();
|
|
10697
10697
|
}
|
|
10698
10698
|
close() {
|
|
10699
|
-
|
|
10699
|
+
T.logAction(this.logger, T.LOG_MINOR, "Connection.close()", "connectionKey = " + this.key), this.connectionManager.requestState({ state: "closing" });
|
|
10700
10700
|
}
|
|
10701
10701
|
get recoveryKey() {
|
|
10702
10702
|
return this.logger.deprecationWarning("The `Connection.recoveryKey` attribute has been replaced by the `Connection.createRecoveryKey()` method. Replace your usage of `recoveryKey` with the return value of `createRecoveryKey()`. `recoveryKey` will be removed in a future version."), this.createRecoveryKey();
|
|
@@ -10706,7 +10706,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10706
10706
|
}
|
|
10707
10707
|
}, Kr = class e extends en {
|
|
10708
10708
|
constructor(t) {
|
|
10709
|
-
if (super(I.objectifyOptions(t, !1, "BaseRealtime",
|
|
10709
|
+
if (super(I.objectifyOptions(t, !1, "BaseRealtime", T.defaultLogger)), T.logAction(this.logger, T.LOG_MINOR, "Realtime()", ""), typeof EdgeRuntime == "string") throw new O("Ably.Realtime instance cannot be used in Vercel Edge runtime. If you are running Vercel Edge functions, please replace your \"new Ably.Realtime()\" with \"new Ably.Rest()\" and use Ably Rest API instead of the Realtime API. If you are server-rendering your application in the Vercel Edge runtime, please use the condition \"if (typeof EdgeRuntime === 'string')\" to prevent instantiating Ably.Realtime instance during SSR in the Vercel Edge runtime.", 4e4, 400);
|
|
10710
10710
|
this._additionalTransportImplementations = e.transportImplementationsFromPlugins(this.options.plugins), this._RealtimePresence = this.options.plugins?.RealtimePresence ?? null, this.connection = new Q(this, this.options), this._channels = new Jr(this), this.options.autoConnect !== !1 && this.connect();
|
|
10711
10711
|
}
|
|
10712
10712
|
static transportImplementationsFromPlugins(e) {
|
|
@@ -10720,10 +10720,10 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10720
10720
|
return this.auth.clientId;
|
|
10721
10721
|
}
|
|
10722
10722
|
connect() {
|
|
10723
|
-
|
|
10723
|
+
T.logAction(this.logger, T.LOG_MINOR, "Realtime.connect()", ""), this.connection.connect();
|
|
10724
10724
|
}
|
|
10725
10725
|
close() {
|
|
10726
|
-
|
|
10726
|
+
T.logAction(this.logger, T.LOG_MINOR, "Realtime.close()", ""), this.connection.close();
|
|
10727
10727
|
}
|
|
10728
10728
|
};
|
|
10729
10729
|
Kr.EventEmitter = Lt;
|
|
@@ -10750,12 +10750,12 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10750
10750
|
async processChannelMessage(e) {
|
|
10751
10751
|
let t = e.channel;
|
|
10752
10752
|
if (t === void 0) {
|
|
10753
|
-
|
|
10753
|
+
T.logAction(this.logger, T.LOG_ERROR, "Channels.processChannelMessage()", "received event unspecified channel, action = " + e.action);
|
|
10754
10754
|
return;
|
|
10755
10755
|
}
|
|
10756
10756
|
let n = this.all[t];
|
|
10757
10757
|
if (!n) {
|
|
10758
|
-
|
|
10758
|
+
T.logAction(this.logger, T.LOG_ERROR, "Channels.processChannelMessage()", "received event for non-existent channel: " + t);
|
|
10759
10759
|
return;
|
|
10760
10760
|
}
|
|
10761
10761
|
await n.processMessage(e);
|
|
@@ -10806,7 +10806,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10806
10806
|
return this.get(e, n);
|
|
10807
10807
|
}
|
|
10808
10808
|
release(e) {
|
|
10809
|
-
e = String(e),
|
|
10809
|
+
e = String(e), T.logAction(this.logger, T.LOG_MAJOR, "Channels.release()", "Releasing references to channel " + e);
|
|
10810
10810
|
let t = this.all[e];
|
|
10811
10811
|
if (!t) return;
|
|
10812
10812
|
let n = t.state;
|
|
@@ -10815,7 +10815,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10815
10815
|
return;
|
|
10816
10816
|
}
|
|
10817
10817
|
t.detach().catch((t) => {
|
|
10818
|
-
|
|
10818
|
+
T.logAction(this.logger, T.LOG_ERROR, "Channels.release()", "Error detaching channel " + e + " prior to release: " + Te(t));
|
|
10819
10819
|
}).then(() => {
|
|
10820
10820
|
delete this.all[e];
|
|
10821
10821
|
});
|
|
@@ -10870,11 +10870,11 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10870
10870
|
}
|
|
10871
10871
|
startSync() {
|
|
10872
10872
|
let e = this.map, t = this.syncInProgress;
|
|
10873
|
-
|
|
10873
|
+
T.logAction(this.logger, T.LOG_MINOR, "PresenceMap.startSync()", "channel = " + this.presence.channel.name + "; syncInProgress = " + t), this.syncInProgress || (this.residualMembers = te(e), this.setInProgress(!0));
|
|
10874
10874
|
}
|
|
10875
10875
|
endSync() {
|
|
10876
10876
|
let e = this.map, t = this.syncInProgress;
|
|
10877
|
-
if (
|
|
10877
|
+
if (T.logAction(this.logger, T.LOG_MINOR, "PresenceMap.endSync()", "channel = " + this.presence.channel.name + "; syncInProgress = " + t), t) {
|
|
10878
10878
|
for (let t in e) e[t].action === "absent" && delete e[t];
|
|
10879
10879
|
this.presence._synthesizeLeaves(he(this.residualMembers));
|
|
10880
10880
|
for (let t in this.residualMembers) delete e[t];
|
|
@@ -10884,13 +10884,13 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10884
10884
|
}
|
|
10885
10885
|
async waitSync() {
|
|
10886
10886
|
let e = this.syncInProgress;
|
|
10887
|
-
|
|
10887
|
+
T.logAction(this.logger, T.LOG_MINOR, "PresenceMap.waitSync()", "channel = " + this.presence.channel.name + "; syncInProgress = " + e), e && await this.once("sync");
|
|
10888
10888
|
}
|
|
10889
10889
|
clear() {
|
|
10890
10890
|
this.map = {}, this.setInProgress(!1), this.residualMembers = null;
|
|
10891
10891
|
}
|
|
10892
10892
|
setInProgress(e) {
|
|
10893
|
-
|
|
10893
|
+
T.logAction(this.logger, T.LOG_MICRO, "PresenceMap.setInProgress()", "inProgress = " + e), this.syncInProgress = e, this.presence.syncComplete = !e;
|
|
10894
10894
|
}
|
|
10895
10895
|
};
|
|
10896
10896
|
function Qr(e) {
|
|
@@ -10937,7 +10937,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10937
10937
|
async _enterOrUpdateClient(e, t, n, r) {
|
|
10938
10938
|
let i = this.channel;
|
|
10939
10939
|
if (!i.connectionManager.activeState()) throw i.connectionManager.getError();
|
|
10940
|
-
|
|
10940
|
+
T.logAction(this.logger, T.LOG_MICRO, "RealtimePresence." + r + "Client()", "channel = " + i.name + ", id = " + e + ", client = " + (t || "(implicit) " + Qr(this)));
|
|
10941
10941
|
let a = An.fromData(n);
|
|
10942
10942
|
a.action = r, e && (a.id = e), t && (a.clientId = t);
|
|
10943
10943
|
let o = await a.encode(i.channelOptions);
|
|
@@ -10972,7 +10972,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
10972
10972
|
async leaveClient(e, t) {
|
|
10973
10973
|
let n = this.channel;
|
|
10974
10974
|
if (!n.connectionManager.activeState()) throw n.connectionManager.getError();
|
|
10975
|
-
|
|
10975
|
+
T.logAction(this.logger, T.LOG_MICRO, "RealtimePresence.leaveClient()", "leaving; channel = " + this.channel.name + ", client = " + e);
|
|
10976
10976
|
let r = An.fromData(t);
|
|
10977
10977
|
r.action = "leave", e && (r.clientId = e);
|
|
10978
10978
|
let i = await r.encode(n.channelOptions);
|
|
@@ -11016,7 +11016,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11016
11016
|
remediation: "Include \"presence_subscribe\" in the channel modes: realtime.channels.get(name, { modes: [\"presence_subscribe\", ...] }), or call channel.setOptions({ modes: [...] }) on an existing channel to trigger a reattach. Alternatively, omit modes entirely and ensure your token/API-key capability permits subscribe on this channel. If you have the Ably CLI installed, `ably auth keys list` shows your key's capabilities."
|
|
11017
11017
|
});
|
|
11018
11018
|
if (this.channel.client.options.strictMode === !0) throw e;
|
|
11019
|
-
|
|
11019
|
+
T.logActionNoStrip(this.logger, T.LOG_ERROR, "RealtimePresence.get()", e.message + "; remediation=" + e.remediation + T.silentFailureLogSuffix());
|
|
11020
11020
|
}
|
|
11021
11021
|
let r = this.members;
|
|
11022
11022
|
return t && await r.waitSync(), n(this.members);
|
|
@@ -11025,7 +11025,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11025
11025
|
return we(e, 0), this._historyImpl(e[0]);
|
|
11026
11026
|
}
|
|
11027
11027
|
async _historyImpl(e) {
|
|
11028
|
-
|
|
11028
|
+
T.logAction(this.logger, T.LOG_MICRO, "RealtimePresence.history()", "channel = " + this.name);
|
|
11029
11029
|
let t = this.channel.client.rest.presenceMixin;
|
|
11030
11030
|
if (e && e.untilAttach) if (this.channel.state === "attached") delete e.untilAttach, e.from_serial = this.channel.properties.attachSerial;
|
|
11031
11031
|
else throw new O({
|
|
@@ -11037,7 +11037,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11037
11037
|
return t.history(this, e);
|
|
11038
11038
|
}
|
|
11039
11039
|
setPresence(e, t, n) {
|
|
11040
|
-
|
|
11040
|
+
T.logAction(this.logger, T.LOG_MICRO, "RealtimePresence.setPresence()", "received presence for " + e.length + " participants; syncChannelSerial = " + n);
|
|
11041
11041
|
let r, i, a = this.members, o = this._myMembers, s = [], c = this.channel.connectionManager.connectionId;
|
|
11042
11042
|
t && (this.members.startSync(), n && (i = n.match(/^[\w-]+:(.*)$/)) && (r = i[1]));
|
|
11043
11043
|
for (let t of e) switch (t.action) {
|
|
@@ -11055,12 +11055,12 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11055
11055
|
}
|
|
11056
11056
|
}
|
|
11057
11057
|
onAttached(e) {
|
|
11058
|
-
|
|
11058
|
+
T.logAction(this.logger, T.LOG_MINOR, "RealtimePresence.onAttached()", "channel = " + this.channel.name + ", hasPresence = " + e), e ? this.members.startSync() : (this._synthesizeLeaves(this.members.values()), this.members.clear()), this._ensureMyMembersPresent();
|
|
11059
11059
|
let t = this.pendingPresence, n = t.length;
|
|
11060
11060
|
if (n) {
|
|
11061
11061
|
this.pendingPresence = [];
|
|
11062
11062
|
let e = [], r = pt.create(this.logger);
|
|
11063
|
-
|
|
11063
|
+
T.logAction(this.logger, T.LOG_MICRO, "RealtimePresence.onAttached", "sending " + n + " queued presence messages");
|
|
11064
11064
|
for (let i = 0; i < n; i++) {
|
|
11065
11065
|
let n = t[i];
|
|
11066
11066
|
e.push(n.presence), r.push(n.callback);
|
|
@@ -11080,7 +11080,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11080
11080
|
}
|
|
11081
11081
|
failPendingPresence(e) {
|
|
11082
11082
|
if (this.pendingPresence.length) {
|
|
11083
|
-
|
|
11083
|
+
T.logAction(this.logger, T.LOG_MINOR, "RealtimeChannel.failPendingPresence", "channel; name = " + this.channel.name + ", err = " + Te(e));
|
|
11084
11084
|
for (let t = 0; t < this.pendingPresence.length; t++) try {
|
|
11085
11085
|
this.pendingPresence[t].callback(e);
|
|
11086
11086
|
} catch {}
|
|
@@ -11100,7 +11100,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11100
11100
|
let e = this._myMembers, t = this.channel.connectionManager.connectionId;
|
|
11101
11101
|
for (let n in e.map) {
|
|
11102
11102
|
let r = e.map[n];
|
|
11103
|
-
|
|
11103
|
+
T.logAction(this.logger, T.LOG_MICRO, "RealtimePresence._ensureMyMembersPresent()", "Auto-reentering clientId \"" + r.clientId + "\" into the presence set");
|
|
11104
11104
|
let i = r.connectionId === t ? r.id : void 0;
|
|
11105
11105
|
this._enterOrUpdateClient(i, r.clientId, r.data, "enter").catch((e) => {
|
|
11106
11106
|
let t = new O({
|
|
@@ -11110,7 +11110,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11110
11110
|
cause: e,
|
|
11111
11111
|
remediation: "Listen for the channel \"update\" event and call presence.enter(...) again once the channel is attached. For a member entered on behalf of another clientId, call presence.enterClient(clientId, data) instead."
|
|
11112
11112
|
});
|
|
11113
|
-
|
|
11113
|
+
T.logAction(this.logger, T.LOG_ERROR, "RealtimePresence._ensureMyMembersPresent()", "Presence auto re-enter failed; reason = " + Te(e));
|
|
11114
11114
|
let n = new xr(this.channel.state, this.channel.state, !0, !1, t);
|
|
11115
11115
|
this.channel.emit("update", n);
|
|
11116
11116
|
});
|
|
@@ -11160,13 +11160,13 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11160
11160
|
return "WebSocketTransport; uri=" + this.uri;
|
|
11161
11161
|
}
|
|
11162
11162
|
connect() {
|
|
11163
|
-
|
|
11163
|
+
T.logAction(this.logger, T.LOG_MINOR, "WebSocketTransport.connect()", "starting"), Lr.prototype.connect.call(this);
|
|
11164
11164
|
let e = this, t = this.params, n = t.options, r = (n.tls ? "wss://" : "ws://") + this.wsHost + ":" + I.getPort(n) + "/";
|
|
11165
|
-
|
|
11165
|
+
T.logAction(this.logger, T.LOG_MINOR, "WebSocketTransport.connect()", "uri: " + r), je(this.auth.getAuthParams(), function(n, i) {
|
|
11166
11166
|
if (e.isDisposed) return;
|
|
11167
11167
|
let a = "";
|
|
11168
11168
|
for (let e in i) a += " " + e + ": " + i[e] + ";";
|
|
11169
|
-
if (
|
|
11169
|
+
if (T.logAction(e.logger, T.LOG_MINOR, "WebSocketTransport.connect()", "authParams:" + a + " err: " + n), n) {
|
|
11170
11170
|
e.disconnect(n);
|
|
11171
11171
|
return;
|
|
11172
11172
|
}
|
|
@@ -11185,56 +11185,56 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11185
11185
|
e.onActivity();
|
|
11186
11186
|
});
|
|
11187
11187
|
} catch (t) {
|
|
11188
|
-
|
|
11188
|
+
T.logAction(e.logger, T.LOG_ERROR, "WebSocketTransport.connect()", "Unexpected exception creating websocket: err = " + (t.stack || t.message)), e.disconnect(t);
|
|
11189
11189
|
}
|
|
11190
11190
|
});
|
|
11191
11191
|
}
|
|
11192
11192
|
send(e) {
|
|
11193
11193
|
let t = this.wsConnection;
|
|
11194
11194
|
if (!t) {
|
|
11195
|
-
|
|
11195
|
+
T.logAction(this.logger, T.LOG_ERROR, "WebSocketTransport.send()", "No socket connection");
|
|
11196
11196
|
return;
|
|
11197
11197
|
}
|
|
11198
11198
|
try {
|
|
11199
11199
|
t.send(pr(e, this.connectionManager.realtime._MsgPack, this.params.format));
|
|
11200
11200
|
} catch (e) {
|
|
11201
11201
|
let t = "Exception from ws connection when trying to send: " + Te(e);
|
|
11202
|
-
|
|
11202
|
+
T.logAction(this.logger, T.LOG_ERROR, "WebSocketTransport.send()", t), this.finish("disconnected", new O(t, 5e4, 500));
|
|
11203
11203
|
}
|
|
11204
11204
|
}
|
|
11205
11205
|
onWsData(e) {
|
|
11206
|
-
|
|
11206
|
+
T.logAction(this.logger, T.LOG_MICRO, "WebSocketTransport.onWsData()", "data received; length = " + e.length + "; type = " + typeof e);
|
|
11207
11207
|
try {
|
|
11208
11208
|
this.onProtocolMessage(J(e, this.connectionManager.realtime._MsgPack, this.connectionManager.realtime._RealtimePresence, this.connectionManager.realtime._Annotations, this.connectionManager.realtime._liveObjectsPlugin, this.format));
|
|
11209
11209
|
} catch (e) {
|
|
11210
|
-
|
|
11210
|
+
T.logAction(this.logger, T.LOG_ERROR, "WebSocketTransport.onWsData()", "Unexpected exception handing channel message: " + e.stack);
|
|
11211
11211
|
}
|
|
11212
11212
|
}
|
|
11213
11213
|
onWsOpen() {
|
|
11214
|
-
|
|
11214
|
+
T.logAction(this.logger, T.LOG_MINOR, "WebSocketTransport.onWsOpen()", "opened WebSocket"), this.emit("preconnect");
|
|
11215
11215
|
}
|
|
11216
11216
|
onWsClose(e) {
|
|
11217
11217
|
let t, n;
|
|
11218
11218
|
if (typeof e == "object" ? (n = e.code, t = e.wasClean || n === 1e3) : (n = e, t = n == 1e3), delete this.wsConnection, t) {
|
|
11219
|
-
|
|
11219
|
+
T.logAction(this.logger, T.LOG_MINOR, "WebSocketTransport.onWsClose()", "Cleanly closed WebSocket");
|
|
11220
11220
|
let e = new O("Websocket closed", 80003, 400);
|
|
11221
11221
|
this.finish("disconnected", e);
|
|
11222
11222
|
} else {
|
|
11223
11223
|
let e = "Unclean disconnection of WebSocket ; code = " + n, t = new O(e, 80003, 400);
|
|
11224
|
-
|
|
11224
|
+
T.logAction(this.logger, T.LOG_MINOR, "WebSocketTransport.onWsClose()", e), this.finish("disconnected", t);
|
|
11225
11225
|
}
|
|
11226
11226
|
this.emit("disposed");
|
|
11227
11227
|
}
|
|
11228
11228
|
onWsError(e) {
|
|
11229
|
-
|
|
11229
|
+
T.logAction(this.logger, T.LOG_MINOR, "WebSocketTransport.onError()", "Error from WebSocket: " + e.message), b.Config.nextTick(() => {
|
|
11230
11230
|
this.disconnect(Error(e.message));
|
|
11231
11231
|
});
|
|
11232
11232
|
}
|
|
11233
11233
|
dispose() {
|
|
11234
|
-
|
|
11234
|
+
T.logAction(this.logger, T.LOG_MINOR, "WebSocketTransport.dispose()", ""), this.isDisposed = !0;
|
|
11235
11235
|
let e = this.wsConnection;
|
|
11236
11236
|
e && (e.onmessage = function() {}, delete this.wsConnection, b.Config.nextTick(() => {
|
|
11237
|
-
if (
|
|
11237
|
+
if (T.logAction(this.logger, T.LOG_MICRO, "WebSocketTransport.dispose()", "closing websocket"), !e) throw Error("WebSocketTransport.dispose(): wsConnection is not defined");
|
|
11238
11238
|
e.close();
|
|
11239
11239
|
}));
|
|
11240
11240
|
}
|
|
@@ -11278,7 +11278,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11278
11278
|
constructor(t) {
|
|
11279
11279
|
let n = e._MsgPack;
|
|
11280
11280
|
if (!n) throw Error("Expected DefaultRealtime._MsgPack to have been set");
|
|
11281
|
-
super(I.objectifyOptions(t, !0, "Realtime",
|
|
11281
|
+
super(I.objectifyOptions(t, !0, "Realtime", T.defaultLogger, f(d({}, Zn), {
|
|
11282
11282
|
Crypto: e.Crypto ?? void 0,
|
|
11283
11283
|
MsgPack: n,
|
|
11284
11284
|
RealtimePresence: {
|
|
@@ -11304,7 +11304,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11304
11304
|
this._Crypto = e;
|
|
11305
11305
|
}
|
|
11306
11306
|
};
|
|
11307
|
-
ai.Utils =
|
|
11307
|
+
ai.Utils = E, ai.ConnectionManager = Gr, ai.ProtocolMessage = br, ai._Crypto = null, ai.Message = Qn, ai.PresenceMessage = $n, ai.Annotation = cr, ai._MsgPack = null, ai._Http = Pt, ai._PresenceMap = Zr, ai._MessageEncoding = Zt;
|
|
11308
11308
|
var oi = ai, si = Uint8Array, ci = Uint32Array, li = Math.pow, ui = new ci(8), di = [], fi = new ci(64);
|
|
11309
11309
|
function pi(e) {
|
|
11310
11310
|
return (e - (e | 0)) * li(2, 32) | 0;
|
|
@@ -11502,7 +11502,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11502
11502
|
return r;
|
|
11503
11503
|
}
|
|
11504
11504
|
async encrypt(e) {
|
|
11505
|
-
|
|
11505
|
+
T.logAction(this.logger, T.LOG_MICRO, "CBCCipher.encrypt()", "");
|
|
11506
11506
|
let t = await this.getIv(), n = await crypto.subtle.importKey("raw", this.key, this.webCryptoAlgorithm, !1, ["encrypt"]), r = await crypto.subtle.encrypt({
|
|
11507
11507
|
name: this.webCryptoAlgorithm,
|
|
11508
11508
|
iv: t
|
|
@@ -11510,7 +11510,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11510
11510
|
return this.concat(t, r);
|
|
11511
11511
|
}
|
|
11512
11512
|
async decrypt(e) {
|
|
11513
|
-
|
|
11513
|
+
T.logAction(this.logger, T.LOG_MICRO, "CBCCipher.decrypt()", "");
|
|
11514
11514
|
let n = t.toArrayBuffer(e), r = n.slice(0, 16), i = n.slice(16), a = await crypto.subtle.importKey("raw", this.key, this.webCryptoAlgorithm, !1, ["decrypt"]);
|
|
11515
11515
|
return crypto.subtle.decrypt({
|
|
11516
11516
|
name: this.webCryptoAlgorithm,
|
|
@@ -11550,19 +11550,19 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11550
11550
|
}, this.checkConnectivity = e?.options.disableConnectivityCheck ? async function() {
|
|
11551
11551
|
return !0;
|
|
11552
11552
|
} : async function() {
|
|
11553
|
-
|
|
11553
|
+
T.logAction(this.logger, T.LOG_MICRO, "(XHRRequest)Http.checkConnectivity()", "Sending; " + t);
|
|
11554
11554
|
let e = await this.doUri(ht.Get, t, null, null, n), i = !1;
|
|
11555
|
-
return i = r ? !e.error && e.body?.replace(/\n/, "") == "yes" : !e.error && _t(e.statusCode),
|
|
11555
|
+
return i = r ? !e.error && e.body?.replace(/\n/, "") == "yes" : !e.error && _t(e.statusCode), T.logAction(this.logger, T.LOG_MICRO, "(XHRRequest)Http.checkConnectivity()", "Result: " + i), i;
|
|
11556
11556
|
}) : b.Config.fetchSupported && o ? (this.supportsAuthHeaders = !0, this.Request = async (t, n, r, i, a) => o(t, e ?? null, n, r, i, a), this.checkConnectivity = e?.options.disableConnectivityCheck ? async function() {
|
|
11557
11557
|
return !0;
|
|
11558
11558
|
} : async function() {
|
|
11559
|
-
|
|
11559
|
+
T.logAction(this.logger, T.LOG_MICRO, "(Fetch)Http.checkConnectivity()", "Sending; " + t);
|
|
11560
11560
|
let e = await this.doUri(ht.Get, t, null, null, null), n = !e.error && e.body?.replace(/\n/, "") == "yes";
|
|
11561
|
-
return
|
|
11561
|
+
return T.logAction(this.logger, T.LOG_MICRO, "(Fetch)Http.checkConnectivity()", "Result: " + n), n;
|
|
11562
11562
|
}) : this.Request = async () => ({ error: s ? new k("no supported HTTP transports available", null, 400) : Di() });
|
|
11563
11563
|
}
|
|
11564
11564
|
get logger() {
|
|
11565
|
-
return this.client?.logger ??
|
|
11565
|
+
return this.client?.logger ?? T.defaultLogger;
|
|
11566
11566
|
}
|
|
11567
11567
|
async doUri(e, t, n, r, i) {
|
|
11568
11568
|
return this.Request ? this.Request(e, t, n, i, r) : { error: new k("Request invoked before assigned to", null, 500) };
|
|
@@ -11699,11 +11699,11 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11699
11699
|
}, this.stream = "stream" in n ? n.stream : !0, this.sendRequest = null, this.recvRequest = null, this.pendingCallback = null, this.pendingItems = null;
|
|
11700
11700
|
}
|
|
11701
11701
|
connect() {
|
|
11702
|
-
|
|
11702
|
+
T.logAction(this.logger, T.LOG_MINOR, "CometTransport.connect()", "starting"), Lr.prototype.connect.call(this);
|
|
11703
11703
|
let e = this.params, t = e.options, n = e.host || t.primaryDomain, r = I.getPort(t), i = t.tls ? "https://" : "http://";
|
|
11704
11704
|
this.baseUri = i + n + ":" + r + "/comet/";
|
|
11705
11705
|
let a = this.baseUri + "connect";
|
|
11706
|
-
|
|
11706
|
+
T.logAction(this.logger, T.LOG_MINOR, "CometTransport.connect()", "uri: " + a), je(this.auth.getAuthParams(), (e, t) => {
|
|
11707
11707
|
if (e) {
|
|
11708
11708
|
this.disconnect(e);
|
|
11709
11709
|
return;
|
|
@@ -11711,7 +11711,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11711
11711
|
if (this.isDisposed) return;
|
|
11712
11712
|
this.authParams = t;
|
|
11713
11713
|
let n = this.params.getConnectParams(t);
|
|
11714
|
-
"stream" in n && (this.stream = n.stream),
|
|
11714
|
+
"stream" in n && (this.stream = n.stream), T.logAction(this.logger, T.LOG_MINOR, "CometTransport.connect()", "connectParams:" + be(n));
|
|
11715
11715
|
let r = !1, i = this.recvRequest = this.createRequest(a, null, n, null, this.stream ? Ei.REQ_RECV_STREAM : Ei.REQ_RECV);
|
|
11716
11716
|
i.on("data", (e) => {
|
|
11717
11717
|
this.recvRequest && (r || (r = !0, this.emit("preconnect")), this.onData(e));
|
|
@@ -11727,22 +11727,22 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11727
11727
|
});
|
|
11728
11728
|
}
|
|
11729
11729
|
requestClose() {
|
|
11730
|
-
|
|
11730
|
+
T.logAction(this.logger, T.LOG_MINOR, "CometTransport.requestClose()"), this._requestCloseOrDisconnect(!0);
|
|
11731
11731
|
}
|
|
11732
11732
|
requestDisconnect() {
|
|
11733
|
-
|
|
11733
|
+
T.logAction(this.logger, T.LOG_MINOR, "CometTransport.requestDisconnect()"), this._requestCloseOrDisconnect(!1);
|
|
11734
11734
|
}
|
|
11735
11735
|
_requestCloseOrDisconnect(e) {
|
|
11736
11736
|
let t = e ? this.closeUri : this.disconnectUri;
|
|
11737
11737
|
if (t) {
|
|
11738
11738
|
let n = this.createRequest(t, null, this.authParams, null, Ei.REQ_SEND);
|
|
11739
11739
|
n.on("complete", (t) => {
|
|
11740
|
-
t && (
|
|
11740
|
+
t && (T.logAction(this.logger, T.LOG_ERROR, "CometTransport.request" + (e ? "Close()" : "Disconnect()"), "request returned err = " + Te(t)), this.finish("disconnected", t));
|
|
11741
11741
|
}), n.exec();
|
|
11742
11742
|
}
|
|
11743
11743
|
}
|
|
11744
11744
|
dispose() {
|
|
11745
|
-
|
|
11745
|
+
T.logAction(this.logger, T.LOG_MINOR, "CometTransport.dispose()", ""), this.isDisposed || (this.isDisposed = !0, this.recvRequest &&= (T.logAction(this.logger, T.LOG_MINOR, "CometTransport.dispose()", "aborting recv request"), this.recvRequest.abort(), null), this.finish("disconnected", Pr.disconnected()), b.Config.nextTick(() => {
|
|
11746
11746
|
this.emit("disposed");
|
|
11747
11747
|
}));
|
|
11748
11748
|
}
|
|
@@ -11751,7 +11751,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11751
11751
|
let t = e.connectionDetails?.connectionKey;
|
|
11752
11752
|
Lr.prototype.onConnect.call(this, e);
|
|
11753
11753
|
let n = this.baseUri + t;
|
|
11754
|
-
|
|
11754
|
+
T.logAction(this.logger, T.LOG_MICRO, "CometTransport.onConnect()", "baseUri = " + n), this.sendUri = n + "/send", this.recvUri = n + "/recv", this.closeUri = n + "/close", this.disconnectUri = n + "/disconnect";
|
|
11755
11755
|
}
|
|
11756
11756
|
send(e) {
|
|
11757
11757
|
if (this.sendRequest) {
|
|
@@ -11768,7 +11768,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11768
11768
|
sendItems(e) {
|
|
11769
11769
|
let t = this.sendRequest = this.createRequest(this.sendUri, null, this.authParams, this.encodeRequest(e), Ei.REQ_SEND);
|
|
11770
11770
|
t.on("complete", (e, t) => {
|
|
11771
|
-
if (e &&
|
|
11771
|
+
if (e && T.logAction(this.logger, T.LOG_ERROR, "CometTransport.sendItems()", "on complete: err = " + Te(e)), this.sendRequest = null, e) {
|
|
11772
11772
|
e.code ? this.onData(zi(e)) : this.disconnect(e);
|
|
11773
11773
|
return;
|
|
11774
11774
|
}
|
|
@@ -11797,7 +11797,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11797
11797
|
let t = this.decodeResponse(e);
|
|
11798
11798
|
if (t && t.length) for (let e = 0; e < t.length; e++) this.onProtocolMessage(hr(t[e], this.connectionManager.realtime._RealtimePresence, this.connectionManager.realtime._Annotations, this.connectionManager.realtime._liveObjectsPlugin));
|
|
11799
11799
|
} catch (e) {
|
|
11800
|
-
|
|
11800
|
+
T.logAction(this.logger, T.LOG_ERROR, "CometTransport.onData()", "Unexpected exception handing channel event: " + e.stack);
|
|
11801
11801
|
}
|
|
11802
11802
|
}
|
|
11803
11803
|
encodeRequest(e) {
|
|
@@ -11850,7 +11850,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
11850
11850
|
for (let t in e) i.setRequestHeader(t, e[t]);
|
|
11851
11851
|
let c = (e, t, n, r) => {
|
|
11852
11852
|
let i = t + " (event type: " + e.type + ")";
|
|
11853
|
-
(this == null ? void 0 : this.xhr)?.statusText && (i += ", current statusText is " + this.xhr.statusText),
|
|
11853
|
+
(this == null ? void 0 : this.xhr)?.statusText && (i += ", current statusText is " + this.xhr.statusText), T.logAction(this.logger, T.LOG_ERROR, "Request.on" + e.type + "()", i), this.complete(new k(i, n, r));
|
|
11854
11854
|
};
|
|
11855
11855
|
i.onerror = (e) => {
|
|
11856
11856
|
c(e, "XHR error occurred", null, 400);
|
|
@@ -12238,7 +12238,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
12238
12238
|
}, xa = wi(Li, Ci);
|
|
12239
12239
|
b.Crypto = xa, b.BufferUtils = Ci, b.Http = ki, b.Config = Li, b.Transports = Zi, b.WebStorage = Mi;
|
|
12240
12240
|
for (let e of [Or, oi]) e.Crypto = xa, e._MsgPack = ha;
|
|
12241
|
-
ki.bundledRequestImplementations = ba,
|
|
12241
|
+
ki.bundledRequestImplementations = ba, T.initLogHandlers(), b.Defaults = ft(Qi), b.Config.agent && (b.Defaults.agent += " " + b.Config.agent);
|
|
12242
12242
|
var Sa = {
|
|
12243
12243
|
ErrorInfo: O,
|
|
12244
12244
|
Rest: Or,
|
|
@@ -12260,7 +12260,7 @@ var Gs = /* @__PURE__ */ s(((e, t) => {
|
|
|
12260
12260
|
};
|
|
12261
12261
|
function cc(e, t) {
|
|
12262
12262
|
Ye(t, !0), ri(e, sc);
|
|
12263
|
-
let n = $(t, "apiOrigin", 7), r = $(t, "slug", 7), i = $(t, "session", 7), a = $(t, "lang", 7), o = $(t, "currencySymbol", 7), s = $(t, "variant", 7), c = $(t, "host", 7), l = $(t, "onstatus", 7), d = $(t, "onstartover", 7), f = "sidon-booking-payment", p = /* @__PURE__ */ V(null), m = /* @__PURE__ */ L(() => Va(a(), J(p)?.booking.locale)), h = /* @__PURE__ */ L(() => Co(J(m))), g = /* @__PURE__ */ V(an([])), _ = /* @__PURE__ */ V(null), v = /* @__PURE__ */ V(null), y = /* @__PURE__ */ V(!1), b = /* @__PURE__ */ V(!1), x = /* @__PURE__ */ V(!1), S = /* @__PURE__ */ V(!1),
|
|
12263
|
+
let n = $(t, "apiOrigin", 7), r = $(t, "slug", 7), i = $(t, "session", 7), a = $(t, "lang", 7), o = $(t, "currencySymbol", 7), s = $(t, "variant", 7), c = $(t, "host", 7), l = $(t, "onstatus", 7), d = $(t, "onstartover", 7), f = "sidon-booking-payment", p = /* @__PURE__ */ V(null), m = /* @__PURE__ */ L(() => Va(a(), J(p)?.booking.locale)), h = /* @__PURE__ */ L(() => Co(J(m))), g = /* @__PURE__ */ V(an([])), _ = /* @__PURE__ */ V(null), v = /* @__PURE__ */ V(null), y = /* @__PURE__ */ V(!1), b = /* @__PURE__ */ V(!1), x = /* @__PURE__ */ V(!1), S = /* @__PURE__ */ V(!1), ee = /* @__PURE__ */ V(null), C = null, w = null, T = null, E = !1, D = /* @__PURE__ */ V(!1), O = !1, k = 0, A = !1, j = null, te, ne = (e) => e instanceof ss && e.status < 400 ? J(h).networkError : e instanceof Error ? e.message : String(e), re = (e) => ka(e)?.toLocaleDateString(J(m), {
|
|
12264
12264
|
day: "numeric",
|
|
12265
12265
|
month: "short",
|
|
12266
12266
|
year: "numeric"
|
|
@@ -12276,31 +12276,31 @@ function cc(e, t) {
|
|
|
12276
12276
|
if (A || e !== k) return;
|
|
12277
12277
|
H(p, t, !0), H(_, null);
|
|
12278
12278
|
let a = t.booking.status;
|
|
12279
|
-
if (a !==
|
|
12280
|
-
let e =
|
|
12281
|
-
|
|
12279
|
+
if (a !== T) {
|
|
12280
|
+
let e = T;
|
|
12281
|
+
T = a, l()(a, e);
|
|
12282
12282
|
}
|
|
12283
|
-
a === "hold" ? t.payment && !
|
|
12283
|
+
a === "hold" ? t.payment && !E && (E = !0, ae(t.payment)) : se();
|
|
12284
12284
|
} catch (t) {
|
|
12285
12285
|
if (A || e !== k || J(p)) return;
|
|
12286
12286
|
H(_, t instanceof ss && t.status === 404 ? J(h).bookingNotFound : J(h).loadFailed, !0);
|
|
12287
12287
|
}
|
|
12288
12288
|
}
|
|
12289
12289
|
async function ae(e) {
|
|
12290
|
-
H(
|
|
12290
|
+
H(D, !1);
|
|
12291
12291
|
try {
|
|
12292
12292
|
await _s(n(), r(), i()), await M();
|
|
12293
12293
|
} catch (t) {
|
|
12294
12294
|
let n = no(t instanceof ss ? t.status : 0);
|
|
12295
|
-
n === "lapsed" ? H(b, !0) : n === "card" ? await oe(e) : (H(v, ne(t), !0), H(
|
|
12295
|
+
n === "lapsed" ? H(b, !0) : n === "card" ? await oe(e) : (H(v, ne(t), !0), H(D, !0), E = !1);
|
|
12296
12296
|
}
|
|
12297
12297
|
}
|
|
12298
12298
|
async function oe(e) {
|
|
12299
|
-
if (
|
|
12299
|
+
if (w || (H(x, !0), await mr(), A || !J(ee))) return;
|
|
12300
12300
|
let t = document.createElement("slot");
|
|
12301
|
-
t.name = f, J(
|
|
12301
|
+
t.name = f, J(ee).appendChild(t);
|
|
12302
12302
|
let n = document.createElement("div");
|
|
12303
|
-
n.slot = f, c().appendChild(n),
|
|
12303
|
+
n.slot = f, c().appendChild(n), w = n;
|
|
12304
12304
|
try {
|
|
12305
12305
|
let t = await Xo({
|
|
12306
12306
|
publishableKey: e.publishableKey,
|
|
@@ -12309,21 +12309,21 @@ function cc(e, t) {
|
|
|
12309
12309
|
mount: n,
|
|
12310
12310
|
colorPrimary: getComputedStyle(c()).getPropertyValue("--brand-navy").trim() || "#16365b"
|
|
12311
12311
|
});
|
|
12312
|
-
if (
|
|
12313
|
-
|
|
12312
|
+
if (w !== n) return t.destroy();
|
|
12313
|
+
C = t, H(S, !0);
|
|
12314
12314
|
} catch (e) {
|
|
12315
12315
|
H(v, ne(e), !0);
|
|
12316
12316
|
}
|
|
12317
12317
|
}
|
|
12318
12318
|
function se() {
|
|
12319
|
-
|
|
12319
|
+
C?.destroy(), C = null, w?.remove(), w = null, H(x, !1), H(S, !1);
|
|
12320
12320
|
}
|
|
12321
12321
|
async function ce() {
|
|
12322
|
-
if (!
|
|
12322
|
+
if (!C || J(y)) return;
|
|
12323
12323
|
H(y, !0), H(v, null);
|
|
12324
12324
|
let e = null;
|
|
12325
12325
|
try {
|
|
12326
|
-
await
|
|
12326
|
+
await C.confirm();
|
|
12327
12327
|
} catch (t) {
|
|
12328
12328
|
e = t;
|
|
12329
12329
|
}
|
|
@@ -12466,20 +12466,20 @@ function cc(e, t) {
|
|
|
12466
12466
|
let t = /* @__PURE__ */ L(() => J(p).booking), a = /* @__PURE__ */ L(() => J(t).expired || J(b) ? "expired" : J(t).status);
|
|
12467
12467
|
var s = ac(), c = mn(s);
|
|
12468
12468
|
let l;
|
|
12469
|
-
var u = U(c), f = U(u), _ = U(f),
|
|
12469
|
+
var u = U(c), f = U(u), _ = U(f), C = (e) => {
|
|
12470
12470
|
var t = Ys();
|
|
12471
12471
|
Ve(), X(e, t);
|
|
12472
|
-
},
|
|
12472
|
+
}, w = (e) => {
|
|
12473
12473
|
X(e, Xs());
|
|
12474
|
-
},
|
|
12474
|
+
}, T = (e) => {
|
|
12475
12475
|
X(e, Zs());
|
|
12476
12476
|
};
|
|
12477
12477
|
Q(_, (e) => {
|
|
12478
|
-
J(a) === "hold" ? e(
|
|
12478
|
+
J(a) === "hold" ? e(C) : J(a) === "pending" || J(a) === "confirmed" ? e(w, 1) : e(T, -1);
|
|
12479
12479
|
}), F(f), F(u);
|
|
12480
|
-
var
|
|
12481
|
-
F(
|
|
12482
|
-
var k = W(
|
|
12480
|
+
var E = W(u, 2), O = U(E, !0);
|
|
12481
|
+
F(E);
|
|
12482
|
+
var k = W(E, 2), A = U(k, !0);
|
|
12483
12483
|
F(k);
|
|
12484
12484
|
var j = W(k, 2), te = U(j, !0);
|
|
12485
12485
|
F(j);
|
|
@@ -12500,7 +12500,7 @@ function cc(e, t) {
|
|
|
12500
12500
|
var d = W(l, 2), f = U(d, !0);
|
|
12501
12501
|
F(d);
|
|
12502
12502
|
var p = W(d, 2);
|
|
12503
|
-
Oi(p, (e) => H(
|
|
12503
|
+
Oi(p, (e) => H(ee, e), () => J(ee));
|
|
12504
12504
|
var g = W(p, 2), _ = U(g, !0);
|
|
12505
12505
|
F(g), F(n), G((e, t) => {
|
|
12506
12506
|
Z(a, J(h).paymentHold), Z(c, `${J(h).total ?? ""} ${e ?? ""}`), Z(u, J(h).paymentNote), Z(f, t), g.disabled = J(y) || !J(S), Z(_, J(y) ? J(h).sending : J(h).payAndSend);
|
|
@@ -12629,7 +12629,7 @@ function cc(e, t) {
|
|
|
12629
12629
|
}), X(e, t);
|
|
12630
12630
|
};
|
|
12631
12631
|
Q(Je, (e) => {
|
|
12632
|
-
J(
|
|
12632
|
+
J(D) && e(Ye);
|
|
12633
12633
|
});
|
|
12634
12634
|
var Xe = W(Je, 2), Ze = (e) => {
|
|
12635
12635
|
var t = ic(), n = U(t), r = (e) => {
|
|
@@ -12716,152 +12716,152 @@ function pc() {
|
|
|
12716
12716
|
}
|
|
12717
12717
|
//#endregion
|
|
12718
12718
|
//#region src/BookingWidget.svelte
|
|
12719
|
-
var mc = /* @__PURE__ */ Y("<div><!></div>"), hc = /* @__PURE__ */ Y("<div class=\"sbw-load-error svelte-h0br6q\" role=\"alert\"> </div>"), gc = /* @__PURE__ */ Y("<!> <!> <!> <!> <!>", 1), _c = /* @__PURE__ */ Y("<!> <div
|
|
12719
|
+
var mc = /* @__PURE__ */ Y("<div><!></div>"), hc = /* @__PURE__ */ Y("<div class=\"sbw-load-error svelte-h0br6q\" role=\"alert\"> </div>"), gc = /* @__PURE__ */ Y("<!> <!> <!> <!> <!>", 1), _c = /* @__PURE__ */ Y("<!> <div><!></div>", 1), vc = {
|
|
12720
12720
|
hash: "svelte-h0br6q",
|
|
12721
|
-
code: ":host {--sbw-radius: 10px;display:block;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;box-sizing:border-box;max-width:560px; /* fallback until the width prop's effect runs; see script */margin:0 auto;}:host .svelte-h0br6q {box-sizing:border-box;}.sbw-root.svelte-h0br6q {border-radius:var(--sbw-radius);overflow:hidden;box-shadow:0 8px 32px rgba(0, 0, 0, 0.16);}\n /* Inline, not a replacement for the card: the guest can still change\n dates or length, and the next successful load clears it. */.sbw-load-error.svelte-h0br6q {padding:16px 20px;font-size:14px;color:#cc4949;background:#fff;}\n /* Sits outside .sbw-root (not a child of it) specifically so map-width\n can be set to 100vw and actually break out full-bleed - .sbw-root's\n own overflow:hidden (for its rounded corners) would otherwise clip\n anything wider than the card right back down to the card's width,\n no matter what width/margin the child itself asks for. */.sbw-map-slot.svelte-h0br6q {border-radius:var(--sbw-radius) var(--sbw-radius) 0 0;overflow:hidden;}.sbw-map-slot--full-bleed.svelte-h0br6q {\n /* Standard full-bleed trick: escapes a centered ancestor of any width\n by sizing to the viewport and pulling back by the half-difference.\n Only correct when width is actually 100vw (see class:sbw-map-slot--\n full-bleed above) - applying this margin at any other width would\n misposition it instead of centering it. */margin-left:calc(50% - 50vw);margin-right:calc(50% - 50vw);border-radius:0;}"
|
|
12721
|
+
code: ":host {--sbw-radius: 10px;display:block;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;box-sizing:border-box;max-width:560px; /* fallback until the width prop's effect runs; see script */margin:0 auto;}:host .svelte-h0br6q {box-sizing:border-box;}.sbw-root.svelte-h0br6q {border-radius:var(--sbw-radius);overflow:hidden;box-shadow:0 8px 32px rgba(0, 0, 0, 0.16);}\n /* Inline, not a replacement for the card: the guest can still change\n dates or length, and the next successful load clears it. */.sbw-load-error.svelte-h0br6q {padding:16px 20px;font-size:14px;color:#cc4949;background:#fff;}\n /* Sits outside .sbw-root (not a child of it) specifically so map-width\n can be set to 100vw and actually break out full-bleed - .sbw-root's\n own overflow:hidden (for its rounded corners) would otherwise clip\n anything wider than the card right back down to the card's width,\n no matter what width/margin the child itself asks for. */.sbw-map-slot.svelte-h0br6q {border-radius:var(--sbw-radius) var(--sbw-radius) 0 0;overflow:hidden;}.sbw-map-slot--full-bleed.svelte-h0br6q {\n /* Standard full-bleed trick: escapes a centered ancestor of any width\n by sizing to the viewport and pulling back by the half-difference.\n Only correct when width is actually 100vw (see class:sbw-map-slot--\n full-bleed above) - applying this margin at any other width would\n misposition it instead of centering it. */margin-left:calc(50% - 50vw);margin-right:calc(50% - 50vw);border-radius:0;}\n /* Overlay: the card's negative-margin pull-up does the overlap, and its\n position/z-index paints it over the map's own positioned layers. */\n /* Below 768px overlay stacks; map-height/map-gap are sized for the\n overlay, so fall back to a half-screen map and a small gap. */\n @media (max-width: 767px) {.sbw-map-slot--overlay.svelte-h0br6q {height:50vh !important;margin-bottom:24px !important;}\n }\n @media (min-width: 768px) {.sbw-map-slot--overlay.svelte-h0br6q {margin-bottom:0 !important; /* beats the stacked inline margin */border-radius:0;}.sbw-root--overlay.svelte-h0br6q {position:relative;z-index:1;max-width:var(--sbw-card-width, 560px);margin-top:calc(var(--sbw-map-gap, 24px) - var(--sbw-map-h, 280px));margin-left:var(--sbw-card-inset, 24px);}\n }"
|
|
12722
12722
|
};
|
|
12723
12723
|
function yc(e, t) {
|
|
12724
12724
|
Ye(t, !0), ri(e, vc);
|
|
12725
|
-
let n = $(t, "marina", 7), r = $(t, "apiOrigin", 7, ""), i = $(t, "from", 7, ""), a = $(t, "to", 7, ""), o = $(t, "length", 7, 15), s = $(t, "berth", 7, ""), c = $(t, "locale", 7, ""), l = $(t, "currencySymbol", 7, ""), u = $(t, "variant", 7, "navy"), d = $(t, "mapsApiKey", 7, ""), f = $(t, "mapStyle", 7, "chart"), p = $(t, "mapHeight", 7, "280px"), m = $(t, "mapWidth", 7, "100%"), h = $(t, "mapGap", 7, "0px"), g = $(t, "width", 7, "560px"), _ = $(t, "logoMark", 7, null),
|
|
12726
|
-
function
|
|
12727
|
-
|
|
12725
|
+
let n = $(t, "marina", 7), r = $(t, "apiOrigin", 7, ""), i = $(t, "from", 7, ""), a = $(t, "to", 7, ""), o = $(t, "length", 7, 15), s = $(t, "berth", 7, ""), c = $(t, "locale", 7, ""), l = $(t, "currencySymbol", 7, ""), u = $(t, "variant", 7, "navy"), d = $(t, "mapsApiKey", 7, ""), f = $(t, "mapStyle", 7, "chart"), p = $(t, "mapHeight", 7, "280px"), m = $(t, "mapWidth", 7, "100%"), h = $(t, "mapGap", 7, "0px"), g = $(t, "width", 7, "560px"), _ = $(t, "layout", 7, "stacked"), v = $(t, "logoMark", 7, null), y = $(t, "marinaName", 7, ""), b = $(t, "otherMarinas", 23, () => []), x = $(t, "bookingId", 7), S = t.$$host;
|
|
12726
|
+
function ee(e, t) {
|
|
12727
|
+
S.dispatchEvent(new CustomEvent(e, {
|
|
12728
12728
|
detail: t,
|
|
12729
12729
|
bubbles: !0,
|
|
12730
12730
|
composed: !0
|
|
12731
12731
|
}));
|
|
12732
12732
|
}
|
|
12733
|
-
let C = /* @__PURE__ */ L(() => Ba(c())), w = /* @__PURE__ */ L(() => Co(J(C))), T = _r(() =>
|
|
12734
|
-
function
|
|
12733
|
+
let C = /* @__PURE__ */ L(() => Ba(c())), w = /* @__PURE__ */ L(() => Co(J(C))), T = _r(() => x() != null), E = /* @__PURE__ */ V(an(_r(() => T ? O() : uc(n())))), D = /* @__PURE__ */ V(an(_r(() => T || J(E) ? 3 : 1)));
|
|
12734
|
+
function O() {
|
|
12735
12735
|
let e = pc();
|
|
12736
12736
|
if (e) {
|
|
12737
12737
|
let t = {
|
|
12738
|
-
id:
|
|
12738
|
+
id: x() || e.id,
|
|
12739
12739
|
token: e.token
|
|
12740
12740
|
};
|
|
12741
12741
|
return dc(n(), t), t;
|
|
12742
12742
|
}
|
|
12743
12743
|
let t = uc(n());
|
|
12744
|
-
return t && (!
|
|
12744
|
+
return t && (!x() || t.id === x()) ? t : null;
|
|
12745
12745
|
}
|
|
12746
|
-
let
|
|
12746
|
+
let k = /* @__PURE__ */ V(an(_r(() => o() && o() > 0 ? o() : 15))), A = /* @__PURE__ */ V(an(_r(() => {
|
|
12747
12747
|
let e = ka(i());
|
|
12748
12748
|
if (e) return e;
|
|
12749
12749
|
let t = /* @__PURE__ */ new Date();
|
|
12750
12750
|
return t.setHours(0, 0, 0, 0), t;
|
|
12751
|
-
}))),
|
|
12751
|
+
}))), j = /* @__PURE__ */ V(an(_r(() => {
|
|
12752
12752
|
let e = ka(a());
|
|
12753
12753
|
if (e) return e;
|
|
12754
12754
|
let t = ka(i()) ?? new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0));
|
|
12755
12755
|
return new Date(t.getTime() + 2592e5);
|
|
12756
|
-
}))),
|
|
12756
|
+
}))), te = /* @__PURE__ */ V(null), ne = /* @__PURE__ */ V(""), re = /* @__PURE__ */ V(""), ie = /* @__PURE__ */ V(""), M = /* @__PURE__ */ V(""), ae = /* @__PURE__ */ V(null), oe = /* @__PURE__ */ V(""), se = /* @__PURE__ */ V(null), ce = /* @__PURE__ */ V(an([])), le = /* @__PURE__ */ V(null), ue = /* @__PURE__ */ V(0), de = /* @__PURE__ */ V(null), fe = /* @__PURE__ */ V(void 0), pe = /* @__PURE__ */ V(!1), me = /* @__PURE__ */ V(null), he = /* @__PURE__ */ V("#16365b"), ge = /* @__PURE__ */ V("#c9a86b");
|
|
12757
12757
|
Gr(() => {
|
|
12758
|
-
let e = getComputedStyle(
|
|
12759
|
-
H(
|
|
12758
|
+
let e = getComputedStyle(S);
|
|
12759
|
+
H(he, e.getPropertyValue("--brand-navy").trim() || J(he), !0), H(ge, e.getPropertyValue("--brand-gold").trim() || J(ge), !0);
|
|
12760
12760
|
}), Gr(() => {
|
|
12761
12761
|
let e = new ResizeObserver(() => {
|
|
12762
12762
|
window.dispatchEvent(new Event("resize"));
|
|
12763
12763
|
});
|
|
12764
|
-
return e.observe(
|
|
12764
|
+
return e.observe(S), () => e.disconnect();
|
|
12765
12765
|
}), Gr(() => {
|
|
12766
|
-
|
|
12766
|
+
_() === "overlay" ? (S.style.maxWidth = "none", S.style.setProperty("--sbw-card-width", g())) : S.style.maxWidth = g();
|
|
12767
12767
|
});
|
|
12768
|
-
let
|
|
12768
|
+
let _e = /* @__PURE__ */ L(() => !!d() && J(D) !== 3 && !J(le)), ve = /* @__PURE__ */ L(() => J(ae) != null && J(ae) > 0 ? J(ae) : null), ye = /* @__PURE__ */ L(() => (J(se)?.berths ?? []).filter((e) => e.status === "available")), be = /* @__PURE__ */ L(() => !J(ye).length || J(ye).some((e) => e.lengthM == null) ? 200 : Math.max(...J(ye).map((e) => e.lengthM ?? 0))), xe = /* @__PURE__ */ L(() => J(te) && J(ce).some((e) => e.label === J(te)) ? J(te) : to(J(ce))), Se = /* @__PURE__ */ L(() => J(ce).find((e) => e.label === J(xe)) ?? null), Ce = /* @__PURE__ */ L(() => J(Se)?.totalPrice == null ? null : io(J(Se).totalPrice, J(se)?.currency ?? null, l(), J(C))), we = !1;
|
|
12769
12769
|
wn(() => {
|
|
12770
|
-
|
|
12770
|
+
we || !J(ye).length || (we = !0, J(k) > J(be) && H(k, J(be), !0));
|
|
12771
12771
|
}), wn(() => {
|
|
12772
12772
|
let e = s();
|
|
12773
12773
|
_r(() => {
|
|
12774
|
-
J(D) === 1 && H(
|
|
12774
|
+
J(D) === 1 && H(te, e || null, !0);
|
|
12775
12775
|
});
|
|
12776
12776
|
});
|
|
12777
|
-
let
|
|
12777
|
+
let Te = /* @__PURE__ */ L(() => J(D) !== 3);
|
|
12778
12778
|
wn(() => {
|
|
12779
|
-
if (!J(
|
|
12780
|
-
let e = J(
|
|
12781
|
-
from: Oa(J(
|
|
12782
|
-
to: Oa(J(
|
|
12779
|
+
if (!J(Te)) return;
|
|
12780
|
+
let e = J(A) && J(j) ? {
|
|
12781
|
+
from: Oa(J(A)),
|
|
12782
|
+
to: Oa(J(j))
|
|
12783
12783
|
} : void 0;
|
|
12784
|
-
J(
|
|
12784
|
+
J(ue);
|
|
12785
12785
|
let t = !1, i = setTimeout(() => {
|
|
12786
12786
|
fs(r(), n(), e).then((e) => {
|
|
12787
|
-
t || (H(
|
|
12787
|
+
t || (H(se, e, !0), H(le, null));
|
|
12788
12788
|
}).catch(() => {
|
|
12789
|
-
t || H(
|
|
12789
|
+
t || H(le, J(w).wizard.errLoad, !0);
|
|
12790
12790
|
});
|
|
12791
12791
|
}, 200);
|
|
12792
12792
|
return () => {
|
|
12793
12793
|
t = !0, clearTimeout(i);
|
|
12794
12794
|
};
|
|
12795
12795
|
}), wn(() => {
|
|
12796
|
-
if (J(D) !== 1 || !J(
|
|
12796
|
+
if (J(D) !== 1 || !J(A) || !J(j) || +J(j) <= +J(A) || !(J(k) > 0)) return;
|
|
12797
12797
|
let e = {
|
|
12798
|
-
arrival: Oa(J(
|
|
12799
|
-
departure: Oa(J(
|
|
12800
|
-
boatLengthM: J(
|
|
12801
|
-
boatBeamM: J(
|
|
12798
|
+
arrival: Oa(J(A)),
|
|
12799
|
+
departure: Oa(J(j)),
|
|
12800
|
+
boatLengthM: J(k),
|
|
12801
|
+
boatBeamM: J(ve)
|
|
12802
12802
|
};
|
|
12803
|
-
J(
|
|
12803
|
+
J(ue);
|
|
12804
12804
|
let t = !1, i = setTimeout(() => {
|
|
12805
12805
|
ms(r(), n(), e).then((e) => {
|
|
12806
|
-
t || (H(
|
|
12806
|
+
t || (H(ce, e, !0), H(le, null));
|
|
12807
12807
|
}).catch(() => {
|
|
12808
|
-
t || H(
|
|
12808
|
+
t || H(le, J(w).wizard.errLoad, !0);
|
|
12809
12809
|
});
|
|
12810
12810
|
}, 200);
|
|
12811
12811
|
return () => {
|
|
12812
12812
|
t = !0, clearTimeout(i);
|
|
12813
12813
|
};
|
|
12814
12814
|
}), wn(() => {
|
|
12815
|
-
|
|
12815
|
+
ee("sidon-step-change", { step: J(D) });
|
|
12816
12816
|
}), wn(() => {
|
|
12817
|
-
T ||
|
|
12817
|
+
T || ee("sidon-loa-change", { loa: J(k) });
|
|
12818
12818
|
});
|
|
12819
|
-
function
|
|
12820
|
-
J(D) === 1 && H(
|
|
12821
|
-
}
|
|
12822
|
-
function Te(e) {
|
|
12823
|
-
e < J(D) && Ne();
|
|
12819
|
+
function Ee(e) {
|
|
12820
|
+
J(D) === 1 && H(te, e, !0);
|
|
12824
12821
|
}
|
|
12825
|
-
function
|
|
12826
|
-
|
|
12822
|
+
function De(e) {
|
|
12823
|
+
e < J(D) && Fe();
|
|
12827
12824
|
}
|
|
12828
|
-
let De = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
12829
12825
|
function Oe() {
|
|
12826
|
+
J(pe) || (H(me, null), J(D) === 1 ? je() : J(D) === 2 && Ne());
|
|
12827
|
+
}
|
|
12828
|
+
let ke = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
12829
|
+
function Ae() {
|
|
12830
12830
|
let e = J(w).wizard;
|
|
12831
|
-
return !J(
|
|
12831
|
+
return !J(A) || !J(j) || +J(j) <= +J(A) ? e.errDates : J(k) > 0 ? J(xe) ? J(ne).trim() ? J(M).trim() ? ke.test(J(re).trim()) ? null : e.errEmail : e.errBoatName : e.errName : e.errNoBerth : e.errLength;
|
|
12832
12832
|
}
|
|
12833
|
-
async function
|
|
12834
|
-
let e =
|
|
12835
|
-
if (e) return void H(
|
|
12836
|
-
H(
|
|
12833
|
+
async function je() {
|
|
12834
|
+
let e = Ae();
|
|
12835
|
+
if (e) return void H(me, e, !0);
|
|
12836
|
+
H(pe, !0);
|
|
12837
12837
|
try {
|
|
12838
12838
|
let e = await hs(r(), n(), {
|
|
12839
|
-
berthLabel: J(
|
|
12840
|
-
arrival: Oa(J(
|
|
12841
|
-
departure: Oa(J(
|
|
12842
|
-
contactName: J(
|
|
12843
|
-
contactEmail: J(
|
|
12844
|
-
contactPhone: J(
|
|
12845
|
-
boatName: J(
|
|
12846
|
-
boatLengthM: J(
|
|
12847
|
-
boatBeamM: J(
|
|
12848
|
-
notes: J(
|
|
12839
|
+
berthLabel: J(xe),
|
|
12840
|
+
arrival: Oa(J(A)),
|
|
12841
|
+
departure: Oa(J(j)),
|
|
12842
|
+
contactName: J(ne).trim(),
|
|
12843
|
+
contactEmail: J(re).trim(),
|
|
12844
|
+
contactPhone: J(ie).trim() || void 0,
|
|
12845
|
+
boatName: J(M).trim(),
|
|
12846
|
+
boatLengthM: J(k),
|
|
12847
|
+
boatBeamM: J(ve),
|
|
12848
|
+
notes: J(oe).trim() || void 0,
|
|
12849
12849
|
locale: J(C)
|
|
12850
12850
|
}), t = {
|
|
12851
12851
|
id: e.booking.id,
|
|
12852
12852
|
token: e.token
|
|
12853
12853
|
};
|
|
12854
|
-
H(E, t, !0), dc(n(), t), e.payment ? (H(
|
|
12854
|
+
H(E, t, !0), dc(n(), t), e.payment ? (H(de, e, !0), H(D, 2)) : Pe(t.id);
|
|
12855
12855
|
} catch (e) {
|
|
12856
|
-
|
|
12856
|
+
Me(e);
|
|
12857
12857
|
} finally {
|
|
12858
|
-
H(
|
|
12858
|
+
H(pe, !1);
|
|
12859
12859
|
}
|
|
12860
12860
|
}
|
|
12861
|
-
function
|
|
12861
|
+
function Me(e) {
|
|
12862
12862
|
let t = J(w).wizard;
|
|
12863
|
-
if (!(e instanceof ss) || e.status === 0) return void H(
|
|
12864
|
-
(e.status === 409 || e.status === 404) && tn(
|
|
12863
|
+
if (!(e instanceof ss) || e.status === 0) return void H(me, t.errNetwork, !0);
|
|
12864
|
+
(e.status === 409 || e.status === 404) && tn(ue);
|
|
12865
12865
|
let n = {
|
|
12866
12866
|
404: t.errTaken,
|
|
12867
12867
|
409: t.errTaken,
|
|
@@ -12869,45 +12869,45 @@ function yc(e, t) {
|
|
|
12869
12869
|
502: t.errPayment,
|
|
12870
12870
|
503: t.errUnavailable
|
|
12871
12871
|
};
|
|
12872
|
-
H(
|
|
12872
|
+
H(me, n[e.status] ?? (e.status >= 500 ? t.errUnavailable : e.message), !0);
|
|
12873
12873
|
}
|
|
12874
|
-
async function
|
|
12874
|
+
async function Ne() {
|
|
12875
12875
|
let e = J(E);
|
|
12876
|
-
if (!(!e || !J(
|
|
12877
|
-
H(
|
|
12876
|
+
if (!(!e || !J(fe))) {
|
|
12877
|
+
H(pe, !0);
|
|
12878
12878
|
try {
|
|
12879
|
-
await J(
|
|
12879
|
+
await J(fe).confirm();
|
|
12880
12880
|
} catch (e) {
|
|
12881
|
-
H(
|
|
12881
|
+
H(me, e instanceof Error ? e.message : J(w).wizard.errNetwork, !0), H(pe, !1);
|
|
12882
12882
|
return;
|
|
12883
12883
|
}
|
|
12884
|
-
await _s(r(), n(), e).catch(() => {}), H(
|
|
12884
|
+
await _s(r(), n(), e).catch(() => {}), H(pe, !1), Pe(e.id);
|
|
12885
12885
|
}
|
|
12886
12886
|
}
|
|
12887
|
-
function
|
|
12888
|
-
H(
|
|
12887
|
+
function Pe(e) {
|
|
12888
|
+
H(de, null), H(D, 3), ee("sidon-booked", {
|
|
12889
12889
|
bookingId: e,
|
|
12890
12890
|
marina: n()
|
|
12891
12891
|
});
|
|
12892
12892
|
}
|
|
12893
|
-
async function
|
|
12893
|
+
async function Fe() {
|
|
12894
12894
|
let e = J(E);
|
|
12895
|
-
if (J(
|
|
12896
|
-
H(
|
|
12895
|
+
if (J(pe) || J(D) !== 2 || !e) return;
|
|
12896
|
+
H(me, null), H(pe, !0);
|
|
12897
12897
|
let t = await vs(r(), n(), e).then(() => !0, (e) => e instanceof ss && e.status >= 400 && e.status < 500 && e.status !== 429);
|
|
12898
|
-
if (H(
|
|
12899
|
-
fc(n()), H(E, null), H(
|
|
12898
|
+
if (H(pe, !1), !t) return void H(me, J(w).wizard.errNetwork, !0);
|
|
12899
|
+
fc(n()), H(E, null), H(de, null), H(D, 1);
|
|
12900
12900
|
}
|
|
12901
|
-
function
|
|
12902
|
-
fc(n()), H(E, null), H(
|
|
12901
|
+
function Ie() {
|
|
12902
|
+
fc(n()), H(E, null), H(me, null), H(D, 1);
|
|
12903
12903
|
}
|
|
12904
|
-
function
|
|
12905
|
-
t !== null && J(E) &&
|
|
12904
|
+
function Le(e, t) {
|
|
12905
|
+
t !== null && J(E) && ee("sidon-booking-status", {
|
|
12906
12906
|
bookingId: J(E).id,
|
|
12907
12907
|
status: e
|
|
12908
12908
|
});
|
|
12909
12909
|
}
|
|
12910
|
-
var
|
|
12910
|
+
var N = {
|
|
12911
12911
|
get marina() {
|
|
12912
12912
|
return n();
|
|
12913
12913
|
},
|
|
@@ -12998,39 +12998,45 @@ function yc(e, t) {
|
|
|
12998
12998
|
set width(e = "560px") {
|
|
12999
12999
|
g(e), B();
|
|
13000
13000
|
},
|
|
13001
|
-
get
|
|
13001
|
+
get layout() {
|
|
13002
13002
|
return _();
|
|
13003
13003
|
},
|
|
13004
|
-
set
|
|
13004
|
+
set layout(e = "stacked") {
|
|
13005
13005
|
_(e), B();
|
|
13006
13006
|
},
|
|
13007
|
-
get
|
|
13007
|
+
get logoMark() {
|
|
13008
13008
|
return v();
|
|
13009
13009
|
},
|
|
13010
|
-
set
|
|
13010
|
+
set logoMark(e = null) {
|
|
13011
13011
|
v(e), B();
|
|
13012
13012
|
},
|
|
13013
|
-
get
|
|
13013
|
+
get marinaName() {
|
|
13014
13014
|
return y();
|
|
13015
13015
|
},
|
|
13016
|
-
set
|
|
13016
|
+
set marinaName(e = "") {
|
|
13017
13017
|
y(e), B();
|
|
13018
13018
|
},
|
|
13019
|
-
get
|
|
13019
|
+
get otherMarinas() {
|
|
13020
13020
|
return b();
|
|
13021
13021
|
},
|
|
13022
|
-
set
|
|
13022
|
+
set otherMarinas(e = []) {
|
|
13023
13023
|
b(e), B();
|
|
13024
|
+
},
|
|
13025
|
+
get bookingId() {
|
|
13026
|
+
return x();
|
|
13027
|
+
},
|
|
13028
|
+
set bookingId(e) {
|
|
13029
|
+
x(e), B();
|
|
13024
13030
|
}
|
|
13025
|
-
},
|
|
13031
|
+
}, Re = _c(), P = mn(Re), ze = (e) => {
|
|
13026
13032
|
var t = mc();
|
|
13027
13033
|
let n;
|
|
13028
13034
|
var r = U(t);
|
|
13029
13035
|
{
|
|
13030
13036
|
let e = /* @__PURE__ */ L(() => ({
|
|
13031
|
-
lat: J(
|
|
13032
|
-
lng: J(
|
|
13033
|
-
})), t = /* @__PURE__ */ L(() => J(
|
|
13037
|
+
lat: J(se)?.profile.lat ?? 0,
|
|
13038
|
+
lng: J(se)?.profile.lng ?? 0
|
|
13039
|
+
})), t = /* @__PURE__ */ L(() => J(se)?.berths ?? []), n = /* @__PURE__ */ L(() => J(se)?.overlays ?? []), i = /* @__PURE__ */ L(() => J(se)?.layout ?? null);
|
|
13034
13040
|
mo(r, {
|
|
13035
13041
|
get mapsApiKey() {
|
|
13036
13042
|
return d();
|
|
@@ -13042,19 +13048,19 @@ function yc(e, t) {
|
|
|
13042
13048
|
return J(e);
|
|
13043
13049
|
},
|
|
13044
13050
|
get navy() {
|
|
13045
|
-
return J(
|
|
13051
|
+
return J(he);
|
|
13046
13052
|
},
|
|
13047
13053
|
get gold() {
|
|
13048
|
-
return J(
|
|
13054
|
+
return J(ge);
|
|
13049
13055
|
},
|
|
13050
13056
|
get logoMark() {
|
|
13051
|
-
return
|
|
13057
|
+
return v();
|
|
13052
13058
|
},
|
|
13053
13059
|
get marinaName() {
|
|
13054
|
-
return
|
|
13060
|
+
return y();
|
|
13055
13061
|
},
|
|
13056
13062
|
get otherMarinas() {
|
|
13057
|
-
return
|
|
13063
|
+
return b();
|
|
13058
13064
|
},
|
|
13059
13065
|
get berths() {
|
|
13060
13066
|
return J(t);
|
|
@@ -13066,22 +13072,27 @@ function yc(e, t) {
|
|
|
13066
13072
|
return J(i);
|
|
13067
13073
|
},
|
|
13068
13074
|
get loa() {
|
|
13069
|
-
return J(
|
|
13075
|
+
return J(k);
|
|
13070
13076
|
},
|
|
13071
13077
|
get selectedBerth() {
|
|
13072
|
-
return J(
|
|
13078
|
+
return J(xe);
|
|
13073
13079
|
},
|
|
13074
|
-
onBerthClick:
|
|
13080
|
+
onBerthClick: Ee
|
|
13075
13081
|
});
|
|
13076
13082
|
}
|
|
13077
13083
|
F(t), G(() => {
|
|
13078
|
-
n = ui(t, 1, "sbw-map-slot svelte-h0br6q", null, n, {
|
|
13084
|
+
n = ui(t, 1, "sbw-map-slot svelte-h0br6q", null, n, {
|
|
13085
|
+
"sbw-map-slot--full-bleed": m() === "100vw",
|
|
13086
|
+
"sbw-map-slot--overlay": _() === "overlay"
|
|
13087
|
+
}), fi(t, `height: ${p() ?? ""}; width: ${m() ?? ""}; margin-bottom: ${h() ?? ""};`);
|
|
13079
13088
|
}), X(e, t);
|
|
13080
13089
|
};
|
|
13081
|
-
Q(
|
|
13082
|
-
|
|
13090
|
+
Q(P, (e) => {
|
|
13091
|
+
J(_e) && e(ze);
|
|
13083
13092
|
});
|
|
13084
|
-
var
|
|
13093
|
+
var Be = W(P, 2);
|
|
13094
|
+
let Ve;
|
|
13095
|
+
var He = U(Be), Ue = (e) => {
|
|
13085
13096
|
var t = Nr(), i = mn(t), a = (e) => {
|
|
13086
13097
|
{
|
|
13087
13098
|
let t = /* @__PURE__ */ L(() => c() ? J(C) : null);
|
|
@@ -13105,9 +13116,9 @@ function yc(e, t) {
|
|
|
13105
13116
|
return u();
|
|
13106
13117
|
},
|
|
13107
13118
|
get host() {
|
|
13108
|
-
return
|
|
13119
|
+
return S;
|
|
13109
13120
|
},
|
|
13110
|
-
onstatus:
|
|
13121
|
+
onstatus: Le
|
|
13111
13122
|
});
|
|
13112
13123
|
}
|
|
13113
13124
|
}, o = (e) => {
|
|
@@ -13117,19 +13128,19 @@ function yc(e, t) {
|
|
|
13117
13128
|
Q(i, (e) => {
|
|
13118
13129
|
J(E) ? e(a) : e(o, -1);
|
|
13119
13130
|
}), X(e, t);
|
|
13120
|
-
},
|
|
13131
|
+
}, We = (e) => {
|
|
13121
13132
|
var t = gc(), i = mn(t), a = (e) => {
|
|
13122
13133
|
{
|
|
13123
|
-
let t = /* @__PURE__ */ L(() => J(
|
|
13134
|
+
let t = /* @__PURE__ */ L(() => J(xe) ?? "—"), n = /* @__PURE__ */ L(() => c() || "en"), r = /* @__PURE__ */ L(() => J(D) !== 1);
|
|
13124
13135
|
Pa(e, {
|
|
13125
13136
|
get berthLabel() {
|
|
13126
13137
|
return J(t);
|
|
13127
13138
|
},
|
|
13128
13139
|
get priceLabel() {
|
|
13129
|
-
return J(
|
|
13140
|
+
return J(Ce);
|
|
13130
13141
|
},
|
|
13131
13142
|
get maxLoa() {
|
|
13132
|
-
return J(
|
|
13143
|
+
return J(be);
|
|
13133
13144
|
},
|
|
13134
13145
|
get locale() {
|
|
13135
13146
|
return J(n);
|
|
@@ -13138,22 +13149,22 @@ function yc(e, t) {
|
|
|
13138
13149
|
return J(r);
|
|
13139
13150
|
},
|
|
13140
13151
|
get loa() {
|
|
13141
|
-
return J(
|
|
13152
|
+
return J(k);
|
|
13142
13153
|
},
|
|
13143
13154
|
set loa(e) {
|
|
13144
|
-
H(
|
|
13155
|
+
H(k, e, !0);
|
|
13145
13156
|
},
|
|
13146
13157
|
get from() {
|
|
13147
|
-
return J(
|
|
13158
|
+
return J(A);
|
|
13148
13159
|
},
|
|
13149
13160
|
set from(e) {
|
|
13150
|
-
H(
|
|
13161
|
+
H(A, e, !0);
|
|
13151
13162
|
},
|
|
13152
13163
|
get to() {
|
|
13153
|
-
return J(
|
|
13164
|
+
return J(j);
|
|
13154
13165
|
},
|
|
13155
13166
|
set to(e) {
|
|
13156
|
-
H(
|
|
13167
|
+
H(j, e, !0);
|
|
13157
13168
|
}
|
|
13158
13169
|
});
|
|
13159
13170
|
}
|
|
@@ -13169,14 +13180,14 @@ function yc(e, t) {
|
|
|
13169
13180
|
get labels() {
|
|
13170
13181
|
return J(w).steps;
|
|
13171
13182
|
},
|
|
13172
|
-
onStepClick:
|
|
13183
|
+
onStepClick: De
|
|
13173
13184
|
});
|
|
13174
13185
|
var s = W(o, 2), d = (e) => {
|
|
13175
13186
|
var t = hc(), n = U(t, !0);
|
|
13176
|
-
F(t), G(() => Z(n, J(
|
|
13187
|
+
F(t), G(() => Z(n, J(le))), X(e, t);
|
|
13177
13188
|
};
|
|
13178
13189
|
Q(s, (e) => {
|
|
13179
|
-
J(
|
|
13190
|
+
J(le) && J(D) !== 3 && e(d);
|
|
13180
13191
|
});
|
|
13181
13192
|
var f = W(s, 2), p = (e) => {
|
|
13182
13193
|
xo(e, {
|
|
@@ -13184,51 +13195,51 @@ function yc(e, t) {
|
|
|
13184
13195
|
return J(w);
|
|
13185
13196
|
},
|
|
13186
13197
|
get contactName() {
|
|
13187
|
-
return J(
|
|
13198
|
+
return J(ne);
|
|
13188
13199
|
},
|
|
13189
13200
|
set contactName(e) {
|
|
13190
|
-
H(
|
|
13201
|
+
H(ne, e, !0);
|
|
13191
13202
|
},
|
|
13192
13203
|
get contactEmail() {
|
|
13193
|
-
return J(
|
|
13204
|
+
return J(re);
|
|
13194
13205
|
},
|
|
13195
13206
|
set contactEmail(e) {
|
|
13196
|
-
H(
|
|
13207
|
+
H(re, e, !0);
|
|
13197
13208
|
},
|
|
13198
13209
|
get contactPhone() {
|
|
13199
|
-
return J(
|
|
13210
|
+
return J(ie);
|
|
13200
13211
|
},
|
|
13201
13212
|
set contactPhone(e) {
|
|
13202
|
-
H(
|
|
13213
|
+
H(ie, e, !0);
|
|
13203
13214
|
},
|
|
13204
13215
|
get boatName() {
|
|
13205
|
-
return J(
|
|
13216
|
+
return J(M);
|
|
13206
13217
|
},
|
|
13207
13218
|
set boatName(e) {
|
|
13208
|
-
H(
|
|
13219
|
+
H(M, e, !0);
|
|
13209
13220
|
},
|
|
13210
13221
|
get boatBeamM() {
|
|
13211
|
-
return J(
|
|
13222
|
+
return J(ae);
|
|
13212
13223
|
},
|
|
13213
13224
|
set boatBeamM(e) {
|
|
13214
|
-
H(
|
|
13225
|
+
H(ae, e, !0);
|
|
13215
13226
|
},
|
|
13216
13227
|
get notes() {
|
|
13217
|
-
return J(
|
|
13228
|
+
return J(oe);
|
|
13218
13229
|
},
|
|
13219
13230
|
set notes(e) {
|
|
13220
|
-
H(
|
|
13231
|
+
H(oe, e, !0);
|
|
13221
13232
|
}
|
|
13222
13233
|
});
|
|
13223
13234
|
}, m = (e) => {
|
|
13224
13235
|
{
|
|
13225
|
-
let t = /* @__PURE__ */ L(() => io(J(
|
|
13236
|
+
let t = /* @__PURE__ */ L(() => io(J(de).booking.totalPrice, J(de).booking.currency, l(), J(C)));
|
|
13226
13237
|
Oi(es(e, {
|
|
13227
13238
|
get payment() {
|
|
13228
|
-
return J(
|
|
13239
|
+
return J(de).payment;
|
|
13229
13240
|
},
|
|
13230
13241
|
get host() {
|
|
13231
|
-
return
|
|
13242
|
+
return S;
|
|
13232
13243
|
},
|
|
13233
13244
|
get lang() {
|
|
13234
13245
|
return J(C);
|
|
@@ -13239,7 +13250,7 @@ function yc(e, t) {
|
|
|
13239
13250
|
get totalLabel() {
|
|
13240
13251
|
return J(t);
|
|
13241
13252
|
}
|
|
13242
|
-
}), (e) => H(
|
|
13253
|
+
}), (e) => H(fe, e), () => J(fe));
|
|
13243
13254
|
}
|
|
13244
13255
|
}, h = (e) => {
|
|
13245
13256
|
{
|
|
@@ -13264,24 +13275,24 @@ function yc(e, t) {
|
|
|
13264
13275
|
return u();
|
|
13265
13276
|
},
|
|
13266
13277
|
get host() {
|
|
13267
|
-
return
|
|
13278
|
+
return S;
|
|
13268
13279
|
},
|
|
13269
|
-
onstatus:
|
|
13270
|
-
onstartover:
|
|
13280
|
+
onstatus: Le,
|
|
13281
|
+
onstartover: Ie
|
|
13271
13282
|
});
|
|
13272
13283
|
}
|
|
13273
13284
|
};
|
|
13274
13285
|
Q(f, (e) => {
|
|
13275
|
-
J(D) === 1 ? e(p) : J(D) === 2 && J(
|
|
13286
|
+
J(D) === 1 ? e(p) : J(D) === 2 && J(de)?.payment ? e(m, 1) : J(D) === 3 && J(E) && e(h, 2);
|
|
13276
13287
|
}), os(W(f, 2), {
|
|
13277
13288
|
get step() {
|
|
13278
13289
|
return J(D);
|
|
13279
13290
|
},
|
|
13280
13291
|
get sending() {
|
|
13281
|
-
return J(
|
|
13292
|
+
return J(pe);
|
|
13282
13293
|
},
|
|
13283
13294
|
get error() {
|
|
13284
|
-
return J(
|
|
13295
|
+
return J(me);
|
|
13285
13296
|
},
|
|
13286
13297
|
get labels() {
|
|
13287
13298
|
return J(w);
|
|
@@ -13289,13 +13300,15 @@ function yc(e, t) {
|
|
|
13289
13300
|
get variant() {
|
|
13290
13301
|
return u();
|
|
13291
13302
|
},
|
|
13292
|
-
onBack:
|
|
13293
|
-
onNext:
|
|
13303
|
+
onBack: Fe,
|
|
13304
|
+
onNext: Oe
|
|
13294
13305
|
}), X(e, t);
|
|
13295
13306
|
};
|
|
13296
|
-
return Q(
|
|
13297
|
-
T ? e(
|
|
13298
|
-
}), F(
|
|
13307
|
+
return Q(He, (e) => {
|
|
13308
|
+
T ? e(Ue) : e(We, -1);
|
|
13309
|
+
}), F(Be), G(() => {
|
|
13310
|
+
Ve = ui(Be, 1, "sbw-root svelte-h0br6q", null, Ve, { "sbw-root--overlay": _() === "overlay" }), fi(Be, `--sbw-map-h: ${(J(_e) ? p() : "0px") ?? ""}; --sbw-map-gap: ${(J(_e) ? h() : "0px") ?? ""};`);
|
|
13311
|
+
}), X(e, Re), Xe(N);
|
|
13299
13312
|
}
|
|
13300
13313
|
customElements.define("sidon-booking-widget", Pi(yc, {
|
|
13301
13314
|
marina: {
|
|
@@ -13358,6 +13371,10 @@ customElements.define("sidon-booking-widget", Pi(yc, {
|
|
|
13358
13371
|
attribute: "width",
|
|
13359
13372
|
type: "String"
|
|
13360
13373
|
},
|
|
13374
|
+
layout: {
|
|
13375
|
+
attribute: "layout",
|
|
13376
|
+
type: "String"
|
|
13377
|
+
},
|
|
13361
13378
|
logoMark: {
|
|
13362
13379
|
attribute: "logo-mark",
|
|
13363
13380
|
type: "String"
|