bootstrap-table-cookie.js 91 KB

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