@placemarkio/polyline 1.1.1 → 2.0.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.
@@ -0,0 +1,2224 @@
1
+ (() => {
2
+ var Qe = Object.create;
3
+ var ae = Object.defineProperty;
4
+ var Pe = Object.getOwnPropertyDescriptor;
5
+ var Ce = Object.getOwnPropertyNames;
6
+ var Oe = Object.getPrototypeOf,
7
+ Re = Object.prototype.hasOwnProperty;
8
+ var _e = (t, e) => () => (
9
+ e || t((e = { exports: {} }).exports, e), e.exports
10
+ );
11
+ var Me = (t, e, n, r) => {
12
+ if ((e && typeof e == "object") || typeof e == "function")
13
+ for (const i of Ce(e))
14
+ !Re.call(t, i) &&
15
+ i !== n &&
16
+ ae(t, i, {
17
+ get: () => e[i],
18
+ enumerable: !(r = Pe(e, i)) || r.enumerable,
19
+ });
20
+ return t;
21
+ };
22
+ var De = (t, e, n) => (
23
+ (n = t != null ? Qe(Oe(t)) : {}),
24
+ Me(
25
+ e || !t || !t.__esModule
26
+ ? ae(n, "default", { value: t, enumerable: !0 })
27
+ : n,
28
+ t,
29
+ )
30
+ );
31
+ var de = _e((ce, he) => {
32
+ (function () {
33
+ var t = (e) => {
34
+ var n = new t.Builder();
35
+ return (
36
+ n.pipeline.add(t.trimmer, t.stopWordFilter, t.stemmer),
37
+ n.searchPipeline.add(t.stemmer),
38
+ e.call(n, n),
39
+ n.build()
40
+ );
41
+ };
42
+ t.version = "2.3.9";
43
+ (t.utils = {}),
44
+ (t.utils.warn = ((e) => (n) => {
45
+ e.console && console.warn && console.warn(n);
46
+ })(this)),
47
+ (t.utils.asString = (e) => (e == null ? "" : e.toString())),
48
+ (t.utils.clone = (e) => {
49
+ if (e == null) return e;
50
+ for (
51
+ var n = Object.create(null), r = Object.keys(e), i = 0;
52
+ i < r.length;
53
+ i++
54
+ ) {
55
+ var s = r[i],
56
+ o = e[s];
57
+ if (Array.isArray(o)) {
58
+ n[s] = o.slice();
59
+ continue;
60
+ }
61
+ if (
62
+ typeof o == "string" ||
63
+ typeof o == "number" ||
64
+ typeof o == "boolean"
65
+ ) {
66
+ n[s] = o;
67
+ continue;
68
+ }
69
+ throw new TypeError(
70
+ "clone is not deep and does not support nested objects",
71
+ );
72
+ }
73
+ return n;
74
+ }),
75
+ (t.FieldRef = function (e, n, r) {
76
+ (this.docRef = e), (this.fieldName = n), (this._stringValue = r);
77
+ }),
78
+ (t.FieldRef.joiner = "/"),
79
+ (t.FieldRef.fromString = (e) => {
80
+ var n = e.indexOf(t.FieldRef.joiner);
81
+ if (n === -1) throw "malformed field ref string";
82
+ var r = e.slice(0, n),
83
+ i = e.slice(n + 1);
84
+ return new t.FieldRef(i, r, e);
85
+ }),
86
+ (t.FieldRef.prototype.toString = function () {
87
+ return (
88
+ this._stringValue == null &&
89
+ (this._stringValue =
90
+ this.fieldName + t.FieldRef.joiner + this.docRef),
91
+ this._stringValue
92
+ );
93
+ });
94
+ (t.Set = function (e) {
95
+ if (((this.elements = Object.create(null)), e)) {
96
+ this.length = e.length;
97
+ for (var n = 0; n < this.length; n++) this.elements[e[n]] = !0;
98
+ } else this.length = 0;
99
+ }),
100
+ (t.Set.complete = {
101
+ intersect: (e) => e,
102
+ union: function () {
103
+ return this;
104
+ },
105
+ contains: () => !0,
106
+ }),
107
+ (t.Set.empty = {
108
+ intersect: function () {
109
+ return this;
110
+ },
111
+ union: (e) => e,
112
+ contains: () => !1,
113
+ }),
114
+ (t.Set.prototype.contains = function (e) {
115
+ return !!this.elements[e];
116
+ }),
117
+ (t.Set.prototype.intersect = function (e) {
118
+ var n,
119
+ r,
120
+ i,
121
+ s = [];
122
+ if (e === t.Set.complete) return this;
123
+ if (e === t.Set.empty) return e;
124
+ this.length < e.length
125
+ ? ((n = this), (r = e))
126
+ : ((n = e), (r = this)),
127
+ (i = Object.keys(n.elements));
128
+ for (var o = 0; o < i.length; o++) {
129
+ var a = i[o];
130
+ a in r.elements && s.push(a);
131
+ }
132
+ return new t.Set(s);
133
+ }),
134
+ (t.Set.prototype.union = function (e) {
135
+ return e === t.Set.complete
136
+ ? t.Set.complete
137
+ : e === t.Set.empty
138
+ ? this
139
+ : new t.Set(
140
+ Object.keys(this.elements).concat(Object.keys(e.elements)),
141
+ );
142
+ }),
143
+ (t.idf = (e, n) => {
144
+ var r = 0;
145
+ for (var i in e) i != "_index" && (r += Object.keys(e[i]).length);
146
+ var s = (n - r + 0.5) / (r + 0.5);
147
+ return Math.log(1 + Math.abs(s));
148
+ }),
149
+ (t.Token = function (e, n) {
150
+ (this.str = e || ""), (this.metadata = n || {});
151
+ }),
152
+ (t.Token.prototype.toString = function () {
153
+ return this.str;
154
+ }),
155
+ (t.Token.prototype.update = function (e) {
156
+ return (this.str = e(this.str, this.metadata)), this;
157
+ }),
158
+ (t.Token.prototype.clone = function (e) {
159
+ return (
160
+ (e = e || ((n) => n)),
161
+ new t.Token(e(this.str, this.metadata), this.metadata)
162
+ );
163
+ });
164
+ (t.tokenizer = (e, n) => {
165
+ if (e == null || e == null) return [];
166
+ if (Array.isArray(e))
167
+ return e.map(
168
+ (m) =>
169
+ new t.Token(t.utils.asString(m).toLowerCase(), t.utils.clone(n)),
170
+ );
171
+ for (
172
+ var r = e.toString().toLowerCase(),
173
+ i = r.length,
174
+ s = [],
175
+ o = 0,
176
+ a = 0;
177
+ o <= i;
178
+ o++
179
+ ) {
180
+ var u = r.charAt(o),
181
+ l = o - a;
182
+ if (u.match(t.tokenizer.separator) || o == i) {
183
+ if (l > 0) {
184
+ var h = t.utils.clone(n) || {};
185
+ (h.position = [a, l]),
186
+ (h.index = s.length),
187
+ s.push(new t.Token(r.slice(a, o), h));
188
+ }
189
+ a = o + 1;
190
+ }
191
+ }
192
+ return s;
193
+ }),
194
+ (t.tokenizer.separator = /[\s-]+/);
195
+ (t.Pipeline = function () {
196
+ this._stack = [];
197
+ }),
198
+ (t.Pipeline.registeredFunctions = Object.create(null)),
199
+ (t.Pipeline.registerFunction = function (e, n) {
200
+ n in this.registeredFunctions &&
201
+ t.utils.warn("Overwriting existing registered function: " + n),
202
+ (e.label = n),
203
+ (t.Pipeline.registeredFunctions[e.label] = e);
204
+ }),
205
+ (t.Pipeline.warnIfFunctionNotRegistered = function (e) {
206
+ var n = e.label && e.label in this.registeredFunctions;
207
+ n ||
208
+ t.utils.warn(
209
+ `Function is not registered with pipeline. This may cause problems when serialising the index.
210
+ `,
211
+ e,
212
+ );
213
+ }),
214
+ (t.Pipeline.load = (e) => {
215
+ var n = new t.Pipeline();
216
+ return (
217
+ e.forEach((r) => {
218
+ var i = t.Pipeline.registeredFunctions[r];
219
+ if (i) n.add(i);
220
+ else throw new Error("Cannot load unregistered function: " + r);
221
+ }),
222
+ n
223
+ );
224
+ }),
225
+ (t.Pipeline.prototype.add = function () {
226
+ var e = Array.prototype.slice.call(arguments);
227
+ e.forEach(function (n) {
228
+ t.Pipeline.warnIfFunctionNotRegistered(n), this._stack.push(n);
229
+ }, this);
230
+ }),
231
+ (t.Pipeline.prototype.after = function (e, n) {
232
+ t.Pipeline.warnIfFunctionNotRegistered(n);
233
+ var r = this._stack.indexOf(e);
234
+ if (r == -1) throw new Error("Cannot find existingFn");
235
+ (r = r + 1), this._stack.splice(r, 0, n);
236
+ }),
237
+ (t.Pipeline.prototype.before = function (e, n) {
238
+ t.Pipeline.warnIfFunctionNotRegistered(n);
239
+ var r = this._stack.indexOf(e);
240
+ if (r == -1) throw new Error("Cannot find existingFn");
241
+ this._stack.splice(r, 0, n);
242
+ }),
243
+ (t.Pipeline.prototype.remove = function (e) {
244
+ var n = this._stack.indexOf(e);
245
+ n != -1 && this._stack.splice(n, 1);
246
+ }),
247
+ (t.Pipeline.prototype.run = function (e) {
248
+ for (var n = this._stack.length, r = 0; r < n; r++) {
249
+ for (var i = this._stack[r], s = [], o = 0; o < e.length; o++) {
250
+ var a = i(e[o], o, e);
251
+ if (!(a == null || a === ""))
252
+ if (Array.isArray(a))
253
+ for (var u = 0; u < a.length; u++) s.push(a[u]);
254
+ else s.push(a);
255
+ }
256
+ e = s;
257
+ }
258
+ return e;
259
+ }),
260
+ (t.Pipeline.prototype.runString = function (e, n) {
261
+ var r = new t.Token(e, n);
262
+ return this.run([r]).map((i) => i.toString());
263
+ }),
264
+ (t.Pipeline.prototype.reset = function () {
265
+ this._stack = [];
266
+ }),
267
+ (t.Pipeline.prototype.toJSON = function () {
268
+ return this._stack.map(
269
+ (e) => (t.Pipeline.warnIfFunctionNotRegistered(e), e.label),
270
+ );
271
+ });
272
+ (t.Vector = function (e) {
273
+ (this._magnitude = 0), (this.elements = e || []);
274
+ }),
275
+ (t.Vector.prototype.positionForIndex = function (e) {
276
+ if (this.elements.length == 0) return 0;
277
+ for (
278
+ var n = 0,
279
+ r = this.elements.length / 2,
280
+ i = r - n,
281
+ s = Math.floor(i / 2),
282
+ o = this.elements[s * 2];
283
+ i > 1 && (o < e && (n = s), o > e && (r = s), o != e);
284
+ )
285
+ (i = r - n),
286
+ (s = n + Math.floor(i / 2)),
287
+ (o = this.elements[s * 2]);
288
+ if (o == e || o > e) return s * 2;
289
+ if (o < e) return (s + 1) * 2;
290
+ }),
291
+ (t.Vector.prototype.insert = function (e, n) {
292
+ this.upsert(e, n, () => {
293
+ throw "duplicate index";
294
+ });
295
+ }),
296
+ (t.Vector.prototype.upsert = function (e, n, r) {
297
+ this._magnitude = 0;
298
+ var i = this.positionForIndex(e);
299
+ this.elements[i] == e
300
+ ? (this.elements[i + 1] = r(this.elements[i + 1], n))
301
+ : this.elements.splice(i, 0, e, n);
302
+ }),
303
+ (t.Vector.prototype.magnitude = function () {
304
+ if (this._magnitude) return this._magnitude;
305
+ for (var e = 0, n = this.elements.length, r = 1; r < n; r += 2) {
306
+ var i = this.elements[r];
307
+ e += i * i;
308
+ }
309
+ return (this._magnitude = Math.sqrt(e));
310
+ }),
311
+ (t.Vector.prototype.dot = function (e) {
312
+ for (
313
+ var n = 0,
314
+ r = this.elements,
315
+ i = e.elements,
316
+ s = r.length,
317
+ o = i.length,
318
+ a = 0,
319
+ u = 0,
320
+ l = 0,
321
+ h = 0;
322
+ l < s && h < o;
323
+ )
324
+ (a = r[l]),
325
+ (u = i[h]),
326
+ a < u
327
+ ? (l += 2)
328
+ : a > u
329
+ ? (h += 2)
330
+ : a == u && ((n += r[l + 1] * i[h + 1]), (l += 2), (h += 2));
331
+ return n;
332
+ }),
333
+ (t.Vector.prototype.similarity = function (e) {
334
+ return this.dot(e) / this.magnitude() || 0;
335
+ }),
336
+ (t.Vector.prototype.toArray = function () {
337
+ for (
338
+ var e = new Array(this.elements.length / 2), n = 1, r = 0;
339
+ n < this.elements.length;
340
+ n += 2, r++
341
+ )
342
+ e[r] = this.elements[n];
343
+ return e;
344
+ }),
345
+ (t.Vector.prototype.toJSON = function () {
346
+ return this.elements;
347
+ });
348
+ (t.stemmer = (() => {
349
+ var e = {
350
+ ational: "ate",
351
+ tional: "tion",
352
+ enci: "ence",
353
+ anci: "ance",
354
+ izer: "ize",
355
+ bli: "ble",
356
+ alli: "al",
357
+ entli: "ent",
358
+ eli: "e",
359
+ ousli: "ous",
360
+ ization: "ize",
361
+ ation: "ate",
362
+ ator: "ate",
363
+ alism: "al",
364
+ iveness: "ive",
365
+ fulness: "ful",
366
+ ousness: "ous",
367
+ aliti: "al",
368
+ iviti: "ive",
369
+ biliti: "ble",
370
+ logi: "log",
371
+ },
372
+ n = {
373
+ icate: "ic",
374
+ ative: "",
375
+ alize: "al",
376
+ iciti: "ic",
377
+ ical: "ic",
378
+ ful: "",
379
+ ness: "",
380
+ },
381
+ r = "[^aeiou]",
382
+ i = "[aeiouy]",
383
+ s = r + "[^aeiouy]*",
384
+ o = i + "[aeiou]*",
385
+ a = "^(" + s + ")?" + o + s,
386
+ u = "^(" + s + ")?" + o + s + "(" + o + ")?$",
387
+ l = "^(" + s + ")?" + o + s + o + s,
388
+ h = "^(" + s + ")?" + i,
389
+ m = new RegExp(a),
390
+ v = new RegExp(l),
391
+ b = new RegExp(u),
392
+ y = new RegExp(h),
393
+ E = /^(.+?)(ss|i)es$/,
394
+ p = /^(.+?)([^s])s$/,
395
+ f = /^(.+?)eed$/,
396
+ S = /^(.+?)(ed|ing)$/,
397
+ w = /.$/,
398
+ k = /(at|bl|iz)$/,
399
+ _ = /([^aeiouylsz])\1$/,
400
+ z = new RegExp("^" + s + i + "[^aeiouwxy]$"),
401
+ H = /^(.+?[^aeiou])y$/,
402
+ q =
403
+ /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,
404
+ $ = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,
405
+ V =
406
+ /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,
407
+ W = /^(.+?)(s|t)(ion)$/,
408
+ P = /^(.+?)e$/,
409
+ U = /ll$/,
410
+ G = new RegExp("^" + s + i + "[^aeiouwxy]$"),
411
+ N = (c) => {
412
+ var g, C, T, d, x, O, D;
413
+ if (c.length < 3) return c;
414
+ if (
415
+ ((T = c.substr(0, 1)),
416
+ T == "y" && (c = T.toUpperCase() + c.substr(1)),
417
+ (d = E),
418
+ (x = p),
419
+ d.test(c)
420
+ ? (c = c.replace(d, "$1$2"))
421
+ : x.test(c) && (c = c.replace(x, "$1$2")),
422
+ (d = f),
423
+ (x = S),
424
+ d.test(c))
425
+ ) {
426
+ var L = d.exec(c);
427
+ (d = m), d.test(L[1]) && ((d = w), (c = c.replace(d, "")));
428
+ } else if (x.test(c)) {
429
+ var L = x.exec(c);
430
+ (g = L[1]),
431
+ (x = y),
432
+ x.test(g) &&
433
+ ((c = g),
434
+ (x = k),
435
+ (O = _),
436
+ (D = z),
437
+ x.test(c)
438
+ ? (c = c + "e")
439
+ : O.test(c)
440
+ ? ((d = w), (c = c.replace(d, "")))
441
+ : D.test(c) && (c = c + "e"));
442
+ }
443
+ if (((d = H), d.test(c))) {
444
+ var L = d.exec(c);
445
+ (g = L[1]), (c = g + "i");
446
+ }
447
+ if (((d = q), d.test(c))) {
448
+ var L = d.exec(c);
449
+ (g = L[1]), (C = L[2]), (d = m), d.test(g) && (c = g + e[C]);
450
+ }
451
+ if (((d = $), d.test(c))) {
452
+ var L = d.exec(c);
453
+ (g = L[1]), (C = L[2]), (d = m), d.test(g) && (c = g + n[C]);
454
+ }
455
+ if (((d = V), (x = W), d.test(c))) {
456
+ var L = d.exec(c);
457
+ (g = L[1]), (d = v), d.test(g) && (c = g);
458
+ } else if (x.test(c)) {
459
+ var L = x.exec(c);
460
+ (g = L[1] + L[2]), (x = v), x.test(g) && (c = g);
461
+ }
462
+ if (((d = P), d.test(c))) {
463
+ var L = d.exec(c);
464
+ (g = L[1]),
465
+ (d = v),
466
+ (x = b),
467
+ (O = G),
468
+ (d.test(g) || (x.test(g) && !O.test(g))) && (c = g);
469
+ }
470
+ return (
471
+ (d = U),
472
+ (x = v),
473
+ d.test(c) && x.test(c) && ((d = w), (c = c.replace(d, ""))),
474
+ T == "y" && (c = T.toLowerCase() + c.substr(1)),
475
+ c
476
+ );
477
+ };
478
+ return (M) => M.update(N);
479
+ })()),
480
+ t.Pipeline.registerFunction(t.stemmer, "stemmer");
481
+ (t.generateStopWordFilter = (e) => {
482
+ var n = e.reduce((r, i) => ((r[i] = i), r), {});
483
+ return (r) => {
484
+ if (r && n[r.toString()] !== r.toString()) return r;
485
+ };
486
+ }),
487
+ (t.stopWordFilter = t.generateStopWordFilter([
488
+ "a",
489
+ "able",
490
+ "about",
491
+ "across",
492
+ "after",
493
+ "all",
494
+ "almost",
495
+ "also",
496
+ "am",
497
+ "among",
498
+ "an",
499
+ "and",
500
+ "any",
501
+ "are",
502
+ "as",
503
+ "at",
504
+ "be",
505
+ "because",
506
+ "been",
507
+ "but",
508
+ "by",
509
+ "can",
510
+ "cannot",
511
+ "could",
512
+ "dear",
513
+ "did",
514
+ "do",
515
+ "does",
516
+ "either",
517
+ "else",
518
+ "ever",
519
+ "every",
520
+ "for",
521
+ "from",
522
+ "get",
523
+ "got",
524
+ "had",
525
+ "has",
526
+ "have",
527
+ "he",
528
+ "her",
529
+ "hers",
530
+ "him",
531
+ "his",
532
+ "how",
533
+ "however",
534
+ "i",
535
+ "if",
536
+ "in",
537
+ "into",
538
+ "is",
539
+ "it",
540
+ "its",
541
+ "just",
542
+ "least",
543
+ "let",
544
+ "like",
545
+ "likely",
546
+ "may",
547
+ "me",
548
+ "might",
549
+ "most",
550
+ "must",
551
+ "my",
552
+ "neither",
553
+ "no",
554
+ "nor",
555
+ "not",
556
+ "of",
557
+ "off",
558
+ "often",
559
+ "on",
560
+ "only",
561
+ "or",
562
+ "other",
563
+ "our",
564
+ "own",
565
+ "rather",
566
+ "said",
567
+ "say",
568
+ "says",
569
+ "she",
570
+ "should",
571
+ "since",
572
+ "so",
573
+ "some",
574
+ "than",
575
+ "that",
576
+ "the",
577
+ "their",
578
+ "them",
579
+ "then",
580
+ "there",
581
+ "these",
582
+ "they",
583
+ "this",
584
+ "tis",
585
+ "to",
586
+ "too",
587
+ "twas",
588
+ "us",
589
+ "wants",
590
+ "was",
591
+ "we",
592
+ "were",
593
+ "what",
594
+ "when",
595
+ "where",
596
+ "which",
597
+ "while",
598
+ "who",
599
+ "whom",
600
+ "why",
601
+ "will",
602
+ "with",
603
+ "would",
604
+ "yet",
605
+ "you",
606
+ "your",
607
+ ])),
608
+ t.Pipeline.registerFunction(t.stopWordFilter, "stopWordFilter");
609
+ (t.trimmer = (e) =>
610
+ e.update((n) => n.replace(/^\W+/, "").replace(/\W+$/, ""))),
611
+ t.Pipeline.registerFunction(t.trimmer, "trimmer");
612
+ (t.TokenSet = function () {
613
+ (this.final = !1),
614
+ (this.edges = {}),
615
+ (this.id = t.TokenSet._nextId),
616
+ (t.TokenSet._nextId += 1);
617
+ }),
618
+ (t.TokenSet._nextId = 1),
619
+ (t.TokenSet.fromArray = (e) => {
620
+ for (
621
+ var n = new t.TokenSet.Builder(), r = 0, i = e.length;
622
+ r < i;
623
+ r++
624
+ )
625
+ n.insert(e[r]);
626
+ return n.finish(), n.root;
627
+ }),
628
+ (t.TokenSet.fromClause = (e) =>
629
+ "editDistance" in e
630
+ ? t.TokenSet.fromFuzzyString(e.term, e.editDistance)
631
+ : t.TokenSet.fromString(e.term)),
632
+ (t.TokenSet.fromFuzzyString = (e, n) => {
633
+ for (
634
+ var r = new t.TokenSet(),
635
+ i = [{ node: r, editsRemaining: n, str: e }];
636
+ i.length;
637
+ ) {
638
+ var s = i.pop();
639
+ if (s.str.length > 0) {
640
+ var o = s.str.charAt(0),
641
+ a;
642
+ o in s.node.edges
643
+ ? (a = s.node.edges[o])
644
+ : ((a = new t.TokenSet()), (s.node.edges[o] = a)),
645
+ s.str.length == 1 && (a.final = !0),
646
+ i.push({
647
+ node: a,
648
+ editsRemaining: s.editsRemaining,
649
+ str: s.str.slice(1),
650
+ });
651
+ }
652
+ if (s.editsRemaining != 0) {
653
+ if ("*" in s.node.edges) var u = s.node.edges["*"];
654
+ else {
655
+ var u = new t.TokenSet();
656
+ s.node.edges["*"] = u;
657
+ }
658
+ if (
659
+ (s.str.length == 0 && (u.final = !0),
660
+ i.push({
661
+ node: u,
662
+ editsRemaining: s.editsRemaining - 1,
663
+ str: s.str,
664
+ }),
665
+ s.str.length > 1 &&
666
+ i.push({
667
+ node: s.node,
668
+ editsRemaining: s.editsRemaining - 1,
669
+ str: s.str.slice(1),
670
+ }),
671
+ s.str.length == 1 && (s.node.final = !0),
672
+ s.str.length >= 1)
673
+ ) {
674
+ if ("*" in s.node.edges) var l = s.node.edges["*"];
675
+ else {
676
+ var l = new t.TokenSet();
677
+ s.node.edges["*"] = l;
678
+ }
679
+ s.str.length == 1 && (l.final = !0),
680
+ i.push({
681
+ node: l,
682
+ editsRemaining: s.editsRemaining - 1,
683
+ str: s.str.slice(1),
684
+ });
685
+ }
686
+ if (s.str.length > 1) {
687
+ var h = s.str.charAt(0),
688
+ m = s.str.charAt(1),
689
+ v;
690
+ m in s.node.edges
691
+ ? (v = s.node.edges[m])
692
+ : ((v = new t.TokenSet()), (s.node.edges[m] = v)),
693
+ s.str.length == 1 && (v.final = !0),
694
+ i.push({
695
+ node: v,
696
+ editsRemaining: s.editsRemaining - 1,
697
+ str: h + s.str.slice(2),
698
+ });
699
+ }
700
+ }
701
+ }
702
+ return r;
703
+ }),
704
+ (t.TokenSet.fromString = (e) => {
705
+ for (
706
+ var n = new t.TokenSet(), r = n, i = 0, s = e.length;
707
+ i < s;
708
+ i++
709
+ ) {
710
+ var o = e[i],
711
+ a = i == s - 1;
712
+ if (o == "*") (n.edges[o] = n), (n.final = a);
713
+ else {
714
+ var u = new t.TokenSet();
715
+ (u.final = a), (n.edges[o] = u), (n = u);
716
+ }
717
+ }
718
+ return r;
719
+ }),
720
+ (t.TokenSet.prototype.toArray = function () {
721
+ for (var e = [], n = [{ prefix: "", node: this }]; n.length; ) {
722
+ var r = n.pop(),
723
+ i = Object.keys(r.node.edges),
724
+ s = i.length;
725
+ r.node.final && (r.prefix.charAt(0), e.push(r.prefix));
726
+ for (var o = 0; o < s; o++) {
727
+ var a = i[o];
728
+ n.push({ prefix: r.prefix.concat(a), node: r.node.edges[a] });
729
+ }
730
+ }
731
+ return e;
732
+ }),
733
+ (t.TokenSet.prototype.toString = function () {
734
+ if (this._str) return this._str;
735
+ for (
736
+ var e = this.final ? "1" : "0",
737
+ n = Object.keys(this.edges).sort(),
738
+ r = n.length,
739
+ i = 0;
740
+ i < r;
741
+ i++
742
+ ) {
743
+ var s = n[i],
744
+ o = this.edges[s];
745
+ e = e + s + o.id;
746
+ }
747
+ return e;
748
+ }),
749
+ (t.TokenSet.prototype.intersect = function (e) {
750
+ for (
751
+ var n = new t.TokenSet(),
752
+ r = void 0,
753
+ i = [{ qNode: e, output: n, node: this }];
754
+ i.length;
755
+ ) {
756
+ r = i.pop();
757
+ for (
758
+ var s = Object.keys(r.qNode.edges),
759
+ o = s.length,
760
+ a = Object.keys(r.node.edges),
761
+ u = a.length,
762
+ l = 0;
763
+ l < o;
764
+ l++
765
+ )
766
+ for (var h = s[l], m = 0; m < u; m++) {
767
+ var v = a[m];
768
+ if (v == h || h == "*") {
769
+ var b = r.node.edges[v],
770
+ y = r.qNode.edges[h],
771
+ E = b.final && y.final,
772
+ p = void 0;
773
+ v in r.output.edges
774
+ ? ((p = r.output.edges[v]), (p.final = p.final || E))
775
+ : ((p = new t.TokenSet()),
776
+ (p.final = E),
777
+ (r.output.edges[v] = p)),
778
+ i.push({ qNode: y, output: p, node: b });
779
+ }
780
+ }
781
+ }
782
+ return n;
783
+ }),
784
+ (t.TokenSet.Builder = function () {
785
+ (this.previousWord = ""),
786
+ (this.root = new t.TokenSet()),
787
+ (this.uncheckedNodes = []),
788
+ (this.minimizedNodes = {});
789
+ }),
790
+ (t.TokenSet.Builder.prototype.insert = function (e) {
791
+ var n,
792
+ r = 0;
793
+ if (e < this.previousWord)
794
+ throw new Error("Out of order word insertion");
795
+ for (
796
+ var i = 0;
797
+ i < e.length &&
798
+ i < this.previousWord.length &&
799
+ e[i] == this.previousWord[i];
800
+ i++
801
+ )
802
+ r++;
803
+ this.minimize(r),
804
+ this.uncheckedNodes.length == 0
805
+ ? (n = this.root)
806
+ : (n = this.uncheckedNodes[this.uncheckedNodes.length - 1].child);
807
+ for (var i = r; i < e.length; i++) {
808
+ var s = new t.TokenSet(),
809
+ o = e[i];
810
+ (n.edges[o] = s),
811
+ this.uncheckedNodes.push({ parent: n, char: o, child: s }),
812
+ (n = s);
813
+ }
814
+ (n.final = !0), (this.previousWord = e);
815
+ }),
816
+ (t.TokenSet.Builder.prototype.finish = function () {
817
+ this.minimize(0);
818
+ }),
819
+ (t.TokenSet.Builder.prototype.minimize = function (e) {
820
+ for (var n = this.uncheckedNodes.length - 1; n >= e; n--) {
821
+ var r = this.uncheckedNodes[n],
822
+ i = r.child.toString();
823
+ i in this.minimizedNodes
824
+ ? (r.parent.edges[r.char] = this.minimizedNodes[i])
825
+ : ((r.child._str = i), (this.minimizedNodes[i] = r.child)),
826
+ this.uncheckedNodes.pop();
827
+ }
828
+ });
829
+ (t.Index = function (e) {
830
+ (this.invertedIndex = e.invertedIndex),
831
+ (this.fieldVectors = e.fieldVectors),
832
+ (this.tokenSet = e.tokenSet),
833
+ (this.fields = e.fields),
834
+ (this.pipeline = e.pipeline);
835
+ }),
836
+ (t.Index.prototype.search = function (e) {
837
+ return this.query((n) => {
838
+ var r = new t.QueryParser(e, n);
839
+ r.parse();
840
+ });
841
+ }),
842
+ (t.Index.prototype.query = function (e) {
843
+ for (
844
+ var n = new t.Query(this.fields),
845
+ r = Object.create(null),
846
+ i = Object.create(null),
847
+ s = Object.create(null),
848
+ o = Object.create(null),
849
+ a = Object.create(null),
850
+ u = 0;
851
+ u < this.fields.length;
852
+ u++
853
+ )
854
+ i[this.fields[u]] = new t.Vector();
855
+ e.call(n, n);
856
+ for (var u = 0; u < n.clauses.length; u++) {
857
+ var l = n.clauses[u],
858
+ h = null,
859
+ m = t.Set.empty;
860
+ l.usePipeline
861
+ ? (h = this.pipeline.runString(l.term, { fields: l.fields }))
862
+ : (h = [l.term]);
863
+ for (var v = 0; v < h.length; v++) {
864
+ var b = h[v];
865
+ l.term = b;
866
+ var y = t.TokenSet.fromClause(l),
867
+ E = this.tokenSet.intersect(y).toArray();
868
+ if (E.length === 0 && l.presence === t.Query.presence.REQUIRED) {
869
+ for (var p = 0; p < l.fields.length; p++) {
870
+ var f = l.fields[p];
871
+ o[f] = t.Set.empty;
872
+ }
873
+ break;
874
+ }
875
+ for (var S = 0; S < E.length; S++)
876
+ for (
877
+ var w = E[S], k = this.invertedIndex[w], _ = k._index, p = 0;
878
+ p < l.fields.length;
879
+ p++
880
+ ) {
881
+ var f = l.fields[p],
882
+ z = k[f],
883
+ H = Object.keys(z),
884
+ q = w + "/" + f,
885
+ $ = new t.Set(H);
886
+ if (
887
+ (l.presence == t.Query.presence.REQUIRED &&
888
+ ((m = m.union($)),
889
+ o[f] === void 0 && (o[f] = t.Set.complete)),
890
+ l.presence == t.Query.presence.PROHIBITED)
891
+ ) {
892
+ a[f] === void 0 && (a[f] = t.Set.empty),
893
+ (a[f] = a[f].union($));
894
+ continue;
895
+ }
896
+ if ((i[f].upsert(_, l.boost, (Ie, ke) => Ie + ke), !s[q])) {
897
+ for (var V = 0; V < H.length; V++) {
898
+ var W = H[V],
899
+ P = new t.FieldRef(W, f),
900
+ U = z[W],
901
+ G;
902
+ (G = r[P]) === void 0
903
+ ? (r[P] = new t.MatchData(w, f, U))
904
+ : G.add(w, f, U);
905
+ }
906
+ s[q] = !0;
907
+ }
908
+ }
909
+ }
910
+ if (l.presence === t.Query.presence.REQUIRED)
911
+ for (var p = 0; p < l.fields.length; p++) {
912
+ var f = l.fields[p];
913
+ o[f] = o[f].intersect(m);
914
+ }
915
+ }
916
+ for (
917
+ var N = t.Set.complete, M = t.Set.empty, u = 0;
918
+ u < this.fields.length;
919
+ u++
920
+ ) {
921
+ var f = this.fields[u];
922
+ o[f] && (N = N.intersect(o[f])), a[f] && (M = M.union(a[f]));
923
+ }
924
+ var c = Object.keys(r),
925
+ g = [],
926
+ C = Object.create(null);
927
+ if (n.isNegated()) {
928
+ c = Object.keys(this.fieldVectors);
929
+ for (var u = 0; u < c.length; u++) {
930
+ var P = c[u],
931
+ T = t.FieldRef.fromString(P);
932
+ r[P] = new t.MatchData();
933
+ }
934
+ }
935
+ for (var u = 0; u < c.length; u++) {
936
+ var T = t.FieldRef.fromString(c[u]),
937
+ d = T.docRef;
938
+ if (N.contains(d) && !M.contains(d)) {
939
+ var x = this.fieldVectors[T],
940
+ O = i[T.fieldName].similarity(x),
941
+ D;
942
+ if ((D = C[d]) !== void 0)
943
+ (D.score += O), D.matchData.combine(r[T]);
944
+ else {
945
+ var L = { ref: d, score: O, matchData: r[T] };
946
+ (C[d] = L), g.push(L);
947
+ }
948
+ }
949
+ }
950
+ return g.sort((Se, Te) => Te.score - Se.score);
951
+ }),
952
+ (t.Index.prototype.toJSON = function () {
953
+ var e = Object.keys(this.invertedIndex)
954
+ .sort()
955
+ .map(function (r) {
956
+ return [r, this.invertedIndex[r]];
957
+ }, this),
958
+ n = Object.keys(this.fieldVectors).map(function (r) {
959
+ return [r, this.fieldVectors[r].toJSON()];
960
+ }, this);
961
+ return {
962
+ version: t.version,
963
+ fields: this.fields,
964
+ fieldVectors: n,
965
+ invertedIndex: e,
966
+ pipeline: this.pipeline.toJSON(),
967
+ };
968
+ }),
969
+ (t.Index.load = (e) => {
970
+ var n = {},
971
+ r = {},
972
+ i = e.fieldVectors,
973
+ s = Object.create(null),
974
+ o = e.invertedIndex,
975
+ a = new t.TokenSet.Builder(),
976
+ u = t.Pipeline.load(e.pipeline);
977
+ e.version != t.version &&
978
+ t.utils.warn(
979
+ "Version mismatch when loading serialised index. Current version of lunr '" +
980
+ t.version +
981
+ "' does not match serialized index '" +
982
+ e.version +
983
+ "'",
984
+ );
985
+ for (var l = 0; l < i.length; l++) {
986
+ var h = i[l],
987
+ m = h[0],
988
+ v = h[1];
989
+ r[m] = new t.Vector(v);
990
+ }
991
+ for (var l = 0; l < o.length; l++) {
992
+ var h = o[l],
993
+ b = h[0],
994
+ y = h[1];
995
+ a.insert(b), (s[b] = y);
996
+ }
997
+ return (
998
+ a.finish(),
999
+ (n.fields = e.fields),
1000
+ (n.fieldVectors = r),
1001
+ (n.invertedIndex = s),
1002
+ (n.tokenSet = a.root),
1003
+ (n.pipeline = u),
1004
+ new t.Index(n)
1005
+ );
1006
+ });
1007
+ (t.Builder = function () {
1008
+ (this._ref = "id"),
1009
+ (this._fields = Object.create(null)),
1010
+ (this._documents = Object.create(null)),
1011
+ (this.invertedIndex = Object.create(null)),
1012
+ (this.fieldTermFrequencies = {}),
1013
+ (this.fieldLengths = {}),
1014
+ (this.tokenizer = t.tokenizer),
1015
+ (this.pipeline = new t.Pipeline()),
1016
+ (this.searchPipeline = new t.Pipeline()),
1017
+ (this.documentCount = 0),
1018
+ (this._b = 0.75),
1019
+ (this._k1 = 1.2),
1020
+ (this.termIndex = 0),
1021
+ (this.metadataWhitelist = []);
1022
+ }),
1023
+ (t.Builder.prototype.ref = function (e) {
1024
+ this._ref = e;
1025
+ }),
1026
+ (t.Builder.prototype.field = function (e, n) {
1027
+ if (/\//.test(e))
1028
+ throw new RangeError(
1029
+ "Field '" + e + "' contains illegal character '/'",
1030
+ );
1031
+ this._fields[e] = n || {};
1032
+ }),
1033
+ (t.Builder.prototype.b = function (e) {
1034
+ e < 0 ? (this._b = 0) : e > 1 ? (this._b = 1) : (this._b = e);
1035
+ }),
1036
+ (t.Builder.prototype.k1 = function (e) {
1037
+ this._k1 = e;
1038
+ }),
1039
+ (t.Builder.prototype.add = function (e, n) {
1040
+ var r = e[this._ref],
1041
+ i = Object.keys(this._fields);
1042
+ (this._documents[r] = n || {}), (this.documentCount += 1);
1043
+ for (var s = 0; s < i.length; s++) {
1044
+ var o = i[s],
1045
+ a = this._fields[o].extractor,
1046
+ u = a ? a(e) : e[o],
1047
+ l = this.tokenizer(u, { fields: [o] }),
1048
+ h = this.pipeline.run(l),
1049
+ m = new t.FieldRef(r, o),
1050
+ v = Object.create(null);
1051
+ (this.fieldTermFrequencies[m] = v),
1052
+ (this.fieldLengths[m] = 0),
1053
+ (this.fieldLengths[m] += h.length);
1054
+ for (var b = 0; b < h.length; b++) {
1055
+ var y = h[b];
1056
+ if (
1057
+ (v[y] == null && (v[y] = 0),
1058
+ (v[y] += 1),
1059
+ this.invertedIndex[y] == null)
1060
+ ) {
1061
+ var E = Object.create(null);
1062
+ (E._index = this.termIndex), (this.termIndex += 1);
1063
+ for (var p = 0; p < i.length; p++)
1064
+ E[i[p]] = Object.create(null);
1065
+ this.invertedIndex[y] = E;
1066
+ }
1067
+ this.invertedIndex[y][o][r] == null &&
1068
+ (this.invertedIndex[y][o][r] = Object.create(null));
1069
+ for (var f = 0; f < this.metadataWhitelist.length; f++) {
1070
+ var S = this.metadataWhitelist[f],
1071
+ w = y.metadata[S];
1072
+ this.invertedIndex[y][o][r][S] == null &&
1073
+ (this.invertedIndex[y][o][r][S] = []),
1074
+ this.invertedIndex[y][o][r][S].push(w);
1075
+ }
1076
+ }
1077
+ }
1078
+ }),
1079
+ (t.Builder.prototype.calculateAverageFieldLengths = function () {
1080
+ for (
1081
+ var e = Object.keys(this.fieldLengths),
1082
+ n = e.length,
1083
+ r = {},
1084
+ i = {},
1085
+ s = 0;
1086
+ s < n;
1087
+ s++
1088
+ ) {
1089
+ var o = t.FieldRef.fromString(e[s]),
1090
+ a = o.fieldName;
1091
+ i[a] || (i[a] = 0),
1092
+ (i[a] += 1),
1093
+ r[a] || (r[a] = 0),
1094
+ (r[a] += this.fieldLengths[o]);
1095
+ }
1096
+ for (var u = Object.keys(this._fields), s = 0; s < u.length; s++) {
1097
+ var l = u[s];
1098
+ r[l] = r[l] / i[l];
1099
+ }
1100
+ this.averageFieldLength = r;
1101
+ }),
1102
+ (t.Builder.prototype.createFieldVectors = function () {
1103
+ for (
1104
+ var e = {},
1105
+ n = Object.keys(this.fieldTermFrequencies),
1106
+ r = n.length,
1107
+ i = Object.create(null),
1108
+ s = 0;
1109
+ s < r;
1110
+ s++
1111
+ ) {
1112
+ for (
1113
+ var o = t.FieldRef.fromString(n[s]),
1114
+ a = o.fieldName,
1115
+ u = this.fieldLengths[o],
1116
+ l = new t.Vector(),
1117
+ h = this.fieldTermFrequencies[o],
1118
+ m = Object.keys(h),
1119
+ v = m.length,
1120
+ b = this._fields[a].boost || 1,
1121
+ y = this._documents[o.docRef].boost || 1,
1122
+ E = 0;
1123
+ E < v;
1124
+ E++
1125
+ ) {
1126
+ var p = m[E],
1127
+ f = h[p],
1128
+ S = this.invertedIndex[p]._index,
1129
+ w,
1130
+ k,
1131
+ _;
1132
+ i[p] === void 0
1133
+ ? ((w = t.idf(this.invertedIndex[p], this.documentCount)),
1134
+ (i[p] = w))
1135
+ : (w = i[p]),
1136
+ (k =
1137
+ (w * ((this._k1 + 1) * f)) /
1138
+ (this._k1 *
1139
+ (1 - this._b + this._b * (u / this.averageFieldLength[a])) +
1140
+ f)),
1141
+ (k *= b),
1142
+ (k *= y),
1143
+ (_ = Math.round(k * 1e3) / 1e3),
1144
+ l.insert(S, _);
1145
+ }
1146
+ e[o] = l;
1147
+ }
1148
+ this.fieldVectors = e;
1149
+ }),
1150
+ (t.Builder.prototype.createTokenSet = function () {
1151
+ this.tokenSet = t.TokenSet.fromArray(
1152
+ Object.keys(this.invertedIndex).sort(),
1153
+ );
1154
+ }),
1155
+ (t.Builder.prototype.build = function () {
1156
+ return (
1157
+ this.calculateAverageFieldLengths(),
1158
+ this.createFieldVectors(),
1159
+ this.createTokenSet(),
1160
+ new t.Index({
1161
+ invertedIndex: this.invertedIndex,
1162
+ fieldVectors: this.fieldVectors,
1163
+ tokenSet: this.tokenSet,
1164
+ fields: Object.keys(this._fields),
1165
+ pipeline: this.searchPipeline,
1166
+ })
1167
+ );
1168
+ }),
1169
+ (t.Builder.prototype.use = function (e) {
1170
+ var n = Array.prototype.slice.call(arguments, 1);
1171
+ n.unshift(this), e.apply(this, n);
1172
+ }),
1173
+ (t.MatchData = function (e, n, r) {
1174
+ for (
1175
+ var i = Object.create(null), s = Object.keys(r || {}), o = 0;
1176
+ o < s.length;
1177
+ o++
1178
+ ) {
1179
+ var a = s[o];
1180
+ i[a] = r[a].slice();
1181
+ }
1182
+ (this.metadata = Object.create(null)),
1183
+ e !== void 0 &&
1184
+ ((this.metadata[e] = Object.create(null)),
1185
+ (this.metadata[e][n] = i));
1186
+ }),
1187
+ (t.MatchData.prototype.combine = function (e) {
1188
+ for (var n = Object.keys(e.metadata), r = 0; r < n.length; r++) {
1189
+ var i = n[r],
1190
+ s = Object.keys(e.metadata[i]);
1191
+ this.metadata[i] == null &&
1192
+ (this.metadata[i] = Object.create(null));
1193
+ for (var o = 0; o < s.length; o++) {
1194
+ var a = s[o],
1195
+ u = Object.keys(e.metadata[i][a]);
1196
+ this.metadata[i][a] == null &&
1197
+ (this.metadata[i][a] = Object.create(null));
1198
+ for (var l = 0; l < u.length; l++) {
1199
+ var h = u[l];
1200
+ this.metadata[i][a][h] == null
1201
+ ? (this.metadata[i][a][h] = e.metadata[i][a][h])
1202
+ : (this.metadata[i][a][h] = this.metadata[i][a][h].concat(
1203
+ e.metadata[i][a][h],
1204
+ ));
1205
+ }
1206
+ }
1207
+ }
1208
+ }),
1209
+ (t.MatchData.prototype.add = function (e, n, r) {
1210
+ if (!(e in this.metadata)) {
1211
+ (this.metadata[e] = Object.create(null)), (this.metadata[e][n] = r);
1212
+ return;
1213
+ }
1214
+ if (!(n in this.metadata[e])) {
1215
+ this.metadata[e][n] = r;
1216
+ return;
1217
+ }
1218
+ for (var i = Object.keys(r), s = 0; s < i.length; s++) {
1219
+ var o = i[s];
1220
+ o in this.metadata[e][n]
1221
+ ? (this.metadata[e][n][o] = this.metadata[e][n][o].concat(r[o]))
1222
+ : (this.metadata[e][n][o] = r[o]);
1223
+ }
1224
+ }),
1225
+ (t.Query = function (e) {
1226
+ (this.clauses = []), (this.allFields = e);
1227
+ }),
1228
+ (t.Query.wildcard = new String("*")),
1229
+ (t.Query.wildcard.NONE = 0),
1230
+ (t.Query.wildcard.LEADING = 1),
1231
+ (t.Query.wildcard.TRAILING = 2),
1232
+ (t.Query.presence = { OPTIONAL: 1, REQUIRED: 2, PROHIBITED: 3 }),
1233
+ (t.Query.prototype.clause = function (e) {
1234
+ return (
1235
+ "fields" in e || (e.fields = this.allFields),
1236
+ "boost" in e || (e.boost = 1),
1237
+ "usePipeline" in e || (e.usePipeline = !0),
1238
+ "wildcard" in e || (e.wildcard = t.Query.wildcard.NONE),
1239
+ e.wildcard & t.Query.wildcard.LEADING &&
1240
+ e.term.charAt(0) != t.Query.wildcard &&
1241
+ (e.term = "*" + e.term),
1242
+ e.wildcard & t.Query.wildcard.TRAILING &&
1243
+ e.term.slice(-1) != t.Query.wildcard &&
1244
+ (e.term = "" + e.term + "*"),
1245
+ "presence" in e || (e.presence = t.Query.presence.OPTIONAL),
1246
+ this.clauses.push(e),
1247
+ this
1248
+ );
1249
+ }),
1250
+ (t.Query.prototype.isNegated = function () {
1251
+ for (var e = 0; e < this.clauses.length; e++)
1252
+ if (this.clauses[e].presence != t.Query.presence.PROHIBITED)
1253
+ return !1;
1254
+ return !0;
1255
+ }),
1256
+ (t.Query.prototype.term = function (e, n) {
1257
+ if (Array.isArray(e))
1258
+ return (
1259
+ e.forEach(function (i) {
1260
+ this.term(i, t.utils.clone(n));
1261
+ }, this),
1262
+ this
1263
+ );
1264
+ var r = n || {};
1265
+ return (r.term = e.toString()), this.clause(r), this;
1266
+ }),
1267
+ (t.QueryParseError = function (e, n, r) {
1268
+ (this.name = "QueryParseError"),
1269
+ (this.message = e),
1270
+ (this.start = n),
1271
+ (this.end = r);
1272
+ }),
1273
+ (t.QueryParseError.prototype = new Error()),
1274
+ (t.QueryLexer = function (e) {
1275
+ (this.lexemes = []),
1276
+ (this.str = e),
1277
+ (this.length = e.length),
1278
+ (this.pos = 0),
1279
+ (this.start = 0),
1280
+ (this.escapeCharPositions = []);
1281
+ }),
1282
+ (t.QueryLexer.prototype.run = function () {
1283
+ for (var e = t.QueryLexer.lexText; e; ) e = e(this);
1284
+ }),
1285
+ (t.QueryLexer.prototype.sliceString = function () {
1286
+ for (
1287
+ var e = [], n = this.start, r = this.pos, i = 0;
1288
+ i < this.escapeCharPositions.length;
1289
+ i++
1290
+ )
1291
+ (r = this.escapeCharPositions[i]),
1292
+ e.push(this.str.slice(n, r)),
1293
+ (n = r + 1);
1294
+ return (
1295
+ e.push(this.str.slice(n, this.pos)),
1296
+ (this.escapeCharPositions.length = 0),
1297
+ e.join("")
1298
+ );
1299
+ }),
1300
+ (t.QueryLexer.prototype.emit = function (e) {
1301
+ this.lexemes.push({
1302
+ type: e,
1303
+ str: this.sliceString(),
1304
+ start: this.start,
1305
+ end: this.pos,
1306
+ }),
1307
+ (this.start = this.pos);
1308
+ }),
1309
+ (t.QueryLexer.prototype.escapeCharacter = function () {
1310
+ this.escapeCharPositions.push(this.pos - 1), (this.pos += 1);
1311
+ }),
1312
+ (t.QueryLexer.prototype.next = function () {
1313
+ if (this.pos >= this.length) return t.QueryLexer.EOS;
1314
+ var e = this.str.charAt(this.pos);
1315
+ return (this.pos += 1), e;
1316
+ }),
1317
+ (t.QueryLexer.prototype.width = function () {
1318
+ return this.pos - this.start;
1319
+ }),
1320
+ (t.QueryLexer.prototype.ignore = function () {
1321
+ this.start == this.pos && (this.pos += 1), (this.start = this.pos);
1322
+ }),
1323
+ (t.QueryLexer.prototype.backup = function () {
1324
+ this.pos -= 1;
1325
+ }),
1326
+ (t.QueryLexer.prototype.acceptDigitRun = function () {
1327
+ var e, n;
1328
+ do (e = this.next()), (n = e.charCodeAt(0));
1329
+ while (n > 47 && n < 58);
1330
+ e != t.QueryLexer.EOS && this.backup();
1331
+ }),
1332
+ (t.QueryLexer.prototype.more = function () {
1333
+ return this.pos < this.length;
1334
+ }),
1335
+ (t.QueryLexer.EOS = "EOS"),
1336
+ (t.QueryLexer.FIELD = "FIELD"),
1337
+ (t.QueryLexer.TERM = "TERM"),
1338
+ (t.QueryLexer.EDIT_DISTANCE = "EDIT_DISTANCE"),
1339
+ (t.QueryLexer.BOOST = "BOOST"),
1340
+ (t.QueryLexer.PRESENCE = "PRESENCE"),
1341
+ (t.QueryLexer.lexField = (e) => (
1342
+ e.backup(),
1343
+ e.emit(t.QueryLexer.FIELD),
1344
+ e.ignore(),
1345
+ t.QueryLexer.lexText
1346
+ )),
1347
+ (t.QueryLexer.lexTerm = (e) => {
1348
+ if (
1349
+ (e.width() > 1 && (e.backup(), e.emit(t.QueryLexer.TERM)),
1350
+ e.ignore(),
1351
+ e.more())
1352
+ )
1353
+ return t.QueryLexer.lexText;
1354
+ }),
1355
+ (t.QueryLexer.lexEditDistance = (e) => (
1356
+ e.ignore(),
1357
+ e.acceptDigitRun(),
1358
+ e.emit(t.QueryLexer.EDIT_DISTANCE),
1359
+ t.QueryLexer.lexText
1360
+ )),
1361
+ (t.QueryLexer.lexBoost = (e) => (
1362
+ e.ignore(),
1363
+ e.acceptDigitRun(),
1364
+ e.emit(t.QueryLexer.BOOST),
1365
+ t.QueryLexer.lexText
1366
+ )),
1367
+ (t.QueryLexer.lexEOS = (e) => {
1368
+ e.width() > 0 && e.emit(t.QueryLexer.TERM);
1369
+ }),
1370
+ (t.QueryLexer.termSeparator = t.tokenizer.separator),
1371
+ (t.QueryLexer.lexText = (e) => {
1372
+ for (;;) {
1373
+ var n = e.next();
1374
+ if (n == t.QueryLexer.EOS) return t.QueryLexer.lexEOS;
1375
+ if (n.charCodeAt(0) == 92) {
1376
+ e.escapeCharacter();
1377
+ continue;
1378
+ }
1379
+ if (n == ":") return t.QueryLexer.lexField;
1380
+ if (n == "~")
1381
+ return (
1382
+ e.backup(),
1383
+ e.width() > 0 && e.emit(t.QueryLexer.TERM),
1384
+ t.QueryLexer.lexEditDistance
1385
+ );
1386
+ if (n == "^")
1387
+ return (
1388
+ e.backup(),
1389
+ e.width() > 0 && e.emit(t.QueryLexer.TERM),
1390
+ t.QueryLexer.lexBoost
1391
+ );
1392
+ if ((n == "+" && e.width() === 1) || (n == "-" && e.width() === 1))
1393
+ return e.emit(t.QueryLexer.PRESENCE), t.QueryLexer.lexText;
1394
+ if (n.match(t.QueryLexer.termSeparator))
1395
+ return t.QueryLexer.lexTerm;
1396
+ }
1397
+ }),
1398
+ (t.QueryParser = function (e, n) {
1399
+ (this.lexer = new t.QueryLexer(e)),
1400
+ (this.query = n),
1401
+ (this.currentClause = {}),
1402
+ (this.lexemeIdx = 0);
1403
+ }),
1404
+ (t.QueryParser.prototype.parse = function () {
1405
+ this.lexer.run(), (this.lexemes = this.lexer.lexemes);
1406
+ for (var e = t.QueryParser.parseClause; e; ) e = e(this);
1407
+ return this.query;
1408
+ }),
1409
+ (t.QueryParser.prototype.peekLexeme = function () {
1410
+ return this.lexemes[this.lexemeIdx];
1411
+ }),
1412
+ (t.QueryParser.prototype.consumeLexeme = function () {
1413
+ var e = this.peekLexeme();
1414
+ return (this.lexemeIdx += 1), e;
1415
+ }),
1416
+ (t.QueryParser.prototype.nextClause = function () {
1417
+ var e = this.currentClause;
1418
+ this.query.clause(e), (this.currentClause = {});
1419
+ }),
1420
+ (t.QueryParser.parseClause = (e) => {
1421
+ var n = e.peekLexeme();
1422
+ if (n != null)
1423
+ switch (n.type) {
1424
+ case t.QueryLexer.PRESENCE:
1425
+ return t.QueryParser.parsePresence;
1426
+ case t.QueryLexer.FIELD:
1427
+ return t.QueryParser.parseField;
1428
+ case t.QueryLexer.TERM:
1429
+ return t.QueryParser.parseTerm;
1430
+ default: {
1431
+ var r = "expected either a field or a term, found " + n.type;
1432
+ throw (
1433
+ (n.str.length >= 1 && (r += " with value '" + n.str + "'"),
1434
+ new t.QueryParseError(r, n.start, n.end))
1435
+ );
1436
+ }
1437
+ }
1438
+ }),
1439
+ (t.QueryParser.parsePresence = (e) => {
1440
+ var n = e.consumeLexeme();
1441
+ if (n != null) {
1442
+ switch (n.str) {
1443
+ case "-":
1444
+ e.currentClause.presence = t.Query.presence.PROHIBITED;
1445
+ break;
1446
+ case "+":
1447
+ e.currentClause.presence = t.Query.presence.REQUIRED;
1448
+ break;
1449
+ default: {
1450
+ var r = "unrecognised presence operator'" + n.str + "'";
1451
+ throw new t.QueryParseError(r, n.start, n.end);
1452
+ }
1453
+ }
1454
+ var i = e.peekLexeme();
1455
+ if (i == null) {
1456
+ var r = "expecting term or field, found nothing";
1457
+ throw new t.QueryParseError(r, n.start, n.end);
1458
+ }
1459
+ switch (i.type) {
1460
+ case t.QueryLexer.FIELD:
1461
+ return t.QueryParser.parseField;
1462
+ case t.QueryLexer.TERM:
1463
+ return t.QueryParser.parseTerm;
1464
+ default: {
1465
+ var r = "expecting term or field, found '" + i.type + "'";
1466
+ throw new t.QueryParseError(r, i.start, i.end);
1467
+ }
1468
+ }
1469
+ }
1470
+ }),
1471
+ (t.QueryParser.parseField = (e) => {
1472
+ var n = e.consumeLexeme();
1473
+ if (n != null) {
1474
+ if (e.query.allFields.indexOf(n.str) == -1) {
1475
+ var r = e.query.allFields.map((o) => "'" + o + "'").join(", "),
1476
+ i = "unrecognised field '" + n.str + "', possible fields: " + r;
1477
+ throw new t.QueryParseError(i, n.start, n.end);
1478
+ }
1479
+ e.currentClause.fields = [n.str];
1480
+ var s = e.peekLexeme();
1481
+ if (s == null) {
1482
+ var i = "expecting term, found nothing";
1483
+ throw new t.QueryParseError(i, n.start, n.end);
1484
+ }
1485
+ switch (s.type) {
1486
+ case t.QueryLexer.TERM:
1487
+ return t.QueryParser.parseTerm;
1488
+ default: {
1489
+ var i = "expecting term, found '" + s.type + "'";
1490
+ throw new t.QueryParseError(i, s.start, s.end);
1491
+ }
1492
+ }
1493
+ }
1494
+ }),
1495
+ (t.QueryParser.parseTerm = (e) => {
1496
+ var n = e.consumeLexeme();
1497
+ if (n != null) {
1498
+ (e.currentClause.term = n.str.toLowerCase()),
1499
+ n.str.indexOf("*") != -1 && (e.currentClause.usePipeline = !1);
1500
+ var r = e.peekLexeme();
1501
+ if (r == null) {
1502
+ e.nextClause();
1503
+ return;
1504
+ }
1505
+ switch (r.type) {
1506
+ case t.QueryLexer.TERM:
1507
+ return e.nextClause(), t.QueryParser.parseTerm;
1508
+ case t.QueryLexer.FIELD:
1509
+ return e.nextClause(), t.QueryParser.parseField;
1510
+ case t.QueryLexer.EDIT_DISTANCE:
1511
+ return t.QueryParser.parseEditDistance;
1512
+ case t.QueryLexer.BOOST:
1513
+ return t.QueryParser.parseBoost;
1514
+ case t.QueryLexer.PRESENCE:
1515
+ return e.nextClause(), t.QueryParser.parsePresence;
1516
+ default: {
1517
+ var i = "Unexpected lexeme type '" + r.type + "'";
1518
+ throw new t.QueryParseError(i, r.start, r.end);
1519
+ }
1520
+ }
1521
+ }
1522
+ }),
1523
+ (t.QueryParser.parseEditDistance = (e) => {
1524
+ var n = e.consumeLexeme();
1525
+ if (n != null) {
1526
+ var r = parseInt(n.str, 10);
1527
+ if (isNaN(r)) {
1528
+ var i = "edit distance must be numeric";
1529
+ throw new t.QueryParseError(i, n.start, n.end);
1530
+ }
1531
+ e.currentClause.editDistance = r;
1532
+ var s = e.peekLexeme();
1533
+ if (s == null) {
1534
+ e.nextClause();
1535
+ return;
1536
+ }
1537
+ switch (s.type) {
1538
+ case t.QueryLexer.TERM:
1539
+ return e.nextClause(), t.QueryParser.parseTerm;
1540
+ case t.QueryLexer.FIELD:
1541
+ return e.nextClause(), t.QueryParser.parseField;
1542
+ case t.QueryLexer.EDIT_DISTANCE:
1543
+ return t.QueryParser.parseEditDistance;
1544
+ case t.QueryLexer.BOOST:
1545
+ return t.QueryParser.parseBoost;
1546
+ case t.QueryLexer.PRESENCE:
1547
+ return e.nextClause(), t.QueryParser.parsePresence;
1548
+ default: {
1549
+ var i = "Unexpected lexeme type '" + s.type + "'";
1550
+ throw new t.QueryParseError(i, s.start, s.end);
1551
+ }
1552
+ }
1553
+ }
1554
+ }),
1555
+ (t.QueryParser.parseBoost = (e) => {
1556
+ var n = e.consumeLexeme();
1557
+ if (n != null) {
1558
+ var r = parseInt(n.str, 10);
1559
+ if (isNaN(r)) {
1560
+ var i = "boost must be numeric";
1561
+ throw new t.QueryParseError(i, n.start, n.end);
1562
+ }
1563
+ e.currentClause.boost = r;
1564
+ var s = e.peekLexeme();
1565
+ if (s == null) {
1566
+ e.nextClause();
1567
+ return;
1568
+ }
1569
+ switch (s.type) {
1570
+ case t.QueryLexer.TERM:
1571
+ return e.nextClause(), t.QueryParser.parseTerm;
1572
+ case t.QueryLexer.FIELD:
1573
+ return e.nextClause(), t.QueryParser.parseField;
1574
+ case t.QueryLexer.EDIT_DISTANCE:
1575
+ return t.QueryParser.parseEditDistance;
1576
+ case t.QueryLexer.BOOST:
1577
+ return t.QueryParser.parseBoost;
1578
+ case t.QueryLexer.PRESENCE:
1579
+ return e.nextClause(), t.QueryParser.parsePresence;
1580
+ default: {
1581
+ var i = "Unexpected lexeme type '" + s.type + "'";
1582
+ throw new t.QueryParseError(i, s.start, s.end);
1583
+ }
1584
+ }
1585
+ }
1586
+ }),
1587
+ ((e, n) => {
1588
+ typeof define == "function" && define.amd
1589
+ ? define(n)
1590
+ : typeof ce == "object"
1591
+ ? (he.exports = n())
1592
+ : (e.lunr = n());
1593
+ })(this, () => t);
1594
+ })();
1595
+ });
1596
+ var le = [];
1597
+ function B(t, e) {
1598
+ le.push({ selector: e, constructor: t });
1599
+ }
1600
+ var Y = class {
1601
+ constructor() {
1602
+ this.alwaysVisibleMember = null;
1603
+ this.createComponents(document.body),
1604
+ this.ensureFocusedElementVisible(),
1605
+ window.addEventListener("hashchange", () =>
1606
+ this.ensureFocusedElementVisible(),
1607
+ );
1608
+ }
1609
+ createComponents(e) {
1610
+ le.forEach((n) => {
1611
+ e.querySelectorAll(n.selector).forEach((r) => {
1612
+ r.dataset.hasInstance ||
1613
+ (new n.constructor({ el: r, app: this }),
1614
+ (r.dataset.hasInstance = String(!0)));
1615
+ });
1616
+ });
1617
+ }
1618
+ filterChanged() {
1619
+ this.ensureFocusedElementVisible();
1620
+ }
1621
+ ensureFocusedElementVisible() {
1622
+ this.alwaysVisibleMember &&
1623
+ (this.alwaysVisibleMember.classList.remove("always-visible"),
1624
+ this.alwaysVisibleMember.firstElementChild.remove(),
1625
+ (this.alwaysVisibleMember = null));
1626
+ const e = document.getElementById(location.hash.substring(1));
1627
+ if (!e) return;
1628
+ let n = e.parentElement;
1629
+ for (; n && n.tagName !== "SECTION"; ) n = n.parentElement;
1630
+ if (n && n.offsetParent == null) {
1631
+ (this.alwaysVisibleMember = n), n.classList.add("always-visible");
1632
+ const r = document.createElement("p");
1633
+ r.classList.add("warning"),
1634
+ (r.textContent =
1635
+ "This member is normally hidden due to your filter settings."),
1636
+ n.prepend(r);
1637
+ }
1638
+ }
1639
+ };
1640
+ var I = class {
1641
+ constructor(e) {
1642
+ (this.el = e.el), (this.app = e.app);
1643
+ }
1644
+ };
1645
+ var J = class {
1646
+ constructor() {
1647
+ this.listeners = {};
1648
+ }
1649
+ addEventListener(e, n) {
1650
+ e in this.listeners || (this.listeners[e] = []),
1651
+ this.listeners[e].push(n);
1652
+ }
1653
+ removeEventListener(e, n) {
1654
+ if (!(e in this.listeners)) return;
1655
+ const r = this.listeners[e];
1656
+ for (let i = 0, s = r.length; i < s; i++)
1657
+ if (r[i] === n) {
1658
+ r.splice(i, 1);
1659
+ return;
1660
+ }
1661
+ }
1662
+ dispatchEvent(e) {
1663
+ if (!(e.type in this.listeners)) return !0;
1664
+ const n = this.listeners[e.type].slice();
1665
+ for (let r = 0, i = n.length; r < i; r++) n[r].call(this, e);
1666
+ return !e.defaultPrevented;
1667
+ }
1668
+ };
1669
+ var ne = (t, e = 100) => {
1670
+ let n = Date.now();
1671
+ return (...r) => {
1672
+ n + e - Date.now() < 0 && (t(...r), (n = Date.now()));
1673
+ };
1674
+ };
1675
+ var re = class extends J {
1676
+ constructor() {
1677
+ super();
1678
+ this.scrollTop = 0;
1679
+ this.lastY = 0;
1680
+ this.width = 0;
1681
+ this.height = 0;
1682
+ this.showToolbar = !0;
1683
+ (this.toolbar = document.querySelector(".tsd-page-toolbar")),
1684
+ (this.navigation = document.querySelector(".col-menu")),
1685
+ window.addEventListener(
1686
+ "scroll",
1687
+ ne(() => this.onScroll(), 10),
1688
+ ),
1689
+ window.addEventListener(
1690
+ "resize",
1691
+ ne(() => this.onResize(), 10),
1692
+ ),
1693
+ (this.searchInput = document.querySelector("#tsd-search input")),
1694
+ this.searchInput &&
1695
+ this.searchInput.addEventListener("focus", () => {
1696
+ this.hideShowToolbar();
1697
+ }),
1698
+ this.onResize(),
1699
+ this.onScroll();
1700
+ }
1701
+ triggerResize() {
1702
+ const n = new CustomEvent("resize", {
1703
+ detail: { width: this.width, height: this.height },
1704
+ });
1705
+ this.dispatchEvent(n);
1706
+ }
1707
+ onResize() {
1708
+ (this.width = window.innerWidth || 0),
1709
+ (this.height = window.innerHeight || 0);
1710
+ const n = new CustomEvent("resize", {
1711
+ detail: { width: this.width, height: this.height },
1712
+ });
1713
+ this.dispatchEvent(n);
1714
+ }
1715
+ onScroll() {
1716
+ this.scrollTop = window.scrollY || 0;
1717
+ const n = new CustomEvent("scroll", {
1718
+ detail: { scrollTop: this.scrollTop },
1719
+ });
1720
+ this.dispatchEvent(n), this.hideShowToolbar();
1721
+ }
1722
+ hideShowToolbar() {
1723
+ const n = this.showToolbar;
1724
+ (this.showToolbar =
1725
+ this.lastY >= this.scrollTop ||
1726
+ this.scrollTop <= 0 ||
1727
+ (!!this.searchInput && this.searchInput === document.activeElement)),
1728
+ n !== this.showToolbar &&
1729
+ (this.toolbar.classList.toggle("tsd-page-toolbar--hide"),
1730
+ this.navigation?.classList.toggle("col-menu--hide")),
1731
+ (this.lastY = this.scrollTop);
1732
+ }
1733
+ },
1734
+ R = re;
1735
+ R.instance = new re();
1736
+ var X = class extends I {
1737
+ constructor(n) {
1738
+ super(n);
1739
+ this.anchors = [];
1740
+ this.index = -1;
1741
+ R.instance.addEventListener("resize", () => this.onResize()),
1742
+ R.instance.addEventListener("scroll", (r) => this.onScroll(r)),
1743
+ this.createAnchors();
1744
+ }
1745
+ createAnchors() {
1746
+ let n = window.location.href;
1747
+ n.indexOf("#") != -1 && (n = n.substring(0, n.indexOf("#"))),
1748
+ this.el.querySelectorAll("a").forEach((r) => {
1749
+ const i = r.href;
1750
+ if (i.indexOf("#") == -1 || i.substring(0, n.length) != n) return;
1751
+ const s = i.substring(i.indexOf("#") + 1),
1752
+ o = document.querySelector("a.tsd-anchor[name=" + s + "]"),
1753
+ a = r.parentNode;
1754
+ !o || !a || this.anchors.push({ link: a, anchor: o, position: 0 });
1755
+ }),
1756
+ this.onResize();
1757
+ }
1758
+ onResize() {
1759
+ let n;
1760
+ for (let i = 0, s = this.anchors.length; i < s; i++) {
1761
+ n = this.anchors[i];
1762
+ const o = n.anchor.getBoundingClientRect();
1763
+ n.position = o.top + document.body.scrollTop;
1764
+ }
1765
+ this.anchors.sort((i, s) => i.position - s.position);
1766
+ const r = new CustomEvent("scroll", {
1767
+ detail: { scrollTop: R.instance.scrollTop },
1768
+ });
1769
+ this.onScroll(r);
1770
+ }
1771
+ onScroll(n) {
1772
+ let r = n.detail.scrollTop + 5,
1773
+ i = this.anchors,
1774
+ s = i.length - 1,
1775
+ o = this.index;
1776
+ for (; o > -1 && i[o].position > r; ) o -= 1;
1777
+ for (; o < s && i[o + 1].position < r; ) o += 1;
1778
+ this.index != o &&
1779
+ (this.index > -1 &&
1780
+ this.anchors[this.index].link.classList.remove("focus"),
1781
+ (this.index = o),
1782
+ this.index > -1 &&
1783
+ this.anchors[this.index].link.classList.add("focus"));
1784
+ }
1785
+ };
1786
+ var ue = (t, e = 100) => {
1787
+ let n;
1788
+ return () => {
1789
+ clearTimeout(n), (n = setTimeout(() => t(), e));
1790
+ };
1791
+ };
1792
+ var me = De(de());
1793
+ function ve() {
1794
+ const t = document.getElementById("tsd-search");
1795
+ if (!t) return;
1796
+ const e = document.getElementById("search-script");
1797
+ t.classList.add("loading"),
1798
+ e &&
1799
+ (e.addEventListener("error", () => {
1800
+ t.classList.remove("loading"), t.classList.add("failure");
1801
+ }),
1802
+ e.addEventListener("load", () => {
1803
+ t.classList.remove("loading"), t.classList.add("ready");
1804
+ }),
1805
+ window.searchData && t.classList.remove("loading"));
1806
+ const n = document.querySelector("#tsd-search input"),
1807
+ r = document.querySelector("#tsd-search .results");
1808
+ if (!n || !r)
1809
+ throw new Error(
1810
+ "The input field or the result list wrapper was not found",
1811
+ );
1812
+ let i = !1;
1813
+ r.addEventListener("mousedown", () => (i = !0)),
1814
+ r.addEventListener("mouseup", () => {
1815
+ (i = !1), t.classList.remove("has-focus");
1816
+ }),
1817
+ n.addEventListener("focus", () => t.classList.add("has-focus")),
1818
+ n.addEventListener("blur", () => {
1819
+ i || ((i = !1), t.classList.remove("has-focus"));
1820
+ });
1821
+ const s = { base: t.dataset.base + "/" };
1822
+ Fe(t, r, n, s);
1823
+ }
1824
+ function Fe(t, e, n, r) {
1825
+ n.addEventListener(
1826
+ "input",
1827
+ ue(() => {
1828
+ He(t, e, n, r);
1829
+ }, 200),
1830
+ );
1831
+ let i = !1;
1832
+ n.addEventListener("keydown", (s) => {
1833
+ (i = !0),
1834
+ s.key == "Enter"
1835
+ ? Ve(e, n)
1836
+ : s.key == "Escape"
1837
+ ? n.blur()
1838
+ : s.key == "ArrowUp"
1839
+ ? pe(e, -1)
1840
+ : s.key === "ArrowDown"
1841
+ ? pe(e, 1)
1842
+ : (i = !1);
1843
+ }),
1844
+ n.addEventListener("keypress", (s) => {
1845
+ i && s.preventDefault();
1846
+ }),
1847
+ document.body.addEventListener("keydown", (s) => {
1848
+ s.altKey ||
1849
+ s.ctrlKey ||
1850
+ s.metaKey ||
1851
+ (!n.matches(":focus") &&
1852
+ s.key === "/" &&
1853
+ (n.focus(), s.preventDefault()));
1854
+ });
1855
+ }
1856
+ function Ae(t, e) {
1857
+ t.index ||
1858
+ (window.searchData &&
1859
+ (e.classList.remove("loading"),
1860
+ e.classList.add("ready"),
1861
+ (t.data = window.searchData),
1862
+ (t.index = me.Index.load(window.searchData.index))));
1863
+ }
1864
+ function He(t, e, n, r) {
1865
+ if ((Ae(r, t), !r.index || !r.data)) return;
1866
+ e.textContent = "";
1867
+ const i = n.value.trim(),
1868
+ s = i ? r.index.search(`*${i}*`) : [];
1869
+ for (let o = 0; o < s.length; o++) {
1870
+ let a = s[o],
1871
+ u = r.data.rows[Number(a.ref)],
1872
+ l = 1;
1873
+ u.name.toLowerCase().startsWith(i.toLowerCase()) &&
1874
+ (l *= 1 + 1 / (1 + Math.abs(u.name.length - i.length))),
1875
+ (a.score *= l);
1876
+ }
1877
+ s.sort((o, a) => a.score - o.score);
1878
+ for (let o = 0, a = Math.min(10, s.length); o < a; o++) {
1879
+ let u = r.data.rows[Number(s[o].ref)],
1880
+ l = fe(u.name, i);
1881
+ globalThis.DEBUG_SEARCH_WEIGHTS &&
1882
+ (l += ` (score: ${s[o].score.toFixed(2)})`),
1883
+ u.parent && (l = `<span class="parent">${fe(u.parent, i)}.</span>${l}`);
1884
+ const h = document.createElement("li");
1885
+ h.classList.value = u.classes ?? "";
1886
+ const m = document.createElement("a");
1887
+ (m.href = r.base + u.url),
1888
+ (m.innerHTML = l),
1889
+ h.append(m),
1890
+ e.appendChild(h);
1891
+ }
1892
+ }
1893
+ function pe(t, e) {
1894
+ let n = t.querySelector(".current");
1895
+ if (!n)
1896
+ (n = t.querySelector(e == 1 ? "li:first-child" : "li:last-child")),
1897
+ n && n.classList.add("current");
1898
+ else {
1899
+ let r = n;
1900
+ if (e === 1)
1901
+ do r = r.nextElementSibling ?? void 0;
1902
+ while (r instanceof HTMLElement && r.offsetParent == null);
1903
+ else
1904
+ do r = r.previousElementSibling ?? void 0;
1905
+ while (r instanceof HTMLElement && r.offsetParent == null);
1906
+ r && (n.classList.remove("current"), r.classList.add("current"));
1907
+ }
1908
+ }
1909
+ function Ve(t, e) {
1910
+ let n = t.querySelector(".current");
1911
+ if ((n || (n = t.querySelector("li:first-child")), n)) {
1912
+ const r = n.querySelector("a");
1913
+ r && (window.location.href = r.href), e.blur();
1914
+ }
1915
+ }
1916
+ function fe(t, e) {
1917
+ if (e === "") return t;
1918
+ let n = t.toLocaleLowerCase(),
1919
+ r = e.toLocaleLowerCase(),
1920
+ i = [],
1921
+ s = 0,
1922
+ o = n.indexOf(r);
1923
+ for (; o != -1; )
1924
+ i.push(
1925
+ ie(t.substring(s, o)),
1926
+ `<b>${ie(t.substring(o, o + r.length))}</b>`,
1927
+ ),
1928
+ (s = o + r.length),
1929
+ (o = n.indexOf(r, s));
1930
+ return i.push(ie(t.substring(s))), i.join("");
1931
+ }
1932
+ var Ne = {
1933
+ "&": "&amp;",
1934
+ "<": "&lt;",
1935
+ ">": "&gt;",
1936
+ "'": "&#039;",
1937
+ '"': "&quot;",
1938
+ };
1939
+ function ie(t) {
1940
+ return t.replace(/[&<>"'"]/g, (e) => Ne[e]);
1941
+ }
1942
+ var F = "mousedown",
1943
+ ye = "mousemove",
1944
+ j = "mouseup",
1945
+ Z = { x: 0, y: 0 },
1946
+ ge = !1,
1947
+ se = !1,
1948
+ Be = !1,
1949
+ A = !1,
1950
+ xe = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
1951
+ navigator.userAgent,
1952
+ );
1953
+ document.documentElement.classList.add(xe ? "is-mobile" : "not-mobile");
1954
+ xe &&
1955
+ "ontouchstart" in document.documentElement &&
1956
+ ((Be = !0), (F = "touchstart"), (ye = "touchmove"), (j = "touchend"));
1957
+ document.addEventListener(F, (t) => {
1958
+ (se = !0), (A = !1);
1959
+ const e = F == "touchstart" ? t.targetTouches[0] : t;
1960
+ (Z.y = e.pageY || 0), (Z.x = e.pageX || 0);
1961
+ });
1962
+ document.addEventListener(ye, (t) => {
1963
+ if (se && !A) {
1964
+ const e = F == "touchstart" ? t.targetTouches[0] : t,
1965
+ n = Z.x - (e.pageX || 0),
1966
+ r = Z.y - (e.pageY || 0);
1967
+ A = Math.sqrt(n * n + r * r) > 10;
1968
+ }
1969
+ });
1970
+ document.addEventListener(j, () => {
1971
+ se = !1;
1972
+ });
1973
+ document.addEventListener("click", (t) => {
1974
+ ge && (t.preventDefault(), t.stopImmediatePropagation(), (ge = !1));
1975
+ });
1976
+ var K = class extends I {
1977
+ constructor(n) {
1978
+ super(n);
1979
+ (this.className = this.el.dataset.toggle || ""),
1980
+ this.el.addEventListener(j, (r) => this.onPointerUp(r)),
1981
+ this.el.addEventListener("click", (r) => r.preventDefault()),
1982
+ document.addEventListener(F, (r) => this.onDocumentPointerDown(r)),
1983
+ document.addEventListener(j, (r) => this.onDocumentPointerUp(r));
1984
+ }
1985
+ setActive(n) {
1986
+ if (this.active == n) return;
1987
+ (this.active = n),
1988
+ document.documentElement.classList.toggle("has-" + this.className, n),
1989
+ this.el.classList.toggle("active", n);
1990
+ const r = (this.active ? "to-has-" : "from-has-") + this.className;
1991
+ document.documentElement.classList.add(r),
1992
+ setTimeout(() => document.documentElement.classList.remove(r), 500);
1993
+ }
1994
+ onPointerUp(n) {
1995
+ A || (this.setActive(!0), n.preventDefault());
1996
+ }
1997
+ onDocumentPointerDown(n) {
1998
+ if (this.active) {
1999
+ if (n.target.closest(".col-menu, .tsd-filter-group")) return;
2000
+ this.setActive(!1);
2001
+ }
2002
+ }
2003
+ onDocumentPointerUp(n) {
2004
+ if (!A && this.active && n.target.closest(".col-menu")) {
2005
+ const r = n.target.closest("a");
2006
+ if (r) {
2007
+ let i = window.location.href;
2008
+ i.indexOf("#") != -1 && (i = i.substring(0, i.indexOf("#"))),
2009
+ r.href.substring(0, i.length) == i &&
2010
+ setTimeout(() => this.setActive(!1), 250);
2011
+ }
2012
+ }
2013
+ }
2014
+ };
2015
+ var oe;
2016
+ try {
2017
+ oe = localStorage;
2018
+ } catch {
2019
+ oe = {
2020
+ getItem() {
2021
+ return null;
2022
+ },
2023
+ setItem() {},
2024
+ };
2025
+ }
2026
+ var Q = oe;
2027
+ var Le = document.head.appendChild(document.createElement("style"));
2028
+ Le.dataset.for = "filters";
2029
+ var ee = class extends I {
2030
+ constructor(n) {
2031
+ super(n);
2032
+ (this.key = `filter-${this.el.name}`),
2033
+ (this.value = this.el.checked),
2034
+ this.el.addEventListener("change", () => {
2035
+ this.setLocalStorage(this.el.checked);
2036
+ }),
2037
+ this.setLocalStorage(this.fromLocalStorage()),
2038
+ (Le.innerHTML += `html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; }
2039
+ `);
2040
+ }
2041
+ fromLocalStorage() {
2042
+ const n = Q.getItem(this.key);
2043
+ return n ? n === "true" : this.el.checked;
2044
+ }
2045
+ setLocalStorage(n) {
2046
+ Q.setItem(this.key, n.toString()),
2047
+ (this.value = n),
2048
+ this.handleValueChange();
2049
+ }
2050
+ handleValueChange() {
2051
+ (this.el.checked = this.value),
2052
+ document.documentElement.classList.toggle(this.key, this.value),
2053
+ this.app.filterChanged(),
2054
+ document.querySelectorAll(".tsd-index-section").forEach((n) => {
2055
+ n.style.display = "block";
2056
+ const r = Array.from(n.querySelectorAll(".tsd-index-link")).every(
2057
+ (i) => i.offsetParent == null,
2058
+ );
2059
+ n.style.display = r ? "none" : "block";
2060
+ });
2061
+ }
2062
+ };
2063
+ var te = class extends I {
2064
+ constructor(n) {
2065
+ super(n);
2066
+ this.calculateHeights(),
2067
+ (this.summary = this.el.querySelector(".tsd-accordion-summary")),
2068
+ (this.icon = this.summary.querySelector("svg")),
2069
+ (this.key = `tsd-accordion-${this.summary.textContent.replace(/\s+/g, "-").toLowerCase()}`),
2070
+ this.setLocalStorage(this.fromLocalStorage(), !0),
2071
+ this.summary.addEventListener("click", (r) => this.toggleVisibility(r)),
2072
+ (this.icon.style.transform = this.getIconRotation());
2073
+ }
2074
+ getIconRotation(n = this.el.open) {
2075
+ return `rotate(${n ? 0 : -90}deg)`;
2076
+ }
2077
+ calculateHeights() {
2078
+ const n = this.el.open,
2079
+ { position: r, left: i } = this.el.style;
2080
+ (this.el.style.position = "fixed"),
2081
+ (this.el.style.left = "-9999px"),
2082
+ (this.el.open = !0),
2083
+ (this.expandedHeight = this.el.offsetHeight + "px"),
2084
+ (this.el.open = !1),
2085
+ (this.collapsedHeight = this.el.offsetHeight + "px"),
2086
+ (this.el.open = n),
2087
+ (this.el.style.height = n ? this.expandedHeight : this.collapsedHeight),
2088
+ (this.el.style.position = r),
2089
+ (this.el.style.left = i);
2090
+ }
2091
+ toggleVisibility(n) {
2092
+ n.preventDefault(),
2093
+ (this.el.style.overflow = "hidden"),
2094
+ this.el.open ? this.collapse() : this.expand();
2095
+ }
2096
+ expand(n = !0) {
2097
+ (this.el.open = !0),
2098
+ this.animate(this.collapsedHeight, this.expandedHeight, {
2099
+ opening: !0,
2100
+ duration: n ? 300 : 0,
2101
+ });
2102
+ }
2103
+ collapse(n = !0) {
2104
+ this.animate(this.expandedHeight, this.collapsedHeight, {
2105
+ opening: !1,
2106
+ duration: n ? 300 : 0,
2107
+ });
2108
+ }
2109
+ animate(n, r, { opening: i, duration: s = 300 }) {
2110
+ if (this.animation) return;
2111
+ const o = { duration: s, easing: "ease" };
2112
+ (this.animation = this.el.animate({ height: [n, r] }, o)),
2113
+ this.icon
2114
+ .animate(
2115
+ {
2116
+ transform: [
2117
+ this.icon.style.transform || this.getIconRotation(!i),
2118
+ this.getIconRotation(i),
2119
+ ],
2120
+ },
2121
+ o,
2122
+ )
2123
+ .addEventListener("finish", () => {
2124
+ this.icon.style.transform = this.getIconRotation(i);
2125
+ }),
2126
+ this.animation.addEventListener("finish", () => this.animationEnd(i));
2127
+ }
2128
+ animationEnd(n) {
2129
+ (this.el.open = n),
2130
+ (this.animation = void 0),
2131
+ (this.el.style.height = "auto"),
2132
+ (this.el.style.overflow = "visible"),
2133
+ this.setLocalStorage(n);
2134
+ }
2135
+ fromLocalStorage() {
2136
+ const n = Q.getItem(this.key);
2137
+ return n ? n === "true" : this.el.open;
2138
+ }
2139
+ setLocalStorage(n, r = !1) {
2140
+ (this.fromLocalStorage() === n && !r) ||
2141
+ (Q.setItem(this.key, n.toString()),
2142
+ (this.el.open = n),
2143
+ this.handleValueChange(r));
2144
+ }
2145
+ handleValueChange(n = !1) {
2146
+ (this.fromLocalStorage() === this.el.open && !n) ||
2147
+ (this.fromLocalStorage() ? this.expand(!1) : this.collapse(!1));
2148
+ }
2149
+ };
2150
+ function be(t) {
2151
+ const e = Q.getItem("tsd-theme") || "os";
2152
+ (t.value = e),
2153
+ Ee(e),
2154
+ t.addEventListener("change", () => {
2155
+ Q.setItem("tsd-theme", t.value), Ee(t.value);
2156
+ });
2157
+ }
2158
+ function Ee(t) {
2159
+ document.documentElement.dataset.theme = t;
2160
+ }
2161
+ ve();
2162
+ B(X, ".menu-highlight");
2163
+ B(K, "a[data-toggle]");
2164
+ B(te, ".tsd-index-accordion");
2165
+ B(ee, ".tsd-filter-item input[type=checkbox]");
2166
+ var we = document.getElementById("theme");
2167
+ we && be(we);
2168
+ var je = new Y();
2169
+ Object.defineProperty(window, "app", { value: je });
2170
+ })();
2171
+ /*! Bundled license information:
2172
+
2173
+ lunr/lunr.js:
2174
+ (**
2175
+ * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9
2176
+ * Copyright (C) 2020 Oliver Nightingale
2177
+ * @license MIT
2178
+ *)
2179
+ (*!
2180
+ * lunr.utils
2181
+ * Copyright (C) 2020 Oliver Nightingale
2182
+ *)
2183
+ (*!
2184
+ * lunr.Set
2185
+ * Copyright (C) 2020 Oliver Nightingale
2186
+ *)
2187
+ (*!
2188
+ * lunr.tokenizer
2189
+ * Copyright (C) 2020 Oliver Nightingale
2190
+ *)
2191
+ (*!
2192
+ * lunr.Pipeline
2193
+ * Copyright (C) 2020 Oliver Nightingale
2194
+ *)
2195
+ (*!
2196
+ * lunr.Vector
2197
+ * Copyright (C) 2020 Oliver Nightingale
2198
+ *)
2199
+ (*!
2200
+ * lunr.stemmer
2201
+ * Copyright (C) 2020 Oliver Nightingale
2202
+ * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
2203
+ *)
2204
+ (*!
2205
+ * lunr.stopWordFilter
2206
+ * Copyright (C) 2020 Oliver Nightingale
2207
+ *)
2208
+ (*!
2209
+ * lunr.trimmer
2210
+ * Copyright (C) 2020 Oliver Nightingale
2211
+ *)
2212
+ (*!
2213
+ * lunr.TokenSet
2214
+ * Copyright (C) 2020 Oliver Nightingale
2215
+ *)
2216
+ (*!
2217
+ * lunr.Index
2218
+ * Copyright (C) 2020 Oliver Nightingale
2219
+ *)
2220
+ (*!
2221
+ * lunr.Builder
2222
+ * Copyright (C) 2020 Oliver Nightingale
2223
+ *)
2224
+ */