bootstrap-table-custom-view.js 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587
  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. $ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
  7. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  8. function createCommonjsModule(fn, module) {
  9. return module = { exports: {} }, fn(module, module.exports), module.exports;
  10. }
  11. var check = function (it) {
  12. return it && it.Math == Math && it;
  13. };
  14. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  15. var global_1 =
  16. // eslint-disable-next-line no-undef
  17. check(typeof globalThis == 'object' && globalThis) ||
  18. check(typeof window == 'object' && window) ||
  19. check(typeof self == 'object' && self) ||
  20. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  21. // eslint-disable-next-line no-new-func
  22. Function('return this')();
  23. var fails = function (exec) {
  24. try {
  25. return !!exec();
  26. } catch (error) {
  27. return true;
  28. }
  29. };
  30. // Thank's IE8 for his funny defineProperty
  31. var descriptors = !fails(function () {
  32. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  33. });
  34. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  35. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  36. // Nashorn ~ JDK8 bug
  37. var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  38. // `Object.prototype.propertyIsEnumerable` method implementation
  39. // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
  40. var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  41. var descriptor = getOwnPropertyDescriptor(this, V);
  42. return !!descriptor && descriptor.enumerable;
  43. } : nativePropertyIsEnumerable;
  44. var objectPropertyIsEnumerable = {
  45. f: f
  46. };
  47. var createPropertyDescriptor = function (bitmap, value) {
  48. return {
  49. enumerable: !(bitmap & 1),
  50. configurable: !(bitmap & 2),
  51. writable: !(bitmap & 4),
  52. value: value
  53. };
  54. };
  55. var toString = {}.toString;
  56. var classofRaw = function (it) {
  57. return toString.call(it).slice(8, -1);
  58. };
  59. var split = ''.split;
  60. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  61. var indexedObject = fails(function () {
  62. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  63. // eslint-disable-next-line no-prototype-builtins
  64. return !Object('z').propertyIsEnumerable(0);
  65. }) ? function (it) {
  66. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  67. } : Object;
  68. // `RequireObjectCoercible` abstract operation
  69. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  70. var requireObjectCoercible = function (it) {
  71. if (it == undefined) throw TypeError("Can't call method on " + it);
  72. return it;
  73. };
  74. // toObject with fallback for non-array-like ES3 strings
  75. var toIndexedObject = function (it) {
  76. return indexedObject(requireObjectCoercible(it));
  77. };
  78. var isObject = function (it) {
  79. return typeof it === 'object' ? it !== null : typeof it === 'function';
  80. };
  81. // `ToPrimitive` abstract operation
  82. // https://tc39.github.io/ecma262/#sec-toprimitive
  83. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  84. // and the second argument - flag - preferred type is a string
  85. var toPrimitive = function (input, PREFERRED_STRING) {
  86. if (!isObject(input)) return input;
  87. var fn, val;
  88. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  89. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  90. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  91. throw TypeError("Can't convert object to primitive value");
  92. };
  93. var hasOwnProperty = {}.hasOwnProperty;
  94. var has = function (it, key) {
  95. return hasOwnProperty.call(it, key);
  96. };
  97. var document$1 = global_1.document;
  98. // typeof document.createElement is 'object' in old IE
  99. var EXISTS = isObject(document$1) && isObject(document$1.createElement);
  100. var documentCreateElement = function (it) {
  101. return EXISTS ? document$1.createElement(it) : {};
  102. };
  103. // Thank's IE8 for his funny defineProperty
  104. var ie8DomDefine = !descriptors && !fails(function () {
  105. return Object.defineProperty(documentCreateElement('div'), 'a', {
  106. get: function () { return 7; }
  107. }).a != 7;
  108. });
  109. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  110. // `Object.getOwnPropertyDescriptor` method
  111. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
  112. var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  113. O = toIndexedObject(O);
  114. P = toPrimitive(P, true);
  115. if (ie8DomDefine) try {
  116. return nativeGetOwnPropertyDescriptor(O, P);
  117. } catch (error) { /* empty */ }
  118. if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  119. };
  120. var objectGetOwnPropertyDescriptor = {
  121. f: f$1
  122. };
  123. var anObject = function (it) {
  124. if (!isObject(it)) {
  125. throw TypeError(String(it) + ' is not an object');
  126. } return it;
  127. };
  128. var nativeDefineProperty = Object.defineProperty;
  129. // `Object.defineProperty` method
  130. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  131. var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  132. anObject(O);
  133. P = toPrimitive(P, true);
  134. anObject(Attributes);
  135. if (ie8DomDefine) try {
  136. return nativeDefineProperty(O, P, Attributes);
  137. } catch (error) { /* empty */ }
  138. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  139. if ('value' in Attributes) O[P] = Attributes.value;
  140. return O;
  141. };
  142. var objectDefineProperty = {
  143. f: f$2
  144. };
  145. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  146. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  147. } : function (object, key, value) {
  148. object[key] = value;
  149. return object;
  150. };
  151. var setGlobal = function (key, value) {
  152. try {
  153. createNonEnumerableProperty(global_1, key, value);
  154. } catch (error) {
  155. global_1[key] = value;
  156. } return value;
  157. };
  158. var SHARED = '__core-js_shared__';
  159. var store = global_1[SHARED] || setGlobal(SHARED, {});
  160. var sharedStore = store;
  161. var functionToString = Function.toString;
  162. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  163. if (typeof sharedStore.inspectSource != 'function') {
  164. sharedStore.inspectSource = function (it) {
  165. return functionToString.call(it);
  166. };
  167. }
  168. var inspectSource = sharedStore.inspectSource;
  169. var WeakMap = global_1.WeakMap;
  170. var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
  171. var shared = createCommonjsModule(function (module) {
  172. (module.exports = function (key, value) {
  173. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  174. })('versions', []).push({
  175. version: '3.6.0',
  176. mode: 'global',
  177. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  178. });
  179. });
  180. var id = 0;
  181. var postfix = Math.random();
  182. var uid = function (key) {
  183. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  184. };
  185. var keys = shared('keys');
  186. var sharedKey = function (key) {
  187. return keys[key] || (keys[key] = uid(key));
  188. };
  189. var hiddenKeys = {};
  190. var WeakMap$1 = global_1.WeakMap;
  191. var set, get, has$1;
  192. var enforce = function (it) {
  193. return has$1(it) ? get(it) : set(it, {});
  194. };
  195. var getterFor = function (TYPE) {
  196. return function (it) {
  197. var state;
  198. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  199. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  200. } return state;
  201. };
  202. };
  203. if (nativeWeakMap) {
  204. var store$1 = new WeakMap$1();
  205. var wmget = store$1.get;
  206. var wmhas = store$1.has;
  207. var wmset = store$1.set;
  208. set = function (it, metadata) {
  209. wmset.call(store$1, it, metadata);
  210. return metadata;
  211. };
  212. get = function (it) {
  213. return wmget.call(store$1, it) || {};
  214. };
  215. has$1 = function (it) {
  216. return wmhas.call(store$1, it);
  217. };
  218. } else {
  219. var STATE = sharedKey('state');
  220. hiddenKeys[STATE] = true;
  221. set = function (it, metadata) {
  222. createNonEnumerableProperty(it, STATE, metadata);
  223. return metadata;
  224. };
  225. get = function (it) {
  226. return has(it, STATE) ? it[STATE] : {};
  227. };
  228. has$1 = function (it) {
  229. return has(it, STATE);
  230. };
  231. }
  232. var internalState = {
  233. set: set,
  234. get: get,
  235. has: has$1,
  236. enforce: enforce,
  237. getterFor: getterFor
  238. };
  239. var redefine = createCommonjsModule(function (module) {
  240. var getInternalState = internalState.get;
  241. var enforceInternalState = internalState.enforce;
  242. var TEMPLATE = String(String).split('String');
  243. (module.exports = function (O, key, value, options) {
  244. var unsafe = options ? !!options.unsafe : false;
  245. var simple = options ? !!options.enumerable : false;
  246. var noTargetGet = options ? !!options.noTargetGet : false;
  247. if (typeof value == 'function') {
  248. if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
  249. enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
  250. }
  251. if (O === global_1) {
  252. if (simple) O[key] = value;
  253. else setGlobal(key, value);
  254. return;
  255. } else if (!unsafe) {
  256. delete O[key];
  257. } else if (!noTargetGet && O[key]) {
  258. simple = true;
  259. }
  260. if (simple) O[key] = value;
  261. else createNonEnumerableProperty(O, key, value);
  262. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  263. })(Function.prototype, 'toString', function toString() {
  264. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  265. });
  266. });
  267. var path = global_1;
  268. var aFunction = function (variable) {
  269. return typeof variable == 'function' ? variable : undefined;
  270. };
  271. var getBuiltIn = function (namespace, method) {
  272. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
  273. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  274. };
  275. var ceil = Math.ceil;
  276. var floor = Math.floor;
  277. // `ToInteger` abstract operation
  278. // https://tc39.github.io/ecma262/#sec-tointeger
  279. var toInteger = function (argument) {
  280. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  281. };
  282. var min = Math.min;
  283. // `ToLength` abstract operation
  284. // https://tc39.github.io/ecma262/#sec-tolength
  285. var toLength = function (argument) {
  286. return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  287. };
  288. var max = Math.max;
  289. var min$1 = Math.min;
  290. // Helper for a popular repeating case of the spec:
  291. // Let integer be ? ToInteger(index).
  292. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  293. var toAbsoluteIndex = function (index, length) {
  294. var integer = toInteger(index);
  295. return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
  296. };
  297. // `Array.prototype.{ indexOf, includes }` methods implementation
  298. var createMethod = function (IS_INCLUDES) {
  299. return function ($this, el, fromIndex) {
  300. var O = toIndexedObject($this);
  301. var length = toLength(O.length);
  302. var index = toAbsoluteIndex(fromIndex, length);
  303. var value;
  304. // Array#includes uses SameValueZero equality algorithm
  305. // eslint-disable-next-line no-self-compare
  306. if (IS_INCLUDES && el != el) while (length > index) {
  307. value = O[index++];
  308. // eslint-disable-next-line no-self-compare
  309. if (value != value) return true;
  310. // Array#indexOf ignores holes, Array#includes - not
  311. } else for (;length > index; index++) {
  312. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  313. } return !IS_INCLUDES && -1;
  314. };
  315. };
  316. var arrayIncludes = {
  317. // `Array.prototype.includes` method
  318. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  319. includes: createMethod(true),
  320. // `Array.prototype.indexOf` method
  321. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  322. indexOf: createMethod(false)
  323. };
  324. var indexOf = arrayIncludes.indexOf;
  325. var objectKeysInternal = function (object, names) {
  326. var O = toIndexedObject(object);
  327. var i = 0;
  328. var result = [];
  329. var key;
  330. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  331. // Don't enum bug & hidden keys
  332. while (names.length > i) if (has(O, key = names[i++])) {
  333. ~indexOf(result, key) || result.push(key);
  334. }
  335. return result;
  336. };
  337. // IE8- don't enum bug keys
  338. var enumBugKeys = [
  339. 'constructor',
  340. 'hasOwnProperty',
  341. 'isPrototypeOf',
  342. 'propertyIsEnumerable',
  343. 'toLocaleString',
  344. 'toString',
  345. 'valueOf'
  346. ];
  347. var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
  348. // `Object.getOwnPropertyNames` method
  349. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  350. var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  351. return objectKeysInternal(O, hiddenKeys$1);
  352. };
  353. var objectGetOwnPropertyNames = {
  354. f: f$3
  355. };
  356. var f$4 = Object.getOwnPropertySymbols;
  357. var objectGetOwnPropertySymbols = {
  358. f: f$4
  359. };
  360. // all object keys, includes non-enumerable and symbols
  361. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  362. var keys = objectGetOwnPropertyNames.f(anObject(it));
  363. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  364. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  365. };
  366. var copyConstructorProperties = function (target, source) {
  367. var keys = ownKeys(source);
  368. var defineProperty = objectDefineProperty.f;
  369. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  370. for (var i = 0; i < keys.length; i++) {
  371. var key = keys[i];
  372. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  373. }
  374. };
  375. var replacement = /#|\.prototype\./;
  376. var isForced = function (feature, detection) {
  377. var value = data[normalize(feature)];
  378. return value == POLYFILL ? true
  379. : value == NATIVE ? false
  380. : typeof detection == 'function' ? fails(detection)
  381. : !!detection;
  382. };
  383. var normalize = isForced.normalize = function (string) {
  384. return String(string).replace(replacement, '.').toLowerCase();
  385. };
  386. var data = isForced.data = {};
  387. var NATIVE = isForced.NATIVE = 'N';
  388. var POLYFILL = isForced.POLYFILL = 'P';
  389. var isForced_1 = isForced;
  390. var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
  391. /*
  392. options.target - name of the target object
  393. options.global - target is the global object
  394. options.stat - export as static methods of target
  395. options.proto - export as prototype methods of target
  396. options.real - real prototype method for the `pure` version
  397. options.forced - export even if the native feature is available
  398. options.bind - bind methods to the target, required for the `pure` version
  399. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  400. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  401. options.sham - add a flag to not completely full polyfills
  402. options.enumerable - export as enumerable property
  403. options.noTargetGet - prevent calling a getter on target
  404. */
  405. var _export = function (options, source) {
  406. var TARGET = options.target;
  407. var GLOBAL = options.global;
  408. var STATIC = options.stat;
  409. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  410. if (GLOBAL) {
  411. target = global_1;
  412. } else if (STATIC) {
  413. target = global_1[TARGET] || setGlobal(TARGET, {});
  414. } else {
  415. target = (global_1[TARGET] || {}).prototype;
  416. }
  417. if (target) for (key in source) {
  418. sourceProperty = source[key];
  419. if (options.noTargetGet) {
  420. descriptor = getOwnPropertyDescriptor$1(target, key);
  421. targetProperty = descriptor && descriptor.value;
  422. } else targetProperty = target[key];
  423. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  424. // contained in target
  425. if (!FORCED && targetProperty !== undefined) {
  426. if (typeof sourceProperty === typeof targetProperty) continue;
  427. copyConstructorProperties(sourceProperty, targetProperty);
  428. }
  429. // add a flag to not completely full polyfills
  430. if (options.sham || (targetProperty && targetProperty.sham)) {
  431. createNonEnumerableProperty(sourceProperty, 'sham', true);
  432. }
  433. // extend global
  434. redefine(target, key, sourceProperty, options);
  435. }
  436. };
  437. // `IsArray` abstract operation
  438. // https://tc39.github.io/ecma262/#sec-isarray
  439. var isArray = Array.isArray || function isArray(arg) {
  440. return classofRaw(arg) == 'Array';
  441. };
  442. // `ToObject` abstract operation
  443. // https://tc39.github.io/ecma262/#sec-toobject
  444. var toObject = function (argument) {
  445. return Object(requireObjectCoercible(argument));
  446. };
  447. var createProperty = function (object, key, value) {
  448. var propertyKey = toPrimitive(key);
  449. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  450. else object[propertyKey] = value;
  451. };
  452. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  453. // Chrome 38 Symbol has incorrect toString conversion
  454. // eslint-disable-next-line no-undef
  455. return !String(Symbol());
  456. });
  457. var useSymbolAsUid = nativeSymbol
  458. // eslint-disable-next-line no-undef
  459. && !Symbol.sham
  460. // eslint-disable-next-line no-undef
  461. && typeof Symbol() == 'symbol';
  462. var WellKnownSymbolsStore = shared('wks');
  463. var Symbol$1 = global_1.Symbol;
  464. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : uid;
  465. var wellKnownSymbol = function (name) {
  466. if (!has(WellKnownSymbolsStore, name)) {
  467. if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
  468. else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  469. } return WellKnownSymbolsStore[name];
  470. };
  471. var SPECIES = wellKnownSymbol('species');
  472. // `ArraySpeciesCreate` abstract operation
  473. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  474. var arraySpeciesCreate = function (originalArray, length) {
  475. var C;
  476. if (isArray(originalArray)) {
  477. C = originalArray.constructor;
  478. // cross-realm fallback
  479. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  480. else if (isObject(C)) {
  481. C = C[SPECIES];
  482. if (C === null) C = undefined;
  483. }
  484. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  485. };
  486. var userAgent = getBuiltIn('navigator', 'userAgent') || '';
  487. var process = global_1.process;
  488. var versions = process && process.versions;
  489. var v8 = versions && versions.v8;
  490. var match, version;
  491. if (v8) {
  492. match = v8.split('.');
  493. version = match[0] + match[1];
  494. } else if (userAgent) {
  495. match = userAgent.match(/Edge\/(\d+)/);
  496. if (!match || match[1] >= 74) {
  497. match = userAgent.match(/Chrome\/(\d+)/);
  498. if (match) version = match[1];
  499. }
  500. }
  501. var v8Version = version && +version;
  502. var SPECIES$1 = wellKnownSymbol('species');
  503. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  504. // We can't use this feature detection in V8 since it causes
  505. // deoptimization and serious performance degradation
  506. // https://github.com/zloirock/core-js/issues/677
  507. return v8Version >= 51 || !fails(function () {
  508. var array = [];
  509. var constructor = array.constructor = {};
  510. constructor[SPECIES$1] = function () {
  511. return { foo: 1 };
  512. };
  513. return array[METHOD_NAME](Boolean).foo !== 1;
  514. });
  515. };
  516. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  517. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  518. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  519. // We can't use this feature detection in V8 since it causes
  520. // deoptimization and serious performance degradation
  521. // https://github.com/zloirock/core-js/issues/679
  522. var IS_CONCAT_SPREADABLE_SUPPORT = v8Version >= 51 || !fails(function () {
  523. var array = [];
  524. array[IS_CONCAT_SPREADABLE] = false;
  525. return array.concat()[0] !== array;
  526. });
  527. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  528. var isConcatSpreadable = function (O) {
  529. if (!isObject(O)) return false;
  530. var spreadable = O[IS_CONCAT_SPREADABLE];
  531. return spreadable !== undefined ? !!spreadable : isArray(O);
  532. };
  533. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  534. // `Array.prototype.concat` method
  535. // https://tc39.github.io/ecma262/#sec-array.prototype.concat
  536. // with adding support of @@isConcatSpreadable and @@species
  537. _export({ target: 'Array', proto: true, forced: FORCED }, {
  538. concat: function concat(arg) { // eslint-disable-line no-unused-vars
  539. var O = toObject(this);
  540. var A = arraySpeciesCreate(O, 0);
  541. var n = 0;
  542. var i, k, length, len, E;
  543. for (i = -1, length = arguments.length; i < length; i++) {
  544. E = i === -1 ? O : arguments[i];
  545. if (isConcatSpreadable(E)) {
  546. len = toLength(E.length);
  547. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  548. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  549. } else {
  550. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  551. createProperty(A, n++, E);
  552. }
  553. }
  554. A.length = n;
  555. return A;
  556. }
  557. });
  558. var aFunction$1 = function (it) {
  559. if (typeof it != 'function') {
  560. throw TypeError(String(it) + ' is not a function');
  561. } return it;
  562. };
  563. // optional / simple context binding
  564. var bindContext = function (fn, that, length) {
  565. aFunction$1(fn);
  566. if (that === undefined) return fn;
  567. switch (length) {
  568. case 0: return function () {
  569. return fn.call(that);
  570. };
  571. case 1: return function (a) {
  572. return fn.call(that, a);
  573. };
  574. case 2: return function (a, b) {
  575. return fn.call(that, a, b);
  576. };
  577. case 3: return function (a, b, c) {
  578. return fn.call(that, a, b, c);
  579. };
  580. }
  581. return function (/* ...args */) {
  582. return fn.apply(that, arguments);
  583. };
  584. };
  585. var push = [].push;
  586. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
  587. var createMethod$1 = function (TYPE) {
  588. var IS_MAP = TYPE == 1;
  589. var IS_FILTER = TYPE == 2;
  590. var IS_SOME = TYPE == 3;
  591. var IS_EVERY = TYPE == 4;
  592. var IS_FIND_INDEX = TYPE == 6;
  593. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  594. return function ($this, callbackfn, that, specificCreate) {
  595. var O = toObject($this);
  596. var self = indexedObject(O);
  597. var boundFunction = bindContext(callbackfn, that, 3);
  598. var length = toLength(self.length);
  599. var index = 0;
  600. var create = specificCreate || arraySpeciesCreate;
  601. var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  602. var value, result;
  603. for (;length > index; index++) if (NO_HOLES || index in self) {
  604. value = self[index];
  605. result = boundFunction(value, index, O);
  606. if (TYPE) {
  607. if (IS_MAP) target[index] = result; // map
  608. else if (result) switch (TYPE) {
  609. case 3: return true; // some
  610. case 5: return value; // find
  611. case 6: return index; // findIndex
  612. case 2: push.call(target, value); // filter
  613. } else if (IS_EVERY) return false; // every
  614. }
  615. }
  616. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  617. };
  618. };
  619. var arrayIteration = {
  620. // `Array.prototype.forEach` method
  621. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  622. forEach: createMethod$1(0),
  623. // `Array.prototype.map` method
  624. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  625. map: createMethod$1(1),
  626. // `Array.prototype.filter` method
  627. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  628. filter: createMethod$1(2),
  629. // `Array.prototype.some` method
  630. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  631. some: createMethod$1(3),
  632. // `Array.prototype.every` method
  633. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  634. every: createMethod$1(4),
  635. // `Array.prototype.find` method
  636. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  637. find: createMethod$1(5),
  638. // `Array.prototype.findIndex` method
  639. // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
  640. findIndex: createMethod$1(6)
  641. };
  642. // `Object.keys` method
  643. // https://tc39.github.io/ecma262/#sec-object.keys
  644. var objectKeys = Object.keys || function keys(O) {
  645. return objectKeysInternal(O, enumBugKeys);
  646. };
  647. // `Object.defineProperties` method
  648. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  649. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  650. anObject(O);
  651. var keys = objectKeys(Properties);
  652. var length = keys.length;
  653. var index = 0;
  654. var key;
  655. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  656. return O;
  657. };
  658. var html = getBuiltIn('document', 'documentElement');
  659. var GT = '>';
  660. var LT = '<';
  661. var PROTOTYPE = 'prototype';
  662. var SCRIPT = 'script';
  663. var IE_PROTO = sharedKey('IE_PROTO');
  664. var EmptyConstructor = function () { /* empty */ };
  665. var scriptTag = function (content) {
  666. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  667. };
  668. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  669. var NullProtoObjectViaActiveX = function (activeXDocument) {
  670. activeXDocument.write(scriptTag(''));
  671. activeXDocument.close();
  672. var temp = activeXDocument.parentWindow.Object;
  673. activeXDocument = null; // avoid memory leak
  674. return temp;
  675. };
  676. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  677. var NullProtoObjectViaIFrame = function () {
  678. // Thrash, waste and sodomy: IE GC bug
  679. var iframe = documentCreateElement('iframe');
  680. var JS = 'java' + SCRIPT + ':';
  681. var iframeDocument;
  682. iframe.style.display = 'none';
  683. html.appendChild(iframe);
  684. // https://github.com/zloirock/core-js/issues/475
  685. iframe.src = String(JS);
  686. iframeDocument = iframe.contentWindow.document;
  687. iframeDocument.open();
  688. iframeDocument.write(scriptTag('document.F=Object'));
  689. iframeDocument.close();
  690. return iframeDocument.F;
  691. };
  692. // Check for document.domain and active x support
  693. // No need to use active x approach when document.domain is not set
  694. // see https://github.com/es-shims/es5-shim/issues/150
  695. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  696. // avoid IE GC bug
  697. var activeXDocument;
  698. var NullProtoObject = function () {
  699. try {
  700. /* global ActiveXObject */
  701. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  702. } catch (error) { /* ignore */ }
  703. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  704. var length = enumBugKeys.length;
  705. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  706. return NullProtoObject();
  707. };
  708. hiddenKeys[IE_PROTO] = true;
  709. // `Object.create` method
  710. // https://tc39.github.io/ecma262/#sec-object.create
  711. var objectCreate = Object.create || function create(O, Properties) {
  712. var result;
  713. if (O !== null) {
  714. EmptyConstructor[PROTOTYPE] = anObject(O);
  715. result = new EmptyConstructor();
  716. EmptyConstructor[PROTOTYPE] = null;
  717. // add "__proto__" for Object.getPrototypeOf polyfill
  718. result[IE_PROTO] = O;
  719. } else result = NullProtoObject();
  720. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  721. };
  722. var UNSCOPABLES = wellKnownSymbol('unscopables');
  723. var ArrayPrototype = Array.prototype;
  724. // Array.prototype[@@unscopables]
  725. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  726. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  727. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  728. configurable: true,
  729. value: objectCreate(null)
  730. });
  731. }
  732. // add a key to Array.prototype[@@unscopables]
  733. var addToUnscopables = function (key) {
  734. ArrayPrototype[UNSCOPABLES][key] = true;
  735. };
  736. var $find = arrayIteration.find;
  737. var FIND = 'find';
  738. var SKIPS_HOLES = true;
  739. // Shouldn't skip holes
  740. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  741. // `Array.prototype.find` method
  742. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  743. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  744. find: function find(callbackfn /* , that = undefined */) {
  745. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  746. }
  747. });
  748. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  749. addToUnscopables(FIND);
  750. var sloppyArrayMethod = function (METHOD_NAME, argument) {
  751. var method = [][METHOD_NAME];
  752. return !method || !fails(function () {
  753. // eslint-disable-next-line no-useless-call,no-throw-literal
  754. method.call(null, argument || function () { throw 1; }, 1);
  755. });
  756. };
  757. var nativeJoin = [].join;
  758. var ES3_STRINGS = indexedObject != Object;
  759. var SLOPPY_METHOD = sloppyArrayMethod('join', ',');
  760. // `Array.prototype.join` method
  761. // https://tc39.github.io/ecma262/#sec-array.prototype.join
  762. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, {
  763. join: function join(separator) {
  764. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  765. }
  766. });
  767. var SPECIES$2 = wellKnownSymbol('species');
  768. var nativeSlice = [].slice;
  769. var max$1 = Math.max;
  770. // `Array.prototype.slice` method
  771. // https://tc39.github.io/ecma262/#sec-array.prototype.slice
  772. // fallback for not array-like ES3 strings and DOM objects
  773. _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, {
  774. slice: function slice(start, end) {
  775. var O = toIndexedObject(this);
  776. var length = toLength(O.length);
  777. var k = toAbsoluteIndex(start, length);
  778. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  779. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  780. var Constructor, result, n;
  781. if (isArray(O)) {
  782. Constructor = O.constructor;
  783. // cross-realm fallback
  784. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  785. Constructor = undefined;
  786. } else if (isObject(Constructor)) {
  787. Constructor = Constructor[SPECIES$2];
  788. if (Constructor === null) Constructor = undefined;
  789. }
  790. if (Constructor === Array || Constructor === undefined) {
  791. return nativeSlice.call(O, k, fin);
  792. }
  793. }
  794. result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
  795. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  796. result.length = n;
  797. return result;
  798. }
  799. });
  800. // `RegExp.prototype.flags` getter implementation
  801. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  802. var regexpFlags = function () {
  803. var that = anObject(this);
  804. var result = '';
  805. if (that.global) result += 'g';
  806. if (that.ignoreCase) result += 'i';
  807. if (that.multiline) result += 'm';
  808. if (that.dotAll) result += 's';
  809. if (that.unicode) result += 'u';
  810. if (that.sticky) result += 'y';
  811. return result;
  812. };
  813. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
  814. // so we use an intermediate function.
  815. function RE(s, f) {
  816. return RegExp(s, f);
  817. }
  818. var UNSUPPORTED_Y = fails(function () {
  819. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  820. var re = RE('a', 'y');
  821. re.lastIndex = 2;
  822. return re.exec('abcd') != null;
  823. });
  824. var BROKEN_CARET = fails(function () {
  825. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  826. var re = RE('^r', 'gy');
  827. re.lastIndex = 2;
  828. return re.exec('str') != null;
  829. });
  830. var regexpStickyHelpers = {
  831. UNSUPPORTED_Y: UNSUPPORTED_Y,
  832. BROKEN_CARET: BROKEN_CARET
  833. };
  834. var nativeExec = RegExp.prototype.exec;
  835. // This always refers to the native implementation, because the
  836. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  837. // which loads this file before patching the method.
  838. var nativeReplace = String.prototype.replace;
  839. var patchedExec = nativeExec;
  840. var UPDATES_LAST_INDEX_WRONG = (function () {
  841. var re1 = /a/;
  842. var re2 = /b*/g;
  843. nativeExec.call(re1, 'a');
  844. nativeExec.call(re2, 'a');
  845. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  846. })();
  847. var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
  848. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  849. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  850. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1;
  851. if (PATCH) {
  852. patchedExec = function exec(str) {
  853. var re = this;
  854. var lastIndex, reCopy, match, i;
  855. var sticky = UNSUPPORTED_Y$1 && re.sticky;
  856. var flags = regexpFlags.call(re);
  857. var source = re.source;
  858. var charsAdded = 0;
  859. var strCopy = str;
  860. if (sticky) {
  861. flags = flags.replace('y', '');
  862. if (flags.indexOf('g') === -1) {
  863. flags += 'g';
  864. }
  865. strCopy = String(str).slice(re.lastIndex);
  866. // Support anchored sticky behavior.
  867. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
  868. source = '(?: ' + source + ')';
  869. strCopy = ' ' + strCopy;
  870. charsAdded++;
  871. }
  872. // ^(? + rx + ) is needed, in combination with some str slicing, to
  873. // simulate the 'y' flag.
  874. reCopy = new RegExp('^(?:' + source + ')', flags);
  875. }
  876. if (NPCG_INCLUDED) {
  877. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  878. }
  879. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  880. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  881. if (sticky) {
  882. if (match) {
  883. match.input = match.input.slice(charsAdded);
  884. match[0] = match[0].slice(charsAdded);
  885. match.index = re.lastIndex;
  886. re.lastIndex += match[0].length;
  887. } else re.lastIndex = 0;
  888. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  889. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  890. }
  891. if (NPCG_INCLUDED && match && match.length > 1) {
  892. // Fix browsers whose `exec` methods don't consistently return `undefined`
  893. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  894. nativeReplace.call(match[0], reCopy, function () {
  895. for (i = 1; i < arguments.length - 2; i++) {
  896. if (arguments[i] === undefined) match[i] = undefined;
  897. }
  898. });
  899. }
  900. return match;
  901. };
  902. }
  903. var regexpExec = patchedExec;
  904. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  905. exec: regexpExec
  906. });
  907. var SPECIES$3 = wellKnownSymbol('species');
  908. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  909. // #replace needs built-in support for named groups.
  910. // #match works fine because it just return the exec results, even if it has
  911. // a "grops" property.
  912. var re = /./;
  913. re.exec = function () {
  914. var result = [];
  915. result.groups = { a: '7' };
  916. return result;
  917. };
  918. return ''.replace(re, '$<a>') !== '7';
  919. });
  920. // IE <= 11 replaces $0 with the whole match, as if it was $&
  921. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  922. var REPLACE_KEEPS_$0 = (function () {
  923. return 'a'.replace(/./, '$0') === '$0';
  924. })();
  925. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  926. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  927. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  928. var re = /(?:)/;
  929. var originalExec = re.exec;
  930. re.exec = function () { return originalExec.apply(this, arguments); };
  931. var result = 'ab'.split(re);
  932. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  933. });
  934. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  935. var SYMBOL = wellKnownSymbol(KEY);
  936. var DELEGATES_TO_SYMBOL = !fails(function () {
  937. // String methods call symbol-named RegEp methods
  938. var O = {};
  939. O[SYMBOL] = function () { return 7; };
  940. return ''[KEY](O) != 7;
  941. });
  942. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  943. // Symbol-named RegExp methods call .exec
  944. var execCalled = false;
  945. var re = /a/;
  946. if (KEY === 'split') {
  947. // We can't use real regex here since it causes deoptimization
  948. // and serious performance degradation in V8
  949. // https://github.com/zloirock/core-js/issues/306
  950. re = {};
  951. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  952. // a new one. We need to return the patched regex when creating the new one.
  953. re.constructor = {};
  954. re.constructor[SPECIES$3] = function () { return re; };
  955. re.flags = '';
  956. re[SYMBOL] = /./[SYMBOL];
  957. }
  958. re.exec = function () { execCalled = true; return null; };
  959. re[SYMBOL]('');
  960. return !execCalled;
  961. });
  962. if (
  963. !DELEGATES_TO_SYMBOL ||
  964. !DELEGATES_TO_EXEC ||
  965. (KEY === 'replace' && !(REPLACE_SUPPORTS_NAMED_GROUPS && REPLACE_KEEPS_$0)) ||
  966. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  967. ) {
  968. var nativeRegExpMethod = /./[SYMBOL];
  969. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  970. if (regexp.exec === regexpExec) {
  971. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  972. // The native String method already delegates to @@method (this
  973. // polyfilled function), leasing to infinite recursion.
  974. // We avoid it by directly calling the native @@method method.
  975. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  976. }
  977. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  978. }
  979. return { done: false };
  980. }, { REPLACE_KEEPS_$0: REPLACE_KEEPS_$0 });
  981. var stringMethod = methods[0];
  982. var regexMethod = methods[1];
  983. redefine(String.prototype, KEY, stringMethod);
  984. redefine(RegExp.prototype, SYMBOL, length == 2
  985. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  986. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  987. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  988. // 21.2.5.6 RegExp.prototype[@@match](string)
  989. // 21.2.5.9 RegExp.prototype[@@search](string)
  990. : function (string) { return regexMethod.call(string, this); }
  991. );
  992. }
  993. if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
  994. };
  995. var MATCH = wellKnownSymbol('match');
  996. // `IsRegExp` abstract operation
  997. // https://tc39.github.io/ecma262/#sec-isregexp
  998. var isRegexp = function (it) {
  999. var isRegExp;
  1000. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  1001. };
  1002. var SPECIES$4 = wellKnownSymbol('species');
  1003. // `SpeciesConstructor` abstract operation
  1004. // https://tc39.github.io/ecma262/#sec-speciesconstructor
  1005. var speciesConstructor = function (O, defaultConstructor) {
  1006. var C = anObject(O).constructor;
  1007. var S;
  1008. return C === undefined || (S = anObject(C)[SPECIES$4]) == undefined ? defaultConstructor : aFunction$1(S);
  1009. };
  1010. // `String.prototype.{ codePointAt, at }` methods implementation
  1011. var createMethod$2 = function (CONVERT_TO_STRING) {
  1012. return function ($this, pos) {
  1013. var S = String(requireObjectCoercible($this));
  1014. var position = toInteger(pos);
  1015. var size = S.length;
  1016. var first, second;
  1017. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  1018. first = S.charCodeAt(position);
  1019. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  1020. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  1021. ? CONVERT_TO_STRING ? S.charAt(position) : first
  1022. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  1023. };
  1024. };
  1025. var stringMultibyte = {
  1026. // `String.prototype.codePointAt` method
  1027. // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
  1028. codeAt: createMethod$2(false),
  1029. // `String.prototype.at` method
  1030. // https://github.com/mathiasbynens/String.prototype.at
  1031. charAt: createMethod$2(true)
  1032. };
  1033. var charAt = stringMultibyte.charAt;
  1034. // `AdvanceStringIndex` abstract operation
  1035. // https://tc39.github.io/ecma262/#sec-advancestringindex
  1036. var advanceStringIndex = function (S, index, unicode) {
  1037. return index + (unicode ? charAt(S, index).length : 1);
  1038. };
  1039. // `RegExpExec` abstract operation
  1040. // https://tc39.github.io/ecma262/#sec-regexpexec
  1041. var regexpExecAbstract = function (R, S) {
  1042. var exec = R.exec;
  1043. if (typeof exec === 'function') {
  1044. var result = exec.call(R, S);
  1045. if (typeof result !== 'object') {
  1046. throw TypeError('RegExp exec method returned something other than an Object or null');
  1047. }
  1048. return result;
  1049. }
  1050. if (classofRaw(R) !== 'RegExp') {
  1051. throw TypeError('RegExp#exec called on incompatible receiver');
  1052. }
  1053. return regexpExec.call(R, S);
  1054. };
  1055. var arrayPush = [].push;
  1056. var min$2 = Math.min;
  1057. var MAX_UINT32 = 0xFFFFFFFF;
  1058. // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
  1059. var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
  1060. // @@split logic
  1061. fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
  1062. var internalSplit;
  1063. if (
  1064. 'abbc'.split(/(b)*/)[1] == 'c' ||
  1065. 'test'.split(/(?:)/, -1).length != 4 ||
  1066. 'ab'.split(/(?:ab)*/).length != 2 ||
  1067. '.'.split(/(.?)(.?)/).length != 4 ||
  1068. '.'.split(/()()/).length > 1 ||
  1069. ''.split(/.?/).length
  1070. ) {
  1071. // based on es5-shim implementation, need to rework it
  1072. internalSplit = function (separator, limit) {
  1073. var string = String(requireObjectCoercible(this));
  1074. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1075. if (lim === 0) return [];
  1076. if (separator === undefined) return [string];
  1077. // If `separator` is not a regex, use native split
  1078. if (!isRegexp(separator)) {
  1079. return nativeSplit.call(string, separator, lim);
  1080. }
  1081. var output = [];
  1082. var flags = (separator.ignoreCase ? 'i' : '') +
  1083. (separator.multiline ? 'm' : '') +
  1084. (separator.unicode ? 'u' : '') +
  1085. (separator.sticky ? 'y' : '');
  1086. var lastLastIndex = 0;
  1087. // Make `global` and avoid `lastIndex` issues by working with a copy
  1088. var separatorCopy = new RegExp(separator.source, flags + 'g');
  1089. var match, lastIndex, lastLength;
  1090. while (match = regexpExec.call(separatorCopy, string)) {
  1091. lastIndex = separatorCopy.lastIndex;
  1092. if (lastIndex > lastLastIndex) {
  1093. output.push(string.slice(lastLastIndex, match.index));
  1094. if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
  1095. lastLength = match[0].length;
  1096. lastLastIndex = lastIndex;
  1097. if (output.length >= lim) break;
  1098. }
  1099. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  1100. }
  1101. if (lastLastIndex === string.length) {
  1102. if (lastLength || !separatorCopy.test('')) output.push('');
  1103. } else output.push(string.slice(lastLastIndex));
  1104. return output.length > lim ? output.slice(0, lim) : output;
  1105. };
  1106. // Chakra, V8
  1107. } else if ('0'.split(undefined, 0).length) {
  1108. internalSplit = function (separator, limit) {
  1109. return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
  1110. };
  1111. } else internalSplit = nativeSplit;
  1112. return [
  1113. // `String.prototype.split` method
  1114. // https://tc39.github.io/ecma262/#sec-string.prototype.split
  1115. function split(separator, limit) {
  1116. var O = requireObjectCoercible(this);
  1117. var splitter = separator == undefined ? undefined : separator[SPLIT];
  1118. return splitter !== undefined
  1119. ? splitter.call(separator, O, limit)
  1120. : internalSplit.call(String(O), separator, limit);
  1121. },
  1122. // `RegExp.prototype[@@split]` method
  1123. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
  1124. //
  1125. // NOTE: This cannot be properly polyfilled in engines that don't support
  1126. // the 'y' flag.
  1127. function (regexp, limit) {
  1128. var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
  1129. if (res.done) return res.value;
  1130. var rx = anObject(regexp);
  1131. var S = String(this);
  1132. var C = speciesConstructor(rx, RegExp);
  1133. var unicodeMatching = rx.unicode;
  1134. var flags = (rx.ignoreCase ? 'i' : '') +
  1135. (rx.multiline ? 'm' : '') +
  1136. (rx.unicode ? 'u' : '') +
  1137. (SUPPORTS_Y ? 'y' : 'g');
  1138. // ^(? + rx + ) is needed, in combination with some S slicing, to
  1139. // simulate the 'y' flag.
  1140. var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
  1141. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1142. if (lim === 0) return [];
  1143. if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
  1144. var p = 0;
  1145. var q = 0;
  1146. var A = [];
  1147. while (q < S.length) {
  1148. splitter.lastIndex = SUPPORTS_Y ? q : 0;
  1149. var z = regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q));
  1150. var e;
  1151. if (
  1152. z === null ||
  1153. (e = min$2(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
  1154. ) {
  1155. q = advanceStringIndex(S, q, unicodeMatching);
  1156. } else {
  1157. A.push(S.slice(p, q));
  1158. if (A.length === lim) return A;
  1159. for (var i = 1; i <= z.length - 1; i++) {
  1160. A.push(z[i]);
  1161. if (A.length === lim) return A;
  1162. }
  1163. q = p = e;
  1164. }
  1165. }
  1166. A.push(S.slice(p));
  1167. return A;
  1168. }
  1169. ];
  1170. }, !SUPPORTS_Y);
  1171. function _classCallCheck(instance, Constructor) {
  1172. if (!(instance instanceof Constructor)) {
  1173. throw new TypeError("Cannot call a class as a function");
  1174. }
  1175. }
  1176. function _defineProperties(target, props) {
  1177. for (var i = 0; i < props.length; i++) {
  1178. var descriptor = props[i];
  1179. descriptor.enumerable = descriptor.enumerable || false;
  1180. descriptor.configurable = true;
  1181. if ("value" in descriptor) descriptor.writable = true;
  1182. Object.defineProperty(target, descriptor.key, descriptor);
  1183. }
  1184. }
  1185. function _createClass(Constructor, protoProps, staticProps) {
  1186. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  1187. if (staticProps) _defineProperties(Constructor, staticProps);
  1188. return Constructor;
  1189. }
  1190. function _inherits(subClass, superClass) {
  1191. if (typeof superClass !== "function" && superClass !== null) {
  1192. throw new TypeError("Super expression must either be null or a function");
  1193. }
  1194. subClass.prototype = Object.create(superClass && superClass.prototype, {
  1195. constructor: {
  1196. value: subClass,
  1197. writable: true,
  1198. configurable: true
  1199. }
  1200. });
  1201. if (superClass) _setPrototypeOf(subClass, superClass);
  1202. }
  1203. function _getPrototypeOf(o) {
  1204. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  1205. return o.__proto__ || Object.getPrototypeOf(o);
  1206. };
  1207. return _getPrototypeOf(o);
  1208. }
  1209. function _setPrototypeOf(o, p) {
  1210. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  1211. o.__proto__ = p;
  1212. return o;
  1213. };
  1214. return _setPrototypeOf(o, p);
  1215. }
  1216. function _assertThisInitialized(self) {
  1217. if (self === void 0) {
  1218. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1219. }
  1220. return self;
  1221. }
  1222. function _possibleConstructorReturn(self, call) {
  1223. if (call && (typeof call === "object" || typeof call === "function")) {
  1224. return call;
  1225. }
  1226. return _assertThisInitialized(self);
  1227. }
  1228. function _superPropBase(object, property) {
  1229. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  1230. object = _getPrototypeOf(object);
  1231. if (object === null) break;
  1232. }
  1233. return object;
  1234. }
  1235. function _get(target, property, receiver) {
  1236. if (typeof Reflect !== "undefined" && Reflect.get) {
  1237. _get = Reflect.get;
  1238. } else {
  1239. _get = function _get(target, property, receiver) {
  1240. var base = _superPropBase(target, property);
  1241. if (!base) return;
  1242. var desc = Object.getOwnPropertyDescriptor(base, property);
  1243. if (desc.get) {
  1244. return desc.get.call(receiver);
  1245. }
  1246. return desc.value;
  1247. };
  1248. }
  1249. return _get(target, property, receiver || target);
  1250. }
  1251. /**
  1252. * @author: Dustin Utecht
  1253. * @github: https://github.com/UtechtDustin
  1254. */
  1255. var Utils = $.fn.bootstrapTable.utils;
  1256. $.extend($.fn.bootstrapTable.defaults, {
  1257. customView: false,
  1258. showCustomView: false,
  1259. showCustomViewButton: false
  1260. });
  1261. $.extend($.fn.bootstrapTable.defaults.icons, {
  1262. customView: {
  1263. bootstrap3: 'glyphicon glyphicon-eye-open',
  1264. bootstrap4: 'fa fa-eye',
  1265. semantic: 'fa fa-eye',
  1266. foundation: 'fa fa-eye',
  1267. bulma: 'fa fa-eye',
  1268. materialize: 'remove_red_eye'
  1269. }[$.fn.bootstrapTable.theme] || 'fa-eye'
  1270. });
  1271. $.extend($.fn.bootstrapTable.defaults, {
  1272. onCustomViewPostBody: function onCustomViewPostBody() {
  1273. return false;
  1274. },
  1275. onCustomViewPreBody: function onCustomViewPreBody() {
  1276. return false;
  1277. }
  1278. });
  1279. $.extend($.fn.bootstrapTable.locales, {
  1280. formatToggleCustomView: function formatToggleCustomView() {
  1281. return 'Toggle custom view';
  1282. }
  1283. });
  1284. $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
  1285. $.fn.bootstrapTable.methods.push('toggleCustomView');
  1286. $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
  1287. 'custom-view-post-body.bs.table': 'onCustomViewPostBody',
  1288. 'custom-view-pre-body.bs.table': 'onCustomViewPreBody'
  1289. });
  1290. $.BootstrapTable =
  1291. /*#__PURE__*/
  1292. function (_$$BootstrapTable) {
  1293. _inherits(_class, _$$BootstrapTable);
  1294. function _class() {
  1295. _classCallCheck(this, _class);
  1296. return _possibleConstructorReturn(this, _getPrototypeOf(_class).apply(this, arguments));
  1297. }
  1298. _createClass(_class, [{
  1299. key: "init",
  1300. value: function init() {
  1301. this.showCustomView = this.options.showCustomView;
  1302. _get(_getPrototypeOf(_class.prototype), "init", this).call(this);
  1303. }
  1304. }, {
  1305. key: "initToolbar",
  1306. value: function initToolbar() {
  1307. var _get2;
  1308. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1309. args[_key] = arguments[_key];
  1310. }
  1311. (_get2 = _get(_getPrototypeOf(_class.prototype), "initToolbar", this)).call.apply(_get2, [this].concat(args));
  1312. if (this.options.customView && this.options.showCustomViewButton) {
  1313. var $btnGroup = this.$toolbar.find('>.' + this.constants.classes.buttonsGroup.split(' ').join('.')).first();
  1314. var $btnToggleCustomView = $btnGroup.find('.toggle-custom-view');
  1315. if (!$btnToggleCustomView.length) {
  1316. $btnToggleCustomView = $("\n <button class=\"toggle-custom-view ".concat(this.constants.buttonsClass, "\"\n type=\"button\" title=\"").concat(this.options.formatToggleCustomView(), "\">\n ").concat(this.options.showButtonIcons ? Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.customView) : '', "\n ").concat(this.options.showButtonText ? this.options.formatToggleCustomView() : '', "\n </button>\n ")).appendTo($btnGroup);
  1317. $btnToggleCustomView.on('click', $.proxy(this.toggleCustomView, this));
  1318. }
  1319. }
  1320. }
  1321. }, {
  1322. key: "initBody",
  1323. value: function initBody() {
  1324. _get(_getPrototypeOf(_class.prototype), "initBody", this).call(this);
  1325. if (!this.options.customView) {
  1326. return;
  1327. }
  1328. var $table = this.$el;
  1329. var $customViewContainer = this.$container.find('.fixed-table-custom-view');
  1330. $table.hide();
  1331. $customViewContainer.hide();
  1332. if (!this.options.customView || !this.showCustomView) {
  1333. $table.show();
  1334. return;
  1335. }
  1336. var data = this.getData().slice(this.pageFrom - 1, this.pageTo);
  1337. var value = Utils.calculateObjectValue(this, this.options.customView, [data], '');
  1338. this.trigger('custom-view-pre-body', data, value);
  1339. if ($customViewContainer.length === 1) {
  1340. $customViewContainer.show().html(value);
  1341. } else {
  1342. this.$tableBody.after("<div class=\"fixed-table-custom-view\">".concat(value, "</div>"));
  1343. }
  1344. this.trigger('custom-view-post-body', data, value);
  1345. }
  1346. }, {
  1347. key: "toggleCustomView",
  1348. value: function toggleCustomView() {
  1349. this.showCustomView = !this.showCustomView;
  1350. this.initBody();
  1351. }
  1352. }]);
  1353. return _class;
  1354. }($.BootstrapTable);
  1355. })));