vendor: 4,938 bytes, lines 1-154
1/*! 2 * JavaScript Cookie v2.1.2 3 * https://github.com/js-cookie/js-cookie 4 * 5 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack 6 * Released under the MIT license 7 */ 8;(function (factory) { 9 if (typeof define === 'function' && define.amd) { 10 define(factory); 11 } else if (typeof exports === 'object') { 12 module.exports = factory(); 13 } else { 14 var OldCookies = window.Cookies; 15 var api = window.Cookies = factory(); 16 api.noConflict = function () { 17 window.Cookies = OldCookies; 18 return api; 19 }; 20 } 21}(function () { 22 function extend () { 23 var i = 0; 24 var result = {}; 25 for (; i < arguments.length; i++) { 26 var attributes = arguments[ i ]; 27 for (var key in attributes) { 28 result[key] = attributes[key]; 29 } 30 } 31 return result; 32 } 33 34 function init (converter) { 35 function api (key, value, attributes) { 36 var result; 37 if (typeof document === 'undefined') { 38 return; 39 } 40 41 // Write 42 43 if (arguments.length > 1) { 44 attributes = extend({ 45 path: '/' 46 }, api.defaults, attributes); 47 48 if (typeof attributes.expires === 'number') { 49 var expires = new Date(); 50 expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5); 51 attributes.expires = expires; 52 } 53 54 try { 55 result = JSON.stringify(value); 56 if (/^[\{\[]/.test(result)) { 57 value = result; 58 } 59 // eslint-disable-next-line no-empty 60 } catch (e) {} 61 62 if (!converter.write) { 63 value = encodeURIComponent(String(value)) 64 .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); 65 } else { 66 value = converter.write(value, key); 67 } 68 69 key = encodeURIComponent(String(key)); 70 key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent); 71 key = key.replace(/[\(\)]/g, escape); 72 73 return (document.cookie = [ 74 key, '=', value, 75 attributes.expires && '; expires=' + attributes.expires.toUTCString(), // use expires attribute, max-age is not supported by IE 76 attributes.path && '; path=' + attributes.path, 77 attributes.domain && '; domain=' + attributes.domain, 78 attributes.secure ? '; secure' : '' 79 ].join('')); 80 } 81 82 // Read 83 84 if (!key) { 85 result = {}; 86 } 87 88 // To prevent the for loop in the first place assign an empty array 89 // in case there are no cookies at all. Also prevents odd result when 90 // calling "get()" 91 var cookies = document.cookie ? document.cookie.split('; ') : []; 92 var rdecode = /(%[0-9A-Z]{2})+/g; 93 var i = 0; 94 95 for (; i < cookies.length; i++) { 96 var parts = cookies[i].split('='); 97 var cookie = parts.slice(1).join('='); 98 99 if (cookie.charAt(0) === '"') { 100 cookie = cookie.slice(1, -1); 101 } 102 103 try { 104 var name = parts[0].replace(rdecode, decodeURIComponent); 105 cookie = converter.read ? 106 converter.read(cookie, name) : converter(cookie, name) || 107 cookie.replace(rdecode, decodeURIComponent); 108 109 if (this.json) { 110 try { 111 cookie = JSON.parse(cookie); 112 // eslint-disable-next-line no-empty 113 } catch (e) {} 114 } 115 116 if (key === name) { 117 result = cookie; 118 break; 119 } 120 121 if (!key) { 122 result[name] = cookie; 123 } 124 // eslint-disable-next-line no-empty 125 } catch (e) {} 126 } 127 128 return result; 129 } 130 131 api.set = api; 132 api.get = function (key) { 133 return api(key); 134 }; 135 api.getJSON = function () { 136 return api.apply({ 137 json: true 138 }, [].slice.call(arguments)); 139 }; 140 api.defaults = {}; 141 142 api.remove = function (key, attributes) { 143 api(key, '', extend(attributes, { 144 expires: -1 145 })); 146 }; 147 148 api.withConverter = init; 149 150 return api; 151 } 152 153 return init(function () {}); 154}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.