�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` /*! * accepts * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict' /** * Module dependencies. * @private */ var Negotiator = require('negotiator') var mime = require('mime-types') /** * Module exports. * @public */ module.exports = Accepts /** * Create a new Accepts object for the given req. * * @param {object} req * @public */ function Accepts (req) { if (!(this instanceof Accepts)) { return new Accepts(req) } this.headers = req.headers this.negotiator = new Negotiator(req) } /** * Check if the given `type(s)` is acceptable, returning * the best match when true, otherwise `undefined`, in which * case you should respond with 406 "Not Acceptable". * * The `type` value may be a single mime type string * such as "application/json", the extension name * such as "json" or an array `["json", "html", "text/plain"]`. When a list * or array is given the _best_ match, if any is returned. * * Examples: * * // Accept: text/html * this.types('html'); * // => "html" * * // Accept: text/*, application/json * this.types('html'); * // => "html" * this.types('text/html'); * // => "text/html" * this.types('json', 'text'); * // => "json" * this.types('application/json'); * // => "application/json" * * // Accept: text/*, application/json * this.types('image/png'); * this.types('png'); * // => undefined * * // Accept: text/*;q=.5, application/json * this.types(['html', 'json']); * this.types('html', 'json'); * // => "json" * * @param {String|Array} types... * @return {String|Array|Boolean} * @public */ Accepts.prototype.type = Accepts.prototype.types = function (types_) { var types = types_ // support flattened arguments if (types && !Array.isArray(types)) { types = new Array(arguments.length) for (var i = 0; i < types.length; i++) { types[i] = arguments[i] } } // no types, return all requested types if (!types || types.length === 0) { return this.negotiator.mediaTypes() } // no accept header, return first given type if (!this.headers.accept) { return types[0] } var mimes = types.map(extToMime) var accepts = this.negotiator.mediaTypes(mimes.filter(validMime)) var first = accepts[0] return first ? types[mimes.indexOf(first)] : false } /** * Return accepted encodings or best fit based on `encodings`. * * Given `Accept-Encoding: gzip, deflate` * an array sorted by quality is returned: * * ['gzip', 'deflate'] * * @param {String|Array} encodings... * @return {String|Array} * @public */ Accepts.prototype.encoding = Accepts.prototype.encodings = function (encodings_) { var encodings = encodings_ // support flattened arguments if (encodings && !Array.isArray(encodings)) { encodings = new Array(arguments.length) for (var i = 0; i < encodings.length; i++) { encodings[i] = arguments[i] } } // no encodings, return all requested encodings if (!encodings || encodings.length === 0) { return this.negotiator.encodings() } return this.negotiator.encodings(encodings)[0] || false } /** * Return accepted charsets or best fit based on `charsets`. * * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5` * an array sorted by quality is returned: * * ['utf-8', 'utf-7', 'iso-8859-1'] * * @param {String|Array} charsets... * @return {String|Array} * @public */ Accepts.prototype.charset = Accepts.prototype.charsets = function (charsets_) { var charsets = charsets_ // support flattened arguments if (charsets && !Array.isArray(charsets)) { charsets = new Array(arguments.length) for (var i = 0; i < charsets.length; i++) { charsets[i] = arguments[i] } } // no charsets, return all requested charsets if (!charsets || charsets.length === 0) { return this.negotiator.charsets() } return this.negotiator.charsets(charsets)[0] || false } /** * Return accepted languages or best fit based on `langs`. * * Given `Accept-Language: en;q=0.8, es, pt` * an array sorted by quality is returned: * * ['es', 'pt', 'en'] * * @param {String|Array} langs... * @return {Array|String} * @public */ Accepts.prototype.lang = Accepts.prototype.langs = Accepts.prototype.language = Accepts.prototype.languages = function (languages_) { var languages = languages_ // support flattened arguments if (languages && !Array.isArray(languages)) { languages = new Array(arguments.length) for (var i = 0; i < languages.length; i++) { languages[i] = arguments[i] } } // no languages, return all requested languages if (!languages || languages.length === 0) { return this.negotiator.languages() } return this.negotiator.languages(languages)[0] || false } /** * Convert extnames to mime. * * @param {String} type * @return {String} * @private */ function extToMime (type) { return type.indexOf('/') === -1 ? mime.lookup(type) : type } /** * Check if mime is valid. * * @param {String} type * @return {String} * @private */ function validMime (type) { return typeof type === 'string' }