bootstrap-table-accent-neutralise.js 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690
  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. $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
  7. var aFunction = function (it) {
  8. if (typeof it != 'function') {
  9. throw TypeError(String(it) + ' is not a function');
  10. } return it;
  11. };
  12. // optional / simple context binding
  13. var bindContext = function (fn, that, length) {
  14. aFunction(fn);
  15. if (that === undefined) return fn;
  16. switch (length) {
  17. case 0: return function () {
  18. return fn.call(that);
  19. };
  20. case 1: return function (a) {
  21. return fn.call(that, a);
  22. };
  23. case 2: return function (a, b) {
  24. return fn.call(that, a, b);
  25. };
  26. case 3: return function (a, b, c) {
  27. return fn.call(that, a, b, c);
  28. };
  29. }
  30. return function (/* ...args */) {
  31. return fn.apply(that, arguments);
  32. };
  33. };
  34. var fails = function (exec) {
  35. try {
  36. return !!exec();
  37. } catch (e) {
  38. return true;
  39. }
  40. };
  41. var toString = {}.toString;
  42. var classofRaw = function (it) {
  43. return toString.call(it).slice(8, -1);
  44. };
  45. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  46. var split = ''.split;
  47. var indexedObject = fails(function () {
  48. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  49. // eslint-disable-next-line no-prototype-builtins
  50. return !Object('z').propertyIsEnumerable(0);
  51. }) ? function (it) {
  52. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  53. } : Object;
  54. // `RequireObjectCoercible` abstract operation
  55. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  56. var requireObjectCoercible = function (it) {
  57. if (it == undefined) throw TypeError("Can't call method on " + it);
  58. return it;
  59. };
  60. // `ToObject` abstract operation
  61. // https://tc39.github.io/ecma262/#sec-toobject
  62. var toObject = function (argument) {
  63. return Object(requireObjectCoercible(argument));
  64. };
  65. var ceil = Math.ceil;
  66. var floor = Math.floor;
  67. // `ToInteger` abstract operation
  68. // https://tc39.github.io/ecma262/#sec-tointeger
  69. var toInteger = function (argument) {
  70. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  71. };
  72. var min = Math.min;
  73. // `ToLength` abstract operation
  74. // https://tc39.github.io/ecma262/#sec-tolength
  75. var toLength = function (argument) {
  76. return argument > 0 ? min(toInteger(argument), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  77. };
  78. var isObject = function (it) {
  79. return typeof it === 'object' ? it !== null : typeof it === 'function';
  80. };
  81. // `IsArray` abstract operation
  82. // https://tc39.github.io/ecma262/#sec-isarray
  83. var isArray = Array.isArray || function isArray(arg) {
  84. return classofRaw(arg) == 'Array';
  85. };
  86. function createCommonjsModule(fn, module) {
  87. return module = { exports: {} }, fn(module, module.exports), module.exports;
  88. }
  89. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  90. var global = typeof window == 'object' && window && window.Math == Math ? window
  91. : typeof self == 'object' && self && self.Math == Math ? self
  92. // eslint-disable-next-line no-new-func
  93. : Function('return this')();
  94. // Thank's IE8 for his funny defineProperty
  95. var descriptors = !fails(function () {
  96. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  97. });
  98. var document = global.document;
  99. // typeof document.createElement is 'object' in old IE
  100. var exist = isObject(document) && isObject(document.createElement);
  101. var documentCreateElement = function (it) {
  102. return exist ? document.createElement(it) : {};
  103. };
  104. // Thank's IE8 for his funny defineProperty
  105. var ie8DomDefine = !descriptors && !fails(function () {
  106. return Object.defineProperty(documentCreateElement('div'), 'a', {
  107. get: function () { return 7; }
  108. }).a != 7;
  109. });
  110. var anObject = function (it) {
  111. if (!isObject(it)) {
  112. throw TypeError(String(it) + ' is not an object');
  113. } return it;
  114. };
  115. // 7.1.1 ToPrimitive(input [, PreferredType])
  116. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  117. // and the second argument - flag - preferred type is a string
  118. var toPrimitive = function (it, S) {
  119. if (!isObject(it)) return it;
  120. var fn, val;
  121. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  122. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  123. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  124. throw TypeError("Can't convert object to primitive value");
  125. };
  126. var nativeDefineProperty = Object.defineProperty;
  127. var f = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  128. anObject(O);
  129. P = toPrimitive(P, true);
  130. anObject(Attributes);
  131. if (ie8DomDefine) try {
  132. return nativeDefineProperty(O, P, Attributes);
  133. } catch (e) { /* empty */ }
  134. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  135. if ('value' in Attributes) O[P] = Attributes.value;
  136. return O;
  137. };
  138. var objectDefineProperty = {
  139. f: f
  140. };
  141. var createPropertyDescriptor = function (bitmap, value) {
  142. return {
  143. enumerable: !(bitmap & 1),
  144. configurable: !(bitmap & 2),
  145. writable: !(bitmap & 4),
  146. value: value
  147. };
  148. };
  149. var hide = descriptors ? function (object, key, value) {
  150. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  151. } : function (object, key, value) {
  152. object[key] = value;
  153. return object;
  154. };
  155. var setGlobal = function (key, value) {
  156. try {
  157. hide(global, key, value);
  158. } catch (e) {
  159. global[key] = value;
  160. } return value;
  161. };
  162. var shared = createCommonjsModule(function (module) {
  163. var SHARED = '__core-js_shared__';
  164. var store = global[SHARED] || setGlobal(SHARED, {});
  165. (module.exports = function (key, value) {
  166. return store[key] || (store[key] = value !== undefined ? value : {});
  167. })('versions', []).push({
  168. version: '3.0.0',
  169. mode: 'global',
  170. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  171. });
  172. });
  173. var id = 0;
  174. var postfix = Math.random();
  175. var uid = function (key) {
  176. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + postfix).toString(36));
  177. };
  178. // Chrome 38 Symbol has incorrect toString conversion
  179. var nativeSymbol = !fails(function () {
  180. });
  181. var store = shared('wks');
  182. var Symbol$1 = global.Symbol;
  183. var wellKnownSymbol = function (name) {
  184. return store[name] || (store[name] = nativeSymbol && Symbol$1[name]
  185. || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
  186. };
  187. var SPECIES = wellKnownSymbol('species');
  188. // `ArraySpeciesCreate` abstract operation
  189. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  190. var arraySpeciesCreate = function (originalArray, length) {
  191. var C;
  192. if (isArray(originalArray)) {
  193. C = originalArray.constructor;
  194. // cross-realm fallback
  195. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  196. else if (isObject(C)) {
  197. C = C[SPECIES];
  198. if (C === null) C = undefined;
  199. }
  200. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  201. };
  202. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
  203. // 0 -> Array#forEach
  204. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  205. // 1 -> Array#map
  206. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  207. // 2 -> Array#filter
  208. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  209. // 3 -> Array#some
  210. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  211. // 4 -> Array#every
  212. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  213. // 5 -> Array#find
  214. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  215. // 6 -> Array#findIndex
  216. // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
  217. var arrayMethods = function (TYPE, specificCreate) {
  218. var IS_MAP = TYPE == 1;
  219. var IS_FILTER = TYPE == 2;
  220. var IS_SOME = TYPE == 3;
  221. var IS_EVERY = TYPE == 4;
  222. var IS_FIND_INDEX = TYPE == 6;
  223. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  224. var create = specificCreate || arraySpeciesCreate;
  225. return function ($this, callbackfn, that) {
  226. var O = toObject($this);
  227. var self = indexedObject(O);
  228. var boundFunction = bindContext(callbackfn, that, 3);
  229. var length = toLength(self.length);
  230. var index = 0;
  231. var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  232. var value, result;
  233. for (;length > index; index++) if (NO_HOLES || index in self) {
  234. value = self[index];
  235. result = boundFunction(value, index, O);
  236. if (TYPE) {
  237. if (IS_MAP) target[index] = result; // map
  238. else if (result) switch (TYPE) {
  239. case 3: return true; // some
  240. case 5: return value; // find
  241. case 6: return index; // findIndex
  242. case 2: target.push(value); // filter
  243. } else if (IS_EVERY) return false; // every
  244. }
  245. }
  246. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  247. };
  248. };
  249. var SPECIES$1 = wellKnownSymbol('species');
  250. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  251. return !fails(function () {
  252. var array = [];
  253. var constructor = array.constructor = {};
  254. constructor[SPECIES$1] = function () {
  255. return { foo: 1 };
  256. };
  257. return array[METHOD_NAME](Boolean).foo !== 1;
  258. });
  259. };
  260. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  261. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  262. // Nashorn ~ JDK8 bug
  263. var NASHORN_BUG = nativeGetOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  264. var f$1 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  265. var descriptor = nativeGetOwnPropertyDescriptor(this, V);
  266. return !!descriptor && descriptor.enumerable;
  267. } : nativePropertyIsEnumerable;
  268. var objectPropertyIsEnumerable = {
  269. f: f$1
  270. };
  271. // toObject with fallback for non-array-like ES3 strings
  272. var toIndexedObject = function (it) {
  273. return indexedObject(requireObjectCoercible(it));
  274. };
  275. var hasOwnProperty = {}.hasOwnProperty;
  276. var has = function (it, key) {
  277. return hasOwnProperty.call(it, key);
  278. };
  279. var nativeGetOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  280. var f$2 = descriptors ? nativeGetOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  281. O = toIndexedObject(O);
  282. P = toPrimitive(P, true);
  283. if (ie8DomDefine) try {
  284. return nativeGetOwnPropertyDescriptor$1(O, P);
  285. } catch (e) { /* empty */ }
  286. if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  287. };
  288. var objectGetOwnPropertyDescriptor = {
  289. f: f$2
  290. };
  291. var functionToString = shared('native-function-to-string', Function.toString);
  292. var WeakMap = global.WeakMap;
  293. var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap));
  294. var shared$1 = shared('keys');
  295. var sharedKey = function (key) {
  296. return shared$1[key] || (shared$1[key] = uid(key));
  297. };
  298. var hiddenKeys = {};
  299. var WeakMap$1 = global.WeakMap;
  300. var set, get, has$1;
  301. var enforce = function (it) {
  302. return has$1(it) ? get(it) : set(it, {});
  303. };
  304. var getterFor = function (TYPE) {
  305. return function (it) {
  306. var state;
  307. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  308. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  309. } return state;
  310. };
  311. };
  312. if (nativeWeakMap) {
  313. var store$1 = new WeakMap$1();
  314. var wmget = store$1.get;
  315. var wmhas = store$1.has;
  316. var wmset = store$1.set;
  317. set = function (it, metadata) {
  318. wmset.call(store$1, it, metadata);
  319. return metadata;
  320. };
  321. get = function (it) {
  322. return wmget.call(store$1, it) || {};
  323. };
  324. has$1 = function (it) {
  325. return wmhas.call(store$1, it);
  326. };
  327. } else {
  328. var STATE = sharedKey('state');
  329. hiddenKeys[STATE] = true;
  330. set = function (it, metadata) {
  331. hide(it, STATE, metadata);
  332. return metadata;
  333. };
  334. get = function (it) {
  335. return has(it, STATE) ? it[STATE] : {};
  336. };
  337. has$1 = function (it) {
  338. return has(it, STATE);
  339. };
  340. }
  341. var internalState = {
  342. set: set,
  343. get: get,
  344. has: has$1,
  345. enforce: enforce,
  346. getterFor: getterFor
  347. };
  348. var redefine = createCommonjsModule(function (module) {
  349. var getInternalState = internalState.get;
  350. var enforceInternalState = internalState.enforce;
  351. var TEMPLATE = String(functionToString).split('toString');
  352. shared('inspectSource', function (it) {
  353. return functionToString.call(it);
  354. });
  355. (module.exports = function (O, key, value, options) {
  356. var unsafe = options ? !!options.unsafe : false;
  357. var simple = options ? !!options.enumerable : false;
  358. var noTargetGet = options ? !!options.noTargetGet : false;
  359. if (typeof value == 'function') {
  360. if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key);
  361. enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
  362. }
  363. if (O === global) {
  364. if (simple) O[key] = value;
  365. else setGlobal(key, value);
  366. return;
  367. } else if (!unsafe) {
  368. delete O[key];
  369. } else if (!noTargetGet && O[key]) {
  370. simple = true;
  371. }
  372. if (simple) O[key] = value;
  373. else hide(O, key, value);
  374. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  375. })(Function.prototype, 'toString', function toString() {
  376. return typeof this == 'function' && getInternalState(this).source || functionToString.call(this);
  377. });
  378. });
  379. var max = Math.max;
  380. var min$1 = Math.min;
  381. // Helper for a popular repeating case of the spec:
  382. // Let integer be ? ToInteger(index).
  383. // If integer < 0, let result be max((length + integer), 0); else let result be min(length, length).
  384. var toAbsoluteIndex = function (index, length) {
  385. var integer = toInteger(index);
  386. return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
  387. };
  388. // `Array.prototype.{ indexOf, includes }` methods implementation
  389. // false -> Array#indexOf
  390. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  391. // true -> Array#includes
  392. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  393. var arrayIncludes = function (IS_INCLUDES) {
  394. return function ($this, el, fromIndex) {
  395. var O = toIndexedObject($this);
  396. var length = toLength(O.length);
  397. var index = toAbsoluteIndex(fromIndex, length);
  398. var value;
  399. // Array#includes uses SameValueZero equality algorithm
  400. // eslint-disable-next-line no-self-compare
  401. if (IS_INCLUDES && el != el) while (length > index) {
  402. value = O[index++];
  403. // eslint-disable-next-line no-self-compare
  404. if (value != value) return true;
  405. // Array#indexOf ignores holes, Array#includes - not
  406. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  407. if (O[index] === el) return IS_INCLUDES || index || 0;
  408. } return !IS_INCLUDES && -1;
  409. };
  410. };
  411. var arrayIndexOf = arrayIncludes(false);
  412. var objectKeysInternal = function (object, names) {
  413. var O = toIndexedObject(object);
  414. var i = 0;
  415. var result = [];
  416. var key;
  417. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  418. // Don't enum bug & hidden keys
  419. while (names.length > i) if (has(O, key = names[i++])) {
  420. ~arrayIndexOf(result, key) || result.push(key);
  421. }
  422. return result;
  423. };
  424. // IE8- don't enum bug keys
  425. var enumBugKeys = [
  426. 'constructor',
  427. 'hasOwnProperty',
  428. 'isPrototypeOf',
  429. 'propertyIsEnumerable',
  430. 'toLocaleString',
  431. 'toString',
  432. 'valueOf'
  433. ];
  434. // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
  435. var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
  436. var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  437. return objectKeysInternal(O, hiddenKeys$1);
  438. };
  439. var objectGetOwnPropertyNames = {
  440. f: f$3
  441. };
  442. var f$4 = Object.getOwnPropertySymbols;
  443. var objectGetOwnPropertySymbols = {
  444. f: f$4
  445. };
  446. var Reflect$1 = global.Reflect;
  447. // all object keys, includes non-enumerable and symbols
  448. var ownKeys = Reflect$1 && Reflect$1.ownKeys || function ownKeys(it) {
  449. var keys = objectGetOwnPropertyNames.f(anObject(it));
  450. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  451. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  452. };
  453. var copyConstructorProperties = function (target, source) {
  454. var keys = ownKeys(source);
  455. var defineProperty = objectDefineProperty.f;
  456. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  457. for (var i = 0; i < keys.length; i++) {
  458. var key = keys[i];
  459. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  460. }
  461. };
  462. var replacement = /#|\.prototype\./;
  463. var isForced = function (feature, detection) {
  464. var value = data[normalize(feature)];
  465. return value == POLYFILL ? true
  466. : value == NATIVE ? false
  467. : typeof detection == 'function' ? fails(detection)
  468. : !!detection;
  469. };
  470. var normalize = isForced.normalize = function (string) {
  471. return String(string).replace(replacement, '.').toLowerCase();
  472. };
  473. var data = isForced.data = {};
  474. var NATIVE = isForced.NATIVE = 'N';
  475. var POLYFILL = isForced.POLYFILL = 'P';
  476. var isForced_1 = isForced;
  477. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  478. /*
  479. options.target - name of the target object
  480. options.global - target is the global object
  481. options.stat - export as static methods of target
  482. options.proto - export as prototype methods of target
  483. options.real - real prototype method for the `pure` version
  484. options.forced - export even if the native feature is available
  485. options.bind - bind methods to the target, required for the `pure` version
  486. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  487. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  488. options.sham - add a flag to not completely full polyfills
  489. options.enumerable - export as enumerable property
  490. options.noTargetGet - prevent calling a getter on target
  491. */
  492. var _export = function (options, source) {
  493. var TARGET = options.target;
  494. var GLOBAL = options.global;
  495. var STATIC = options.stat;
  496. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  497. if (GLOBAL) {
  498. target = global;
  499. } else if (STATIC) {
  500. target = global[TARGET] || setGlobal(TARGET, {});
  501. } else {
  502. target = (global[TARGET] || {}).prototype;
  503. }
  504. if (target) for (key in source) {
  505. sourceProperty = source[key];
  506. if (options.noTargetGet) {
  507. descriptor = getOwnPropertyDescriptor(target, key);
  508. targetProperty = descriptor && descriptor.value;
  509. } else targetProperty = target[key];
  510. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  511. // contained in target
  512. if (!FORCED && targetProperty !== undefined) {
  513. if (typeof sourceProperty === typeof targetProperty) continue;
  514. copyConstructorProperties(sourceProperty, targetProperty);
  515. }
  516. // add a flag to not completely full polyfills
  517. if (options.sham || (targetProperty && targetProperty.sham)) {
  518. hide(sourceProperty, 'sham', true);
  519. }
  520. // extend global
  521. redefine(target, key, sourceProperty, options);
  522. }
  523. };
  524. var internalFilter = arrayMethods(2);
  525. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  526. // `Array.prototype.filter` method
  527. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  528. // with adding support of @@species
  529. _export({ target: 'Array', proto: true, forced: !SPECIES_SUPPORT }, {
  530. filter: function filter(callbackfn /* , thisArg */) {
  531. return internalFilter(this, callbackfn, arguments[1]);
  532. }
  533. });
  534. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  535. var objectKeys = Object.keys || function keys(O) {
  536. return objectKeysInternal(O, enumBugKeys);
  537. };
  538. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  539. anObject(O);
  540. var keys = objectKeys(Properties);
  541. var length = keys.length;
  542. var i = 0;
  543. var key;
  544. while (length > i) objectDefineProperty.f(O, key = keys[i++], Properties[key]);
  545. return O;
  546. };
  547. var document$1 = global.document;
  548. var html = document$1 && document$1.documentElement;
  549. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  550. var IE_PROTO = sharedKey('IE_PROTO');
  551. var PROTOTYPE = 'prototype';
  552. var Empty = function () { /* empty */ };
  553. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  554. var createDict = function () {
  555. // Thrash, waste and sodomy: IE GC bug
  556. var iframe = documentCreateElement('iframe');
  557. var length = enumBugKeys.length;
  558. var lt = '<';
  559. var script = 'script';
  560. var gt = '>';
  561. var js = 'java' + script + ':';
  562. var iframeDocument;
  563. iframe.style.display = 'none';
  564. html.appendChild(iframe);
  565. iframe.src = String(js);
  566. iframeDocument = iframe.contentWindow.document;
  567. iframeDocument.open();
  568. iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
  569. iframeDocument.close();
  570. createDict = iframeDocument.F;
  571. while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
  572. return createDict();
  573. };
  574. var objectCreate = Object.create || function create(O, Properties) {
  575. var result;
  576. if (O !== null) {
  577. Empty[PROTOTYPE] = anObject(O);
  578. result = new Empty();
  579. Empty[PROTOTYPE] = null;
  580. // add "__proto__" for Object.getPrototypeOf polyfill
  581. result[IE_PROTO] = O;
  582. } else result = createDict();
  583. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  584. };
  585. hiddenKeys[IE_PROTO] = true;
  586. var UNSCOPABLES = wellKnownSymbol('unscopables');
  587. var ArrayPrototype = Array.prototype;
  588. // Array.prototype[@@unscopables]
  589. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  590. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  591. hide(ArrayPrototype, UNSCOPABLES, objectCreate(null));
  592. }
  593. // add a key to Array.prototype[@@unscopables]
  594. var addToUnscopables = function (key) {
  595. ArrayPrototype[UNSCOPABLES][key] = true;
  596. };
  597. var internalIncludes = arrayIncludes(true);
  598. // `Array.prototype.includes` method
  599. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  600. _export({ target: 'Array', proto: true }, {
  601. includes: function includes(el /* , fromIndex = 0 */) {
  602. return internalIncludes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  603. }
  604. });
  605. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  606. addToUnscopables('includes');
  607. var sloppyArrayMethod = function (METHOD_NAME, argument) {
  608. var method = [][METHOD_NAME];
  609. return !method || !fails(function () {
  610. // eslint-disable-next-line no-useless-call
  611. method.call(null, argument || function () { throw Error(); }, 1);
  612. });
  613. };
  614. var internalIndexOf = arrayIncludes(false);
  615. var nativeIndexOf = [].indexOf;
  616. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
  617. var SLOPPY_METHOD = sloppyArrayMethod('indexOf');
  618. // `Array.prototype.indexOf` method
  619. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  620. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || SLOPPY_METHOD }, {
  621. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  622. return NEGATIVE_ZERO
  623. // convert -0 to +0
  624. ? nativeIndexOf.apply(this, arguments) || 0
  625. : internalIndexOf(this, searchElement, arguments[1]);
  626. }
  627. });
  628. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  629. // TO_ENTRIES: true -> Object.entries
  630. // TO_ENTRIES: false -> Object.values
  631. var objectToArray = function (it, TO_ENTRIES) {
  632. var O = toIndexedObject(it);
  633. var keys = objectKeys(O);
  634. var length = keys.length;
  635. var i = 0;
  636. var result = [];
  637. var key;
  638. while (length > i) if (propertyIsEnumerable.call(O, key = keys[i++])) {
  639. result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
  640. } return result;
  641. };
  642. // `Object.entries` method
  643. // https://tc39.github.io/ecma262/#sec-object.entries
  644. _export({ target: 'Object', stat: true }, {
  645. entries: function entries(O) {
  646. return objectToArray(O, true);
  647. }
  648. });
  649. // a string of all valid unicode whitespaces
  650. // eslint-disable-next-line max-len
  651. var whitespaces = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  652. var whitespace = '[' + whitespaces + ']';
  653. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  654. var rtrim = RegExp(whitespace + whitespace + '*$');
  655. // 1 -> String#trimStart
  656. // 2 -> String#trimEnd
  657. // 3 -> String#trim
  658. var stringTrim = function (string, TYPE) {
  659. string = String(requireObjectCoercible(string));
  660. if (TYPE & 1) string = string.replace(ltrim, '');
  661. if (TYPE & 2) string = string.replace(rtrim, '');
  662. return string;
  663. };
  664. var nativeParseInt = global.parseInt;
  665. var hex = /^[-+]?0[xX]/;
  666. var FORCED = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22;
  667. var _parseInt = FORCED ? function parseInt(str, radix) {
  668. var string = stringTrim(String(str), 3);
  669. return nativeParseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
  670. } : nativeParseInt;
  671. // `parseInt` method
  672. // https://tc39.github.io/ecma262/#sec-parseint-string-radix
  673. _export({ global: true, forced: parseInt != _parseInt }, {
  674. parseInt: _parseInt
  675. });
  676. var MATCH = wellKnownSymbol('match');
  677. // `IsRegExp` abstract operation
  678. // https://tc39.github.io/ecma262/#sec-isregexp
  679. var isRegexp = function (it) {
  680. var isRegExp;
  681. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  682. };
  683. // helper for String#{startsWith, endsWith, includes}
  684. var validateStringMethodArguments = function (that, searchString, NAME) {
  685. if (isRegexp(searchString)) {
  686. throw TypeError('String.prototype.' + NAME + " doesn't accept regex");
  687. } return String(requireObjectCoercible(that));
  688. };
  689. var MATCH$1 = wellKnownSymbol('match');
  690. var correctIsRegexpLogic = function (METHOD_NAME) {
  691. var regexp = /./;
  692. try {
  693. '/./'[METHOD_NAME](regexp);
  694. } catch (e) {
  695. try {
  696. regexp[MATCH$1] = false;
  697. return '/./'[METHOD_NAME](regexp);
  698. } catch (f) { /* empty */ }
  699. } return false;
  700. };
  701. var INCLUDES = 'includes';
  702. var CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic(INCLUDES);
  703. // `String.prototype.includes` method
  704. // https://tc39.github.io/ecma262/#sec-string.prototype.includes
  705. _export({ target: 'String', proto: true, forced: !CORRECT_IS_REGEXP_LOGIC }, {
  706. includes: function includes(searchString /* , position = 0 */) {
  707. return !!~validateStringMethodArguments(this, searchString, INCLUDES)
  708. .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
  709. }
  710. });
  711. // CONVERT_TO_STRING: true -> String#at
  712. // CONVERT_TO_STRING: false -> String#codePointAt
  713. var stringAt = function (that, pos, CONVERT_TO_STRING) {
  714. var S = String(requireObjectCoercible(that));
  715. var position = toInteger(pos);
  716. var size = S.length;
  717. var first, second;
  718. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  719. first = S.charCodeAt(position);
  720. return first < 0xd800 || first > 0xdbff || position + 1 === size
  721. || (second = S.charCodeAt(position + 1)) < 0xdc00 || second > 0xdfff
  722. ? CONVERT_TO_STRING ? S.charAt(position) : first
  723. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xd800 << 10) + (second - 0xdc00) + 0x10000;
  724. };
  725. // `AdvanceStringIndex` abstract operation
  726. // https://tc39.github.io/ecma262/#sec-advancestringindex
  727. var advanceStringIndex = function (S, index, unicode) {
  728. return index + (unicode ? stringAt(S, index, true).length : 1);
  729. };
  730. // `RegExp.prototype.flags` getter implementation
  731. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  732. var regexpFlags = function () {
  733. var that = anObject(this);
  734. var result = '';
  735. if (that.global) result += 'g';
  736. if (that.ignoreCase) result += 'i';
  737. if (that.multiline) result += 'm';
  738. if (that.unicode) result += 'u';
  739. if (that.sticky) result += 'y';
  740. return result;
  741. };
  742. var nativeExec = RegExp.prototype.exec;
  743. // This always refers to the native implementation, because the
  744. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  745. // which loads this file before patching the method.
  746. var nativeReplace = String.prototype.replace;
  747. var patchedExec = nativeExec;
  748. var UPDATES_LAST_INDEX_WRONG = (function () {
  749. var re1 = /a/;
  750. var re2 = /b*/g;
  751. nativeExec.call(re1, 'a');
  752. nativeExec.call(re2, 'a');
  753. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  754. })();
  755. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  756. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  757. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
  758. if (PATCH) {
  759. patchedExec = function exec(str) {
  760. var re = this;
  761. var lastIndex, reCopy, match, i;
  762. if (NPCG_INCLUDED) {
  763. reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
  764. }
  765. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  766. match = nativeExec.call(re, str);
  767. if (UPDATES_LAST_INDEX_WRONG && match) {
  768. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  769. }
  770. if (NPCG_INCLUDED && match && match.length > 1) {
  771. // Fix browsers whose `exec` methods don't consistently return `undefined`
  772. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  773. nativeReplace.call(match[0], reCopy, function () {
  774. for (i = 1; i < arguments.length - 2; i++) {
  775. if (arguments[i] === undefined) match[i] = undefined;
  776. }
  777. });
  778. }
  779. return match;
  780. };
  781. }
  782. var regexpExec = patchedExec;
  783. // `RegExpExec` abstract operation
  784. // https://tc39.github.io/ecma262/#sec-regexpexec
  785. var regexpExecAbstract = function (R, S) {
  786. var exec = R.exec;
  787. if (typeof exec === 'function') {
  788. var result = exec.call(R, S);
  789. if (typeof result !== 'object') {
  790. throw TypeError('RegExp exec method returned something other than an Object or null');
  791. }
  792. return result;
  793. }
  794. if (classofRaw(R) !== 'RegExp') {
  795. throw TypeError('RegExp#exec called on incompatible receiver');
  796. }
  797. return regexpExec.call(R, S);
  798. };
  799. var SPECIES$2 = wellKnownSymbol('species');
  800. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  801. // #replace needs built-in support for named groups.
  802. // #match works fine because it just return the exec results, even if it has
  803. // a "grops" property.
  804. var re = /./;
  805. re.exec = function () {
  806. var result = [];
  807. result.groups = { a: '7' };
  808. return result;
  809. };
  810. return ''.replace(re, '$<a>') !== '7';
  811. });
  812. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  813. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  814. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  815. var re = /(?:)/;
  816. var originalExec = re.exec;
  817. re.exec = function () { return originalExec.apply(this, arguments); };
  818. var result = 'ab'.split(re);
  819. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  820. });
  821. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  822. var SYMBOL = wellKnownSymbol(KEY);
  823. var DELEGATES_TO_SYMBOL = !fails(function () {
  824. // String methods call symbol-named RegEp methods
  825. var O = {};
  826. O[SYMBOL] = function () { return 7; };
  827. return ''[KEY](O) != 7;
  828. });
  829. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  830. // Symbol-named RegExp methods call .exec
  831. var execCalled = false;
  832. var re = /a/;
  833. re.exec = function () { execCalled = true; return null; };
  834. if (KEY === 'split') {
  835. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  836. // a new one. We need to return the patched regex when creating the new one.
  837. re.constructor = {};
  838. re.constructor[SPECIES$2] = function () { return re; };
  839. }
  840. re[SYMBOL]('');
  841. return !execCalled;
  842. });
  843. if (
  844. !DELEGATES_TO_SYMBOL ||
  845. !DELEGATES_TO_EXEC ||
  846. (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
  847. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  848. ) {
  849. var nativeRegExpMethod = /./[SYMBOL];
  850. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  851. if (regexp.exec === regexpExec) {
  852. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  853. // The native String method already delegates to @@method (this
  854. // polyfilled function), leasing to infinite recursion.
  855. // We avoid it by directly calling the native @@method method.
  856. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  857. }
  858. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  859. }
  860. return { done: false };
  861. });
  862. var stringMethod = methods[0];
  863. var regexMethod = methods[1];
  864. redefine(String.prototype, KEY, stringMethod);
  865. redefine(RegExp.prototype, SYMBOL, length == 2
  866. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  867. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  868. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  869. // 21.2.5.6 RegExp.prototype[@@match](string)
  870. // 21.2.5.9 RegExp.prototype[@@search](string)
  871. : function (string) { return regexMethod.call(string, this); }
  872. );
  873. if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
  874. }
  875. };
  876. var max$1 = Math.max;
  877. var min$2 = Math.min;
  878. var floor$1 = Math.floor;
  879. var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
  880. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
  881. var maybeToString = function (it) {
  882. return it === undefined ? it : String(it);
  883. };
  884. // @@replace logic
  885. fixRegexpWellKnownSymbolLogic(
  886. 'replace',
  887. 2,
  888. function (REPLACE, nativeReplace, maybeCallNative) {
  889. return [
  890. // `String.prototype.replace` method
  891. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  892. function replace(searchValue, replaceValue) {
  893. var O = requireObjectCoercible(this);
  894. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  895. return replacer !== undefined
  896. ? replacer.call(searchValue, O, replaceValue)
  897. : nativeReplace.call(String(O), searchValue, replaceValue);
  898. },
  899. // `RegExp.prototype[@@replace]` method
  900. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  901. function (regexp, replaceValue) {
  902. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  903. if (res.done) return res.value;
  904. var rx = anObject(regexp);
  905. var S = String(this);
  906. var functionalReplace = typeof replaceValue === 'function';
  907. if (!functionalReplace) replaceValue = String(replaceValue);
  908. var global = rx.global;
  909. if (global) {
  910. var fullUnicode = rx.unicode;
  911. rx.lastIndex = 0;
  912. }
  913. var results = [];
  914. while (true) {
  915. var result = regexpExecAbstract(rx, S);
  916. if (result === null) break;
  917. results.push(result);
  918. if (!global) break;
  919. var matchStr = String(result[0]);
  920. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  921. }
  922. var accumulatedResult = '';
  923. var nextSourcePosition = 0;
  924. for (var i = 0; i < results.length; i++) {
  925. result = results[i];
  926. var matched = String(result[0]);
  927. var position = max$1(min$2(toInteger(result.index), S.length), 0);
  928. var captures = [];
  929. // NOTE: This is equivalent to
  930. // captures = result.slice(1).map(maybeToString)
  931. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  932. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  933. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  934. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  935. var namedCaptures = result.groups;
  936. if (functionalReplace) {
  937. var replacerArgs = [matched].concat(captures, position, S);
  938. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  939. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  940. } else {
  941. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  942. }
  943. if (position >= nextSourcePosition) {
  944. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  945. nextSourcePosition = position + matched.length;
  946. }
  947. }
  948. return accumulatedResult + S.slice(nextSourcePosition);
  949. }
  950. ];
  951. // https://tc39.github.io/ecma262/#sec-getsubstitution
  952. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  953. var tailPos = position + matched.length;
  954. var m = captures.length;
  955. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  956. if (namedCaptures !== undefined) {
  957. namedCaptures = toObject(namedCaptures);
  958. symbols = SUBSTITUTION_SYMBOLS;
  959. }
  960. return nativeReplace.call(replacement, symbols, function (match, ch) {
  961. var capture;
  962. switch (ch.charAt(0)) {
  963. case '$': return '$';
  964. case '&': return matched;
  965. case '`': return str.slice(0, position);
  966. case "'": return str.slice(tailPos);
  967. case '<':
  968. capture = namedCaptures[ch.slice(1, -1)];
  969. break;
  970. default: // \d\d?
  971. var n = +ch;
  972. if (n === 0) return match;
  973. if (n > m) {
  974. var f = floor$1(n / 10);
  975. if (f === 0) return match;
  976. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  977. return match;
  978. }
  979. capture = captures[n - 1];
  980. }
  981. return capture === undefined ? '' : capture;
  982. });
  983. }
  984. }
  985. );
  986. function _classCallCheck(instance, Constructor) {
  987. if (!(instance instanceof Constructor)) {
  988. throw new TypeError("Cannot call a class as a function");
  989. }
  990. }
  991. function _defineProperties(target, props) {
  992. for (var i = 0; i < props.length; i++) {
  993. var descriptor = props[i];
  994. descriptor.enumerable = descriptor.enumerable || false;
  995. descriptor.configurable = true;
  996. if ("value" in descriptor) descriptor.writable = true;
  997. Object.defineProperty(target, descriptor.key, descriptor);
  998. }
  999. }
  1000. function _createClass(Constructor, protoProps, staticProps) {
  1001. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  1002. if (staticProps) _defineProperties(Constructor, staticProps);
  1003. return Constructor;
  1004. }
  1005. function _inherits(subClass, superClass) {
  1006. if (typeof superClass !== "function" && superClass !== null) {
  1007. throw new TypeError("Super expression must either be null or a function");
  1008. }
  1009. subClass.prototype = Object.create(superClass && superClass.prototype, {
  1010. constructor: {
  1011. value: subClass,
  1012. writable: true,
  1013. configurable: true
  1014. }
  1015. });
  1016. if (superClass) _setPrototypeOf(subClass, superClass);
  1017. }
  1018. function _getPrototypeOf(o) {
  1019. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  1020. return o.__proto__ || Object.getPrototypeOf(o);
  1021. };
  1022. return _getPrototypeOf(o);
  1023. }
  1024. function _setPrototypeOf(o, p) {
  1025. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  1026. o.__proto__ = p;
  1027. return o;
  1028. };
  1029. return _setPrototypeOf(o, p);
  1030. }
  1031. function _assertThisInitialized(self) {
  1032. if (self === void 0) {
  1033. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1034. }
  1035. return self;
  1036. }
  1037. function _possibleConstructorReturn(self, call) {
  1038. if (call && (typeof call === "object" || typeof call === "function")) {
  1039. return call;
  1040. }
  1041. return _assertThisInitialized(self);
  1042. }
  1043. function _superPropBase(object, property) {
  1044. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  1045. object = _getPrototypeOf(object);
  1046. if (object === null) break;
  1047. }
  1048. return object;
  1049. }
  1050. function _get(target, property, receiver) {
  1051. if (typeof Reflect !== "undefined" && Reflect.get) {
  1052. _get = Reflect.get;
  1053. } else {
  1054. _get = function _get(target, property, receiver) {
  1055. var base = _superPropBase(target, property);
  1056. if (!base) return;
  1057. var desc = Object.getOwnPropertyDescriptor(base, property);
  1058. if (desc.get) {
  1059. return desc.get.call(receiver);
  1060. }
  1061. return desc.value;
  1062. };
  1063. }
  1064. return _get(target, property, receiver || target);
  1065. }
  1066. function _slicedToArray(arr, i) {
  1067. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
  1068. }
  1069. function _arrayWithHoles(arr) {
  1070. if (Array.isArray(arr)) return arr;
  1071. }
  1072. function _iterableToArrayLimit(arr, i) {
  1073. var _arr = [];
  1074. var _n = true;
  1075. var _d = false;
  1076. var _e = undefined;
  1077. try {
  1078. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  1079. _arr.push(_s.value);
  1080. if (i && _arr.length === i) break;
  1081. }
  1082. } catch (err) {
  1083. _d = true;
  1084. _e = err;
  1085. } finally {
  1086. try {
  1087. if (!_n && _i["return"] != null) _i["return"]();
  1088. } finally {
  1089. if (_d) throw _e;
  1090. }
  1091. }
  1092. return _arr;
  1093. }
  1094. function _nonIterableRest() {
  1095. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  1096. }
  1097. /**
  1098. * @author: Dennis Hernández
  1099. * @webSite: http://djhvscf.github.io/Blog
  1100. * @update: zhixin wen <wenzhixin2010@gmail.com>
  1101. */
  1102. var diacriticsMap = {};
  1103. var defaultAccentsDiacritics = [{
  1104. base: 'A',
  1105. letters: "A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"
  1106. }, {
  1107. base: 'AA',
  1108. letters: "\uA732"
  1109. }, {
  1110. base: 'AE',
  1111. letters: "\xC6\u01FC\u01E2"
  1112. }, {
  1113. base: 'AO',
  1114. letters: "\uA734"
  1115. }, {
  1116. base: 'AU',
  1117. letters: "\uA736"
  1118. }, {
  1119. base: 'AV',
  1120. letters: "\uA738\uA73A"
  1121. }, {
  1122. base: 'AY',
  1123. letters: "\uA73C"
  1124. }, {
  1125. base: 'B',
  1126. letters: "B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"
  1127. }, {
  1128. base: 'C',
  1129. letters: "C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"
  1130. }, {
  1131. base: 'D',
  1132. letters: "D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"
  1133. }, {
  1134. base: 'DZ',
  1135. letters: "\u01F1\u01C4"
  1136. }, {
  1137. base: 'Dz',
  1138. letters: "\u01F2\u01C5"
  1139. }, {
  1140. base: 'E',
  1141. letters: "E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"
  1142. }, {
  1143. base: 'F',
  1144. letters: "F\u24BB\uFF26\u1E1E\u0191\uA77B"
  1145. }, {
  1146. base: 'G',
  1147. letters: "G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"
  1148. }, {
  1149. base: 'H',
  1150. letters: "H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"
  1151. }, {
  1152. base: 'I',
  1153. letters: "I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"
  1154. }, {
  1155. base: 'J',
  1156. letters: "J\u24BF\uFF2A\u0134\u0248"
  1157. }, {
  1158. base: 'K',
  1159. letters: "K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"
  1160. }, {
  1161. base: 'L',
  1162. letters: "L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"
  1163. }, {
  1164. base: 'LJ',
  1165. letters: "\u01C7"
  1166. }, {
  1167. base: 'Lj',
  1168. letters: "\u01C8"
  1169. }, {
  1170. base: 'M',
  1171. letters: "M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"
  1172. }, {
  1173. base: 'N',
  1174. letters: "N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"
  1175. }, {
  1176. base: 'NJ',
  1177. letters: "\u01CA"
  1178. }, {
  1179. base: 'Nj',
  1180. letters: "\u01CB"
  1181. }, {
  1182. base: 'O',
  1183. letters: "O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"
  1184. }, {
  1185. base: 'OI',
  1186. letters: "\u01A2"
  1187. }, {
  1188. base: 'OO',
  1189. letters: "\uA74E"
  1190. }, {
  1191. base: 'OU',
  1192. letters: "\u0222"
  1193. }, {
  1194. base: 'OE',
  1195. letters: "\x8C\u0152"
  1196. }, {
  1197. base: 'oe',
  1198. letters: "\x9C\u0153"
  1199. }, {
  1200. base: 'P',
  1201. letters: "P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"
  1202. }, {
  1203. base: 'Q',
  1204. letters: "Q\u24C6\uFF31\uA756\uA758\u024A"
  1205. }, {
  1206. base: 'R',
  1207. letters: "R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"
  1208. }, {
  1209. base: 'S',
  1210. letters: "S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"
  1211. }, {
  1212. base: 'T',
  1213. letters: "T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"
  1214. }, {
  1215. base: 'TZ',
  1216. letters: "\uA728"
  1217. }, {
  1218. base: 'U',
  1219. letters: "U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"
  1220. }, {
  1221. base: 'V',
  1222. letters: "V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"
  1223. }, {
  1224. base: 'VY',
  1225. letters: "\uA760"
  1226. }, {
  1227. base: 'W',
  1228. letters: "W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"
  1229. }, {
  1230. base: 'X',
  1231. letters: "X\u24CD\uFF38\u1E8A\u1E8C"
  1232. }, {
  1233. base: 'Y',
  1234. letters: "Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"
  1235. }, {
  1236. base: 'Z',
  1237. letters: "Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"
  1238. }, {
  1239. base: 'a',
  1240. letters: "a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"
  1241. }, {
  1242. base: 'aa',
  1243. letters: "\uA733"
  1244. }, {
  1245. base: 'ae',
  1246. letters: "\xE6\u01FD\u01E3"
  1247. }, {
  1248. base: 'ao',
  1249. letters: "\uA735"
  1250. }, {
  1251. base: 'au',
  1252. letters: "\uA737"
  1253. }, {
  1254. base: 'av',
  1255. letters: "\uA739\uA73B"
  1256. }, {
  1257. base: 'ay',
  1258. letters: "\uA73D"
  1259. }, {
  1260. base: 'b',
  1261. letters: "b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"
  1262. }, {
  1263. base: 'c',
  1264. letters: "c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"
  1265. }, {
  1266. base: 'd',
  1267. letters: "d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"
  1268. }, {
  1269. base: 'dz',
  1270. letters: "\u01F3\u01C6"
  1271. }, {
  1272. base: 'e',
  1273. letters: "e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"
  1274. }, {
  1275. base: 'f',
  1276. letters: "f\u24D5\uFF46\u1E1F\u0192\uA77C"
  1277. }, {
  1278. base: 'g',
  1279. letters: "g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"
  1280. }, {
  1281. base: 'h',
  1282. letters: "h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"
  1283. }, {
  1284. base: 'hv',
  1285. letters: "\u0195"
  1286. }, {
  1287. base: 'i',
  1288. letters: "i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"
  1289. }, {
  1290. base: 'j',
  1291. letters: "j\u24D9\uFF4A\u0135\u01F0\u0249"
  1292. }, {
  1293. base: 'k',
  1294. letters: "k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"
  1295. }, {
  1296. base: 'l',
  1297. letters: "l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"
  1298. }, {
  1299. base: 'lj',
  1300. letters: "\u01C9"
  1301. }, {
  1302. base: 'm',
  1303. letters: "m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"
  1304. }, {
  1305. base: 'n',
  1306. letters: "n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"
  1307. }, {
  1308. base: 'nj',
  1309. letters: "\u01CC"
  1310. }, {
  1311. base: 'o',
  1312. letters: "o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"
  1313. }, {
  1314. base: 'oi',
  1315. letters: "\u01A3"
  1316. }, {
  1317. base: 'ou',
  1318. letters: "\u0223"
  1319. }, {
  1320. base: 'oo',
  1321. letters: "\uA74F"
  1322. }, {
  1323. base: 'p',
  1324. letters: "p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"
  1325. }, {
  1326. base: 'q',
  1327. letters: "q\u24E0\uFF51\u024B\uA757\uA759"
  1328. }, {
  1329. base: 'r',
  1330. letters: "r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"
  1331. }, {
  1332. base: 's',
  1333. letters: "s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"
  1334. }, {
  1335. base: 't',
  1336. letters: "t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"
  1337. }, {
  1338. base: 'tz',
  1339. letters: "\uA729"
  1340. }, {
  1341. base: 'u',
  1342. letters: "u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"
  1343. }, {
  1344. base: 'v',
  1345. letters: "v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"
  1346. }, {
  1347. base: 'vy',
  1348. letters: "\uA761"
  1349. }, {
  1350. base: 'w',
  1351. letters: "w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"
  1352. }, {
  1353. base: 'x',
  1354. letters: "x\u24E7\uFF58\u1E8B\u1E8D"
  1355. }, {
  1356. base: 'y',
  1357. letters: "y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"
  1358. }, {
  1359. base: 'z',
  1360. letters: "z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"
  1361. }];
  1362. var initNeutraliser = function initNeutraliser() {
  1363. for (var _i = 0, _defaultAccentsDiacri = defaultAccentsDiacritics; _i < _defaultAccentsDiacri.length; _i++) {
  1364. var diacritic = _defaultAccentsDiacri[_i];
  1365. var letters = diacritic.letters;
  1366. for (var i = 0; i < letters.length; i++) {
  1367. diacriticsMap[letters[i]] = diacritic.base;
  1368. }
  1369. }
  1370. };
  1371. /* eslint-disable no-control-regex */
  1372. var removeDiacritics = function removeDiacritics(str) {
  1373. return str.replace(/[^\u0000-\u007E]/g, function (a) {
  1374. return diacriticsMap[a] || a;
  1375. });
  1376. };
  1377. $.extend($.fn.bootstrapTable.defaults, {
  1378. searchAccentNeutralise: false
  1379. });
  1380. $.BootstrapTable =
  1381. /*#__PURE__*/
  1382. function (_$$BootstrapTable) {
  1383. _inherits(_class, _$$BootstrapTable);
  1384. function _class() {
  1385. _classCallCheck(this, _class);
  1386. return _possibleConstructorReturn(this, _getPrototypeOf(_class).apply(this, arguments));
  1387. }
  1388. _createClass(_class, [{
  1389. key: "init",
  1390. value: function init() {
  1391. if (this.options.searchAccentNeutralise) {
  1392. initNeutraliser();
  1393. }
  1394. _get(_getPrototypeOf(_class.prototype), "init", this).call(this);
  1395. }
  1396. }, {
  1397. key: "initSearch",
  1398. value: function initSearch() {
  1399. var _this = this;
  1400. if (this.options.sidePagination !== 'server') {
  1401. var s = this.searchText && this.searchText.toLowerCase();
  1402. var f = $.isEmptyObject(this.filterColumns) ? null : this.filterColumns; // Check filter
  1403. this.data = f ? this.options.data.filter(function (item, i) {
  1404. for (var key in f) {
  1405. if (item[key] !== f[key]) {
  1406. return false;
  1407. }
  1408. }
  1409. return true;
  1410. }) : this.options.data;
  1411. this.data = s ? this.options.data.filter(function (item, i) {
  1412. for (var _i2 = 0, _Object$entries = Object.entries(item); _i2 < _Object$entries.length; _i2++) {
  1413. var _Object$entries$_i = _slicedToArray(_Object$entries[_i2], 2),
  1414. key = _Object$entries$_i[0],
  1415. value = _Object$entries$_i[1];
  1416. key = $.isNumeric(key) ? parseInt(key, 10) : key;
  1417. var column = _this.columns[_this.fieldsColumnsIndex[key]];
  1418. var j = _this.header.fields.indexOf(key);
  1419. if (column && column.searchFormatter) {
  1420. value = $.fn.bootstrapTable.utils.calculateObjectValue(column, _this.header.formatters[j], [value, item, i], value);
  1421. }
  1422. var index = _this.header.fields.indexOf(key);
  1423. if (index !== -1 && _this.header.searchables[index] && typeof value === 'string') {
  1424. if (_this.options.searchAccentNeutralise) {
  1425. value = removeDiacritics(value);
  1426. s = removeDiacritics(s);
  1427. }
  1428. if (_this.options.strictSearch) {
  1429. if ("".concat(value).toLowerCase() === s) {
  1430. return true;
  1431. }
  1432. } else {
  1433. if ("".concat(value).toLowerCase().includes(s)) {
  1434. return true;
  1435. }
  1436. }
  1437. }
  1438. }
  1439. return false;
  1440. }) : this.data;
  1441. }
  1442. }
  1443. }]);
  1444. return _class;
  1445. }($.BootstrapTable);
  1446. }));