bootstrap-table-print.js 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665
  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 _unsupportedIterableToArray(o, minLen) {
  114. if (!o) return;
  115. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  116. var n = Object.prototype.toString.call(o).slice(8, -1);
  117. if (n === "Object" && o.constructor) n = o.constructor.name;
  118. if (n === "Map" || n === "Set") return Array.from(o);
  119. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  120. }
  121. function _arrayLikeToArray(arr, len) {
  122. if (len == null || len > arr.length) len = arr.length;
  123. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  124. return arr2;
  125. }
  126. function _createForOfIteratorHelper(o, allowArrayLike) {
  127. var it;
  128. if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
  129. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  130. if (it) o = it;
  131. var i = 0;
  132. var F = function () {};
  133. return {
  134. s: F,
  135. n: function () {
  136. if (i >= o.length) return {
  137. done: true
  138. };
  139. return {
  140. done: false,
  141. value: o[i++]
  142. };
  143. },
  144. e: function (e) {
  145. throw e;
  146. },
  147. f: F
  148. };
  149. }
  150. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  151. }
  152. var normalCompletion = true,
  153. didErr = false,
  154. err;
  155. return {
  156. s: function () {
  157. it = o[Symbol.iterator]();
  158. },
  159. n: function () {
  160. var step = it.next();
  161. normalCompletion = step.done;
  162. return step;
  163. },
  164. e: function (e) {
  165. didErr = true;
  166. err = e;
  167. },
  168. f: function () {
  169. try {
  170. if (!normalCompletion && it.return != null) it.return();
  171. } finally {
  172. if (didErr) throw err;
  173. }
  174. }
  175. };
  176. }
  177. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  178. function createCommonjsModule(fn, module) {
  179. return module = { exports: {} }, fn(module, module.exports), module.exports;
  180. }
  181. var check = function (it) {
  182. return it && it.Math == Math && it;
  183. };
  184. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  185. var global_1 =
  186. // eslint-disable-next-line es/no-global-this -- safe
  187. check(typeof globalThis == 'object' && globalThis) ||
  188. check(typeof window == 'object' && window) ||
  189. // eslint-disable-next-line no-restricted-globals -- safe
  190. check(typeof self == 'object' && self) ||
  191. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  192. // eslint-disable-next-line no-new-func -- fallback
  193. (function () { return this; })() || Function('return this')();
  194. var fails = function (exec) {
  195. try {
  196. return !!exec();
  197. } catch (error) {
  198. return true;
  199. }
  200. };
  201. // Detect IE8's incomplete defineProperty implementation
  202. var descriptors = !fails(function () {
  203. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  204. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  205. });
  206. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  207. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  208. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  209. // Nashorn ~ JDK8 bug
  210. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  211. // `Object.prototype.propertyIsEnumerable` method implementation
  212. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  213. var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  214. var descriptor = getOwnPropertyDescriptor$1(this, V);
  215. return !!descriptor && descriptor.enumerable;
  216. } : $propertyIsEnumerable;
  217. var objectPropertyIsEnumerable = {
  218. f: f$4
  219. };
  220. var createPropertyDescriptor = function (bitmap, value) {
  221. return {
  222. enumerable: !(bitmap & 1),
  223. configurable: !(bitmap & 2),
  224. writable: !(bitmap & 4),
  225. value: value
  226. };
  227. };
  228. var toString = {}.toString;
  229. var classofRaw = function (it) {
  230. return toString.call(it).slice(8, -1);
  231. };
  232. var split = ''.split;
  233. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  234. var indexedObject = fails(function () {
  235. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  236. // eslint-disable-next-line no-prototype-builtins -- safe
  237. return !Object('z').propertyIsEnumerable(0);
  238. }) ? function (it) {
  239. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  240. } : Object;
  241. // `RequireObjectCoercible` abstract operation
  242. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  243. var requireObjectCoercible = function (it) {
  244. if (it == undefined) throw TypeError("Can't call method on " + it);
  245. return it;
  246. };
  247. // toObject with fallback for non-array-like ES3 strings
  248. var toIndexedObject = function (it) {
  249. return indexedObject(requireObjectCoercible(it));
  250. };
  251. var isObject = function (it) {
  252. return typeof it === 'object' ? it !== null : typeof it === 'function';
  253. };
  254. // `ToPrimitive` abstract operation
  255. // https://tc39.es/ecma262/#sec-toprimitive
  256. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  257. // and the second argument - flag - preferred type is a string
  258. var toPrimitive = function (input, PREFERRED_STRING) {
  259. if (!isObject(input)) return input;
  260. var fn, val;
  261. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  262. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  263. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  264. throw TypeError("Can't convert object to primitive value");
  265. };
  266. var hasOwnProperty = {}.hasOwnProperty;
  267. var has$1 = function (it, key) {
  268. return hasOwnProperty.call(it, key);
  269. };
  270. var document$1 = global_1.document;
  271. // typeof document.createElement is 'object' in old IE
  272. var EXISTS = isObject(document$1) && isObject(document$1.createElement);
  273. var documentCreateElement = function (it) {
  274. return EXISTS ? document$1.createElement(it) : {};
  275. };
  276. // Thank's IE8 for his funny defineProperty
  277. var ie8DomDefine = !descriptors && !fails(function () {
  278. // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
  279. return Object.defineProperty(documentCreateElement('div'), 'a', {
  280. get: function () { return 7; }
  281. }).a != 7;
  282. });
  283. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  284. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  285. // `Object.getOwnPropertyDescriptor` method
  286. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  287. var f$3 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  288. O = toIndexedObject(O);
  289. P = toPrimitive(P, true);
  290. if (ie8DomDefine) try {
  291. return $getOwnPropertyDescriptor(O, P);
  292. } catch (error) { /* empty */ }
  293. if (has$1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  294. };
  295. var objectGetOwnPropertyDescriptor = {
  296. f: f$3
  297. };
  298. var anObject = function (it) {
  299. if (!isObject(it)) {
  300. throw TypeError(String(it) + ' is not an object');
  301. } return it;
  302. };
  303. // eslint-disable-next-line es/no-object-defineproperty -- safe
  304. var $defineProperty = Object.defineProperty;
  305. // `Object.defineProperty` method
  306. // https://tc39.es/ecma262/#sec-object.defineproperty
  307. var f$2 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
  308. anObject(O);
  309. P = toPrimitive(P, true);
  310. anObject(Attributes);
  311. if (ie8DomDefine) try {
  312. return $defineProperty(O, P, Attributes);
  313. } catch (error) { /* empty */ }
  314. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  315. if ('value' in Attributes) O[P] = Attributes.value;
  316. return O;
  317. };
  318. var objectDefineProperty = {
  319. f: f$2
  320. };
  321. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  322. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  323. } : function (object, key, value) {
  324. object[key] = value;
  325. return object;
  326. };
  327. var setGlobal = function (key, value) {
  328. try {
  329. createNonEnumerableProperty(global_1, key, value);
  330. } catch (error) {
  331. global_1[key] = value;
  332. } return value;
  333. };
  334. var SHARED = '__core-js_shared__';
  335. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  336. var sharedStore = store$1;
  337. var functionToString = Function.toString;
  338. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  339. if (typeof sharedStore.inspectSource != 'function') {
  340. sharedStore.inspectSource = function (it) {
  341. return functionToString.call(it);
  342. };
  343. }
  344. var inspectSource = sharedStore.inspectSource;
  345. var WeakMap$1 = global_1.WeakMap;
  346. var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));
  347. var shared = createCommonjsModule(function (module) {
  348. (module.exports = function (key, value) {
  349. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  350. })('versions', []).push({
  351. version: '3.10.1',
  352. mode: 'global',
  353. copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
  354. });
  355. });
  356. var id = 0;
  357. var postfix = Math.random();
  358. var uid = function (key) {
  359. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  360. };
  361. var keys = shared('keys');
  362. var sharedKey = function (key) {
  363. return keys[key] || (keys[key] = uid(key));
  364. };
  365. var hiddenKeys$1 = {};
  366. var WeakMap = global_1.WeakMap;
  367. var set, get, has;
  368. var enforce = function (it) {
  369. return has(it) ? get(it) : set(it, {});
  370. };
  371. var getterFor = function (TYPE) {
  372. return function (it) {
  373. var state;
  374. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  375. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  376. } return state;
  377. };
  378. };
  379. if (nativeWeakMap) {
  380. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  381. var wmget = store.get;
  382. var wmhas = store.has;
  383. var wmset = store.set;
  384. set = function (it, metadata) {
  385. metadata.facade = it;
  386. wmset.call(store, it, metadata);
  387. return metadata;
  388. };
  389. get = function (it) {
  390. return wmget.call(store, it) || {};
  391. };
  392. has = function (it) {
  393. return wmhas.call(store, it);
  394. };
  395. } else {
  396. var STATE = sharedKey('state');
  397. hiddenKeys$1[STATE] = true;
  398. set = function (it, metadata) {
  399. metadata.facade = it;
  400. createNonEnumerableProperty(it, STATE, metadata);
  401. return metadata;
  402. };
  403. get = function (it) {
  404. return has$1(it, STATE) ? it[STATE] : {};
  405. };
  406. has = function (it) {
  407. return has$1(it, STATE);
  408. };
  409. }
  410. var internalState = {
  411. set: set,
  412. get: get,
  413. has: has,
  414. enforce: enforce,
  415. getterFor: getterFor
  416. };
  417. var redefine = createCommonjsModule(function (module) {
  418. var getInternalState = internalState.get;
  419. var enforceInternalState = internalState.enforce;
  420. var TEMPLATE = String(String).split('String');
  421. (module.exports = function (O, key, value, options) {
  422. var unsafe = options ? !!options.unsafe : false;
  423. var simple = options ? !!options.enumerable : false;
  424. var noTargetGet = options ? !!options.noTargetGet : false;
  425. var state;
  426. if (typeof value == 'function') {
  427. if (typeof key == 'string' && !has$1(value, 'name')) {
  428. createNonEnumerableProperty(value, 'name', key);
  429. }
  430. state = enforceInternalState(value);
  431. if (!state.source) {
  432. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  433. }
  434. }
  435. if (O === global_1) {
  436. if (simple) O[key] = value;
  437. else setGlobal(key, value);
  438. return;
  439. } else if (!unsafe) {
  440. delete O[key];
  441. } else if (!noTargetGet && O[key]) {
  442. simple = true;
  443. }
  444. if (simple) O[key] = value;
  445. else createNonEnumerableProperty(O, key, value);
  446. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  447. })(Function.prototype, 'toString', function toString() {
  448. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  449. });
  450. });
  451. var path = global_1;
  452. var aFunction$1 = function (variable) {
  453. return typeof variable == 'function' ? variable : undefined;
  454. };
  455. var getBuiltIn = function (namespace, method) {
  456. return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(global_1[namespace])
  457. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  458. };
  459. var ceil = Math.ceil;
  460. var floor = Math.floor;
  461. // `ToInteger` abstract operation
  462. // https://tc39.es/ecma262/#sec-tointeger
  463. var toInteger = function (argument) {
  464. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  465. };
  466. var min$1 = Math.min;
  467. // `ToLength` abstract operation
  468. // https://tc39.es/ecma262/#sec-tolength
  469. var toLength = function (argument) {
  470. return argument > 0 ? min$1(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  471. };
  472. var max$1 = Math.max;
  473. var min = Math.min;
  474. // Helper for a popular repeating case of the spec:
  475. // Let integer be ? ToInteger(index).
  476. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  477. var toAbsoluteIndex = function (index, length) {
  478. var integer = toInteger(index);
  479. return integer < 0 ? max$1(integer + length, 0) : min(integer, length);
  480. };
  481. // `Array.prototype.{ indexOf, includes }` methods implementation
  482. var createMethod$1 = function (IS_INCLUDES) {
  483. return function ($this, el, fromIndex) {
  484. var O = toIndexedObject($this);
  485. var length = toLength(O.length);
  486. var index = toAbsoluteIndex(fromIndex, length);
  487. var value;
  488. // Array#includes uses SameValueZero equality algorithm
  489. // eslint-disable-next-line no-self-compare -- NaN check
  490. if (IS_INCLUDES && el != el) while (length > index) {
  491. value = O[index++];
  492. // eslint-disable-next-line no-self-compare -- NaN check
  493. if (value != value) return true;
  494. // Array#indexOf ignores holes, Array#includes - not
  495. } else for (;length > index; index++) {
  496. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  497. } return !IS_INCLUDES && -1;
  498. };
  499. };
  500. var arrayIncludes = {
  501. // `Array.prototype.includes` method
  502. // https://tc39.es/ecma262/#sec-array.prototype.includes
  503. includes: createMethod$1(true),
  504. // `Array.prototype.indexOf` method
  505. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  506. indexOf: createMethod$1(false)
  507. };
  508. var indexOf = arrayIncludes.indexOf;
  509. var objectKeysInternal = function (object, names) {
  510. var O = toIndexedObject(object);
  511. var i = 0;
  512. var result = [];
  513. var key;
  514. for (key in O) !has$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key);
  515. // Don't enum bug & hidden keys
  516. while (names.length > i) if (has$1(O, key = names[i++])) {
  517. ~indexOf(result, key) || result.push(key);
  518. }
  519. return result;
  520. };
  521. // IE8- don't enum bug keys
  522. var enumBugKeys = [
  523. 'constructor',
  524. 'hasOwnProperty',
  525. 'isPrototypeOf',
  526. 'propertyIsEnumerable',
  527. 'toLocaleString',
  528. 'toString',
  529. 'valueOf'
  530. ];
  531. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  532. // `Object.getOwnPropertyNames` method
  533. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  534. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  535. var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  536. return objectKeysInternal(O, hiddenKeys);
  537. };
  538. var objectGetOwnPropertyNames = {
  539. f: f$1
  540. };
  541. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  542. var f = Object.getOwnPropertySymbols;
  543. var objectGetOwnPropertySymbols = {
  544. f: f
  545. };
  546. // all object keys, includes non-enumerable and symbols
  547. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  548. var keys = objectGetOwnPropertyNames.f(anObject(it));
  549. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  550. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  551. };
  552. var copyConstructorProperties = function (target, source) {
  553. var keys = ownKeys(source);
  554. var defineProperty = objectDefineProperty.f;
  555. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  556. for (var i = 0; i < keys.length; i++) {
  557. var key = keys[i];
  558. if (!has$1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  559. }
  560. };
  561. var replacement = /#|\.prototype\./;
  562. var isForced = function (feature, detection) {
  563. var value = data[normalize(feature)];
  564. return value == POLYFILL ? true
  565. : value == NATIVE ? false
  566. : typeof detection == 'function' ? fails(detection)
  567. : !!detection;
  568. };
  569. var normalize = isForced.normalize = function (string) {
  570. return String(string).replace(replacement, '.').toLowerCase();
  571. };
  572. var data = isForced.data = {};
  573. var NATIVE = isForced.NATIVE = 'N';
  574. var POLYFILL = isForced.POLYFILL = 'P';
  575. var isForced_1 = isForced;
  576. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  577. /*
  578. options.target - name of the target object
  579. options.global - target is the global object
  580. options.stat - export as static methods of target
  581. options.proto - export as prototype methods of target
  582. options.real - real prototype method for the `pure` version
  583. options.forced - export even if the native feature is available
  584. options.bind - bind methods to the target, required for the `pure` version
  585. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  586. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  587. options.sham - add a flag to not completely full polyfills
  588. options.enumerable - export as enumerable property
  589. options.noTargetGet - prevent calling a getter on target
  590. */
  591. var _export = function (options, source) {
  592. var TARGET = options.target;
  593. var GLOBAL = options.global;
  594. var STATIC = options.stat;
  595. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  596. if (GLOBAL) {
  597. target = global_1;
  598. } else if (STATIC) {
  599. target = global_1[TARGET] || setGlobal(TARGET, {});
  600. } else {
  601. target = (global_1[TARGET] || {}).prototype;
  602. }
  603. if (target) for (key in source) {
  604. sourceProperty = source[key];
  605. if (options.noTargetGet) {
  606. descriptor = getOwnPropertyDescriptor(target, key);
  607. targetProperty = descriptor && descriptor.value;
  608. } else targetProperty = target[key];
  609. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  610. // contained in target
  611. if (!FORCED && targetProperty !== undefined) {
  612. if (typeof sourceProperty === typeof targetProperty) continue;
  613. copyConstructorProperties(sourceProperty, targetProperty);
  614. }
  615. // add a flag to not completely full polyfills
  616. if (options.sham || (targetProperty && targetProperty.sham)) {
  617. createNonEnumerableProperty(sourceProperty, 'sham', true);
  618. }
  619. // extend global
  620. redefine(target, key, sourceProperty, options);
  621. }
  622. };
  623. // `IsArray` abstract operation
  624. // https://tc39.es/ecma262/#sec-isarray
  625. // eslint-disable-next-line es/no-array-isarray -- safe
  626. var isArray = Array.isArray || function isArray(arg) {
  627. return classofRaw(arg) == 'Array';
  628. };
  629. // `ToObject` abstract operation
  630. // https://tc39.es/ecma262/#sec-toobject
  631. var toObject = function (argument) {
  632. return Object(requireObjectCoercible(argument));
  633. };
  634. var createProperty = function (object, key, value) {
  635. var propertyKey = toPrimitive(key);
  636. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  637. else object[propertyKey] = value;
  638. };
  639. var engineIsNode = classofRaw(global_1.process) == 'process';
  640. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  641. var process = global_1.process;
  642. var versions = process && process.versions;
  643. var v8 = versions && versions.v8;
  644. var match, version;
  645. if (v8) {
  646. match = v8.split('.');
  647. version = match[0] + match[1];
  648. } else if (engineUserAgent) {
  649. match = engineUserAgent.match(/Edge\/(\d+)/);
  650. if (!match || match[1] >= 74) {
  651. match = engineUserAgent.match(/Chrome\/(\d+)/);
  652. if (match) version = match[1];
  653. }
  654. }
  655. var engineV8Version = version && +version;
  656. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  657. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  658. // eslint-disable-next-line es/no-symbol -- required for testing
  659. return !Symbol.sham &&
  660. // Chrome 38 Symbol has incorrect toString conversion
  661. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  662. (engineIsNode ? engineV8Version === 38 : engineV8Version > 37 && engineV8Version < 41);
  663. });
  664. /* eslint-disable es/no-symbol -- required for testing */
  665. var useSymbolAsUid = nativeSymbol
  666. && !Symbol.sham
  667. && typeof Symbol.iterator == 'symbol';
  668. var WellKnownSymbolsStore = shared('wks');
  669. var Symbol$1 = global_1.Symbol;
  670. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  671. var wellKnownSymbol = function (name) {
  672. if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  673. if (nativeSymbol && has$1(Symbol$1, name)) {
  674. WellKnownSymbolsStore[name] = Symbol$1[name];
  675. } else {
  676. WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  677. }
  678. } return WellKnownSymbolsStore[name];
  679. };
  680. var SPECIES$2 = wellKnownSymbol('species');
  681. // `ArraySpeciesCreate` abstract operation
  682. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  683. var arraySpeciesCreate = function (originalArray, length) {
  684. var C;
  685. if (isArray(originalArray)) {
  686. C = originalArray.constructor;
  687. // cross-realm fallback
  688. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  689. else if (isObject(C)) {
  690. C = C[SPECIES$2];
  691. if (C === null) C = undefined;
  692. }
  693. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  694. };
  695. var SPECIES$1 = wellKnownSymbol('species');
  696. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  697. // We can't use this feature detection in V8 since it causes
  698. // deoptimization and serious performance degradation
  699. // https://github.com/zloirock/core-js/issues/677
  700. return engineV8Version >= 51 || !fails(function () {
  701. var array = [];
  702. var constructor = array.constructor = {};
  703. constructor[SPECIES$1] = function () {
  704. return { foo: 1 };
  705. };
  706. return array[METHOD_NAME](Boolean).foo !== 1;
  707. });
  708. };
  709. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  710. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  711. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  712. // We can't use this feature detection in V8 since it causes
  713. // deoptimization and serious performance degradation
  714. // https://github.com/zloirock/core-js/issues/679
  715. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  716. var array = [];
  717. array[IS_CONCAT_SPREADABLE] = false;
  718. return array.concat()[0] !== array;
  719. });
  720. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  721. var isConcatSpreadable = function (O) {
  722. if (!isObject(O)) return false;
  723. var spreadable = O[IS_CONCAT_SPREADABLE];
  724. return spreadable !== undefined ? !!spreadable : isArray(O);
  725. };
  726. var FORCED$1 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  727. // `Array.prototype.concat` method
  728. // https://tc39.es/ecma262/#sec-array.prototype.concat
  729. // with adding support of @@isConcatSpreadable and @@species
  730. _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
  731. // eslint-disable-next-line no-unused-vars -- required for `.length`
  732. concat: function concat(arg) {
  733. var O = toObject(this);
  734. var A = arraySpeciesCreate(O, 0);
  735. var n = 0;
  736. var i, k, length, len, E;
  737. for (i = -1, length = arguments.length; i < length; i++) {
  738. E = i === -1 ? O : arguments[i];
  739. if (isConcatSpreadable(E)) {
  740. len = toLength(E.length);
  741. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  742. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  743. } else {
  744. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  745. createProperty(A, n++, E);
  746. }
  747. }
  748. A.length = n;
  749. return A;
  750. }
  751. });
  752. // `Object.keys` method
  753. // https://tc39.es/ecma262/#sec-object.keys
  754. // eslint-disable-next-line es/no-object-keys -- safe
  755. var objectKeys = Object.keys || function keys(O) {
  756. return objectKeysInternal(O, enumBugKeys);
  757. };
  758. // eslint-disable-next-line es/no-object-assign -- safe
  759. var $assign = Object.assign;
  760. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  761. var defineProperty = Object.defineProperty;
  762. // `Object.assign` method
  763. // https://tc39.es/ecma262/#sec-object.assign
  764. var objectAssign = !$assign || fails(function () {
  765. // should have correct order of operations (Edge bug)
  766. if (descriptors && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
  767. enumerable: true,
  768. get: function () {
  769. defineProperty(this, 'b', {
  770. value: 3,
  771. enumerable: false
  772. });
  773. }
  774. }), { b: 2 })).b !== 1) return true;
  775. // should work with symbols and should have deterministic property order (V8 bug)
  776. var A = {};
  777. var B = {};
  778. // eslint-disable-next-line es/no-symbol -- safe
  779. var symbol = Symbol();
  780. var alphabet = 'abcdefghijklmnopqrst';
  781. A[symbol] = 7;
  782. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  783. return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
  784. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  785. var T = toObject(target);
  786. var argumentsLength = arguments.length;
  787. var index = 1;
  788. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  789. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  790. while (argumentsLength > index) {
  791. var S = indexedObject(arguments[index++]);
  792. var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
  793. var length = keys.length;
  794. var j = 0;
  795. var key;
  796. while (length > j) {
  797. key = keys[j++];
  798. if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
  799. }
  800. } return T;
  801. } : $assign;
  802. // `Object.assign` method
  803. // https://tc39.es/ecma262/#sec-object.assign
  804. // eslint-disable-next-line es/no-object-assign -- required for testing
  805. _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
  806. assign: objectAssign
  807. });
  808. var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport('slice');
  809. var SPECIES = wellKnownSymbol('species');
  810. var nativeSlice = [].slice;
  811. var max = Math.max;
  812. // `Array.prototype.slice` method
  813. // https://tc39.es/ecma262/#sec-array.prototype.slice
  814. // fallback for not array-like ES3 strings and DOM objects
  815. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
  816. slice: function slice(start, end) {
  817. var O = toIndexedObject(this);
  818. var length = toLength(O.length);
  819. var k = toAbsoluteIndex(start, length);
  820. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  821. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  822. var Constructor, result, n;
  823. if (isArray(O)) {
  824. Constructor = O.constructor;
  825. // cross-realm fallback
  826. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  827. Constructor = undefined;
  828. } else if (isObject(Constructor)) {
  829. Constructor = Constructor[SPECIES];
  830. if (Constructor === null) Constructor = undefined;
  831. }
  832. if (Constructor === Array || Constructor === undefined) {
  833. return nativeSlice.call(O, k, fin);
  834. }
  835. }
  836. result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
  837. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  838. result.length = n;
  839. return result;
  840. }
  841. });
  842. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  843. var method = [][METHOD_NAME];
  844. return !!method && fails(function () {
  845. // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
  846. method.call(null, argument || function () { throw 1; }, 1);
  847. });
  848. };
  849. /* eslint-disable es/no-array-prototype-indexof -- required for testing */
  850. var $indexOf = arrayIncludes.indexOf;
  851. var nativeIndexOf = [].indexOf;
  852. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
  853. var STRICT_METHOD$2 = arrayMethodIsStrict('indexOf');
  854. // `Array.prototype.indexOf` method
  855. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  856. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD$2 }, {
  857. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  858. return NEGATIVE_ZERO
  859. // convert -0 to +0
  860. ? nativeIndexOf.apply(this, arguments) || 0
  861. : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
  862. }
  863. });
  864. var aFunction = function (it) {
  865. if (typeof it != 'function') {
  866. throw TypeError(String(it) + ' is not a function');
  867. } return it;
  868. };
  869. // optional / simple context binding
  870. var functionBindContext = function (fn, that, length) {
  871. aFunction(fn);
  872. if (that === undefined) return fn;
  873. switch (length) {
  874. case 0: return function () {
  875. return fn.call(that);
  876. };
  877. case 1: return function (a) {
  878. return fn.call(that, a);
  879. };
  880. case 2: return function (a, b) {
  881. return fn.call(that, a, b);
  882. };
  883. case 3: return function (a, b, c) {
  884. return fn.call(that, a, b, c);
  885. };
  886. }
  887. return function (/* ...args */) {
  888. return fn.apply(that, arguments);
  889. };
  890. };
  891. // `FlattenIntoArray` abstract operation
  892. // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
  893. var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
  894. var targetIndex = start;
  895. var sourceIndex = 0;
  896. var mapFn = mapper ? functionBindContext(mapper, thisArg, 3) : false;
  897. var element;
  898. while (sourceIndex < sourceLen) {
  899. if (sourceIndex in source) {
  900. element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
  901. if (depth > 0 && isArray(element)) {
  902. targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
  903. } else {
  904. if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length');
  905. target[targetIndex] = element;
  906. }
  907. targetIndex++;
  908. }
  909. sourceIndex++;
  910. }
  911. return targetIndex;
  912. };
  913. var flattenIntoArray_1 = flattenIntoArray;
  914. // `Array.prototype.flat` method
  915. // https://tc39.es/ecma262/#sec-array.prototype.flat
  916. _export({ target: 'Array', proto: true }, {
  917. flat: function flat(/* depthArg = 1 */) {
  918. var depthArg = arguments.length ? arguments[0] : undefined;
  919. var O = toObject(this);
  920. var sourceLen = toLength(O.length);
  921. var A = arraySpeciesCreate(O, 0);
  922. A.length = flattenIntoArray_1(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));
  923. return A;
  924. }
  925. });
  926. var test = [];
  927. var nativeSort = test.sort;
  928. // IE8-
  929. var FAILS_ON_UNDEFINED = fails(function () {
  930. test.sort(undefined);
  931. });
  932. // V8 bug
  933. var FAILS_ON_NULL = fails(function () {
  934. test.sort(null);
  935. });
  936. // Old WebKit
  937. var STRICT_METHOD$1 = arrayMethodIsStrict('sort');
  938. var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$1;
  939. // `Array.prototype.sort` method
  940. // https://tc39.es/ecma262/#sec-array.prototype.sort
  941. _export({ target: 'Array', proto: true, forced: FORCED }, {
  942. sort: function sort(comparefn) {
  943. return comparefn === undefined
  944. ? nativeSort.call(toObject(this))
  945. : nativeSort.call(toObject(this), aFunction(comparefn));
  946. }
  947. });
  948. // `Object.defineProperties` method
  949. // https://tc39.es/ecma262/#sec-object.defineproperties
  950. // eslint-disable-next-line es/no-object-defineproperties -- safe
  951. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  952. anObject(O);
  953. var keys = objectKeys(Properties);
  954. var length = keys.length;
  955. var index = 0;
  956. var key;
  957. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  958. return O;
  959. };
  960. var html = getBuiltIn('document', 'documentElement');
  961. var GT = '>';
  962. var LT = '<';
  963. var PROTOTYPE = 'prototype';
  964. var SCRIPT = 'script';
  965. var IE_PROTO = sharedKey('IE_PROTO');
  966. var EmptyConstructor = function () { /* empty */ };
  967. var scriptTag = function (content) {
  968. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  969. };
  970. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  971. var NullProtoObjectViaActiveX = function (activeXDocument) {
  972. activeXDocument.write(scriptTag(''));
  973. activeXDocument.close();
  974. var temp = activeXDocument.parentWindow.Object;
  975. activeXDocument = null; // avoid memory leak
  976. return temp;
  977. };
  978. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  979. var NullProtoObjectViaIFrame = function () {
  980. // Thrash, waste and sodomy: IE GC bug
  981. var iframe = documentCreateElement('iframe');
  982. var JS = 'java' + SCRIPT + ':';
  983. var iframeDocument;
  984. iframe.style.display = 'none';
  985. html.appendChild(iframe);
  986. // https://github.com/zloirock/core-js/issues/475
  987. iframe.src = String(JS);
  988. iframeDocument = iframe.contentWindow.document;
  989. iframeDocument.open();
  990. iframeDocument.write(scriptTag('document.F=Object'));
  991. iframeDocument.close();
  992. return iframeDocument.F;
  993. };
  994. // Check for document.domain and active x support
  995. // No need to use active x approach when document.domain is not set
  996. // see https://github.com/es-shims/es5-shim/issues/150
  997. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  998. // avoid IE GC bug
  999. var activeXDocument;
  1000. var NullProtoObject = function () {
  1001. try {
  1002. /* global ActiveXObject -- old IE */
  1003. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  1004. } catch (error) { /* ignore */ }
  1005. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  1006. var length = enumBugKeys.length;
  1007. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1008. return NullProtoObject();
  1009. };
  1010. hiddenKeys$1[IE_PROTO] = true;
  1011. // `Object.create` method
  1012. // https://tc39.es/ecma262/#sec-object.create
  1013. var objectCreate = Object.create || function create(O, Properties) {
  1014. var result;
  1015. if (O !== null) {
  1016. EmptyConstructor[PROTOTYPE] = anObject(O);
  1017. result = new EmptyConstructor();
  1018. EmptyConstructor[PROTOTYPE] = null;
  1019. // add "__proto__" for Object.getPrototypeOf polyfill
  1020. result[IE_PROTO] = O;
  1021. } else result = NullProtoObject();
  1022. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  1023. };
  1024. var UNSCOPABLES = wellKnownSymbol('unscopables');
  1025. var ArrayPrototype = Array.prototype;
  1026. // Array.prototype[@@unscopables]
  1027. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1028. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  1029. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  1030. configurable: true,
  1031. value: objectCreate(null)
  1032. });
  1033. }
  1034. // add a key to Array.prototype[@@unscopables]
  1035. var addToUnscopables = function (key) {
  1036. ArrayPrototype[UNSCOPABLES][key] = true;
  1037. };
  1038. var $includes = arrayIncludes.includes;
  1039. // `Array.prototype.includes` method
  1040. // https://tc39.es/ecma262/#sec-array.prototype.includes
  1041. _export({ target: 'Array', proto: true }, {
  1042. includes: function includes(el /* , fromIndex = 0 */) {
  1043. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  1044. }
  1045. });
  1046. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1047. addToUnscopables('includes');
  1048. var push = [].push;
  1049. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  1050. var createMethod = function (TYPE) {
  1051. var IS_MAP = TYPE == 1;
  1052. var IS_FILTER = TYPE == 2;
  1053. var IS_SOME = TYPE == 3;
  1054. var IS_EVERY = TYPE == 4;
  1055. var IS_FIND_INDEX = TYPE == 6;
  1056. var IS_FILTER_OUT = TYPE == 7;
  1057. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  1058. return function ($this, callbackfn, that, specificCreate) {
  1059. var O = toObject($this);
  1060. var self = indexedObject(O);
  1061. var boundFunction = functionBindContext(callbackfn, that, 3);
  1062. var length = toLength(self.length);
  1063. var index = 0;
  1064. var create = specificCreate || arraySpeciesCreate;
  1065. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  1066. var value, result;
  1067. for (;length > index; index++) if (NO_HOLES || index in self) {
  1068. value = self[index];
  1069. result = boundFunction(value, index, O);
  1070. if (TYPE) {
  1071. if (IS_MAP) target[index] = result; // map
  1072. else if (result) switch (TYPE) {
  1073. case 3: return true; // some
  1074. case 5: return value; // find
  1075. case 6: return index; // findIndex
  1076. case 2: push.call(target, value); // filter
  1077. } else switch (TYPE) {
  1078. case 4: return false; // every
  1079. case 7: push.call(target, value); // filterOut
  1080. }
  1081. }
  1082. }
  1083. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  1084. };
  1085. };
  1086. var arrayIteration = {
  1087. // `Array.prototype.forEach` method
  1088. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1089. forEach: createMethod(0),
  1090. // `Array.prototype.map` method
  1091. // https://tc39.es/ecma262/#sec-array.prototype.map
  1092. map: createMethod(1),
  1093. // `Array.prototype.filter` method
  1094. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1095. filter: createMethod(2),
  1096. // `Array.prototype.some` method
  1097. // https://tc39.es/ecma262/#sec-array.prototype.some
  1098. some: createMethod(3),
  1099. // `Array.prototype.every` method
  1100. // https://tc39.es/ecma262/#sec-array.prototype.every
  1101. every: createMethod(4),
  1102. // `Array.prototype.find` method
  1103. // https://tc39.es/ecma262/#sec-array.prototype.find
  1104. find: createMethod(5),
  1105. // `Array.prototype.findIndex` method
  1106. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  1107. findIndex: createMethod(6),
  1108. // `Array.prototype.filterOut` method
  1109. // https://github.com/tc39/proposal-array-filtering
  1110. filterOut: createMethod(7)
  1111. };
  1112. var $find = arrayIteration.find;
  1113. var FIND = 'find';
  1114. var SKIPS_HOLES = true;
  1115. // Shouldn't skip holes
  1116. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  1117. // `Array.prototype.find` method
  1118. // https://tc39.es/ecma262/#sec-array.prototype.find
  1119. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1120. find: function find(callbackfn /* , that = undefined */) {
  1121. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1122. }
  1123. });
  1124. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1125. addToUnscopables(FIND);
  1126. var nativeJoin = [].join;
  1127. var ES3_STRINGS = indexedObject != Object;
  1128. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  1129. // `Array.prototype.join` method
  1130. // https://tc39.es/ecma262/#sec-array.prototype.join
  1131. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  1132. join: function join(separator) {
  1133. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  1134. }
  1135. });
  1136. var $filter = arrayIteration.filter;
  1137. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('filter');
  1138. // `Array.prototype.filter` method
  1139. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1140. // with adding support of @@species
  1141. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  1142. filter: function filter(callbackfn /* , thisArg */) {
  1143. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1144. }
  1145. });
  1146. var $map = arrayIteration.map;
  1147. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
  1148. // `Array.prototype.map` method
  1149. // https://tc39.es/ecma262/#sec-array.prototype.map
  1150. // with adding support of @@species
  1151. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1152. map: function map(callbackfn /* , thisArg */) {
  1153. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1154. }
  1155. });
  1156. /**
  1157. * @update zhixin wen <wenzhixin2010@gmail.com>
  1158. */
  1159. var Utils = $__default['default'].fn.bootstrapTable.utils;
  1160. function printPageBuilderDefault(table) {
  1161. return "\n <html>\n <head>\n <style type=\"text/css\" media=\"print\">\n @page {\n size: auto;\n margin: 25px 0 25px 0;\n }\n </style>\n <style type=\"text/css\" media=\"all\">\n table {\n border-collapse: collapse;\n font-size: 12px;\n }\n table, th, td {\n border: 1px solid grey;\n }\n th, td {\n text-align: center;\n vertical-align: middle;\n }\n p {\n font-weight: bold;\n margin-left:20px;\n }\n table {\n width:94%;\n margin-left:3%;\n margin-right:3%;\n }\n div.bs-table-print {\n text-align:center;\n }\n </style>\n </head>\n <title>Print Table</title>\n <body>\n <p>Printed on: ".concat(new Date(), " </p>\n <div class=\"bs-table-print\">").concat(table, "</div>\n </body>\n </html>");
  1162. }
  1163. $__default['default'].extend($__default['default'].fn.bootstrapTable.locales, {
  1164. formatPrint: function formatPrint() {
  1165. return 'Print';
  1166. }
  1167. });
  1168. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, $__default['default'].fn.bootstrapTable.locales);
  1169. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  1170. showPrint: false,
  1171. printAsFilteredAndSortedOnUI: true,
  1172. printSortColumn: undefined,
  1173. printSortOrder: 'asc',
  1174. printPageBuilder: function printPageBuilder(table) {
  1175. return printPageBuilderDefault(table);
  1176. }
  1177. });
  1178. $__default['default'].extend($__default['default'].fn.bootstrapTable.COLUMN_DEFAULTS, {
  1179. printFilter: undefined,
  1180. printIgnore: false,
  1181. printFormatter: undefined
  1182. });
  1183. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults.icons, {
  1184. print: {
  1185. bootstrap3: 'glyphicon-print icon-share',
  1186. 'bootstrap-table': 'icon-printer'
  1187. }[$__default['default'].fn.bootstrapTable.theme] || 'fa-print'
  1188. });
  1189. $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1190. _inherits(_class, _$$BootstrapTable);
  1191. var _super = _createSuper(_class);
  1192. function _class() {
  1193. _classCallCheck(this, _class);
  1194. return _super.apply(this, arguments);
  1195. }
  1196. _createClass(_class, [{
  1197. key: "init",
  1198. value: function init() {
  1199. var _get2;
  1200. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1201. args[_key] = arguments[_key];
  1202. }
  1203. (_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
  1204. if (!this.options.showPrint) {
  1205. return;
  1206. }
  1207. this.mergedCells = [];
  1208. }
  1209. }, {
  1210. key: "initToolbar",
  1211. value: function initToolbar() {
  1212. var _this = this,
  1213. _get3;
  1214. this.showToolbar = this.showToolbar || this.options.showPrint;
  1215. if (this.options.showPrint) {
  1216. this.buttons = Object.assign(this.buttons, {
  1217. print: {
  1218. text: this.options.formatPrint(),
  1219. icon: this.options.icons.print,
  1220. event: function event() {
  1221. _this.doPrint(_this.options.printAsFilteredAndSortedOnUI ? _this.getData() : _this.options.data.slice(0));
  1222. },
  1223. attributes: {
  1224. 'aria-label': this.options.formatPrint(),
  1225. title: this.options.formatPrint()
  1226. }
  1227. }
  1228. });
  1229. }
  1230. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1231. args[_key2] = arguments[_key2];
  1232. }
  1233. (_get3 = _get(_getPrototypeOf(_class.prototype), "initToolbar", this)).call.apply(_get3, [this].concat(args));
  1234. }
  1235. }, {
  1236. key: "mergeCells",
  1237. value: function mergeCells(options) {
  1238. _get(_getPrototypeOf(_class.prototype), "mergeCells", this).call(this, options);
  1239. if (!this.options.showPrint) {
  1240. return;
  1241. }
  1242. var col = this.getVisibleFields().indexOf(options.field);
  1243. if (Utils.hasDetailViewIcon(this.options)) {
  1244. col += 1;
  1245. }
  1246. this.mergedCells.push({
  1247. row: options.index,
  1248. col: col,
  1249. rowspan: options.rowspan || 1,
  1250. colspan: options.colspan || 1
  1251. });
  1252. }
  1253. }, {
  1254. key: "doPrint",
  1255. value: function doPrint(data) {
  1256. var _this2 = this;
  1257. var formatValue = function formatValue(row, i, column) {
  1258. var value = Utils.calculateObjectValue(column, column.printFormatter || column.formatter, [row[column.field], row, i], row[column.field]);
  1259. return typeof value === 'undefined' || value === null ? _this2.options.undefinedText : value;
  1260. };
  1261. var buildTable = function buildTable(data, columnsArray) {
  1262. var dir = _this2.$el.attr('dir') || 'ltr';
  1263. var html = ["<table dir=\"".concat(dir, "\"><thead>")];
  1264. var _iterator = _createForOfIteratorHelper(columnsArray),
  1265. _step;
  1266. try {
  1267. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  1268. var _columns2 = _step.value;
  1269. html.push('<tr>');
  1270. for (var _h = 0; _h < _columns2.length; _h++) {
  1271. if (!_columns2[_h].printIgnore) {
  1272. html.push("<th\n ".concat(Utils.sprintf(' rowspan="%s"', _columns2[_h].rowspan), "\n ").concat(Utils.sprintf(' colspan="%s"', _columns2[_h].colspan), "\n >").concat(_columns2[_h].title, "</th>"));
  1273. }
  1274. }
  1275. html.push('</tr>');
  1276. }
  1277. } catch (err) {
  1278. _iterator.e(err);
  1279. } finally {
  1280. _iterator.f();
  1281. }
  1282. html.push('</thead><tbody>');
  1283. var dontRender = [];
  1284. if (_this2.mergedCells) {
  1285. for (var mc = 0; mc < _this2.mergedCells.length; mc++) {
  1286. var currentMergedCell = _this2.mergedCells[mc];
  1287. for (var rs = 0; rs < currentMergedCell.rowspan; rs++) {
  1288. var row = currentMergedCell.row + rs;
  1289. for (var cs = 0; cs < currentMergedCell.colspan; cs++) {
  1290. var col = currentMergedCell.col + cs;
  1291. dontRender.push("".concat(row, ",").concat(col));
  1292. }
  1293. }
  1294. }
  1295. }
  1296. for (var i = 0; i < data.length; i++) {
  1297. html.push('<tr>');
  1298. var columns = columnsArray.flat(1);
  1299. columns.sort(function (c1, c2) {
  1300. return c1.colspanIndex - c2.colspanIndex;
  1301. });
  1302. for (var j = 0; j < columns.length; j++) {
  1303. if (columns[j].colspanGroup > 0) continue;
  1304. var rowspan = 0;
  1305. var colspan = 0;
  1306. if (_this2.mergedCells) {
  1307. for (var _mc = 0; _mc < _this2.mergedCells.length; _mc++) {
  1308. var _currentMergedCell = _this2.mergedCells[_mc];
  1309. if (_currentMergedCell.col === j && _currentMergedCell.row === i) {
  1310. rowspan = _currentMergedCell.rowspan;
  1311. colspan = _currentMergedCell.colspan;
  1312. }
  1313. }
  1314. }
  1315. if (!columns[j].printIgnore && columns[j].field && (!dontRender.includes("".concat(i, ",").concat(j)) || rowspan > 0 && colspan > 0)) {
  1316. if (rowspan > 0 && colspan > 0) {
  1317. html.push("<td ".concat(Utils.sprintf(' rowspan="%s"', rowspan), " ").concat(Utils.sprintf(' colspan="%s"', colspan), ">"), formatValue(data[i], i, columns[j]), '</td>');
  1318. } else {
  1319. html.push('<td>', formatValue(data[i], i, columns[j]), '</td>');
  1320. }
  1321. }
  1322. }
  1323. html.push('</tr>');
  1324. }
  1325. html.push('</tbody>');
  1326. if (_this2.options.showFooter) {
  1327. html.push('<footer><tr>');
  1328. var _iterator2 = _createForOfIteratorHelper(columnsArray),
  1329. _step2;
  1330. try {
  1331. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  1332. var _columns = _step2.value;
  1333. for (var h = 0; h < _columns.length; h++) {
  1334. if (!_columns[h].printIgnore) {
  1335. var footerData = Utils.trToData(_columns, _this2.$el.find('>tfoot>tr'));
  1336. var footerValue = Utils.calculateObjectValue(_columns[h], _columns[h].footerFormatter, [data], footerData[0] && footerData[0][_columns[h].field] || '');
  1337. html.push("<th>".concat(footerValue, "</th>"));
  1338. }
  1339. }
  1340. }
  1341. } catch (err) {
  1342. _iterator2.e(err);
  1343. } finally {
  1344. _iterator2.f();
  1345. }
  1346. html.push('</tr></footer>');
  1347. }
  1348. html.push('</table>');
  1349. return html.join('');
  1350. };
  1351. var sortRows = function sortRows(data, colName, sortOrder) {
  1352. if (!colName) {
  1353. return data;
  1354. }
  1355. var reverse = sortOrder !== 'asc';
  1356. reverse = -(+reverse || -1);
  1357. return data.sort(function (a, b) {
  1358. return reverse * a[colName].localeCompare(b[colName]);
  1359. });
  1360. };
  1361. var filterRow = function filterRow(row, filters) {
  1362. for (var index = 0; index < filters.length; ++index) {
  1363. if (row[filters[index].colName] !== filters[index].value) {
  1364. return false;
  1365. }
  1366. }
  1367. return true;
  1368. };
  1369. var filterRows = function filterRows(data, filters) {
  1370. return data.filter(function (row) {
  1371. return filterRow(row, filters);
  1372. });
  1373. };
  1374. var getColumnFilters = function getColumnFilters(columns) {
  1375. return !columns || !columns[0] ? [] : columns[0].filter(function (col) {
  1376. return col.printFilter;
  1377. }).map(function (col) {
  1378. return {
  1379. colName: col.field,
  1380. value: col.printFilter
  1381. };
  1382. });
  1383. };
  1384. data = filterRows(data, getColumnFilters(this.options.columns));
  1385. data = sortRows(data, this.options.printSortColumn, this.options.printSortOrder);
  1386. var table = buildTable(data, this.options.columns);
  1387. var newWin = window.open('');
  1388. newWin.document.write(this.options.printPageBuilder.call(this, table));
  1389. newWin.document.close();
  1390. newWin.focus();
  1391. newWin.print();
  1392. newWin.close();
  1393. }
  1394. }]);
  1395. return _class;
  1396. }($__default['default'].BootstrapTable);
  1397. })));