"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function this_value(){return this.valueOf()}function quote(e){return rx_escapable.lastIndex=0,rx_escapable.test(e)?'"'+e.replace(rx_escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var r,o,c,n,i,a=gap,u=t[e];switch(u&&"object"==typeof u&&"function"==typeof u.toJSON&&(u=u.toJSON(e)),"function"==typeof rep&&(u=rep.call(t,e,u)),typeof u){case"string":return quote(u);case"number":return isFinite(u)?String(u):"null";case"boolean":case"null":return String(u);case"object":if(!u)return"null";if(gap+=indent,i=[],"[object Array]"===Object.prototype.toString.apply(u)){for(n=u.length,r=0;r3072?E.sendActivity(o,"error",{time:(new Date).getTime(),error:r+" too large"}):n(r,{value:JSON.stringify(e),path:"/"})}}function a(){return document.cookie.indexOf("__cq_dnt=1")!==-1}function u(){try{for(var e=["cqcid","cquid","__cq_uuid","__cqact","__cqviews","__cq_bc","__cq_seg","__cq_anchor"],t=(e.length,document.cookie.split(";")),r=0,o=t.length;r-1?c.substr(0,n):c).trim();e.indexOf(i)!==-1&&(document.cookie=i+"=; path=/; domain="+F+"; expires=Thu, 01 Jan 1970 00:00:00 GMT")}}catch(e){}}function s(e){for(var t,r=window.location.search.substring(1),o=r.split("&"),c=0,n=o.length;c0)||!!p("__cqact")}function x(e,t){if(e){var r=v(),o=t.map(function(e){return e.id});r[e]=o;var c=JSON.stringify(r);try{window.sessionStorage.setItem("cq.anchor",c)}catch(e){n("__cq_anchor",{value:c,domain:f("__cq_anchor"),path:"/"})}}}function N(e,t,r,o){var c={clientId:e,activityType:t,params:r,callback:o};D.push(c)}function C(){for(var e=0,t=D.length;e=0)return r}return"other"}var E=e.CQuotient=window.CQuotient||(e.CQuotient={});E.VERSION="v2.9.16";var U=0,D=[],P=!0,M=!1;E.byteLength=function(e){for(var t=e.length,r=0,o=e.length;r127&&c<=2047?t++:c>2047&&c<=65535&&(t+=2),c>=55296&&c<=56319&&r++}return t},E._getTopDomain=function(e){var t,r,o="weird_get_top_level_domain=cookie",c=e.split(".");for(t=c.length-1;t>=0;t--)if(r=c.slice(t).join("."),document.cookie=o+";domain=."+r+";",document.cookie.indexOf(o)>-1)return document.cookie=o.split("=")[0]+"=;domain=."+r+";expires=Thu, 01 Jan 1970 00:00:01 GMT;","."+r;return!1};var F=E._getTopDomain(document.location.hostname),B={customerSignup:["cookieId","userId","emailId"],viewPage:["cookieId","pageId"],viewProduct:["cookieId","product"],search:["cookieId","searchText"],viewSearch:["cookieId","searchText","products"],clickSearch:["cookieId","searchText","product"],viewCategory:["cookieId","categoryId"],clickCategory:["cookieId","categoryId"],viewCart:["cookieId","products"],addToCart:["cookieId","product"],removeFromCart:["cookieId","product"],beginCheckout:["cookieId","products","amount"],finishCheckout:["cookieId","products","amount"],reviewProduct:["cookieId","product","rating"],clickReco:["cookieId","product"],_clickReco:["cookieId","product"],viewWishList:["cookieId"],addToWishList:["cookieId"],removeFromWishList:["cookieId"],viewReco:["cookieId"],servedReco:[],error:[]},L={},V={},Q={},$={},W={},G={},H=g();try{window.sessionStorage.removeItem("cq.viewReco")}catch(e){document.cookie="__cqviews=;path=/;"}var Y=y();try{window.sessionStorage.removeItem("cq.viewSearch")}catch(e){document.cookie="__cqsviews=;path=/;"}var Z=_();try{window.sessionStorage.removeItem("cq.viewCategory")}catch(e){document.cookie="__cqcviews=;path=/;"}var z=v();try{window.sessionStorage.removeItem("cq.anchor")}catch(e){l("__cq_anchor")}var K=!1;if(window.setTimeout(function(){K||!E.clientId||T()||E.sendActivity(E.clientId,"viewPage",{cookieId:p("cqcid")})},1e3),E.sendActivity=function(e,r,o,c){function n(){delete E[T],R.parentNode.removeChild(R)}if(a())return u(),new Image;if(!e)throw new Error("Must provide a clientId");if(!B.hasOwnProperty(r))throw new Error("Unsupported activity type!");if(K=!0,o=o||{},"viewReco"===r){if(o.accumulate)return delete o.accumulate,void w(e,o);var i=v(),f=o.recommenderName;i.hasOwnProperty(f)&&(o.anchors=i[f])}if("viewSearch"===r&&o.accumulate)return delete o.accumulate,void I(e,o);if("viewCategory"===r&&o.accumulate)return delete o.accumulate,void k(e,o);if("viewProduct"===r&&(S(e,o.product),b(e,o.product),O(e,o.product)),!("clickReco"===r&&H.length>0)){var l=s("__cq_eid");l&&(o.emailId=l),"_clickReco"===r&&(r="clickReco"),o.referrer=window.document.referrer;var h=p("__cq_uuid");h&&(o.__cq_uuid=h);var g=p("__cq_seg");g&&(o.__cq_seg=g);var y="https://p."+t()+"/pebble?tla="+e+"&activityType="+r,_=m(e);_&&(o.bc=_),o.ls=q(),y+="&_="+(new Date).getTime();var T="_act_callback"+U++;y+="&callback=CQuotient."+T,o.v=E.VERSION;var x=d(o);if(x.length>0&&(y+="&"+x),!j()&&!M){if(!P)return void N(e,r,o,c);P=!1}var R=document.createElement("script");return R.src=y,R.type="text/javascript",E[T]=function(e){if("[object Object]"===Object.prototype.toString.call(e)&&(e=[e]),"[object Array]"===Object.prototype.toString.call(e))for(var t=0,r=e.length;t0){for(var X=0;X=0&&(s=re[f]);var l,v=o.timeoutMs||5e3,h="_callback"+U++,g="recs/"+e+"/"+r+"?callback=CQuotient."+h;if(s?l="r":(g+="&_="+(new Date).getTime(),l="e"),o.filters){var y=o.filters;delete o.filters,y.fieldsToMatchToValue&&(o.filter_fieldsToMatchToValue=y.fieldsToMatchToValue)}r&&o.hasOwnProperty("anchors")&&x(r,o.anchors),o.v=E.VERSION,g+="&_device="+A(navigator.userAgent);var _=m(e);_&&(o.bc=_);var w=d(o);w.length>0&&(g+="&"+w);var I=document.createElement("script");I.src="https://"+l+"."+t()+"/"+g,I.type="text/javascript";var k=window.setTimeout(function(){try{n&&n({errorMessage:"Reco request timed out for recommender: "+r})}finally{i()}},v);E[h]=function(t){try{if("[object Object]"===Object.prototype.toString.call(t))try{c(t)}catch(r){E.sendActivity(e,"error",{time:new Date-a,recoRequestParams:o,recoResponse:t,caughtError:r})}finally{E.sendActivity(e,"servedReco",{time:new Date-a,recoRequestParams:o,recoResponse:t})}else if(n)try{n(t)}finally{E.sendActivity(e,"error",{time:new Date-a,recoRequestParams:o,recoResponse:t})}}catch(r){E.sendActivity(e,"error",{time:new Date-a,recoRequestParams:o,recoResponse:t,caughtError:r})}finally{i()}},document.getElementsByTagName("body")[0].appendChild(I)},E.clientId&&E.widgets&&E.widgets.length>0){for(var oe=0;oe