(function(w){if(!w._wtf){var planOutCampaigns=[{"name":"planout_aa","salt":"test_1","json":"{\"op\":\"seq\",\"seq\":[{\"op\":\"set\",\"var\":\"param_1\",\"value\":{\"choices\":{\"op\":\"array\",\"values\":[\"a1\",\"b1\"]},\"unit\":{\"op\":\"get\",\"var\":\"visitorId\"},\"op\":\"uniformChoice\"}},{\"op\":\"set\",\"var\":\"param_2\",\"value\":{\"choices\":{\"op\":\"array\",\"values\":[\"a2\",\"b2\"]},\"unit\":{\"op\":\"get\",\"var\":\"visitorId\"},\"op\":\"uniformChoice\"}}]}","hash":298820685}];var a=w._wtf=function(){return a.callMethod.apply(a,arguments)};!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):"object"==typeof exports?exports.PlanOut=b():a.PlanOut=b()}(a,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m= a,b.c=c,b.p="",b(0)}([function(a,b,c){function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0});var f=c(1),g=e(f),h=c(2),i=e(h),j=c(3),k=e(j),l=c(4),m=e(l),n=c(5),o=d(n),p=c(6),q=e(p),r=c(7),s=e(r);b["default"]={Namespace:o,Assignment:q["default"],Interpreter:i["default"],Experiment:g["default"],ExperimentSetup:s["default"], Ops:{Random:k["default"],Core:m["default"]}},a.exports=b["default"]},function(a,b,c){function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(b,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c=0}},{key:"setName",value:function(a){var b=/\s+/g;this.name=a.replace(b,"-"),this._assignment&&(this._assignment.experimentSalt= this.getSalt())}},{key:"__asBlob",value:function(){var a=void 0===arguments[0]?{}:arguments[0],b={name:this.getName(),time:(new Date).getTime()/1E3,salt:this.getSalt(),inputs:this.inputs,params:this._assignment.getParams()};return i.extend(b,a),b}},{key:"setAutoExposureLogging",value:function(a){this._autoExposureLog=a}},{key:"getParams",value:function(){return this.requireAssignment(),this.requireExposureLogging(),this._assignment.getParams()}},{key:"get",value:function(a,b){return this.requireAssignment(), this.requireExposureLogging(a),this._assignment.get(a,b)}},{key:"toString",value:function(){return this.requireAssignment(),this.requireExposureLogging(),JSON.stringify(this.__asBlob())}},{key:"logExposure",value:function(a){this.inExperiment()&&(this._exposureLogged=!0,this.logEvent("exposure",a))}},{key:"shouldLogExposure",value:function(a){return void 0===a||this.shouldFetchExperimentParameter(a)?this._autoExposureLog&&!this.previouslyLogged():!1}},{key:"logEvent",value:function(a,b){if(this.inExperiment()){var c; c=b?{event:a,extra_data:i.shallowCopy(b)}:{event:a},this.log(this.__asBlob(c))}}},{key:"configureLogger",value:function(){throw"IMPLEMENT configureLogger";}},{key:"log",value:function(a){throw"IMPLEMENT log";}},{key:"previouslyLogged",value:function(){throw"IMPLEMENT previouslyLogged";}}]),a}();b["default"]=j,a.exports=b["default"]},function(a,b,c){function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(b, "__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c1&&a.salt)this._ctrl_data[a.salt]=a.choices.values[0];if(j.isObject(a)&&a.op)return i.operatorInstance(a).execute(this);if(j.isArray(a)){var b=this;return j.map(a,function(a){return b.evaluate(a)})}return a}}]),a}();b["default"]=k,a.exports=b["default"]},function(a,b,c){function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function f(a,b){if("function"!= typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0});var g=function(){function a(a,b){for(var c=0;ca||a>1)throw"Invalid probability";return this.getUniform(0,1)<=a?1:0}}]),b}(p),t=function(a){function b(){e(this,b),null!=a&&a.apply(this,arguments)}return f(b,a),g(b,[{key:"simpleExecute",value:function(){var a=this.getArgNumber("p"),b=this.getArgList("choices");if(0>a||a>1)throw"Invalid probability";if(0==b.length)return[];for(var c=[],d=0;d=e?a[d]:b},null)}}]),b}(p),w=function(a){function b(){e(this,b),null!=a&&a.apply(this,arguments)}return f(b,a),g(b,[{key:"sample",value:function(a,b){for(var c=a.length,d=c-b,e=m.usingCompatibleHash(),f=c-1;f>0;f--){var g;g=e?this.getHash(f).modulo(f+1).toNumber():this.getHash(f)%(f+1);var h=a[f];if(a[f]=a[g],a[g]=h,!e&&d===f)return a.slice(f,c)}return a.slice(0,b)}},{key:"simpleExecute",value:function(){var a=l.shallowCopy(this.getArgList("choices")), b=0;return b=void 0!==this.args.draws?this.getArgNumber("draws"):a.length,this.sample(a,b)}}]),b}(p);b["default"]={PlanOutOpRandom:p,Sample:w,WeightedChoice:v,UniformChoice:u,BernoulliFilter:t,BernoulliTrial:s,RandomInteger:r,RandomFloat:q},a.exports=b["default"]},function(a,b,c){function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function e(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+ typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c=0&&bb}}]),b}(g.PlanOutOpBinary),y=function(a){function b(){d(this,b),null!=a&&a.apply(this,arguments)}return e(b,a),f(b,[{key:"binaryExecute",value:function(a,b){return b>a}}]),b}(g.PlanOutOpBinary),z=function(a){function b(){d(this,b),null!=a&&a.apply(this,arguments)}return e(b,a),f(b, [{key:"binaryExecute",value:function(a,b){return b>=a}}]),b}(g.PlanOutOpBinary),A=function(a){function b(){d(this,b),null!=a&&a.apply(this,arguments)}return e(b,a),f(b,[{key:"binaryExecute",value:function(a,b){return a>=b}}]),b}(g.PlanOutOpBinary),B=function(a){function b(){d(this,b),null!=a&&a.apply(this,arguments)}return e(b,a),f(b,[{key:"binaryExecute",value:function(a,b){return a%b}}]),b}(g.PlanOutOpBinary),C=function(a){function b(){d(this,b),null!=a&&a.apply(this,arguments)}return e(b,a),f(b, [{key:"binaryExecute",value:function(a,b){return parseFloat(a)/parseFloat(b)}}]),b}(g.PlanOutOpBinary),D=function(a){function b(){d(this,b),null!=a&&a.apply(this,arguments)}return e(b,a),f(b,[{key:"unaryExecute",value:function(a){return Math.round(a)}}]),b}(g.PlanOutOpBinary),E=function(a){function b(){d(this,b),null!=a&&a.apply(this,arguments)}return e(b,a),f(b,[{key:"getUnaryString",value:function(){return"!"}},{key:"unaryExecute",value:function(a){return!a}}]),b}(g.PlanOutOpUnary),F=function(a){function b(){d(this, b),null!=a&&a.apply(this,arguments)}return e(b,a),f(b,[{key:"getUnaryString",value:function(){return"-"}},{key:"unaryExecute",value:function(a){return 0-a}}]),b}(g.PlanOutOpUnary),G=function(a){function b(){d(this,b),null!=a&&a.apply(this,arguments)}return e(b,a),f(b,[{key:"commutativeExecute",value:function(a){return Math.min.apply(null,a)}}]),b}(g.PlanOutOpCommutative),H=function(a){function b(){d(this,b),null!=a&&a.apply(this,arguments)}return e(b,a),f(b,[{key:"commutativeExecute",value:function(a){return Math.max.apply(null, a)}}]),b}(g.PlanOutOpCommutative),I=function(a){function b(){d(this,b),null!=a&&a.apply(this,arguments)}return e(b,a),f(b,[{key:"unaryExecute",value:function(a){return a.length}}]),b}(g.PlanOutOpUnary),J=function(a){function b(){d(this,b),null!=a&&a.apply(this,arguments)}return e(b,a),f(b,[{key:"simpleExecute",value:function(){var a=i.deepCopy(this.args);return delete a.op,delete a.salt,a}}]),b}(g.PlanOutOpSimple);b.Literal=j,b.Get=k,b.Seq=l,b.Set=n,b.Arr=o,b.Map=J,b.Coalesce=p,b.Index=q,b.Cond=r, b.And=s,b.Or=t,b.Product=u,b.Sum=v,b.Equals=w,b.GreaterThan=x,b.LessThan=y,b.LessThanOrEqualTo=z,b.GreaterThanOrEqualTo=A,b.Mod=B,b.Divide=C,b.Round=D,b.Not=E,b.Negative=F,b.Min=G,b.Max=H,b.Length=I,b.Return=m},function(a,b,c){function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+ typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0});var g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1;var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},h=function(){function a(a,b){for(var c= 0;cd)return!1;if(void 0!==this.currentExperiments[a])return!1;var e=new l["default"](this.name);e.set("sampled_segments",new m.Sample({choices:this.availableSegments,draws:c,unit:a}));for(var f=e.get("sampled_segments"), g=0;gd||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},n=m(l),o=m(k),p=function(a){return a},q=function(a,b){var c=c(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0},r=function(a){return a=o({},a),function(b){return q(b,a)}},s=function(a,b,c){return null==a?p:j(a)?t(a,b,c):h(a)?r(a):y(a)},t=function(a,b,c){if(void 0===b)return a; switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},u=function(a,b,c){b=t(b,c);var d,e;if(B(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=f(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},v=function(a,b,c){b=s(b,c);for(var d=!B(a)&&d(a),e=(d||a).length,f=Array(e), g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},w=function(a,b,c,d){b=t(b,d,4);var e=!B(a)&&e(a),f=(e||a).length,g=0;for(arguments.length<3&&(c=a[e?e[g]:g],g+=1);g>=0&&f>g;g++){var h=e?e[g]:g;c=b(c,a[h],h,a)}return c},x=function(a){return h(a)?i(a)?a.slice():n({},a):a},y=function(a){return function(b){return null==b?void 0:b[a]}},z=Math.pow(2,53)-1,A=y("length"),B=function(a){var b=A(a);return"number"==typeof b&&b>=0&&z>=b},C=function(a,b){return null!=a&&Object.prototype.hasOwnProperty.call(a, b)},D=!{toString:null}.propertyIsEnumerable("toString"),E=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],F=function(a,b,c,d){return B(a)||(a=values(a)),("number"!=typeof c||d)&&(c=0),a.indexOf(b)>=0},G=function(a){for(var b=[],c=0;a>c;c++)b.push(c);return b},H=function(a,b){return"undefined"!=typeof a[b]};b["default"]={deepCopy:g,map:v,reduce:w,getParameterByName:f,forEach:u,isFunction:j,trimTrailingWhitespace:e,hasKey:H,shallowCopy:x,extend:n,isObject:h, isArray:i,range:G},a.exports=b["default"]},function(a,b,c){function d(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.__proto__=b)}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(b,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c= 0;c>5]|=128<<24-f%32,c[(f+64>>>9<< 4)+15]=f;for(var m=0;ms;s++){if(16>s)g[s]=c[m+s];else{var t=g[s-3]^g[s-8]^g[s-14]^g[s-16];g[s]=t<<1|t>>>31}var u=(h<<5|h>>>27)+l+(g[s]>>>0)+(20>s?(i&j|~i&k)+1518500249:40>s?(i^j^k)+1859775393:60>s?(i&j|i&k|j&k)-1894007588:(i^j^k)-899497514);l=k,k=j,j=i<<30|i>>>2,i=h,h=u}h+=n,i+=o,j+=p,k+=q,l+=r}return[h,i,j,k,l]},h=function(a,b){var c=d.wordsToBytes(g(a));return b&&b.asBytes?c:b&&b.asString?f.bytesToString(c):d.bytesToHex(c)};h._blocksize=16,h._digestsize= 20,a.exports=h}()}).call(b,c(13).Buffer)},function(a,b,c){var d;!function(e){function f(a){function b(a,d){var e,f,g,h,i,j,k=this;if(!(k instanceof b))return S&&G(26,"constructor call without new",a),new b(a,d);if(null!=d&&T(d,2,64,J,"base")){if(d=0|d,j=a+"",10==d)return k=new b(a instanceof b?a:j),H(k,M+k.e+1,N);if((h="number"==typeof a)&&0*a!=0||!(new RegExp("^-?"+(e="["+y.slice(0,d)+"]+")+"(?:\\."+e+")?$",37>d?"i":"")).test(j))return r(k,j,h,d);h?(k.s=0>1/a?(j=j.slice(1),-1):1,S&&j.replace(/^0\.0*|\./, "").length>15&&G(J,x,a),h=!1):k.s=45===j.charCodeAt(0)?(j=j.slice(1),-1):1,j=c(j,10,d,k.s)}else{if(a instanceof b)return k.s=a.s,k.e=a.e,k.c=(a=a.c)?a.slice():a,void(J=0);if((h="number"==typeof a)&&0*a==0){if(k.s=0>1/a?(a=-a,-1):1,a===~~a){for(f=0,g=a;g>=10;g/=10,f++);return k.e=f,k.c=[a],void(J=0)}j=a+""}else{if(!s.test(j=a+""))return r(k,j,h);k.s=45===j.charCodeAt(0)?(j=j.slice(1),-1):1}}for((f=j.indexOf("."))>-1&&(j=j.replace(".","")),(g=j.search(/e/i))>0?(0>f&&(f=g),f+=+j.slice(g+1),j=j.substring(0, g)):0>f&&(f=j.length),g=0;48===j.charCodeAt(g);g++);for(i=j.length;48===j.charCodeAt(--i););if(j=j.slice(g,i+1))if(i=j.length,h&&S&&i>15&&G(J,x,k.s*a),f=f-g-1,f>R)k.c=k.e=null;else if(Q>f)k.c=[k.e=0];else{if(k.e=f,k.c=[],g=(f+1)%A,0>f&&(g+=A),i>g){for(g&&k.c.push(+j.slice(0,g)),i-=A;i>g;)k.c.push(+j.slice(g,g+=A));j=j.slice(g),g=A-j.length}else g-=i;for(;g--;j+="0");k.c.push(+j)}else k.c=[k.e=0];J=0}function c(a,c,d,e){var f,g,i,j,k,m,o,p=a.indexOf("."),q=M,r=N;for(37>d&&(a=a.toLowerCase()),p>=0&& (i=W,W=0,a=a.replace(".",""),o=new b(d),k=o.pow(a.length-p),W=i,o.c=l(n(h(k.c),k.e),10,c),o.e=o.c.length),m=l(a,d,c),g=i=m.length;0==m[--i];m.pop());if(!m[0])return"0";if(0>p?--g:(k.c=m,k.e=g,k.s=e,k=I(k,o,q,r,c),m=k.c,j=k.r,g=k.e),f=g+q+1,p=m[f],i=c/2,j=j||0>f||null!=m[f+1],j=4>r?(null!=p||j)&&(0==r||r==(k.s<0?3:2)):p>i||p==i&&(4==r||j||6==r&&1&m[f-1]||r==(k.s<0?8:7)),1>f||!m[0])a=j?n("1",-q):"0";else{if(m.length=f,j)for(--c;++m[--f]>c;)m[f]=0,f||(++g,m.unshift(1));for(i=m.length;!m[--i];);for(p= 0,a="";i>=p;a+=y.charAt(m[p++]));a=n(a,g)}return a}function d(a,c,d,e){var f,g,i,j,k;if(d=null!=d&&T(d,0,8,e,w)?0|d:N,!a.c)return a.toString();if(f=a.c[0],i=a.e,null==c)k=h(a.c),k=19==e||24==e&&O>=i?m(k,i):n(k,i);else if(a=H(new b(a),c,d),g=a.e,k=h(a.c),j=k.length,19==e||24==e&&(g>=c||O>=g)){for(;c>j;k+="0",j++);k=m(k,g)}else if(c-=i,k=n(k,g),g+1>j){if(--c>0)for(k+=".";c--;k+="0");}else if(c+=g-j,c>0)for(g+1==j&&(k+=".");c--;k+="0");return a.s<0&&f?"-"+k:k}function e(a,c){var d,e,f=0;for(k(a[0])&& (a=a[0]),d=new b(a[0]);++fa||a>c||a!=o(a))&&G(d,(e||"decimal places")+(b>a||a>c?" out of range":" not an integer"),a),!0}function F(a,b,c){for(var d=1,e=b.length;!b[--e];b.pop());for(e=b[0];e>=10;e/=10,d++);return(c=d+c*A-1)>R?a.c=a.e=null:Q>c?a.c=[a.e=0]:(a.e=c,a.c=b),a}function G(a,b,c){var d=new Error(["new BigNumber","cmp","config","div","divToInt","eq","gt","gte","lt","lte","minus","mod","plus", "precision","random","round","shift","times","toDigits","toExponential","toFixed","toFormat","toFraction","pow","toPrecision","toString","BigNumber"][a]+"() "+b+": "+c);throw d.name="BigNumber Error",J=0,d;}function H(a,b,c,d){var e,f,g,h,i,j,k,l=a.c,m=C;if(l){a:{for(e=1,h=l[0];h>=10;h/=10,e++);if(f=b-e,0>f)f+=A,g=b,i=l[j=0],k=i/m[e-g-1]%10|0;else if(j=t((f+1)/A),j>=l.length){if(!d)break a;for(;l.length<=j;l.push(0));i=k=0,e=1,f%=A,g=f-A+1}else{for(i=h=l[j],e=1;h>=10;h/=10,e++);f%=A,g=f-A+e,k=0>g? 0:i/m[e-g-1]%10|0}if(d=d||0>b||null!=l[j+1]||(0>g?i:i%m[e-g-1]),d=4>c?(k||d)&&(0==c||c==(a.s<0?3:2)):k>5||5==k&&(4==c||d||6==c&&(f>0?g>0?i/m[e-g]:0:l[j-1])%10&1||c==(a.s<0?8:7)),1>b||!l[0])return l.length=0,d?(b-=a.e+1,l[0]=m[b%A],a.e=-b||0):l[0]=a.e=0,a;if(0==f?(l.length=j,h=1,j--):(l.length=j+1,h=m[A-f],l[j]=g>0?u(i/m[e-g]%m[g])*h:0),d)for(;;){if(0==j){for(f=1,g=l[0];g>=10;g/=10,f++);for(g=l[0]+=h,h=1;g>=10;g/=10,h++);f!=h&&(a.e++,l[0]==z&&(l[0]=1));break}if(l[j]+=h,l[j]!=z)break;l[j--]=0,h=1}for(f= l.length;0===l[--f];l.pop());}a.e>R?a.c=a.e=null:a.ec?null!=(a=e[c++]):void 0};return g(b="DECIMAL_PLACES")&&T(a,0,E,2,b)&&(M=0|a),d[b]=M,g(b="ROUNDING_MODE")&&T(a,0,8,2,b)&&(N=0|a),d[b]=N,g(b="EXPONENTIAL_AT")&&(k(a)?T(a[0],-E,0,2,b)&&T(a[1],0,E,2,b)&&(O=0|a[0],P=0|a[1]):T(a,-E,E,2,b)&&(O=-(P=0|(0>a?-a:a)))),d[b]=[O,P],g(b="RANGE")&&(k(a)?T(a[0],-E,-1,2,b)&&T(a[1],1,E,2,b)&&(Q=0|a[0],R=0|a[1]):T(a,-E,E,2,b)&& (0|a?Q=-(R=0|(0>a?-a:a)):S&&G(2,b+" cannot be zero",a))),d[b]=[Q,R],g(b="ERRORS")&&(a===!!a||1===a||0===a?(J=0,T=(S=!!a)?p:j):S&&G(2,b+v,a)),d[b]=S,g(b="CRYPTO")&&(a===!!a||1===a||0===a?(U=!(!a||!q||"object"!=typeof q),a&&!U&&S&&G(2,"crypto unavailable",q)):S&&G(2,b+v,a)),d[b]=U,g(b="MODULO_MODE")&&T(a,0,9,2,b)&&(V=0|a),d[b]=V,g(b="POW_PRECISION")&&T(a,0,E,2,b)&&(W=0|a),d[b]=W,g(b="FORMAT")&&("object"==typeof a?X=a:S&&G(2,b+" not an object",a)),d[b]=X,d},b.max=function(){return e(arguments,K.lt)}, b.min=function(){return e(arguments,K.gt)},b.random=function(){var a=9007199254740992,c=Math.random()*a&2097151?function(){return u(Math.random()*a)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(a){var d,e,f,g,h,i=0,j=[],k=new b(L);if(a=null!=a&&T(a,0,E,14)?0|a:M,g=t(a/A),U)if(q&&q.getRandomValues){for(d=q.getRandomValues(new Uint32Array(g*=2));g>i;)h=131072*d[i]+(d[i+1]>>>11),h>=9E15?(e=q.getRandomValues(new Uint32Array(2)),d[i]=e[0],d[i+1]=e[1]): (j.push(h%1E14),i+=2);i=g/2}else if(q&&q.randomBytes){for(d=q.randomBytes(g*=7);g>i;)h=281474976710656*(31&d[i])+1099511627776*d[i+1]+4294967296*d[i+2]+16777216*d[i+3]+(d[i+4]<<16)+(d[i+5]<<8)+d[i+6],h>=9E15?q.randomBytes(7).copy(d,i):(j.push(h%1E14),i+=7);i=g/7}else S&&G(14,"crypto unavailable",q);if(!i)for(;g>i;)h=c(),9E15>h&&(j[i++]=h%1E14);for(g=j[--i],a%=A,g&&a&&(h=C[A-a],j[i]=u(g/h)*h);0===j[i];j.pop(),i--);if(0>i)j=[f=0];else{for(f=-1;0===j[0];j.shift(),f-=A);for(i=1,h=j[0];h>=10;h/=10,i++); A>i&&(f-=A-i)}return k.e=f,k.c=j,k}}(),I=function(){function a(a,b,c){var d,e,f,g,h=0,i=a.length,j=b%D,k=b/D|0;for(a=a.slice();i--;)f=a[i]%D,g=a[i]/D|0,d=k*f+g*j,e=j*f+d%D*D+h,h=(e/c|0)+(d/D|0)+k*g,a[i]=e%c;return h&&a.unshift(h),a}function c(a,b,c,d){var e,f;if(c!=d)f=c>d?1:-1;else for(e=f=0;c>e;e++)if(a[e]!=b[e]){f=a[e]>b[e]?1:-1;break}return f}function d(a,b,c,d){for(var e=0;c--;)a[c]-=e,e=a[c]1;a.shift());}return function(e,f,h,i,j){var k,l,m, n,o,p,q,r,s,t,v,w,x,y,B,C,D,E=e.s==f.s?1:-1,F=e.c,G=f.c;if(!(F&&F[0]&&G&&G[0]))return new b(e.s&&f.s&&(F?!G||F[0]!=G[0]:G)?F&&0==F[0]||!G?0*E:E/0:NaN);for(r=new b(E),s=r.c=[],l=e.e-f.e,E=h+l+1,j||(j=z,l=g(e.e/A)-g(f.e/A),E=E/A|0),m=0;G[m]==(F[m]||0);m++);if(G[m]>(F[m]||0)&&l--,0>E)s.push(1),n=!0;else{for(y=F.length,C=G.length,m=0,E+=2,o=u(j/(G[0]+1)),o>1&&(G=a(G,o,j),F=a(F,o,j),C=G.length,y=F.length),x=C,t=F.slice(0,C),v=t.length;C>v;t[v++]=0);D=G.slice(),D.unshift(0),B=G[0],G[1]>=j/2&&B++;do{if(o= 0,k=c(G,t,C,v),0>k){if(w=t[0],C!=v&&(w=w*j+(t[1]||0)),o=u(w/B),o>1)for(o>=j&&(o=j-1),p=a(G,o,j),q=p.length,v=t.length;1==c(p,t,q,v);)o--,d(p,q>C?D:G,q,j),q=p.length,k=1;else 0==o&&(k=o=1),p=G.slice(),q=p.length;if(v>q&&p.unshift(0),d(t,p,v,j),v=t.length,-1==k)for(;c(G,t,C,v)<1;)o++,d(t,v>C?D:G,v,j),v=t.length}else 0===k&&(o++,t=[0]);s[m++]=o,t[0]?t[v++]=F[x]||0:(t=[F[x]],v=1)}while((x++=10;E/=10,m++);H(r,h+(r.e=m+l*A-1)+ 1,i,n)}else r.e=l,r.r=+n;return r}}(),r=function(){var a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,c=/^([^.]+)\.$/,d=/^\.([^.]+)$/,e=/^-?(Infinity|NaN)$/,f=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(g,h,i,j){var k,l=i?h:h.replace(f,"");if(e.test(l))g.s=isNaN(l)?null:0>l?-1:1;else{if(!i&&(l=l.replace(a,function(a,b,c){return k="x"==(c=c.toLowerCase())?16:"b"==c?2:8,j&&j!=k?a:b}),j&&(k=j,l=l.replace(c,"$1").replace(d,"0.$1")),h!=l))return new b(l,k);S&&G(J,"not a"+(j?" base "+j:"")+" number",h),g.s=null}g.c= g.e=null,J=0}}(),K.absoluteValue=K.abs=function(){var a=new b(this);return a.s<0&&(a.s=1),a},K.ceil=function(){return H(new b(this),this.e+1,2)},K.comparedTo=K.cmp=function(a,c){return J=1,i(this,new b(a,c))},K.decimalPlaces=K.dp=function(){var a,b,c=this.c;if(!c)return null;if(a=((b=c.length-1)-g(this.e/A))*A,b=c[b])for(;b%10==0;b/=10,a--);return 0>a&&(a=0),a},K.dividedBy=K.div=function(a,c){return J=3,I(this,new b(a,c),M,N)},K.dividedToIntegerBy=K.divToInt=function(a,c){return J=4,I(this,new b(a, c),0,1)},K.equals=K.eq=function(a,c){return J=5,0===i(this,new b(a,c))},K.floor=function(){return H(new b(this),this.e+1,3)},K.greaterThan=K.gt=function(a,c){return J=6,i(this,new b(a,c))>0},K.greaterThanOrEqualTo=K.gte=function(a,c){return J=7,1===(c=i(this,new b(a,c)))||0===c},K.isFinite=function(){return!!this.c},K.isInteger=K.isInt=function(){return!!this.c&&g(this.e/A)>this.c.length-2},K.isNaN=function(){return!this.s},K.isNegative=K.isNeg=function(){return this.s<0},K.isZero=function(){return!!this.c&& 0==this.c[0]},K.lessThan=K.lt=function(a,c){return J=8,i(this,new b(a,c))<0},K.lessThanOrEqualTo=K.lte=function(a,c){return J=9,-1===(c=i(this,new b(a,c)))||0===c},K.minus=K.sub=function(a,c){var d,e,f,h,i=this,j=i.s;if(J=10,a=new b(a,c),c=a.s,!j||!c)return new b(NaN);if(j!=c)return a.s=-c,i.plus(a);var k=i.e/A,l=a.e/A,m=i.c,n=a.c;if(!k||!l){if(!m||!n)return m?(a.s=-c,a):new b(n?i:NaN);if(!m[0]||!n[0])return n[0]?(a.s=-c,a):new b(m[0]?i:3==N?-0:0)}if(k=g(k),l=g(l),m=m.slice(),j=k-l){for((h=0>j)?(j= -j,f=m):(l=k,f=n),f.reverse(),c=j;c--;f.push(0));f.reverse()}else for(e=(h=(j=m.length)<(c=n.length))?j:c,j=c=0;e>c;c++)if(m[c]!=n[c]){h=m[c]0)for(;c--;m[d++]=0);for(c=z-1;e>j;){if(m[--e]0?(i=h,d=k):(f=-f,d=j),d.reverse();f--;d.push(0)); d.reverse()}for(f=j.length,c=k.length,0>f-c&&(d=k,k=j,j=d,c=f),f=0;c;)f=(j[--c]=j[c]+k[c]+f)/z|0,j[c]%=z;return f&&(j.unshift(f),++i),F(a,j,i)},K.precision=K.sd=function(a){var b,c,d=this,e=d.c;if(null!=a&&a!==!!a&&1!==a&&0!==a&&(S&&G(13,"argument"+v,a),a!=!!a&&(a=null)),!e)return null;if(c=e.length-1,b=c*A+1,c=e[c]){for(;c%10==0;c/=10,b--);for(c=e[0];c>=10;c/=10,b++);}return a&&d.e+1>b&&(b=d.e+1),b},K.round=function(a,c){var d=new b(this);return(null==a||T(a,0,E,15))&&H(d,~~a+this.e+1,null!=c&&T(c, 0,8,15,w)?0|c:N),d},K.shift=function(a){var c=this;return T(a,-B,B,16,"argument")?c.times("1e"+o(a)):new b(c.c&&c.c[0]&&(-B>a||a>B)?c.s*(0>a?0:1/0):c)},K.squareRoot=K.sqrt=function(){var a,c,d,e,f,i=this,j=i.c,k=i.s,l=i.e,m=M+4,n=new b("0.5");if(1!==k||!j||!j[0])return new b(!k||0>k&&(!j||j[0])?NaN:j?i:1/0);if(k=Math.sqrt(+i),0==k||k==1/0?(c=h(j),(c.length+l)%2==0&&(c+="0"),k=Math.sqrt(c),l=g((l+1)/2)-(0>l||l%2),k==1/0?c="1e"+l:(c=k.toExponential(),c=c.slice(0,c.indexOf("e")+1)+l),d=new b(c)):d=new b(k+ ""),d.c[0])for(l=d.e,k=l+m,3>k&&(k=0);;)if(f=d,d=n.times(f.plus(I(i,f,m,1))),h(f.c).slice(0,k)===(c=h(d.c)).slice(0,k)){if(d.ek&&(q=u,u=v,v=q,f=k,k=n,n=f),f=k+n,q=[];f--;q.push(0));for(r=z,s=D,f=n;--f>=0;){for(d=0,o=v[f]%s,p=v[f]/s|0,i=k,h=f+i;h>f;)l=u[--i]%s,m=u[i]/s|0,j=p*l+m*o,l=o*l+j%s*s+q[h]+d,d=(l/r|0)+(j/s|0)+p*m,q[h--]=l%r;q[h]=d}return d?++e:q.shift(),F(a,q,e)},K.toDigits=function(a,c){var d=new b(this);return a=null!=a&&T(a,1,E,18,"precision")?0|a:null,c=null!=c&&T(c,0,8,18, w)?0|c:N,a?H(d,a,c):d},K.toExponential=function(a,b){return d(this,null!=a&&T(a,0,E,19)?~~a+1:null,b,19)},K.toFixed=function(a,b){return d(this,null!=a&&T(a,0,E,20)?~~a+this.e+1:null,b,20)},K.toFormat=function(a,b){var c=d(this,null!=a&&T(a,0,E,21)?~~a+this.e+1:null,b,21);if(this.c){var e,f=c.split("."),g=+X.groupSize,h=+X.secondaryGroupSize,i=X.groupSeparator,j=f[0],k=f[1],l=this.s<0,m=l?j.slice(1):j,n=m.length;if(h&&(e=g,g=h,h=e,n-=e),g>0&&n>0){for(e=n%g||g,j=m.substr(0,e);n>e;e+=g)j+=i+m.substr(e, g);h>0&&(j+=i+m.slice(e)),l&&(j="-"+j)}c=k?j+X.decimalSeparator+((h=+X.fractionGroupSize)?k.replace(new RegExp("\\d{"+h+"}\\B","g"),"$\x26"+X.fractionGroupSeparator):k):j}return c},K.toFraction=function(a){var c,d,e,f,g,i,j,k,l,m=S,n=this,o=n.c,p=new b(L),q=d=new b(L),r=j=new b(L);if(null!=a&&(S=!1,i=new b(a),S=m,(!(m=i.isInt())||i.lt(L))&&(S&&G(22,"max denominator "+(m?"out of range":"not an integer"),a),a=!m&&i.c&&H(i,i.e+1,1).gte(L)?i:null)),!o)return n.toString();for(l=h(o),f=p.e=l.length-n.e- 1,p.c[0]=C[(g=f%A)<0?A+g:g],a=!a||i.cmp(p)>0?f>0?p:q:i,g=R,R=1/0,i=new b(l),j.c[0]=0;k=I(i,p,0,1),e=d.plus(k.times(r)),1!=e.cmp(a);)d=r,r=e,q=j.plus(k.times(e=q)),j=e,p=i.minus(k.times(e=p)),i=e;return e=I(a.minus(d),r,0,1),j=j.plus(e.times(q)),d=d.plus(e.times(r)),j.s=q.s=n.s,f*=2,c=I(q,r,f,N).minus(n).abs().cmp(I(j,d,f,N).minus(n).abs())<1?[q.toString(),r.toString()]:[j.toString(),d.toString()],R=g,c},K.toNumber=function(){var a=this;return+a||(a.s?0*a.s:NaN)},K.toPower=K.pow=function(a){var c, d,e=u(0>a?-a:+a),f=this;if(!T(a,-B,B,23,"exponent")&&(!isFinite(a)||e>B&&(a/=0)||parseFloat(a)!=a&&!(a=NaN)))return new b(Math.pow(+f,a));for(c=W?t(W/A+2):0,d=new b(L);;){if(e%2){if(d=d.times(f),!d.c)break;c&&d.c.length>c&&(d.c.length=c)}if(e=u(e/2),!e)break;f=f.times(f),c&&f.c&&f.c.length>c&&(f.c.length=c)}return 0>a&&(d=L.div(d)),c?H(d,W,N):d},K.toPrecision=function(a,b){return d(this,null!=a&&T(a,1,E,24,"precision")?0|a:null,b,24)},K.toString=function(a){var b,d=this,e=d.s,f=d.e;return null=== f?e?(b="Infinity",0>e&&(b="-"+b)):b="NaN":(b=h(d.c),b=null!=a&&T(a,2,64,25,"base")?c(n(b,f),0|a,10,e):O>=f||f>=P?m(b,f):n(b,f),0>e&&d.c[0]&&(b="-"+b)),b},K.truncated=K.trunc=function(){return H(new b(this),this.e+1,1)},K.valueOf=K.toJSON=function(){return this.toString()},null!=a&&b.config(a),b}function g(a){var b=0|a;return a>0||a===b?b:b-1}function h(a){for(var b,c,d=1,e=a.length,f=a[0]+"";e>d;){for(b=a[d++]+"",c=A-b.length;c--;b="0"+b);f+=b}for(e=f.length;48===f.charCodeAt(--e););return f.slice(0, e+1||1)}function i(a,b){var c,d,e=a.c,f=b.c,g=a.s,h=b.s,i=a.e,j=b.e;if(!g||!h)return null;if(c=e&&!e[0],d=f&&!f[0],c||d)return c?d?0:-h:g;if(g!=h)return g;if(c=0>g,d=i==j,!e||!f)return d?0:!e^c?1:-1;if(!d)return i>j^c?1:-1;for(h=(i=e.length)<(j=f.length)?i:j,g=0;h>g;g++)if(e[g]!=f[g])return e[g]>f[g]^c?1:-1;return i==j?0:i>j^c?1:-1}function j(a,b,c){return(a=o(a))>=b&&c>=a}function k(a){return"[object Array]"==Object.prototype.toString.call(a)}function l(a,b,c){for(var d,e,f=[0],g=0,h=a.length;h> g;){for(e=f.length;e--;f[e]*=b);for(f[d=0]+=y.indexOf(a.charAt(g++));dc-1&&(null==f[d+1]&&(f[d+1]=0),f[d+1]+=f[d]/c|0,f[d]%=c)}return f.reverse()}function m(a,b){return(a.length>1?a.charAt(0)+"."+a.slice(1):a)+(0>b?"e":"e+")+b}function n(a,b){var c,d;if(0>b){for(d="0.";++b;d+="0");a=d+a}else if(c=a.length,++b>c){for(d="0",b-=c;--b;d+="0");a+=d}else c>b&&(a=a.slice(0,b)+"."+a.slice(b));return a}function o(a){return a=parseFloat(a),0>a?t(a):u(a)}var p,q,r,s=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, t=Math.ceil,u=Math.floor,v=" not a boolean or binary digit",w="rounding mode",x="number type has more than 15 significant digits",y="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",z=1E14,A=14,B=9007199254740991,C=[1,10,100,1E3,1E4,1E5,1E6,1E7,1E8,1E9,1E10,1E11,1E12,1E13],D=1E7,E=1E9;p=f(),d=function(){return p}.call(b,c,b,a),!(void 0!==d&&(a.exports=d))}(this)},function(a,b,c){(function(a){function a(b){return this instanceof a?(this.length=0,this.parent=void 0,"number"==typeof b? d(this,b):"string"==typeof b?e(this,b,arguments.length>1?arguments[1]:"utf8"):f(this,b)):arguments.length>1?new a(b,arguments[1]):new a(b)}function d(b,c){if(b=l(b,0>c?0:0|m(c)),!a.TYPED_ARRAY_SUPPORT)for(var d=0;c>d;d++)b[d]=0;return b}function e(a,b,c){("string"!=typeof c||""===c)&&(c="utf8");var d=0|o(b,c);return a=l(a,d),a.write(b,c),a}function f(b,c){if(a.isBuffer(c))return g(b,c);if(T(c))return h(b,c);if(null==c)throw new TypeError("must start with number, buffer, array or string");return"undefined"!= typeof ArrayBuffer&&c.buffer instanceof ArrayBuffer?i(b,c):c.length?j(b,c):k(b,c)}function g(a,b){var c=0|m(b.length);return a=l(a,c),b.copy(a,0,0,c),a}function h(a,b){var c=0|m(b.length);a=l(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function i(a,b){var c=0|m(b.length);a=l(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function j(a,b){var c=0|m(b.length);a=l(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function k(a,b){var c,d=0;"Buffer"===b.type&&T(b.data)&&(c=b.data,d=0|m(c.length)), a=l(a,d);for(var e=0;d>e;e+=1)a[e]=255&c[e];return a}function l(b,c){a.TYPED_ARRAY_SUPPORT?b=a._augment(new Uint8Array(c)):(b.length=c,b._isBuffer=!0);var d=0!==c&&c<=a.poolSize>>>1;return d&&(b.parent=V),b}function m(a){if(a>=U)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+U.toString(16)+" bytes");return 0|a}function n(b,c){if(!(this instanceof n))return new n(b,c);var d=new a(b,c);return delete d.parent,d}function o(a,b){if("string"!=typeof a&&(a=String(a)),0=== a.length)return 0;switch(b||"utf8"){case "ascii":case "binary":case "raw":return a.length;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return 2*a.length;case "hex":return a.length>>>1;case "utf8":case "utf-8":return L(a).length;case "base64":return O(a).length;default:return a.length}}function p(a,b,c,d){c=Number(c)||0;var e=a.length-c;d?(d=Number(d),d>e&&(d=e)):d=e;var f=b.length;if(f%2!==0)throw new Error("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;d>g;g++){var h=parseInt(b.substr(2* g,2),16);if(isNaN(h))throw new Error("Invalid hex string");a[c+g]=h}return g}function q(a,b,c,d){return P(L(b,a.length-c),a,c,d)}function r(a,b,c,d){return P(M(b),a,c,d)}function s(a,b,c,d){return r(a,b,c,d)}function t(a,b,c,d){return P(O(b),a,c,d)}function u(a,b,c,d){return P(N(b,a.length-c),a,c,d)}function v(a,b,c){return 0===b&&c===a.length?R.fromByteArray(a):R.fromByteArray(a.slice(b,c))}function w(a,b,c){var d="",e="";c=Math.min(a.length,c);for(var f=b;c>f;f++)a[f]<=127?(d+=Q(e)+String.fromCharCode(a[f]), e=""):e+="%"+a[f].toString(16);return d+Q(e)}function x(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(127&a[e]);return d}function y(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(a[e]);return d}function z(a,b,c){var d=a.length;(!b||0>b)&&(b=0),(!c||0>c||c>d)&&(c=d);for(var e="",f=b;c>f;f++)e+=K(a[f]);return e}function A(a,b,c){for(var d=a.slice(b,c),e="",f=0;fa)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length");}function C(b,c,d,e,f,g){if(!a.isBuffer(b))throw new TypeError("buffer must be a Buffer instance");if(c>f||g>c)throw new RangeError("value is out of bounds");if(d+e>b.length)throw new RangeError("index out of range");}function D(a,b,c,d){0>b&&(b=65535+b+1);for(var e=0,f=Math.min(a.length-c,2);f>e;e++)a[c+e]=(b&255<<8*(d?e:1-e))>>>8*(d?e:1-e)}function E(a,b,c,d){0> b&&(b=4294967295+b+1);for(var e=0,f=Math.min(a.length-c,4);f>e;e++)a[c+e]=b>>>8*(d?e:3-e)&255}function F(a,b,c,d,e,f){if(b>e||f>b)throw new RangeError("value is out of bounds");if(c+d>a.length)throw new RangeError("index out of range");if(0>c)throw new RangeError("index out of range");}function G(a,b,c,d,e){return e||F(a,b,c,4,3.4028234663852886E38,-3.4028234663852886E38),S.write(a,b,c,d,23,4),c+4}function H(a,b,c,d,e){return e||F(a,b,c,8,1.7976931348623157E308,-1.7976931348623157E308),S.write(a, b,c,d,52,8),c+8}function I(a){if(a=J(a).replace(X,""),a.length<2)return"";for(;a.length%4!==0;)a+="\x3d";return a}function J(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function K(a){return 16>a?"0"+a.toString(16):a.toString(16)}function L(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;d>g;g++){if(c=a.charCodeAt(g),c>55295&&57344>c){if(!e){if(c>56319){(b-=3)>-1&&f.push(239,191,189);continue}if(g+1===d){(b-=3)>-1&&f.push(239,191,189);continue}e=c;continue}if(56320>c){(b-=3)>-1&&f.push(239, 191,189),e=c;continue}c=e-55296<<10|c-56320|65536,e=null}else e&&((b-=3)>-1&&f.push(239,191,189),e=null);if(128>c){if((b-=1)<0)break;f.push(c)}else if(2048>c){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}else if(65536>c){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(2097152>c))throw new Error("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return f}function M(a){for(var b=[],c=0;c>8,e=c%256,f.push(e),f.push(d);return f}function O(a){return R.toByteArray(I(a))}function P(a,b,c,d){for(var e=0;d>e&&!(e+c>=b.length||e>=a.length);e++)b[e+c]=a[e];return e}function Q(a){try{return decodeURIComponent(a)}catch(b){return String.fromCharCode(65533)}}var R=c(17),S=c(18),T=c(16);b.Buffer=a,b.SlowBuffer=n,b.INSPECT_MAX_BYTES=50,a.poolSize=8192;var U=1073741823,V={};a.TYPED_ARRAY_SUPPORT=function(){try{var a=new ArrayBuffer(0), b=new Uint8Array(a);return b.foo=function(){return 42},42===b.foo()&&"function"==typeof b.subarray&&0===(new Uint8Array(1)).subarray(1,1).byteLength}catch(c){return!1}}(),a.isBuffer=function(a){return!(null==a||!a._isBuffer)},a.compare=function(b,c){if(!a.isBuffer(b)||!a.isBuffer(c))throw new TypeError("Arguments must be Buffers");if(b===c)return 0;for(var d=b.length,e=c.length,f=0,g=Math.min(d,e);g>f&&b[f]===c[f];)++f;return f!==g&&(d=b[f],e=c[f]),e>d?-1:d>e?1:0},a.isEncoding=function(a){switch(String(a).toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "binary":case "base64":case "raw":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return!0; default:return!1}},a.concat=function(b,c){if(!T(b))throw new TypeError("list argument must be an Array of Buffers.");if(0===b.length)return new a(0);if(1===b.length)return b[0];var d;if(void 0===c)for(c=0,d=0;db&&(b=0),c>this.length&&(c=this.length),b>=c)return"";for(;;)switch(a){case "hex":return z(this,b,c);case "utf8":case "utf-8":return w(this,b,c);case "ascii":return x(this,b,c);case "binary":return y(this,b,c);case "base64":return v(this,b,c);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return A(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}},a.prototype.equals=function(b){if(!a.isBuffer(b))throw new TypeError("Argument must be a Buffer"); return this===b?!0:0===a.compare(this,b)},a.prototype.inspect=function(){var a="",c=b.INSPECT_MAX_BYTES;return this.length>0&&(a=this.toString("hex",0,c).match(/.{2}/g).join(" "),this.length>c&&(a+=" ... ")),"\x3cBuffer "+a+"\x3e"},a.prototype.compare=function(b){if(!a.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b?0:a.compare(this,b)},a.prototype.indexOf=function(b,c){function d(a,b,c){for(var d=-1,e=0;c+e2147483647?c=2147483647:-2147483648>c&&(c=-2147483648),c>>=0,0===this.length)return-1;if(c>=this.length)return-1;if(0>c&&(c=Math.max(this.length+c,0)),"string"==typeof b)return 0===b.length?-1:String.prototype.indexOf.call(this,b,c);if(a.isBuffer(b))return d(this,b,c);if("number"==typeof b)return a.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,b,c):d(this,[b],c);throw new TypeError("val must be string, number or Buffer"); },a.prototype.get=function(a){return this.readUInt8(a)},a.prototype.set=function(a,b){return this.writeUInt8(a,b)},a.prototype.write=function(a,b,c,d){if(void 0===b)d="utf8",c=this.length,b=0;else if(void 0===c&&"string"==typeof b)d=b,c=this.length,b=0;else if(isFinite(b))b=0|b,isFinite(c)?(c=0|c,void 0===d&&(d="utf8")):(d=c,c=void 0);else{var e=d;d=b,b=0|c,c=e}var f=this.length-b;if((void 0===c||c>f)&&(c=f),a.length>0&&(0>c||0>b)||b>this.length)throw new RangeError("attempt to write outside buffer bounds"); d||(d="utf8");for(var g=!1;;)switch(d){case "hex":return p(this,a,b,c);case "utf8":case "utf-8":return q(this,a,b,c);case "ascii":return r(this,a,b,c);case "binary":return s(this,a,b,c);case "base64":return t(this,a,b,c);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return u(this,a,b,c);default:if(g)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),g=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice= function(b,c){var d=this.length;b=~~b,c=void 0===c?d:~~c,0>b?(b+=d,0>b&&(b=0)):b>d&&(b=d),0>c?(c+=d,0>c&&(c=0)):c>d&&(c=d),b>c&&(c=b);var e;if(a.TYPED_ARRAY_SUPPORT)e=a._augment(this.subarray(b,c));else{var f=c-b;e=new a(f,void 0);for(var g=0;f>g;g++)e[g]=this[g+b]}return e.length&&(e.parent=this.parent||this),e},a.prototype.readUIntLE=function(a,b,c){a=0|a,b=0|b,c||B(a,b,this.length);for(var d=this[a],e=1,f=0;++f0&&(e*=256);)d+=this[a+--b]*e;return d},a.prototype.readUInt8=function(a,b){return b||B(a,1,this.length),this[a]},a.prototype.readUInt16LE=function(a,b){return b||B(a,2,this.length),this[a]|this[a+1]<<8},a.prototype.readUInt16BE=function(a,b){return b||B(a,2,this.length),this[a]<<8|this[a+1]},a.prototype.readUInt32LE=function(a,b){return b||B(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]},a.prototype.readUInt32BE=function(a, b){return b||B(a,4,this.length),16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])},a.prototype.readIntLE=function(a,b,c){a=0|a,b=0|b,c||B(a,b,this.length);for(var d=this[a],e=1,f=0;++f=e&&(d-=Math.pow(2,8*b)),d},a.prototype.readIntBE=function(a,b,c){a=0|a,b=0|b,c||B(a,b,this.length);for(var d=b,e=1,f=this[a+--d];d>0&&(e*=256);)f+=this[a+--d]*e;return e*=128,f>=e&&(f-=Math.pow(2,8*b)),f},a.prototype.readInt8=function(a,b){return b||B(a,1,this.length), 128&this[a]?-1*(255-this[a]+1):this[a]},a.prototype.readInt16LE=function(a,b){b||B(a,2,this.length);var c=this[a]|this[a+1]<<8;return 32768&c?4294901760|c:c},a.prototype.readInt16BE=function(a,b){b||B(a,2,this.length);var c=this[a+1]|this[a]<<8;return 32768&c?4294901760|c:c},a.prototype.readInt32LE=function(a,b){return b||B(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},a.prototype.readInt32BE=function(a,b){return b||B(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+ 3]},a.prototype.readFloatLE=function(a,b){return b||B(a,4,this.length),S.read(this,a,!0,23,4)},a.prototype.readFloatBE=function(a,b){return b||B(a,4,this.length),S.read(this,a,!1,23,4)},a.prototype.readDoubleLE=function(a,b){return b||B(a,8,this.length),S.read(this,a,!0,52,8)},a.prototype.readDoubleBE=function(a,b){return b||B(a,8,this.length),S.read(this,a,!1,52,8)},a.prototype.writeUIntLE=function(a,b,c,d){a=+a,b=0|b,c=0|c,d||C(this,a,b,c,Math.pow(2,8*c),0);var e=1,f=0;for(this[b]=255&a;++f=0&&(f*=256);)this[b+e]=a/f&255;return b+c},a.prototype.writeUInt8=function(b,c,d){return b=+b,c=0|c,d||C(this,b,c,1,255,0),a.TYPED_ARRAY_SUPPORT||(b=Math.floor(b)),this[c]=b,c+1},a.prototype.writeUInt16LE=function(b,c,d){return b=+b,c=0|c,d||C(this,b,c,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[c]=b,this[c+1]=b>>>8):D(this,b,c,!0), c+2},a.prototype.writeUInt16BE=function(b,c,d){return b=+b,c=0|c,d||C(this,b,c,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[c]=b>>>8,this[c+1]=b):D(this,b,c,!1),c+2},a.prototype.writeUInt32LE=function(b,c,d){return b=+b,c=0|c,d||C(this,b,c,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[c+3]=b>>>24,this[c+2]=b>>>16,this[c+1]=b>>>8,this[c]=b):E(this,b,c,!0),c+4},a.prototype.writeUInt32BE=function(b,c,d){return b=+b,c=0|c,d||C(this,b,c,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[c]=b>>>24,this[c+1]=b>>>16,this[c+ 2]=b>>>8,this[c+3]=b):E(this,b,c,!1),c+4},a.prototype.writeIntLE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);C(this,a,b,c,e-1,-e)}var f=0,g=1,h=0>a?1:0;for(this[b]=255&a;++f>0)-h&255;return b+c},a.prototype.writeIntBE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);C(this,a,b,c,e-1,-e)}var f=c-1,g=1,h=0>a?1:0;for(this[b+f]=255&a;--f>=0&&(g*=256);)this[b+f]=(a/g>>0)-h&255;return b+c},a.prototype.writeInt8=function(b,c,d){return b=+b,c=0|c,d|| C(this,b,c,1,127,-128),a.TYPED_ARRAY_SUPPORT||(b=Math.floor(b)),0>b&&(b=255+b+1),this[c]=b,c+1},a.prototype.writeInt16LE=function(b,c,d){return b=+b,c=0|c,d||C(this,b,c,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[c]=b,this[c+1]=b>>>8):D(this,b,c,!0),c+2},a.prototype.writeInt16BE=function(b,c,d){return b=+b,c=0|c,d||C(this,b,c,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[c]=b>>>8,this[c+1]=b):D(this,b,c,!1),c+2},a.prototype.writeInt32LE=function(b,c,d){return b=+b,c=0|c,d||C(this,b,c,4,2147483647,-2147483648), a.TYPED_ARRAY_SUPPORT?(this[c]=b,this[c+1]=b>>>8,this[c+2]=b>>>16,this[c+3]=b>>>24):E(this,b,c,!0),c+4},a.prototype.writeInt32BE=function(b,c,d){return b=+b,c=0|c,d||C(this,b,c,4,2147483647,-2147483648),0>b&&(b=4294967295+b+1),a.TYPED_ARRAY_SUPPORT?(this[c]=b>>>24,this[c+1]=b>>>16,this[c+2]=b>>>8,this[c+3]=b):E(this,b,c,!1),c+4},a.prototype.writeFloatLE=function(a,b,c){return G(this,a,b,!0,c)},a.prototype.writeFloatBE=function(a,b,c){return G(this,a,b,!1,c)},a.prototype.writeDoubleLE=function(a,b, c){return H(this,a,b,!0,c)},a.prototype.writeDoubleBE=function(a,b,c){return H(this,a,b,!1,c)},a.prototype.copy=function(b,c,d,e){if(d||(d=0),e||0===e||(e=this.length),c>=b.length&&(c=b.length),c||(c=0),e>0&&d>e&&(e=d),e===d)return 0;if(0===b.length||0===this.length)return 0;if(0>c)throw new RangeError("targetStart out of bounds");if(0>d||d>=this.length)throw new RangeError("sourceStart out of bounds");if(0>e)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),b.length- cf||!a.TYPED_ARRAY_SUPPORT)for(var g=0;f>g;g++)b[g+c]=this[g+d];else b._set(this.subarray(d,d+f),c);return f},a.prototype.fill=function(a,b,c){if(a||(a=0),b||(b=0),c||(c=this.length),b>c)throw new RangeError("end \x3c start");if(c!==b&&0!==this.length){if(0>b||b>=this.length)throw new RangeError("start out of bounds");if(0>c||c>this.length)throw new RangeError("end out of bounds");var d;if("number"==typeof a)for(d=b;c>d;d++)this[d]=a;else{var e=L(a.toString()), f=e.length;for(d=b;c>d;d++)this[d]=e[d%f]}return this}},a.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(a.TYPED_ARRAY_SUPPORT)return(new a(this)).buffer;for(var b=new Uint8Array(this.length),c=0,d=b.length;d>c;c+=1)b[c]=this[c];return b.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser");};var W=a.prototype;a._augment=function(b){return b.constructor=a,b._isBuffer=!0,b._set=b.set,b.get=W.get,b.set=W.set,b.write=W.write,b.toString=W.toString, b.toLocaleString=W.toString,b.toJSON=W.toJSON,b.equals=W.equals,b.compare=W.compare,b.indexOf=W.indexOf,b.copy=W.copy,b.slice=W.slice,b.readUIntLE=W.readUIntLE,b.readUIntBE=W.readUIntBE,b.readUInt8=W.readUInt8,b.readUInt16LE=W.readUInt16LE,b.readUInt16BE=W.readUInt16BE,b.readUInt32LE=W.readUInt32LE,b.readUInt32BE=W.readUInt32BE,b.readIntLE=W.readIntLE,b.readIntBE=W.readIntBE,b.readInt8=W.readInt8,b.readInt16LE=W.readInt16LE,b.readInt16BE=W.readInt16BE,b.readInt32LE=W.readInt32LE,b.readInt32BE=W.readInt32BE, b.readFloatLE=W.readFloatLE,b.readFloatBE=W.readFloatBE,b.readDoubleLE=W.readDoubleLE,b.readDoubleBE=W.readDoubleBE,b.writeUInt8=W.writeUInt8,b.writeUIntLE=W.writeUIntLE,b.writeUIntBE=W.writeUIntBE,b.writeUInt16LE=W.writeUInt16LE,b.writeUInt16BE=W.writeUInt16BE,b.writeUInt32LE=W.writeUInt32LE,b.writeUInt32BE=W.writeUInt32BE,b.writeIntLE=W.writeIntLE,b.writeIntBE=W.writeIntBE,b.writeInt8=W.writeInt8,b.writeInt16LE=W.writeInt16LE,b.writeInt16BE=W.writeInt16BE,b.writeInt32LE=W.writeInt32LE,b.writeInt32BE= W.writeInt32BE,b.writeFloatLE=W.writeFloatLE,b.writeFloatBE=W.writeFloatBE,b.writeDoubleLE=W.writeDoubleLE,b.writeDoubleBE=W.writeDoubleBE,b.fill=W.fill,b.inspect=W.inspect,b.toArrayBuffer=W.toArrayBuffer,b};var X=/[^+\/0-9A-z\-]/g}).call(b,c(13).Buffer)},function(a,b,c){var d={utf8:{stringToBytes:function(a){return d.bin.stringToBytes(unescape(encodeURIComponent(a)))},bytesToString:function(a){return decodeURIComponent(escape(d.bin.bytesToString(a)))}},bin:{stringToBytes:function(a){for(var b=[], c=0;c>>32-b},rotr:function(a,b){return a<<32-b|a>>>b},endian:function(a){if(a.constructor==Number)return 16711935&c.rotl(a,8)|4278255360&c.rotl(a,24);for(var b=0;b0;a--)b.push(Math.floor(256*Math.random()));return b},bytesToWords:function(a){for(var b=[],c=0,d=0;c>>5]|=a[c]<<24-d%32;return b},wordsToBytes:function(a){for(var b=[],c=0;c<32*a.length;c+=8)b.push(a[c>>>5]>>>24-c%32&255);return b},bytesToHex:function(a){for(var b=[],c=0;c>>4).toString(16)),b.push((15&a[c]).toString(16));return b.join("")},hexToBytes:function(a){for(var b=[],c=0;cf;f++)8*d+6*f<=8*a.length?c.push(b.charAt(e>>>6*(3-f)&63)):c.push("\x3d");return c.join("")},base64ToBytes:function(a){a=a.replace(/[^A-Z0-9+\/]/gi,"");for(var c=[],d=0,e=0;d>>6-2*e);return c}};a.exports=c}()},function(a,b,c){var d=Array.isArray,e=Object.prototype.toString;a.exports= d||function(a){return!!a&&"[object Array]"==e.call(a)}},function(a,b,c){var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(a){function b(a){var b=a.charCodeAt(0);return b===g||b===l?62:b===h||b===m?63:i>b?-1:i+10>b?b-i+26+26:k+26>b?b-k:j+26>b?b-j+26:void 0}function c(a){function c(a){j[l++]=a}var d,e,g,h,i,j;if(a.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=a.length;i="\x3d"===a.charAt(k-2)?2:"\x3d"===a.charAt(k-1)?1:0,j=new f(3* a.length/4-i),g=i>0?a.length-4:a.length;var l=0;for(d=0,e=0;g>d;d+=4,e+=3)h=b(a.charAt(d))<<18|b(a.charAt(d+1))<<12|b(a.charAt(d+2))<<6|b(a.charAt(d+3)),c((16711680&h)>>16),c((65280&h)>>8),c(255&h);return 2===i?(h=b(a.charAt(d))<<2|b(a.charAt(d+1))>>4,c(255&h)):1===i&&(h=b(a.charAt(d))<<10|b(a.charAt(d+1))<<4|b(a.charAt(d+2))>>2,c(h>>8&255),c(255&h)),j}function e(a){function b(a){return d.charAt(a)}function c(a){return b(a>>18&63)+b(a>>12&63)+b(a>>6&63)+b(63&a)}var e,f,g,h=a.length%3,i="";for(e=0, g=a.length-h;g>e;e+=3)f=(a[e]<<16)+(a[e+1]<<8)+a[e+2],i+=c(f);switch(h){case 1:f=a[a.length-1],i+=b(f>>2),i+=b(f<<4&63),i+="\x3d\x3d";break;case 2:f=(a[a.length-2]<<8)+a[a.length-1],i+=b(f>>10),i+=b(f>>4&63),i+=b(f<<2&63),i+="\x3d"}return i}var f="undefined"!=typeof Uint8Array?Uint8Array:Array,g="+".charCodeAt(0),h="/".charCodeAt(0),i="0".charCodeAt(0),j="a".charCodeAt(0),k="A".charCodeAt(0),l="-".charCodeAt(0),m="_".charCodeAt(0);a.toByteArray=c,a.fromByteArray=e}(b)},function(a,b,c){b.read=function(a, b,c,d,e){var f,g,h=8*e-d-1,i=(1<>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?NaN:(n?-1:1)*(1/0);g+=Math.pow(2,d),f-=j}return(n?-1:1)*g*Math.pow(2,f-d)},b.write=function(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||b=== 1/0?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p}}])});Object.getOwnPropertyDescriptors=function getOwnPropertyDescriptors(obj){var descriptors={};for(var prop in obj)if(obj.hasOwnProperty(prop))descriptors[prop]= Object.getOwnPropertyDescriptor(obj,prop);return descriptors};Function.prototype.extend=function extend(proto){var superclass=this;var constructor;if(!proto.hasOwnProperty("constructor"))Object.defineProperty(proto,"constructor",{value:function(){superclass.apply(this,arguments)},writable:true,configurable:true,enumerable:false});constructor=proto.constructor;constructor.prototype=Object.create(this.prototype,Object.getOwnPropertyDescriptors(proto));return constructor};a.manager=function(){var eventTrackingPath= "/api/wtf/v2/planout/track";var sessionCookie="edw";var sessionId=null;var sessionMaxAge=30;var visitorCookie="edmunds";var visitorId=null;var visitorMaxAge=365*24*60;var trackTimeout=1E3;var campaigns={};var Cookie={set:function(name,value,mins){var domain,domainParts,date,expires,host;if(mins){date=new Date;date.setTime(date.getTime()+mins*60*1E3);expires="; expires\x3d"+date.toGMTString()}else expires="";host=location.host;if(host.split(".").length===1)document.cookie=name+"\x3d"+value+expires+ "; path\x3d/";else{domainParts=host.split(".");domainParts.shift();domain="."+domainParts.join(".");document.cookie=name+"\x3d"+value+expires+"; path\x3d/; domain\x3d"+domain;if(Cookie.get(name)==null||Cookie.get(name)!=value){domain="."+host;document.cookie=name+"\x3d"+value+expires+"; path\x3d/; domain\x3d"+domain}}},get:function(name){var nameEQ=name+"\x3d";var ca=document.cookie.split(";");for(var i=0;i0)assignment+="|";assignment+=param+":"+data.params[param]});track(this.name,assignment,this.hash);return},getParamNames:function(){return Object.keys(this._assignment._data)},previouslyLogged:function(){return this._exposureLogged}})};var init=function(){getAndSetVisitorCookie();getAndSetSessionCookie();campaigns=loadCampaignsFromArray()}; var loadCampaignsFromArray=function(){var result={};for(var i in planOutCampaigns){var campaign=transformCampaign(planOutCampaigns[i]);var WTFExperiment=defineExperiment(campaign);result[campaign.name]=new WTFExperiment(getInputData())}return result};var transformCampaign=function(original){var campaign={};campaign.name=original.name;campaign.compiled=original.json;campaign.salt=original.salt?original.salt:original.name;campaign.hash=original.hash;return campaign};var getAllCampaigns=function(){return campaigns}; var getInputData=function(){return{"visitorId":visitorId}};var getRootUri=function(){if(window.location.hostname.indexOf("www.edmunds.com")>-1)return window.location.origin;else if(window.location.hostname=="")return"http://localhost:8888";else return"http://www.edmunds.com"};var invokeTrack=function(params){var url=getRootUri()+eventTrackingPath;var xmlHttp=new XMLHttpRequest;xmlHttp.open("GET",url+"?"+params,true);xmlHttp.timeout=trackTimeout;xmlHttp.ontimeout=function(){};xmlHttp.onerror=function(status, error){};xmlHttp.send(params)};var track=function(campaign,param,hash){var params="visitorId\x3d"+visitorId+"\x26sessionId\x3d"+sessionId+"\x26campaign\x3d"+campaign+"\x26recipe\x3d"+param+"\x26hash\x3d"+hash;invokeTrack(params)};var param=function(params,cb){var splitted=params.split(":");var campaignName=splitted[0];var param=splitted[1];var def_val=splitted[2];var campaign=campaigns[campaignName];var result;if(param)result=campaign?campaign.get(param,def_val):def_val;else result=campaign?campaign.getParams(): null;if(campaign&&result)if(param){var ctrl=result===campaign.ctrlParams[param]?"ctrl:":"";var assignment=ctrl+result;track(campaign.name+":"+param,assignment,campaign.hash)}else Object.keys(result).forEach(function(param){var ctrl=result[param]===campaign.ctrlParams[param]?"ctrl:":"";var assignment=ctrl+result[param];track(campaign.name+":"+param,assignment,campaign.hash)});if(cb)cb(result);return result};init();return{param:param}}();a.version="1.0";a.callMethod=function(methodName,args,cb){if(!methodName|| !args)return;var result;switch(methodName){case "param":result=a.manager.param(args,cb);break;default:}return result}}})(window);