svelte-typeahead 4.4.1 → 5.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.
package/lib/index.js DELETED
@@ -1,2004 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["svelte-typeahead"] = {}));
5
- })(this, (function (exports) { 'use strict';
6
-
7
- function noop() { }
8
- function assign(tar, src) {
9
- // @ts-ignore
10
- for (const k in src)
11
- tar[k] = src[k];
12
- return tar;
13
- }
14
- function run(fn) {
15
- return fn();
16
- }
17
- function blank_object() {
18
- return Object.create(null);
19
- }
20
- function run_all(fns) {
21
- fns.forEach(run);
22
- }
23
- function is_function(thing) {
24
- return typeof thing === 'function';
25
- }
26
- function safe_not_equal(a, b) {
27
- return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
28
- }
29
- function is_empty(obj) {
30
- return Object.keys(obj).length === 0;
31
- }
32
- function create_slot(definition, ctx, $$scope, fn) {
33
- if (definition) {
34
- const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
35
- return definition[0](slot_ctx);
36
- }
37
- }
38
- function get_slot_context(definition, ctx, $$scope, fn) {
39
- return definition[1] && fn
40
- ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))
41
- : $$scope.ctx;
42
- }
43
- function get_slot_changes(definition, $$scope, dirty, fn) {
44
- if (definition[2] && fn) {
45
- const lets = definition[2](fn(dirty));
46
- if ($$scope.dirty === undefined) {
47
- return lets;
48
- }
49
- if (typeof lets === 'object') {
50
- const merged = [];
51
- const len = Math.max($$scope.dirty.length, lets.length);
52
- for (let i = 0; i < len; i += 1) {
53
- merged[i] = $$scope.dirty[i] | lets[i];
54
- }
55
- return merged;
56
- }
57
- return $$scope.dirty | lets;
58
- }
59
- return $$scope.dirty;
60
- }
61
- function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {
62
- if (slot_changes) {
63
- const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
64
- slot.p(slot_context, slot_changes);
65
- }
66
- }
67
- function get_all_dirty_from_scope($$scope) {
68
- if ($$scope.ctx.length > 32) {
69
- const dirty = [];
70
- const length = $$scope.ctx.length / 32;
71
- for (let i = 0; i < length; i++) {
72
- dirty[i] = -1;
73
- }
74
- return dirty;
75
- }
76
- return -1;
77
- }
78
- function exclude_internal_props(props) {
79
- const result = {};
80
- for (const k in props)
81
- if (k[0] !== '$')
82
- result[k] = props[k];
83
- return result;
84
- }
85
- function compute_rest_props(props, keys) {
86
- const rest = {};
87
- keys = new Set(keys);
88
- for (const k in props)
89
- if (!keys.has(k) && k[0] !== '$')
90
- rest[k] = props[k];
91
- return rest;
92
- }
93
- function compute_slots(slots) {
94
- const result = {};
95
- for (const key in slots) {
96
- result[key] = true;
97
- }
98
- return result;
99
- }
100
- function append(target, node) {
101
- target.appendChild(node);
102
- }
103
- function append_styles(target, style_sheet_id, styles) {
104
- const append_styles_to = get_root_for_style(target);
105
- if (!append_styles_to.getElementById(style_sheet_id)) {
106
- const style = element('style');
107
- style.id = style_sheet_id;
108
- style.textContent = styles;
109
- append_stylesheet(append_styles_to, style);
110
- }
111
- }
112
- function get_root_for_style(node) {
113
- if (!node)
114
- return document;
115
- const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;
116
- if (root && root.host) {
117
- return root;
118
- }
119
- return node.ownerDocument;
120
- }
121
- function append_stylesheet(node, style) {
122
- append(node.head || node, style);
123
- return style.sheet;
124
- }
125
- function insert(target, node, anchor) {
126
- target.insertBefore(node, anchor || null);
127
- }
128
- function detach(node) {
129
- node.parentNode.removeChild(node);
130
- }
131
- function destroy_each(iterations, detaching) {
132
- for (let i = 0; i < iterations.length; i += 1) {
133
- if (iterations[i])
134
- iterations[i].d(detaching);
135
- }
136
- }
137
- function element(name) {
138
- return document.createElement(name);
139
- }
140
- function svg_element(name) {
141
- return document.createElementNS('http://www.w3.org/2000/svg', name);
142
- }
143
- function text(data) {
144
- return document.createTextNode(data);
145
- }
146
- function space() {
147
- return text(' ');
148
- }
149
- function empty() {
150
- return text('');
151
- }
152
- function listen(node, event, handler, options) {
153
- node.addEventListener(event, handler, options);
154
- return () => node.removeEventListener(event, handler, options);
155
- }
156
- function prevent_default(fn) {
157
- return function (event) {
158
- event.preventDefault();
159
- // @ts-ignore
160
- return fn.call(this, event);
161
- };
162
- }
163
- function attr(node, attribute, value) {
164
- if (value == null)
165
- node.removeAttribute(attribute);
166
- else if (node.getAttribute(attribute) !== value)
167
- node.setAttribute(attribute, value);
168
- }
169
- function set_attributes(node, attributes) {
170
- // @ts-ignore
171
- const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);
172
- for (const key in attributes) {
173
- if (attributes[key] == null) {
174
- node.removeAttribute(key);
175
- }
176
- else if (key === 'style') {
177
- node.style.cssText = attributes[key];
178
- }
179
- else if (key === '__value') {
180
- node.value = node[key] = attributes[key];
181
- }
182
- else if (descriptors[key] && descriptors[key].set) {
183
- node[key] = attributes[key];
184
- }
185
- else {
186
- attr(node, key, attributes[key]);
187
- }
188
- }
189
- }
190
- function children(element) {
191
- return Array.from(element.childNodes);
192
- }
193
- function set_data(text, data) {
194
- data = '' + data;
195
- if (text.wholeText !== data)
196
- text.data = data;
197
- }
198
- function set_input_value(input, value) {
199
- input.value = value == null ? '' : value;
200
- }
201
- function toggle_class(element, name, toggle) {
202
- element.classList[toggle ? 'add' : 'remove'](name);
203
- }
204
- function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {
205
- const e = document.createEvent('CustomEvent');
206
- e.initCustomEvent(type, bubbles, cancelable, detail);
207
- return e;
208
- }
209
- class HtmlTag {
210
- constructor(is_svg = false) {
211
- this.is_svg = false;
212
- this.is_svg = is_svg;
213
- this.e = this.n = null;
214
- }
215
- c(html) {
216
- this.h(html);
217
- }
218
- m(html, target, anchor = null) {
219
- if (!this.e) {
220
- if (this.is_svg)
221
- this.e = svg_element(target.nodeName);
222
- else
223
- this.e = element(target.nodeName);
224
- this.t = target;
225
- this.c(html);
226
- }
227
- this.i(anchor);
228
- }
229
- h(html) {
230
- this.e.innerHTML = html;
231
- this.n = Array.from(this.e.childNodes);
232
- }
233
- i(anchor) {
234
- for (let i = 0; i < this.n.length; i += 1) {
235
- insert(this.t, this.n[i], anchor);
236
- }
237
- }
238
- p(html) {
239
- this.d();
240
- this.h(html);
241
- this.i(this.a);
242
- }
243
- d() {
244
- this.n.forEach(detach);
245
- }
246
- }
247
-
248
- let current_component;
249
- function set_current_component(component) {
250
- current_component = component;
251
- }
252
- function get_current_component() {
253
- if (!current_component)
254
- throw new Error('Function called outside component initialization');
255
- return current_component;
256
- }
257
- /**
258
- * The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.
259
- * It must be called during the component's initialisation (but doesn't need to live *inside* the component;
260
- * it can be called from an external module).
261
- *
262
- * `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).
263
- *
264
- * https://svelte.dev/docs#run-time-svelte-onmount
265
- */
266
- function onMount(fn) {
267
- get_current_component().$$.on_mount.push(fn);
268
- }
269
- /**
270
- * Schedules a callback to run immediately after the component has been updated.
271
- *
272
- * The first time the callback runs will be after the initial `onMount`
273
- */
274
- function afterUpdate(fn) {
275
- get_current_component().$$.after_update.push(fn);
276
- }
277
- /**
278
- * Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname).
279
- * Event dispatchers are functions that can take two arguments: `name` and `detail`.
280
- *
281
- * Component events created with `createEventDispatcher` create a
282
- * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).
283
- * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).
284
- * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)
285
- * property and can contain any type of data.
286
- *
287
- * https://svelte.dev/docs#run-time-svelte-createeventdispatcher
288
- */
289
- function createEventDispatcher() {
290
- const component = get_current_component();
291
- return (type, detail, { cancelable = false } = {}) => {
292
- const callbacks = component.$$.callbacks[type];
293
- if (callbacks) {
294
- // TODO are there situations where events could be dispatched
295
- // in a server (non-DOM) environment?
296
- const event = custom_event(type, detail, { cancelable });
297
- callbacks.slice().forEach(fn => {
298
- fn.call(component, event);
299
- });
300
- return !event.defaultPrevented;
301
- }
302
- return true;
303
- };
304
- }
305
- // TODO figure out if we still want to support
306
- // shorthand events, or if we want to implement
307
- // a real bubbling mechanism
308
- function bubble(component, event) {
309
- const callbacks = component.$$.callbacks[event.type];
310
- if (callbacks) {
311
- // @ts-ignore
312
- callbacks.slice().forEach(fn => fn.call(this, event));
313
- }
314
- }
315
-
316
- const dirty_components = [];
317
- const binding_callbacks = [];
318
- const render_callbacks = [];
319
- const flush_callbacks = [];
320
- const resolved_promise = Promise.resolve();
321
- let update_scheduled = false;
322
- function schedule_update() {
323
- if (!update_scheduled) {
324
- update_scheduled = true;
325
- resolved_promise.then(flush);
326
- }
327
- }
328
- function tick() {
329
- schedule_update();
330
- return resolved_promise;
331
- }
332
- function add_render_callback(fn) {
333
- render_callbacks.push(fn);
334
- }
335
- function add_flush_callback(fn) {
336
- flush_callbacks.push(fn);
337
- }
338
- // flush() calls callbacks in this order:
339
- // 1. All beforeUpdate callbacks, in order: parents before children
340
- // 2. All bind:this callbacks, in reverse order: children before parents.
341
- // 3. All afterUpdate callbacks, in order: parents before children. EXCEPT
342
- // for afterUpdates called during the initial onMount, which are called in
343
- // reverse order: children before parents.
344
- // Since callbacks might update component values, which could trigger another
345
- // call to flush(), the following steps guard against this:
346
- // 1. During beforeUpdate, any updated components will be added to the
347
- // dirty_components array and will cause a reentrant call to flush(). Because
348
- // the flush index is kept outside the function, the reentrant call will pick
349
- // up where the earlier call left off and go through all dirty components. The
350
- // current_component value is saved and restored so that the reentrant call will
351
- // not interfere with the "parent" flush() call.
352
- // 2. bind:this callbacks cannot trigger new flush() calls.
353
- // 3. During afterUpdate, any updated components will NOT have their afterUpdate
354
- // callback called a second time; the seen_callbacks set, outside the flush()
355
- // function, guarantees this behavior.
356
- const seen_callbacks = new Set();
357
- let flushidx = 0; // Do *not* move this inside the flush() function
358
- function flush() {
359
- const saved_component = current_component;
360
- do {
361
- // first, call beforeUpdate functions
362
- // and update components
363
- while (flushidx < dirty_components.length) {
364
- const component = dirty_components[flushidx];
365
- flushidx++;
366
- set_current_component(component);
367
- update(component.$$);
368
- }
369
- set_current_component(null);
370
- dirty_components.length = 0;
371
- flushidx = 0;
372
- while (binding_callbacks.length)
373
- binding_callbacks.pop()();
374
- // then, once components are updated, call
375
- // afterUpdate functions. This may cause
376
- // subsequent updates...
377
- for (let i = 0; i < render_callbacks.length; i += 1) {
378
- const callback = render_callbacks[i];
379
- if (!seen_callbacks.has(callback)) {
380
- // ...so guard against infinite loops
381
- seen_callbacks.add(callback);
382
- callback();
383
- }
384
- }
385
- render_callbacks.length = 0;
386
- } while (dirty_components.length);
387
- while (flush_callbacks.length) {
388
- flush_callbacks.pop()();
389
- }
390
- update_scheduled = false;
391
- seen_callbacks.clear();
392
- set_current_component(saved_component);
393
- }
394
- function update($$) {
395
- if ($$.fragment !== null) {
396
- $$.update();
397
- run_all($$.before_update);
398
- const dirty = $$.dirty;
399
- $$.dirty = [-1];
400
- $$.fragment && $$.fragment.p($$.ctx, dirty);
401
- $$.after_update.forEach(add_render_callback);
402
- }
403
- }
404
- const outroing = new Set();
405
- let outros;
406
- function group_outros() {
407
- outros = {
408
- r: 0,
409
- c: [],
410
- p: outros // parent group
411
- };
412
- }
413
- function check_outros() {
414
- if (!outros.r) {
415
- run_all(outros.c);
416
- }
417
- outros = outros.p;
418
- }
419
- function transition_in(block, local) {
420
- if (block && block.i) {
421
- outroing.delete(block);
422
- block.i(local);
423
- }
424
- }
425
- function transition_out(block, local, detach, callback) {
426
- if (block && block.o) {
427
- if (outroing.has(block))
428
- return;
429
- outroing.add(block);
430
- outros.c.push(() => {
431
- outroing.delete(block);
432
- if (callback) {
433
- if (detach)
434
- block.d(1);
435
- callback();
436
- }
437
- });
438
- block.o(local);
439
- }
440
- else if (callback) {
441
- callback();
442
- }
443
- }
444
-
445
- function get_spread_update(levels, updates) {
446
- const update = {};
447
- const to_null_out = {};
448
- const accounted_for = { $$scope: 1 };
449
- let i = levels.length;
450
- while (i--) {
451
- const o = levels[i];
452
- const n = updates[i];
453
- if (n) {
454
- for (const key in o) {
455
- if (!(key in n))
456
- to_null_out[key] = 1;
457
- }
458
- for (const key in n) {
459
- if (!accounted_for[key]) {
460
- update[key] = n[key];
461
- accounted_for[key] = 1;
462
- }
463
- }
464
- levels[i] = n;
465
- }
466
- else {
467
- for (const key in o) {
468
- accounted_for[key] = 1;
469
- }
470
- }
471
- }
472
- for (const key in to_null_out) {
473
- if (!(key in update))
474
- update[key] = undefined;
475
- }
476
- return update;
477
- }
478
- function get_spread_object(spread_props) {
479
- return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};
480
- }
481
-
482
- function bind(component, name, callback) {
483
- const index = component.$$.props[name];
484
- if (index !== undefined) {
485
- component.$$.bound[index] = callback;
486
- callback(component.$$.ctx[index]);
487
- }
488
- }
489
- function create_component(block) {
490
- block && block.c();
491
- }
492
- function mount_component(component, target, anchor, customElement) {
493
- const { fragment, after_update } = component.$$;
494
- fragment && fragment.m(target, anchor);
495
- if (!customElement) {
496
- // onMount happens before the initial afterUpdate
497
- add_render_callback(() => {
498
- const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
499
- // if the component was destroyed immediately
500
- // it will update the `$$.on_destroy` reference to `null`.
501
- // the destructured on_destroy may still reference to the old array
502
- if (component.$$.on_destroy) {
503
- component.$$.on_destroy.push(...new_on_destroy);
504
- }
505
- else {
506
- // Edge case - component was destroyed immediately,
507
- // most likely as a result of a binding initialising
508
- run_all(new_on_destroy);
509
- }
510
- component.$$.on_mount = [];
511
- });
512
- }
513
- after_update.forEach(add_render_callback);
514
- }
515
- function destroy_component(component, detaching) {
516
- const $$ = component.$$;
517
- if ($$.fragment !== null) {
518
- run_all($$.on_destroy);
519
- $$.fragment && $$.fragment.d(detaching);
520
- // TODO null out other refs, including component.$$ (but need to
521
- // preserve final state?)
522
- $$.on_destroy = $$.fragment = null;
523
- $$.ctx = [];
524
- }
525
- }
526
- function make_dirty(component, i) {
527
- if (component.$$.dirty[0] === -1) {
528
- dirty_components.push(component);
529
- schedule_update();
530
- component.$$.dirty.fill(0);
531
- }
532
- component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));
533
- }
534
- function init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {
535
- const parent_component = current_component;
536
- set_current_component(component);
537
- const $$ = component.$$ = {
538
- fragment: null,
539
- ctx: [],
540
- // state
541
- props,
542
- update: noop,
543
- not_equal,
544
- bound: blank_object(),
545
- // lifecycle
546
- on_mount: [],
547
- on_destroy: [],
548
- on_disconnect: [],
549
- before_update: [],
550
- after_update: [],
551
- context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
552
- // everything else
553
- callbacks: blank_object(),
554
- dirty,
555
- skip_bound: false,
556
- root: options.target || parent_component.$$.root
557
- };
558
- append_styles && append_styles($$.root);
559
- let ready = false;
560
- $$.ctx = instance
561
- ? instance(component, options.props || {}, (i, ret, ...rest) => {
562
- const value = rest.length ? rest[0] : ret;
563
- if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
564
- if (!$$.skip_bound && $$.bound[i])
565
- $$.bound[i](value);
566
- if (ready)
567
- make_dirty(component, i);
568
- }
569
- return ret;
570
- })
571
- : [];
572
- $$.update();
573
- ready = true;
574
- run_all($$.before_update);
575
- // `false` as a special case of no DOM component
576
- $$.fragment = create_fragment ? create_fragment($$.ctx) : false;
577
- if (options.target) {
578
- if (options.hydrate) {
579
- const nodes = children(options.target);
580
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
581
- $$.fragment && $$.fragment.l(nodes);
582
- nodes.forEach(detach);
583
- }
584
- else {
585
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
586
- $$.fragment && $$.fragment.c();
587
- }
588
- if (options.intro)
589
- transition_in(component.$$.fragment);
590
- mount_component(component, options.target, options.anchor, options.customElement);
591
- flush();
592
- }
593
- set_current_component(parent_component);
594
- }
595
- /**
596
- * Base class for Svelte components. Used when dev=false.
597
- */
598
- class SvelteComponent {
599
- $destroy() {
600
- destroy_component(this, 1);
601
- this.$destroy = noop;
602
- }
603
- $on(type, callback) {
604
- if (!is_function(callback)) {
605
- return noop;
606
- }
607
- const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
608
- callbacks.push(callback);
609
- return () => {
610
- const index = callbacks.indexOf(callback);
611
- if (index !== -1)
612
- callbacks.splice(index, 1);
613
- };
614
- }
615
- $set($$props) {
616
- if (this.$$set && !is_empty($$props)) {
617
- this.$$.skip_bound = true;
618
- this.$$set($$props);
619
- this.$$.skip_bound = false;
620
- }
621
- }
622
- }
623
-
624
- var fuzzy$1 = {exports: {}};
625
-
626
- /*
627
- * Fuzzy
628
- * https://github.com/myork/fuzzy
629
- *
630
- * Copyright (c) 2012 Matt York
631
- * Licensed under the MIT license.
632
- */
633
-
634
- (function (module, exports) {
635
- (function() {
636
-
637
- var fuzzy = {};
638
-
639
- // Use in node or in browser
640
- {
641
- module.exports = fuzzy;
642
- }
643
-
644
- // Return all elements of `array` that have a fuzzy
645
- // match against `pattern`.
646
- fuzzy.simpleFilter = function(pattern, array) {
647
- return array.filter(function(str) {
648
- return fuzzy.test(pattern, str);
649
- });
650
- };
651
-
652
- // Does `pattern` fuzzy match `str`?
653
- fuzzy.test = function(pattern, str) {
654
- return fuzzy.match(pattern, str) !== null;
655
- };
656
-
657
- // If `pattern` matches `str`, wrap each matching character
658
- // in `opts.pre` and `opts.post`. If no match, return null
659
- fuzzy.match = function(pattern, str, opts) {
660
- opts = opts || {};
661
- var patternIdx = 0
662
- , result = []
663
- , len = str.length
664
- , totalScore = 0
665
- , currScore = 0
666
- // prefix
667
- , pre = opts.pre || ''
668
- // suffix
669
- , post = opts.post || ''
670
- // String to compare against. This might be a lowercase version of the
671
- // raw string
672
- , compareString = opts.caseSensitive && str || str.toLowerCase()
673
- , ch;
674
-
675
- pattern = opts.caseSensitive && pattern || pattern.toLowerCase();
676
-
677
- // For each character in the string, either add it to the result
678
- // or wrap in template if it's the next string in the pattern
679
- for(var idx = 0; idx < len; idx++) {
680
- ch = str[idx];
681
- if(compareString[idx] === pattern[patternIdx]) {
682
- ch = pre + ch + post;
683
- patternIdx += 1;
684
-
685
- // consecutive characters should increase the score more than linearly
686
- currScore += 1 + currScore;
687
- } else {
688
- currScore = 0;
689
- }
690
- totalScore += currScore;
691
- result[result.length] = ch;
692
- }
693
-
694
- // return rendered string if we have a match for every char
695
- if(patternIdx === pattern.length) {
696
- // if the string is an exact match with pattern, totalScore should be maxed
697
- totalScore = (compareString === pattern) ? Infinity : totalScore;
698
- return {rendered: result.join(''), score: totalScore};
699
- }
700
-
701
- return null;
702
- };
703
-
704
- // The normal entry point. Filters `arr` for matches against `pattern`.
705
- // It returns an array with matching values of the type:
706
- //
707
- // [{
708
- // string: '<b>lah' // The rendered string
709
- // , index: 2 // The index of the element in `arr`
710
- // , original: 'blah' // The original element in `arr`
711
- // }]
712
- //
713
- // `opts` is an optional argument bag. Details:
714
- //
715
- // opts = {
716
- // // string to put before a matching character
717
- // pre: '<b>'
718
- //
719
- // // string to put after matching character
720
- // , post: '</b>'
721
- //
722
- // // Optional function. Input is an entry in the given arr`,
723
- // // output should be the string to test `pattern` against.
724
- // // In this example, if `arr = [{crying: 'koala'}]` we would return
725
- // // 'koala'.
726
- // , extract: function(arg) { return arg.crying; }
727
- // }
728
- fuzzy.filter = function(pattern, arr, opts) {
729
- if(!arr || arr.length === 0) {
730
- return [];
731
- }
732
- if (typeof pattern !== 'string') {
733
- return arr;
734
- }
735
- opts = opts || {};
736
- return arr
737
- .reduce(function(prev, element, idx, arr) {
738
- var str = element;
739
- if(opts.extract) {
740
- str = opts.extract(element);
741
- }
742
- var rendered = fuzzy.match(pattern, str, opts);
743
- if(rendered != null) {
744
- prev[prev.length] = {
745
- string: rendered.rendered
746
- , score: rendered.score
747
- , index: idx
748
- , original: element
749
- };
750
- }
751
- return prev;
752
- }, [])
753
-
754
- // Sort by score. Browsers are inconsistent wrt stable/unstable
755
- // sorting, so force stable by using the index in the case of tie.
756
- // See http://ofb.net/~sethml/is-sort-stable.html
757
- .sort(function(a,b) {
758
- var compare = b.score - a.score;
759
- if(compare) return compare;
760
- return a.index - b.index;
761
- });
762
- };
763
-
764
-
765
- }());
766
- }(fuzzy$1));
767
-
768
- var fuzzy = fuzzy$1.exports;
769
-
770
- /* node_modules/svelte-search/src/Search.svelte generated by Svelte v3.52.0 */
771
-
772
- function add_css$1(target) {
773
- append_styles(target, "svelte-5m0wg6", ".hide-label.svelte-5m0wg6{position:absolute;height:1px;width:1px;overflow:hidden;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);white-space:nowrap}");
774
- }
775
-
776
- const get_label_slot_changes = dirty => ({});
777
- const get_label_slot_context = ctx => ({});
778
-
779
- // (60:23) {label}
780
- function fallback_block$1(ctx) {
781
- let t;
782
-
783
- return {
784
- c() {
785
- t = text(/*label*/ ctx[2]);
786
- },
787
- m(target, anchor) {
788
- insert(target, t, anchor);
789
- },
790
- p(ctx, dirty) {
791
- if (dirty & /*label*/ 4) set_data(t, /*label*/ ctx[2]);
792
- },
793
- d(detaching) {
794
- if (detaching) detach(t);
795
- }
796
- };
797
- }
798
-
799
- function create_fragment$1(ctx) {
800
- let form;
801
- let label_1;
802
- let label_1_id_value;
803
- let t;
804
- let input;
805
- let form_role_value;
806
- let form_aria_labelledby_value;
807
- let current;
808
- let mounted;
809
- let dispose;
810
- const label_slot_template = /*#slots*/ ctx[10].label;
811
- const label_slot = create_slot(label_slot_template, ctx, /*$$scope*/ ctx[9], get_label_slot_context);
812
- const label_slot_or_fallback = label_slot || fallback_block$1(ctx);
813
-
814
- let input_levels = [
815
- { name: "search" },
816
- { type: "search" },
817
- { placeholder: "Search..." },
818
- { autocomplete: "off" },
819
- { spellcheck: "false" },
820
- /*$$restProps*/ ctx[6],
821
- { id: /*id*/ ctx[4] }
822
- ];
823
-
824
- let input_data = {};
825
-
826
- for (let i = 0; i < input_levels.length; i += 1) {
827
- input_data = assign(input_data, input_levels[i]);
828
- }
829
-
830
- return {
831
- c() {
832
- form = element("form");
833
- label_1 = element("label");
834
- if (label_slot_or_fallback) label_slot_or_fallback.c();
835
- t = space();
836
- input = element("input");
837
- attr(label_1, "id", label_1_id_value = "" + (/*id*/ ctx[4] + "-label"));
838
- attr(label_1, "for", /*id*/ ctx[4]);
839
- attr(label_1, "class", "svelte-5m0wg6");
840
- toggle_class(label_1, "hide-label", /*hideLabel*/ ctx[3]);
841
- set_attributes(input, input_data);
842
- toggle_class(input, "svelte-5m0wg6", true);
843
- attr(form, "data-svelte-search", "");
844
- attr(form, "role", form_role_value = /*removeFormAriaAttributes*/ ctx[5] ? null : "search");
845
-
846
- attr(form, "aria-labelledby", form_aria_labelledby_value = /*removeFormAriaAttributes*/ ctx[5]
847
- ? null
848
- : /*id*/ ctx[4]);
849
- },
850
- m(target, anchor) {
851
- insert(target, form, anchor);
852
- append(form, label_1);
853
-
854
- if (label_slot_or_fallback) {
855
- label_slot_or_fallback.m(label_1, null);
856
- }
857
-
858
- append(form, t);
859
- append(form, input);
860
- if (input.autofocus) input.focus();
861
- /*input_binding*/ ctx[17](input);
862
- set_input_value(input, /*value*/ ctx[0]);
863
- current = true;
864
-
865
- if (!mounted) {
866
- dispose = [
867
- listen(input, "input", /*input_input_handler*/ ctx[18]),
868
- listen(input, "input", /*input_handler*/ ctx[12]),
869
- listen(input, "change", /*change_handler*/ ctx[13]),
870
- listen(input, "focus", /*focus_handler*/ ctx[14]),
871
- listen(input, "blur", /*blur_handler*/ ctx[15]),
872
- listen(input, "keydown", /*keydown_handler*/ ctx[16]),
873
- listen(form, "submit", prevent_default(/*submit_handler*/ ctx[11]))
874
- ];
875
-
876
- mounted = true;
877
- }
878
- },
879
- p(ctx, [dirty]) {
880
- if (label_slot) {
881
- if (label_slot.p && (!current || dirty & /*$$scope*/ 512)) {
882
- update_slot_base(
883
- label_slot,
884
- label_slot_template,
885
- ctx,
886
- /*$$scope*/ ctx[9],
887
- !current
888
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[9])
889
- : get_slot_changes(label_slot_template, /*$$scope*/ ctx[9], dirty, get_label_slot_changes),
890
- get_label_slot_context
891
- );
892
- }
893
- } else {
894
- if (label_slot_or_fallback && label_slot_or_fallback.p && (!current || dirty & /*label*/ 4)) {
895
- label_slot_or_fallback.p(ctx, !current ? -1 : dirty);
896
- }
897
- }
898
-
899
- if (!current || dirty & /*id*/ 16 && label_1_id_value !== (label_1_id_value = "" + (/*id*/ ctx[4] + "-label"))) {
900
- attr(label_1, "id", label_1_id_value);
901
- }
902
-
903
- if (!current || dirty & /*id*/ 16) {
904
- attr(label_1, "for", /*id*/ ctx[4]);
905
- }
906
-
907
- if (!current || dirty & /*hideLabel*/ 8) {
908
- toggle_class(label_1, "hide-label", /*hideLabel*/ ctx[3]);
909
- }
910
-
911
- set_attributes(input, input_data = get_spread_update(input_levels, [
912
- { name: "search" },
913
- { type: "search" },
914
- { placeholder: "Search..." },
915
- { autocomplete: "off" },
916
- { spellcheck: "false" },
917
- dirty & /*$$restProps*/ 64 && /*$$restProps*/ ctx[6],
918
- (!current || dirty & /*id*/ 16) && { id: /*id*/ ctx[4] }
919
- ]));
920
-
921
- if (dirty & /*value*/ 1) {
922
- set_input_value(input, /*value*/ ctx[0]);
923
- }
924
-
925
- toggle_class(input, "svelte-5m0wg6", true);
926
-
927
- if (!current || dirty & /*removeFormAriaAttributes*/ 32 && form_role_value !== (form_role_value = /*removeFormAriaAttributes*/ ctx[5] ? null : "search")) {
928
- attr(form, "role", form_role_value);
929
- }
930
-
931
- if (!current || dirty & /*removeFormAriaAttributes, id*/ 48 && form_aria_labelledby_value !== (form_aria_labelledby_value = /*removeFormAriaAttributes*/ ctx[5]
932
- ? null
933
- : /*id*/ ctx[4])) {
934
- attr(form, "aria-labelledby", form_aria_labelledby_value);
935
- }
936
- },
937
- i(local) {
938
- if (current) return;
939
- transition_in(label_slot_or_fallback, local);
940
- current = true;
941
- },
942
- o(local) {
943
- transition_out(label_slot_or_fallback, local);
944
- current = false;
945
- },
946
- d(detaching) {
947
- if (detaching) detach(form);
948
- if (label_slot_or_fallback) label_slot_or_fallback.d(detaching);
949
- /*input_binding*/ ctx[17](null);
950
- mounted = false;
951
- run_all(dispose);
952
- }
953
- };
954
- }
955
-
956
- function instance$1($$self, $$props, $$invalidate) {
957
- const omit_props_names = [
958
- "value","autofocus","debounce","label","hideLabel","id","ref","removeFormAriaAttributes"
959
- ];
960
-
961
- let $$restProps = compute_rest_props($$props, omit_props_names);
962
- let { $$slots: slots = {}, $$scope } = $$props;
963
- let { value = "" } = $$props;
964
- let { autofocus = false } = $$props;
965
- let { debounce = 0 } = $$props;
966
- let { label = "Label" } = $$props;
967
- let { hideLabel = false } = $$props;
968
- let { id = "search" + Math.random().toString(36) } = $$props;
969
- let { ref = null } = $$props;
970
- let { removeFormAriaAttributes = false } = $$props;
971
- const dispatch = createEventDispatcher();
972
- let prevValue = value;
973
- let timeout = undefined;
974
- let calling = false;
975
-
976
- function debounced(cb) {
977
- if (calling) return;
978
- calling = true;
979
-
980
- timeout = setTimeout(
981
- () => {
982
- cb();
983
- calling = false;
984
- },
985
- debounce
986
- );
987
- }
988
-
989
- onMount(() => {
990
- if (autofocus) window.requestAnimationFrame(() => ref.focus());
991
- return () => clearTimeout(timeout);
992
- });
993
-
994
- afterUpdate(() => {
995
- if (value.length > 0 && value !== prevValue) {
996
- if (debounce > 0) {
997
- debounced(() => dispatch("type", value));
998
- } else {
999
- dispatch("type", value);
1000
- }
1001
- }
1002
-
1003
- if (value.length === 0 && prevValue.length > 0) dispatch("clear");
1004
- prevValue = value;
1005
- });
1006
-
1007
- function submit_handler(event) {
1008
- bubble.call(this, $$self, event);
1009
- }
1010
-
1011
- function input_handler(event) {
1012
- bubble.call(this, $$self, event);
1013
- }
1014
-
1015
- function change_handler(event) {
1016
- bubble.call(this, $$self, event);
1017
- }
1018
-
1019
- function focus_handler(event) {
1020
- bubble.call(this, $$self, event);
1021
- }
1022
-
1023
- function blur_handler(event) {
1024
- bubble.call(this, $$self, event);
1025
- }
1026
-
1027
- function keydown_handler(event) {
1028
- bubble.call(this, $$self, event);
1029
- }
1030
-
1031
- function input_binding($$value) {
1032
- binding_callbacks[$$value ? 'unshift' : 'push'](() => {
1033
- ref = $$value;
1034
- $$invalidate(1, ref);
1035
- });
1036
- }
1037
-
1038
- function input_input_handler() {
1039
- value = this.value;
1040
- $$invalidate(0, value);
1041
- }
1042
-
1043
- $$self.$$set = $$new_props => {
1044
- $$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
1045
- $$invalidate(6, $$restProps = compute_rest_props($$props, omit_props_names));
1046
- if ('value' in $$new_props) $$invalidate(0, value = $$new_props.value);
1047
- if ('autofocus' in $$new_props) $$invalidate(7, autofocus = $$new_props.autofocus);
1048
- if ('debounce' in $$new_props) $$invalidate(8, debounce = $$new_props.debounce);
1049
- if ('label' in $$new_props) $$invalidate(2, label = $$new_props.label);
1050
- if ('hideLabel' in $$new_props) $$invalidate(3, hideLabel = $$new_props.hideLabel);
1051
- if ('id' in $$new_props) $$invalidate(4, id = $$new_props.id);
1052
- if ('ref' in $$new_props) $$invalidate(1, ref = $$new_props.ref);
1053
- if ('removeFormAriaAttributes' in $$new_props) $$invalidate(5, removeFormAriaAttributes = $$new_props.removeFormAriaAttributes);
1054
- if ('$$scope' in $$new_props) $$invalidate(9, $$scope = $$new_props.$$scope);
1055
- };
1056
-
1057
- return [
1058
- value,
1059
- ref,
1060
- label,
1061
- hideLabel,
1062
- id,
1063
- removeFormAriaAttributes,
1064
- $$restProps,
1065
- autofocus,
1066
- debounce,
1067
- $$scope,
1068
- slots,
1069
- submit_handler,
1070
- input_handler,
1071
- change_handler,
1072
- focus_handler,
1073
- blur_handler,
1074
- keydown_handler,
1075
- input_binding,
1076
- input_input_handler
1077
- ];
1078
- }
1079
-
1080
- class Search extends SvelteComponent {
1081
- constructor(options) {
1082
- super();
1083
-
1084
- init(
1085
- this,
1086
- options,
1087
- instance$1,
1088
- create_fragment$1,
1089
- safe_not_equal,
1090
- {
1091
- value: 0,
1092
- autofocus: 7,
1093
- debounce: 8,
1094
- label: 2,
1095
- hideLabel: 3,
1096
- id: 4,
1097
- ref: 1,
1098
- removeFormAriaAttributes: 5
1099
- },
1100
- add_css$1
1101
- );
1102
- }
1103
- }
1104
-
1105
- var Search$1 = Search;
1106
-
1107
- /* src/Typeahead.svelte generated by Svelte v3.52.0 */
1108
-
1109
- function add_css(target) {
1110
- append_styles(target, "svelte-1t4elht", "[data-svelte-typeahead].svelte-1t4elht.svelte-1t4elht{position:relative;background-color:#fff}ul.svelte-1t4elht.svelte-1t4elht{position:absolute;top:100%;left:0;width:100%;margin:0;padding:0;list-style:none;background-color:inherit;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1)}[aria-expanded=\"true\"].svelte-1t4elht ul.svelte-1t4elht{z-index:1}li.svelte-1t4elht.svelte-1t4elht,.no-results.svelte-1t4elht.svelte-1t4elht{padding:0.25rem 1rem}li.svelte-1t4elht.svelte-1t4elht{cursor:pointer}li.svelte-1t4elht.svelte-1t4elht:not(:last-of-type){border-bottom:1px solid #e0e0e0}li.svelte-1t4elht.svelte-1t4elht:hover{background-color:#e5e5e5}.selected.svelte-1t4elht.svelte-1t4elht{background-color:#e5e5e5}.selected.svelte-1t4elht.svelte-1t4elht:hover{background-color:#cacaca}.disabled.svelte-1t4elht.svelte-1t4elht{opacity:0.4;cursor:not-allowed}[data-svelte-search] label{margin-bottom:0.25rem;display:inline-flex;font-size:0.875rem}[data-svelte-search] input{width:100%;padding:0.5rem 0.75rem;background:none;font-size:1rem;border:0;border-radius:0;border:1px solid #e5e5e5}[data-svelte-search] input:focus{outline-color:#0f62fe;outline-offset:2px;outline-width:1px}");
1111
- }
1112
-
1113
- const get_no_results_slot_changes = dirty => ({
1114
- value: dirty[0] & /*value*/ 1,
1115
- result: dirty[0] & /*results*/ 2
1116
- });
1117
-
1118
- const get_no_results_slot_context = ctx => ({
1119
- value: /*value*/ ctx[0],
1120
- result: /*result*/ ctx[47],
1121
- index: /*index*/ ctx[49]
1122
- });
1123
-
1124
- function get_each_context(ctx, list, i) {
1125
- const child_ctx = ctx.slice();
1126
- child_ctx[47] = list[i];
1127
- child_ctx[49] = i;
1128
- return child_ctx;
1129
- }
1130
-
1131
- const get_default_slot_changes = dirty => ({
1132
- result: dirty[0] & /*results*/ 2,
1133
- value: dirty[0] & /*value*/ 1
1134
- });
1135
-
1136
- const get_default_slot_context = ctx => ({
1137
- result: /*result*/ ctx[47],
1138
- index: /*index*/ ctx[49],
1139
- value: /*value*/ ctx[0]
1140
- });
1141
-
1142
- // (247:4) {#if showResults}
1143
- function create_if_block_1(ctx) {
1144
- let each_1_anchor;
1145
- let current;
1146
- let each_value = /*results*/ ctx[1];
1147
- let each_blocks = [];
1148
-
1149
- for (let i = 0; i < each_value.length; i += 1) {
1150
- each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
1151
- }
1152
-
1153
- const out = i => transition_out(each_blocks[i], 1, 1, () => {
1154
- each_blocks[i] = null;
1155
- });
1156
-
1157
- return {
1158
- c() {
1159
- for (let i = 0; i < each_blocks.length; i += 1) {
1160
- each_blocks[i].c();
1161
- }
1162
-
1163
- each_1_anchor = empty();
1164
- },
1165
- m(target, anchor) {
1166
- for (let i = 0; i < each_blocks.length; i += 1) {
1167
- each_blocks[i].m(target, anchor);
1168
- }
1169
-
1170
- insert(target, each_1_anchor, anchor);
1171
- current = true;
1172
- },
1173
- p(ctx, dirty) {
1174
- if (dirty[0] & /*id, selectedIndex, results, select, $$scope, value*/ 67111943) {
1175
- each_value = /*results*/ ctx[1];
1176
- let i;
1177
-
1178
- for (i = 0; i < each_value.length; i += 1) {
1179
- const child_ctx = get_each_context(ctx, each_value, i);
1180
-
1181
- if (each_blocks[i]) {
1182
- each_blocks[i].p(child_ctx, dirty);
1183
- transition_in(each_blocks[i], 1);
1184
- } else {
1185
- each_blocks[i] = create_each_block(child_ctx);
1186
- each_blocks[i].c();
1187
- transition_in(each_blocks[i], 1);
1188
- each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
1189
- }
1190
- }
1191
-
1192
- group_outros();
1193
-
1194
- for (i = each_value.length; i < each_blocks.length; i += 1) {
1195
- out(i);
1196
- }
1197
-
1198
- check_outros();
1199
- }
1200
- },
1201
- i(local) {
1202
- if (current) return;
1203
-
1204
- for (let i = 0; i < each_value.length; i += 1) {
1205
- transition_in(each_blocks[i]);
1206
- }
1207
-
1208
- current = true;
1209
- },
1210
- o(local) {
1211
- each_blocks = each_blocks.filter(Boolean);
1212
-
1213
- for (let i = 0; i < each_blocks.length; i += 1) {
1214
- transition_out(each_blocks[i]);
1215
- }
1216
-
1217
- current = false;
1218
- },
1219
- d(detaching) {
1220
- destroy_each(each_blocks, detaching);
1221
- if (detaching) detach(each_1_anchor);
1222
- }
1223
- };
1224
- }
1225
-
1226
- // (266:41)
1227
- function fallback_block(ctx) {
1228
- let html_tag;
1229
- let raw_value = /*result*/ ctx[47].string + "";
1230
- let html_anchor;
1231
-
1232
- return {
1233
- c() {
1234
- html_tag = new HtmlTag(false);
1235
- html_anchor = empty();
1236
- html_tag.a = html_anchor;
1237
- },
1238
- m(target, anchor) {
1239
- html_tag.m(raw_value, target, anchor);
1240
- insert(target, html_anchor, anchor);
1241
- },
1242
- p(ctx, dirty) {
1243
- if (dirty[0] & /*results*/ 2 && raw_value !== (raw_value = /*result*/ ctx[47].string + "")) html_tag.p(raw_value);
1244
- },
1245
- d(detaching) {
1246
- if (detaching) detach(html_anchor);
1247
- if (detaching) html_tag.d();
1248
- }
1249
- };
1250
- }
1251
-
1252
- // (248:6) {#each results as result, index}
1253
- function create_each_block(ctx) {
1254
- let li;
1255
- let t;
1256
- let li_id_value;
1257
- let li_aria_selected_value;
1258
- let current;
1259
- let mounted;
1260
- let dispose;
1261
- const default_slot_template = /*#slots*/ ctx[27].default;
1262
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[26], get_default_slot_context);
1263
- const default_slot_or_fallback = default_slot || fallback_block(ctx);
1264
-
1265
- function click_handler_1() {
1266
- return /*click_handler_1*/ ctx[40](/*result*/ ctx[47], /*index*/ ctx[49]);
1267
- }
1268
-
1269
- function mouseenter_handler() {
1270
- return /*mouseenter_handler*/ ctx[41](/*result*/ ctx[47], /*index*/ ctx[49]);
1271
- }
1272
-
1273
- return {
1274
- c() {
1275
- li = element("li");
1276
- if (default_slot_or_fallback) default_slot_or_fallback.c();
1277
- t = space();
1278
- attr(li, "role", "option");
1279
- attr(li, "id", li_id_value = "" + (/*id*/ ctx[2] + "-result-" + /*index*/ ctx[49]));
1280
- attr(li, "aria-selected", li_aria_selected_value = /*selectedIndex*/ ctx[10] === /*index*/ ctx[49]);
1281
- attr(li, "class", "svelte-1t4elht");
1282
- toggle_class(li, "selected", /*selectedIndex*/ ctx[10] === /*index*/ ctx[49]);
1283
- toggle_class(li, "disabled", /*result*/ ctx[47].disabled);
1284
- },
1285
- m(target, anchor) {
1286
- insert(target, li, anchor);
1287
-
1288
- if (default_slot_or_fallback) {
1289
- default_slot_or_fallback.m(li, null);
1290
- }
1291
-
1292
- append(li, t);
1293
- current = true;
1294
-
1295
- if (!mounted) {
1296
- dispose = [
1297
- listen(li, "click", click_handler_1),
1298
- listen(li, "mouseenter", mouseenter_handler)
1299
- ];
1300
-
1301
- mounted = true;
1302
- }
1303
- },
1304
- p(new_ctx, dirty) {
1305
- ctx = new_ctx;
1306
-
1307
- if (default_slot) {
1308
- if (default_slot.p && (!current || dirty[0] & /*$$scope, results, value*/ 67108867)) {
1309
- update_slot_base(
1310
- default_slot,
1311
- default_slot_template,
1312
- ctx,
1313
- /*$$scope*/ ctx[26],
1314
- !current
1315
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[26])
1316
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[26], dirty, get_default_slot_changes),
1317
- get_default_slot_context
1318
- );
1319
- }
1320
- } else {
1321
- if (default_slot_or_fallback && default_slot_or_fallback.p && (!current || dirty[0] & /*results*/ 2)) {
1322
- default_slot_or_fallback.p(ctx, !current ? [-1, -1] : dirty);
1323
- }
1324
- }
1325
-
1326
- if (!current || dirty[0] & /*id*/ 4 && li_id_value !== (li_id_value = "" + (/*id*/ ctx[2] + "-result-" + /*index*/ ctx[49]))) {
1327
- attr(li, "id", li_id_value);
1328
- }
1329
-
1330
- if (!current || dirty[0] & /*selectedIndex*/ 1024 && li_aria_selected_value !== (li_aria_selected_value = /*selectedIndex*/ ctx[10] === /*index*/ ctx[49])) {
1331
- attr(li, "aria-selected", li_aria_selected_value);
1332
- }
1333
-
1334
- if (!current || dirty[0] & /*selectedIndex*/ 1024) {
1335
- toggle_class(li, "selected", /*selectedIndex*/ ctx[10] === /*index*/ ctx[49]);
1336
- }
1337
-
1338
- if (!current || dirty[0] & /*results*/ 2) {
1339
- toggle_class(li, "disabled", /*result*/ ctx[47].disabled);
1340
- }
1341
- },
1342
- i(local) {
1343
- if (current) return;
1344
- transition_in(default_slot_or_fallback, local);
1345
- current = true;
1346
- },
1347
- o(local) {
1348
- transition_out(default_slot_or_fallback, local);
1349
- current = false;
1350
- },
1351
- d(detaching) {
1352
- if (detaching) detach(li);
1353
- if (default_slot_or_fallback) default_slot_or_fallback.d(detaching);
1354
- mounted = false;
1355
- run_all(dispose);
1356
- }
1357
- };
1358
- }
1359
-
1360
- // (272:4) {#if $$slots["no-results"] && !hideDropdown && value.length > 0 && results.length === 0}
1361
- function create_if_block(ctx) {
1362
- let div;
1363
- let current;
1364
- const no_results_slot_template = /*#slots*/ ctx[27]["no-results"];
1365
- const no_results_slot = create_slot(no_results_slot_template, ctx, /*$$scope*/ ctx[26], get_no_results_slot_context);
1366
-
1367
- return {
1368
- c() {
1369
- div = element("div");
1370
- if (no_results_slot) no_results_slot.c();
1371
- attr(div, "class", "svelte-1t4elht");
1372
- toggle_class(div, "no-results", true);
1373
- },
1374
- m(target, anchor) {
1375
- insert(target, div, anchor);
1376
-
1377
- if (no_results_slot) {
1378
- no_results_slot.m(div, null);
1379
- }
1380
-
1381
- current = true;
1382
- },
1383
- p(ctx, dirty) {
1384
- if (no_results_slot) {
1385
- if (no_results_slot.p && (!current || dirty[0] & /*$$scope, value, results*/ 67108867)) {
1386
- update_slot_base(
1387
- no_results_slot,
1388
- no_results_slot_template,
1389
- ctx,
1390
- /*$$scope*/ ctx[26],
1391
- !current
1392
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[26])
1393
- : get_slot_changes(no_results_slot_template, /*$$scope*/ ctx[26], dirty, get_no_results_slot_changes),
1394
- get_no_results_slot_context
1395
- );
1396
- }
1397
- }
1398
- },
1399
- i(local) {
1400
- if (current) return;
1401
- transition_in(no_results_slot, local);
1402
- current = true;
1403
- },
1404
- o(local) {
1405
- transition_out(no_results_slot, local);
1406
- current = false;
1407
- },
1408
- d(detaching) {
1409
- if (detaching) detach(div);
1410
- if (no_results_slot) no_results_slot.d(detaching);
1411
- }
1412
- };
1413
- }
1414
-
1415
- function create_fragment(ctx) {
1416
- let div;
1417
- let search;
1418
- let updating_ref;
1419
- let updating_value;
1420
- let t0;
1421
- let ul;
1422
- let t1;
1423
- let ul_aria_labelledby_value;
1424
- let ul_id_value;
1425
- let div_aria_controls_value;
1426
- let div_id_value;
1427
- let current;
1428
- let mounted;
1429
- let dispose;
1430
-
1431
- const search_spread_levels = [
1432
- { id: /*id*/ ctx[2] },
1433
- { removeFormAriaAttributes: true },
1434
- /*$$restProps*/ ctx[16],
1435
- { "aria-autocomplete": "list" },
1436
- {
1437
- "aria-controls": "" + (/*id*/ ctx[2] + "-listbox")
1438
- },
1439
- {
1440
- "aria-labelledby": "" + (/*id*/ ctx[2] + "-label")
1441
- },
1442
- {
1443
- "aria-activedescendant": /*selectedIndex*/ ctx[10] >= 0 && !/*hideDropdown*/ ctx[5] && /*results*/ ctx[1].length > 0
1444
- ? `${/*id*/ ctx[2]}-result-${/*selectedIndex*/ ctx[10]}`
1445
- : null
1446
- }
1447
- ];
1448
-
1449
- function search_ref_binding(value) {
1450
- /*search_ref_binding*/ ctx[29](value);
1451
- }
1452
-
1453
- function search_value_binding(value) {
1454
- /*search_value_binding*/ ctx[30](value);
1455
- }
1456
-
1457
- let search_props = {};
1458
-
1459
- for (let i = 0; i < search_spread_levels.length; i += 1) {
1460
- search_props = assign(search_props, search_spread_levels[i]);
1461
- }
1462
-
1463
- if (/*searchRef*/ ctx[9] !== void 0) {
1464
- search_props.ref = /*searchRef*/ ctx[9];
1465
- }
1466
-
1467
- if (/*value*/ ctx[0] !== void 0) {
1468
- search_props.value = /*value*/ ctx[0];
1469
- }
1470
-
1471
- search = new Search$1({ props: search_props });
1472
- binding_callbacks.push(() => bind(search, 'ref', search_ref_binding));
1473
- binding_callbacks.push(() => bind(search, 'value', search_value_binding));
1474
- search.$on("type", /*type_handler*/ ctx[31]);
1475
- search.$on("input", /*input_handler*/ ctx[32]);
1476
- search.$on("change", /*change_handler*/ ctx[33]);
1477
- search.$on("focus", /*focus_handler*/ ctx[34]);
1478
- search.$on("focus", /*focus_handler_1*/ ctx[35]);
1479
- search.$on("clear", /*clear_handler*/ ctx[36]);
1480
- search.$on("clear", /*open*/ ctx[13]);
1481
- search.$on("blur", /*blur_handler*/ ctx[37]);
1482
- search.$on("keydown", /*keydown_handler*/ ctx[38]);
1483
- search.$on("keydown", /*keydown_handler_1*/ ctx[39]);
1484
- let if_block0 = /*showResults*/ ctx[7] && create_if_block_1(ctx);
1485
- let if_block1 = /*$$slots*/ ctx[15]["no-results"] && !/*hideDropdown*/ ctx[5] && /*value*/ ctx[0].length > 0 && /*results*/ ctx[1].length === 0 && create_if_block(ctx);
1486
-
1487
- return {
1488
- c() {
1489
- div = element("div");
1490
- create_component(search.$$.fragment);
1491
- t0 = space();
1492
- ul = element("ul");
1493
- if (if_block0) if_block0.c();
1494
- t1 = space();
1495
- if (if_block1) if_block1.c();
1496
- attr(ul, "role", "listbox");
1497
- attr(ul, "aria-labelledby", ul_aria_labelledby_value = "" + (/*id*/ ctx[2] + "-label"));
1498
- attr(ul, "id", ul_id_value = "" + (/*id*/ ctx[2] + "-listbox"));
1499
- attr(ul, "class", "svelte-1t4elht");
1500
- toggle_class(ul, "svelte-typeahead-list", true);
1501
- attr(div, "data-svelte-typeahead", "");
1502
- attr(div, "role", "combobox");
1503
- attr(div, "aria-haspopup", "listbox");
1504
- attr(div, "aria-controls", div_aria_controls_value = "" + (/*id*/ ctx[2] + "-listbox"));
1505
- attr(div, "aria-expanded", /*showResults*/ ctx[7]);
1506
- attr(div, "id", div_id_value = "" + (/*id*/ ctx[2] + "-typeahead"));
1507
- attr(div, "class", "svelte-1t4elht");
1508
- toggle_class(div, "dropdown", /*results*/ ctx[1].length > 0);
1509
- },
1510
- m(target, anchor) {
1511
- insert(target, div, anchor);
1512
- mount_component(search, div, null);
1513
- append(div, t0);
1514
- append(div, ul);
1515
- if (if_block0) if_block0.m(ul, null);
1516
- append(ul, t1);
1517
- if (if_block1) if_block1.m(ul, null);
1518
- /*div_binding*/ ctx[42](div);
1519
- current = true;
1520
-
1521
- if (!mounted) {
1522
- dispose = listen(window, "click", /*click_handler*/ ctx[28]);
1523
- mounted = true;
1524
- }
1525
- },
1526
- p(ctx, dirty) {
1527
- const search_changes = (dirty[0] & /*id, $$restProps, selectedIndex, hideDropdown, results*/ 66598)
1528
- ? get_spread_update(search_spread_levels, [
1529
- dirty[0] & /*id*/ 4 && { id: /*id*/ ctx[2] },
1530
- search_spread_levels[1],
1531
- dirty[0] & /*$$restProps*/ 65536 && get_spread_object(/*$$restProps*/ ctx[16]),
1532
- search_spread_levels[3],
1533
- dirty[0] & /*id*/ 4 && {
1534
- "aria-controls": "" + (/*id*/ ctx[2] + "-listbox")
1535
- },
1536
- dirty[0] & /*id*/ 4 && {
1537
- "aria-labelledby": "" + (/*id*/ ctx[2] + "-label")
1538
- },
1539
- dirty[0] & /*selectedIndex, hideDropdown, results, id*/ 1062 && {
1540
- "aria-activedescendant": /*selectedIndex*/ ctx[10] >= 0 && !/*hideDropdown*/ ctx[5] && /*results*/ ctx[1].length > 0
1541
- ? `${/*id*/ ctx[2]}-result-${/*selectedIndex*/ ctx[10]}`
1542
- : null
1543
- }
1544
- ])
1545
- : {};
1546
-
1547
- if (!updating_ref && dirty[0] & /*searchRef*/ 512) {
1548
- updating_ref = true;
1549
- search_changes.ref = /*searchRef*/ ctx[9];
1550
- add_flush_callback(() => updating_ref = false);
1551
- }
1552
-
1553
- if (!updating_value && dirty[0] & /*value*/ 1) {
1554
- updating_value = true;
1555
- search_changes.value = /*value*/ ctx[0];
1556
- add_flush_callback(() => updating_value = false);
1557
- }
1558
-
1559
- search.$set(search_changes);
1560
-
1561
- if (/*showResults*/ ctx[7]) {
1562
- if (if_block0) {
1563
- if_block0.p(ctx, dirty);
1564
-
1565
- if (dirty[0] & /*showResults*/ 128) {
1566
- transition_in(if_block0, 1);
1567
- }
1568
- } else {
1569
- if_block0 = create_if_block_1(ctx);
1570
- if_block0.c();
1571
- transition_in(if_block0, 1);
1572
- if_block0.m(ul, t1);
1573
- }
1574
- } else if (if_block0) {
1575
- group_outros();
1576
-
1577
- transition_out(if_block0, 1, 1, () => {
1578
- if_block0 = null;
1579
- });
1580
-
1581
- check_outros();
1582
- }
1583
-
1584
- if (/*$$slots*/ ctx[15]["no-results"] && !/*hideDropdown*/ ctx[5] && /*value*/ ctx[0].length > 0 && /*results*/ ctx[1].length === 0) {
1585
- if (if_block1) {
1586
- if_block1.p(ctx, dirty);
1587
-
1588
- if (dirty[0] & /*$$slots, hideDropdown, value, results*/ 32803) {
1589
- transition_in(if_block1, 1);
1590
- }
1591
- } else {
1592
- if_block1 = create_if_block(ctx);
1593
- if_block1.c();
1594
- transition_in(if_block1, 1);
1595
- if_block1.m(ul, null);
1596
- }
1597
- } else if (if_block1) {
1598
- group_outros();
1599
-
1600
- transition_out(if_block1, 1, 1, () => {
1601
- if_block1 = null;
1602
- });
1603
-
1604
- check_outros();
1605
- }
1606
-
1607
- if (!current || dirty[0] & /*id*/ 4 && ul_aria_labelledby_value !== (ul_aria_labelledby_value = "" + (/*id*/ ctx[2] + "-label"))) {
1608
- attr(ul, "aria-labelledby", ul_aria_labelledby_value);
1609
- }
1610
-
1611
- if (!current || dirty[0] & /*id*/ 4 && ul_id_value !== (ul_id_value = "" + (/*id*/ ctx[2] + "-listbox"))) {
1612
- attr(ul, "id", ul_id_value);
1613
- }
1614
-
1615
- if (!current || dirty[0] & /*id*/ 4 && div_aria_controls_value !== (div_aria_controls_value = "" + (/*id*/ ctx[2] + "-listbox"))) {
1616
- attr(div, "aria-controls", div_aria_controls_value);
1617
- }
1618
-
1619
- if (!current || dirty[0] & /*showResults*/ 128) {
1620
- attr(div, "aria-expanded", /*showResults*/ ctx[7]);
1621
- }
1622
-
1623
- if (!current || dirty[0] & /*id*/ 4 && div_id_value !== (div_id_value = "" + (/*id*/ ctx[2] + "-typeahead"))) {
1624
- attr(div, "id", div_id_value);
1625
- }
1626
-
1627
- if (!current || dirty[0] & /*results*/ 2) {
1628
- toggle_class(div, "dropdown", /*results*/ ctx[1].length > 0);
1629
- }
1630
- },
1631
- i(local) {
1632
- if (current) return;
1633
- transition_in(search.$$.fragment, local);
1634
- transition_in(if_block0);
1635
- transition_in(if_block1);
1636
- current = true;
1637
- },
1638
- o(local) {
1639
- transition_out(search.$$.fragment, local);
1640
- transition_out(if_block0);
1641
- transition_out(if_block1);
1642
- current = false;
1643
- },
1644
- d(detaching) {
1645
- if (detaching) detach(div);
1646
- destroy_component(search);
1647
- if (if_block0) if_block0.d();
1648
- if (if_block1) if_block1.d();
1649
- /*div_binding*/ ctx[42](null);
1650
- mounted = false;
1651
- dispose();
1652
- }
1653
- };
1654
- }
1655
-
1656
- function instance($$self, $$props, $$invalidate) {
1657
- let options;
1658
- let resultsId;
1659
- let showResults;
1660
-
1661
- const omit_props_names = [
1662
- "id","value","data","extract","disable","filter","autoselect","inputAfterSelect","results","focusAfterSelect","showDropdownOnFocus","showAllResultsOnFocus","limit"
1663
- ];
1664
-
1665
- let $$restProps = compute_rest_props($$props, omit_props_names);
1666
- let { $$slots: slots = {}, $$scope } = $$props;
1667
- const $$slots = compute_slots(slots);
1668
- let { id = "typeahead-" + Math.random().toString(36) } = $$props;
1669
- let { value = "" } = $$props;
1670
- let { data = [] } = $$props;
1671
- let { extract = item => item } = $$props;
1672
- let { disable = item => false } = $$props;
1673
- let { filter = item => false } = $$props;
1674
- let { autoselect = true } = $$props;
1675
- let { inputAfterSelect = "update" } = $$props;
1676
- let { results = [] } = $$props;
1677
- let { focusAfterSelect = false } = $$props;
1678
- let { showDropdownOnFocus = false } = $$props;
1679
- let { showAllResultsOnFocus = false } = $$props;
1680
- let { limit = Infinity } = $$props;
1681
- const dispatch = createEventDispatcher();
1682
- let comboboxRef = null;
1683
- let searchRef = null;
1684
- let hideDropdown = false;
1685
- let selectedIndex = -1;
1686
- let prevResults = "";
1687
- let isFocused = false;
1688
-
1689
- afterUpdate(() => {
1690
- if (prevResults !== resultsId && autoselect) {
1691
- $$invalidate(10, selectedIndex = getNextNonDisabledIndex());
1692
- }
1693
-
1694
- if (prevResults !== resultsId && !$$slots["no-results"]) {
1695
- $$invalidate(5, hideDropdown = results.length === 0);
1696
- }
1697
-
1698
- prevResults = resultsId;
1699
- });
1700
-
1701
- async function select() {
1702
- const result = results[selectedIndex];
1703
- if (result.disabled) return;
1704
- const selectedValue = extract(result.original);
1705
- const searchedValue = value;
1706
- if (inputAfterSelect == "clear") $$invalidate(0, value = "");
1707
- if (inputAfterSelect == "update") $$invalidate(0, value = selectedValue);
1708
-
1709
- dispatch("select", {
1710
- selectedIndex,
1711
- searched: searchedValue,
1712
- selected: selectedValue,
1713
- original: result.original,
1714
- originalIndex: result.index
1715
- });
1716
-
1717
- await tick();
1718
- if (focusAfterSelect) searchRef.focus();
1719
- close();
1720
- }
1721
-
1722
- /** @type {() => number} */
1723
- function getNextNonDisabledIndex() {
1724
- let index = 0;
1725
- let disabled = results[index]?.disabled ?? false;
1726
-
1727
- while (disabled) {
1728
- if (index === results.length) {
1729
- index = 0;
1730
- } else {
1731
- index += 1;
1732
- }
1733
-
1734
- disabled = results[index]?.disabled ?? false;
1735
- }
1736
-
1737
- return index;
1738
- }
1739
-
1740
- /** @type {(direction: -1 | 1) => void} */
1741
- function change(direction) {
1742
- let index = direction === 1 && selectedIndex === results.length - 1
1743
- ? 0
1744
- : selectedIndex + direction;
1745
-
1746
- if (index < 0) index = results.length - 1;
1747
- let disabled = results[index].disabled;
1748
-
1749
- while (disabled) {
1750
- if (index === results.length) {
1751
- index = 0;
1752
- } else {
1753
- index += direction;
1754
- }
1755
-
1756
- disabled = results[index].disabled;
1757
- }
1758
-
1759
- $$invalidate(10, selectedIndex = index);
1760
- }
1761
-
1762
- const open = () => $$invalidate(5, hideDropdown = false);
1763
-
1764
- const close = () => {
1765
- $$invalidate(5, hideDropdown = true);
1766
- $$invalidate(6, isFocused = false);
1767
- };
1768
-
1769
- const click_handler = ({ target }) => {
1770
- if (!hideDropdown && !comboboxRef?.contains(target)) {
1771
- close();
1772
- }
1773
- };
1774
-
1775
- function search_ref_binding(value) {
1776
- searchRef = value;
1777
- $$invalidate(9, searchRef);
1778
- }
1779
-
1780
- function search_value_binding(value$1) {
1781
- value = value$1;
1782
- $$invalidate(0, value);
1783
- }
1784
-
1785
- function type_handler(event) {
1786
- bubble.call(this, $$self, event);
1787
- }
1788
-
1789
- function input_handler(event) {
1790
- bubble.call(this, $$self, event);
1791
- }
1792
-
1793
- function change_handler(event) {
1794
- bubble.call(this, $$self, event);
1795
- }
1796
-
1797
- function focus_handler(event) {
1798
- bubble.call(this, $$self, event);
1799
- }
1800
-
1801
- const focus_handler_1 = () => {
1802
- open();
1803
-
1804
- if (showDropdownOnFocus || showAllResultsOnFocus) {
1805
- $$invalidate(7, showResults = true);
1806
- $$invalidate(6, isFocused = true);
1807
- }
1808
- };
1809
-
1810
- function clear_handler(event) {
1811
- bubble.call(this, $$self, event);
1812
- }
1813
-
1814
- function blur_handler(event) {
1815
- bubble.call(this, $$self, event);
1816
- }
1817
-
1818
- function keydown_handler(event) {
1819
- bubble.call(this, $$self, event);
1820
- }
1821
-
1822
- const keydown_handler_1 = e => {
1823
- if (results.length === 0) return;
1824
-
1825
- switch (e.key) {
1826
- case "Enter":
1827
- select();
1828
- break;
1829
- case "ArrowDown":
1830
- e.preventDefault();
1831
- change(1);
1832
- break;
1833
- case "ArrowUp":
1834
- e.preventDefault();
1835
- change(-1);
1836
- break;
1837
- case "Escape":
1838
- e.preventDefault();
1839
- $$invalidate(0, value = "");
1840
- searchRef?.focus();
1841
- close();
1842
- break;
1843
- }
1844
- };
1845
-
1846
- const click_handler_1 = (result, index) => {
1847
- if (result.disabled) return;
1848
- $$invalidate(10, selectedIndex = index);
1849
- select();
1850
- };
1851
-
1852
- const mouseenter_handler = (result, index) => {
1853
- if (result.disabled) return;
1854
- $$invalidate(10, selectedIndex = index);
1855
- };
1856
-
1857
- function div_binding($$value) {
1858
- binding_callbacks[$$value ? 'unshift' : 'push'](() => {
1859
- comboboxRef = $$value;
1860
- $$invalidate(8, comboboxRef);
1861
- });
1862
- }
1863
-
1864
- $$self.$$set = $$new_props => {
1865
- $$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
1866
- $$invalidate(16, $$restProps = compute_rest_props($$props, omit_props_names));
1867
- if ('id' in $$new_props) $$invalidate(2, id = $$new_props.id);
1868
- if ('value' in $$new_props) $$invalidate(0, value = $$new_props.value);
1869
- if ('data' in $$new_props) $$invalidate(17, data = $$new_props.data);
1870
- if ('extract' in $$new_props) $$invalidate(18, extract = $$new_props.extract);
1871
- if ('disable' in $$new_props) $$invalidate(19, disable = $$new_props.disable);
1872
- if ('filter' in $$new_props) $$invalidate(20, filter = $$new_props.filter);
1873
- if ('autoselect' in $$new_props) $$invalidate(21, autoselect = $$new_props.autoselect);
1874
- if ('inputAfterSelect' in $$new_props) $$invalidate(22, inputAfterSelect = $$new_props.inputAfterSelect);
1875
- if ('results' in $$new_props) $$invalidate(1, results = $$new_props.results);
1876
- if ('focusAfterSelect' in $$new_props) $$invalidate(23, focusAfterSelect = $$new_props.focusAfterSelect);
1877
- if ('showDropdownOnFocus' in $$new_props) $$invalidate(3, showDropdownOnFocus = $$new_props.showDropdownOnFocus);
1878
- if ('showAllResultsOnFocus' in $$new_props) $$invalidate(4, showAllResultsOnFocus = $$new_props.showAllResultsOnFocus);
1879
- if ('limit' in $$new_props) $$invalidate(24, limit = $$new_props.limit);
1880
- if ('$$scope' in $$new_props) $$invalidate(26, $$scope = $$new_props.$$scope);
1881
- };
1882
-
1883
- $$self.$$.update = () => {
1884
- if ($$self.$$.dirty[0] & /*extract*/ 262144) {
1885
- $$invalidate(25, options = { pre: "<mark>", post: "</mark>", extract });
1886
- }
1887
-
1888
- if ($$self.$$.dirty[0] & /*value, data, options, limit, filter, disable*/ 52035585) {
1889
- $$invalidate(1, results = fuzzy.filter(value, data, options).filter(({ score }) => score > 0).slice(0, limit).filter(result => !filter(result.original)).map(result => ({
1890
- ...result,
1891
- disabled: disable(result.original)
1892
- })));
1893
- }
1894
-
1895
- if ($$self.$$.dirty[0] & /*isFocused, showAllResultsOnFocus, value, data, filter, disable, extract*/ 1966161) {
1896
- if (isFocused && showAllResultsOnFocus && value.length === 0) {
1897
- $$invalidate(1, results = data.filter(datum => !filter(datum)).map((original, index) => ({
1898
- disabled: disable(original),
1899
- index,
1900
- original,
1901
- score: 0,
1902
- string: extract(original)
1903
- })));
1904
- }
1905
- }
1906
-
1907
- if ($$self.$$.dirty[0] & /*results, extract*/ 262146) {
1908
- resultsId = results.map(result => extract(result.original)).join("");
1909
- }
1910
-
1911
- if ($$self.$$.dirty[0] & /*hideDropdown, results*/ 34) {
1912
- $$invalidate(7, showResults = !hideDropdown && results.length > 0);
1913
- }
1914
-
1915
- if ($$self.$$.dirty[0] & /*showDropdownOnFocus, showResults, isFocused*/ 200) {
1916
- if (showDropdownOnFocus) {
1917
- $$invalidate(7, showResults = showResults && isFocused);
1918
- }
1919
- }
1920
- };
1921
-
1922
- return [
1923
- value,
1924
- results,
1925
- id,
1926
- showDropdownOnFocus,
1927
- showAllResultsOnFocus,
1928
- hideDropdown,
1929
- isFocused,
1930
- showResults,
1931
- comboboxRef,
1932
- searchRef,
1933
- selectedIndex,
1934
- select,
1935
- change,
1936
- open,
1937
- close,
1938
- $$slots,
1939
- $$restProps,
1940
- data,
1941
- extract,
1942
- disable,
1943
- filter,
1944
- autoselect,
1945
- inputAfterSelect,
1946
- focusAfterSelect,
1947
- limit,
1948
- options,
1949
- $$scope,
1950
- slots,
1951
- click_handler,
1952
- search_ref_binding,
1953
- search_value_binding,
1954
- type_handler,
1955
- input_handler,
1956
- change_handler,
1957
- focus_handler,
1958
- focus_handler_1,
1959
- clear_handler,
1960
- blur_handler,
1961
- keydown_handler,
1962
- keydown_handler_1,
1963
- click_handler_1,
1964
- mouseenter_handler,
1965
- div_binding
1966
- ];
1967
- }
1968
-
1969
- class Typeahead extends SvelteComponent {
1970
- constructor(options) {
1971
- super();
1972
-
1973
- init(
1974
- this,
1975
- options,
1976
- instance,
1977
- create_fragment,
1978
- safe_not_equal,
1979
- {
1980
- id: 2,
1981
- value: 0,
1982
- data: 17,
1983
- extract: 18,
1984
- disable: 19,
1985
- filter: 20,
1986
- autoselect: 21,
1987
- inputAfterSelect: 22,
1988
- results: 1,
1989
- focusAfterSelect: 23,
1990
- showDropdownOnFocus: 3,
1991
- showAllResultsOnFocus: 4,
1992
- limit: 24
1993
- },
1994
- add_css,
1995
- [-1, -1]
1996
- );
1997
- }
1998
- }
1999
-
2000
- exports["default"] = Typeahead;
2001
-
2002
- Object.defineProperty(exports, '__esModule', { value: true });
2003
-
2004
- }));