vendor: 4,117 bytes, lines 1-142
1/*! js-cookie v3.0.8 | MIT */ 2; 3(function (global, factory) { 4 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 5 typeof define === 'function' && define.amd ? define(factory) : 6 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () { 7 var current = global.Cookies; 8 var exports = global.Cookies = factory(); 9 exports.noConflict = function () { global.Cookies = current; return exports; }; 10 })()); 11})(this, (function () { 'use strict'; 12 13 function assign (target) { 14 for (var i = 1; i < arguments.length; i++) { 15 var source = arguments[i]; 16 for (var key in source) { 17 if (key === '__proto__') continue 18 target[key] = source[key]; 19 } 20 } 21 return target 22 } 23 24 var defaultConverter = { 25 read: function (value) { 26 if (value[0] === '"') { 27 value = value.slice(1, -1); 28 } 29 return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent) 30 }, 31 write: function (value) { 32 return encodeURIComponent(value).replace( 33 /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, 34 decodeURIComponent 35 ) 36 } 37 }; 38 39 function init(converter, defaultAttributes) { 40 function set(name, value, attributes) { 41 if (typeof document === 'undefined') { 42 return 43 } 44 45 attributes = assign({}, defaultAttributes, attributes); 46 47 if (typeof attributes.expires === 'number') { 48 attributes.expires = new Date(Date.now() + attributes.expires * 864e5); 49 } 50 if (attributes.expires) { 51 attributes.expires = attributes.expires.toUTCString(); 52 } 53 54 name = encodeURIComponent(name) 55 .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent) 56 .replace(/[()]/g, escape); 57 58 var stringifiedAttributes = ''; 59 for (var attributeName in attributes) { 60 if (!attributes[attributeName]) { 61 continue 62 } 63 64 stringifiedAttributes += '; ' + attributeName; 65 66 if (attributes[attributeName] === true) { 67 continue 68 } 69 70 // Considers RFC 6265 section 5.2: 71 // ... 72 // 3. If the remaining unparsed-attributes contains a %x3B (";") 73 // character: 74 // Consume the characters of the unparsed-attributes up to, 75 // not including, the first %x3B (";") character. 76 // ... 77 stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]; 78 } 79 80 return (document.cookie = 81 name + '=' + converter.write(value, name) + stringifiedAttributes) 82 } 83 84 function get(name) { 85 if (typeof document === 'undefined' || (arguments.length && !name)) { 86 return 87 } 88 89 // To prevent the for loop in the first place assign an empty array 90 // in case there are no cookies at all. 91 var cookies = document.cookie ? document.cookie.split('; ') : []; 92 var jar = {}; 93 for (var i = 0; i < cookies.length; i++) { 94 var parts = cookies[i].split('='); 95 var value = parts.slice(1).join('='); 96 97 try { 98 var found = decodeURIComponent(parts[0]); 99 if (!(found in jar)) jar[found] = converter.read(value, found); 100 if (name === found) { 101 break 102 } 103 } catch (_e) { 104 // Do nothing... 105 } 106 } 107 108 return name ? jar[name] : jar 109 } 110 111 return Object.create( 112 { 113 set: set, 114 get: get, 115 remove: function (name, attributes) { 116 set( 117 name, 118 '', 119 assign({}, attributes, { 120 expires: -1 121 }) 122 ); 123 }, 124 withAttributes: function (attributes) { 125 return init(this.converter, assign({}, this.attributes, attributes)) 126 }, 127 withConverter: function (converter) { 128 return init(assign({}, this.converter, converter), this.attributes) 129 } 130 }, 131 { 132 attributes: { value: Object.freeze(defaultAttributes) }, 133 converter: { value: Object.freeze(converter) } 134 } 135 ) 136 } 137 138 var api = init(defaultConverter, { path: '/' }); 139 140 return api; 141 142}));
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.