1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | (function (global, factory) {
|
8 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
9 | typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
10 | (global = global || self, factory((global.ssw = global.ssw || {}, global.ssw.core = {})));
|
11 | }(this, function (exports) { 'use strict';
|
12 |
|
13 | |
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | let re = {
|
21 | 'symbol': 'S[123][0-9a-f]{2}[0-5][0-9a-f]',
|
22 | 'coord': '[0-9]{3}x[0-9]{3}',
|
23 | 'sort': 'A',
|
24 | 'box': '[BLMR]'
|
25 | };
|
26 | re.prefix = `(?:${re.sort}(?:${re.symbol})+)`;
|
27 | re.spatial = `${re.symbol}${re.coord}`;
|
28 | re.signbox = `${re.box}${re.coord}(?:${re.spatial})*`;
|
29 | re.sign = `${re.prefix}?${re.signbox}`;
|
30 | re.sortable = `${re.prefix}${re.signbox}`;
|
31 |
|
32 | |
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | let re$1 = {
|
40 | 'colorize': 'C',
|
41 | 'colorhex': '(?:[0-9a-fA-F]{3}){1,2}',
|
42 | 'colorname': '[a-zA-Z]+',
|
43 | 'padding': 'P[0-9]{2}',
|
44 | 'zoom': 'Z(?:[0-9]+(?:\\.[0-9]+)?|x)',
|
45 | 'zoomsym': 'Z[0-9]{2},[0-9]+(?:\\.[0-9]+)?(?:,[0-9]{3}x[0-9]{3})?',
|
46 | 'classbase': '-?[_a-zA-Z][_a-zA-Z0-9-]{0,100}',
|
47 | 'id': '[a-zA-Z][_a-zA-Z0-9-]{0,100}'
|
48 | };
|
49 | re$1.colorbase = `(?:${re$1.colorhex}|${re$1.colorname})`;
|
50 | re$1.color = `_${re$1.colorbase}_`;
|
51 | re$1.colors = `_${re$1.colorbase}(?:,${re$1.colorbase})?_`;
|
52 | re$1.background = `G${re$1.color}`;
|
53 | re$1.detail = `D${re$1.colors}`;
|
54 | re$1.detailsym = `D[0-9]{2}${re$1.colors}`;
|
55 | re$1.classes = `${re$1.classbase}(?: ${re$1.classbase})*`;
|
56 | re$1.full = `-(${re$1.colorize})?(${re$1.padding})?(${re$1.background})?(${re$1.detail})?(${re$1.zoom})?(?:-((?:${re$1.detailsym})*)((?:${re$1.zoomsym})*))?(?:-(${re$1.classes})?!(?:(${re$1.id})!)?)?`;
|
57 |
|
58 | const prefixColor = color => {
|
59 | const regex = new RegExp(`^${re$1.colorhex}$`);
|
60 | return (regex.test(color) ? '#' : '') + color;
|
61 | };
|
62 | |
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 | const parse = styleString => {
|
80 | const regex = `^${re$1.full}`;
|
81 | const m = (typeof styleString === 'string' ? styleString.match(new RegExp(regex)) : []) || [];
|
82 | return {
|
83 | 'colorize': !m[1] ? undefined : !!m[1],
|
84 | 'padding': !m[2] ? undefined : parseInt(m[2].slice(1)),
|
85 | 'background': !m[3] ? undefined : prefixColor(m[3].slice(2, -1)),
|
86 | 'detail': !m[4] ? undefined : m[4].slice(2, -1).split(',').map(prefixColor),
|
87 | 'zoom': !m[5] ? undefined : m[5] === 'Zx' ? 'x' : parseFloat(m[5].slice(1)),
|
88 | 'detailsym': !m[6] ? undefined : m[6].match(new RegExp(re$1.detailsym, 'g')).map(val => {
|
89 | const parts = val.split('_');
|
90 | const detail = parts[1].split(',').map(prefixColor);
|
91 | return {
|
92 | 'index': parseInt(parts[0].slice(1)),
|
93 | 'detail': detail
|
94 | };
|
95 | }),
|
96 | 'zoomsym': !m[7] ? undefined : m[7].match(new RegExp(re$1.zoomsym, 'g')).map(val => {
|
97 | const parts = val.split(',');
|
98 | return {
|
99 | 'index': parseInt(parts[0].slice(1)),
|
100 | 'zoom': parseFloat(parts[1]),
|
101 | 'offset': !parts[2] ? undefined : parts[2].split('x').map(val => parseInt(val) - 500)
|
102 | };
|
103 | }),
|
104 | 'classes': !m[8] ? undefined : m[8],
|
105 | 'id': !m[9] ? undefined : m[9]
|
106 | };
|
107 | };
|
108 |
|
109 | |
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 | const compose = styleObject => {
|
159 | if (typeof styleObject !== 'object' || styleObject === null) return undefined;
|
160 |
|
161 | let style1 = '-';
|
162 | style1 += !styleObject.colorize ? '' : 'C';
|
163 | const padding = parseInt(styleObject.padding);
|
164 | style1 += !padding || padding <= 0 || padding > 99 ? '' : 'P' + (padding > 9 ? padding : '0' + padding);
|
165 | const background = !styleObject.background || !(typeof styleObject.background === 'string') ? undefined : styleObject.background.match(re$1.colorbase)[0];
|
166 | style1 += !background ? '' : 'G_' + background + '_';
|
167 | const detail1 = !styleObject.detail || !styleObject.detail[0] || !(typeof styleObject.detail[0] === 'string') ? undefined : styleObject.detail[0].match(re$1.colorbase)[0];
|
168 | const detail2 = !styleObject.detail || !styleObject.detail[1] || !(typeof styleObject.detail[1] === 'string') ? undefined : styleObject.detail[1].match(re$1.colorbase)[0];
|
169 |
|
170 | if (detail1) {
|
171 | style1 += 'D_' + detail1;
|
172 |
|
173 | if (detail2) {
|
174 | style1 += ',' + detail2;
|
175 | }
|
176 |
|
177 | style1 += '_';
|
178 | }
|
179 |
|
180 | const zoom = styleObject.zoom === 'x' ? 'x' : parseFloat(styleObject.zoom);
|
181 | style1 += !zoom || zoom <= 0 ? '' : 'Z' + zoom;
|
182 | let style2 = '';
|
183 | const detailsym = !styleObject.detailsym || !Array.isArray(styleObject.detailsym) ? [] : styleObject.detailsym.map(styleObject => {
|
184 | const index = parseInt(styleObject.index);
|
185 | if (!index || index <= 0 || index > 99) return '';
|
186 | let style = 'D' + (index > 9 ? index : '0' + index);
|
187 | const detail1 = !styleObject.detail || !styleObject.detail[0] ? undefined : styleObject.detail[0].match(re$1.colorbase)[0];
|
188 | const detail2 = !styleObject.detail || !styleObject.detail[1] ? undefined : styleObject.detail[1].match(re$1.colorbase)[0];
|
189 |
|
190 | if (detail1) {
|
191 | style += '_' + detail1;
|
192 |
|
193 | if (detail2) {
|
194 | style += ',' + detail2;
|
195 | }
|
196 |
|
197 | style += '_';
|
198 | }
|
199 |
|
200 | return style;
|
201 | });
|
202 | style2 += detailsym.join('');
|
203 | const zoomsym = !styleObject.zoomsym || !Array.isArray(styleObject.zoomsym) ? [] : styleObject.zoomsym.map(styleObject => {
|
204 | const index = parseInt(styleObject.index);
|
205 | if (!index || index <= 0 || index > 99) return '';
|
206 | let style = 'Z' + (index > 9 ? index : '0' + index);
|
207 | const zoom = parseFloat(styleObject.zoom);
|
208 | style += !zoom || zoom <= 0 ? '' : ',' + zoom;
|
209 |
|
210 | if (styleObject.offset && 0 in styleObject.offset && 1 in styleObject.offset) {
|
211 | const x = parseInt(styleObject.offset[0]) + 500;
|
212 | const y = parseInt(styleObject.offset[1]) + 500;
|
213 |
|
214 | if (x >= 250 && x < 750 && y >= 250 && y < 750) {
|
215 | style += ',' + x + 'x' + y;
|
216 | }
|
217 | }
|
218 |
|
219 | return style;
|
220 | });
|
221 | style2 += zoomsym.join('');
|
222 | let style3 = '';
|
223 | const classes = !styleObject.classes || !(typeof styleObject.classes === 'string') ? undefined : styleObject.classes.match(re$1.classes)[0];
|
224 | style3 += !classes ? '' : classes;
|
225 | const id = !styleObject.id || !(typeof styleObject.id === 'string') ? undefined : styleObject.id.match(re$1.id)[0];
|
226 | style3 += classes || id ? '!' : '';
|
227 | style3 += !id ? '' : id + '!';
|
228 | return style1 + (style2 || style3 ? '-' + style2 : '') + (style3 ? '-' + style3 : '');
|
229 | };
|
230 |
|
231 | |
232 |
|
233 |
|
234 |
|
235 |
|
236 | var index = Object.freeze({
|
237 | __proto__: null,
|
238 | re: re$1,
|
239 | parse: parse,
|
240 | compose: compose
|
241 | });
|
242 |
|
243 | |
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 | let re$2 = {
|
251 | 'symbol': '(?:(?:\uD8C0[\uDC01-\uDFFF])|(?:[\uD8C1-\uD8FC][\uDC00-\uDFFF])|(?:\uD8FD[\uDC00-\uDC80]))',
|
252 | 'coord': '(?:\uD836[\uDC0C-\uDDFF]){2}',
|
253 | 'sort': '\uD836\uDC00',
|
254 | 'box': '\uD836[\uDC01-\uDC04]'
|
255 | };
|
256 | re$2.prefix = `(?:${re$2.sort}(?:${re$2.symbol})+)`;
|
257 | re$2.spatial = `${re$2.symbol}${re$2.coord}`;
|
258 | re$2.signbox = `${re$2.box}${re$2.coord}(?:${re$2.spatial})*`;
|
259 | re$2.sign = `${re$2.prefix}?${re$2.signbox}`;
|
260 | re$2.sortable = `${re$2.prefix}${re$2.signbox}`;
|
261 |
|
262 | |
263 |
|
264 |
|
265 |
|
266 | |
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 | const swu2mark = swuMark => {
|
278 | return {
|
279 | '𝠀': 'A',
|
280 | '𝠁': 'B',
|
281 | '𝠂': 'L',
|
282 | '𝠃': 'M',
|
283 | '𝠄': 'R'
|
284 | }[swuMark];
|
285 | };
|
286 | |
287 |
|
288 |
|
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 |
|
298 | const mark2swu = fswMark => {
|
299 | return {
|
300 | 'A': '𝠀',
|
301 | 'B': '𝠁',
|
302 | 'L': '𝠂',
|
303 | 'M': '𝠃',
|
304 | 'R': '𝠄'
|
305 | }[fswMark];
|
306 | };
|
307 | |
308 |
|
309 |
|
310 |
|
311 |
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 | const swu2num = swuNum => parseInt(swuNum.codePointAt(0)) - 0x1D80C + 250;
|
320 | |
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 | const num2swu = num => String.fromCodePoint(0x1D80C + parseInt(num) - 250);
|
333 | |
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 | const swu2coord = swuCoord => [swu2num(swuCoord.slice(0, 2)), swu2num(swuCoord.slice(2, 4))];
|
346 | |
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 | const coord2swu = coord => coord.map(num => num2swu(num)).join('');
|
359 | |
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 | const fsw2coord = fswCoord => fswCoord.split('x').map(num => parseInt(num));
|
372 | |
373 |
|
374 |
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 | const coord2fsw = coord => coord.join('x');
|
385 | |
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 | const swu2code = swuSym => parseInt(swuSym.codePointAt(0));
|
398 | |
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 | const code2swu = code => String.fromCodePoint(code);
|
411 | |
412 |
|
413 |
|
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 | const swu2id = swuSym => swu2code(swuSym) - 0x40000;
|
424 | |
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 | const id2swu = id => code2swu(id + 0x40000);
|
437 | |
438 |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 | const key2id = key => 1 + (parseInt(key.slice(1, 4), 16) - 256) * 96 + parseInt(key.slice(4, 5), 16) * 16 + parseInt(key.slice(5, 6), 16);
|
450 | |
451 |
|
452 |
|
453 |
|
454 |
|
455 |
|
456 |
|
457 |
|
458 |
|
459 |
|
460 |
|
461 |
|
462 | const id2key = id => {
|
463 | const symcode = id - 1;
|
464 | const base = parseInt(symcode / 96);
|
465 | const fill = parseInt((symcode - base * 96) / 16);
|
466 | const rotation = parseInt(symcode - base * 96 - fill * 16);
|
467 | return 'S' + (base + 0x100).toString(16) + fill.toString(16) + rotation.toString(16);
|
468 | };
|
469 | |
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 | const swu2key = swuSym => {
|
482 | const symcode = swu2code(swuSym) - 0x40001;
|
483 | const base = parseInt(symcode / 96);
|
484 | const fill = parseInt((symcode - base * 96) / 16);
|
485 | const rotation = parseInt(symcode - base * 96 - fill * 16);
|
486 | return 'S' + (base + 0x100).toString(16) + fill.toString(16) + rotation.toString(16);
|
487 | };
|
488 | |
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 |
|
495 |
|
496 |
|
497 |
|
498 |
|
499 |
|
500 | const key2swu = key => code2swu(0x40001 + (parseInt(key.slice(1, 4), 16) - 256) * 96 + parseInt(key.slice(4, 5), 16) * 16 + parseInt(key.slice(5, 6), 16));
|
501 | |
502 |
|
503 |
|
504 |
|
505 |
|
506 |
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 | const swu2fsw = swuText => {
|
514 | if (!swuText) return '';
|
515 | let fsw = swuText.replace(/𝠀/g, "A").replace(/𝠁/g, "B").replace(/𝠂/g, "L").replace(/𝠃/g, "M").replace(/𝠄/g, "R");
|
516 | const syms = fsw.match(new RegExp(re$2.symbol, 'g'));
|
517 |
|
518 | if (syms) {
|
519 | syms.forEach(function (sym) {
|
520 | fsw = fsw.replace(sym, swu2key(sym));
|
521 | });
|
522 | }
|
523 |
|
524 | const coords = fsw.match(new RegExp(re$2.coord, 'g'));
|
525 |
|
526 | if (coords) {
|
527 | coords.forEach(function (coord) {
|
528 | fsw = fsw.replace(coord, swu2coord(coord).join('x'));
|
529 | });
|
530 | }
|
531 |
|
532 | return fsw;
|
533 | };
|
534 | |
535 |
|
536 |
|
537 |
|
538 |
|
539 |
|
540 |
|
541 |
|
542 |
|
543 |
|
544 |
|
545 |
|
546 | const fsw2swu = fswText => {
|
547 | if (!fswText) return '';
|
548 | const prefixes = fswText.match(new RegExp(re.prefix, 'g'));
|
549 |
|
550 | if (prefixes) {
|
551 | prefixes.forEach(function (prefix) {
|
552 | fswText = fswText.replace(prefix, '𝠀' + prefix.slice(1).match(/.{6}/g).map(key => key2swu(key)).join(''));
|
553 | });
|
554 | }
|
555 |
|
556 | const boxes = fswText.match(new RegExp(re.box + re.coord, 'g'));
|
557 |
|
558 | if (boxes) {
|
559 | boxes.forEach(function (boxes) {
|
560 | fswText = fswText.replace(boxes, mark2swu(boxes.slice(0, 1)) + coord2swu(fsw2coord(boxes.slice(1, 8))));
|
561 | });
|
562 | }
|
563 |
|
564 | const spatials = fswText.match(new RegExp(re.spatial, 'g'));
|
565 |
|
566 | if (spatials) {
|
567 | spatials.forEach(function (spatial) {
|
568 | fswText = fswText.replace(spatial, key2swu(spatial.slice(0, 6)) + coord2swu(fsw2coord(spatial.slice(6, 13))));
|
569 | });
|
570 | }
|
571 |
|
572 | return fswText;
|
573 | };
|
574 |
|
575 | var index$1 = Object.freeze({
|
576 | __proto__: null,
|
577 | swu2mark: swu2mark,
|
578 | mark2swu: mark2swu,
|
579 | swu2num: swu2num,
|
580 | num2swu: num2swu,
|
581 | swu2coord: swu2coord,
|
582 | coord2swu: coord2swu,
|
583 | fsw2coord: fsw2coord,
|
584 | coord2fsw: coord2fsw,
|
585 | swu2code: swu2code,
|
586 | code2swu: code2swu,
|
587 | swu2id: swu2id,
|
588 | id2swu: id2swu,
|
589 | key2id: key2id,
|
590 | id2key: id2key,
|
591 | swu2key: swu2key,
|
592 | key2swu: key2swu,
|
593 | swu2fsw: swu2fsw,
|
594 | fsw2swu: fsw2swu
|
595 | });
|
596 |
|
597 | const parse$1 = {
|
598 | |
599 |
|
600 |
|
601 |
|
602 |
|
603 |
|
604 |
|
605 |
|
606 |
|
607 |
|
608 |
|
609 |
|
610 |
|
611 |
|
612 | symbol: fswSym => {
|
613 | const regex = `^(${re.symbol})(${re.coord})?(${re$1.full})?`;
|
614 | const symbol = typeof fswSym === 'string' ? fswSym.match(new RegExp(regex)) : undefined;
|
615 | return {
|
616 | 'symbol': symbol ? symbol[1] : undefined,
|
617 | 'coord': symbol && symbol[2] ? fsw2coord(symbol[2]) : undefined,
|
618 | 'style': symbol ? symbol[3] : undefined
|
619 | };
|
620 | },
|
621 |
|
622 | |
623 |
|
624 |
|
625 |
|
626 |
|
627 |
|
628 |
|
629 |
|
630 |
|
631 |
|
632 |
|
633 |
|
634 |
|
635 |
|
636 |
|
637 |
|
638 |
|
639 |
|
640 |
|
641 |
|
642 |
|
643 |
|
644 |
|
645 |
|
646 |
|
647 |
|
648 |
|
649 |
|
650 |
|
651 |
|
652 |
|
653 |
|
654 |
|
655 | sign: fswSign => {
|
656 | const regex = `^(${re.prefix})?(${re.signbox})(${re$1.full})?`;
|
657 | const sign = typeof fswSign === 'string' ? fswSign.match(new RegExp(regex)) : undefined;
|
658 |
|
659 | if (sign) {
|
660 | return {
|
661 | 'sequence': sign[1] ? sign[1].slice(1).match(/.{6}/g) : undefined,
|
662 | 'box': sign[2][0],
|
663 | 'max': fsw2coord(sign[2].slice(1, 8)),
|
664 | 'spatials': sign[2].length < 9 ? undefined : sign[2].slice(8).match(/(.{13})/g).map(m => {
|
665 | return {
|
666 | symbol: m.slice(0, 6),
|
667 | coord: [parseInt(m.slice(6, 9)), parseInt(m.slice(10, 13))]
|
668 | };
|
669 | }),
|
670 | 'style': sign[3]
|
671 | };
|
672 | } else {
|
673 | return {};
|
674 | }
|
675 | }
|
676 | };
|
677 |
|
678 | const compose$1 = {
|
679 | |
680 |
|
681 |
|
682 |
|
683 |
|
684 |
|
685 |
|
686 |
|
687 |
|
688 |
|
689 |
|
690 |
|
691 |
|
692 |
|
693 |
|
694 |
|
695 |
|
696 | symbol: fswSymObject => {
|
697 | if (typeof fswSymObject.symbol === 'string') {
|
698 | const symbol = (fswSymObject.symbol.match(re.symbol) || [''])[0];
|
699 |
|
700 | if (symbol) {
|
701 | const x = (fswSymObject.coord && fswSymObject.coord[0] || '').toString();
|
702 | const y = (fswSymObject.coord && fswSymObject.coord[1] || '').toString();
|
703 | const coord = ((x + 'x' + y).match(re.coord) || [''])[0] || '';
|
704 | const styleStr = typeof fswSymObject.style === 'string' && (fswSymObject.style.match(re$1.full) || [''])[0] || '';
|
705 | return symbol + coord + styleStr;
|
706 | }
|
707 | }
|
708 |
|
709 | return undefined;
|
710 | },
|
711 |
|
712 | |
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 |
|
720 |
|
721 |
|
722 |
|
723 |
|
724 |
|
725 |
|
726 |
|
727 |
|
728 |
|
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 |
|
737 |
|
738 |
|
739 |
|
740 |
|
741 |
|
742 |
|
743 |
|
744 |
|
745 |
|
746 |
|
747 |
|
748 |
|
749 | sign: fswSignObject => {
|
750 | let box = typeof fswSignObject.box !== 'string' ? 'M' : (fswSignObject.box + 'M').match(re.box);
|
751 | const x = (fswSignObject.max && fswSignObject.max[0] || '').toString();
|
752 | const y = (fswSignObject.max && fswSignObject.max[1] || '').toString();
|
753 | const max = ((x + 'x' + y).match(re.coord) || [''])[0] || '';
|
754 | if (!max) return undefined;
|
755 | let prefix = '';
|
756 |
|
757 | if (fswSignObject.sequence && Array.isArray(fswSignObject.sequence)) {
|
758 | prefix = fswSignObject.sequence.map(key => (key.match(re.symbol) || [''])[0]).join('');
|
759 | prefix = prefix ? 'A' + prefix : '';
|
760 | }
|
761 |
|
762 | let signbox = '';
|
763 |
|
764 | if (fswSignObject.spatials && Array.isArray(fswSignObject.spatials)) {
|
765 | signbox = fswSignObject.spatials.map(spatial => {
|
766 | if (typeof spatial.symbol === 'string') {
|
767 | const symbol = (spatial.symbol.match(re.symbol) || [''])[0];
|
768 |
|
769 | if (symbol) {
|
770 | const x = (spatial.coord && spatial.coord[0] || '').toString();
|
771 | const y = (spatial.coord && spatial.coord[1] || '').toString();
|
772 | const coord = ((x + 'x' + y).match(re.coord) || [''])[0] || '';
|
773 |
|
774 | if (coord) {
|
775 | return symbol + coord;
|
776 | }
|
777 | }
|
778 | }
|
779 |
|
780 | return '';
|
781 | }).join('');
|
782 | }
|
783 |
|
784 | const styleStr = typeof fswSignObject.style === 'string' && (fswSignObject.style.match(re$1.full) || [''])[0] || '';
|
785 | return prefix + box + max + signbox + styleStr;
|
786 | }
|
787 | };
|
788 |
|
789 | |
790 |
|
791 |
|
792 |
|
793 |
|
794 |
|
795 | const kind = [0x100, 0x37f, 0x387];
|
796 | |
797 |
|
798 |
|
799 |
|
800 |
|
801 |
|
802 | const category = [0x100, 0x205, 0x2f7, 0x2ff, 0x36d, 0x37f, 0x387];
|
803 | |
804 |
|
805 |
|
806 |
|
807 |
|
808 |
|
809 | const group = [0x100, 0x10e, 0x11e, 0x144, 0x14c, 0x186, 0x1a4, 0x1ba, 0x1cd, 0x1f5, 0x205, 0x216, 0x22a, 0x255, 0x265, 0x288, 0x2a6, 0x2b7, 0x2d5, 0x2e3, 0x2f7, 0x2ff, 0x30a, 0x32a, 0x33b, 0x359, 0x36d, 0x376, 0x37f, 0x387];
|
810 | |
811 |
|
812 |
|
813 |
|
814 |
|
815 |
|
816 |
|
817 |
|
818 | const ranges = {
|
819 | 'all': [0x100, 0x38b],
|
820 | 'writing': [0x100, 0x37e],
|
821 | 'hand': [0x100, 0x204],
|
822 | 'movement': [0x205, 0x2f6],
|
823 | 'dynamic': [0x2f7, 0x2fe],
|
824 | 'head': [0x2ff, 0x36c],
|
825 | 'hcenter': [0x2ff, 0x36c],
|
826 | 'vcenter': [0x2ff, 0x375],
|
827 | 'trunk': [0x36d, 0x375],
|
828 | 'limb': [0x376, 0x37e],
|
829 | 'location': [0x37f, 0x386],
|
830 | 'punctuation': [0x387, 0x38b]
|
831 | };
|
832 | |
833 |
|
834 |
|
835 |
|
836 |
|
837 |
|
838 |
|
839 |
|
840 |
|
841 |
|
842 |
|
843 |
|
844 | const isType = (key, type) => {
|
845 | const parsed = parse$1.symbol(key);
|
846 |
|
847 | if (parsed.symbol) {
|
848 | const dec = parseInt(parsed.symbol.slice(1, 4), 16);
|
849 | const range = ranges[type];
|
850 |
|
851 | if (range) {
|
852 | return range[0] <= dec && range[1] >= dec;
|
853 | }
|
854 | }
|
855 |
|
856 | return false;
|
857 | };
|
858 |
|
859 | |
860 |
|
861 |
|
862 |
|
863 |
|
864 |
|
865 | const colors = ['#0000CC', '#CC0000', '#FF0099', '#006600', '#000000', '#884411', '#FF9900'];
|
866 | |
867 |
|
868 |
|
869 |
|
870 |
|
871 |
|
872 |
|
873 |
|
874 |
|
875 |
|
876 |
|
877 | const colorize = key => {
|
878 | const parsed = parse$1.symbol(key);
|
879 | let color = '#000000';
|
880 |
|
881 | if (parsed.symbol) {
|
882 | const dec = parseInt(parsed.symbol.slice(1, 4), 16);
|
883 | const index = category.findIndex(val => val > dec);
|
884 | color = colors[index < 0 ? 6 : index - 1];
|
885 | }
|
886 |
|
887 | return color;
|
888 | };
|
889 |
|
890 | |
891 |
|
892 |
|
893 |
|
894 |
|
895 | var index$2 = Object.freeze({
|
896 | __proto__: null,
|
897 | re: re,
|
898 | parse: parse$1,
|
899 | compose: compose$1,
|
900 | kind: kind,
|
901 | category: category,
|
902 | group: group,
|
903 | ranges: ranges,
|
904 | isType: isType,
|
905 | colors: colors,
|
906 | colorize: colorize
|
907 | });
|
908 |
|
909 | |
910 |
|
911 |
|
912 |
|
913 |
|
914 |
|
915 |
|
916 | let re$3 = {
|
917 | 'base': '[123][0-9a-f]{2}',
|
918 | 'coord': '(?:[0-9]{3}x[0-9]{3})?',
|
919 | 'var': 'V[0-9]+'
|
920 | };
|
921 | re$3.symbol = `S${re$3.base}[0-5u][0-9a-fu]`;
|
922 | re$3.range = `R${re$3.base}t${re$3.base}`;
|
923 | re$3.prefix = `(?:A(?:${re$3.symbol}|${re$3.range})+)?T`;
|
924 | re$3.signbox = `(?:${re$3.symbol}${re$3.coord}|${re$3.range}${re$3.coord})*`;
|
925 | re$3.full = `Q(${re$3.prefix})?(${re$3.signbox})?(${re$3.var})?(-?)`;
|
926 |
|
927 | const parsePrefix = text => {
|
928 | return {
|
929 | required: true,
|
930 | parts: text == 'T' ? undefined : text.match(new RegExp(`(${re$3.symbol}|${re$3.range})`, 'g')).map(part => part[0] == 'S' ? part : part.slice(1).split('t'))
|
931 | };
|
932 | };
|
933 |
|
934 | const parseSignbox = text => {
|
935 | return text.match(new RegExp(`(${re$3.symbol}${re$3.coord}|${re$3.range}${re$3.coord})`, 'g')).map(part => {
|
936 | let coord, front;
|
937 |
|
938 | if (part.includes('x')) {
|
939 | coord = fsw2coord(part.slice(-7));
|
940 | front = part.slice(0, -7);
|
941 | } else {
|
942 | front = part;
|
943 | }
|
944 |
|
945 | if (front.includes('S')) {
|
946 | return {
|
947 | symbol: front,
|
948 | coord: coord
|
949 | };
|
950 | } else {
|
951 | return {
|
952 | range: front.slice(1).split('t'),
|
953 | coord: coord
|
954 | };
|
955 | }
|
956 | });
|
957 | };
|
958 | |
959 |
|
960 |
|
961 |
|
962 |
|
963 |
|
964 |
|
965 |
|
966 |
|
967 |
|
968 |
|
969 |
|
970 |
|
971 |
|
972 |
|
973 |
|
974 |
|
975 |
|
976 |
|
977 |
|
978 |
|
979 |
|
980 |
|
981 |
|
982 |
|
983 |
|
984 |
|
985 |
|
986 |
|
987 |
|
988 |
|
989 | const parse$2 = fswQueryString => {
|
990 | const query = typeof fswQueryString === 'string' ? fswQueryString.match(new RegExp(`^${re$3.full}`)) : undefined;
|
991 | return {
|
992 | 'query': query ? true : undefined,
|
993 | 'prefix': query && query[1] ? parsePrefix(query[1]) : undefined,
|
994 | 'signbox': query && query[2] ? parseSignbox(query[2]) : undefined,
|
995 | 'variance': query && query[3] ? parseInt(query[3].slice(1)) : undefined,
|
996 | 'style': query && query[4] ? true : undefined
|
997 | };
|
998 | };
|
999 |
|
1000 | |
1001 |
|
1002 |
|
1003 |
|
1004 |
|
1005 |
|
1006 |
|
1007 |
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 |
|
1016 |
|
1017 |
|
1018 |
|
1019 |
|
1020 |
|
1021 |
|
1022 |
|
1023 |
|
1024 |
|
1025 |
|
1026 |
|
1027 |
|
1028 |
|
1029 |
|
1030 |
|
1031 |
|
1032 |
|
1033 |
|
1034 |
|
1035 |
|
1036 |
|
1037 | const compose$2 = fswQueryObject => {
|
1038 | if (!fswQueryObject || !fswQueryObject.query) {
|
1039 | return undefined;
|
1040 | }
|
1041 |
|
1042 | let query = 'Q';
|
1043 |
|
1044 | if (fswQueryObject.prefix && fswQueryObject.prefix.required) {
|
1045 | if (Array.isArray(fswQueryObject.prefix.parts)) {
|
1046 | query += 'A';
|
1047 | query += fswQueryObject.prefix.parts.map(part => {
|
1048 | if (typeof part === 'string') {
|
1049 | return part;
|
1050 | } else {
|
1051 | if (Array.isArray(part) && part.length == 2) {
|
1052 | return `R${part[0]}t${part[1]}`;
|
1053 | }
|
1054 | }
|
1055 | }).join('');
|
1056 | }
|
1057 |
|
1058 | query += 'T';
|
1059 | }
|
1060 |
|
1061 | if (Array.isArray(fswQueryObject.signbox)) {
|
1062 | query += fswQueryObject.signbox.map(part => {
|
1063 | let out;
|
1064 |
|
1065 | if (part.symbol) {
|
1066 | out = part.symbol;
|
1067 | } else {
|
1068 | if (part.range && Array.isArray(part.range) && part.range.length == 2) {
|
1069 | out = `R${part.range[0]}t${part.range[1]}`;
|
1070 | }
|
1071 | }
|
1072 |
|
1073 | return out + (Array.isArray(part.coord) && part.coord.length == 2 ? part.coord.join('x') : '');
|
1074 | }).join('');
|
1075 | }
|
1076 |
|
1077 | query += fswQueryObject.style ? '-' : '';
|
1078 | query = query.match(new RegExp(`^${re$3.full}`))[0];
|
1079 | return query;
|
1080 | };
|
1081 |
|
1082 | |
1083 |
|
1084 |
|
1085 |
|
1086 |
|
1087 |
|
1088 |
|
1089 |
|
1090 |
|
1091 |
|
1092 |
|
1093 |
|
1094 |
|
1095 |
|
1096 |
|
1097 |
|
1098 |
|
1099 |
|
1100 |
|
1101 | const fsw2query = (fswSign, flags) => {
|
1102 | let query = '';
|
1103 | const parsed = parse$1.sign(fswSign);
|
1104 |
|
1105 | if (parsed.box) {
|
1106 | const A_flag = flags.indexOf('A') > -1;
|
1107 | const a_flag = flags.indexOf('a') > -1;
|
1108 | const S_flag = flags.indexOf('S') > -1;
|
1109 | const s_flag = flags.indexOf('s') > -1;
|
1110 | const L_flag = flags.indexOf('L') > -1;
|
1111 |
|
1112 | if (A_flag || a_flag || S_flag || s_flag) {
|
1113 | if ((A_flag || a_flag) && parsed.sequence) {
|
1114 | query += 'A';
|
1115 | query += parsed.sequence.map(sym => sym.slice(0, 4) + (a_flag ? 'uu' : sym.slice(4, 6))).join('');
|
1116 | query += 'T';
|
1117 | }
|
1118 |
|
1119 | if ((S_flag || s_flag) && parsed.spatials) {
|
1120 | query += parsed.spatials.map(spatial => spatial.symbol.slice(0, 4) + (s_flag ? 'uu' : spatial.symbol.slice(4, 6)) + (L_flag ? spatial.coord.join('x') : '')).join('');
|
1121 | }
|
1122 | }
|
1123 |
|
1124 | return query ? "Q" + query : undefined;
|
1125 | } else {
|
1126 | return undefined;
|
1127 | }
|
1128 | };
|
1129 |
|
1130 |
|
1131 |
|
1132 | |
1133 |
|
1134 |
|
1135 |
|
1136 |
|
1137 |
|
1138 |
|
1139 |
|
1140 |
|
1141 |
|
1142 |
|
1143 |
|
1144 |
|
1145 |
|
1146 |
|
1147 |
|
1148 | const range = (min, max, hex) => {
|
1149 | let pattern;
|
1150 | let re;
|
1151 | let diff;
|
1152 | let tmax;
|
1153 | let cnt;
|
1154 | let minV;
|
1155 | let maxV;
|
1156 |
|
1157 | if (!hex) {
|
1158 | hex = '';
|
1159 | }
|
1160 |
|
1161 | min = ("000" + min).slice(-3);
|
1162 | max = '' + max;
|
1163 | pattern = '';
|
1164 |
|
1165 | if (min === max) {
|
1166 | return min;
|
1167 | }
|
1168 |
|
1169 |
|
1170 | re = [];
|
1171 |
|
1172 |
|
1173 | if (!(min[0] == max[0] && min[1] == max[1])) {
|
1174 | if (min[2] != '0') {
|
1175 | pattern = min[0] + min[1];
|
1176 |
|
1177 | if (hex) {
|
1178 |
|
1179 | switch (min[2]) {
|
1180 | case "f":
|
1181 | pattern += 'f';
|
1182 | break;
|
1183 |
|
1184 | case "e":
|
1185 | pattern += '[ef]';
|
1186 | break;
|
1187 |
|
1188 | case "d":
|
1189 | case "c":
|
1190 | case "b":
|
1191 | case "a":
|
1192 | pattern += '[' + min[2] + '-f]';
|
1193 | break;
|
1194 |
|
1195 | default:
|
1196 | switch (min[2]) {
|
1197 | case "9":
|
1198 | pattern += '[9a-f]';
|
1199 | break;
|
1200 |
|
1201 | case "8":
|
1202 | pattern += '[89a-f]';
|
1203 | break;
|
1204 |
|
1205 | default:
|
1206 | pattern += '[' + min[2] + '-9a-f]';
|
1207 | break;
|
1208 | }
|
1209 |
|
1210 | break;
|
1211 | }
|
1212 |
|
1213 | diff = 15 - parseInt(min[2], 16) + 1;
|
1214 | min = '' + (parseInt(min, 16) + diff).toString(16);
|
1215 | re.push(pattern);
|
1216 | } else {
|
1217 |
|
1218 | switch (min[2]) {
|
1219 | case "9":
|
1220 | pattern += '9';
|
1221 | break;
|
1222 |
|
1223 | case "8":
|
1224 | pattern += '[89]';
|
1225 | break;
|
1226 |
|
1227 | default:
|
1228 | pattern += '[' + min[2] + '-9]';
|
1229 | break;
|
1230 | }
|
1231 |
|
1232 | diff = 9 - min[2] + 1;
|
1233 | min = '' + (min * 1 + diff);
|
1234 | re.push(pattern);
|
1235 | }
|
1236 | }
|
1237 | }
|
1238 |
|
1239 | pattern = '';
|
1240 |
|
1241 | if (min[0] != max[0]) {
|
1242 | if (min[1] != '0') {
|
1243 | if (hex) {
|
1244 |
|
1245 | pattern = min[0];
|
1246 |
|
1247 | switch (min[1]) {
|
1248 | case "f":
|
1249 | pattern += 'f';
|
1250 | break;
|
1251 |
|
1252 | case "e":
|
1253 | pattern += '[ef]';
|
1254 | break;
|
1255 |
|
1256 | case "d":
|
1257 | case "c":
|
1258 | case "b":
|
1259 | case "a":
|
1260 | pattern += '[' + min[1] + '-f]';
|
1261 | break;
|
1262 |
|
1263 | case "9":
|
1264 | pattern += '[9a-f]';
|
1265 | break;
|
1266 |
|
1267 | case "8":
|
1268 | pattern += '[89a-f]';
|
1269 | break;
|
1270 |
|
1271 | default:
|
1272 | pattern += '[' + min[1] + '-9a-f]';
|
1273 | break;
|
1274 | }
|
1275 |
|
1276 | pattern += '[0-9a-f]';
|
1277 | diff = 15 - parseInt(min[1], 16) + 1;
|
1278 | min = '' + (parseInt(min, 16) + diff * 16).toString(16);
|
1279 | re.push(pattern);
|
1280 | } else {
|
1281 |
|
1282 | pattern = min[0];
|
1283 | diff = 9 - min[1] + 1;
|
1284 |
|
1285 | switch (min[1]) {
|
1286 | case "9":
|
1287 | pattern += '9';
|
1288 | break;
|
1289 |
|
1290 | case "8":
|
1291 | pattern += '[89]';
|
1292 | break;
|
1293 |
|
1294 | default:
|
1295 | pattern += '[' + min[1] + '-9]';
|
1296 | break;
|
1297 | }
|
1298 |
|
1299 | pattern += '[0-9]';
|
1300 | diff = 9 - min[1] + 1;
|
1301 | min = '' + (min * 1 + diff * 10);
|
1302 | re.push(pattern);
|
1303 | }
|
1304 | }
|
1305 | }
|
1306 |
|
1307 | pattern = '';
|
1308 |
|
1309 | if (min[0] != max[0]) {
|
1310 | if (hex) {
|
1311 | diff = parseInt(max[0], 16) - parseInt(min[0], 16);
|
1312 | tmax = (parseInt(min[0], 16) + diff - 1).toString(16);
|
1313 |
|
1314 | switch (diff) {
|
1315 | case 1:
|
1316 | pattern = min[0];
|
1317 | break;
|
1318 |
|
1319 | case 2:
|
1320 | pattern = '[' + min[0] + tmax + ']';
|
1321 | break;
|
1322 |
|
1323 | default:
|
1324 | if (parseInt(min[0], 16) > 9) {
|
1325 | minV = 'h';
|
1326 | } else {
|
1327 | minV = 'd';
|
1328 | }
|
1329 |
|
1330 | if (parseInt(tmax, 16) > 9) {
|
1331 | maxV = 'h';
|
1332 | } else {
|
1333 | maxV = 'd';
|
1334 | }
|
1335 |
|
1336 | switch (minV + maxV) {
|
1337 | case "dd":
|
1338 | pattern += '[' + min[0] + '-' + tmax + ']';
|
1339 | break;
|
1340 |
|
1341 | case "dh":
|
1342 | diff = 9 - min[0];
|
1343 |
|
1344 | switch (diff) {
|
1345 | case 0:
|
1346 | pattern += '[9';
|
1347 | break;
|
1348 |
|
1349 | case 1:
|
1350 | pattern += '[89';
|
1351 | break;
|
1352 |
|
1353 | default:
|
1354 | pattern += '[' + min[0] + '-9';
|
1355 | break;
|
1356 | }
|
1357 |
|
1358 | switch (tmax[0]) {
|
1359 | case 'a':
|
1360 | pattern += 'a]';
|
1361 | break;
|
1362 |
|
1363 | case 'b':
|
1364 | pattern += 'ab]';
|
1365 | break;
|
1366 |
|
1367 | default:
|
1368 | pattern += 'a-' + tmax + ']';
|
1369 | break;
|
1370 | }
|
1371 |
|
1372 | break;
|
1373 |
|
1374 | case "hh":
|
1375 | pattern += '[' + min[0] + '-' + tmax + ']';
|
1376 | break;
|
1377 | }
|
1378 |
|
1379 | }
|
1380 |
|
1381 | pattern += '[0-9a-f][0-9a-f]';
|
1382 | diff = parseInt(max[0], 16) - parseInt(min[0], 16);
|
1383 | min = '' + (parseInt(min, 16) + diff * 256).toString(16);
|
1384 | re.push(pattern);
|
1385 | } else {
|
1386 | diff = max[0] - min[0];
|
1387 | tmax = min[0] * 1 + diff - 1;
|
1388 |
|
1389 | switch (diff) {
|
1390 | case 1:
|
1391 | pattern = min[0];
|
1392 | break;
|
1393 |
|
1394 | case 2:
|
1395 | pattern = '[' + min[0] + tmax + ']';
|
1396 | break;
|
1397 |
|
1398 | default:
|
1399 | pattern = '[' + min[0] + '-' + tmax + ']';
|
1400 | break;
|
1401 | }
|
1402 |
|
1403 | pattern += '[0-9][0-9]';
|
1404 | min = '' + (min * 1 + diff * 100);
|
1405 | re.push(pattern);
|
1406 | }
|
1407 | }
|
1408 |
|
1409 | pattern = '';
|
1410 |
|
1411 | if (min[1] != max[1]) {
|
1412 | if (hex) {
|
1413 | diff = parseInt(max[1], 16) - parseInt(min[1], 16);
|
1414 | tmax = (parseInt(min[1], 16) + diff - 1).toString(16);
|
1415 | pattern = min[0];
|
1416 |
|
1417 | switch (diff) {
|
1418 | case 1:
|
1419 | pattern += min[1];
|
1420 | break;
|
1421 |
|
1422 | case 2:
|
1423 | pattern += '[' + min[1] + tmax + ']';
|
1424 | break;
|
1425 |
|
1426 | default:
|
1427 | if (parseInt(min[1], 16) > 9) {
|
1428 | minV = 'h';
|
1429 | } else {
|
1430 | minV = 'd';
|
1431 | }
|
1432 |
|
1433 | if (parseInt(tmax, 16) > 9) {
|
1434 | maxV = 'h';
|
1435 | } else {
|
1436 | maxV = 'd';
|
1437 | }
|
1438 |
|
1439 | switch (minV + maxV) {
|
1440 | case "dd":
|
1441 | pattern += '[' + min[1];
|
1442 |
|
1443 | if (diff > 1) {
|
1444 | pattern += '-';
|
1445 | }
|
1446 |
|
1447 | pattern += tmax + ']';
|
1448 | break;
|
1449 |
|
1450 | case "dh":
|
1451 | diff = 9 - min[1];
|
1452 |
|
1453 | switch (diff) {
|
1454 | case 0:
|
1455 | pattern += '[9';
|
1456 | break;
|
1457 |
|
1458 | case 1:
|
1459 | pattern += '[89';
|
1460 | break;
|
1461 |
|
1462 | default:
|
1463 | pattern += '[' + min[1] + '-9';
|
1464 | break;
|
1465 | }
|
1466 |
|
1467 | switch (max[1]) {
|
1468 | case 'a':
|
1469 | pattern += ']';
|
1470 | break;
|
1471 |
|
1472 | case 'b':
|
1473 | pattern += 'a]';
|
1474 | break;
|
1475 |
|
1476 | default:
|
1477 | pattern += 'a-' + (parseInt(max[1], 16) - 1).toString(16) + ']';
|
1478 | break;
|
1479 | }
|
1480 |
|
1481 | break;
|
1482 |
|
1483 | case "hh":
|
1484 | pattern += '[' + min[1];
|
1485 |
|
1486 | if (diff > 1) {
|
1487 | pattern += '-';
|
1488 | }
|
1489 |
|
1490 | pattern += (parseInt(max[1], 16) - 1).toString(16) + ']';
|
1491 | break;
|
1492 | }
|
1493 |
|
1494 | break;
|
1495 | }
|
1496 |
|
1497 | pattern += '[0-9a-f]';
|
1498 | diff = parseInt(max[1], 16) - parseInt(min[1], 16);
|
1499 | min = '' + (parseInt(min, 16) + diff * 16).toString(16);
|
1500 | re.push(pattern);
|
1501 | } else {
|
1502 | diff = max[1] - min[1];
|
1503 | tmax = min[1] * 1 + diff - 1;
|
1504 | pattern = min[0];
|
1505 |
|
1506 | switch (diff) {
|
1507 | case 1:
|
1508 | pattern += min[1];
|
1509 | break;
|
1510 |
|
1511 | case 2:
|
1512 | pattern += '[' + min[1] + tmax + ']';
|
1513 | break;
|
1514 |
|
1515 | default:
|
1516 | pattern += '[' + min[1] + '-' + tmax + ']';
|
1517 | break;
|
1518 | }
|
1519 |
|
1520 | pattern += '[0-9]';
|
1521 | min = '' + (min * 1 + diff * 10);
|
1522 | re.push(pattern);
|
1523 | }
|
1524 | }
|
1525 |
|
1526 | pattern = '';
|
1527 |
|
1528 | if (min[2] != max[2]) {
|
1529 | if (hex) {
|
1530 | pattern = min[0] + min[1];
|
1531 | diff = parseInt(max[2], 16) - parseInt(min[2], 16);
|
1532 |
|
1533 | if (parseInt(min[2], 16) > 9) {
|
1534 | minV = 'h';
|
1535 | } else {
|
1536 | minV = 'd';
|
1537 | }
|
1538 |
|
1539 | if (parseInt(max[2], 16) > 9) {
|
1540 | maxV = 'h';
|
1541 | } else {
|
1542 | maxV = 'd';
|
1543 | }
|
1544 |
|
1545 | switch (minV + maxV) {
|
1546 | case "dd":
|
1547 | pattern += '[' + min[2];
|
1548 |
|
1549 | if (diff > 1) {
|
1550 | pattern += '-';
|
1551 | }
|
1552 |
|
1553 | pattern += max[2] + ']';
|
1554 | break;
|
1555 |
|
1556 | case "dh":
|
1557 | diff = 9 - min[2];
|
1558 |
|
1559 | switch (diff) {
|
1560 | case 0:
|
1561 | pattern += '[9';
|
1562 | break;
|
1563 |
|
1564 | case 1:
|
1565 | pattern += '[89';
|
1566 | break;
|
1567 |
|
1568 | default:
|
1569 | pattern += '[' + min[2] + '-9';
|
1570 | break;
|
1571 | }
|
1572 |
|
1573 | switch (max[2]) {
|
1574 | case 'a':
|
1575 | pattern += 'a]';
|
1576 | break;
|
1577 |
|
1578 | case 'b':
|
1579 | pattern += 'ab]';
|
1580 | break;
|
1581 |
|
1582 | default:
|
1583 | pattern += 'a-' + max[2] + ']';
|
1584 | break;
|
1585 | }
|
1586 |
|
1587 | break;
|
1588 |
|
1589 | case "hh":
|
1590 | pattern += '[' + min[2];
|
1591 |
|
1592 | if (diff > 1) {
|
1593 | pattern += '-';
|
1594 | }
|
1595 |
|
1596 | pattern += max[2] + ']';
|
1597 | break;
|
1598 | }
|
1599 |
|
1600 | diff = parseInt(max[2], 16) - parseInt(min[2], 16);
|
1601 | min = '' + (parseInt(min, 16) + diff).toString(16);
|
1602 | re.push(pattern);
|
1603 | } else {
|
1604 | diff = max[2] - min[2];
|
1605 | pattern = min[0] + min[1];
|
1606 |
|
1607 | switch (diff) {
|
1608 | case 0:
|
1609 | pattern += min[2];
|
1610 | break;
|
1611 |
|
1612 | case 1:
|
1613 | pattern += '[' + min[2] + max[2] + ']';
|
1614 | break;
|
1615 |
|
1616 | default:
|
1617 | pattern += '[' + min[2] + '-' + max[2] + ']';
|
1618 | break;
|
1619 | }
|
1620 |
|
1621 | min = '' + (min * 1 + diff);
|
1622 | re.push(pattern);
|
1623 | }
|
1624 | }
|
1625 |
|
1626 | pattern = '';
|
1627 |
|
1628 | if (min[2] == '0' && max[2] == '0') {
|
1629 | pattern = max;
|
1630 | re.push(pattern);
|
1631 | }
|
1632 |
|
1633 | pattern = '';
|
1634 | cnt = re.length;
|
1635 |
|
1636 | if (cnt == 1) {
|
1637 | pattern = re[0];
|
1638 | } else {
|
1639 | pattern = re.join(')|(');
|
1640 | pattern = '((' + pattern + '))';
|
1641 | }
|
1642 |
|
1643 | return pattern;
|
1644 | };
|
1645 |
|
1646 | |
1647 |
|
1648 |
|
1649 |
|
1650 |
|
1651 |
|
1652 |
|
1653 |
|
1654 |
|
1655 |
|
1656 |
|
1657 |
|
1658 |
|
1659 |
|
1660 | const regex = query => {
|
1661 | query = query.match(new RegExp(`^${re$3.full}`))[0];
|
1662 |
|
1663 | if (!query) {
|
1664 | return '';
|
1665 | }
|
1666 |
|
1667 | var matches;
|
1668 | var i;
|
1669 | var fsw_pattern;
|
1670 | var part;
|
1671 | var from;
|
1672 | var to;
|
1673 | var re_range;
|
1674 | var segment;
|
1675 | var x;
|
1676 | var y;
|
1677 | var base;
|
1678 | var fill;
|
1679 | var rotate;
|
1680 | var fuzz = 20;
|
1681 | var re_sym = 'S[123][0-9a-f]{2}[0-5][0-9a-f]';
|
1682 | var re_coord = '[0-9]{3}x[0-9]{3}';
|
1683 | var re_word = '[BLMR](' + re_coord + ')(' + re_sym + re_coord + ')*';
|
1684 | var re_sortable = '(A(' + re_sym + ')+)';
|
1685 | var q_range = 'R[123][0-9a-f]{2}t[123][0-9a-f]{2}';
|
1686 | var q_sym = 'S[123][0-9a-f]{2}[0-5u][0-9a-fu]';
|
1687 | var q_coord = '([0-9]{3}x[0-9]{3})?';
|
1688 | var q_var = '(V[0-9]+)';
|
1689 | var q_style = '(' + re$1.full + ')?';
|
1690 | var q_sortable;
|
1691 |
|
1692 | if (query == 'Q') {
|
1693 | return [re_sortable + "?" + re_word];
|
1694 | }
|
1695 |
|
1696 | if (query == 'Q-') {
|
1697 | return [re_sortable + "?" + re_word + q_style];
|
1698 | }
|
1699 |
|
1700 | if (query == 'QT') {
|
1701 | return [re_sortable + re_word];
|
1702 | }
|
1703 |
|
1704 | if (query == 'QT-') {
|
1705 | return [re_sortable + re_word + q_style];
|
1706 | }
|
1707 |
|
1708 | var segments = [];
|
1709 | var sortable = query.indexOf('T') + 1;
|
1710 |
|
1711 | if (sortable) {
|
1712 | q_sortable = '(A';
|
1713 | var qat = query.slice(0, sortable);
|
1714 | query = query.replace(qat, '');
|
1715 |
|
1716 | if (qat == 'QT') {
|
1717 | q_sortable += '(' + re_sym + ')+)';
|
1718 | } else {
|
1719 | matches = qat.match(new RegExp('(' + q_sym + '|' + q_range + ')', 'g'));
|
1720 |
|
1721 | if (matches) {
|
1722 | var matched;
|
1723 |
|
1724 | for (i = 0; i < matches.length; i += 1) {
|
1725 | matched = matches[i].match(new RegExp(q_sym));
|
1726 |
|
1727 | if (matched) {
|
1728 | segment = matched[0].slice(0, 4);
|
1729 | fill = matched[0].slice(4, 5);
|
1730 |
|
1731 | if (fill == 'u') {
|
1732 | segment += '[0-5]';
|
1733 | } else {
|
1734 | segment += fill;
|
1735 | }
|
1736 |
|
1737 | rotate = matched[0].slice(5, 6);
|
1738 |
|
1739 | if (rotate == 'u') {
|
1740 | segment += '[0-9a-f]';
|
1741 | } else {
|
1742 | segment += rotate;
|
1743 | }
|
1744 |
|
1745 | q_sortable += segment;
|
1746 | } else {
|
1747 | from = matches[i].slice(1, 4);
|
1748 | to = matches[i].slice(5, 8);
|
1749 | re_range = range(from, to, 'hex');
|
1750 | segment = 'S' + re_range + '[0-5][0-9a-f]';
|
1751 | q_sortable += segment;
|
1752 | }
|
1753 | }
|
1754 |
|
1755 | q_sortable += '(' + re_sym + ')*)';
|
1756 | }
|
1757 | }
|
1758 | }
|
1759 |
|
1760 |
|
1761 | matches = query.match(new RegExp(q_var, 'g'));
|
1762 |
|
1763 | if (matches) {
|
1764 | fuzz = matches.toString().slice(1) * 1;
|
1765 | }
|
1766 |
|
1767 |
|
1768 | fsw_pattern = q_sym + q_coord;
|
1769 | matches = query.match(new RegExp(fsw_pattern, 'g'));
|
1770 |
|
1771 | if (matches) {
|
1772 | for (i = 0; i < matches.length; i += 1) {
|
1773 | part = matches[i].toString();
|
1774 | base = part.slice(1, 4);
|
1775 | segment = 'S' + base;
|
1776 | fill = part.slice(4, 5);
|
1777 |
|
1778 | if (fill == 'u') {
|
1779 | segment += '[0-5]';
|
1780 | } else {
|
1781 | segment += fill;
|
1782 | }
|
1783 |
|
1784 | rotate = part.slice(5, 6);
|
1785 |
|
1786 | if (rotate == 'u') {
|
1787 | segment += '[0-9a-f]';
|
1788 | } else {
|
1789 | segment += rotate;
|
1790 | }
|
1791 |
|
1792 | if (part.length > 6) {
|
1793 | x = part.slice(6, 9) * 1;
|
1794 | y = part.slice(10, 13) * 1;
|
1795 |
|
1796 | segment += range(x - fuzz, x + fuzz);
|
1797 | segment += 'x';
|
1798 | segment += range(y - fuzz, y + fuzz);
|
1799 | } else {
|
1800 | segment += re_coord;
|
1801 | }
|
1802 |
|
1803 |
|
1804 |
|
1805 | segment = re_word + segment + '(' + re_sym + re_coord + ')*';
|
1806 |
|
1807 | if (sortable) {
|
1808 | segment = q_sortable + segment;
|
1809 | } else {
|
1810 | segment = re_sortable + "?" + segment;
|
1811 | }
|
1812 |
|
1813 | if (query.indexOf('-') > 0) {
|
1814 | segment += q_style;
|
1815 | }
|
1816 |
|
1817 | segments.push(segment);
|
1818 | }
|
1819 | }
|
1820 |
|
1821 |
|
1822 | fsw_pattern = q_range + q_coord;
|
1823 | matches = query.match(new RegExp(fsw_pattern, 'g'));
|
1824 |
|
1825 | if (matches) {
|
1826 | for (i = 0; i < matches.length; i += 1) {
|
1827 | part = matches[i].toString();
|
1828 | from = part.slice(1, 4);
|
1829 | to = part.slice(5, 8);
|
1830 | re_range = range(from, to, "hex");
|
1831 | segment = 'S' + re_range + '[0-5][0-9a-f]';
|
1832 |
|
1833 | if (part.length > 8) {
|
1834 | x = part.slice(8, 11) * 1;
|
1835 | y = part.slice(12, 15) * 1;
|
1836 |
|
1837 | segment += range(x - fuzz, x + fuzz);
|
1838 | segment += 'x';
|
1839 | segment += range(y - fuzz, y + fuzz);
|
1840 | } else {
|
1841 | segment += re_coord;
|
1842 | }
|
1843 |
|
1844 |
|
1845 | segment = re_word + segment + '(' + re_sym + re_coord + ')*';
|
1846 |
|
1847 | if (sortable) {
|
1848 | segment = q_sortable + segment;
|
1849 | } else {
|
1850 | segment = re_sortable + "?" + segment;
|
1851 | }
|
1852 |
|
1853 | if (query.indexOf('-') > 0) {
|
1854 | segment += q_style;
|
1855 | }
|
1856 |
|
1857 | segments.push(segment);
|
1858 | }
|
1859 | }
|
1860 |
|
1861 | if (!segments.length) {
|
1862 | if (query.indexOf('-') > 0) {
|
1863 | segment += q_style;
|
1864 | }
|
1865 |
|
1866 | segments.push(q_sortable + re_word);
|
1867 | }
|
1868 |
|
1869 | return segments;
|
1870 | };
|
1871 |
|
1872 | |
1873 |
|
1874 |
|
1875 |
|
1876 |
|
1877 |
|
1878 |
|
1879 |
|
1880 |
|
1881 |
|
1882 |
|
1883 |
|
1884 |
|
1885 |
|
1886 | const results = (query, text) => {
|
1887 | if (!text) {
|
1888 | return [];
|
1889 | }
|
1890 |
|
1891 | let pattern;
|
1892 | let matches;
|
1893 | let parts;
|
1894 | let words;
|
1895 | let re = regex(query);
|
1896 |
|
1897 | if (!re) {
|
1898 | return [];
|
1899 | }
|
1900 |
|
1901 | let i;
|
1902 |
|
1903 | for (i = 0; i < re.length; i += 1) {
|
1904 | pattern = re[i];
|
1905 | matches = text.match(new RegExp(pattern, 'g'));
|
1906 |
|
1907 | if (matches) {
|
1908 | text = matches.join(' ');
|
1909 | } else {
|
1910 | text = '';
|
1911 | }
|
1912 | }
|
1913 |
|
1914 | if (text) {
|
1915 | parts = text.split(' ');
|
1916 | words = parts.filter(function (element) {
|
1917 | return element in parts ? false : parts[element] = true;
|
1918 | }, {});
|
1919 | } else {
|
1920 | words = [];
|
1921 | }
|
1922 |
|
1923 | return words;
|
1924 | };
|
1925 |
|
1926 | |
1927 |
|
1928 |
|
1929 |
|
1930 |
|
1931 |
|
1932 |
|
1933 |
|
1934 |
|
1935 |
|
1936 |
|
1937 |
|
1938 |
|
1939 |
|
1940 |
|
1941 |
|
1942 |
|
1943 | const lines = (query, text) => {
|
1944 | if (!text) {
|
1945 | return [];
|
1946 | }
|
1947 |
|
1948 | let pattern;
|
1949 | let matches;
|
1950 | let parts;
|
1951 | let words;
|
1952 | let re = regex(query);
|
1953 |
|
1954 | if (!re) {
|
1955 | return [];
|
1956 | }
|
1957 |
|
1958 | let i;
|
1959 |
|
1960 | for (i = 0; i < re.length; i += 1) {
|
1961 | pattern = re[i];
|
1962 | pattern = '^' + pattern + '.*';
|
1963 | matches = text.match(new RegExp(pattern, 'mg'));
|
1964 |
|
1965 | if (matches) {
|
1966 | text = matches.join("\n");
|
1967 | } else {
|
1968 | text = '';
|
1969 | }
|
1970 | }
|
1971 |
|
1972 | if (text) {
|
1973 | parts = text.split("\n");
|
1974 | words = parts.filter(function (element) {
|
1975 | return element in parts ? false : parts[element] = true;
|
1976 | }, {});
|
1977 | } else {
|
1978 | words = [];
|
1979 | }
|
1980 |
|
1981 | return words;
|
1982 | };
|
1983 |
|
1984 | |
1985 |
|
1986 |
|
1987 |
|
1988 |
|
1989 | var index$3 = Object.freeze({
|
1990 | __proto__: null,
|
1991 | re: re$3,
|
1992 | parse: parse$2,
|
1993 | compose: compose$2,
|
1994 | fsw2query: fsw2query,
|
1995 | range: range,
|
1996 | regex: regex,
|
1997 | results: results,
|
1998 | lines: lines
|
1999 | });
|
2000 |
|
2001 | const parse$3 = {
|
2002 | |
2003 |
|
2004 |
|
2005 |
|
2006 |
|
2007 |
|
2008 |
|
2009 |
|
2010 |
|
2011 |
|
2012 |
|
2013 |
|
2014 |
|
2015 |
|
2016 | symbol: swuSym => {
|
2017 | const regex = `^(${re$2.symbol})(${re$2.coord})?(${re$1.full})?`;
|
2018 | const symbol = typeof swuSym === 'string' ? swuSym.match(new RegExp(regex)) : undefined;
|
2019 | return {
|
2020 | 'symbol': symbol ? symbol[1] : undefined,
|
2021 | 'coord': symbol && symbol[2] ? swu2coord(symbol[2]) : undefined,
|
2022 | 'style': symbol ? symbol[3] : undefined
|
2023 | };
|
2024 | },
|
2025 |
|
2026 | |
2027 |
|
2028 |
|
2029 |
|
2030 |
|
2031 |
|
2032 |
|
2033 |
|
2034 |
|
2035 |
|
2036 |
|
2037 |
|
2038 |
|
2039 |
|
2040 |
|
2041 |
|
2042 |
|
2043 |
|
2044 |
|
2045 |
|
2046 |
|
2047 |
|
2048 |
|
2049 |
|
2050 |
|
2051 |
|
2052 |
|
2053 |
|
2054 |
|
2055 |
|
2056 |
|
2057 |
|
2058 |
|
2059 | sign: swuSign => {
|
2060 | const regex = `^(${re$2.prefix})?(${re$2.signbox})(${re$1.full})?`;
|
2061 | const sign = typeof swuSign === 'string' ? swuSign.match(new RegExp(regex)) : undefined;
|
2062 |
|
2063 | if (sign) {
|
2064 | return {
|
2065 | 'sequence': sign[1] ? sign[1].slice(2).match(/.{2}/g) : undefined,
|
2066 | 'box': sign[2].slice(0, 2),
|
2067 | 'max': swu2coord(sign[2].slice(2, 6)),
|
2068 | 'spatials': sign[2].length < 7 ? undefined : sign[2].slice(6).match(/(.{6})/g).map(m => {
|
2069 | return {
|
2070 | symbol: m.slice(0, 2),
|
2071 | coord: swu2coord(m.slice(2))
|
2072 | };
|
2073 | }),
|
2074 | 'style': sign[3]
|
2075 | };
|
2076 | } else {
|
2077 | return {};
|
2078 | }
|
2079 | }
|
2080 | };
|
2081 | |
2082 |
|
2083 |
|
2084 |
|
2085 |
|
2086 |
|
2087 |
|
2088 |
|
2089 |
|
2090 |
|
2091 |
|
2092 | const encode = text => text.replace(/[\u007F-\uFFFF]/g, function (chr) {
|
2093 | return "\\u" + ("0000" + chr.charCodeAt(0).toString(16)).substr(-4).toUpperCase();
|
2094 | });
|
2095 | |
2096 |
|
2097 |
|
2098 |
|
2099 |
|
2100 |
|
2101 |
|
2102 |
|
2103 |
|
2104 |
|
2105 |
|
2106 |
|
2107 | const decode = encoded => encoded.replace(/\\u([0-9A-F]{4})/g, function (match, chr) {
|
2108 | return String.fromCharCode(parseInt(chr, 16));
|
2109 | });
|
2110 | |
2111 |
|
2112 |
|
2113 |
|
2114 |
|
2115 |
|
2116 |
|
2117 |
|
2118 |
|
2119 |
|
2120 |
|
2121 |
|
2122 | const pair = swuChar => [swuChar.charCodeAt(0).toString(16).toUpperCase(), swuChar.charCodeAt(1).toString(16).toUpperCase()];
|
2123 |
|
2124 | const compose$3 = {
|
2125 | |
2126 |
|
2127 |
|
2128 |
|
2129 |
|
2130 |
|
2131 |
|
2132 |
|
2133 |
|
2134 |
|
2135 |
|
2136 |
|
2137 |
|
2138 |
|
2139 |
|
2140 |
|
2141 |
|
2142 | symbol: swuSymObject => {
|
2143 | if (typeof swuSymObject !== 'object' || swuSymObject === null) return undefined;
|
2144 |
|
2145 | if (typeof swuSymObject.symbol === 'string') {
|
2146 | const symbol = (swuSymObject.symbol.match(re$2.symbol) || [''])[0];
|
2147 |
|
2148 | if (symbol) {
|
2149 | const x = swuSymObject.coord && swuSymObject.coord[0] || '';
|
2150 | const y = swuSymObject.coord && swuSymObject.coord[1] || '';
|
2151 | const coord = x && y ? coord2swu([x, y]) : '';
|
2152 | const styleStr = typeof swuSymObject.style === 'string' && (swuSymObject.style.match(re$1.full) || [''])[0] || '';
|
2153 | return symbol + coord + styleStr;
|
2154 | }
|
2155 | }
|
2156 |
|
2157 | return undefined;
|
2158 | },
|
2159 |
|
2160 | |
2161 |
|
2162 |
|
2163 |
|
2164 |
|
2165 |
|
2166 |
|
2167 |
|
2168 |
|
2169 |
|
2170 |
|
2171 |
|
2172 |
|
2173 |
|
2174 |
|
2175 |
|
2176 |
|
2177 |
|
2178 |
|
2179 |
|
2180 |
|
2181 |
|
2182 |
|
2183 |
|
2184 |
|
2185 |
|
2186 |
|
2187 |
|
2188 |
|
2189 |
|
2190 |
|
2191 |
|
2192 |
|
2193 |
|
2194 |
|
2195 |
|
2196 |
|
2197 | sign: swuSignObject => {
|
2198 | if (typeof swuSignObject !== 'object' || swuSignObject === null) return undefined;
|
2199 | let box = typeof swuSignObject.box !== 'string' ? '𝠃' : (swuSignObject.box + '𝠃').match(re$2.box);
|
2200 | const x = swuSignObject.max && swuSignObject.max[0] || '';
|
2201 | const y = swuSignObject.max && swuSignObject.max[1] || '';
|
2202 | const max = x && y ? coord2swu([x, y]) : undefined;
|
2203 | if (!max) return undefined;
|
2204 | let prefix = '';
|
2205 |
|
2206 | if (swuSignObject.sequence && Array.isArray(swuSignObject.sequence)) {
|
2207 | prefix = swuSignObject.sequence.map(key => (key.match(re$2.symbol) || [''])[0]).join('');
|
2208 | prefix = prefix ? '𝠀' + prefix : '';
|
2209 | }
|
2210 |
|
2211 | let signbox = '';
|
2212 |
|
2213 | if (swuSignObject.spatials && Array.isArray(swuSignObject.spatials)) {
|
2214 | signbox = swuSignObject.spatials.map(spatial => {
|
2215 | if (typeof spatial.symbol === 'string') {
|
2216 | const symbol = (spatial.symbol.match(re$2.symbol) || [''])[0];
|
2217 |
|
2218 | if (symbol) {
|
2219 | const x = spatial.coord && spatial.coord[0] || '';
|
2220 | const y = spatial.coord && spatial.coord[1] || '';
|
2221 | const coord = x && y ? coord2swu([x, y]) : '';
|
2222 |
|
2223 | if (coord) {
|
2224 | return symbol + coord;
|
2225 | }
|
2226 | }
|
2227 | }
|
2228 |
|
2229 | return '';
|
2230 | }).join('');
|
2231 | }
|
2232 |
|
2233 | const styleStr = typeof swuSignObject.style === 'string' && (swuSignObject.style.match(re$1.full) || [''])[0] || '';
|
2234 | return prefix + box + max + signbox + styleStr;
|
2235 | }
|
2236 | };
|
2237 |
|
2238 | |
2239 |
|
2240 |
|
2241 |
|
2242 |
|
2243 |
|
2244 | const kind$1 = [0x40001, 0x4efa1, 0x4f2a1];
|
2245 | |
2246 |
|
2247 |
|
2248 |
|
2249 |
|
2250 |
|
2251 | const category$1 = [0x40001, 0x461e1, 0x4bca1, 0x4bfa1, 0x4e8e1, 0x4efa1, 0x4f2a1];
|
2252 | |
2253 |
|
2254 |
|
2255 |
|
2256 |
|
2257 |
|
2258 | const group$1 = [0x40001, 0x40541, 0x40b41, 0x41981, 0x41c81, 0x43241, 0x43d81, 0x445c1, 0x44ce1, 0x45be1, 0x461e1, 0x46841, 0x46fc1, 0x47fe1, 0x485e1, 0x49301, 0x49e41, 0x4a4a1, 0x4afe1, 0x4b521, 0x4bca1, 0x4bfa1, 0x4c3c1, 0x4cfc1, 0x4d621, 0x4e161, 0x4e8e1, 0x4ec41, 0x4efa1, 0x4f2a1];
|
2259 | |
2260 |
|
2261 |
|
2262 |
|
2263 |
|
2264 |
|
2265 |
|
2266 |
|
2267 | const ranges$1 = {
|
2268 | 'all': [0x40001, 0x4f480],
|
2269 | 'writing': [0x40001, 0x4efa0],
|
2270 | 'hand': [0x40001, 0x461e0],
|
2271 | 'movement': [0x461e1, 0x4bca0],
|
2272 | 'dynamic': [0x4bca1, 0x4bfa0],
|
2273 | 'head': [0x4bfa1, 0x4e8e0],
|
2274 | 'hcenter': [0x4bfa1, 0x4e8e0],
|
2275 | 'vcenter': [0x4bfa1, 0x4ec40],
|
2276 | 'trunk': [0x4e8e1, 0x4ec40],
|
2277 | 'limb': [0x4ec41, 0x4efa0],
|
2278 | 'location': [0x4efa1, 0x4f2a0],
|
2279 | 'punctuation': [0x4f2a1, 0x4f480]
|
2280 | };
|
2281 | |
2282 |
|
2283 |
|
2284 |
|
2285 |
|
2286 |
|
2287 |
|
2288 |
|
2289 |
|
2290 |
|
2291 |
|
2292 |
|
2293 | const isType$1 = (swuSym, type) => {
|
2294 | const parsed = parse$3.symbol(swuSym);
|
2295 |
|
2296 | if (parsed.symbol) {
|
2297 | const code = swu2code(parsed.symbol);
|
2298 | const range = ranges$1[type];
|
2299 |
|
2300 | if (range) {
|
2301 | return range[0] <= code && range[1] >= code;
|
2302 | }
|
2303 | }
|
2304 |
|
2305 | return false;
|
2306 | };
|
2307 |
|
2308 | |
2309 |
|
2310 |
|
2311 |
|
2312 |
|
2313 |
|
2314 | const colors$1 = ['#0000CC', '#CC0000', '#FF0099', '#006600', '#000000', '#884411', '#FF9900'];
|
2315 | |
2316 |
|
2317 |
|
2318 |
|
2319 |
|
2320 |
|
2321 |
|
2322 |
|
2323 |
|
2324 |
|
2325 |
|
2326 | const colorize$1 = swuSym => {
|
2327 | const parsed = parse$3.symbol(swuSym);
|
2328 | let color = '#000000';
|
2329 |
|
2330 | if (parsed.symbol) {
|
2331 | const code = swu2code(parsed.symbol);
|
2332 | const index = category$1.findIndex(val => val > code);
|
2333 | color = colors$1[index < 0 ? 6 : index - 1];
|
2334 | }
|
2335 |
|
2336 | return color;
|
2337 | };
|
2338 |
|
2339 | |
2340 |
|
2341 |
|
2342 |
|
2343 |
|
2344 | var index$4 = Object.freeze({
|
2345 | __proto__: null,
|
2346 | re: re$2,
|
2347 | parse: parse$3,
|
2348 | encode: encode,
|
2349 | decode: decode,
|
2350 | pair: pair,
|
2351 | compose: compose$3,
|
2352 | kind: kind$1,
|
2353 | category: category$1,
|
2354 | group: group$1,
|
2355 | ranges: ranges$1,
|
2356 | isType: isType$1,
|
2357 | colors: colors$1,
|
2358 | colorize: colorize$1
|
2359 | });
|
2360 |
|
2361 | |
2362 |
|
2363 |
|
2364 |
|
2365 |
|
2366 |
|
2367 |
|
2368 | let re$4 = {
|
2369 | 'base': '(?:(?:\uD8C0[\uDC01-\uDFFF])|(?:[\uD8C1-\uD8FC][\uDC00-\uDFFF])|(?:\uD8FD[\uDC00-\uDC80]))',
|
2370 | 'coord': '(?:(?:\uD836[\uDC0C-\uDDFF]){2})?',
|
2371 | 'var': 'V[0-9]+'
|
2372 | };
|
2373 | re$4.symbol = `${re$4.base}f?r?`;
|
2374 | re$4.range = `R${re$4.base}${re$4.base}`;
|
2375 | re$4.prefix = `(?:A(?:${re$4.symbol}|${re$4.range})+)?T`;
|
2376 | re$4.signbox = `(?:${re$4.symbol}${re$4.coord}|${re$4.range}${re$4.coord})*`;
|
2377 | re$4.full = `Q(${re$4.prefix})?(${re$4.signbox})?(${re$4.var})?(-?)`;
|
2378 |
|
2379 | const parsePrefix$1 = text => {
|
2380 | return {
|
2381 | required: true,
|
2382 | parts: text == 'T' ? undefined : text.match(new RegExp(`(${re$4.symbol}|${re$4.range})`, 'g')).map(part => part[0] != 'R' ? part : [part.slice(1, 3), part.slice(3, 5)])
|
2383 | };
|
2384 | };
|
2385 |
|
2386 | const parseSignbox$1 = text => {
|
2387 | return text.match(new RegExp(`(${re$4.symbol}${re$4.coord}|${re$4.range}${re$4.coord})`, 'g')).map(part => {
|
2388 | let coord, front;
|
2389 |
|
2390 | if (part.length > 5) {
|
2391 | coord = swu2coord(part.slice(-4));
|
2392 | front = part.slice(0, -4);
|
2393 | } else {
|
2394 | front = part;
|
2395 | }
|
2396 |
|
2397 | if (!front.includes('R')) {
|
2398 | return {
|
2399 | symbol: front,
|
2400 | coord: coord
|
2401 | };
|
2402 | } else {
|
2403 | return {
|
2404 | range: [front.slice(1, 3), front.slice(3, 5)],
|
2405 | coord: coord
|
2406 | };
|
2407 | }
|
2408 | });
|
2409 | };
|
2410 | |
2411 |
|
2412 |
|
2413 |
|
2414 |
|
2415 |
|
2416 |
|
2417 |
|
2418 |
|
2419 |
|
2420 |
|
2421 |
|
2422 |
|
2423 |
|
2424 |
|
2425 |
|
2426 |
|
2427 |
|
2428 |
|
2429 |
|
2430 |
|
2431 |
|
2432 |
|
2433 |
|
2434 |
|
2435 |
|
2436 |
|
2437 |
|
2438 |
|
2439 |
|
2440 |
|
2441 | const parse$4 = swuQueryString => {
|
2442 | const query = typeof swuQueryString === 'string' ? swuQueryString.match(new RegExp(`^${re$4.full}`)) : undefined;
|
2443 | return {
|
2444 | 'query': query ? true : undefined,
|
2445 | 'prefix': query && query[1] ? parsePrefix$1(query[1]) : undefined,
|
2446 | 'signbox': query && query[2] ? parseSignbox$1(query[2]) : undefined,
|
2447 | 'variance': query && query[3] ? parseInt(query[3].slice(1)) : undefined,
|
2448 | 'style': query && query[4] ? true : undefined
|
2449 | };
|
2450 | };
|
2451 |
|
2452 | |
2453 |
|
2454 |
|
2455 |
|
2456 |
|
2457 |
|
2458 |
|
2459 |
|
2460 |
|
2461 |
|
2462 |
|
2463 |
|
2464 |
|
2465 |
|
2466 |
|
2467 |
|
2468 |
|
2469 |
|
2470 |
|
2471 |
|
2472 |
|
2473 |
|
2474 |
|
2475 |
|
2476 |
|
2477 |
|
2478 |
|
2479 |
|
2480 |
|
2481 |
|
2482 |
|
2483 |
|
2484 |
|
2485 |
|
2486 |
|
2487 |
|
2488 |
|
2489 | const compose$4 = swuQueryObject => {
|
2490 | if (!swuQueryObject || !swuQueryObject.query) {
|
2491 | return undefined;
|
2492 | }
|
2493 |
|
2494 | let query = 'Q';
|
2495 |
|
2496 | if (swuQueryObject.prefix && swuQueryObject.prefix.required) {
|
2497 | if (Array.isArray(swuQueryObject.prefix.parts)) {
|
2498 | query += 'A';
|
2499 | query += swuQueryObject.prefix.parts.map(part => {
|
2500 | if (typeof part === 'string') {
|
2501 | return part;
|
2502 | } else {
|
2503 | if (Array.isArray(part) && part.length == 2) {
|
2504 | return `R${part[0]}${part[1]}`;
|
2505 | }
|
2506 | }
|
2507 | }).join('');
|
2508 | }
|
2509 |
|
2510 | query += 'T';
|
2511 | }
|
2512 |
|
2513 | if (Array.isArray(swuQueryObject.signbox)) {
|
2514 | query += swuQueryObject.signbox.map(part => {
|
2515 | let out;
|
2516 |
|
2517 | if (part.symbol) {
|
2518 | out = part.symbol;
|
2519 | } else {
|
2520 | if (part.range && Array.isArray(part.range) && part.range.length == 2) {
|
2521 | out = `R${part.range[0]}${part.range[1]}`;
|
2522 | }
|
2523 | }
|
2524 |
|
2525 | return out + (Array.isArray(part.coord) && part.coord.length == 2 ? coord2swu(part.coord) : '');
|
2526 | }).join('');
|
2527 | }
|
2528 |
|
2529 | query += swuQueryObject.style ? '-' : '';
|
2530 | query = query.match(new RegExp(`^${re$4.full}`))[0];
|
2531 | return query;
|
2532 | };
|
2533 |
|
2534 | |
2535 |
|
2536 |
|
2537 |
|
2538 |
|
2539 |
|
2540 |
|
2541 |
|
2542 |
|
2543 |
|
2544 |
|
2545 |
|
2546 |
|
2547 |
|
2548 |
|
2549 |
|
2550 |
|
2551 |
|
2552 |
|
2553 | const swu2query = (swuSign, flags) => {
|
2554 | let query = '';
|
2555 | const parsed = parse$3.sign(swuSign);
|
2556 |
|
2557 | if (parsed.box) {
|
2558 | const A_flag = flags.indexOf('A') > -1;
|
2559 | const a_flag = flags.indexOf('a') > -1;
|
2560 | const S_flag = flags.indexOf('S') > -1;
|
2561 | const s_flag = flags.indexOf('s') > -1;
|
2562 | const L_flag = flags.indexOf('L') > -1;
|
2563 |
|
2564 | if (A_flag || a_flag || S_flag || s_flag) {
|
2565 | if ((A_flag || a_flag) && parsed.sequence) {
|
2566 | query += 'A';
|
2567 | query += parsed.sequence.map(sym => sym + (a_flag ? 'fr' : '')).join('');
|
2568 | query += 'T';
|
2569 | }
|
2570 |
|
2571 | if ((S_flag || s_flag) && parsed.spatials) {
|
2572 | query += parsed.spatials.map(spatial => spatial.symbol + (s_flag ? 'fr' : '') + (L_flag ? coord2swu(spatial.coord) : '')).join('');
|
2573 | }
|
2574 | }
|
2575 |
|
2576 | return query ? "Q" + query : undefined;
|
2577 | } else {
|
2578 | return undefined;
|
2579 | }
|
2580 | };
|
2581 |
|
2582 | |
2583 |
|
2584 |
|
2585 |
|
2586 |
|
2587 |
|
2588 |
|
2589 |
|
2590 |
|
2591 |
|
2592 |
|
2593 |
|
2594 |
|
2595 |
|
2596 |
|
2597 |
|
2598 | const range$1 = (min, max) => {
|
2599 | if (min > max) return '';
|
2600 | let pattern = '';
|
2601 | let cnt;
|
2602 | let re = [];
|
2603 | min = pair(min);
|
2604 | max = pair(max);
|
2605 | if (min.length != 2 && max.length != 2) return '';
|
2606 |
|
2607 | if (min[0] == max[0]) {
|
2608 | if (min[1] == max[1]) {
|
2609 | pattern = '\\u' + min[0] + '\\u' + min[1];
|
2610 | re.push(pattern);
|
2611 | } else {
|
2612 | pattern = '\\u' + min[0] + '[\\u' + min[1] + '-\\u' + max[1] + ']';
|
2613 | re.push(pattern);
|
2614 | }
|
2615 | } else {
|
2616 | if (min[1] == "DFFF") {
|
2617 | pattern = '\\u' + min[0] + '\\uDFFF';
|
2618 | } else {
|
2619 | pattern = '\\u' + min[0] + '[\\u' + min[1] + '-\\uDFFF]';
|
2620 | }
|
2621 |
|
2622 | re.push(pattern);
|
2623 |
|
2624 | let diff = parseInt(max[0], 16) - parseInt(min[0], 16);
|
2625 |
|
2626 | if (diff == 2) {
|
2627 | pattern = '\\u' + (parseInt(min[0], 16) + 1).toString(16).toUpperCase();
|
2628 | pattern += '[\\uDC00-\\uDFFF]';
|
2629 | re.push(pattern);
|
2630 | }
|
2631 |
|
2632 | if (diff > 2) {
|
2633 | pattern = '[';
|
2634 | pattern += '\\u' + (parseInt(min[0], 16) + 1).toString(16).toUpperCase();
|
2635 | pattern += '-\\u' + (parseInt(max[0], 16) - 1).toString(16).toUpperCase();
|
2636 | pattern += '][\\uDC00-\\uDFFF]';
|
2637 | re.push(pattern);
|
2638 | }
|
2639 |
|
2640 |
|
2641 | if (max[1] == "DC00") {
|
2642 | pattern = '\\u' + max[0] + '\\uDC00';
|
2643 | } else {
|
2644 | pattern = '\\u' + max[0] + '[\\uDC00-\\u' + max[1] + ']';
|
2645 | }
|
2646 |
|
2647 | re.push(pattern);
|
2648 | }
|
2649 |
|
2650 | cnt = re.length;
|
2651 |
|
2652 | if (cnt == 1) {
|
2653 | pattern = re[0];
|
2654 | } else {
|
2655 | pattern = re.join(')|(');
|
2656 | pattern = '((' + pattern + '))';
|
2657 | }
|
2658 |
|
2659 | return decode(pattern);
|
2660 | };
|
2661 |
|
2662 | |
2663 |
|
2664 |
|
2665 |
|
2666 |
|
2667 |
|
2668 |
|
2669 |
|
2670 |
|
2671 |
|
2672 |
|
2673 |
|
2674 |
|
2675 |
|
2676 |
|
2677 |
|
2678 |
|
2679 |
|
2680 |
|
2681 |
|
2682 |
|
2683 |
|
2684 |
|
2685 | const symbolRanges = symbolFR => {
|
2686 | let match = symbolFR.match(new RegExp(re$4.symbol));
|
2687 |
|
2688 | if (match) {
|
2689 | let sym = match[0].slice(0, 2);
|
2690 | let key = swu2key(sym);
|
2691 | let base = key.slice(0, 4);
|
2692 | let start, end;
|
2693 |
|
2694 | if (match[0].slice(-2) == 'fr') {
|
2695 | start = key2swu(base + "00");
|
2696 | end = key2swu(base + "5f");
|
2697 | return range$1(start, end);
|
2698 | } else if (match[0].slice(-1) == 'r') {
|
2699 | start = key2swu(key.slice(0, 5) + '0');
|
2700 | end = key2swu(key.slice(0, 5) + 'f');
|
2701 | return range$1(start, end);
|
2702 | } else if (match[0].slice(-1) == 'f') {
|
2703 | let list = [0, 1, 2, 3, 4, 5].map(function (f) {
|
2704 | return key2swu(base + f + key.slice(-1));
|
2705 | });
|
2706 | return "(" + list.join("|") + ")";
|
2707 | } else {
|
2708 | return sym;
|
2709 | }
|
2710 | } else {
|
2711 | return '';
|
2712 | }
|
2713 | };
|
2714 |
|
2715 | |
2716 |
|
2717 |
|
2718 |
|
2719 |
|
2720 |
|
2721 |
|
2722 |
|
2723 |
|
2724 |
|
2725 |
|
2726 |
|
2727 |
|
2728 | const regex$1 = query => {
|
2729 | query = query.match(new RegExp(`^${re$4.full}`))[0];
|
2730 |
|
2731 | if (!query) {
|
2732 | return '';
|
2733 | }
|
2734 |
|
2735 | let matches;
|
2736 | let i;
|
2737 | let part;
|
2738 | let from;
|
2739 | let to;
|
2740 | let coord;
|
2741 | let segment;
|
2742 | let x;
|
2743 | let y;
|
2744 | let fuzz = 20;
|
2745 | let re_sym = re$2.symbol;
|
2746 | let re_coord = re$2.coord;
|
2747 | let re_signbox = re$2.box;
|
2748 | let re_seq = re$2.sort;
|
2749 | let re_word = re_signbox + re_coord + '(' + re_sym + re_coord + ')*';
|
2750 | let re_sortable = '(' + re_seq + '(' + re_sym + ')+)';
|
2751 | let q_range = 'R' + re_sym + re_sym;
|
2752 | let q_sym = re_sym + 'f?r?';
|
2753 | let q_coord = '(' + re_coord + ')?';
|
2754 | let q_var = '(V[0-9]+)';
|
2755 | let q_style = '(' + re$1.full + ')?';
|
2756 | let q_sortable;
|
2757 |
|
2758 | if (query == 'Q') {
|
2759 | return [re$2.sign];
|
2760 | }
|
2761 |
|
2762 | if (query == 'Q-') {
|
2763 | return [re$2.sign + "(" + re$1.full + ")?"];
|
2764 | }
|
2765 |
|
2766 | if (query == 'QT') {
|
2767 | return [re$2.sortable];
|
2768 | }
|
2769 |
|
2770 | if (query == 'QT-') {
|
2771 | return [re$2.sortable + "(" + re$1.full + ")?"];
|
2772 | }
|
2773 |
|
2774 | let segments = [];
|
2775 | let sym;
|
2776 | let sortable = query.indexOf('T') + 1;
|
2777 |
|
2778 | if (sortable) {
|
2779 | q_sortable = '(' + re$2.sort;
|
2780 | let qat = query.slice(0, sortable);
|
2781 | query = query.replace(qat, '');
|
2782 |
|
2783 | if (qat == 'QT') {
|
2784 | q_sortable += '(' + re_sym + ')+)';
|
2785 | } else {
|
2786 | matches = qat.match(new RegExp('(' + q_sym + '|' + q_range + ')', 'g'));
|
2787 |
|
2788 | if (matches) {
|
2789 | let matched;
|
2790 |
|
2791 | for (i = 0; i < matches.length; i += 1) {
|
2792 | matched = matches[i].match(new RegExp('^' + q_sym));
|
2793 |
|
2794 | if (matched) {
|
2795 | q_sortable += symbolRanges(matched[0]);
|
2796 | } else {
|
2797 | from = swu2key(matches[i].slice(1, 3));
|
2798 | to = swu2key(matches[i].slice(-2));
|
2799 | from = key2swu(from.slice(0, 4) + '00');
|
2800 | to = key2swu(to.slice(0, 4) + '5f');
|
2801 | q_sortable += range$1(from, to);
|
2802 | }
|
2803 | }
|
2804 |
|
2805 | q_sortable += '(' + re_sym + ')*)';
|
2806 | }
|
2807 | }
|
2808 | }
|
2809 |
|
2810 |
|
2811 | matches = query.match(new RegExp(q_var, 'g'));
|
2812 |
|
2813 | if (matches) {
|
2814 | fuzz = matches.toString().slice(1) * 1;
|
2815 | }
|
2816 | matches = query.match(new RegExp("(" + q_range + q_coord + "|" + q_sym + q_coord + ")", 'g'));
|
2817 |
|
2818 | if (matches) {
|
2819 | for (i = 0; i < matches.length; i += 1) {
|
2820 | part = matches[i].toString();
|
2821 |
|
2822 | if (part[0] != "R") {
|
2823 | sym = part.match(new RegExp(q_sym))[0];
|
2824 | segment = symbolRanges(sym);
|
2825 |
|
2826 | if (sym.length > part.length) {
|
2827 | coord = swu2coord(part.slice(-4));
|
2828 | x = coord[0];
|
2829 | y = coord[1];
|
2830 |
|
2831 | segment += range$1(coord2swu([x - fuzz, x + fuzz]));
|
2832 | segment += range$1(coord2swu([y - fuzz, y + fuzz]));
|
2833 | } else {
|
2834 | segment += re_coord;
|
2835 | }
|
2836 |
|
2837 |
|
2838 |
|
2839 | segment = re_word + segment + '(' + re_sym + re_coord + ')*';
|
2840 |
|
2841 | if (sortable) {
|
2842 | segment = q_sortable + segment;
|
2843 | } else {
|
2844 | segment = re_sortable + "?" + segment;
|
2845 | }
|
2846 |
|
2847 | if (query.indexOf('-') > 0) {
|
2848 | segment += q_style;
|
2849 | }
|
2850 |
|
2851 | segments.push(segment);
|
2852 | } else {
|
2853 |
|
2854 | part = matches[i].toString();
|
2855 | from = swu2key(part.slice(1, 3));
|
2856 | to = swu2key(part.slice(3, 5));
|
2857 | from = key2swu(from.slice(0, 4) + '00');
|
2858 | to = key2swu(to.slice(0, 4) + '5f');
|
2859 | segment = range$1(from, to);
|
2860 |
|
2861 | if (part.length > 5) {
|
2862 | coord = swu2coord(part.slice(5, 9));
|
2863 | x = coord[0];
|
2864 | y = coord[1];
|
2865 |
|
2866 | segment += range$1(coord2swu([x - fuzz, x + fuzz]));
|
2867 | segment += range$1(coord2swu([y - fuzz, y + fuzz]));
|
2868 | } else {
|
2869 | segment += re_coord;
|
2870 | }
|
2871 |
|
2872 |
|
2873 | segment = re_word + segment + '(' + re_sym + re_coord + ')*';
|
2874 |
|
2875 | if (sortable) {
|
2876 | segment = q_sortable + segment;
|
2877 | } else {
|
2878 | segment = re_sortable + "?" + segment;
|
2879 | }
|
2880 |
|
2881 | if (query.indexOf('-') > 0) {
|
2882 | segment += q_style;
|
2883 | }
|
2884 |
|
2885 | segments.push(segment);
|
2886 | }
|
2887 | }
|
2888 | }
|
2889 |
|
2890 | if (!segments.length) {
|
2891 | if (query.indexOf('-') > 0) {
|
2892 | segment += q_style;
|
2893 | }
|
2894 |
|
2895 | segments.push(q_sortable + re_word);
|
2896 | }
|
2897 |
|
2898 | return segments;
|
2899 | };
|
2900 |
|
2901 | |
2902 |
|
2903 |
|
2904 |
|
2905 |
|
2906 |
|
2907 |
|
2908 |
|
2909 |
|
2910 |
|
2911 |
|
2912 |
|
2913 |
|
2914 |
|
2915 | const results$1 = (query, text) => {
|
2916 | if (!text) {
|
2917 | return [];
|
2918 | }
|
2919 |
|
2920 | let pattern;
|
2921 | let matches;
|
2922 | let parts;
|
2923 | let words;
|
2924 | let res = regex$1(query);
|
2925 |
|
2926 | if (!res) {
|
2927 | return [];
|
2928 | }
|
2929 |
|
2930 | let i;
|
2931 |
|
2932 | for (i = 0; i < res.length; i += 1) {
|
2933 | pattern = res[i];
|
2934 | matches = text.match(new RegExp(pattern, 'g'));
|
2935 |
|
2936 | if (matches) {
|
2937 | text = matches.join(' ');
|
2938 | } else {
|
2939 | text = '';
|
2940 | }
|
2941 | }
|
2942 |
|
2943 | if (text) {
|
2944 | parts = text.split(' ');
|
2945 | words = parts.filter(function (element) {
|
2946 | return element in parts ? false : parts[element] = true;
|
2947 | }, {});
|
2948 | } else {
|
2949 | words = [];
|
2950 | }
|
2951 |
|
2952 | return words;
|
2953 | };
|
2954 |
|
2955 | |
2956 |
|
2957 |
|
2958 |
|
2959 |
|
2960 |
|
2961 |
|
2962 |
|
2963 |
|
2964 |
|
2965 |
|
2966 |
|
2967 |
|
2968 |
|
2969 |
|
2970 |
|
2971 |
|
2972 | const lines$1 = (query, text) => {
|
2973 | if (!text) {
|
2974 | return [];
|
2975 | }
|
2976 |
|
2977 | let pattern;
|
2978 | let matches;
|
2979 | let parts;
|
2980 | let words;
|
2981 | let res = regex$1(query);
|
2982 |
|
2983 | if (!res) {
|
2984 | return [];
|
2985 | }
|
2986 |
|
2987 | let i;
|
2988 |
|
2989 | for (i = 0; i < res.length; i += 1) {
|
2990 | pattern = res[i];
|
2991 | pattern = '^' + pattern + '.*';
|
2992 | matches = text.match(new RegExp(pattern, 'mg'));
|
2993 |
|
2994 | if (matches) {
|
2995 | text = matches.join("\n");
|
2996 | } else {
|
2997 | text = '';
|
2998 | }
|
2999 | }
|
3000 |
|
3001 | if (text) {
|
3002 | parts = text.split("\n");
|
3003 | words = parts.filter(function (element) {
|
3004 | return element in parts ? false : parts[element] = true;
|
3005 | }, {});
|
3006 | } else {
|
3007 | words = [];
|
3008 | }
|
3009 |
|
3010 | return words;
|
3011 | };
|
3012 |
|
3013 | |
3014 |
|
3015 |
|
3016 |
|
3017 |
|
3018 | var index$5 = Object.freeze({
|
3019 | __proto__: null,
|
3020 | re: re$4,
|
3021 | parse: parse$4,
|
3022 | compose: compose$4,
|
3023 | swu2query: swu2query,
|
3024 | range: range$1,
|
3025 | symbolRanges: symbolRanges,
|
3026 | regex: regex$1,
|
3027 | results: results$1,
|
3028 | lines: lines$1
|
3029 | });
|
3030 |
|
3031 | exports.convert = index$1;
|
3032 | exports.fsw = index$2;
|
3033 | exports.fswquery = index$3;
|
3034 | exports.style = index;
|
3035 | exports.swu = index$4;
|
3036 | exports.swuquery = index$5;
|
3037 |
|
3038 | Object.defineProperty(exports, '__esModule', { value: true });
|
3039 |
|
3040 | }));
|
3041 |
|
3042 |
|