(function(f){var g=window.AmazonUIPageJS||window.P,k=g._namespace||g.attributeErrors,q=k?k("CustomerReviewsCommonAssets",""):g;q.guardFatal?q.guardFatal(f)(q,window):q.execute(function(){f(q,window)})})(function(f,g,k){function q(){}f.when("A","cr-log-utils","cr-streaming-utils","ready").execute(function(c,d,b){function a(){function a(a){l[a]&&(l[a].abort(),delete l[a])}function n(e,m,r,u,v,f,k,y){m=m||{};m.params=m.params||{};f=f?f:p++;v=v?v:m.error||function(){};u=u?u:0;r=r?r:2;y=y?y:"FATAL";var h=
"FATAL"===y?0:1,w=m.finallyCallback||function(){};k||(k="reviewsAjax"+t++,g.uet&&g.uet("tc",k));var x=c.state("cr-weblab-state"),q;for(q in x)x.hasOwnProperty(q)&&(m.params[q]=x[q]);m.params.scope=k;m.contentType=m.contentType||"application/x-www-form-urlencoded;charset\x3dUTF-8";var z=m.success||function(){};m.success=function(a){delete l[f];"function"===typeof z&&z(a);"function"===typeof w&&w(a)};m.error=function(c,b,p){c=c||{};var l=(c.http||{}).status||"[]";if(401===l){var t=c;var x=v,q=t.http.getResponseHeader("x-amz-re-authentication-url");
q?("function"===typeof x&&x(t),"function"===typeof w&&w(t),d.logCount("AjaxRedirectToReAuthenticationUrl",1),g.location=q,t=!0):t=!1;if(t)return;u=r}a(f);u++;u<r?(b="AJAX Post to "+e+" from "+g.location.href+" failed, status code passed through parameter was: "+b+", status code extracted from XHR HTTP object was: "+l+", attempt "+u+" of "+r+", error message was: \n "+p,d.logError(b,"WARN"),n(e,m,r,u,v,f,k,y)):(b="AJAX Post to "+e+" from "+g.location.href+" failed, status code passed through parameter was: "+
b+", status code extracted from XHR HTTP object was: "+l+", exhausted "+r+" attempt(s), error message was: \n "+p,d.logError(b,y),d.logCount("AjaxFailureFatal",h),"function"===typeof v&&v(c),"function"===typeof w&&w(c))};"function"!==typeof m.chunk&&(m.chunk=function(a){"appendFadeIn"===a[0]?b.appendFadeIn(a):"replace"===a[0]&&b.replace(a)});l[f]=c.post(e,m);return f}var t=0,p=1,l={};return{abort:a,post:n,postWithoutFatals:function(a,c,b,e,p,d,t){return n(a,c,b,e,p,d,t,"WARN")}}}f.now?f.now("cr-ajax-model").execute(function(c){c||
f.now().register("cr-ajax-model",a)}):f.register("cr-ajax-model",a)});"use strict";f.when("A","cr-jQuery","cr-log-utils","cr-number-utils").register("cr-A",function(c,d,b,a){c.toggleExpanderAriaLabel=function(a,b,e){a="a:expander:"+a+":toggle";c.on(a+":expand",function(a){a.expander.$expander.find('a[data-action\x3d"a-expander-toggle"]').attr("aria-label",e);a.expander.$expander.attr("tabindex","-1").focus()});c.on(a+":collapse",function(a){a.expander.$expander.find('a[data-action\x3d"a-expander-toggle"]').attr("aria-label",
b)})};c.getListFromState=function(a){var b=c.map(d("#cr-state-object, .cr-state-object"),function(a){return d(a).data("state")});return c.reduce(b,function(c,b){b!==k&&b[a]!==k&&c.push(b[a]);return c},[])};c.getValueFromState=function(a){var e=c.getListFromState(a);1<e.length&&b.logError("More than one  value defined for key: "+a,"ERROR");return e[0]};var e={top:-100,left:-100};c.inView=function(a){a=a||d();if("function"===typeof a.offset){var c=(a.offset()||e).top-d(g).scrollTop();a=0<=c;c=c<d(g).height();
return a&&c}return!1};c.onScreenAndVisible=function(c,b){c=c||d();b=a.isFiniteNumber(b)?b:0;if(c instanceof d||c.jquery){if(!c.is(":visible"))return!1;c=c[0].getBoundingClientRect();return c.top>=0-b&&c.left>=0-b&&c.bottom<=d(g).height()+b&&c.right<=d(g).width()+b}return!1};c.compositeEventWrapper=function(a,e,d){var n=a;d&&(n=c.throttle(n,d,{trailing:!1}));return b.jsGuard(function(a){a&&(n(a),e&&a.$event&&a.$event.preventDefault())})};c.freeze=function(a){return"undefined"!==typeof Object&&"function"===
typeof Object.freeze?Object.freeze(a):a};c.isFrozen=function(a){return"undefined"!==typeof Object&&"function"===typeof Object.isFrozen?Object.isFrozen(a):!1};return c});"use strict";f.when("jQuery").register("cr-jQuery",function(c){return c});"use strict";f.declare("reviews-constants",{PUSH_STATE:!0,REPLACE_STATE:!1,RATING_SERVICE_CONTEXT_ID:"ReviewsConsumption",data:{REFTAG:"data-reftag",CSM_COUNTER:"data-csm-counter",getReviews:{STANDARD:"data-reviews-state-param",CHECKED:"data-reviews-param-checked",
UNCHECKED:"data-reviews-param-unchecked"}},events:{CONTENT_CHANGED:"reviews:content-changed",RELOAD:"reviews:content-reload",RELOAD_COMPLETE:"reviews:content-reload-complete",AUTOSCROLL_COMPLETE:"reviews:autoscroll-complete",FILTER_FIRE_AGGREGATE:"reviews:filter-action:aggregate:trigger",FILTER_FIRE_UPDATE:"reviews:filter-action:trigger",FILTER_AGGREGATE:"reviews:filter-action:aggregate",FILTER_PUSH:"reviews:filter-action:push-state",FILTER_REPLACE:"reviews:filter-action:replace-state",PAGINATION:"reviews:page-action",
SEARCH_TEXTBOX:"reviews:search-textbox",SEARCH_BUTTON:"reviews:search-button",VOTE:"reviews:vote-action",TOGGLE_CLASS_CLICK:"reviews:toggle-class:click",AJAX_POST:"reviews:ajax-post",SCROLL_TO_ELEMENT_CLICK:"reviews:scroll-to-element:click",OPEN_MASH_MODAL:"reviews:open-mash-modal",FILTER_APPLY:"reviews:filter-action:apply",FILTER_CHANGE:"reviews:filter-action:change",FILTER_TAB_CLICKED:"reviews:filter-action:tab-clicked",FILTER_APPLY_BEGIN:"reviews:filter-action:apply-begin",FILTER_APPLY_SUCCESS:"reviews:filter-action:apply-success",
FILTER_APPLY_ERROR:"reviews:filter-action:apply-error",FILTER_APPLY_DONE:"reviews:filter-action:apply-done",INPUT_COMMENT:"reviews:input-comment",SUBMIT_COMMENT:"reviews:submit-comment",OPEN_SUBMISSION_COMMENT:"reviews:open-comment-submission",SORT_COMMENTS:"reviews:sort-comments",MORE_COMMENTS:"reviews:more-comments",EDIT_COMMENT:"reviews:edit-comment",CANCEL_EDIT_COMMENT:"reviews:cancel-edit-comment",DELETE_COMMENT:"reviews:delete-comment",SUBMIT_EDIT_COMMENT:"reviews:submit-edit-comment",MODIFY_EDIT_COMMENT:"reviews:modify-edit-comment",
INPUT_PRODUCT_LINK:"reviews:input-product-link",SELECT_PRODUCT_LINK:"reviews:select-product-link",STAR_RATING_CLICK:"ryp:star-rating-click",STAR_RATING_CLEAR:"ryp:star-rating-clear-click",TRIGGER_WEBLAB:"reviews:trigger-weblab",REFTAG_TRIGGER:"reviews:trigger-reftag"},filterOptions:{SORT_KEY:"sortBy",HELPFUL:"helpful",RECENT:"recent",LEGACY_HELPFUL:"byRankDescending",LEGACY_RECENT:"bySubmissionDateDescending",MOBILE_HELPFUL:"sh",MOBILE_RECENT:"sd",STAR_KEY:"filterByStar",ALL_STARS:"all_stars",ONE_STAR:"one_star",
TWO_STAR:"two_star",THREE_STAR:"three_star",FOUR_STAR:"four_star",FIVE_STAR:"five_star",POSTIVE:"positive",CRITICAL:"critical",FORMAT_KEY:"formatType",ALL_FORMATS:"all_formats",CURRENT_FORMAT:"current_format",AVP_KEY:"reviewerType",ALL_REVIEWS:"all_reviews",AVP_ONLY:"avp_only_reviews",MEDIA_KEY:"mediaType",ALL_CONTENTS:"all_contents",MEDIA_ONLY:"media_reviews_only",LANGUAGE_KEY:"filterByLanguage",HEIGHT_KEY:"filterByHeight",WEIGHT_KEY:"filterByWeight"},keycodes:{ENTER:13,BACK_SPACE:8,SPACE:32},aui:{HIDDEN:"aok-hidden",
NOWRAP:"aok-nowrap"}});"use strict";f.when("A","cr-string-utils","cr-log-utils").register("cr-popup",function(c,d,b){function a(a){var e={};a&&a.data&&(e=a.data);var f=d.defaultIfBlank(e.url,a.$target.find("a").andSelf().filter("a").attr("href")),p=d.defaultIfBlank(e.title,"CustomerReviews");p=""+p;var l="";c.each({width:null,height:null,resizable:"1",scrollbars:"1",toolbar:"0",status:"1"},function(a,c){var b=e[c];a=null===b||b===k?a:b;null!==a&&(l+=c+"\x3d"+a+",")});l=l.slice(0,-1);var h=null;try{(h=
g.open(f,p,l))?h.focus():b.logError("Unable to move focus to popup window with data: "+d.stringify(e),"ERROR"),a.$event.preventDefault()}catch(m){b.logError("Unable to open window with parameters: "+d.stringify(e),"FATAL",m)}return h}c.declarative("cr-popup",["click"],b.jsGuard(a));return{popup:a}});"use strict";f.when("A","cr-jQuery","reviews-constants","cr-ajax-model","cr-string-utils","cr-global-view").register("cr-generic-declarative-actions",function(c,d,b,a,e,n){function f(a){h(a)&&a.data.selector&&
a.data.cssClass&&(d(a.data.selector).toggleClass(a.data.cssClass),a.$event.preventDefault(),c.trigger("a:pageUpdate"))}function p(a){h(a)&&a.data.scrollToSelector&&(n.scrollTo(a.data.scrollToSelector,0),a.$event.preventDefault())}function l(b){if(h(b)&&b.data.url&&b.data.params){b.$event.preventDefault();c.declarative.remove(b.$currentTarget,r.AJAX_POST);b=b.data;var e=b.params,p=d(b.indicatorSelector)[0],n=m(d.fn.hide,b.hideOnSuccessSelector),f=m(d.fn.show,b.showOnFailureSelector);d(b.removeOnLoadSelector).remove();
a.post(b.url,{params:e,indicator:p,success:n,error:f})}}function h(a){return a&&a.data&&a.$event&&"function"===typeof a.$event.preventDefault}function m(a,b){if(b&&"function"===typeof a)return function(){var c=d(b);0<c.length&&a.call(c)}}var r=b.events;c.declarative(r.TOGGLE_CLASS_CLICK,"click",f);c.declarative(r.SCROLL_TO_ELEMENT_CLICK,"click",p);c.declarative(r.AJAX_POST,"click",l);return{toggleCssClass:f,scrollToElement:p,ajaxPost:l}});"use strict";f.register("cr-global-model",function(){return{generateUrl:function(c,
d){c&&"/"!==c.charAt(c.length-1)&&(c+="/");c&&d&&(c=c+"ref\x3d"+d);return c}}});"use strict";f.when("A","a-expander","cr-jQuery","reviews-constants","cr-string-utils").register("cr-global-view",function(c,d,b,a,e){function n(a){var b="";if(a&&a.closest!==k){var c=a.closest("*["+h.REFTAG+"]");c&&(b=c.attr(h.REFTAG))}e.isBlank(b)&&a&&a.closest!==k&&(a=a.closest("*[rel]"))&&(b=a.attr("rel"));return e.defaultIfBlank(b,"cm_cr_unknown")}function f(a){return a&&"function"===typeof a.is?a.is("*["+h.getReviews.CHECKED+
"]")&&a.is("*["+h.getReviews.UNCHECKED+"]"):!1}function p(a){return a&&a.has!==k&&a.is!==k?0<a.find(":checked").length||a.is(":checked"):!1}function l(a,b){return a&&a.attr!==k&&b?e.parseJSON(a.attr(b))||{}:{}}var h=a.data;c.on("a:pageUpdate",function(){d!==k&&d.initializeExpanders()});c.on(a.events.RELOAD_COMPLETE,function(){c.trigger("a:image:lazyLoad")});(function(){function a(a){a&&a.addEventListener("focusout",function(){a.classList.remove("cr-remove-focus-visible")},!1)}function b(a,b){a&&b&&
a.addEventListener("click",function(a){a.target.closest("a[href]:not(:focus-visible)")&&b.classList.add("cr-remove-focus-visible")},!1)}var c=document.getElementById("acrCustomerReviewLink"),e=document.getElementById("aw-udpv3-customer-reviews_feature_div"),d=document.getElementById("mobile-product-reviews");b(d,d);a(d);b(e,e);a(e);b(c,e)})();return{getReviewsStateParamsFromElement:function(a){var b=c.reduce(h.getReviews,function(a,b){return a+"*["+b+"],"},"").slice(0,-1),e;b&&a&&a.closest!==k&&(e=
a.closest(b));return f(e)?p(e)?l(e,h.getReviews.CHECKED):l(e,h.getReviews.UNCHECKED):l(e,h.getReviews.STANDARD)},getReftag:function(a){if(a&&a.$target)var c=a.$target;a&&a.id&&(c=b("#"+a.id));a&&a.expander&&a.expander.$expander&&(c=a.expander.$expander);c=n(c);"cm_cr_unknown"===c&&a&&a.data&&a.data.reftag&&(c=a.data.reftag);return c},getReftagByDom:n,scrollTo:function(a,c){a=b(a).offset();c=c||0;var e=b("#cr-state-object").data("state");e=e!==k&&e.disableScroll;a&&a.top!==k&&!e&&(b("html,body").stop(),
b("html,body").animate({scrollTop:a.top-c},{queue:!1,duration:500}))}}});"use strict";f.when("cr-A","cr-jQuery","cr-lazy-widget-model","cr-lazy-widget-view","cr-log-utils","cr-number-utils","cr-string-utils","cr-uri-utils","ready").register("cr-lazy-widget-controller",function(c,d,b,a,e,n,f,p){function l(d){var n=c.getValueFromState("lazyWidgetDomainWhitelist"),h=p.getCurrentHostname();if(n)b:{for(var l=0;l<n.length;l++)if(f.endsWith(h,n[l])){e.logCount("LazyWidgetInvalidDomain",0);break b}e.logError("AJAX triggered from invalid domain: "+
h,"WARN");e.logCount("LazyWidgetInvalidDomain",1)}else e.logCount("LazyWidgetInvalidDomain",1),e.logError("AJAX triggered with null whitelist from domain: "+h,"WARN");b.loadLazyWidgets(a.getLazyWidgetStubs())&&(e.logCount("LazyWidgetTrigger",1),e.logCount("LazyWidgetTrigger:"+d,1))}var h={};h.bufferPixels=n.convertToInteger(c.getValueFromState("lazyWidgetLoaderBufferPixels"),1E3);h.delayBeforeTriggering=n.convertToInteger(c.getValueFromState("lazyWidgetLoaderDelayBeforeTriggering"),5E3);h.triggerLazyLoadIfWidgetWithinBuffer=
function(e){b.lazyLoadHasTriggered()||a.getLazyWidgetStubs().each(function(a,b){if(c.onScreen(d(b),h.bufferPixels))return l("scroll"),!1})};var m={};h.logVisibleStubMetrics=function(b){a.getLazyWidgetStubs().each(function(a,b){a=d(b);b=a.data("widget-name");!m[b]&&c.onScreen(a)&&(e.logCount("VisibleLazyWidgetStub",1),e.logCount("VisibleLazyWidgetStub:"+b,1),m[b]=!0)})};c.on("scroll",h.logVisibleStubMetrics);c.on("scroll",h.triggerLazyLoadIfWidgetWithinBuffer);d(a.getHoverTargets()).mouseenter(function(){l("hover")});
e.logCount("LazyWidgetTrigger",0);return c.freeze(h)});"use strict";f.when("cr-A","cr-ajax-model","cr-uri-utils","ready").register("cr-lazy-widget-model",function(c,d,b){function a(){var a=c.$("#cr-state-object").attr("data-lazy-widget-triggered");return a===k?f:"true"===a}var e={},n=c.getValueFromState("lazyWidgetLoaderUrl"),f=!1;e.loadLazyWidgets=function(e){if(!a()&&0<e.length){f=!0;c.$("#cr-state-object").attr("data-lazy-widget-triggered","true");var p=c.getValueFromState("asin"),h=c.getValueFromState("lazyWidgetCsrfToken"),
m=c.getValueFromState("languageOfPreference");e=c.reduce(e,function(a,b){return a+"\x26lazyWidget\x3d"+c.$(b).data("widget-name")},n+"?asin\x3d"+p+"\x26csrf\x3d"+h+"\x26language\x3d"+m);d.postWithoutFatals(e,{success:q,cache:!1,headers:{"cache-control":"no-cache"},params:b.getUrlParametersMap()||{}});return!0}return!1};e.lazyLoadHasTriggered=function(){return a()};return c.freeze(e)});"use strict";f.when("cr-A","cr-jQuery","ready").register("cr-lazy-widget-view",function(c,d){var b={},a=c.getValueFromState("lazyWidgetLoaderHoverTargetsSelector")||
"";b.getLazyWidgetStubs=function(){return d(".cr-lazy-widget")};b.getHoverTargets=function(){d(a)};return c.freeze(b)});"use strict";f.when("A").register("cr-log-utils",function(c){function d(a,b,c){g.ueLogError&&("string"!==typeof b&&(b="FATAL"),c?g.ueLogError(c,{message:a,logLevel:b.toUpperCase(),attribution:"CustomerReviewsJS"}):g.ueLogError({message:a},{logLevel:b.toUpperCase(),attribution:"CustomerReviewsJS"}))}function b(a,b){return"string"===typeof b?b+a:"CustomerReviews:"+a}return{logError:d,
jsGuard:function(a){if("function"===typeof a)return function(){try{return a.apply(this,arguments)}catch(e){d("Uncaught Error in function","FATAL",e)}};d("Unable to wrap non-function","ERROR");return a},incrementCount:function(a,c){g.ue&&(a=b(a,c),c=g.ue.count(a)||0,g.ue.count(a,c+1))},logCount:function(a,c,d){g.ue&&(a=b(a,d),g.ue.count(a,c))}}});"use strict";f.when("A","reviews-constants").register("cr-mash-utils",function(c,d){function b(a){f.when("mash").execute(function(b){b.navstack.begin().modalOpen(a).end()})}
var a=!1;f.when("mash").execute(function(){a=!0});c.declarative(d.events.OPEN_MASH_MODAL,"click",function(a){b(a.data.url);a.$event.preventDefault()});return{isMash:function(){return a},openModal:b}});"use strict";f.when("A","cr-log-utils").register("cr-number-utils",function(c,d){return{convertToInteger:function(b,a){if(b===parseInt(b,10))return b;if(null!==b&&"string"===typeof b&&""!==b)return parseInt(b.replace(/[^0-9]/g,""),10);if(a!==k)return a;d.logError("convertToInteger","Cannot convert "+
b+" to Integer");return 0},isFiniteNumber:function(b){return"number"===typeof b&&!isNaN(b)&&isFinite(b)}}});"use strict";f.when("cr-A","reviews-constants","cr-ajax-model","cr-global-model").register("cr-reftag-utils",function(c,d,b,a){function e(a){b.postWithoutFatals(a)}c.declarative(d.events.REFTAG_TRIGGER,"click",function(a){a.data.refMarker&&a.data.reftagTriggerUrl&&e(a.data.reftagTriggerUrl+"/ref\x3d"+a.data.refMarker)});return{triggerRefTagWithUrl:e,triggerRefTag:function(b){var d=c.getValueFromState("reftagTriggerUrl");
d&&b&&e(a.generateUrl(d,b))}}});"use strict";f.when("A","cr-jQuery").register("cr-streaming-utils",function(c,d){return{appendFadeIn:function(b){if(null!==b&&2<b.length&&null!==b[1]&&null!==b[2]){var a=b[1];b=d(b[2]).hide();d(a).append(b);c.fadeIn(b,500,"ease-in-out",function(){})}},replace:function(b){if(null!==b&&2<b.length&&null!==b[1]&&null!==b[2]){var a=b[2];d(b[1]).replaceWith(d(a))}}}});"use strict";f.when("A","cr-log-utils").register("cr-string-utils",function(c,d){function b(a){return null===
a||a===k?!0:0===c.trim(a).length}return{defaultIfBlank:function(a,c){return b(a)?c:a},isBlank:b,parseJSON:function(a){try{return c.parseJSON(a)}catch(e){d.logError("Unable to parse JSON object","ERROR",e)}return null},startsWith:function(a,b){return a===b?!0:null===a||null===b?!1:0===a.indexOf(b)},endsWith:function(a,b){if(a===b)return!0;if(null===a||null===b)return!1;var c=a.lastIndexOf(b);return-1!==c&&c===a.length-b.length},stringify:function(a){return g.JSON&&g.JSON.stringify?g.JSON.stringify(a):
a}}});"use strict";f.when("A").register("cr-uri-utils",function(c){function d(){return g.location.hostname}function b(a){a=a||g.location.href;var b={},d=a.indexOf("?"),f=a.indexOf("#");a=a.slice(d+1,f>d?f:k)||"";d=[];-1<a.indexOf("\x26")?d=a.split("\x26"):-1<a.indexOf("\x3d")&&(d=[a]);c.each(d,function(a,c){0<a.indexOf("\x3d")&&(a=a.split("\x3d"),b[a[0]]=a[1])});return b}return{getUrlParametersMap:b,addKeyValuePair:function(a,c,d){d=d||0;if(b(a)[c]===d||!a||!c)return a;c="?"+c+"\x3d"+d;return-1<a.indexOf("?")?
a.replace("?",c+"\x26"):a+c},getCurrentHostname:d,getDomainRealmBaseUrl:function(a){a=a||d();if(-1!==a.indexOf(".corp.amazon.com"))return"https://development.amazon.com/";if(-1!==a.indexOf(".proxy.amazon.com")){a=a.split(".")[1];var b={dub:"https://pre-prod.amazon.co.uk/",pdx:"https://pre-prod.amazon.co.jp/",pek:"https://pre-prod.amazon.cn/"};return b[a]!==k?b[a]:"https://pre-prod.amazon.com/"}return"/"}}});"use strict";f.when("A","reviews-constants").register("cr-weblab-utils",function(c,d){function b(a){g.ue&&
g.ue.trigger&&g.ue.trigger(a.weblabID,a.treatment)}c.declarative(d.events.TRIGGER_WEBLAB,"click",function(a){a.data.weblab&&a.data.treatment&&b({weblabID:a.data.weblab,treatment:a.data.treatment})});return{triggerWeblab:b}});"use strict";f.when("A","cr-uri-utils","cr-string-utils","3p-urijs","cr-jQuery").register("cr-extended-uri-utils",function(c,d,b,a,e){function f(){return a(g.location.href)}function k(){return f().query()}return e.extend(d,{getCurrentUri:f,getCurrentQueryString:k,getCurrentQueryParameters:function(){return a.parseQuery(k())},
isAmazonDomain:function(c){if("string"===typeof c||c instanceof String)c=a(c);var d=b.startsWith(c.domain(),"amazon");!1===d&&(c=c.hostname(),c=c.substring(c.indexOf(".")+1),d=b.startsWith(c,"amazon"));return d},setQueryParameters:function(d,e){if("string"===typeof d||d instanceof String)d=a(d);c.each(e,function(a,c){b.isBlank(a)?d.removeSearch(c):d=d.setSearch(c,a)});return d},setReftag:function(c,d){if("string"===typeof c||c instanceof String)c=a(c);for(var e=c.segment(),f=!1,g=e.length-1;0<=g;g--)if(b.startsWith(e[g],
"ref\x3d")){f=!0;e[g]="ref\x3d"+d;break}f||e.push("ref\x3d"+d);c.segment(e);return c}})});"use strict";f.when("A","cr-jQuery","cr-lazy-widget-controller").register("histogram-trigger",function(c,d,b){function a(){c.onScreen(d("#histogramTable"))&&(b.logVisibleStubMetrics(),b.triggerLazyLoadIfWidgetWithinBuffer())}c.on.afterLoad(a);return{triggerHistogram:a}})});
/* ******** */
(function(a){var b=window.AmazonUIPageJS||window.P,f=b._namespace||b.attributeErrors,e=f?f("CustomerReviewsMedleyAssets",""):b;e.guardFatal?e.guardFatal(a)(e,window):e.execute(function(){a(e,window)})})(function(a,b,f){a.when("A","reviews-constants","medley-twister-view","medley-twister-model","ready").register("medley-twister-controller",function(e,b,d,a){function c(c){c=a.getASIN();var g=d.getDisplayedASIN();g&&c!==g&&(d.fadeReviews(!0),a.getReviews(g,function(){a.setASIN(g)},function(){},function(){d.fadeReviews(!1);
e.trigger(b.events.RELOAD_COMPLETE)}))}var f=d.getLoadedASIN();a.setASIN(f);e.on("a:pageUpdate",c);return{onTwist:c}});"use strict";a.when("A","cr-jQuery").register("medley-twister-view",function(a,c){return{getDisplayedASIN:function(){var a=String(c("#ASIN").val()||"");!a&&b&&b.TwisterState&&(a=b.TwisterState.asin||"");return a},getLoadedASIN:function(){return(c("#cr-state-object").data("state")||{}).asin||""},fadeReviews:function(a){!1===a?c("#cm-cr-review-list .review,#most-recent-reviews-content .review").css("opacity",
1):c("#cm-cr-review-list .review,#most-recent-reviews-content .review").css("opacity",.5)}}});"use strict";a.when("A","cr-global-model","cr-ajax-model","cr-uri-utils","cr-jQuery").register("medley-twister-model",function(a,c,b,f,h){function e(a){var b=f.getUrlParametersMap()||{};b.asin=a;return b}var d;return{setASIN:function(a){d=a||""},getASIN:function(){return d},getReviews:function(a,c,f,d){var g=h("#cr-state-object").data("state"),k={"anti-csrftoken-a2z":g.reviewsCsrfToken};"string"===typeof a&&
10===a.length?b.post(g.medleyReviewsAjaxUrl,{headers:k,params:e(a),attribution:"getMedleyReviews",success:c,error:f,finallyCallback:d}):"function"===typeof d&&d()}}})});
/* ******** */
(function(g){var q=window.AmazonUIPageJS||window.P,t=q._namespace||q.attributeErrors,c=t?t("CustomerReviewsVotingAssets",""):q;c.guardFatal?c.guardFatal(g)(c,window):c.execute(function(){g(c,window)})})(function(g,q,t){g.when("A","cr-jQuery","a-checkbox","a-modal","3p-urijs","cr-extended-uri-utils","cr-log-utils").register("report-abusive-review-controller",function(c,f,a,h,g,k,n){function l(b){var r=[];c.each(f("[id^\x3dcr-report-abusive-review-reason-"+b+"]"),function(b,e){a(b).isChecked()&&r.push(b.value)});
return r}function p(b){var a=b.data,m=g(a.reportAbuseFeedbackUrl);if(a.isSignedIn){var e=l(a.reviewId);m.setSearch("customerSelections",e.join(","));h.get(f("#report-abusive-review-modal-popover-"+a.reviewId)).update({url:m.toString()}).lock().show()}else a=a.reviewId,e=k.getCurrentUri(),e.hash(a),m.setSearch("openid.return_to",encodeURI(e)),q.location.href=m.toString();b.$event.preventDefault()}function d(a){var b=a.data,m=a.$target;b={url:b.url,width:b.width,header:b.header,name:b.name};var e=h.get(m);
e?e.update(b).refresh():e=h.create(m,b);e.show();a.$event.preventDefault()}c.declarative("reviews:report-abusive-review-submit-action","click",p);c.declarative("reviews:report-abusive-review-modal-button","click",d);c.on("a:popover:ajaxFail",function(a){(a=a.popover)&&a.name&&0==a.name.indexOf("report-abusive-review-modal-popover-")&&n.logCount("AjaxFailure:ReportAbusiveReview",1)});c.on("a:popover:invisible",function(a){(a=a.popover)&&a.name&&0==a.name.indexOf("report-abusive-review-modal-popover-")&&
h.remove(a)});return{submitAbusiveReviewReport:p,showReportAbusiveReviewModal:d}});"use strict";g.when("A","cr-jQuery","a-checkbox","a-sheet","vote-model","vote-view","cr-log-utils").register("report-abusive-review-mobile-controller",function(c,f,a,h,g,k,n){function l(b){var m=[];c.each(f("[id^\x3dcr-report-abusive-review-reason-"+b+"]"),function(b,e){a(b).isChecked()&&m.push(b.value)});return m}function p(a){a=h.get("report-abusive-review-bottom-sheet-"+a);h.hideSheet(a)}function d(a,e){b(a,e);k.showElementByCssSelector(a,
e.inFlight)}function b(a,b){k.hideElementByCssSelector(a,b.hideVoteComponents);b.hideAbuseComponents&&k.hideElementByCssSelector(a,b.hideAbuseComponents)}function r(a,e){var c=l(e.reviewId);e.additionalAjaxParams={customerSelections:c.join(",")};p(e.reviewId);a=f("#report-abusive-review-button-"+e.reviewId);d(a,e.cssSelectors);g.submitVote(e,function(d){if(!0===d){d=a;var c=e.cssSelectors;b(d,c);k.showElementByCssSelector(d,c.onSuccess)}else d=a,c=e.cssSelectors,b(d,c),k.showElementByCssSelector(d,
c.onError)},function(d){if(401===d.http.status){if(d.http.getResponseHeader("x-amz-re-authentication-url")){n.logCount("Ajax401WithReAuthUrl:SubmitVote",1);return}n.logCount("Ajax401WithoutReAuthUrl:SubmitVote",1)}d=a;var c=e.cssSelectors;b(d,c);k.showElementByCssSelector(d,c.onError)})}c.declarative("reviews:vote-action-multi-selection","click",function(a){r(a.$target,a.data);a.$event.preventDefault()});return{submitVote:r}});"use strict";g.when("A","vote-model","vote-view","a-modal","cr-log-utils").register("vote-controller",
function(c,f,a,h,g){function k(d,b){l(d,b);a.showElementByCssSelector(d,b.onError);a.setFocus(d,".cr-vote-focusable-error")}function n(d,b){l(d,b);a.showElementByCssSelector(d,b.inFlight);a.setFocus(d,".cr-vote-focusable-feedback")}function l(d,b){a.hideElementByCssSelector(d,b.hideVoteComponents);b.hideAbuseComponents&&a.hideElementByCssSelector(d,b.hideAbuseComponents)}function p(d,b){b.isReportAbuse&&(d=c.$("#mobile-abuse-"+b.reviewId),h.get(d).hide());n(d,b.cssSelectors);f.submitVote(b,function(c){if(!0===
c){c=d;var f=b.cssSelectors;l(c,f);a.showElementByCssSelector(c,f.onSuccess);a.setFocus(c,".cr-vote-focusable-success")}else k(d,b.cssSelectors)},function(a){if(401===a.http.status){if(a.http.getResponseHeader("x-amz-re-authentication-url")){g.logCount("Ajax401WithReAuthUrl:SubmitVote",1);return}g.logCount("Ajax401WithoutReAuthUrl:SubmitVote",1)}k(d,b.cssSelectors)})}c.declarative("reviews:vote-action","click",function(a){p(a.$target,a.data);a.$event.preventDefault()});return{submitVote:p}});"use strict";
g.when("A","cr-ajax-model").register("vote-model",function(c,f){return{submitVote:function(a,c,g){var h={"anti-csrftoken-a2z":a.csrfT};a.physicalId&&a.imageExtension&&(h["x-amz-extra-params"]=[a.physicalId,a.imageExtension]);var n={reviewId:a.reviewId},l;for(l in a.additionalAjaxParams)n[l]=a.additionalAjaxParams[l];f.post(a.ajaxUrl,{params:n,attribution:"submitVote",success:c,error:g,headers:h})}}});"use strict";g.when("A").register("vote-view",function(c){function f(a,c){return a.closest(".cr-vote").find(c)}
return{hideThankYouAlert:function(a){f(a,".cr-vote-success").addClass("aok-hidden")},showThankYouAlert:function(a){f(a,".cr-vote-success").removeClass("aok-hidden")},showErrorAlert:function(a){f(a,".cr-vote-error").removeClass("aok-hidden")},showFeedback:function(a){f(a,".cr-vote-feedback").removeClass("aok-hidden")},hideFeedback:function(a){f(a,".cr-vote-feedback").addClass("aok-hidden")},hideButtons:function(a){f(a,".cr-vote-buttons").addClass("aok-hidden")},hideElementByCssSelector:function(a,
c){f(a,c).addClass("aok-hidden")},showElementByCssSelector:function(a,c){f(a,c).removeClass("aok-hidden")},setFocus:function(a,c){f(a,c).focus()}}})});
/* ******** */
(function(k){var u=window.AmazonUIPageJS||window.P,C=u._namespace||u.attributeErrors,h=C?C("CustomerReviewsGalleryAssets",""):u;h.guardFatal?h.guardFatal(k)(h,window):h.execute(function(){k(h,window)})})(function(k,u,C){k.when("A","cr-jQuery","cr-log-utils","reviews-constants","review-image-assets-loaded").register("review-image-binder",function(h,b,d,c){function g(a,c,e,f,m){if(!(a&&c&&e instanceof b&&f instanceof b&&m instanceof b))return d.logError("Invalid parameters for imageBinder.initializeEventHandlers with ASIN: "+
a+", galleryName: "+c+", $popoverTrigger: "+e+", $thumbnails: "+f+", $galleryLink: "+m,"FATAL"),!1;var q="reviewsLightbox-ready-"+c;f.click(function(){l(a,c);var d=f.index(this);e.click();k.when(q).execute(function(){b("#"+c).trigger("jumpToImageAtIndex",d)})});m.click(function(){l(a,c);e.click();k.when(q).execute(function(){b("#"+c).trigger("hideImmersiveView")})});return!0}function l(b,c){if(!b||!c)return d.logError("Invalid parameters for imageBinder.initializeImageGallery with ASIN: "+b+", galleryName: "+
c,"FATAL"),!1;if(A)return!0;(new ReviewsLightbox(c,"DESKTOP")).initializeForAsin(b);return A=!0}var A=!1,r={};k.when("reviewsLightbox-js").execute(function(){var a=b("#reviews-image-gallery-container"),d=a.attr("data-asin");0<a.length&&d&&g(d,"reviews-image-gallery",a.find(".a-popover-trigger"),a.find(".review-image-tile"),a.find(".reviews-image-gallery-link"))});h.on(c.events.RELOAD_COMPLETE,function(){r={}});return{bindReview:function(a,d,c){var e=new ReviewGallery(c,"DESKTOP"),m=b("#"+d);m.find(".review-image-tile").each(function(d){b(this).click(function(){r[a]||
(e.initializeForReview(a),r[a]=!0);m.find(".a-popover-trigger").click();k.when("reviewsLightbox-ready-"+c).execute(function(){e.render();e.showImageAtIndex(d)})})})},initializeImageGallery:l,initializeEventHandlers:g}});"use strict";k.when("A","cr-jQuery","cr-image-popover-data-fetcher","cr-see-all-images-controller").register("cr-image-popover-controller",function(h,b,d,c){function g(){for(var a=0;a<t.length;a++)a!=n&&b(t[a]).unbind("click").removeClass("cr-lightbox-selected").removeAttr("aria-pressed"),
b(t[a]).click(l(a));m(n)}function l(b){return function(){z(b)}}function A(d){z(d);e();q()&&b(w).focus();a()&&b(x).focus()}function r(){b(x).unbind("click");b(w).unbind("click");1===t.length?(b(x).css(E),b(w).css(E)):(b(x).click(function(){A(parseInt(n,10)+1)}).focus(e).blur(f),b(w).click(function(){A(parseInt(n,10)-1)}).focus(e).blur(f),b(Q).mouseenter(e).mouseleave(f))}function a(){var b=d.getReviewIds();return!D&&0===n||D&&0===n&&0==b.indexOf(G)}function q(){var b=d.getReviewIds();return!D&&n===
B.length-1||D&&n===B.length-1&&b.indexOf(G)==b.length-1}function e(){x.css(M);w.css(M);q()&&x.css(E);a()&&w.css(E);x.animate(N,100);w.animate(N,100)}function f(){x.animate(W,100);w.animate(W,100)}function m(b){0<=b&&b<B.length&&(b=t.eq(b).find("img").attr("alt"))&&H.attr("alt",b)}function z(a){if(0<=a&&a<B.length)H.attr("src",B[a]),b(t[n]).removeClass("cr-lightbox-selected").attr("aria-pressed","false"),b(t[a]).addClass("cr-lightbox-selected").attr("aria-pressed","true"),n=a;else if(D){var U=d.getReviewList(),
c=d.getReviewIds(),e=c.indexOf(G),f={popover:{$trigger:{context:{}}}};a>n?(e++,e<c.length&&(f.popover.$trigger.context.id=c[e]+"-0",F(f))):(e--,-1<e&&(f.popover.$trigger.context.id=c[e]+"-"+(U[c[e]].images.length-1),F(f)))}m(n)}function p(a){b(O).empty();a.forEach(function(a,d){d===n?b(O).append('\x3cimg src\x3d"'+a+'" class\x3d"cr-lightbox-image-thumbnail cr-lightbox-selected" /\x3e'):b(O).append('\x3cimg src\x3d"'+a+'" class\x3d"cr-lightbox-image-thumbnail"/\x3e')});t=v.find(".cr-lightbox-image-button");
g()}function X(a,U,d,c){v=(D=c||!1)?b("#cr_customers_image_gallery"):b("#"+a+"_image_popover");L=v.closest('[role\x3d"dialog"]');I=v.closest(".a-popover-wrapper").find("h4.a-popover-header-content");x=v.find(".cr-lightbox-navigator-button__next");w=v.find(".cr-lightbox-navigator-button__back");t=v.find(".cr-lightbox-image-button");Q=v.find(".cr-lightbox-image-viewer");H=Q.find(".cr-lightbox-main-image");u=v.find(".cr-lightbox-review-title");C=v.find(".cr-lightbox-review-body");Y=v.find(".cr-lightbox-review-origin");
R=v.find(".cr-lightbox-review-rating");O=v.find(".cr-lightbox-image-thumbnails");D&&(P=v.find(".cr-lightbox-customer-profile"),S=v.find(".cr-lightbox-customer-profile .a-profile-name"),Z=v.find(".cr-lightbox-customer-profile .a-profile-avatar \x3e img"),V=R.find(".a-icon-alt"));B=U;"string"===typeof U&&(B=U.substring(1,U.length-1).split(","));g();z(k(d).thumbnailId||0);r();if(a=v.data("heading"))I.attr("aria-label",a),L.attr("aria-label",a)}function F(b){var a=d.getReviewList();d.getReviewIds();for(var c=
k(b).reviewId,e=[],f=[],m=0;m<a[c].images.length;m++)e.push(a[c].images[m].source),f.push(a[c].images[m].lowResSource);G=c;X(c,e,b,!0);b=G;u.text(a[b].title);R.removeClass();R.addClass("a-icon a-icon-star a-star-"+a[b].starRating+" cr-lightbox-review-rating");V.text(V.text().replace(/\d([.,]\d)?/,a[b].starRating+".0"));p(f);C.text(a[b].reviewText);Y.text(a[b].originDescription);D&&(a=a[b],null===a.customerProfileLink||0===a.customerProfileLink.length?P.css("cursor","initial"):P.css("cursor",""),P.attr("href",
a.customerProfileLink),S.text(a.customerName),Z.attr("src",a.customerProfileImage));J(!1)}function k(b){return b&&b.popover&&b.popover.$trigger&&b.popover.$trigger.context&&(b=b.popover.$trigger.context.id)&&(b=b.split("-"),1<b.length)?{reviewId:b[0],thumbnailId:parseInt(b[1],10),seeAllImages:!1}:{seeAllImages:!0}}function aa(b){k(b).seeAllImages?J(!0):F(b)}function J(a){v=b("#cr_customers_image_gallery");a?(v.hide(),T.show(),c.updateSeeAllImages(T,F),H&&H.attr("src","")):(v.show(),T.hide(),y.hide(),
ba.show(),ca.removeClass("cr-lightbox-review-row-no-display"),ca.addClass("cr-lightbox-review-row"))}var M={cursor:"pointer",display:"block"},E={cursor:"auto",display:"none"},N={opacity:1},W={opacity:0},L,I,B,n=0,x,w,t,Q,H,G,D=!1,K=!1,u,C,Y,R,O,P,S,Z,V,T=b("#seeAllImagesContainer"),v=b("#cr_customers_image_gallery"),y=b(".cr-large-loadingIcon"),ca=b("#crReviewRow"),ba=b("#crViewAllImagesLink");return{initImagePopover:X,loadDataAndInitImageGalleryPopover:function(b,a,c,e){d.isDataLoaded()?aa(b):d.fetchData(c,
a,e,function(a,e){if(a=!K)a:{a=d.getReviewIds();for(e=0;e<c.length;e++)if(0>a.indexOf(c[e])){a=!1;break a}a=!0}a&&(aa(b),K=!0)})},toggleSeeAllView:J}});"use strict";k.when("A","cr-jQuery","cr-image-popover-data-fetcher","cr-ranking-see-all-images-controller").register("cr-ranking-image-popover-controller",function(h,b,d,c){function g(){for(var a=0;a<t.length;a++)a!=n&&b(t[a]).unbind("click").removeClass("cr-lightbox-selected").removeAttr("aria-pressed"),b(t[a]).click(l(a));m(n)}function l(b){return function(){z(b)}}
function A(c){z(c);e();q()&&b(w).focus();a()&&b(x).focus()}function r(){b(x).unbind("click");b(w).unbind("click");1===t.length?(b(x).css(E),b(w).css(E)):(b(x).click(function(){A(parseInt(n,10)+1)}).focus(e).blur(f),b(w).click(function(){A(parseInt(n,10)-1)}).focus(e).blur(f),b(Q).mouseenter(e).mouseleave(f))}function a(){var b=d.getReviewIds();return!K&&0===n||K&&0===n&&0==b.indexOf(D)}function q(){var b=d.getReviewIds();return!K&&n===B.length-1||K&&n===B.length-1&&b.indexOf(D)==b.length-1}function e(){x.css(M);
w.css(M);q()&&x.css(E);a()&&w.css(E);x.animate(N,100);w.animate(N,100)}function f(){x.animate(C,100);w.animate(C,100)}function m(b){0<=b&&b<B.length&&(b=t.eq(b).find("img").attr("alt"))&&H.attr("alt",b)}function z(a){if(0<=a&&a<B.length)H.attr("src",B[a]),b(t[n]).removeClass("cr-lightbox-selected").attr("aria-pressed","false"),b(t[a]).addClass("cr-lightbox-selected").attr("aria-pressed","true"),n=a;else if(K){d.getReviewList();var c=d.getReviewIds(),e=c.indexOf(D),f={popover:{$trigger:{context:{}}}};
a>n?(a=G[c[e]],e++,e<c.length&&(f.popover.$trigger.context.dataset={reviewid:c[e],physicalid:Object.keys(a)[0]},F(f))):(e--,-1<e&&(a=G[c[e]],f.popover.$trigger.context.dataset={reviewid:c[e],physicalid:Object.keys(a)[Object.keys(a).length-1]},F(f)))}m(n)}function p(a){b(P).empty();a.forEach(function(a,c){c===n?b(P).append('\x3cimg src\x3d"'+a+'" class\x3d"cr-lightbox-image-thumbnail cr-lightbox-selected" /\x3e'):b(P).append('\x3cimg src\x3d"'+a+'" class\x3d"cr-lightbox-image-thumbnail"/\x3e')});t=
y.find(".cr-lightbox-image-button");g()}function X(a,c,e,d){y=(K=d||!1)?b("#cr_customers_image_gallery"):b("#"+a+"_image_popover");L=y.closest('[role\x3d"dialog"]');I=y.closest(".a-popover-wrapper").find("h4.a-popover-header-content");x=y.find(".cr-lightbox-navigator-button__next");w=y.find(".cr-lightbox-navigator-button__back");t=y.find(".cr-lightbox-image-button");Q=y.find(".cr-lightbox-image-viewer");H=Q.find(".cr-lightbox-main-image");ea=y.find(".cr-lightbox-review-title");Y=y.find(".cr-lightbox-review-body");
R=y.find(".cr-lightbox-review-origin");O=y.find(".cr-lightbox-review-rating");P=y.find(".cr-lightbox-image-thumbnails");K&&(S=y.find(".cr-lightbox-customer-profile"),Z=y.find(".cr-lightbox-customer-profile .a-profile-name"),V=y.find(".cr-lightbox-customer-profile .a-profile-avatar \x3e img"),T=O.find(".a-icon-alt"));B=c;"string"===typeof c&&(B=c.substring(1,c.length-1).split(","));g();z(k(e).thumbnailId||0);r();if(a=y.data("heading"))I.attr("aria-label",a),L.attr("aria-label",a)}function F(b){var a=
d.getReviewList();d.getReviewIds();for(var c=k(b).reviewId,e=[],f=[],m=0;m<a[c].images.length;m++)e.push(a[c].images[m].source),f.push(a[c].images[m].lowResSource);D=c;X(c,e,b,!0);b=D;ea.text(a[b].title);O.removeClass();O.addClass("a-icon a-icon-star a-star-"+a[b].starRating+" cr-lightbox-review-rating");T.text(T.text().replace(/\d([.,]\d)?/,a[b].starRating+".0"));p(f);Y.text(a[b].reviewText);R.text(a[b].originDescription);K&&(a=a[b],null===a.customerProfileLink||0===a.customerProfileLink.length?
S.css("cursor","initial"):S.css("cursor",""),S.attr("href",a.customerProfileLink),Z.text(a.customerName),V.attr("src",a.customerProfileImage));J(!1)}function k(b){if(b&&b.popover&&b.popover.$trigger&&b.popover.$trigger.context&&b.popover.$trigger.context.dataset){var a=b.popover.$trigger.context.dataset.reviewid,c=b.popover.$trigger.context.dataset.physicalid;if(!b.popover.$trigger.context.dataset.seemore&&a&&c)return{reviewId:a,thumbnailId:G[a][c],seeAllImages:!1}}return{seeAllImages:!0}}function u(b){k(b).seeAllImages?
J(!0):F(b)}function J(a){y=b("#cr_customers_image_gallery");a?(y.hide(),v.show(),c.updateSeeAllImages(v,F),H&&H.attr("src","")):(y.show(),v.hide(),ca.hide(),fa.show(),ba.removeClass("cr-lightbox-review-row-no-display"),ba.addClass("cr-lightbox-review-row"))}var M={cursor:"pointer",display:"block"},E={cursor:"auto",display:"none"},N={opacity:1},C={opacity:0},L,I,B,n=0,x,w,t,Q,H,G={},D,K=!1,da=!1,ea,Y,R,O,P,S,Z,V,T,v=b("#seeAllImagesContainer"),y=b("#cr_customers_image_gallery"),ca=b(".cr-large-loadingIcon"),
ba=b("#crReviewRow"),fa=b("#crViewAllImagesLink");return{initImagePopover:X,loadDataAndInitImageGalleryPopover:function(b,a,c,e){d.isDataLoaded()?u(b):d.fetchData(c,a,e,function(a,e){if(a=!da)a:{a=d.getReviewIds();for(e=0;e<c.length;e++)if(0>a.indexOf(c[e])){a=!1;break a}a=!0}if(a){a=d.getReviewList();for(var f in a){e={};for(var m=0;m<a[f].images.length;m++){var l=a[f].images[m].source;var t=l.lastIndexOf("/")+1;l=l.substring(t);t=l.lastIndexOf(".");t=l.substring(0,t);e[t]=m}G[a[f].reviewId]=e}u(b);
da=!0}})},toggleSeeAllView:J,setReviewToPhysicalIdAndIndexMap:function(a){G=a}}});"use strict";k.when("A","cr-jQuery","cr-log-utils").register("cr-image-popover-data-fetcher",function(h,b,d){function c(a,b,c){a="/hz/reviews-render/get-reviews-with-media?mediaType\x3dimage\x26asin\x3d"+a+"\x26csrfToken\x3d"+b;c!==C&&(a+="\x26nextToken\x3d"+c);return a}function g(a,b,f,m,z,p){f=c(b,f,p);h.ajax(f,{method:"get",success:function(c){for(var e in c.reviewsWithMediaList)r[e]=c.reviewsWithMediaList[e];e=Object.keys(r);
A=a.slice();for(var d=0;d<e.length;d++)0>a.indexOf(e[d])&&A.push(e[d]);"function"===typeof m&&m(r,A);c.nextToken?g(a,b,c.csrfToken,m,z,c.nextToken):l=!0},error:function(a){d.logCount("ReviewWithImages-DataFetcher-Error");"function"===typeof z&&z()}})}var l=!1,A=[],r={},a=null;return{fetchData:g,getReviewList:function(){return r},getReviewIds:function(){return A},isDataLoaded:function(){return l},getCustomerImageAltText:function(){a||(a=b(".review-with-images-section .cr-customer-image-thumbnail")[0].getAttribute("alt"));
return a}}});"use strict";k.when("A","cr-jQuery","cr-image-popover-data-fetcher").register("cr-see-all-images-controller",function(h,b,d){function c(a,c,e,f){a=b("\x3cdiv\x3e",{class:"cr-thumbnail-preview-tile",css:{background:"url("+a+") 50% 50% no-repeat"},role:"img",alt:d.getCustomerImageAltText()});a.click(function(){f({popover:{$trigger:{context:{id:c+"-"+e}}}})});return a}function g(a,b,e){for(var f=d.getReviewList(),m=d.getReviewIds(),h=l;l<h+e;){var p=m[r];if(p&&f[p]){r++;for(var g=0;g<f[p].images.length;g++){var q=
"undefined"===typeof A[p+g]?!0:!1;q&&(a.append(c(f[p].images[g].lowResSource,p,g,b)),l++,0==l%7&&a.append("\x3cbr /\x3e"),A[p+g]=p+g)}}else break}}var l=0,A={},r=0;return{updateSeeAllImages:function(a,b){g(a,b,50);var c=0;a.scroll(function(){var e=a.scrollTop();200<e-c&&(c=e,g(a,b,50))})}}});"use strict";k.when("A","cr-jQuery","cr-image-popover-data-fetcher").register("cr-ranking-see-all-images-controller",function(h,b,d){function c(a,c,e,f){a=b("\x3cdiv\x3e",{class:"cr-thumbnail-preview-tile",css:{background:"url("+
a+") 50% 50% no-repeat"},role:"img",alt:d.getCustomerImageAltText()});a.click(function(){f({popover:{$trigger:{context:{dataset:{reviewid:c,physicalid:e}}}}})});return a}function g(a,b,e){for(var f=d.getReviewList(),m=d.getReviewIds(),h=l;l<h+e;){var g=m[r];if(g&&f[g]){r++;for(var k=0;k<f[g].images.length;k++){var q="undefined"===typeof A[g+k]?!0:!1;if(q){var u=f[g].images[k].source;q=u.lastIndexOf("/")+1;u=u.substring(q);q=u.lastIndexOf(".");q=u.substring(0,q);a.append(c(f[g].images[k].lowResSource,
g,q,b));l++;0==l%7&&a.append("\x3cbr /\x3e");A[g+k]=g+k}}}else break}}var l=0,A={},r=0;return{updateSeeAllImages:function(a,b){g(a,b,50);var c=0;a.scroll(function(){var e=a.scrollTop();200<e-c&&(c=e,g(a,b,50))})}}});"use strict";k.when("A","cr-jQuery").register("cr-mobile-image-popover-controller",function(h,b){function d(b,a){return 0<=b&&b<a.length}function c(){var b=L.prop("scrollHeight"),a=L.prop("clientHeight");return b>a}function g(){return u.hasClass("cr-mg-image-popover-expand-full-cr")}function l(){c()?
(I.removeClass("cr-mg-image-popover-reviews-expand-hide"),I.addClass("cr-mg-image-popover-reviews-expand-show")):(I.removeClass("cr-mg-image-popover-reviews-expand-show"),I.addClass("cr-mg-image-popover-reviews-expand-hide"))}function k(){B.removeClass("cr-mg-image-popover-reviews-content-expand-container-short")}function r(){u.removeClass("cr-mg-image-popover-expand-full-cr");k();L.scrollTop(0);x||z.removeClass("button-hide");w||m.removeClass("button-hide")}function a(){u.addClass("cr-mg-image-popover-expand-full-cr");
k();c()||B.addClass("cr-mg-image-popover-reviews-content-expand-container-short");m.addClass("button-hide");z.addClass("button-hide")}function q(b,a){F.text(a[b].title);C.removeClass();C.addClass("cr-mg-image-popover-reviews-star-rating a-icon a-icon-star-small a-star-small-"+a[b].starRating);aa.text(a[b].reviewText);J.empty();J.append(a[b].richReviewText);M.empty();M.append('\x3cimg src\x3d"'+a[b].image+'" class\x3d"cr-mg-image-element" /\x3e');E.text(a[b].authorName);N.empty();N.append('\x3cimg src\x3d"'+
a[b].authorAvatarImage+'" data-src\x3d"'+a[b].authorAvatarImage+'"/\x3e \x3cnoscript\x3e\x3cimg src\x3d"'+a[b].authorAvatarImage+'"/\x3e\x3c/noscript\x3e');W.attr("href",a[b].authorProfileLink);b+1==a.length?m.addClass("button-hide"):m.removeClass("button-hide");0==b?z.addClass("button-hide"):z.removeClass("button-hide");l()}function e(b){w=x=0;0==n&&(x=1);n+1==b.length&&(w=1)}function f(a,c){m.unbind("click");z.unbind("click");n=a;e(c);b(m).click(function(){d(n+1,c)&&(n++,q(n,c),e(c))});b(z).click(function(){d(n-
1,c)&&(n--,q(n,c),e(c))})}var m,z,p,u,F,C,aa,J,M,E,N,W,L,I,B,n,x,w;h.declarative("cr-mg-image-popover-expand-review-content","click",function(b){c()&&!g()&&a()});h.declarative("cr-mg-image-popover-reviews-collapse-review-content","click",function(b){r()});h.on("resize",function(){var b=p?p.is(":visible"):!1;b&&(g()?(r(),l(),c()&&a()):l())});return{initializePopover:function(a,c){a=parseInt(a,10);d(a,c)&&(p=b("#cr-mg-immsersive-view-container-"+a),u=p.find(".cr-mg-image-popover-overlay"),m=p.find(".next-button-mobile"),
z=p.find(".back-button-mobile"),F=p.find(".cr-mg-image-popover-review-title"),C=p.find(".cr-mg-image-popover-reviews-star-rating"),aa=p.find(".cr-mg-image-popover-reviews-plain-text"),J=p.find(".cr-mg-image-popover-reviews-rich-text"),M=p.find(".cr-mg-image-view"),L=p.find(".cr-mg-image-popover-reviews-content-wrapper"),I=p.find(".cr-mg-image-popover-reviews-expand-container"),B=p.find(".cr-mg-image-popover-reviews-content-expand-container"),E=p.find(".cr-mg-image-popover-reviews-reviewer-text"),
N=p.find(".a-profile-avatar"),W=p.find(".cr-mg-image-popover-reviews-author-profile-image"),q(a,c),f(a,c))}}});"use strict";k.when("cr-A","cr-jQuery","cr-streaming-utils","cr-media-gallery-view","cr-media-gallery-model").register("cr-media-gallery-controller",function(h,b,d,c,g){function l(){return 480<b(u).width()?3:2}function k(){var a=c.getCurrentMasonryItems(),b=l();0<a.length&&(a=c.getPreciseMaxMasonryListHeightItems(a,b),c.setMasonryListHeight(a.heightInPixelOfColumn,"px",a.nItemInColumn*q))}
function r(a){if(!h.objectIsEmpty(a)&&!h.objectIsEmpty(a.data)){c.toggleMediaListLoadingState(!0);var b=g.updateMediaType(a.data.mediaType);c.updateFilterBar(b);g.getMedia(a.data,function(){},function(){},function(){c.toggleMediaListLoadingState(!1)},function(a){"appendFadeIn"===a[0]&&(c.removeMasonryItemLoadingElements(),d.appendFadeIn(a))})}}function a(){b(".a-manually-loaded.cr-mg-image-element").not("[src]").each(function(){var a=b(this);a.is(":visible")&&h.onScreen(a,f)&&h.loadImageManually(a)})}
h.on("resize",function(){c.isMediaGalleryPageVisible()?k():e=!0});h.on("scroll",a);var q=8,e=!1,f=500;return{initialize:k,getNoOfColumns:l,initializeAfterPopoverHide:function(){e&&k();e=!1},initializeMediaFilters:function(a,b){g.setInitialParams(a,b);h.declarative("cr:media-filter","click",h.compositeEventWrapper(r,!0,100))},manualLazyLoadImages:a}});"use strict";k.when("A","cr-jQuery").register("cr-media-gallery-view",function(h,b){return{getCurrentMasonryItems:function(){return b(".cr-mg-masonry-list").find(".cr-mg-masonry-item")},
setMasonryListHeight:function(d,c,g){var l=b(".cr-mg-masonry-list-height-control").get(0);l&&(l.style.setProperty("--height-to-column-width",d+c),l.style.setProperty("--height-in-pixel",g+"px"))},getPreciseMaxMasonryListHeightItems:function(d,c){for(var g=Array(c),l=Array(c),h=0;h<c;h++)g[h]=0,l[h]=0;var k=0;d.each(function(){var a=b(this).children(".cr-mg-ratio-control");g[k%c]+=a.get(0).getBoundingClientRect().height;l[k%c]+=1;k++});d=g.indexOf(Math.max.apply(Math,g));return{heightInPixelOfColumn:g[d],
nItemInColumn:l[d]}},isMediaGalleryPageVisible:function(){var d=b(".cr-mg-masonry-list-height-control");return d?d.is(":visible"):!1},updateFilterBar:function(d){var c="image"===d;d="video"===d;b(".cr-mg-filter-btn-vid").toggleClass("cr-mg-filter-btn-selected",d);b(".cr-mg-filter-btn-img").toggleClass("cr-mg-filter-btn-selected",c)},toggleMediaListLoadingState:function(d){b(".cr-mg-masonry-list-loading").toggleClass("aok-hidden",!d)},removeMasonryItemLoadingElements:function(){b(".cr-mg-masonry-item-loading").remove()}}});
"use strict";k.when("cr-A","cr-log-utils","cr-ajax-model").register("cr-media-gallery-model",function(h,b,d){var c={},g;return{setInitialParams:function(b,d){c.asin=b;c.mediaType=d},updateMediaType:function(b){if("image"===b||"video"===b)c.mediaType=b;return c.mediaType},getMedia:function(l,k,r,a,q){g&&d.abort(g);var e=h.now();b.logCount("GetMedia:Count",1);g=d.post("/hz/reviews-render/ajax/media/get/?ie\x3dUTF8",{params:c,attribution:"getMedia",headers:{"anti-csrftoken-a2z":l.csrfToken},success:function(){var a=
h.now()-e;b.logCount("GetMedia:Status",1);b.logCount("GetMedia:RequestTime",a);k()},error:function(){b.logCount("GetMedia:Status",0);r()},finallyCallback:function(){a();g=0},timeout:3E4,chunk:q,cache:!0},1)}}});"use strict";k.when("A","cr-jQuery").register("cr-review-inline-images-controller",function(h,b){function d(c){return b("#%s-cr-inline-images-preview".replace("%s",c)).find(".cr-review-inline-images-main-image")}h.declarative("cr-review-inline-images-thumbnail-click","click",function(b){var c=
b.data.imageSrc;d(b.data.reviewId).attr("src",c)});return{getMainImage:d,getAllThumbnails:function(c){return b("#%s-cr-inline-images-preview".replace("%s",c)).find(".cr-review-inline-images-thumbnails .cr-review-inline-images-thumbnail")}}});"use strict";k.when("cr-inline-videos-controller","ready").register("cr-inline-videos-module",function(h){h.initialize(!0)});"use strict";k.when("A","reviews-constants","cr-log-utils","cr-inline-videos-view","cr-vse-brila-player-gateway").register("cr-inline-videos-controller",
function(h,b,d,c,g){function l(b){c.getPlayerPlaceholders().each(function(e,d){e=h.$(d);if(!c.isPlayerRequestPending(e)&&(!b||b&&c.isPlayerPlaceholderInViewport(e))){c.markPlayerRequestAsPending(e);d=c.extractVideoAsset(e);var f=h.$("#cr-state-object").data("state");d={videoUrl:d.videoUrl,thumbnailUrl:d.thumbnailUrl,reviewId:d.reviewId,closedCaptions:d.closedCaptions,vseContentId:d.vseContentId,marketplaceId:f.marketplaceId,locale:f.locale,page:f.page||"cr_page",placement:f.page?f.page+"_cr_inline_review":
"cr_inline_review"};g.getVideoPlayer("vse_reviews_desktop_"+d.reviewId+"_"+h.now(),d,k(d),r(e),a(e))}})}function k(a){return!h.objectIsEmpty(a)&&!h.objectIsEmpty(a.vseContentId)&&""!=a.vseContentId}function r(a){return function(b){c.markPlayerRequestAsDone(a);c.renderPlayer(a,b)}}function a(a){return function(b){c.markPlayerRequestAsDone(a);c.showErrorMessage(a);d.logError("Failed loading inline video player: "+JSON.stringify(b),"ERROR")}}function q(a){if(a)h.on(h.constants.BROWSER_EVENTS.SCROLL,
function(){l(!0)});h.on(b.events.RELOAD_COMPLETE,function(){l(a)})}return{initialize:function(a){l(a);q(a)},fetchVideoPlayers:l}});"use strict";k.when("A").register("cr-inline-videos-view",function(h){return{getPlayerPlaceholders:function(){return h.$(".cr-video-desktop-placeholder")},extractVideoAsset:function(b){b=b.data();return{reviewId:b.reviewId,videoUrl:b.videoUrl,thumbnailUrl:b.thumbnailUrl,closedCaptions:b.closedCaptions,vseContentId:b.vseContentId}},markPlayerRequestAsPending:function(b){b.data("playerRequestPending",
!0)},markPlayerRequestAsDone:function(b){b.removeData("playerRequestPending");b.removeClass("cr-video-desktop-placeholder")},isPlayerRequestPending:function(b){b=b.data("playerRequestPending");return"undefined"!==b&&b},isPlayerPlaceholderInViewport:function(b){return h.onScreen(b,800)},renderPlayer:function(b,d){b.html(d)},showErrorMessage:function(b){b.addClass("cr-media-show-error-msg")}}});"use strict";k.when("A","cr-uri-utils","cr-log-utils","cr-ajax-model").register("cr-vse-brila-player-gateway",
function(h,b,d,c){function g(b,a,c){var e={requester:"vse_reviews_desktop",clientPrefix:b,marketplaceID:a.marketplaceId,locale:a.locale,page:a.page,placement:a.placement};c&&a.vseContentId?e.video={contentID:a.vseContentId,contentIDType:"VIDEO_ID"}:(a.videoUrl&&a.thumbnailUrl&&a.reviewId||d.logCount(l("vse_player:${placement}:incomplete_video_payload",a),1),e.video={videoURL:a.videoUrl,imageURL:a.thumbnailUrl,contentID:a.reviewId,contentIDType:"EXTERNAL_VIDEO_ID"},h.objectIsEmpty(a.closedCaptions)||
""==a.closedCaptions||(e.video.closedCaptions=a.closedCaptions));k.now("Brila").execute("vse-assets-check",function(a){a!==C&&(e.excludeAssets=["Brila","VSEPlayer"])});return e}function l(b,a){return b.replace("${placement}",a.placement)}var u=b.getDomainRealmBaseUrl()+"vap/ew/subcomponent/vseplayer";return{getVideoPlayer:function(b,a,k,e,f){var m=h.now();b={params:g(b,a,k),paramsFormat:"json",crossDomain:!0,method:"post",contentType:"application/json",withCredentials:!0,timeout:4E3,success:function(b){var c=
h.now()-m;d.logCount(l("vse_player:${placement}:load:status",a),1);d.logCount(l("vse_player:${placement}:load:request_time",a),c);"function"===typeof e&&e(b)},error:function(b){d.logCount(l("vse_player:${placement}:load:status",a),0);"function"===typeof f&&f(b)}};d.logCount(l("vse_player:${placement}:load:count",a),1);c.post(u,b,2)}}})});
/* ******** */
(function(g){var m=window.AmazonUIPageJS||window.P,n=m._namespace||m.attributeErrors,e=n?n("CustomerReviewsFilteringAssets",""):m;e.guardFatal?e.guardFatal(g)(e,window):e.execute(function(){g(e,window)})})(function(g,m,n){g.when("cr-A","cr-jQuery","cr-filtering-view","cr-filtering-model","cr-global-view","reviews-constants","cr-streaming-utils").register("cr-filtering-controller",function(e,f,a,c,l,d,k){function p(h){var b=!1,d=!1;h.toggleFilters&&(d=!0);c.setASIN(a.getLoadedFilterParam("asin"));
b=c.setReviewerType(h.reviewerType,d)||b;b=c.setFormatType(h.formatType,d)||b;b=c.setFilterByKeyword(h.filterByKeyword,d)||b;b=c.setFilterByLanguage(h.filterByLanguage,d)||b;b=c.setSortOrder(h.sortOrder,d)||b;b=c.setStarFilter(h.filterByStar,d)||b;b=c.setPageNumber(h.pageNumber,d)||b;b=c.setHeightFilter(h.filterByHeight,d)||b;b=c.setWeightFilter(h.filterByWeight,d)||b;b=c.setAgeFilter(h.filterByAge,d)||b;return b=c.setMediaFilter(h.mediaType,d)||b}function r(b){if(p(b.data)||b.data.forceReload){b.data.sortOrder&&
a.setSortDropdown(b.data.sortOrder);a.hideReviewLoadError();a.hideReviews();a.showLoadingSpinner();e.trigger(d.events.FILTER_APPLY_BEGIN,b);var h=a.getLoadedFilterParam("newDPFiltersTreatment",!1);null!==h&&"C"!==h&&(h=c.getFilterParams(),n(h));c.getReviews(function(){a.showReviews();var h=document.querySelector("#cm-cr-filters");h&&e.onScreen(h,0)||!h||!h.scrollIntoView||h.scrollIntoView();"filterByHeight"===c.getActiveTab()&&a.scrollToFilterIndex("filterByHeight");"filterByWeight"===c.getActiveTab()&&
a.scrollToFilterIndex("filterByWeight");"filterByAge"===c.getActiveTab()&&a.scrollToFilterIndex("filterByAge");"filterByStar"===c.getActiveTab()&&a.scrollToFilterIndex("filterByStar");e.trigger(d.events.FILTER_APPLY_SUCCESS,b)},function(){a.showReviewLoadError();e.trigger(d.events.FILTER_APPLY_ERROR,b)},function(){a.hideLoadingSpinner();e.trigger(d.events.FILTER_APPLY_DONE,b);e.trigger(d.events.RELOAD_COMPLETE)},function(b){"appendFadeIn"===b[0]?k.appendFadeIn(b):"replace"===b[0]&&k.replace(b)},l.getReftag(b));
b.data.scrollToSelector&&l.scrollTo(b.data.scrollToSelector,0);b.data.filterByAge&&a.setAgeDropdown(b.data.filterByAge)}}function g(b){b&&b.data&&r(b)}function b(b){b&&b.data&&b.$target&&b.data.filterType&&(b.data[b.data.filterType]=b.$target.val(),r(b))}function q(b){b&&b.data&&b.data.filterType&&(a.deactivateFilterTabHeaders(),a.activateFilterTabHeader(b.data.filterType),a.changeFilterOptionsTo(b.data.filterType),c.setActiveTab(b.data.filterType),"filterByHeight"!==b.data.filterType&&"filterByWeight"!==
b.data.filterType&&"filterByAge"!==b.data.filterType&&"filterByStar"!==b.data.filterType||a.scrollToFilterIndex(b.data.filterType))}function n(b){var a=[d.filterOptions.STAR_KEY,d.filterOptions.AVP_KEY,d.filterOptions.MEDIA_KEY,d.filterOptions.LANGUAGE_KEY,d.filterOptions.HEIGHT_KEY,d.filterOptions.WEIGHT_KEY,"filterByAge"],c=!1,q;for(q in b)a.includes(q)&&"CLEAR_VALUE"!==b[q]&&(c=!0);c?f(".cr-widget-MobileGlobalReviews").addClass("aok-hidden"):f(".cr-widget-MobileGlobalReviews").removeClass("aok-hidden")}
c.setReviewsAjaxUrl(a.getReviewsAjaxUrl());a.enableDesktopDPFilterDropdown();e.declarative(d.events.FILTER_APPLY,"click",e.compositeEventWrapper(g,!0,100));e.declarative(d.events.FILTER_CHANGE,"change",e.compositeEventWrapper(b,!0,100));e.declarative(d.events.FILTER_TAB_CLICKED,"click",q);c.setReviewerType(a.getLoadedFilterParam("reviewerType"),!1);c.setFormatType(a.getLoadedFilterParam("formatType"),!1);c.setFilterByKeyword(a.getLoadedFilterParam("filterByKeyword"),!1);c.setFilterByLanguage(a.getLoadedFilterParam("filterByLanguage"),
!1);c.setStarFilter(a.getLoadedFilterParam("filterByStar"),!1);c.setSortOrder(a.getLoadedFilterParam("sortOrder"),!1);c.setPageNumber(a.getLoadedFilterParam("pageNumber"),!1);c.setHeightFilter(a.getLoadedFilterParam("filterByHeight"),!1);c.setWeightFilter(a.getLoadedFilterParam("filterByWeight"),!1);c.setAgeFilter(a.getLoadedFilterParam("filterByAge"),!1);c.setLanguage(a.getLoadedFilterParam("languageOfPreference"));c.setMediaFilter(a.getLoadedFilterParam("mediaType"),!1);var t=a.getLoadedFilterParam("newDPFiltersTreatment",
!1);null!==t&&"C"!==t?a.getLoadedFilterParam("showStarFilter")?c.setActiveTab("filterByStar"):a.getLoadedFilterParam("showLanguageFilter")?c.setActiveTab("filterByLanguage"):a.getLoadedFilterParam("showHeightFilter")?(c.setActiveTab("filterByHeight"),a.scrollToFilterIndex("filterByHeight")):a.getLoadedFilterParam("showAgeFilter")&&c.setActiveTab("filterByAge"):a.getLoadedFilterParam("showLanguageFilter")?c.setActiveTab("filterByLanguage"):a.getLoadedFilterParam("showHeightFilter")?(c.setActiveTab("filterByHeight"),
a.scrollToFilterIndex("filterByHeight")):a.getLoadedFilterParam("showAgeFilter")?c.setActiveTab("filterByAge"):a.getLoadedFilterParam("showStarFilter")&&c.setActiveTab("filterByStar");return{setFilterParams:p,onFilterApply:g,onFilterChange:b,onFilterTabClicked:q}});"use strict";g.when("cr-A","cr-ajax-model","ready").register("cr-filtering-model",function(e,f){function a(){return p.asin||""}function c(){return g||""}function l(b,a){a?p[b]=a:delete p[b]}function d(b,a,d){var c=!1;b&&a!==n&&(c=k(b)!==
a,!c&&d&&(a="CLEAR_VALUE",c=!0),l(b,a));return c}function k(b){return p[b]||""}var p={},g="",m;return{getReviews:function(b,a,d,c,l){var q=g,h={"anti-csrftoken-a2z":e.getValueFromState("reviewsCsrfToken")||""};m&&f.abort(m);l&&(q+="ref\x3d"+l);m=f.post(q,{headers:h,params:p,attribution:"getFilteredReviews",success:b,error:a,finallyCallback:function(){d();m=0},chunk:c})},setASIN:function(b){var d=a()!==b;l("asin",b);return d},getASIN:a,setReviewsAjaxUrl:function(b){var a=c()!==b;g=b||"";return a},
getReviewsAjaxUrl:c,setReviewerType:function(b,a){return d("reviewerType",b,a)},getReviewerType:function(){return k("reviewerType")},setFormatType:function(b,a){return d("formatType",b,a)},getFormatType:function(){return k("formatType")},setFilterByKeyword:function(b,a){return d("filterByKeyword",b,a)},getFilterByKeyword:function(){return k("filterByKeyword")},setFilterByLanguage:function(b,a){return d("filterByLanguage",b,a)},getFilterByLanguage:function(){return k("filterByLanguage")},setSortOrder:function(b,
a){return d("sortBy",b,a)},getSortOrder:function(){return k("sortBy")},setStarFilter:function(b,a){return d("filterByStar",b,a)},getStarFilter:function(){return k("filterByStar")},setPageNumber:function(b,a){return d("pageNumber",b,a)},getPageNumber:function(){return k("pageNumber")},setHeightFilter:function(b,a){return d("filterByHeight",b,a)},getHeightFilter:function(){return k("filterByHeight")},setWeightFilter:function(b,a){return d("filterByWeight",b,a)},getWeightFilter:function(){return k("filterByWeight")},
setAgeFilter:function(b,a){return d("filterByAge",b,a)},getAgeFilter:function(){return k("filterByAge")},getFilterParams:function(){return p||{}},updateFilterParam:l,setActiveTab:function(b){return l("activeTab",b)},getActiveTab:function(){return k("activeTab")},setLanguage:function(b){return l("language",b)},setMediaFilter:function(b,a){return d("mediaType",b,a)},getMediaFilter:function(){return k("mediaType")}}});"use strict";g.when("cr-A","cr-jQuery","a-dropdown","ready").register("cr-filtering-view",
function(e,f,a){function c(a){return(f("#cr-state-object").data("state")||{})[a]||""}return{getReviewsAjaxUrl:function(){return(f("#cr-state-object").data("state")||{}).reviewsAjaxUrl||""},showLoadingSpinner:function(){var a=e.getValueFromState("onLoadShowHideElements");f(a).removeClass("aok-hidden")},hideLoadingSpinner:function(){var a=e.getValueFromState("onLoadShowHideElements");f(a).addClass("aok-hidden")},hideReviews:function(){f(".filterable-reviews-content").addClass("aok-hidden")},showReviews:function(){f(".filterable-reviews-content").removeClass("aok-hidden")},
showReviewLoadError:function(){f(".review-load-error").removeClass("aok-hidden")},hideReviewLoadError:function(){f(".review-load-error").addClass("aok-hidden")},deactivateFilterTabHeaders:function(){f(".cr-tab-header-text").removeClass("cr-tab-active").closest("li").removeClass("cr-tab-active-item")},activateFilterTabHeader:function(a){f(".cr-tab-header-text-"+a).addClass("cr-tab-active").closest("li").addClass("cr-tab-active-item")},changeFilterOptionsTo:function(a){f(".cr-tab-content").addClass("aok-hidden");
f(".cr-tab-content-"+a).removeClass("aok-hidden")},getLoadedFilterParam:c,setSortDropdown:function(c){a.getSelect("cm-cr-sort-dropdown").setValue(c)},setAgeDropdown:function(c){c="CLEAR_VALUE"===c?"":c;var d=a.getSelect("cm-cr-age-dropdown");null!==d&&d.setValue(c)},scrollToFilterIndex:function(a){var d=0;var e=c("isCardTreatmentEnabled")?f(".cr-horizontal-scroll-list-cardify-padding ul \x3e *:first-child"):f(".cr-horizontal-scroll-list-padding ul \x3e *:first-child");var g=f(m).width();a=f("ul#"+
a+"-button-list")[0];if(e===n||g===n||a===n)d=-1;else{var l=parseInt(a.dataset.index);e=parseInt(e.css("padding-left").replace("px",""));if(-1!==l){d=e-g/2;for(g=0;g<l;g++)d+=f("#"+a.children[g].firstElementChild.id).outerWidth(!0);d+=f("#"+a.children[l].firstElementChild.id).outerWidth(!0)/2}}0>d||f(".cr-filter-scroll-container").animate({scrollLeft:d},50)},enableDesktopDPFilterDropdown:function(){f("#cm-cr-dp-review-sort-type").removeClass("aok-hidden")}}});"use strict";g.when("A","jQuery","cr-log-utils").execute(function(e,
f,a){e.$(".cr-filter-tab-button").live("click",function(){a.incrementCount("filters-tab-click")});e.$("#button-one_star").live("click",function(){a.incrementCount("starRating-one-star")});e.$("#button-two_star").live("click",function(){a.incrementCount("starRating-two-star")});e.$("#button-three_star").live("click",function(){a.incrementCount("starRating-three-star")});e.$("#button-four_star").live("click",function(){a.incrementCount("starRating-four-star")});e.$("#button-five_star").live("click",
function(){a.incrementCount("starRating-five-star")});e.$("#button-positive").live("click",function(){a.incrementCount("starRating-positive")});e.$("#button-critical").live("click",function(){a.incrementCount("starRating-critical")});e.$("#button-avp_only_reviews").live("click",function(){a.incrementCount("verified-purchases-click")});e.$("#button-media_reviews_only").live("click",function(){a.incrementCount("media-filter-click")})});"use strict";g.when("cr-A","cr-lighthut-terms-view","reviews-constants",
"cr-log-utils").register("cr-lighthut-terms-controller",function(e,f,a,c){function g(a){a&&a.filterByKeyword!==n&&(f.setSelected(a.filterByKeyword),c.incrementCount("LighthutTermClicked"))}e.on(a.events.FILTER_APPLY_BEGIN,e.compositeEventWrapper(function(a){a&&a.data&&g(a.data)}));return{onFilterApplied:g}});"use strict";g.when("A","cr-jQuery","ready").register("cr-lighthut-terms-view",function(e,f){return{setSelected:function(a){a=a.replace(/ /g,"_");var c=(a=f("#cr-lighthouse-term-"+a))&&a.hasClass("cr-lighthut-term-selected");
f(".cr-lighthut-term-selected").removeClass("cr-lighthut-term-selected");c||a.addClass("cr-lighthut-term-selected")}}})});
/* ******** */
(function(c){var a=window.AmazonUIPageJS||window.P,d=a._namespace||a.attributeErrors,b=d?d("CustomerReviewsTwisterAssets",""):a;b.guardFatal?b.guardFatal(c)(b,window):b.execute(function(){c(b,window)})})(function(c,a,d){c.when().register("customer-reviews-twister-update",function(){return{getDisplayedASIN:function(){var b=document.querySelector("#ASIN");return b?b.value:a&&a.TwisterState&&a.TwisterState.asin?a.TwisterState.asin:""}}})});
/* ******** */
/*
 This software is used under the MIT license.

 URI.js - Mutating URLs

 Version: 1.14.1

 Author: Rodney Rehm
 Web: http://medialize.github.io/URI.js/

 Licensed under
   MIT License http://www.opensource.org/licenses/mit-license
   GPL v3 http://opensource.org/licenses/GPL-3.0

*/
P.register("3p-urijs",function(){(function(n,t){"object"===typeof exports?module.exports=t(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"===typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):n.URI=t(n.punycode,n.IPv6,n.SecondLevelDomains,n)})(this,function(n,t,r,k){function d(a,b){if(!(this instanceof d))return new d(a,b);void 0===a&&(a="undefined"!==typeof location?location.href+"":"");this.href(a);return void 0!==b?this.absoluteTo(b):
this}function q(a){return a.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function w(a){return void 0===a?"Undefined":String(Object.prototype.toString.call(a)).slice(8,-1)}function h(a){return"Array"===w(a)}function v(a,b){var c;if(h(b)){var d=0;for(c=b.length;d<c;d++)if(!v(a,b[d]))return!1;return!0}var f=w(b);d=0;for(c=a.length;d<c;d++)if("RegExp"===f){if("string"===typeof a[d]&&a[d].match(b))return!0}else if(a[d]===b)return!0;return!1}function z(a,b){if(!h(a)||!h(b)||a.length!==b.length)return!1;
a.sort();b.sort();for(var c=0,d=a.length;c<d;c++)if(a[c]!==b[c])return!1;return!0}function D(a){return escape(a)}function x(a){return encodeURIComponent(a).replace(/[!'()*]/g,D).replace(/\*/g,"%2A")}function u(a){return function(b,c){if(void 0===b)return this._parts[a]||"";this._parts[a]=b||null;this.build(!c);return this}}function A(a,b){return function(c,d){if(void 0===c)return this._parts[a]||"";null!==c&&(c+="",c.charAt(0)===b&&(c=c.substring(1)));this._parts[a]=c;this.build(!d);return this}}
var E=k&&k.URI;d.version="1.14.1";var e=d.prototype,p=Object.prototype.hasOwnProperty;d._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,duplicateQueryParameters:d.duplicateQueryParameters,escapeQuerySpace:d.escapeQuerySpace}};d.duplicateQueryParameters=!1;d.escapeQuerySpace=!0;d.protocol_expression=/^[a-z][a-z0-9.+-]*$/i;d.idn_expression=/[^a-z0-9\.-]/i;d.punycode_expression=/(xn--)/i;d.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
d.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
d.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig;d.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/};d.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"};d.invalid_hostname_characters=/[^a-zA-Z0-9\.-]/;d.domAttributes={a:"href",blockquote:"cite",
link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"};d.getDomAttribute=function(a){if(a&&a.nodeName){var b=a.nodeName.toLowerCase();if("input"!==b||"image"===a.type)return d.domAttributes[b]}};d.encode=x;d.decode=decodeURIComponent;d.iso8859=function(){d.encode=escape;d.decode=unescape};d.unicode=function(){d.encode=x;d.decode=decodeURIComponent};d.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,
map:{"%24":"$","%26":"\x26","%2B":"+","%2C":",","%3B":";","%3D":"\x3d","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"\x26","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"\x3d"}}}};d.encodeQuery=function(a,b){a=d.encode(a+"");void 0===b&&
(b=d.escapeQuerySpace);return b?a.replace(/%20/g,"+"):a};d.decodeQuery=function(a,b){a+="";void 0===b&&(b=d.escapeQuerySpace);try{return d.decode(b?a.replace(/\+/g,"%20"):a)}catch(c){return a}};d.recodePath=function(a){a=(a+"").split("/");for(var b=0,c=a.length;b<c;b++)a[b]=d.encodePathSegment(d.decode(a[b]));return a.join("/")};d.decodePath=function(a){a=(a+"").split("/");for(var b=0,c=a.length;b<c;b++)a[b]=d.decodePathSegment(a[b]);return a.join("/")};var B={encode:"encode",decode:"decode"},y,C=
function(a,b){return function(c){try{return d[b](c+"").replace(d.characters[a][b].expression,function(c){return d.characters[a][b].map[c]})}catch(g){return c}}};for(y in B)d[y+"PathSegment"]=C("pathname",B[y]);d.encodeReserved=C("reserved","encode");d.parse=function(a,b){b||(b={});var c=a.indexOf("#");-1<c&&(b.fragment=a.substring(c+1)||null,a=a.substring(0,c));c=a.indexOf("?");-1<c&&(b.query=a.substring(c+1)||null,a=a.substring(0,c));"//"===a.substring(0,2)?(b.protocol=null,a=a.substring(2),a=d.parseAuthority(a,
b)):(c=a.indexOf(":"),-1<c&&(b.protocol=a.substring(0,c)||null,b.protocol&&!b.protocol.match(d.protocol_expression)?b.protocol=void 0:"//"===a.substring(c+1,c+3)?(a=a.substring(c+3),a=d.parseAuthority(a,b)):(a=a.substring(c+1),b.urn=!0)));b.path=a;return b};d.parseHost=function(a,b){var c=a.indexOf("/");-1===c&&(c=a.length);if("["===a.charAt(0)){var d=a.indexOf("]");b.hostname=a.substring(1,d)||null;b.port=a.substring(d+2,c)||null;"/"===b.port&&(b.port=null)}else a.indexOf(":")!==a.lastIndexOf(":")?
(b.hostname=a.substring(0,c)||null,b.port=null):(d=a.substring(0,c).split(":"),b.hostname=d[0]||null,b.port=d[1]||null);b.hostname&&"/"!==a.substring(c).charAt(0)&&(c++,a="/"+a);return a.substring(c)||"/"};d.parseAuthority=function(a,b){a=d.parseUserinfo(a,b);return d.parseHost(a,b)};d.parseUserinfo=function(a,b){var c=a.indexOf("/"),g=a.lastIndexOf("@",-1<c?c:a.length-1);-1<g&&(-1===c||g<c)?(c=a.substring(0,g).split(":"),b.username=c[0]?d.decode(c[0]):null,c.shift(),b.password=c[0]?d.decode(c.join(":")):
null,a=a.substring(g+1)):(b.username=null,b.password=null);return a};d.parseQuery=function(a,b){if(!a)return{};a=a.replace(/&+/g,"\x26").replace(/^\?*&*|&+$/g,"");if(!a)return{};var c={};a=a.split("\x26");for(var g=a.length,f,e,l=0;l<g;l++)f=a[l].split("\x3d"),e=d.decodeQuery(f.shift(),b),f=f.length?d.decodeQuery(f.join("\x3d"),b):null,p.call(c,e)?("string"===typeof c[e]&&(c[e]=[c[e]]),c[e].push(f)):c[e]=f;return c};d.build=function(a){var b="";a.protocol&&(b+=a.protocol+":");a.urn||!b&&!a.hostname||
(b+="//");b+=d.buildAuthority(a)||"";"string"===typeof a.path&&("/"!==a.path.charAt(0)&&"string"===typeof a.hostname&&(b+="/"),b+=a.path);"string"===typeof a.query&&a.query&&(b+="?"+a.query);"string"===typeof a.fragment&&a.fragment&&(b+="#"+a.fragment);return b};d.buildHost=function(a){var b="";if(a.hostname)b=d.ip6_expression.test(a.hostname)?b+("["+a.hostname+"]"):b+a.hostname;else return"";a.port&&(b+=":"+a.port);return b};d.buildAuthority=function(a){return d.buildUserinfo(a)+d.buildHost(a)};
d.buildUserinfo=function(a){var b="";a.username&&(b+=d.encode(a.username),a.password&&(b+=":"+d.encode(a.password)),b+="@");return b};d.buildQuery=function(a,b,c){var g="",f,e;for(f in a)if(p.call(a,f)&&f)if(h(a[f])){var l={};var m=0;for(e=a[f].length;m<e;m++)void 0!==a[f][m]&&void 0===l[a[f][m]+""]&&(g+="\x26"+d.buildQueryParameter(f,a[f][m],c),!0!==b&&(l[a[f][m]+""]=!0))}else void 0!==a[f]&&(g+="\x26"+d.buildQueryParameter(f,a[f],c));return g.substring(1)};d.buildQueryParameter=function(a,b,c){return d.encodeQuery(a,
c)+(null!==b?"\x3d"+d.encodeQuery(b,c):"")};d.addQuery=function(a,b,c){if("object"===typeof b)for(var g in b)p.call(b,g)&&d.addQuery(a,g,b[g]);else if("string"===typeof b)void 0===a[b]?a[b]=c:("string"===typeof a[b]&&(a[b]=[a[b]]),h(c)||(c=[c]),a[b]=(a[b]||[]).concat(c));else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");};d.removeQuery=function(a,b,c){var g;if(h(b))for(c=0,g=b.length;c<g;c++)a[b[c]]=void 0;else if("object"===typeof b)for(g in b)p.call(b,g)&&
d.removeQuery(a,g,b[g]);else if("string"===typeof b)if(void 0!==c)if(a[b]===c)a[b]=void 0;else{if(h(a[b])){g=a[b];var f={},e;if(h(c)){var l=0;for(e=c.length;l<e;l++)f[c[l]]=!0}else f[c]=!0;l=0;for(e=g.length;l<e;l++)void 0!==f[g[l]]&&(g.splice(l,1),e--,l--);a[b]=g}}else a[b]=void 0;else throw new TypeError("URI.addQuery() accepts an object, string as the first parameter");};d.hasQuery=function(a,b,c,g){if("object"===typeof b){for(var f in b)if(p.call(b,f)&&!d.hasQuery(a,f,b[f]))return!1;return!0}if("string"!==
typeof b)throw new TypeError("URI.hasQuery() accepts an object, string as the name parameter");switch(w(c)){case "Undefined":return b in a;case "Boolean":return a=!(h(a[b])?!a[b].length:!a[b]),c===a;case "Function":return!!c(a[b],b,a);case "Array":return h(a[b])?(g?v:z)(a[b],c):!1;case "RegExp":return h(a[b])?g?v(a[b],c):!1:!(!a[b]||!a[b].match(c));case "Number":c=String(c);case "String":return h(a[b])?g?v(a[b],c):!1:a[b]===c;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter");
}};d.commonPath=function(a,b){var c=Math.min(a.length,b.length),d;for(d=0;d<c;d++)if(a.charAt(d)!==b.charAt(d)){d--;break}if(1>d)return a.charAt(0)===b.charAt(0)&&"/"===a.charAt(0)?"/":"";if("/"!==a.charAt(d)||"/"!==b.charAt(d))d=a.substring(0,d).lastIndexOf("/");return a.substring(0,d+1)};d.withinString=function(a,b,c){c||(c={});var g=c.start||d.findUri.start,f=c.end||d.findUri.end,e=c.trim||d.findUri.trim,l=/[a-z0-9-]=["']?$/i;for(g.lastIndex=0;;){var m=g.exec(a);if(!m)break;m=m.index;if(c.ignoreHtml){var h=
a.slice(Math.max(m-3,0),m);if(h&&l.test(h))continue}h=m+a.slice(m).search(f);var k=a.slice(m,h).replace(e,"");c.ignore&&c.ignore.test(k)||(h=m+k.length,k=b(k,m,h,a),a=a.slice(0,m)+k+a.slice(h),g.lastIndex=m+k.length)}g.lastIndex=0;return a};d.ensureValidHostname=function(a){if(a.match(d.invalid_hostname_characters)){if(!n)throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-] and Punycode.js is not available');if(n.toASCII(a).match(d.invalid_hostname_characters))throw new TypeError('Hostname "'+
a+'" contains characters other than [A-Z0-9.-]');}};d.noConflict=function(a){if(a)return a={URI:this.noConflict()},k.URITemplate&&"function"===typeof k.URITemplate.noConflict&&(a.URITemplate=k.URITemplate.noConflict()),k.IPv6&&"function"===typeof k.IPv6.noConflict&&(a.IPv6=k.IPv6.noConflict()),k.SecondLevelDomains&&"function"===typeof k.SecondLevelDomains.noConflict&&(a.SecondLevelDomains=k.SecondLevelDomains.noConflict()),a;k.URI===this&&(k.URI=E);return this};e.build=function(a){if(!0===a)this._deferred_build=
!0;else if(void 0===a||this._deferred_build)this._string=d.build(this._parts),this._deferred_build=!1;return this};e.clone=function(){return new d(this)};e.valueOf=e.toString=function(){return this.build(!1)._string};e.protocol=u("protocol");e.username=u("username");e.password=u("password");e.hostname=u("hostname");e.port=u("port");e.query=A("query","?");e.fragment=A("fragment","#");e.search=function(a,b){a=this.query(a,b);return"string"===typeof a&&a.length?"?"+a:a};e.hash=function(a,b){a=this.fragment(a,
b);return"string"===typeof a&&a.length?"#"+a:a};e.pathname=function(a,b){if(void 0===a||!0===a)return b=this._parts.path||(this._parts.hostname?"/":""),a?d.decodePath(b):b;this._parts.path=a?d.recodePath(a):"/";this.build(!b);return this};e.path=e.pathname;e.href=function(a,b){var c;if(void 0===a)return this.toString();this._string="";this._parts=d._parts();var g=a instanceof d,f="object"===typeof a&&(a.hostname||a.path||a.pathname);a.nodeName&&(f=d.getDomAttribute(a),a=a[f]||"",f=!1);!g&&f&&void 0!==
a.pathname&&(a=a.toString());if("string"===typeof a||a instanceof String)this._parts=d.parse(String(a),this._parts);else if(g||f)for(c in a=g?a._parts:a,a)p.call(this._parts,c)&&(this._parts[c]=a[c]);else throw new TypeError("invalid input");this.build(!b);return this};e.is=function(a){var b=!1,c=!1,g=!1,f=!1,e=!1,l=!1,h=!1,k=!this._parts.urn;this._parts.hostname&&(k=!1,c=d.ip4_expression.test(this._parts.hostname),g=d.ip6_expression.test(this._parts.hostname),b=c||g,e=(f=!b)&&r&&r.has(this._parts.hostname),
l=f&&d.idn_expression.test(this._parts.hostname),h=f&&d.punycode_expression.test(this._parts.hostname));switch(a.toLowerCase()){case "relative":return k;case "absolute":return!k;case "domain":case "name":return f;case "sld":return e;case "ip":return b;case "ip4":case "ipv4":case "inet4":return c;case "ip6":case "ipv6":case "inet6":return g;case "idn":return l;case "url":return!this._parts.urn;case "urn":return!!this._parts.urn;case "punycode":return h}return null};var F=e.protocol,G=e.port,H=e.hostname;
e.protocol=function(a,b){if(void 0!==a&&a&&(a=a.replace(/:(\/\/)?$/,""),!a.match(d.protocol_expression)))throw new TypeError('Protocol "'+a+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return F.call(this,a,b)};e.scheme=e.protocol;e.port=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0!==a&&(0===a&&(a=null),a&&(a+="",":"===a.charAt(0)&&(a=a.substring(1)),a.match(/[^0-9]/))))throw new TypeError('Port "'+a+'" contains characters other than [0-9]');
return G.call(this,a,b)};e.hostname=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0!==a){var c={};d.parseHost(a,c);a=c.hostname}return H.call(this,a,b)};e.host=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a)return this._parts.hostname?d.buildHost(this._parts):"";d.parseHost(a,this._parts);this.build(!b);return this};e.authority=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a)return this._parts.hostname?d.buildAuthority(this._parts):
"";d.parseAuthority(a,this._parts);this.build(!b);return this};e.userinfo=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.username)return"";a=d.buildUserinfo(this._parts);return a.substring(0,a.length-1)}"@"!==a[a.length-1]&&(a+="@");d.parseUserinfo(a,this._parts);this.build(!b);return this};e.resource=function(a,b){if(void 0===a)return this.path()+this.search()+this.hash();a=d.parse(a);this._parts.path=a.path;this._parts.query=a.query;this._parts.fragment=
a.fragment;this.build(!b);return this};e.subdomain=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";a=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,a)||""}var c=this._parts.hostname.length-this.domain().length;c=this._parts.hostname.substring(0,c);c=new RegExp("^"+q(c));a&&"."!==a.charAt(a.length-1)&&(a+=".");a&&d.ensureValidHostname(a);this._parts.hostname=this._parts.hostname.replace(c,
a);this.build(!b);return this};e.domain=function(a,b){if(this._parts.urn)return void 0===a?"":this;"boolean"===typeof a&&(b=a,a=void 0);if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";if((a=this._parts.hostname.match(/\./g))&&2>a.length)return this._parts.hostname;b=this._parts.hostname.length-this.tld(b).length-1;b=this._parts.hostname.lastIndexOf(".",b-1)+1;return this._parts.hostname.substring(b)||""}if(!a)throw new TypeError("cannot set domain empty");d.ensureValidHostname(a);
if(!this._parts.hostname||this.is("IP"))this._parts.hostname=a;else{var c=new RegExp(q(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(c,a)}this.build(!b);return this};e.tld=function(a,b){if(this._parts.urn)return void 0===a?"":this;"boolean"===typeof a&&(b=a,a=void 0);if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";a=this._parts.hostname.lastIndexOf(".");a=this._parts.hostname.substring(a+1);return!0!==b&&r&&r.list[a.toLowerCase()]?r.get(this._parts.hostname)||
a:a}if(a)if(a.match(/[^a-zA-Z0-9-]/))if(r&&r.is(a)){var c=new RegExp(q(this.tld())+"$");this._parts.hostname=this._parts.hostname.replace(c,a)}else throw new TypeError('TLD "'+a+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");c=new RegExp(q(this.tld())+"$");this._parts.hostname=this._parts.hostname.replace(c,a)}else throw new TypeError("cannot set TLD empty");this.build(!b);return this};e.directory=
function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";b=this._parts.path.length-this.filename().length-1;b=this._parts.path.substring(0,b)||(this._parts.hostname?"/":"");return a?d.decodePath(b):b}var c=this._parts.path.length-this.filename().length;c=this._parts.path.substring(0,c);c=new RegExp("^"+q(c));this.is("relative")||(a||(a="/"),"/"!==a.charAt(0)&&(a="/"+a));a&&"/"!==a.charAt(a.length-
1)&&(a+="/");a=d.recodePath(a);this._parts.path=this._parts.path.replace(c,a);this.build(!b);return this};e.filename=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return"";b=this._parts.path.lastIndexOf("/");b=this._parts.path.substring(b+1);return a?d.decodePathSegment(b):b}var c=!1;"/"===a.charAt(0)&&(a=a.substring(1));a.match(/\.?\//)&&(c=!0);var g=new RegExp(q(this.filename())+"$");a=d.recodePath(a);this._parts.path=
this._parts.path.replace(g,a);c?this.normalizePath(b):this.build(!b);return this};e.suffix=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return"";b=this.filename();var c=b.lastIndexOf(".");if(-1===c)return"";b=b.substring(c+1);b=/^[a-z0-9%]+$/i.test(b)?b:"";return a?d.decodePathSegment(b):b}"."===a.charAt(0)&&(a=a.substring(1));c=this.suffix();if(c)var g=a?new RegExp(q(c)+"$"):new RegExp(q("."+c)+"$");else{if(!a)return this;
this._parts.path+="."+d.recodePath(a)}g&&(a=d.recodePath(a),this._parts.path=this._parts.path.replace(g,a));this.build(!b);return this};e.segment=function(a,b,c){var d=this._parts.urn?":":"/",f=this.path(),e="/"===f.substring(0,1);f=f.split(d);void 0!==a&&"number"!==typeof a&&(c=b,b=a,a=void 0);if(void 0!==a&&"number"!==typeof a)throw Error('Bad segment "'+a+'", must be 0-based integer');e&&f.shift();0>a&&(a=Math.max(f.length+a,0));if(void 0===b)return void 0===a?f:f[a];if(null===a||void 0===f[a])if(h(b)){f=
[];a=0;for(var l=b.length;a<l;a++)if(b[a].length||f.length&&f[f.length-1].length)f.length&&!f[f.length-1].length&&f.pop(),f.push(b[a])}else{if(b||"string"===typeof b)""===f[f.length-1]?f[f.length-1]=b:f.push(b)}else b?f[a]=b:f.splice(a,1);e&&f.unshift("");return this.path(f.join(d),c)};e.segmentCoded=function(a,b,c){var e;"number"!==typeof a&&(c=b,b=a,a=void 0);if(void 0===b){a=this.segment(a,b,c);if(h(a)){var f=0;for(e=a.length;f<e;f++)a[f]=d.decode(a[f])}else a=void 0!==a?d.decode(a):void 0;return a}if(h(b))for(f=
0,e=b.length;f<e;f++)b[f]=d.decode(b[f]);else b="string"===typeof b||b instanceof String?d.encode(b):b;return this.segment(a,b,c)};var I=e.query;e.query=function(a,b){if(!0===a)return d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"===typeof a){var c=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);a=a.call(this,c);this._parts.query=d.buildQuery(a||c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);this.build(!b);return this}return void 0!==
a&&"string"!==typeof a?(this._parts.query=d.buildQuery(a,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!b),this):I.call(this,a,b)};e.setQuery=function(a,b,c){var e=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"===typeof a||a instanceof String)e[a]=void 0!==b?b:null;else if("object"===typeof a)for(var f in a)p.call(a,f)&&(e[f]=a[f]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");this._parts.query=
d.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(c=b);this.build(!c);return this};e.addQuery=function(a,b,c){var e=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);d.addQuery(e,a,void 0===b?null:b);this._parts.query=d.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(c=b);this.build(!c);return this};e.removeQuery=function(a,b,c){var e=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);
d.removeQuery(e,a,b);this._parts.query=d.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(c=b);this.build(!c);return this};e.hasQuery=function(a,b,c){var e=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return d.hasQuery(e,a,b,c)};e.setSearch=e.setQuery;e.addSearch=e.addQuery;e.removeSearch=e.removeQuery;e.hasSearch=e.hasQuery;e.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizeQuery(!1).normalizeFragment(!1).build():
this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()};e.normalizeProtocol=function(a){"string"===typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!a));return this};e.normalizeHostname=function(a){this._parts.hostname&&(this.is("IDN")&&n?this._parts.hostname=n.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=
this._parts.hostname.toLowerCase(),this.build(!a));return this};e.normalizePort=function(a){"string"===typeof this._parts.protocol&&this._parts.port===d.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!a));return this};e.normalizePath=function(a){if(this._parts.urn||!this._parts.path||"/"===this._parts.path)return this;var b=this._parts.path,c="";if("/"!==b.charAt(0)){var e=!0;b="/"+b}b=b.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/");e&&(c=b.substring(1).match(/^(\.\.\/)+/)||
"")&&(c=c[0]);for(;;){var f=b.indexOf("/..");if(-1===f)break;else if(0===f){b=b.substring(3);continue}var h=b.substring(0,f).lastIndexOf("/");-1===h&&(h=f);b=b.substring(0,h)+b.substring(f+3)}e&&this.is("relative")&&(b=c+b.substring(1));b=d.recodePath(b);this._parts.path=b;this.build(!a);return this};e.normalizePathname=e.normalizePath;e.normalizeQuery=function(a){"string"===typeof this._parts.query&&(this._parts.query.length?this.query(d.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):
this._parts.query=null,this.build(!a));return this};e.normalizeFragment=function(a){this._parts.fragment||(this._parts.fragment=null,this.build(!a));return this};e.normalizeSearch=e.normalizeQuery;e.normalizeHash=e.normalizeFragment;e.iso8859=function(){var a=d.encode,b=d.decode;d.encode=escape;d.decode=decodeURIComponent;this.normalize();d.encode=a;d.decode=b;return this};e.unicode=function(){var a=d.encode,b=d.decode;d.encode=x;d.decode=unescape;this.normalize();d.encode=a;d.decode=b;return this};
e.readable=function(){var a=this.clone();a.username("").password("").normalize();var b="";a._parts.protocol&&(b+=a._parts.protocol+"://");a._parts.hostname&&(a.is("punycode")&&n?(b+=n.toUnicode(a._parts.hostname),a._parts.port&&(b+=":"+a._parts.port)):b+=a.host());a._parts.hostname&&a._parts.path&&"/"!==a._parts.path.charAt(0)&&(b+="/");b+=a.path(!0);if(a._parts.query){for(var c="",e=0,f=a._parts.query.split("\x26"),h=f.length;e<h;e++){var l=(f[e]||"").split("\x3d");c+="\x26"+d.decodeQuery(l[0],this._parts.escapeQuerySpace).replace(/&/g,
"%26");void 0!==l[1]&&(c+="\x3d"+d.decodeQuery(l[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}b+="?"+c.substring(1)}return b+=d.decodeQuery(a.hash(),!0)};e.absoluteTo=function(a){var b=this.clone(),c=["protocol","username","password","hostname","port"],e,f;if(this._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");a instanceof d||(a=new d(a));b._parts.protocol||(b._parts.protocol=a._parts.protocol);if(this._parts.hostname)return b;for(e=0;f=c[e];e++)b._parts[f]=
a._parts[f];b._parts.path?".."===b._parts.path.substring(-2)&&(b._parts.path+="/"):(b._parts.path=a._parts.path,b._parts.query||(b._parts.query=a._parts.query));"/"!==b.path().charAt(0)&&(a=a.directory(),b._parts.path=(a?a+"/":"")+b._parts.path,b.normalizePath());b.build();return b};e.relativeTo=function(a){var b=this.clone().normalize();if(b._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");a=(new d(a)).normalize();var c=b._parts;var e=a._parts;var f=b.path();
var h=a.path();if("/"!==f.charAt(0))throw Error("URI is already relative");if("/"!==h.charAt(0))throw Error("Cannot calculate a URI relative to another relative URI");c.protocol===e.protocol&&(c.protocol=null);if(c.username===e.username&&c.password===e.password&&null===c.protocol&&null===c.username&&null===c.password&&c.hostname===e.hostname&&c.port===e.port)c.hostname=null,c.port=null;else return b.build();if(f===h)return c.path="",b.build();a=d.commonPath(b.path(),a.path());if(!a)return b.build();
e=e.path.substring(a.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");c.path=e+c.path.substring(a.length);return b.build()};e.equals=function(a){var b=this.clone(),c=new d(a);a={};var e;b.normalize();c.normalize();if(b.toString()===c.toString())return!0;var f=b.query();var k=c.query();b.query("");c.query("");if(b.toString()!==c.toString()||f.length!==k.length)return!1;b=d.parseQuery(f,this._parts.escapeQuerySpace);k=d.parseQuery(k,this._parts.escapeQuerySpace);for(e in b)if(p.call(b,e)){if(!h(b[e])){if(b[e]!==
k[e])return!1}else if(!z(b[e],k[e]))return!1;a[e]=!0}for(e in k)if(p.call(k,e)&&!a[e])return!1;return!0};e.duplicateQueryParameters=function(a){this._parts.duplicateQueryParameters=!!a;return this};e.escapeQuerySpace=function(a){this._parts.escapeQuerySpace=!!a;return this};return d});return URI});
/* ******** */
