var g,k=this,l=function(a){var c=typeof a;if("object"==c)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return c;var b=Object.prototype.toString.call(a);if("[object Window]"==b)return"object";if("[object Array]"==b||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==b||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==c&&"undefined"==typeof a.call)return"object";return c},m=function(a,c){var b=a.split("."),d=k;b[0]in d||!d.execScript||d.execScript("var "+b[0]);for(var e;b.length&&(e=b.shift());)b.length||void 0===c?d=d[e]?d[e]:d[e]={}:d[e]=c},n=function(a,c){function b(){}b.prototype=c.prototype;a.H=c.prototype;a.prototype=new b;a.G=function(a,b,f){for(var h=Array(arguments.length-2),x=2;x<arguments.length;x++)h[x-2]=arguments[x];return c.prototype[b].apply(a,h)}};var p=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,p);else{var c=Error().stack;c&&(this.stack=c)}a&&(this.message=String(a))};n(p,Error);var q=function(a,c){for(var b=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<b.length;)d+=b.shift()+e.shift();return d+b.join("%s")},r=function(a){return Array.prototype.join.call(arguments,"")};var t=function(a,c){c.unshift(a);p.call(this,q.apply(null,c));c.shift()};n(t,p);var u=function(a,c,b,d){var e="Assertion failed";if(b)var e=e+(": "+b),f=d;else a&&(e+=": "+a,f=c);throw new t(""+e,f||[]);},v=function(a,c,b){"number"==typeof a||u("Expected number but got %s: %s.",[l(a),a],c,Array.prototype.slice.call(arguments,2));return a},w=function(a,c,b){"string"==typeof a||u("Expected string but got %s: %s.",[l(a),a],c,Array.prototype.slice.call(arguments,2));return a};var y=function(a){return Array.prototype.concat.apply(Array.prototype,arguments)},z=function(a){var c=a.length;if(0<c){for(var b=Array(c),d=0;d<c;d++)b[d]=a[d];return b}return[]};var A="StopIteration"in k?k.StopIteration:{message:"StopIteration",stack:""},B=function(){};B.prototype.next=function(){throw A;};B.prototype.D=function(){return this};var C=function(a,c){this.h={};this.c=[];this.B=this.b=0;var b=arguments.length;if(1<b){if(b%2)throw Error("Uneven number of arguments");for(var d=0;d<b;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.addAll(a)};C.prototype.l=function(){D(this);for(var a=[],c=0;c<this.c.length;c++)a.push(this.h[this.c[c]]);return a};C.prototype.s=function(){D(this);return this.c.concat()};C.prototype.o=function(a){return E(this.h,a)};
C.prototype.remove=function(a){return E(this.h,a)?(delete this.h[a],this.b--,this.B++,this.c.length>2*this.b&&D(this),!0):!1};var D=function(a){if(a.b!=a.c.length){for(var c=0,b=0;c<a.c.length;){var d=a.c[c];E(a.h,d)&&(a.c[b++]=d);c++}a.c.length=b}if(a.b!=a.c.length){for(var e={},b=c=0;c<a.c.length;)d=a.c[c],E(e,d)||(a.c[b++]=d,e[d]=1),c++;a.c.length=b}};g=C.prototype;g.get=function(a,c){return E(this.h,a)?this.h[a]:c};
g.set=function(a,c){E(this.h,a)||(this.b++,this.c.push(a),this.B++);this.h[a]=c};g.addAll=function(a){var c;if(a instanceof C)c=a.s(),a=a.l();else{c=[];var b=0,d;for(d in a)c[b++]=d;b=[];d=0;for(var e in a)b[d++]=a[e];a=b}for(e=0;e<c.length;e++)this.set(c[e],a[e])};g.forEach=function(a,c){for(var b=this.s(),d=0;d<b.length;d++){var e=b[d],f=this.get(e);a.call(c,f,e,this)}};g.clone=function(){return new C(this)};
g.D=function(a){D(this);var c=0,b=this.B,d=this,e=new B;e.next=function(){if(b!=d.B)throw Error("The map has changed since the iterator was created");if(c>=d.c.length)throw A;var e=d.c[c++];return a?e:d.h[e]};return e};var E=function(a,c){return Object.prototype.hasOwnProperty.call(a,c)};var F=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/,G=function(a,c){if(a)for(var b=a.split("&"),d=0;d<b.length;d++){var e=b[d].indexOf("="),f=null,h=null;0<=e?(f=b[d].substring(0,e),h=b[d].substring(e+1)):f=b[d];c(f,h?decodeURIComponent(h.replace(/\+/g," ")):"")}};var H=function(a,c){this.j=this.A=this.m="";this.w=null;this.u=this.v="";this.g=this.F=!1;var b;if(a instanceof H)this.g=void 0!==c?c:a.g,I(this,a.m),b=a.A,J(this),this.A=b,b=a.j,J(this),this.j=b,K(this,a.w),b=a.v,J(this),this.v=b,L(this,a.i.clone()),b=a.u,J(this),this.u=b;else if(a&&(b=String(a).match(F))){this.g=!!c;I(this,b[1]||"",!0);var d=b[2]||"";J(this);this.A=M(d);d=b[3]||"";J(this);this.j=M(d,!0);K(this,b[4]);d=b[5]||"";J(this);this.v=M(d,!0);L(this,b[6]||"",!0);b=b[7]||"";J(this);this.u=
M(b)}else this.g=!!c,this.i=new N(null,0,this.g)};H.prototype.toString=function(){var a=[],c=this.m;c&&a.push(O(c,P,!0),":");var b=this.j;if(b||"file"==c)a.push("//"),(c=this.A)&&a.push(O(c,P,!0),"@"),a.push(encodeURIComponent(String(b)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),b=this.w,null!=b&&a.push(":",String(b));if(b=this.v)this.j&&"/"!=b.charAt(0)&&a.push("/"),a.push(O(b,"/"==b.charAt(0)?Q:R,!0));(b=this.i.toString())&&a.push("?",b);(b=this.u)&&a.push("#",O(b,S));return a.join("")};
H.prototype.clone=function(){return new H(this)};var I=function(a,c,b){J(a);a.m=b?M(c,!0):c;a.m&&(a.m=a.m.replace(/:$/,""))},K=function(a,c){J(a);if(c){c=Number(c);if(isNaN(c)||0>c)throw Error("Bad port number "+c);a.w=c}else a.w=null},L=function(a,c,b){J(a);c instanceof N?(a.i=c,a.i.C(a.g)):(b||(c=O(c,T)),a.i=new N(c,0,a.g))},J=function(a){if(a.F)throw Error("Tried to modify a read-only Uri");};H.prototype.C=function(a){this.g=a;this.i&&this.i.C(a);return this};
var M=function(a,c){return a?c?decodeURI(a.replace(/%25/g,"%2525")):decodeURIComponent(a):""},O=function(a,c,b){return"string"==typeof a?(a=encodeURI(a).replace(c,U),b&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null},U=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)},P=/[#\/\?@]/g,R=/[\#\?:]/g,Q=/[\#\?]/g,T=/[\#\?@]/g,S=/#/g,N=function(a,c,b){this.b=this.a=null;this.f=a||null;this.g=!!b},V=function(a){a.a||(a.a=new C,a.b=0,a.f&&G(a.f,function(c,b){a.add(decodeURIComponent(c.replace(/\+/g,
" ")),b)}))};g=N.prototype;g.add=function(a,c){V(this);this.f=null;a=W(this,a);var b=this.a.get(a);b||this.a.set(a,b=[]);b.push(c);this.b=v(this.b)+1;return this};g.remove=function(a){V(this);a=W(this,a);return this.a.o(a)?(this.f=null,this.b=v(this.b)-this.a.get(a).length,this.a.remove(a)):!1};g.o=function(a){V(this);a=W(this,a);return this.a.o(a)};g.s=function(){V(this);for(var a=this.a.l(),c=this.a.s(),b=[],d=0;d<c.length;d++)for(var e=a[d],f=0;f<e.length;f++)b.push(c[d]);return b};
g.l=function(a){V(this);var c=[];if("string"==typeof a)this.o(a)&&(c=y(c,this.a.get(W(this,a))));else{a=this.a.l();for(var b=0;b<a.length;b++)c=y(c,a[b])}return c};g.set=function(a,c){V(this);this.f=null;a=W(this,a);this.o(a)&&(this.b=v(this.b)-this.a.get(a).length);this.a.set(a,[c]);this.b=v(this.b)+1;return this};g.get=function(a,c){var b=a?this.l(a):[];return 0<b.length?String(b[0]):c};
g.toString=function(){if(this.f)return this.f;if(!this.a)return"";for(var a=[],c=this.a.s(),b=0;b<c.length;b++)for(var d=c[b],e=encodeURIComponent(String(d)),d=this.l(d),f=0;f<d.length;f++){var h=e;""!==d[f]&&(h+="="+encodeURIComponent(String(d[f])));a.push(h)}return this.f=a.join("&")};g.clone=function(){var a=new N;a.f=this.f;this.a&&(a.a=this.a.clone(),a.b=this.b);return a};var W=function(a,c){var b=String(c);a.g&&(b=b.toLowerCase());return b};
N.prototype.C=function(a){a&&!this.g&&(V(this),this.f=null,this.a.forEach(function(a,b){var d=b.toLowerCase();b!=d&&(this.remove(b),this.remove(d),0<a.length&&(this.f=null,this.a.set(W(this,d),z(a)),this.b=v(this.b)+a.length))},this));this.g=a};var X=["googleads.g.doubleclick.net","adclick.g.doubleclick.net","www.googleadservices.com","adclick.googleadservices.com"],Y=function(a){var c=(new H(a)).j;return X.some(function(a){return a==c})};m("getNonChargedClickThroughUrl",function(a,c){var b,d;Y(c)?(b=new H(c),d=b.i.get("adurl")):(b=new H(a),d=c);J(b);b.i.set("ctype",38);J(b);b.i.remove("adurl");return r(b.toString(),"&","adurl","=",encodeURIComponent(w(d)))});m("getStructuredData",function(a,c){var b={},d;for(d in a){var e=d.split(/_/),f=e.shift(),h=Number(e.shift()),e=e.join(c?"_":"");f&&!isNaN(h)&&e?(b[f]||(b[f]=[]),b[f][h]||(b[f][h]={}),b[f][h][e]=a[d]):b[d]=a[d]}return b});
m("getVideoId",function(a){return a&&a.match(/youtube/)?(a=a.match(/[\?&](video_id|v)=([^&]+)/))?a[2]:null:null});m("toHtmlColor",function(a){if(null==a)return"#fff";var c=a.match("^(0x|#)([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$");return c?"#"==c[1]?a:"#"+c[2]:"#fff"});
