1 | (function (global, factory) {
|
2 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
|
3 | typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
4 | (global = global || self, factory(global.jQuery));
|
5 | }(this, function ($) { 'use strict';
|
6 |
|
7 | $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
8 |
|
9 | function _typeof(obj) {
|
10 | if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
11 | _typeof = function (obj) {
|
12 | return typeof obj;
|
13 | };
|
14 | } else {
|
15 | _typeof = function (obj) {
|
16 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
17 | };
|
18 | }
|
19 |
|
20 | return _typeof(obj);
|
21 | }
|
22 |
|
23 | function _classCallCheck(instance, Constructor) {
|
24 | if (!(instance instanceof Constructor)) {
|
25 | throw new TypeError("Cannot call a class as a function");
|
26 | }
|
27 | }
|
28 |
|
29 | function _defineProperties(target, props) {
|
30 | for (var i = 0; i < props.length; i++) {
|
31 | var descriptor = props[i];
|
32 | descriptor.enumerable = descriptor.enumerable || false;
|
33 | descriptor.configurable = true;
|
34 | if ("value" in descriptor) descriptor.writable = true;
|
35 | Object.defineProperty(target, descriptor.key, descriptor);
|
36 | }
|
37 | }
|
38 |
|
39 | function _createClass(Constructor, protoProps, staticProps) {
|
40 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
41 | if (staticProps) _defineProperties(Constructor, staticProps);
|
42 | return Constructor;
|
43 | }
|
44 |
|
45 | function _taggedTemplateLiteral(strings, raw) {
|
46 | if (!raw) {
|
47 | raw = strings.slice(0);
|
48 | }
|
49 |
|
50 | return Object.freeze(Object.defineProperties(strings, {
|
51 | raw: {
|
52 | value: Object.freeze(raw)
|
53 | }
|
54 | }));
|
55 | }
|
56 |
|
57 | var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
58 |
|
59 | function createCommonjsModule(fn, module) {
|
60 | return module = { exports: {} }, fn(module, module.exports), module.exports;
|
61 | }
|
62 |
|
63 | var O = 'object';
|
64 | var check = function (it) {
|
65 | return it && it.Math == Math && it;
|
66 | };
|
67 |
|
68 |
|
69 | var global_1 =
|
70 |
|
71 | check(typeof globalThis == O && globalThis) ||
|
72 | check(typeof window == O && window) ||
|
73 | check(typeof self == O && self) ||
|
74 | check(typeof commonjsGlobal == O && commonjsGlobal) ||
|
75 |
|
76 | Function('return this')();
|
77 |
|
78 | var fails = function (exec) {
|
79 | try {
|
80 | return !!exec();
|
81 | } catch (error) {
|
82 | return true;
|
83 | }
|
84 | };
|
85 |
|
86 |
|
87 | var descriptors = !fails(function () {
|
88 | return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
|
89 | });
|
90 |
|
91 | var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
|
92 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
93 |
|
94 |
|
95 | var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
|
96 |
|
97 |
|
98 |
|
99 | var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
100 | var descriptor = getOwnPropertyDescriptor(this, V);
|
101 | return !!descriptor && descriptor.enumerable;
|
102 | } : nativePropertyIsEnumerable;
|
103 |
|
104 | var objectPropertyIsEnumerable = {
|
105 | f: f
|
106 | };
|
107 |
|
108 | var createPropertyDescriptor = function (bitmap, value) {
|
109 | return {
|
110 | enumerable: !(bitmap & 1),
|
111 | configurable: !(bitmap & 2),
|
112 | writable: !(bitmap & 4),
|
113 | value: value
|
114 | };
|
115 | };
|
116 |
|
117 | var toString = {}.toString;
|
118 |
|
119 | var classofRaw = function (it) {
|
120 | return toString.call(it).slice(8, -1);
|
121 | };
|
122 |
|
123 | var split = ''.split;
|
124 |
|
125 |
|
126 | var indexedObject = fails(function () {
|
127 |
|
128 |
|
129 | return !Object('z').propertyIsEnumerable(0);
|
130 | }) ? function (it) {
|
131 | return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
|
132 | } : Object;
|
133 |
|
134 |
|
135 |
|
136 | var requireObjectCoercible = function (it) {
|
137 | if (it == undefined) throw TypeError("Can't call method on " + it);
|
138 | return it;
|
139 | };
|
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 | var toIndexedObject = function (it) {
|
146 | return indexedObject(requireObjectCoercible(it));
|
147 | };
|
148 |
|
149 | var isObject = function (it) {
|
150 | return typeof it === 'object' ? it !== null : typeof it === 'function';
|
151 | };
|
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 | var toPrimitive = function (input, PREFERRED_STRING) {
|
158 | if (!isObject(input)) return input;
|
159 | var fn, val;
|
160 | if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
161 | if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
|
162 | if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
163 | throw TypeError("Can't convert object to primitive value");
|
164 | };
|
165 |
|
166 | var hasOwnProperty = {}.hasOwnProperty;
|
167 |
|
168 | var has = function (it, key) {
|
169 | return hasOwnProperty.call(it, key);
|
170 | };
|
171 |
|
172 | var document$1 = global_1.document;
|
173 |
|
174 | var EXISTS = isObject(document$1) && isObject(document$1.createElement);
|
175 |
|
176 | var documentCreateElement = function (it) {
|
177 | return EXISTS ? document$1.createElement(it) : {};
|
178 | };
|
179 |
|
180 |
|
181 | var ie8DomDefine = !descriptors && !fails(function () {
|
182 | return Object.defineProperty(documentCreateElement('div'), 'a', {
|
183 | get: function () { return 7; }
|
184 | }).a != 7;
|
185 | });
|
186 |
|
187 | var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
188 |
|
189 |
|
190 |
|
191 | var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
192 | O = toIndexedObject(O);
|
193 | P = toPrimitive(P, true);
|
194 | if (ie8DomDefine) try {
|
195 | return nativeGetOwnPropertyDescriptor(O, P);
|
196 | } catch (error) { }
|
197 | if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
|
198 | };
|
199 |
|
200 | var objectGetOwnPropertyDescriptor = {
|
201 | f: f$1
|
202 | };
|
203 |
|
204 | var anObject = function (it) {
|
205 | if (!isObject(it)) {
|
206 | throw TypeError(String(it) + ' is not an object');
|
207 | } return it;
|
208 | };
|
209 |
|
210 | var nativeDefineProperty = Object.defineProperty;
|
211 |
|
212 |
|
213 |
|
214 | var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
|
215 | anObject(O);
|
216 | P = toPrimitive(P, true);
|
217 | anObject(Attributes);
|
218 | if (ie8DomDefine) try {
|
219 | return nativeDefineProperty(O, P, Attributes);
|
220 | } catch (error) { }
|
221 | if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
222 | if ('value' in Attributes) O[P] = Attributes.value;
|
223 | return O;
|
224 | };
|
225 |
|
226 | var objectDefineProperty = {
|
227 | f: f$2
|
228 | };
|
229 |
|
230 | var hide = descriptors ? function (object, key, value) {
|
231 | return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
|
232 | } : function (object, key, value) {
|
233 | object[key] = value;
|
234 | return object;
|
235 | };
|
236 |
|
237 | var setGlobal = function (key, value) {
|
238 | try {
|
239 | hide(global_1, key, value);
|
240 | } catch (error) {
|
241 | global_1[key] = value;
|
242 | } return value;
|
243 | };
|
244 |
|
245 | var shared = createCommonjsModule(function (module) {
|
246 | var SHARED = '__core-js_shared__';
|
247 | var store = global_1[SHARED] || setGlobal(SHARED, {});
|
248 |
|
249 | (module.exports = function (key, value) {
|
250 | return store[key] || (store[key] = value !== undefined ? value : {});
|
251 | })('versions', []).push({
|
252 | version: '3.2.1',
|
253 | mode: 'global',
|
254 | copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
255 | });
|
256 | });
|
257 |
|
258 | var functionToString = shared('native-function-to-string', Function.toString);
|
259 |
|
260 | var WeakMap = global_1.WeakMap;
|
261 |
|
262 | var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap));
|
263 |
|
264 | var id = 0;
|
265 | var postfix = Math.random();
|
266 |
|
267 | var uid = function (key) {
|
268 | return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
|
269 | };
|
270 |
|
271 | var keys = shared('keys');
|
272 |
|
273 | var sharedKey = function (key) {
|
274 | return keys[key] || (keys[key] = uid(key));
|
275 | };
|
276 |
|
277 | var hiddenKeys = {};
|
278 |
|
279 | var WeakMap$1 = global_1.WeakMap;
|
280 | var set, get, has$1;
|
281 |
|
282 | var enforce = function (it) {
|
283 | return has$1(it) ? get(it) : set(it, {});
|
284 | };
|
285 |
|
286 | var getterFor = function (TYPE) {
|
287 | return function (it) {
|
288 | var state;
|
289 | if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
290 | throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
291 | } return state;
|
292 | };
|
293 | };
|
294 |
|
295 | if (nativeWeakMap) {
|
296 | var store = new WeakMap$1();
|
297 | var wmget = store.get;
|
298 | var wmhas = store.has;
|
299 | var wmset = store.set;
|
300 | set = function (it, metadata) {
|
301 | wmset.call(store, it, metadata);
|
302 | return metadata;
|
303 | };
|
304 | get = function (it) {
|
305 | return wmget.call(store, it) || {};
|
306 | };
|
307 | has$1 = function (it) {
|
308 | return wmhas.call(store, it);
|
309 | };
|
310 | } else {
|
311 | var STATE = sharedKey('state');
|
312 | hiddenKeys[STATE] = true;
|
313 | set = function (it, metadata) {
|
314 | hide(it, STATE, metadata);
|
315 | return metadata;
|
316 | };
|
317 | get = function (it) {
|
318 | return has(it, STATE) ? it[STATE] : {};
|
319 | };
|
320 | has$1 = function (it) {
|
321 | return has(it, STATE);
|
322 | };
|
323 | }
|
324 |
|
325 | var internalState = {
|
326 | set: set,
|
327 | get: get,
|
328 | has: has$1,
|
329 | enforce: enforce,
|
330 | getterFor: getterFor
|
331 | };
|
332 |
|
333 | var redefine = createCommonjsModule(function (module) {
|
334 | var getInternalState = internalState.get;
|
335 | var enforceInternalState = internalState.enforce;
|
336 | var TEMPLATE = String(functionToString).split('toString');
|
337 |
|
338 | shared('inspectSource', function (it) {
|
339 | return functionToString.call(it);
|
340 | });
|
341 |
|
342 | (module.exports = function (O, key, value, options) {
|
343 | var unsafe = options ? !!options.unsafe : false;
|
344 | var simple = options ? !!options.enumerable : false;
|
345 | var noTargetGet = options ? !!options.noTargetGet : false;
|
346 | if (typeof value == 'function') {
|
347 | if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key);
|
348 | enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
|
349 | }
|
350 | if (O === global_1) {
|
351 | if (simple) O[key] = value;
|
352 | else setGlobal(key, value);
|
353 | return;
|
354 | } else if (!unsafe) {
|
355 | delete O[key];
|
356 | } else if (!noTargetGet && O[key]) {
|
357 | simple = true;
|
358 | }
|
359 | if (simple) O[key] = value;
|
360 | else hide(O, key, value);
|
361 |
|
362 | })(Function.prototype, 'toString', function toString() {
|
363 | return typeof this == 'function' && getInternalState(this).source || functionToString.call(this);
|
364 | });
|
365 | });
|
366 |
|
367 | var path = global_1;
|
368 |
|
369 | var aFunction = function (variable) {
|
370 | return typeof variable == 'function' ? variable : undefined;
|
371 | };
|
372 |
|
373 | var getBuiltIn = function (namespace, method) {
|
374 | return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
|
375 | : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
|
376 | };
|
377 |
|
378 | var ceil = Math.ceil;
|
379 | var floor = Math.floor;
|
380 |
|
381 |
|
382 |
|
383 | var toInteger = function (argument) {
|
384 | return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
|
385 | };
|
386 |
|
387 | var min = Math.min;
|
388 |
|
389 |
|
390 |
|
391 | var toLength = function (argument) {
|
392 | return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0;
|
393 | };
|
394 |
|
395 | var max = Math.max;
|
396 | var min$1 = Math.min;
|
397 |
|
398 |
|
399 |
|
400 |
|
401 | var toAbsoluteIndex = function (index, length) {
|
402 | var integer = toInteger(index);
|
403 | return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
404 | };
|
405 |
|
406 |
|
407 | var createMethod = function (IS_INCLUDES) {
|
408 | return function ($this, el, fromIndex) {
|
409 | var O = toIndexedObject($this);
|
410 | var length = toLength(O.length);
|
411 | var index = toAbsoluteIndex(fromIndex, length);
|
412 | var value;
|
413 |
|
414 |
|
415 | if (IS_INCLUDES && el != el) while (length > index) {
|
416 | value = O[index++];
|
417 |
|
418 | if (value != value) return true;
|
419 |
|
420 | } else for (;length > index; index++) {
|
421 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
422 | } return !IS_INCLUDES && -1;
|
423 | };
|
424 | };
|
425 |
|
426 | var arrayIncludes = {
|
427 |
|
428 |
|
429 | includes: createMethod(true),
|
430 |
|
431 |
|
432 | indexOf: createMethod(false)
|
433 | };
|
434 |
|
435 | var indexOf = arrayIncludes.indexOf;
|
436 |
|
437 |
|
438 | var objectKeysInternal = function (object, names) {
|
439 | var O = toIndexedObject(object);
|
440 | var i = 0;
|
441 | var result = [];
|
442 | var key;
|
443 | for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
|
444 |
|
445 | while (names.length > i) if (has(O, key = names[i++])) {
|
446 | ~indexOf(result, key) || result.push(key);
|
447 | }
|
448 | return result;
|
449 | };
|
450 |
|
451 |
|
452 | var enumBugKeys = [
|
453 | 'constructor',
|
454 | 'hasOwnProperty',
|
455 | 'isPrototypeOf',
|
456 | 'propertyIsEnumerable',
|
457 | 'toLocaleString',
|
458 | 'toString',
|
459 | 'valueOf'
|
460 | ];
|
461 |
|
462 | var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
463 |
|
464 |
|
465 |
|
466 | var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
467 | return objectKeysInternal(O, hiddenKeys$1);
|
468 | };
|
469 |
|
470 | var objectGetOwnPropertyNames = {
|
471 | f: f$3
|
472 | };
|
473 |
|
474 | var f$4 = Object.getOwnPropertySymbols;
|
475 |
|
476 | var objectGetOwnPropertySymbols = {
|
477 | f: f$4
|
478 | };
|
479 |
|
480 |
|
481 | var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
482 | var keys = objectGetOwnPropertyNames.f(anObject(it));
|
483 | var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
484 | return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
|
485 | };
|
486 |
|
487 | var copyConstructorProperties = function (target, source) {
|
488 | var keys = ownKeys(source);
|
489 | var defineProperty = objectDefineProperty.f;
|
490 | var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
491 | for (var i = 0; i < keys.length; i++) {
|
492 | var key = keys[i];
|
493 | if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
494 | }
|
495 | };
|
496 |
|
497 | var replacement = /#|\.prototype\./;
|
498 |
|
499 | var isForced = function (feature, detection) {
|
500 | var value = data[normalize(feature)];
|
501 | return value == POLYFILL ? true
|
502 | : value == NATIVE ? false
|
503 | : typeof detection == 'function' ? fails(detection)
|
504 | : !!detection;
|
505 | };
|
506 |
|
507 | var normalize = isForced.normalize = function (string) {
|
508 | return String(string).replace(replacement, '.').toLowerCase();
|
509 | };
|
510 |
|
511 | var data = isForced.data = {};
|
512 | var NATIVE = isForced.NATIVE = 'N';
|
513 | var POLYFILL = isForced.POLYFILL = 'P';
|
514 |
|
515 | var isForced_1 = isForced;
|
516 |
|
517 | var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 | |
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 |
|
533 |
|
534 |
|
535 |
|
536 |
|
537 |
|
538 | var _export = function (options, source) {
|
539 | var TARGET = options.target;
|
540 | var GLOBAL = options.global;
|
541 | var STATIC = options.stat;
|
542 | var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
543 | if (GLOBAL) {
|
544 | target = global_1;
|
545 | } else if (STATIC) {
|
546 | target = global_1[TARGET] || setGlobal(TARGET, {});
|
547 | } else {
|
548 | target = (global_1[TARGET] || {}).prototype;
|
549 | }
|
550 | if (target) for (key in source) {
|
551 | sourceProperty = source[key];
|
552 | if (options.noTargetGet) {
|
553 | descriptor = getOwnPropertyDescriptor$1(target, key);
|
554 | targetProperty = descriptor && descriptor.value;
|
555 | } else targetProperty = target[key];
|
556 | FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
557 |
|
558 | if (!FORCED && targetProperty !== undefined) {
|
559 | if (typeof sourceProperty === typeof targetProperty) continue;
|
560 | copyConstructorProperties(sourceProperty, targetProperty);
|
561 | }
|
562 |
|
563 | if (options.sham || (targetProperty && targetProperty.sham)) {
|
564 | hide(sourceProperty, 'sham', true);
|
565 | }
|
566 |
|
567 | redefine(target, key, sourceProperty, options);
|
568 | }
|
569 | };
|
570 |
|
571 | var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
572 |
|
573 |
|
574 | return !String(Symbol());
|
575 | });
|
576 |
|
577 | var Symbol$1 = global_1.Symbol;
|
578 | var store$1 = shared('wks');
|
579 |
|
580 | var wellKnownSymbol = function (name) {
|
581 | return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name]
|
582 | || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
|
583 | };
|
584 |
|
585 |
|
586 |
|
587 | var objectKeys = Object.keys || function keys(O) {
|
588 | return objectKeysInternal(O, enumBugKeys);
|
589 | };
|
590 |
|
591 |
|
592 |
|
593 | var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
|
594 | anObject(O);
|
595 | var keys = objectKeys(Properties);
|
596 | var length = keys.length;
|
597 | var index = 0;
|
598 | var key;
|
599 | while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
|
600 | return O;
|
601 | };
|
602 |
|
603 | var html = getBuiltIn('document', 'documentElement');
|
604 |
|
605 | var IE_PROTO = sharedKey('IE_PROTO');
|
606 |
|
607 | var PROTOTYPE = 'prototype';
|
608 | var Empty = function () { };
|
609 |
|
610 |
|
611 | var createDict = function () {
|
612 |
|
613 | var iframe = documentCreateElement('iframe');
|
614 | var length = enumBugKeys.length;
|
615 | var lt = '<';
|
616 | var script = 'script';
|
617 | var gt = '>';
|
618 | var js = 'java' + script + ':';
|
619 | var iframeDocument;
|
620 | iframe.style.display = 'none';
|
621 | html.appendChild(iframe);
|
622 | iframe.src = String(js);
|
623 | iframeDocument = iframe.contentWindow.document;
|
624 | iframeDocument.open();
|
625 | iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
|
626 | iframeDocument.close();
|
627 | createDict = iframeDocument.F;
|
628 | while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
|
629 | return createDict();
|
630 | };
|
631 |
|
632 |
|
633 |
|
634 | var objectCreate = Object.create || function create(O, Properties) {
|
635 | var result;
|
636 | if (O !== null) {
|
637 | Empty[PROTOTYPE] = anObject(O);
|
638 | result = new Empty();
|
639 | Empty[PROTOTYPE] = null;
|
640 |
|
641 | result[IE_PROTO] = O;
|
642 | } else result = createDict();
|
643 | return Properties === undefined ? result : objectDefineProperties(result, Properties);
|
644 | };
|
645 |
|
646 | hiddenKeys[IE_PROTO] = true;
|
647 |
|
648 | var UNSCOPABLES = wellKnownSymbol('unscopables');
|
649 | var ArrayPrototype = Array.prototype;
|
650 |
|
651 |
|
652 |
|
653 | if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
654 | hide(ArrayPrototype, UNSCOPABLES, objectCreate(null));
|
655 | }
|
656 |
|
657 |
|
658 | var addToUnscopables = function (key) {
|
659 | ArrayPrototype[UNSCOPABLES][key] = true;
|
660 | };
|
661 |
|
662 | var $includes = arrayIncludes.includes;
|
663 |
|
664 |
|
665 |
|
666 |
|
667 | _export({ target: 'Array', proto: true }, {
|
668 | includes: function includes(el /* , fromIndex = 0 */) {
|
669 | return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
670 | }
|
671 | });
|
672 |
|
673 |
|
674 | addToUnscopables('includes');
|
675 |
|
676 |
|
677 |
|
678 | var toObject = function (argument) {
|
679 | return Object(requireObjectCoercible(argument));
|
680 | };
|
681 |
|
682 | var nativeAssign = Object.assign;
|
683 |
|
684 |
|
685 |
|
686 |
|
687 | var objectAssign = !nativeAssign || fails(function () {
|
688 | var A = {};
|
689 | var B = {};
|
690 |
|
691 | var symbol = Symbol();
|
692 | var alphabet = 'abcdefghijklmnopqrst';
|
693 | A[symbol] = 7;
|
694 | alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
695 | return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
|
696 | }) ? function assign(target, source) {
|
697 | var T = toObject(target);
|
698 | var argumentsLength = arguments.length;
|
699 | var index = 1;
|
700 | var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
701 | var propertyIsEnumerable = objectPropertyIsEnumerable.f;
|
702 | while (argumentsLength > index) {
|
703 | var S = indexedObject(arguments[index++]);
|
704 | var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
|
705 | var length = keys.length;
|
706 | var j = 0;
|
707 | var key;
|
708 | while (length > j) {
|
709 | key = keys[j++];
|
710 | if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
|
711 | }
|
712 | } return T;
|
713 | } : nativeAssign;
|
714 |
|
715 |
|
716 |
|
717 | _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
|
718 | assign: objectAssign
|
719 | });
|
720 |
|
721 | var MATCH = wellKnownSymbol('match');
|
722 |
|
723 |
|
724 |
|
725 | var isRegexp = function (it) {
|
726 | var isRegExp;
|
727 | return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
|
728 | };
|
729 |
|
730 | var notARegexp = function (it) {
|
731 | if (isRegexp(it)) {
|
732 | throw TypeError("The method doesn't accept regular expressions");
|
733 | } return it;
|
734 | };
|
735 |
|
736 | var MATCH$1 = wellKnownSymbol('match');
|
737 |
|
738 | var correctIsRegexpLogic = function (METHOD_NAME) {
|
739 | var regexp = /./;
|
740 | try {
|
741 | '/./'[METHOD_NAME](regexp);
|
742 | } catch (e) {
|
743 | try {
|
744 | regexp[MATCH$1] = false;
|
745 | return '/./'[METHOD_NAME](regexp);
|
746 | } catch (f) { }
|
747 | } return false;
|
748 | };
|
749 |
|
750 |
|
751 |
|
752 | _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
|
753 | includes: function includes(searchString /* , position = 0 */) {
|
754 | return !!~String(requireObjectCoercible(this))
|
755 | .indexOf(notARegexp(searchString), arguments.length > 1 ? arguments[1] : undefined);
|
756 | }
|
757 | });
|
758 |
|
759 | var VERSION = '1.4.1';
|
760 | var DEFAULTS = {
|
761 | name: '',
|
762 | placeholder: '',
|
763 | data: undefined,
|
764 | locale: undefined,
|
765 | selectAll: true,
|
766 | single: false,
|
767 | singleRadio: false,
|
768 | multiple: false,
|
769 | hideOptgroupCheckboxes: false,
|
770 | multipleWidth: 80,
|
771 | width: undefined,
|
772 | dropWidth: undefined,
|
773 | maxHeight: 250,
|
774 | position: 'bottom',
|
775 | displayHtml: false,
|
776 | displayValues: false,
|
777 | displayTitle: false,
|
778 | displayDelimiter: ', ',
|
779 | minimumCountSelected: 3,
|
780 | ellipsis: false,
|
781 | isOpen: false,
|
782 | keepOpen: false,
|
783 | openOnHover: false,
|
784 | container: null,
|
785 | filter: false,
|
786 | filterGroup: false,
|
787 | filterPlaceholder: '',
|
788 | filterAcceptOnEnter: false,
|
789 | filterByDataLength: undefined,
|
790 | customFilter: function customFilter(label, text) {
|
791 |
|
792 | return label.includes(text);
|
793 | },
|
794 | animate: undefined,
|
795 | styler: function styler() {
|
796 | return false;
|
797 | },
|
798 | textTemplate: function textTemplate($elm) {
|
799 | return $elm[0].innerHTML;
|
800 | },
|
801 | labelTemplate: function labelTemplate($elm) {
|
802 | return $elm[0].getAttribute('label');
|
803 | },
|
804 | onOpen: function onOpen() {
|
805 | return false;
|
806 | },
|
807 | onClose: function onClose() {
|
808 | return false;
|
809 | },
|
810 | onCheckAll: function onCheckAll() {
|
811 | return false;
|
812 | },
|
813 | onUncheckAll: function onUncheckAll() {
|
814 | return false;
|
815 | },
|
816 | onFocus: function onFocus() {
|
817 | return false;
|
818 | },
|
819 | onBlur: function onBlur() {
|
820 | return false;
|
821 | },
|
822 | onOptgroupClick: function onOptgroupClick() {
|
823 | return false;
|
824 | },
|
825 | onClick: function onClick() {
|
826 | return false;
|
827 | },
|
828 | onFilter: function onFilter() {
|
829 | return false;
|
830 | },
|
831 | onAfterCreate: function onAfterCreate() {
|
832 | return false;
|
833 | }
|
834 | };
|
835 | var EN = {
|
836 | formatSelectAll: function formatSelectAll() {
|
837 | return '[Select all]';
|
838 | },
|
839 | formatAllSelected: function formatAllSelected() {
|
840 | return 'All selected';
|
841 | },
|
842 | formatCountSelected: function formatCountSelected(count, total) {
|
843 | return count + ' of ' + total + ' selected';
|
844 | },
|
845 | formatNoMatchesFound: function formatNoMatchesFound() {
|
846 | return 'No matches found';
|
847 | }
|
848 | };
|
849 | var METHODS = ['getOptions', 'refreshOptions', 'getSelects', 'setSelects', 'enable', 'disable', 'open', 'close', 'check', 'uncheck', 'checkAll', 'uncheckAll', 'checkInvert', 'focus', 'blur', 'refresh', 'destroy'];
|
850 | Object.assign(DEFAULTS, EN);
|
851 | var Constants = {
|
852 | VERSION: VERSION,
|
853 | DEFAULTS: DEFAULTS,
|
854 | METHODS: METHODS,
|
855 | LOCALES: {
|
856 | en: EN,
|
857 | 'en-US': EN
|
858 | }
|
859 | };
|
860 |
|
861 |
|
862 |
|
863 | var isArray = Array.isArray || function isArray(arg) {
|
864 | return classofRaw(arg) == 'Array';
|
865 | };
|
866 |
|
867 | var nativeGetOwnPropertyNames = objectGetOwnPropertyNames.f;
|
868 |
|
869 | var toString$1 = {}.toString;
|
870 |
|
871 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
872 | ? Object.getOwnPropertyNames(window) : [];
|
873 |
|
874 | var getWindowNames = function (it) {
|
875 | try {
|
876 | return nativeGetOwnPropertyNames(it);
|
877 | } catch (error) {
|
878 | return windowNames.slice();
|
879 | }
|
880 | };
|
881 |
|
882 |
|
883 | var f$5 = function getOwnPropertyNames(it) {
|
884 | return windowNames && toString$1.call(it) == '[object Window]'
|
885 | ? getWindowNames(it)
|
886 | : nativeGetOwnPropertyNames(toIndexedObject(it));
|
887 | };
|
888 |
|
889 | var objectGetOwnPropertyNamesExternal = {
|
890 | f: f$5
|
891 | };
|
892 |
|
893 | var f$6 = wellKnownSymbol;
|
894 |
|
895 | var wrappedWellKnownSymbol = {
|
896 | f: f$6
|
897 | };
|
898 |
|
899 | var defineProperty = objectDefineProperty.f;
|
900 |
|
901 | var defineWellKnownSymbol = function (NAME) {
|
902 | var Symbol = path.Symbol || (path.Symbol = {});
|
903 | if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {
|
904 | value: wrappedWellKnownSymbol.f(NAME)
|
905 | });
|
906 | };
|
907 |
|
908 | var defineProperty$1 = objectDefineProperty.f;
|
909 |
|
910 |
|
911 |
|
912 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
913 |
|
914 | var setToStringTag = function (it, TAG, STATIC) {
|
915 | if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
|
916 | defineProperty$1(it, TO_STRING_TAG, { configurable: true, value: TAG });
|
917 | }
|
918 | };
|
919 |
|
920 | var aFunction$1 = function (it) {
|
921 | if (typeof it != 'function') {
|
922 | throw TypeError(String(it) + ' is not a function');
|
923 | } return it;
|
924 | };
|
925 |
|
926 |
|
927 | var bindContext = function (fn, that, length) {
|
928 | aFunction$1(fn);
|
929 | if (that === undefined) return fn;
|
930 | switch (length) {
|
931 | case 0: return function () {
|
932 | return fn.call(that);
|
933 | };
|
934 | case 1: return function (a) {
|
935 | return fn.call(that, a);
|
936 | };
|
937 | case 2: return function (a, b) {
|
938 | return fn.call(that, a, b);
|
939 | };
|
940 | case 3: return function (a, b, c) {
|
941 | return fn.call(that, a, b, c);
|
942 | };
|
943 | }
|
944 | return function (/* ...args */) {
|
945 | return fn.apply(that, arguments);
|
946 | };
|
947 | };
|
948 |
|
949 | var SPECIES = wellKnownSymbol('species');
|
950 |
|
951 |
|
952 |
|
953 | var arraySpeciesCreate = function (originalArray, length) {
|
954 | var C;
|
955 | if (isArray(originalArray)) {
|
956 | C = originalArray.constructor;
|
957 |
|
958 | if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
|
959 | else if (isObject(C)) {
|
960 | C = C[SPECIES];
|
961 | if (C === null) C = undefined;
|
962 | }
|
963 | } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
|
964 | };
|
965 |
|
966 | var push = [].push;
|
967 |
|
968 |
|
969 | var createMethod$1 = function (TYPE) {
|
970 | var IS_MAP = TYPE == 1;
|
971 | var IS_FILTER = TYPE == 2;
|
972 | var IS_SOME = TYPE == 3;
|
973 | var IS_EVERY = TYPE == 4;
|
974 | var IS_FIND_INDEX = TYPE == 6;
|
975 | var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
976 | return function ($this, callbackfn, that, specificCreate) {
|
977 | var O = toObject($this);
|
978 | var self = indexedObject(O);
|
979 | var boundFunction = bindContext(callbackfn, that, 3);
|
980 | var length = toLength(self.length);
|
981 | var index = 0;
|
982 | var create = specificCreate || arraySpeciesCreate;
|
983 | var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
|
984 | var value, result;
|
985 | for (;length > index; index++) if (NO_HOLES || index in self) {
|
986 | value = self[index];
|
987 | result = boundFunction(value, index, O);
|
988 | if (TYPE) {
|
989 | if (IS_MAP) target[index] = result;
|
990 | else if (result) switch (TYPE) {
|
991 | case 3: return true;
|
992 | case 5: return value;
|
993 | case 6: return index;
|
994 | case 2: push.call(target, value);
|
995 | } else if (IS_EVERY) return false;
|
996 | }
|
997 | }
|
998 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
999 | };
|
1000 | };
|
1001 |
|
1002 | var arrayIteration = {
|
1003 |
|
1004 |
|
1005 | forEach: createMethod$1(0),
|
1006 |
|
1007 |
|
1008 | map: createMethod$1(1),
|
1009 |
|
1010 |
|
1011 | filter: createMethod$1(2),
|
1012 |
|
1013 |
|
1014 | some: createMethod$1(3),
|
1015 |
|
1016 |
|
1017 | every: createMethod$1(4),
|
1018 |
|
1019 |
|
1020 | find: createMethod$1(5),
|
1021 |
|
1022 |
|
1023 | findIndex: createMethod$1(6)
|
1024 | };
|
1025 |
|
1026 | var $forEach = arrayIteration.forEach;
|
1027 |
|
1028 | var HIDDEN = sharedKey('hidden');
|
1029 | var SYMBOL = 'Symbol';
|
1030 | var PROTOTYPE$1 = 'prototype';
|
1031 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
1032 | var setInternalState = internalState.set;
|
1033 | var getInternalState = internalState.getterFor(SYMBOL);
|
1034 | var ObjectPrototype = Object[PROTOTYPE$1];
|
1035 | var $Symbol = global_1.Symbol;
|
1036 | var JSON = global_1.JSON;
|
1037 | var nativeJSONStringify = JSON && JSON.stringify;
|
1038 | var nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
1039 | var nativeDefineProperty$1 = objectDefineProperty.f;
|
1040 | var nativeGetOwnPropertyNames$1 = objectGetOwnPropertyNamesExternal.f;
|
1041 | var nativePropertyIsEnumerable$1 = objectPropertyIsEnumerable.f;
|
1042 | var AllSymbols = shared('symbols');
|
1043 | var ObjectPrototypeSymbols = shared('op-symbols');
|
1044 | var StringToSymbolRegistry = shared('string-to-symbol-registry');
|
1045 | var SymbolToStringRegistry = shared('symbol-to-string-registry');
|
1046 | var WellKnownSymbolsStore = shared('wks');
|
1047 | var QObject = global_1.QObject;
|
1048 |
|
1049 | var USE_SETTER = !QObject || !QObject[PROTOTYPE$1] || !QObject[PROTOTYPE$1].findChild;
|
1050 |
|
1051 |
|
1052 | var setSymbolDescriptor = descriptors && fails(function () {
|
1053 | return objectCreate(nativeDefineProperty$1({}, 'a', {
|
1054 | get: function () { return nativeDefineProperty$1(this, 'a', { value: 7 }).a; }
|
1055 | })).a != 7;
|
1056 | }) ? function (O, P, Attributes) {
|
1057 | var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype, P);
|
1058 | if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
|
1059 | nativeDefineProperty$1(O, P, Attributes);
|
1060 | if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
|
1061 | nativeDefineProperty$1(ObjectPrototype, P, ObjectPrototypeDescriptor);
|
1062 | }
|
1063 | } : nativeDefineProperty$1;
|
1064 |
|
1065 | var wrap = function (tag, description) {
|
1066 | var symbol = AllSymbols[tag] = objectCreate($Symbol[PROTOTYPE$1]);
|
1067 | setInternalState(symbol, {
|
1068 | type: SYMBOL,
|
1069 | tag: tag,
|
1070 | description: description
|
1071 | });
|
1072 | if (!descriptors) symbol.description = description;
|
1073 | return symbol;
|
1074 | };
|
1075 |
|
1076 | var isSymbol = nativeSymbol && typeof $Symbol.iterator == 'symbol' ? function (it) {
|
1077 | return typeof it == 'symbol';
|
1078 | } : function (it) {
|
1079 | return Object(it) instanceof $Symbol;
|
1080 | };
|
1081 |
|
1082 | var $defineProperty = function defineProperty(O, P, Attributes) {
|
1083 | if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
|
1084 | anObject(O);
|
1085 | var key = toPrimitive(P, true);
|
1086 | anObject(Attributes);
|
1087 | if (has(AllSymbols, key)) {
|
1088 | if (!Attributes.enumerable) {
|
1089 | if (!has(O, HIDDEN)) nativeDefineProperty$1(O, HIDDEN, createPropertyDescriptor(1, {}));
|
1090 | O[HIDDEN][key] = true;
|
1091 | } else {
|
1092 | if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
|
1093 | Attributes = objectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
|
1094 | } return setSymbolDescriptor(O, key, Attributes);
|
1095 | } return nativeDefineProperty$1(O, key, Attributes);
|
1096 | };
|
1097 |
|
1098 | var $defineProperties = function defineProperties(O, Properties) {
|
1099 | anObject(O);
|
1100 | var properties = toIndexedObject(Properties);
|
1101 | var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
|
1102 | $forEach(keys, function (key) {
|
1103 | if (!descriptors || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
|
1104 | });
|
1105 | return O;
|
1106 | };
|
1107 |
|
1108 | var $create = function create(O, Properties) {
|
1109 | return Properties === undefined ? objectCreate(O) : $defineProperties(objectCreate(O), Properties);
|
1110 | };
|
1111 |
|
1112 | var $propertyIsEnumerable = function propertyIsEnumerable(V) {
|
1113 | var P = toPrimitive(V, true);
|
1114 | var enumerable = nativePropertyIsEnumerable$1.call(this, P);
|
1115 | if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
|
1116 | return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
|
1117 | };
|
1118 |
|
1119 | var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
|
1120 | var it = toIndexedObject(O);
|
1121 | var key = toPrimitive(P, true);
|
1122 | if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
|
1123 | var descriptor = nativeGetOwnPropertyDescriptor$1(it, key);
|
1124 | if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
|
1125 | descriptor.enumerable = true;
|
1126 | }
|
1127 | return descriptor;
|
1128 | };
|
1129 |
|
1130 | var $getOwnPropertyNames = function getOwnPropertyNames(O) {
|
1131 | var names = nativeGetOwnPropertyNames$1(toIndexedObject(O));
|
1132 | var result = [];
|
1133 | $forEach(names, function (key) {
|
1134 | if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
|
1135 | });
|
1136 | return result;
|
1137 | };
|
1138 |
|
1139 | var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
|
1140 | var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
|
1141 | var names = nativeGetOwnPropertyNames$1(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
|
1142 | var result = [];
|
1143 | $forEach(names, function (key) {
|
1144 | if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
|
1145 | result.push(AllSymbols[key]);
|
1146 | }
|
1147 | });
|
1148 | return result;
|
1149 | };
|
1150 |
|
1151 |
|
1152 |
|
1153 | if (!nativeSymbol) {
|
1154 | $Symbol = function Symbol() {
|
1155 | if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
|
1156 | var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
|
1157 | var tag = uid(description);
|
1158 | var setter = function (value) {
|
1159 | if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
|
1160 | if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
|
1161 | setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
|
1162 | };
|
1163 | if (descriptors && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
|
1164 | return wrap(tag, description);
|
1165 | };
|
1166 |
|
1167 | redefine($Symbol[PROTOTYPE$1], 'toString', function toString() {
|
1168 | return getInternalState(this).tag;
|
1169 | });
|
1170 |
|
1171 | objectPropertyIsEnumerable.f = $propertyIsEnumerable;
|
1172 | objectDefineProperty.f = $defineProperty;
|
1173 | objectGetOwnPropertyDescriptor.f = $getOwnPropertyDescriptor;
|
1174 | objectGetOwnPropertyNames.f = objectGetOwnPropertyNamesExternal.f = $getOwnPropertyNames;
|
1175 | objectGetOwnPropertySymbols.f = $getOwnPropertySymbols;
|
1176 |
|
1177 | if (descriptors) {
|
1178 |
|
1179 | nativeDefineProperty$1($Symbol[PROTOTYPE$1], 'description', {
|
1180 | configurable: true,
|
1181 | get: function description() {
|
1182 | return getInternalState(this).description;
|
1183 | }
|
1184 | });
|
1185 | {
|
1186 | redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
|
1187 | }
|
1188 | }
|
1189 |
|
1190 | wrappedWellKnownSymbol.f = function (name) {
|
1191 | return wrap(wellKnownSymbol(name), name);
|
1192 | };
|
1193 | }
|
1194 |
|
1195 | _export({ global: true, wrap: true, forced: !nativeSymbol, sham: !nativeSymbol }, {
|
1196 | Symbol: $Symbol
|
1197 | });
|
1198 |
|
1199 | $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
|
1200 | defineWellKnownSymbol(name);
|
1201 | });
|
1202 |
|
1203 | _export({ target: SYMBOL, stat: true, forced: !nativeSymbol }, {
|
1204 |
|
1205 |
|
1206 | 'for': function (key) {
|
1207 | var string = String(key);
|
1208 | if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
|
1209 | var symbol = $Symbol(string);
|
1210 | StringToSymbolRegistry[string] = symbol;
|
1211 | SymbolToStringRegistry[symbol] = string;
|
1212 | return symbol;
|
1213 | },
|
1214 |
|
1215 |
|
1216 | keyFor: function keyFor(sym) {
|
1217 | if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
|
1218 | if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
|
1219 | },
|
1220 | useSetter: function () { USE_SETTER = true; },
|
1221 | useSimple: function () { USE_SETTER = false; }
|
1222 | });
|
1223 |
|
1224 | _export({ target: 'Object', stat: true, forced: !nativeSymbol, sham: !descriptors }, {
|
1225 |
|
1226 |
|
1227 | create: $create,
|
1228 |
|
1229 |
|
1230 | defineProperty: $defineProperty,
|
1231 |
|
1232 |
|
1233 | defineProperties: $defineProperties,
|
1234 |
|
1235 |
|
1236 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor
|
1237 | });
|
1238 |
|
1239 | _export({ target: 'Object', stat: true, forced: !nativeSymbol }, {
|
1240 |
|
1241 |
|
1242 | getOwnPropertyNames: $getOwnPropertyNames,
|
1243 |
|
1244 |
|
1245 | getOwnPropertySymbols: $getOwnPropertySymbols
|
1246 | });
|
1247 |
|
1248 |
|
1249 |
|
1250 | _export({ target: 'Object', stat: true, forced: fails(function () { objectGetOwnPropertySymbols.f(1); }) }, {
|
1251 | getOwnPropertySymbols: function getOwnPropertySymbols(it) {
|
1252 | return objectGetOwnPropertySymbols.f(toObject(it));
|
1253 | }
|
1254 | });
|
1255 |
|
1256 |
|
1257 |
|
1258 | JSON && _export({ target: 'JSON', stat: true, forced: !nativeSymbol || fails(function () {
|
1259 | var symbol = $Symbol();
|
1260 |
|
1261 | return nativeJSONStringify([symbol]) != '[null]'
|
1262 |
|
1263 | || nativeJSONStringify({ a: symbol }) != '{}'
|
1264 |
|
1265 | || nativeJSONStringify(Object(symbol)) != '{}';
|
1266 | }) }, {
|
1267 | stringify: function stringify(it) {
|
1268 | var args = [it];
|
1269 | var index = 1;
|
1270 | var replacer, $replacer;
|
1271 | while (arguments.length > index) args.push(arguments[index++]);
|
1272 | $replacer = replacer = args[1];
|
1273 | if (!isObject(replacer) && it === undefined || isSymbol(it)) return;
|
1274 | if (!isArray(replacer)) replacer = function (key, value) {
|
1275 | if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
|
1276 | if (!isSymbol(value)) return value;
|
1277 | };
|
1278 | args[1] = replacer;
|
1279 | return nativeJSONStringify.apply(JSON, args);
|
1280 | }
|
1281 | });
|
1282 |
|
1283 |
|
1284 |
|
1285 | if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE]) hide($Symbol[PROTOTYPE$1], TO_PRIMITIVE, $Symbol[PROTOTYPE$1].valueOf);
|
1286 |
|
1287 |
|
1288 | setToStringTag($Symbol, SYMBOL);
|
1289 |
|
1290 | hiddenKeys[HIDDEN] = true;
|
1291 |
|
1292 | var defineProperty$2 = objectDefineProperty.f;
|
1293 |
|
1294 |
|
1295 | var NativeSymbol = global_1.Symbol;
|
1296 |
|
1297 | if (descriptors && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) ||
|
1298 |
|
1299 | NativeSymbol().description !== undefined
|
1300 | )) {
|
1301 | var EmptyStringDescriptionStore = {};
|
1302 |
|
1303 | var SymbolWrapper = function Symbol() {
|
1304 | var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
|
1305 | var result = this instanceof SymbolWrapper
|
1306 | ? new NativeSymbol(description)
|
1307 |
|
1308 | : description === undefined ? NativeSymbol() : NativeSymbol(description);
|
1309 | if (description === '') EmptyStringDescriptionStore[result] = true;
|
1310 | return result;
|
1311 | };
|
1312 | copyConstructorProperties(SymbolWrapper, NativeSymbol);
|
1313 | var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
|
1314 | symbolPrototype.constructor = SymbolWrapper;
|
1315 |
|
1316 | var symbolToString = symbolPrototype.toString;
|
1317 | var native = String(NativeSymbol('test')) == 'Symbol(test)';
|
1318 | var regexp = /^Symbol\((.*)\)[^)]+$/;
|
1319 | defineProperty$2(symbolPrototype, 'description', {
|
1320 | configurable: true,
|
1321 | get: function description() {
|
1322 | var symbol = isObject(this) ? this.valueOf() : this;
|
1323 | var string = symbolToString.call(symbol);
|
1324 | if (has(EmptyStringDescriptionStore, symbol)) return '';
|
1325 | var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1');
|
1326 | return desc === '' ? undefined : desc;
|
1327 | }
|
1328 | });
|
1329 |
|
1330 | _export({ global: true, forced: true }, {
|
1331 | Symbol: SymbolWrapper
|
1332 | });
|
1333 | }
|
1334 |
|
1335 |
|
1336 |
|
1337 | defineWellKnownSymbol('iterator');
|
1338 |
|
1339 | var createProperty = function (object, key, value) {
|
1340 | var propertyKey = toPrimitive(key);
|
1341 | if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
|
1342 | else object[propertyKey] = value;
|
1343 | };
|
1344 |
|
1345 | var SPECIES$1 = wellKnownSymbol('species');
|
1346 |
|
1347 | var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
|
1348 | return !fails(function () {
|
1349 | var array = [];
|
1350 | var constructor = array.constructor = {};
|
1351 | constructor[SPECIES$1] = function () {
|
1352 | return { foo: 1 };
|
1353 | };
|
1354 | return array[METHOD_NAME](Boolean).foo !== 1;
|
1355 | });
|
1356 | };
|
1357 |
|
1358 | var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
1359 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
1360 | var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
1361 |
|
1362 | var IS_CONCAT_SPREADABLE_SUPPORT = !fails(function () {
|
1363 | var array = [];
|
1364 | array[IS_CONCAT_SPREADABLE] = false;
|
1365 | return array.concat()[0] !== array;
|
1366 | });
|
1367 |
|
1368 | var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
|
1369 |
|
1370 | var isConcatSpreadable = function (O) {
|
1371 | if (!isObject(O)) return false;
|
1372 | var spreadable = O[IS_CONCAT_SPREADABLE];
|
1373 | return spreadable !== undefined ? !!spreadable : isArray(O);
|
1374 | };
|
1375 |
|
1376 | var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
1377 |
|
1378 |
|
1379 |
|
1380 |
|
1381 | _export({ target: 'Array', proto: true, forced: FORCED }, {
|
1382 | concat: function concat(arg) {
|
1383 | var O = toObject(this);
|
1384 | var A = arraySpeciesCreate(O, 0);
|
1385 | var n = 0;
|
1386 | var i, k, length, len, E;
|
1387 | for (i = -1, length = arguments.length; i < length; i++) {
|
1388 | E = i === -1 ? O : arguments[i];
|
1389 | if (isConcatSpreadable(E)) {
|
1390 | len = toLength(E.length);
|
1391 | if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
1392 | for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
1393 | } else {
|
1394 | if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
1395 | createProperty(A, n++, E);
|
1396 | }
|
1397 | }
|
1398 | A.length = n;
|
1399 | return A;
|
1400 | }
|
1401 | });
|
1402 |
|
1403 | var $filter = arrayIteration.filter;
|
1404 |
|
1405 |
|
1406 |
|
1407 |
|
1408 |
|
1409 | _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, {
|
1410 | filter: function filter(callbackfn /* , thisArg */) {
|
1411 | return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
1412 | }
|
1413 | });
|
1414 |
|
1415 | var $find = arrayIteration.find;
|
1416 |
|
1417 |
|
1418 | var FIND = 'find';
|
1419 | var SKIPS_HOLES = true;
|
1420 |
|
1421 |
|
1422 | if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
|
1423 |
|
1424 |
|
1425 |
|
1426 | _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
1427 | find: function find(callbackfn /* , that = undefined */) {
|
1428 | return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
1429 | }
|
1430 | });
|
1431 |
|
1432 |
|
1433 | addToUnscopables(FIND);
|
1434 |
|
1435 | var correctPrototypeGetter = !fails(function () {
|
1436 | function F() { }
|
1437 | F.prototype.constructor = null;
|
1438 | return Object.getPrototypeOf(new F()) !== F.prototype;
|
1439 | });
|
1440 |
|
1441 | var IE_PROTO$1 = sharedKey('IE_PROTO');
|
1442 | var ObjectPrototype$1 = Object.prototype;
|
1443 |
|
1444 |
|
1445 |
|
1446 | var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
|
1447 | O = toObject(O);
|
1448 | if (has(O, IE_PROTO$1)) return O[IE_PROTO$1];
|
1449 | if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
1450 | return O.constructor.prototype;
|
1451 | } return O instanceof Object ? ObjectPrototype$1 : null;
|
1452 | };
|
1453 |
|
1454 | var ITERATOR = wellKnownSymbol('iterator');
|
1455 | var BUGGY_SAFARI_ITERATORS = false;
|
1456 |
|
1457 | var returnThis = function () { return this; };
|
1458 |
|
1459 |
|
1460 |
|
1461 | var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
1462 |
|
1463 | if ([].keys) {
|
1464 | arrayIterator = [].keys();
|
1465 |
|
1466 | if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
|
1467 | else {
|
1468 | PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
|
1469 | if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
|
1470 | }
|
1471 | }
|
1472 |
|
1473 | if (IteratorPrototype == undefined) IteratorPrototype = {};
|
1474 |
|
1475 |
|
1476 | if ( !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);
|
1477 |
|
1478 | var iteratorsCore = {
|
1479 | IteratorPrototype: IteratorPrototype,
|
1480 | BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
|
1481 | };
|
1482 |
|
1483 | var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
1484 |
|
1485 | var createIteratorConstructor = function (IteratorConstructor, NAME, next) {
|
1486 | var TO_STRING_TAG = NAME + ' Iterator';
|
1487 | IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(1, next) });
|
1488 | setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
|
1489 | return IteratorConstructor;
|
1490 | };
|
1491 |
|
1492 | var aPossiblePrototype = function (it) {
|
1493 | if (!isObject(it) && it !== null) {
|
1494 | throw TypeError("Can't set " + String(it) + ' as a prototype');
|
1495 | } return it;
|
1496 | };
|
1497 |
|
1498 |
|
1499 |
|
1500 |
|
1501 |
|
1502 | var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
1503 | var CORRECT_SETTER = false;
|
1504 | var test = {};
|
1505 | var setter;
|
1506 | try {
|
1507 | setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
|
1508 | setter.call(test, []);
|
1509 | CORRECT_SETTER = test instanceof Array;
|
1510 | } catch (error) { }
|
1511 | return function setPrototypeOf(O, proto) {
|
1512 | anObject(O);
|
1513 | aPossiblePrototype(proto);
|
1514 | if (CORRECT_SETTER) setter.call(O, proto);
|
1515 | else O.__proto__ = proto;
|
1516 | return O;
|
1517 | };
|
1518 | }() : undefined);
|
1519 |
|
1520 | var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
|
1521 | var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS;
|
1522 | var ITERATOR$1 = wellKnownSymbol('iterator');
|
1523 | var KEYS = 'keys';
|
1524 | var VALUES = 'values';
|
1525 | var ENTRIES = 'entries';
|
1526 |
|
1527 | var returnThis$1 = function () { return this; };
|
1528 |
|
1529 | var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
1530 | createIteratorConstructor(IteratorConstructor, NAME, next);
|
1531 |
|
1532 | var getIterationMethod = function (KIND) {
|
1533 | if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
1534 | if (!BUGGY_SAFARI_ITERATORS$1 && KIND in IterablePrototype) return IterablePrototype[KIND];
|
1535 | switch (KIND) {
|
1536 | case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
1537 | case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
1538 | case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
1539 | } return function () { return new IteratorConstructor(this); };
|
1540 | };
|
1541 |
|
1542 | var TO_STRING_TAG = NAME + ' Iterator';
|
1543 | var INCORRECT_VALUES_NAME = false;
|
1544 | var IterablePrototype = Iterable.prototype;
|
1545 | var nativeIterator = IterablePrototype[ITERATOR$1]
|
1546 | || IterablePrototype['@@iterator']
|
1547 | || DEFAULT && IterablePrototype[DEFAULT];
|
1548 | var defaultIterator = !BUGGY_SAFARI_ITERATORS$1 && nativeIterator || getIterationMethod(DEFAULT);
|
1549 | var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
1550 | var CurrentIteratorPrototype, methods, KEY;
|
1551 |
|
1552 |
|
1553 | if (anyNativeIterator) {
|
1554 | CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
|
1555 | if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) {
|
1556 | if ( objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype$2) {
|
1557 | if (objectSetPrototypeOf) {
|
1558 | objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
|
1559 | } else if (typeof CurrentIteratorPrototype[ITERATOR$1] != 'function') {
|
1560 | hide(CurrentIteratorPrototype, ITERATOR$1, returnThis$1);
|
1561 | }
|
1562 | }
|
1563 |
|
1564 | setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
|
1565 | }
|
1566 | }
|
1567 |
|
1568 |
|
1569 | if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
1570 | INCORRECT_VALUES_NAME = true;
|
1571 | defaultIterator = function values() { return nativeIterator.call(this); };
|
1572 | }
|
1573 |
|
1574 |
|
1575 | if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
|
1576 | hide(IterablePrototype, ITERATOR$1, defaultIterator);
|
1577 | }
|
1578 |
|
1579 |
|
1580 | if (DEFAULT) {
|
1581 | methods = {
|
1582 | values: getIterationMethod(VALUES),
|
1583 | keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
1584 | entries: getIterationMethod(ENTRIES)
|
1585 | };
|
1586 | if (FORCED) for (KEY in methods) {
|
1587 | if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
1588 | redefine(IterablePrototype, KEY, methods[KEY]);
|
1589 | }
|
1590 | } else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME }, methods);
|
1591 | }
|
1592 |
|
1593 | return methods;
|
1594 | };
|
1595 |
|
1596 | var ARRAY_ITERATOR = 'Array Iterator';
|
1597 | var setInternalState$1 = internalState.set;
|
1598 | var getInternalState$1 = internalState.getterFor(ARRAY_ITERATOR);
|
1599 |
|
1600 |
|
1601 |
|
1602 |
|
1603 |
|
1604 |
|
1605 |
|
1606 |
|
1607 |
|
1608 |
|
1609 |
|
1610 | var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
|
1611 | setInternalState$1(this, {
|
1612 | type: ARRAY_ITERATOR,
|
1613 | target: toIndexedObject(iterated),
|
1614 | index: 0,
|
1615 | kind: kind
|
1616 | });
|
1617 |
|
1618 |
|
1619 | }, function () {
|
1620 | var state = getInternalState$1(this);
|
1621 | var target = state.target;
|
1622 | var kind = state.kind;
|
1623 | var index = state.index++;
|
1624 | if (!target || index >= target.length) {
|
1625 | state.target = undefined;
|
1626 | return { value: undefined, done: true };
|
1627 | }
|
1628 | if (kind == 'keys') return { value: index, done: false };
|
1629 | if (kind == 'values') return { value: target[index], done: false };
|
1630 | return { value: [index, target[index]], done: false };
|
1631 | }, 'values');
|
1632 |
|
1633 |
|
1634 | addToUnscopables('keys');
|
1635 | addToUnscopables('values');
|
1636 | addToUnscopables('entries');
|
1637 |
|
1638 | var sloppyArrayMethod = function (METHOD_NAME, argument) {
|
1639 | var method = [][METHOD_NAME];
|
1640 | return !method || !fails(function () {
|
1641 |
|
1642 | method.call(null, argument || function () { throw 1; }, 1);
|
1643 | });
|
1644 | };
|
1645 |
|
1646 | var nativeJoin = [].join;
|
1647 |
|
1648 | var ES3_STRINGS = indexedObject != Object;
|
1649 | var SLOPPY_METHOD = sloppyArrayMethod('join', ',');
|
1650 |
|
1651 |
|
1652 |
|
1653 | _export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, {
|
1654 | join: function join(separator) {
|
1655 | return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
|
1656 | }
|
1657 | });
|
1658 |
|
1659 | var $map = arrayIteration.map;
|
1660 |
|
1661 |
|
1662 |
|
1663 |
|
1664 |
|
1665 | _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('map') }, {
|
1666 | map: function map(callbackfn /* , thisArg */) {
|
1667 | return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
1668 | }
|
1669 | });
|
1670 |
|
1671 | var SPECIES$2 = wellKnownSymbol('species');
|
1672 | var nativeSlice = [].slice;
|
1673 | var max$1 = Math.max;
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 | _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, {
|
1679 | slice: function slice(start, end) {
|
1680 | var O = toIndexedObject(this);
|
1681 | var length = toLength(O.length);
|
1682 | var k = toAbsoluteIndex(start, length);
|
1683 | var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
1684 |
|
1685 | var Constructor, result, n;
|
1686 | if (isArray(O)) {
|
1687 | Constructor = O.constructor;
|
1688 |
|
1689 | if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
|
1690 | Constructor = undefined;
|
1691 | } else if (isObject(Constructor)) {
|
1692 | Constructor = Constructor[SPECIES$2];
|
1693 | if (Constructor === null) Constructor = undefined;
|
1694 | }
|
1695 | if (Constructor === Array || Constructor === undefined) {
|
1696 | return nativeSlice.call(O, k, fin);
|
1697 | }
|
1698 | }
|
1699 | result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
|
1700 | for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
|
1701 | result.length = n;
|
1702 | return result;
|
1703 | }
|
1704 | });
|
1705 |
|
1706 | var defineProperty$3 = objectDefineProperty.f;
|
1707 |
|
1708 | var FunctionPrototype = Function.prototype;
|
1709 | var FunctionPrototypeToString = FunctionPrototype.toString;
|
1710 | var nameRE = /^\s*function ([^ (]*)/;
|
1711 | var NAME = 'name';
|
1712 |
|
1713 |
|
1714 |
|
1715 | if (descriptors && !(NAME in FunctionPrototype)) {
|
1716 | defineProperty$3(FunctionPrototype, NAME, {
|
1717 | configurable: true,
|
1718 | get: function () {
|
1719 | try {
|
1720 | return FunctionPrototypeToString.call(this).match(nameRE)[1];
|
1721 | } catch (error) {
|
1722 | return '';
|
1723 | }
|
1724 | }
|
1725 | });
|
1726 | }
|
1727 |
|
1728 | var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
1729 |
|
1730 | var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
1731 |
|
1732 |
|
1733 | var tryGet = function (it, key) {
|
1734 | try {
|
1735 | return it[key];
|
1736 | } catch (error) { }
|
1737 | };
|
1738 |
|
1739 |
|
1740 | var classof = function (it) {
|
1741 | var O, tag, result;
|
1742 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
1743 |
|
1744 | : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
|
1745 |
|
1746 | : CORRECT_ARGUMENTS ? classofRaw(O)
|
1747 |
|
1748 | : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
|
1749 | };
|
1750 |
|
1751 | var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
1752 | var test = {};
|
1753 |
|
1754 | test[TO_STRING_TAG$2] = 'z';
|
1755 |
|
1756 |
|
1757 |
|
1758 | var objectToString = String(test) !== '[object z]' ? function toString() {
|
1759 | return '[object ' + classof(this) + ']';
|
1760 | } : test.toString;
|
1761 |
|
1762 | var ObjectPrototype$2 = Object.prototype;
|
1763 |
|
1764 |
|
1765 |
|
1766 | if (objectToString !== ObjectPrototype$2.toString) {
|
1767 | redefine(ObjectPrototype$2, 'toString', objectToString, { unsafe: true });
|
1768 | }
|
1769 |
|
1770 |
|
1771 | var createMethod$2 = function (CONVERT_TO_STRING) {
|
1772 | return function ($this, pos) {
|
1773 | var S = String(requireObjectCoercible($this));
|
1774 | var position = toInteger(pos);
|
1775 | var size = S.length;
|
1776 | var first, second;
|
1777 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
1778 | first = S.charCodeAt(position);
|
1779 | return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
1780 | || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
|
1781 | ? CONVERT_TO_STRING ? S.charAt(position) : first
|
1782 | : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
1783 | };
|
1784 | };
|
1785 |
|
1786 | var stringMultibyte = {
|
1787 |
|
1788 |
|
1789 | codeAt: createMethod$2(false),
|
1790 |
|
1791 |
|
1792 | charAt: createMethod$2(true)
|
1793 | };
|
1794 |
|
1795 | var charAt = stringMultibyte.charAt;
|
1796 |
|
1797 |
|
1798 |
|
1799 | var STRING_ITERATOR = 'String Iterator';
|
1800 | var setInternalState$2 = internalState.set;
|
1801 | var getInternalState$2 = internalState.getterFor(STRING_ITERATOR);
|
1802 |
|
1803 |
|
1804 |
|
1805 | defineIterator(String, 'String', function (iterated) {
|
1806 | setInternalState$2(this, {
|
1807 | type: STRING_ITERATOR,
|
1808 | string: String(iterated),
|
1809 | index: 0
|
1810 | });
|
1811 |
|
1812 |
|
1813 | }, function next() {
|
1814 | var state = getInternalState$2(this);
|
1815 | var string = state.string;
|
1816 | var index = state.index;
|
1817 | var point;
|
1818 | if (index >= string.length) return { value: undefined, done: true };
|
1819 | point = charAt(string, index);
|
1820 | state.index += point.length;
|
1821 | return { value: point, done: false };
|
1822 | });
|
1823 |
|
1824 |
|
1825 |
|
1826 | var regexpFlags = function () {
|
1827 | var that = anObject(this);
|
1828 | var result = '';
|
1829 | if (that.global) result += 'g';
|
1830 | if (that.ignoreCase) result += 'i';
|
1831 | if (that.multiline) result += 'm';
|
1832 | if (that.dotAll) result += 's';
|
1833 | if (that.unicode) result += 'u';
|
1834 | if (that.sticky) result += 'y';
|
1835 | return result;
|
1836 | };
|
1837 |
|
1838 | var nativeExec = RegExp.prototype.exec;
|
1839 |
|
1840 |
|
1841 |
|
1842 | var nativeReplace = String.prototype.replace;
|
1843 |
|
1844 | var patchedExec = nativeExec;
|
1845 |
|
1846 | var UPDATES_LAST_INDEX_WRONG = (function () {
|
1847 | var re1 = /a/;
|
1848 | var re2 = /b*/g;
|
1849 | nativeExec.call(re1, 'a');
|
1850 | nativeExec.call(re2, 'a');
|
1851 | return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
1852 | })();
|
1853 |
|
1854 |
|
1855 | var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
1856 |
|
1857 | var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
|
1858 |
|
1859 | if (PATCH) {
|
1860 | patchedExec = function exec(str) {
|
1861 | var re = this;
|
1862 | var lastIndex, reCopy, match, i;
|
1863 |
|
1864 | if (NPCG_INCLUDED) {
|
1865 | reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
|
1866 | }
|
1867 | if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
1868 |
|
1869 | match = nativeExec.call(re, str);
|
1870 |
|
1871 | if (UPDATES_LAST_INDEX_WRONG && match) {
|
1872 | re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
1873 | }
|
1874 | if (NPCG_INCLUDED && match && match.length > 1) {
|
1875 |
|
1876 |
|
1877 | nativeReplace.call(match[0], reCopy, function () {
|
1878 | for (i = 1; i < arguments.length - 2; i++) {
|
1879 | if (arguments[i] === undefined) match[i] = undefined;
|
1880 | }
|
1881 | });
|
1882 | }
|
1883 |
|
1884 | return match;
|
1885 | };
|
1886 | }
|
1887 |
|
1888 | var regexpExec = patchedExec;
|
1889 |
|
1890 | var SPECIES$3 = wellKnownSymbol('species');
|
1891 |
|
1892 | var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
1893 |
|
1894 |
|
1895 |
|
1896 | var re = /./;
|
1897 | re.exec = function () {
|
1898 | var result = [];
|
1899 | result.groups = { a: '7' };
|
1900 | return result;
|
1901 | };
|
1902 | return ''.replace(re, '$<a>') !== '7';
|
1903 | });
|
1904 |
|
1905 |
|
1906 |
|
1907 | var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
|
1908 | var re = /(?:)/;
|
1909 | var originalExec = re.exec;
|
1910 | re.exec = function () { return originalExec.apply(this, arguments); };
|
1911 | var result = 'ab'.split(re);
|
1912 | return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
|
1913 | });
|
1914 |
|
1915 | var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
|
1916 | var SYMBOL = wellKnownSymbol(KEY);
|
1917 |
|
1918 | var DELEGATES_TO_SYMBOL = !fails(function () {
|
1919 |
|
1920 | var O = {};
|
1921 | O[SYMBOL] = function () { return 7; };
|
1922 | return ''[KEY](O) != 7;
|
1923 | });
|
1924 |
|
1925 | var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
|
1926 |
|
1927 | var execCalled = false;
|
1928 | var re = /a/;
|
1929 | re.exec = function () { execCalled = true; return null; };
|
1930 |
|
1931 | if (KEY === 'split') {
|
1932 |
|
1933 |
|
1934 | re.constructor = {};
|
1935 | re.constructor[SPECIES$3] = function () { return re; };
|
1936 | }
|
1937 |
|
1938 | re[SYMBOL]('');
|
1939 | return !execCalled;
|
1940 | });
|
1941 |
|
1942 | if (
|
1943 | !DELEGATES_TO_SYMBOL ||
|
1944 | !DELEGATES_TO_EXEC ||
|
1945 | (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
|
1946 | (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
|
1947 | ) {
|
1948 | var nativeRegExpMethod = /./[SYMBOL];
|
1949 | var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
1950 | if (regexp.exec === regexpExec) {
|
1951 | if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
1952 |
|
1953 |
|
1954 |
|
1955 | return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
|
1956 | }
|
1957 | return { done: true, value: nativeMethod.call(str, regexp, arg2) };
|
1958 | }
|
1959 | return { done: false };
|
1960 | });
|
1961 | var stringMethod = methods[0];
|
1962 | var regexMethod = methods[1];
|
1963 |
|
1964 | redefine(String.prototype, KEY, stringMethod);
|
1965 | redefine(RegExp.prototype, SYMBOL, length == 2
|
1966 |
|
1967 |
|
1968 | ? function (string, arg) { return regexMethod.call(string, this, arg); }
|
1969 |
|
1970 |
|
1971 | : function (string) { return regexMethod.call(string, this); }
|
1972 | );
|
1973 | if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
|
1974 | }
|
1975 | };
|
1976 |
|
1977 | var SPECIES$4 = wellKnownSymbol('species');
|
1978 |
|
1979 |
|
1980 |
|
1981 | var speciesConstructor = function (O, defaultConstructor) {
|
1982 | var C = anObject(O).constructor;
|
1983 | var S;
|
1984 | return C === undefined || (S = anObject(C)[SPECIES$4]) == undefined ? defaultConstructor : aFunction$1(S);
|
1985 | };
|
1986 |
|
1987 | var charAt$1 = stringMultibyte.charAt;
|
1988 |
|
1989 |
|
1990 |
|
1991 | var advanceStringIndex = function (S, index, unicode) {
|
1992 | return index + (unicode ? charAt$1(S, index).length : 1);
|
1993 | };
|
1994 |
|
1995 |
|
1996 |
|
1997 | var regexpExecAbstract = function (R, S) {
|
1998 | var exec = R.exec;
|
1999 | if (typeof exec === 'function') {
|
2000 | var result = exec.call(R, S);
|
2001 | if (typeof result !== 'object') {
|
2002 | throw TypeError('RegExp exec method returned something other than an Object or null');
|
2003 | }
|
2004 | return result;
|
2005 | }
|
2006 |
|
2007 | if (classofRaw(R) !== 'RegExp') {
|
2008 | throw TypeError('RegExp#exec called on incompatible receiver');
|
2009 | }
|
2010 |
|
2011 | return regexpExec.call(R, S);
|
2012 | };
|
2013 |
|
2014 | var arrayPush = [].push;
|
2015 | var min$2 = Math.min;
|
2016 | var MAX_UINT32 = 0xFFFFFFFF;
|
2017 |
|
2018 |
|
2019 | var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
|
2020 |
|
2021 |
|
2022 | fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
|
2023 | var internalSplit;
|
2024 | if (
|
2025 | 'abbc'.split(/(b)*/)[1] == 'c' ||
|
2026 | 'test'.split(/(?:)/, -1).length != 4 ||
|
2027 | 'ab'.split(/(?:ab)*/).length != 2 ||
|
2028 | '.'.split(/(.?)(.?)/).length != 4 ||
|
2029 | '.'.split(/()()/).length > 1 ||
|
2030 | ''.split(/.?/).length
|
2031 | ) {
|
2032 |
|
2033 | internalSplit = function (separator, limit) {
|
2034 | var string = String(requireObjectCoercible(this));
|
2035 | var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
2036 | if (lim === 0) return [];
|
2037 | if (separator === undefined) return [string];
|
2038 |
|
2039 | if (!isRegexp(separator)) {
|
2040 | return nativeSplit.call(string, separator, lim);
|
2041 | }
|
2042 | var output = [];
|
2043 | var flags = (separator.ignoreCase ? 'i' : '') +
|
2044 | (separator.multiline ? 'm' : '') +
|
2045 | (separator.unicode ? 'u' : '') +
|
2046 | (separator.sticky ? 'y' : '');
|
2047 | var lastLastIndex = 0;
|
2048 |
|
2049 | var separatorCopy = new RegExp(separator.source, flags + 'g');
|
2050 | var match, lastIndex, lastLength;
|
2051 | while (match = regexpExec.call(separatorCopy, string)) {
|
2052 | lastIndex = separatorCopy.lastIndex;
|
2053 | if (lastIndex > lastLastIndex) {
|
2054 | output.push(string.slice(lastLastIndex, match.index));
|
2055 | if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
|
2056 | lastLength = match[0].length;
|
2057 | lastLastIndex = lastIndex;
|
2058 | if (output.length >= lim) break;
|
2059 | }
|
2060 | if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++;
|
2061 | }
|
2062 | if (lastLastIndex === string.length) {
|
2063 | if (lastLength || !separatorCopy.test('')) output.push('');
|
2064 | } else output.push(string.slice(lastLastIndex));
|
2065 | return output.length > lim ? output.slice(0, lim) : output;
|
2066 | };
|
2067 |
|
2068 | } else if ('0'.split(undefined, 0).length) {
|
2069 | internalSplit = function (separator, limit) {
|
2070 | return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
|
2071 | };
|
2072 | } else internalSplit = nativeSplit;
|
2073 |
|
2074 | return [
|
2075 |
|
2076 |
|
2077 | function split(separator, limit) {
|
2078 | var O = requireObjectCoercible(this);
|
2079 | var splitter = separator == undefined ? undefined : separator[SPLIT];
|
2080 | return splitter !== undefined
|
2081 | ? splitter.call(separator, O, limit)
|
2082 | : internalSplit.call(String(O), separator, limit);
|
2083 | },
|
2084 |
|
2085 |
|
2086 |
|
2087 |
|
2088 |
|
2089 | function (regexp, limit) {
|
2090 | var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
|
2091 | if (res.done) return res.value;
|
2092 |
|
2093 | var rx = anObject(regexp);
|
2094 | var S = String(this);
|
2095 | var C = speciesConstructor(rx, RegExp);
|
2096 |
|
2097 | var unicodeMatching = rx.unicode;
|
2098 | var flags = (rx.ignoreCase ? 'i' : '') +
|
2099 | (rx.multiline ? 'm' : '') +
|
2100 | (rx.unicode ? 'u' : '') +
|
2101 | (SUPPORTS_Y ? 'y' : 'g');
|
2102 |
|
2103 |
|
2104 |
|
2105 | var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
|
2106 | var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
2107 | if (lim === 0) return [];
|
2108 | if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
|
2109 | var p = 0;
|
2110 | var q = 0;
|
2111 | var A = [];
|
2112 | while (q < S.length) {
|
2113 | splitter.lastIndex = SUPPORTS_Y ? q : 0;
|
2114 | var z = regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q));
|
2115 | var e;
|
2116 | if (
|
2117 | z === null ||
|
2118 | (e = min$2(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
|
2119 | ) {
|
2120 | q = advanceStringIndex(S, q, unicodeMatching);
|
2121 | } else {
|
2122 | A.push(S.slice(p, q));
|
2123 | if (A.length === lim) return A;
|
2124 | for (var i = 1; i <= z.length - 1; i++) {
|
2125 | A.push(z[i]);
|
2126 | if (A.length === lim) return A;
|
2127 | }
|
2128 | q = p = e;
|
2129 | }
|
2130 | }
|
2131 | A.push(S.slice(p));
|
2132 | return A;
|
2133 | }
|
2134 | ];
|
2135 | }, !SUPPORTS_Y);
|
2136 |
|
2137 |
|
2138 |
|
2139 | var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
2140 |
|
2141 | var whitespace = '[' + whitespaces + ']';
|
2142 | var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
2143 | var rtrim = RegExp(whitespace + whitespace + '*$');
|
2144 |
|
2145 |
|
2146 | var createMethod$3 = function (TYPE) {
|
2147 | return function ($this) {
|
2148 | var string = String(requireObjectCoercible($this));
|
2149 | if (TYPE & 1) string = string.replace(ltrim, '');
|
2150 | if (TYPE & 2) string = string.replace(rtrim, '');
|
2151 | return string;
|
2152 | };
|
2153 | };
|
2154 |
|
2155 | var stringTrim = {
|
2156 |
|
2157 |
|
2158 | start: createMethod$3(1),
|
2159 |
|
2160 |
|
2161 | end: createMethod$3(2),
|
2162 |
|
2163 |
|
2164 | trim: createMethod$3(3)
|
2165 | };
|
2166 |
|
2167 | var non = '\u200B\u0085\u180E';
|
2168 |
|
2169 |
|
2170 |
|
2171 | var forcedStringTrimMethod = function (METHOD_NAME) {
|
2172 | return fails(function () {
|
2173 | return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
|
2174 | });
|
2175 | };
|
2176 |
|
2177 | var $trim = stringTrim.trim;
|
2178 |
|
2179 |
|
2180 |
|
2181 |
|
2182 | _export({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
2183 | trim: function trim() {
|
2184 | return $trim(this);
|
2185 | }
|
2186 | });
|
2187 |
|
2188 |
|
2189 |
|
2190 | var domIterables = {
|
2191 | CSSRuleList: 0,
|
2192 | CSSStyleDeclaration: 0,
|
2193 | CSSValueList: 0,
|
2194 | ClientRectList: 0,
|
2195 | DOMRectList: 0,
|
2196 | DOMStringList: 0,
|
2197 | DOMTokenList: 1,
|
2198 | DataTransferItemList: 0,
|
2199 | FileList: 0,
|
2200 | HTMLAllCollection: 0,
|
2201 | HTMLCollection: 0,
|
2202 | HTMLFormElement: 0,
|
2203 | HTMLSelectElement: 0,
|
2204 | MediaList: 0,
|
2205 | MimeTypeArray: 0,
|
2206 | NamedNodeMap: 0,
|
2207 | NodeList: 1,
|
2208 | PaintRequestList: 0,
|
2209 | Plugin: 0,
|
2210 | PluginArray: 0,
|
2211 | SVGLengthList: 0,
|
2212 | SVGNumberList: 0,
|
2213 | SVGPathSegList: 0,
|
2214 | SVGPointList: 0,
|
2215 | SVGStringList: 0,
|
2216 | SVGTransformList: 0,
|
2217 | SourceBufferList: 0,
|
2218 | StyleSheetList: 0,
|
2219 | TextTrackCueList: 0,
|
2220 | TextTrackList: 0,
|
2221 | TouchList: 0
|
2222 | };
|
2223 |
|
2224 | var $forEach$1 = arrayIteration.forEach;
|
2225 |
|
2226 |
|
2227 |
|
2228 |
|
2229 | var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
|
2230 | return $forEach$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
2231 | } : [].forEach;
|
2232 |
|
2233 | for (var COLLECTION_NAME in domIterables) {
|
2234 | var Collection = global_1[COLLECTION_NAME];
|
2235 | var CollectionPrototype = Collection && Collection.prototype;
|
2236 |
|
2237 | if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
|
2238 | hide(CollectionPrototype, 'forEach', arrayForEach);
|
2239 | } catch (error) {
|
2240 | CollectionPrototype.forEach = arrayForEach;
|
2241 | }
|
2242 | }
|
2243 |
|
2244 | var ITERATOR$2 = wellKnownSymbol('iterator');
|
2245 | var TO_STRING_TAG$3 = wellKnownSymbol('toStringTag');
|
2246 | var ArrayValues = es_array_iterator.values;
|
2247 |
|
2248 | for (var COLLECTION_NAME$1 in domIterables) {
|
2249 | var Collection$1 = global_1[COLLECTION_NAME$1];
|
2250 | var CollectionPrototype$1 = Collection$1 && Collection$1.prototype;
|
2251 | if (CollectionPrototype$1) {
|
2252 |
|
2253 | if (CollectionPrototype$1[ITERATOR$2] !== ArrayValues) try {
|
2254 | hide(CollectionPrototype$1, ITERATOR$2, ArrayValues);
|
2255 | } catch (error) {
|
2256 | CollectionPrototype$1[ITERATOR$2] = ArrayValues;
|
2257 | }
|
2258 | if (!CollectionPrototype$1[TO_STRING_TAG$3]) hide(CollectionPrototype$1, TO_STRING_TAG$3, COLLECTION_NAME$1);
|
2259 | if (domIterables[COLLECTION_NAME$1]) for (var METHOD_NAME in es_array_iterator) {
|
2260 |
|
2261 | if (CollectionPrototype$1[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) try {
|
2262 | hide(CollectionPrototype$1, METHOD_NAME, es_array_iterator[METHOD_NAME]);
|
2263 | } catch (error) {
|
2264 | CollectionPrototype$1[METHOD_NAME] = es_array_iterator[METHOD_NAME];
|
2265 | }
|
2266 | }
|
2267 | }
|
2268 | }
|
2269 |
|
2270 | var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
|
2271 |
|
2272 |
|
2273 |
|
2274 | _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
2275 | keys: function keys(it) {
|
2276 | return objectKeys(toObject(it));
|
2277 | }
|
2278 | });
|
2279 |
|
2280 | var max$2 = Math.max;
|
2281 | var min$3 = Math.min;
|
2282 | var floor$1 = Math.floor;
|
2283 | var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
|
2284 | var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
|
2285 |
|
2286 | var maybeToString = function (it) {
|
2287 | return it === undefined ? it : String(it);
|
2288 | };
|
2289 |
|
2290 |
|
2291 | fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) {
|
2292 | return [
|
2293 |
|
2294 |
|
2295 | function replace(searchValue, replaceValue) {
|
2296 | var O = requireObjectCoercible(this);
|
2297 | var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
|
2298 | return replacer !== undefined
|
2299 | ? replacer.call(searchValue, O, replaceValue)
|
2300 | : nativeReplace.call(String(O), searchValue, replaceValue);
|
2301 | },
|
2302 |
|
2303 |
|
2304 | function (regexp, replaceValue) {
|
2305 | var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
|
2306 | if (res.done) return res.value;
|
2307 |
|
2308 | var rx = anObject(regexp);
|
2309 | var S = String(this);
|
2310 |
|
2311 | var functionalReplace = typeof replaceValue === 'function';
|
2312 | if (!functionalReplace) replaceValue = String(replaceValue);
|
2313 |
|
2314 | var global = rx.global;
|
2315 | if (global) {
|
2316 | var fullUnicode = rx.unicode;
|
2317 | rx.lastIndex = 0;
|
2318 | }
|
2319 | var results = [];
|
2320 | while (true) {
|
2321 | var result = regexpExecAbstract(rx, S);
|
2322 | if (result === null) break;
|
2323 |
|
2324 | results.push(result);
|
2325 | if (!global) break;
|
2326 |
|
2327 | var matchStr = String(result[0]);
|
2328 | if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
2329 | }
|
2330 |
|
2331 | var accumulatedResult = '';
|
2332 | var nextSourcePosition = 0;
|
2333 | for (var i = 0; i < results.length; i++) {
|
2334 | result = results[i];
|
2335 |
|
2336 | var matched = String(result[0]);
|
2337 | var position = max$2(min$3(toInteger(result.index), S.length), 0);
|
2338 | var captures = [];
|
2339 |
|
2340 |
|
2341 |
|
2342 |
|
2343 |
|
2344 | for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
|
2345 | var namedCaptures = result.groups;
|
2346 | if (functionalReplace) {
|
2347 | var replacerArgs = [matched].concat(captures, position, S);
|
2348 | if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
|
2349 | var replacement = String(replaceValue.apply(undefined, replacerArgs));
|
2350 | } else {
|
2351 | replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
2352 | }
|
2353 | if (position >= nextSourcePosition) {
|
2354 | accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
|
2355 | nextSourcePosition = position + matched.length;
|
2356 | }
|
2357 | }
|
2358 | return accumulatedResult + S.slice(nextSourcePosition);
|
2359 | }
|
2360 | ];
|
2361 |
|
2362 |
|
2363 | function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
|
2364 | var tailPos = position + matched.length;
|
2365 | var m = captures.length;
|
2366 | var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
2367 | if (namedCaptures !== undefined) {
|
2368 | namedCaptures = toObject(namedCaptures);
|
2369 | symbols = SUBSTITUTION_SYMBOLS;
|
2370 | }
|
2371 | return nativeReplace.call(replacement, symbols, function (match, ch) {
|
2372 | var capture;
|
2373 | switch (ch.charAt(0)) {
|
2374 | case '$': return '$';
|
2375 | case '&': return matched;
|
2376 | case '`': return str.slice(0, position);
|
2377 | case "'": return str.slice(tailPos);
|
2378 | case '<':
|
2379 | capture = namedCaptures[ch.slice(1, -1)];
|
2380 | break;
|
2381 | default:
|
2382 | var n = +ch;
|
2383 | if (n === 0) return match;
|
2384 | if (n > m) {
|
2385 | var f = floor$1(n / 10);
|
2386 | if (f === 0) return match;
|
2387 | if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
|
2388 | return match;
|
2389 | }
|
2390 | capture = captures[n - 1];
|
2391 | }
|
2392 | return capture === undefined ? '' : capture;
|
2393 | });
|
2394 | }
|
2395 | });
|
2396 |
|
2397 |
|
2398 | var s = 's';
|
2399 |
|
2400 | var sprintf = function sprintf(strings) {
|
2401 | for (var _len = arguments.length, formats = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
2402 | formats[_key - 1] = arguments[_key];
|
2403 | }
|
2404 |
|
2405 | return function () {
|
2406 | for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
2407 | args[_key2] = arguments[_key2];
|
2408 | }
|
2409 |
|
2410 | var retStr = '';
|
2411 | return strings.slice(0, -1).some(function (str, i) {
|
2412 | switch (formats[i]) {
|
2413 | default:
|
2414 | throw new TypeError('Unrecognized sprintf format');
|
2415 |
|
2416 | case 's':
|
2417 | {
|
2418 | var arg = args[i];
|
2419 |
|
2420 | if (arg === null || arg === undefined) {
|
2421 | return true;
|
2422 | }
|
2423 |
|
2424 | retStr += str + arg;
|
2425 | return false;
|
2426 | }
|
2427 | }
|
2428 | }) ? '' : retStr + strings.slice(-1);
|
2429 | };
|
2430 | };
|
2431 |
|
2432 | var compareObjects = function compareObjects(objectA, objectB, compareLength) {
|
2433 | var aKeys = Object.keys(objectA);
|
2434 | var bKeys = Object.keys(objectB);
|
2435 |
|
2436 | if (compareLength && aKeys.length !== bKeys.length) {
|
2437 | return false;
|
2438 | }
|
2439 |
|
2440 | for (var _i = 0, _aKeys = aKeys; _i < _aKeys.length; _i++) {
|
2441 | var key = _aKeys[_i];
|
2442 |
|
2443 | if (bKeys.includes(key) && objectA[key] !== objectB[key]) {
|
2444 | return false;
|
2445 | }
|
2446 | }
|
2447 |
|
2448 | return true;
|
2449 | };
|
2450 |
|
2451 | var removeDiacritics = function removeDiacritics(str) {
|
2452 | if (str.normalize) {
|
2453 | return str.normalize('NFD').replace(/[\u0300-\u036F]/g, '');
|
2454 | }
|
2455 |
|
2456 | var defaultDiacriticsRemovalMap = [{
|
2457 | 'base': 'A',
|
2458 | 'letters': /[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g
|
2459 | }, {
|
2460 | 'base': 'AA',
|
2461 | 'letters': /[\uA732]/g
|
2462 | }, {
|
2463 | 'base': 'AE',
|
2464 | 'letters': /[\u00C6\u01FC\u01E2]/g
|
2465 | }, {
|
2466 | 'base': 'AO',
|
2467 | 'letters': /[\uA734]/g
|
2468 | }, {
|
2469 | 'base': 'AU',
|
2470 | 'letters': /[\uA736]/g
|
2471 | }, {
|
2472 | 'base': 'AV',
|
2473 | 'letters': /[\uA738\uA73A]/g
|
2474 | }, {
|
2475 | 'base': 'AY',
|
2476 | 'letters': /[\uA73C]/g
|
2477 | }, {
|
2478 | 'base': 'B',
|
2479 | 'letters': /[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g
|
2480 | }, {
|
2481 | 'base': 'C',
|
2482 | 'letters': /[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g
|
2483 | }, {
|
2484 | 'base': 'D',
|
2485 | 'letters': /[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g
|
2486 | }, {
|
2487 | 'base': 'DZ',
|
2488 | 'letters': /[\u01F1\u01C4]/g
|
2489 | }, {
|
2490 | 'base': 'Dz',
|
2491 | 'letters': /[\u01F2\u01C5]/g
|
2492 | }, {
|
2493 | 'base': 'E',
|
2494 | 'letters': /[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g
|
2495 | }, {
|
2496 | 'base': 'F',
|
2497 | 'letters': /[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g
|
2498 | }, {
|
2499 | 'base': 'G',
|
2500 | 'letters': /[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g
|
2501 | }, {
|
2502 | 'base': 'H',
|
2503 | 'letters': /[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g
|
2504 | }, {
|
2505 | 'base': 'I',
|
2506 | 'letters': /[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g
|
2507 | }, {
|
2508 | 'base': 'J',
|
2509 | 'letters': /[\u004A\u24BF\uFF2A\u0134\u0248]/g
|
2510 | }, {
|
2511 | 'base': 'K',
|
2512 | 'letters': /[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g
|
2513 | }, {
|
2514 | 'base': 'L',
|
2515 | 'letters': /[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g
|
2516 | }, {
|
2517 | 'base': 'LJ',
|
2518 | 'letters': /[\u01C7]/g
|
2519 | }, {
|
2520 | 'base': 'Lj',
|
2521 | 'letters': /[\u01C8]/g
|
2522 | }, {
|
2523 | 'base': 'M',
|
2524 | 'letters': /[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g
|
2525 | }, {
|
2526 | 'base': 'N',
|
2527 | 'letters': /[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g
|
2528 | }, {
|
2529 | 'base': 'NJ',
|
2530 | 'letters': /[\u01CA]/g
|
2531 | }, {
|
2532 | 'base': 'Nj',
|
2533 | 'letters': /[\u01CB]/g
|
2534 | }, {
|
2535 | 'base': 'O',
|
2536 | 'letters': /[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g
|
2537 | }, {
|
2538 | 'base': 'OI',
|
2539 | 'letters': /[\u01A2]/g
|
2540 | }, {
|
2541 | 'base': 'OO',
|
2542 | 'letters': /[\uA74E]/g
|
2543 | }, {
|
2544 | 'base': 'OU',
|
2545 | 'letters': /[\u0222]/g
|
2546 | }, {
|
2547 | 'base': 'P',
|
2548 | 'letters': /[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g
|
2549 | }, {
|
2550 | 'base': 'Q',
|
2551 | 'letters': /[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g
|
2552 | }, {
|
2553 | 'base': 'R',
|
2554 | 'letters': /[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g
|
2555 | }, {
|
2556 | 'base': 'S',
|
2557 | 'letters': /[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g
|
2558 | }, {
|
2559 | 'base': 'T',
|
2560 | 'letters': /[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g
|
2561 | }, {
|
2562 | 'base': 'TZ',
|
2563 | 'letters': /[\uA728]/g
|
2564 | }, {
|
2565 | 'base': 'U',
|
2566 | 'letters': /[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g
|
2567 | }, {
|
2568 | 'base': 'V',
|
2569 | 'letters': /[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g
|
2570 | }, {
|
2571 | 'base': 'VY',
|
2572 | 'letters': /[\uA760]/g
|
2573 | }, {
|
2574 | 'base': 'W',
|
2575 | 'letters': /[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g
|
2576 | }, {
|
2577 | 'base': 'X',
|
2578 | 'letters': /[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g
|
2579 | }, {
|
2580 | 'base': 'Y',
|
2581 | 'letters': /[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g
|
2582 | }, {
|
2583 | 'base': 'Z',
|
2584 | 'letters': /[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g
|
2585 | }, {
|
2586 | 'base': 'a',
|
2587 | 'letters': /[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g
|
2588 | }, {
|
2589 | 'base': 'aa',
|
2590 | 'letters': /[\uA733]/g
|
2591 | }, {
|
2592 | 'base': 'ae',
|
2593 | 'letters': /[\u00E6\u01FD\u01E3]/g
|
2594 | }, {
|
2595 | 'base': 'ao',
|
2596 | 'letters': /[\uA735]/g
|
2597 | }, {
|
2598 | 'base': 'au',
|
2599 | 'letters': /[\uA737]/g
|
2600 | }, {
|
2601 | 'base': 'av',
|
2602 | 'letters': /[\uA739\uA73B]/g
|
2603 | }, {
|
2604 | 'base': 'ay',
|
2605 | 'letters': /[\uA73D]/g
|
2606 | }, {
|
2607 | 'base': 'b',
|
2608 | 'letters': /[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g
|
2609 | }, {
|
2610 | 'base': 'c',
|
2611 | 'letters': /[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g
|
2612 | }, {
|
2613 | 'base': 'd',
|
2614 | 'letters': /[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g
|
2615 | }, {
|
2616 | 'base': 'dz',
|
2617 | 'letters': /[\u01F3\u01C6]/g
|
2618 | }, {
|
2619 | 'base': 'e',
|
2620 | 'letters': /[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g
|
2621 | }, {
|
2622 | 'base': 'f',
|
2623 | 'letters': /[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g
|
2624 | }, {
|
2625 | 'base': 'g',
|
2626 | 'letters': /[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g
|
2627 | }, {
|
2628 | 'base': 'h',
|
2629 | 'letters': /[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g
|
2630 | }, {
|
2631 | 'base': 'hv',
|
2632 | 'letters': /[\u0195]/g
|
2633 | }, {
|
2634 | 'base': 'i',
|
2635 | 'letters': /[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g
|
2636 | }, {
|
2637 | 'base': 'j',
|
2638 | 'letters': /[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g
|
2639 | }, {
|
2640 | 'base': 'k',
|
2641 | 'letters': /[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g
|
2642 | }, {
|
2643 | 'base': 'l',
|
2644 | 'letters': /[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g
|
2645 | }, {
|
2646 | 'base': 'lj',
|
2647 | 'letters': /[\u01C9]/g
|
2648 | }, {
|
2649 | 'base': 'm',
|
2650 | 'letters': /[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g
|
2651 | }, {
|
2652 | 'base': 'n',
|
2653 | 'letters': /[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g
|
2654 | }, {
|
2655 | 'base': 'nj',
|
2656 | 'letters': /[\u01CC]/g
|
2657 | }, {
|
2658 | 'base': 'o',
|
2659 | 'letters': /[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g
|
2660 | }, {
|
2661 | 'base': 'oi',
|
2662 | 'letters': /[\u01A3]/g
|
2663 | }, {
|
2664 | 'base': 'ou',
|
2665 | 'letters': /[\u0223]/g
|
2666 | }, {
|
2667 | 'base': 'oo',
|
2668 | 'letters': /[\uA74F]/g
|
2669 | }, {
|
2670 | 'base': 'p',
|
2671 | 'letters': /[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g
|
2672 | }, {
|
2673 | 'base': 'q',
|
2674 | 'letters': /[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g
|
2675 | }, {
|
2676 | 'base': 'r',
|
2677 | 'letters': /[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g
|
2678 | }, {
|
2679 | 'base': 's',
|
2680 | 'letters': /[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g
|
2681 | }, {
|
2682 | 'base': 't',
|
2683 | 'letters': /[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g
|
2684 | }, {
|
2685 | 'base': 'tz',
|
2686 | 'letters': /[\uA729]/g
|
2687 | }, {
|
2688 | 'base': 'u',
|
2689 | 'letters': /[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g
|
2690 | }, {
|
2691 | 'base': 'v',
|
2692 | 'letters': /[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g
|
2693 | }, {
|
2694 | 'base': 'vy',
|
2695 | 'letters': /[\uA761]/g
|
2696 | }, {
|
2697 | 'base': 'w',
|
2698 | 'letters': /[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g
|
2699 | }, {
|
2700 | 'base': 'x',
|
2701 | 'letters': /[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g
|
2702 | }, {
|
2703 | 'base': 'y',
|
2704 | 'letters': /[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g
|
2705 | }, {
|
2706 | 'base': 'z',
|
2707 | 'letters': /[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g
|
2708 | }];
|
2709 | return defaultDiacriticsRemovalMap.reduce(function (string, _ref) {
|
2710 | var letters = _ref.letters,
|
2711 | base = _ref.base;
|
2712 | return string.replace(letters, base);
|
2713 | }, str);
|
2714 | };
|
2715 |
|
2716 | function _templateObject26() {
|
2717 | var data = _taggedTemplateLiteral(["[data-group=\"", "\"]"]);
|
2718 |
|
2719 | _templateObject26 = function _templateObject26() {
|
2720 | return data;
|
2721 | };
|
2722 |
|
2723 | return data;
|
2724 | }
|
2725 |
|
2726 | function _templateObject25() {
|
2727 | var data = _taggedTemplateLiteral(["[value=\"", "\"]"]);
|
2728 |
|
2729 | _templateObject25 = function _templateObject25() {
|
2730 | return data;
|
2731 | };
|
2732 |
|
2733 | return data;
|
2734 | }
|
2735 |
|
2736 | function _templateObject24() {
|
2737 | var data = _taggedTemplateLiteral(["[value=\"", "\"]"]);
|
2738 |
|
2739 | _templateObject24 = function _templateObject24() {
|
2740 | return data;
|
2741 | };
|
2742 |
|
2743 | return data;
|
2744 | }
|
2745 |
|
2746 | function _templateObject23() {
|
2747 | var data = _taggedTemplateLiteral(["[value=\"", "\"]"]);
|
2748 |
|
2749 | _templateObject23 = function _templateObject23() {
|
2750 | return data;
|
2751 | };
|
2752 |
|
2753 | return data;
|
2754 | }
|
2755 |
|
2756 | function _templateObject22() {
|
2757 | var data = _taggedTemplateLiteral(["[value=\"", "\"]"]);
|
2758 |
|
2759 | _templateObject22 = function _templateObject22() {
|
2760 | return data;
|
2761 | };
|
2762 |
|
2763 | return data;
|
2764 | }
|
2765 |
|
2766 | function _templateObject21() {
|
2767 | var data = _taggedTemplateLiteral(["[", "][data-group=\"", "\"]"]);
|
2768 |
|
2769 | _templateObject21 = function _templateObject21() {
|
2770 | return data;
|
2771 | };
|
2772 |
|
2773 | return data;
|
2774 | }
|
2775 |
|
2776 | function _templateObject20() {
|
2777 | var data = _taggedTemplateLiteral(["input[", "]:checked"]);
|
2778 |
|
2779 | _templateObject20 = function _templateObject20() {
|
2780 | return data;
|
2781 | };
|
2782 |
|
2783 | return data;
|
2784 | }
|
2785 |
|
2786 | function _templateObject19() {
|
2787 | var data = _taggedTemplateLiteral(["[data-group=\"", "\"]"]);
|
2788 |
|
2789 | _templateObject19 = function _templateObject19() {
|
2790 | return data;
|
2791 | };
|
2792 |
|
2793 | return data;
|
2794 | }
|
2795 |
|
2796 | function _templateObject18() {
|
2797 | var data = _taggedTemplateLiteral(["[data-group=\"", "\"]"]);
|
2798 |
|
2799 | _templateObject18 = function _templateObject18() {
|
2800 | return data;
|
2801 | };
|
2802 |
|
2803 | return data;
|
2804 | }
|
2805 |
|
2806 | function _templateObject17() {
|
2807 | var data = _taggedTemplateLiteral(["<span>", "</span>"]);
|
2808 |
|
2809 | _templateObject17 = function _templateObject17() {
|
2810 | return data;
|
2811 | };
|
2812 |
|
2813 | return data;
|
2814 | }
|
2815 |
|
2816 | function _templateObject16() {
|
2817 | var data = _taggedTemplateLiteral([" data-group=\"", "\""]);
|
2818 |
|
2819 | _templateObject16 = function _templateObject16() {
|
2820 | return data;
|
2821 | };
|
2822 |
|
2823 | return data;
|
2824 | }
|
2825 |
|
2826 | function _templateObject15() {
|
2827 | var data = _taggedTemplateLiteral(["<input type=\"", "\" value=\"", "\" ", "", "", "", ">"]);
|
2828 |
|
2829 | _templateObject15 = function _templateObject15() {
|
2830 | return data;
|
2831 | };
|
2832 |
|
2833 | return data;
|
2834 | }
|
2835 |
|
2836 | function _templateObject14() {
|
2837 | var data = _taggedTemplateLiteral(["<label class=\"", "\">"]);
|
2838 |
|
2839 | _templateObject14 = function _templateObject14() {
|
2840 | return data;
|
2841 | };
|
2842 |
|
2843 | return data;
|
2844 | }
|
2845 |
|
2846 | function _templateObject13() {
|
2847 | var data = _taggedTemplateLiteral(["<li class=\"", " ", "\" ", " ", ">"]);
|
2848 |
|
2849 | _templateObject13 = function _templateObject13() {
|
2850 | return data;
|
2851 | };
|
2852 |
|
2853 | return data;
|
2854 | }
|
2855 |
|
2856 | function _templateObject12() {
|
2857 | var data = _taggedTemplateLiteral(["style=\"", "\""]);
|
2858 |
|
2859 | _templateObject12 = function _templateObject12() {
|
2860 | return data;
|
2861 | };
|
2862 |
|
2863 | return data;
|
2864 | }
|
2865 |
|
2866 | function _templateObject11() {
|
2867 | var data = _taggedTemplateLiteral(["<input type=\"checkbox\" ", " ", ">"]);
|
2868 |
|
2869 | _templateObject11 = function _templateObject11() {
|
2870 | return data;
|
2871 | };
|
2872 |
|
2873 | return data;
|
2874 | }
|
2875 |
|
2876 | function _templateObject10() {
|
2877 | var data = _taggedTemplateLiteral(["<label class=\"optgroup ", "\" data-group=\"", "\">"]);
|
2878 |
|
2879 | _templateObject10 = function _templateObject10() {
|
2880 | return data;
|
2881 | };
|
2882 |
|
2883 | return data;
|
2884 | }
|
2885 |
|
2886 | function _templateObject9() {
|
2887 | var data = _taggedTemplateLiteral(["style=\"", "\""]);
|
2888 |
|
2889 | _templateObject9 = function _templateObject9() {
|
2890 | return data;
|
2891 | };
|
2892 |
|
2893 | return data;
|
2894 | }
|
2895 |
|
2896 | function _templateObject8() {
|
2897 | var data = _taggedTemplateLiteral(["title=\"", "\""]);
|
2898 |
|
2899 | _templateObject8 = function _templateObject8() {
|
2900 | return data;
|
2901 | };
|
2902 |
|
2903 | return data;
|
2904 | }
|
2905 |
|
2906 | function _templateObject7() {
|
2907 | var data = _taggedTemplateLiteral(["<li class=\"ms-no-results\">", "</li>"]);
|
2908 |
|
2909 | _templateObject7 = function _templateObject7() {
|
2910 | return data;
|
2911 | };
|
2912 |
|
2913 | return data;
|
2914 | }
|
2915 |
|
2916 | function _templateObject6() {
|
2917 | var data = _taggedTemplateLiteral(["<input type=\"checkbox\" ", " />"]);
|
2918 |
|
2919 | _templateObject6 = function _templateObject6() {
|
2920 | return data;
|
2921 | };
|
2922 |
|
2923 | return data;
|
2924 | }
|
2925 |
|
2926 | function _templateObject5() {
|
2927 | var data = _taggedTemplateLiteral(["placeholder=\"", "\""]);
|
2928 |
|
2929 | _templateObject5 = function _templateObject5() {
|
2930 | return data;
|
2931 | };
|
2932 |
|
2933 | return data;
|
2934 | }
|
2935 |
|
2936 | function _templateObject4() {
|
2937 | var data = _taggedTemplateLiteral(["<div class=\"ms-drop ", "\"></div>"]);
|
2938 |
|
2939 | _templateObject4 = function _templateObject4() {
|
2940 | return data;
|
2941 | };
|
2942 |
|
2943 | return data;
|
2944 | }
|
2945 |
|
2946 | function _templateObject3() {
|
2947 | var data = _taggedTemplateLiteral(["\n <button type=\"button\" class=\"ms-choice\">\n <span class=\"placeholder\">", "</span>\n <div></div>\n </button>\n "]);
|
2948 |
|
2949 | _templateObject3 = function _templateObject3() {
|
2950 | return data;
|
2951 | };
|
2952 |
|
2953 | return data;
|
2954 | }
|
2955 |
|
2956 | function _templateObject2() {
|
2957 | var data = _taggedTemplateLiteral(["title=\"", "\""]);
|
2958 |
|
2959 | _templateObject2 = function _templateObject2() {
|
2960 | return data;
|
2961 | };
|
2962 |
|
2963 | return data;
|
2964 | }
|
2965 |
|
2966 | function _templateObject() {
|
2967 | var data = _taggedTemplateLiteral(["<div class=\"ms-parent ", "\" ", "/>"]);
|
2968 |
|
2969 | _templateObject = function _templateObject() {
|
2970 | return data;
|
2971 | };
|
2972 |
|
2973 | return data;
|
2974 | }
|
2975 |
|
2976 | var MultipleSelect =
|
2977 |
|
2978 | function () {
|
2979 | function MultipleSelect($el, options) {
|
2980 | _classCallCheck(this, MultipleSelect);
|
2981 |
|
2982 | this.$el = $el;
|
2983 | this.options = $.extend({}, Constants.DEFAULTS, options);
|
2984 | }
|
2985 |
|
2986 | _createClass(MultipleSelect, [{
|
2987 | key: "init",
|
2988 | value: function init() {
|
2989 | this.initLocale();
|
2990 | this.initContainer();
|
2991 | this.initData();
|
2992 | this.initFilter();
|
2993 | this.initDrop();
|
2994 | this.initView();
|
2995 | }
|
2996 | }, {
|
2997 | key: "initLocale",
|
2998 | value: function initLocale() {
|
2999 | if (this.options.locale) {
|
3000 | var locales = $.fn.multipleSelect.locales;
|
3001 | var parts = this.options.locale.split(/-|_/);
|
3002 | parts[0] = parts[0].toLowerCase();
|
3003 |
|
3004 | if (parts[1]) {
|
3005 | parts[1] = parts[1].toUpperCase();
|
3006 | }
|
3007 |
|
3008 | if (locales[this.options.locale]) {
|
3009 | $.extend(this.options, locales[this.options.locale]);
|
3010 | } else if (locales[parts.join('-')]) {
|
3011 | $.extend(this.options, locales[parts.join('-')]);
|
3012 | } else if (locales[parts[0]]) {
|
3013 | $.extend(this.options, locales[parts[0]]);
|
3014 | }
|
3015 | }
|
3016 | }
|
3017 | }, {
|
3018 | key: "initContainer",
|
3019 | value: function initContainer() {
|
3020 | var _this = this;
|
3021 |
|
3022 | var el = this.$el[0];
|
3023 | var name = el.getAttribute('name') || this.options.name || '';
|
3024 |
|
3025 | this.$el = this.$el.hide();
|
3026 |
|
3027 | this.$label = this.$el.closest('label');
|
3028 |
|
3029 | if (!this.$label.length && this.$el.attr('id')) {
|
3030 | this.$label = $("label[for=\"".concat(this.$el.attr('id'), "\"]"));
|
3031 | }
|
3032 |
|
3033 | if (this.$label.find('>input').length) {
|
3034 | this.$label = null;
|
3035 | }
|
3036 |
|
3037 |
|
3038 | this.$parent = $(sprintf(_templateObject(), s, s)(el.getAttribute('class') || '', sprintf(_templateObject2(), s)(el.getAttribute('title'))));
|
3039 |
|
3040 | this.options.placeholder = this.options.placeholder || el.getAttribute('placeholder') || '';
|
3041 | this.$choice = $(sprintf(_templateObject3(), s)(this.options.placeholder));
|
3042 |
|
3043 | this.$drop = $(sprintf(_templateObject4(), s)(this.options.position));
|
3044 |
|
3045 | if (this.options.dropWidth) {
|
3046 | this.$drop.css('width', this.options.dropWidth);
|
3047 | }
|
3048 |
|
3049 | this.$el.after(this.$parent);
|
3050 | this.$parent.append(this.$choice);
|
3051 | this.$parent.append(this.$drop);
|
3052 |
|
3053 | if (el.disabled) {
|
3054 | this.$choice.addClass('disabled');
|
3055 | }
|
3056 |
|
3057 | this.selectAllName = "data-name=\"selectAll".concat(name, "\"");
|
3058 | this.selectGroupName = "data-name=\"selectGroup".concat(name, "\"");
|
3059 | this.selectItemName = "data-name=\"selectItem".concat(name, "\"");
|
3060 |
|
3061 | if (!this.options.keepOpen) {
|
3062 | $(document).click(function (e) {
|
3063 | if ($(e.target)[0] === _this.$choice[0] || $(e.target).parents('.ms-choice')[0] === _this.$choice[0]) {
|
3064 | return;
|
3065 | }
|
3066 |
|
3067 | if (($(e.target)[0] === _this.$drop[0] || $(e.target).parents('.ms-drop')[0] !== _this.$drop[0] && e.target !== el) && _this.options.isOpen) {
|
3068 | _this.close();
|
3069 | }
|
3070 | });
|
3071 | }
|
3072 |
|
3073 | this.options.onAfterCreate();
|
3074 | }
|
3075 | }, {
|
3076 | key: "initData",
|
3077 | value: function initData() {
|
3078 | var _this2 = this;
|
3079 |
|
3080 | var data = [];
|
3081 |
|
3082 | if (this.options.data) {
|
3083 | this.options.data.forEach(function (row, i) {
|
3084 | if (row.type === 'optgroup') {
|
3085 | row.group = row.group || "group_".concat(i);
|
3086 | row.children.forEach(function (child) {
|
3087 | child.group = child.group || row.group;
|
3088 | });
|
3089 | }
|
3090 | });
|
3091 | this.data = this.options.data;
|
3092 | return;
|
3093 | }
|
3094 |
|
3095 | $.each(this.$el.children(), function (i, elm) {
|
3096 | var row = _this2.initRow(i, elm);
|
3097 |
|
3098 | if (row) {
|
3099 | data.push(_this2.initRow(i, elm));
|
3100 | }
|
3101 | });
|
3102 | this.options.data = data;
|
3103 | this.data = data;
|
3104 | this.fromHtml = true;
|
3105 | }
|
3106 | }, {
|
3107 | key: "initRow",
|
3108 | value: function initRow(i, elm, group, groupDisabled) {
|
3109 | var _this3 = this;
|
3110 |
|
3111 | var row = {};
|
3112 | var $elm = $(elm);
|
3113 |
|
3114 | if ($elm.is('option')) {
|
3115 | row.type = 'option';
|
3116 | row.group = group;
|
3117 | row.text = this.options.textTemplate($elm);
|
3118 | row.value = elm.value;
|
3119 | row.selected = elm.selected;
|
3120 | row.disabled = groupDisabled || elm.disabled;
|
3121 | row.classes = elm.getAttribute('class') || '';
|
3122 | row.title = elm.getAttribute('title');
|
3123 | return row;
|
3124 | }
|
3125 |
|
3126 | if ($elm.is('optgroup')) {
|
3127 | row.type = 'optgroup';
|
3128 | row.group = "group_".concat(i);
|
3129 | row.label = this.options.labelTemplate($elm);
|
3130 | row.disabled = elm.disabled;
|
3131 | row.children = [];
|
3132 | $.each($elm.children(), function (j, elem) {
|
3133 | row.children.push(_this3.initRow(j, elem, row.group, row.disabled));
|
3134 | });
|
3135 | return row;
|
3136 | }
|
3137 |
|
3138 | return null;
|
3139 | }
|
3140 | }, {
|
3141 | key: "initFilter",
|
3142 | value: function initFilter() {
|
3143 | if (this.options.filter || !this.options.filterByDataLength) {
|
3144 | return;
|
3145 | }
|
3146 |
|
3147 | var length = 0;
|
3148 | var _iteratorNormalCompletion = true;
|
3149 | var _didIteratorError = false;
|
3150 | var _iteratorError = undefined;
|
3151 |
|
3152 | try {
|
3153 | for (var _iterator = this.data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
3154 | var option = _step.value;
|
3155 |
|
3156 | if (option.type === 'optgroup') {
|
3157 | length += option.children.length;
|
3158 | } else {
|
3159 | length += 1;
|
3160 | }
|
3161 | }
|
3162 | } catch (err) {
|
3163 | _didIteratorError = true;
|
3164 | _iteratorError = err;
|
3165 | } finally {
|
3166 | try {
|
3167 | if (!_iteratorNormalCompletion && _iterator.return != null) {
|
3168 | _iterator.return();
|
3169 | }
|
3170 | } finally {
|
3171 | if (_didIteratorError) {
|
3172 | throw _iteratorError;
|
3173 | }
|
3174 | }
|
3175 | }
|
3176 |
|
3177 | this.options.filter = length > this.options.filterByDataLength;
|
3178 | }
|
3179 | }, {
|
3180 | key: "initDrop",
|
3181 | value: function initDrop() {
|
3182 | var _this4 = this;
|
3183 |
|
3184 | this.initList();
|
3185 | this.events();
|
3186 | this.update(true);
|
3187 | this.updateOptGroupSelect(true);
|
3188 | this.updateSelectAll(false, true);
|
3189 |
|
3190 | if (this.options.isOpen) {
|
3191 | this.open();
|
3192 | }
|
3193 |
|
3194 | if (this.options.openOnHover) {
|
3195 | this.$parent.hover(function () {
|
3196 | _this4.open();
|
3197 | }, function () {
|
3198 | _this4.close();
|
3199 | });
|
3200 | }
|
3201 | }
|
3202 | }, {
|
3203 | key: "initList",
|
3204 | value: function initList() {
|
3205 | var _this5 = this;
|
3206 |
|
3207 | var html = [];
|
3208 |
|
3209 | if (this.options.filter) {
|
3210 | html.push("\n <div class=\"ms-search\">\n <input type=\"text\" autocomplete=\"off\" autocorrect=\"off\"\n autocapitalize=\"off\" spellcheck=\"false\"\n ".concat(sprintf(_templateObject5(), s)(this.options.filterPlaceholder), ">\n </div>\n "));
|
3211 | }
|
3212 |
|
3213 | html.push('<ul>');
|
3214 |
|
3215 | if (this.options.selectAll && !this.options.single) {
|
3216 | html.push(['<li class="ms-select-all">', '<label>', sprintf(_templateObject6(), s)(this.selectAllName), "<span>".concat(this.options.formatSelectAll(), "</span>"), '</label>', '</li>'].join(''));
|
3217 | }
|
3218 |
|
3219 | html.push(this.data.map(function (row) {
|
3220 | return _this5.initListItem(row);
|
3221 | }).join(''));
|
3222 | html.push(sprintf(_templateObject7(), s)(this.options.formatNoMatchesFound()));
|
3223 | html.push('</ul>');
|
3224 | this.$drop.html(html.join(''));
|
3225 | this.$drop.find('ul').css('max-height', "".concat(this.options.maxHeight, "px"));
|
3226 | this.$drop.find('.multiple').css('width', "".concat(this.options.multipleWidth, "px"));
|
3227 | this.$searchInput = this.$drop.find('.ms-search input');
|
3228 | this.$selectAll = this.$drop.find("input[".concat(this.selectAllName, "]"));
|
3229 | this.$selectGroups = this.$drop.find("input[".concat(this.selectGroupName, "]"));
|
3230 | this.$selectItems = this.$drop.find("input[".concat(this.selectItemName, "]:enabled"));
|
3231 | this.$disableItems = this.$drop.find("input[".concat(this.selectItemName, "]:disabled"));
|
3232 | this.$noResults = this.$drop.find('.ms-no-results');
|
3233 | }
|
3234 | }, {
|
3235 | key: "initListItem",
|
3236 | value: function initListItem(row) {
|
3237 | var _this6 = this;
|
3238 |
|
3239 | var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
3240 | var title = sprintf(_templateObject8(), s)(row.title);
|
3241 | var multiple = this.options.multiple ? 'multiple' : '';
|
3242 | var type = this.options.single ? 'radio' : 'checkbox';
|
3243 | var classes = '';
|
3244 |
|
3245 | if (this.options.single && !this.options.singleRadio) {
|
3246 | classes = 'hide-radio ';
|
3247 | }
|
3248 |
|
3249 | if (row.type === 'optgroup') {
|
3250 | var _customStyle = this.options.styler(row);
|
3251 |
|
3252 | var _style = _customStyle ? sprintf(_templateObject9(), s)(_customStyle) : '';
|
3253 |
|
3254 | var html = [];
|
3255 | html.push(["<li class=\"group ".concat(classes, "\" ").concat(_style, ">"), sprintf(_templateObject10(), s, s)(row.disabled ? 'disabled' : '', row.group), this.options.hideOptgroupCheckboxes || this.options.single ? '' : sprintf(_templateObject11(), s, s)(this.selectGroupName, row.disabled ? 'disabled="disabled"' : ''), row.label, '</label>', '</li>'].join(''));
|
3256 | html.push(row.children.map(function (child) {
|
3257 | return _this6.initListItem(child, 1);
|
3258 | }).join(''));
|
3259 | return html.join('');
|
3260 | }
|
3261 |
|
3262 | var customStyle = this.options.styler(row);
|
3263 | var style = customStyle ? sprintf(_templateObject12(), s)(customStyle) : '';
|
3264 | classes += row.classes || '';
|
3265 |
|
3266 | if (level && this.options.single) {
|
3267 | classes += "option-level-".concat(level, " ");
|
3268 | }
|
3269 |
|
3270 | return [sprintf(_templateObject13(), s, s, s, s)(multiple, classes, title, style), sprintf(_templateObject14(), s)(row.disabled ? 'disabled' : ''), sprintf(_templateObject15(), s, s, s, s, s, s)(type, row.value, this.selectItemName, row.selected ? ' checked="checked"' : '', row.disabled ? ' disabled="disabled"' : '', sprintf(_templateObject16(), s)(row.group)), sprintf(_templateObject17(), s)(row.text), '</label>', '</li>'].join('');
|
3271 | }
|
3272 | }, {
|
3273 | key: "initView",
|
3274 | value: function initView() {
|
3275 | var computedWidth;
|
3276 |
|
3277 | if (window.getComputedStyle) {
|
3278 | computedWidth = window.getComputedStyle(this.$el[0]).width;
|
3279 |
|
3280 | if (computedWidth === 'auto') {
|
3281 | computedWidth = this.$drop.outerWidth() + 20;
|
3282 | }
|
3283 | } else {
|
3284 | computedWidth = this.$el.outerWidth() + 20;
|
3285 | }
|
3286 |
|
3287 | this.$parent.css('width', this.options.width || computedWidth);
|
3288 | }
|
3289 | }, {
|
3290 | key: "events",
|
3291 | value: function events() {
|
3292 | var _this7 = this;
|
3293 |
|
3294 | var toggleOpen = function toggleOpen(e) {
|
3295 | e.preventDefault();
|
3296 |
|
3297 | _this7[_this7.options.isOpen ? 'close' : 'open']();
|
3298 | };
|
3299 |
|
3300 | if (this.$label && this.$label.length) {
|
3301 | this.$label.off('click').on('click', function (e) {
|
3302 | if (e.target.nodeName.toLowerCase() !== 'label') {
|
3303 | return;
|
3304 | }
|
3305 |
|
3306 | toggleOpen(e);
|
3307 |
|
3308 | if (!_this7.options.filter || !_this7.options.isOpen) {
|
3309 | _this7.focus();
|
3310 | }
|
3311 |
|
3312 | e.stopPropagation();
|
3313 | });
|
3314 | }
|
3315 |
|
3316 | this.$choice.off('click').on('click', toggleOpen).off('focus').on('focus', this.options.onFocus).off('blur').on('blur', this.options.onBlur);
|
3317 | this.$parent.off('keydown').on('keydown', function (e) {
|
3318 |
|
3319 | if (e.which === 27 && !_this7.options.keepOpen) {
|
3320 | _this7.close();
|
3321 |
|
3322 | _this7.$choice.focus();
|
3323 | }
|
3324 | });
|
3325 | this.$searchInput.off('keydown').on('keydown', function (e) {
|
3326 |
|
3327 | if (e.keyCode === 9 && e.shiftKey) {
|
3328 | _this7.close();
|
3329 | }
|
3330 | }).off('keyup').on('keyup', function (e) {
|
3331 |
|
3332 |
|
3333 | if (_this7.options.filterAcceptOnEnter && [13, 32].includes(e.which) && _this7.$searchInput.val()) {
|
3334 | if (_this7.options.single) {
|
3335 | var $items = _this7.$selectItems.closest('li').filter(':visible');
|
3336 |
|
3337 | if ($items.length) {
|
3338 | _this7.setSelects([$items.first().find("input[".concat(_this7.selectItemName, "]")).val()]);
|
3339 | }
|
3340 | } else {
|
3341 | _this7.$selectAll.click();
|
3342 | }
|
3343 |
|
3344 | _this7.close();
|
3345 |
|
3346 | _this7.focus();
|
3347 |
|
3348 | return;
|
3349 | }
|
3350 |
|
3351 | _this7.filter();
|
3352 | });
|
3353 | this.$selectAll.off('click').on('click', function (e) {
|
3354 | var checked = $(e.currentTarget).prop('checked');
|
3355 |
|
3356 | var $items = _this7.$selectItems.filter(':visible');
|
3357 |
|
3358 | if ($items.length === _this7.$selectItems.length) {
|
3359 | _this7[checked ? 'checkAll' : 'uncheckAll']();
|
3360 | } else {
|
3361 |
|
3362 | _this7.$selectGroups.prop('checked', checked);
|
3363 |
|
3364 | $items.prop('checked', checked);
|
3365 |
|
3366 | _this7.options[checked ? 'onCheckAll' : 'onUncheckAll']();
|
3367 |
|
3368 | _this7.update();
|
3369 | }
|
3370 | });
|
3371 | this.$selectGroups.off('click').on('click', function (e) {
|
3372 | var $this = $(e.currentTarget);
|
3373 | var group = $this.parent()[0].getAttribute('data-group');
|
3374 |
|
3375 | var $items = _this7.$selectItems.filter(':visible');
|
3376 |
|
3377 | var $children = $items.filter(sprintf(_templateObject18(), s)(group));
|
3378 | var checked = $children.length !== $children.filter(':checked').length;
|
3379 | $children.prop('checked', checked);
|
3380 |
|
3381 | _this7.updateSelectAll(true);
|
3382 |
|
3383 | _this7.update();
|
3384 |
|
3385 | _this7.options.onOptgroupClick({
|
3386 | label: $this.parent().text(),
|
3387 | checked: checked,
|
3388 | children: $children.get().map(function (el) {
|
3389 | return {
|
3390 | label: $(el).parent().text(),
|
3391 | value: $(el).val(),
|
3392 | check: $(el).prop('checked')
|
3393 | };
|
3394 | })
|
3395 | });
|
3396 | });
|
3397 | this.$selectItems.off('click').on('click', function (e) {
|
3398 | var $this = $(e.currentTarget);
|
3399 |
|
3400 | if (_this7.options.single) {
|
3401 | var clickedVal = $this.val();
|
3402 |
|
3403 | _this7.$selectItems.filter(function (i, el) {
|
3404 | return $(el).val() !== clickedVal;
|
3405 | }).each(function (i, el) {
|
3406 | $(el).prop('checked', false);
|
3407 | });
|
3408 | }
|
3409 |
|
3410 | _this7.updateSelectAll(true);
|
3411 |
|
3412 | _this7.update();
|
3413 |
|
3414 | _this7.updateOptGroupSelect();
|
3415 |
|
3416 | _this7.options.onClick({
|
3417 | label: $this.parent().text(),
|
3418 | value: $this.val(),
|
3419 | checked: $this.prop('checked')
|
3420 | });
|
3421 |
|
3422 | if (_this7.options.single && _this7.options.isOpen && !_this7.options.keepOpen) {
|
3423 | _this7.close();
|
3424 | }
|
3425 | });
|
3426 | }
|
3427 | }, {
|
3428 | key: "open",
|
3429 | value: function open() {
|
3430 | if (this.$choice.hasClass('disabled')) {
|
3431 | return;
|
3432 | }
|
3433 |
|
3434 | this.options.isOpen = true;
|
3435 | this.$choice.find('>div').addClass('open');
|
3436 | this.$drop[this.animateMethod('show')]();
|
3437 |
|
3438 | this.$selectAll.parent().show();
|
3439 | this.$noResults.hide();
|
3440 |
|
3441 | if (!this.data.length) {
|
3442 | this.$selectAll.parent().hide();
|
3443 | this.$noResults.show();
|
3444 | }
|
3445 |
|
3446 | if (this.options.container) {
|
3447 | var offset = this.$drop.offset();
|
3448 | this.$drop.appendTo($(this.options.container));
|
3449 | this.$drop.offset({
|
3450 | top: offset.top,
|
3451 | left: offset.left
|
3452 | }).css('min-width', 'auto').outerWidth(this.$parent.outerWidth());
|
3453 | }
|
3454 |
|
3455 | if (this.data.length && this.options.filter) {
|
3456 | this.$searchInput.val('');
|
3457 | this.$searchInput.focus();
|
3458 | this.filter();
|
3459 | }
|
3460 |
|
3461 | this.options.onOpen();
|
3462 | }
|
3463 | }, {
|
3464 | key: "close",
|
3465 | value: function close() {
|
3466 | this.options.isOpen = false;
|
3467 | this.$choice.find('>div').removeClass('open');
|
3468 | this.$drop[this.animateMethod('hide')]();
|
3469 |
|
3470 | if (this.options.container) {
|
3471 | this.$parent.append(this.$drop);
|
3472 | this.$drop.css({
|
3473 | 'top': 'auto',
|
3474 | 'left': 'auto'
|
3475 | });
|
3476 | }
|
3477 |
|
3478 | this.options.onClose();
|
3479 | }
|
3480 | }, {
|
3481 | key: "animateMethod",
|
3482 | value: function animateMethod(method) {
|
3483 | var methods = {
|
3484 | show: {
|
3485 | fade: 'fadeIn',
|
3486 | slide: 'slideDown'
|
3487 | },
|
3488 | hide: {
|
3489 | fade: 'fadeOut',
|
3490 | slide: 'slideUp'
|
3491 | }
|
3492 | };
|
3493 | return methods[method][this.options.animate] || method;
|
3494 | }
|
3495 | }, {
|
3496 | key: "update",
|
3497 | value: function update(ignoreTrigger) {
|
3498 | var textSelects = this.getSelects('text');
|
3499 |
|
3500 | if (this.options.displayHtml) {
|
3501 | textSelects = this.getSelects('html');
|
3502 | } else if (this.options.displayValues) {
|
3503 | textSelects = this.getSelects();
|
3504 | }
|
3505 |
|
3506 | var $span = this.$choice.find('>span');
|
3507 | var sl = textSelects.length;
|
3508 | var html = '';
|
3509 |
|
3510 | if (sl === 0) {
|
3511 | $span.addClass('placeholder').html(this.options.placeholder);
|
3512 | } else if (sl < this.options.minimumCountSelected) {
|
3513 | html = textSelects.join(this.options.displayDelimiter);
|
3514 | } else if (this.options.formatAllSelected() && sl === this.$selectItems.length + this.$disableItems.length) {
|
3515 | html = this.options.formatAllSelected();
|
3516 | } else if (this.options.ellipsis && sl > this.options.minimumCountSelected) {
|
3517 | html = "".concat(textSelects.slice(0, this.options.minimumCountSelected).join(this.options.displayDelimiter), "...");
|
3518 | } else if (this.options.formatCountSelected() && sl > this.options.minimumCountSelected) {
|
3519 | html = this.options.formatCountSelected(sl, this.$selectItems.length + this.$disableItems.length);
|
3520 | } else {
|
3521 | html = textSelects.join(this.options.displayDelimiter);
|
3522 | }
|
3523 |
|
3524 | if (html) {
|
3525 | $span.removeClass('placeholder').html(html);
|
3526 | }
|
3527 |
|
3528 | if (this.options.displayTitle) {
|
3529 | $span.prop('title', this.getSelects('text'));
|
3530 | }
|
3531 |
|
3532 |
|
3533 | this.$el.val(this.getSelects());
|
3534 |
|
3535 | this.$drop.find('li').removeClass('selected');
|
3536 | this.$drop.find('input:checked').each(function (i, el) {
|
3537 | $(el).parents('li').first().addClass('selected');
|
3538 | });
|
3539 |
|
3540 | if (!ignoreTrigger) {
|
3541 | this.$el.trigger('change');
|
3542 | }
|
3543 | }
|
3544 | }, {
|
3545 | key: "updateSelectAll",
|
3546 | value: function updateSelectAll(triggerEvent) {
|
3547 | var all = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
3548 | var $items = this.$selectItems;
|
3549 |
|
3550 | if (!all) {
|
3551 | $items = $items.filter(':visible');
|
3552 | }
|
3553 |
|
3554 | var selectedLength = $items.filter(':checked').length;
|
3555 | this.$selectAll.prop('checked', selectedLength === $items.length);
|
3556 |
|
3557 | if (triggerEvent) {
|
3558 | if (selectedLength === $items.length) {
|
3559 | this.options.onCheckAll();
|
3560 | } else if (selectedLength === 0) {
|
3561 | this.options.onUncheckAll();
|
3562 | }
|
3563 | }
|
3564 | }
|
3565 | }, {
|
3566 | key: "updateOptGroupSelect",
|
3567 | value: function updateOptGroupSelect() {
|
3568 | var all = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
3569 | var $items = this.$selectItems;
|
3570 |
|
3571 | if (!all) {
|
3572 | $items = $items.filter(':visible');
|
3573 | }
|
3574 |
|
3575 | $.each(this.$selectGroups, function (i, val) {
|
3576 | var group = $(val).parent()[0].getAttribute('data-group');
|
3577 | var $children = $items.filter(sprintf(_templateObject19(), s)(group));
|
3578 | $(val).prop('checked', $children.length && $children.length === $children.filter(':checked').length);
|
3579 | });
|
3580 | }
|
3581 | }, {
|
3582 | key: "getOptions",
|
3583 | value: function getOptions() {
|
3584 |
|
3585 | var options = $.extend({}, this.options);
|
3586 | delete options.data;
|
3587 | return $.extend(true, {}, options);
|
3588 | }
|
3589 | }, {
|
3590 | key: "refreshOptions",
|
3591 | value: function refreshOptions(options) {
|
3592 |
|
3593 | if (compareObjects(this.options, options, true)) {
|
3594 | return;
|
3595 | }
|
3596 |
|
3597 | this.options = $.extend(this.options, options);
|
3598 | this.destroy();
|
3599 | this.init();
|
3600 | }
|
3601 |
|
3602 | }, {
|
3603 | key: "getSelects",
|
3604 | value: function getSelects(type) {
|
3605 | var _this8 = this;
|
3606 |
|
3607 | var texts = [];
|
3608 | var values = [];
|
3609 | this.$drop.find(sprintf(_templateObject20(), s)(this.selectItemName)).each(function (i, el) {
|
3610 | texts.push($(el).next()[type === 'html' ? 'html' : 'text']());
|
3611 | values.push($(el).val());
|
3612 | });
|
3613 |
|
3614 | if (type === 'text' && this.$selectGroups.length) {
|
3615 | texts = [];
|
3616 | this.$selectGroups.each(function (i, el) {
|
3617 | var html = [];
|
3618 | var text = $.trim($(el).parent().text());
|
3619 | var group = $(el).parent().data('group');
|
3620 |
|
3621 | var $children = _this8.$drop.find(sprintf(_templateObject21(), s, s)(_this8.selectItemName, group));
|
3622 |
|
3623 | var $selected = $children.filter(':checked');
|
3624 |
|
3625 | if (!$selected.length) {
|
3626 | return;
|
3627 | }
|
3628 |
|
3629 | html.push('[');
|
3630 | html.push(text);
|
3631 |
|
3632 | if ($children.length > $selected.length) {
|
3633 | var list = [];
|
3634 | $selected.each(function (j, elem) {
|
3635 | list.push($(elem).parent().text());
|
3636 | });
|
3637 | html.push(": ".concat(list.join(', ')));
|
3638 | }
|
3639 |
|
3640 | html.push(']');
|
3641 | texts.push(html.join(''));
|
3642 | });
|
3643 | }
|
3644 |
|
3645 | return ['html', 'text'].includes(type) ? texts : values;
|
3646 | }
|
3647 | }, {
|
3648 | key: "setSelects",
|
3649 | value: function setSelects(values) {
|
3650 | var _this9 = this;
|
3651 |
|
3652 | this.$selectItems.prop('checked', false);
|
3653 | this.$disableItems.prop('checked', false);
|
3654 | $.each(values, function (i, value) {
|
3655 | _this9.$selectItems.filter(sprintf(_templateObject22(), s)(value)).prop('checked', true);
|
3656 |
|
3657 | _this9.$disableItems.filter(sprintf(_templateObject23(), s)(value)).prop('checked', true);
|
3658 | });
|
3659 | this.$selectAll.prop('checked', this.$selectItems.length === this.$selectItems.filter(':checked').length + this.$disableItems.filter(':checked').length);
|
3660 | $.each(this.$selectGroups, function (i, val) {
|
3661 | var group = $(val).parent()[0].getAttribute('data-group');
|
3662 |
|
3663 | var $children = _this9.$selectItems.filter("[data-group=\"".concat(group, "\"]"));
|
3664 |
|
3665 | $(val).prop('checked', $children.length && $children.length === $children.filter(':checked').length);
|
3666 | });
|
3667 | this.update(false);
|
3668 | }
|
3669 | }, {
|
3670 | key: "enable",
|
3671 | value: function enable() {
|
3672 | this.$choice.removeClass('disabled');
|
3673 | }
|
3674 | }, {
|
3675 | key: "disable",
|
3676 | value: function disable() {
|
3677 | this.$choice.addClass('disabled');
|
3678 | }
|
3679 | }, {
|
3680 | key: "check",
|
3681 | value: function check(value) {
|
3682 | if (this.options.single) {
|
3683 | this.$selectItems.prop('checked', false);
|
3684 | this.$disableItems.prop('checked', false);
|
3685 | }
|
3686 |
|
3687 | this._check(value, true);
|
3688 | }
|
3689 | }, {
|
3690 | key: "uncheck",
|
3691 | value: function uncheck(value) {
|
3692 | this._check(value, false);
|
3693 | }
|
3694 | }, {
|
3695 | key: "_check",
|
3696 | value: function _check(value, checked) {
|
3697 | this.$selectItems.filter(sprintf(_templateObject24(), s)(value)).prop('checked', checked);
|
3698 | this.$disableItems.filter(sprintf(_templateObject25(), s)(value)).prop('checked', checked);
|
3699 | this.update();
|
3700 | this.updateOptGroupSelect(true);
|
3701 | this.updateSelectAll(true, true);
|
3702 | }
|
3703 | }, {
|
3704 | key: "checkAll",
|
3705 | value: function checkAll() {
|
3706 | this._checkAll(true);
|
3707 |
|
3708 | this.options.onCheckAll();
|
3709 | }
|
3710 | }, {
|
3711 | key: "uncheckAll",
|
3712 | value: function uncheckAll() {
|
3713 | this._checkAll(false);
|
3714 |
|
3715 | this.options.onUncheckAll();
|
3716 | }
|
3717 | }, {
|
3718 | key: "_checkAll",
|
3719 | value: function _checkAll(checked) {
|
3720 | this.$selectItems.prop('checked', checked);
|
3721 | this.$selectGroups.prop('checked', checked);
|
3722 | this.$selectAll.prop('checked', checked);
|
3723 | this.update();
|
3724 | }
|
3725 | }, {
|
3726 | key: "checkInvert",
|
3727 | value: function checkInvert() {
|
3728 | if (this.options.single) {
|
3729 | return;
|
3730 | }
|
3731 |
|
3732 | this.$selectItems.each(function (i, el) {
|
3733 | $(el).prop('checked', !$(el).prop('checked'));
|
3734 | });
|
3735 | this.update();
|
3736 | this.updateOptGroupSelect(true);
|
3737 | this.updateSelectAll(true, true);
|
3738 | }
|
3739 | }, {
|
3740 | key: "focus",
|
3741 | value: function focus() {
|
3742 | this.$choice.focus();
|
3743 | this.options.onFocus();
|
3744 | }
|
3745 | }, {
|
3746 | key: "blur",
|
3747 | value: function blur() {
|
3748 | this.$choice.blur();
|
3749 | this.options.onBlur();
|
3750 | }
|
3751 | }, {
|
3752 | key: "refresh",
|
3753 | value: function refresh() {
|
3754 | this.destroy();
|
3755 | this.init();
|
3756 | }
|
3757 | }, {
|
3758 | key: "filter",
|
3759 | value: function filter() {
|
3760 | var _this10 = this;
|
3761 |
|
3762 | var originalText = $.trim(this.$searchInput.val());
|
3763 | var text = originalText.toLowerCase();
|
3764 |
|
3765 | if (text.length === 0) {
|
3766 | this.$selectAll.closest('li').show();
|
3767 | this.$selectItems.closest('li').show();
|
3768 | this.$disableItems.closest('li').show();
|
3769 | this.$selectGroups.closest('li').show();
|
3770 | this.$noResults.hide();
|
3771 | } else {
|
3772 | if (!this.options.filterGroup) {
|
3773 | this.$selectItems.each(function (i, el) {
|
3774 | var $parent = $(el).parent();
|
3775 |
|
3776 | var hasText = _this10.options.customFilter(removeDiacritics($parent.text().toLowerCase()), removeDiacritics(text), $parent.text(), originalText);
|
3777 |
|
3778 | $parent.closest('li')[hasText ? 'show' : 'hide']();
|
3779 | });
|
3780 | }
|
3781 |
|
3782 | this.$disableItems.closest('li').hide();
|
3783 | this.$selectGroups.each(function (i, el) {
|
3784 | var $parent = $(el).parent();
|
3785 | var group = $parent[0].getAttribute('data-group');
|
3786 |
|
3787 | if (_this10.options.filterGroup) {
|
3788 | var hasText = _this10.options.customFilter(removeDiacritics($parent.text().toLowerCase()), removeDiacritics(text), $parent.text(), originalText);
|
3789 |
|
3790 | var func = hasText ? 'show' : 'hide';
|
3791 | $parent.closest('li')[func]();
|
3792 |
|
3793 | _this10.$selectItems.filter("[data-group=\"".concat(group, "\"]")).closest('li')[func]();
|
3794 | } else {
|
3795 | var $items = _this10.$selectItems.filter(':visible');
|
3796 |
|
3797 | var _hasText = $items.filter(sprintf(_templateObject26(), s)(group)).length;
|
3798 | $parent.closest('li')[_hasText ? 'show' : 'hide']();
|
3799 | }
|
3800 | });
|
3801 |
|
3802 | if (this.$selectItems.closest('li').filter(':visible').length) {
|
3803 | this.$selectAll.closest('li').show();
|
3804 | this.$noResults.hide();
|
3805 | } else {
|
3806 | this.$selectAll.closest('li').hide();
|
3807 | this.$noResults.show();
|
3808 | }
|
3809 | }
|
3810 |
|
3811 | this.updateOptGroupSelect();
|
3812 | this.updateSelectAll();
|
3813 | this.options.onFilter(text);
|
3814 | }
|
3815 | }, {
|
3816 | key: "destroy",
|
3817 | value: function destroy() {
|
3818 | if (!this.$parent) {
|
3819 | return;
|
3820 | }
|
3821 |
|
3822 | this.$el.before(this.$parent).show();
|
3823 | this.$parent.remove();
|
3824 |
|
3825 | if (this.fromHtml) {
|
3826 | delete this.options.data;
|
3827 | this.fromHtml = false;
|
3828 | }
|
3829 | }
|
3830 | }]);
|
3831 |
|
3832 | return MultipleSelect;
|
3833 | }();
|
3834 |
|
3835 | $.fn.multipleSelect = function (option) {
|
3836 | for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
3837 | args[_key - 1] = arguments[_key];
|
3838 | }
|
3839 |
|
3840 | var value;
|
3841 | this.each(function (i, el) {
|
3842 | var $this = $(el);
|
3843 | var data = $this.data('multipleSelect');
|
3844 | var options = $.extend({}, $this.data(), _typeof(option) === 'object' && option);
|
3845 |
|
3846 | if (!data) {
|
3847 | data = new MultipleSelect($this, options);
|
3848 | $this.data('multipleSelect', data);
|
3849 | }
|
3850 |
|
3851 | if (typeof option === 'string') {
|
3852 | var _data;
|
3853 |
|
3854 | if ($.inArray(option, Constants.METHODS) < 0) {
|
3855 | throw new Error("Unknown method: ".concat(option));
|
3856 | }
|
3857 |
|
3858 | value = (_data = data)[option].apply(_data, args);
|
3859 |
|
3860 | if (option === 'destroy') {
|
3861 | $this.removeData('multipleSelect');
|
3862 | }
|
3863 | } else {
|
3864 | data.init();
|
3865 | }
|
3866 | });
|
3867 | return typeof value !== 'undefined' ? value : this;
|
3868 | };
|
3869 |
|
3870 | $.fn.multipleSelect.defaults = Constants.DEFAULTS;
|
3871 | $.fn.multipleSelect.locales = Constants.LOCALES;
|
3872 | $.fn.multipleSelect.methods = Constants.METHODS;
|
3873 |
|
3874 | }));
|