bootstrap-table-export.js 77 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249
  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 _defineProperty(obj, key, value) {
  28. if (key in obj) {
  29. Object.defineProperty(obj, key, {
  30. value: value,
  31. enumerable: true,
  32. configurable: true,
  33. writable: true
  34. });
  35. } else {
  36. obj[key] = value;
  37. }
  38. return obj;
  39. }
  40. function _inherits(subClass, superClass) {
  41. if (typeof superClass !== "function" && superClass !== null) {
  42. throw new TypeError("Super expression must either be null or a function");
  43. }
  44. subClass.prototype = Object.create(superClass && superClass.prototype, {
  45. constructor: {
  46. value: subClass,
  47. writable: true,
  48. configurable: true
  49. }
  50. });
  51. if (superClass) _setPrototypeOf(subClass, superClass);
  52. }
  53. function _getPrototypeOf(o) {
  54. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  55. return o.__proto__ || Object.getPrototypeOf(o);
  56. };
  57. return _getPrototypeOf(o);
  58. }
  59. function _setPrototypeOf(o, p) {
  60. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  61. o.__proto__ = p;
  62. return o;
  63. };
  64. return _setPrototypeOf(o, p);
  65. }
  66. function _isNativeReflectConstruct() {
  67. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  68. if (Reflect.construct.sham) return false;
  69. if (typeof Proxy === "function") return true;
  70. try {
  71. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  72. return true;
  73. } catch (e) {
  74. return false;
  75. }
  76. }
  77. function _assertThisInitialized(self) {
  78. if (self === void 0) {
  79. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  80. }
  81. return self;
  82. }
  83. function _possibleConstructorReturn(self, call) {
  84. if (call && (typeof call === "object" || typeof call === "function")) {
  85. return call;
  86. }
  87. return _assertThisInitialized(self);
  88. }
  89. function _createSuper(Derived) {
  90. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  91. return function _createSuperInternal() {
  92. var Super = _getPrototypeOf(Derived),
  93. result;
  94. if (hasNativeReflectConstruct) {
  95. var NewTarget = _getPrototypeOf(this).constructor;
  96. result = Reflect.construct(Super, arguments, NewTarget);
  97. } else {
  98. result = Super.apply(this, arguments);
  99. }
  100. return _possibleConstructorReturn(this, result);
  101. };
  102. }
  103. function _superPropBase(object, property) {
  104. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  105. object = _getPrototypeOf(object);
  106. if (object === null) break;
  107. }
  108. return object;
  109. }
  110. function _get(target, property, receiver) {
  111. if (typeof Reflect !== "undefined" && Reflect.get) {
  112. _get = Reflect.get;
  113. } else {
  114. _get = function _get(target, property, receiver) {
  115. var base = _superPropBase(target, property);
  116. if (!base) return;
  117. var desc = Object.getOwnPropertyDescriptor(base, property);
  118. if (desc.get) {
  119. return desc.get.call(receiver);
  120. }
  121. return desc.value;
  122. };
  123. }
  124. return _get(target, property, receiver || target);
  125. }
  126. function _unsupportedIterableToArray(o, minLen) {
  127. if (!o) return;
  128. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  129. var n = Object.prototype.toString.call(o).slice(8, -1);
  130. if (n === "Object" && o.constructor) n = o.constructor.name;
  131. if (n === "Map" || n === "Set") return Array.from(o);
  132. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  133. }
  134. function _arrayLikeToArray(arr, len) {
  135. if (len == null || len > arr.length) len = arr.length;
  136. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  137. return arr2;
  138. }
  139. function _createForOfIteratorHelper(o, allowArrayLike) {
  140. var it;
  141. if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
  142. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  143. if (it) o = it;
  144. var i = 0;
  145. var F = function () {};
  146. return {
  147. s: F,
  148. n: function () {
  149. if (i >= o.length) return {
  150. done: true
  151. };
  152. return {
  153. done: false,
  154. value: o[i++]
  155. };
  156. },
  157. e: function (e) {
  158. throw e;
  159. },
  160. f: F
  161. };
  162. }
  163. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  164. }
  165. var normalCompletion = true,
  166. didErr = false,
  167. err;
  168. return {
  169. s: function () {
  170. it = o[Symbol.iterator]();
  171. },
  172. n: function () {
  173. var step = it.next();
  174. normalCompletion = step.done;
  175. return step;
  176. },
  177. e: function (e) {
  178. didErr = true;
  179. err = e;
  180. },
  181. f: function () {
  182. try {
  183. if (!normalCompletion && it.return != null) it.return();
  184. } finally {
  185. if (didErr) throw err;
  186. }
  187. }
  188. };
  189. }
  190. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  191. function createCommonjsModule(fn, module) {
  192. return module = { exports: {} }, fn(module, module.exports), module.exports;
  193. }
  194. var check = function (it) {
  195. return it && it.Math == Math && it;
  196. };
  197. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  198. var global_1 =
  199. // eslint-disable-next-line es/no-global-this -- safe
  200. check(typeof globalThis == 'object' && globalThis) ||
  201. check(typeof window == 'object' && window) ||
  202. // eslint-disable-next-line no-restricted-globals -- safe
  203. check(typeof self == 'object' && self) ||
  204. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  205. // eslint-disable-next-line no-new-func -- fallback
  206. (function () { return this; })() || Function('return this')();
  207. var fails = function (exec) {
  208. try {
  209. return !!exec();
  210. } catch (error) {
  211. return true;
  212. }
  213. };
  214. // Detect IE8's incomplete defineProperty implementation
  215. var descriptors = !fails(function () {
  216. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  217. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  218. });
  219. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  220. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  221. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  222. // Nashorn ~ JDK8 bug
  223. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  224. // `Object.prototype.propertyIsEnumerable` method implementation
  225. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  226. var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  227. var descriptor = getOwnPropertyDescriptor$1(this, V);
  228. return !!descriptor && descriptor.enumerable;
  229. } : $propertyIsEnumerable;
  230. var objectPropertyIsEnumerable = {
  231. f: f$4
  232. };
  233. var createPropertyDescriptor = function (bitmap, value) {
  234. return {
  235. enumerable: !(bitmap & 1),
  236. configurable: !(bitmap & 2),
  237. writable: !(bitmap & 4),
  238. value: value
  239. };
  240. };
  241. var toString = {}.toString;
  242. var classofRaw = function (it) {
  243. return toString.call(it).slice(8, -1);
  244. };
  245. var split = ''.split;
  246. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  247. var indexedObject = fails(function () {
  248. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  249. // eslint-disable-next-line no-prototype-builtins -- safe
  250. return !Object('z').propertyIsEnumerable(0);
  251. }) ? function (it) {
  252. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  253. } : Object;
  254. // `RequireObjectCoercible` abstract operation
  255. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  256. var requireObjectCoercible = function (it) {
  257. if (it == undefined) throw TypeError("Can't call method on " + it);
  258. return it;
  259. };
  260. // toObject with fallback for non-array-like ES3 strings
  261. var toIndexedObject = function (it) {
  262. return indexedObject(requireObjectCoercible(it));
  263. };
  264. var isObject = function (it) {
  265. return typeof it === 'object' ? it !== null : typeof it === 'function';
  266. };
  267. // `ToPrimitive` abstract operation
  268. // https://tc39.es/ecma262/#sec-toprimitive
  269. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  270. // and the second argument - flag - preferred type is a string
  271. var toPrimitive = function (input, PREFERRED_STRING) {
  272. if (!isObject(input)) return input;
  273. var fn, val;
  274. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  275. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  276. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  277. throw TypeError("Can't convert object to primitive value");
  278. };
  279. var hasOwnProperty = {}.hasOwnProperty;
  280. var has$1 = function (it, key) {
  281. return hasOwnProperty.call(it, key);
  282. };
  283. var document$1 = global_1.document;
  284. // typeof document.createElement is 'object' in old IE
  285. var EXISTS = isObject(document$1) && isObject(document$1.createElement);
  286. var documentCreateElement = function (it) {
  287. return EXISTS ? document$1.createElement(it) : {};
  288. };
  289. // Thank's IE8 for his funny defineProperty
  290. var ie8DomDefine = !descriptors && !fails(function () {
  291. // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
  292. return Object.defineProperty(documentCreateElement('div'), 'a', {
  293. get: function () { return 7; }
  294. }).a != 7;
  295. });
  296. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  297. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  298. // `Object.getOwnPropertyDescriptor` method
  299. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  300. var f$3 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  301. O = toIndexedObject(O);
  302. P = toPrimitive(P, true);
  303. if (ie8DomDefine) try {
  304. return $getOwnPropertyDescriptor(O, P);
  305. } catch (error) { /* empty */ }
  306. if (has$1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  307. };
  308. var objectGetOwnPropertyDescriptor = {
  309. f: f$3
  310. };
  311. var anObject = function (it) {
  312. if (!isObject(it)) {
  313. throw TypeError(String(it) + ' is not an object');
  314. } return it;
  315. };
  316. // eslint-disable-next-line es/no-object-defineproperty -- safe
  317. var $defineProperty = Object.defineProperty;
  318. // `Object.defineProperty` method
  319. // https://tc39.es/ecma262/#sec-object.defineproperty
  320. var f$2 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
  321. anObject(O);
  322. P = toPrimitive(P, true);
  323. anObject(Attributes);
  324. if (ie8DomDefine) try {
  325. return $defineProperty(O, P, Attributes);
  326. } catch (error) { /* empty */ }
  327. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  328. if ('value' in Attributes) O[P] = Attributes.value;
  329. return O;
  330. };
  331. var objectDefineProperty = {
  332. f: f$2
  333. };
  334. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  335. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  336. } : function (object, key, value) {
  337. object[key] = value;
  338. return object;
  339. };
  340. var setGlobal = function (key, value) {
  341. try {
  342. createNonEnumerableProperty(global_1, key, value);
  343. } catch (error) {
  344. global_1[key] = value;
  345. } return value;
  346. };
  347. var SHARED = '__core-js_shared__';
  348. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  349. var sharedStore = store$1;
  350. var functionToString = Function.toString;
  351. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  352. if (typeof sharedStore.inspectSource != 'function') {
  353. sharedStore.inspectSource = function (it) {
  354. return functionToString.call(it);
  355. };
  356. }
  357. var inspectSource = sharedStore.inspectSource;
  358. var WeakMap$1 = global_1.WeakMap;
  359. var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));
  360. var shared = createCommonjsModule(function (module) {
  361. (module.exports = function (key, value) {
  362. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  363. })('versions', []).push({
  364. version: '3.10.1',
  365. mode: 'global',
  366. copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
  367. });
  368. });
  369. var id = 0;
  370. var postfix = Math.random();
  371. var uid = function (key) {
  372. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  373. };
  374. var keys = shared('keys');
  375. var sharedKey = function (key) {
  376. return keys[key] || (keys[key] = uid(key));
  377. };
  378. var hiddenKeys$1 = {};
  379. var WeakMap = global_1.WeakMap;
  380. var set, get, has;
  381. var enforce = function (it) {
  382. return has(it) ? get(it) : set(it, {});
  383. };
  384. var getterFor = function (TYPE) {
  385. return function (it) {
  386. var state;
  387. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  388. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  389. } return state;
  390. };
  391. };
  392. if (nativeWeakMap) {
  393. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  394. var wmget = store.get;
  395. var wmhas = store.has;
  396. var wmset = store.set;
  397. set = function (it, metadata) {
  398. metadata.facade = it;
  399. wmset.call(store, it, metadata);
  400. return metadata;
  401. };
  402. get = function (it) {
  403. return wmget.call(store, it) || {};
  404. };
  405. has = function (it) {
  406. return wmhas.call(store, it);
  407. };
  408. } else {
  409. var STATE = sharedKey('state');
  410. hiddenKeys$1[STATE] = true;
  411. set = function (it, metadata) {
  412. metadata.facade = it;
  413. createNonEnumerableProperty(it, STATE, metadata);
  414. return metadata;
  415. };
  416. get = function (it) {
  417. return has$1(it, STATE) ? it[STATE] : {};
  418. };
  419. has = function (it) {
  420. return has$1(it, STATE);
  421. };
  422. }
  423. var internalState = {
  424. set: set,
  425. get: get,
  426. has: has,
  427. enforce: enforce,
  428. getterFor: getterFor
  429. };
  430. var redefine = createCommonjsModule(function (module) {
  431. var getInternalState = internalState.get;
  432. var enforceInternalState = internalState.enforce;
  433. var TEMPLATE = String(String).split('String');
  434. (module.exports = function (O, key, value, options) {
  435. var unsafe = options ? !!options.unsafe : false;
  436. var simple = options ? !!options.enumerable : false;
  437. var noTargetGet = options ? !!options.noTargetGet : false;
  438. var state;
  439. if (typeof value == 'function') {
  440. if (typeof key == 'string' && !has$1(value, 'name')) {
  441. createNonEnumerableProperty(value, 'name', key);
  442. }
  443. state = enforceInternalState(value);
  444. if (!state.source) {
  445. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  446. }
  447. }
  448. if (O === global_1) {
  449. if (simple) O[key] = value;
  450. else setGlobal(key, value);
  451. return;
  452. } else if (!unsafe) {
  453. delete O[key];
  454. } else if (!noTargetGet && O[key]) {
  455. simple = true;
  456. }
  457. if (simple) O[key] = value;
  458. else createNonEnumerableProperty(O, key, value);
  459. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  460. })(Function.prototype, 'toString', function toString() {
  461. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  462. });
  463. });
  464. var path = global_1;
  465. var aFunction$1 = function (variable) {
  466. return typeof variable == 'function' ? variable : undefined;
  467. };
  468. var getBuiltIn = function (namespace, method) {
  469. return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(global_1[namespace])
  470. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  471. };
  472. var ceil = Math.ceil;
  473. var floor$1 = Math.floor;
  474. // `ToInteger` abstract operation
  475. // https://tc39.es/ecma262/#sec-tointeger
  476. var toInteger = function (argument) {
  477. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor$1 : ceil)(argument);
  478. };
  479. var min$3 = Math.min;
  480. // `ToLength` abstract operation
  481. // https://tc39.es/ecma262/#sec-tolength
  482. var toLength = function (argument) {
  483. return argument > 0 ? min$3(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  484. };
  485. var max$2 = Math.max;
  486. var min$2 = Math.min;
  487. // Helper for a popular repeating case of the spec:
  488. // Let integer be ? ToInteger(index).
  489. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  490. var toAbsoluteIndex = function (index, length) {
  491. var integer = toInteger(index);
  492. return integer < 0 ? max$2(integer + length, 0) : min$2(integer, length);
  493. };
  494. // `Array.prototype.{ indexOf, includes }` methods implementation
  495. var createMethod$2 = function (IS_INCLUDES) {
  496. return function ($this, el, fromIndex) {
  497. var O = toIndexedObject($this);
  498. var length = toLength(O.length);
  499. var index = toAbsoluteIndex(fromIndex, length);
  500. var value;
  501. // Array#includes uses SameValueZero equality algorithm
  502. // eslint-disable-next-line no-self-compare -- NaN check
  503. if (IS_INCLUDES && el != el) while (length > index) {
  504. value = O[index++];
  505. // eslint-disable-next-line no-self-compare -- NaN check
  506. if (value != value) return true;
  507. // Array#indexOf ignores holes, Array#includes - not
  508. } else for (;length > index; index++) {
  509. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  510. } return !IS_INCLUDES && -1;
  511. };
  512. };
  513. var arrayIncludes = {
  514. // `Array.prototype.includes` method
  515. // https://tc39.es/ecma262/#sec-array.prototype.includes
  516. includes: createMethod$2(true),
  517. // `Array.prototype.indexOf` method
  518. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  519. indexOf: createMethod$2(false)
  520. };
  521. var indexOf = arrayIncludes.indexOf;
  522. var objectKeysInternal = function (object, names) {
  523. var O = toIndexedObject(object);
  524. var i = 0;
  525. var result = [];
  526. var key;
  527. for (key in O) !has$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key);
  528. // Don't enum bug & hidden keys
  529. while (names.length > i) if (has$1(O, key = names[i++])) {
  530. ~indexOf(result, key) || result.push(key);
  531. }
  532. return result;
  533. };
  534. // IE8- don't enum bug keys
  535. var enumBugKeys = [
  536. 'constructor',
  537. 'hasOwnProperty',
  538. 'isPrototypeOf',
  539. 'propertyIsEnumerable',
  540. 'toLocaleString',
  541. 'toString',
  542. 'valueOf'
  543. ];
  544. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  545. // `Object.getOwnPropertyNames` method
  546. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  547. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  548. var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  549. return objectKeysInternal(O, hiddenKeys);
  550. };
  551. var objectGetOwnPropertyNames = {
  552. f: f$1
  553. };
  554. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  555. var f = Object.getOwnPropertySymbols;
  556. var objectGetOwnPropertySymbols = {
  557. f: f
  558. };
  559. // all object keys, includes non-enumerable and symbols
  560. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  561. var keys = objectGetOwnPropertyNames.f(anObject(it));
  562. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  563. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  564. };
  565. var copyConstructorProperties = function (target, source) {
  566. var keys = ownKeys(source);
  567. var defineProperty = objectDefineProperty.f;
  568. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  569. for (var i = 0; i < keys.length; i++) {
  570. var key = keys[i];
  571. if (!has$1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  572. }
  573. };
  574. var replacement = /#|\.prototype\./;
  575. var isForced = function (feature, detection) {
  576. var value = data[normalize(feature)];
  577. return value == POLYFILL ? true
  578. : value == NATIVE ? false
  579. : typeof detection == 'function' ? fails(detection)
  580. : !!detection;
  581. };
  582. var normalize = isForced.normalize = function (string) {
  583. return String(string).replace(replacement, '.').toLowerCase();
  584. };
  585. var data = isForced.data = {};
  586. var NATIVE = isForced.NATIVE = 'N';
  587. var POLYFILL = isForced.POLYFILL = 'P';
  588. var isForced_1 = isForced;
  589. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  590. /*
  591. options.target - name of the target object
  592. options.global - target is the global object
  593. options.stat - export as static methods of target
  594. options.proto - export as prototype methods of target
  595. options.real - real prototype method for the `pure` version
  596. options.forced - export even if the native feature is available
  597. options.bind - bind methods to the target, required for the `pure` version
  598. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  599. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  600. options.sham - add a flag to not completely full polyfills
  601. options.enumerable - export as enumerable property
  602. options.noTargetGet - prevent calling a getter on target
  603. */
  604. var _export = function (options, source) {
  605. var TARGET = options.target;
  606. var GLOBAL = options.global;
  607. var STATIC = options.stat;
  608. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  609. if (GLOBAL) {
  610. target = global_1;
  611. } else if (STATIC) {
  612. target = global_1[TARGET] || setGlobal(TARGET, {});
  613. } else {
  614. target = (global_1[TARGET] || {}).prototype;
  615. }
  616. if (target) for (key in source) {
  617. sourceProperty = source[key];
  618. if (options.noTargetGet) {
  619. descriptor = getOwnPropertyDescriptor(target, key);
  620. targetProperty = descriptor && descriptor.value;
  621. } else targetProperty = target[key];
  622. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  623. // contained in target
  624. if (!FORCED && targetProperty !== undefined) {
  625. if (typeof sourceProperty === typeof targetProperty) continue;
  626. copyConstructorProperties(sourceProperty, targetProperty);
  627. }
  628. // add a flag to not completely full polyfills
  629. if (options.sham || (targetProperty && targetProperty.sham)) {
  630. createNonEnumerableProperty(sourceProperty, 'sham', true);
  631. }
  632. // extend global
  633. redefine(target, key, sourceProperty, options);
  634. }
  635. };
  636. var aFunction = function (it) {
  637. if (typeof it != 'function') {
  638. throw TypeError(String(it) + ' is not a function');
  639. } return it;
  640. };
  641. // optional / simple context binding
  642. var functionBindContext = function (fn, that, length) {
  643. aFunction(fn);
  644. if (that === undefined) return fn;
  645. switch (length) {
  646. case 0: return function () {
  647. return fn.call(that);
  648. };
  649. case 1: return function (a) {
  650. return fn.call(that, a);
  651. };
  652. case 2: return function (a, b) {
  653. return fn.call(that, a, b);
  654. };
  655. case 3: return function (a, b, c) {
  656. return fn.call(that, a, b, c);
  657. };
  658. }
  659. return function (/* ...args */) {
  660. return fn.apply(that, arguments);
  661. };
  662. };
  663. // `ToObject` abstract operation
  664. // https://tc39.es/ecma262/#sec-toobject
  665. var toObject = function (argument) {
  666. return Object(requireObjectCoercible(argument));
  667. };
  668. // `IsArray` abstract operation
  669. // https://tc39.es/ecma262/#sec-isarray
  670. // eslint-disable-next-line es/no-array-isarray -- safe
  671. var isArray = Array.isArray || function isArray(arg) {
  672. return classofRaw(arg) == 'Array';
  673. };
  674. var engineIsNode = classofRaw(global_1.process) == 'process';
  675. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  676. var process = global_1.process;
  677. var versions = process && process.versions;
  678. var v8 = versions && versions.v8;
  679. var match, version;
  680. if (v8) {
  681. match = v8.split('.');
  682. version = match[0] + match[1];
  683. } else if (engineUserAgent) {
  684. match = engineUserAgent.match(/Edge\/(\d+)/);
  685. if (!match || match[1] >= 74) {
  686. match = engineUserAgent.match(/Chrome\/(\d+)/);
  687. if (match) version = match[1];
  688. }
  689. }
  690. var engineV8Version = version && +version;
  691. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  692. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  693. // eslint-disable-next-line es/no-symbol -- required for testing
  694. return !Symbol.sham &&
  695. // Chrome 38 Symbol has incorrect toString conversion
  696. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  697. (engineIsNode ? engineV8Version === 38 : engineV8Version > 37 && engineV8Version < 41);
  698. });
  699. /* eslint-disable es/no-symbol -- required for testing */
  700. var useSymbolAsUid = nativeSymbol
  701. && !Symbol.sham
  702. && typeof Symbol.iterator == 'symbol';
  703. var WellKnownSymbolsStore = shared('wks');
  704. var Symbol$1 = global_1.Symbol;
  705. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  706. var wellKnownSymbol = function (name) {
  707. if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  708. if (nativeSymbol && has$1(Symbol$1, name)) {
  709. WellKnownSymbolsStore[name] = Symbol$1[name];
  710. } else {
  711. WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  712. }
  713. } return WellKnownSymbolsStore[name];
  714. };
  715. var SPECIES$4 = wellKnownSymbol('species');
  716. // `ArraySpeciesCreate` abstract operation
  717. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  718. var arraySpeciesCreate = function (originalArray, length) {
  719. var C;
  720. if (isArray(originalArray)) {
  721. C = originalArray.constructor;
  722. // cross-realm fallback
  723. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  724. else if (isObject(C)) {
  725. C = C[SPECIES$4];
  726. if (C === null) C = undefined;
  727. }
  728. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  729. };
  730. var push = [].push;
  731. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  732. var createMethod$1 = function (TYPE) {
  733. var IS_MAP = TYPE == 1;
  734. var IS_FILTER = TYPE == 2;
  735. var IS_SOME = TYPE == 3;
  736. var IS_EVERY = TYPE == 4;
  737. var IS_FIND_INDEX = TYPE == 6;
  738. var IS_FILTER_OUT = TYPE == 7;
  739. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  740. return function ($this, callbackfn, that, specificCreate) {
  741. var O = toObject($this);
  742. var self = indexedObject(O);
  743. var boundFunction = functionBindContext(callbackfn, that, 3);
  744. var length = toLength(self.length);
  745. var index = 0;
  746. var create = specificCreate || arraySpeciesCreate;
  747. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  748. var value, result;
  749. for (;length > index; index++) if (NO_HOLES || index in self) {
  750. value = self[index];
  751. result = boundFunction(value, index, O);
  752. if (TYPE) {
  753. if (IS_MAP) target[index] = result; // map
  754. else if (result) switch (TYPE) {
  755. case 3: return true; // some
  756. case 5: return value; // find
  757. case 6: return index; // findIndex
  758. case 2: push.call(target, value); // filter
  759. } else switch (TYPE) {
  760. case 4: return false; // every
  761. case 7: push.call(target, value); // filterOut
  762. }
  763. }
  764. }
  765. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  766. };
  767. };
  768. var arrayIteration = {
  769. // `Array.prototype.forEach` method
  770. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  771. forEach: createMethod$1(0),
  772. // `Array.prototype.map` method
  773. // https://tc39.es/ecma262/#sec-array.prototype.map
  774. map: createMethod$1(1),
  775. // `Array.prototype.filter` method
  776. // https://tc39.es/ecma262/#sec-array.prototype.filter
  777. filter: createMethod$1(2),
  778. // `Array.prototype.some` method
  779. // https://tc39.es/ecma262/#sec-array.prototype.some
  780. some: createMethod$1(3),
  781. // `Array.prototype.every` method
  782. // https://tc39.es/ecma262/#sec-array.prototype.every
  783. every: createMethod$1(4),
  784. // `Array.prototype.find` method
  785. // https://tc39.es/ecma262/#sec-array.prototype.find
  786. find: createMethod$1(5),
  787. // `Array.prototype.findIndex` method
  788. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  789. findIndex: createMethod$1(6),
  790. // `Array.prototype.filterOut` method
  791. // https://github.com/tc39/proposal-array-filtering
  792. filterOut: createMethod$1(7)
  793. };
  794. // `Object.keys` method
  795. // https://tc39.es/ecma262/#sec-object.keys
  796. // eslint-disable-next-line es/no-object-keys -- safe
  797. var objectKeys = Object.keys || function keys(O) {
  798. return objectKeysInternal(O, enumBugKeys);
  799. };
  800. // `Object.defineProperties` method
  801. // https://tc39.es/ecma262/#sec-object.defineproperties
  802. // eslint-disable-next-line es/no-object-defineproperties -- safe
  803. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  804. anObject(O);
  805. var keys = objectKeys(Properties);
  806. var length = keys.length;
  807. var index = 0;
  808. var key;
  809. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  810. return O;
  811. };
  812. var html = getBuiltIn('document', 'documentElement');
  813. var GT = '>';
  814. var LT = '<';
  815. var PROTOTYPE = 'prototype';
  816. var SCRIPT = 'script';
  817. var IE_PROTO = sharedKey('IE_PROTO');
  818. var EmptyConstructor = function () { /* empty */ };
  819. var scriptTag = function (content) {
  820. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  821. };
  822. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  823. var NullProtoObjectViaActiveX = function (activeXDocument) {
  824. activeXDocument.write(scriptTag(''));
  825. activeXDocument.close();
  826. var temp = activeXDocument.parentWindow.Object;
  827. activeXDocument = null; // avoid memory leak
  828. return temp;
  829. };
  830. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  831. var NullProtoObjectViaIFrame = function () {
  832. // Thrash, waste and sodomy: IE GC bug
  833. var iframe = documentCreateElement('iframe');
  834. var JS = 'java' + SCRIPT + ':';
  835. var iframeDocument;
  836. iframe.style.display = 'none';
  837. html.appendChild(iframe);
  838. // https://github.com/zloirock/core-js/issues/475
  839. iframe.src = String(JS);
  840. iframeDocument = iframe.contentWindow.document;
  841. iframeDocument.open();
  842. iframeDocument.write(scriptTag('document.F=Object'));
  843. iframeDocument.close();
  844. return iframeDocument.F;
  845. };
  846. // Check for document.domain and active x support
  847. // No need to use active x approach when document.domain is not set
  848. // see https://github.com/es-shims/es5-shim/issues/150
  849. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  850. // avoid IE GC bug
  851. var activeXDocument;
  852. var NullProtoObject = function () {
  853. try {
  854. /* global ActiveXObject -- old IE */
  855. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  856. } catch (error) { /* ignore */ }
  857. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  858. var length = enumBugKeys.length;
  859. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  860. return NullProtoObject();
  861. };
  862. hiddenKeys$1[IE_PROTO] = true;
  863. // `Object.create` method
  864. // https://tc39.es/ecma262/#sec-object.create
  865. var objectCreate = Object.create || function create(O, Properties) {
  866. var result;
  867. if (O !== null) {
  868. EmptyConstructor[PROTOTYPE] = anObject(O);
  869. result = new EmptyConstructor();
  870. EmptyConstructor[PROTOTYPE] = null;
  871. // add "__proto__" for Object.getPrototypeOf polyfill
  872. result[IE_PROTO] = O;
  873. } else result = NullProtoObject();
  874. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  875. };
  876. var UNSCOPABLES = wellKnownSymbol('unscopables');
  877. var ArrayPrototype = Array.prototype;
  878. // Array.prototype[@@unscopables]
  879. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  880. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  881. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  882. configurable: true,
  883. value: objectCreate(null)
  884. });
  885. }
  886. // add a key to Array.prototype[@@unscopables]
  887. var addToUnscopables = function (key) {
  888. ArrayPrototype[UNSCOPABLES][key] = true;
  889. };
  890. var $find = arrayIteration.find;
  891. var FIND = 'find';
  892. var SKIPS_HOLES = true;
  893. // Shouldn't skip holes
  894. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  895. // `Array.prototype.find` method
  896. // https://tc39.es/ecma262/#sec-array.prototype.find
  897. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  898. find: function find(callbackfn /* , that = undefined */) {
  899. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  900. }
  901. });
  902. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  903. addToUnscopables(FIND);
  904. // `RegExp.prototype.flags` getter implementation
  905. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  906. var regexpFlags = function () {
  907. var that = anObject(this);
  908. var result = '';
  909. if (that.global) result += 'g';
  910. if (that.ignoreCase) result += 'i';
  911. if (that.multiline) result += 'm';
  912. if (that.dotAll) result += 's';
  913. if (that.unicode) result += 'u';
  914. if (that.sticky) result += 'y';
  915. return result;
  916. };
  917. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
  918. // so we use an intermediate function.
  919. function RE(s, f) {
  920. return RegExp(s, f);
  921. }
  922. var UNSUPPORTED_Y$2 = fails(function () {
  923. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  924. var re = RE('a', 'y');
  925. re.lastIndex = 2;
  926. return re.exec('abcd') != null;
  927. });
  928. var BROKEN_CARET = fails(function () {
  929. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  930. var re = RE('^r', 'gy');
  931. re.lastIndex = 2;
  932. return re.exec('str') != null;
  933. });
  934. var regexpStickyHelpers = {
  935. UNSUPPORTED_Y: UNSUPPORTED_Y$2,
  936. BROKEN_CARET: BROKEN_CARET
  937. };
  938. var nativeExec = RegExp.prototype.exec;
  939. var nativeReplace = shared('native-string-replace', String.prototype.replace);
  940. var patchedExec = nativeExec;
  941. var UPDATES_LAST_INDEX_WRONG = (function () {
  942. var re1 = /a/;
  943. var re2 = /b*/g;
  944. nativeExec.call(re1, 'a');
  945. nativeExec.call(re2, 'a');
  946. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  947. })();
  948. var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
  949. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  950. // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
  951. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  952. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1;
  953. if (PATCH) {
  954. patchedExec = function exec(str) {
  955. var re = this;
  956. var lastIndex, reCopy, match, i;
  957. var sticky = UNSUPPORTED_Y$1 && re.sticky;
  958. var flags = regexpFlags.call(re);
  959. var source = re.source;
  960. var charsAdded = 0;
  961. var strCopy = str;
  962. if (sticky) {
  963. flags = flags.replace('y', '');
  964. if (flags.indexOf('g') === -1) {
  965. flags += 'g';
  966. }
  967. strCopy = String(str).slice(re.lastIndex);
  968. // Support anchored sticky behavior.
  969. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
  970. source = '(?: ' + source + ')';
  971. strCopy = ' ' + strCopy;
  972. charsAdded++;
  973. }
  974. // ^(? + rx + ) is needed, in combination with some str slicing, to
  975. // simulate the 'y' flag.
  976. reCopy = new RegExp('^(?:' + source + ')', flags);
  977. }
  978. if (NPCG_INCLUDED) {
  979. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  980. }
  981. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  982. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  983. if (sticky) {
  984. if (match) {
  985. match.input = match.input.slice(charsAdded);
  986. match[0] = match[0].slice(charsAdded);
  987. match.index = re.lastIndex;
  988. re.lastIndex += match[0].length;
  989. } else re.lastIndex = 0;
  990. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  991. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  992. }
  993. if (NPCG_INCLUDED && match && match.length > 1) {
  994. // Fix browsers whose `exec` methods don't consistently return `undefined`
  995. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  996. nativeReplace.call(match[0], reCopy, function () {
  997. for (i = 1; i < arguments.length - 2; i++) {
  998. if (arguments[i] === undefined) match[i] = undefined;
  999. }
  1000. });
  1001. }
  1002. return match;
  1003. };
  1004. }
  1005. var regexpExec = patchedExec;
  1006. // `RegExp.prototype.exec` method
  1007. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  1008. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  1009. exec: regexpExec
  1010. });
  1011. // TODO: Remove from `core-js@4` since it's moved to entry points
  1012. var SPECIES$3 = wellKnownSymbol('species');
  1013. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  1014. // #replace needs built-in support for named groups.
  1015. // #match works fine because it just return the exec results, even if it has
  1016. // a "grops" property.
  1017. var re = /./;
  1018. re.exec = function () {
  1019. var result = [];
  1020. result.groups = { a: '7' };
  1021. return result;
  1022. };
  1023. return ''.replace(re, '$<a>') !== '7';
  1024. });
  1025. // IE <= 11 replaces $0 with the whole match, as if it was $&
  1026. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  1027. var REPLACE_KEEPS_$0 = (function () {
  1028. // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
  1029. return 'a'.replace(/./, '$0') === '$0';
  1030. })();
  1031. var REPLACE = wellKnownSymbol('replace');
  1032. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  1033. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  1034. if (/./[REPLACE]) {
  1035. return /./[REPLACE]('a', '$0') === '';
  1036. }
  1037. return false;
  1038. })();
  1039. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  1040. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  1041. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  1042. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1043. var re = /(?:)/;
  1044. var originalExec = re.exec;
  1045. re.exec = function () { return originalExec.apply(this, arguments); };
  1046. var result = 'ab'.split(re);
  1047. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  1048. });
  1049. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  1050. var SYMBOL = wellKnownSymbol(KEY);
  1051. var DELEGATES_TO_SYMBOL = !fails(function () {
  1052. // String methods call symbol-named RegEp methods
  1053. var O = {};
  1054. O[SYMBOL] = function () { return 7; };
  1055. return ''[KEY](O) != 7;
  1056. });
  1057. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  1058. // Symbol-named RegExp methods call .exec
  1059. var execCalled = false;
  1060. var re = /a/;
  1061. if (KEY === 'split') {
  1062. // We can't use real regex here since it causes deoptimization
  1063. // and serious performance degradation in V8
  1064. // https://github.com/zloirock/core-js/issues/306
  1065. re = {};
  1066. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  1067. // a new one. We need to return the patched regex when creating the new one.
  1068. re.constructor = {};
  1069. re.constructor[SPECIES$3] = function () { return re; };
  1070. re.flags = '';
  1071. re[SYMBOL] = /./[SYMBOL];
  1072. }
  1073. re.exec = function () { execCalled = true; return null; };
  1074. re[SYMBOL]('');
  1075. return !execCalled;
  1076. });
  1077. if (
  1078. !DELEGATES_TO_SYMBOL ||
  1079. !DELEGATES_TO_EXEC ||
  1080. (KEY === 'replace' && !(
  1081. REPLACE_SUPPORTS_NAMED_GROUPS &&
  1082. REPLACE_KEEPS_$0 &&
  1083. !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  1084. )) ||
  1085. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  1086. ) {
  1087. var nativeRegExpMethod = /./[SYMBOL];
  1088. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  1089. if (regexp.exec === RegExp.prototype.exec) {
  1090. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  1091. // The native String method already delegates to @@method (this
  1092. // polyfilled function), leasing to infinite recursion.
  1093. // We avoid it by directly calling the native @@method method.
  1094. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  1095. }
  1096. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  1097. }
  1098. return { done: false };
  1099. }, {
  1100. REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
  1101. REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  1102. });
  1103. var stringMethod = methods[0];
  1104. var regexMethod = methods[1];
  1105. redefine(String.prototype, KEY, stringMethod);
  1106. redefine(RegExp.prototype, SYMBOL, length == 2
  1107. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  1108. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  1109. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  1110. // 21.2.5.6 RegExp.prototype[@@match](string)
  1111. // 21.2.5.9 RegExp.prototype[@@search](string)
  1112. : function (string) { return regexMethod.call(string, this); }
  1113. );
  1114. }
  1115. if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
  1116. };
  1117. var MATCH = wellKnownSymbol('match');
  1118. // `IsRegExp` abstract operation
  1119. // https://tc39.es/ecma262/#sec-isregexp
  1120. var isRegexp = function (it) {
  1121. var isRegExp;
  1122. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  1123. };
  1124. var SPECIES$2 = wellKnownSymbol('species');
  1125. // `SpeciesConstructor` abstract operation
  1126. // https://tc39.es/ecma262/#sec-speciesconstructor
  1127. var speciesConstructor = function (O, defaultConstructor) {
  1128. var C = anObject(O).constructor;
  1129. var S;
  1130. return C === undefined || (S = anObject(C)[SPECIES$2]) == undefined ? defaultConstructor : aFunction(S);
  1131. };
  1132. // `String.prototype.{ codePointAt, at }` methods implementation
  1133. var createMethod = function (CONVERT_TO_STRING) {
  1134. return function ($this, pos) {
  1135. var S = String(requireObjectCoercible($this));
  1136. var position = toInteger(pos);
  1137. var size = S.length;
  1138. var first, second;
  1139. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  1140. first = S.charCodeAt(position);
  1141. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  1142. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  1143. ? CONVERT_TO_STRING ? S.charAt(position) : first
  1144. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  1145. };
  1146. };
  1147. var stringMultibyte = {
  1148. // `String.prototype.codePointAt` method
  1149. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  1150. codeAt: createMethod(false),
  1151. // `String.prototype.at` method
  1152. // https://github.com/mathiasbynens/String.prototype.at
  1153. charAt: createMethod(true)
  1154. };
  1155. var charAt = stringMultibyte.charAt;
  1156. // `AdvanceStringIndex` abstract operation
  1157. // https://tc39.es/ecma262/#sec-advancestringindex
  1158. var advanceStringIndex = function (S, index, unicode) {
  1159. return index + (unicode ? charAt(S, index).length : 1);
  1160. };
  1161. // `RegExpExec` abstract operation
  1162. // https://tc39.es/ecma262/#sec-regexpexec
  1163. var regexpExecAbstract = function (R, S) {
  1164. var exec = R.exec;
  1165. if (typeof exec === 'function') {
  1166. var result = exec.call(R, S);
  1167. if (typeof result !== 'object') {
  1168. throw TypeError('RegExp exec method returned something other than an Object or null');
  1169. }
  1170. return result;
  1171. }
  1172. if (classofRaw(R) !== 'RegExp') {
  1173. throw TypeError('RegExp#exec called on incompatible receiver');
  1174. }
  1175. return regexpExec.call(R, S);
  1176. };
  1177. var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y;
  1178. var arrayPush = [].push;
  1179. var min$1 = Math.min;
  1180. var MAX_UINT32 = 0xFFFFFFFF;
  1181. // @@split logic
  1182. fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
  1183. var internalSplit;
  1184. if (
  1185. 'abbc'.split(/(b)*/)[1] == 'c' ||
  1186. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1187. 'test'.split(/(?:)/, -1).length != 4 ||
  1188. 'ab'.split(/(?:ab)*/).length != 2 ||
  1189. '.'.split(/(.?)(.?)/).length != 4 ||
  1190. // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
  1191. '.'.split(/()()/).length > 1 ||
  1192. ''.split(/.?/).length
  1193. ) {
  1194. // based on es5-shim implementation, need to rework it
  1195. internalSplit = function (separator, limit) {
  1196. var string = String(requireObjectCoercible(this));
  1197. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1198. if (lim === 0) return [];
  1199. if (separator === undefined) return [string];
  1200. // If `separator` is not a regex, use native split
  1201. if (!isRegexp(separator)) {
  1202. return nativeSplit.call(string, separator, lim);
  1203. }
  1204. var output = [];
  1205. var flags = (separator.ignoreCase ? 'i' : '') +
  1206. (separator.multiline ? 'm' : '') +
  1207. (separator.unicode ? 'u' : '') +
  1208. (separator.sticky ? 'y' : '');
  1209. var lastLastIndex = 0;
  1210. // Make `global` and avoid `lastIndex` issues by working with a copy
  1211. var separatorCopy = new RegExp(separator.source, flags + 'g');
  1212. var match, lastIndex, lastLength;
  1213. while (match = regexpExec.call(separatorCopy, string)) {
  1214. lastIndex = separatorCopy.lastIndex;
  1215. if (lastIndex > lastLastIndex) {
  1216. output.push(string.slice(lastLastIndex, match.index));
  1217. if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
  1218. lastLength = match[0].length;
  1219. lastLastIndex = lastIndex;
  1220. if (output.length >= lim) break;
  1221. }
  1222. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  1223. }
  1224. if (lastLastIndex === string.length) {
  1225. if (lastLength || !separatorCopy.test('')) output.push('');
  1226. } else output.push(string.slice(lastLastIndex));
  1227. return output.length > lim ? output.slice(0, lim) : output;
  1228. };
  1229. // Chakra, V8
  1230. } else if ('0'.split(undefined, 0).length) {
  1231. internalSplit = function (separator, limit) {
  1232. return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
  1233. };
  1234. } else internalSplit = nativeSplit;
  1235. return [
  1236. // `String.prototype.split` method
  1237. // https://tc39.es/ecma262/#sec-string.prototype.split
  1238. function split(separator, limit) {
  1239. var O = requireObjectCoercible(this);
  1240. var splitter = separator == undefined ? undefined : separator[SPLIT];
  1241. return splitter !== undefined
  1242. ? splitter.call(separator, O, limit)
  1243. : internalSplit.call(String(O), separator, limit);
  1244. },
  1245. // `RegExp.prototype[@@split]` method
  1246. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  1247. //
  1248. // NOTE: This cannot be properly polyfilled in engines that don't support
  1249. // the 'y' flag.
  1250. function (regexp, limit) {
  1251. var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
  1252. if (res.done) return res.value;
  1253. var rx = anObject(regexp);
  1254. var S = String(this);
  1255. var C = speciesConstructor(rx, RegExp);
  1256. var unicodeMatching = rx.unicode;
  1257. var flags = (rx.ignoreCase ? 'i' : '') +
  1258. (rx.multiline ? 'm' : '') +
  1259. (rx.unicode ? 'u' : '') +
  1260. (UNSUPPORTED_Y ? 'g' : 'y');
  1261. // ^(? + rx + ) is needed, in combination with some S slicing, to
  1262. // simulate the 'y' flag.
  1263. var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
  1264. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1265. if (lim === 0) return [];
  1266. if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
  1267. var p = 0;
  1268. var q = 0;
  1269. var A = [];
  1270. while (q < S.length) {
  1271. splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
  1272. var z = regexpExecAbstract(splitter, UNSUPPORTED_Y ? S.slice(q) : S);
  1273. var e;
  1274. if (
  1275. z === null ||
  1276. (e = min$1(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
  1277. ) {
  1278. q = advanceStringIndex(S, q, unicodeMatching);
  1279. } else {
  1280. A.push(S.slice(p, q));
  1281. if (A.length === lim) return A;
  1282. for (var i = 1; i <= z.length - 1; i++) {
  1283. A.push(z[i]);
  1284. if (A.length === lim) return A;
  1285. }
  1286. q = p = e;
  1287. }
  1288. }
  1289. A.push(S.slice(p));
  1290. return A;
  1291. }
  1292. ];
  1293. }, UNSUPPORTED_Y);
  1294. var floor = Math.floor;
  1295. var replace = ''.replace;
  1296. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  1297. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  1298. // https://tc39.es/ecma262/#sec-getsubstitution
  1299. var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
  1300. var tailPos = position + matched.length;
  1301. var m = captures.length;
  1302. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  1303. if (namedCaptures !== undefined) {
  1304. namedCaptures = toObject(namedCaptures);
  1305. symbols = SUBSTITUTION_SYMBOLS;
  1306. }
  1307. return replace.call(replacement, symbols, function (match, ch) {
  1308. var capture;
  1309. switch (ch.charAt(0)) {
  1310. case '$': return '$';
  1311. case '&': return matched;
  1312. case '`': return str.slice(0, position);
  1313. case "'": return str.slice(tailPos);
  1314. case '<':
  1315. capture = namedCaptures[ch.slice(1, -1)];
  1316. break;
  1317. default: // \d\d?
  1318. var n = +ch;
  1319. if (n === 0) return match;
  1320. if (n > m) {
  1321. var f = floor(n / 10);
  1322. if (f === 0) return match;
  1323. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  1324. return match;
  1325. }
  1326. capture = captures[n - 1];
  1327. }
  1328. return capture === undefined ? '' : capture;
  1329. });
  1330. };
  1331. var max$1 = Math.max;
  1332. var min = Math.min;
  1333. var maybeToString = function (it) {
  1334. return it === undefined ? it : String(it);
  1335. };
  1336. // @@replace logic
  1337. fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
  1338. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
  1339. var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
  1340. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  1341. return [
  1342. // `String.prototype.replace` method
  1343. // https://tc39.es/ecma262/#sec-string.prototype.replace
  1344. function replace(searchValue, replaceValue) {
  1345. var O = requireObjectCoercible(this);
  1346. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  1347. return replacer !== undefined
  1348. ? replacer.call(searchValue, O, replaceValue)
  1349. : nativeReplace.call(String(O), searchValue, replaceValue);
  1350. },
  1351. // `RegExp.prototype[@@replace]` method
  1352. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  1353. function (regexp, replaceValue) {
  1354. if (
  1355. (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
  1356. (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
  1357. ) {
  1358. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  1359. if (res.done) return res.value;
  1360. }
  1361. var rx = anObject(regexp);
  1362. var S = String(this);
  1363. var functionalReplace = typeof replaceValue === 'function';
  1364. if (!functionalReplace) replaceValue = String(replaceValue);
  1365. var global = rx.global;
  1366. if (global) {
  1367. var fullUnicode = rx.unicode;
  1368. rx.lastIndex = 0;
  1369. }
  1370. var results = [];
  1371. while (true) {
  1372. var result = regexpExecAbstract(rx, S);
  1373. if (result === null) break;
  1374. results.push(result);
  1375. if (!global) break;
  1376. var matchStr = String(result[0]);
  1377. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1378. }
  1379. var accumulatedResult = '';
  1380. var nextSourcePosition = 0;
  1381. for (var i = 0; i < results.length; i++) {
  1382. result = results[i];
  1383. var matched = String(result[0]);
  1384. var position = max$1(min(toInteger(result.index), S.length), 0);
  1385. var captures = [];
  1386. // NOTE: This is equivalent to
  1387. // captures = result.slice(1).map(maybeToString)
  1388. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  1389. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  1390. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  1391. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  1392. var namedCaptures = result.groups;
  1393. if (functionalReplace) {
  1394. var replacerArgs = [matched].concat(captures, position, S);
  1395. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  1396. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  1397. } else {
  1398. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  1399. }
  1400. if (position >= nextSourcePosition) {
  1401. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  1402. nextSourcePosition = position + matched.length;
  1403. }
  1404. }
  1405. return accumulatedResult + S.slice(nextSourcePosition);
  1406. }
  1407. ];
  1408. });
  1409. var createProperty = function (object, key, value) {
  1410. var propertyKey = toPrimitive(key);
  1411. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  1412. else object[propertyKey] = value;
  1413. };
  1414. var SPECIES$1 = wellKnownSymbol('species');
  1415. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  1416. // We can't use this feature detection in V8 since it causes
  1417. // deoptimization and serious performance degradation
  1418. // https://github.com/zloirock/core-js/issues/677
  1419. return engineV8Version >= 51 || !fails(function () {
  1420. var array = [];
  1421. var constructor = array.constructor = {};
  1422. constructor[SPECIES$1] = function () {
  1423. return { foo: 1 };
  1424. };
  1425. return array[METHOD_NAME](Boolean).foo !== 1;
  1426. });
  1427. };
  1428. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('slice');
  1429. var SPECIES = wellKnownSymbol('species');
  1430. var nativeSlice = [].slice;
  1431. var max = Math.max;
  1432. // `Array.prototype.slice` method
  1433. // https://tc39.es/ecma262/#sec-array.prototype.slice
  1434. // fallback for not array-like ES3 strings and DOM objects
  1435. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  1436. slice: function slice(start, end) {
  1437. var O = toIndexedObject(this);
  1438. var length = toLength(O.length);
  1439. var k = toAbsoluteIndex(start, length);
  1440. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1441. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  1442. var Constructor, result, n;
  1443. if (isArray(O)) {
  1444. Constructor = O.constructor;
  1445. // cross-realm fallback
  1446. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  1447. Constructor = undefined;
  1448. } else if (isObject(Constructor)) {
  1449. Constructor = Constructor[SPECIES];
  1450. if (Constructor === null) Constructor = undefined;
  1451. }
  1452. if (Constructor === Array || Constructor === undefined) {
  1453. return nativeSlice.call(O, k, fin);
  1454. }
  1455. }
  1456. result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
  1457. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  1458. result.length = n;
  1459. return result;
  1460. }
  1461. });
  1462. var $map = arrayIteration.map;
  1463. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
  1464. // `Array.prototype.map` method
  1465. // https://tc39.es/ecma262/#sec-array.prototype.map
  1466. // with adding support of @@species
  1467. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1468. map: function map(callbackfn /* , thisArg */) {
  1469. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1470. }
  1471. });
  1472. // eslint-disable-next-line es/no-object-assign -- safe
  1473. var $assign = Object.assign;
  1474. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  1475. var defineProperty = Object.defineProperty;
  1476. // `Object.assign` method
  1477. // https://tc39.es/ecma262/#sec-object.assign
  1478. var objectAssign = !$assign || fails(function () {
  1479. // should have correct order of operations (Edge bug)
  1480. if (descriptors && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
  1481. enumerable: true,
  1482. get: function () {
  1483. defineProperty(this, 'b', {
  1484. value: 3,
  1485. enumerable: false
  1486. });
  1487. }
  1488. }), { b: 2 })).b !== 1) return true;
  1489. // should work with symbols and should have deterministic property order (V8 bug)
  1490. var A = {};
  1491. var B = {};
  1492. // eslint-disable-next-line es/no-symbol -- safe
  1493. var symbol = Symbol();
  1494. var alphabet = 'abcdefghijklmnopqrst';
  1495. A[symbol] = 7;
  1496. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  1497. return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
  1498. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  1499. var T = toObject(target);
  1500. var argumentsLength = arguments.length;
  1501. var index = 1;
  1502. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  1503. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  1504. while (argumentsLength > index) {
  1505. var S = indexedObject(arguments[index++]);
  1506. var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
  1507. var length = keys.length;
  1508. var j = 0;
  1509. var key;
  1510. while (length > j) {
  1511. key = keys[j++];
  1512. if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
  1513. }
  1514. } return T;
  1515. } : $assign;
  1516. // `Object.assign` method
  1517. // https://tc39.es/ecma262/#sec-object.assign
  1518. // eslint-disable-next-line es/no-object-assign -- required for testing
  1519. _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
  1520. assign: objectAssign
  1521. });
  1522. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  1523. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  1524. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  1525. // We can't use this feature detection in V8 since it causes
  1526. // deoptimization and serious performance degradation
  1527. // https://github.com/zloirock/core-js/issues/679
  1528. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  1529. var array = [];
  1530. array[IS_CONCAT_SPREADABLE] = false;
  1531. return array.concat()[0] !== array;
  1532. });
  1533. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  1534. var isConcatSpreadable = function (O) {
  1535. if (!isObject(O)) return false;
  1536. var spreadable = O[IS_CONCAT_SPREADABLE];
  1537. return spreadable !== undefined ? !!spreadable : isArray(O);
  1538. };
  1539. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  1540. // `Array.prototype.concat` method
  1541. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1542. // with adding support of @@isConcatSpreadable and @@species
  1543. _export({ target: 'Array', proto: true, forced: FORCED }, {
  1544. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1545. concat: function concat(arg) {
  1546. var O = toObject(this);
  1547. var A = arraySpeciesCreate(O, 0);
  1548. var n = 0;
  1549. var i, k, length, len, E;
  1550. for (i = -1, length = arguments.length; i < length; i++) {
  1551. E = i === -1 ? O : arguments[i];
  1552. if (isConcatSpreadable(E)) {
  1553. len = toLength(E.length);
  1554. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1555. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  1556. } else {
  1557. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1558. createProperty(A, n++, E);
  1559. }
  1560. }
  1561. A.length = n;
  1562. return A;
  1563. }
  1564. });
  1565. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  1566. var method = [][METHOD_NAME];
  1567. return !!method && fails(function () {
  1568. // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
  1569. method.call(null, argument || function () { throw 1; }, 1);
  1570. });
  1571. };
  1572. var nativeJoin = [].join;
  1573. var ES3_STRINGS = indexedObject != Object;
  1574. var STRICT_METHOD$1 = arrayMethodIsStrict('join', ',');
  1575. // `Array.prototype.join` method
  1576. // https://tc39.es/ecma262/#sec-array.prototype.join
  1577. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$1 }, {
  1578. join: function join(separator) {
  1579. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  1580. }
  1581. });
  1582. // iterable DOM collections
  1583. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  1584. var domIterables = {
  1585. CSSRuleList: 0,
  1586. CSSStyleDeclaration: 0,
  1587. CSSValueList: 0,
  1588. ClientRectList: 0,
  1589. DOMRectList: 0,
  1590. DOMStringList: 0,
  1591. DOMTokenList: 1,
  1592. DataTransferItemList: 0,
  1593. FileList: 0,
  1594. HTMLAllCollection: 0,
  1595. HTMLCollection: 0,
  1596. HTMLFormElement: 0,
  1597. HTMLSelectElement: 0,
  1598. MediaList: 0,
  1599. MimeTypeArray: 0,
  1600. NamedNodeMap: 0,
  1601. NodeList: 1,
  1602. PaintRequestList: 0,
  1603. Plugin: 0,
  1604. PluginArray: 0,
  1605. SVGLengthList: 0,
  1606. SVGNumberList: 0,
  1607. SVGPathSegList: 0,
  1608. SVGPointList: 0,
  1609. SVGStringList: 0,
  1610. SVGTransformList: 0,
  1611. SourceBufferList: 0,
  1612. StyleSheetList: 0,
  1613. TextTrackCueList: 0,
  1614. TextTrackList: 0,
  1615. TouchList: 0
  1616. };
  1617. var $forEach = arrayIteration.forEach;
  1618. var STRICT_METHOD = arrayMethodIsStrict('forEach');
  1619. // `Array.prototype.forEach` method implementation
  1620. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1621. var arrayForEach = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
  1622. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1623. // eslint-disable-next-line es/no-array-prototype-foreach -- safe
  1624. } : [].forEach;
  1625. for (var COLLECTION_NAME in domIterables) {
  1626. var Collection = global_1[COLLECTION_NAME];
  1627. var CollectionPrototype = Collection && Collection.prototype;
  1628. // some Chrome versions have non-configurable methods on DOMTokenList
  1629. if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
  1630. createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
  1631. } catch (error) {
  1632. CollectionPrototype.forEach = arrayForEach;
  1633. }
  1634. }
  1635. /**
  1636. * @author zhixin wen <wenzhixin2010@gmail.com>
  1637. * extensions: https://github.com/hhurz/tableExport.jquery.plugin
  1638. */
  1639. var Utils = $__default['default'].fn.bootstrapTable.utils;
  1640. var TYPE_NAME = {
  1641. json: 'JSON',
  1642. xml: 'XML',
  1643. png: 'PNG',
  1644. csv: 'CSV',
  1645. txt: 'TXT',
  1646. sql: 'SQL',
  1647. doc: 'MS-Word',
  1648. excel: 'MS-Excel',
  1649. xlsx: 'MS-Excel (OpenXML)',
  1650. powerpoint: 'MS-Powerpoint',
  1651. pdf: 'PDF'
  1652. };
  1653. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  1654. showExport: false,
  1655. exportDataType: 'basic',
  1656. // basic, all, selected
  1657. exportTypes: ['json', 'xml', 'csv', 'txt', 'sql', 'excel'],
  1658. exportOptions: {
  1659. onCellHtmlData: function onCellHtmlData(cell, rowIndex, colIndex, htmlData) {
  1660. if (cell.is('th')) {
  1661. return cell.find('.th-inner').text();
  1662. }
  1663. return htmlData;
  1664. }
  1665. },
  1666. exportFooter: false
  1667. });
  1668. $__default['default'].extend($__default['default'].fn.bootstrapTable.columnDefaults, {
  1669. forceExport: false,
  1670. forceHide: false
  1671. });
  1672. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults.icons, {
  1673. export: {
  1674. bootstrap3: 'glyphicon-export icon-share',
  1675. bootstrap5: 'bi-download',
  1676. materialize: 'file_download',
  1677. 'bootstrap-table': 'icon-download'
  1678. }[$__default['default'].fn.bootstrapTable.theme] || 'fa-download'
  1679. });
  1680. $__default['default'].extend($__default['default'].fn.bootstrapTable.locales, {
  1681. formatExport: function formatExport() {
  1682. return 'Export data';
  1683. }
  1684. });
  1685. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, $__default['default'].fn.bootstrapTable.locales);
  1686. $__default['default'].fn.bootstrapTable.methods.push('exportTable');
  1687. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  1688. // eslint-disable-next-line no-unused-vars
  1689. onExportSaved: function onExportSaved(exportedRows) {
  1690. return false;
  1691. }
  1692. });
  1693. $__default['default'].extend($__default['default'].fn.bootstrapTable.Constructor.EVENTS, {
  1694. 'export-saved.bs.table': 'onExportSaved'
  1695. });
  1696. $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1697. _inherits(_class, _$$BootstrapTable);
  1698. var _super = _createSuper(_class);
  1699. function _class() {
  1700. _classCallCheck(this, _class);
  1701. return _super.apply(this, arguments);
  1702. }
  1703. _createClass(_class, [{
  1704. key: "initToolbar",
  1705. value: function initToolbar() {
  1706. var _this = this,
  1707. _get2;
  1708. var o = this.options;
  1709. var exportTypes = o.exportTypes;
  1710. this.showToolbar = this.showToolbar || o.showExport;
  1711. if (this.options.showExport) {
  1712. if (typeof exportTypes === 'string') {
  1713. var types = exportTypes.slice(1, -1).replace(/ /g, '').split(',');
  1714. exportTypes = types.map(function (t) {
  1715. return t.slice(1, -1);
  1716. });
  1717. }
  1718. this.$export = this.$toolbar.find('>.columns div.export');
  1719. if (this.$export.length) {
  1720. this.updateExportButton();
  1721. return;
  1722. }
  1723. this.buttons = Object.assign(this.buttons, {
  1724. export: {
  1725. html: function html() {
  1726. if (exportTypes.length === 1) {
  1727. return "\n <div class=\"export ".concat(_this.constants.classes.buttonsDropdown, "\"\n data-type=\"").concat(exportTypes[0], "\">\n <button class=\"").concat(_this.constants.buttonsClass, "\"\n aria-label=\"Export\"\n type=\"button\"\n title=\"").concat(o.formatExport(), "\">\n ").concat(o.showButtonIcons ? Utils.sprintf(_this.constants.html.icon, o.iconsPrefix, o.icons.export) : '', "\n ").concat(o.showButtonText ? o.formatExport() : '', "\n </button>\n </div>\n ");
  1728. }
  1729. var html = [];
  1730. html.push("\n <div class=\"export ".concat(_this.constants.classes.buttonsDropdown, "\">\n <button class=\"").concat(_this.constants.buttonsClass, " dropdown-toggle\"\n aria-label=\"Export\"\n ").concat(_this.constants.dataToggle, "=\"dropdown\"\n type=\"button\"\n title=\"").concat(o.formatExport(), "\">\n ").concat(o.showButtonIcons ? Utils.sprintf(_this.constants.html.icon, o.iconsPrefix, o.icons.export) : '', "\n ").concat(o.showButtonText ? o.formatExport() : '', "\n ").concat(_this.constants.html.dropdownCaret, "\n </button>\n ").concat(_this.constants.html.toolbarDropdown[0], "\n "));
  1731. var _iterator = _createForOfIteratorHelper(exportTypes),
  1732. _step;
  1733. try {
  1734. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  1735. var type = _step.value;
  1736. if (TYPE_NAME.hasOwnProperty(type)) {
  1737. var $item = $__default['default'](Utils.sprintf(_this.constants.html.pageDropdownItem, '', TYPE_NAME[type]));
  1738. $item.attr('data-type', type);
  1739. html.push($item.prop('outerHTML'));
  1740. }
  1741. }
  1742. } catch (err) {
  1743. _iterator.e(err);
  1744. } finally {
  1745. _iterator.f();
  1746. }
  1747. html.push(_this.constants.html.toolbarDropdown[1], '</div>');
  1748. return html.join('');
  1749. }
  1750. }
  1751. });
  1752. }
  1753. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1754. args[_key] = arguments[_key];
  1755. }
  1756. (_get2 = _get(_getPrototypeOf(_class.prototype), "initToolbar", this)).call.apply(_get2, [this].concat(args));
  1757. this.$export = this.$toolbar.find('>.columns div.export');
  1758. if (!this.options.showExport) {
  1759. return;
  1760. }
  1761. this.updateExportButton();
  1762. var $exportButtons = this.$export.find('[data-type]');
  1763. if (exportTypes.length === 1) {
  1764. $exportButtons = this.$export.find('button');
  1765. }
  1766. $exportButtons.click(function (e) {
  1767. e.preventDefault();
  1768. var type = $__default['default'](e.currentTarget).data('type');
  1769. var exportOptions = {
  1770. type: type,
  1771. escape: false
  1772. };
  1773. _this.exportTable(exportOptions);
  1774. });
  1775. this.handleToolbar();
  1776. }
  1777. }, {
  1778. key: "handleToolbar",
  1779. value: function handleToolbar() {
  1780. if (!this.$export) {
  1781. return;
  1782. }
  1783. if (_get(_getPrototypeOf(_class.prototype), "handleToolbar", this)) {
  1784. _get(_getPrototypeOf(_class.prototype), "handleToolbar", this).call(this);
  1785. }
  1786. }
  1787. }, {
  1788. key: "exportTable",
  1789. value: function exportTable(options) {
  1790. var _this2 = this;
  1791. var o = this.options;
  1792. var stateField = this.header.stateField;
  1793. var isCardView = o.cardView;
  1794. var doExport = function doExport(callback) {
  1795. if (stateField) {
  1796. _this2.hideColumn(stateField);
  1797. }
  1798. if (isCardView) {
  1799. _this2.toggleView();
  1800. }
  1801. _this2.columns.forEach(function (row) {
  1802. if (row.forceHide) {
  1803. _this2.hideColumn(row.field);
  1804. }
  1805. });
  1806. var data = _this2.getData();
  1807. if (o.detailView && o.detailViewIcon) {
  1808. var detailViewIndex = o.detailViewAlign === 'left' ? 0 : _this2.getVisibleFields().length + Utils.getDetailViewIndexOffset(_this2.options);
  1809. o.exportOptions.ignoreColumn = [detailViewIndex].concat(o.exportOptions.ignoreColumn || []);
  1810. }
  1811. if (o.exportFooter) {
  1812. var $footerRow = _this2.$tableFooter.find('tr').first();
  1813. var footerData = {};
  1814. var footerHtml = [];
  1815. $__default['default'].each($footerRow.children(), function (index, footerCell) {
  1816. var footerCellHtml = $__default['default'](footerCell).children('.th-inner').first().html();
  1817. footerData[_this2.columns[index].field] = footerCellHtml === '&nbsp;' ? null : footerCellHtml; // grab footer cell text into cell index-based array
  1818. footerHtml.push(footerCellHtml);
  1819. });
  1820. _this2.$body.append(_this2.$body.children().last()[0].outerHTML);
  1821. var $lastTableRow = _this2.$body.children().last();
  1822. $__default['default'].each($lastTableRow.children(), function (index, lastTableRowCell) {
  1823. $__default['default'](lastTableRowCell).html(footerHtml[index]);
  1824. });
  1825. }
  1826. var hiddenColumns = _this2.getHiddenColumns();
  1827. hiddenColumns.forEach(function (row) {
  1828. if (row.forceExport) {
  1829. _this2.showColumn(row.field);
  1830. }
  1831. });
  1832. if (typeof o.exportOptions.fileName === 'function') {
  1833. options.fileName = o.exportOptions.fileName();
  1834. }
  1835. _this2.$el.tableExport($__default['default'].extend({
  1836. onAfterSaveToFile: function onAfterSaveToFile() {
  1837. if (o.exportFooter) {
  1838. _this2.load(data);
  1839. }
  1840. if (stateField) {
  1841. _this2.showColumn(stateField);
  1842. }
  1843. if (isCardView) {
  1844. _this2.toggleView();
  1845. }
  1846. hiddenColumns.forEach(function (row) {
  1847. if (row.forceExport) {
  1848. _this2.hideColumn(row.field);
  1849. }
  1850. });
  1851. _this2.columns.forEach(function (row) {
  1852. if (row.forceHide) {
  1853. _this2.showColumn(row.field);
  1854. }
  1855. });
  1856. if (callback) callback();
  1857. }
  1858. }, o.exportOptions, options));
  1859. };
  1860. if (o.exportDataType === 'all' && o.pagination) {
  1861. var eventName = o.sidePagination === 'server' ? 'post-body.bs.table' : 'page-change.bs.table';
  1862. var virtualScroll = this.options.virtualScroll;
  1863. this.$el.one(eventName, function () {
  1864. setTimeout(function () {
  1865. doExport(function () {
  1866. _this2.options.virtualScroll = virtualScroll;
  1867. _this2.togglePagination();
  1868. });
  1869. }, 0);
  1870. });
  1871. this.options.virtualScroll = false;
  1872. this.togglePagination();
  1873. this.trigger('export-saved', this.getData());
  1874. } else if (o.exportDataType === 'selected') {
  1875. var data = this.getData();
  1876. var selectedData = this.getSelections();
  1877. var pagination = o.pagination;
  1878. if (!selectedData.length) {
  1879. return;
  1880. }
  1881. if (o.sidePagination === 'server') {
  1882. data = _defineProperty({
  1883. total: o.totalRows
  1884. }, this.options.dataField, data);
  1885. selectedData = _defineProperty({
  1886. total: selectedData.length
  1887. }, this.options.dataField, selectedData);
  1888. }
  1889. this.load(selectedData);
  1890. if (pagination) {
  1891. this.togglePagination();
  1892. }
  1893. doExport(function () {
  1894. if (pagination) {
  1895. _this2.togglePagination();
  1896. }
  1897. _this2.load(data);
  1898. });
  1899. this.trigger('export-saved', selectedData);
  1900. } else {
  1901. doExport();
  1902. this.trigger('export-saved', this.getData(true));
  1903. }
  1904. }
  1905. }, {
  1906. key: "updateSelected",
  1907. value: function updateSelected() {
  1908. _get(_getPrototypeOf(_class.prototype), "updateSelected", this).call(this);
  1909. this.updateExportButton();
  1910. }
  1911. }, {
  1912. key: "updateExportButton",
  1913. value: function updateExportButton() {
  1914. if (this.options.exportDataType === 'selected') {
  1915. this.$export.find('> button').prop('disabled', !this.getSelections().length);
  1916. }
  1917. }
  1918. }]);
  1919. return _class;
  1920. }($__default['default'].BootstrapTable);
  1921. })));