�PNG  IHDR��;���IDATx��ܻn�0���K�� �)(�pA��� ���7�LeG{�� �§㻢|��ذaÆ 6lذaÆ 6lذaÆ 6lom��$^�y���ذag�5bÆ 6lذaÆ 6lذa{���� 6lذaÆ �`����}H�Fkm�,�m����Ӫ���ô�ô!� �x�|'ܢ˟;�E:���9�&ᶒ�}�{�v]�n&�6� �h��_��t�ڠ͵-ҫ���Z;��Z$�.�P���k�ž)�!��o���>}l�eQfJ�T��u і���چ��\��X=8��Rن4`Vw�l�>����n�G�^��i�s��"ms�$�u��i��?w�bs[m�6�K4���O���.�4��%����/����b�C%��t ��M�ז� �-l�G6�mrz2���s�%�9��s@���-�k�9�=���)������k�B5����\��+͂�Zsٲ ��Rn��~G���R���C����� �wIcI��n7jJ���hۛNCS|���j0��8y�iHKֶۛ�k�Ɉ+;Sz������L/��F�*\��Ԕ�#"5��m�2��[S��������=�g��n�a�P�e�ғ�L�� lذaÆ 6l�^k��̱aÆ 6lذaÆ 6lذa;���� �_��ذaÆ 6lذaÆ 6lذaÆ ���R���IEND�B` 'use strict'; const retry = require('retry'); const networkErrorMsgs = [ 'Failed to fetch', // Chrome 'NetworkError when attempting to fetch resource.', // Firefox 'The Internet connection appears to be offline.', // Safari 'Network request failed' // `cross-fetch` ]; class AbortError extends Error { constructor(message) { super(); if (message instanceof Error) { this.originalError = message; ({message} = message); } else { this.originalError = new Error(message); this.originalError.stack = this.stack; } this.name = 'AbortError'; this.message = message; } } const decorateErrorWithCounts = (error, attemptNumber, options) => { // Minus 1 from attemptNumber because the first attempt does not count as a retry const retriesLeft = options.retries - (attemptNumber - 1); error.attemptNumber = attemptNumber; error.retriesLeft = retriesLeft; return error; }; const isNetworkError = errorMessage => networkErrorMsgs.includes(errorMessage); const pRetry = (input, options) => new Promise((resolve, reject) => { options = { onFailedAttempt: () => {}, retries: 10, ...options }; const operation = retry.operation(options); operation.attempt(async attemptNumber => { try { resolve(await input(attemptNumber)); } catch (error) { if (!(error instanceof Error)) { reject(new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`)); return; } if (error instanceof AbortError) { operation.stop(); reject(error.originalError); } else if (error instanceof TypeError && !isNetworkError(error.message)) { operation.stop(); reject(error); } else { decorateErrorWithCounts(error, attemptNumber, options); try { await options.onFailedAttempt(error); } catch (error) { reject(error); return; } if (!operation.retry(error)) { reject(operation.mainError()); } } } }); }); module.exports = pRetry; // TODO: remove this in the next major version module.exports.default = pRetry; module.exports.AbortError = AbortError;