bootstrap-table-reorder-columns.js 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491
  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 = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jQuery));
  5. }(this, (function ($) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($);
  8. function _classCallCheck(instance, Constructor) {
  9. if (!(instance instanceof Constructor)) {
  10. throw new TypeError("Cannot call a class as a function");
  11. }
  12. }
  13. function _defineProperties(target, props) {
  14. for (var i = 0; i < props.length; i++) {
  15. var descriptor = props[i];
  16. descriptor.enumerable = descriptor.enumerable || false;
  17. descriptor.configurable = true;
  18. if ("value" in descriptor) descriptor.writable = true;
  19. Object.defineProperty(target, descriptor.key, descriptor);
  20. }
  21. }
  22. function _createClass(Constructor, protoProps, staticProps) {
  23. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  24. if (staticProps) _defineProperties(Constructor, staticProps);
  25. return Constructor;
  26. }
  27. function _inherits(subClass, superClass) {
  28. if (typeof superClass !== "function" && superClass !== null) {
  29. throw new TypeError("Super expression must either be null or a function");
  30. }
  31. subClass.prototype = Object.create(superClass && superClass.prototype, {
  32. constructor: {
  33. value: subClass,
  34. writable: true,
  35. configurable: true
  36. }
  37. });
  38. if (superClass) _setPrototypeOf(subClass, superClass);
  39. }
  40. function _getPrototypeOf(o) {
  41. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  42. return o.__proto__ || Object.getPrototypeOf(o);
  43. };
  44. return _getPrototypeOf(o);
  45. }
  46. function _setPrototypeOf(o, p) {
  47. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  48. o.__proto__ = p;
  49. return o;
  50. };
  51. return _setPrototypeOf(o, p);
  52. }
  53. function _isNativeReflectConstruct() {
  54. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  55. if (Reflect.construct.sham) return false;
  56. if (typeof Proxy === "function") return true;
  57. try {
  58. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  59. return true;
  60. } catch (e) {
  61. return false;
  62. }
  63. }
  64. function _assertThisInitialized(self) {
  65. if (self === void 0) {
  66. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  67. }
  68. return self;
  69. }
  70. function _possibleConstructorReturn(self, call) {
  71. if (call && (typeof call === "object" || typeof call === "function")) {
  72. return call;
  73. }
  74. return _assertThisInitialized(self);
  75. }
  76. function _createSuper(Derived) {
  77. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  78. return function _createSuperInternal() {
  79. var Super = _getPrototypeOf(Derived),
  80. result;
  81. if (hasNativeReflectConstruct) {
  82. var NewTarget = _getPrototypeOf(this).constructor;
  83. result = Reflect.construct(Super, arguments, NewTarget);
  84. } else {
  85. result = Super.apply(this, arguments);
  86. }
  87. return _possibleConstructorReturn(this, result);
  88. };
  89. }
  90. function _superPropBase(object, property) {
  91. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  92. object = _getPrototypeOf(object);
  93. if (object === null) break;
  94. }
  95. return object;
  96. }
  97. function _get(target, property, receiver) {
  98. if (typeof Reflect !== "undefined" && Reflect.get) {
  99. _get = Reflect.get;
  100. } else {
  101. _get = function _get(target, property, receiver) {
  102. var base = _superPropBase(target, property);
  103. if (!base) return;
  104. var desc = Object.getOwnPropertyDescriptor(base, property);
  105. if (desc.get) {
  106. return desc.get.call(receiver);
  107. }
  108. return desc.value;
  109. };
  110. }
  111. return _get(target, property, receiver || target);
  112. }
  113. function _slicedToArray(arr, i) {
  114. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  115. }
  116. function _arrayWithHoles(arr) {
  117. if (Array.isArray(arr)) return arr;
  118. }
  119. function _iterableToArrayLimit(arr, i) {
  120. if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
  121. var _arr = [];
  122. var _n = true;
  123. var _d = false;
  124. var _e = undefined;
  125. try {
  126. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  127. _arr.push(_s.value);
  128. if (i && _arr.length === i) break;
  129. }
  130. } catch (err) {
  131. _d = true;
  132. _e = err;
  133. } finally {
  134. try {
  135. if (!_n && _i["return"] != null) _i["return"]();
  136. } finally {
  137. if (_d) throw _e;
  138. }
  139. }
  140. return _arr;
  141. }
  142. function _unsupportedIterableToArray(o, minLen) {
  143. if (!o) return;
  144. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  145. var n = Object.prototype.toString.call(o).slice(8, -1);
  146. if (n === "Object" && o.constructor) n = o.constructor.name;
  147. if (n === "Map" || n === "Set") return Array.from(o);
  148. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  149. }
  150. function _arrayLikeToArray(arr, len) {
  151. if (len == null || len > arr.length) len = arr.length;
  152. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  153. return arr2;
  154. }
  155. function _nonIterableRest() {
  156. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  157. }
  158. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  159. function createCommonjsModule(fn, module) {
  160. return module = { exports: {} }, fn(module, module.exports), module.exports;
  161. }
  162. var check = function (it) {
  163. return it && it.Math == Math && it;
  164. };
  165. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  166. var global_1 =
  167. // eslint-disable-next-line es/no-global-this -- safe
  168. check(typeof globalThis == 'object' && globalThis) ||
  169. check(typeof window == 'object' && window) ||
  170. // eslint-disable-next-line no-restricted-globals -- safe
  171. check(typeof self == 'object' && self) ||
  172. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  173. // eslint-disable-next-line no-new-func -- fallback
  174. (function () { return this; })() || Function('return this')();
  175. var fails = function (exec) {
  176. try {
  177. return !!exec();
  178. } catch (error) {
  179. return true;
  180. }
  181. };
  182. // Detect IE8's incomplete defineProperty implementation
  183. var descriptors = !fails(function () {
  184. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  185. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  186. });
  187. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  188. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  189. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  190. // Nashorn ~ JDK8 bug
  191. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  192. // `Object.prototype.propertyIsEnumerable` method implementation
  193. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  194. var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  195. var descriptor = getOwnPropertyDescriptor$1(this, V);
  196. return !!descriptor && descriptor.enumerable;
  197. } : $propertyIsEnumerable;
  198. var objectPropertyIsEnumerable = {
  199. f: f$4
  200. };
  201. var createPropertyDescriptor = function (bitmap, value) {
  202. return {
  203. enumerable: !(bitmap & 1),
  204. configurable: !(bitmap & 2),
  205. writable: !(bitmap & 4),
  206. value: value
  207. };
  208. };
  209. var toString = {}.toString;
  210. var classofRaw = function (it) {
  211. return toString.call(it).slice(8, -1);
  212. };
  213. var split = ''.split;
  214. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  215. var indexedObject = fails(function () {
  216. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  217. // eslint-disable-next-line no-prototype-builtins -- safe
  218. return !Object('z').propertyIsEnumerable(0);
  219. }) ? function (it) {
  220. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  221. } : Object;
  222. // `RequireObjectCoercible` abstract operation
  223. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  224. var requireObjectCoercible = function (it) {
  225. if (it == undefined) throw TypeError("Can't call method on " + it);
  226. return it;
  227. };
  228. // toObject with fallback for non-array-like ES3 strings
  229. var toIndexedObject = function (it) {
  230. return indexedObject(requireObjectCoercible(it));
  231. };
  232. var isObject = function (it) {
  233. return typeof it === 'object' ? it !== null : typeof it === 'function';
  234. };
  235. // `ToPrimitive` abstract operation
  236. // https://tc39.es/ecma262/#sec-toprimitive
  237. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  238. // and the second argument - flag - preferred type is a string
  239. var toPrimitive = function (input, PREFERRED_STRING) {
  240. if (!isObject(input)) return input;
  241. var fn, val;
  242. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  243. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  244. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  245. throw TypeError("Can't convert object to primitive value");
  246. };
  247. var hasOwnProperty = {}.hasOwnProperty;
  248. var has$1 = function (it, key) {
  249. return hasOwnProperty.call(it, key);
  250. };
  251. var document$1 = global_1.document;
  252. // typeof document.createElement is 'object' in old IE
  253. var EXISTS = isObject(document$1) && isObject(document$1.createElement);
  254. var documentCreateElement = function (it) {
  255. return EXISTS ? document$1.createElement(it) : {};
  256. };
  257. // Thank's IE8 for his funny defineProperty
  258. var ie8DomDefine = !descriptors && !fails(function () {
  259. // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
  260. return Object.defineProperty(documentCreateElement('div'), 'a', {
  261. get: function () { return 7; }
  262. }).a != 7;
  263. });
  264. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  265. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  266. // `Object.getOwnPropertyDescriptor` method
  267. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  268. var f$3 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  269. O = toIndexedObject(O);
  270. P = toPrimitive(P, true);
  271. if (ie8DomDefine) try {
  272. return $getOwnPropertyDescriptor(O, P);
  273. } catch (error) { /* empty */ }
  274. if (has$1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  275. };
  276. var objectGetOwnPropertyDescriptor = {
  277. f: f$3
  278. };
  279. var anObject = function (it) {
  280. if (!isObject(it)) {
  281. throw TypeError(String(it) + ' is not an object');
  282. } return it;
  283. };
  284. // eslint-disable-next-line es/no-object-defineproperty -- safe
  285. var $defineProperty = Object.defineProperty;
  286. // `Object.defineProperty` method
  287. // https://tc39.es/ecma262/#sec-object.defineproperty
  288. var f$2 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
  289. anObject(O);
  290. P = toPrimitive(P, true);
  291. anObject(Attributes);
  292. if (ie8DomDefine) try {
  293. return $defineProperty(O, P, Attributes);
  294. } catch (error) { /* empty */ }
  295. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  296. if ('value' in Attributes) O[P] = Attributes.value;
  297. return O;
  298. };
  299. var objectDefineProperty = {
  300. f: f$2
  301. };
  302. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  303. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  304. } : function (object, key, value) {
  305. object[key] = value;
  306. return object;
  307. };
  308. var setGlobal = function (key, value) {
  309. try {
  310. createNonEnumerableProperty(global_1, key, value);
  311. } catch (error) {
  312. global_1[key] = value;
  313. } return value;
  314. };
  315. var SHARED = '__core-js_shared__';
  316. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  317. var sharedStore = store$1;
  318. var functionToString = Function.toString;
  319. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  320. if (typeof sharedStore.inspectSource != 'function') {
  321. sharedStore.inspectSource = function (it) {
  322. return functionToString.call(it);
  323. };
  324. }
  325. var inspectSource = sharedStore.inspectSource;
  326. var WeakMap$1 = global_1.WeakMap;
  327. var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));
  328. var shared = createCommonjsModule(function (module) {
  329. (module.exports = function (key, value) {
  330. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  331. })('versions', []).push({
  332. version: '3.10.1',
  333. mode: 'global',
  334. copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
  335. });
  336. });
  337. var id = 0;
  338. var postfix = Math.random();
  339. var uid = function (key) {
  340. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  341. };
  342. var keys = shared('keys');
  343. var sharedKey = function (key) {
  344. return keys[key] || (keys[key] = uid(key));
  345. };
  346. var hiddenKeys$1 = {};
  347. var WeakMap = global_1.WeakMap;
  348. var set, get, has;
  349. var enforce = function (it) {
  350. return has(it) ? get(it) : set(it, {});
  351. };
  352. var getterFor = function (TYPE) {
  353. return function (it) {
  354. var state;
  355. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  356. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  357. } return state;
  358. };
  359. };
  360. if (nativeWeakMap) {
  361. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  362. var wmget = store.get;
  363. var wmhas = store.has;
  364. var wmset = store.set;
  365. set = function (it, metadata) {
  366. metadata.facade = it;
  367. wmset.call(store, it, metadata);
  368. return metadata;
  369. };
  370. get = function (it) {
  371. return wmget.call(store, it) || {};
  372. };
  373. has = function (it) {
  374. return wmhas.call(store, it);
  375. };
  376. } else {
  377. var STATE = sharedKey('state');
  378. hiddenKeys$1[STATE] = true;
  379. set = function (it, metadata) {
  380. metadata.facade = it;
  381. createNonEnumerableProperty(it, STATE, metadata);
  382. return metadata;
  383. };
  384. get = function (it) {
  385. return has$1(it, STATE) ? it[STATE] : {};
  386. };
  387. has = function (it) {
  388. return has$1(it, STATE);
  389. };
  390. }
  391. var internalState = {
  392. set: set,
  393. get: get,
  394. has: has,
  395. enforce: enforce,
  396. getterFor: getterFor
  397. };
  398. var redefine = createCommonjsModule(function (module) {
  399. var getInternalState = internalState.get;
  400. var enforceInternalState = internalState.enforce;
  401. var TEMPLATE = String(String).split('String');
  402. (module.exports = function (O, key, value, options) {
  403. var unsafe = options ? !!options.unsafe : false;
  404. var simple = options ? !!options.enumerable : false;
  405. var noTargetGet = options ? !!options.noTargetGet : false;
  406. var state;
  407. if (typeof value == 'function') {
  408. if (typeof key == 'string' && !has$1(value, 'name')) {
  409. createNonEnumerableProperty(value, 'name', key);
  410. }
  411. state = enforceInternalState(value);
  412. if (!state.source) {
  413. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  414. }
  415. }
  416. if (O === global_1) {
  417. if (simple) O[key] = value;
  418. else setGlobal(key, value);
  419. return;
  420. } else if (!unsafe) {
  421. delete O[key];
  422. } else if (!noTargetGet && O[key]) {
  423. simple = true;
  424. }
  425. if (simple) O[key] = value;
  426. else createNonEnumerableProperty(O, key, value);
  427. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  428. })(Function.prototype, 'toString', function toString() {
  429. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  430. });
  431. });
  432. var path = global_1;
  433. var aFunction$1 = function (variable) {
  434. return typeof variable == 'function' ? variable : undefined;
  435. };
  436. var getBuiltIn = function (namespace, method) {
  437. return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(global_1[namespace])
  438. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  439. };
  440. var ceil = Math.ceil;
  441. var floor = Math.floor;
  442. // `ToInteger` abstract operation
  443. // https://tc39.es/ecma262/#sec-tointeger
  444. var toInteger = function (argument) {
  445. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  446. };
  447. var min$1 = Math.min;
  448. // `ToLength` abstract operation
  449. // https://tc39.es/ecma262/#sec-tolength
  450. var toLength = function (argument) {
  451. return argument > 0 ? min$1(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  452. };
  453. var max = Math.max;
  454. var min = Math.min;
  455. // Helper for a popular repeating case of the spec:
  456. // Let integer be ? ToInteger(index).
  457. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  458. var toAbsoluteIndex = function (index, length) {
  459. var integer = toInteger(index);
  460. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  461. };
  462. // `Array.prototype.{ indexOf, includes }` methods implementation
  463. var createMethod$3 = function (IS_INCLUDES) {
  464. return function ($this, el, fromIndex) {
  465. var O = toIndexedObject($this);
  466. var length = toLength(O.length);
  467. var index = toAbsoluteIndex(fromIndex, length);
  468. var value;
  469. // Array#includes uses SameValueZero equality algorithm
  470. // eslint-disable-next-line no-self-compare -- NaN check
  471. if (IS_INCLUDES && el != el) while (length > index) {
  472. value = O[index++];
  473. // eslint-disable-next-line no-self-compare -- NaN check
  474. if (value != value) return true;
  475. // Array#indexOf ignores holes, Array#includes - not
  476. } else for (;length > index; index++) {
  477. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  478. } return !IS_INCLUDES && -1;
  479. };
  480. };
  481. var arrayIncludes = {
  482. // `Array.prototype.includes` method
  483. // https://tc39.es/ecma262/#sec-array.prototype.includes
  484. includes: createMethod$3(true),
  485. // `Array.prototype.indexOf` method
  486. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  487. indexOf: createMethod$3(false)
  488. };
  489. var indexOf = arrayIncludes.indexOf;
  490. var objectKeysInternal = function (object, names) {
  491. var O = toIndexedObject(object);
  492. var i = 0;
  493. var result = [];
  494. var key;
  495. for (key in O) !has$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key);
  496. // Don't enum bug & hidden keys
  497. while (names.length > i) if (has$1(O, key = names[i++])) {
  498. ~indexOf(result, key) || result.push(key);
  499. }
  500. return result;
  501. };
  502. // IE8- don't enum bug keys
  503. var enumBugKeys = [
  504. 'constructor',
  505. 'hasOwnProperty',
  506. 'isPrototypeOf',
  507. 'propertyIsEnumerable',
  508. 'toLocaleString',
  509. 'toString',
  510. 'valueOf'
  511. ];
  512. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  513. // `Object.getOwnPropertyNames` method
  514. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  515. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  516. var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  517. return objectKeysInternal(O, hiddenKeys);
  518. };
  519. var objectGetOwnPropertyNames = {
  520. f: f$1
  521. };
  522. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  523. var f = Object.getOwnPropertySymbols;
  524. var objectGetOwnPropertySymbols = {
  525. f: f
  526. };
  527. // all object keys, includes non-enumerable and symbols
  528. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  529. var keys = objectGetOwnPropertyNames.f(anObject(it));
  530. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  531. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  532. };
  533. var copyConstructorProperties = function (target, source) {
  534. var keys = ownKeys(source);
  535. var defineProperty = objectDefineProperty.f;
  536. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  537. for (var i = 0; i < keys.length; i++) {
  538. var key = keys[i];
  539. if (!has$1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  540. }
  541. };
  542. var replacement = /#|\.prototype\./;
  543. var isForced = function (feature, detection) {
  544. var value = data[normalize(feature)];
  545. return value == POLYFILL ? true
  546. : value == NATIVE ? false
  547. : typeof detection == 'function' ? fails(detection)
  548. : !!detection;
  549. };
  550. var normalize = isForced.normalize = function (string) {
  551. return String(string).replace(replacement, '.').toLowerCase();
  552. };
  553. var data = isForced.data = {};
  554. var NATIVE = isForced.NATIVE = 'N';
  555. var POLYFILL = isForced.POLYFILL = 'P';
  556. var isForced_1 = isForced;
  557. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  558. /*
  559. options.target - name of the target object
  560. options.global - target is the global object
  561. options.stat - export as static methods of target
  562. options.proto - export as prototype methods of target
  563. options.real - real prototype method for the `pure` version
  564. options.forced - export even if the native feature is available
  565. options.bind - bind methods to the target, required for the `pure` version
  566. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  567. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  568. options.sham - add a flag to not completely full polyfills
  569. options.enumerable - export as enumerable property
  570. options.noTargetGet - prevent calling a getter on target
  571. */
  572. var _export = function (options, source) {
  573. var TARGET = options.target;
  574. var GLOBAL = options.global;
  575. var STATIC = options.stat;
  576. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  577. if (GLOBAL) {
  578. target = global_1;
  579. } else if (STATIC) {
  580. target = global_1[TARGET] || setGlobal(TARGET, {});
  581. } else {
  582. target = (global_1[TARGET] || {}).prototype;
  583. }
  584. if (target) for (key in source) {
  585. sourceProperty = source[key];
  586. if (options.noTargetGet) {
  587. descriptor = getOwnPropertyDescriptor(target, key);
  588. targetProperty = descriptor && descriptor.value;
  589. } else targetProperty = target[key];
  590. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  591. // contained in target
  592. if (!FORCED && targetProperty !== undefined) {
  593. if (typeof sourceProperty === typeof targetProperty) continue;
  594. copyConstructorProperties(sourceProperty, targetProperty);
  595. }
  596. // add a flag to not completely full polyfills
  597. if (options.sham || (targetProperty && targetProperty.sham)) {
  598. createNonEnumerableProperty(sourceProperty, 'sham', true);
  599. }
  600. // extend global
  601. redefine(target, key, sourceProperty, options);
  602. }
  603. };
  604. // `Object.keys` method
  605. // https://tc39.es/ecma262/#sec-object.keys
  606. // eslint-disable-next-line es/no-object-keys -- safe
  607. var objectKeys = Object.keys || function keys(O) {
  608. return objectKeysInternal(O, enumBugKeys);
  609. };
  610. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  611. // `Object.{ entries, values }` methods implementation
  612. var createMethod$2 = function (TO_ENTRIES) {
  613. return function (it) {
  614. var O = toIndexedObject(it);
  615. var keys = objectKeys(O);
  616. var length = keys.length;
  617. var i = 0;
  618. var result = [];
  619. var key;
  620. while (length > i) {
  621. key = keys[i++];
  622. if (!descriptors || propertyIsEnumerable.call(O, key)) {
  623. result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
  624. }
  625. }
  626. return result;
  627. };
  628. };
  629. var objectToArray = {
  630. // `Object.entries` method
  631. // https://tc39.es/ecma262/#sec-object.entries
  632. entries: createMethod$2(true),
  633. // `Object.values` method
  634. // https://tc39.es/ecma262/#sec-object.values
  635. values: createMethod$2(false)
  636. };
  637. var $entries = objectToArray.entries;
  638. // `Object.entries` method
  639. // https://tc39.es/ecma262/#sec-object.entries
  640. _export({ target: 'Object', stat: true }, {
  641. entries: function entries(O) {
  642. return $entries(O);
  643. }
  644. });
  645. var aFunction = function (it) {
  646. if (typeof it != 'function') {
  647. throw TypeError(String(it) + ' is not a function');
  648. } return it;
  649. };
  650. // optional / simple context binding
  651. var functionBindContext = function (fn, that, length) {
  652. aFunction(fn);
  653. if (that === undefined) return fn;
  654. switch (length) {
  655. case 0: return function () {
  656. return fn.call(that);
  657. };
  658. case 1: return function (a) {
  659. return fn.call(that, a);
  660. };
  661. case 2: return function (a, b) {
  662. return fn.call(that, a, b);
  663. };
  664. case 3: return function (a, b, c) {
  665. return fn.call(that, a, b, c);
  666. };
  667. }
  668. return function (/* ...args */) {
  669. return fn.apply(that, arguments);
  670. };
  671. };
  672. // `ToObject` abstract operation
  673. // https://tc39.es/ecma262/#sec-toobject
  674. var toObject = function (argument) {
  675. return Object(requireObjectCoercible(argument));
  676. };
  677. // `IsArray` abstract operation
  678. // https://tc39.es/ecma262/#sec-isarray
  679. // eslint-disable-next-line es/no-array-isarray -- safe
  680. var isArray = Array.isArray || function isArray(arg) {
  681. return classofRaw(arg) == 'Array';
  682. };
  683. var engineIsNode = classofRaw(global_1.process) == 'process';
  684. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  685. var process = global_1.process;
  686. var versions = process && process.versions;
  687. var v8 = versions && versions.v8;
  688. var match, version;
  689. if (v8) {
  690. match = v8.split('.');
  691. version = match[0] + match[1];
  692. } else if (engineUserAgent) {
  693. match = engineUserAgent.match(/Edge\/(\d+)/);
  694. if (!match || match[1] >= 74) {
  695. match = engineUserAgent.match(/Chrome\/(\d+)/);
  696. if (match) version = match[1];
  697. }
  698. }
  699. var engineV8Version = version && +version;
  700. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  701. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  702. // eslint-disable-next-line es/no-symbol -- required for testing
  703. return !Symbol.sham &&
  704. // Chrome 38 Symbol has incorrect toString conversion
  705. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  706. (engineIsNode ? engineV8Version === 38 : engineV8Version > 37 && engineV8Version < 41);
  707. });
  708. /* eslint-disable es/no-symbol -- required for testing */
  709. var useSymbolAsUid = nativeSymbol
  710. && !Symbol.sham
  711. && typeof Symbol.iterator == 'symbol';
  712. var WellKnownSymbolsStore = shared('wks');
  713. var Symbol$1 = global_1.Symbol;
  714. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  715. var wellKnownSymbol = function (name) {
  716. if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  717. if (nativeSymbol && has$1(Symbol$1, name)) {
  718. WellKnownSymbolsStore[name] = Symbol$1[name];
  719. } else {
  720. WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  721. }
  722. } return WellKnownSymbolsStore[name];
  723. };
  724. var SPECIES$1 = wellKnownSymbol('species');
  725. // `ArraySpeciesCreate` abstract operation
  726. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  727. var arraySpeciesCreate = function (originalArray, length) {
  728. var C;
  729. if (isArray(originalArray)) {
  730. C = originalArray.constructor;
  731. // cross-realm fallback
  732. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  733. else if (isObject(C)) {
  734. C = C[SPECIES$1];
  735. if (C === null) C = undefined;
  736. }
  737. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  738. };
  739. var push = [].push;
  740. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  741. var createMethod$1 = function (TYPE) {
  742. var IS_MAP = TYPE == 1;
  743. var IS_FILTER = TYPE == 2;
  744. var IS_SOME = TYPE == 3;
  745. var IS_EVERY = TYPE == 4;
  746. var IS_FIND_INDEX = TYPE == 6;
  747. var IS_FILTER_OUT = TYPE == 7;
  748. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  749. return function ($this, callbackfn, that, specificCreate) {
  750. var O = toObject($this);
  751. var self = indexedObject(O);
  752. var boundFunction = functionBindContext(callbackfn, that, 3);
  753. var length = toLength(self.length);
  754. var index = 0;
  755. var create = specificCreate || arraySpeciesCreate;
  756. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  757. var value, result;
  758. for (;length > index; index++) if (NO_HOLES || index in self) {
  759. value = self[index];
  760. result = boundFunction(value, index, O);
  761. if (TYPE) {
  762. if (IS_MAP) target[index] = result; // map
  763. else if (result) switch (TYPE) {
  764. case 3: return true; // some
  765. case 5: return value; // find
  766. case 6: return index; // findIndex
  767. case 2: push.call(target, value); // filter
  768. } else switch (TYPE) {
  769. case 4: return false; // every
  770. case 7: push.call(target, value); // filterOut
  771. }
  772. }
  773. }
  774. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  775. };
  776. };
  777. var arrayIteration = {
  778. // `Array.prototype.forEach` method
  779. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  780. forEach: createMethod$1(0),
  781. // `Array.prototype.map` method
  782. // https://tc39.es/ecma262/#sec-array.prototype.map
  783. map: createMethod$1(1),
  784. // `Array.prototype.filter` method
  785. // https://tc39.es/ecma262/#sec-array.prototype.filter
  786. filter: createMethod$1(2),
  787. // `Array.prototype.some` method
  788. // https://tc39.es/ecma262/#sec-array.prototype.some
  789. some: createMethod$1(3),
  790. // `Array.prototype.every` method
  791. // https://tc39.es/ecma262/#sec-array.prototype.every
  792. every: createMethod$1(4),
  793. // `Array.prototype.find` method
  794. // https://tc39.es/ecma262/#sec-array.prototype.find
  795. find: createMethod$1(5),
  796. // `Array.prototype.findIndex` method
  797. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  798. findIndex: createMethod$1(6),
  799. // `Array.prototype.filterOut` method
  800. // https://github.com/tc39/proposal-array-filtering
  801. filterOut: createMethod$1(7)
  802. };
  803. // `Object.defineProperties` method
  804. // https://tc39.es/ecma262/#sec-object.defineproperties
  805. // eslint-disable-next-line es/no-object-defineproperties -- safe
  806. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  807. anObject(O);
  808. var keys = objectKeys(Properties);
  809. var length = keys.length;
  810. var index = 0;
  811. var key;
  812. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  813. return O;
  814. };
  815. var html = getBuiltIn('document', 'documentElement');
  816. var GT = '>';
  817. var LT = '<';
  818. var PROTOTYPE = 'prototype';
  819. var SCRIPT = 'script';
  820. var IE_PROTO = sharedKey('IE_PROTO');
  821. var EmptyConstructor = function () { /* empty */ };
  822. var scriptTag = function (content) {
  823. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  824. };
  825. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  826. var NullProtoObjectViaActiveX = function (activeXDocument) {
  827. activeXDocument.write(scriptTag(''));
  828. activeXDocument.close();
  829. var temp = activeXDocument.parentWindow.Object;
  830. activeXDocument = null; // avoid memory leak
  831. return temp;
  832. };
  833. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  834. var NullProtoObjectViaIFrame = function () {
  835. // Thrash, waste and sodomy: IE GC bug
  836. var iframe = documentCreateElement('iframe');
  837. var JS = 'java' + SCRIPT + ':';
  838. var iframeDocument;
  839. iframe.style.display = 'none';
  840. html.appendChild(iframe);
  841. // https://github.com/zloirock/core-js/issues/475
  842. iframe.src = String(JS);
  843. iframeDocument = iframe.contentWindow.document;
  844. iframeDocument.open();
  845. iframeDocument.write(scriptTag('document.F=Object'));
  846. iframeDocument.close();
  847. return iframeDocument.F;
  848. };
  849. // Check for document.domain and active x support
  850. // No need to use active x approach when document.domain is not set
  851. // see https://github.com/es-shims/es5-shim/issues/150
  852. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  853. // avoid IE GC bug
  854. var activeXDocument;
  855. var NullProtoObject = function () {
  856. try {
  857. /* global ActiveXObject -- old IE */
  858. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  859. } catch (error) { /* ignore */ }
  860. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  861. var length = enumBugKeys.length;
  862. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  863. return NullProtoObject();
  864. };
  865. hiddenKeys$1[IE_PROTO] = true;
  866. // `Object.create` method
  867. // https://tc39.es/ecma262/#sec-object.create
  868. var objectCreate = Object.create || function create(O, Properties) {
  869. var result;
  870. if (O !== null) {
  871. EmptyConstructor[PROTOTYPE] = anObject(O);
  872. result = new EmptyConstructor();
  873. EmptyConstructor[PROTOTYPE] = null;
  874. // add "__proto__" for Object.getPrototypeOf polyfill
  875. result[IE_PROTO] = O;
  876. } else result = NullProtoObject();
  877. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  878. };
  879. var UNSCOPABLES = wellKnownSymbol('unscopables');
  880. var ArrayPrototype = Array.prototype;
  881. // Array.prototype[@@unscopables]
  882. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  883. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  884. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  885. configurable: true,
  886. value: objectCreate(null)
  887. });
  888. }
  889. // add a key to Array.prototype[@@unscopables]
  890. var addToUnscopables = function (key) {
  891. ArrayPrototype[UNSCOPABLES][key] = true;
  892. };
  893. var $find = arrayIteration.find;
  894. var FIND = 'find';
  895. var SKIPS_HOLES = true;
  896. // Shouldn't skip holes
  897. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  898. // `Array.prototype.find` method
  899. // https://tc39.es/ecma262/#sec-array.prototype.find
  900. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  901. find: function find(callbackfn /* , that = undefined */) {
  902. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  903. }
  904. });
  905. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  906. addToUnscopables(FIND);
  907. // a string of all valid unicode whitespaces
  908. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  909. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  910. var whitespace = '[' + whitespaces + ']';
  911. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  912. var rtrim = RegExp(whitespace + whitespace + '*$');
  913. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  914. var createMethod = function (TYPE) {
  915. return function ($this) {
  916. var string = String(requireObjectCoercible($this));
  917. if (TYPE & 1) string = string.replace(ltrim, '');
  918. if (TYPE & 2) string = string.replace(rtrim, '');
  919. return string;
  920. };
  921. };
  922. var stringTrim = {
  923. // `String.prototype.{ trimLeft, trimStart }` methods
  924. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  925. start: createMethod(1),
  926. // `String.prototype.{ trimRight, trimEnd }` methods
  927. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  928. end: createMethod(2),
  929. // `String.prototype.trim` method
  930. // https://tc39.es/ecma262/#sec-string.prototype.trim
  931. trim: createMethod(3)
  932. };
  933. var trim = stringTrim.trim;
  934. var $parseInt = global_1.parseInt;
  935. var hex = /^[+-]?0[Xx]/;
  936. var FORCED$1 = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22;
  937. // `parseInt` method
  938. // https://tc39.es/ecma262/#sec-parseint-string-radix
  939. var numberParseInt = FORCED$1 ? function parseInt(string, radix) {
  940. var S = trim(String(string));
  941. return $parseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
  942. } : $parseInt;
  943. // `parseInt` method
  944. // https://tc39.es/ecma262/#sec-parseint-string-radix
  945. _export({ global: true, forced: parseInt != numberParseInt }, {
  946. parseInt: numberParseInt
  947. });
  948. var SPECIES = wellKnownSymbol('species');
  949. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  950. // We can't use this feature detection in V8 since it causes
  951. // deoptimization and serious performance degradation
  952. // https://github.com/zloirock/core-js/issues/677
  953. return engineV8Version >= 51 || !fails(function () {
  954. var array = [];
  955. var constructor = array.constructor = {};
  956. constructor[SPECIES] = function () {
  957. return { foo: 1 };
  958. };
  959. return array[METHOD_NAME](Boolean).foo !== 1;
  960. });
  961. };
  962. var $filter = arrayIteration.filter;
  963. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  964. // `Array.prototype.filter` method
  965. // https://tc39.es/ecma262/#sec-array.prototype.filter
  966. // with adding support of @@species
  967. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  968. filter: function filter(callbackfn /* , thisArg */) {
  969. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  970. }
  971. });
  972. var createProperty = function (object, key, value) {
  973. var propertyKey = toPrimitive(key);
  974. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  975. else object[propertyKey] = value;
  976. };
  977. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  978. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  979. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  980. // We can't use this feature detection in V8 since it causes
  981. // deoptimization and serious performance degradation
  982. // https://github.com/zloirock/core-js/issues/679
  983. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  984. var array = [];
  985. array[IS_CONCAT_SPREADABLE] = false;
  986. return array.concat()[0] !== array;
  987. });
  988. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  989. var isConcatSpreadable = function (O) {
  990. if (!isObject(O)) return false;
  991. var spreadable = O[IS_CONCAT_SPREADABLE];
  992. return spreadable !== undefined ? !!spreadable : isArray(O);
  993. };
  994. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  995. // `Array.prototype.concat` method
  996. // https://tc39.es/ecma262/#sec-array.prototype.concat
  997. // with adding support of @@isConcatSpreadable and @@species
  998. _export({ target: 'Array', proto: true, forced: FORCED }, {
  999. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1000. concat: function concat(arg) {
  1001. var O = toObject(this);
  1002. var A = arraySpeciesCreate(O, 0);
  1003. var n = 0;
  1004. var i, k, length, len, E;
  1005. for (i = -1, length = arguments.length; i < length; i++) {
  1006. E = i === -1 ? O : arguments[i];
  1007. if (isConcatSpreadable(E)) {
  1008. len = toLength(E.length);
  1009. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1010. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  1011. } else {
  1012. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1013. createProperty(A, n++, E);
  1014. }
  1015. }
  1016. A.length = n;
  1017. return A;
  1018. }
  1019. });
  1020. /**
  1021. * @author: Dennis Hernández
  1022. * @webSite: http://djhvscf.github.io/Blog
  1023. * @update: https://github.com/wenzhixin
  1024. * @version: v1.2.0
  1025. */
  1026. $__default['default'].akottr.dragtable.prototype._restoreState = function (persistObj) {
  1027. var i = 0;
  1028. for (var _i = 0, _Object$entries = Object.entries(persistObj); _i < _Object$entries.length; _i++) {
  1029. var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
  1030. field = _Object$entries$_i[0],
  1031. value = _Object$entries$_i[1];
  1032. var $th = this.originalTable.el.find("th[data-field=\"".concat(field, "\"]"));
  1033. if (!$th.length) {
  1034. i++;
  1035. continue;
  1036. }
  1037. this.originalTable.startIndex = $th.prevAll().length + 1;
  1038. this.originalTable.endIndex = parseInt(value, 10) + 1 - i;
  1039. this._bubbleCols();
  1040. }
  1041. }; // From MDN site, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
  1042. var filterFn = function filterFn() {
  1043. if (!Array.prototype.filter) {
  1044. Array.prototype.filter = function (fun
  1045. /* , thisArg*/
  1046. ) {
  1047. if (this === undefined || this === null) {
  1048. throw new TypeError();
  1049. }
  1050. var t = Object(this);
  1051. var len = t.length >>> 0;
  1052. if (typeof fun !== 'function') {
  1053. throw new TypeError();
  1054. }
  1055. var res = [];
  1056. var thisArg = arguments.length >= 2 ? arguments[1] : undefined;
  1057. for (var i = 0; i < len; i++) {
  1058. if (i in t) {
  1059. var val = t[i]; // NOTE: Technically this should Object.defineProperty at
  1060. // the next index, as push can be affected by
  1061. // properties on Object.prototype and Array.prototype.
  1062. // But this method's new, and collisions should be
  1063. // rare, so use the more-compatible alternative.
  1064. if (fun.call(thisArg, val, i, t)) {
  1065. res.push(val);
  1066. }
  1067. }
  1068. }
  1069. return res;
  1070. };
  1071. }
  1072. };
  1073. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  1074. reorderableColumns: false,
  1075. maxMovingRows: 10,
  1076. // eslint-disable-next-line no-unused-vars
  1077. onReorderColumn: function onReorderColumn(headerFields) {
  1078. return false;
  1079. },
  1080. dragaccept: null
  1081. });
  1082. $__default['default'].extend($__default['default'].fn.bootstrapTable.Constructor.EVENTS, {
  1083. 'reorder-column.bs.table': 'onReorderColumn'
  1084. });
  1085. $__default['default'].fn.bootstrapTable.methods.push('orderColumns');
  1086. $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1087. _inherits(_class, _$$BootstrapTable);
  1088. var _super = _createSuper(_class);
  1089. function _class() {
  1090. _classCallCheck(this, _class);
  1091. return _super.apply(this, arguments);
  1092. }
  1093. _createClass(_class, [{
  1094. key: "initHeader",
  1095. value: function initHeader() {
  1096. var _get2;
  1097. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1098. args[_key] = arguments[_key];
  1099. }
  1100. (_get2 = _get(_getPrototypeOf(_class.prototype), "initHeader", this)).call.apply(_get2, [this].concat(args));
  1101. if (!this.options.reorderableColumns) {
  1102. return;
  1103. }
  1104. this.makeRowsReorderable();
  1105. }
  1106. }, {
  1107. key: "_toggleColumn",
  1108. value: function _toggleColumn() {
  1109. var _get3;
  1110. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1111. args[_key2] = arguments[_key2];
  1112. }
  1113. (_get3 = _get(_getPrototypeOf(_class.prototype), "_toggleColumn", this)).call.apply(_get3, [this].concat(args));
  1114. if (!this.options.reorderableColumns) {
  1115. return;
  1116. }
  1117. this.makeRowsReorderable();
  1118. }
  1119. }, {
  1120. key: "toggleView",
  1121. value: function toggleView() {
  1122. var _get4;
  1123. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  1124. args[_key3] = arguments[_key3];
  1125. }
  1126. (_get4 = _get(_getPrototypeOf(_class.prototype), "toggleView", this)).call.apply(_get4, [this].concat(args));
  1127. if (!this.options.reorderableColumns) {
  1128. return;
  1129. }
  1130. if (this.options.cardView) {
  1131. return;
  1132. }
  1133. this.makeRowsReorderable();
  1134. }
  1135. }, {
  1136. key: "resetView",
  1137. value: function resetView() {
  1138. var _get5;
  1139. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1140. args[_key4] = arguments[_key4];
  1141. }
  1142. (_get5 = _get(_getPrototypeOf(_class.prototype), "resetView", this)).call.apply(_get5, [this].concat(args));
  1143. if (!this.options.reorderableColumns) {
  1144. return;
  1145. }
  1146. this.makeRowsReorderable();
  1147. }
  1148. }, {
  1149. key: "makeRowsReorderable",
  1150. value: function makeRowsReorderable() {
  1151. var _this = this;
  1152. var order = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  1153. try {
  1154. $__default['default'](this.$el).dragtable('destroy');
  1155. } catch (e) {// do nothing
  1156. }
  1157. $__default['default'](this.$el).dragtable({
  1158. maxMovingRows: this.options.maxMovingRows,
  1159. dragaccept: this.options.dragaccept,
  1160. clickDelay: 200,
  1161. dragHandle: '.th-inner',
  1162. restoreState: order ? order : this.columnsSortOrder,
  1163. beforeStop: function beforeStop(table) {
  1164. var sortOrder = {};
  1165. table.el.find('th').each(function (i, el) {
  1166. sortOrder[$__default['default'](el).data('field')] = i;
  1167. });
  1168. _this.columnsSortOrder = sortOrder;
  1169. if (_this.options.cookie) {
  1170. _this.persistReorderColumnsState(_this);
  1171. }
  1172. var ths = [];
  1173. var formatters = [];
  1174. var columns = [];
  1175. var columnsHidden = [];
  1176. var columnIndex = -1;
  1177. var optionsColumns = [];
  1178. _this.$header.find('th:not(.detail)').each(function (i, el) {
  1179. ths.push($__default['default'](el).data('field'));
  1180. formatters.push($__default['default'](el).data('formatter'));
  1181. }); // Exist columns not shown
  1182. if (ths.length < _this.columns.length) {
  1183. columnsHidden = _this.columns.filter(function (column) {
  1184. return !column.visible;
  1185. });
  1186. for (var i = 0; i < columnsHidden.length; i++) {
  1187. ths.push(columnsHidden[i].field);
  1188. formatters.push(columnsHidden[i].formatter);
  1189. }
  1190. }
  1191. for (var _i2 = 0; _i2 < ths.length; _i2++) {
  1192. columnIndex = _this.fieldsColumnsIndex[ths[_i2]];
  1193. if (columnIndex !== -1) {
  1194. _this.fieldsColumnsIndex[ths[_i2]] = _i2;
  1195. _this.columns[columnIndex].fieldIndex = _i2;
  1196. columns.push(_this.columns[columnIndex]);
  1197. }
  1198. }
  1199. _this.columns = columns;
  1200. filterFn(); // Support <IE9
  1201. $__default['default'].each(_this.columns, function (i, column) {
  1202. var found = false;
  1203. var field = column.field;
  1204. _this.options.columns[0].filter(function (item) {
  1205. if (!found && item['field'] === field) {
  1206. optionsColumns.push(item);
  1207. found = true;
  1208. return false;
  1209. }
  1210. return true;
  1211. });
  1212. });
  1213. _this.options.columns[0] = optionsColumns;
  1214. _this.header.fields = ths;
  1215. _this.header.formatters = formatters;
  1216. _this.initHeader();
  1217. _this.initToolbar();
  1218. _this.initSearchText();
  1219. _this.initBody();
  1220. _this.resetView();
  1221. _this.trigger('reorder-column', ths);
  1222. }
  1223. });
  1224. }
  1225. }, {
  1226. key: "orderColumns",
  1227. value: function orderColumns(order) {
  1228. this.columnsSortOrder = order;
  1229. this.makeRowsReorderable();
  1230. }
  1231. }]);
  1232. return _class;
  1233. }($__default['default'].BootstrapTable);
  1234. })));