browser.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840
  1. (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
  2. 'use strict';
  3. var keys = require('object-keys').shim();
  4. delete keys.shim;
  5. var assign = require('./');
  6. module.exports = assign.shim();
  7. delete assign.shim;
  8. },{"./":3,"object-keys":16}],2:[function(require,module,exports){
  9. 'use strict';
  10. // modified from https://github.com/es-shims/es6-shim
  11. var keys = require('object-keys');
  12. var canBeObject = function (obj) {
  13. return typeof obj !== 'undefined' && obj !== null;
  14. };
  15. var hasSymbols = require('has-symbols/shams')();
  16. var callBound = require('es-abstract/helpers/callBound');
  17. var toObject = Object;
  18. var $push = callBound('Array.prototype.push');
  19. var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');
  20. var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;
  21. // eslint-disable-next-line no-unused-vars
  22. module.exports = function assign(target, source1) {
  23. if (!canBeObject(target)) { throw new TypeError('target must be an object'); }
  24. var objTarget = toObject(target);
  25. var s, source, i, props, syms, value, key;
  26. for (s = 1; s < arguments.length; ++s) {
  27. source = toObject(arguments[s]);
  28. props = keys(source);
  29. var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);
  30. if (getSymbols) {
  31. syms = getSymbols(source);
  32. for (i = 0; i < syms.length; ++i) {
  33. key = syms[i];
  34. if ($propIsEnumerable(source, key)) {
  35. $push(props, key);
  36. }
  37. }
  38. }
  39. for (i = 0; i < props.length; ++i) {
  40. key = props[i];
  41. value = source[key];
  42. if ($propIsEnumerable(source, key)) {
  43. objTarget[key] = value;
  44. }
  45. }
  46. }
  47. return objTarget;
  48. };
  49. },{"es-abstract/helpers/callBound":7,"has-symbols/shams":11,"object-keys":16}],3:[function(require,module,exports){
  50. 'use strict';
  51. var defineProperties = require('define-properties');
  52. var callBind = require('es-abstract/helpers/callBind');
  53. var implementation = require('./implementation');
  54. var getPolyfill = require('./polyfill');
  55. var shim = require('./shim');
  56. var polyfill = callBind.apply(getPolyfill());
  57. // eslint-disable-next-line no-unused-vars
  58. var bound = function assign(target, source1) {
  59. return polyfill(Object, arguments);
  60. };
  61. defineProperties(bound, {
  62. getPolyfill: getPolyfill,
  63. implementation: implementation,
  64. shim: shim
  65. });
  66. module.exports = bound;
  67. },{"./implementation":2,"./polyfill":18,"./shim":19,"define-properties":4,"es-abstract/helpers/callBind":6}],4:[function(require,module,exports){
  68. 'use strict';
  69. var keys = require('object-keys');
  70. var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
  71. var toStr = Object.prototype.toString;
  72. var concat = Array.prototype.concat;
  73. var origDefineProperty = Object.defineProperty;
  74. var isFunction = function (fn) {
  75. return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
  76. };
  77. var arePropertyDescriptorsSupported = function () {
  78. var obj = {};
  79. try {
  80. origDefineProperty(obj, 'x', { enumerable: false, value: obj });
  81. // eslint-disable-next-line no-unused-vars, no-restricted-syntax
  82. for (var _ in obj) { // jscs:ignore disallowUnusedVariables
  83. return false;
  84. }
  85. return obj.x === obj;
  86. } catch (e) { /* this is IE 8. */
  87. return false;
  88. }
  89. };
  90. var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
  91. var defineProperty = function (object, name, value, predicate) {
  92. if (name in object && (!isFunction(predicate) || !predicate())) {
  93. return;
  94. }
  95. if (supportsDescriptors) {
  96. origDefineProperty(object, name, {
  97. configurable: true,
  98. enumerable: false,
  99. value: value,
  100. writable: true
  101. });
  102. } else {
  103. object[name] = value;
  104. }
  105. };
  106. var defineProperties = function (object, map) {
  107. var predicates = arguments.length > 2 ? arguments[2] : {};
  108. var props = keys(map);
  109. if (hasSymbols) {
  110. props = concat.call(props, Object.getOwnPropertySymbols(map));
  111. }
  112. for (var i = 0; i < props.length; i += 1) {
  113. defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
  114. }
  115. };
  116. defineProperties.supportsDescriptors = !!supportsDescriptors;
  117. module.exports = defineProperties;
  118. },{"object-keys":16}],5:[function(require,module,exports){
  119. 'use strict';
  120. /* globals
  121. AggregateError,
  122. Atomics,
  123. FinalizationRegistry,
  124. SharedArrayBuffer,
  125. WeakRef,
  126. */
  127. var undefined;
  128. var $SyntaxError = SyntaxError;
  129. var $Function = Function;
  130. var $TypeError = TypeError;
  131. // eslint-disable-next-line consistent-return
  132. var getEvalledConstructor = function (expressionSyntax) {
  133. try {
  134. // eslint-disable-next-line no-new-func
  135. return Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
  136. } catch (e) {}
  137. };
  138. var $gOPD = Object.getOwnPropertyDescriptor;
  139. if ($gOPD) {
  140. try {
  141. $gOPD({}, '');
  142. } catch (e) {
  143. $gOPD = null; // this is IE 8, which has a broken gOPD
  144. }
  145. }
  146. var throwTypeError = function () { throw new $TypeError(); };
  147. var ThrowTypeError = $gOPD
  148. ? (function () {
  149. try {
  150. // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
  151. arguments.callee; // IE 8 does not throw here
  152. return throwTypeError;
  153. } catch (calleeThrows) {
  154. try {
  155. // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
  156. return $gOPD(arguments, 'callee').get;
  157. } catch (gOPDthrows) {
  158. return throwTypeError;
  159. }
  160. }
  161. }())
  162. : throwTypeError;
  163. var hasSymbols = require('has-symbols')();
  164. var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
  165. var asyncGenFunction = getEvalledConstructor('async function* () {}');
  166. var asyncGenFunctionPrototype = asyncGenFunction ? asyncGenFunction.prototype : undefined;
  167. var asyncGenPrototype = asyncGenFunctionPrototype ? asyncGenFunctionPrototype.prototype : undefined;
  168. var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
  169. var INTRINSICS = {
  170. '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
  171. '%Array%': Array,
  172. '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
  173. '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
  174. '%AsyncFromSyncIteratorPrototype%': undefined,
  175. '%AsyncFunction%': getEvalledConstructor('async function () {}'),
  176. '%AsyncGenerator%': asyncGenFunctionPrototype,
  177. '%AsyncGeneratorFunction%': asyncGenFunction,
  178. '%AsyncIteratorPrototype%': asyncGenPrototype ? getProto(asyncGenPrototype) : undefined,
  179. '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
  180. '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
  181. '%Boolean%': Boolean,
  182. '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
  183. '%Date%': Date,
  184. '%decodeURI%': decodeURI,
  185. '%decodeURIComponent%': decodeURIComponent,
  186. '%encodeURI%': encodeURI,
  187. '%encodeURIComponent%': encodeURIComponent,
  188. '%Error%': Error,
  189. '%eval%': eval, // eslint-disable-line no-eval
  190. '%EvalError%': EvalError,
  191. '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
  192. '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
  193. '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
  194. '%Function%': $Function,
  195. '%GeneratorFunction%': getEvalledConstructor('function* () {}'),
  196. '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
  197. '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
  198. '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
  199. '%isFinite%': isFinite,
  200. '%isNaN%': isNaN,
  201. '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
  202. '%JSON%': typeof JSON === 'object' ? JSON : undefined,
  203. '%Map%': typeof Map === 'undefined' ? undefined : Map,
  204. '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
  205. '%Math%': Math,
  206. '%Number%': Number,
  207. '%Object%': Object,
  208. '%parseFloat%': parseFloat,
  209. '%parseInt%': parseInt,
  210. '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
  211. '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
  212. '%RangeError%': RangeError,
  213. '%ReferenceError%': ReferenceError,
  214. '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
  215. '%RegExp%': RegExp,
  216. '%Set%': typeof Set === 'undefined' ? undefined : Set,
  217. '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
  218. '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
  219. '%String%': String,
  220. '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
  221. '%Symbol%': hasSymbols ? Symbol : undefined,
  222. '%SyntaxError%': $SyntaxError,
  223. '%ThrowTypeError%': ThrowTypeError,
  224. '%TypedArray%': TypedArray,
  225. '%TypeError%': $TypeError,
  226. '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
  227. '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
  228. '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
  229. '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
  230. '%URIError%': URIError,
  231. '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
  232. '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
  233. '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
  234. };
  235. var LEGACY_ALIASES = {
  236. '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
  237. '%ArrayPrototype%': ['Array', 'prototype'],
  238. '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
  239. '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
  240. '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
  241. '%ArrayProto_values%': ['Array', 'prototype', 'values'],
  242. '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
  243. '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
  244. '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
  245. '%BooleanPrototype%': ['Boolean', 'prototype'],
  246. '%DataViewPrototype%': ['DataView', 'prototype'],
  247. '%DatePrototype%': ['Date', 'prototype'],
  248. '%ErrorPrototype%': ['Error', 'prototype'],
  249. '%EvalErrorPrototype%': ['EvalError', 'prototype'],
  250. '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
  251. '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
  252. '%FunctionPrototype%': ['Function', 'prototype'],
  253. '%Generator%': ['GeneratorFunction', 'prototype'],
  254. '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
  255. '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
  256. '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
  257. '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
  258. '%JSONParse%': ['JSON', 'parse'],
  259. '%JSONStringify%': ['JSON', 'stringify'],
  260. '%MapPrototype%': ['Map', 'prototype'],
  261. '%NumberPrototype%': ['Number', 'prototype'],
  262. '%ObjectPrototype%': ['Object', 'prototype'],
  263. '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
  264. '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
  265. '%PromisePrototype%': ['Promise', 'prototype'],
  266. '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
  267. '%Promise_all%': ['Promise', 'all'],
  268. '%Promise_reject%': ['Promise', 'reject'],
  269. '%Promise_resolve%': ['Promise', 'resolve'],
  270. '%RangeErrorPrototype%': ['RangeError', 'prototype'],
  271. '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
  272. '%RegExpPrototype%': ['RegExp', 'prototype'],
  273. '%SetPrototype%': ['Set', 'prototype'],
  274. '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
  275. '%StringPrototype%': ['String', 'prototype'],
  276. '%SymbolPrototype%': ['Symbol', 'prototype'],
  277. '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
  278. '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
  279. '%TypeErrorPrototype%': ['TypeError', 'prototype'],
  280. '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
  281. '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
  282. '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
  283. '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
  284. '%URIErrorPrototype%': ['URIError', 'prototype'],
  285. '%WeakMapPrototype%': ['WeakMap', 'prototype'],
  286. '%WeakSetPrototype%': ['WeakSet', 'prototype']
  287. };
  288. var bind = require('function-bind');
  289. var hasOwn = require('has');
  290. var $concat = bind.call(Function.call, Array.prototype.concat);
  291. var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
  292. var $replace = bind.call(Function.call, String.prototype.replace);
  293. /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
  294. var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
  295. var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
  296. var stringToPath = function stringToPath(string) {
  297. var result = [];
  298. $replace(string, rePropName, function (match, number, quote, subString) {
  299. result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
  300. });
  301. return result;
  302. };
  303. /* end adaptation */
  304. var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
  305. var intrinsicName = name;
  306. var alias;
  307. if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
  308. alias = LEGACY_ALIASES[intrinsicName];
  309. intrinsicName = '%' + alias[0] + '%';
  310. }
  311. if (hasOwn(INTRINSICS, intrinsicName)) {
  312. var value = INTRINSICS[intrinsicName];
  313. if (typeof value === 'undefined' && !allowMissing) {
  314. throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
  315. }
  316. return {
  317. alias: alias,
  318. name: intrinsicName,
  319. value: value
  320. };
  321. }
  322. throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
  323. };
  324. module.exports = function GetIntrinsic(name, allowMissing) {
  325. if (typeof name !== 'string' || name.length === 0) {
  326. throw new $TypeError('intrinsic name must be a non-empty string');
  327. }
  328. if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
  329. throw new $TypeError('"allowMissing" argument must be a boolean');
  330. }
  331. var parts = stringToPath(name);
  332. var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
  333. var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
  334. var intrinsicRealName = intrinsic.name;
  335. var value = intrinsic.value;
  336. var skipFurtherCaching = false;
  337. var alias = intrinsic.alias;
  338. if (alias) {
  339. intrinsicBaseName = alias[0];
  340. $spliceApply(parts, $concat([0, 1], alias));
  341. }
  342. for (var i = 1, isOwn = true; i < parts.length; i += 1) {
  343. var part = parts[i];
  344. if (part === 'constructor' || !isOwn) {
  345. skipFurtherCaching = true;
  346. }
  347. intrinsicBaseName += '.' + part;
  348. intrinsicRealName = '%' + intrinsicBaseName + '%';
  349. if (hasOwn(INTRINSICS, intrinsicRealName)) {
  350. value = INTRINSICS[intrinsicRealName];
  351. } else if (value != null) {
  352. if ($gOPD && (i + 1) >= parts.length) {
  353. var desc = $gOPD(value, part);
  354. isOwn = !!desc;
  355. if (!allowMissing && !(part in value)) {
  356. throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
  357. }
  358. value = isOwn ? desc.get || desc.value : value[part];
  359. } else {
  360. isOwn = hasOwn(value, part);
  361. value = value[part];
  362. }
  363. if (isOwn && !skipFurtherCaching) {
  364. INTRINSICS[intrinsicRealName] = value;
  365. }
  366. }
  367. }
  368. return value;
  369. };
  370. },{"function-bind":9,"has":14,"has-symbols":10}],6:[function(require,module,exports){
  371. 'use strict';
  372. var bind = require('function-bind');
  373. var GetIntrinsic = require('../GetIntrinsic');
  374. var $apply = GetIntrinsic('%Function.prototype.apply%');
  375. var $call = GetIntrinsic('%Function.prototype.call%');
  376. var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
  377. module.exports = function callBind() {
  378. return $reflectApply(bind, $call, arguments);
  379. };
  380. module.exports.apply = function applyBind() {
  381. return $reflectApply(bind, $apply, arguments);
  382. };
  383. },{"../GetIntrinsic":5,"function-bind":9}],7:[function(require,module,exports){
  384. 'use strict';
  385. var GetIntrinsic = require('../GetIntrinsic');
  386. var callBind = require('./callBind');
  387. var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
  388. module.exports = function callBoundIntrinsic(name, allowMissing) {
  389. var intrinsic = GetIntrinsic(name, !!allowMissing);
  390. if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) {
  391. return callBind(intrinsic);
  392. }
  393. return intrinsic;
  394. };
  395. },{"../GetIntrinsic":5,"./callBind":6}],8:[function(require,module,exports){
  396. 'use strict';
  397. /* eslint no-invalid-this: 1 */
  398. var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
  399. var slice = Array.prototype.slice;
  400. var toStr = Object.prototype.toString;
  401. var funcType = '[object Function]';
  402. module.exports = function bind(that) {
  403. var target = this;
  404. if (typeof target !== 'function' || toStr.call(target) !== funcType) {
  405. throw new TypeError(ERROR_MESSAGE + target);
  406. }
  407. var args = slice.call(arguments, 1);
  408. var bound;
  409. var binder = function () {
  410. if (this instanceof bound) {
  411. var result = target.apply(
  412. this,
  413. args.concat(slice.call(arguments))
  414. );
  415. if (Object(result) === result) {
  416. return result;
  417. }
  418. return this;
  419. } else {
  420. return target.apply(
  421. that,
  422. args.concat(slice.call(arguments))
  423. );
  424. }
  425. };
  426. var boundLength = Math.max(0, target.length - args.length);
  427. var boundArgs = [];
  428. for (var i = 0; i < boundLength; i++) {
  429. boundArgs.push('$' + i);
  430. }
  431. bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
  432. if (target.prototype) {
  433. var Empty = function Empty() {};
  434. Empty.prototype = target.prototype;
  435. bound.prototype = new Empty();
  436. Empty.prototype = null;
  437. }
  438. return bound;
  439. };
  440. },{}],9:[function(require,module,exports){
  441. 'use strict';
  442. var implementation = require('./implementation');
  443. module.exports = Function.prototype.bind || implementation;
  444. },{"./implementation":8}],10:[function(require,module,exports){
  445. (function (global){
  446. 'use strict';
  447. var origSymbol = global.Symbol;
  448. var hasSymbolSham = require('./shams');
  449. module.exports = function hasNativeSymbols() {
  450. if (typeof origSymbol !== 'function') { return false; }
  451. if (typeof Symbol !== 'function') { return false; }
  452. if (typeof origSymbol('foo') !== 'symbol') { return false; }
  453. if (typeof Symbol('bar') !== 'symbol') { return false; }
  454. return hasSymbolSham();
  455. };
  456. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  457. },{"./shams":11}],11:[function(require,module,exports){
  458. 'use strict';
  459. /* eslint complexity: [2, 18], max-statements: [2, 33] */
  460. module.exports = function hasSymbols() {
  461. if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
  462. if (typeof Symbol.iterator === 'symbol') { return true; }
  463. var obj = {};
  464. var sym = Symbol('test');
  465. var symObj = Object(sym);
  466. if (typeof sym === 'string') { return false; }
  467. if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
  468. if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
  469. // temp disabled per https://github.com/ljharb/object.assign/issues/17
  470. // if (sym instanceof Symbol) { return false; }
  471. // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
  472. // if (!(symObj instanceof Symbol)) { return false; }
  473. // if (typeof Symbol.prototype.toString !== 'function') { return false; }
  474. // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
  475. var symVal = 42;
  476. obj[sym] = symVal;
  477. for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
  478. if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
  479. if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
  480. var syms = Object.getOwnPropertySymbols(obj);
  481. if (syms.length !== 1 || syms[0] !== sym) { return false; }
  482. if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
  483. if (typeof Object.getOwnPropertyDescriptor === 'function') {
  484. var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
  485. if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
  486. }
  487. return true;
  488. };
  489. },{}],12:[function(require,module,exports){
  490. arguments[4][8][0].apply(exports,arguments)
  491. },{"dup":8}],13:[function(require,module,exports){
  492. arguments[4][9][0].apply(exports,arguments)
  493. },{"./implementation":12,"dup":9}],14:[function(require,module,exports){
  494. 'use strict';
  495. var bind = require('function-bind');
  496. module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
  497. },{"function-bind":13}],15:[function(require,module,exports){
  498. 'use strict';
  499. var keysShim;
  500. if (!Object.keys) {
  501. // modified from https://github.com/es-shims/es5-shim
  502. var has = Object.prototype.hasOwnProperty;
  503. var toStr = Object.prototype.toString;
  504. var isArgs = require('./isArguments'); // eslint-disable-line global-require
  505. var isEnumerable = Object.prototype.propertyIsEnumerable;
  506. var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
  507. var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
  508. var dontEnums = [
  509. 'toString',
  510. 'toLocaleString',
  511. 'valueOf',
  512. 'hasOwnProperty',
  513. 'isPrototypeOf',
  514. 'propertyIsEnumerable',
  515. 'constructor'
  516. ];
  517. var equalsConstructorPrototype = function (o) {
  518. var ctor = o.constructor;
  519. return ctor && ctor.prototype === o;
  520. };
  521. var excludedKeys = {
  522. $applicationCache: true,
  523. $console: true,
  524. $external: true,
  525. $frame: true,
  526. $frameElement: true,
  527. $frames: true,
  528. $innerHeight: true,
  529. $innerWidth: true,
  530. $onmozfullscreenchange: true,
  531. $onmozfullscreenerror: true,
  532. $outerHeight: true,
  533. $outerWidth: true,
  534. $pageXOffset: true,
  535. $pageYOffset: true,
  536. $parent: true,
  537. $scrollLeft: true,
  538. $scrollTop: true,
  539. $scrollX: true,
  540. $scrollY: true,
  541. $self: true,
  542. $webkitIndexedDB: true,
  543. $webkitStorageInfo: true,
  544. $window: true
  545. };
  546. var hasAutomationEqualityBug = (function () {
  547. /* global window */
  548. if (typeof window === 'undefined') { return false; }
  549. for (var k in window) {
  550. try {
  551. if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
  552. try {
  553. equalsConstructorPrototype(window[k]);
  554. } catch (e) {
  555. return true;
  556. }
  557. }
  558. } catch (e) {
  559. return true;
  560. }
  561. }
  562. return false;
  563. }());
  564. var equalsConstructorPrototypeIfNotBuggy = function (o) {
  565. /* global window */
  566. if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
  567. return equalsConstructorPrototype(o);
  568. }
  569. try {
  570. return equalsConstructorPrototype(o);
  571. } catch (e) {
  572. return false;
  573. }
  574. };
  575. keysShim = function keys(object) {
  576. var isObject = object !== null && typeof object === 'object';
  577. var isFunction = toStr.call(object) === '[object Function]';
  578. var isArguments = isArgs(object);
  579. var isString = isObject && toStr.call(object) === '[object String]';
  580. var theKeys = [];
  581. if (!isObject && !isFunction && !isArguments) {
  582. throw new TypeError('Object.keys called on a non-object');
  583. }
  584. var skipProto = hasProtoEnumBug && isFunction;
  585. if (isString && object.length > 0 && !has.call(object, 0)) {
  586. for (var i = 0; i < object.length; ++i) {
  587. theKeys.push(String(i));
  588. }
  589. }
  590. if (isArguments && object.length > 0) {
  591. for (var j = 0; j < object.length; ++j) {
  592. theKeys.push(String(j));
  593. }
  594. } else {
  595. for (var name in object) {
  596. if (!(skipProto && name === 'prototype') && has.call(object, name)) {
  597. theKeys.push(String(name));
  598. }
  599. }
  600. }
  601. if (hasDontEnumBug) {
  602. var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
  603. for (var k = 0; k < dontEnums.length; ++k) {
  604. if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
  605. theKeys.push(dontEnums[k]);
  606. }
  607. }
  608. }
  609. return theKeys;
  610. };
  611. }
  612. module.exports = keysShim;
  613. },{"./isArguments":17}],16:[function(require,module,exports){
  614. 'use strict';
  615. var slice = Array.prototype.slice;
  616. var isArgs = require('./isArguments');
  617. var origKeys = Object.keys;
  618. var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');
  619. var originalKeys = Object.keys;
  620. keysShim.shim = function shimObjectKeys() {
  621. if (Object.keys) {
  622. var keysWorksWithArguments = (function () {
  623. // Safari 5.0 bug
  624. var args = Object.keys(arguments);
  625. return args && args.length === arguments.length;
  626. }(1, 2));
  627. if (!keysWorksWithArguments) {
  628. Object.keys = function keys(object) { // eslint-disable-line func-name-matching
  629. if (isArgs(object)) {
  630. return originalKeys(slice.call(object));
  631. }
  632. return originalKeys(object);
  633. };
  634. }
  635. } else {
  636. Object.keys = keysShim;
  637. }
  638. return Object.keys || keysShim;
  639. };
  640. module.exports = keysShim;
  641. },{"./implementation":15,"./isArguments":17}],17:[function(require,module,exports){
  642. 'use strict';
  643. var toStr = Object.prototype.toString;
  644. module.exports = function isArguments(value) {
  645. var str = toStr.call(value);
  646. var isArgs = str === '[object Arguments]';
  647. if (!isArgs) {
  648. isArgs = str !== '[object Array]' &&
  649. value !== null &&
  650. typeof value === 'object' &&
  651. typeof value.length === 'number' &&
  652. value.length >= 0 &&
  653. toStr.call(value.callee) === '[object Function]';
  654. }
  655. return isArgs;
  656. };
  657. },{}],18:[function(require,module,exports){
  658. 'use strict';
  659. var implementation = require('./implementation');
  660. var lacksProperEnumerationOrder = function () {
  661. if (!Object.assign) {
  662. return false;
  663. }
  664. /*
  665. * v8, specifically in node 4.x, has a bug with incorrect property enumeration order
  666. * note: this does not detect the bug unless there's 20 characters
  667. */
  668. var str = 'abcdefghijklmnopqrst';
  669. var letters = str.split('');
  670. var map = {};
  671. for (var i = 0; i < letters.length; ++i) {
  672. map[letters[i]] = letters[i];
  673. }
  674. var obj = Object.assign({}, map);
  675. var actual = '';
  676. for (var k in obj) {
  677. actual += k;
  678. }
  679. return str !== actual;
  680. };
  681. var assignHasPendingExceptions = function () {
  682. if (!Object.assign || !Object.preventExtensions) {
  683. return false;
  684. }
  685. /*
  686. * Firefox 37 still has "pending exception" logic in its Object.assign implementation,
  687. * which is 72% slower than our shim, and Firefox 40's native implementation.
  688. */
  689. var thrower = Object.preventExtensions({ 1: 2 });
  690. try {
  691. Object.assign(thrower, 'xy');
  692. } catch (e) {
  693. return thrower[1] === 'y';
  694. }
  695. return false;
  696. };
  697. module.exports = function getPolyfill() {
  698. if (!Object.assign) {
  699. return implementation;
  700. }
  701. if (lacksProperEnumerationOrder()) {
  702. return implementation;
  703. }
  704. if (assignHasPendingExceptions()) {
  705. return implementation;
  706. }
  707. return Object.assign;
  708. };
  709. },{"./implementation":2}],19:[function(require,module,exports){
  710. 'use strict';
  711. var define = require('define-properties');
  712. var getPolyfill = require('./polyfill');
  713. module.exports = function shimAssign() {
  714. var polyfill = getPolyfill();
  715. define(
  716. Object,
  717. { assign: polyfill },
  718. { assign: function () { return Object.assign !== polyfill; } }
  719. );
  720. return polyfill;
  721. };
  722. },{"./polyfill":18,"define-properties":4}]},{},[1]);