text: /* Garlicjs dist/garlic-standalone.min.js build version 1.2.2 http://garlicjs.org */
  var Zepto=function(){function c(a){return"[object Function]"==O.call(a)}function k(a){return a instanceof Object}function v(a){return k(a)&&a.__proto__==Object.prototype}function e(a){return a instanceof Array}function f(a){return"number"==typeof a.length}function h(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function x(a){return a in D?D[a]:D[a]=RegExp("(^|\\s)"+a+"(\\s|$)")}function l(a){return"children"in
  a?y.call(a.children):b.map(a.childNodes,function(a){if(1==a.nodeType)return a})}function n(a,b,d){for(s in b)d&&v(b[s])?(v(a[s])||(a[s]={}),n(a[s],b[s],d)):b[s]!==m&&(a[s]=b[s])}function p(a,t){return t===m?b(a):b(a).filter(t)}function j(a,b,d,g){return c(b)?b.call(a,d,g):b}function w(a,b){var d=a.className,c=d&&d.baseVal!==m;if(b===m)return c?d.baseVal:d;c?d.baseVal=b:a.className=b}function A(a){var t;try{return a?"true"==a||("false"==a?!1:"null"==a?null:isNaN(t=Number(a))?/^[\[\{]/.test(a)?b.parseJSON(a):
  a:t):a}catch(d){return a}}function B(a,b){b(a);for(var d in a.childNodes)B(a.childNodes[d],b)}var m,s,b,g,q=[],y=q.slice,z=q.filter,u=window.document,E={},D={},F=u.defaultView.getComputedStyle,I={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},J=/^\s*<(\w+|!)[^>]*>/,P=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,K=/^(?:body|html)$/i,Q="val css html text data width height offset".split(" "),G=u.createElement("table"),L=u.createElement("tr"),
  M={tr:u.createElement("tbody"),tbody:G,thead:G,tfoot:G,td:L,th:L,"*":u.createElement("div")},R=/complete|loaded|interactive/,S=/^\.([\w-]+)$/,T=/^#([\w-]*)$/,U=/^[\w-]+$/,O={}.toString,r={},H,C,N=u.createElement("div");return r.matches=function(a,b){if(!a||1!==a.nodeType)return!1;var d=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(d)return d.call(a,b);var c,d=a.parentNode,g=!d;return g&&(d=N).appendChild(a),c=~r.qsa(d,b).indexOf(a),g&&N.removeChild(a),c},
  H=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},C=function(a){return z.call(a,function(b,d){return a.indexOf(b)==d})},r.fragment=function(a,t,d){a.replace&&(a=a.replace(P,"<$1></$2>"));t===m&&(t=J.test(a)&&RegExp.$1);t in M||(t="*");var c,g,e=M[t];return e.innerHTML=""+a,g=b.each(y.call(e.childNodes),function(){e.removeChild(this)}),v(d)&&(c=b(g),b.each(d,function(a,b){-1<Q.indexOf(a)?c[a](b):c.attr(a,b)})),g},r.Z=function(a,b){return a=a||[],a.__proto__=arguments.callee.prototype,
  a.selector=b||"",a},r.isZ=function(a){return a instanceof r.Z},r.init=function(a,t){if(!a)return r.Z();if(c(a))return b(u).ready(a);if(r.isZ(a))return a;var d;if(e(a))d=z.call(a,function(a){return a!==m&&null!==a});else if(k(a))d=[v(a)?b.extend({},a):a],a=null;else if(J.test(a))d=r.fragment(a.trim(),RegExp.$1,t),a=null;else{if(t!==m)return b(t).find(a);d=r.qsa(u,a)}return r.Z(d,a)},b=function(a,b){return r.init(a,b)},b.extend=function(a){var b,d=y.call(arguments,1);return"boolean"==typeof a&&(b=a,
  a=d.shift()),d.forEach(function(d){n(a,d,b)}),a},r.qsa=function(a,b){var d;return a===u&&T.test(b)?(d=a.getElementById(RegExp.$1))?[d]:[]:1!==a.nodeType&&9!==a.nodeType?[]:y.call(S.test(b)?a.getElementsByClassName(RegExp.$1):U.test(b)?a.getElementsByTagName(b):a.querySelectorAll(b))},b.contains=function(a,b){return a!==b&&a.contains(b)},b.isFunction=c,b.isObject=k,b.isArray=e,b.isPlainObject=v,b.inArray=function(a,b,d){return q.indexOf.call(b,a,d)},b.camelCase=H,b.trim=function(a){return a.trim()},
  b.uuid=0,b.support={},b.expr={},b.map=function(a,t){var d,c=[],g;if(f(a))for(g=0;g<a.length;g++)d=t(a[g],g),null!=d&&c.push(d);else for(g in a)d=t(a[g],g),null!=d&&c.push(d);return 0<c.length?b.fn.concat.apply([],c):c},b.each=function(a,b){var d;if(f(a))for(d=0;d<a.length&&!1!==b.call(a[d],d,a[d]);d++);else for(d in a)if(!1===b.call(a[d],d,a[d]))break;return a},b.grep=function(a,b){return z.call(a,b)},window.JSON&&(b.parseJSON=JSON.parse),b.fn={forEach:q.forEach,reduce:q.reduce,push:q.push,sort:q.sort,
  indexOf:q.indexOf,concat:q.concat,map:function(a){return b(b.map(this,function(b,d){return a.call(b,d,b)}))},slice:function(){return b(y.apply(this,arguments))},ready:function(a){return R.test(u.readyState)?a(b):u.addEventListener("DOMContentLoaded",function(){a(b)},!1),this},get:function(a){return a===m?y.call(this):this[a]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},
  each:function(a){return this.forEach(function(b,d){a.call(b,d,b)}),this},filter:function(a){return c(a)?this.not(this.not(a)):b(z.call(this,function(b){return r.matches(b,a)}))},add:function(a,c){return b(C(this.concat(b(a,c))))},is:function(a){return 0<this.length&&r.matches(this[0],a)},not:function(a){var t=[];if(c(a)&&a.call!==m)this.each(function(b){a.call(this,b)||t.push(this)});else{var d="string"==typeof a?this.filter(a):f(a)&&c(a.item)?y.call(a):b(a);this.forEach(function(a){0>d.indexOf(a)&&
  t.push(a)})}return b(t)},has:function(a){return this.filter(function(){return k(a)?b.contains(this,a):b(this).find(a).size()})},eq:function(a){return-1===a?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!k(a)?a:b(a)},last:function(){var a=this[this.length-1];return a&&!k(a)?a:b(a)},find:function(a){var c;return 1==this.length?c=b(r.qsa(this[0],a)):c=this.map(function(){return r.qsa(this,a)}),c},closest:function(a,c){for(var d=this[0];d&&!r.matches(d,a);)d=d!==c&&d!==u&&
  d.parentNode;return b(d)},parents:function(a){for(var c=[],d=this;0<d.length;)d=b.map(d,function(a){if((a=a.parentNode)&&a!==u&&0>c.indexOf(a))return c.push(a),a});return p(c,a)},parent:function(a){return p(C(this.pluck("parentNode")),a)},children:function(a){return p(this.map(function(){return l(this)}),a)},contents:function(){return this.map(function(){return y.call(this.childNodes)})},siblings:function(a){return p(this.map(function(a,b){return z.call(l(b.parentNode),function(a){return a!==b})}),
  a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return b.map(this,function(b){return b[a]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=null);if("none"==F(this,"").getPropertyValue("display")){var a=this.style,b;b=this.nodeName;var d,c;b=(E[b]||(d=u.createElement(b),u.body.appendChild(d),c=F(d,"").getPropertyValue("display"),d.parentNode.removeChild(d),"none"==c&&(c="block"),E[b]=c),E[b]);a.display=b}})},replaceWith:function(a){return this.before(a).remove()},
  wrap:function(a){var g=c(a);if(this[0]&&!g)var d=b(a).get(0),e=d.parentNode||1<this.length;return this.each(function(c){b(this).wrapAll(g?a.call(this,c):e?d.cloneNode(!0):d)})},wrapAll:function(a){if(this[0]){b(this[0]).before(a=b(a));for(var c;(c=a.children()).length;)a=c.first();b(a).append(this)}return this},wrapInner:function(a){var g=c(a);return this.each(function(d){var c=b(this),e=c.contents();d=g?a.call(this,d):a;e.length?e.wrapAll(d):c.append(d)})},unwrap:function(){return this.parent().each(function(){b(this).replaceWith(b(this).children())}),
  this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(a){return this.each(function(){var c=b(this);(a===m?"none"==c.css("display"):a)?c.show():c.hide()})},prev:function(a){return b(this.pluck("previousElementSibling")).filter(a||"*")},next:function(a){return b(this.pluck("nextElementSibling")).filter(a||"*")},html:function(a){return a===m?0<this.length?this[0].innerHTML:null:this.each(function(c){var d=this.innerHTML;
  b(this).empty().append(j(this,a,c,d))})},text:function(a){return a===m?0<this.length?this[0].textContent:null:this.each(function(){this.textContent=a})},attr:function(a,b){var c;return"string"==typeof a&&b===m?0==this.length||1!==this[0].nodeType?m:"value"==a&&"INPUT"==this[0].nodeName?this.val():!(c=this[0].getAttribute(a))&&a in this[0]?this[0][a]:c:this.each(function(c){if(1===this.nodeType)if(k(a))for(s in a){c=s;var d=a[s];null==d?this.removeAttribute(c):this.setAttribute(c,d)}else c=j(this,
  b,c,this.getAttribute(a)),null==c?this.removeAttribute(a):this.setAttribute(a,c)})},removeAttr:function(a){return this.each(function(){1===this.nodeType&&this.removeAttribute(a)})},prop:function(a,b){return b===m?this[0]?this[0][a]:m:this.each(function(c){this[a]=j(this,b,c,this[a])})},data:function(a,b){var c=this.attr("data-"+h(a),b);return null!==c?A(c):m},val:function(a){return a===m?0<this.length?this[0].multiple?b(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):
  this[0].value:m:this.each(function(b){this.value=j(this,a,b,this.value)})},offset:function(){if(0==this.length)return null;var a=this[0].getBoundingClientRect();return{left:a.left+window.pageXOffset,top:a.top+window.pageYOffset,width:a.width,height:a.height}},css:function(a,b){if(2>arguments.length&&"string"==typeof a)return 0==this.length?m:this[0].style[H(a)]||F(this[0],"").getPropertyValue(a);var c="";for(s in a)!a[s]&&0!==a[s]?this.each(function(){this.style.removeProperty(h(s))}):c+=h(s)+":"+
  ("number"==typeof a[s]&&!I[h(s)]?a[s]+"px":a[s])+";";return"string"==typeof a&&(!b&&0!==b?this.each(function(){this.style.removeProperty(h(a))}):c=h(a)+":"+("number"==typeof b&&!I[h(a)]?b+"px":b)),this.each(function(){this.style.cssText+=";"+c})},index:function(a){return a?this.indexOf(b(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return 1>this.length?!1:x(a).test(w(this[0]))},addClass:function(a){return this.each(function(c){g=[];var d=w(this);j(this,a,c,d).split(/\s+/g).forEach(function(a){b(this).hasClass(a)||
  g.push(a)},this);g.length&&w(this,d+(d?" ":"")+g.join(" "))})},removeClass:function(a){return this.each(function(b){if(a===m)return w(this,"");g=w(this);j(this,a,b,g).split(/\s+/g).forEach(function(a){g=g.replace(x(a)," ")});w(this,g.trim())})},toggleClass:function(a,c){return this.each(function(d){d=j(this,a,d,w(this));(c===m?!b(this).hasClass(d):c)?b(this).addClass(d):b(this).removeClass(d)})},scrollTop:function(){if(this.length)return"scrollTop"in this[0]?this[0].scrollTop:this[0].scrollY},position:function(){if(this.length){var a=
  this[0],c=this.offsetParent(),d=this.offset(),g=K.test(c[0].nodeName)?{top:0,left:0}:c.offset();return d.top-=parseFloat(b(a).css("margin-top"))||0,d.left-=parseFloat(b(a).css("margin-left"))||0,g.top+=parseFloat(b(c[0]).css("border-top-width"))||0,g.left+=parseFloat(b(c[0]).css("border-left-width"))||0,{top:d.top-g.top,left:d.left-g.left}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||u.body;a&&!K.test(a.nodeName)&&"static"==b(a).css("position");)a=a.offsetParent;
  return a})}},["width","height"].forEach(function(a){b.fn[a]=function(c){var d,g=a.replace(/./,function(a){return a[0].toUpperCase()});return c===m?this[0]==window?window["inner"+g]:this[0]==u?u.documentElement["offset"+g]:(d=this.offset())&&d[a]:this.each(function(d){var g=b(this);g.css(a,j(this,c,d,g[a]()))})}}),["after","prepend","before","append"].forEach(function(a,c){var d=c%2;b.fn[a]=function(){var a=b.map(arguments,function(a){return k(a)?a:r.fragment(a)}),g,e=1<this.length;return 1>a.length?
  this:this.each(function(q,f){g=d?f:f.parentNode;f=0==c?f.nextSibling:1==c?f.firstChild:2==c?f:null;a.forEach(function(a){if(e)a=a.cloneNode(!0);else if(!g)return b(a).remove();B(g.insertBefore(a,f),function(a){null!=a.nodeName&&"SCRIPT"===a.nodeName.toUpperCase()&&(!a.type||"text/javascript"===a.type)&&!a.src&&window.eval.call(window,a.innerHTML)})})})};b.fn[d?a+"To":"insert"+(c?"Before":"After")]=function(c){return b(c)[a](this),this}}),r.Z.prototype=b.fn,r.uniq=C,r.deserializeValue=A,b.zepto=r,
  b}();window.Zepto=Zepto;"$"in window||(window.$=Zepto);
  (function(c){function k(b){return b._zid||(b._zid=p++)}function v(b,c,q,f){c=e(c);if(c.ns)var l=RegExp("(?:^| )"+c.ns.replace(" "," .* ?")+"(?: |$)");return(n[k(b)]||[]).filter(function(b){return b&&(!c.e||b.e==c.e)&&(!c.ns||l.test(b.ns))&&(!q||k(b.fn)===k(q))&&(!f||b.sel==f)})}function e(b){b=(""+b).split(".");return{e:b[0],ns:b.slice(1).sort().join(" ")}}function f(b,g,e){c.isObject(b)?c.each(b,e):b.split(/\s/).forEach(function(b){e(b,g)})}function h(b,g,q,l,h,m){var j=k(b),p=n[j]||(n[j]=[]);f(g,
  q,function(g,q){var f=e(g);f.fn=q;f.sel=l;f.e in w&&(q=function(b){var g=b.relatedTarget;if(!g||g!==this&&!c.contains(this,g))return f.fn.apply(this,arguments)});f.del=h&&h(q,g);var j=f.del||q;f.proxy=function(c){var g=j.apply(b,[c].concat(c.data));return!1===g&&(c.preventDefault(),c.stopPropagation()),g};f.i=p.length;p.push(f);b.addEventListener(w[f.e]||f.e,f.proxy,f.del&&("focus"==f.e||"blur"==f.e)||!!m)})}function x(b,c,e,l,j){var h=k(b);f(c||"",e,function(c,g){v(b,c,g,l).forEach(function(c){delete n[h][c.i];
  b.removeEventListener(w[c.e]||c.e,c.proxy,c.del&&("focus"==c.e||"blur"==c.e)||!!j)})})}function l(b){var g,e={originalEvent:b};for(g in b)!m.test(g)&&void 0!==b[g]&&(e[g]=b[g]);return c.each(s,function(c,g){e[c]=function(){return this[g]=A,b[c].apply(b,arguments)};e[g]=B}),e}var n={},p=1,j={},w={mouseenter:"mouseover",mouseleave:"mouseout"};j.click=j.mousedown=j.mouseup=j.mousemove="MouseEvents";c.event={add:h,remove:x};c.proxy=function(b,g){if(c.isFunction(b)){var e=function(){return b.apply(g,arguments)};
  return e._zid=k(b),e}if("string"==typeof g)return c.proxy(b[g],b);throw new TypeError("expected function");};c.fn.bind=function(b,c){return this.each(function(){h(this,b,c)})};c.fn.unbind=function(b,c){return this.each(function(){x(this,b,c)})};c.fn.one=function(b,c){return this.each(function(e,f){h(this,b,c,null,function(b,c){return function(){var g=b.apply(f,arguments);return x(f,c,b),g}})})};var A=function(){return!0},B=function(){return!1},m=/^([A-Z]|layer[XY]$)/,s={preventDefault:"isDefaultPrevented",
  stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};c.fn.delegate=function(b,g,e){return this.each(function(f,j){h(j,g,e,b,function(g){return function(e){var f,q=c(e.target).closest(b,j).get(0);if(q)return f=c.extend(l(e),{currentTarget:q,liveFired:j}),g.apply(q,[f].concat([].slice.call(arguments,1)))}})})};c.fn.undelegate=function(b,c,e){return this.each(function(){x(this,c,e,b)})};c.fn.live=function(b,g){return c(document.body).delegate(this.selector,
  b,g),this};c.fn.die=function(b,g){return c(document.body).undelegate(this.selector,b,g),this};c.fn.on=function(b,g,e){return!g||c.isFunction(g)?this.bind(b,g||e):this.delegate(g,b,e)};c.fn.off=function(b,g,e){return!g||c.isFunction(g)?this.unbind(b,g||e):this.undelegate(g,b,e)};c.fn.trigger=function(b,g){if("string"==typeof b||c.isPlainObject(b))b=c.Event(b);var e=b;if(!("defaultPrevented"in e)){e.defaultPrevented=!1;var f=e.preventDefault;e.preventDefault=function(){this.defaultPrevented=!0;f.call(this)}}return b.data=
  g,this.each(function(){"dispatchEvent"in this&&this.dispatchEvent(b)})};c.fn.triggerHandler=function(b,g){var e,f;return this.each(function(j,h){e=l("string"==typeof b?c.Event(b):b);e.data=g;e.target=h;c.each(v(h,b.type||b),function(b,c){f=c.proxy(e);if(e.isImmediatePropagationStopped())return!1})}),f};"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(b){c.fn[b]=
  function(c){return c?this.bind(b,c):this.trigger(b)}});["focus","blur"].forEach(function(b){c.fn[b]=function(c){return c?this.bind(b,c):this.each(function(){try{this[b]()}catch(c){}}),this}});c.Event=function(b,c){"string"!=typeof b&&(c=b,b=c.type);var e=document.createEvent(j[b]||"Events"),f=!0;if(c)for(var l in c)"bubbles"==l?f=!!c[l]:e[l]=c[l];return e.initEvent(b,f,!0,null,null,null,null,null,null,null,null,null,null,null,null),e.isDefaultPrevented=function(){return this.defaultPrevented},e}})(Zepto);
  (function(c){function k(l,n){var p=l[x],p=p&&e[p];if(void 0===n)return p||v(l);if(p){if(n in p)return p[n];var j=h(n);if(j in p)return p[j]}return f.call(c(l),n)}function v(f,n,p){var j=f[x]||(f[x]=++c.uuid),w;if(!(w=e[j])){w=e;var k={};f=(c.each(f.attributes,function(e,f){0==f.name.indexOf("data-")&&(k[h(f.name.replace("data-",""))]=c.zepto.deserializeValue(f.value))}),k);w=w[j]=f}j=w;return void 0!==n&&(j[h(n)]=p),j}var e={},f=c.fn.data,h=c.camelCase,x=c.expando="Zepto"+ +new Date;c.fn.data=function(e,
  f){return void 0===f?c.isPlainObject(e)?this.each(function(f,j){c.each(e,function(c,e){v(j,c,e)})}):0==this.length?void 0:k(this[0],e):this.each(function(){v(this,e,f)})};c.fn.removeData=function(f){return"string"==typeof f&&(f=f.split(/\s+/)),this.each(function(){var n=this[x],p=n&&e[n];p&&c.each(f,function(){delete p[h(this)]})})}})(Zepto);!function(c){var k=function(){this.defined="undefined"!==typeof localStorage};k.prototype={constructor:k,get:function(c,f){return localStorage.getItem(c)?localStorage.getItem(c):"undefined"!==typeof f?f:null},has:function(c){return localStorage.getItem(c)?!0:!1},set:function(c,f,h){"string"===typeof f&&(""===f?this.destroy(c):localStorage.setItem(c,f));return"function"===typeof h?h():!0},destroy:function(c,f){localStorage.removeItem(c);return"function"===typeof f?f():!0},clean:function(c){for(var f=
  localStorage.length-1;0<=f;f--)"undefined"===typeof Array.indexOf&&-1!==localStorage.key(f).indexOf("garlic:")&&localStorage.removeItem(localStorage.key(f));return"function"===typeof c?c():!0},clear:function(c){localStorage.clear();return"function"===typeof c?c():!0}};var v=function(c,f,h){this.init("garlic",c,f,h)};v.prototype={constructor:v,init:function(e,f,h,k){this.type=e;this.$element=c(f);this.options=this.getOptions(k);this.storage=h;this.path=this.options.getPath(this.$element)||this.getPath();
  this.parentForm=this.$element.closest("form");this.$element.addClass("garlic-auto-save");this.expiresFlag=!this.options.expires?!1:(this.$element.data("expires")?this.path:this.getPath(this.parentForm))+"_flag";this.$element.on(this.options.events.join("."+this.type+" "),!1,c.proxy(this.persist,this));if(this.options.destroy)c(this.parentForm).on("submit reset",!1,c.proxy(this.destroy,this));this.retrieve()},getOptions:function(e){return c.extend({},c.fn[this.type].defaults,e,this.$element.data())},
  persist:function(){this.val!==this.getVal()&&(this.val=this.getVal(),this.options.expires&&this.storage.set(this.expiresFlag,((new Date).getTime()+1E3*this.options.expires).toString()),this.storage.set(this.path,this.getVal()))},getVal:function(){return!this.$element.is("input[type=checkbox]")?this.$element.val():this.$element.prop("checked")?"checked":"unchecked"},retrieve:function(){if(this.storage.has(this.path)){if(this.options.expires){var c=(new Date).getTime();if(this.storage.get(this.expiresFlag)<
  c.toString()){this.storage.destroy(this.path);return}this.$element.attr("expires-in",Math.floor((parseInt(this.storage.get(this.expiresFlag))-c)/1E3))}c=this.storage.get(this.path);if(this.options.conflictManager.enabled&&this.detectConflict())return this.conflictManager();if(this.$element.is("input[type=radio], input[type=checkbox]")){if("checked"===c||this.$element.val()===c)return this.$element.attr("checked",!0);"unchecked"===c&&this.$element.attr("checked",!1)}else this.$element.val(c),this.options.onRetrieve(this.$element,
  c)}},detectConflict:function(){var e=this;if(this.$element.is("input[type=checkbox], input[type=radio]"))return!1;if(this.$element.val()&&this.storage.get(this.path)!==this.$element.val()){if(this.$element.is("select")){var f=!1;this.$element.find("option").each(function(){0!==c(this).index()&&(c(this).attr("selected")&&c(this).val()!==e.storage.get(this.path))&&(f=!0)});return f}return!0}return!1},conflictManager:function(){if("function"===typeof this.options.conflictManager.onConflictDetected&&
  !this.options.conflictManager.onConflictDetected(this.$element,this.storage.get(this.path)))return!1;this.options.conflictManager.garlicPriority?(this.$element.data("swap-data",this.$element.val()),this.$element.data("swap-state","garlic"),this.$element.val(this.storage.get(this.path))):(this.$element.data("swap-data",this.storage.get(this.path)),this.$element.data("swap-state","default"));this.swapHandler();this.$element.addClass("garlic-conflict-detected");this.$element.closest("input[type=submit]").attr("disabled",
  !0)},swapHandler:function(){var e=c(this.options.conflictManager.template);this.$element.after(e.text(this.options.conflictManager.message));e.on("click",!1,c.proxy(this.swap,this))},swap:function(){var e=this.$element.data("swap-data");this.$element.data("swap-state","garlic"===this.$element.data("swap-state")?"default":"garlic");this.$element.data("swap-data",this.$element.val());c(this.$element).val(e)},destroy:function(){this.storage.destroy(this.path)},remove:function(){this.remove();this.$element.is("input[type=radio], input[type=checkbox]")?
  c(this.$element).prop("checked",!1):this.$element.val("")},getPath:function(e){"undefined"===typeof e&&(e=this.$element);if(this.options.getPath(e))return this.options.getPath(e);if(1!=e.length)return!1;for(var f="",h=e.is("input[type=checkbox]"),k=e;k.length;){e=k[0];var l=e.nodeName;if(!l)break;var l=l.toLowerCase(),k=k.parent(),n=k.children(l);if(c(e).is("form, input, select, textarea")||h)if(l+=c(e).attr("name")?"."+c(e).attr("name"):"",1<n.length&&!c(e).is("input[type=radio]")&&(l+=":eq("+n.index(e)+
  ")"),f=l+(f?">"+f:""),"form"==e.nodeName.toLowerCase())break}return"garlic:"+document.domain+(this.options.domain?"*":window.location.pathname)+">"+f},getStorage:function(){return this.storage}};c.fn.garlic=function(e,f){function h(f){var j=c(f),h=j.data("garlic"),k=c.extend({},x,j.data());if(("undefined"===typeof k.storage||k.storage)&&"password"!==c(f).attr("type"))if(h||j.data("garlic",h=new v(f,l,k)),"string"===typeof e&&"function"===typeof h[e])return h[e]()}var x=c.extend(!0,{},c.fn.garlic.defaults,
  e,this.data()),l=new k,n=!1;if(!l.defined)return!1;this.each(function(){c(this).is("form")?c(this).find(x.inputs).each(function(){n=h(c(this))}):c(this).is(x.inputs)&&(n=h(c(this)))});return"function"===typeof f?f():n};c.fn.garlic.Constructor=v;c.fn.garlic.defaults={destroy:!0,inputs:"input, textarea, select",events:"DOMAttrModified textInput input change click keypress paste focus".split(" "),domain:!1,expires:!1,conflictManager:{enabled:!1,garlicPriority:!0,template:'<span class="garlic-swap"></span>',
  message:"This is your saved data. Click here to see default one",onConflictDetected:function(){return!0}},getPath:function(){},onRetrieve:function(){}};c(window).on("load",function(){c('[data-persist="garlic"]').each(function(){c(this).garlic()})})}(window.jQuery||window.Zepto);
  