2 * jQuery Cookie Plugin v1.4.1
3 * https://github.com/carhartl/jquery-cookie
5 * Copyright 2013 Klaus Hartl
6 * Released under the MIT license
9 "function" == typeof define
&& define
.amd
? define(["jquery"], a
) : a("object" == typeof exports
? require("jquery") : jQuery
)
12 return h
.raw
? a
: encodeURIComponent(a
)
16 return h
.raw
? a
: decodeURIComponent(a
)
20 return b(h
.json
? JSON
.stringify(a
) : String(a
))
24 0 === a
.indexOf('"') && (a
= a
.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g
, "\\"));
26 return a
= decodeURIComponent(a
.replace(g
, " ")), h
.json
? JSON
.parse(a
) : a
32 var d
= h
.raw
? b
: e(b
);
33 return a
.isFunction(c
) ? c(d
) : d
36 var g
= /\+/g, h
= a
.cookie = function (e
, g
, i
) {
37 if (void 0 !== g
&& !a
.isFunction(g
)) {
38 if (i
= a
.extend({}, h
.defaults
, i
), "number" == typeof i
.expires
) {
39 var j
= i
.expires
, k
= i
.expires
= new Date
;
40 k
.setTime(+k
+ 864e5
* j
)
42 return document
.cookie
= [b(e
), "=", d(g
), i
.expires
? "; expires=" + i
.expires
.toUTCString() : "", i
.path
? "; path=" + i
.path
: "", i
.domain
? "; domain=" + i
.domain
: "", i
.secure
? "; secure" : ""].join("")
44 for (var l
= e
? void 0 : {}, m
= document
.cookie
? document
.cookie
.split("; ") : [], n
= 0, o
= m
.length
; o
> n
; n
++) {
45 var p
= m
[n
].split("="), q
= c(p
.shift()), r
= p
.join("=");
50 e
|| void 0 === (r
= f(r
)) || (l
[q
] = r
)
54 h
.defaults
= {}, a
.removeCookie = function (b
, c
) {
55 return void 0 === a
.cookie(b
) ? !1 : (a
.cookie(b
, "", a
.extend({}, c
, {expires
: -1})), !a
.cookie(b
))