bootstrap-table-addrbar.js 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['jquery'], factory) :
  4. (global = global || self, factory(global.jQuery));
  5. }(this, function ($) { 'use strict';
  6. $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
  7. var toString = {}.toString;
  8. var classofRaw = function (it) {
  9. return toString.call(it).slice(8, -1);
  10. };
  11. // `IsArray` abstract operation
  12. // https://tc39.github.io/ecma262/#sec-isarray
  13. var isArray = Array.isArray || function isArray(arg) {
  14. return classofRaw(arg) == 'Array';
  15. };
  16. var isObject = function (it) {
  17. return typeof it === 'object' ? it !== null : typeof it === 'function';
  18. };
  19. // `RequireObjectCoercible` abstract operation
  20. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  21. var requireObjectCoercible = function (it) {
  22. if (it == undefined) throw TypeError("Can't call method on " + it);
  23. return it;
  24. };
  25. // `ToObject` abstract operation
  26. // https://tc39.github.io/ecma262/#sec-toobject
  27. var toObject = function (argument) {
  28. return Object(requireObjectCoercible(argument));
  29. };
  30. var ceil = Math.ceil;
  31. var floor = Math.floor;
  32. // `ToInteger` abstract operation
  33. // https://tc39.github.io/ecma262/#sec-tointeger
  34. var toInteger = function (argument) {
  35. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  36. };
  37. var min = Math.min;
  38. // `ToLength` abstract operation
  39. // https://tc39.github.io/ecma262/#sec-tolength
  40. var toLength = function (argument) {
  41. return argument > 0 ? min(toInteger(argument), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  42. };
  43. // 7.1.1 ToPrimitive(input [, PreferredType])
  44. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  45. // and the second argument - flag - preferred type is a string
  46. var toPrimitive = function (it, S) {
  47. if (!isObject(it)) return it;
  48. var fn, val;
  49. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  50. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  51. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  52. throw TypeError("Can't convert object to primitive value");
  53. };
  54. var fails = function (exec) {
  55. try {
  56. return !!exec();
  57. } catch (e) {
  58. return true;
  59. }
  60. };
  61. // Thank's IE8 for his funny defineProperty
  62. var descriptors = !fails(function () {
  63. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  64. });
  65. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  66. var global = typeof window == 'object' && window && window.Math == Math ? window
  67. : typeof self == 'object' && self && self.Math == Math ? self
  68. // eslint-disable-next-line no-new-func
  69. : Function('return this')();
  70. var document = global.document;
  71. // typeof document.createElement is 'object' in old IE
  72. var exist = isObject(document) && isObject(document.createElement);
  73. var documentCreateElement = function (it) {
  74. return exist ? document.createElement(it) : {};
  75. };
  76. // Thank's IE8 for his funny defineProperty
  77. var ie8DomDefine = !descriptors && !fails(function () {
  78. return Object.defineProperty(documentCreateElement('div'), 'a', {
  79. get: function () { return 7; }
  80. }).a != 7;
  81. });
  82. var anObject = function (it) {
  83. if (!isObject(it)) {
  84. throw TypeError(String(it) + ' is not an object');
  85. } return it;
  86. };
  87. var nativeDefineProperty = Object.defineProperty;
  88. var f = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  89. anObject(O);
  90. P = toPrimitive(P, true);
  91. anObject(Attributes);
  92. if (ie8DomDefine) try {
  93. return nativeDefineProperty(O, P, Attributes);
  94. } catch (e) { /* empty */ }
  95. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  96. if ('value' in Attributes) O[P] = Attributes.value;
  97. return O;
  98. };
  99. var objectDefineProperty = {
  100. f: f
  101. };
  102. var createPropertyDescriptor = function (bitmap, value) {
  103. return {
  104. enumerable: !(bitmap & 1),
  105. configurable: !(bitmap & 2),
  106. writable: !(bitmap & 4),
  107. value: value
  108. };
  109. };
  110. var createProperty = function (object, key, value) {
  111. var propertyKey = toPrimitive(key);
  112. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  113. else object[propertyKey] = value;
  114. };
  115. function createCommonjsModule(fn, module) {
  116. return module = { exports: {} }, fn(module, module.exports), module.exports;
  117. }
  118. var hide = descriptors ? function (object, key, value) {
  119. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  120. } : function (object, key, value) {
  121. object[key] = value;
  122. return object;
  123. };
  124. var setGlobal = function (key, value) {
  125. try {
  126. hide(global, key, value);
  127. } catch (e) {
  128. global[key] = value;
  129. } return value;
  130. };
  131. var shared = createCommonjsModule(function (module) {
  132. var SHARED = '__core-js_shared__';
  133. var store = global[SHARED] || setGlobal(SHARED, {});
  134. (module.exports = function (key, value) {
  135. return store[key] || (store[key] = value !== undefined ? value : {});
  136. })('versions', []).push({
  137. version: '3.0.0',
  138. mode: 'global',
  139. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  140. });
  141. });
  142. var id = 0;
  143. var postfix = Math.random();
  144. var uid = function (key) {
  145. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + postfix).toString(36));
  146. };
  147. // Chrome 38 Symbol has incorrect toString conversion
  148. var nativeSymbol = !fails(function () {
  149. });
  150. var store = shared('wks');
  151. var Symbol$1 = global.Symbol;
  152. var wellKnownSymbol = function (name) {
  153. return store[name] || (store[name] = nativeSymbol && Symbol$1[name]
  154. || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
  155. };
  156. var SPECIES = wellKnownSymbol('species');
  157. // `ArraySpeciesCreate` abstract operation
  158. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  159. var arraySpeciesCreate = function (originalArray, length) {
  160. var C;
  161. if (isArray(originalArray)) {
  162. C = originalArray.constructor;
  163. // cross-realm fallback
  164. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  165. else if (isObject(C)) {
  166. C = C[SPECIES];
  167. if (C === null) C = undefined;
  168. }
  169. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  170. };
  171. var SPECIES$1 = wellKnownSymbol('species');
  172. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  173. return !fails(function () {
  174. var array = [];
  175. var constructor = array.constructor = {};
  176. constructor[SPECIES$1] = function () {
  177. return { foo: 1 };
  178. };
  179. return array[METHOD_NAME](Boolean).foo !== 1;
  180. });
  181. };
  182. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  183. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  184. // Nashorn ~ JDK8 bug
  185. var NASHORN_BUG = nativeGetOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  186. var f$1 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  187. var descriptor = nativeGetOwnPropertyDescriptor(this, V);
  188. return !!descriptor && descriptor.enumerable;
  189. } : nativePropertyIsEnumerable;
  190. var objectPropertyIsEnumerable = {
  191. f: f$1
  192. };
  193. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  194. var split = ''.split;
  195. var indexedObject = fails(function () {
  196. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  197. // eslint-disable-next-line no-prototype-builtins
  198. return !Object('z').propertyIsEnumerable(0);
  199. }) ? function (it) {
  200. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  201. } : Object;
  202. // toObject with fallback for non-array-like ES3 strings
  203. var toIndexedObject = function (it) {
  204. return indexedObject(requireObjectCoercible(it));
  205. };
  206. var hasOwnProperty = {}.hasOwnProperty;
  207. var has = function (it, key) {
  208. return hasOwnProperty.call(it, key);
  209. };
  210. var nativeGetOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  211. var f$2 = descriptors ? nativeGetOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  212. O = toIndexedObject(O);
  213. P = toPrimitive(P, true);
  214. if (ie8DomDefine) try {
  215. return nativeGetOwnPropertyDescriptor$1(O, P);
  216. } catch (e) { /* empty */ }
  217. if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  218. };
  219. var objectGetOwnPropertyDescriptor = {
  220. f: f$2
  221. };
  222. var functionToString = shared('native-function-to-string', Function.toString);
  223. var WeakMap = global.WeakMap;
  224. var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap));
  225. var shared$1 = shared('keys');
  226. var sharedKey = function (key) {
  227. return shared$1[key] || (shared$1[key] = uid(key));
  228. };
  229. var hiddenKeys = {};
  230. var WeakMap$1 = global.WeakMap;
  231. var set, get, has$1;
  232. var enforce = function (it) {
  233. return has$1(it) ? get(it) : set(it, {});
  234. };
  235. var getterFor = function (TYPE) {
  236. return function (it) {
  237. var state;
  238. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  239. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  240. } return state;
  241. };
  242. };
  243. if (nativeWeakMap) {
  244. var store$1 = new WeakMap$1();
  245. var wmget = store$1.get;
  246. var wmhas = store$1.has;
  247. var wmset = store$1.set;
  248. set = function (it, metadata) {
  249. wmset.call(store$1, it, metadata);
  250. return metadata;
  251. };
  252. get = function (it) {
  253. return wmget.call(store$1, it) || {};
  254. };
  255. has$1 = function (it) {
  256. return wmhas.call(store$1, it);
  257. };
  258. } else {
  259. var STATE = sharedKey('state');
  260. hiddenKeys[STATE] = true;
  261. set = function (it, metadata) {
  262. hide(it, STATE, metadata);
  263. return metadata;
  264. };
  265. get = function (it) {
  266. return has(it, STATE) ? it[STATE] : {};
  267. };
  268. has$1 = function (it) {
  269. return has(it, STATE);
  270. };
  271. }
  272. var internalState = {
  273. set: set,
  274. get: get,
  275. has: has$1,
  276. enforce: enforce,
  277. getterFor: getterFor
  278. };
  279. var redefine = createCommonjsModule(function (module) {
  280. var getInternalState = internalState.get;
  281. var enforceInternalState = internalState.enforce;
  282. var TEMPLATE = String(functionToString).split('toString');
  283. shared('inspectSource', function (it) {
  284. return functionToString.call(it);
  285. });
  286. (module.exports = function (O, key, value, options) {
  287. var unsafe = options ? !!options.unsafe : false;
  288. var simple = options ? !!options.enumerable : false;
  289. var noTargetGet = options ? !!options.noTargetGet : false;
  290. if (typeof value == 'function') {
  291. if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key);
  292. enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
  293. }
  294. if (O === global) {
  295. if (simple) O[key] = value;
  296. else setGlobal(key, value);
  297. return;
  298. } else if (!unsafe) {
  299. delete O[key];
  300. } else if (!noTargetGet && O[key]) {
  301. simple = true;
  302. }
  303. if (simple) O[key] = value;
  304. else hide(O, key, value);
  305. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  306. })(Function.prototype, 'toString', function toString() {
  307. return typeof this == 'function' && getInternalState(this).source || functionToString.call(this);
  308. });
  309. });
  310. var max = Math.max;
  311. var min$1 = Math.min;
  312. // Helper for a popular repeating case of the spec:
  313. // Let integer be ? ToInteger(index).
  314. // If integer < 0, let result be max((length + integer), 0); else let result be min(length, length).
  315. var toAbsoluteIndex = function (index, length) {
  316. var integer = toInteger(index);
  317. return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
  318. };
  319. // `Array.prototype.{ indexOf, includes }` methods implementation
  320. // false -> Array#indexOf
  321. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  322. // true -> Array#includes
  323. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  324. var arrayIncludes = function (IS_INCLUDES) {
  325. return function ($this, el, fromIndex) {
  326. var O = toIndexedObject($this);
  327. var length = toLength(O.length);
  328. var index = toAbsoluteIndex(fromIndex, length);
  329. var value;
  330. // Array#includes uses SameValueZero equality algorithm
  331. // eslint-disable-next-line no-self-compare
  332. if (IS_INCLUDES && el != el) while (length > index) {
  333. value = O[index++];
  334. // eslint-disable-next-line no-self-compare
  335. if (value != value) return true;
  336. // Array#indexOf ignores holes, Array#includes - not
  337. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  338. if (O[index] === el) return IS_INCLUDES || index || 0;
  339. } return !IS_INCLUDES && -1;
  340. };
  341. };
  342. var arrayIndexOf = arrayIncludes(false);
  343. var objectKeysInternal = function (object, names) {
  344. var O = toIndexedObject(object);
  345. var i = 0;
  346. var result = [];
  347. var key;
  348. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  349. // Don't enum bug & hidden keys
  350. while (names.length > i) if (has(O, key = names[i++])) {
  351. ~arrayIndexOf(result, key) || result.push(key);
  352. }
  353. return result;
  354. };
  355. // IE8- don't enum bug keys
  356. var enumBugKeys = [
  357. 'constructor',
  358. 'hasOwnProperty',
  359. 'isPrototypeOf',
  360. 'propertyIsEnumerable',
  361. 'toLocaleString',
  362. 'toString',
  363. 'valueOf'
  364. ];
  365. // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
  366. var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
  367. var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  368. return objectKeysInternal(O, hiddenKeys$1);
  369. };
  370. var objectGetOwnPropertyNames = {
  371. f: f$3
  372. };
  373. var f$4 = Object.getOwnPropertySymbols;
  374. var objectGetOwnPropertySymbols = {
  375. f: f$4
  376. };
  377. var Reflect$1 = global.Reflect;
  378. // all object keys, includes non-enumerable and symbols
  379. var ownKeys = Reflect$1 && Reflect$1.ownKeys || function ownKeys(it) {
  380. var keys = objectGetOwnPropertyNames.f(anObject(it));
  381. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  382. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  383. };
  384. var copyConstructorProperties = function (target, source) {
  385. var keys = ownKeys(source);
  386. var defineProperty = objectDefineProperty.f;
  387. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  388. for (var i = 0; i < keys.length; i++) {
  389. var key = keys[i];
  390. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  391. }
  392. };
  393. var replacement = /#|\.prototype\./;
  394. var isForced = function (feature, detection) {
  395. var value = data[normalize(feature)];
  396. return value == POLYFILL ? true
  397. : value == NATIVE ? false
  398. : typeof detection == 'function' ? fails(detection)
  399. : !!detection;
  400. };
  401. var normalize = isForced.normalize = function (string) {
  402. return String(string).replace(replacement, '.').toLowerCase();
  403. };
  404. var data = isForced.data = {};
  405. var NATIVE = isForced.NATIVE = 'N';
  406. var POLYFILL = isForced.POLYFILL = 'P';
  407. var isForced_1 = isForced;
  408. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  409. /*
  410. options.target - name of the target object
  411. options.global - target is the global object
  412. options.stat - export as static methods of target
  413. options.proto - export as prototype methods of target
  414. options.real - real prototype method for the `pure` version
  415. options.forced - export even if the native feature is available
  416. options.bind - bind methods to the target, required for the `pure` version
  417. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  418. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  419. options.sham - add a flag to not completely full polyfills
  420. options.enumerable - export as enumerable property
  421. options.noTargetGet - prevent calling a getter on target
  422. */
  423. var _export = function (options, source) {
  424. var TARGET = options.target;
  425. var GLOBAL = options.global;
  426. var STATIC = options.stat;
  427. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  428. if (GLOBAL) {
  429. target = global;
  430. } else if (STATIC) {
  431. target = global[TARGET] || setGlobal(TARGET, {});
  432. } else {
  433. target = (global[TARGET] || {}).prototype;
  434. }
  435. if (target) for (key in source) {
  436. sourceProperty = source[key];
  437. if (options.noTargetGet) {
  438. descriptor = getOwnPropertyDescriptor(target, key);
  439. targetProperty = descriptor && descriptor.value;
  440. } else targetProperty = target[key];
  441. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  442. // contained in target
  443. if (!FORCED && targetProperty !== undefined) {
  444. if (typeof sourceProperty === typeof targetProperty) continue;
  445. copyConstructorProperties(sourceProperty, targetProperty);
  446. }
  447. // add a flag to not completely full polyfills
  448. if (options.sham || (targetProperty && targetProperty.sham)) {
  449. hide(sourceProperty, 'sham', true);
  450. }
  451. // extend global
  452. redefine(target, key, sourceProperty, options);
  453. }
  454. };
  455. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  456. var MAX_SAFE_INTEGER = 0x1fffffffffffff;
  457. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  458. var IS_CONCAT_SPREADABLE_SUPPORT = !fails(function () {
  459. var array = [];
  460. array[IS_CONCAT_SPREADABLE] = false;
  461. return array.concat()[0] !== array;
  462. });
  463. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  464. var isConcatSpreadable = function (O) {
  465. if (!isObject(O)) return false;
  466. var spreadable = O[IS_CONCAT_SPREADABLE];
  467. return spreadable !== undefined ? !!spreadable : isArray(O);
  468. };
  469. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  470. // `Array.prototype.concat` method
  471. // https://tc39.github.io/ecma262/#sec-array.prototype.concat
  472. // with adding support of @@isConcatSpreadable and @@species
  473. _export({ target: 'Array', proto: true, forced: FORCED }, {
  474. concat: function concat(arg) { // eslint-disable-line no-unused-vars
  475. var O = toObject(this);
  476. var A = arraySpeciesCreate(O, 0);
  477. var n = 0;
  478. var i, k, length, len, E;
  479. for (i = -1, length = arguments.length; i < length; i++) {
  480. E = i === -1 ? O : arguments[i];
  481. if (isConcatSpreadable(E)) {
  482. len = toLength(E.length);
  483. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  484. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  485. } else {
  486. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  487. createProperty(A, n++, E);
  488. }
  489. }
  490. A.length = n;
  491. return A;
  492. }
  493. });
  494. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  495. var objectKeys = Object.keys || function keys(O) {
  496. return objectKeysInternal(O, enumBugKeys);
  497. };
  498. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  499. // TO_ENTRIES: true -> Object.entries
  500. // TO_ENTRIES: false -> Object.values
  501. var objectToArray = function (it, TO_ENTRIES) {
  502. var O = toIndexedObject(it);
  503. var keys = objectKeys(O);
  504. var length = keys.length;
  505. var i = 0;
  506. var result = [];
  507. var key;
  508. while (length > i) if (propertyIsEnumerable.call(O, key = keys[i++])) {
  509. result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
  510. } return result;
  511. };
  512. // `Object.entries` method
  513. // https://tc39.github.io/ecma262/#sec-object.entries
  514. _export({ target: 'Object', stat: true }, {
  515. entries: function entries(O) {
  516. return objectToArray(O, true);
  517. }
  518. });
  519. var validateSetPrototypeOfArguments = function (O, proto) {
  520. anObject(O);
  521. if (!isObject(proto) && proto !== null) {
  522. throw TypeError("Can't set " + String(proto) + ' as a prototype');
  523. }
  524. };
  525. // Works with __proto__ only. Old v8 can't work with null proto objects.
  526. /* eslint-disable no-proto */
  527. var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () { // eslint-disable-line
  528. var correctSetter = false;
  529. var test = {};
  530. var setter;
  531. try {
  532. setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
  533. setter.call(test, []);
  534. correctSetter = test instanceof Array;
  535. } catch (e) { /* empty */ }
  536. return function setPrototypeOf(O, proto) {
  537. validateSetPrototypeOfArguments(O, proto);
  538. if (correctSetter) setter.call(O, proto);
  539. else O.__proto__ = proto;
  540. return O;
  541. };
  542. }() : undefined);
  543. var inheritIfRequired = function (that, target, C) {
  544. var S = target.constructor;
  545. var P;
  546. if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && objectSetPrototypeOf) {
  547. objectSetPrototypeOf(that, P);
  548. } return that;
  549. };
  550. var MATCH = wellKnownSymbol('match');
  551. // `IsRegExp` abstract operation
  552. // https://tc39.github.io/ecma262/#sec-isregexp
  553. var isRegexp = function (it) {
  554. var isRegExp;
  555. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  556. };
  557. // `RegExp.prototype.flags` getter implementation
  558. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  559. var regexpFlags = function () {
  560. var that = anObject(this);
  561. var result = '';
  562. if (that.global) result += 'g';
  563. if (that.ignoreCase) result += 'i';
  564. if (that.multiline) result += 'm';
  565. if (that.unicode) result += 'u';
  566. if (that.sticky) result += 'y';
  567. return result;
  568. };
  569. var path = global;
  570. var aFunction = function (variable) {
  571. return typeof variable == 'function' ? variable : undefined;
  572. };
  573. var getBuiltIn = function (namespace, method) {
  574. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
  575. : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
  576. };
  577. var SPECIES$2 = wellKnownSymbol('species');
  578. var setSpecies = function (CONSTRUCTOR_NAME) {
  579. var C = getBuiltIn(CONSTRUCTOR_NAME);
  580. var defineProperty = objectDefineProperty.f;
  581. if (descriptors && C && !C[SPECIES$2]) defineProperty(C, SPECIES$2, {
  582. configurable: true,
  583. get: function () { return this; }
  584. });
  585. };
  586. var MATCH$1 = wellKnownSymbol('match');
  587. var defineProperty = objectDefineProperty.f;
  588. var getOwnPropertyNames = objectGetOwnPropertyNames.f;
  589. var NativeRegExp = global.RegExp;
  590. var RegExpPrototype = NativeRegExp.prototype;
  591. var re1 = /a/g;
  592. var re2 = /a/g;
  593. // "new" should create a new object, old webkit bug
  594. var CORRECT_NEW = new NativeRegExp(re1) !== re1;
  595. var FORCED$1 = isForced_1('RegExp', descriptors && (!CORRECT_NEW || fails(function () {
  596. re2[MATCH$1] = false;
  597. // RegExp constructor can alter flags and IsRegExp works correct with @@match
  598. return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
  599. })));
  600. // `RegExp` constructor
  601. // https://tc39.github.io/ecma262/#sec-regexp-constructor
  602. if (FORCED$1) {
  603. var RegExpWrapper = function RegExp(pattern, flags) {
  604. var thisIsRegExp = this instanceof RegExpWrapper;
  605. var patternIsRegExp = isRegexp(pattern);
  606. var flagsAreUndefined = flags === undefined;
  607. return !thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined ? pattern
  608. : inheritIfRequired(CORRECT_NEW
  609. ? new NativeRegExp(patternIsRegExp && !flagsAreUndefined ? pattern.source : pattern, flags)
  610. : NativeRegExp((patternIsRegExp = pattern instanceof RegExpWrapper)
  611. ? pattern.source
  612. : pattern, patternIsRegExp && flagsAreUndefined ? regexpFlags.call(pattern) : flags)
  613. , thisIsRegExp ? this : RegExpPrototype, RegExpWrapper);
  614. };
  615. var proxy = function (key) {
  616. key in RegExpWrapper || defineProperty(RegExpWrapper, key, {
  617. configurable: true,
  618. get: function () { return NativeRegExp[key]; },
  619. set: function (it) { NativeRegExp[key] = it; }
  620. });
  621. };
  622. var keys = getOwnPropertyNames(NativeRegExp);
  623. var i = 0;
  624. while (i < keys.length) proxy(keys[i++]);
  625. RegExpPrototype.constructor = RegExpWrapper;
  626. RegExpWrapper.prototype = RegExpPrototype;
  627. redefine(global, 'RegExp', RegExpWrapper);
  628. }
  629. // https://tc39.github.io/ecma262/#sec-get-regexp-@@species
  630. setSpecies('RegExp');
  631. var TO_STRING = 'toString';
  632. var nativeToString = /./[TO_STRING];
  633. var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  634. // FF44- RegExp#toString has a wrong name
  635. var INCORRECT_NAME = nativeToString.name != TO_STRING;
  636. // `RegExp.prototype.toString` method
  637. // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
  638. if (NOT_GENERIC || INCORRECT_NAME) {
  639. redefine(RegExp.prototype, TO_STRING, function toString() {
  640. var R = anObject(this);
  641. return '/'.concat(R.source, '/',
  642. 'flags' in R ? R.flags : !descriptors && R instanceof RegExp ? regexpFlags.call(R) : undefined);
  643. }, { unsafe: true });
  644. }
  645. // CONVERT_TO_STRING: true -> String#at
  646. // CONVERT_TO_STRING: false -> String#codePointAt
  647. var stringAt = function (that, pos, CONVERT_TO_STRING) {
  648. var S = String(requireObjectCoercible(that));
  649. var position = toInteger(pos);
  650. var size = S.length;
  651. var first, second;
  652. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  653. first = S.charCodeAt(position);
  654. return first < 0xd800 || first > 0xdbff || position + 1 === size
  655. || (second = S.charCodeAt(position + 1)) < 0xdc00 || second > 0xdfff
  656. ? CONVERT_TO_STRING ? S.charAt(position) : first
  657. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xd800 << 10) + (second - 0xdc00) + 0x10000;
  658. };
  659. // `AdvanceStringIndex` abstract operation
  660. // https://tc39.github.io/ecma262/#sec-advancestringindex
  661. var advanceStringIndex = function (S, index, unicode) {
  662. return index + (unicode ? stringAt(S, index, true).length : 1);
  663. };
  664. var nativeExec = RegExp.prototype.exec;
  665. // This always refers to the native implementation, because the
  666. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  667. // which loads this file before patching the method.
  668. var nativeReplace = String.prototype.replace;
  669. var patchedExec = nativeExec;
  670. var UPDATES_LAST_INDEX_WRONG = (function () {
  671. var re1 = /a/;
  672. var re2 = /b*/g;
  673. nativeExec.call(re1, 'a');
  674. nativeExec.call(re2, 'a');
  675. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  676. })();
  677. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  678. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  679. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
  680. if (PATCH) {
  681. patchedExec = function exec(str) {
  682. var re = this;
  683. var lastIndex, reCopy, match, i;
  684. if (NPCG_INCLUDED) {
  685. reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
  686. }
  687. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  688. match = nativeExec.call(re, str);
  689. if (UPDATES_LAST_INDEX_WRONG && match) {
  690. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  691. }
  692. if (NPCG_INCLUDED && match && match.length > 1) {
  693. // Fix browsers whose `exec` methods don't consistently return `undefined`
  694. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  695. nativeReplace.call(match[0], reCopy, function () {
  696. for (i = 1; i < arguments.length - 2; i++) {
  697. if (arguments[i] === undefined) match[i] = undefined;
  698. }
  699. });
  700. }
  701. return match;
  702. };
  703. }
  704. var regexpExec = patchedExec;
  705. // `RegExpExec` abstract operation
  706. // https://tc39.github.io/ecma262/#sec-regexpexec
  707. var regexpExecAbstract = function (R, S) {
  708. var exec = R.exec;
  709. if (typeof exec === 'function') {
  710. var result = exec.call(R, S);
  711. if (typeof result !== 'object') {
  712. throw TypeError('RegExp exec method returned something other than an Object or null');
  713. }
  714. return result;
  715. }
  716. if (classofRaw(R) !== 'RegExp') {
  717. throw TypeError('RegExp#exec called on incompatible receiver');
  718. }
  719. return regexpExec.call(R, S);
  720. };
  721. var SPECIES$3 = wellKnownSymbol('species');
  722. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  723. // #replace needs built-in support for named groups.
  724. // #match works fine because it just return the exec results, even if it has
  725. // a "grops" property.
  726. var re = /./;
  727. re.exec = function () {
  728. var result = [];
  729. result.groups = { a: '7' };
  730. return result;
  731. };
  732. return ''.replace(re, '$<a>') !== '7';
  733. });
  734. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  735. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  736. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  737. var re = /(?:)/;
  738. var originalExec = re.exec;
  739. re.exec = function () { return originalExec.apply(this, arguments); };
  740. var result = 'ab'.split(re);
  741. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  742. });
  743. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  744. var SYMBOL = wellKnownSymbol(KEY);
  745. var DELEGATES_TO_SYMBOL = !fails(function () {
  746. // String methods call symbol-named RegEp methods
  747. var O = {};
  748. O[SYMBOL] = function () { return 7; };
  749. return ''[KEY](O) != 7;
  750. });
  751. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  752. // Symbol-named RegExp methods call .exec
  753. var execCalled = false;
  754. var re = /a/;
  755. re.exec = function () { execCalled = true; return null; };
  756. if (KEY === 'split') {
  757. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  758. // a new one. We need to return the patched regex when creating the new one.
  759. re.constructor = {};
  760. re.constructor[SPECIES$3] = function () { return re; };
  761. }
  762. re[SYMBOL]('');
  763. return !execCalled;
  764. });
  765. if (
  766. !DELEGATES_TO_SYMBOL ||
  767. !DELEGATES_TO_EXEC ||
  768. (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
  769. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  770. ) {
  771. var nativeRegExpMethod = /./[SYMBOL];
  772. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  773. if (regexp.exec === regexpExec) {
  774. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  775. // The native String method already delegates to @@method (this
  776. // polyfilled function), leasing to infinite recursion.
  777. // We avoid it by directly calling the native @@method method.
  778. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  779. }
  780. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  781. }
  782. return { done: false };
  783. });
  784. var stringMethod = methods[0];
  785. var regexMethod = methods[1];
  786. redefine(String.prototype, KEY, stringMethod);
  787. redefine(RegExp.prototype, SYMBOL, length == 2
  788. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  789. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  790. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  791. // 21.2.5.6 RegExp.prototype[@@match](string)
  792. // 21.2.5.9 RegExp.prototype[@@search](string)
  793. : function (string) { return regexMethod.call(string, this); }
  794. );
  795. if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
  796. }
  797. };
  798. // @@match logic
  799. fixRegexpWellKnownSymbolLogic(
  800. 'match',
  801. 1,
  802. function (MATCH, nativeMatch, maybeCallNative) {
  803. return [
  804. // `String.prototype.match` method
  805. // https://tc39.github.io/ecma262/#sec-string.prototype.match
  806. function match(regexp) {
  807. var O = requireObjectCoercible(this);
  808. var matcher = regexp == undefined ? undefined : regexp[MATCH];
  809. return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
  810. },
  811. // `RegExp.prototype[@@match]` method
  812. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
  813. function (regexp) {
  814. var res = maybeCallNative(nativeMatch, regexp, this);
  815. if (res.done) return res.value;
  816. var rx = anObject(regexp);
  817. var S = String(this);
  818. if (!rx.global) return regexpExecAbstract(rx, S);
  819. var fullUnicode = rx.unicode;
  820. rx.lastIndex = 0;
  821. var A = [];
  822. var n = 0;
  823. var result;
  824. while ((result = regexpExecAbstract(rx, S)) !== null) {
  825. var matchStr = String(result[0]);
  826. A[n] = matchStr;
  827. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  828. n++;
  829. }
  830. return n === 0 ? null : A;
  831. }
  832. ];
  833. }
  834. );
  835. var max$1 = Math.max;
  836. var min$2 = Math.min;
  837. var floor$1 = Math.floor;
  838. var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
  839. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
  840. var maybeToString = function (it) {
  841. return it === undefined ? it : String(it);
  842. };
  843. // @@replace logic
  844. fixRegexpWellKnownSymbolLogic(
  845. 'replace',
  846. 2,
  847. function (REPLACE, nativeReplace, maybeCallNative) {
  848. return [
  849. // `String.prototype.replace` method
  850. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  851. function replace(searchValue, replaceValue) {
  852. var O = requireObjectCoercible(this);
  853. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  854. return replacer !== undefined
  855. ? replacer.call(searchValue, O, replaceValue)
  856. : nativeReplace.call(String(O), searchValue, replaceValue);
  857. },
  858. // `RegExp.prototype[@@replace]` method
  859. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  860. function (regexp, replaceValue) {
  861. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  862. if (res.done) return res.value;
  863. var rx = anObject(regexp);
  864. var S = String(this);
  865. var functionalReplace = typeof replaceValue === 'function';
  866. if (!functionalReplace) replaceValue = String(replaceValue);
  867. var global = rx.global;
  868. if (global) {
  869. var fullUnicode = rx.unicode;
  870. rx.lastIndex = 0;
  871. }
  872. var results = [];
  873. while (true) {
  874. var result = regexpExecAbstract(rx, S);
  875. if (result === null) break;
  876. results.push(result);
  877. if (!global) break;
  878. var matchStr = String(result[0]);
  879. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  880. }
  881. var accumulatedResult = '';
  882. var nextSourcePosition = 0;
  883. for (var i = 0; i < results.length; i++) {
  884. result = results[i];
  885. var matched = String(result[0]);
  886. var position = max$1(min$2(toInteger(result.index), S.length), 0);
  887. var captures = [];
  888. // NOTE: This is equivalent to
  889. // captures = result.slice(1).map(maybeToString)
  890. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  891. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  892. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  893. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  894. var namedCaptures = result.groups;
  895. if (functionalReplace) {
  896. var replacerArgs = [matched].concat(captures, position, S);
  897. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  898. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  899. } else {
  900. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  901. }
  902. if (position >= nextSourcePosition) {
  903. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  904. nextSourcePosition = position + matched.length;
  905. }
  906. }
  907. return accumulatedResult + S.slice(nextSourcePosition);
  908. }
  909. ];
  910. // https://tc39.github.io/ecma262/#sec-getsubstitution
  911. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  912. var tailPos = position + matched.length;
  913. var m = captures.length;
  914. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  915. if (namedCaptures !== undefined) {
  916. namedCaptures = toObject(namedCaptures);
  917. symbols = SUBSTITUTION_SYMBOLS;
  918. }
  919. return nativeReplace.call(replacement, symbols, function (match, ch) {
  920. var capture;
  921. switch (ch.charAt(0)) {
  922. case '$': return '$';
  923. case '&': return matched;
  924. case '`': return str.slice(0, position);
  925. case "'": return str.slice(tailPos);
  926. case '<':
  927. capture = namedCaptures[ch.slice(1, -1)];
  928. break;
  929. default: // \d\d?
  930. var n = +ch;
  931. if (n === 0) return match;
  932. if (n > m) {
  933. var f = floor$1(n / 10);
  934. if (f === 0) return match;
  935. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  936. return match;
  937. }
  938. capture = captures[n - 1];
  939. }
  940. return capture === undefined ? '' : capture;
  941. });
  942. }
  943. }
  944. );
  945. // `SameValue` abstract operation
  946. // https://tc39.github.io/ecma262/#sec-samevalue
  947. var sameValue = Object.is || function is(x, y) {
  948. // eslint-disable-next-line no-self-compare
  949. return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  950. };
  951. // @@search logic
  952. fixRegexpWellKnownSymbolLogic(
  953. 'search',
  954. 1,
  955. function (SEARCH, nativeSearch, maybeCallNative) {
  956. return [
  957. // `String.prototype.search` method
  958. // https://tc39.github.io/ecma262/#sec-string.prototype.search
  959. function search(regexp) {
  960. var O = requireObjectCoercible(this);
  961. var searcher = regexp == undefined ? undefined : regexp[SEARCH];
  962. return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
  963. },
  964. // `RegExp.prototype[@@search]` method
  965. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
  966. function (regexp) {
  967. var res = maybeCallNative(nativeSearch, regexp, this);
  968. if (res.done) return res.value;
  969. var rx = anObject(regexp);
  970. var S = String(this);
  971. var previousLastIndex = rx.lastIndex;
  972. if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
  973. var result = regexpExecAbstract(rx, S);
  974. if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
  975. return result === null ? -1 : result.index;
  976. }
  977. ];
  978. }
  979. );
  980. function _classCallCheck(instance, Constructor) {
  981. if (!(instance instanceof Constructor)) {
  982. throw new TypeError("Cannot call a class as a function");
  983. }
  984. }
  985. function _defineProperties(target, props) {
  986. for (var i = 0; i < props.length; i++) {
  987. var descriptor = props[i];
  988. descriptor.enumerable = descriptor.enumerable || false;
  989. descriptor.configurable = true;
  990. if ("value" in descriptor) descriptor.writable = true;
  991. Object.defineProperty(target, descriptor.key, descriptor);
  992. }
  993. }
  994. function _createClass(Constructor, protoProps, staticProps) {
  995. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  996. if (staticProps) _defineProperties(Constructor, staticProps);
  997. return Constructor;
  998. }
  999. function _inherits(subClass, superClass) {
  1000. if (typeof superClass !== "function" && superClass !== null) {
  1001. throw new TypeError("Super expression must either be null or a function");
  1002. }
  1003. subClass.prototype = Object.create(superClass && superClass.prototype, {
  1004. constructor: {
  1005. value: subClass,
  1006. writable: true,
  1007. configurable: true
  1008. }
  1009. });
  1010. if (superClass) _setPrototypeOf(subClass, superClass);
  1011. }
  1012. function _getPrototypeOf(o) {
  1013. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  1014. return o.__proto__ || Object.getPrototypeOf(o);
  1015. };
  1016. return _getPrototypeOf(o);
  1017. }
  1018. function _setPrototypeOf(o, p) {
  1019. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  1020. o.__proto__ = p;
  1021. return o;
  1022. };
  1023. return _setPrototypeOf(o, p);
  1024. }
  1025. function _assertThisInitialized(self) {
  1026. if (self === void 0) {
  1027. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1028. }
  1029. return self;
  1030. }
  1031. function _possibleConstructorReturn(self, call) {
  1032. if (call && (typeof call === "object" || typeof call === "function")) {
  1033. return call;
  1034. }
  1035. return _assertThisInitialized(self);
  1036. }
  1037. function _superPropBase(object, property) {
  1038. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  1039. object = _getPrototypeOf(object);
  1040. if (object === null) break;
  1041. }
  1042. return object;
  1043. }
  1044. function _get(target, property, receiver) {
  1045. if (typeof Reflect !== "undefined" && Reflect.get) {
  1046. _get = Reflect.get;
  1047. } else {
  1048. _get = function _get(target, property, receiver) {
  1049. var base = _superPropBase(target, property);
  1050. if (!base) return;
  1051. var desc = Object.getOwnPropertyDescriptor(base, property);
  1052. if (desc.get) {
  1053. return desc.get.call(receiver);
  1054. }
  1055. return desc.value;
  1056. };
  1057. }
  1058. return _get(target, property, receiver || target);
  1059. }
  1060. function _slicedToArray(arr, i) {
  1061. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
  1062. }
  1063. function _arrayWithHoles(arr) {
  1064. if (Array.isArray(arr)) return arr;
  1065. }
  1066. function _iterableToArrayLimit(arr, i) {
  1067. var _arr = [];
  1068. var _n = true;
  1069. var _d = false;
  1070. var _e = undefined;
  1071. try {
  1072. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  1073. _arr.push(_s.value);
  1074. if (i && _arr.length === i) break;
  1075. }
  1076. } catch (err) {
  1077. _d = true;
  1078. _e = err;
  1079. } finally {
  1080. try {
  1081. if (!_n && _i["return"] != null) _i["return"]();
  1082. } finally {
  1083. if (_d) throw _e;
  1084. }
  1085. }
  1086. return _arr;
  1087. }
  1088. function _nonIterableRest() {
  1089. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  1090. }
  1091. /**
  1092. * @author: general
  1093. * @website: note.generals.space
  1094. * @email: generals.space@gmail.com
  1095. * @github: https://github.com/generals-space/bootstrap-table-addrbar
  1096. * @update: zhixin wen <wenzhixin2010@gmail.com>
  1097. */
  1098. /*
  1099. * function: 获取浏览器地址栏中的指定参数.
  1100. * key: 参数名
  1101. * url: 默认为当前地址栏
  1102. */
  1103. function _GET(key) {
  1104. var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.search;
  1105. /*
  1106. * 注意这里正则表达式的书写方法
  1107. * (^|&)key匹配: 直接以key开始或以&key开始的字符串
  1108. * 同理(&|$)表示以&结束或是直接结束的字符串
  1109. * ...当然, 我并不知道这种用法.
  1110. */
  1111. var reg = new RegExp("(^|&)".concat(key, "=([^&]*)(&|$)"));
  1112. var result = url.substr(1).match(reg);
  1113. if (result) {
  1114. return decodeURIComponent(result[2]);
  1115. }
  1116. return null;
  1117. }
  1118. /*
  1119. * function: 根据给定参数生成url地址
  1120. * var dic = {name: 'genreal', age: 24}
  1121. * var url = 'https://www.baidu.com?age=22';
  1122. * _buildUrl(dic, url);
  1123. * 将得到"https://www.baidu.com?age=24&name=genreal"
  1124. * 哦, 忽略先后顺序吧...
  1125. *
  1126. * 补充: 可以参考浏览器URLSearchParams对象, 更加方便和强大.
  1127. * 考虑到兼容性, 暂时不使用这个工具.
  1128. */
  1129. function _buildUrl(dict) {
  1130. var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.search;
  1131. for (var _i = 0, _Object$entries = Object.entries(dict); _i < _Object$entries.length; _i++) {
  1132. var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
  1133. key = _Object$entries$_i[0],
  1134. val = _Object$entries$_i[1];
  1135. // 搜索name=general这种形式的字符串(&是分隔符)
  1136. var pattern = "".concat(key, "=([^&]*)");
  1137. var targetStr = "".concat(key, "=").concat(val);
  1138. /*
  1139. * 如果目标url中包含了key键, 我们需要将它替换成我们自己的val
  1140. * 不然就直接添加好了.
  1141. */
  1142. if (url.match(pattern)) {
  1143. var tmp = new RegExp("(".concat(key, "=)([^&]*)"), 'gi');
  1144. url = url.replace(tmp, targetStr);
  1145. } else {
  1146. var seperator = url.match('[?]') ? '&' : '?';
  1147. url = url + seperator + targetStr;
  1148. }
  1149. }
  1150. if (location.hash) {
  1151. url += location.hash;
  1152. }
  1153. return url;
  1154. }
  1155. $.BootstrapTable =
  1156. /*#__PURE__*/
  1157. function (_$$BootstrapTable) {
  1158. _inherits(_class, _$$BootstrapTable);
  1159. function _class() {
  1160. _classCallCheck(this, _class);
  1161. return _possibleConstructorReturn(this, _getPrototypeOf(_class).apply(this, arguments));
  1162. }
  1163. _createClass(_class, [{
  1164. key: "init",
  1165. value: function init() {
  1166. var _this = this,
  1167. _get2;
  1168. if (this.options.pagination && this.options.sidePagination === 'server' && this.options.addrbar) {
  1169. // 标志位, 初始加载后关闭
  1170. this.addrbarInit = true;
  1171. var _prefix = this.options.addrPrefix || ''; // 优先级排序: 用户指定值最优先, 未指定时从地址栏获取, 未获取到时采用默认值
  1172. this.options.pageNumber = +_GET("".concat(_prefix, "page")) || $.BootstrapTable.DEFAULTS.pageNumber;
  1173. this.options.pageSize = +_GET("".concat(_prefix, "size")) || $.BootstrapTable.DEFAULTS.pageSize;
  1174. this.options.sortOrder = _GET("".concat(_prefix, "order")) || $.BootstrapTable.DEFAULTS.sortOrder;
  1175. this.options.sortName = _GET("".concat(_prefix, "sort")) || $.BootstrapTable.DEFAULTS.sortName;
  1176. this.options.searchText = _GET("".concat(_prefix, "search")) || $.BootstrapTable.DEFAULTS.searchText;
  1177. var _onLoadSuccess = this.options.onLoadSuccess;
  1178. this.options.onLoadSuccess = function (data) {
  1179. if (_this.addrbarInit) {
  1180. _this.addrbarInit = false;
  1181. } else {
  1182. var params = {};
  1183. params["".concat(_prefix, "page")] = _this.options.pageNumber, params["".concat(_prefix, "size")] = _this.options.pageSize, params["".concat(_prefix, "order")] = _this.options.sortOrder, params["".concat(_prefix, "sort")] = _this.options.sortName, params["".concat(_prefix, "search")] = _this.options.searchText; // h5提供的修改浏览器地址栏的方法
  1184. window.history.pushState({}, '', _buildUrl(params));
  1185. }
  1186. if (_onLoadSuccess) {
  1187. _onLoadSuccess.call(_this, data);
  1188. }
  1189. };
  1190. }
  1191. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1192. args[_key] = arguments[_key];
  1193. }
  1194. (_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
  1195. }
  1196. }]);
  1197. return _class;
  1198. }($.BootstrapTable);
  1199. }));