{"size": 91557, "ext": "js", "max_stars_repo_path": "ydn.db/ydn.db-isw-crud.js", "max_stars_repo_name": "jivesoftware/ydn-db-custom", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "ydn.db/ydn.db-isw-crud.js", "max_issues_repo_name": "jivesoftware/ydn-db-custom", "max_issues_repo_issues_event_min_datetime": "2016-02-02T12:37:06.000Z", "max_issues_repo_issues_event_max_datetime": "2016-02-02T12:37:06.000Z", "max_forks_repo_path": "ydn.db/ydn.db-isw-crud.js", "max_forks_repo_name": "jivesoftware/ydn-db-custom", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 446.6195121951, "max_line_length": 1751, "alphanum_fraction": 0.6367727208}
(function (name, definition, context) {if (typeof context['module'] !== 'undefined' && context['module']['exports']) {context['module']['exports'] = definition.apply(context);}else if (typeof context['define'] !== 'undefined' && context['define'] === 'function' && context['define']['amd']) {define(name, [], definition);}else {context[name] = definition();}})('ydn', function () {var l,q=this;function r(a){return void 0!==a}
function aa(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function v(a){return"array"==aa(a)}function y(a){var b=aa(a);return"array"==b||"object"==b&&"number"==typeof a.length}function z(a){return"string"==typeof a}function ba(a){return"boolean"==typeof a}function A(a){return"number"==typeof a}function ca(a){return"function"==aa(a)}function B(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function da(a,b,c){return a.call.apply(a.bind,arguments)}
function ea(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function fa(a,b,c){fa=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?da:ea;return fa.apply(null,arguments)}var ha=Date.now||function(){return+new Date};
function ia(a,b){var c=a.split("."),d=q;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&r(b)?d[e]=b:d[e]?d=d[e]:d=d[e]={}}function C(a,b){function c(){}c.prototype=b.prototype;a.G=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.lb=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}};function ja(a){a.prototype.then=a.prototype.then;a.prototype.$goog_Thenable=!0}function ka(a){if(!a)return!1;try{return!!a.$goog_Thenable}catch(b){return!1}};function E(a){if(Error.captureStackTrace)Error.captureStackTrace(this,E);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))}C(E,Error);E.prototype.name="CustomError";function ma(a){for(var b=0;1>b;b++)if('"'==a.charAt(0)&&'"'==a.charAt(a.length-1))return a.substring(1,a.length-1);return a}var na={"\x00":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"\\":"\\\\"},oa={"'":"\\'"};
function pa(a){a=String(a);if(a.quote)return a.quote();for(var b=['"'],c=0;c<a.length;c++){var d=a.charAt(c),e=d.charCodeAt(0),f=c+1,g;if(!(g=na[d])){if(!(31<e&&127>e))if(d in oa)d=oa[d];else if(d in na)d=oa[d]=na[d];else{e=d;g=d.charCodeAt(0);if(31<g&&127>g)e=d;else{if(256>g){if(e="\\x",16>g||256<g)e+="0"}else e="\\u",4096>g&&(e+="0");e+=g.toString(16).toUpperCase()}d=oa[d]=e}g=d}b[f]=g}b.push('"');return b.join("")};var qa=Array.prototype,ra=qa.indexOf?function(a,b,c){return qa.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(z(a))return z(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},sa=qa.map?function(a,b,c){return qa.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),f=z(a)?a.split(""):a,g=0;g<d;g++)g in f&&(e[g]=b.call(c,f[g],g,a));return e},ta=qa.some?function(a,b,c){return qa.some.call(a,b,c)}:function(a,b,c){for(var d=
a.length,e=z(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return!0;return!1};function ua(a,b){var c=va(a,b,void 0);return 0>c?null:z(a)?a.charAt(c):a[c]}function va(a,b,c){for(var d=a.length,e=z(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return f;return-1}function wa(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]}
function xa(a,b){if(!y(a)||!y(b)||a.length!=b.length)return!1;for(var c=a.length,d=ya,e=0;e<c;e++)if(!d(a[e],b[e]))return!1;return!0}function ya(a,b){return a===b};var za;a:{var Aa=q.navigator;if(Aa){var Ba=Aa.userAgent;if(Ba){za=Ba;break a}}za=""}function F(a){return-1!=za.indexOf(a)};function Ca(a,b){for(var c=y(b),d=c?b:arguments,c=c?0:1;c<d.length&&(a=a[d[c]],r(a));c++);return a};function Da(a){q.setTimeout(function(){throw a;},0)}var Ea;
function Fa(){var a=q.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&(a=function(){var a=document.createElement("iframe");a.style.display="none";a.src="";document.documentElement.appendChild(a);var b=a.contentWindow,a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),d="file:"==b.location.protocol?"*":b.location.protocol+"//"+b.location.host,a=fa(function(a){if(("*"==d||a.origin==d)&&a.data==c)this.port1.onmessage()},
this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof a&&!F("Trident")&&!F("MSIE")){var b=new a,c={},d=c;b.port1.onmessage=function(){if(r(c.next)){c=c.next;var a=c.Ga;c.Ga=null;a()}};return function(a){d.next={Ga:a};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("script")?function(a){var b=document.createElement("script");b.onreadystatechange=function(){b.onreadystatechange=
null;b.parentNode.removeChild(b);b=null;a();a=null};document.documentElement.appendChild(b)}:function(a){q.setTimeout(a,0)}};function Ga(a,b){Ha||Ia();Ja||(Ha(),Ja=!0);Ka.push(new La(a,b))}var Ha;function Ia(){if(q.Promise&&q.Promise.resolve){var a=q.Promise.resolve();Ha=function(){a.then(Ma)}}else Ha=function(){var a=Ma;!ca(q.setImmediate)||q.Window&&q.Window.prototype.setImmediate==q.setImmediate?(Ea||(Ea=Fa()),Ea(a)):q.setImmediate(a)}}var Ja=!1,Ka=[];function Ma(){for(;Ka.length;){var a=Ka;Ka=[];for(var b=0;b<a.length;b++){var c=a[b];try{c.a.call(c.b)}catch(d){Da(d)}}}Ja=!1}function La(a,b){this.a=a;this.b=b};function Na(a,b){this.b=Oa;this.g=void 0;this.a=this.c=null;this.d=this.e=!1;try{var c=this;a.call(b,function(a){Pa(c,Qa,a)},function(a){Pa(c,Sa,a)})}catch(d){Pa(this,Sa,d)}}var Oa=0,Qa=2,Sa=3;Na.prototype.then=function(a,b,c){return Ta(this,ca(a)?a:null,ca(b)?b:null,c)};ja(Na);function Ua(a){a.b==Oa&&Ga(function(){var a=new Va(void 0);Wa(this,a)},a)}
function Wa(a,b){if(a.b==Oa)if(a.c){var c=a.c;if(c.a){for(var d=0,e=-1,f=0,g;g=c.a[f];f++)if(g=g.S)if(d++,g==a&&(e=f),0<=e&&1<d)break;0<=e&&(c.b==Oa&&1==d?Wa(c,b):(d=c.a.splice(e,1)[0],Xa(c,d,Sa,b)))}}else Pa(a,Sa,b)}function Ya(a,b){a.a&&a.a.length||a.b!=Qa&&a.b!=Sa||Za(a);a.a||(a.a=[]);a.a.push(b)}
function Ta(a,b,c,d){var e={S:null,Ka:null,La:null};e.S=new Na(function(a,g){e.Ka=b?function(c){try{var e=b.call(d,c);a(e)}catch(m){g(m)}}:a;e.La=c?function(b){try{var e=c.call(d,b);!r(e)&&b instanceof Va?g(b):a(e)}catch(m){g(m)}}:g});e.S.c=a;Ya(a,e);return e.S}Na.prototype.i=function(a){this.b=Oa;Pa(this,Qa,a)};Na.prototype.k=function(a){this.b=Oa;Pa(this,Sa,a)};
function Pa(a,b,c){if(a.b==Oa){if(a==c)b=Sa,c=new TypeError("Promise cannot resolve to itself");else{if(ka(c)){a.b=1;c.then(a.i,a.k,a);return}if(B(c))try{var d=c.then;if(ca(d)){$a(a,c,d);return}}catch(e){b=Sa,c=e}}a.g=c;a.b=b;Za(a);b!=Sa||c instanceof Va||ab(a,c)}}function $a(a,b,c){function d(b){f||(f=!0,a.k(b))}function e(b){f||(f=!0,a.i(b))}a.b=1;var f=!1;try{c.call(b,e,d)}catch(g){d(g)}}function Za(a){a.e||(a.e=!0,Ga(a.m,a))}
Na.prototype.m=function(){for(;this.a&&this.a.length;){var a=this.a;this.a=[];for(var b=0;b<a.length;b++)Xa(this,a[b],this.b,this.g)}this.e=!1};function Xa(a,b,c,d){if(c==Qa)b.Ka(d);else{if(b.S)for(;a&&a.d;a=a.c)a.d=!1;b.La(d)}}function ab(a,b){a.d=!0;Ga(function(){a.d&&bb.call(null,b)})}var bb=Da;function Va(a){E.call(this,a)}C(Va,E);Va.prototype.name="cancel";/*
 Portions of this code are from MochiKit, received by
 The Closure Authors under the MIT license. All other code is Copyright
 2005-2009 The Closure Authors. All Rights Reserved.
*/
function G(a,b){this.k=[];this.Ia=b||null;this.b=this.c=!1;this.d=void 0;this.Ma=this.I=this.m=!1;this.g=0;this.i=null;this.V=0}l=G.prototype;l.Z=function(a,b){this.m=!1;cb(this,a,b)};function cb(a,b,c){a.c=!0;a.d=c;a.b=!b;a.sa()}function db(a){if(a.c){if(!a.Ma)throw new eb;a.Ma=!1}}l.callback=function(a){db(this);cb(this,!0,a)};l.h=function(a){db(this);cb(this,!1,a)};l.F=function(a,b){return fb(this,a,null,b)};l.Fa=function(a,b){return fb(this,null,a,b)};l.Ea=function(a,b){return fb(this,a,a,b)};
function fb(a,b,c,d){a.k.push([b,c,d]);a.c&&a.sa();return a}l.then=function(a,b,c){var d,e,f=new Na(function(a,b){d=a;e=b});fb(this,d,function(a){e(a)});return f.then(a,b,c)};ja(G);function jb(a){return ta(a.k,function(a){return ca(a[1])})}
G.prototype.sa=function(){this.g&&this.c&&jb(this)&&(kb(this.g),this.g=0);this.i&&(this.i.V--,delete this.i);for(var a=this.d,b=!1,c=!1;this.k.length&&!this.m;){var d=this.k.shift(),e=d[0],f=d[1],d=d[2];if(e=this.b?f:e)try{var g=e.call(d||this.Ia,a);r(g)&&(this.b=this.b&&(g==a||g instanceof Error),this.d=a=g);ka(a)&&(this.m=c=!0)}catch(h){a=h,this.b=!0,jb(this)||(b=!0)}}this.d=a;c&&(c=fa(this.Z,this,!0),g=fa(this.Z,this,!1),a instanceof G?(fb(a,c,g),a.I=!0):a.then(c,g));b&&(a=new lb(a),mb[a.da]=a,
this.g=a.da)};function eb(){E.call(this)}C(eb,E);eb.prototype.message="Deferred has already fired";eb.prototype.name="AlreadyCalledError";function lb(a){this.da=q.setTimeout(fa(this.b,this),0);this.a=a}lb.prototype.b=function(){delete mb[this.da];throw this.a;};var mb={};function kb(a){var b=mb[a];b&&(q.clearTimeout(b.da),delete mb[a])};function H(a){E.call(this,a);this.name="ydn.error.ArgumentException"}C(H,E);function nb(a){E.call(this,a);this.name="ydn.error.NotSupportedException"}C(nb,E);function ob(a){E.call(this,a);this.name="ydn.error.NotImplementedException"}C(ob,E);function pb(a){E.call(this,a);this.name="ydn.error.InvalidOperationException"}C(pb,E);function qb(a){Error.captureStackTrace?Error.captureStackTrace(this,qb):this.stack=Error().stack||"";a&&(this.message=String(a));this.name="ydn.error.InternalError"}C(qb,Error);
qb.prototype.name="ydn.error.InternalError";var rb=F("Opera")||F("OPR"),sb=F("Trident")||F("MSIE"),tb=F("Gecko")&&-1==za.toLowerCase().indexOf("webkit")&&!(F("Trident")||F("MSIE")),ub=-1!=za.toLowerCase().indexOf("webkit");ub&&F("Mobile");F("Macintosh");F("Windows");F("Linux");var vb=q.navigator||null;vb&&(vb.appVersion||"").indexOf("X11");F("Android");!F("iPhone")||F("iPod")||F("iPad");F("iPad");
(function(){var a="",b;if(rb&&q.opera)return a=q.opera.version,ca(a)?a():a;tb?b=/rv\:([^\);]+)(\)|;)/:sb?b=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:ub&&(b=/WebKit\/(\S+)/);b&&(a=(a=b.exec(za))?a[1]:"");return sb&&(b=(b=q.document)?b.documentMode:void 0,b>parseFloat(a))?String(b):a})();function wb(){}function xb(){};function yb(){}function zb(){};function K(a,b){G.call(this,0,b);this.e=[]}C(K,G);K.prototype.Za=function(a,b){this.e.push([a,b]);return this};K.prototype.callback=function(a){this.e.length=0;K.G.callback.call(this,a)};K.prototype.h=function(a){this.e.length=0;K.G.h.call(this,a)};K.prototype.ab=function(){return this};var Ab={READ_ONLY:"readonly",READ_WRITE:"readwrite",VERSION_CHANGE:"versionchange"},Bb=Ab.READ_ONLY,L=Ab.READ_WRITE,Cb=Ab.VERSION_CHANGE,Db=q.indexedDB||q.mozIndexedDB||q.webkitIndexedDB||q.moz_indexedDB||q.msIndexedDB;G.prototype.done=G.prototype.F;G.prototype.fail=G.prototype.Fa;G.prototype.always=G.prototype.Ea;K.prototype.then=K.prototype.then;function Eb(a,b){var c,d;2==arguments.length&&z(arguments[1])?(c=!0,d=arguments[1].split(".")):d=(c=y(b))?b:arguments;for(c=c?0:1;c<d.length&&(a=a[d[c]],r(a));c++);return a}var Fb={};
function Gb(a){var b=[a];a=new Hb;for(var c=0,d,e;void 0!==(e=b.pop());){0===c%4&&12<c+4&&(a.write(c),c=0);d=typeof e;if(e instanceof Array)if(c+=4,0<e.length){b.push(Fb);for(d=e.length;d--;)b.push(e[d]);continue}else a.write(c);else if("number"===d)c+=1,a.write(c),Ib(a,e);else if(e instanceof Date)c+=2,a.write(c),Ib(a,e.valueOf());else if("string"===d){c+=3;a.write(c);c=a;for(d=0;d<e.length;d++){var f=e.charCodeAt(d);126>=f?c.write(f+1):16510>=f?(f-=127,c.write(128|f>>8,f&255)):c.write(192|f>>10,
f>>2|255,(f|3)<<6)}c.write(0)}else if(e===Fb)a.write(0);else return"";c=0}for(b=a.a.length;"00"===a.a[--b];);a.a.length=++b;return a.toString()}function Jb(a){for(var b=[],c=b,d=[],e,f,g=new Kb(a);null!=Lb(g);)if(0===g.a)c=d.pop();else{if(null===g.a)break;do{e=g.a/4|0;a=g.a%4;for(var h=0;h<e;h++)f=[],c.push(f),d.push(c),c=f;if(0===a&&12<g.a+4)Lb(g);else break}while(1);1===a?c.push(Mb(g)):2===a?c.push(new Date(Mb(g))):3===a?c.push(Nb(g)):0===a&&(c=d.pop())}return b[0]}
function Ib(a,b){var c,d,e;c=b;var f=e=d=0;if(0!==c)if(isFinite(c)){0>c&&(d=1,c=-c);f=0;if(2.2250738585072014E-308<=c){for(e=c;1>e;)f--,e*=2;for(;2<=e;)f++,e/=2;e=f+1023}f=e?Math.floor(4503599627370496*(c/Math.pow(2,f)-1)):Math.floor(c/4.9E-324)}else e=2047,isNaN(c)?f=0x8000000000000:-Infinity===c&&(d=1);c=d;d=e;e=f;c&&(e=0xfffffffffffff-e,d=2047-d);a.write((c?0:128)|d>>4);a.write((d&15)<<4|0|e/281474976710656);e%=281474976710656;c=0|e/4294967296;a.write(c>>8,c&255);e%=4294967296;c=0|e/65536;a.write(c>>
8,c&255);c=e%65536;a.write(c>>8,c&255)}function Mb(a){var b=Lb(a)|0,c=b>>7?!1:!0,d=c?-1:1,e=(b&127)<<4,b=Lb(a)|0,e=e+(b>>4);c&&(e=2047-e);for(var b=[c?15-(b&15):b&15],f=6;f--;)b.push(c?255-(Lb(a)|0):Lb(a)|0);a=0;for(f=7;f--;)a=a/256+b[f];a/=16;return 0===a&&0===e?0:(a+1)*Math.pow(2,e-1023)*d}
function Nb(a){for(var b=[],c=0,d=0,e=0,f,g;;){f=Lb(a);if(0===f||null==f)break;0===c?(g=f>>6,2>g&&!isNaN(f)?b.push(String.fromCharCode(f-1)):(c=g,d=f<<10,e++)):2===c?(b.push(String.fromCharCode(d+f+127)),c=d=e=0):2===e?(d+=f<<2,e++):(b.push(String.fromCharCode(d|f>>6)),c=d=e=0)}return b.join("")}function Kb(a){this.a=null;this.b=a;this.c=this.b.length-1;this.index=-1}function Lb(a){return a.a=a.index<a.c?parseInt(a.b.charAt(++a.index)+a.b.charAt(++a.index),16):null}
function Hb(){this.a=[];this.b=void 0}Hb.prototype.write=function(a){for(var b=0;b<arguments.length;b++)this.b=arguments[b].toString(16),this.a.push(2===this.b.length?this.b:this.b="0"+this.b)};Hb.prototype.toString=function(){return this.a.length?this.a.join(""):""};function Ob(a,b){var c=Gb(a),d=Gb(b);return c>d?1:c==d?0:-1};function M(a,b,c){K.call(this,0,c);this.w=a;this.e=[];this.p=[];this.Na=[];this.a=null;this.O="";this.ga=0}C(M,K);l=M.prototype;l.O="";l.logger=null;function Pb(a,b,c){a.a=b;a.O=c;if(b){for(c=0;c<a.p.length;c++)a.p[c][0].call(a.p[c][1],b);a.p.length=0}}function Qb(a){var b=new M(a.w);a.ga++;Pb(b,a.a,a.O+"C"+a.ga);return b}l.Ra=function(){return!!this.a};
l.abort=function(){if(this.a)if(ca(this.a.abort))this.a.abort();else if(ca(this.a.executeSql))this.a.executeSql("ABORT",[],function(){},function(){return!0});else throw new nb;else throw new Rb("");};function N(a,b,c){var d=a.Na.shift();c=!!c;d?d[0].call(d[1],b,c,function(b,c){N(a,b,c)}):c?a.h(b):a.callback(b)}function Sb(a,b,c){a.Na.push([b,c])}function O(a,b,c){a.a?b.call(c,a.a):a.p.push([b,c])}l.callback=function(a){M.G.callback.call(this,a)};l.h=function(a){M.G.h.call(this,a)};
function Tb(a){var b="";a.O&&(b=a.a?"*":"",b="["+a.O+b+"]");return a.w+b}function Ub(a,b){var c=new M(a);N(c,b);return c}l.toString=function(){return"Request:"+Tb(this)};
l.sa=function(){this.g&&this.c&&jb(this)&&(kb(this.g),this.g=0);this.i&&(this.i.V--,delete this.i);for(var a=this.d,b=!1;this.k.length&&!this.m;){var c=this.k.shift(),d=c[0],e=c[1],c=c[2];if(d=this.b?e:d)d=d.call(c||this.Ia,a),r(d)&&(this.b=this.b&&(d==a||d instanceof Error),this.d=a=d),ka(a)&&(this.m=b=!0)}this.d=a;b&&(b=fa(this.Z,this,!0),d=fa(this.Z,this,!1),a instanceof G?(fb(a,b,d),a.I=!0):a.then(b,d))};
l.toJSON=function(){var a=(this.O||"").match(/B(\d+)T(\d+)(?:Q(\d+?))?(?:R(\d+))?/)||[];return{method:this.w?this.w.split(":"):[],branchNo:parseFloat(a[1]),transactionNo:parseFloat(a[2]),queueNo:parseFloat(a[3]),requestNo:parseFloat(a[4])}};var Vb=Db&&Db.cmp?fa(Db.cmp,Db):Ob,Wb=[];function Xb(a,b){this.type=a;this.target=b}Xb.prototype.preventDefault=function(){};function Yb(a,b){Xb.call(this,a,b)}C(Yb,Xb);Yb.prototype.a=function(){return this.b};function Zb(a,b,c,d,e){Xb.call(this,a,b);this.version=c;this.Oa=d;this.Ja=e}C(Zb,Yb);l=Zb.prototype;l.name="ReadyEvent";l.version=NaN;l.Oa=NaN;l.Ja=null;l.jb=function(){return this.version};l.Wa=function(){return this.Oa};l.Va=function(){return this.Ja};function $b(a,b,c){Xb.call(this,c||"error",a);this.error=b}C($b,Yb);$b.prototype.toString=function(){return this.name+":"+(this.error?this.error:"")};
$b.prototype.name="ErrorEvent";$b.prototype.error=null;$b.prototype.c=function(){return this.error};function ac(a,b){$b.call(this,a,b,"fail")}C(ac,$b);ac.prototype.name="FailEvent";function P(a,b,c){var d;if(B(a))d=a.store,b=a.id,null!=a.parent&&(c=new P(a.parent));else if(r(b))d=a;else if(d=a.lastIndexOf("^|"),b=a,0<d&&(b=a.substr(d),c=new P(a.substring(0,d))),b=b.split("^:"),d=b[0],b=b[1],!r(b))throw Error("Invalid key value: "+a);this.b=d;this.a=b;this.parent=c||null}l=P.prototype;l.toJSON=function(){var a={store:this.b,id:this.a};this.parent&&(a.parent=this.parent.toJSON());return a};l.valueOf=function(){return(this.parent?this.parent.valueOf()+"^|":"")+this.b+"^:"+this.a};
l.toString=function(){return this.valueOf().replace("^|","|").replace("^:",":")};l.hb=function(){return this.b};l.Ta=function(){return this.a};function bc(a){return v(a.a)?a.a.join("^|"):a.a instanceof Date?+a.a:a.a}l.gb=function(){return this.parent};function cc(a){if(y(a)){for(var b=[],c=0,d=a.length;c<d;c++)b[c]=a[c];return b}return a};function Q(a,b,c,d){a>b&&(b=a=void 0);null===a&&(a=void 0);null===b&&(b=void 0);this.lower=a;this.upper=b;this.lowerOpen=!!c;this.upperOpen=!!d}Q.prototype.lower=void 0;Q.prototype.upper=void 0;Q.prototype.toJSON=function(){var a;a=this||{};return{lower:a.lower,upper:a.upper,lowerOpen:a.lowerOpen,upperOpen:a.upperOpen}};function dc(a){return ec(a)}Q.only=function(a){return new Q(a,a,!1,!1)};Q.bound=function(a,b,c,d){return new Q(a,b,c,d)};Q.upperBound=function(a,b){return new Q(void 0,a,void 0,!!b)};
Q.lowerBound=function(a,b){return new Q(a,void 0,!!b,void 0)};function ec(a){return null!=a?null!=a.upper&&null!=a.lower?fc.bound(a.lower,a.upper,!!a.lowerOpen,!!a.upperOpen):null!=a.upper?fc.upperBound(a.upper,a.upperOpen):null!=a.lower?fc.lowerBound(a.lower,a.lowerOpen):null:null}
function gc(a,b,c,d,e){if(c)if(c.lowerOpen||c.upperOpen||null==c.lower||null==c.upper||0!==Vb(c.lower,c.upper)){if(null!=c.lower){var f=c.lowerOpen?" > ":" >= ";d.push(a+f+"?");e.push(hc(c.lower,b))}null!=c.upper&&(f=c.upperOpen?" < ":" <= ",d.push(a+f+"?"),e.push(hc(c.upper,b)))}else d.push(a+" = ?"),e.push(hc(c.lower,b))}var fc=q.IDBKeyRange||q.webkitIDBKeyRange||Q;function ic(a,b,c,d,e,f){r(e)||(e=v(a)?a.join(", "):a);if(null!=a&&!z(a)&&!y(a))throw new H("index keyPath for "+e+" must be a string or array, but "+a+" is "+typeof a);!r(a)&&r(e)&&(a=e);this.keyPath=a;this.g=y(this.keyPath);this.a=e;this.type=jc(b);if(r(b)){if(!r(this.type))throw new H("type invalid in index: "+this.a);if(v(this.keyPath))throw new H('composite key for store "'+this.a+'" must not specified type');}this.unique=!!c;this.multiEntry=!!d;this.i=z(this.type)?this.type:kc;this.d=z(e)?e:
v(a)?this.keyPath.join(","):a;this.c=pa(this.d);this.b=this.g?null:this.keyPath.split(".");this.e=f||null}function lc(a,b){if(null!=b){if(y(a.keyPath)){for(var c=[],d=0,e=a.keyPath.length;d<e;d++){var f=Eb(b,a.keyPath[d]);c[d]=f}return c}return Eb(b,a.keyPath)}}function mc(a,b,c){for(var d=0;d<a.b.length;d++)d==a.b.length-1?b[a.b[d]]=c:B(b[a.b[d]])||(b[a.b[d]]={})}var kc="TEXT";function hc(a,b){if("DATE"==b){if(a instanceof Date)return+a}else return null!=b?a:Gb(a)}
function nc(a,b){return"DATE"==b?new Date(a):r(b)?a:Jb(a)}var oc=["BLOB","DATE","INTEGER","NUMERIC",kc];function jc(a){if(z(a))return a=ra(oc,a),oc[a]}ic.prototype.getName=function(){return this.a};ic.prototype.toJSON=function(){return{name:this.a,keyPath:this.keyPath,type:this.type,unique:this.unique,multiEntry:this.multiEntry}};ic.prototype.clone=function(){var a=v(this.keyPath)?wa(this.keyPath):this.keyPath;return new ic(a,this.type,this.unique,this.multiEntry,this.a,this.e)};
function pc(a,b){return null!=a||null!=b?null!=a?null!=b?y(a)&&y(b)?xa(a,b)?null:"expect: "+a+", but: "+b:qc(a,b)?null:"expect: "+a+", but: "+b:"keyPath: "+a+" no longer defined":"newly define "+b:null}ic.prototype.hint=function(a){if(!a)return this;var b=v(this.keyPath)?wa(this.keyPath):this.keyPath,c=this.type;r(a.type)||"TEXT"!=c||(c=void 0);return new ic(b,c,this.unique,this.multiEntry,a.a)};function rc(a,b,c,d,e,f,g,h){if(!z(a))throw new H("store name must be a string");this.d=a;this.keyPath=r(b)?b:null;this.i=y(this.keyPath);if(null!==this.keyPath&&!z(this.keyPath)&&!this.i)throw new H("keyPath must be a string or array");this.b=!!c;var k;if(null!=d){k=jc(d);if(!r(k))throw new H('type "'+d+'" for primary key in store "'+this.d+'" is invalid.');if(this.i)throw new H('composite key for store "'+this.d+'" must not specified type');}this.type=null!=k?k:this.b?"INTEGER":void 0;this.e=z(this.keyPath)?
this.keyPath.split("."):[];this.a=e||[];this.H=!!f;this.M=!!g;this.p=z(this.type)?this.type:kc;this.g=v(this.keyPath)?this.keyPath.join(","):z(this.keyPath)?this.keyPath:"_ROWID_";this.c=pa(this.g);this.m=!!h;this.k=[]}l=rc.prototype;l.H=!1;l.M=!1;l.toJSON=function(){for(var a=[],b=0;b<this.a.length;b++)a.push(this.a[b].toJSON());return{name:this.d,keyPath:this.keyPath,autoIncrement:this.b,type:this.type,indexes:a}};
function sc(a){var b=[],c=a.indexes||[];if(v(c))for(var d=0;d<c.length;d++){var e;e=c[d];e=new ic(e.keyPath,e.type,e.unique,e.multiEntry,e.name,e.generator);r(e.keyPath)&&e.keyPath===a.keyPath||b.push(e)}return new rc(a.name,a.keyPath,a.autoIncrement,"undefined"===a.type||"null"===a.type?void 0:a.type,b,a.dispatchEvents,a.fixed,a.encrypted)}
function tc(a,b,c,d,e,f,g){a=uc(a,b,c,d,e,f,g);b="";0!=c&&(b+="SELECT "+a.select);b+=" FROM "+a.T;a.l&&(b+=" WHERE "+a.l);a.group&&(b+=" GROUP BY "+a.group);a.J&&(b+=" ORDER BY "+a.J);return b}
function uc(a,b,c,d,e,f,g){var h={select:"",T:"",l:"",group:"",J:""},k=a.g,m=a.c,n=null;d!==k&&z(d)&&(n=vc(a,d));var p=!!n,u=d||k,t=pa(u),x=p?n.type:a.type,w=p&&n.multiEntry;h.T=wc(a);6===c?h.select="COUNT("+m+")":3===c||1===c||2===c?(h.select=m,null!=d&&d!=k&&(h.select+=", "+t)):h.select="*";d=g?"DISTINCT ":"";k=[];w?(w=pa("ydn.db.me:"+a.getName()+":"+n.getName()),h.select=6===c?"COUNT("+d+w+"."+t+")":3===c||1===c||2===c?"DISTINCT "+wc(a)+"."+m+", "+w+"."+t+" AS "+u:"DISTINCT "+wc(a)+".*, "+w+"."+
t+" AS "+u,h.T=w+" INNER JOIN "+wc(a)+" USING ("+m+")",null!=e&&(gc(w+"."+t,x,e,k,b),0<k.length&&(h.l=h.l?h.l+(" AND "+k.join(" AND ")):k.join(" AND ")))):null!=e&&(gc(t,x,e,k,b),0<k.length&&(h.l=h.l?h.l+(" AND "+k.join(" AND ")):k.join(" AND ")));p&&!n.unique&&g&&(h.group=t);a=f?"DESC":"ASC";h.J=t+" "+a;p&&(h.J+=", "+m+" "+a);return h}
function xc(a,b,c,d,e,f,g,h){var k,m,n,p;null!=e?(k=e.lower,m=e.upper,n=e.lowerOpen,p=e.upperOpen,f?null!=m?(e=Vb(h,m),-1==e?(m=h,p=!0):0==e&&(p=!0)):(m=h,p=!0):null!=k?(e=Vb(h,k),1==e?(k=h,n=!0):0==e&&(n=!0)):(k=h,n=!0)):f?(m=h,p=!0):(k=h,n=!0);e=new Q(k,m,!!n,!!p);d=d?vc(a,d):null;b=uc(a,c,b,d?d.d:a.g,e,f,g);b="SELECT "+b.select+" FROM "+b.T+(b.l?" WHERE "+b.l:"")+(b.group?" GROUP BY "+b.group:"")+" ORDER BY "+b.J;d&&(b+=", "+a.c+(f?"DESC":"ASC"));return b}
function yc(a,b,c,d,e,f,g,h,k){var m=vc(a,d),n=m.d;d=m.c;var p=a.c,u;u=(h?" <":" >")+" ";m=hc(f,m.type);g=hc(g,a.type);var t="";e?(a=uc(a,c,b,n,e,h,k),a.l+=" AND ",t=d+u+"?",c.push(m)):(e=h?Q.upperBound(f,!0):Q.lowerBound(f,!0),a=uc(a,c,b,n,e,h,k),t=a.l,a.l="");a.l+="("+t+" OR ("+d+" = ? AND "+p+u+"?))";c.push(m);c.push(g);return"SELECT "+a.select+" FROM "+a.T+" WHERE "+a.l+(a.group?" GROUP BY "+a.group:"")+" ORDER BY "+a.J}l.clone=function(){return sc(this.toJSON())};
l.index=function(a){return this.a[a]||null};function vc(a,b){return ua(a.a,function(a){return a.getName()==b})}function zc(a,b){return b===a.keyPath?!0:ta(a.a,function(a){return a.getName()==b})}function wc(a){return pa(a.d)}
function Ac(a,b){if(!b)return a;var c=a.b,d=v(a.keyPath)?wa(a.keyPath):a.keyPath,e=a.type,f=sa(a.a,function(a){return a.clone()});r(b.type)||"TEXT"!=e||(e=void 0);v(b.keyPath)&&z(d)&&d==b.keyPath.join(",")&&(d=wa(b.keyPath));for(var g=0,h=b.a.length;g<h;g++)if(b.a[g].g)for(var k=b.a[g].getName(),m=f.length-1;0<=m;m--)if(0<=k.indexOf(f[m].getName())){f[m]=b.a[g].clone();break}for(g=0;g<f.length;g++)(h=vc(b,f[g].getName()))&&(f[g]=f[g].hint(h));return new rc(b.d,d,c,e,f)}l.getName=function(){return this.d};
function Bc(a){return!!a.keyPath}function Cc(a,b,c){if(b){if(!a.keyPath&&null!=c)return c;if(a.i){c=[];for(var d=0;d<a.keyPath.length;d++)c.push(Eb(b,a.keyPath[d]));return c}if(a.keyPath)return Ca(b,a.e)}}function Dc(a,b,c){for(var d=0;d<a.e.length;d++){var e=a.e[d];if(d==a.e.length-1){b[e]=c;break}r(b[e])||(b[e]={});b=b[e]}}
function Ec(a,b,c){var d=[],e=[];c=r(c)?c:Cc(a,b);r(c)&&(e.push(a.c),d.push(hc(c,a.type)));for(var f=0;f<a.a.length;f++){var g=a.a[f];if(!g.multiEntry&&g.getName()!==a.keyPath&&"_default_"!=g.getName()){var h=lc(g,b);null!=h&&(d.push(hc(h,g.type)),e.push(g.c))}}a.M?a.M&&!a.keyPath&&0==a.a.length&&(z(b)&&-1==b.indexOf(";base64,")?d.push(b):d.push(R(b)),e.push("_default_")):(d.push(R(b)),e.push("_default_"));a=[];for(f=d.length-1;0<=f;f--)a[f]="?";return{Sa:e,cb:a,L:d,key:c}}
function Fc(a,b){if(!b)return"missing store: "+a.d;if(a.d!=b.d)return"store name, expect: "+a.d+", but: "+b.d;var c=pc(a.keyPath,b.keyPath);if(c)return"keyPath, "+c;if(r(a.b)&&r(b.b)&&a.b!=b.b)return"autoIncrement, expect:  "+a.b+", but: "+b.b;if(a.a.length!=b.a.length)return"indexes length, expect:  "+a.a.length+", but: "+b.a.length;if(r(a.type)&&r(b.type)&&(y(a.type)?!xa(a.type,b.type):a.type!=b.type))return"data type, expect:  "+a.type+", but: "+b.type;for(c=0;c<a.a.length;c++){var d=vc(b,a.a[c].getName()),
e;e=a.a[c];if(d)if(e.a!=d.a)e="name, expect: "+e.a+", but: "+d.a;else{var f=pc(e.keyPath,d.keyPath);e=f?"keyPath, "+f:null!=e.unique&&null!=d.unique&&e.unique!=d.unique?"unique, expect: "+e.unique+", but: "+d.unique:null!=e.multiEntry&&null!=d.multiEntry&&e.multiEntry!=d.multiEntry?"multiEntry, expect: "+e.multiEntry+", but: "+d.multiEntry:r(e.type)&&r(d.type)&&(y(e.type)?!xa(e.type,d.type):e.type!=d.type)?"data type, expect: "+e.type+", but: "+d.type:""}else e="no index for "+e.a;if(0<e.length)return'index "'+
a.a[c].getName()+'" '+e}return""}function Gc(a,b){if(b)for(var c=0;c<a.a.length;c++){var d=a.a[c],e=b;if(d.e){var f=d.e(e),g=typeof f;if("string"==g||"number"==g||f instanceof Date||v(f)){for(g=0;g<d.b.length-1;g++)B(e[d.b[g]])||(e[d.b[g]]={});e[d.b[d.b.length-1]]=f}}}}function S(a,b,c,d,e){for(var f=0;f<a.k.length;f++)d!==f&&a.k[f].call(e,b,c)};function Hc(a){return eval("("+a+")")}function Ic(){}
function Jc(a,b,c){switch(typeof b){case "string":Kc(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?b:"null");break;case "boolean":c.push(b);break;case "undefined":c.push("null");break;case "object":if(null==b){c.push("null");break}if(v(b)){var d=b.length;c.push("[");for(var e="",f=0;f<d;f++)c.push(e),Jc(a,b[f],c),e=",";c.push("]");break}c.push("{");d="";for(e in b)Object.prototype.hasOwnProperty.call(b,e)&&(f=b[e],"function"!=typeof f&&(c.push(d),Kc(e,c),c.push(":"),Jc(a,f,c),d=","));c.push("}");
break;case "function":break;default:throw Error("Unknown type: "+typeof b);}}var Lc={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Mc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;function Kc(a,b){b.push('"',a.replace(Mc,function(a){if(a in Lc)return Lc[a];var b=a.charCodeAt(0),e="\\u";16>b?e+="000":256>b?e+="00":4096>b&&(e+="0");return Lc[a]=e+b.toString(16)}),'"')};function Nc(a){return!z(a)||/^[\s\xa0]*$/.test(a)?{}:"undefined"==typeof q.JSON?Hc(a):JSON.parse(a)}function Oc(a){var b;try{b=R(a)}catch(c){b=""}return b?b.substr(0,70)+(70<b.length?"...":""):""}function R(a){if("undefined"==typeof q.JSON){var b=[];Jc(new Ic,a,b);a=b.join("")}else a=JSON.stringify(a,void 0,void 0);return a};function Pc(a){this.a=a};function Qc(a,b){this.name=a;this.a=b}Qc.prototype.getName=function(){return this.name};Qc.prototype.count=function(){return this.a.length};Qc.prototype.index=function(a){return this.a[a]};function Rc(a){if(!v(a.sources))throw new H("indexes require for full text search index "+a.name+", but "+a.sources+" of type "+typeof a.sources+" found.");var b=a.sources.map(function(a){return new Pc(a.storeName)});return new Qc(a.name,b)};function Sc(a,b){var c,d,e=b;if(B(a)){d=a;c=d.version;for(var e=[],f=d.stores||[],g=0;g<f.length;g++){var h=sc(f[g]);e.push(h)}}else z(a)?c=0==a.length?void 0:parseFloat(a):A(a)&&(c=a);if(r(c)){if(!A(c)||0>c)throw new H("Invalid version: "+c+" ("+a+")");isNaN(c)&&(c=void 0)}if(r(b)&&(!v(b)||0<b.length&&!(b[0]instanceof rc)))throw new H("stores");this.version=c;this.U=!r(this.version);this.a=e||[];c=[];if(d&&d.fullTextCatalogs)for(g=0;g<d.fullTextCatalogs.length;g++)e=Rc(d.fullTextCatalogs[g]),c[g]=
e,T(this,e.getName())||(f=[new ic("k",kc),new ic("v",kc)],e=new rc(e.getName(),"id",!1,void 0,f,!1,!1,!1),this.a.push(e));this.b=c}l=Sc.prototype;l.toJSON=function(){var a=sa(this.a,function(a){return a.toJSON()}),b={};b.stores=a;r(this.version)&&(b.version=this.version);return b};l.U=!1;l.u=function(){return!1};function Tc(a){return sa(a.a,function(a){return a.getName()})}l.C=function(a){return this.a[a]||null};l.count=function(){return this.a.length};
function T(a,b){return ua(a.a,function(a){return a.getName()==b})}function Uc(a,b){return ta(a.a,function(a){return a.getName()==b})}
function Vc(a,b,c,d){if(!b||a.a.length!=b.a.length)return"Number of store: "+a.a.length+" vs "+b.a.length;for(var e=0;e<a.a.length;e++){var f=T(b,a.a[e].getName());if(f){c&&(f=Ac(f,a.a[e]));if(d)for(var g=f,h=a.a[e],k=0;k<h.a.length;k++){var m=h.a[k];zc(g,m.getName())||"BLOB"!=m.type||(m=new ic(m.keyPath,m.type,m.unique,m.multiEntry,m.getName()),g.a.push(m))}f=Fc(a.a[e],f);if(0<f.length)return'store: "'+a.a[e].getName()+'" '+f}else return'missing object store "'+a.a[e].getName()+'"'}return""};function Wc(a,b){Sc.call(this,a,b)}C(Wc,Sc);Wc.prototype.u=function(){return!0};function Xc(a,b){a.a.push(b)};function Yc(a){Error.captureStackTrace?Error.captureStackTrace(this,Yc):this.stack=Error().stack||"";a&&(this.message=String(a));this.name="ydn.error.InternalError"}C(Yc,Error);Yc.prototype.name="ydn.InternalError";function Zc(a){Error.captureStackTrace?Error.captureStackTrace(this,Zc):this.stack=Error().stack||"";a&&(this.message=String(a));this.name="ydn.error.ConstraintError"}C(Zc,Error);Zc.prototype.name="ydn.error.ConstraintError";function qc(a,b){var c;c=c||{};if(null!=a&&null!=b){if(y(a)&&y(b)){if(a.length!=b.length)return!1;for(var d=0;d<a.length;d++)if(-1==ua(b,function(b){return qc(b,a[d])}))return!1;return!0}if(y(a))return 1==a.length&&qc(a[0],b);if(y(b))return 1==b.length&&qc(b[0],a);if(B(a)&&B(a)){for(var e in a)if(a.hasOwnProperty(e)&&!c[e]){var f=qc(a[e],b[e]);if(!f)return!1}for(e in b)if(b.hasOwnProperty(e)&&!c[e]&&(f=qc(a[e],b[e]),!f))return!1;return!0}return a===b}return!1};/*
 Copyright 2012 YDN Authors, Yathit. All Rights Reserved.
 Licensed under the Apache License, Version 2.0 (the "License");.
*/
function U(a,b,c){c=c||{};this.p=c.mechanisms||$c;this.m=c.size;this.w=r(c.connectionTimeout)?c.connectionTimeout:6E4;this.a=null;this.e=[];this.ea=!1;var d;if(b instanceof Sc)d=b;else if(B(b)){c.autoSchema||!r(b.stores)?d=new Wc(b):d=new Sc(b);var e=b.stores?b.stores.length:0;for(c=0;c<e;c++){var f=T(d,b.stores[c].name);b.stores[c].Sync&&f.getName()}}else d=new Wc;this.b=d;for(c=0;c<this.b.count();c++)this.b.C(c).m&&this.b.C(c).getName();r(a)&&this.k(a);this.d=new G}U.prototype.logger=null;
U.prototype.I=function(a){if(r(a)){var b=function(b){a(b.toJSON());a=void 0};if(this.a)this.a.s(b);else{var c=this;this.transaction(function(a){c.a.s(b,a)},null,Bb)}}return this.b?this.b.toJSON():null};U.prototype.k=function(a){if(this.a)throw new pb("Already connected with "+this.g);this.g=a;ad(this)};U.prototype.getName=function(){return this.g};var $c="indexeddb sqlite websql localstorage sessionstorage userdata memory".split(" ");l=U.prototype;l.ra=function(){return null};
function ad(a){function b(b,e){b?(a.Ha=NaN,d.va=function(){},d.ia=function(){a.a=null},d.wa=function(){},setTimeout(function(){bd(a,e);cd(a)},10),c.callback(e)):(setTimeout(function(){bd(a,new ac(a,e));if(a.e)for(var b;b=a.e.shift();)b.q&&b.q("error",e)},10),c.h(e))}for(var c=new G,d=null,e=a.p,f=0;f<e.length;f++){var g=e[f].toLowerCase();if(d=a.ra(g)){d=a.ra(g);break}}null===d?(e=new Zc("No storage mechanism found."),b(!1,new ac(a,e))):fb(d.P(a.g,a.b),function(a){this.a=d;b(!0,new Zb("ready",this,
parseFloat(d.Ca()),parseFloat(a),null))},function(a){b(!1,a)},a)}l.Da=function(){if(this.a)return this.a.X()};l.ja=function(a,b){this.d.Ea(a,b)};function bd(a,b){setTimeout(function(){a.b.U&&a.d.c||(b instanceof $b?a.d.h(b.error):a.d.callback())},4)}function dd(a){return!!a.a&&a.a.ma()}l.close=function(){this.a&&(this.a.close(),this.a=null)};l.ib=function(){return this.a?this.a.Ba():null};l.Ha=NaN;function cd(a){var b=a.e.shift();b&&a.transaction(b.ba,b.bb,b.mode,b.q);a.Ha=ha()}l.ea=!1;
l.transaction=function(a,b,c,d){var e=b;z(b)?e=[b]:null!=b||(e=null);if(this.a&&this.a.ma()&&!this.ea){var f=this,g=r(c)?c:Bb;g==Cb&&(this.ea=!0);this.a.aa(function(b){a(b);a=null},e,g,function(a,b){ca(d)&&(d(a,b),d=void 0);g==Cb&&(f.ea=!1);cd(f)})}else this.e.push({ba:a,bb:e,mode:c,q:d})};U.prototype.close=U.prototype.close;U.prototype.getType=U.prototype.Da;U.prototype.getName=U.prototype.getName;U.prototype.getSchema=U.prototype.I;U.prototype.onReady=U.prototype.ja;U.prototype.setName=U.prototype.k;U.prototype.transaction=U.prototype.transaction;U.prototype.db=U.prototype.ib;ia("ydn.db.version","1.1.2");ia("ydn.db.cmp",Vb);ia("ydn.db.deleteDatabase",function(a,b){for(var c,d=0;d<Wb.length;d++){var e=Wb[d](a,b);e&&(c=e)}return c||Ub("vc",null)});Zb.prototype.name=Zb.prototype.name;
Zb.prototype.getVersion=Zb.prototype.jb;Zb.prototype.getOldVersion=Zb.prototype.Wa;Zb.prototype.getOldSchema=Zb.prototype.Va;$b.prototype.getError=$b.prototype.c;M.prototype.abort=M.prototype.abort;M.prototype.canAbort=M.prototype.Ra;K.prototype.progress=K.prototype.Za;K.prototype.promise=K.prototype.ab;function ed(a){Error.captureStackTrace?Error.captureStackTrace(this,ed):this.stack=Error().stack||"";a&&(this.message=String(a));this.name="ConstraintError"}C(ed,Error);ed.prototype.name="ConstraintError";function fd(a){Error.captureStackTrace?Error.captureStackTrace(this,fd):this.stack=Error().stack||"";a&&(this.message=String(a));this.name="ydn.db.VersionError"}C(fd,Error);fd.prototype.name="ydn.db.VersionError";
function Rb(a){Error.captureStackTrace?Error.captureStackTrace(this,Rb):this.stack=Error().stack||"";a&&(this.message=String(a));this.name="InvalidStateError"}C(Rb,Error);function gd(a){Error.captureStackTrace?Error.captureStackTrace(this,gd):this.stack=Error().stack||"";a&&(this.message=String(a));this.name="NotFoundError"}C(gd,Error);gd.prototype.name="NotFoundError";
function hd(a,b){Error.captureStackTrace?Error.captureStackTrace(this,hd):this.stack=Error().stack||"";b&&(this.message=String(b));this.message+=" :"+a.message+" ["+a.code+"]";this.name="SQLError"}C(hd,Error);function id(a,b){Error.captureStackTrace?Error.captureStackTrace(this,id):this.stack=Error().stack||"";b&&(this.message=String(b));this.message+=" :"+a.message;this.name="SecurityError"}C(id,Error);
function jd(a){Error.captureStackTrace?Error.captureStackTrace(this,jd):this.stack=Error().stack||"";a&&(this.message=String(a));this.name="ydn.db.TimeoutError"}C(jd,Error);function kd(a,b){this.a=b}kd.prototype.logger=null;function ld(a){this.d=a;this.a=null;this.b=0}ld.prototype.logger=null;ld.prototype.r=null;function md(a){return!!a.a&&!a.c}ld.prototype.q=null;function nd(a,b,c,d,e,f){this.V=a;this.ga=b;this.a=this.d=0;this.I=d;this.w=e;this.g=c||od;this.k=f||0}nd.prototype.logger=null;nd.prototype.type=function(){return this.V.Da()};nd.prototype.f=function(){return this.V};nd.prototype.D=function(){return"B"+this.ga+"T"+this.d};var od="single";function pd(a){if(a)if(ca(a.abort))a.abort();else if(ca(a.executeSql))a.executeSql("ABORT",[],null,function(){return!0});else throw new nb;else throw new Rb("No active transaction");};function qd(a,b,c,d,e,f){nd.call(this,a,b,c,d,e,f);this.c=[];this.e=[];this.i=null;this.b=new ld(b);this.m=f||0;this.p=!1}C(qd,nd);l=qd.prototype;l.logger=null;
function rd(a,b,c){if("multi"==a.g)a:if(a=a.b,!a.r||!a.mode||c!=a.mode&&(a.mode!=L||c!=Bb)||b.length>a.r.length)b=!1;else{for(c=0;c<b.length;c++)if(-1==a.r.indexOf(b[c])){b=!1;break a}b=!0}else if("repeat"==a.g)a:if(a=a.b,a.r&&a.mode&&c==a.mode&&a.r.length==b.length){for(c=0;c<b.length;c++)if(-1==a.r.indexOf(b[c])){b=!1;break a}b=!0}else b=!1;else b="all"==a.g?!0:!1;return b}function sd(a){var b=0<a.c.length?a.c[0].r:null,c=0<a.c.length?a.c[0].mode:null;return null!=b&&null!=c?rd(a,b,c):!1}
l.abort=function(){pd(this.i)};
l.K=function(a,b,c,d){var e=z(b)?[b]:b,f=r(c)?c:Bb,g=this;if(this.b.a||!dd(this.f())&&this.p)this.c.push({ba:a,r:b,mode:f,q:d});else{d&&this.e.push(d);if(this.m&&this.d>=this.m)throw new pb("Exceed maximum number of transactions of "+this.m);this.p=!0;this.f().transaction(function(c){var d=g.b;d.a=c;d.c=!1;d.r=b;d.mode=f;d.b++;d.q=null;R(b);a(g);for(a=null;sd(g);)c=g.c.shift(),c.q&&g.e.push(c.q),c.ba()},e,f,function(a,b){var c=g.b;c.a&&(c.a=null,c.r=null,c.mode=null,ca(c.q)&&c.q(a,b),c.q=null);for(c=
0;c<g.e.length;c++)(0,g.e[c])(a,b);g.e.length=0;(c=g.c.shift())&&g.K(c.ba,c.r,c.mode,c.q);g.a=0})}};l.D=function(){var a=this.b;return"B"+a.d+"T"+a.b};l.request=function(a,b,c,d){function e(a,b){f.a=null;d&&d(a,b)}var f=new M(a);a=c||Bb;var g=this;md(this.b)&&rd(this,b,a)?(b=this.b.a,this.a++,Pb(f,b,this.D()+"R"+this.a),this.e.push(e)):g.K(function(){var a=g.b.a;g.a++;Pb(f,a,g.D()+"R"+g.a)},b,a,e);return f};
l.R=function(a,b,c,d,e){d=d||Bb;var f=this,g;if(md(f.b)&&rd(this,c,d)){var h=f.b.a;f.a++;g=f.D()+"R"+f.a;b(h,g,function(b,c){f.i=h;c?a.h(b):a.callback(b);f.i=null});b=null}else f.K(function(){var c=f.b.a;f.a++;g=f.D()+"R"+f.a;b(c,g,function(b,d){f.i=c;d?a.h(b):a.callback(b);f.i=null});b=null},c,d,e)};l.getName=function(){return this.f().getName()};function td(a,b){qd.call(this,a,b)}C(td,qd);td.prototype.logger=null;td.prototype.request=function(a,b,c){var d,e,f,g=td.G.request.call(this,a,b,c,function(a,b){g.a=null;if(d)"complete"!=a&&(f=!0,e=b),d(e,f);else{var c=new jd;N(g,c,!0)}});Sb(g,function(a,b,c){f=b;e=a;d=c});return g};
td.prototype.R=function(a,b,c,d,e){var f,g,h=new G;fb(h,function(a){g=!1;f=a},function(a){g=!0;f=a});td.G.R.call(this,h,b,c,d,function(b,c){if("complete"!=b)a.h(c);else if(!0===g)a.h(f);else if(!1===g)a.callback(f);else{var d=new jd;a.h(d)}e&&(e(b,c),e=void 0)})};function ud(a,b,c){this.d=a;this.b=b;this.a=c;this.c=null}ud.prototype.logger=null;ud.prototype.e=function(){return this.a.d};ud.prototype.abort=function(){this.a.abort()};function V(a){if(!a.c){var b;b=a.d;var c=b.Da();if("indexeddb"==c)b=new vd(0,b.b);else if("websql"==c||"sqlite"==c)b=new wd(0,b.b);else if("memory"==c||"localstorage"==c||"sessionstorage"==c)b=new xd(0,b.b);else throw new qb("No executor for "+c);a.c=b}return a.c}ud.prototype.f=function(){return this.d};
function yd(a,b){var c=a.f(),d=b instanceof rc?b:sc(b),e=T(c.b,b.name);if(0==Fc(d,e).length)(new G).callback(!1);else if(c.b instanceof Wc)Xc(c.b,d),c.a?(c.a.close(),c.a=null,ad(c)):(new G).callback(!1);else throw new Zc("");};function W(a,b,c){ud.call(this,a,b,c)}C(W,ud);l=W.prototype;l.logger=null;
l.count=function(a,b,c,d){var e,f,g,h;if(null!=a)if(v(a)){if(r(c)||r(b))throw new H("too many arguments.");f=a;for(var k=0;k<f.length;k++)if(!Uc(this.b,f[k]))throw new H('store name "'+f[k]+'" at '+k+" not found.");zb("countStores: "+R(f));e=this.a.request("d",f);O(e,function(){V(this).$(e,f)},this)}else if(z(a)){k=T(this.b,a);if(!k)throw new H('store name "'+a+'" not found.');f=[a];if(z(b))g=b,B(c)?h=ec(c):h=null;else if(B(b)||null==b)if(B(b))h=ec(b);else{if(null!=b)throw new H("key range must be  an object but found "+
Oc(b)+" of type "+typeof b);h=null}else throw new H('invalid second argument for count "'+Oc(c)+'" of type '+typeof b);zb("countKeyRange: "+a+" "+(g?g:"")+R(h));e=this.a.request("d",f);S(k,e,arguments);O(e,function(){V(this).qa(e,f[0],h,g,!!d)},this)}else throw new H("Invalid store name or store names.");else k=Tc(this.b),e=this.a.request("d",k),Sb(e,function(a,b,c){if(b)c(a,!0);else{for(var d=b=0;d<a.length;d++)b+=a[d];c(b,!1)}},this),O(e,function(){V(this).$(e,f)},this);return e};
l.get=function(a,b){var c=this,d;if(a instanceof P){var e=a,f=e.b,g=T(this.b,f);if(!g){if(this.b.u()){if(dd(this.f()))return Ub("e",void 0);d=new M("e");this.f().ja(function(){fb(c.get(a,b),function(a){d.callback(a)},function(a){d.h(a)})});return d}throw new H("Store: "+f+" not found.");}var h=e.a;d=this.a.request("ek",[f]);S(g,d,arguments,void 0,this);O(d,function(){V(this).ca(d,f,h)},this)}else if(z(a)&&r(b)){var k=a,g=T(this.b,k);if(!g){if(this.b.u()){if(dd(this.f()))return Ub("e",void 0);d=new M("e");
this.f().ja(function(){fb(c.get(a,b),function(a){d.callback(a)},function(a){d.h(a)})});return d}throw new H('Store name "'+k+'" not found.');}var m=b;d=this.a.request("e",[k]);S(g,d,arguments,void 0,this);O(d,function(){V(this).ca(d,k,m)},this)}else throw new H("get require valid input arguments.");return d};
l.Ya=function(a,b,c,d,e){var f=T(this.b,a),g,h,k,m=null;B(b)&&(m=ec(b));if(r(c))if(A(c))g=c;else throw new H("limit must be a number, but "+c+" is "+typeof c);else g=100;if(r(d))if(A(d))h=d;else throw new H("offset must be a number, but "+d+" is "+typeof d);else h=0;if(r(e))if(ba(e))k=e;else throw new H("reverse must be a boolean, but "+e+" is "+typeof e);var n=this.a.request("g",[a]);S(f,n,arguments);O(n,function(){V(this).Q(n,2,a,null,m,g,h,k,!1)},this);return n};
l.Xa=function(a,b,c,d,e,f,g){var h,k,m,n,p,u=T(this.b,a);h=ec(c);if(A(d))k=d;else{if(r(d))throw new H("limit must be a number");k=100}if(A(e))m=e;else{if(r(e))throw new H("offset must be a number");m=0}if(r(f))if(ba(f))n=f;else throw new H("reverse must be a boolean");if(r(g))if(ba(g))p=g;else throw new H("unique must be a boolean");var t=this.a.request("i",[a]);S(u,t,arguments);O(t,function(){V(this).Q(t,2,a,b,h,k,m,n,p)},this);return t};
l.keys=function(a,b,c,d,e,f,g){var h=T(this.b,a);return this.b.u()&&!h?Ub("g",[]):z(b)?this.Xa(a,b,c,d,e,f,g):this.Ya(a,b,c,d,e)};
l.L=function(a,b,c,d,e,f,g){var h=this,k;if(z(a)){var m=a,n=T(this.b,m);if(!n){if(this.b.u()){if(dd(this.f()))return Ub("s",[]);k=new M("s");this.f().ja(function(){fb(h.L(a,b,c,d,e,f),function(a){k.callback(a)},function(a){k.h(a)})});return k}throw new gd(m);}if(v(b)){var p=b;k=this.a.request("v",[m]);S(n,k,arguments,void 0,this);O(k,function(){V(this).ta(k,m,p)},this)}else k=z(b)?this.eb(m,b,c,d,e,f,g):this.fb(m,b,c,d,e)}else if(v(a))if(a[0]instanceof P){for(var n=[],u=a,t=0;t<u.length;t++){var x=
u[t].b;if(!Uc(this.b,x)){if(this.b.u())return n=[],n[u.length-1]=void 0,Ub("e",n);throw new H("Store: "+x+" not found.");}0<=ra(n,x)||n.push(x)}zb("listByKeys: "+R(n)+" "+u.length+" keys");k=this.a.request("w",n);O(k,function(){V(this).ua(k,u)},this)}else throw new H("first argumentmust be array of ydn.db.Key, but "+a[0]+" of "+typeof a[0]+" found.");else throw new H("first argument "+a+" is invalid.");return k};
l.fb=function(a,b,c,d,e){var f=T(this.b,a),g,h,k,m=null;B(b)&&(m=ec(b));if(r(c))if(A(c))g=c;else throw new H("limit must be a number, but "+c+" is "+typeof c);else g=100;if(r(d))if(A(d))h=d;else throw new H("offset must be a number, but "+d+" is "+typeof d);else h=0;if(r(e))if(ba(e))k=e;else throw new H("reverse must be a boolean, but "+e+" is "+typeof e);var n=this.a.request("s",[a]);S(f,n,arguments);O(n,function(){V(this).Q(n,4,a,null,m,g,h,k,!1)},this);return n};
l.eb=function(a,b,c,d,e,f,g){var h=T(this.b,a),k,m,n,p,u=ec(c);if(r(d))if(A(d))k=d;else throw new H("limit must be a number.");else k=100;if(r(e))if(A(e))m=e;else throw new H("offset must be a number.");else m=0;if(ba(f))n=f;else if(r(f))throw new H("reverse must be a boolean, but "+f);if(r(g))if(ba(g))p=g;else throw new H("unique must be a boolean");var t=this.a.request("u",[a]);S(h,t,arguments);O(t,function(){V(this).Q(t,4,a,b,u,k,m,n,p)},this);return t};
l.add=function(a,b,c){var d=z(a)?a:B(a)?a.name:void 0;if(!z(d))throw new H("store name "+d+" must be a string, but "+typeof d);var e=T(this.b,d);if(!e){if(!this.b.u())throw new H('store name "'+d+'" not found.');e=sc(B(a)?a:{name:d});yd(this,e)}else if(this.b.u()&&B(a)&&(a=sc(a),a=Fc(e,a)))throw new nb(a);var f;if(!e)throw new H('store name "'+d+'" not found.');if(z(e.keyPath)&&r(c))throw new H("key must not be provided while the store uses in-line key.");if(!e.keyPath&&!e.b&&!r(c))throw new H("out-of-line key must be provided.");
if(v(b)){for(a=0;a<b.length;a++)Gc(e,b[a]);f=this.a.request("b",[d],L);O(f,function(){V(this).v(f,!1,!1,d,b,c)},this);e.H&&f.F(function(){this.f();e.getName();this.f()},this)}else if(B(b))Cc(e,b,c),Gc(e,b),f=this.a.request("a",[d],L),O(f,function(){V(this).v(f,!1,!0,d,[b],[c])},this),e.H&&f.F(function(){this.f();e.getName();this.f()},this);else throw new H("record must be an object or array list of objects, but "+b+" of type "+typeof b+" found.");return f};
function zd(a,b){var c=z(b)?b:B(b)?b.name:void 0;if(!z(c))throw new H("store name must be a string");var d=T(a.b,c);if(!d){if(!a.b.u())throw new gd(c);d=sc(B(b)?b:{name:c});yd(a,d)}else if(a.b.u()&&B(b)){var e=sc(b);if(e=Fc(d,e))throw new nb(e);}if(!d)throw new gd(c);return d}l.load=function(a,b,c){var d=c||",",e=zd(this,a).getName();a=this.a.request("i3",[e]);var f=this;this.a.R(a,function(a,c,k){V(f).ya(a,c,k,e,b,d)},[e],L);return a};
l.put=function(a,b,c){var d,e=this;if(a instanceof P){var f=a,g=f.b,h=T(this.b,g);if(!h)throw new H('store "'+g+'" not found.');if(h.keyPath){var k=Cc(h,b);if(null!=k){if(0!=Vb(k,f.a))throw new H("Inline key must be "+f+" but "+k+" found.");}else Dc(h,b,f.a);return this.put(g,b)}return this.put(g,b,f.a)}if(v(a)){for(var m=a,n=b,f=[],g=0,h=m.length;g<h;g++){k=m[g].b;-1==ra(f,k)&&f.push(k);var p=T(this.b,k);if(!p)throw new H('store "'+k+'" not found.');p.keyPath&&Dc(p,n[g],m[g].a)}zb("putByKeys: to "+
R(f)+" "+n.length+" objects");for(g=0;g<n.length;g++)Gc(p,n[g]);d=this.a.request("l",f,L);S(p,d,arguments);O(d,function(){V(e).xa(d,n,m)},this)}else if(z(a)||B(a)){var p=zd(this,a),u=p.getName();if(p.keyPath&&r(c))throw new H("key must not be provided while the store uses in-line key.");if(!p.keyPath&&!p.b&&!r(c))throw new H("out-of-line key must be provided.");if(v(b)){for(var t=b,x=c,g=0;g<t.length;g++)Gc(p,t[g]);d=this.a.request("k",[u],L);S(p,d,arguments);O(d,function(){V(this).v(d,!0,!1,u,t,
x)},this);p.H&&d.F(function(){this.f();this.f()},this)}else if(B(b)){var w=b,D=c;if(r(q.Blob)&&w instanceof Blob&&p.M&&!p.keyPath&&0==p.a.length&&ub)d=new M("j"),f=new FileReader,f.onload=function(a){var b=a.target.result,c=e.a.request("j",[u],L);S(p,c,[u,w,D]);O(c,function(){V(e).v(c,!0,!0,u,[b],[D])},this);fb(c,function(a){d.callback(a)},function(a){d.h(a)})},f.onerror=function(a){d.h(a)},f.onabort=function(a){d.h(a)},f.readAsDataURL(w);else{Gc(p,w);d=this.a.request("j",[u],L);var J=[u,w,D];S(p,
d,J);O(d,function(){var a=r(D)?[J[2]]:void 0;V(e).v(d,!0,!0,u,[J[1]],a)},this)}p.H&&d.F(function(){this.f();this.f()},this)}else throw new H("put record value must be Object or array of Objects");}else throw new H("the first argument of put must be store name, store schema or array of keys.");return d};
l.clear=function(a,b){var c;if(z(a)){var d=T(this.b,a);if(!d)throw new H('store name "'+a+'" not found.');if(B(b)){var e=ec(b);if(null===e)throw new H("clear method requires a valid non-null KeyRange object.");zb("clearByKeyRange: "+a+":"+R(e));c=this.a.request("c",[a],L);S(d,c,[a,e]);O(c,function(){V(this).oa(c,a,e)},this)}else{if(r(b))throw new H("clear method requires a valid KeyRange object as second argument, but found "+b+" of type "+typeof b);c=this.a.request("c",[a],L);O(c,function(){V(this).Y(c,
[a])},this)}}else if(!r(a)||v(a)&&z(a[0])){var f=a||Tc(this.b);zb("clearByStores: "+R(f));c=this.a.request("c",f,L);O(c,function(){V(this).Y(c,f)},this)}else throw new H('first argument "'+a+'" is invalid.');return c};
l.na=function(a,b,c){var d;if(z(a)){var e=T(this.b,a);if(!e)throw new H('store name "'+a+'" not found.');if(r(c))if(z(b)){var f=vc(e,b);if(!f)throw new H("index: "+b+" not found in "+a);if(B(c)||null===c){var g=ec(c);zb("removeByIndexKeyRange: "+a+":"+f.getName()+" "+a);d=this.a.request("p",[a],L);O(d,function(){V(this).za(d,a,f.getName(),g)},this)}else throw new H("key range "+c+' is invalid type "'+typeof c+'".');}else throw new H('index name "'+b+'" must be a string, but '+typeof b+" found.");
else if(z(b)||A(b)||y(b)||b instanceof Date){d=this.a.request("m",[a],L);var h=[a,b];S(e,d,h);O(d,function(){V(this).ka(d,a,h[1])},this);e.H&&d.F(function(){this.f();this.f()},this)}else if(B(b))g=ec(b),zb("removeByKeyRange: "+a+":"+R(g)),d=this.a.request("n",[a],L),S(e,d,[a,g]),O(d,function(){V(this).la(d,a,g)},this),e.H&&d.F(function(){this.f();this.f()},this);else throw new H('Invalid key or key range "'+b+'" of type '+typeof b);}else if(a instanceof P){var k=a.b,e=T(this.b,k);d=this.a.request("m",
[k],L);var m=[k,a.a];S(e,d,m);O(d,function(){V(this).ka(d,k,m[1])},this)}else if(v(a)){b=[];c=0;for(e=a.length;c<e;c++){var n=a[c].b;-1==ra(b,n)&&b.push(n)}if(1>b.length)throw new H('at least one valid key required in key list "'+Oc(a)+'"');d=this.a.request("o",b,L);O(d,function(){V(this).Aa(d,a)},this)}else throw new H('first argument requires store name, key (ydn.db.Key) or list of keys (array) , but "'+Oc(a)+'" ('+aa(a)+") found.");return d};function Ad(a,b,c,d){this.d=a;this.a=wa(c);this.b=d;this.c=[]}Ad.prototype.d=null;function Bd(a,b,c){if(a.d)c&&a.c.push(c),b(a.d);else throw new qb("tx committed on ParallelTxExecutor");};function Cd(a,b,c,d,e,f){nd.call(this,a,b,c,d,e,f);this.c=this.b=null}C(Cd,nd);l=Cd.prototype;l.logger=null;l.abort=function(){pd(this.c)};
l.Pa=function(a,b){var c;if("multi"==this.g)a:if(c=this.b,!c.a||!c.b||b!=c.b&&(c.b!=L||b!=Bb)||a.length>c.a.length)c=!1;else{for(var d=0;d<a.length;d++)if(-1==c.a.indexOf(a[d])){c=!1;break a}c=!0}else if("repeat"==this.g)a:if(c=this.b,c.a&&c.b&&b==c.b&&c.a.length==a.length){for(d=0;d<a.length;d++)if(-1==c.a.indexOf(a[d])){c=!1;break a}c=!0}else c=!1;else c="all"==this.g?!0:!1;return c};
l.K=function(a,b,c,d){function e(c){h.d++;k=new Ad(c,0,b,g);R(b);h.b=k;Bd(h.b,a,d)}function f(a,b){if(k){for(var c=k,d=0;d<c.c.length;d++)c.c[d](a,b);c.c.length=0;c.d=null;c.a=null;c.c=null}h.a=0}this.I&&(b=this.I);this.w&&(c=this.w);var g=r(c)?c:Bb,h=this,k;if(this.b&&this.b.d&&this.Pa(b,g))Bd(this.b,a,d);else{if(this.k&&this.d>=this.k)throw new pb("Exceed maximum number of transactions of "+this.k);this.f().transaction(e,b,g,f)}};
l.request=function(a,b,c,d){var e=new M(a),f=this;this.K(function(a){f.a++;Pb(e,a,f.D()+"R"+f.a)},b,c||Bb,function(a,b){e.a=null;d&&d(a,b)});return e};l.R=function(a,b,c,d,e){var f=this,g;this.K(function(c){f.a++;g=f.D()+"R"+f.a;b(c,g,function(b,d){f.c=c;g=f.D()+"R"+f.a;d?a.h(b):a.callback(b);f.c=null});b=null},c,d,e)};function Dd(a,b){Cd.call(this,a,b,od)}C(Dd,Cd);Dd.prototype.logger=null;Dd.prototype.Pa=function(){return!1};Dd.prototype.request=function(a,b,c){var d,e,f,g=Dd.G.request.call(this,a,b,c,function(a,b){g.a=null;if(d)"complete"!=a&&(f=!0,e=b),d(e,f);else{var c=new jd;N(g,c,!0)}});Sb(g,function(a,b,c){f=b;e=a;d=c});return g};
Dd.prototype.R=function(a,b,c,d,e){var f,g,h=new G;fb(h,function(a){g=!1;f=a},function(a){g=!0;f=a});Dd.G.R.call(this,h,b,c,d,function(b,c){if("complete"!=b)a.h(c);else if(!0===g)a.h(f);else if(!1===g)a.callback(f);else{var d=new jd;a.h(d)}e&&(e(b,c),e=void 0)})};function Ed(a,b,c){U.call(this,a,b,c);this.N=0;a=!0;b=od;c&&(r(c.isSerial)&&(a=!!c.isSerial),c.policy&&(b=c.policy));c=Fd(this,b,a);this.i=Fd(this,"atomic",!1);this.c=this.ha(c,this.i)}C(Ed,U);l=Ed.prototype;l.N=0;l.Qa=function(a,b,c,d,e,f){a=a||od;var g;"readonly"==d?g=Bb:"readwrite"==d&&(g=L);a=Fd(this,a,b,c,g,e);return this.ha(a,f?null:this.i)};l.ha=function(a){return new ud(this,this.b,a)};
function Fd(a,b,c,d,e,f){if(c){if("multi"==b||"repeat"==b||"all"==b||b==od)return new qd(a,a.N++,b,d,e,f);if("atomic"==b)return new td(a,a.N++);throw new H('Invalid requestType "'+b+'"');}if("multi"==b||"repeat"==b||"all"==b||b==od)return new Cd(a,a.N++,b,d,e,f);if("atomic"==b)return new Dd(a,a.N++);throw new H('Invalid requestType "'+b+'"');}
l.$a=function(a,b,c){this.N++;b=b||Tc(this.b);var d=Bb;if(c)if("readwrite"==c)d=L;else if("readonly"!=c)throw new H('Invalid transaction mode "'+c+'"');var e=Fd(this,"all",!1,b,d,1),f=this.ha(e,this.i),g=new M("q");e.K(function(b){Pb(g,b,e.D()+"R0");a(f)},b,d,function(a){g.a=null;N(g,e.d,"complete"!==a)});return g};l.kb=function(){return this.c?this.c.a.d:NaN};function X(a,b,c){Ed.call(this,a,b,c);a=this.b;for(b=0;b<a.b.length;b++){c=a.b[b];var d=T(a,c.getName());if(d){if(!zc(d,"k"))throw new H('full text index store "'+d.getName()+'" must have "keyword" index');if(!zc(d,"v"))throw new H('full text index store "'+d.getName()+'" must have "keyword" index');if("id"!=d.keyPath)throw new H('full text index store "'+d.getName()+'" must use "id" as key path.');}else throw new H('full text index store "'+c.getName()+'" required.');for(d=0;d<c.count();d++){var e=
c.index(d),f=T(a,e.a);if(f)f.getName();else throw new H('full text source store "'+e.a+'" does not exist for full text index "'+c.getName()+'"');}}}C(X,Ed);l=X.prototype;l.ha=function(a){return new W(this,this.b,a)};l.add=function(a,b,c){return this.c.add(a,b,c)};l.count=function(a,b,c,d){return this.c.count(a,b,c,d)};l.get=function(a,b){return this.c.get(a,b)};l.keys=function(a,b,c,d,e,f,g){return this.c.keys(a,b,c,d,e,f,g)};l.L=function(a,b,c,d,e,f){return this.c.L(a,b,c,d,e,f)};
l.load=function(a,b,c){return this.c.load(a,b,c)};l.put=function(a,b,c){return this.c.put(a,b,c)};l.clear=function(a,b,c){return this.c.clear(a,b,c)};l.na=function(a,b,c){return this.c.na(a,b,c)};function vd(a,b){this.a=b}C(vd,kd);l=vd.prototype;l.logger=null;l.$=function(a,b){function c(e){var f=a.a.objectStore(b[e]).count();f.onsuccess=function(f){d[e]=f.target.result;e++;e==b.length?N(a,d):c(e)};f.onerror=function(b){b.preventDefault();N(a,f.error,!0)}}var d=[];0==b.length?N(a,[]):c(0)};
l.v=function(a,b,c,d,e,f){function g(d){if(null==e[d])if(k++,k==e.length)N(a,h,m);else{var u=d+10;u<e.length&&g(u)}var t,u=e[d];t=f&&null!=f[d]?b?n.put(u,f[d]):n.add(u,f[d]):b?n.put(u):n.add(u);t.onsuccess=function(b){k++;h[d]=b.target.result;k==e.length?N(a,c?h[0]:h,m):(b=d+10,b<e.length&&g(b))};t.onerror=function(b){k++;var f=t.error;Oc(e[d]);h[d]=f;m=!0;b.preventDefault();k==e.length?N(a,c?h[0]:h,m):(b=d+10,b<e.length&&g(b))}}var h=[],k=0,m=!1,n=a.a.objectStore(d);if(0<e.length)for(d=0;10>d&&d<
e.length;d++)g(d);else N(a,[])};l.xa=function(a,b,c){function d(h){var m=c[h],n=a.a.objectStore(m.b),p;p=null===n.keyPath?n.put(b[h],m.a):n.put(b[h]);p.onsuccess=function(c){f++;e[h]=c.target.result;f==b.length?N(a,e,g):(c=h+10,c<b.length&&d(c))};p.onerror=function(c){f++;e[h]=p.error;g=!0;c.preventDefault();f==b.length?N(a,e,g):(c=h+10,c<b.length&&d(c))}}var e=[],f=0,g=!1;if(0<b.length)for(var h=0;10>h&&h<b.length;h++)d(h);else N(a,e,g)};
l.ya=function(a,b,c,d,e,f){function g(){var a={},b=e.indexOf("\n",m),d=!1,w;-1==b?(d=!0,w=e.substring(m)):(w=e.substring(m,b),m=b+1);b=w.split(f);for(w=0;w<n.length;w++){var D=b[w];p[w]&&(p[w]==kc?D=ma(D):"INTEGER"==p[w]?D=parseInt(D,10):"NUMERIC"==p[w]&&(D=parseFloat(D)));a[n[w]]=D}var J=h.put(a);J.onsuccess=function(a){k.push(a.target.result);d?c(k):g()};J.onerror=function(a){a.preventDefault();c(J.error,!0)}}b=T(this.a,d);var h=a.objectStore(d),k=[],m=e.indexOf("\n"),n=e.substr(0,m).split(f),p=
[];for(a=0;a<n.length;a++)(d=vc(b,n[a]))?p[a]=d.type:n[a]==b.keyPath&&(p[a]=b.type);m++;g()};l.ka=function(a,b,c){var d=a.a.objectStore(b).openCursor(fc.only(c));d.onsuccess=function(b){if(b=b.target.result){var c=b["delete"]();c.onsuccess=function(){N(a,1)};c.onerror=function(){N(a,c.error,!0)}}else N(a,0)};d.onerror=function(b){b.preventDefault();N(a,d.error,!0)}};
l.Aa=function(a,b){function c(h){h++;if(h>=b.length)0<g.length?N(a,g,!0):N(a,d);else{b[h].b!=e&&(e=b[h].b,f=a.a.objectStore(e));var k=f["delete"](b[h].a);k.onsuccess=function(){d++;c(h)};k.onerror=function(a){a.preventDefault();g[h]=k.error;c(h)}}}var d=0,e,f,g=[];c(-1)};
l.la=function(a,b,c){var d=a.a.objectStore(b),e=d.count(c);e.onsuccess=function(b){var e=b.target.result,h=d["delete"](c);h.onsuccess=function(){N(a,e)};h.onerror=function(){N(a,h.error,!0)}};e.onerror=function(b){b.preventDefault();N(a,e.error,!0)}};l.oa=function(a,b,c){var d=a.a.objectStore(b)["delete"](c);d.onsuccess=function(){N(a,void 0)};d.onerror=function(b){b.preventDefault();N(a,d.error,!0)}};
l.za=function(a,b,c,d){var e=[],f=a.a.objectStore(b).index(c).openCursor(d),g=0;f.onsuccess=function(b){var c=b.target.result;if(c){var d=c["delete"]();d.onsuccess=function(){g++;c["continue"]()};d.onerror=function(a){e.push(d.error);a.preventDefault();c["continue"]()}}else 0<e.length?N(a,e,!0):N(a,g)};f.onerror=function(b){b.preventDefault();N(a,f.error,!0)}};
l.Y=function(a,b){for(var c=b.length,d=0,e=0;e<c;e++){var f=a.a.objectStore(b[e]).clear();f.onsuccess=function(){d++;d==c&&N(a,d)};f.onerror=function(b){d++;b.preventDefault();d==c&&N(a,f.error,!0)}}};
l.ca=function(a,b,c){var d=a.a.objectStore(b),e=d.get(c);e.onsuccess=function(b){var c=b.target.result;if(!d.keyPath&&0==d.indexNames.length&&ub&&z(c)&&0<=c.indexOf(";base64,")){'"'==c.charAt(0)&&'"'==c.charAt(c.length-1)&&(c=c.substr(1,c.length-2));c=c.split(";base64,");b=c[0].split(":")[1];for(var c=window.atob(c[1]),e=c.length,k=new Uint8Array(e),m=0;m<e;++m)k[m]=c.charCodeAt(m);N(a,new Blob([k.buffer],{type:b}))}else N(a,b.target.result)};e.onerror=function(b){b.preventDefault();N(a,e.error,!0)}};
l.ta=function(a,b,c){function d(b){if(null==c[b])if(f++,e[b]=void 0,f==h)N(a,e);else{var m=b+10;m<h&&d(m)}var n;n=g.get(c[b]);n.onsuccess=function(c){f++;e[b]=c.target.result;f==h?N(a,e):(c=b+10,c<h&&d(c))};n.onerror=function(b){f++;b.preventDefault();N(a,n.error,!0)}}var e=[];e.length=c.length;var f=0,g=a.a.objectStore(b),h=c.length;if(0<h)for(b=0;10>b&&b<h;b++)d(b);else N(a,[])};
l.ua=function(a,b){function c(f){var h=b[f],k=a.a.objectStore(h.b).get(h.a);k.onsuccess=function(h){e++;d[f]=h.target.result;e==b.length?N(a,d):(h=f+10,h<b.length&&c(h))};k.onerror=function(b){e++;b.preventDefault();N(a,k.error,!0)}}var d=[];d.length=b.length;var e=0;if(0<b.length)for(var f=0;10>f&&f<b.length;f++)c(f);else N(a,[])};
l.qa=function(a,b,c,d){b=a.a.objectStore(b);c&&R(c);var e;null!=d?(d=b.index(d),e=null!=c?d.count(c):d.count()):e=null!=c?b.count(c):b.count();e.onsuccess=function(b){N(a,b.target.result)};e.onerror=function(b){b.preventDefault();N(a,e.error,!0)}};
l.Q=function(a,b,c,d,e,f,g,h,k,m){var n=[],p=a.a.objectStore(c),u=h?k?"prevunique":"prev":k?"nextunique":"next";c=Tb(a)+" "+b+" "+c+(d?":"+d:"")+(e?R(e):"");h&&(c+=" reverse");k&&(c+=" unique");if(m&&r(m[0])){k=d?!r(m[1]):!0;var t=m[0],x=e?e.lower:void 0,w=e?e.upper:void 0,D=e?!!e.lowerOpen:!1;e=e?!!e.upperOpen:!1;e=dc(h?new Q(x,t,D,k):new Q(t,w,k,e));c+=" starting from "+R(m[0]);r(m[1])&&(c+=", "+R(m[1]))}var J;J=1==b||2==b||3==b?d?p.index(d).openKeyCursor(e,u):p.openCursor(e,u):d?p.index(d).openCursor(e,
u):p.openCursor(e,u);var I=!1;J.onsuccess=function(c){if(c=c.target.result){if(!I){if(0<g){I=!0;c.advance(g);return}if(m&&d&&r(m[0]))if(r(m[1])){var e=Db.cmp(c.key,m[0]),k=h?-1:1;if(0==e){e=Db.cmp(c.primaryKey,m[1]);if(0==e){I=!0;c["continue"]();return}if(e==k)I=!0;else{c["continue"]();return}}else I=!0}else I=!0;else I=!0}1==b?n.push(c.key):2==b?n.push(c.primaryKey):3==b?(k={},d&&(k[d]=c.key),p.keyPath?k[p.keyPath]=c.primaryKey:k._ROWID_=c.primaryKey,n.push(k)):4==b?n.push(c.value):n.push([c.key,
c.primaryKey,c.value]);if(n.length<f)c["continue"]();else m&&(m[0]=cc(c.key),m[1]=cc(c.primaryKey)),N(a,n)}else m&&(m[0]=void 0,m[1]=void 0),N(a,n)};J.onerror=function(b){b.preventDefault();N(a,J.error,!0)}};function Gd(a,b,c){a=["ydn.db",a];r(b)&&(a.push(b),r(c)&&(a.push(c),r(void 0)&&a.push(Gb(void 0))));return a.join("^|")};function Y(a,b){this.key=a;this.a=b}function Hd(a,b){var c=Vb(a.key,b.key);return 0===c?null!=a.a?null!=b.a?Vb(a.a,b.a):1:null!=b.a?-1:0:c};function Id(a){this.t=a||Jd}function Jd(a,b){return String(a)<String(b)?-1:String(a)>String(b)?1:0}l=Id.prototype;l.o=null;l.t=null;l.B=null;l.A=null;
l.add=function(a){if(null==this.o)return this.A=this.B=this.o=new Kd(a),!0;var b=null;Ld(this,function(c){var d=null,e=this.t(c.value,a);0<e?(d=c.left,null==c.left&&(b=new Kd(a,c),c.left=b,c==this.B&&(this.B=b))):0>e&&(d=c.right,null==c.right&&(b=new Kd(a,c),c.right=b,c==this.A&&(this.A=b)));return d});b&&(Ld(this,function(a){a.count++;return a.parent},b.parent),Md(this,b.parent));return!!b};
function Nd(a,b){Ld(a,function(a){var d=null,e=this.t(a.value,b);0<e?d=a.left:0>e?d=a.right:Od(this,a);return d})}l.clear=function(){this.A=this.B=this.o=null};l.contains=function(a){var b=!1;Ld(this,function(c){var d=null,e=this.t(c.value,a);0<e?d=c.left:0>e?d=c.right:b=!0;return d});return b};l.indexOf=function(a){var b=-1,c=0;Ld(this,function(d){var e=this.t(d.value,a);if(0<e)return d.left;d.left&&(c+=d.left.count);if(0>e)return c++,d.right;b=c;return null});return b};
function Ld(a,b,c){for(c=c?c:a.o;c&&null!=c;)c=b.call(a,c)}function Md(a,b){Ld(a,function(a){var b=a.left?a.left.a:0,e=a.right?a.right.a:0;1<b-e?(a.left.right&&(!a.left.left||a.left.left.a<a.left.right.a)&&Pd(this,a.left),Qd(this,a)):1<e-b&&(a.right.left&&(!a.right.right||a.right.right.a<a.right.left.a)&&Qd(this,a.right),Pd(this,a));b=a.left?a.left.a:0;e=a.right?a.right.a:0;a.a=Math.max(b,e)+1;return a.parent},b)}
function Pd(a,b){Rd(b)?(b.parent.left=b.right,b.right.parent=b.parent):Sd(b)?(b.parent.right=b.right,b.right.parent=b.parent):(a.o=b.right,a.o.parent=null);var c=b.right;b.right=b.right.left;null!=b.right&&(b.right.parent=b);c.left=b;b.parent=c;c.count=b.count;b.count-=(c.right?c.right.count:0)+1}
function Qd(a,b){Rd(b)?(b.parent.left=b.left,b.left.parent=b.parent):Sd(b)?(b.parent.right=b.left,b.left.parent=b.parent):(a.o=b.left,a.o.parent=null);var c=b.left;b.left=b.left.right;null!=b.left&&(b.left.parent=b);c.right=b;b.parent=c;c.count=b.count;b.count-=(c.left?c.left.count:0)+1}
function Od(a,b){if(null!=b.left||null!=b.right){var c=null,d;if(null!=b.left){d=Td(a,b.left);Ld(a,function(a){a.count--;return a.parent},d);if(d!=b.left){if(d.parent.right=d.left)d.left.parent=d.parent;d.left=b.left;d.left.parent=d;c=d.parent}d.parent=b.parent;d.right=b.right;d.right&&(d.right.parent=d);b==a.A&&(a.A=d)}else{d=Ud(a,b.right);Ld(a,function(a){a.count--;return a.parent},d);if(d!=b.right){if(d.parent.left=d.right)d.right.parent=d.parent;d.right=b.right;d.right.parent=d;c=d.parent}d.parent=
b.parent;d.left=b.left;d.left&&(d.left.parent=d);b==a.B&&(a.B=d)}d.count=b.count;Rd(b)?b.parent.left=d:Sd(b)?b.parent.right=d:a.o=d;Md(a,c?c:d)}else Ld(a,function(a){a.count--;return a.parent},b.parent),Rd(b)?(b.parent.left=null,b==a.B&&(a.B=b.parent),Md(a,b.parent)):Sd(b)?(b.parent.right=null,b==a.A&&(a.A=b.parent),Md(a,b.parent)):a.clear()}function Ud(a,b){if(!b)return a.B;var c=b;Ld(a,function(a){var b=null;a.left&&(b=c=a.left);return b},b);return c}
function Td(a,b){if(!b)return a.A;var c=b;Ld(a,function(a){var b=null;a.right&&(b=c=a.right);return b},b);return c}function Kd(a,b){this.value=a;this.parent=b?b:null;this.count=1}Kd.prototype.left=null;Kd.prototype.right=null;Kd.prototype.a=1;function Sd(a){return!!a.parent&&a.parent.right==a}function Rd(a){return!!a.parent&&a.parent.left==a};function Vd(a){this.t=a||Jd}C(Vd,Id);function Wd(a,b,c){if(a.o){var d;if(c instanceof Kd)d=c;else if(c){if(Ld(a,function(a){var b=null;0<this.t(a.value,c)?(b=a.left,d=a):0>this.t(a.value,c)?b=a.right:d=a;return b}),!d)return}else d=Ud(a);a=d;for(var e=d.left?d.left:d;null!=a;)if(null!=a.left&&a.left!=e&&a.right!=e)a=a.left;else{if(a.right!=e&&b(a))return;var f=a;a=null!=a.right&&a.right!=e?a.right:a.parent;e=f}b(null)}}
function Xd(a,b,c){if(a.o){var d;if(c instanceof Kd)d=c;else if(c){if(Ld(a,fa(function(a){var b=null;0<this.t(a.value,c)?b=a.left:(0>this.t(a.value,c)&&(b=a.right),d=a);return b},a)),!d)return}else d=Td(a);a=d;for(var e=d.right?d.right:d;null!=a;)if(null!=a.right&&a.right!=e&&a.left!=e)a=a.right;else{if(a.left!=e&&b(a))return;var f=a;a=null!=a.left&&a.left!=e?a.left:a.parent;e=f}b(null)}};function Yd(a,b,c){this.e=a;this.storage=b;this.b=c;this.a={};a=this.b.keyPath;this.c=v(a)?a.join(","):a||"_ROWID_";this.a[this.c]=null;this.d=Gd(this.e,this.b.getName(),this.c)+"^|"}
function Zd(a,b){var c=b||a.c;if(!a.a[c]){a.a[c]=new Vd(Hd);for(var d=a.storage.length,e=0;e<d;e++){var f=a.storage.key(e);if(null!==f&&0==f.lastIndexOf(a.d,0)){var g=Jb(f.substr(a.d.length));if(c==a.c)a.a[c].add(new Y(g));else{var h=a.storage.getItem(f);if(null!==h)if(f=vc(a.b,c),h=Nc(h),h=lc(f,h),f.multiEntry){if(v(h))for(f=0;f<h.length;f++)a.a[c].add(new Y(h[f],g))}else a.a[c].add(new Y(h,g))}}}}return a.a[c]}
function $d(a,b,c){for(var d in a.a){var e=a.a[d];if(e)if(d==a.c)Nd(e,new Y(b));else{var f=vc(a.b,d),f=Eb(c,f.keyPath);Nd(e,new Y(b,f))}}}function ae(a){for(var b in a.a){var c=a.a[b];c&&c.clear()}a.a={}}
function be(a,b,c,d){if(null==b&&(a.b.keyPath&&(b=Cc(a.b,c)),a.b.b&&null==b)){b=a.d+Gb(void 0);var e=Nc(a.storage.getItem(b));e.key_count||(e.key_count=0);e.key_count++;a.storage.setItem(b,R(e));b=e.key_count}d&&(d=null!==a.storage.getItem(a.d+Gb(b)));if(d)return null;a.storage.setItem(a.d+Gb(b),R(c));d=b;for(var f in a.a)if(e=a.a[f])if(f==a.c)e.add(new Y(d));else{var g=vc(a.b,f),g=Eb(c,g.keyPath);null!=g&&e.add(new Y(d,g))}return b}
function ce(a,b){var c=a.d+Gb(b),d=a.storage.getItem(c);if(null===d)return 0;a.storage.removeItem(c);c=Nc(d);$d(a,b,c);return 1}Yd.prototype.clear=function(){ae(this);de(this)};function ee(a,b){var c=a.storage.getItem(a.d+Gb(b)),d=void 0;if(null!==c)for(var d=Nc(c),c=0,e=a.b.a.length;c<e;c++){var f=a.b.index(c);if("DATE"==f.type){var g=lc(f,d);g&&mc(f,d,new Date(g))}}return d}Yd.prototype.getName=function(){return this.b.getName()};
function fe(a,b,c){b=b||a.c;a=Zd(a,b);var d=null,e=null,f=0,g=!1,h=!1;null!=c&&(null!=c.lower&&(d=new Y(c.lower)),null!=c.upper&&(e=new Y(c.upper)),g=c.lowerOpen,h=c.upperOpen);Wd(a,function(a){if(null!=a&&(a=a.value,!g||null==d||0!=Vb(a.key,d.key))){if(null!=e&&(a=Vb(a.key,e.key),1===a||0===a&&h))return!0;f++}},d);return f}
function de(a,b){var c=Zd(a,a.c),d=null,e=null,f=0,g=[],h=[],k=!1,m=!1;null!=b&&(null!=b.lower&&(d=new Y(b.lower)),null!=b.upper&&(e=new Y(b.upper)),k=b.lowerOpen,m=b.upperOpen);Wd(c,function(b){if(null!=b&&(b=b.value,!k||null==d||0!=Hd(b,d))){if(null!=e){var c=Hd(b,e);if(1===c||0===c&&m)return!0}var c=a.d+Gb(b.key),u=a.storage.getItem(c);null!==u&&(a.storage.removeItem(c),f++,10>g.length&&(g.push(b.key),h.push(Nc(u))))}},d);if(10>g.length)for(c=0;c<g.length;c++)$d(a,g[c],h[c]);else ae(a);return f}
function ge(a,b,c,d,e,f,g,h,k){function m(c){if(c&&(D++,!(D<g))){var d=c.value;if(e){if(I&&null!=w&&(c=u?Hd(d,w):Vb(d.key,w.key),0==c))return;if(null!=x&&(c=u?Hd(d,x):Vb(d.key,x.key),-1==c||0==c&&J))return k&&(k[0]=void 0,k[1]=void 0),!0}else{if(J&&null!=x&&(c=u?Hd(d,x):Vb(d.key,x.key),0==c))return;if(null!=w&&(c=u?Hd(d,w):Vb(d.key,w.key),1==c||0==c&&I))return k&&(k[0]=void 0,k[1]=void 0),!0}c=d.key;if(!h||!t||null==p||0!=Vb(p,c)){d=t?d.a:c;if(2==b)n.push(d);else if(1==b)n.push(c);else if(3==b)n.push([c,
d]);else if(4==b){var m=ee(a,d);n.push(m)}else n.push([c,d,ee(a,d)]);k&&(k[0]=c,k[1]=d)}p=c;if(r(f)&&n.length>=f)return!0}}var n=[],p,u=!!k&&null!=k[0];c=c||a.c;var t=c!=a.c;c=Zd(a,c);var x=null,w=null;r(g)||(g=0);var D=-1,J=!1,I=!1;null!=d&&(null!=d.lower&&(x=t&&e?new Y(d.lower,"\uffff"):new Y(d.lower)),null!=d.upper&&(w=t&&!e?new Y(d.upper,"\uffff"):new Y(d.upper)),J=!!d.lowerOpen,I=!!d.upperOpen);if(u){e?I=!0:J=!0;d=k[0];var Z=r(k[1])?k[1]:"\uffff";e?w=t?new Y(d,Z):new Y(d):x=t?new Y(d,Z):new Y(d)}e?
Xd(c,m,w):Wd(c,m,x);return n}Yd.prototype.Ua=function(a,b){return ge(this,2,a,b,void 0,void 0,void 0)};function he(){this.clear()}l=he.prototype;l.pa=function(){return this};l.setItem=function(a,b){r(this.a[a])||(this.keys.push(a.toString()),this.length=this.keys.length);this.a[a]=b};l.getItem=function(a){return r(this.a[a])?this.a[a]:null};l.removeItem=function(a){delete this.a[a];var b=this.keys;a=ra(b,a.toString());0<=a&&qa.splice.call(b,a,1);this.length=this.keys.length};l.length=0;l.key=function(a){a=this.keys[a];return r(a)?this.a[a]:null};
l.clear=function(){this.a={};this.keys=[];this.length=0};function ie(a){this.g=a||new he;this.e={}}function je(a,b){var c=T(a.a,b);if(c)a.e[b]||(a.e[b]=new Yd(a.d,a.c,c));else throw new qb('store name "'+b+'" not found.');return a.e[b]}ie.prototype.s=function(a){var b=this;setTimeout(function(){var c=Gd(b.d),c=b.c.getItem(c),c=new Sc(c);a(c)},10)};function ke(a,b){this.b=a;this.a=b}ke.prototype.f=function(a,b){var c=this.b;setTimeout(function(){a.call(b,c)},4);var d=this;return function(){d.a("complete",null);d.a=null;d.b=null}};function xd(a,b){this.a=b}C(xd,kd);l=xd.prototype;l.logger=null;l.xa=function(a,b,c){this.v(a,!0,!1,null,b,c)};l.v=function(a,b,c,d,e,f){var g=a.a.f(function(h){var k;if(c)k=je(h,d),h=f?f[0]:void 0,h=be(k,h,e[0],!b),null!=h?N(a,h):(k=new ed(""),N(a,k,!0));else{for(var m=d,n=[],p=!1,u=f||{},t=0;t<e.length;t++){var x;d?x=u[t]:(m=f[t],x=m.a,m=m.b);k&&k.getName()==m||(k=je(h,m));x=be(k,x,e[t],!b);null!=x?n.push(x):(p=!0,n.push(new ed))}N(a,n,p)}g();g=null},this)};
l.ya=function(){throw new ob("putData");};l.ca=function(a,b,c){var d=a.a.f(function(e){e=ee(je(e,b),c);N(a,e);d();d=null},this)};function le(a,b,c,d){var e=b.a.f(function(a){for(var g=[],h=c,k,m=0;m<d.length;m++){var n=d[m];n instanceof P&&(h=n,n=h.a,h=h.b);k&&k.getName()==h||(k=je(a,h));n=ee(k,n);g[m]=n}N(b,g,!1);e();e=null},a)}l.ta=function(a,b,c){le(this,a,b,c)};l.ua=function(a,b){le(this,a,null,b)};l.ka=function(a,b,c){var d=a.a.f(function(e){e=ce(je(e,b),c);N(a,e);d();d=null},this)};
l.Aa=function(a,b){var c,d=0,e=a.a.f(function(f){for(var g=0;g<b.length;g++){var h=b[g].b,k=b[g].a;c&&c.getName()==h||(c=je(f,h));d+=ce(c,k)}N(a,d);e();e=null},this)};l.oa=function(a,b,c){this.la(a,b,c)};l.la=function(a,b,c){c&&R(c);var d=a.a.f(function(e){e=de(je(e,b),c);N(a,e);d();d=null},this)};l.za=function(a,b,c,d){d&&R(d);var e=a.a.f(function(f){f=je(f,b);for(var g=f.Ua(c,d),h=g.length,k=0;k<h;k++)ce(f,g[k]);N(a,h);e();e=null},this)};
l.Y=function(a,b){var c=a.a.f(function(d){for(var e=0;e<b.length;e++)je(d,b[e]).clear();N(a,b.length);c();c=null},this)};l.$=function(a,b){var c=a.a.f(function(d){for(var e=[],f=0;f<b.length;f++){var g=je(d,b[f]);e.push(fe(g))}N(a,e);c();c=null},this)};l.qa=function(a,b,c,d){var e=a.a.f(function(f){f=fe(je(f,b),d,c);N(a,f);e();e=null},this)};l.Q=function(a,b,c,d,e,f,g,h,k,m){e&&Oc(e);var n=a.a.f(function(p){p=ge(je(p,c),b,d,e,h,f,g,k,m);N(a,p);n();n=null},this)};function wd(a,b){this.a=b}C(wd,kd);l=wd.prototype;l.logger=null;
function me(a,b){if(b.M&&!b.keyPath&&0==b.a.length&&a._default_){var c=a._default_;if(-1==c.indexOf(";base64,"))return Nc(c);'"'==c.charAt(0)&&'"'==c.charAt(c.length-1)&&(c=c.substr(1,c.length-2));for(var d=c.split(";base64,"),c=d[0].split(":")[1],d=window.atob(d[1]),e=d.length,f=new Uint8Array(e),g=0;g<e;++g)f[g]=d.charCodeAt(g);return new Blob([f.buffer],{type:c})}c=a._default_?Nc(a._default_):{};null!=b.keyPath&&(d=nc(a[b.keyPath],b.type),null!=d&&Dc(b,c,d));for(d=0;d<b.a.length;d++)e=b.index(d),
f=e.d,"_default_"==f||e.g||e.multiEntry||"DATE"!=e.type&&!b.M||(f=nc(a[f],e.type),r(f)&&mc(e,c,f));return c}l.ya=function(){throw new ob("putData");};
l.v=function(a,b,c,d,e,f){function g(b,d){if(null==e[b])if(n++,n==e.length)N(a,m,p);else{var x=b+2;x<e.length&&g(x,d)}var w;w=r(f)?Ec(h,e[b],f[b]):Ec(h,e[b]);x=k+wc(h)+" ("+w.Sa.join(", ")+") VALUES ("+w.cb.join(", ")+");";d.executeSql(x,w.L,function(f,x){function I(a,b){var c="ydn.db.me:"+h.getName()+":"+a.getName(),c=k+pa(c)+" ("+h.c+", "+a.c+") VALUES (?, ?)",e=[hc(Z,h.type),hc(b,a.type)];d.executeSql(c,e,function(){},function(){return!1})}n++;var Z=r(w.key)?w.key:x.insertId;1>x.rowsAffected&&
(p=!0,Z=new ed(Z+" no-op"));for(var ga=0,la=h.a.length;ga<la;ga++){var gb=h.index(ga);if(gb.multiEntry)for(var hb=Eb(e[b],gb.keyPath),ib=(hb?hb.length:0)||0,Ra=0;Ra<ib;Ra++)I(gb,hb[Ra])}c?N(a,Z):(m[b]=Z,n==e.length?N(a,m,p):(ga=b+2,ga<e.length&&g(ga,f)))},function(d,f){n++;p=!0;6==f.code&&(f.name="ConstraintError");if(c)N(a,f,!0);else if(m[b]=f,n==e.length)N(a,m,p);else{var h=b+2;h<e.length&&g(h,d)}return!1})}b=!b;var h=T(this.a,d),k=b?"INSERT INTO ":"INSERT OR REPLACE INTO ";d=a.a;var m=[],n=0,p=
!1;if(0<e.length)for(b=0;2>b&&b<e.length;b++)g(b,d);else N(a,[])};
l.xa=function(a,b,c){if(0==c.length)N(a,[]);else{for(var d=[],e=0,f=0,g=this,h=function(h,k){for(var m=[],n=Bc(T(g.a,h)),p=n?void 0:[],u=0;u<k.length;u++)m.push(b[k[u]]),n||p.push(c[k[u]].a);n=Qb(a);fb(n,function(b){for(var c=0;c<k.length;c++)d[k[c]]=b[c];e++;e==f&&N(a,d)},function(){e++;e==f&&N(a,d,!0)});g.v(n,!1,!1,h,m,p)},k="",m=[],n=[],p=0;p<c.length;p++){var u=c[p].b,t=c[p].a;u!=k?(f++,0<m.length&&h(k,m),m=[p],n=[t],k=u):(m.push(p),n.push(t))}0<m.length&&h(k,m)}};
l.ca=function(a,b,c){var d=a.a,e=T(this.a,b);b=e.c;c=[hc(c,e.type)];b="SELECT * FROM "+wc(e)+" WHERE "+b+" = ?";d.executeSql(b,c,function(b,c){if(0<c.rows.length){var d=c.rows.item(0);null!=d?(d=me(d,e),N(a,d)):N(a,void 0)}else N(a,void 0)},function(b,c){N(a,c,!0);return!1})};
l.ta=function(a,b,c){function d(b,e){var n=h.c,p=[hc(c[b],h.type)],n="SELECT * FROM "+wc(h)+" WHERE "+n+" = ?";e.executeSql(n,p,function(e,m){g++;if(0<m.rows.length){var n=m.rows.item(0);null!=n&&(f[b]=me(n,h))}else f[b]=void 0;g==c.length?N(a,f):(n=b+10,n<c.length&&d(n,e))},function(e){g++;if(g==c.length)N(a,f);else{var h=b+10;h<c.length&&d(h,e)}return!1})}var e=a.a,f=[],g=0,h=T(this.a,b);if(0<c.length)for(b=0;10>b&&b<c.length;b++)d(b,e);else N(a,[])};
l.ua=function(a,b){function c(d,h){var n=b[d],p=T(e.a,n.b),u=bc(n),n=p.c,u=[hc(u,p.type)],n="SELECT * FROM "+wc(p)+" WHERE "+n+" = ?";h.executeSql(n,u,function(e,h){g++;if(0<h.rows.length){var m=h.rows.item(0);null!=m&&(f[d]=me(m,p))}else f[d]=void 0;g==b.length?N(a,f):(m=d+10,m<b.length&&c(m,e))},function(b,c){N(a,c,!0);return!1})}var d=a.a,e=this,f=[],g=0;if(0<b.length)for(var h=0;10>h&&h<b.length;h++)c(h,d);else N(a,[])};
l.Y=function(a,b){function c(d,g){function h(a){a="ydn.db.me:"+k.getName()+":"+a.getName();a="DELETE FROM  "+pa(a);g.executeSql(a,[])}var k=T(e.a,b[d]),m="DELETE FROM  "+wc(k);g.executeSql(m,[],function(e){d==b.length-1?N(a,b.length):c(d+1,e)},function(b,c){N(a,c,!0);return!1});for(var m=0,n=k.a.length;m<n;m++){var p=k.index(m);p.multiEntry&&h(p)}}var d=a.a,e=this;0<b.length?c(0,d):N(a,0)};
l.Aa=function(a,b){function c(h){if(h>=b.length)N(a,f,g);else{var k=T(e.a,b[h].b),m=hc(b[h].a,k.type),n=" WHERE "+k.c+" = ?",p="DELETE FROM "+wc(k)+n;d.executeSql(p,[m],function(){f++;c(h)},function(){g=!0;c(h);return!1});h++;for(var p=function(a){a="ydn.db.me:"+k.getName()+":"+a.getName();a="DELETE FROM  "+pa(a)+n;d.executeSql(a,[m])},u=0,t=k.a.length;u<t;u++){var x=k.index(u);x.multiEntry&&p(x)}}}var d=a.a,e=this,f=0,g=!1;c(0)};
l.ka=function(a,b,c){function d(a){a="ydn.db.me:"+f.getName()+":"+a.getName();a="DELETE FROM  "+pa(a)+h;e.executeSql(a,[g])}var e=a.a,f=T(this.a,b),g=hc(c,f.type),h=" WHERE "+f.c+" = ?";b="DELETE FROM "+wc(f)+h;e.executeSql(b,[g],function(b,c){N(a,c.rowsAffected)},function(b,c){N(a,c,!0);return!1});b=0;for(c=f.a.length;b<c;b++){var k=f.index(b);k.multiEntry&&d(k)}};l.oa=function(a,b,c){ne(this,a,b,void 0,c)};l.la=function(a,b,c){ne(this,a,b,void 0,c)};l.za=function(a,b,c,d){ne(this,a,b,c,d)};
function ne(a,b,c,d,e){function f(a){a="ydn.db.me:"+h.getName()+":"+a.getName();a="DELETE FROM  "+pa(a)+m;g.executeSql(a,k)}var g=b.a,h=T(a.a,c);a="DELETE FROM "+wc(h);c=[];var k=[],m="";null!=e&&(r(d)?(d=vc(h,d),gc(d.c,d.type,e,k,c)):gc(h.c,h.type,e,k,c),m=" WHERE "+k.join(" AND "));g.executeSql(a+m,c,function(a,c){N(b,c.rowsAffected)},function(a,c){N(b,c,!0);return!1});e=0;for(d=h.a.length;e<d;e++)a=h.index(e),a.multiEntry&&f(a)}
l.$=function(a,b){function c(f){var g="SELECT COUNT(*) FROM "+pa(b[f]);d.executeSql(g,[],function(d,g){var m=g.rows.item(0);e[f]=parseInt(m["COUNT(*)"],10);f++;f==b.length?N(a,e):c(f)},function(b,c){N(a,c,!0);return!1})}var d=a.a,e=[];0==b.length?N(a,0):c(0)};l.qa=function(a,b,c,d,e){var f=[];b=tc(T(this.a,b),f,6,d,c,!1,e);a.a.executeSql(b,f,function(b,c){var d;a:{if(d=c.rows.item(0))for(var e in d)if(d.hasOwnProperty(e)){d=d[e];break a}d=void 0}N(a,d)},function(b,c){N(a,c,!0);return!1})};
l.Q=function(a,b,c,d,e,f,g,h,k,m){var n=[],p=T(this.a,c),u=p.g,t=p.type,x=t,w=null!=d&&d!==u?vc(p,d):null,D=d||u;w&&(x=w.type);c=[];if(m&&r(m[0])){var J=m[0];w&&r(m[1])?(d=m[1],e=yc(p,b,c,w.getName(),e,J,d,h,k)):e=xc(p,b,c,d,e,h,k,J)}else e=tc(p,c,b,D,e,h,k);A(f)&&(e+=" LIMIT "+f);A(g)&&(e+=" OFFSET "+g);R(c);a.a.executeSql(e,c,function(c,d){for(var e=d.rows.length,f,g=0;g<e;g++)f=d.rows.item(g),2==b?n[g]=nc(f[u],t):1==b?n[g]=nc(f[D],x):3==b?n[g]=[nc(f[D],x),nc(f[u],t)]:null!=f&&(n[g]=me(f,p));m&&
f&&(m[0]=nc(f[D],x),m[1]=nc(f[u],t));N(a,n)},function(b,c){N(a,c,!0);return!1})};var oe;oe=!1;var pe=za;pe&&(-1!=pe.indexOf("Firefox")||-1!=pe.indexOf("Camino")||-1!=pe.indexOf("iPad")||-1!=pe.indexOf("iPhone")||-1!=pe.indexOf("iPod")||-1!=pe.indexOf("Chrome")||-1!=pe.indexOf("Android")||-1!=pe.indexOf("Safari")&&(oe=!0));var qe=oe;function re(a,b){this.j=null;this.W=b||NaN}l=re.prototype;
l.P=function(a,b){function c(a,c){for(var d=0;d<b.a.length;d++)se(a,c,b.a[d]);for(var e=a.objectStoreNames,f=e.length,d=0;d<f;d++)Uc(b,e[d])||a.deleteObjectStore(e[d])}function d(a,b){f.c||(r(b)?(e.j=null,f.h(b)):(e.j=a,e.j.onabort=function(){},e.j.onerror=function(){},e.j.onversionchange=function(a){if(e.j&&(e.j.onabort=null,e.j.onblocked=null,e.j.onerror=null,e.j.onversionchange=null,!a.defaultPrevented)){e.j.close();e.j=null;var b=Error();b.name=a.type;e.ia(b)}},f.callback(parseFloat(g))))}var e=
this,f=new G,g=void 0,h=b.version,k;k=r(h)?Db.open(a,h):Db.open(a);k.onsuccess=function(f){var h=f.target.result;r(g)||(g=h.version);if(b.U)e.s(function(e){if(b instanceof Wc)for(var f=0;f<e.a.length;f++)Uc(b,e.a[f].getName())||Xc(b,e.a[f].clone());if(0<Vc(b,e,!1,!0).length)if(e=A(h.version)?h.version+1:1,"IDBOpenDBRequest"in q){h.close();var g=Db.open(a,e);g.onupgradeneeded=function(a){c(a.target.result,g.transaction)};g.onsuccess=function(a){d(a.target.result)};g.onerror=function(){d(null)}}else{var k=
h.setVersion(e+"");k.a=function(a){d(null,a)};k.onsuccess=function(){k.transaction.oncomplete=m;c(h,k.transaction)};var m=function(){var b=Db.open(a);b.onsuccess=function(a){d(a.target.result)};b.onerror=function(){d(null)}};null!=k.transaction&&(k.transaction.oncomplete=m)}else d(h)},void 0,h);else if(b.version>h.version){var k=h.setVersion(b.version);k.a=function(a){d(null,a)};k.onsuccess=function(){c(h,k.transaction)}}else e.s(function(a){a=Vc(b,a,!1,!0);0<a.length?d(null,new Zc("different schema: "+
a)):d(h)},void 0,h)};k.onupgradeneeded=function(a){a=a.target.result;g=NaN;c(a,k.transaction)};k.onerror=function(a){d(null,a)};k.onblocked=function(a){d(null,a)};A(this.W)&&!isNaN(this.W)&&setTimeout(function(){"done"!=k.readyState&&d(null,new jd("connection timeout after "+e.W))},this.W);return f};l.W=18E4;l.ia=function(){};l.va=function(){};l.wa=function(){};l.X=function(){return"indexeddb"};l.Ba=function(){return this.j||null};l.ma=function(){return!!this.j};l.logger=null;l.j=null;
l.Ca=function(){return this.j?parseFloat(this.j.version):void 0};
l.s=function(a,b,c){c=c||this.j;if(r(b)){if(null===b){if(0==c.objectStoreNames.length){a(new Sc(c.version));return}throw new Yc;}c=b.db}else{b=[];for(var d=c.objectStoreNames.length-1;0<=d;d--)b[d]=c.objectStoreNames[d];if(0==b.length){a(new Sc(c.version));return}b=c.transaction(b,Bb)}for(var e=c.objectStoreNames,f=[],g=e.length,d=0;d<g;d++){for(var h=b.objectStore(e[d]),k=[],m=0,n=h.indexNames.length;m<n;m++){var p=h.index(h.indexNames[m]);k[m]=new ic(p.keyPath,void 0,p.unique,p.multiEntry,p.name)}f[d]=
new rc(h.name,h.keyPath,h.autoIncrement,void 0,k)}b=new Sc(c.version,f);a(b)};
function se(a,b,c){function d(){var b={autoIncrement:!!c.b};null!=c.keyPath&&(b.keyPath=c.keyPath);return a.createObjectStore(c.getName(),b)}wb("Creating Object Store for "+c.getName()+" keyPath: "+c.keyPath);if(a.objectStoreNames.contains(c.getName())){b=b.objectStore(c.getName());pc(c.keyPath||"",b.keyPath||"")?(a.deleteObjectStore(c.getName()),wb("store: "+c.getName()+" deleted due to keyPath change."),b=d()):ba(b.autoIncrement)&&ba(c.b)&&b.autoIncrement!=c.b&&(a.deleteObjectStore(c.getName()),
wb("store: "+c.getName()+" deleted due to autoIncrement change."),b=d());for(var e=b.indexNames,f=0;f<c.a.length;f++){var g=c.index(f);!e.contains(g.getName())&&g.e&&(b.clear(),wb("store: "+c.getName()+" cleared since generator index need re-indexing."))}for(var h=0,k=0,m=0,f=0;f<c.a.length;f++){var g=c.index(f),n=!1;if(e.contains(g.getName())){var p=b.index(g.getName()),u=null!=p.unique&&null!=g.unique&&p.unique!=g.unique,t=null!=p.multiEntry&&null!=g.multiEntry&&p.multiEntry!=g.multiEntry,p=null!=
p.keyPath&&null!=g.keyPath&&!!pc(p.keyPath,g.keyPath);if(u||t||p)b.deleteIndex(g.getName()),n=!0,h--,m++}else"BLOB"!=g.type&&(n=!0);n&&(g.unique||g.multiEntry?(n={unique:g.unique,multiEntry:g.multiEntry},b.createIndex(g.getName(),g.keyPath,n)):b.createIndex(g.getName(),g.keyPath),h++)}for(f=0;f<e.length;f++)zc(c,e[f])||(b.deleteIndex(e[f]),k++)}else for(b=d(),f=0;f<c.a.length;f++)g=c.index(f),"BLOB"!=g.type&&(g.unique||g.multiEntry?(n={unique:g.unique,multiEntry:g.multiEntry},b.createIndex(g.getName(),
g.keyPath,n)):b.createIndex(g.getName(),g.keyPath))}l.aa=function(a,b,c,d){var e=this.j;if(!b){b=[];for(var f=e.objectStoreNames.length-1;0<=f;f--)b[f]=e.objectStoreNames[f]}0==b.length?a(null):(b=e.transaction(b,c),b.oncomplete=function(a){d("complete",a)},b.onabort=function(a){d("abort",a)},a(b),a=null)};l.close=function(){this.j.close()};
Wb.push(function(a,b){if(!Db||b&&"indexeddb"!=b)return null;var c=Db.deleteDatabase(a),d=new M("vc");c.onblocked=function(a){for(var b=0;b<d.e.length;b++)d.e[b][0].call(d.e[b][1],a)};c.onerror=function(a){d.h(a)};c.onsuccess=function(a){d.callback(a)};return d});function te(a){ie.call(this,a);this.b=NaN}C(te,ie);l=te.prototype;l.logger=null;l.Ca=function(){return this.b};
l.P=function(a,b){function c(a,b){setTimeout(function(){b?d.h(b):d.callback(a)},10)}var d=new G;this.c=this.g.pa(a);this.d=a;this.a=b;var e=Gd(this.d);this.b=NaN;var f=Nc(this.c.getItem(e));r(f.version)&&!A(f.version)&&(f.version=NaN);if(f)if(f=new Sc(f),Vc(this.a,f,!1,!1))if(!this.a.U&&!isNaN(f.version)&&this.a.version>f.version)c(NaN,new fd(""));else{var g=this.a.version;this.b=r(g)?g:f.version+1;for(g=0;g<this.a.count();g++)var h=this.a.C(g);if(this.a instanceof Wc)for(g=0;g<f.count();g++)h=f.C(g),
Xc(this.a,h);g=this.a.toJSON();g.version=this.b||NaN;this.c.setItem(e,R(g));c(f.version||NaN)}else{for(g=0;g<this.a.count();g++)h=this.a.C(g);this.b=f.version||NaN;c(this.b)}else f=b.toJSON(),this.b=1,f.version=this.b,this.c.setItem(e,R(f)),c(NaN);return d};l.ma=function(){return!!this.d};l.Ba=function(){return this.c||null};l.ia=function(){};l.va=function(){};l.wa=function(){};l.X=function(){return"memory"};l.close=function(){};l.aa=function(a,b,c,d){a(new ke(this,function(a,b){d(a,b)}))};function ue(){te.call(this,this)}C(ue,te);ue.prototype.pa=function(){return window.localStorage};ue.prototype.X=function(){return"localstorage"};Wb.push(function(a,b){if(!b||"localstorage"==b){var c=new ue,d=new Wc;c.P(a,d);c.s(function(a){for(var b=0;b<a.a.length;b++)je(c,a.a[b].getName()).clear()})}});function ve(){te.call(this,this)}C(ve,te);ve.prototype.pa=function(){return window.sessionStorage};ve.prototype.X=function(){return"sessionstorage"};
Wb.push(function(a,b){if(!b||"sessionstorage"==b){var c=new ve,d=new Wc;c.P(a,d);c.s(function(a){for(var b=0;b<a.a.length;b++)je(c,a.a[b].getName()).clear()})}});function we(a,b){this.a=r(a)?a:4194304;this.b=b||"websql"}l=we.prototype;
l.P=function(a,b){function c(a,b){var c=a.version?parseInt(a.version,10):0,f=!1,g=0;a.changeVersion(a.version,(b.U?isNaN(c)?1:c+1:b.version)+"",function(c){e.s(function(a){f=!0;for(var d=0;d<b.count();d++){var e=T(a,b.C(d).getName()),e=e?Ac(e,b.C(d)):null;xe(c,b.C(d),function(a){a&&g++},e)}for(d=0;d<a.count();d++)e=a.C(d),Uc(b,e.getName())||(b instanceof Wc?Xc(b,e):(e="DROP TABLE "+wc(e),c.executeSql(e,[],function(){},function(a,b){throw b;})))},c,a)},function(a){throw a;},function(){f&&d(a)})}function d(a,
b){r(b)?(e.n=null,g.h(b)):(e.n=a,g.callback(parseFloat(f)))}var e=this,f=NaN,g=new G,h=null;try{"sqlite"==this.b?q.sqlitePlugin?(h=q.sqlitePlugin.openDatabase(a,"",a,this.a),h.readTransaction||(h.readTransaction=h.transaction),h.changeVersion=function(a,b,c,d,e){h.transaction(c,d,e)}):(h=null,this.fa=Error("sqlitePlugin not found.")):h=q.openDatabase(a,"",a,this.a)}catch(k){if("SECURITY_ERR"==k.name)h=null,this.fa=new id(k);else throw k;}h?(f=h.version||"",null!=b.version&&b.version==h.version?d(h):
this.s(function(a){Vc(b,a,!0,!1)?c(h,b):d(h)},null,h)):d(null,this.fa);return g};l.X=function(){return this.b};l.fa=null;l.n=null;l.Ba=function(){return this.n||null};l.logger=null;l.ia=function(){};l.va=function(){};
function ye(a){var b=a.p,c="CREATE TABLE IF NOT EXISTS "+wc(a)+" (",d=a.c,c=c+(d+" "+b+" PRIMARY KEY ");a.b&&(c+=" AUTOINCREMENT ");if(!a.M||!a.keyPath&&0==a.a.length)c+=" ,_default_ BLOB";for(var e=[],f=[d],g=0,h=a.a.length;g<h;g++){var k=a.index(g),m="";if(k.multiEntry){var m="ydn.db.me:"+a.getName()+":"+k.getName(),n=k.unique?" UNIQUE ":"",k="CREATE TABLE IF NOT EXISTS "+pa(m)+" ("+d+" "+b+", "+k.c+" "+k.i+n+")";e.push(k)}else k.unique&&(m=" UNIQUE "),n=k.c,-1==f.indexOf(n)&&(c+=", "+n+" "+k.i+
m,f.push(n))}e.unshift(c+")");return e}l.Ca=function(){return this.n?parseFloat(this.n.version):void 0};
l.s=function(a,b,c){function d(a,b){throw b;}function e(b,c){if(c&&c.rows){for(var d=0;d<c.rows.length;d++){var e=c.rows.item(d);if("__WebKitDatabaseInfoTable__"!=e.name&&"sqlite_sequence"!=e.name&&"table"==e.type){var f="sql"in e?e.sql:void 0,t=f.substr(f.indexOf("("),f.lastIndexOf(")")).match(/(?:"[^"]*"|[^,])+/g),x=void 0,w,f=[],D=!1,J=!1,I=0;for(;I<t.length;I++){var Z=t[I].match(/\w+|"[^"]+"/g),ga=sa(Z,function(a){return a.toUpperCase()}),la=ma(Z[0]),Z=jc(ga[1]);if(-1!=ga.indexOf("PRIMARY")&&
-1!=ga.indexOf("KEY")){w=Z;if(z(la)&&!/^[\s\xa0]*$/.test(la)&&"_ROWID_"!=la){var gb=la.split(","),x=la;1<gb.length&&(x=gb,w=void 0)}-1!=ga.indexOf("AUTOINCREMENT")&&(D=!0)}else if("_ROWID_"!=la)if("_default_"==la)J=!0;else{var hb="UNIQUE"==ga[2];0==la.lastIndexOf(e.tbl_name+"-",0)&&(la=la.substr(e.tbl_name.length+1));ga=new ic(la,Z,hb);f.push(ga)}}if(0==e.name.lastIndexOf("ydn.db.me:",0)){var ib=e.name.split(":");if(3<=ib.length){var Ra=ib[1],x=new ic(ib[2],Z,hb,!0),t=va(f,function(a){return a.getName()==
ib[2]});0<=t?f[t]=x:f.push(x);t=va(h,function(a){return a.getName()===Ra});0<=t?(I=h[t],h[t]=new rc(I.getName(),I.keyPath,D,w,f,void 0,!J)):h.push(new rc(Ra,void 0,!1,void 0,[x]));yb('multi entry index "'+x.getName()+'" found in '+Ra+(-1==t?"*":""))}}else I=va(h,function(a){return a.getName()===e.name}),0<=I?(t=h[I].index(0),f.push(t),h[I]=new rc(e.name,x,D,w,f,void 0,!J)):(f=new rc(e.name,x,D,w,f,void 0,!J),h.push(f))}}d=new Sc(g,h);a(d)}}var f=this,g=(c=c||this.n)&&c.version?parseFloat(c.version):
void 0,g=isNaN(g)?void 0:g,h=[];b?b.executeSql("SELECT * FROM sqlite_master",[],e,d):c.readTransaction(function(b){f.s(a,b,c)},function(a){throw a;},e)};
function xe(a,b,c,d){function e(b){a.executeSql(b,[],function(){f++;f==g.length&&(c(!0),c=null)},function(a,b){f++;f==g.length&&(c(!1),c=null);throw new hd(b,'"');})}var f=0,g=ye(b),h="Create";if(d){d=Fc(b,d);if(0==d.length){yb("same table "+b.getName()+" exists.");c(!0);c=null;return}h="Modify";xb("table: "+b.getName()+" has changed by "+d+" ALTER TABLE cannot run in WebSql, dropping old table.");g.unshift("DROP TABLE IF EXISTS "+pa(b.getName()))}yb(h+" table: "+b.getName()+": "+g.join(";"));for(b=
0;b<g.length;b++)e(g[b])}l.ma=function(){return!!this.n};l.close=function(){this.n=null};l.aa=function(a,b,c,d){function e(a){d("abort",a)}function f(){d("complete",{type:"complete"})}function g(b){a(b)}null===this.n&&(a(null),d("abort",this.fa));c==Bb?this.n.readTransaction(g,e,f):c==Cb?this.n.changeVersion(this.n.version,this.n.version+1+"",g,e,f):this.n.transaction(g,e,f)};
Wb.push(function(a,b){if(ca(q.openDatabase)&&(!b||"websql"==b)){var c=new we,d=new Wc,d=c.P(a,d),e=function(){};d.F(function(){c.aa(function(a){a.executeSql('SELECT * FROM sqlite_master WHERE type = "table"',[],function(b,c){if(c&&c.rows)for(var d=c.rows.length,e=0,n=0;n<d;n++){var p=c.rows.item(n);"__WebKitDatabaseInfoTable__"!=p.name&&"sqlite_sequence"!=p.name&&(e++,a.executeSql("DROP TABLE "+p.name))}},function(a,b){throw b;})},[],L,e)});d.Fa(function(){})}});we.prototype.wa=function(){};/*
 Copyright 2012 YDN Authors, Yathit. All Rights Reserved.
 Licensed under the Apache License, Version 2.0 (the "License");.
*/
Ed.prototype.ra=function(a){return"indexeddb"==a&&(!Db||qe?0:Db)?new re(0,this.w):"websql"==a&&ca(q.openDatabase)?new we(this.m):"sqlite"==a&&q.sqlitePlugin?new we(this.m,"sqlite"):"localstorage"==a&&window.localStorage?new ue:"sessionstorage"==a&&window.sessionStorage?new ve:"memory"==a?new te:null};/*
 Copyright 2012 YDN Authors, Yathit. All Rights Reserved.
 Licensed under the Apache License, Version 2.0 (the "License");.
*/
Ed.prototype.branch=Ed.prototype.Qa;Ed.prototype.getTxNo=Ed.prototype.kb;ud.prototype.getTxNo=ud.prototype.e;Ed.prototype.run=Ed.prototype.$a;X.prototype.branch=X.prototype.Qa;X.prototype.add=X.prototype.add;X.prototype.get=X.prototype.get;X.prototype.keys=X.prototype.keys;X.prototype.values=X.prototype.L;X.prototype.put=X.prototype.put;X.prototype.clear=X.prototype.clear;X.prototype.remove=X.prototype.na;X.prototype.count=X.prototype.count;W.prototype.add=W.prototype.add;W.prototype.get=W.prototype.get;W.prototype.keys=W.prototype.keys;W.prototype.values=W.prototype.L;W.prototype.put=W.prototype.put;W.prototype.clear=W.prototype.clear;
W.prototype.remove=W.prototype.na;W.prototype.count=W.prototype.count;ia("ydn.db.Key",P);P.prototype.id=P.prototype.Ta;P.prototype.parent=P.prototype.gb;P.prototype.storeName=P.prototype.hb;ia("ydn.db.KeyRange",Q);Q.upperBound=Q.upperBound;Q.lowerBound=Q.lowerBound;Q.bound=Q.bound;Q.only=Q.only;Q.starts=function(a){var b;if(v(a))b=wa(a),b.push("\uffff");else if(z(a))b=a+"\uffff";else if(A(a))b=a+2.220460492503131E-16,a-=2.220460492503131E-16;else return Q.only(a);return Q.bound(a,b,!1,!0)};
Yb.prototype.store_name=Yb.prototype.b;Yb.prototype.getStoreName=Yb.prototype.a;function ze(a,b,c){X.call(this,a,b,c)}C(ze,X);ia("ydn.db.Storage",ze); 

//# sourceMappingURL=ydn.db-isw-crud.js.map
return ydn;}, (this || {}));
            