@pixelmatters/markup 1.9.0 → 1.10.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 +6 -6
- package/dist/widget.js +792 -770
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
package/dist/widget.js
CHANGED
|
@@ -302,26 +302,33 @@ function _e(e, t, n) {
|
|
|
302
302
|
context: n?.context
|
|
303
303
|
});
|
|
304
304
|
}
|
|
305
|
+
var ve = null;
|
|
306
|
+
function ye(e) {
|
|
307
|
+
ve = e;
|
|
308
|
+
}
|
|
309
|
+
function F(e, t) {
|
|
310
|
+
ve && _e(ve, e, t);
|
|
311
|
+
}
|
|
305
312
|
//#endregion
|
|
306
313
|
//#region ../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/hooks/dist/hooks.module.js
|
|
307
|
-
var
|
|
308
|
-
function
|
|
309
|
-
|
|
310
|
-
var n =
|
|
314
|
+
var be, I, xe, Se, L = 0, Ce = [], R = t, we = R.__b, Te = R.__r, Ee = R.diffed, De = R.__c, Oe = R.unmount, ke = R.__;
|
|
315
|
+
function Ae(e, t) {
|
|
316
|
+
R.__h && R.__h(I, e, L || t), L = 0;
|
|
317
|
+
var n = I.__H ||= {
|
|
311
318
|
__: [],
|
|
312
319
|
__h: []
|
|
313
320
|
};
|
|
314
321
|
return e >= n.__.length && n.__.push({}), n.__[e];
|
|
315
322
|
}
|
|
316
|
-
function
|
|
317
|
-
return
|
|
323
|
+
function z(e) {
|
|
324
|
+
return L = 1, je(ze, e);
|
|
318
325
|
}
|
|
319
|
-
function
|
|
320
|
-
var r =
|
|
321
|
-
if (r.t = e, !r.__c && (r.__ = [n ? n(t) :
|
|
326
|
+
function je(e, t, n) {
|
|
327
|
+
var r = Ae(be++, 2);
|
|
328
|
+
if (r.t = e, !r.__c && (r.__ = [n ? n(t) : ze(void 0, t), function(e) {
|
|
322
329
|
var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);
|
|
323
330
|
t !== n && (r.__N = [n, r.__[1]], r.__c.setState({}));
|
|
324
|
-
}], r.__c =
|
|
331
|
+
}], r.__c = I, !I.__f)) {
|
|
325
332
|
var i = function(e, t, n) {
|
|
326
333
|
if (!r.__c.__H) return !0;
|
|
327
334
|
var i = r.__c.__H.__.filter(function(e) {
|
|
@@ -338,111 +345,111 @@ function ke(e, t, n) {
|
|
|
338
345
|
}
|
|
339
346
|
}), a && a.call(this, e, t, n) || o;
|
|
340
347
|
};
|
|
341
|
-
|
|
342
|
-
var a =
|
|
343
|
-
|
|
348
|
+
I.__f = !0;
|
|
349
|
+
var a = I.shouldComponentUpdate, o = I.componentWillUpdate;
|
|
350
|
+
I.componentWillUpdate = function(e, t, n) {
|
|
344
351
|
if (this.__e) {
|
|
345
352
|
var r = a;
|
|
346
353
|
a = void 0, i(e, t, n), a = r;
|
|
347
354
|
}
|
|
348
355
|
o && o.call(this, e, t, n);
|
|
349
|
-
},
|
|
356
|
+
}, I.shouldComponentUpdate = i;
|
|
350
357
|
}
|
|
351
358
|
return r.__N || r.__;
|
|
352
359
|
}
|
|
353
|
-
function
|
|
354
|
-
var n =
|
|
355
|
-
!
|
|
360
|
+
function B(e, t) {
|
|
361
|
+
var n = Ae(be++, 3);
|
|
362
|
+
!R.__s && Re(n.__H, t) && (n.__ = e, n.u = t, I.__H.__h.push(n));
|
|
356
363
|
}
|
|
357
|
-
function
|
|
358
|
-
return
|
|
364
|
+
function V(e) {
|
|
365
|
+
return L = 5, Me(function() {
|
|
359
366
|
return { current: e };
|
|
360
367
|
}, []);
|
|
361
368
|
}
|
|
362
|
-
function
|
|
363
|
-
var n =
|
|
364
|
-
return
|
|
369
|
+
function Me(e, t) {
|
|
370
|
+
var n = Ae(be++, 7);
|
|
371
|
+
return Re(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
|
|
365
372
|
}
|
|
366
|
-
function
|
|
367
|
-
return
|
|
373
|
+
function H(e, t) {
|
|
374
|
+
return L = 8, Me(function() {
|
|
368
375
|
return e;
|
|
369
376
|
}, t);
|
|
370
377
|
}
|
|
371
|
-
function
|
|
372
|
-
for (var e; e =
|
|
378
|
+
function Ne() {
|
|
379
|
+
for (var e; e = Ce.shift();) {
|
|
373
380
|
var t = e.__H;
|
|
374
381
|
if (e.__P && t) try {
|
|
375
|
-
t.__h.some(
|
|
382
|
+
t.__h.some(Ie), t.__h.some(Le), t.__h = [];
|
|
376
383
|
} catch (n) {
|
|
377
|
-
t.__h = [],
|
|
384
|
+
t.__h = [], R.__e(n, e.__v);
|
|
378
385
|
}
|
|
379
386
|
}
|
|
380
387
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
},
|
|
384
|
-
e && t.__k && t.__k.__m && (e.__m = t.__k.__m),
|
|
385
|
-
},
|
|
386
|
-
|
|
387
|
-
var t = (
|
|
388
|
-
t && (
|
|
388
|
+
R.__b = function(e) {
|
|
389
|
+
I = null, we && we(e);
|
|
390
|
+
}, R.__ = function(e, t) {
|
|
391
|
+
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), ke && ke(e, t);
|
|
392
|
+
}, R.__r = function(e) {
|
|
393
|
+
Te && Te(e), be = 0;
|
|
394
|
+
var t = (I = e.__c).__H;
|
|
395
|
+
t && (xe === I ? (t.__h = [], I.__h = [], t.__.some(function(e) {
|
|
389
396
|
e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
|
|
390
|
-
})) : (t.__h.some(
|
|
391
|
-
},
|
|
392
|
-
|
|
397
|
+
})) : (t.__h.some(Ie), t.__h.some(Le), t.__h = [], be = 0)), xe = I;
|
|
398
|
+
}, R.diffed = function(e) {
|
|
399
|
+
Ee && Ee(e);
|
|
393
400
|
var t = e.__c;
|
|
394
|
-
t && t.__H && (t.__H.__h.length && (
|
|
401
|
+
t && t.__H && (t.__H.__h.length && (Ce.push(t) !== 1 && Se === R.requestAnimationFrame || ((Se = R.requestAnimationFrame) || Fe)(Ne)), t.__H.__.some(function(e) {
|
|
395
402
|
e.u && (e.__H = e.u), e.u = void 0;
|
|
396
|
-
})),
|
|
397
|
-
},
|
|
403
|
+
})), xe = I = null;
|
|
404
|
+
}, R.__c = function(e, t) {
|
|
398
405
|
t.some(function(e) {
|
|
399
406
|
try {
|
|
400
|
-
e.__h.some(
|
|
401
|
-
return !e.__ ||
|
|
407
|
+
e.__h.some(Ie), e.__h = e.__h.filter(function(e) {
|
|
408
|
+
return !e.__ || Le(e);
|
|
402
409
|
});
|
|
403
410
|
} catch (n) {
|
|
404
411
|
t.some(function(e) {
|
|
405
412
|
e.__h &&= [];
|
|
406
|
-
}), t = [],
|
|
413
|
+
}), t = [], R.__e(n, e.__v);
|
|
407
414
|
}
|
|
408
|
-
}),
|
|
409
|
-
},
|
|
410
|
-
|
|
415
|
+
}), De && De(e, t);
|
|
416
|
+
}, R.unmount = function(e) {
|
|
417
|
+
Oe && Oe(e);
|
|
411
418
|
var t, n = e.__c;
|
|
412
419
|
n && n.__H && (n.__H.__.some(function(e) {
|
|
413
420
|
try {
|
|
414
|
-
|
|
421
|
+
Ie(e);
|
|
415
422
|
} catch (e) {
|
|
416
423
|
t = e;
|
|
417
424
|
}
|
|
418
|
-
}), n.__H = void 0, t &&
|
|
425
|
+
}), n.__H = void 0, t && R.__e(t, n.__v));
|
|
419
426
|
};
|
|
420
|
-
var
|
|
421
|
-
function
|
|
427
|
+
var Pe = typeof requestAnimationFrame == "function";
|
|
428
|
+
function Fe(e) {
|
|
422
429
|
var t, n = function() {
|
|
423
|
-
clearTimeout(r),
|
|
430
|
+
clearTimeout(r), Pe && cancelAnimationFrame(t), setTimeout(e);
|
|
424
431
|
}, r = setTimeout(n, 35);
|
|
425
|
-
|
|
432
|
+
Pe && (t = requestAnimationFrame(n));
|
|
426
433
|
}
|
|
427
|
-
function
|
|
428
|
-
var t =
|
|
429
|
-
typeof n == "function" && (e.__c = void 0, n()),
|
|
434
|
+
function Ie(e) {
|
|
435
|
+
var t = I, n = e.__c;
|
|
436
|
+
typeof n == "function" && (e.__c = void 0, n()), I = t;
|
|
430
437
|
}
|
|
431
|
-
function
|
|
432
|
-
var t =
|
|
433
|
-
e.__c = e.__(),
|
|
438
|
+
function Le(e) {
|
|
439
|
+
var t = I;
|
|
440
|
+
e.__c = e.__(), I = t;
|
|
434
441
|
}
|
|
435
|
-
function
|
|
442
|
+
function Re(e, t) {
|
|
436
443
|
return !e || e.length !== t.length || t.some(function(t, n) {
|
|
437
444
|
return t !== e[n];
|
|
438
445
|
});
|
|
439
446
|
}
|
|
440
|
-
function
|
|
447
|
+
function ze(e, t) {
|
|
441
448
|
return typeof t == "function" ? t(e) : t;
|
|
442
449
|
}
|
|
443
|
-
for (var
|
|
444
|
-
|
|
445
|
-
function
|
|
450
|
+
for (var Be = "1.38.0", U = [], W = [], Ve = Uint8Array, He = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Ue = 0, We = He.length; Ue < We; ++Ue) U[Ue] = He[Ue], W[He.charCodeAt(Ue)] = Ue;
|
|
451
|
+
W[45] = 62, W[95] = 63;
|
|
452
|
+
function Ge(e) {
|
|
446
453
|
var t = e.length;
|
|
447
454
|
if (t % 4 > 0) throw Error("Invalid string. Length must be a multiple of 4");
|
|
448
455
|
var n = e.indexOf("=");
|
|
@@ -450,33 +457,33 @@ function Ue(e) {
|
|
|
450
457
|
var r = n === t ? 0 : 4 - n % 4;
|
|
451
458
|
return [n, r];
|
|
452
459
|
}
|
|
453
|
-
function
|
|
460
|
+
function Ke(e, t, n) {
|
|
454
461
|
return (t + n) * 3 / 4 - n;
|
|
455
462
|
}
|
|
456
|
-
function
|
|
457
|
-
var t, n =
|
|
458
|
-
for (c = 0; c < s; c += 4) t =
|
|
459
|
-
return i === 2 && (t =
|
|
463
|
+
function qe(e) {
|
|
464
|
+
var t, n = Ge(e), r = n[0], i = n[1], a = new Ve(Ke(e, r, i)), o = 0, s = i > 0 ? r - 4 : r, c;
|
|
465
|
+
for (c = 0; c < s; c += 4) t = W[e.charCodeAt(c)] << 18 | W[e.charCodeAt(c + 1)] << 12 | W[e.charCodeAt(c + 2)] << 6 | W[e.charCodeAt(c + 3)], a[o++] = t >> 16 & 255, a[o++] = t >> 8 & 255, a[o++] = t & 255;
|
|
466
|
+
return i === 2 && (t = W[e.charCodeAt(c)] << 2 | W[e.charCodeAt(c + 1)] >> 4, a[o++] = t & 255), i === 1 && (t = W[e.charCodeAt(c)] << 10 | W[e.charCodeAt(c + 1)] << 4 | W[e.charCodeAt(c + 2)] >> 2, a[o++] = t >> 8 & 255, a[o++] = t & 255), a;
|
|
460
467
|
}
|
|
461
|
-
function
|
|
462
|
-
return
|
|
468
|
+
function Je(e) {
|
|
469
|
+
return U[e >> 18 & 63] + U[e >> 12 & 63] + U[e >> 6 & 63] + U[e & 63];
|
|
463
470
|
}
|
|
464
|
-
function
|
|
465
|
-
for (var r, i = [], a = t; a < n; a += 3) r = (e[a] << 16 & 16711680) + (e[a + 1] << 8 & 65280) + (e[a + 2] & 255), i.push(
|
|
471
|
+
function Ye(e, t, n) {
|
|
472
|
+
for (var r, i = [], a = t; a < n; a += 3) r = (e[a] << 16 & 16711680) + (e[a + 1] << 8 & 65280) + (e[a + 2] & 255), i.push(Je(r));
|
|
466
473
|
return i.join("");
|
|
467
474
|
}
|
|
468
|
-
function
|
|
469
|
-
for (var t, n = e.length, r = n % 3, i = [], a = 16383, o = 0, s = n - r; o < s; o += a) i.push(
|
|
470
|
-
return r === 1 ? (t = e[n - 1], i.push(
|
|
475
|
+
function Xe(e) {
|
|
476
|
+
for (var t, n = e.length, r = n % 3, i = [], a = 16383, o = 0, s = n - r; o < s; o += a) i.push(Ye(e, o, o + a > s ? s : o + a));
|
|
477
|
+
return r === 1 ? (t = e[n - 1], i.push(U[t >> 2] + U[t << 4 & 63] + "==")) : r === 2 && (t = (e[n - 2] << 8) + e[n - 1], i.push(U[t >> 10] + U[t >> 4 & 63] + U[t << 2 & 63] + "=")), i.join("");
|
|
471
478
|
}
|
|
472
479
|
//#endregion
|
|
473
480
|
//#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/common/index.js
|
|
474
|
-
function
|
|
481
|
+
function Ze(e) {
|
|
475
482
|
if (e === void 0) return {};
|
|
476
|
-
if (
|
|
483
|
+
if (!$e(e)) throw Error(`The arguments to a Convex function must be an object. Received: ${e}`);
|
|
477
484
|
return e;
|
|
478
485
|
}
|
|
479
|
-
function
|
|
486
|
+
function Qe(e) {
|
|
480
487
|
if (e === void 0) throw Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");
|
|
481
488
|
if (typeof e != "string") throw Error(`Invalid deployment address: found ${e}".`);
|
|
482
489
|
if (!(e.startsWith("http:") || e.startsWith("https:"))) throw Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);
|
|
@@ -487,146 +494,146 @@ function Ye(e) {
|
|
|
487
494
|
}
|
|
488
495
|
if (e.endsWith(".convex.site")) throw Error(`Invalid deployment address: "${e}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`);
|
|
489
496
|
}
|
|
490
|
-
function
|
|
497
|
+
function $e(e) {
|
|
491
498
|
let t = typeof e == "object", n = Object.getPrototypeOf(e), r = n === null || n === Object.prototype || n?.constructor?.name === "Object";
|
|
492
499
|
return t && r;
|
|
493
500
|
}
|
|
494
501
|
//#endregion
|
|
495
502
|
//#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/values/value.js
|
|
496
|
-
var
|
|
497
|
-
function
|
|
503
|
+
var et = !0, tt = BigInt("-9223372036854775808"), nt = BigInt("9223372036854775807"), rt = BigInt("0"), it = BigInt("8"), at = BigInt("256");
|
|
504
|
+
function ot(e) {
|
|
498
505
|
return Number.isNaN(e) || !Number.isFinite(e) || Object.is(e, -0);
|
|
499
506
|
}
|
|
500
|
-
function
|
|
501
|
-
e <
|
|
507
|
+
function st(e) {
|
|
508
|
+
e < rt && (e -= tt + tt);
|
|
502
509
|
let t = e.toString(16);
|
|
503
510
|
t.length % 2 == 1 && (t = "0" + t);
|
|
504
511
|
let n = new Uint8Array(/* @__PURE__ */ new ArrayBuffer(8)), r = 0;
|
|
505
|
-
for (let i of t.match(/.{2}/g).reverse()) n.set([parseInt(i, 16)], r++), e >>=
|
|
506
|
-
return
|
|
512
|
+
for (let i of t.match(/.{2}/g).reverse()) n.set([parseInt(i, 16)], r++), e >>= it;
|
|
513
|
+
return Xe(n);
|
|
507
514
|
}
|
|
508
|
-
function
|
|
509
|
-
let t =
|
|
515
|
+
function ct(e) {
|
|
516
|
+
let t = qe(e);
|
|
510
517
|
if (t.byteLength !== 8) throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);
|
|
511
|
-
let n =
|
|
512
|
-
for (let e of t) n += BigInt(e) *
|
|
513
|
-
return n >
|
|
518
|
+
let n = rt, r = rt;
|
|
519
|
+
for (let e of t) n += BigInt(e) * at ** r, r++;
|
|
520
|
+
return n > nt && (n += tt + tt), n;
|
|
514
521
|
}
|
|
515
|
-
function
|
|
516
|
-
if (e <
|
|
522
|
+
function lt(e) {
|
|
523
|
+
if (e < tt || nt < e) throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);
|
|
517
524
|
let t = /* @__PURE__ */ new ArrayBuffer(8);
|
|
518
|
-
return new DataView(t).setBigInt64(0, e, !0),
|
|
525
|
+
return new DataView(t).setBigInt64(0, e, !0), Xe(new Uint8Array(t));
|
|
519
526
|
}
|
|
520
|
-
function
|
|
521
|
-
let t =
|
|
527
|
+
function ut(e) {
|
|
528
|
+
let t = qe(e);
|
|
522
529
|
if (t.byteLength !== 8) throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);
|
|
523
530
|
return new DataView(t.buffer).getBigInt64(0, !0);
|
|
524
531
|
}
|
|
525
|
-
var
|
|
526
|
-
function
|
|
527
|
-
if (e.length >
|
|
532
|
+
var dt = DataView.prototype.setBigInt64 ? lt : st, ft = DataView.prototype.getBigInt64 ? ut : ct, pt = 1024;
|
|
533
|
+
function mt(e) {
|
|
534
|
+
if (e.length > pt) throw Error(`Field name ${e} exceeds maximum field name length ${pt}.`);
|
|
528
535
|
if (e.startsWith("$")) throw Error(`Field name ${e} starts with a '$', which is reserved.`);
|
|
529
536
|
for (let t = 0; t < e.length; t += 1) {
|
|
530
537
|
let n = e.charCodeAt(t);
|
|
531
538
|
if (n < 32 || n >= 127) throw Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`);
|
|
532
539
|
}
|
|
533
540
|
}
|
|
534
|
-
function
|
|
541
|
+
function ht(e) {
|
|
535
542
|
if (e === null || typeof e == "boolean" || typeof e == "number" || typeof e == "string") return e;
|
|
536
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
543
|
+
if (Array.isArray(e)) return e.map((e) => ht(e));
|
|
537
544
|
if (typeof e != "object") throw Error(`Unexpected type of ${e}`);
|
|
538
545
|
let t = Object.entries(e);
|
|
539
546
|
if (t.length === 1) {
|
|
540
547
|
let n = t[0][0];
|
|
541
548
|
if (n === "$bytes") {
|
|
542
549
|
if (typeof e.$bytes != "string") throw Error(`Malformed $bytes field on ${e}`);
|
|
543
|
-
return
|
|
550
|
+
return qe(e.$bytes).buffer;
|
|
544
551
|
}
|
|
545
552
|
if (n === "$integer") {
|
|
546
553
|
if (typeof e.$integer != "string") throw Error(`Malformed $integer field on ${e}`);
|
|
547
|
-
return
|
|
554
|
+
return ft(e.$integer);
|
|
548
555
|
}
|
|
549
556
|
if (n === "$float") {
|
|
550
557
|
if (typeof e.$float != "string") throw Error(`Malformed $float field on ${e}`);
|
|
551
|
-
let t =
|
|
558
|
+
let t = qe(e.$float);
|
|
552
559
|
if (t.byteLength !== 8) throw Error(`Received ${t.byteLength} bytes, expected 8 for $float`);
|
|
553
|
-
let n = new DataView(t.buffer).getFloat64(0,
|
|
554
|
-
if (!
|
|
560
|
+
let n = new DataView(t.buffer).getFloat64(0, et);
|
|
561
|
+
if (!ot(n)) throw Error(`Float ${n} should be encoded as a number`);
|
|
555
562
|
return n;
|
|
556
563
|
}
|
|
557
564
|
if (n === "$set") throw Error("Received a Set which is no longer supported as a Convex type.");
|
|
558
565
|
if (n === "$map") throw Error("Received a Map which is no longer supported as a Convex type.");
|
|
559
566
|
}
|
|
560
567
|
let n = {};
|
|
561
|
-
for (let [t, r] of Object.entries(e))
|
|
568
|
+
for (let [t, r] of Object.entries(e)) mt(t), n[t] = ht(r);
|
|
562
569
|
return n;
|
|
563
570
|
}
|
|
564
|
-
var
|
|
565
|
-
function
|
|
571
|
+
var gt = 16384;
|
|
572
|
+
function _t(e) {
|
|
566
573
|
let t = JSON.stringify(e, (e, t) => t === void 0 ? "undefined" : typeof t == "bigint" ? `${t.toString()}n` : t);
|
|
567
|
-
if (t.length >
|
|
568
|
-
let e =
|
|
574
|
+
if (t.length > gt) {
|
|
575
|
+
let e = gt - 14, n = t.codePointAt(e - 1);
|
|
569
576
|
return n !== void 0 && n > 65535 && --e, t.substring(0, e) + "[...truncated]";
|
|
570
577
|
}
|
|
571
578
|
return t;
|
|
572
579
|
}
|
|
573
|
-
function
|
|
580
|
+
function vt(e, t, n, r) {
|
|
574
581
|
if (e === void 0) {
|
|
575
|
-
let e = n && ` (present at path ${n} in original object ${
|
|
582
|
+
let e = n && ` (present at path ${n} in original object ${_t(t)})`;
|
|
576
583
|
throw Error(`undefined is not a valid Convex value${e}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`);
|
|
577
584
|
}
|
|
578
585
|
if (e === null) return e;
|
|
579
586
|
if (typeof e == "bigint") {
|
|
580
|
-
if (e <
|
|
581
|
-
return { $integer:
|
|
587
|
+
if (e < tt || nt < e) throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);
|
|
588
|
+
return { $integer: dt(e) };
|
|
582
589
|
}
|
|
583
|
-
if (typeof e == "number") if (
|
|
590
|
+
if (typeof e == "number") if (ot(e)) {
|
|
584
591
|
let t = /* @__PURE__ */ new ArrayBuffer(8);
|
|
585
|
-
return new DataView(t).setFloat64(0, e,
|
|
592
|
+
return new DataView(t).setFloat64(0, e, et), { $float: Xe(new Uint8Array(t)) };
|
|
586
593
|
} else return e;
|
|
587
594
|
if (typeof e == "boolean" || typeof e == "string") return e;
|
|
588
|
-
if (e instanceof ArrayBuffer) return { $bytes:
|
|
589
|
-
if (Array.isArray(e)) return e.map((e, r) =>
|
|
590
|
-
if (e instanceof Set) throw Error(
|
|
591
|
-
if (e instanceof Map) throw Error(
|
|
592
|
-
if (
|
|
595
|
+
if (e instanceof ArrayBuffer) return { $bytes: Xe(new Uint8Array(e)) };
|
|
596
|
+
if (Array.isArray(e)) return e.map((e, r) => vt(e, t, n + `[${r}]`, !1));
|
|
597
|
+
if (e instanceof Set) throw Error(yt(n, "Set", [...e], t));
|
|
598
|
+
if (e instanceof Map) throw Error(yt(n, "Map", [...e], t));
|
|
599
|
+
if (!$e(e)) {
|
|
593
600
|
let r = e?.constructor?.name, i = r ? `${r} ` : "";
|
|
594
|
-
throw Error(
|
|
601
|
+
throw Error(yt(n, i, e, t));
|
|
595
602
|
}
|
|
596
603
|
let i = {}, a = Object.entries(e);
|
|
597
604
|
a.sort(([e, t], [n, r]) => e === n ? 0 : e < n ? -1 : 1);
|
|
598
|
-
for (let [e, o] of a) o === void 0 ? r && (
|
|
605
|
+
for (let [e, o] of a) o === void 0 ? r && (mt(e), i[e] = bt(o, t, n + `.${e}`)) : (mt(e), i[e] = vt(o, t, n + `.${e}`, !1));
|
|
599
606
|
return i;
|
|
600
607
|
}
|
|
601
|
-
function
|
|
602
|
-
return e ? `${t}${
|
|
608
|
+
function yt(e, t, n, r) {
|
|
609
|
+
return e ? `${t}${_t(n)} is not a supported Convex type (present at path ${e} in original object ${_t(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.` : `${t}${_t(n)} is not a supported Convex type.`;
|
|
603
610
|
}
|
|
604
|
-
function
|
|
611
|
+
function bt(e, t, n) {
|
|
605
612
|
if (e === void 0) return { $undefined: null };
|
|
606
|
-
if (t === void 0) throw Error(`Programming error. Current value is ${
|
|
607
|
-
return
|
|
613
|
+
if (t === void 0) throw Error(`Programming error. Current value is ${_t(e)} but original value is undefined`);
|
|
614
|
+
return vt(e, t, n, !1);
|
|
608
615
|
}
|
|
609
|
-
function
|
|
610
|
-
return
|
|
616
|
+
function xt(e) {
|
|
617
|
+
return vt(e, e, "", !1);
|
|
611
618
|
}
|
|
612
619
|
//#endregion
|
|
613
620
|
//#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/values/errors.js
|
|
614
|
-
var
|
|
621
|
+
var St = Object.defineProperty, Ct = (e, t, n) => t in e ? St(e, t, {
|
|
615
622
|
enumerable: !0,
|
|
616
623
|
configurable: !0,
|
|
617
624
|
writable: !0,
|
|
618
625
|
value: n
|
|
619
|
-
}) : e[t] = n,
|
|
626
|
+
}) : e[t] = n, wt = (e, t, n) => Ct(e, typeof t == "symbol" ? t : t + "", n), Tt, Et, Dt = Symbol.for("ConvexError"), Ot = class extends (Et = Error, Tt = Dt, Et) {
|
|
620
627
|
constructor(e) {
|
|
621
|
-
super(typeof e == "string" ? e :
|
|
628
|
+
super(typeof e == "string" ? e : _t(e)), wt(this, "name", "ConvexError"), wt(this, "data"), wt(this, Tt, !0), this.data = e;
|
|
622
629
|
}
|
|
623
|
-
},
|
|
630
|
+
}, kt = Object.defineProperty, At = (e, t, n) => t in e ? kt(e, t, {
|
|
624
631
|
enumerable: !0,
|
|
625
632
|
configurable: !0,
|
|
626
633
|
writable: !0,
|
|
627
634
|
value: n
|
|
628
|
-
}) : e[t] = n,
|
|
629
|
-
function
|
|
635
|
+
}) : e[t] = n, jt = (e, t, n) => At(e, typeof t == "symbol" ? t : t + "", n), Mt = "color:rgb(0, 145, 255)";
|
|
636
|
+
function Nt(e) {
|
|
630
637
|
switch (e) {
|
|
631
638
|
case "query": return "Q";
|
|
632
639
|
case "mutation": return "M";
|
|
@@ -634,9 +641,9 @@ function At(e) {
|
|
|
634
641
|
case "any": return "?";
|
|
635
642
|
}
|
|
636
643
|
}
|
|
637
|
-
var
|
|
644
|
+
var Pt = class {
|
|
638
645
|
constructor(e) {
|
|
639
|
-
|
|
646
|
+
jt(this, "_onLogLineFuncs"), jt(this, "_verbose"), this._onLogLineFuncs = {}, this._verbose = e.verbose;
|
|
640
647
|
}
|
|
641
648
|
addLogLineListener(e) {
|
|
642
649
|
let t = Math.random().toString(36).substring(2, 15);
|
|
@@ -658,8 +665,8 @@ var jt = class {
|
|
|
658
665
|
for (let t of Object.values(this._onLogLineFuncs)) t("error", ...e);
|
|
659
666
|
}
|
|
660
667
|
};
|
|
661
|
-
function
|
|
662
|
-
let t = new
|
|
668
|
+
function Ft(e) {
|
|
669
|
+
let t = new Pt(e);
|
|
663
670
|
return t.addLogLineListener((e, ...t) => {
|
|
664
671
|
switch (e) {
|
|
665
672
|
case "debug":
|
|
@@ -678,11 +685,11 @@ function Mt(e) {
|
|
|
678
685
|
}
|
|
679
686
|
}), t;
|
|
680
687
|
}
|
|
681
|
-
function
|
|
682
|
-
return new
|
|
688
|
+
function It(e) {
|
|
689
|
+
return new Pt(e);
|
|
683
690
|
}
|
|
684
|
-
function
|
|
685
|
-
let a =
|
|
691
|
+
function Lt(e, t, n, r, i) {
|
|
692
|
+
let a = Nt(n);
|
|
686
693
|
if (typeof i == "object" && (i = `ConvexError ${JSON.stringify(i.errorData, null, 2)}`), t === "info") {
|
|
687
694
|
let t = i.match(/^\[.*?\] /);
|
|
688
695
|
if (t === null) {
|
|
@@ -690,55 +697,55 @@ function Pt(e, t, n, r, i) {
|
|
|
690
697
|
return;
|
|
691
698
|
}
|
|
692
699
|
let n = i.slice(1, t[0].length - 2), o = i.slice(t[0].length);
|
|
693
|
-
e.log(`%c[CONVEX ${a}(${r})] [${n}]`,
|
|
700
|
+
e.log(`%c[CONVEX ${a}(${r})] [${n}]`, Mt, o);
|
|
694
701
|
} else e.error(`[CONVEX ${a}(${r})] ${i}`);
|
|
695
702
|
}
|
|
696
|
-
function
|
|
703
|
+
function Rt(e, t) {
|
|
697
704
|
let n = `[CONVEX FATAL ERROR] ${t}`;
|
|
698
705
|
return e.error(n), Error(n);
|
|
699
706
|
}
|
|
700
|
-
function
|
|
701
|
-
return `[CONVEX ${
|
|
707
|
+
function zt(e, t, n) {
|
|
708
|
+
return `[CONVEX ${Nt(e)}(${t})] ${n.errorMessage}
|
|
702
709
|
Called by client`;
|
|
703
710
|
}
|
|
704
|
-
function
|
|
711
|
+
function Bt(e, t) {
|
|
705
712
|
return t.data = e.errorData, t;
|
|
706
713
|
}
|
|
707
714
|
//#endregion
|
|
708
715
|
//#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/udf_path_utils.js
|
|
709
|
-
function
|
|
716
|
+
function Vt(e) {
|
|
710
717
|
let t = e.split(":"), n, r;
|
|
711
718
|
return t.length === 1 ? (n = t[0], r = "default") : (n = t.slice(0, t.length - 1).join(":"), r = t[t.length - 1]), n.endsWith(".js") && (n = n.slice(0, -3)), `${n}:${r}`;
|
|
712
719
|
}
|
|
713
|
-
function
|
|
720
|
+
function Ht(e, t) {
|
|
714
721
|
return JSON.stringify({
|
|
715
|
-
udfPath:
|
|
716
|
-
args:
|
|
722
|
+
udfPath: Vt(e),
|
|
723
|
+
args: xt(t)
|
|
717
724
|
});
|
|
718
725
|
}
|
|
719
|
-
function
|
|
726
|
+
function Ut(e, t, n) {
|
|
720
727
|
let { initialNumItems: r, id: i } = n;
|
|
721
728
|
return JSON.stringify({
|
|
722
729
|
type: "paginated",
|
|
723
|
-
udfPath:
|
|
724
|
-
args:
|
|
725
|
-
options:
|
|
730
|
+
udfPath: Vt(e),
|
|
731
|
+
args: xt(t),
|
|
732
|
+
options: xt({
|
|
726
733
|
initialNumItems: r,
|
|
727
734
|
id: i
|
|
728
735
|
})
|
|
729
736
|
});
|
|
730
737
|
}
|
|
731
|
-
function
|
|
738
|
+
function Wt(e) {
|
|
732
739
|
return JSON.parse(e).type === "paginated";
|
|
733
740
|
}
|
|
734
741
|
//#endregion
|
|
735
742
|
//#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/local_state.js
|
|
736
|
-
var
|
|
743
|
+
var Gt = Object.defineProperty, Kt = (e, t, n) => t in e ? Gt(e, t, {
|
|
737
744
|
enumerable: !0,
|
|
738
745
|
configurable: !0,
|
|
739
746
|
writable: !0,
|
|
740
747
|
value: n
|
|
741
|
-
}) : e[t] = n, G = (e, t, n) =>
|
|
748
|
+
}) : e[t] = n, G = (e, t, n) => Kt(e, typeof t == "symbol" ? t : t + "", n), qt = class {
|
|
742
749
|
constructor() {
|
|
743
750
|
G(this, "nextQueryId"), G(this, "querySetVersion"), G(this, "querySet"), G(this, "queryIdToToken"), G(this, "identityVersion"), G(this, "auth"), G(this, "outstandingQueriesOlderThanRestart"), G(this, "outstandingAuthOlderThanRestart"), G(this, "paused"), G(this, "pendingQuerySetModifications"), this.nextQueryId = 0, this.querySetVersion = 0, this.identityVersion = 0, this.querySet = /* @__PURE__ */ new Map(), this.queryIdToToken = /* @__PURE__ */ new Map(), this.outstandingQueriesOlderThanRestart = /* @__PURE__ */ new Set(), this.outstandingAuthOlderThanRestart = !1, this.paused = !1, this.pendingQuerySetModifications = /* @__PURE__ */ new Map();
|
|
744
751
|
}
|
|
@@ -749,7 +756,7 @@ var Ht = Object.defineProperty, Ut = (e, t, n) => t in e ? Ht(e, t, {
|
|
|
749
756
|
this.outstandingAuthOlderThanRestart = !1;
|
|
750
757
|
}
|
|
751
758
|
subscribe(e, t, n, r) {
|
|
752
|
-
let i =
|
|
759
|
+
let i = Vt(e), a = Ht(i, t), o = this.querySet.get(a);
|
|
753
760
|
if (o !== void 0) return o.numSubscribers += 1, {
|
|
754
761
|
queryToken: a,
|
|
755
762
|
modification: null,
|
|
@@ -769,7 +776,7 @@ var Ht = Object.defineProperty, Ut = (e, t, n) => t in e ? Ht(e, t, {
|
|
|
769
776
|
type: "Add",
|
|
770
777
|
queryId: e,
|
|
771
778
|
udfPath: i,
|
|
772
|
-
args: [
|
|
779
|
+
args: [xt(t)],
|
|
773
780
|
journal: n,
|
|
774
781
|
componentPath: r
|
|
775
782
|
};
|
|
@@ -804,7 +811,7 @@ var Ht = Object.defineProperty, Ut = (e, t, n) => t in e ? Ht(e, t, {
|
|
|
804
811
|
}
|
|
805
812
|
}
|
|
806
813
|
queryId(e, t) {
|
|
807
|
-
let n =
|
|
814
|
+
let n = Ht(Vt(e), t), r = this.querySet.get(n);
|
|
808
815
|
return r === void 0 ? null : r.id;
|
|
809
816
|
}
|
|
810
817
|
isCurrentOrNewerAuthVersion(e) {
|
|
@@ -876,7 +883,7 @@ var Ht = Object.defineProperty, Ut = (e, t, n) => t in e ? Ht(e, t, {
|
|
|
876
883
|
type: "Add",
|
|
877
884
|
queryId: t.id,
|
|
878
885
|
udfPath: t.canonicalizedUdfPath,
|
|
879
|
-
args: [
|
|
886
|
+
args: [xt(t.args)],
|
|
880
887
|
journal: t.journal,
|
|
881
888
|
componentPath: t.componentPath
|
|
882
889
|
};
|
|
@@ -934,14 +941,14 @@ var Ht = Object.defineProperty, Ut = (e, t, n) => t in e ? Ht(e, t, {
|
|
|
934
941
|
};
|
|
935
942
|
}
|
|
936
943
|
}
|
|
937
|
-
},
|
|
944
|
+
}, Jt = Object.defineProperty, Yt = (e, t, n) => t in e ? Jt(e, t, {
|
|
938
945
|
enumerable: !0,
|
|
939
946
|
configurable: !0,
|
|
940
947
|
writable: !0,
|
|
941
948
|
value: n
|
|
942
|
-
}) : e[t] = n,
|
|
949
|
+
}) : e[t] = n, Xt = (e, t, n) => Yt(e, typeof t == "symbol" ? t : t + "", n), Zt = class {
|
|
943
950
|
constructor(e, t) {
|
|
944
|
-
this.logger = e, this.markConnectionStateDirty = t,
|
|
951
|
+
this.logger = e, this.markConnectionStateDirty = t, Xt(this, "inflightRequests"), Xt(this, "requestsOlderThanRestart"), Xt(this, "inflightMutationsCount", 0), Xt(this, "inflightActionsCount", 0), this.inflightRequests = /* @__PURE__ */ new Map(), this.requestsOlderThanRestart = /* @__PURE__ */ new Set();
|
|
945
952
|
}
|
|
946
953
|
request(e, t) {
|
|
947
954
|
let n = new Promise((n) => {
|
|
@@ -961,19 +968,19 @@ var Ht = Object.defineProperty, Ut = (e, t, n) => t in e ? Ht(e, t, {
|
|
|
961
968
|
let t = this.inflightRequests.get(e.requestId);
|
|
962
969
|
if (t === void 0 || t.status.status === "Completed") return null;
|
|
963
970
|
let n = t.message.type === "Mutation" ? "mutation" : "action", r = t.message.udfPath;
|
|
964
|
-
for (let t of e.logLines)
|
|
971
|
+
for (let t of e.logLines) Lt(this.logger, "info", n, r, t);
|
|
965
972
|
let i = t.status, a, o;
|
|
966
973
|
if (e.success) a = {
|
|
967
974
|
success: !0,
|
|
968
975
|
logLines: e.logLines,
|
|
969
|
-
value:
|
|
976
|
+
value: ht(e.result)
|
|
970
977
|
}, o = () => i.onResult(a);
|
|
971
978
|
else {
|
|
972
979
|
let t = e.result, { errorData: s } = e;
|
|
973
|
-
|
|
980
|
+
Lt(this.logger, "error", n, r, t), a = {
|
|
974
981
|
success: !1,
|
|
975
982
|
errorMessage: t,
|
|
976
|
-
errorData: s === void 0 ? void 0 :
|
|
983
|
+
errorData: s === void 0 ? void 0 : ht(s),
|
|
977
984
|
logLines: e.logLines
|
|
978
985
|
}, o = () => i.onResult(a);
|
|
979
986
|
}
|
|
@@ -1045,19 +1052,19 @@ var Ht = Object.defineProperty, Ut = (e, t, n) => t in e ? Ht(e, t, {
|
|
|
1045
1052
|
inflightActions() {
|
|
1046
1053
|
return this.inflightActionsCount;
|
|
1047
1054
|
}
|
|
1048
|
-
},
|
|
1049
|
-
function
|
|
1050
|
-
return e[
|
|
1055
|
+
}, Qt = Symbol.for("functionName"), $t = Symbol.for("toReferencePath");
|
|
1056
|
+
function en(e) {
|
|
1057
|
+
return e[$t] ?? null;
|
|
1051
1058
|
}
|
|
1052
|
-
function
|
|
1059
|
+
function tn(e) {
|
|
1053
1060
|
return e.startsWith("function://");
|
|
1054
1061
|
}
|
|
1055
|
-
function
|
|
1062
|
+
function nn(e) {
|
|
1056
1063
|
let t;
|
|
1057
|
-
if (typeof e == "string") t =
|
|
1058
|
-
else if (e[
|
|
1064
|
+
if (typeof e == "string") t = tn(e) ? { functionHandle: e } : { name: e };
|
|
1065
|
+
else if (e[Qt]) t = { name: e[Qt] };
|
|
1059
1066
|
else {
|
|
1060
|
-
let n =
|
|
1067
|
+
let n = en(e);
|
|
1061
1068
|
if (!n) throw Error(`${e} is not a functionReference`);
|
|
1062
1069
|
t = { reference: n };
|
|
1063
1070
|
}
|
|
@@ -1066,20 +1073,20 @@ function $t(e) {
|
|
|
1066
1073
|
//#endregion
|
|
1067
1074
|
//#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/server/api.js
|
|
1068
1075
|
function K(e) {
|
|
1069
|
-
let t =
|
|
1076
|
+
let t = nn(e);
|
|
1070
1077
|
if (t.name === void 0) throw t.functionHandle === void 0 ? t.reference === void 0 ? Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`) : Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`) : Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`);
|
|
1071
1078
|
if (typeof e == "string") return e;
|
|
1072
|
-
let n = e[
|
|
1079
|
+
let n = e[Qt];
|
|
1073
1080
|
if (!n) throw Error(`${e} is not a functionReference`);
|
|
1074
1081
|
return n;
|
|
1075
1082
|
}
|
|
1076
|
-
function
|
|
1077
|
-
return { [
|
|
1083
|
+
function rn(e) {
|
|
1084
|
+
return { [Qt]: e };
|
|
1078
1085
|
}
|
|
1079
|
-
function
|
|
1086
|
+
function an(e = []) {
|
|
1080
1087
|
return new Proxy({}, { get(t, n) {
|
|
1081
|
-
if (typeof n == "string") return
|
|
1082
|
-
if (n ===
|
|
1088
|
+
if (typeof n == "string") return an([...e, n]);
|
|
1089
|
+
if (n === Qt) {
|
|
1083
1090
|
if (e.length < 2) {
|
|
1084
1091
|
let t = ["api", ...e].join(".");
|
|
1085
1092
|
throw Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${t}\``);
|
|
@@ -1090,32 +1097,32 @@ function tn(e = []) {
|
|
|
1090
1097
|
else return;
|
|
1091
1098
|
} });
|
|
1092
1099
|
}
|
|
1093
|
-
|
|
1100
|
+
an();
|
|
1094
1101
|
//#endregion
|
|
1095
1102
|
//#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/optimistic_updates_impl.js
|
|
1096
|
-
var
|
|
1103
|
+
var on = Object.defineProperty, sn = (e, t, n) => t in e ? on(e, t, {
|
|
1097
1104
|
enumerable: !0,
|
|
1098
1105
|
configurable: !0,
|
|
1099
1106
|
writable: !0,
|
|
1100
1107
|
value: n
|
|
1101
|
-
}) : e[t] = n,
|
|
1108
|
+
}) : e[t] = n, cn = (e, t, n) => sn(e, typeof t == "symbol" ? t : t + "", n), ln = class e {
|
|
1102
1109
|
constructor(e) {
|
|
1103
|
-
|
|
1110
|
+
cn(this, "queryResults"), cn(this, "modifiedQueries"), this.queryResults = e, this.modifiedQueries = [];
|
|
1104
1111
|
}
|
|
1105
1112
|
getQuery(t, ...n) {
|
|
1106
|
-
let r =
|
|
1113
|
+
let r = Ze(n[0]), i = K(t), a = this.queryResults.get(Ht(i, r));
|
|
1107
1114
|
if (a !== void 0) return e.queryValue(a.result);
|
|
1108
1115
|
}
|
|
1109
1116
|
getAllQueries(t) {
|
|
1110
1117
|
let n = [], r = K(t);
|
|
1111
|
-
for (let t of this.queryResults.values()) t.udfPath ===
|
|
1118
|
+
for (let t of this.queryResults.values()) t.udfPath === Vt(r) && n.push({
|
|
1112
1119
|
args: t.args,
|
|
1113
1120
|
value: e.queryValue(t.result)
|
|
1114
1121
|
});
|
|
1115
1122
|
return n;
|
|
1116
1123
|
}
|
|
1117
1124
|
setQuery(e, t, n) {
|
|
1118
|
-
let r =
|
|
1125
|
+
let r = Ze(t), i = K(e), a = Ht(i, r), o;
|
|
1119
1126
|
o = n === void 0 ? void 0 : {
|
|
1120
1127
|
success: !0,
|
|
1121
1128
|
value: n,
|
|
@@ -1131,15 +1138,15 @@ var nn = Object.defineProperty, rn = (e, t, n) => t in e ? nn(e, t, {
|
|
|
1131
1138
|
static queryValue(e) {
|
|
1132
1139
|
if (e !== void 0 && e.success) return e.value;
|
|
1133
1140
|
}
|
|
1134
|
-
},
|
|
1141
|
+
}, un = class {
|
|
1135
1142
|
constructor() {
|
|
1136
|
-
|
|
1143
|
+
cn(this, "queryResults"), cn(this, "optimisticUpdates"), this.queryResults = /* @__PURE__ */ new Map(), this.optimisticUpdates = [];
|
|
1137
1144
|
}
|
|
1138
1145
|
ingestQueryResultsFromServer(e, t) {
|
|
1139
1146
|
this.optimisticUpdates = this.optimisticUpdates.filter((e) => !t.has(e.mutationId));
|
|
1140
1147
|
let n = this.queryResults;
|
|
1141
1148
|
this.queryResults = new Map(e);
|
|
1142
|
-
let r = new
|
|
1149
|
+
let r = new ln(this.queryResults);
|
|
1143
1150
|
for (let e of this.optimisticUpdates) e.update(r);
|
|
1144
1151
|
let i = [];
|
|
1145
1152
|
for (let [e, t] of this.queryResults) {
|
|
@@ -1153,7 +1160,7 @@ var nn = Object.defineProperty, rn = (e, t, n) => t in e ? nn(e, t, {
|
|
|
1153
1160
|
update: e,
|
|
1154
1161
|
mutationId: t
|
|
1155
1162
|
});
|
|
1156
|
-
let n = new
|
|
1163
|
+
let n = new ln(this.queryResults);
|
|
1157
1164
|
return e(n), n.modifiedQueries;
|
|
1158
1165
|
}
|
|
1159
1166
|
rawQueryResult(e) {
|
|
@@ -1166,7 +1173,7 @@ var nn = Object.defineProperty, rn = (e, t, n) => t in e ? nn(e, t, {
|
|
|
1166
1173
|
let n = t.result;
|
|
1167
1174
|
if (n !== void 0) {
|
|
1168
1175
|
if (n.success) return n.value;
|
|
1169
|
-
throw n.errorData === void 0 ? Error(
|
|
1176
|
+
throw n.errorData === void 0 ? Error(zt("query", t.udfPath, n)) : Bt(n, new Ot(zt("query", t.udfPath, n)));
|
|
1170
1177
|
}
|
|
1171
1178
|
}
|
|
1172
1179
|
hasQueryResult(e) {
|
|
@@ -1175,14 +1182,14 @@ var nn = Object.defineProperty, rn = (e, t, n) => t in e ? nn(e, t, {
|
|
|
1175
1182
|
queryLogs(e) {
|
|
1176
1183
|
return this.queryResults.get(e)?.result?.logLines;
|
|
1177
1184
|
}
|
|
1178
|
-
},
|
|
1185
|
+
}, dn = Object.defineProperty, fn = (e, t, n) => t in e ? dn(e, t, {
|
|
1179
1186
|
enumerable: !0,
|
|
1180
1187
|
configurable: !0,
|
|
1181
1188
|
writable: !0,
|
|
1182
1189
|
value: n
|
|
1183
|
-
}) : e[t] = n,
|
|
1190
|
+
}) : e[t] = n, pn = (e, t, n) => fn(e, typeof t == "symbol" ? t : t + "", n), mn = class e {
|
|
1184
1191
|
constructor(e, t) {
|
|
1185
|
-
|
|
1192
|
+
pn(this, "low"), pn(this, "high"), pn(this, "__isUnsignedLong__"), this.low = e | 0, this.high = t | 0, this.__isUnsignedLong__ = !0;
|
|
1186
1193
|
}
|
|
1187
1194
|
static isLong(e) {
|
|
1188
1195
|
return (e && e.__isUnsignedLong__) === !0;
|
|
@@ -1204,10 +1211,10 @@ var nn = Object.defineProperty, rn = (e, t, n) => t in e ? nn(e, t, {
|
|
|
1204
1211
|
];
|
|
1205
1212
|
}
|
|
1206
1213
|
static fromNumber(t) {
|
|
1207
|
-
return isNaN(t) || t < 0 ?
|
|
1214
|
+
return isNaN(t) || t < 0 ? hn : t >= vn ? yn : new e(t % _n | 0, t / _n | 0);
|
|
1208
1215
|
}
|
|
1209
1216
|
toString() {
|
|
1210
|
-
return (BigInt(this.high) * BigInt(
|
|
1217
|
+
return (BigInt(this.high) * BigInt(_n) + BigInt(this.low)).toString();
|
|
1211
1218
|
}
|
|
1212
1219
|
equals(t) {
|
|
1213
1220
|
return e.isLong(t) || (t = e.fromValue(t)), this.high >>> 31 == 1 && t.high >>> 31 == 1 ? !1 : this.high === t.high && this.low === t.low;
|
|
@@ -1224,16 +1231,16 @@ var nn = Object.defineProperty, rn = (e, t, n) => t in e ? nn(e, t, {
|
|
|
1224
1231
|
static fromValue(t) {
|
|
1225
1232
|
return typeof t == "number" ? e.fromNumber(t) : new e(t.low, t.high);
|
|
1226
1233
|
}
|
|
1227
|
-
},
|
|
1234
|
+
}, hn = new mn(0, 0), gn = 65536, _n = gn * gn, vn = _n * _n, yn = new mn(-1, -1), bn = Object.defineProperty, xn = (e, t, n) => t in e ? bn(e, t, {
|
|
1228
1235
|
enumerable: !0,
|
|
1229
1236
|
configurable: !0,
|
|
1230
1237
|
writable: !0,
|
|
1231
1238
|
value: n
|
|
1232
|
-
}) : e[t] = n,
|
|
1239
|
+
}) : e[t] = n, Sn = (e, t, n) => xn(e, typeof t == "symbol" ? t : t + "", n), Cn = class {
|
|
1233
1240
|
constructor(e, t) {
|
|
1234
|
-
|
|
1241
|
+
Sn(this, "version"), Sn(this, "remoteQuerySet"), Sn(this, "queryPath"), Sn(this, "logger"), this.version = {
|
|
1235
1242
|
querySet: 0,
|
|
1236
|
-
ts:
|
|
1243
|
+
ts: mn.fromNumber(0),
|
|
1237
1244
|
identity: 0
|
|
1238
1245
|
}, this.remoteQuerySet = /* @__PURE__ */ new Map(), this.queryPath = e, this.logger = t;
|
|
1239
1246
|
}
|
|
@@ -1243,8 +1250,8 @@ var nn = Object.defineProperty, rn = (e, t, n) => t in e ? nn(e, t, {
|
|
|
1243
1250
|
for (let t of e.modifications) switch (t.type) {
|
|
1244
1251
|
case "QueryUpdated": {
|
|
1245
1252
|
let e = this.queryPath(t.queryId);
|
|
1246
|
-
if (e) for (let n of t.logLines)
|
|
1247
|
-
let n =
|
|
1253
|
+
if (e) for (let n of t.logLines) Lt(this.logger, "info", "query", e, n);
|
|
1254
|
+
let n = ht(t.value ?? null);
|
|
1248
1255
|
this.remoteQuerySet.set(t.queryId, {
|
|
1249
1256
|
success: !0,
|
|
1250
1257
|
value: n,
|
|
@@ -1254,12 +1261,12 @@ var nn = Object.defineProperty, rn = (e, t, n) => t in e ? nn(e, t, {
|
|
|
1254
1261
|
}
|
|
1255
1262
|
case "QueryFailed": {
|
|
1256
1263
|
let e = this.queryPath(t.queryId);
|
|
1257
|
-
if (e) for (let n of t.logLines)
|
|
1264
|
+
if (e) for (let n of t.logLines) Lt(this.logger, "info", "query", e, n);
|
|
1258
1265
|
let { errorData: n } = t;
|
|
1259
1266
|
this.remoteQuerySet.set(t.queryId, {
|
|
1260
1267
|
success: !1,
|
|
1261
1268
|
errorMessage: t.errorMessage,
|
|
1262
|
-
errorData: n === void 0 ? void 0 :
|
|
1269
|
+
errorData: n === void 0 ? void 0 : ht(n),
|
|
1263
1270
|
logLines: t.logLines
|
|
1264
1271
|
});
|
|
1265
1272
|
break;
|
|
@@ -1280,14 +1287,14 @@ var nn = Object.defineProperty, rn = (e, t, n) => t in e ? nn(e, t, {
|
|
|
1280
1287
|
};
|
|
1281
1288
|
//#endregion
|
|
1282
1289
|
//#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/protocol.js
|
|
1283
|
-
function
|
|
1284
|
-
let t =
|
|
1285
|
-
return
|
|
1290
|
+
function wn(e) {
|
|
1291
|
+
let t = qe(e);
|
|
1292
|
+
return mn.fromBytesLE(Array.from(t));
|
|
1286
1293
|
}
|
|
1287
|
-
function
|
|
1288
|
-
return
|
|
1294
|
+
function Tn(e) {
|
|
1295
|
+
return Xe(new Uint8Array(e.toBytesLE()));
|
|
1289
1296
|
}
|
|
1290
|
-
function
|
|
1297
|
+
function En(e) {
|
|
1291
1298
|
switch (e.type) {
|
|
1292
1299
|
case "FatalError":
|
|
1293
1300
|
case "AuthError":
|
|
@@ -1296,23 +1303,23 @@ function Cn(e) {
|
|
|
1296
1303
|
case "Ping": return { ...e };
|
|
1297
1304
|
case "MutationResponse": return e.success ? {
|
|
1298
1305
|
...e,
|
|
1299
|
-
ts:
|
|
1306
|
+
ts: wn(e.ts)
|
|
1300
1307
|
} : { ...e };
|
|
1301
1308
|
case "Transition": return {
|
|
1302
1309
|
...e,
|
|
1303
1310
|
startVersion: {
|
|
1304
1311
|
...e.startVersion,
|
|
1305
|
-
ts:
|
|
1312
|
+
ts: wn(e.startVersion.ts)
|
|
1306
1313
|
},
|
|
1307
1314
|
endVersion: {
|
|
1308
1315
|
...e.endVersion,
|
|
1309
|
-
ts:
|
|
1316
|
+
ts: wn(e.endVersion.ts)
|
|
1310
1317
|
}
|
|
1311
1318
|
};
|
|
1312
1319
|
default:
|
|
1313
1320
|
}
|
|
1314
1321
|
}
|
|
1315
|
-
function
|
|
1322
|
+
function Dn(e) {
|
|
1316
1323
|
switch (e.type) {
|
|
1317
1324
|
case "Authenticate":
|
|
1318
1325
|
case "ModifyQuerySet":
|
|
@@ -1324,26 +1331,26 @@ function wn(e) {
|
|
|
1324
1331
|
maxObservedTimestamp: void 0
|
|
1325
1332
|
} : {
|
|
1326
1333
|
...e,
|
|
1327
|
-
maxObservedTimestamp:
|
|
1334
|
+
maxObservedTimestamp: Tn(e.maxObservedTimestamp)
|
|
1328
1335
|
};
|
|
1329
1336
|
default:
|
|
1330
1337
|
}
|
|
1331
1338
|
}
|
|
1332
1339
|
//#endregion
|
|
1333
1340
|
//#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/web_socket_manager.js
|
|
1334
|
-
var
|
|
1341
|
+
var On = Object.defineProperty, kn = (e, t, n) => t in e ? On(e, t, {
|
|
1335
1342
|
enumerable: !0,
|
|
1336
1343
|
configurable: !0,
|
|
1337
1344
|
writable: !0,
|
|
1338
1345
|
value: n
|
|
1339
|
-
}) : e[t] = n, q = (e, t, n) =>
|
|
1340
|
-
function
|
|
1341
|
-
return
|
|
1346
|
+
}) : e[t] = n, q = (e, t, n) => kn(e, typeof t == "symbol" ? t : t + "", n), An = 1e3, jn = 1001, Mn = 1005, Nn = 4040, Pn;
|
|
1347
|
+
function Fn() {
|
|
1348
|
+
return Pn === void 0 && (Pn = Date.now()), typeof performance > "u" || !performance.now ? Date.now() : Math.round(Pn + performance.now());
|
|
1342
1349
|
}
|
|
1343
|
-
function
|
|
1344
|
-
return `t=${Math.round((
|
|
1350
|
+
function In() {
|
|
1351
|
+
return `t=${Math.round((Fn() - Pn) / 100) / 10}s`;
|
|
1345
1352
|
}
|
|
1346
|
-
var
|
|
1353
|
+
var Ln = {
|
|
1347
1354
|
InternalServerError: { timeout: 1e3 },
|
|
1348
1355
|
SubscriptionsWorkerFullError: { timeout: 3e3 },
|
|
1349
1356
|
TooManyConcurrentRequests: { timeout: 3e3 },
|
|
@@ -1359,12 +1366,12 @@ var Pn = {
|
|
|
1359
1366
|
SearchIndexTooLarge: { timeout: 3e3 },
|
|
1360
1367
|
TooManyWritesInTimePeriod: { timeout: 3e3 }
|
|
1361
1368
|
};
|
|
1362
|
-
function
|
|
1369
|
+
function Rn(e) {
|
|
1363
1370
|
if (e === void 0) return "Unknown";
|
|
1364
|
-
for (let t of Object.keys(
|
|
1371
|
+
for (let t of Object.keys(Ln)) if (e.startsWith(t)) return t;
|
|
1365
1372
|
return "Unknown";
|
|
1366
1373
|
}
|
|
1367
|
-
var
|
|
1374
|
+
var zn = class {
|
|
1368
1375
|
constructor(e, t, n, r, i, a) {
|
|
1369
1376
|
this.markConnectionStateDirty = i, this.debug = a, q(this, "socket"), q(this, "connectionCount"), q(this, "_hasEverConnected", !1), q(this, "lastCloseReason"), q(this, "transitionChunkBuffer", null), q(this, "defaultInitialBackoff"), q(this, "maxBackoff"), q(this, "retries"), q(this, "serverInactivityThreshold"), q(this, "reconnectDueToServerInactivityTimeout"), q(this, "scheduledReconnect", null), q(this, "networkOnlineHandler", null), q(this, "pendingNetworkRecoveryInfo", null), q(this, "uri"), q(this, "onOpen"), q(this, "onResume"), q(this, "onMessage"), q(this, "webSocketConstructor"), q(this, "logger"), q(this, "onServerDisconnectError"), this.webSocketConstructor = n, this.socket = { state: "disconnected" }, this.connectionCount = 0, this.lastCloseReason = "InitialConnect", this.defaultInitialBackoff = 1e3, this.maxBackoff = 16e3, this.retries = 0, this.serverInactivityThreshold = 6e4, this.reconnectDueToServerInactivityTimeout = null, this.uri = e, this.onOpen = t.onOpen, this.onResume = t.onResume, this.onMessage = t.onMessage, this.onServerDisconnectError = t.onServerDisconnectError, this.logger = r, this.setupNetworkListener(), this.connect();
|
|
1370
1377
|
}
|
|
@@ -1392,7 +1399,7 @@ var In = class {
|
|
|
1392
1399
|
if (this.transitionChunkBuffer.chunks.push(e.chunk), this.transitionChunkBuffer.chunks.length === e.totalParts) {
|
|
1393
1400
|
let e = this.transitionChunkBuffer.chunks.join("");
|
|
1394
1401
|
this.transitionChunkBuffer = null;
|
|
1395
|
-
let t =
|
|
1402
|
+
let t = En(JSON.parse(e));
|
|
1396
1403
|
if (t.type !== "Transition") throw Error(`Expected Transition, got ${t.type} after assembling chunks`);
|
|
1397
1404
|
return t;
|
|
1398
1405
|
}
|
|
@@ -1415,8 +1422,8 @@ var In = class {
|
|
|
1415
1422
|
}), this.resetServerInactivityTimeout(), this.socket.paused === "no" && (this._hasEverConnected = !0, this.onOpen({
|
|
1416
1423
|
connectionCount: this.connectionCount,
|
|
1417
1424
|
lastCloseReason: this.lastCloseReason,
|
|
1418
|
-
clientTs:
|
|
1419
|
-
})), this.lastCloseReason !== "InitialConnect" && (this.lastCloseReason ? this.logger.log("WebSocket reconnected at",
|
|
1425
|
+
clientTs: Fn()
|
|
1426
|
+
})), this.lastCloseReason !== "InitialConnect" && (this.lastCloseReason ? this.logger.log("WebSocket reconnected at", In(), "after disconnect due to", this.lastCloseReason) : this.logger.log("WebSocket reconnected at", In())), this.connectionCount += 1, this.lastCloseReason = null, this.pendingNetworkRecoveryInfo !== null) {
|
|
1420
1427
|
let { timeSavedMs: e } = this.pendingNetworkRecoveryInfo;
|
|
1421
1428
|
this.pendingNetworkRecoveryInfo = null, this.sendMessage({
|
|
1422
1429
|
type: "Event",
|
|
@@ -1430,7 +1437,7 @@ var In = class {
|
|
|
1430
1437
|
t && this.logger.log(`WebSocket error message: ${t}`);
|
|
1431
1438
|
}, e.onmessage = (e) => {
|
|
1432
1439
|
this.resetServerInactivityTimeout();
|
|
1433
|
-
let t = e.data.length, n =
|
|
1440
|
+
let t = e.data.length, n = En(JSON.parse(e.data));
|
|
1434
1441
|
if (this._logVerbose(`received ws message with type ${n.type}`), n.type !== "Ping") {
|
|
1435
1442
|
if (n.type === "TransitionChunk") {
|
|
1436
1443
|
let e = this.assembleTransition(n);
|
|
@@ -1443,11 +1450,11 @@ var In = class {
|
|
|
1443
1450
|
}), this.onMessage(n).hasSyncedPastLastReconnect && (this.retries = 0, this.markConnectionStateDirty());
|
|
1444
1451
|
}
|
|
1445
1452
|
}, e.onclose = (e) => {
|
|
1446
|
-
if (this._logVerbose("begin ws.onclose"), this.transitionChunkBuffer = null, this.lastCloseReason === null && (this.lastCloseReason = e.reason || `closed with code ${e.code}`), e.code !==
|
|
1453
|
+
if (this._logVerbose("begin ws.onclose"), this.transitionChunkBuffer = null, this.lastCloseReason === null && (this.lastCloseReason = e.reason || `closed with code ${e.code}`), e.code !== An && e.code !== jn && e.code !== Mn && e.code !== Nn) {
|
|
1447
1454
|
let t = `WebSocket closed with code ${e.code}`;
|
|
1448
1455
|
e.reason && (t += `: ${e.reason}`), this.logger.log(t), this.onServerDisconnectError && e.reason && this.onServerDisconnectError(t);
|
|
1449
1456
|
}
|
|
1450
|
-
let t =
|
|
1457
|
+
let t = Rn(e.reason);
|
|
1451
1458
|
this.scheduleReconnect(t);
|
|
1452
1459
|
};
|
|
1453
1460
|
}
|
|
@@ -1460,7 +1467,7 @@ var In = class {
|
|
|
1460
1467
|
...e.type === "Authenticate" && e.tokenType === "User" ? { value: `...${e.value.slice(-7)}` } : {}
|
|
1461
1468
|
};
|
|
1462
1469
|
if (this.socket.state === "ready" && this.socket.paused === "no") {
|
|
1463
|
-
let n =
|
|
1470
|
+
let n = Dn(e), r = JSON.stringify(n), i = !1;
|
|
1464
1471
|
try {
|
|
1465
1472
|
this.socket.ws.send(r), i = !0;
|
|
1466
1473
|
} catch (e) {
|
|
@@ -1479,7 +1486,7 @@ var In = class {
|
|
|
1479
1486
|
this.scheduledReconnect &&= (clearTimeout(this.scheduledReconnect.timeout), null), this.socket = { state: "disconnected" };
|
|
1480
1487
|
let t = this.nextBackoff(e);
|
|
1481
1488
|
this.markConnectionStateDirty(), this.logger.log(`Attempting reconnect in ${Math.round(t)}ms`);
|
|
1482
|
-
let n =
|
|
1489
|
+
let n = Fn(), r = setTimeout(() => {
|
|
1483
1490
|
this.scheduledReconnect?.timeout === r && (this.scheduledReconnect = null, this.connect());
|
|
1484
1491
|
}, t);
|
|
1485
1492
|
this.scheduledReconnect = {
|
|
@@ -1597,7 +1604,7 @@ var In = class {
|
|
|
1597
1604
|
}
|
|
1598
1605
|
let e = null;
|
|
1599
1606
|
if (this.scheduledReconnect) {
|
|
1600
|
-
let t =
|
|
1607
|
+
let t = Fn() - this.scheduledReconnect.scheduledAt;
|
|
1601
1608
|
e = Math.max(0, this.scheduledReconnect.backoffMs - t), this._logVerbose(`would have waited ${Math.round(e)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(t)}ms)`), clearTimeout(this.scheduledReconnect.timeout), this.scheduledReconnect = null, this._logVerbose("canceled scheduled reconnect");
|
|
1602
1609
|
}
|
|
1603
1610
|
this.logger.log("Network recovery detected, reconnecting immediately"), this.pendingNetworkRecoveryInfo = e === null ? null : { timeSavedMs: e }, this.connect();
|
|
@@ -1617,7 +1624,7 @@ var In = class {
|
|
|
1617
1624
|
}, this._hasEverConnected = !0, this.onOpen({
|
|
1618
1625
|
connectionCount: this.connectionCount,
|
|
1619
1626
|
lastCloseReason: this.lastCloseReason,
|
|
1620
|
-
clientTs:
|
|
1627
|
+
clientTs: Fn()
|
|
1621
1628
|
})) : this.socket.paused === "yes" && (this.socket = {
|
|
1622
1629
|
...this.socket,
|
|
1623
1630
|
paused: "no"
|
|
@@ -1642,14 +1649,14 @@ var In = class {
|
|
|
1642
1649
|
this.logger.logVerbose(e);
|
|
1643
1650
|
}
|
|
1644
1651
|
nextBackoff(e) {
|
|
1645
|
-
let t = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff :
|
|
1652
|
+
let t = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff : Ln[e].timeout) * 2 ** this.retries;
|
|
1646
1653
|
this.retries += 1;
|
|
1647
1654
|
let n = Math.min(t, this.maxBackoff);
|
|
1648
1655
|
return n + n * (Math.random() - .5);
|
|
1649
1656
|
}
|
|
1650
1657
|
reportLargeTransition({ transition: e, messageLength: t }) {
|
|
1651
1658
|
if (e.clientClockSkew === void 0 || e.serverTs === void 0) return;
|
|
1652
|
-
let n =
|
|
1659
|
+
let n = Fn() - e.clientClockSkew - e.serverTs / 1e6, r = `${Math.round(n)}ms`, i = `${Math.round(t / 1e4) / 100}MB`, a = t / (n / 1e3), o = `${Math.round(a / 1e4) / 100}MB per second`;
|
|
1653
1660
|
this._logVerbose(`received ${i} transition in ${r} at ${o}`), t > 2e7 ? this.logger.log(`received query results totaling more that 20MB (${i}) which will take a long time to download on slower connections`) : n > 2e4 && this.logger.log(`received query results totaling ${i} which took more than 20s to arrive (${r})`), this.debug && this.sendMessage({
|
|
1654
1661
|
type: "Event",
|
|
1655
1662
|
eventType: "ClientReceivedTransition",
|
|
@@ -1662,10 +1669,10 @@ var In = class {
|
|
|
1662
1669
|
};
|
|
1663
1670
|
//#endregion
|
|
1664
1671
|
//#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/session.js
|
|
1665
|
-
function
|
|
1666
|
-
return
|
|
1672
|
+
function Bn() {
|
|
1673
|
+
return Vn();
|
|
1667
1674
|
}
|
|
1668
|
-
function
|
|
1675
|
+
function Vn() {
|
|
1669
1676
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
|
|
1670
1677
|
let t = Math.random() * 16 | 0;
|
|
1671
1678
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
@@ -1673,15 +1680,15 @@ function Rn() {
|
|
|
1673
1680
|
}
|
|
1674
1681
|
//#endregion
|
|
1675
1682
|
//#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/vendor/jwt-decode/index.js
|
|
1676
|
-
var
|
|
1677
|
-
|
|
1678
|
-
function
|
|
1683
|
+
var Hn = class extends Error {};
|
|
1684
|
+
Hn.prototype.name = "InvalidTokenError";
|
|
1685
|
+
function Un(e) {
|
|
1679
1686
|
return decodeURIComponent(atob(e).replace(/(.)/g, (e, t) => {
|
|
1680
1687
|
let n = t.charCodeAt(0).toString(16).toUpperCase();
|
|
1681
1688
|
return n.length < 2 && (n = "0" + n), "%" + n;
|
|
1682
1689
|
}));
|
|
1683
1690
|
}
|
|
1684
|
-
function
|
|
1691
|
+
function Wn(e) {
|
|
1685
1692
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
1686
1693
|
switch (t.length % 4) {
|
|
1687
1694
|
case 0: break;
|
|
@@ -1694,36 +1701,36 @@ function Vn(e) {
|
|
|
1694
1701
|
default: throw Error("base64 string is not of the correct length");
|
|
1695
1702
|
}
|
|
1696
1703
|
try {
|
|
1697
|
-
return
|
|
1704
|
+
return Un(t);
|
|
1698
1705
|
} catch {
|
|
1699
1706
|
return atob(t);
|
|
1700
1707
|
}
|
|
1701
1708
|
}
|
|
1702
|
-
function
|
|
1703
|
-
if (typeof e != "string") throw new
|
|
1709
|
+
function Gn(e, t) {
|
|
1710
|
+
if (typeof e != "string") throw new Hn("Invalid token specified: must be a string");
|
|
1704
1711
|
t ||= {};
|
|
1705
1712
|
let n = t.header === !0 ? 0 : 1, r = e.split(".")[n];
|
|
1706
|
-
if (typeof r != "string") throw new
|
|
1713
|
+
if (typeof r != "string") throw new Hn(`Invalid token specified: missing part #${n + 1}`);
|
|
1707
1714
|
let i;
|
|
1708
1715
|
try {
|
|
1709
|
-
i =
|
|
1716
|
+
i = Wn(r);
|
|
1710
1717
|
} catch (e) {
|
|
1711
|
-
throw new
|
|
1718
|
+
throw new Hn(`Invalid token specified: invalid base64 for part #${n + 1} (${e.message})`);
|
|
1712
1719
|
}
|
|
1713
1720
|
try {
|
|
1714
1721
|
return JSON.parse(i);
|
|
1715
1722
|
} catch (e) {
|
|
1716
|
-
throw new
|
|
1723
|
+
throw new Hn(`Invalid token specified: invalid json for part #${n + 1} (${e.message})`);
|
|
1717
1724
|
}
|
|
1718
1725
|
}
|
|
1719
1726
|
//#endregion
|
|
1720
1727
|
//#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/authentication_manager.js
|
|
1721
|
-
var
|
|
1728
|
+
var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
|
|
1722
1729
|
enumerable: !0,
|
|
1723
1730
|
configurable: !0,
|
|
1724
1731
|
writable: !0,
|
|
1725
1732
|
value: n
|
|
1726
|
-
}) : e[t] = n, J = (e, t, n) =>
|
|
1733
|
+
}) : e[t] = n, J = (e, t, n) => qn(e, typeof t == "symbol" ? t : t + "", n), Jn = 480 * 60 * 60 * 1e3, Yn = 2, Xn = class {
|
|
1727
1734
|
constructor(e, t, n) {
|
|
1728
1735
|
J(this, "authState", { state: "noAuth" }), J(this, "configVersion", 0), J(this, "syncState"), J(this, "authenticate"), J(this, "stopSocket"), J(this, "tryRestartSocket"), J(this, "pauseSocket"), J(this, "resumeSocket"), J(this, "clearAuth"), J(this, "logger"), J(this, "refreshTokenLeewaySeconds"), J(this, "tokenConfirmationAttempts", 0), this.syncState = e, this.authenticate = t.authenticate, this.stopSocket = t.stopSocket, this.tryRestartSocket = t.tryRestartSocket, this.pauseSocket = t.pauseSocket, this.resumeSocket = t.resumeSocket, this.clearAuth = t.clearAuth, this.logger = n.logger, this.refreshTokenLeewaySeconds = n.refreshTokenLeewaySeconds;
|
|
1729
1736
|
}
|
|
@@ -1767,11 +1774,11 @@ var Un = Object.defineProperty, Wn = (e, t, n) => t in e ? Un(e, t, {
|
|
|
1767
1774
|
this.tryToReauthenticate(e);
|
|
1768
1775
|
}
|
|
1769
1776
|
async tryToReauthenticate(e) {
|
|
1770
|
-
if (this._logVerbose(`attempting to reauthenticate: ${e.error}`), this.authState.state === "noAuth" || this.authState.state === "waitingForServerConfirmationOfFreshToken" && this.tokenConfirmationAttempts >=
|
|
1777
|
+
if (this._logVerbose(`attempting to reauthenticate: ${e.error}`), this.authState.state === "noAuth" || this.authState.state === "waitingForServerConfirmationOfFreshToken" && this.tokenConfirmationAttempts >= Yn) {
|
|
1771
1778
|
this.logger.error(`Failed to authenticate: "${e.error}", check your server auth config`), this.syncState.hasAuth() && this.syncState.clearAuth(), this.authState.state !== "noAuth" && this.setAndReportAuthFailed(this.authState.config.onAuthChange);
|
|
1772
1779
|
return;
|
|
1773
1780
|
}
|
|
1774
|
-
this.authState.state === "waitingForServerConfirmationOfFreshToken" && (this.tokenConfirmationAttempts++, this._logVerbose(`retrying reauthentication, ${
|
|
1781
|
+
this.authState.state === "waitingForServerConfirmationOfFreshToken" && (this.tokenConfirmationAttempts++, this._logVerbose(`retrying reauthentication, ${Yn - this.tokenConfirmationAttempts} attempts remaining`)), await this.stopSocket();
|
|
1775
1782
|
let t = await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken, { forceRefreshToken: !0 });
|
|
1776
1783
|
t.isFromOutdatedConfig || (t.value && this.syncState.isNewAuth(t.value) ? (this.authenticate(t.value), this.setAuthState({
|
|
1777
1784
|
state: "waitingForServerConfirmationOfFreshToken",
|
|
@@ -1811,7 +1818,7 @@ var Un = Object.defineProperty, Wn = (e, t, n) => t in e ? Un(e, t, {
|
|
|
1811
1818
|
this.logger.error("Auth token does not live long enough, cannot refetch the token");
|
|
1812
1819
|
return;
|
|
1813
1820
|
}
|
|
1814
|
-
let a = Math.min(
|
|
1821
|
+
let a = Math.min(Jn, (i - this.refreshTokenLeewaySeconds) * 1e3);
|
|
1815
1822
|
a <= 0 && (this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${i}s`), a = 0);
|
|
1816
1823
|
let o = setTimeout(() => {
|
|
1817
1824
|
this._logVerbose("running scheduled token refetch"), this.refetchToken();
|
|
@@ -1861,7 +1868,7 @@ var Un = Object.defineProperty, Wn = (e, t, n) => t in e ? Un(e, t, {
|
|
|
1861
1868
|
}
|
|
1862
1869
|
decodeToken(e) {
|
|
1863
1870
|
try {
|
|
1864
|
-
return
|
|
1871
|
+
return Gn(e);
|
|
1865
1872
|
} catch (e) {
|
|
1866
1873
|
return this._logVerbose(`Error decoding token: ${e instanceof Error ? e.message : "Unknown error"}`), null;
|
|
1867
1874
|
}
|
|
@@ -1869,39 +1876,39 @@ var Un = Object.defineProperty, Wn = (e, t, n) => t in e ? Un(e, t, {
|
|
|
1869
1876
|
_logVerbose(e) {
|
|
1870
1877
|
this.logger.logVerbose(`${e} [v${this.configVersion}]`);
|
|
1871
1878
|
}
|
|
1872
|
-
},
|
|
1879
|
+
}, Zn = [
|
|
1873
1880
|
"convexClientConstructed",
|
|
1874
1881
|
"convexWebSocketOpen",
|
|
1875
1882
|
"convexFirstMessageReceived"
|
|
1876
1883
|
];
|
|
1877
|
-
function
|
|
1884
|
+
function Qn(e, t) {
|
|
1878
1885
|
let n = { sessionId: t };
|
|
1879
1886
|
typeof performance > "u" || !performance.mark || performance.mark(e, { detail: n });
|
|
1880
1887
|
}
|
|
1881
|
-
function
|
|
1888
|
+
function $n(e) {
|
|
1882
1889
|
let t = e.name.slice(6);
|
|
1883
1890
|
return t = t.charAt(0).toLowerCase() + t.slice(1), {
|
|
1884
1891
|
name: t,
|
|
1885
1892
|
startTime: e.startTime
|
|
1886
1893
|
};
|
|
1887
1894
|
}
|
|
1888
|
-
function
|
|
1895
|
+
function er(e) {
|
|
1889
1896
|
if (typeof performance > "u" || !performance.getEntriesByName) return [];
|
|
1890
1897
|
let t = [];
|
|
1891
|
-
for (let n of
|
|
1898
|
+
for (let n of Zn) {
|
|
1892
1899
|
let r = performance.getEntriesByName(n).filter((e) => e.entryType === "mark").filter((t) => t.detail.sessionId === e);
|
|
1893
1900
|
t.push(...r);
|
|
1894
1901
|
}
|
|
1895
|
-
return t.map(
|
|
1902
|
+
return t.map($n);
|
|
1896
1903
|
}
|
|
1897
1904
|
//#endregion
|
|
1898
1905
|
//#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/client.js
|
|
1899
|
-
var
|
|
1906
|
+
var tr = Object.defineProperty, nr = (e, t, n) => t in e ? tr(e, t, {
|
|
1900
1907
|
enumerable: !0,
|
|
1901
1908
|
configurable: !0,
|
|
1902
1909
|
writable: !0,
|
|
1903
1910
|
value: n
|
|
1904
|
-
}) : e[t] = n, Y = (e, t, n) =>
|
|
1911
|
+
}) : e[t] = n, Y = (e, t, n) => nr(e, typeof t == "symbol" ? t : t + "", n), rr = class {
|
|
1905
1912
|
constructor(e, t, n) {
|
|
1906
1913
|
if (Y(this, "address"), Y(this, "state"), Y(this, "requestManager"), Y(this, "webSocketManager"), Y(this, "authenticationManager"), Y(this, "remoteQuerySet"), Y(this, "optimisticQueryResults"), Y(this, "_transitionHandlerCounter", 0), Y(this, "_nextRequestId"), Y(this, "_onTransitionFns", /* @__PURE__ */ new Map()), Y(this, "_sessionId"), Y(this, "firstMessageReceived", !1), Y(this, "debug"), Y(this, "logger"), Y(this, "maxObservedTimestamp"), Y(this, "connectionStateSubscribers", /* @__PURE__ */ new Map()), Y(this, "nextConnectionStateSubscriberId", 0), Y(this, "_lastPublishedConnectionState"), Y(this, "markConnectionStateDirty", () => {
|
|
1907
1914
|
Promise.resolve().then(() => {
|
|
@@ -1912,24 +1919,24 @@ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
|
|
|
1912
1919
|
}
|
|
1913
1920
|
});
|
|
1914
1921
|
}), Y(this, "mark", (e) => {
|
|
1915
|
-
this.debug &&
|
|
1922
|
+
this.debug && Qn(e, this.sessionId);
|
|
1916
1923
|
}), typeof e == "object") throw Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");
|
|
1917
|
-
n?.skipConvexDeploymentUrlCheck !== !0 &&
|
|
1924
|
+
n?.skipConvexDeploymentUrlCheck !== !0 && Qe(e), n = { ...n };
|
|
1918
1925
|
let r = n.authRefreshTokenLeewaySeconds ?? 10, i = n.webSocketConstructor;
|
|
1919
1926
|
if (!i && typeof WebSocket > "u") throw Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");
|
|
1920
|
-
i ||= WebSocket, this.debug = n.reportDebugInfoToConvex ?? !1, this.address = e, this.logger = n.logger === !1 ?
|
|
1927
|
+
i ||= WebSocket, this.debug = n.reportDebugInfoToConvex ?? !1, this.address = e, this.logger = n.logger === !1 ? It({ verbose: n.verbose ?? !1 }) : n.logger !== !0 && n.logger ? n.logger : Ft({ verbose: n.verbose ?? !1 });
|
|
1921
1928
|
let a = e.search("://");
|
|
1922
1929
|
if (a === -1) throw Error("Provided address was not an absolute URL.");
|
|
1923
1930
|
let o = e.substring(a + 3), s = e.substring(0, a), c;
|
|
1924
1931
|
if (s === "http") c = "ws";
|
|
1925
1932
|
else if (s === "https") c = "wss";
|
|
1926
1933
|
else throw Error(`Unknown parent protocol ${s}`);
|
|
1927
|
-
let l = `${c}://${o}/api/${
|
|
1928
|
-
this.state = new
|
|
1934
|
+
let l = `${c}://${o}/api/${Be}/sync`;
|
|
1935
|
+
this.state = new qt(), this.remoteQuerySet = new Cn((e) => this.state.queryPath(e), this.logger), this.requestManager = new Zt(this.logger, this.markConnectionStateDirty);
|
|
1929
1936
|
let u = () => {
|
|
1930
1937
|
this.webSocketManager.pause(), this.state.pause();
|
|
1931
1938
|
};
|
|
1932
|
-
this.authenticationManager = new
|
|
1939
|
+
this.authenticationManager = new Xn(this.state, {
|
|
1933
1940
|
authenticate: (e) => {
|
|
1934
1941
|
let t = this.state.setAuth(e);
|
|
1935
1942
|
return this.webSocketManager.sendMessage(t), t.baseVersion;
|
|
@@ -1944,9 +1951,9 @@ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
|
|
|
1944
1951
|
}, {
|
|
1945
1952
|
logger: this.logger,
|
|
1946
1953
|
refreshTokenLeewaySeconds: r
|
|
1947
|
-
}), this.optimisticQueryResults = new
|
|
1954
|
+
}), this.optimisticQueryResults = new un(), this.addOnTransitionHandler((e) => {
|
|
1948
1955
|
t(e.queries.map((e) => e.token));
|
|
1949
|
-
}), this._nextRequestId = 0, this._sessionId =
|
|
1956
|
+
}), this._nextRequestId = 0, this._sessionId = Bn();
|
|
1950
1957
|
let { unsavedChangesWarning: d } = n;
|
|
1951
1958
|
if (typeof window > "u" || window.addEventListener === void 0) {
|
|
1952
1959
|
if (d === !0) throw Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.");
|
|
@@ -1957,14 +1964,14 @@ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
|
|
|
1957
1964
|
return (e || window.event).returnValue = t, t;
|
|
1958
1965
|
}
|
|
1959
1966
|
});
|
|
1960
|
-
this.webSocketManager = new
|
|
1967
|
+
this.webSocketManager = new zn(l, {
|
|
1961
1968
|
onOpen: (e) => {
|
|
1962
1969
|
this.mark("convexWebSocketOpen"), this.webSocketManager.sendMessage({
|
|
1963
1970
|
...e,
|
|
1964
1971
|
type: "Connect",
|
|
1965
1972
|
sessionId: this._sessionId,
|
|
1966
1973
|
maxObservedTimestamp: this.maxObservedTimestamp
|
|
1967
|
-
}), this.remoteQuerySet = new
|
|
1974
|
+
}), this.remoteQuerySet = new Cn((e) => this.state.queryPath(e), this.logger);
|
|
1968
1975
|
let [t, n] = this.state.restart();
|
|
1969
1976
|
n && this.webSocketManager.sendMessage(n), this.webSocketManager.sendMessage(t);
|
|
1970
1977
|
for (let e of this.requestManager.restart()) this.webSocketManager.sendMessage(e);
|
|
@@ -1995,7 +2002,7 @@ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
|
|
|
1995
2002
|
this.authenticationManager.onAuthError(e);
|
|
1996
2003
|
break;
|
|
1997
2004
|
case "FatalError": {
|
|
1998
|
-
let t =
|
|
2005
|
+
let t = Rt(this.logger, e.error);
|
|
1999
2006
|
throw this.webSocketManager.terminate(), t;
|
|
2000
2007
|
}
|
|
2001
2008
|
default:
|
|
@@ -2053,7 +2060,7 @@ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
|
|
|
2053
2060
|
getCurrentAuthClaims() {
|
|
2054
2061
|
let e = this.state.getAuth(), t = {};
|
|
2055
2062
|
if (e && e.tokenType === "User") try {
|
|
2056
|
-
t = e ?
|
|
2063
|
+
t = e ? Gn(e.value) : {};
|
|
2057
2064
|
} catch {
|
|
2058
2065
|
t = {};
|
|
2059
2066
|
}
|
|
@@ -2078,7 +2085,7 @@ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
|
|
|
2078
2085
|
this.webSocketManager.sendMessage(e);
|
|
2079
2086
|
}
|
|
2080
2087
|
subscribe(e, t, n) {
|
|
2081
|
-
let r =
|
|
2088
|
+
let r = Ze(t), { modification: i, queryToken: a, unsubscribe: o } = this.state.subscribe(e, r, n?.journal, n?.componentPath);
|
|
2082
2089
|
return i !== null && this.webSocketManager.sendMessage(i), {
|
|
2083
2090
|
queryToken: a,
|
|
2084
2091
|
unsubscribe: () => {
|
|
@@ -2088,7 +2095,7 @@ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
|
|
|
2088
2095
|
};
|
|
2089
2096
|
}
|
|
2090
2097
|
localQueryResult(e, t) {
|
|
2091
|
-
let n =
|
|
2098
|
+
let n = Ht(e, Ze(t));
|
|
2092
2099
|
return this.optimisticQueryResults.queryResult(n);
|
|
2093
2100
|
}
|
|
2094
2101
|
localQueryResultByToken(e) {
|
|
@@ -2098,11 +2105,11 @@ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
|
|
|
2098
2105
|
return this.optimisticQueryResults.hasQueryResult(e);
|
|
2099
2106
|
}
|
|
2100
2107
|
localQueryLogs(e, t) {
|
|
2101
|
-
let n =
|
|
2108
|
+
let n = Ht(e, Ze(t));
|
|
2102
2109
|
return this.optimisticQueryResults.queryLogs(n);
|
|
2103
2110
|
}
|
|
2104
2111
|
queryJournal(e, t) {
|
|
2105
|
-
let n =
|
|
2112
|
+
let n = Ht(e, Ze(t));
|
|
2106
2113
|
return this.state.queryJournal(n);
|
|
2107
2114
|
}
|
|
2108
2115
|
connectionState() {
|
|
@@ -2126,7 +2133,7 @@ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
|
|
|
2126
2133
|
}
|
|
2127
2134
|
async mutation(e, t, n) {
|
|
2128
2135
|
let r = await this.mutationInternal(e, t, n);
|
|
2129
|
-
if (!r.success) throw r.errorData === void 0 ? Error(
|
|
2136
|
+
if (!r.success) throw r.errorData === void 0 ? Error(zt("mutation", e, r)) : Bt(r, new Ot(zt("mutation", e, r)));
|
|
2130
2137
|
return r.value;
|
|
2131
2138
|
}
|
|
2132
2139
|
async mutationInternal(e, t, n, r) {
|
|
@@ -2134,7 +2141,7 @@ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
|
|
|
2134
2141
|
return i;
|
|
2135
2142
|
}
|
|
2136
2143
|
enqueueMutation(e, t, n, r) {
|
|
2137
|
-
let i =
|
|
2144
|
+
let i = Ze(t);
|
|
2138
2145
|
this.tryReportLongDisconnect();
|
|
2139
2146
|
let a = this.nextRequestId;
|
|
2140
2147
|
if (this._nextRequestId++, n !== void 0) {
|
|
@@ -2168,7 +2175,7 @@ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
|
|
|
2168
2175
|
requestId: a,
|
|
2169
2176
|
udfPath: e,
|
|
2170
2177
|
componentPath: r,
|
|
2171
|
-
args: [
|
|
2178
|
+
args: [xt(i)]
|
|
2172
2179
|
}, s = this.webSocketManager.sendMessage(o);
|
|
2173
2180
|
return {
|
|
2174
2181
|
requestId: a,
|
|
@@ -2177,18 +2184,18 @@ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
|
|
|
2177
2184
|
}
|
|
2178
2185
|
async action(e, t) {
|
|
2179
2186
|
let n = await this.actionInternal(e, t);
|
|
2180
|
-
if (!n.success) throw n.errorData === void 0 ? Error(
|
|
2187
|
+
if (!n.success) throw n.errorData === void 0 ? Error(zt("action", e, n)) : Bt(n, new Ot(zt("action", e, n)));
|
|
2181
2188
|
return n.value;
|
|
2182
2189
|
}
|
|
2183
2190
|
async actionInternal(e, t, n) {
|
|
2184
|
-
let r =
|
|
2191
|
+
let r = Ze(t), i = this.nextRequestId;
|
|
2185
2192
|
this._nextRequestId++, this.tryReportLongDisconnect();
|
|
2186
2193
|
let a = {
|
|
2187
2194
|
type: "Action",
|
|
2188
2195
|
requestId: i,
|
|
2189
2196
|
udfPath: e,
|
|
2190
2197
|
componentPath: n,
|
|
2191
|
-
args: [
|
|
2198
|
+
args: [xt(r)]
|
|
2192
2199
|
}, o = this.webSocketManager.sendMessage(a);
|
|
2193
2200
|
return this.requestManager.request(a, o);
|
|
2194
2201
|
}
|
|
@@ -2206,7 +2213,7 @@ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
|
|
|
2206
2213
|
}
|
|
2207
2214
|
reportMarks() {
|
|
2208
2215
|
if (this.debug) {
|
|
2209
|
-
let e =
|
|
2216
|
+
let e = er(this.sessionId);
|
|
2210
2217
|
this.webSocketManager.sendMessage({
|
|
2211
2218
|
type: "Event",
|
|
2212
2219
|
eventType: "ClientConnect",
|
|
@@ -2223,7 +2230,7 @@ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
|
|
|
2223
2230
|
method: "POST",
|
|
2224
2231
|
headers: {
|
|
2225
2232
|
"Content-Type": "application/json",
|
|
2226
|
-
"Convex-Client": `npm-${
|
|
2233
|
+
"Convex-Client": `npm-${Be}`
|
|
2227
2234
|
},
|
|
2228
2235
|
body: JSON.stringify({ event: "LongWebsocketDisconnect" })
|
|
2229
2236
|
}).then((e) => {
|
|
@@ -2235,23 +2242,23 @@ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
|
|
|
2235
2242
|
};
|
|
2236
2243
|
//#endregion
|
|
2237
2244
|
//#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/pagination.js
|
|
2238
|
-
function
|
|
2245
|
+
function ir(e) {
|
|
2239
2246
|
if (typeof e != "object" || !e || !Array.isArray(e.page) || typeof e.isDone != "boolean" || typeof e.continueCursor != "string") throw Error(`Not a valid paginated query result: ${e?.toString()}`);
|
|
2240
2247
|
return e;
|
|
2241
2248
|
}
|
|
2242
2249
|
//#endregion
|
|
2243
2250
|
//#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/paginated_query_client.js
|
|
2244
|
-
var
|
|
2251
|
+
var ar = Object.defineProperty, or = (e, t, n) => t in e ? ar(e, t, {
|
|
2245
2252
|
enumerable: !0,
|
|
2246
2253
|
configurable: !0,
|
|
2247
2254
|
writable: !0,
|
|
2248
2255
|
value: n
|
|
2249
|
-
}) : e[t] = n,
|
|
2256
|
+
}) : e[t] = n, sr = (e, t, n) => or(e, typeof t == "symbol" ? t : t + "", n), cr = class {
|
|
2250
2257
|
constructor(e, t) {
|
|
2251
|
-
this.client = e, this.onTransition = t,
|
|
2258
|
+
this.client = e, this.onTransition = t, sr(this, "paginatedQuerySet", /* @__PURE__ */ new Map()), sr(this, "lastTransitionTs"), this.lastTransitionTs = mn.fromNumber(0), this.client.addOnTransitionHandler((e) => this.onBaseTransition(e));
|
|
2252
2259
|
}
|
|
2253
2260
|
subscribe(e, t, n) {
|
|
2254
|
-
let r =
|
|
2261
|
+
let r = Vt(e), i = Ut(r, t, n), a = () => this.removePaginatedQuerySubscriber(i), o = this.paginatedQuerySet.get(i);
|
|
2255
2262
|
return o ? (o.numSubscribers += 1, {
|
|
2256
2263
|
paginatedQueryToken: i,
|
|
2257
2264
|
unsubscribe: a
|
|
@@ -2273,7 +2280,7 @@ var nr = Object.defineProperty, rr = (e, t, n) => t in e ? nr(e, t, {
|
|
|
2273
2280
|
});
|
|
2274
2281
|
}
|
|
2275
2282
|
localQueryResult(e, t, n) {
|
|
2276
|
-
let r =
|
|
2283
|
+
let r = Ut(Vt(e), t, n);
|
|
2277
2284
|
return this.localQueryResultByToken(r);
|
|
2278
2285
|
}
|
|
2279
2286
|
localQueryResultByToken(e) {
|
|
@@ -2292,7 +2299,7 @@ var nr = Object.defineProperty, rr = (e, t, n) => t in e ? nr(e, t, {
|
|
|
2292
2299
|
i = !0, a = !1;
|
|
2293
2300
|
continue;
|
|
2294
2301
|
}
|
|
2295
|
-
let n =
|
|
2302
|
+
let n = ir(t);
|
|
2296
2303
|
r = r.concat(n.page), a = !!n.isDone;
|
|
2297
2304
|
}
|
|
2298
2305
|
let o;
|
|
@@ -2321,7 +2328,7 @@ var nr = Object.defineProperty, rr = (e, t, n) => t in e ? nr(e, t, {
|
|
|
2321
2328
|
this.mustGetPaginatedQuery(e);
|
|
2322
2329
|
let n = this.queryTokenForLastPageOfPaginatedQuery(e), r = this.client.localQueryResultByToken(n);
|
|
2323
2330
|
if (!r) return !1;
|
|
2324
|
-
let i =
|
|
2331
|
+
let i = ir(r);
|
|
2325
2332
|
if (i.isDone) return !1;
|
|
2326
2333
|
this.addPageToPaginatedQuery(e, i.continueCursor, t);
|
|
2327
2334
|
let a = {
|
|
@@ -2355,7 +2362,7 @@ var nr = Object.defineProperty, rr = (e, t, n) => t in e ? nr(e, t, {
|
|
|
2355
2362
|
if (r.has(n)) continue;
|
|
2356
2363
|
let a = i.get(n).queryToken, o = t(a);
|
|
2357
2364
|
if (!o) continue;
|
|
2358
|
-
let s =
|
|
2365
|
+
let s = ir(o);
|
|
2359
2366
|
s.splitCursor && (s.pageStatus === "SplitRecommended" || s.pageStatus === "SplitRequired" || s.page.length > e.options.initialNumItems * 2) && this.splitPaginatedQueryPage(e, n, s.splitCursor, s.continueCursor);
|
|
2360
2367
|
}
|
|
2361
2368
|
}
|
|
@@ -2424,16 +2431,16 @@ var nr = Object.defineProperty, rr = (e, t, n) => t in e ? nr(e, t, {
|
|
|
2424
2431
|
if (!t) throw Error("paginated query no longer exists for token " + e);
|
|
2425
2432
|
return t;
|
|
2426
2433
|
}
|
|
2427
|
-
},
|
|
2434
|
+
}, lr = Object.defineProperty, ur = (e, t, n) => t in e ? lr(e, t, {
|
|
2428
2435
|
enumerable: !0,
|
|
2429
2436
|
configurable: !0,
|
|
2430
2437
|
writable: !0,
|
|
2431
2438
|
value: n
|
|
2432
|
-
}) : e[t] = n,
|
|
2439
|
+
}) : e[t] = n, dr = (e, t, n) => ur(e, typeof t == "symbol" ? t : t + "", n), fr, pr = class {
|
|
2433
2440
|
constructor(e, t = {}) {
|
|
2434
|
-
|
|
2441
|
+
dr(this, "listeners"), dr(this, "_client"), dr(this, "_paginatedClient"), dr(this, "callNewListenersWithCurrentValuesTimer"), dr(this, "_closed"), dr(this, "_disabled"), t.skipConvexDeploymentUrlCheck !== !0 && Qe(e);
|
|
2435
2442
|
let { disabled: n, ...r } = t;
|
|
2436
|
-
this._closed = !1, this._disabled = !!n,
|
|
2443
|
+
this._closed = !1, this._disabled = !!n, fr && !("webSocketConstructor" in r) && typeof WebSocket > "u" && (r.webSocketConstructor = fr), typeof window > "u" && !("unsavedChangesWarning" in r) && (r.unsavedChangesWarning = !1), this.disabled || (this._client = new rr(e, () => {}, r), this._paginatedClient = new cr(this._client, (e) => this._transition(e))), this.listeners = /* @__PURE__ */ new Set();
|
|
2437
2444
|
}
|
|
2438
2445
|
get closed() {
|
|
2439
2446
|
return this._closed;
|
|
@@ -2529,7 +2536,7 @@ var nr = Object.defineProperty, rr = (e, t, n) => t in e ? nr(e, t, {
|
|
|
2529
2536
|
_transition({ queries: e, paginatedQueries: t }, n = !1) {
|
|
2530
2537
|
let r = [...e.map((e) => e.token), ...t.map((e) => e.token)];
|
|
2531
2538
|
for (let e of this.listeners) {
|
|
2532
|
-
let { callback: t, queryToken: i, onError: a, hasEverRun: o } = e, s =
|
|
2539
|
+
let { callback: t, queryToken: i, onError: a, hasEverRun: o } = e, s = Wt(i), c = s ? !!this.paginatedClient.localQueryResultByToken(i) : this.client.hasLocalQueryResultByToken(i);
|
|
2533
2540
|
if (r.includes(i) || n && !o && c) {
|
|
2534
2541
|
e.hasEverRun = !0;
|
|
2535
2542
|
let n;
|
|
@@ -2573,14 +2580,14 @@ var nr = Object.defineProperty, rr = (e, t, n) => t in e ? nr(e, t, {
|
|
|
2573
2580
|
};
|
|
2574
2581
|
//#endregion
|
|
2575
2582
|
//#region src/lib/machine.ts
|
|
2576
|
-
function
|
|
2583
|
+
function mr(e) {
|
|
2577
2584
|
return e;
|
|
2578
2585
|
}
|
|
2579
|
-
function
|
|
2580
|
-
let n =
|
|
2586
|
+
function hr(e, t) {
|
|
2587
|
+
let n = V(e);
|
|
2581
2588
|
n.current = e;
|
|
2582
|
-
let [r, i] =
|
|
2583
|
-
return [r,
|
|
2589
|
+
let [r, i] = z(() => typeof t == "function" ? t() : t);
|
|
2590
|
+
return [r, H((e) => {
|
|
2584
2591
|
i((t) => {
|
|
2585
2592
|
let r = n.current[t.kind]?.[e.type];
|
|
2586
2593
|
return r ? r(t, e) : t;
|
|
@@ -2589,7 +2596,7 @@ function fr(e, t) {
|
|
|
2589
2596
|
}
|
|
2590
2597
|
//#endregion
|
|
2591
2598
|
//#region src/lib/use-async-action.ts
|
|
2592
|
-
var
|
|
2599
|
+
var gr = mr({
|
|
2593
2600
|
idle: { start: () => ({ kind: "pending" }) },
|
|
2594
2601
|
pending: {
|
|
2595
2602
|
success: (e, t) => ({
|
|
@@ -2610,10 +2617,10 @@ var pr = dr({
|
|
|
2610
2617
|
reset: () => ({ kind: "idle" })
|
|
2611
2618
|
}
|
|
2612
2619
|
});
|
|
2613
|
-
function
|
|
2614
|
-
let [e, t] =
|
|
2620
|
+
function _r() {
|
|
2621
|
+
let [e, t] = hr(gr, { kind: "idle" }), n = e, r = V(n);
|
|
2615
2622
|
r.current = n;
|
|
2616
|
-
let i =
|
|
2623
|
+
let i = H(async (e, n) => {
|
|
2617
2624
|
if (r.current.kind !== "pending") {
|
|
2618
2625
|
t({ type: "start" });
|
|
2619
2626
|
try {
|
|
@@ -2631,7 +2638,7 @@ function mr() {
|
|
|
2631
2638
|
return;
|
|
2632
2639
|
}
|
|
2633
2640
|
}
|
|
2634
|
-
}, [t]), a =
|
|
2641
|
+
}, [t]), a = H(() => t({ type: "reset" }), [t]);
|
|
2635
2642
|
return {
|
|
2636
2643
|
state: n,
|
|
2637
2644
|
isIdle: n.kind === "idle",
|
|
@@ -2646,37 +2653,37 @@ function mr() {
|
|
|
2646
2653
|
}
|
|
2647
2654
|
//#endregion
|
|
2648
2655
|
//#region ../../node_modules/.pnpm/@medv+finder@4.0.2/node_modules/@medv/finder/finder.js
|
|
2649
|
-
var
|
|
2656
|
+
var vr = new Set([
|
|
2650
2657
|
"role",
|
|
2651
2658
|
"name",
|
|
2652
2659
|
"aria-label",
|
|
2653
2660
|
"rel",
|
|
2654
2661
|
"href"
|
|
2655
2662
|
]);
|
|
2656
|
-
function
|
|
2657
|
-
let n =
|
|
2658
|
-
n ||= e.startsWith("data-") &&
|
|
2659
|
-
let r =
|
|
2660
|
-
return r ||= t.startsWith("#") &&
|
|
2663
|
+
function yr(e, t) {
|
|
2664
|
+
let n = vr.has(e);
|
|
2665
|
+
n ||= e.startsWith("data-") && Tr(e);
|
|
2666
|
+
let r = Tr(t) && t.length < 100;
|
|
2667
|
+
return r ||= t.startsWith("#") && Tr(t.slice(1)), n && r;
|
|
2661
2668
|
}
|
|
2662
|
-
function
|
|
2663
|
-
return
|
|
2669
|
+
function br(e) {
|
|
2670
|
+
return Tr(e);
|
|
2664
2671
|
}
|
|
2665
|
-
function
|
|
2666
|
-
return
|
|
2672
|
+
function xr(e) {
|
|
2673
|
+
return Tr(e);
|
|
2667
2674
|
}
|
|
2668
|
-
function
|
|
2675
|
+
function Sr(e) {
|
|
2669
2676
|
return !0;
|
|
2670
2677
|
}
|
|
2671
|
-
function
|
|
2678
|
+
function Cr(e, t) {
|
|
2672
2679
|
if (e.nodeType !== Node.ELEMENT_NODE) throw Error("Can't generate CSS selector for non-element node type.");
|
|
2673
2680
|
if (e.tagName.toLowerCase() === "html") return "html";
|
|
2674
2681
|
let n = {
|
|
2675
2682
|
root: document.body,
|
|
2676
|
-
idName:
|
|
2677
|
-
className:
|
|
2678
|
-
tagName:
|
|
2679
|
-
attr:
|
|
2683
|
+
idName: br,
|
|
2684
|
+
className: xr,
|
|
2685
|
+
tagName: Sr,
|
|
2686
|
+
attr: yr,
|
|
2680
2687
|
timeoutMs: 1e3,
|
|
2681
2688
|
seedMinLength: 3,
|
|
2682
2689
|
optimizedMinLength: 2,
|
|
@@ -2684,37 +2691,37 @@ function br(e, t) {
|
|
|
2684
2691
|
}, r = /* @__PURE__ */ new Date(), i = {
|
|
2685
2692
|
...n,
|
|
2686
2693
|
...t
|
|
2687
|
-
}, a =
|
|
2688
|
-
for (let t of
|
|
2694
|
+
}, a = Fr(i.root, n), o, s = 0;
|
|
2695
|
+
for (let t of wr(e, i, a)) {
|
|
2689
2696
|
if ((/* @__PURE__ */ new Date()).getTime() - r.getTime() > i.timeoutMs || s >= i.maxNumberOfPathChecks) {
|
|
2690
|
-
let t =
|
|
2697
|
+
let t = jr(e, a);
|
|
2691
2698
|
if (!t) throw Error(`Timeout: Can't find a unique selector after ${i.timeoutMs}ms`);
|
|
2692
|
-
return
|
|
2699
|
+
return Dr(t);
|
|
2693
2700
|
}
|
|
2694
|
-
if (s++,
|
|
2701
|
+
if (s++, Ir(t, a)) {
|
|
2695
2702
|
o = t;
|
|
2696
2703
|
break;
|
|
2697
2704
|
}
|
|
2698
2705
|
}
|
|
2699
2706
|
if (!o) throw Error("Selector was not found.");
|
|
2700
|
-
let c = [...
|
|
2701
|
-
return c.sort(
|
|
2707
|
+
let c = [...Lr(o, e, i, a, r)];
|
|
2708
|
+
return c.sort(kr), c.length > 0 ? Dr(c[0]) : Dr(o);
|
|
2702
2709
|
}
|
|
2703
|
-
function*
|
|
2710
|
+
function* wr(e, t, n) {
|
|
2704
2711
|
let r = [], i = [], a = e, o = 0;
|
|
2705
2712
|
for (; a && a !== n;) {
|
|
2706
|
-
let e =
|
|
2713
|
+
let e = Er(a, t);
|
|
2707
2714
|
for (let t of e) t.level = o;
|
|
2708
|
-
if (r.push(e), a = a.parentElement, o++, i.push(...
|
|
2709
|
-
i.sort(
|
|
2715
|
+
if (r.push(e), a = a.parentElement, o++, i.push(...Pr(r)), o >= t.seedMinLength) {
|
|
2716
|
+
i.sort(kr);
|
|
2710
2717
|
for (let e of i) yield e;
|
|
2711
2718
|
i = [];
|
|
2712
2719
|
}
|
|
2713
2720
|
}
|
|
2714
|
-
i.sort(
|
|
2721
|
+
i.sort(kr);
|
|
2715
2722
|
for (let e of i) yield e;
|
|
2716
2723
|
}
|
|
2717
|
-
function
|
|
2724
|
+
function Tr(e) {
|
|
2718
2725
|
if (/^[a-z\-]{3,}$/i.test(e)) {
|
|
2719
2726
|
let t = e.split(/-|[A-Z]/);
|
|
2720
2727
|
for (let e of t) if (e.length <= 2 || /[^aeiou]{4,}/i.test(e)) return !1;
|
|
@@ -2722,7 +2729,7 @@ function Sr(e) {
|
|
|
2722
2729
|
}
|
|
2723
2730
|
return !1;
|
|
2724
2731
|
}
|
|
2725
|
-
function
|
|
2732
|
+
function Er(e, t) {
|
|
2726
2733
|
let n = [], r = e.getAttribute("id");
|
|
2727
2734
|
r && t.idName(r) && n.push({
|
|
2728
2735
|
name: "#" + CSS.escape(r),
|
|
@@ -2748,19 +2755,19 @@ function Cr(e, t) {
|
|
|
2748
2755
|
name: i,
|
|
2749
2756
|
penalty: 5
|
|
2750
2757
|
});
|
|
2751
|
-
let t =
|
|
2758
|
+
let t = Ar(e, i);
|
|
2752
2759
|
t !== void 0 && n.push({
|
|
2753
|
-
name:
|
|
2760
|
+
name: Nr(i, t),
|
|
2754
2761
|
penalty: 10
|
|
2755
2762
|
});
|
|
2756
2763
|
}
|
|
2757
|
-
let a =
|
|
2764
|
+
let a = Ar(e);
|
|
2758
2765
|
return a !== void 0 && n.push({
|
|
2759
|
-
name:
|
|
2766
|
+
name: Mr(i, a),
|
|
2760
2767
|
penalty: 50
|
|
2761
2768
|
}), n;
|
|
2762
2769
|
}
|
|
2763
|
-
function
|
|
2770
|
+
function Dr(e) {
|
|
2764
2771
|
let t = e[0], n = t.name;
|
|
2765
2772
|
for (let r = 1; r < e.length; r++) {
|
|
2766
2773
|
let i = e[r].level || 0;
|
|
@@ -2768,13 +2775,13 @@ function wr(e) {
|
|
|
2768
2775
|
}
|
|
2769
2776
|
return n;
|
|
2770
2777
|
}
|
|
2771
|
-
function
|
|
2778
|
+
function Or(e) {
|
|
2772
2779
|
return e.map((e) => e.penalty).reduce((e, t) => e + t, 0);
|
|
2773
2780
|
}
|
|
2774
|
-
function
|
|
2775
|
-
return
|
|
2781
|
+
function kr(e, t) {
|
|
2782
|
+
return Or(e) - Or(t);
|
|
2776
2783
|
}
|
|
2777
|
-
function
|
|
2784
|
+
function Ar(e, t) {
|
|
2778
2785
|
let n = e.parentNode;
|
|
2779
2786
|
if (!n) return;
|
|
2780
2787
|
let r = n.firstChild;
|
|
@@ -2783,51 +2790,51 @@ function Dr(e, t) {
|
|
|
2783
2790
|
for (; r && (r.nodeType === Node.ELEMENT_NODE && (t === void 0 || r.tagName.toLowerCase() === t) && i++, r !== e);) r = r.nextSibling;
|
|
2784
2791
|
return i;
|
|
2785
2792
|
}
|
|
2786
|
-
function
|
|
2793
|
+
function jr(e, t) {
|
|
2787
2794
|
let n = 0, r = e, i = [];
|
|
2788
2795
|
for (; r && r !== t;) {
|
|
2789
|
-
let e = r.tagName.toLowerCase(), t =
|
|
2796
|
+
let e = r.tagName.toLowerCase(), t = Ar(r, e);
|
|
2790
2797
|
if (t === void 0) return;
|
|
2791
2798
|
i.push({
|
|
2792
|
-
name:
|
|
2799
|
+
name: Nr(e, t),
|
|
2793
2800
|
penalty: NaN,
|
|
2794
2801
|
level: n
|
|
2795
2802
|
}), r = r.parentElement, n++;
|
|
2796
2803
|
}
|
|
2797
|
-
if (
|
|
2804
|
+
if (Ir(i, t)) return i;
|
|
2798
2805
|
}
|
|
2799
|
-
function
|
|
2806
|
+
function Mr(e, t) {
|
|
2800
2807
|
return e === "html" ? "html" : `${e}:nth-child(${t})`;
|
|
2801
2808
|
}
|
|
2802
|
-
function
|
|
2809
|
+
function Nr(e, t) {
|
|
2803
2810
|
return e === "html" ? "html" : `${e}:nth-of-type(${t})`;
|
|
2804
2811
|
}
|
|
2805
|
-
function*
|
|
2806
|
-
if (e.length > 0) for (let n of e[0]) yield*
|
|
2812
|
+
function* Pr(e, t = []) {
|
|
2813
|
+
if (e.length > 0) for (let n of e[0]) yield* Pr(e.slice(1, e.length), t.concat(n));
|
|
2807
2814
|
else yield t;
|
|
2808
2815
|
}
|
|
2809
|
-
function
|
|
2816
|
+
function Fr(e, t) {
|
|
2810
2817
|
return e.nodeType === Node.DOCUMENT_NODE ? e : e === t.root ? e.ownerDocument : e;
|
|
2811
2818
|
}
|
|
2812
|
-
function
|
|
2813
|
-
let n =
|
|
2819
|
+
function Ir(e, t) {
|
|
2820
|
+
let n = Dr(e);
|
|
2814
2821
|
switch (t.querySelectorAll(n).length) {
|
|
2815
2822
|
case 0: throw Error(`Can't select any node with this selector: ${n}`);
|
|
2816
2823
|
case 1: return !0;
|
|
2817
2824
|
default: return !1;
|
|
2818
2825
|
}
|
|
2819
2826
|
}
|
|
2820
|
-
function*
|
|
2827
|
+
function* Lr(e, t, n, r, i) {
|
|
2821
2828
|
if (e.length > 2 && e.length > n.optimizedMinLength) for (let a = 1; a < e.length - 1; a++) {
|
|
2822
2829
|
if ((/* @__PURE__ */ new Date()).getTime() - i.getTime() > n.timeoutMs) return;
|
|
2823
2830
|
let o = [...e];
|
|
2824
|
-
o.splice(a, 1),
|
|
2831
|
+
o.splice(a, 1), Ir(o, r) && r.querySelector(Dr(o)) === t && (yield o, yield* Lr(o, t, n, r, i));
|
|
2825
2832
|
}
|
|
2826
2833
|
}
|
|
2827
2834
|
//#endregion
|
|
2828
2835
|
//#region src/runtime/anchor.ts
|
|
2829
|
-
function
|
|
2830
|
-
let n = document.documentElement, r = Math.max(n.scrollWidth, n.clientWidth), i = Math.max(n.scrollHeight, n.clientHeight), a = e.clientX + window.scrollX, o = e.clientY + window.scrollY, s = t === void 0 ? e.target instanceof Element ? e.target : null : t, c = s ?
|
|
2836
|
+
function Rr(e, t) {
|
|
2837
|
+
let n = document.documentElement, r = Math.max(n.scrollWidth, n.clientWidth), i = Math.max(n.scrollHeight, n.clientHeight), a = e.clientX + window.scrollX, o = e.clientY + window.scrollY, s = t === void 0 ? e.target instanceof Element ? e.target : null : t, c = s ? Br(s) : void 0, l, u;
|
|
2831
2838
|
if (s) {
|
|
2832
2839
|
let t = s.getBoundingClientRect();
|
|
2833
2840
|
t.width > 0 && t.height > 0 && (l = Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)), u = Math.max(0, Math.min(1, (e.clientY - t.top) / t.height)));
|
|
@@ -2842,7 +2849,7 @@ function Fr(e, t) {
|
|
|
2842
2849
|
anchorOffsetY: u
|
|
2843
2850
|
};
|
|
2844
2851
|
}
|
|
2845
|
-
function
|
|
2852
|
+
function zr(e) {
|
|
2846
2853
|
if (e.anchorSelector) try {
|
|
2847
2854
|
let t = document.querySelector(e.anchorSelector);
|
|
2848
2855
|
if (t) {
|
|
@@ -2861,22 +2868,22 @@ function Ir(e) {
|
|
|
2861
2868
|
resolved: !1
|
|
2862
2869
|
};
|
|
2863
2870
|
}
|
|
2864
|
-
function
|
|
2871
|
+
function Br(e) {
|
|
2865
2872
|
try {
|
|
2866
|
-
return
|
|
2873
|
+
return Cr(e, { timeoutMs: 1e3 });
|
|
2867
2874
|
} catch {
|
|
2868
2875
|
return;
|
|
2869
2876
|
}
|
|
2870
2877
|
}
|
|
2871
2878
|
//#endregion
|
|
2872
2879
|
//#region src/runtime/api.ts
|
|
2873
|
-
var
|
|
2880
|
+
var Vr = class extends Error {
|
|
2874
2881
|
status;
|
|
2875
2882
|
constructor(e, t) {
|
|
2876
2883
|
super(e), this.name = "WidgetApiError", this.status = t;
|
|
2877
2884
|
}
|
|
2878
2885
|
};
|
|
2879
|
-
function
|
|
2886
|
+
function Hr(e) {
|
|
2880
2887
|
let t = e.apiUrl.replace(/\/+$/, "");
|
|
2881
2888
|
async function n(n, r = {}) {
|
|
2882
2889
|
let i = {
|
|
@@ -2892,8 +2899,8 @@ function zr(e) {
|
|
|
2892
2899
|
headers: i
|
|
2893
2900
|
};
|
|
2894
2901
|
c && (l.credentials = "include");
|
|
2895
|
-
let u = await fetch(`${t}${n}`, l), d = await u.text(), f = d ?
|
|
2896
|
-
if (!u.ok) throw u.status === 401 && (o || c) && e.onUnauthorized?.(), new
|
|
2902
|
+
let u = await fetch(`${t}${n}`, l), d = await u.text(), f = d ? Ur(d) : null;
|
|
2903
|
+
if (!u.ok) throw u.status === 401 && (o || c) && e.onUnauthorized?.(), new Vr((f && typeof f == "object" && "error" in f && typeof f.error == "string" ? f.error : null) ?? `Request failed with ${u.status}`, u.status);
|
|
2897
2904
|
return f;
|
|
2898
2905
|
}
|
|
2899
2906
|
return {
|
|
@@ -2947,7 +2954,7 @@ function zr(e) {
|
|
|
2947
2954
|
}
|
|
2948
2955
|
};
|
|
2949
2956
|
}
|
|
2950
|
-
function
|
|
2957
|
+
function Ur(e) {
|
|
2951
2958
|
try {
|
|
2952
2959
|
return JSON.parse(e);
|
|
2953
2960
|
} catch {
|
|
@@ -2956,10 +2963,10 @@ function Br(e) {
|
|
|
2956
2963
|
}
|
|
2957
2964
|
//#endregion
|
|
2958
2965
|
//#region src/runtime/cookie-probe.ts
|
|
2959
|
-
var
|
|
2960
|
-
async function
|
|
2966
|
+
var Wr = "markup.cookieProbe";
|
|
2967
|
+
async function Gr(e, t) {
|
|
2961
2968
|
try {
|
|
2962
|
-
let e = sessionStorage.getItem(
|
|
2969
|
+
let e = sessionStorage.getItem(Wr);
|
|
2963
2970
|
if (e === "supported") return !0;
|
|
2964
2971
|
if (e === "unsupported") return !1;
|
|
2965
2972
|
} catch {}
|
|
@@ -2978,57 +2985,63 @@ async function Hr(e, t) {
|
|
|
2978
2985
|
if (!e.ok) return !1;
|
|
2979
2986
|
let { supported: t } = await e.json(), i = t === !0;
|
|
2980
2987
|
try {
|
|
2981
|
-
sessionStorage.setItem(
|
|
2988
|
+
sessionStorage.setItem(Wr, i ? "supported" : "unsupported");
|
|
2982
2989
|
} catch {}
|
|
2983
2990
|
return i;
|
|
2984
|
-
} catch {
|
|
2985
|
-
return !1;
|
|
2991
|
+
} catch (e) {
|
|
2992
|
+
return e?.name !== "TypeError" && F(e, { context: "cookie-probe" }), !1;
|
|
2986
2993
|
}
|
|
2987
2994
|
}
|
|
2988
2995
|
//#endregion
|
|
2989
2996
|
//#region src/runtime/history-observer.ts
|
|
2990
|
-
var
|
|
2991
|
-
function
|
|
2992
|
-
e.forEach((e) =>
|
|
2997
|
+
var Kr = "__markup_history_observer__", qr = "__markup_history_listeners__";
|
|
2998
|
+
function Jr(e) {
|
|
2999
|
+
e.forEach((e) => {
|
|
3000
|
+
try {
|
|
3001
|
+
e();
|
|
3002
|
+
} catch (e) {
|
|
3003
|
+
F(e, { context: "history-observer-listener" });
|
|
3004
|
+
}
|
|
3005
|
+
});
|
|
2993
3006
|
}
|
|
2994
|
-
function
|
|
3007
|
+
function Yr() {
|
|
2995
3008
|
let e = history.pushState;
|
|
2996
|
-
if (e[
|
|
3009
|
+
if (e[Kr]) return e[qr];
|
|
2997
3010
|
let t = /* @__PURE__ */ new Set(), n = history.pushState, r = history.replaceState;
|
|
2998
3011
|
function i(...e) {
|
|
2999
|
-
n.apply(this, e),
|
|
3012
|
+
n.apply(this, e), Jr(t);
|
|
3000
3013
|
}
|
|
3001
3014
|
function a(...e) {
|
|
3002
|
-
r.apply(this, e),
|
|
3015
|
+
r.apply(this, e), Jr(t);
|
|
3003
3016
|
}
|
|
3004
|
-
return Object.defineProperty(i,
|
|
3017
|
+
return Object.defineProperty(i, Kr, { value: 1 }), Object.defineProperty(i, qr, { value: t }), Object.defineProperty(a, Kr, { value: 1 }), history.pushState = i, history.replaceState = a, window.addEventListener("popstate", () => Jr(t)), t;
|
|
3005
3018
|
}
|
|
3006
|
-
var
|
|
3007
|
-
function
|
|
3008
|
-
return
|
|
3019
|
+
var Xr = null;
|
|
3020
|
+
function Zr(e) {
|
|
3021
|
+
return Xr ||= Yr(), Xr.add(e), () => Xr.delete(e);
|
|
3009
3022
|
}
|
|
3010
3023
|
//#endregion
|
|
3011
3024
|
//#region src/runtime/identity-store.ts
|
|
3012
|
-
var
|
|
3013
|
-
function
|
|
3025
|
+
var Qr = "markup.identity";
|
|
3026
|
+
function $r() {
|
|
3014
3027
|
try {
|
|
3015
|
-
let e = localStorage.getItem(
|
|
3028
|
+
let e = localStorage.getItem(Qr);
|
|
3016
3029
|
return e ? JSON.parse(e) : null;
|
|
3017
3030
|
} catch {
|
|
3018
3031
|
return null;
|
|
3019
3032
|
}
|
|
3020
3033
|
}
|
|
3021
|
-
function
|
|
3034
|
+
function ei(e) {
|
|
3022
3035
|
try {
|
|
3023
3036
|
if (e == null) {
|
|
3024
|
-
localStorage.removeItem(
|
|
3037
|
+
localStorage.removeItem(Qr);
|
|
3025
3038
|
return;
|
|
3026
3039
|
}
|
|
3027
|
-
localStorage.setItem(
|
|
3040
|
+
localStorage.setItem(Qr, JSON.stringify(e));
|
|
3028
3041
|
} catch {}
|
|
3029
3042
|
}
|
|
3030
|
-
function
|
|
3031
|
-
let e =
|
|
3043
|
+
function ti() {
|
|
3044
|
+
let e = $r(), t = {
|
|
3032
3045
|
name: e?.name,
|
|
3033
3046
|
email: e?.email
|
|
3034
3047
|
};
|
|
@@ -3088,10 +3101,10 @@ function Qr() {
|
|
|
3088
3101
|
preserved: t
|
|
3089
3102
|
};
|
|
3090
3103
|
}
|
|
3091
|
-
function
|
|
3104
|
+
function ni(e) {
|
|
3092
3105
|
switch (e.kind) {
|
|
3093
3106
|
case "verified":
|
|
3094
|
-
|
|
3107
|
+
ei({
|
|
3095
3108
|
clientId: e.identity.clientId,
|
|
3096
3109
|
storage: e.identity.storage,
|
|
3097
3110
|
token: e.identity.storage === "cookies" ? void 0 : e.identity.token,
|
|
@@ -3104,7 +3117,7 @@ function $r(e) {
|
|
|
3104
3117
|
});
|
|
3105
3118
|
return;
|
|
3106
3119
|
case "anon":
|
|
3107
|
-
|
|
3120
|
+
ei({
|
|
3108
3121
|
clientId: e.identity.clientId,
|
|
3109
3122
|
anonToken: e.identity.anonToken,
|
|
3110
3123
|
name: e.identity.name,
|
|
@@ -3112,23 +3125,23 @@ function $r(e) {
|
|
|
3112
3125
|
});
|
|
3113
3126
|
return;
|
|
3114
3127
|
case "recovering":
|
|
3115
|
-
|
|
3128
|
+
ei({
|
|
3116
3129
|
name: e.preserved.name,
|
|
3117
3130
|
email: e.preserved.email
|
|
3118
3131
|
});
|
|
3119
3132
|
return;
|
|
3120
3133
|
case "unresolved":
|
|
3121
|
-
|
|
3134
|
+
ei(null);
|
|
3122
3135
|
return;
|
|
3123
3136
|
}
|
|
3124
3137
|
}
|
|
3125
|
-
function
|
|
3138
|
+
function ri(e) {
|
|
3126
3139
|
if (e.kind === "anon" || e.kind === "verified") return e.identity.clientId;
|
|
3127
3140
|
}
|
|
3128
|
-
function
|
|
3141
|
+
function ii(e) {
|
|
3129
3142
|
return e.kind === "anon" ? e.identity.name ?? null : e.kind === "verified" ? e.identity.name : null;
|
|
3130
3143
|
}
|
|
3131
|
-
function
|
|
3144
|
+
function ai(e) {
|
|
3132
3145
|
if (e.kind === "anon") {
|
|
3133
3146
|
let t = e.identity.name;
|
|
3134
3147
|
return t ? {
|
|
@@ -3143,7 +3156,7 @@ function ni(e) {
|
|
|
3143
3156
|
}
|
|
3144
3157
|
//#endregion
|
|
3145
3158
|
//#region src/runtime/popup-auth.ts
|
|
3146
|
-
async function
|
|
3159
|
+
async function oi(e) {
|
|
3147
3160
|
let { apiUrl: t, apiKey: n, useCookies: r } = e, i = new URL(t).origin, a;
|
|
3148
3161
|
try {
|
|
3149
3162
|
let e = await fetch(`${t.replace(/\/+$/, "")}/widget/popup-exchange`, {
|
|
@@ -3160,7 +3173,7 @@ async function ri(e) {
|
|
|
3160
3173
|
let s = r ? "refresh,cookies" : "refresh";
|
|
3161
3174
|
o.searchParams.set("capabilities", s), a = o.toString();
|
|
3162
3175
|
} catch (e) {
|
|
3163
|
-
return Promise.reject(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to start popup exchange"));
|
|
3176
|
+
return e?.name !== "TypeError" && F(e, { context: "popup-exchange" }), Promise.reject(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to start popup exchange"));
|
|
3164
3177
|
}
|
|
3165
3178
|
let o = Math.max(0, window.screenX + (window.outerWidth - 420) / 2), s = Math.max(0, window.screenY + (window.outerHeight - 560) / 2), c = window.open(a, "markup-auth", `width=420,height=560,left=${o},top=${s}`);
|
|
3166
3179
|
if (!c) return Promise.reject(/* @__PURE__ */ Error("Popup blocked — allow popups for this site to sign in"));
|
|
@@ -3200,7 +3213,10 @@ async function ri(e) {
|
|
|
3200
3213
|
refreshToken: l.refreshToken
|
|
3201
3214
|
})
|
|
3202
3215
|
});
|
|
3203
|
-
if (!e.ok)
|
|
3216
|
+
if (!e.ok) {
|
|
3217
|
+
let t = /* @__PURE__ */ Error(`Failed to install widget cookies (${e.status})`);
|
|
3218
|
+
throw F(t, { context: "install-cookies" }), t;
|
|
3219
|
+
}
|
|
3204
3220
|
return {
|
|
3205
3221
|
...l,
|
|
3206
3222
|
token: null,
|
|
@@ -3211,45 +3227,45 @@ async function ri(e) {
|
|
|
3211
3227
|
}
|
|
3212
3228
|
//#endregion
|
|
3213
3229
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/util.js
|
|
3214
|
-
function
|
|
3230
|
+
function si(e, t) {
|
|
3215
3231
|
if (e.match(/^[a-z]+:\/\//i)) return e;
|
|
3216
3232
|
if (e.match(/^\/\//)) return window.location.protocol + e;
|
|
3217
3233
|
if (e.match(/^[a-z]+:/i)) return e;
|
|
3218
3234
|
let n = document.implementation.createHTMLDocument(), r = n.createElement("base"), i = n.createElement("a");
|
|
3219
3235
|
return n.head.appendChild(r), n.body.appendChild(i), t && (r.href = t), i.href = e, i.href;
|
|
3220
3236
|
}
|
|
3221
|
-
var
|
|
3237
|
+
var ci = (() => {
|
|
3222
3238
|
let e = 0, t = () => `0000${(Math.random() * 36 ** 4 << 0).toString(36)}`.slice(-4);
|
|
3223
3239
|
return () => (e += 1, `u${t()}${e}`);
|
|
3224
3240
|
})();
|
|
3225
|
-
function
|
|
3241
|
+
function li(e) {
|
|
3226
3242
|
let t = [];
|
|
3227
3243
|
for (let n = 0, r = e.length; n < r; n++) t.push(e[n]);
|
|
3228
3244
|
return t;
|
|
3229
3245
|
}
|
|
3230
|
-
var
|
|
3231
|
-
function
|
|
3232
|
-
return
|
|
3246
|
+
var ui = null;
|
|
3247
|
+
function di(e = {}) {
|
|
3248
|
+
return ui || (e.includeStyleProperties ? (ui = e.includeStyleProperties, ui) : (ui = li(window.getComputedStyle(document.documentElement)), ui));
|
|
3233
3249
|
}
|
|
3234
|
-
function
|
|
3250
|
+
function fi(e, t) {
|
|
3235
3251
|
let n = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
|
|
3236
3252
|
return n ? parseFloat(n.replace("px", "")) : 0;
|
|
3237
3253
|
}
|
|
3238
|
-
function
|
|
3239
|
-
let t =
|
|
3254
|
+
function pi(e) {
|
|
3255
|
+
let t = fi(e, "border-left-width"), n = fi(e, "border-right-width");
|
|
3240
3256
|
return e.clientWidth + t + n;
|
|
3241
3257
|
}
|
|
3242
|
-
function
|
|
3243
|
-
let t =
|
|
3258
|
+
function mi(e) {
|
|
3259
|
+
let t = fi(e, "border-top-width"), n = fi(e, "border-bottom-width");
|
|
3244
3260
|
return e.clientHeight + t + n;
|
|
3245
3261
|
}
|
|
3246
|
-
function
|
|
3262
|
+
function hi(e, t = {}) {
|
|
3247
3263
|
return {
|
|
3248
|
-
width: t.width ||
|
|
3249
|
-
height: t.height ||
|
|
3264
|
+
width: t.width || pi(e),
|
|
3265
|
+
height: t.height || mi(e)
|
|
3250
3266
|
};
|
|
3251
3267
|
}
|
|
3252
|
-
function
|
|
3268
|
+
function gi() {
|
|
3253
3269
|
let e, t;
|
|
3254
3270
|
try {
|
|
3255
3271
|
t = process;
|
|
@@ -3258,10 +3274,10 @@ function pi() {
|
|
|
3258
3274
|
return n && (e = parseInt(n, 10), Number.isNaN(e) && (e = 1)), e || window.devicePixelRatio || 1;
|
|
3259
3275
|
}
|
|
3260
3276
|
var X = 16384;
|
|
3261
|
-
function
|
|
3277
|
+
function _i(e) {
|
|
3262
3278
|
(e.width > X || e.height > X) && (e.width > X && e.height > X ? e.width > e.height ? (e.height *= X / e.width, e.width = X) : (e.width *= X / e.height, e.height = X) : e.width > X ? (e.height *= X / e.width, e.width = X) : (e.width *= X / e.height, e.height = X));
|
|
3263
3279
|
}
|
|
3264
|
-
function
|
|
3280
|
+
function vi(e) {
|
|
3265
3281
|
return new Promise((t, n) => {
|
|
3266
3282
|
let r = new Image();
|
|
3267
3283
|
r.onload = () => {
|
|
@@ -3271,12 +3287,12 @@ function hi(e) {
|
|
|
3271
3287
|
}, r.onerror = n, r.crossOrigin = "anonymous", r.decoding = "async", r.src = e;
|
|
3272
3288
|
});
|
|
3273
3289
|
}
|
|
3274
|
-
async function
|
|
3290
|
+
async function yi(e) {
|
|
3275
3291
|
return Promise.resolve().then(() => new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then((e) => `data:image/svg+xml;charset=utf-8,${e}`);
|
|
3276
3292
|
}
|
|
3277
|
-
async function
|
|
3293
|
+
async function bi(e, t, n) {
|
|
3278
3294
|
let r = "http://www.w3.org/2000/svg", i = document.createElementNS(r, "svg"), a = document.createElementNS(r, "foreignObject");
|
|
3279
|
-
return i.setAttribute("width", `${t}`), i.setAttribute("height", `${n}`), i.setAttribute("viewBox", `0 0 ${t} ${n}`), a.setAttribute("width", "100%"), a.setAttribute("height", "100%"), a.setAttribute("x", "0"), a.setAttribute("y", "0"), a.setAttribute("externalResourcesRequired", "true"), i.appendChild(a), a.appendChild(e),
|
|
3295
|
+
return i.setAttribute("width", `${t}`), i.setAttribute("height", `${n}`), i.setAttribute("viewBox", `0 0 ${t} ${n}`), a.setAttribute("width", "100%"), a.setAttribute("height", "100%"), a.setAttribute("x", "0"), a.setAttribute("y", "0"), a.setAttribute("externalResourcesRequired", "true"), i.appendChild(a), a.appendChild(e), yi(i);
|
|
3280
3296
|
}
|
|
3281
3297
|
var Z = (e, t) => {
|
|
3282
3298
|
if (e instanceof t) return !0;
|
|
@@ -3285,66 +3301,66 @@ var Z = (e, t) => {
|
|
|
3285
3301
|
};
|
|
3286
3302
|
//#endregion
|
|
3287
3303
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/clone-pseudos.js
|
|
3288
|
-
function
|
|
3304
|
+
function xi(e) {
|
|
3289
3305
|
let t = e.getPropertyValue("content");
|
|
3290
3306
|
return `${e.cssText} content: '${t.replace(/'|"/g, "")}';`;
|
|
3291
3307
|
}
|
|
3292
|
-
function
|
|
3293
|
-
return
|
|
3308
|
+
function Si(e, t) {
|
|
3309
|
+
return di(t).map((t) => `${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t) ? " !important" : ""};`).join(" ");
|
|
3294
3310
|
}
|
|
3295
|
-
function
|
|
3296
|
-
let i = `.${e}:${t}`, a = n.cssText ?
|
|
3311
|
+
function Ci(e, t, n, r) {
|
|
3312
|
+
let i = `.${e}:${t}`, a = n.cssText ? xi(n) : Si(n, r);
|
|
3297
3313
|
return document.createTextNode(`${i}{${a}}`);
|
|
3298
3314
|
}
|
|
3299
|
-
function
|
|
3315
|
+
function wi(e, t, n, r) {
|
|
3300
3316
|
let i = window.getComputedStyle(e, n), a = i.getPropertyValue("content");
|
|
3301
3317
|
if (a === "" || a === "none") return;
|
|
3302
|
-
let o =
|
|
3318
|
+
let o = ci();
|
|
3303
3319
|
try {
|
|
3304
3320
|
t.className = `${t.className} ${o}`;
|
|
3305
3321
|
} catch {
|
|
3306
3322
|
return;
|
|
3307
3323
|
}
|
|
3308
3324
|
let s = document.createElement("style");
|
|
3309
|
-
s.appendChild(
|
|
3325
|
+
s.appendChild(Ci(o, n, i, r)), t.appendChild(s);
|
|
3310
3326
|
}
|
|
3311
|
-
function
|
|
3312
|
-
|
|
3327
|
+
function Ti(e, t, n) {
|
|
3328
|
+
wi(e, t, ":before", n), wi(e, t, ":after", n);
|
|
3313
3329
|
}
|
|
3314
3330
|
//#endregion
|
|
3315
3331
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/mimes.js
|
|
3316
|
-
var
|
|
3317
|
-
woff:
|
|
3318
|
-
woff2:
|
|
3332
|
+
var Ei = "application/font-woff", Di = "image/jpeg", Oi = {
|
|
3333
|
+
woff: Ei,
|
|
3334
|
+
woff2: Ei,
|
|
3319
3335
|
ttf: "application/font-truetype",
|
|
3320
3336
|
eot: "application/vnd.ms-fontobject",
|
|
3321
3337
|
png: "image/png",
|
|
3322
|
-
jpg:
|
|
3323
|
-
jpeg:
|
|
3338
|
+
jpg: Di,
|
|
3339
|
+
jpeg: Di,
|
|
3324
3340
|
gif: "image/gif",
|
|
3325
3341
|
tiff: "image/tiff",
|
|
3326
3342
|
svg: "image/svg+xml",
|
|
3327
3343
|
webp: "image/webp"
|
|
3328
3344
|
};
|
|
3329
|
-
function
|
|
3345
|
+
function ki(e) {
|
|
3330
3346
|
let t = /\.([^./]*?)$/g.exec(e);
|
|
3331
3347
|
return t ? t[1] : "";
|
|
3332
3348
|
}
|
|
3333
|
-
function
|
|
3334
|
-
return
|
|
3349
|
+
function Ai(e) {
|
|
3350
|
+
return Oi[ki(e).toLowerCase()] || "";
|
|
3335
3351
|
}
|
|
3336
3352
|
//#endregion
|
|
3337
3353
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/dataurl.js
|
|
3338
|
-
function
|
|
3354
|
+
function ji(e) {
|
|
3339
3355
|
return e.split(/,/)[1];
|
|
3340
3356
|
}
|
|
3341
|
-
function
|
|
3357
|
+
function Mi(e) {
|
|
3342
3358
|
return e.search(/^(data:)/) !== -1;
|
|
3343
3359
|
}
|
|
3344
|
-
function
|
|
3360
|
+
function Ni(e, t) {
|
|
3345
3361
|
return `data:${t};base64,${e}`;
|
|
3346
3362
|
}
|
|
3347
|
-
async function
|
|
3363
|
+
async function Pi(e, t, n) {
|
|
3348
3364
|
let r = await fetch(e, t);
|
|
3349
3365
|
if (r.status === 404) throw Error(`Resource "${r.url}" not found`);
|
|
3350
3366
|
let i = await r.blob();
|
|
@@ -3362,78 +3378,78 @@ async function ji(e, t, n) {
|
|
|
3362
3378
|
}, a.readAsDataURL(i);
|
|
3363
3379
|
});
|
|
3364
3380
|
}
|
|
3365
|
-
var
|
|
3366
|
-
function
|
|
3381
|
+
var Fi = {};
|
|
3382
|
+
function Ii(e, t, n) {
|
|
3367
3383
|
let r = e.replace(/\?.*/, "");
|
|
3368
3384
|
return n && (r = e), /ttf|otf|eot|woff2?/i.test(r) && (r = r.replace(/.*\//, "")), t ? `[${t}]${r}` : r;
|
|
3369
3385
|
}
|
|
3370
|
-
async function
|
|
3371
|
-
let r =
|
|
3372
|
-
if (
|
|
3386
|
+
async function Li(e, t, n) {
|
|
3387
|
+
let r = Ii(e, t, n.includeQueryParams);
|
|
3388
|
+
if (Fi[r] != null) return Fi[r];
|
|
3373
3389
|
n.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
|
|
3374
3390
|
let i;
|
|
3375
3391
|
try {
|
|
3376
|
-
i =
|
|
3392
|
+
i = Ni(await Pi(e, n.fetchRequestInit, ({ res: e, result: n }) => (t ||= e.headers.get("Content-Type") || "", ji(n))), t);
|
|
3377
3393
|
} catch (t) {
|
|
3378
3394
|
i = n.imagePlaceholder || "";
|
|
3379
3395
|
let r = `Failed to fetch resource: ${e}`;
|
|
3380
3396
|
t && (r = typeof t == "string" ? t : t.message), r && console.warn(r);
|
|
3381
3397
|
}
|
|
3382
|
-
return
|
|
3398
|
+
return Fi[r] = i, i;
|
|
3383
3399
|
}
|
|
3384
3400
|
//#endregion
|
|
3385
3401
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/clone-node.js
|
|
3386
|
-
async function
|
|
3402
|
+
async function Ri(e) {
|
|
3387
3403
|
let t = e.toDataURL();
|
|
3388
|
-
return t === "data:," ? e.cloneNode(!1) :
|
|
3404
|
+
return t === "data:," ? e.cloneNode(!1) : vi(t);
|
|
3389
3405
|
}
|
|
3390
|
-
async function
|
|
3406
|
+
async function zi(e, t) {
|
|
3391
3407
|
if (e.currentSrc) {
|
|
3392
3408
|
let t = document.createElement("canvas"), n = t.getContext("2d");
|
|
3393
|
-
return t.width = e.clientWidth, t.height = e.clientHeight, n?.drawImage(e, 0, 0, t.width, t.height),
|
|
3409
|
+
return t.width = e.clientWidth, t.height = e.clientHeight, n?.drawImage(e, 0, 0, t.width, t.height), vi(t.toDataURL());
|
|
3394
3410
|
}
|
|
3395
3411
|
let n = e.poster;
|
|
3396
|
-
return
|
|
3412
|
+
return vi(await Li(n, Ai(n), t));
|
|
3397
3413
|
}
|
|
3398
|
-
async function
|
|
3414
|
+
async function Bi(e, t) {
|
|
3399
3415
|
try {
|
|
3400
|
-
if (e?.contentDocument?.body) return await
|
|
3416
|
+
if (e?.contentDocument?.body) return await Xi(e.contentDocument.body, t, !0);
|
|
3401
3417
|
} catch {}
|
|
3402
3418
|
return e.cloneNode(!1);
|
|
3403
3419
|
}
|
|
3404
|
-
async function
|
|
3405
|
-
return Z(e, HTMLCanvasElement) ?
|
|
3420
|
+
async function Vi(e, t) {
|
|
3421
|
+
return Z(e, HTMLCanvasElement) ? Ri(e) : Z(e, HTMLVideoElement) ? zi(e, t) : Z(e, HTMLIFrameElement) ? Bi(e, t) : e.cloneNode(Ui(e));
|
|
3406
3422
|
}
|
|
3407
|
-
var
|
|
3408
|
-
async function
|
|
3409
|
-
if (
|
|
3423
|
+
var Hi = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", Ui = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
|
|
3424
|
+
async function Wi(e, t, n) {
|
|
3425
|
+
if (Ui(t)) return t;
|
|
3410
3426
|
let r = [];
|
|
3411
|
-
return r =
|
|
3427
|
+
return r = Hi(e) && e.assignedNodes ? li(e.assignedNodes()) : Z(e, HTMLIFrameElement) && e.contentDocument?.body ? li(e.contentDocument.body.childNodes) : li((e.shadowRoot ?? e).childNodes), r.length === 0 || Z(e, HTMLVideoElement) || await r.reduce((e, r) => e.then(() => Xi(r, n)).then((e) => {
|
|
3412
3428
|
e && t.appendChild(e);
|
|
3413
3429
|
}), Promise.resolve()), t;
|
|
3414
3430
|
}
|
|
3415
|
-
function
|
|
3431
|
+
function Gi(e, t, n) {
|
|
3416
3432
|
let r = t.style;
|
|
3417
3433
|
if (!r) return;
|
|
3418
3434
|
let i = window.getComputedStyle(e);
|
|
3419
|
-
i.cssText ? (r.cssText = i.cssText, r.transformOrigin = i.transformOrigin) :
|
|
3435
|
+
i.cssText ? (r.cssText = i.cssText, r.transformOrigin = i.transformOrigin) : di(n).forEach((n) => {
|
|
3420
3436
|
let a = i.getPropertyValue(n);
|
|
3421
3437
|
n === "font-size" && a.endsWith("px") && (a = `${Math.floor(parseFloat(a.substring(0, a.length - 2))) - .1}px`), Z(e, HTMLIFrameElement) && n === "display" && a === "inline" && (a = "block"), n === "d" && t.getAttribute("d") && (a = `path(${t.getAttribute("d")})`), r.setProperty(n, a, i.getPropertyPriority(n));
|
|
3422
3438
|
});
|
|
3423
3439
|
}
|
|
3424
|
-
function
|
|
3440
|
+
function Ki(e, t) {
|
|
3425
3441
|
Z(e, HTMLTextAreaElement) && (t.innerHTML = e.value), Z(e, HTMLInputElement) && t.setAttribute("value", e.value);
|
|
3426
3442
|
}
|
|
3427
|
-
function
|
|
3443
|
+
function qi(e, t) {
|
|
3428
3444
|
if (Z(e, HTMLSelectElement)) {
|
|
3429
3445
|
let n = t, r = Array.from(n.children).find((t) => e.value === t.getAttribute("value"));
|
|
3430
3446
|
r && r.setAttribute("selected", "");
|
|
3431
3447
|
}
|
|
3432
3448
|
}
|
|
3433
|
-
function
|
|
3434
|
-
return Z(t, Element) && (
|
|
3449
|
+
function Ji(e, t, n) {
|
|
3450
|
+
return Z(t, Element) && (Gi(e, t, n), Ti(e, t, n), Ki(e, t), qi(e, t)), t;
|
|
3435
3451
|
}
|
|
3436
|
-
async function
|
|
3452
|
+
async function Yi(e, t) {
|
|
3437
3453
|
let n = e.querySelectorAll ? e.querySelectorAll("use") : [];
|
|
3438
3454
|
if (n.length === 0) return e;
|
|
3439
3455
|
let r = {};
|
|
@@ -3441,7 +3457,7 @@ async function Ki(e, t) {
|
|
|
3441
3457
|
let a = n[i].getAttribute("xlink:href");
|
|
3442
3458
|
if (a) {
|
|
3443
3459
|
let n = e.querySelector(a), i = document.querySelector(a);
|
|
3444
|
-
!n && i && !r[a] && (r[a] = await
|
|
3460
|
+
!n && i && !r[a] && (r[a] = await Xi(i, t, !0));
|
|
3445
3461
|
}
|
|
3446
3462
|
}
|
|
3447
3463
|
let i = Object.values(r);
|
|
@@ -3455,61 +3471,61 @@ async function Ki(e, t) {
|
|
|
3455
3471
|
}
|
|
3456
3472
|
return e;
|
|
3457
3473
|
}
|
|
3458
|
-
async function
|
|
3459
|
-
return !n && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((e) =>
|
|
3474
|
+
async function Xi(e, t, n) {
|
|
3475
|
+
return !n && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((e) => Vi(e, t)).then((n) => Wi(e, n, t)).then((n) => Ji(e, n, t)).then((e) => Yi(e, t));
|
|
3460
3476
|
}
|
|
3461
3477
|
//#endregion
|
|
3462
3478
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-resources.js
|
|
3463
|
-
var
|
|
3464
|
-
function
|
|
3479
|
+
var Zi = /url\((['"]?)([^'"]+?)\1\)/g, Qi = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, $i = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
|
|
3480
|
+
function ea(e) {
|
|
3465
3481
|
let t = e.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
|
|
3466
3482
|
return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
|
|
3467
3483
|
}
|
|
3468
|
-
function
|
|
3484
|
+
function ta(e) {
|
|
3469
3485
|
let t = [];
|
|
3470
|
-
return e.replace(
|
|
3486
|
+
return e.replace(Zi, (e, n, r) => (t.push(r), e)), t.filter((e) => !Mi(e));
|
|
3471
3487
|
}
|
|
3472
|
-
async function
|
|
3488
|
+
async function na(e, t, n, r, i) {
|
|
3473
3489
|
try {
|
|
3474
|
-
let a = n ?
|
|
3475
|
-
return s = i ?
|
|
3490
|
+
let a = n ? si(t, n) : t, o = Ai(t), s;
|
|
3491
|
+
return s = i ? Ni(await i(a), o) : await Li(a, o, r), e.replace(ea(t), `$1${s}$3`);
|
|
3476
3492
|
} catch {}
|
|
3477
3493
|
return e;
|
|
3478
3494
|
}
|
|
3479
|
-
function
|
|
3480
|
-
return t ? e.replace(
|
|
3495
|
+
function ra(e, { preferredFontFormat: t }) {
|
|
3496
|
+
return t ? e.replace($i, (e) => {
|
|
3481
3497
|
for (;;) {
|
|
3482
|
-
let [n, , r] =
|
|
3498
|
+
let [n, , r] = Qi.exec(e) || [];
|
|
3483
3499
|
if (!r) return "";
|
|
3484
3500
|
if (r === t) return `src: ${n};`;
|
|
3485
3501
|
}
|
|
3486
3502
|
}) : e;
|
|
3487
3503
|
}
|
|
3488
|
-
function
|
|
3489
|
-
return e.search(
|
|
3504
|
+
function ia(e) {
|
|
3505
|
+
return e.search(Zi) !== -1;
|
|
3490
3506
|
}
|
|
3491
|
-
async function
|
|
3492
|
-
if (!
|
|
3493
|
-
let r =
|
|
3494
|
-
return
|
|
3507
|
+
async function aa(e, t, n) {
|
|
3508
|
+
if (!ia(e)) return e;
|
|
3509
|
+
let r = ra(e, n);
|
|
3510
|
+
return ta(r).reduce((e, r) => e.then((e) => na(e, r, t, n)), Promise.resolve(r));
|
|
3495
3511
|
}
|
|
3496
3512
|
//#endregion
|
|
3497
3513
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-images.js
|
|
3498
|
-
async function
|
|
3514
|
+
async function oa(e, t, n) {
|
|
3499
3515
|
let r = t.style?.getPropertyValue(e);
|
|
3500
3516
|
if (r) {
|
|
3501
|
-
let i = await
|
|
3517
|
+
let i = await aa(r, null, n);
|
|
3502
3518
|
return t.style.setProperty(e, i, t.style.getPropertyPriority(e)), !0;
|
|
3503
3519
|
}
|
|
3504
3520
|
return !1;
|
|
3505
3521
|
}
|
|
3506
|
-
async function
|
|
3507
|
-
await
|
|
3522
|
+
async function sa(e, t) {
|
|
3523
|
+
await oa("background", e, t) || await oa("background-image", e, t), await oa("mask", e, t) || await oa("-webkit-mask", e, t) || await oa("mask-image", e, t) || await oa("-webkit-mask-image", e, t);
|
|
3508
3524
|
}
|
|
3509
|
-
async function
|
|
3525
|
+
async function ca(e, t) {
|
|
3510
3526
|
let n = Z(e, HTMLImageElement);
|
|
3511
|
-
if (!(n && !
|
|
3512
|
-
let r = n ? e.src : e.href.baseVal, i = await
|
|
3527
|
+
if (!(n && !Mi(e.src)) && !(Z(e, SVGImageElement) && !Mi(e.href.baseVal))) return;
|
|
3528
|
+
let r = n ? e.src : e.href.baseVal, i = await Li(r, Ai(r), t);
|
|
3513
3529
|
await new Promise((r, a) => {
|
|
3514
3530
|
e.onload = r, e.onerror = t.onImageErrorHandler ? (...e) => {
|
|
3515
3531
|
try {
|
|
@@ -3522,16 +3538,16 @@ async function aa(e, t) {
|
|
|
3522
3538
|
o.decode &&= r, o.loading === "lazy" && (o.loading = "eager"), n ? (e.srcset = "", e.src = i) : e.href.baseVal = i;
|
|
3523
3539
|
});
|
|
3524
3540
|
}
|
|
3525
|
-
async function
|
|
3526
|
-
let n =
|
|
3541
|
+
async function la(e, t) {
|
|
3542
|
+
let n = li(e.childNodes).map((e) => ua(e, t));
|
|
3527
3543
|
await Promise.all(n).then(() => e);
|
|
3528
3544
|
}
|
|
3529
|
-
async function
|
|
3530
|
-
Z(e, Element) && (await
|
|
3545
|
+
async function ua(e, t) {
|
|
3546
|
+
Z(e, Element) && (await sa(e, t), await ca(e, t), await la(e, t));
|
|
3531
3547
|
}
|
|
3532
3548
|
//#endregion
|
|
3533
3549
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/apply-style.js
|
|
3534
|
-
function
|
|
3550
|
+
function da(e, t) {
|
|
3535
3551
|
let { style: n } = e;
|
|
3536
3552
|
t.backgroundColor && (n.backgroundColor = t.backgroundColor), t.width && (n.width = `${t.width}px`), t.height && (n.height = `${t.height}px`);
|
|
3537
3553
|
let r = t.style;
|
|
@@ -3541,22 +3557,22 @@ function ca(e, t) {
|
|
|
3541
3557
|
}
|
|
3542
3558
|
//#endregion
|
|
3543
3559
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-webfonts.js
|
|
3544
|
-
var
|
|
3545
|
-
async function
|
|
3546
|
-
let t =
|
|
3560
|
+
var fa = {};
|
|
3561
|
+
async function pa(e) {
|
|
3562
|
+
let t = fa[e];
|
|
3547
3563
|
return t ?? (t = {
|
|
3548
3564
|
url: e,
|
|
3549
3565
|
cssText: await (await fetch(e)).text()
|
|
3550
|
-
},
|
|
3566
|
+
}, fa[e] = t, t);
|
|
3551
3567
|
}
|
|
3552
|
-
async function
|
|
3568
|
+
async function ma(e, t) {
|
|
3553
3569
|
let n = e.cssText, r = /url\(["']?([^"')]+)["']?\)/g, i = (n.match(/url\([^)]+\)/g) || []).map(async (i) => {
|
|
3554
3570
|
let a = i.replace(r, "$1");
|
|
3555
|
-
return a.startsWith("https://") || (a = new URL(a, e.url).href),
|
|
3571
|
+
return a.startsWith("https://") || (a = new URL(a, e.url).href), Pi(a, t.fetchRequestInit, ({ result: e }) => (n = n.replace(i, `url(${e})`), [i, e]));
|
|
3556
3572
|
});
|
|
3557
3573
|
return Promise.all(i).then(() => n);
|
|
3558
3574
|
}
|
|
3559
|
-
function
|
|
3575
|
+
function ha(e) {
|
|
3560
3576
|
if (e == null) return [];
|
|
3561
3577
|
let t = [], n = e.replace(/(\/\*[\s\S]*?\*\/)/gi, ""), r = /* @__PURE__ */ RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
|
|
3562
3578
|
for (;;) {
|
|
@@ -3576,13 +3592,13 @@ function fa(e) {
|
|
|
3576
3592
|
}
|
|
3577
3593
|
return t;
|
|
3578
3594
|
}
|
|
3579
|
-
async function
|
|
3595
|
+
async function ga(e, t) {
|
|
3580
3596
|
let n = [], r = [];
|
|
3581
3597
|
return e.forEach((n) => {
|
|
3582
3598
|
if ("cssRules" in n) try {
|
|
3583
|
-
|
|
3599
|
+
li(n.cssRules || []).forEach((e, i) => {
|
|
3584
3600
|
if (e.type === CSSRule.IMPORT_RULE) {
|
|
3585
|
-
let a = i + 1, o = e.href, s =
|
|
3601
|
+
let a = i + 1, o = e.href, s = pa(o).then((e) => ma(e, t)).then((e) => ha(e).forEach((e) => {
|
|
3586
3602
|
try {
|
|
3587
3603
|
n.insertRule(e, e.startsWith("@import") ? a += 1 : n.cssRules.length);
|
|
3588
3604
|
} catch (t) {
|
|
@@ -3599,7 +3615,7 @@ async function pa(e, t) {
|
|
|
3599
3615
|
});
|
|
3600
3616
|
} catch (i) {
|
|
3601
3617
|
let a = e.find((e) => e.href == null) || document.styleSheets[0];
|
|
3602
|
-
n.href != null && r.push(
|
|
3618
|
+
n.href != null && r.push(pa(n.href).then((e) => ma(e, t)).then((e) => ha(e).forEach((e) => {
|
|
3603
3619
|
a.insertRule(e, a.cssRules.length);
|
|
3604
3620
|
})).catch((e) => {
|
|
3605
3621
|
console.error("Error loading remote stylesheet", e);
|
|
@@ -3607,7 +3623,7 @@ async function pa(e, t) {
|
|
|
3607
3623
|
}
|
|
3608
3624
|
}), Promise.all(r).then(() => (e.forEach((e) => {
|
|
3609
3625
|
if ("cssRules" in e) try {
|
|
3610
|
-
|
|
3626
|
+
li(e.cssRules || []).forEach((e) => {
|
|
3611
3627
|
n.push(e);
|
|
3612
3628
|
});
|
|
3613
3629
|
} catch (t) {
|
|
@@ -3615,36 +3631,36 @@ async function pa(e, t) {
|
|
|
3615
3631
|
}
|
|
3616
3632
|
}), n));
|
|
3617
3633
|
}
|
|
3618
|
-
function
|
|
3619
|
-
return e.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) =>
|
|
3634
|
+
function _a(e) {
|
|
3635
|
+
return e.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => ia(e.style.getPropertyValue("src")));
|
|
3620
3636
|
}
|
|
3621
|
-
async function
|
|
3637
|
+
async function va(e, t) {
|
|
3622
3638
|
if (e.ownerDocument == null) throw Error("Provided element is not within a Document");
|
|
3623
|
-
return
|
|
3639
|
+
return _a(await ga(li(e.ownerDocument.styleSheets), t));
|
|
3624
3640
|
}
|
|
3625
|
-
function
|
|
3641
|
+
function ya(e) {
|
|
3626
3642
|
return e.trim().replace(/["']/g, "");
|
|
3627
3643
|
}
|
|
3628
|
-
function
|
|
3644
|
+
function ba(e) {
|
|
3629
3645
|
let t = /* @__PURE__ */ new Set();
|
|
3630
3646
|
function n(e) {
|
|
3631
3647
|
(e.style.fontFamily || getComputedStyle(e).fontFamily).split(",").forEach((e) => {
|
|
3632
|
-
t.add(
|
|
3648
|
+
t.add(ya(e));
|
|
3633
3649
|
}), Array.from(e.children).forEach((e) => {
|
|
3634
3650
|
e instanceof HTMLElement && n(e);
|
|
3635
3651
|
});
|
|
3636
3652
|
}
|
|
3637
3653
|
return n(e), t;
|
|
3638
3654
|
}
|
|
3639
|
-
async function
|
|
3640
|
-
let n = await
|
|
3641
|
-
return (await Promise.all(n.filter((e) => r.has(
|
|
3655
|
+
async function xa(e, t) {
|
|
3656
|
+
let n = await va(e, t), r = ba(e);
|
|
3657
|
+
return (await Promise.all(n.filter((e) => r.has(ya(e.style.fontFamily))).map((e) => {
|
|
3642
3658
|
let n = e.parentStyleSheet ? e.parentStyleSheet.href : null;
|
|
3643
|
-
return
|
|
3659
|
+
return aa(e.cssText, n, t);
|
|
3644
3660
|
}))).join("\n");
|
|
3645
3661
|
}
|
|
3646
|
-
async function
|
|
3647
|
-
let n = t.fontEmbedCSS == null ? t.skipFonts ? null : await
|
|
3662
|
+
async function Sa(e, t) {
|
|
3663
|
+
let n = t.fontEmbedCSS == null ? t.skipFonts ? null : await xa(e, t) : t.fontEmbedCSS;
|
|
3648
3664
|
if (n) {
|
|
3649
3665
|
let t = document.createElement("style"), r = document.createTextNode(n);
|
|
3650
3666
|
t.appendChild(r), e.firstChild ? e.insertBefore(t, e.firstChild) : e.appendChild(t);
|
|
@@ -3652,18 +3668,18 @@ async function ya(e, t) {
|
|
|
3652
3668
|
}
|
|
3653
3669
|
//#endregion
|
|
3654
3670
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/index.js
|
|
3655
|
-
async function
|
|
3656
|
-
let { width: n, height: r } =
|
|
3657
|
-
return await
|
|
3671
|
+
async function Ca(e, t = {}) {
|
|
3672
|
+
let { width: n, height: r } = hi(e, t), i = await Xi(e, t, !0);
|
|
3673
|
+
return await Sa(i, t), await ua(i, t), da(i, t), await bi(i, n, r);
|
|
3658
3674
|
}
|
|
3659
|
-
async function
|
|
3660
|
-
let { width: n, height: r } =
|
|
3661
|
-
return a.width = c * s, a.height = l * s, t.skipAutoScale ||
|
|
3675
|
+
async function wa(e, t = {}) {
|
|
3676
|
+
let { width: n, height: r } = hi(e, t), i = await vi(await Ca(e, t)), a = document.createElement("canvas"), o = a.getContext("2d"), s = t.pixelRatio || gi(), c = t.canvasWidth || n, l = t.canvasHeight || r;
|
|
3677
|
+
return a.width = c * s, a.height = l * s, t.skipAutoScale || _i(a), a.style.width = `${c}`, a.style.height = `${l}`, t.backgroundColor && (o.fillStyle = t.backgroundColor, o.fillRect(0, 0, a.width, a.height)), o.drawImage(i, 0, 0, a.width, a.height), a;
|
|
3662
3678
|
}
|
|
3663
3679
|
//#endregion
|
|
3664
3680
|
//#region src/runtime/screenshot.ts
|
|
3665
|
-
var
|
|
3666
|
-
function
|
|
3681
|
+
var Ta = 2 * 1024 * 1024, Ea = "background:currentColor!important;color:transparent!important;text-shadow:none!important;-webkit-text-fill-color:transparent!important", Da = "input[type=\"password\"],input[autocomplete~=\"cc-number\"],input[autocomplete~=\"cc-csc\"],input[autocomplete~=\"cc-exp\"],input[autocomplete~=\"cc-name\"],input[autocomplete~=\"cc-type\"],input[autocomplete~=\"current-password\"],input[autocomplete~=\"new-password\"],input[autocomplete~=\"one-time-code\"]";
|
|
3682
|
+
function Oa(e) {
|
|
3667
3683
|
let t = e.parentElement;
|
|
3668
3684
|
for (; t;) {
|
|
3669
3685
|
if (t.hasAttribute("data-markup-safe")) return !0;
|
|
@@ -3671,35 +3687,37 @@ function Ta(e) {
|
|
|
3671
3687
|
}
|
|
3672
3688
|
return !1;
|
|
3673
3689
|
}
|
|
3674
|
-
function
|
|
3690
|
+
function ka(e) {
|
|
3675
3691
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
3676
3692
|
function r(e) {
|
|
3677
3693
|
t.has(e) || (t.add(e), n.push(e));
|
|
3678
3694
|
}
|
|
3679
3695
|
for (let e of document.querySelectorAll("[data-markup-private],[data-markup-redact]")) r(e);
|
|
3680
|
-
for (let e of document.querySelectorAll(
|
|
3696
|
+
for (let e of document.querySelectorAll(Da)) Oa(e) || r(e);
|
|
3681
3697
|
if (e.redactSelector) try {
|
|
3682
|
-
for (let t of document.querySelectorAll(e.redactSelector))
|
|
3683
|
-
} catch {
|
|
3684
|
-
|
|
3698
|
+
for (let t of document.querySelectorAll(e.redactSelector)) Oa(t) || r(t);
|
|
3699
|
+
} catch (e) {
|
|
3700
|
+
F(e, { context: "screenshot-redact-selector" });
|
|
3701
|
+
}
|
|
3702
|
+
if (e.strictScrub) for (let e of document.querySelectorAll("input,select,textarea")) Oa(e) || r(e);
|
|
3685
3703
|
return n;
|
|
3686
3704
|
}
|
|
3687
|
-
function
|
|
3705
|
+
function Aa(e) {
|
|
3688
3706
|
let t = e.getAttribute("style");
|
|
3689
|
-
return e.setAttribute("style", t ? `${t};${
|
|
3707
|
+
return e.setAttribute("style", t ? `${t};${Ea}` : Ea), () => {
|
|
3690
3708
|
t === null ? e.removeAttribute("style") : e.setAttribute("style", t);
|
|
3691
3709
|
};
|
|
3692
3710
|
}
|
|
3693
|
-
function
|
|
3711
|
+
function ja(e) {
|
|
3694
3712
|
if (e.id) return `#${CSS.escape(e.id)}`;
|
|
3695
3713
|
let t = e.tagName.toLowerCase(), n = e.getAttribute("type"), r = e.getAttribute("name");
|
|
3696
3714
|
return n && r ? `${t}[type="${n}"][name="${r}"]` : n ? `${t}[type="${n}"]` : r ? `${t}[name="${r}"]` : t;
|
|
3697
3715
|
}
|
|
3698
|
-
async function
|
|
3716
|
+
async function Ma(e, t, n) {
|
|
3699
3717
|
try {
|
|
3700
|
-
let r = window.innerWidth, i = window.innerHeight, a = Math.min(window.devicePixelRatio, 2), o = n ?
|
|
3718
|
+
let r = window.innerWidth, i = window.innerHeight, a = Math.min(window.devicePixelRatio, 2), o = n ? ka(n) : [], s = o.map(ja), c = o.map(Aa), l;
|
|
3701
3719
|
try {
|
|
3702
|
-
l = await
|
|
3720
|
+
l = await wa(document.documentElement, {
|
|
3703
3721
|
width: r,
|
|
3704
3722
|
height: i,
|
|
3705
3723
|
cacheBust: !0,
|
|
@@ -3718,29 +3736,29 @@ async function ka(e, t, n) {
|
|
|
3718
3736
|
}
|
|
3719
3737
|
if (t) {
|
|
3720
3738
|
let e = l.getContext("2d");
|
|
3721
|
-
e &&
|
|
3739
|
+
e && Pa(e, t.x, t.y, a);
|
|
3722
3740
|
}
|
|
3723
|
-
let u = await
|
|
3741
|
+
let u = await Na(l, .85);
|
|
3724
3742
|
if (!u) return null;
|
|
3725
|
-
if (u.size <=
|
|
3743
|
+
if (u.size <= Ta) return {
|
|
3726
3744
|
blob: u,
|
|
3727
3745
|
redactedCount: s.length,
|
|
3728
3746
|
redactedSelectors: s
|
|
3729
3747
|
};
|
|
3730
|
-
let d = await
|
|
3731
|
-
return !d || d.size >
|
|
3748
|
+
let d = await Na(l, .5);
|
|
3749
|
+
return !d || d.size > Ta ? null : {
|
|
3732
3750
|
blob: d,
|
|
3733
3751
|
redactedCount: s.length,
|
|
3734
3752
|
redactedSelectors: s
|
|
3735
3753
|
};
|
|
3736
|
-
} catch {
|
|
3737
|
-
return null;
|
|
3754
|
+
} catch (e) {
|
|
3755
|
+
return F(e, { context: "screenshot-capture" }), null;
|
|
3738
3756
|
}
|
|
3739
3757
|
}
|
|
3740
|
-
function
|
|
3758
|
+
function Na(e, t) {
|
|
3741
3759
|
return new Promise((n) => e.toBlob(n, "image/jpeg", t));
|
|
3742
3760
|
}
|
|
3743
|
-
function
|
|
3761
|
+
function Pa(e, t, n, r) {
|
|
3744
3762
|
let i = r, a = 28 * i, o = a / 2, s = t * i, c = n * i;
|
|
3745
3763
|
e.save();
|
|
3746
3764
|
let l = 2 * i;
|
|
@@ -3758,7 +3776,7 @@ function ja(e, t, n, r) {
|
|
|
3758
3776
|
}
|
|
3759
3777
|
//#endregion
|
|
3760
3778
|
//#region src/runtime/use-subscription-token.ts
|
|
3761
|
-
var
|
|
3779
|
+
var Fa = mr({
|
|
3762
3780
|
idle: { issued: (e, t) => ({
|
|
3763
3781
|
kind: "active",
|
|
3764
3782
|
token: t.token,
|
|
@@ -3769,10 +3787,10 @@ var Ma = dr({
|
|
|
3769
3787
|
token: t.token,
|
|
3770
3788
|
expiresAt: t.expiresAt
|
|
3771
3789
|
}) }
|
|
3772
|
-
}),
|
|
3773
|
-
function
|
|
3774
|
-
let [t, n] =
|
|
3775
|
-
return
|
|
3790
|
+
}), Ia = 30 * 6e4, La = 6e4, Ra = 6e4;
|
|
3791
|
+
function za(e) {
|
|
3792
|
+
let [t, n] = hr(Fa, { kind: "idle" });
|
|
3793
|
+
return B(() => {
|
|
3776
3794
|
let t = !1, r = null;
|
|
3777
3795
|
async function i() {
|
|
3778
3796
|
try {
|
|
@@ -3783,11 +3801,11 @@ function Ia(e) {
|
|
|
3783
3801
|
token: a.token,
|
|
3784
3802
|
expiresAt: a.expiresAt
|
|
3785
3803
|
});
|
|
3786
|
-
let o = Math.max(
|
|
3804
|
+
let o = Math.max(La, a.expiresAt - Date.now() - Ia);
|
|
3787
3805
|
r = setTimeout(i, o);
|
|
3788
|
-
} catch {
|
|
3806
|
+
} catch (e) {
|
|
3789
3807
|
if (t) return;
|
|
3790
|
-
r = setTimeout(i,
|
|
3808
|
+
e?.name !== "TypeError" && F(e, { context: "subscription-token-refresh" }), r = setTimeout(i, Ra);
|
|
3791
3809
|
}
|
|
3792
3810
|
}
|
|
3793
3811
|
return i(), () => {
|
|
@@ -3797,7 +3815,7 @@ function Ia(e) {
|
|
|
3797
3815
|
}
|
|
3798
3816
|
//#endregion
|
|
3799
3817
|
//#region src/runtime/refresh-token.ts
|
|
3800
|
-
async function
|
|
3818
|
+
async function Ba(e) {
|
|
3801
3819
|
try {
|
|
3802
3820
|
let t = {
|
|
3803
3821
|
method: "POST",
|
|
@@ -3826,24 +3844,25 @@ async function La(e) {
|
|
|
3826
3844
|
refreshToken: r.refreshToken,
|
|
3827
3845
|
refreshTokenExpiresAt: r.refreshTokenExpiresAt
|
|
3828
3846
|
};
|
|
3829
|
-
} catch {
|
|
3830
|
-
|
|
3847
|
+
} catch (e) {
|
|
3848
|
+
let t = e?.name;
|
|
3849
|
+
return t !== "AbortError" && t !== "TypeError" && F(e, { context: "refresh-token" }), null;
|
|
3831
3850
|
}
|
|
3832
3851
|
}
|
|
3833
3852
|
//#endregion
|
|
3834
3853
|
//#region src/runtime/use-token-refresh.ts
|
|
3835
|
-
var
|
|
3836
|
-
function
|
|
3854
|
+
var Va = 6e4, Ha = 500;
|
|
3855
|
+
function Ua(e, t, n, r, i) {
|
|
3837
3856
|
let a = e.kind === "verified", o = a ? e.identity.storage : void 0, s = a ? e.identity.refreshToken : void 0, c = a ? e.identity.refreshTokenExpiresAt : void 0, l = a ? e.identity.tokenExpiresAt : void 0;
|
|
3838
|
-
|
|
3857
|
+
B(() => {
|
|
3839
3858
|
if (!a || c == null || l == null || o === "localStorage" && s == null || o !== "cookies" && o !== "localStorage") return;
|
|
3840
3859
|
let u = Date.now();
|
|
3841
3860
|
if (c <= u) {
|
|
3842
3861
|
i();
|
|
3843
3862
|
return;
|
|
3844
3863
|
}
|
|
3845
|
-
let d = Math.max(
|
|
3846
|
-
let a = await
|
|
3864
|
+
let d = Math.max(Ha, l - Va - u), f = new AbortController(), p = window.setTimeout(async () => {
|
|
3865
|
+
let a = await Ba({
|
|
3847
3866
|
apiUrl: t,
|
|
3848
3867
|
apiKey: n,
|
|
3849
3868
|
mode: o,
|
|
@@ -3888,12 +3907,12 @@ function Q(...e) {
|
|
|
3888
3907
|
}
|
|
3889
3908
|
//#endregion
|
|
3890
3909
|
//#region src/runtime/use-drag.ts
|
|
3891
|
-
function
|
|
3892
|
-
let t =
|
|
3910
|
+
function Wa(e) {
|
|
3911
|
+
let t = V(e);
|
|
3893
3912
|
t.current = e;
|
|
3894
|
-
let [n, r] =
|
|
3913
|
+
let [n, r] = z(!1), i = V(!1);
|
|
3895
3914
|
return {
|
|
3896
|
-
onPointerDown:
|
|
3915
|
+
onPointerDown: H((e) => {
|
|
3897
3916
|
let n = t.current;
|
|
3898
3917
|
if (n.preventDefault && e.preventDefault(), n.stopPropagation && e.stopPropagation(), e.button !== 0 || n.shouldStart && !n.shouldStart(e)) return;
|
|
3899
3918
|
let a = e.currentTarget;
|
|
@@ -3917,8 +3936,8 @@ function Va(e) {
|
|
|
3917
3936
|
g = !0, i.current = !0, r(!0), t.current.onStart?.();
|
|
3918
3937
|
}
|
|
3919
3938
|
let o = Math.max(m, window.innerWidth - d - m), v = Math.max(m, window.innerHeight - f - m), y = {
|
|
3920
|
-
left:
|
|
3921
|
-
top:
|
|
3939
|
+
left: Ga(l + n, m, o),
|
|
3940
|
+
top: Ga(u + a, m, v)
|
|
3922
3941
|
};
|
|
3923
3942
|
_ = y, t.current.onMove(y);
|
|
3924
3943
|
}
|
|
@@ -3931,15 +3950,15 @@ function Va(e) {
|
|
|
3931
3950
|
a.addEventListener("pointermove", y), a.addEventListener("pointerup", b), a.addEventListener("pointercancel", x);
|
|
3932
3951
|
}, []),
|
|
3933
3952
|
isDragging: n,
|
|
3934
|
-
consumeClickIfDragged:
|
|
3953
|
+
consumeClickIfDragged: H(() => i.current ? (i.current = !1, !0) : !1, [])
|
|
3935
3954
|
};
|
|
3936
3955
|
}
|
|
3937
|
-
function
|
|
3956
|
+
function Ga(e, t, n) {
|
|
3938
3957
|
return Math.max(t, Math.min(n, e));
|
|
3939
3958
|
}
|
|
3940
3959
|
//#endregion
|
|
3941
3960
|
//#region ../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
|
|
3942
|
-
var
|
|
3961
|
+
var Ka = 0;
|
|
3943
3962
|
Array.isArray;
|
|
3944
3963
|
function $(e, n, r, i, a, o) {
|
|
3945
3964
|
n ||= {};
|
|
@@ -3956,7 +3975,7 @@ function $(e, n, r, i, a, o) {
|
|
|
3956
3975
|
__e: null,
|
|
3957
3976
|
__c: null,
|
|
3958
3977
|
constructor: void 0,
|
|
3959
|
-
__v: --
|
|
3978
|
+
__v: --Ka,
|
|
3960
3979
|
__i: -1,
|
|
3961
3980
|
__u: 0,
|
|
3962
3981
|
__source: a,
|
|
@@ -3967,7 +3986,7 @@ function $(e, n, r, i, a, o) {
|
|
|
3967
3986
|
}
|
|
3968
3987
|
//#endregion
|
|
3969
3988
|
//#region src/runtime/ui/icons.tsx
|
|
3970
|
-
function
|
|
3989
|
+
function qa({ size: e = 16 }) {
|
|
3971
3990
|
return /* @__PURE__ */ $("svg", {
|
|
3972
3991
|
width: e,
|
|
3973
3992
|
height: e,
|
|
@@ -3977,7 +3996,7 @@ function Wa({ size: e = 16 }) {
|
|
|
3977
3996
|
children: /* @__PURE__ */ $("path", { d: "M63.4561 0.00557731C70.6277 -0.0175584 76.9025 1.04088 83.5898 3.71066C97.7952 9.43043 109.186 20.5001 115.311 34.5359C119.708 44.8002 120.746 54.7869 119.156 65.8171C116.857 82.7956 105.129 98.8382 90.0566 106.846C83.4394 110.362 74.7336 113.029 67.2051 113.271C62.4204 113.425 61.1274 113.32 56.6807 115.204C50.2035 117.858 43.6874 120.417 37.1348 122.879C34.8442 123.763 32.3203 124.902 29.9404 125.51C29.4023 125.648 28.1978 125.009 27.7598 124.646C26.9046 123.951 27.0582 122.505 27.0264 121.484C26.8123 114.646 27.3302 107.458 26.8604 100.656C25.1578 98.6714 22.4026 96.603 20.3086 94.1989C12.1853 84.8731 7.05334 73.9949 6.18164 61.6101C4.95583 46.292 9.97176 31.1285 20.0908 19.5632C29.989 8.13202 44.0369 1.11921 59.1221 0.0788195C60.2694 -0.0356049 62.2637 0.00944821 63.4561 0.00557731ZM92.2676 55.7497C91.5754 39.5314 77.8207 26.9725 61.6064 27.7536C45.5175 28.5287 33.0758 42.1537 33.7627 58.2468C34.4496 74.3398 48.007 86.8553 64.1035 86.2566C80.3254 85.6533 92.9599 71.968 92.2676 55.7497Z" })
|
|
3978
3997
|
});
|
|
3979
3998
|
}
|
|
3980
|
-
function
|
|
3999
|
+
function Ja({ size: e = 16 }) {
|
|
3981
4000
|
return /* @__PURE__ */ $("svg", {
|
|
3982
4001
|
width: e,
|
|
3983
4002
|
height: e,
|
|
@@ -3986,7 +4005,7 @@ function Ga({ size: e = 16 }) {
|
|
|
3986
4005
|
children: /* @__PURE__ */ $("path", { d: "M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" })
|
|
3987
4006
|
});
|
|
3988
4007
|
}
|
|
3989
|
-
function
|
|
4008
|
+
function Ya({ size: e = 16 }) {
|
|
3990
4009
|
return /* @__PURE__ */ $("svg", {
|
|
3991
4010
|
width: e,
|
|
3992
4011
|
height: e,
|
|
@@ -3995,7 +4014,7 @@ function Ka({ size: e = 16 }) {
|
|
|
3995
4014
|
children: /* @__PURE__ */ $("path", { d: "M3 10a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM8.5 10a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM15.5 8.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z" })
|
|
3996
4015
|
});
|
|
3997
4016
|
}
|
|
3998
|
-
function
|
|
4017
|
+
function Xa({ size: e = 16 }) {
|
|
3999
4018
|
return /* @__PURE__ */ $("svg", {
|
|
4000
4019
|
width: e,
|
|
4001
4020
|
height: e,
|
|
@@ -4008,7 +4027,7 @@ function qa({ size: e = 16 }) {
|
|
|
4008
4027
|
})
|
|
4009
4028
|
});
|
|
4010
4029
|
}
|
|
4011
|
-
function
|
|
4030
|
+
function Za({ size: e = 16 }) {
|
|
4012
4031
|
return /* @__PURE__ */ $("svg", {
|
|
4013
4032
|
width: e,
|
|
4014
4033
|
height: e,
|
|
@@ -4022,7 +4041,7 @@ function Ja({ size: e = 16 }) {
|
|
|
4022
4041
|
})
|
|
4023
4042
|
});
|
|
4024
4043
|
}
|
|
4025
|
-
function
|
|
4044
|
+
function Qa({ size: e = 16 }) {
|
|
4026
4045
|
return /* @__PURE__ */ $("svg", {
|
|
4027
4046
|
width: e,
|
|
4028
4047
|
height: e,
|
|
@@ -4031,7 +4050,7 @@ function Ya({ size: e = 16 }) {
|
|
|
4031
4050
|
children: /* @__PURE__ */ $("path", { d: "M2.87 2.298a.75.75 0 0 0-.812 1.021L3.39 6.624a1 1 0 0 0 .928.626H8.25a.75.75 0 0 1 0 1.5H4.318a1 1 0 0 0-.927.626l-1.333 3.305a.75.75 0 0 0 .811 1.022 24.89 24.89 0 0 0 11.668-5.115.75.75 0 0 0 0-1.175A24.89 24.89 0 0 0 2.869 2.298Z" })
|
|
4032
4051
|
});
|
|
4033
4052
|
}
|
|
4034
|
-
function
|
|
4053
|
+
function $a({ size: e = 16 }) {
|
|
4035
4054
|
return /* @__PURE__ */ $("svg", {
|
|
4036
4055
|
width: e,
|
|
4037
4056
|
height: e,
|
|
@@ -4043,8 +4062,8 @@ function Xa({ size: e = 16 }) {
|
|
|
4043
4062
|
}
|
|
4044
4063
|
//#endregion
|
|
4045
4064
|
//#region src/runtime/ui/fab.tsx
|
|
4046
|
-
function
|
|
4047
|
-
let o = a === "icon-only", s = r === "bottom-left" ? "markup-fab-left" : r === "bottom-center" ? "markup-fab-center" : "markup-fab-right", [c, l] =
|
|
4065
|
+
function eo({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right", onPositionChange: i, variant: a = "default" }) {
|
|
4066
|
+
let o = a === "icon-only", s = r === "bottom-left" ? "markup-fab-left" : r === "bottom-center" ? "markup-fab-center" : "markup-fab-right", [c, l] = z(null), { onPointerDown: u, isDragging: d, consumeClickIfDragged: f } = Wa({
|
|
4048
4067
|
preventDefault: !0,
|
|
4049
4068
|
stopPropagation: !0,
|
|
4050
4069
|
onMove: l,
|
|
@@ -4076,7 +4095,7 @@ function Za({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right",
|
|
|
4076
4095
|
"aria-pressed": e,
|
|
4077
4096
|
children: [/* @__PURE__ */ $("span", {
|
|
4078
4097
|
class: "markup-fab-icon",
|
|
4079
|
-
children: $(e ?
|
|
4098
|
+
children: $(e ? Ja : qa, { size: 16 })
|
|
4080
4099
|
}), o ? null : /* @__PURE__ */ $("span", {
|
|
4081
4100
|
class: "markup-fab-label",
|
|
4082
4101
|
children: e ? "Cancel" : "Markup"
|
|
@@ -4085,7 +4104,7 @@ function Za({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right",
|
|
|
4085
4104
|
}
|
|
4086
4105
|
//#endregion
|
|
4087
4106
|
//#region src/runtime/use-focus-trap.ts
|
|
4088
|
-
var
|
|
4107
|
+
var to = [
|
|
4089
4108
|
"a[href]",
|
|
4090
4109
|
"button:not([disabled])",
|
|
4091
4110
|
"input:not([disabled])",
|
|
@@ -4093,14 +4112,14 @@ var Qa = [
|
|
|
4093
4112
|
"textarea:not([disabled])",
|
|
4094
4113
|
"[tabindex]:not([tabindex=\"-1\"])"
|
|
4095
4114
|
].join(",");
|
|
4096
|
-
function
|
|
4097
|
-
|
|
4115
|
+
function no(e, t) {
|
|
4116
|
+
B(() => {
|
|
4098
4117
|
if (!t) return;
|
|
4099
4118
|
let n = e.current;
|
|
4100
4119
|
if (!n) return;
|
|
4101
4120
|
function r(e) {
|
|
4102
4121
|
if (e.key !== "Tab") return;
|
|
4103
|
-
let t = Array.from(n.querySelectorAll(
|
|
4122
|
+
let t = Array.from(n.querySelectorAll(to)), r = t[0], i = t[t.length - 1];
|
|
4104
4123
|
if (!r || !i) return;
|
|
4105
4124
|
let a = n.getRootNode(), o = a instanceof ShadowRoot ? a.activeElement : document.activeElement;
|
|
4106
4125
|
(e.shiftKey ? o === r : o === i) && (e.preventDefault(), (e.shiftKey ? i : r).focus());
|
|
@@ -4110,9 +4129,9 @@ function $a(e, t) {
|
|
|
4110
4129
|
}
|
|
4111
4130
|
//#endregion
|
|
4112
4131
|
//#region src/runtime/use-object-url.ts
|
|
4113
|
-
function
|
|
4114
|
-
let [t, n] =
|
|
4115
|
-
return
|
|
4132
|
+
function ro(e) {
|
|
4133
|
+
let [t, n] = z(null);
|
|
4134
|
+
return B(() => {
|
|
4116
4135
|
if (!e) {
|
|
4117
4136
|
n(null);
|
|
4118
4137
|
return;
|
|
@@ -4123,9 +4142,9 @@ function eo(e) {
|
|
|
4123
4142
|
}
|
|
4124
4143
|
//#endregion
|
|
4125
4144
|
//#region src/runtime/ui/author-prompt.tsx
|
|
4126
|
-
function
|
|
4127
|
-
let [o, s] =
|
|
4128
|
-
|
|
4145
|
+
function io({ isPending: e, isConnecting: t = !1, isSigningIn: n = !1, onSubmit: r, onCancel: i, onSignIn: a }) {
|
|
4146
|
+
let [o, s] = z(""), [c, l] = z(""), u = V(null);
|
|
4147
|
+
B(() => {
|
|
4129
4148
|
u.current?.focus();
|
|
4130
4149
|
}, []);
|
|
4131
4150
|
function d(n) {
|
|
@@ -4202,18 +4221,18 @@ function to({ isPending: e, isConnecting: t = !1, isSigningIn: n = !1, onSubmit:
|
|
|
4202
4221
|
}
|
|
4203
4222
|
//#endregion
|
|
4204
4223
|
//#region src/runtime/ui/composer.tsx
|
|
4205
|
-
var
|
|
4206
|
-
function
|
|
4207
|
-
let [s, c] =
|
|
4208
|
-
|
|
4224
|
+
var ao = 4e3;
|
|
4225
|
+
function oo({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "Post", initialFocus: r = !0, isPending: i, error: a, onSubmit: o }) {
|
|
4226
|
+
let [s, c] = z(""), l = V(null), u = V(!1);
|
|
4227
|
+
B(() => {
|
|
4209
4228
|
r && l.current?.focus();
|
|
4210
|
-
}, [r]),
|
|
4229
|
+
}, [r]), B(() => {
|
|
4211
4230
|
let e = l.current;
|
|
4212
4231
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 160)}px`);
|
|
4213
|
-
}, [s]),
|
|
4232
|
+
}, [s]), B(() => {
|
|
4214
4233
|
u.current && !i && !a && (c(""), l.current?.focus()), u.current = i;
|
|
4215
4234
|
}, [i, a]);
|
|
4216
|
-
let d =
|
|
4235
|
+
let d = ao - s.length, f = d < 0;
|
|
4217
4236
|
function p(e) {
|
|
4218
4237
|
e?.preventDefault();
|
|
4219
4238
|
let t = s.trim();
|
|
@@ -4231,7 +4250,7 @@ function ro({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
|
|
|
4231
4250
|
"aria-label": i ? "Sending…" : n,
|
|
4232
4251
|
title: i ? "Sending…" : n,
|
|
4233
4252
|
tabIndex: e,
|
|
4234
|
-
children: /* @__PURE__ */ $(
|
|
4253
|
+
children: /* @__PURE__ */ $(Qa, { size: 14 })
|
|
4235
4254
|
});
|
|
4236
4255
|
}
|
|
4237
4256
|
return /* @__PURE__ */ $("form", {
|
|
@@ -4244,7 +4263,7 @@ function ro({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
|
|
|
4244
4263
|
class: "markup-composer-input",
|
|
4245
4264
|
placeholder: t,
|
|
4246
4265
|
rows: h ? 2 : 1,
|
|
4247
|
-
maxLength:
|
|
4266
|
+
maxLength: ao + 100,
|
|
4248
4267
|
value: s,
|
|
4249
4268
|
onInput: (e) => c(e.currentTarget.value),
|
|
4250
4269
|
onKeyDown: m,
|
|
@@ -4280,15 +4299,15 @@ function ro({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
|
|
|
4280
4299
|
}
|
|
4281
4300
|
//#endregion
|
|
4282
4301
|
//#region src/runtime/ui/new-thread-popover.tsx
|
|
4283
|
-
function
|
|
4284
|
-
let g =
|
|
4285
|
-
|
|
4286
|
-
let [_, v] =
|
|
4302
|
+
function so({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolving: i, isSigningIn: a, isPending: o, error: s, screenshot: c, isScreenshotCapturing: l, screenshotRedactedCount: u, screenshotRedactedSelectors: d, onAuthor: f, onSignIn: p, onSubmit: m, onClose: h }) {
|
|
4303
|
+
let g = V(null);
|
|
4304
|
+
no(g, !0);
|
|
4305
|
+
let [_, v] = z(!1), [y, b] = z(!1), x = ro(c), [C, w] = z(null), { onPointerDown: T, isDragging: E } = Wa({
|
|
4287
4306
|
targetRef: g,
|
|
4288
4307
|
shouldStart: (e) => !e.target?.closest("button, a, input, textarea, select"),
|
|
4289
4308
|
onMove: w
|
|
4290
4309
|
});
|
|
4291
|
-
|
|
4310
|
+
B(() => {
|
|
4292
4311
|
let e = g.current;
|
|
4293
4312
|
if (!e) return;
|
|
4294
4313
|
if (typeof e.showPopover == "function" && !e.matches(":popover-open")) try {
|
|
@@ -4299,7 +4318,7 @@ function io({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
|
|
|
4299
4318
|
}
|
|
4300
4319
|
return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
|
|
4301
4320
|
}, [h]);
|
|
4302
|
-
let D =
|
|
4321
|
+
let D = co(e - window.scrollX + 16, 12, window.innerWidth - 320 - 12), O = co(t - window.scrollY - 16, 12, window.innerHeight - 220), k = c != null, A = l || k;
|
|
4303
4322
|
return /* @__PURE__ */ $("div", {
|
|
4304
4323
|
ref: g,
|
|
4305
4324
|
class: Q("markup-popover", C && "is-floating", E && "is-dragging"),
|
|
@@ -4321,9 +4340,9 @@ function io({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
|
|
|
4321
4340
|
class: "markup-icon-btn",
|
|
4322
4341
|
"aria-label": "Discard pin",
|
|
4323
4342
|
onClick: h,
|
|
4324
|
-
children: /* @__PURE__ */ $(
|
|
4343
|
+
children: /* @__PURE__ */ $(Ja, { size: 16 })
|
|
4325
4344
|
})]
|
|
4326
|
-
}), n == null ? /* @__PURE__ */ $(
|
|
4345
|
+
}), n == null ? /* @__PURE__ */ $(io, {
|
|
4327
4346
|
isPending: o,
|
|
4328
4347
|
isConnecting: i,
|
|
4329
4348
|
isSigningIn: a,
|
|
@@ -4347,7 +4366,7 @@ function io({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
|
|
|
4347
4366
|
}) : null
|
|
4348
4367
|
]
|
|
4349
4368
|
}),
|
|
4350
|
-
/* @__PURE__ */ $(
|
|
4369
|
+
/* @__PURE__ */ $(oo, {
|
|
4351
4370
|
label: "Feedback",
|
|
4352
4371
|
placeholder: "What's wrong, missing, or worth noting?",
|
|
4353
4372
|
submitLabel: "Post markup",
|
|
@@ -4365,7 +4384,7 @@ function io({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
|
|
|
4365
4384
|
class: "markup-screenshot-checkbox",
|
|
4366
4385
|
disabled: !0
|
|
4367
4386
|
}),
|
|
4368
|
-
/* @__PURE__ */ $(
|
|
4387
|
+
/* @__PURE__ */ $(Za, { size: 12 }),
|
|
4369
4388
|
/* @__PURE__ */ $("span", { children: "Capturing…" })
|
|
4370
4389
|
]
|
|
4371
4390
|
}) : /* @__PURE__ */ $("label", {
|
|
@@ -4377,7 +4396,7 @@ function io({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
|
|
|
4377
4396
|
checked: _,
|
|
4378
4397
|
onChange: (e) => v(e.currentTarget.checked)
|
|
4379
4398
|
}),
|
|
4380
|
-
/* @__PURE__ */ $(
|
|
4399
|
+
/* @__PURE__ */ $(Za, { size: 12 }),
|
|
4381
4400
|
/* @__PURE__ */ $("span", { children: "Attach screenshot" }),
|
|
4382
4401
|
x && _ ? /* @__PURE__ */ $("img", {
|
|
4383
4402
|
class: "markup-screenshot-thumb",
|
|
@@ -4425,12 +4444,12 @@ function io({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
|
|
|
4425
4444
|
})]
|
|
4426
4445
|
});
|
|
4427
4446
|
}
|
|
4428
|
-
function
|
|
4447
|
+
function co(e, t, n) {
|
|
4429
4448
|
return Math.max(t, Math.min(n, e));
|
|
4430
4449
|
}
|
|
4431
4450
|
//#endregion
|
|
4432
4451
|
//#region src/runtime/ui/pin.tsx
|
|
4433
|
-
function
|
|
4452
|
+
function lo({ pageX: e, pageY: t, count: n, isActive: r, isUnresolved: i, onClick: a }) {
|
|
4434
4453
|
let o = t - window.scrollY, s = e - window.scrollX;
|
|
4435
4454
|
return /* @__PURE__ */ $("button", {
|
|
4436
4455
|
type: "button",
|
|
@@ -4453,7 +4472,7 @@ function oo({ pageX: e, pageY: t, count: n, isActive: r, isUnresolved: i, onClic
|
|
|
4453
4472
|
}) : null]
|
|
4454
4473
|
});
|
|
4455
4474
|
}
|
|
4456
|
-
function
|
|
4475
|
+
function uo({ pageX: e, pageY: t }) {
|
|
4457
4476
|
let n = t - window.scrollY, r = e - window.scrollX;
|
|
4458
4477
|
return /* @__PURE__ */ $("div", {
|
|
4459
4478
|
class: "markup-pin markup-pin-ghost is-anchor",
|
|
@@ -4469,15 +4488,15 @@ function so({ pageX: e, pageY: t }) {
|
|
|
4469
4488
|
}
|
|
4470
4489
|
//#endregion
|
|
4471
4490
|
//#region src/runtime/ui/placement-overlay.tsx
|
|
4472
|
-
function
|
|
4473
|
-
|
|
4491
|
+
function fo({ onPlace: e, onCancel: t }) {
|
|
4492
|
+
B(() => {
|
|
4474
4493
|
function e(e) {
|
|
4475
4494
|
e.key === "Escape" && t();
|
|
4476
4495
|
}
|
|
4477
4496
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
4478
4497
|
}, [t]);
|
|
4479
4498
|
function n(t) {
|
|
4480
|
-
t.stopPropagation(), t.preventDefault(), e(
|
|
4499
|
+
t.stopPropagation(), t.preventDefault(), e(Rr(t, document.elementsFromPoint(t.clientX, t.clientY).find((e) => !e.shadowRoot) ?? null), t.clientX, t.clientY);
|
|
4481
4500
|
}
|
|
4482
4501
|
function r(e) {
|
|
4483
4502
|
e.preventDefault(), e.stopPropagation();
|
|
@@ -4495,14 +4514,14 @@ function co({ onPlace: e, onCancel: t }) {
|
|
|
4495
4514
|
}
|
|
4496
4515
|
//#endregion
|
|
4497
4516
|
//#region src/runtime/ui/thread-popover.tsx
|
|
4498
|
-
var
|
|
4517
|
+
var po = [
|
|
4499
4518
|
"👍",
|
|
4500
4519
|
"❤️",
|
|
4501
4520
|
"🎉",
|
|
4502
4521
|
"😮",
|
|
4503
4522
|
"😄",
|
|
4504
4523
|
"❓"
|
|
4505
|
-
],
|
|
4524
|
+
], mo = mr({
|
|
4506
4525
|
none: {
|
|
4507
4526
|
"toggle-thread-menu": () => ({
|
|
4508
4527
|
kind: "thread-menu",
|
|
@@ -4558,22 +4577,22 @@ var lo = [
|
|
|
4558
4577
|
dismiss: () => ({ kind: "none" })
|
|
4559
4578
|
}
|
|
4560
4579
|
});
|
|
4561
|
-
function
|
|
4562
|
-
let y =
|
|
4580
|
+
function ho({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIdentityResolving: i, isSigningIn: a, canDelete: o, isPending: s, error: c, isHidden: l = !1, onAuthor: u, onSignIn: d, onClose: f, onReply: p, onEditComment: m, onDeleteComment: h, onToggleReaction: g, onResolve: _, onDelete: v }) {
|
|
4581
|
+
let y = V(null), b = V(null), x = V(null), S = V(null), [C, w] = hr(mo, { kind: "none" }), [T, E] = z(null), { onPointerDown: D, isDragging: O } = Wa({
|
|
4563
4582
|
targetRef: y,
|
|
4564
4583
|
shouldStart: (e) => !e.target?.closest("button, a, input, textarea, select"),
|
|
4565
4584
|
onMove: E
|
|
4566
4585
|
});
|
|
4567
|
-
|
|
4568
|
-
let k = e.resolvedAt != null, A =
|
|
4569
|
-
|
|
4586
|
+
no(y, !0);
|
|
4587
|
+
let k = e.resolvedAt != null, A = Me(() => e.comments.filter((e) => !e.deleted), [e.comments]);
|
|
4588
|
+
B(() => {
|
|
4570
4589
|
if (C.kind === "none" || C.kind === "editing") return;
|
|
4571
4590
|
function e(e) {
|
|
4572
4591
|
let t = S.current;
|
|
4573
4592
|
t && !e.composedPath().includes(t) && w({ type: "dismiss" });
|
|
4574
4593
|
}
|
|
4575
4594
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
4576
|
-
}, [C.kind, w]),
|
|
4595
|
+
}, [C.kind, w]), B(() => {
|
|
4577
4596
|
if (C.kind !== "editing") return;
|
|
4578
4597
|
let t = e.comments.find((e) => e._id === C.commentId);
|
|
4579
4598
|
(!t || t.deleted) && w({ type: "dismiss" });
|
|
@@ -4582,8 +4601,8 @@ function fo({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
|
|
|
4582
4601
|
C,
|
|
4583
4602
|
w
|
|
4584
4603
|
]);
|
|
4585
|
-
let j =
|
|
4586
|
-
|
|
4604
|
+
let j = V(!0);
|
|
4605
|
+
B(() => {
|
|
4587
4606
|
let e = b.current;
|
|
4588
4607
|
if (e) {
|
|
4589
4608
|
if (j.current) {
|
|
@@ -4592,7 +4611,7 @@ function fo({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
|
|
|
4592
4611
|
}
|
|
4593
4612
|
e.scrollHeight - e.scrollTop - e.clientHeight < 80 && (e.scrollTop = e.scrollHeight);
|
|
4594
4613
|
}
|
|
4595
|
-
}, [A.length]),
|
|
4614
|
+
}, [A.length]), B(() => {
|
|
4596
4615
|
let e = y.current;
|
|
4597
4616
|
if (!e) return;
|
|
4598
4617
|
if (typeof e.showPopover == "function" && !e.matches(":popover-open")) try {
|
|
@@ -4603,15 +4622,15 @@ function fo({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
|
|
|
4603
4622
|
}
|
|
4604
4623
|
return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
|
|
4605
4624
|
}, [f]);
|
|
4606
|
-
let M =
|
|
4607
|
-
let t =
|
|
4625
|
+
let M = Me(() => {
|
|
4626
|
+
let t = zr({
|
|
4608
4627
|
anchorX: e.anchorX,
|
|
4609
4628
|
anchorY: e.anchorY,
|
|
4610
4629
|
anchorSelector: e.anchorSelector
|
|
4611
4630
|
});
|
|
4612
4631
|
return {
|
|
4613
|
-
left:
|
|
4614
|
-
top:
|
|
4632
|
+
left: yo(t.pageX - window.scrollX + 16, 12, window.innerWidth - 320 - 12),
|
|
4633
|
+
top: yo(t.pageY - window.scrollY - 16, 12, window.innerHeight - 200)
|
|
4615
4634
|
};
|
|
4616
4635
|
}, [
|
|
4617
4636
|
e.anchorX,
|
|
@@ -4655,7 +4674,7 @@ function fo({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
|
|
|
4655
4674
|
class: Q("markup-icon-btn", C.kind === "thread-menu" && "is-open"),
|
|
4656
4675
|
title: "More options",
|
|
4657
4676
|
onClick: () => w({ type: "toggle-thread-menu" }),
|
|
4658
|
-
children: /* @__PURE__ */ $(
|
|
4677
|
+
children: /* @__PURE__ */ $(Ya, { size: 16 })
|
|
4659
4678
|
}), C.kind === "thread-menu" ? /* @__PURE__ */ $("div", {
|
|
4660
4679
|
class: "markup-thread-menu-list",
|
|
4661
4680
|
children: [/* @__PURE__ */ $("button", {
|
|
@@ -4683,14 +4702,14 @@ function fo({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
|
|
|
4683
4702
|
title: "Mark as resolved",
|
|
4684
4703
|
disabled: s,
|
|
4685
4704
|
onClick: _,
|
|
4686
|
-
children: /* @__PURE__ */ $(
|
|
4705
|
+
children: /* @__PURE__ */ $(Xa, { size: 16 })
|
|
4687
4706
|
}) : null,
|
|
4688
4707
|
/* @__PURE__ */ $("button", {
|
|
4689
4708
|
type: "button",
|
|
4690
4709
|
class: "markup-icon-btn",
|
|
4691
4710
|
title: "Close thread",
|
|
4692
4711
|
onClick: f,
|
|
4693
|
-
children: /* @__PURE__ */ $(
|
|
4712
|
+
children: /* @__PURE__ */ $(Ja, { size: 16 })
|
|
4694
4713
|
})
|
|
4695
4714
|
]
|
|
4696
4715
|
})]
|
|
@@ -4717,12 +4736,12 @@ function fo({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
|
|
|
4717
4736
|
/* @__PURE__ */ $("time", {
|
|
4718
4737
|
class: "markup-comment-time",
|
|
4719
4738
|
datetime: new Date(t.createdAt).toISOString(),
|
|
4720
|
-
title:
|
|
4721
|
-
children:
|
|
4739
|
+
title: xo(t.createdAt),
|
|
4740
|
+
children: bo(t.createdAt)
|
|
4722
4741
|
}),
|
|
4723
4742
|
/* @__PURE__ */ $("div", {
|
|
4724
4743
|
class: "markup-thread-actions",
|
|
4725
|
-
children: [!k && !l ? /* @__PURE__ */ $(
|
|
4744
|
+
children: [!k && !l ? /* @__PURE__ */ $(go, {
|
|
4726
4745
|
comment: t,
|
|
4727
4746
|
pickerOpen: p,
|
|
4728
4747
|
pickerDirection: _,
|
|
@@ -4790,7 +4809,7 @@ function fo({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
|
|
|
4790
4809
|
direction: a < i ? "up" : "down"
|
|
4791
4810
|
});
|
|
4792
4811
|
},
|
|
4793
|
-
children: /* @__PURE__ */ $(
|
|
4812
|
+
children: /* @__PURE__ */ $(Ya, { size: 16 })
|
|
4794
4813
|
}), d ? /* @__PURE__ */ $("div", {
|
|
4795
4814
|
class: "markup-thread-menu-list",
|
|
4796
4815
|
children: [o ? /* @__PURE__ */ $("button", {
|
|
@@ -4862,7 +4881,7 @@ function fo({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
|
|
|
4862
4881
|
children: [t.body, t.editedAt == null ? null : /* @__PURE__ */ $("time", {
|
|
4863
4882
|
class: "markup-comment-edited",
|
|
4864
4883
|
datetime: new Date(t.editedAt).toISOString(),
|
|
4865
|
-
title:
|
|
4884
|
+
title: xo(t.editedAt),
|
|
4866
4885
|
children: [" ", "(edited)"]
|
|
4867
4886
|
})]
|
|
4868
4887
|
}),
|
|
@@ -4875,7 +4894,7 @@ function fo({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
|
|
|
4875
4894
|
alt: "Screenshot"
|
|
4876
4895
|
})
|
|
4877
4896
|
}) : null,
|
|
4878
|
-
!l && t.reactions.length > 0 ? /* @__PURE__ */ $(
|
|
4897
|
+
!l && t.reactions.length > 0 ? /* @__PURE__ */ $(_o, {
|
|
4879
4898
|
comment: t,
|
|
4880
4899
|
isResolved: k,
|
|
4881
4900
|
onToggle: (e) => g(t._id, e)
|
|
@@ -4895,7 +4914,7 @@ function fo({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
|
|
|
4895
4914
|
onClick: (e) => {
|
|
4896
4915
|
e.stopPropagation(), x.current?.close();
|
|
4897
4916
|
},
|
|
4898
|
-
children: /* @__PURE__ */ $(
|
|
4917
|
+
children: /* @__PURE__ */ $(Ja, { size: 16 })
|
|
4899
4918
|
}), /* @__PURE__ */ $("img", {
|
|
4900
4919
|
class: "markup-lightbox-img",
|
|
4901
4920
|
src: e.screenshotUrl,
|
|
@@ -4903,7 +4922,7 @@ function fo({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
|
|
|
4903
4922
|
onClick: (e) => e.stopPropagation()
|
|
4904
4923
|
})]
|
|
4905
4924
|
}) : null,
|
|
4906
|
-
t == null ? /* @__PURE__ */ $(
|
|
4925
|
+
t == null ? /* @__PURE__ */ $(io, {
|
|
4907
4926
|
isPending: s,
|
|
4908
4927
|
isConnecting: i,
|
|
4909
4928
|
isSigningIn: a,
|
|
@@ -4925,7 +4944,7 @@ function fo({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
|
|
|
4925
4944
|
children: "team"
|
|
4926
4945
|
}) : null
|
|
4927
4946
|
]
|
|
4928
|
-
}), /* @__PURE__ */ $(
|
|
4947
|
+
}), /* @__PURE__ */ $(oo, {
|
|
4929
4948
|
label: "Reply",
|
|
4930
4949
|
placeholder: "Write a reply…",
|
|
4931
4950
|
submitLabel: "Reply",
|
|
@@ -4938,7 +4957,7 @@ function fo({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
|
|
|
4938
4957
|
]
|
|
4939
4958
|
});
|
|
4940
4959
|
}
|
|
4941
|
-
function
|
|
4960
|
+
function go({ comment: e, pickerOpen: t, pickerDirection: n, pickerSide: r, pickerRef: i, onPickerClick: a, onPickerSelect: o }) {
|
|
4942
4961
|
return /* @__PURE__ */ $("div", {
|
|
4943
4962
|
class: Q("markup-reaction-picker-wrap", t && "is-open", t && n === "up" && "is-up", r && "is-side"),
|
|
4944
4963
|
ref: i,
|
|
@@ -4948,11 +4967,11 @@ function po({ comment: e, pickerOpen: t, pickerDirection: n, pickerSide: r, pick
|
|
|
4948
4967
|
title: "Add reaction",
|
|
4949
4968
|
"aria-label": "Add reaction",
|
|
4950
4969
|
onClick: a,
|
|
4951
|
-
children: /* @__PURE__ */ $(
|
|
4970
|
+
children: /* @__PURE__ */ $($a, { size: 16 })
|
|
4952
4971
|
}), t ? /* @__PURE__ */ $("div", {
|
|
4953
4972
|
class: "markup-reaction-picker",
|
|
4954
4973
|
role: "menu",
|
|
4955
|
-
children:
|
|
4974
|
+
children: po.map((t) => /* @__PURE__ */ $("button", {
|
|
4956
4975
|
type: "button",
|
|
4957
4976
|
role: "menuitem",
|
|
4958
4977
|
class: Q("markup-reaction-picker-item", (e.reactions.find((e) => e.emoji === t)?.mine ?? !1) && "is-mine"),
|
|
@@ -4962,11 +4981,11 @@ function po({ comment: e, pickerOpen: t, pickerDirection: n, pickerSide: r, pick
|
|
|
4962
4981
|
}) : null]
|
|
4963
4982
|
});
|
|
4964
4983
|
}
|
|
4965
|
-
function
|
|
4984
|
+
function _o({ comment: e, isResolved: t, onToggle: n }) {
|
|
4966
4985
|
return /* @__PURE__ */ $("div", {
|
|
4967
4986
|
class: "markup-reactions",
|
|
4968
4987
|
children: e.reactions.map((e) => {
|
|
4969
|
-
let r =
|
|
4988
|
+
let r = vo(e.reactors, e.mine, e.count, e.emoji);
|
|
4970
4989
|
return /* @__PURE__ */ $("button", {
|
|
4971
4990
|
type: "button",
|
|
4972
4991
|
class: Q("markup-reaction-chip", e.mine && "is-mine"),
|
|
@@ -4987,14 +5006,14 @@ function mo({ comment: e, isResolved: t, onToggle: n }) {
|
|
|
4987
5006
|
})
|
|
4988
5007
|
});
|
|
4989
5008
|
}
|
|
4990
|
-
function
|
|
5009
|
+
function vo(e, t, n, r) {
|
|
4991
5010
|
let i = e.slice(), a = i.length + +!!t, o = Math.max(0, n - a);
|
|
4992
5011
|
return o > 0 && i.push(`${o} other${o === 1 ? "" : "s"}`), t && i.push("you"), i.length === 0 ? `${n} reacted with ${r}` : `${i.length === 1 ? i[0] : `${i.slice(0, -1).join(", ")} and ${i[i.length - 1]}`} reacted with ${r}`;
|
|
4993
5012
|
}
|
|
4994
|
-
function
|
|
5013
|
+
function yo(e, t, n) {
|
|
4995
5014
|
return Math.max(t, Math.min(n, e));
|
|
4996
5015
|
}
|
|
4997
|
-
function
|
|
5016
|
+
function bo(e) {
|
|
4998
5017
|
let t = Date.now() - e, n = Math.floor(t / 1e3);
|
|
4999
5018
|
if (n < 60) return "just now";
|
|
5000
5019
|
let r = Math.floor(n / 60);
|
|
@@ -5011,7 +5030,7 @@ function _o(e) {
|
|
|
5011
5030
|
year: "numeric"
|
|
5012
5031
|
});
|
|
5013
5032
|
}
|
|
5014
|
-
function
|
|
5033
|
+
function xo(e) {
|
|
5015
5034
|
return new Date(e).toLocaleDateString([], {
|
|
5016
5035
|
month: "long",
|
|
5017
5036
|
day: "numeric",
|
|
@@ -5022,7 +5041,7 @@ function vo(e) {
|
|
|
5022
5041
|
}
|
|
5023
5042
|
//#endregion
|
|
5024
5043
|
//#region src/runtime/ui/app.tsx
|
|
5025
|
-
function
|
|
5044
|
+
function So(e) {
|
|
5026
5045
|
let t = {
|
|
5027
5046
|
clientId: `markup_user_${e.identity.id}`,
|
|
5028
5047
|
name: e.identity.name,
|
|
@@ -5047,10 +5066,10 @@ function yo(e) {
|
|
|
5047
5066
|
} : {}
|
|
5048
5067
|
};
|
|
5049
5068
|
}
|
|
5050
|
-
function
|
|
5069
|
+
function Co() {
|
|
5051
5070
|
return window.location.host + window.location.pathname;
|
|
5052
5071
|
}
|
|
5053
|
-
var
|
|
5072
|
+
var wo = mr({
|
|
5054
5073
|
visible: {
|
|
5055
5074
|
"hide-with-toast": () => ({ kind: "hidden-with-toast" }),
|
|
5056
5075
|
toggle: () => ({ kind: "hidden" })
|
|
@@ -5061,26 +5080,26 @@ var xo = dr({
|
|
|
5061
5080
|
},
|
|
5062
5081
|
hidden: { toggle: () => ({ kind: "visible" }) }
|
|
5063
5082
|
});
|
|
5064
|
-
function
|
|
5065
|
-
return
|
|
5083
|
+
function To(e) {
|
|
5084
|
+
return ni(e), e;
|
|
5066
5085
|
}
|
|
5067
|
-
var
|
|
5086
|
+
var Eo = mr({
|
|
5068
5087
|
unresolved: {
|
|
5069
|
-
"mint-success": (e, t) =>
|
|
5088
|
+
"mint-success": (e, t) => To({
|
|
5070
5089
|
kind: "anon",
|
|
5071
5090
|
identity: t.identity
|
|
5072
5091
|
}),
|
|
5073
|
-
"signed-in": (e, t) =>
|
|
5092
|
+
"signed-in": (e, t) => To({
|
|
5074
5093
|
kind: "verified",
|
|
5075
5094
|
identity: t.identity
|
|
5076
5095
|
})
|
|
5077
5096
|
},
|
|
5078
5097
|
anon: {
|
|
5079
|
-
"signed-in": (e, t) =>
|
|
5098
|
+
"signed-in": (e, t) => To({
|
|
5080
5099
|
kind: "verified",
|
|
5081
5100
|
identity: t.identity
|
|
5082
5101
|
}),
|
|
5083
|
-
"author-set": (e, t) =>
|
|
5102
|
+
"author-set": (e, t) => To({
|
|
5084
5103
|
kind: "anon",
|
|
5085
5104
|
identity: {
|
|
5086
5105
|
...e.identity,
|
|
@@ -5090,11 +5109,11 @@ var Co = dr({
|
|
|
5090
5109
|
})
|
|
5091
5110
|
},
|
|
5092
5111
|
verified: {
|
|
5093
|
-
"signed-in": (e, t) =>
|
|
5112
|
+
"signed-in": (e, t) => To({
|
|
5094
5113
|
kind: "verified",
|
|
5095
5114
|
identity: t.identity
|
|
5096
5115
|
}),
|
|
5097
|
-
unauthorized: (e) =>
|
|
5116
|
+
unauthorized: (e) => To({
|
|
5098
5117
|
kind: "recovering",
|
|
5099
5118
|
preserved: {
|
|
5100
5119
|
name: e.identity.name,
|
|
@@ -5103,32 +5122,32 @@ var Co = dr({
|
|
|
5103
5122
|
})
|
|
5104
5123
|
},
|
|
5105
5124
|
recovering: {
|
|
5106
|
-
"mint-success": (e, t) =>
|
|
5125
|
+
"mint-success": (e, t) => To({
|
|
5107
5126
|
kind: "anon",
|
|
5108
5127
|
identity: t.identity
|
|
5109
5128
|
}),
|
|
5110
|
-
"signed-in": (e, t) =>
|
|
5129
|
+
"signed-in": (e, t) => To({
|
|
5111
5130
|
kind: "verified",
|
|
5112
5131
|
identity: t.identity
|
|
5113
5132
|
})
|
|
5114
5133
|
}
|
|
5115
5134
|
});
|
|
5116
|
-
function
|
|
5117
|
-
let [a, o] =
|
|
5118
|
-
|
|
5135
|
+
function Do({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "default", screenshots: i }) {
|
|
5136
|
+
let [a, o] = z(Co), [s, c] = z([]), [l, u] = z(!1), d = Me(() => ti(), []), [f, p] = hr(Eo, d.state), [m, h] = z(null);
|
|
5137
|
+
B(() => {
|
|
5119
5138
|
let n = !1;
|
|
5120
|
-
return
|
|
5139
|
+
return Gr(e, t).then((e) => {
|
|
5121
5140
|
n || h(e);
|
|
5122
5141
|
}), () => {
|
|
5123
5142
|
n = !0;
|
|
5124
5143
|
};
|
|
5125
5144
|
}, [e, t]);
|
|
5126
|
-
let [g, _] =
|
|
5127
|
-
v.current = f,
|
|
5145
|
+
let [g, _] = z(n), v = V(f);
|
|
5146
|
+
v.current = f, Ua(f, e, t, (e) => p({
|
|
5128
5147
|
type: "signed-in",
|
|
5129
5148
|
identity: e
|
|
5130
5149
|
}), () => p({ type: "unauthorized" }));
|
|
5131
|
-
let y =
|
|
5150
|
+
let y = Me(() => Hr({
|
|
5132
5151
|
apiUrl: e,
|
|
5133
5152
|
apiKey: t,
|
|
5134
5153
|
getToken: () => {
|
|
@@ -5153,8 +5172,8 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5153
5172
|
e,
|
|
5154
5173
|
t,
|
|
5155
5174
|
p
|
|
5156
|
-
]), [b, x] =
|
|
5157
|
-
|
|
5175
|
+
]), [b, x] = z({ kind: "idle" }), S = _r(), C = _r(), w = _r(), { run: T, reset: E } = S, { run: D } = C, { run: O, reset: k } = w, A = S.isPending, j = S.error ?? C.error ?? w.error, [M, N] = hr(wo, { kind: "visible" }), ee = M.kind !== "visible", [te, ne] = z(0), re = V(null), ie = ii(f), ae = f.kind === "verified", oe = f.kind === "unresolved" || f.kind === "recovering", P = ri(f);
|
|
5176
|
+
B(() => {
|
|
5158
5177
|
if (f.kind !== "unresolved" && f.kind !== "recovering") return;
|
|
5159
5178
|
let e = f.kind === "recovering" ? f.preserved : d.preserved, t = !1, n = null, r = 1e3;
|
|
5160
5179
|
function i() {
|
|
@@ -5181,16 +5200,16 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5181
5200
|
p,
|
|
5182
5201
|
d
|
|
5183
5202
|
]);
|
|
5184
|
-
let se =
|
|
5185
|
-
|
|
5186
|
-
let t = new
|
|
5203
|
+
let se = za(y), [ce, le] = z(null);
|
|
5204
|
+
B(() => {
|
|
5205
|
+
let t = new pr(e.replace(/\.convex\.site(\/.*)?$/, ".convex.cloud"));
|
|
5187
5206
|
return le(t), () => {
|
|
5188
5207
|
t.close(), le((e) => e === t ? null : e);
|
|
5189
5208
|
};
|
|
5190
5209
|
}, [e]);
|
|
5191
|
-
let ue =
|
|
5192
|
-
|
|
5193
|
-
if (!(!ce || !se)) return E(), k(), ce.onUpdate(
|
|
5210
|
+
let ue = V(!1);
|
|
5211
|
+
B(() => {
|
|
5212
|
+
if (!(!ce || !se)) return E(), k(), ce.onUpdate(rn("widget/queries:subscribeThreadsForRoute"), {
|
|
5194
5213
|
subscriptionToken: se,
|
|
5195
5214
|
route: a,
|
|
5196
5215
|
viewerClientId: P
|
|
@@ -5204,7 +5223,7 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5204
5223
|
P,
|
|
5205
5224
|
E,
|
|
5206
5225
|
k
|
|
5207
|
-
]),
|
|
5226
|
+
]), B(() => {
|
|
5208
5227
|
if (ue.current || !l) return;
|
|
5209
5228
|
let e = window.location.hash.match(/^#markup-thread=(.+)$/);
|
|
5210
5229
|
if (e) {
|
|
@@ -5215,16 +5234,16 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5215
5234
|
}), history.replaceState(null, "", window.location.pathname + window.location.search);
|
|
5216
5235
|
}
|
|
5217
5236
|
ue.current = !0;
|
|
5218
|
-
}, [s, l]),
|
|
5237
|
+
}, [s, l]), B(() => Zr(() => o(Co())), []), B(() => {
|
|
5219
5238
|
function e(e) {
|
|
5220
5239
|
e.key === "." && (e.metaKey || e.ctrlKey) && (e.altKey || e.shiftKey || (e.preventDefault(), N({ type: "toggle" })));
|
|
5221
5240
|
}
|
|
5222
5241
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
5223
|
-
}, [N]),
|
|
5242
|
+
}, [N]), B(() => {
|
|
5224
5243
|
if (M.kind !== "hidden-with-toast") return;
|
|
5225
5244
|
let e = window.setTimeout(() => N({ type: "dismiss-toast" }), 5e3);
|
|
5226
5245
|
return () => window.clearTimeout(e);
|
|
5227
|
-
}, [M.kind, N]),
|
|
5246
|
+
}, [M.kind, N]), B(() => {
|
|
5228
5247
|
let e = null;
|
|
5229
5248
|
function t() {
|
|
5230
5249
|
e ??= requestAnimationFrame(() => {
|
|
@@ -5237,11 +5256,11 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5237
5256
|
window.removeEventListener("scroll", t), window.removeEventListener("resize", t), n.disconnect(), e != null && cancelAnimationFrame(e);
|
|
5238
5257
|
};
|
|
5239
5258
|
}, []);
|
|
5240
|
-
let de =
|
|
5259
|
+
let de = H(() => {
|
|
5241
5260
|
E(), k(), x({ kind: "placing" });
|
|
5242
|
-
}, [E, k]), fe =
|
|
5261
|
+
}, [E, k]), fe = H(() => {
|
|
5243
5262
|
x({ kind: "idle" }), E(), k();
|
|
5244
|
-
}, [E, k]), pe =
|
|
5263
|
+
}, [E, k]), pe = V(0), me = H((e, t, n) => {
|
|
5245
5264
|
let r = t + window.scrollX, a = n + window.scrollY, o = ++pe.current;
|
|
5246
5265
|
if (i?.enabled === !1) {
|
|
5247
5266
|
x({
|
|
@@ -5272,7 +5291,7 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5272
5291
|
strictScrub: i?.strictScrub,
|
|
5273
5292
|
redactSelector: i?.redactSelector
|
|
5274
5293
|
};
|
|
5275
|
-
|
|
5294
|
+
Ma(s, {
|
|
5276
5295
|
x: t,
|
|
5277
5296
|
y: n
|
|
5278
5297
|
}, c).then((e) => {
|
|
@@ -5284,15 +5303,15 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5284
5303
|
screenshotRedactedSelectors: e?.redactedSelectors ?? []
|
|
5285
5304
|
});
|
|
5286
5305
|
});
|
|
5287
|
-
}, [i]), he =
|
|
5306
|
+
}, [i]), he = H((e, t) => {
|
|
5288
5307
|
p({
|
|
5289
5308
|
type: "author-set",
|
|
5290
5309
|
name: e,
|
|
5291
5310
|
email: t
|
|
5292
5311
|
});
|
|
5293
|
-
}, [p]), ge = C.isPending, _e =
|
|
5312
|
+
}, [p]), ge = C.isPending, _e = H(async () => {
|
|
5294
5313
|
await D(async () => {
|
|
5295
|
-
let n =
|
|
5314
|
+
let n = So(await oi({
|
|
5296
5315
|
apiUrl: e,
|
|
5297
5316
|
apiKey: t,
|
|
5298
5317
|
useCookies: m === !0
|
|
@@ -5309,9 +5328,9 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5309
5328
|
m,
|
|
5310
5329
|
D,
|
|
5311
5330
|
p
|
|
5312
|
-
]), ve =
|
|
5331
|
+
]), ve = H(async (e, t) => {
|
|
5313
5332
|
if (b.kind !== "composing-new") return;
|
|
5314
|
-
let n =
|
|
5333
|
+
let n = ai(f);
|
|
5315
5334
|
n && await T(async () => {
|
|
5316
5335
|
let r;
|
|
5317
5336
|
if (t && b.screenshot) {
|
|
@@ -5351,7 +5370,7 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5351
5370
|
b,
|
|
5352
5371
|
a,
|
|
5353
5372
|
T
|
|
5354
|
-
]),
|
|
5373
|
+
]), ye = H(async () => {
|
|
5355
5374
|
if (b.kind !== "thread") return;
|
|
5356
5375
|
let e = b.threadId;
|
|
5357
5376
|
await T(async () => {
|
|
@@ -5361,7 +5380,7 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5361
5380
|
y,
|
|
5362
5381
|
b,
|
|
5363
5382
|
T
|
|
5364
|
-
]),
|
|
5383
|
+
]), F = H(async () => {
|
|
5365
5384
|
if (b.kind !== "thread") return;
|
|
5366
5385
|
let e = b.threadId;
|
|
5367
5386
|
await T(async () => {
|
|
@@ -5372,9 +5391,9 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5372
5391
|
b,
|
|
5373
5392
|
P,
|
|
5374
5393
|
T
|
|
5375
|
-
]), be =
|
|
5394
|
+
]), be = H(async (e) => {
|
|
5376
5395
|
if (b.kind !== "thread") return;
|
|
5377
|
-
let t =
|
|
5396
|
+
let t = ai(f);
|
|
5378
5397
|
if (!t) return;
|
|
5379
5398
|
let n = b.threadId;
|
|
5380
5399
|
await T(async () => {
|
|
@@ -5390,7 +5409,7 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5390
5409
|
f,
|
|
5391
5410
|
b,
|
|
5392
5411
|
T
|
|
5393
|
-
]),
|
|
5412
|
+
]), I = H(async (e, t) => {
|
|
5394
5413
|
if (b.kind !== "thread" || f.kind !== "anon" && f.kind !== "verified") return;
|
|
5395
5414
|
let n = b.threadId;
|
|
5396
5415
|
await T(async () => {
|
|
@@ -5402,7 +5421,7 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5402
5421
|
f,
|
|
5403
5422
|
b,
|
|
5404
5423
|
T
|
|
5405
|
-
]),
|
|
5424
|
+
]), xe = H(async (e) => {
|
|
5406
5425
|
if (b.kind !== "thread" || f.kind !== "anon" && f.kind !== "verified") return;
|
|
5407
5426
|
let t = b.threadId;
|
|
5408
5427
|
await T(async () => {
|
|
@@ -5414,9 +5433,9 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5414
5433
|
f,
|
|
5415
5434
|
b,
|
|
5416
5435
|
T
|
|
5417
|
-
]),
|
|
5436
|
+
]), Se = H(async (e, t) => {
|
|
5418
5437
|
if (b.kind !== "thread") return;
|
|
5419
|
-
let n =
|
|
5438
|
+
let n = ai(f);
|
|
5420
5439
|
if (!n) return;
|
|
5421
5440
|
let r = b.threadId;
|
|
5422
5441
|
await O(async () => {
|
|
@@ -5431,18 +5450,18 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5431
5450
|
f,
|
|
5432
5451
|
b,
|
|
5433
5452
|
O
|
|
5434
|
-
]), L = b.kind === "thread" ? s.find((e) => e._id === b.threadId) ?? null : null, Ce = ae || P != null && P === L?.authorClientId,
|
|
5453
|
+
]), L = b.kind === "thread" ? s.find((e) => e._id === b.threadId) ?? null : null, Ce = ae || P != null && P === L?.authorClientId, R = Me(() => s.map((e) => ({
|
|
5435
5454
|
thread: e,
|
|
5436
|
-
point:
|
|
5455
|
+
point: zr({
|
|
5437
5456
|
anchorX: e.anchorX,
|
|
5438
5457
|
anchorY: e.anchorY,
|
|
5439
5458
|
anchorSelector: e.anchorSelector,
|
|
5440
5459
|
anchorOffsetX: e.anchorOffsetX,
|
|
5441
5460
|
anchorOffsetY: e.anchorOffsetY
|
|
5442
5461
|
})
|
|
5443
|
-
})), [s, te]),
|
|
5444
|
-
return
|
|
5445
|
-
if (!
|
|
5462
|
+
})), [s, te]), we = R.some((e) => !e.point.resolved);
|
|
5463
|
+
return B(() => {
|
|
5464
|
+
if (!we) return;
|
|
5446
5465
|
let e = null;
|
|
5447
5466
|
function t() {
|
|
5448
5467
|
e ??= requestAnimationFrame(() => {
|
|
@@ -5456,7 +5475,7 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5456
5475
|
}), () => {
|
|
5457
5476
|
n.disconnect(), e != null && cancelAnimationFrame(e);
|
|
5458
5477
|
};
|
|
5459
|
-
}, [
|
|
5478
|
+
}, [we]), B(() => {
|
|
5460
5479
|
b.kind === "thread" && L == null && fe();
|
|
5461
5480
|
}, [
|
|
5462
5481
|
b,
|
|
@@ -5468,9 +5487,9 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5468
5487
|
children: [
|
|
5469
5488
|
b.kind === "placing" ? null : /* @__PURE__ */ $("div", {
|
|
5470
5489
|
class: "markup-pins-layer",
|
|
5471
|
-
children: [ee ? null :
|
|
5490
|
+
children: [ee ? null : R.map(({ thread: e, point: t }) => {
|
|
5472
5491
|
let n = b.kind === "thread" && b.threadId === e._id, r = e.comments.reduce((e, t) => e + +!t.deleted, 0);
|
|
5473
|
-
return /* @__PURE__ */ $(
|
|
5492
|
+
return /* @__PURE__ */ $(lo, {
|
|
5474
5493
|
pageX: t.pageX,
|
|
5475
5494
|
pageY: t.pageY,
|
|
5476
5495
|
count: r,
|
|
@@ -5481,16 +5500,16 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5481
5500
|
threadId: e._id
|
|
5482
5501
|
})
|
|
5483
5502
|
}, e._id);
|
|
5484
|
-
}), b.kind === "composing-new" ? /* @__PURE__ */ $(
|
|
5503
|
+
}), b.kind === "composing-new" ? /* @__PURE__ */ $(uo, {
|
|
5485
5504
|
pageX: b.pageX,
|
|
5486
5505
|
pageY: b.pageY
|
|
5487
5506
|
}) : null]
|
|
5488
5507
|
}),
|
|
5489
|
-
b.kind === "placing" ? /* @__PURE__ */ $(
|
|
5508
|
+
b.kind === "placing" ? /* @__PURE__ */ $(fo, {
|
|
5490
5509
|
onPlace: me,
|
|
5491
5510
|
onCancel: fe
|
|
5492
5511
|
}) : null,
|
|
5493
|
-
b.kind === "thread" && L ? /* @__PURE__ */ $(
|
|
5512
|
+
b.kind === "thread" && L ? /* @__PURE__ */ $(ho, {
|
|
5494
5513
|
thread: L,
|
|
5495
5514
|
authorName: ie,
|
|
5496
5515
|
currentClientId: P ?? null,
|
|
@@ -5505,13 +5524,13 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5505
5524
|
onSignIn: _e,
|
|
5506
5525
|
onClose: fe,
|
|
5507
5526
|
onReply: be,
|
|
5508
|
-
onEditComment:
|
|
5509
|
-
onDeleteComment:
|
|
5510
|
-
onToggleReaction:
|
|
5511
|
-
onDelete:
|
|
5512
|
-
onResolve:
|
|
5527
|
+
onEditComment: I,
|
|
5528
|
+
onDeleteComment: xe,
|
|
5529
|
+
onToggleReaction: Se,
|
|
5530
|
+
onDelete: ye,
|
|
5531
|
+
onResolve: F
|
|
5513
5532
|
}, L._id) : null,
|
|
5514
|
-
b.kind === "composing-new" ? /* @__PURE__ */ $(
|
|
5533
|
+
b.kind === "composing-new" ? /* @__PURE__ */ $(so, {
|
|
5515
5534
|
pageX: b.pageX,
|
|
5516
5535
|
pageY: b.pageY,
|
|
5517
5536
|
authorName: ie,
|
|
@@ -5529,7 +5548,7 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5529
5548
|
onSubmit: ve,
|
|
5530
5549
|
onClose: fe
|
|
5531
5550
|
}) : null,
|
|
5532
|
-
!ee || b.kind === "placing" || b.kind === "composing-new" ? /* @__PURE__ */ $(
|
|
5551
|
+
!ee || b.kind === "placing" || b.kind === "composing-new" ? /* @__PURE__ */ $(eo, {
|
|
5533
5552
|
isActive: b.kind === "placing",
|
|
5534
5553
|
onToggle: () => b.kind === "placing" ? fe() : de(),
|
|
5535
5554
|
onHide: () => N({ type: "hide-with-toast" }),
|
|
@@ -5537,11 +5556,11 @@ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
|
|
|
5537
5556
|
onPositionChange: _,
|
|
5538
5557
|
variant: r
|
|
5539
5558
|
}) : null,
|
|
5540
|
-
M.kind === "hidden-with-toast" ? /* @__PURE__ */ $(
|
|
5559
|
+
M.kind === "hidden-with-toast" ? /* @__PURE__ */ $(Oo, { position: g }) : null
|
|
5541
5560
|
]
|
|
5542
5561
|
});
|
|
5543
5562
|
}
|
|
5544
|
-
function
|
|
5563
|
+
function Oo({ position: e }) {
|
|
5545
5564
|
let t = /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent) ? "⌘" : "Ctrl";
|
|
5546
5565
|
return /* @__PURE__ */ $("div", {
|
|
5547
5566
|
class: Q("markup-hud-hidden-toast", e === "bottom-left" ? "markup-hud-hidden-toast-left" : e === "bottom-center" ? "markup-hud-hidden-toast-center" : "markup-hud-hidden-toast-right"),
|
|
@@ -5563,47 +5582,50 @@ function To({ position: e }) {
|
|
|
5563
5582
|
}
|
|
5564
5583
|
//#endregion
|
|
5565
5584
|
//#region src/runtime/mount.tsx
|
|
5566
|
-
function
|
|
5585
|
+
function ko(e, t) {
|
|
5567
5586
|
e.style.position = "fixed", e.style.inset = "0", e.style.zIndex = "2147483647", e.style.pointerEvents = "none";
|
|
5568
5587
|
let n = t.theme ?? "auto";
|
|
5569
5588
|
n !== "auto" && (e.dataset.theme = n);
|
|
5570
5589
|
let r = e.attachShadow({ mode: "open" }), i = document.createElement("style");
|
|
5571
5590
|
i.textContent = ue, r.appendChild(i);
|
|
5572
5591
|
let a = document.createElement("div");
|
|
5573
|
-
a.className = "markup-shadow-root", r.appendChild(a)
|
|
5574
|
-
let o = {
|
|
5592
|
+
a.className = "markup-shadow-root", r.appendChild(a), ye({
|
|
5575
5593
|
apiUrl: t.apiUrl,
|
|
5576
|
-
apiKey: t.apiKey
|
|
5577
|
-
|
|
5594
|
+
apiKey: t.apiKey,
|
|
5595
|
+
widgetVersion: "1.10.0"
|
|
5596
|
+
});
|
|
5597
|
+
let { theme: o, ...s } = t;
|
|
5578
5598
|
return le(/* @__PURE__ */ $(de, {
|
|
5579
|
-
onError: (e) =>
|
|
5580
|
-
children: /* @__PURE__ */ $(
|
|
5581
|
-
}), a), () =>
|
|
5599
|
+
onError: (e) => F(e, { context: "render" }),
|
|
5600
|
+
children: /* @__PURE__ */ $(Do, { ...s })
|
|
5601
|
+
}), a), () => {
|
|
5602
|
+
ye(null), le(null, a);
|
|
5603
|
+
};
|
|
5582
5604
|
}
|
|
5583
5605
|
//#endregion
|
|
5584
5606
|
//#region src/widget.ts
|
|
5585
|
-
var
|
|
5586
|
-
function
|
|
5607
|
+
var Ao = null, jo = null, Mo = null;
|
|
5608
|
+
function No(e) {
|
|
5587
5609
|
if (!e.apiUrl || !e.apiKey) return console.warn("[markup] init() requires both apiUrl and apiKey — widget not mounted"), () => {};
|
|
5588
|
-
|
|
5610
|
+
Po();
|
|
5589
5611
|
let t = () => {
|
|
5590
|
-
if (
|
|
5612
|
+
if (Mo = null, !document.body) return;
|
|
5591
5613
|
let t = document.createElement("div");
|
|
5592
|
-
t.id = "markup-widget", document.body.appendChild(t),
|
|
5614
|
+
t.id = "markup-widget", document.body.appendChild(t), jo = t, Ao = ko(t, e);
|
|
5593
5615
|
};
|
|
5594
5616
|
if (document.readyState === "loading" || !document.body) {
|
|
5595
5617
|
let e = () => t();
|
|
5596
|
-
|
|
5618
|
+
Mo = () => document.removeEventListener("DOMContentLoaded", e), document.addEventListener("DOMContentLoaded", e, { once: !0 });
|
|
5597
5619
|
} else t();
|
|
5598
|
-
return
|
|
5620
|
+
return Po;
|
|
5599
5621
|
}
|
|
5600
|
-
function
|
|
5601
|
-
|
|
5622
|
+
function Po() {
|
|
5623
|
+
Mo &&= (Mo(), null), Ao &&= (Ao(), null), jo?.parentNode && jo.parentNode.removeChild(jo), jo = null;
|
|
5602
5624
|
}
|
|
5603
5625
|
if (typeof document < "u") {
|
|
5604
5626
|
let e = document.currentScript ?? document.querySelector("script[data-markup-widget=\"true\"]"), t = e?.dataset.apiUrl, n = e?.dataset.apiKey;
|
|
5605
5627
|
if (t && n) {
|
|
5606
|
-
let r = e?.dataset.position, i = e?.dataset.theme, a = e?.dataset.fab, o = () =>
|
|
5628
|
+
let r = e?.dataset.position, i = e?.dataset.theme, a = e?.dataset.fab, o = () => No({
|
|
5607
5629
|
apiUrl: t,
|
|
5608
5630
|
apiKey: n,
|
|
5609
5631
|
position: r,
|
|
@@ -5614,6 +5636,6 @@ if (typeof document < "u") {
|
|
|
5614
5636
|
}
|
|
5615
5637
|
}
|
|
5616
5638
|
//#endregion
|
|
5617
|
-
export {
|
|
5639
|
+
export { Po as destroy, No as init };
|
|
5618
5640
|
|
|
5619
5641
|
//# sourceMappingURL=widget.js.map
|