!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).AdvonCommerceWidget=e()}(this,(function(){"use strict";function t(){}function e(t,e){for(const n in e)t[n]=e[n];return t}function n(t){return t()}function r(){return Object.create(null)}function l(t){t.forEach(n)}function s(t){return"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function o(t){return null==t?"":t}function c(t,e){t.appendChild(e)}function i(t,e,n){t.insertBefore(e,n||null)}function u(t){t.parentNode.removeChild(t)}function d(t,e){for(let n=0;nt.removeEventListener(e,n,r)}function v(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function _(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const r in e)null==e[r]?t.removeAttribute(r):"style"===r?t.style.cssText=e[r]:"__value"===r?t.value=t[r]=e[r]:n[r]&&n[r].set?t[r]=e[r]:v(t,r,e[r])}function $(t){return Array.from(t.childNodes)}function b(t,e,n,r){for(let r=0;r{t.source===l.contentWindow&&e()}))):(l.src="about:blank",l.onload=()=>{a=m(l.contentWindow,"resize",e)}),c(t,l),()=>{(s||a&&l.contentWindow)&&a(),u(l)}}function S(t,e,n){t.classList[n?"add":"remove"](e)}function A(t){R=t}function I(){if(!R)throw new Error("Function called outside component initialization");return R}function P(){const t=I();return(e,n)=>{const r=t.$$.callbacks[e];if(r){const l=function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,e),n}(e,n);r.slice().forEach((e=>{e.call(t,l)}))}}}const N=[],O=[],j=[],k=[],q=Promise.resolve();let V=!1;function L(){V||(V=!0,q.then(B))}function U(t){j.push(t)}let M=!1;const W=new Set;function B(){if(!M){M=!0;do{for(let t=0;t{z.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}}function X(t){t&&t.c()}function Y(t,e){t&&t.l(e)}function Z(t,e,r){const{fragment:a,on_mount:o,on_destroy:c,after_update:i}=t.$$;a&&a.m(e,r),U((()=>{const e=o.map(n).filter(s);c?c.push(...e):l(e),t.$$.on_mount=[]})),i.forEach(U)}function tt(t,e){const n=t.$$;null!==n.fragment&&(l(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function et(e,n,s,a,o,c,i=[-1]){const d=R;A(e);const f=n.props||{},h=e.$$={fragment:null,ctx:null,props:c,update:t,not_equal:o,bound:r(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(d?d.$$.context:[]),callbacks:r(),dirty:i,skip_bound:!1};let p=!1;if(h.ctx=s?s(e,f,((t,n,...r)=>{const l=r.length?r[0]:n;return h.ctx&&o(h.ctx[t],h.ctx[t]=l)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](l),p&&function(t,e){-1===t.$$.dirty[0]&&(N.push(t),L(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const rt=[];function lt(e,n=t){let r;const l=[];function s(t){if(a(e,t)&&(e=t,r)){const t=!rt.length;for(let t=0;t{const t=l.indexOf(c);-1!==t&&l.splice(t,1),0===l.length&&(r(),r=null)}}}}function st(e,n,r){const a=!Array.isArray(e),o=a?[e]:e,c=n.length<2;return{subscribe:lt(r,(e=>{let r=!1;const i=[];let u=0,d=t;const f=()=>{if(u)return;d();const r=n(a?i[0]:i,e);c?e(r):d=s(r)?r:t},h=o.map(((e,n)=>function(e,...n){if(null==e)return t;const r=e.subscribe(...n);return r.unsubscribe?()=>r.unsubscribe():r}(e,(t=>{i[n]=t,u&=~(1<{u|=1<`${t}_${e}`)).join(" ")}function pt(t,e,n){return`${t}?${e}=${encodeURIComponent(n)}`}function gt(t){let e,n,r;return{c(){e=f("div"),n=h(t[3]),this.h()},l(r){e=b(r,"DIV",{class:!0});var l=$(e);n=y(l,t[3]),l.forEach(u),this.h()},h(){v(e,"class",r=o(t[0]("logo_publisher_name"))+" svelte-8ssa2t")},m(t,r){i(t,e,r),c(e,n)},p(t,l){8&l&&E(n,t[3]),1&l&&r!==(r=o(t[0]("logo_publisher_name"))+" svelte-8ssa2t")&&v(e,"class",r)},d(t){t&&u(e)}}}function mt(t){let e,n,r;return{c(){e=f("a"),n=h(t[5]),this.h()},l(r){e=b(r,"A",{class:!0,href:!0});var l=$(e);n=y(l,t[5]),l.forEach(u),this.h()},h(){v(e,"class",r=o(t[0]("logo_cta"))+" svelte-8ssa2t"),v(e,"href",t[6])},m(t,r){i(t,e,r),c(e,n)},p(t,l){32&l&&E(n,t[5]),1&l&&r!==(r=o(t[0]("logo_cta"))+" svelte-8ssa2t")&&v(e,"class",r),64&l&&v(e,"href",t[6])},d(t){t&&u(e)}}}function vt(e){let n,r,l,s,a,d,g,m,_,x,C,R,T,D,S,A,I,P,N=e[3]&>(e),O=e[7]&&mt(e);return{c(){n=f("div"),r=f("div"),l=h(e[1]),a=p(),d=f("div"),g=h(e[2]),_=p(),x=f("div"),C=f("img"),A=p(),N&&N.c(),I=p(),O&&O.c(),this.h()},l(t){n=b(t,"DIV",{class:!0});var s=$(n);r=b(s,"DIV",{class:!0});var o=$(r);l=y(o,e[1]),o.forEach(u),a=w(s),d=b(s,"DIV",{class:!0});var c=$(d);g=y(c,e[2]),c.forEach(u),_=w(s),x=b(s,"DIV",{class:!0});var i=$(x);C=b(i,"IMG",{class:!0,src:!0,alt:!0}),i.forEach(u),A=w(s),N&&N.l(s),I=w(s),O&&O.l(s),s.forEach(u),this.h()},h(){v(r,"class",s=o(e[0]("logo_title"))+" svelte-8ssa2t"),v(d,"class",m=o(e[0]("logo_intro"))+" svelte-8ssa2t"),v(C,"class",R=o(e[0]("logo_fig_img"))+" svelte-8ssa2t"),C.src!==(T=e[4])&&v(C,"src",T),v(C,"alt",D=e[3]??"Logo"),v(x,"class",S=o(e[0]("logo_fig"))+" svelte-8ssa2t"),v(n,"class",P="advon_ee_logo "+e[0]("logo")+" svelte-8ssa2t")},m(t,e){i(t,n,e),c(n,r),c(r,l),c(n,a),c(n,d),c(d,g),c(n,_),c(n,x),c(x,C),c(n,A),N&&N.m(n,null),c(n,I),O&&O.m(n,null)},p(t,[e]){2&e&&E(l,t[1]),1&e&&s!==(s=o(t[0]("logo_title"))+" svelte-8ssa2t")&&v(r,"class",s),4&e&&E(g,t[2]),1&e&&m!==(m=o(t[0]("logo_intro"))+" svelte-8ssa2t")&&v(d,"class",m),1&e&&R!==(R=o(t[0]("logo_fig_img"))+" svelte-8ssa2t")&&v(C,"class",R),16&e&&C.src!==(T=t[4])&&v(C,"src",T),8&e&&D!==(D=t[3]??"Logo")&&v(C,"alt",D),1&e&&S!==(S=o(t[0]("logo_fig"))+" svelte-8ssa2t")&&v(x,"class",S),t[3]?N?N.p(t,e):(N=gt(t),N.c(),N.m(n,I)):N&&(N.d(1),N=null),t[7]?O?O.p(t,e):(O=mt(t),O.c(),O.m(n,null)):O&&(O.d(1),O=null),1&e&&P!==(P="advon_ee_logo "+t[0]("logo")+" svelte-8ssa2t")&&v(n,"class",P)},i:t,o:t,d(t){t&&u(n),N&&N.d(),O&&O.d()}}}function _t(t,e,n){let{cls:r}=e,{name:l}=e,{intro:s}=e,{publisher:a}=e,{logoUrl:o}=e,{ctaLabel:c}=e,{ctaUrl:i}=e,{displayCta:u}=e;return t.$$set=t=>{"cls"in t&&n(0,r=t.cls),"name"in t&&n(1,l=t.name),"intro"in t&&n(2,s=t.intro),"publisher"in t&&n(3,a=t.publisher),"logoUrl"in t&&n(4,o=t.logoUrl),"ctaLabel"in t&&n(5,c=t.ctaLabel),"ctaUrl"in t&&n(6,i=t.ctaUrl),"displayCta"in t&&n(7,u=t.displayCta)},[r,l,s,a,o,c,i,u]}class $t extends nt{constructor(t){super(),et(this,t,_t,vt,a,{cls:0,name:1,intro:2,publisher:3,logoUrl:4,ctaLabel:5,ctaUrl:6,displayCta:7})}}function bt(t,e,n){const r=t.slice();return r[6]=e[n],r[8]=n,r}function yt(t){let e,n,r,l,s=t[1].charStarRatingEmpty+"";return{c(){e=f("span"),n=h(s),r=p(),this.h()},l(t){e=b(t,"SPAN",{class:!0});var l=$(e);n=y(l,s),r=w(l),l.forEach(u),this.h()},h(){v(e,"class",l=t[0]("rating_star-empty"))},m(t,l){i(t,e,l),c(e,n),c(e,r)},p(t,r){2&r&&s!==(s=t[1].charStarRatingEmpty+"")&&E(n,s),1&r&&l!==(l=t[0]("rating_star-empty"))&&v(e,"class",l)},d(t){t&&u(e)}}}function wt(t){let e,n,r,l,s=t[1].charStarRatingHalf+"";return{c(){e=f("span"),n=h(s),r=p(),this.h()},l(t){e=b(t,"SPAN",{class:!0});var l=$(e);n=y(l,s),r=w(l),l.forEach(u),this.h()},h(){v(e,"class",l=t[0]("rating_star-half"))},m(t,l){i(t,e,l),c(e,n),c(e,r)},p(t,r){2&r&&s!==(s=t[1].charStarRatingHalf+"")&&E(n,s),1&r&&l!==(l=t[0]("rating_star-half"))&&v(e,"class",l)},d(t){t&&u(e)}}}function Et(t){let e,n,r,l,s=t[1].charStarRatingFull+"";return{c(){e=f("span"),n=h(s),r=p(),this.h()},l(t){e=b(t,"SPAN",{class:!0});var l=$(e);n=y(l,s),r=w(l),l.forEach(u),this.h()},h(){v(e,"class",l=t[0]("rating_star-full"))},m(t,l){i(t,e,l),c(e,n),c(e,r)},p(t,r){2&r&&s!==(s=t[1].charStarRatingFull+"")&&E(n,s),1&r&&l!==(l=t[0]("rating_star-full"))&&v(e,"class",l)},d(t){t&&u(e)}}}function xt(t){let e;function n(t,e){return t[8]+1<=t[4]?Et:t[1].showStarRatingHalves&&t[8]===t[4]&&t[3]%1>0?wt:yt}let r=n(t),l=r(t);return{c(){l.c(),e=g()},l(t){l.l(t),e=g()},m(t,n){l.m(t,n),i(t,e,n)},p(t,s){r===(r=n(t))&&l?l.p(t,s):(l.d(1),l=r(t),l&&(l.c(),l.m(e.parentNode,e)))},d(t){l.d(t),t&&u(e)}}}function Ct(t){let e,n,r;return{c(){e=f("span"),n=h(t[3]),this.h()},l(r){e=b(r,"SPAN",{class:!0});var l=$(e);n=y(l,t[3]),l.forEach(u),this.h()},h(){v(e,"class",r=t[0]("rating_value"))},m(t,r){i(t,e,r),c(e,n)},p(t,l){8&l&&E(n,t[3]),1&l&&r!==(r=t[0]("rating_value"))&&v(e,"class",r)},d(t){t&&u(e)}}}function Rt(t){let e,n,r,l,s,a,o=null!=t[1].starReviewTypeLabel&&Tt(t);return{c(){e=f("span"),n=f("span"),r=h(t[2]),s=p(),o&&o.c(),this.h()},l(l){e=b(l,"SPAN",{class:!0});var a=$(e);n=b(a,"SPAN",{class:!0});var c=$(n);r=y(c,t[2]),c.forEach(u),s=w(a),o&&o.l(a),a.forEach(u),this.h()},h(){v(n,"class",l=t[0]("rating_reviews_count")),v(e,"class",a=t[0]("rating_reviews"))},m(t,l){i(t,e,l),c(e,n),c(n,r),c(e,s),o&&o.m(e,null)},p(t,s){4&s&&E(r,t[2]),1&s&&l!==(l=t[0]("rating_reviews_count"))&&v(n,"class",l),null!=t[1].starReviewTypeLabel?o?o.p(t,s):(o=Tt(t),o.c(),o.m(e,null)):o&&(o.d(1),o=null),1&s&&a!==(a=t[0]("rating_reviews"))&&v(e,"class",a)},d(t){t&&u(e),o&&o.d()}}}function Tt(t){let e,n,r,l=t[1].starReviewTypeLabel+"";return{c(){e=f("span"),n=h(l),this.h()},l(t){e=b(t,"SPAN",{class:!0});var r=$(e);n=y(r,l),r.forEach(u),this.h()},h(){v(e,"class",r=t[0]("rating_reviews_label"))},m(t,r){i(t,e,r),c(e,n)},p(t,s){2&s&&l!==(l=t[1].starReviewTypeLabel+"")&&E(n,l),1&s&&r!==(r=t[0]("rating_reviews_label"))&&v(e,"class",r)},d(t){t&&u(e)}}}function Dt(e){let n,r,l,s,a,o,h=Array(5),g=[];for(let t=0;t{"cls"in t&&n(0,s=t.cls),"env"in t&&n(1,a=t.env),"rating"in t&&n(5,o=t.rating),"totalReviewCount"in t&&n(2,c=t.totalReviewCount)},t.$$.update=()=>{42&t.$$.dirty&&(n(3,r=ft(o,a.showStarRatingHalves,a.starRatingRoundDirection)),n(4,l=Math.floor(r)))},[s,a,c,r,l,o]}class At extends nt{constructor(t){super(),et(this,t,St,Dt,a,{cls:0,env:1,rating:5,totalReviewCount:2})}}function It(t){let e,n,r,l,s,a;return{c(){e=f("div"),n=f("img"),this.h()},l(t){e=b(t,"DIV",{class:!0});var r=$(e);n=b(r,"IMG",{alt:!0,class:!0,src:!0}),r.forEach(u),this.h()},h(){v(n,"alt",r=dt(t[2])?t[2]:null),v(n,"class",l=t[0]("product_publisher_fig_img")),n.src!==(s=t[1])&&v(n,"src",s),v(e,"class",a=t[0]("product_publisher_fig"))},m(t,r){i(t,e,r),c(e,n)},p(t,o){4&o&&r!==(r=dt(t[2])?t[2]:null)&&v(n,"alt",r),1&o&&l!==(l=t[0]("product_publisher_fig_img"))&&v(n,"class",l),2&o&&n.src!==(s=t[1])&&v(n,"src",s),1&o&&a!==(a=t[0]("product_publisher_fig"))&&v(e,"class",a)},d(t){t&&u(e)}}}function Pt(t){let e,n,r;return{c(){e=f("div"),n=h(t[3]),this.h()},l(r){e=b(r,"DIV",{class:!0});var l=$(e);n=y(l,t[3]),l.forEach(u),this.h()},h(){v(e,"class",r=t[0]("product_publisher_label"))},m(t,r){i(t,e,r),c(e,n)},p(t,l){8&l&&E(n,t[3]),1&l&&r!==(r=t[0]("product_publisher_label"))&&v(e,"class",r)},d(t){t&&u(e)}}}function Nt(t){let e,n,r;return{c(){e=f("div"),n=h(t[4]),this.h()},l(r){e=b(r,"DIV",{class:!0});var l=$(e);n=y(l,t[4]),l.forEach(u),this.h()},h(){v(e,"class",r=t[0]("product_publisher_description"))},m(t,r){i(t,e,r),c(e,n)},p(t,l){16&l&&E(n,t[4]),1&l&&r!==(r=t[0]("product_publisher_description"))&&v(e,"class",r)},d(t){t&&u(e)}}}function Ot(e){let n,r,l,s,a=dt(e[1]),o=dt(e[3]),d=dt(e[4]),h=a&&It(e),g=o&&Pt(e),m=d&&Nt(e);return{c(){n=f("div"),h&&h.c(),r=p(),g&&g.c(),l=p(),m&&m.c(),this.h()},l(t){n=b(t,"DIV",{class:!0});var e=$(n);h&&h.l(e),r=w(e),g&&g.l(e),l=w(e),m&&m.l(e),e.forEach(u),this.h()},h(){v(n,"class",s=e[0]("product_publisher"))},m(t,e){i(t,n,e),h&&h.m(n,null),c(n,r),g&&g.m(n,null),c(n,l),m&&m.m(n,null)},p(t,[e]){2&e&&(a=dt(t[1])),a?h?h.p(t,e):(h=It(t),h.c(),h.m(n,r)):h&&(h.d(1),h=null),8&e&&(o=dt(t[3])),o?g?g.p(t,e):(g=Pt(t),g.c(),g.m(n,l)):g&&(g.d(1),g=null),16&e&&(d=dt(t[4])),d?m?m.p(t,e):(m=Nt(t),m.c(),m.m(n,null)):m&&(m.d(1),m=null),1&e&&s!==(s=t[0]("product_publisher"))&&v(n,"class",s)},i:t,o:t,d(t){t&&u(n),h&&h.d(),g&&g.d(),m&&m.d()}}}function jt(t,e,n){let{cls:r}=e,{src:l=null}=e,{alt:s=null}=e,{label:a=null}=e,{description:o=null}=e;return t.$$set=t=>{"cls"in t&&n(0,r=t.cls),"src"in t&&n(1,l=t.src),"alt"in t&&n(2,s=t.alt),"label"in t&&n(3,a=t.label),"description"in t&&n(4,o=t.description)},[r,l,s,a,o]}class kt extends nt{constructor(t){super(),et(this,t,jt,Ot,a,{cls:0,src:1,alt:2,label:3,description:4})}}function qt(e){let n,r,l,s,a;return{c(){n=f("button"),r=h(e[1]),this.h()},l(t){n=b(t,"BUTTON",{class:!0,type:!0,"aria-label":!0});var l=$(n);r=y(l,e[1]),l.forEach(u),this.h()},h(){v(n,"class",l=e[0]("add_to_cart")),v(n,"type","button"),v(n,"aria-label","Add To Cart")},m(t,l){i(t,n,l),c(n,r),s||(a=m(n,"click",e[2]),s=!0)},p(t,[e]){2&e&&E(r,t[1]),1&e&&l!==(l=t[0]("add_to_cart"))&&v(n,"class",l)},i:t,o:t,d(t){t&&u(n),s=!1,a()}}}function Vt(t,e,n){let{cls:r}=e,{label:l="Add To Cart"}=e,{productID:s}=e;const a=(o=ut,I().$$.context.get(o));var o;return t.$$set=t=>{"cls"in t&&n(0,r=t.cls),"label"in t&&n(1,l=t.label),"productID"in t&&n(3,s=t.productID)},[r,l,function(t){t.preventDefault(),a("EE-AddToCart",s)},s]}class Lt extends nt{constructor(t){super(),et(this,t,Vt,qt,a,{cls:0,label:1,productID:3})}}function Ut(t){let e,n;return e=new At({props:{cls:t[2],env:t[4],rating:t[5].rating,totalReviewCount:t[5].rating_count}}),{c(){X(e.$$.fragment)},l(t){Y(e.$$.fragment,t)},m(t,r){Z(e,t,r),n=!0},p(t,n){const r={};4&n&&(r.cls=t[2]),16&n&&(r.env=t[4]),32&n&&(r.rating=t[5].rating),32&n&&(r.totalReviewCount=t[5].rating_count),e.$set(r)},i(t){n||(K(e.$$.fragment,t),n=!0)},o(t){Q(e.$$.fragment,t),n=!1},d(t){tt(e,t)}}}function Mt(t){let e,n;return e=new kt({props:{alt:t[5].product_name,label:"Fake Publisher",src:t[5].product_image,cls:t[2]}}),{c(){X(e.$$.fragment)},l(t){Y(e.$$.fragment,t)},m(t,r){Z(e,t,r),n=!0},p(t,n){const r={};32&n&&(r.alt=t[5].product_name),32&n&&(r.src=t[5].product_image),4&n&&(r.cls=t[2]),e.$set(r)},i(t){n||(K(e.$$.fragment,t),n=!0)},o(t){Q(e.$$.fragment,t),n=!1},d(t){tt(e,t)}}}function Wt(t){let e,n;return e=new Lt({props:{label:t[4].addToCartLabel,productID:t[5].client_id,cls:t[2]}}),{c(){X(e.$$.fragment)},l(t){Y(e.$$.fragment,t)},m(t,r){Z(e,t,r),n=!0},p(t,n){const r={};16&n&&(r.label=t[4].addToCartLabel),32&n&&(r.productID=t[5].client_id),4&n&&(r.cls=t[2]),e.$set(r)},i(t){n||(K(e.$$.fragment,t),n=!0)},o(t){Q(e.$$.fragment,t),n=!1},d(t){tt(e,t)}}}function Bt(t){let n,r,l,s,a,d,g,m,x,C,R,T,D,A,I,P,N,O,j,k,q,V,L,U,M,W,B,H,z,F,X,Y,Z,tt,et,nt,rt=t[5].headline+"",lt=t[5].award+"",st=t[5].product_name+"",at=t[5].summary+"",ot=t[5].price+"",ct=t[4].showStarRatings&&Ut(t),it=t[4].productOnly&&Mt(t),ut=t[4].addToCart&&Wt(t),dt=[t[1],{class:tt="advon_ee_link_product "+t[2]("link_product")},{href:et=t[3](t[5].product_url)}],ft={};for(let t=0;t{ct=null})),J()),(!nt||32&e)&&ot!==(ot=t[5].price+"")&&E(z,ot),(!nt||4&e&&F!==(F=o(t[2]("product_price"))+" svelte-qmyd0o"))&&v(B,"class",F),t[4].productOnly?it?(it.p(t,e),16&e&&K(it,1)):(it=Mt(t),it.c(),K(it,1),it.m(r,Y)):it&&(G(),Q(it,1,1,(()=>{it=null})),J()),t[4].addToCart?ut?(ut.p(t,e),16&e&&K(ut,1)):(ut=Wt(t),ut.c(),K(ut,1),ut.m(r,null)):ut&&(G(),Q(ut,1,1,(()=>{ut=null})),J()),(!nt||4&e&&Z!==(Z="advon_ee_product "+t[2]("product")+" svelte-qmyd0o"))&&v(r,"class",Z),_(n,ft=function(t,e){const n={},r={},l={$$scope:1};let s=t.length;for(;s--;){const a=t[s],o=e[s];if(o){for(const t in a)t in o||(r[t]=1);for(const t in o)l[t]||(n[t]=o[t],l[t]=1);t[s]=o}else for(const t in a)l[t]=1}for(const t in r)t in n||(n[t]=void 0);return n}(dt,[2&e&&t[1],(!nt||4&e&&tt!==(tt="advon_ee_link_product "+t[2]("link_product")))&&{class:tt},(!nt||40&e&&et!==(et=t[3](t[5].product_url)))&&{href:et}])),S(n,"svelte-qmyd0o",!0)},i(t){nt||(K(ct),K(it),K(ut),nt=!0)},o(t){Q(ct),Q(it),Q(ut),nt=!1},d(e){e&&u(n),ct&&ct.d(),it&&it.d(),ut&&ut.d(),t[6](null)}}}function Ht(t,e,n){let{aria:r={}}=e,{cls:l}=e,{cdr:s}=e,{env:a}=e,{rev:o}=e,{ref:c=null}=e;return t.$$set=t=>{"aria"in t&&n(1,r=t.aria),"cls"in t&&n(2,l=t.cls),"cdr"in t&&n(3,s=t.cdr),"env"in t&&n(4,a=t.env),"rev"in t&&n(5,o=t.rev),"ref"in t&&n(0,c=t.ref)},[c,r,l,s,a,o,function(t){O[t?"unshift":"push"]((()=>{c=t,n(0,c)}))}]}class zt extends nt{constructor(t){super(),et(this,t,Ht,Bt,a,{aria:1,cls:2,cdr:3,env:4,rev:5,ref:0})}}function Ft(t,e,n){const r=t.slice();return r[21]=e[n],r[22]=e,r[23]=n,r}function Gt(t){let e,n,r;function l(e){t[15].call(null,e,t[23])}let s={aria:{role:"group","aria-roledescription":"slide","aria-label":`${t[23]+1} of ${t[0].length}`,tabindex:Kt(t[4],t[9],t[23])},cls:t[3],cdr:t[2],env:t[1],rev:t[21]};return void 0!==t[5][t[23]]&&(s.ref=t[5][t[23]]),e=new zt({props:s}),O.push((()=>function(t,e,n){const r=t.$$.props[e];void 0!==r&&(t.$$.bound[r]=n,n(t.$$.ctx[r]))}(e,"ref",l))),{c(){X(e.$$.fragment)},l(t){Y(e.$$.fragment,t)},m(t,n){Z(e,t,n),r=!0},p(r,l){t=r;const s={};var a;529&l&&(s.aria={role:"group","aria-roledescription":"slide","aria-label":`${t[23]+1} of ${t[0].length}`,tabindex:Kt(t[4],t[9],t[23])}),8&l&&(s.cls=t[3]),4&l&&(s.cdr=t[2]),2&l&&(s.env=t[1]),1&l&&(s.rev=t[21]),!n&&32&l&&(n=!0,s.ref=t[5][t[23]],a=()=>n=!1,k.push(a)),e.$set(s)},i(t){r||(K(e.$$.fragment,t),r=!0)},o(t){Q(e.$$.fragment,t),r=!1},d(t){tt(e,t)}}}function Jt(t){let e,n,r,s,a,o,h,g,_,y,E,C,R,T,S,A,I,P,N,O,j=t[0],k=[];for(let e=0;eQ(k[t],1,1,(()=>{k[t]=null}));return{c(){e=f("section"),n=f("button"),o=p(),h=f("div"),g=f("div");for(let t=0;tt[14].call(n))),v(g,"aria-live","polite"),v(g,"id","advon_ee_carousel_slider"),v(g,"class",_="advon_ee_carousel_slider "+t[3]("carousel_slider")+" svelte-1gmaxja"),x(g,"left",t[11]+"px"),v(h,"class",y="advon_ee_carousel_content "+t[3]("carousel_content")+" svelte-1gmaxja"),x(h,"width",t[10]+"px"),v(C,"aria-controls","advon_ee_carousel_slider"),v(C,"aria-label","Next Slide"),v(C,"class",R="advon_ee_carousel_btn advon_ee_carousel_btn_right "+t[3]("carousel_btn","carousel_btn_right")+" svelte-1gmaxja"),C.disabled=T=t[4]+t[9]>=t[0].length,U((()=>t[16].call(C))),v(e,"aria-roledescription","carousel"),v(e,"aria-label","Embedded Expert Recommended Products"),v(e,"class",A="advon_ee_carousel "+t[3]("carousel")+" svelte-1gmaxja"),U((()=>t[17].call(e)))},m(r,l){i(r,e,l),c(e,n),a=D(n,t[14].bind(n)),c(e,o),c(e,h),c(h,g);for(let t=0;t=t[0].length))&&(C.disabled=T),(!P||8&l&&A!==(A="advon_ee_carousel "+t[3]("carousel")+" svelte-1gmaxja"))&&v(e,"class",A)},i(t){if(!P){for(let t=0;t=t&&n{"revs"in t&&n(0,i=t.revs),"env"in t&&n(1,u=t.env),"cdr"in t&&n(2,d=t.cdr),"cls"in t&&n(3,f=t.cls)},t.$$.update=()=>{262176&t.$$.dirty&&n(19,l=null===n(18,r=p[0])||void 0===r?void 0:r.offsetWidth),448&t.$$.dirty&&n(20,s=g-m-v),1572866&t.$$.dirty&&n(9,a=0===l||u.maxProductDisplayCount*l=i.length||n(4,h+=1)},function(){m=this.offsetWidth,n(7,m)},function(t,e){p[e]=t,n(5,p)},function(){v=this.offsetWidth,n(8,v)},function(){g=this.offsetWidth,n(6,g)}]}class Xt extends nt{constructor(t){super(),et(this,t,Qt,Jt,a,{revs:0,env:1,cdr:2,cls:3})}}function Yt(t,e,n){const r=t.slice();return r[6]=e[n],r}function Zt(t){let e,n;return e=new zt({props:{cls:t[2],env:t[0],cdr:t[1],rev:t[6]}}),{c(){X(e.$$.fragment)},l(t){Y(e.$$.fragment,t)},m(t,r){Z(e,t,r),n=!0},p(t,n){const r={};4&n&&(r.cls=t[2]),1&n&&(r.env=t[0]),2&n&&(r.cdr=t[1]),8&n&&(r.rev=t[6]),e.$set(r)},i(t){n||(K(e.$$.fragment,t),n=!0)},o(t){Q(e.$$.fragment,t),n=!1},d(t){tt(e,t)}}}function te(t){let e,n,r,l=t[3],s=[];for(let e=0;eQ(s[t],1,1,(()=>{s[t]=null}));return{c(){e=f("div");for(let t=0;t{"revs"in t&&n(4,s=t.revs),"env"in t&&n(0,a=t.env),"cdr"in t&&n(1,o=t.cdr),"cls"in t&&n(2,c=t.cls)},t.$$.update=()=>{49&t.$$.dirty&&n(3,l=(null==a?void 0:a.maxProductDisplayCount)>-1?s.slice(0,null!==n(5,r=null==a?void 0:a.maxProductDisplayCount)&&void 0!==r?r:void 0):s)},[a,o,c,l,s]}class ne extends nt{constructor(t){super(),et(this,t,ee,te,a,{revs:4,env:0,cdr:1,cls:2})}}function re(t){let e,n,r,l,s,a=!t[0].productOnly&&le(t);var o=t[0].hasCarousel?Xt:ne;function d(t){return{props:{revs:t[3].reviews,cls:t[2],cdr:t[1],env:t[0]}}}return o&&(r=new o(d(t))),{c(){e=f("section"),a&&a.c(),n=p(),r&&X(r.$$.fragment),this.h()},l(t){e=b(t,"SECTION",{class:!0});var l=$(e);a&&a.l(l),n=w(l),r&&Y(r.$$.fragment,l),l.forEach(u),this.h()},h(){v(e,"class",l="advon_ee_main "+t[2]("main")+" svelte-16kw9er")},m(t,l){i(t,e,l),a&&a.m(e,null),c(e,n),r&&Z(r,e,null),s=!0},p(t,c){t[0].productOnly?a&&(G(),Q(a,1,1,(()=>{a=null})),J()):a?(a.p(t,c),1&c&&K(a,1)):(a=le(t),a.c(),K(a,1),a.m(e,n));const i={};if(8&c&&(i.revs=t[3].reviews),4&c&&(i.cls=t[2]),2&c&&(i.cdr=t[1]),1&c&&(i.env=t[0]),o!==(o=t[0].hasCarousel?Xt:ne)){if(r){G();const t=r;Q(t.$$.fragment,1,0,(()=>{tt(t,1)})),J()}o?(r=new o(d(t)),X(r.$$.fragment),K(r.$$.fragment,1),Z(r,e,null)):r=null}else o&&r.$set(i);(!s||4&c&&l!==(l="advon_ee_main "+t[2]("main")+" svelte-16kw9er"))&&v(e,"class",l)},i(t){s||(K(a),r&&K(r.$$.fragment,t),s=!0)},o(t){Q(a),r&&Q(r.$$.fragment,t),s=!1},d(t){t&&u(e),a&&a.d(),r&&tt(r)}}}function le(t){let e,n;return e=new $t({props:{logoUrl:t[3].publisher?.logo,publisher:t[3].publisher?.name,intro:t[3].introtext,name:t[3].name,ctaLabel:t[3].cta_label,ctaUrl:t[3].cta_url,displayCta:t[0].displayCallToAction,cls:t[2]}}),{c(){X(e.$$.fragment)},l(t){Y(e.$$.fragment,t)},m(t,r){Z(e,t,r),n=!0},p(t,n){const r={};8&n&&(r.logoUrl=t[3].publisher?.logo),8&n&&(r.publisher=t[3].publisher?.name),8&n&&(r.intro=t[3].introtext),8&n&&(r.name=t[3].name),8&n&&(r.ctaLabel=t[3].cta_label),8&n&&(r.ctaUrl=t[3].cta_url),1&n&&(r.displayCta=t[0].displayCallToAction),4&n&&(r.cls=t[2]),e.$set(r)},i(t){n||(K(e.$$.fragment,t),n=!0)},o(t){Q(e.$$.fragment,t),n=!1},d(t){tt(e,t)}}}function se(t){let e,n,r=!(null==t[3]||t[3]instanceof Error||!Array.isArray(t[3]?.reviews)||t[3].reviews.length<1),l=r&&re(t);return{c(){l&&l.c(),e=g()},l(t){l&&l.l(t),e=g()},m(t,r){l&&l.m(t,r),i(t,e,r),n=!0},p(t,[n]){8&n&&(r=!(null==t[3]||t[3]instanceof Error||!Array.isArray(t[3]?.reviews)||t[3].reviews.length<1)),r?l?(l.p(t,n),8&n&&K(l,1)):(l=re(t),l.c(),K(l,1),l.m(e.parentNode,e)):l&&(G(),Q(l,1,1,(()=>{l=null})),J())},i(t){n||(K(l),n=!0)},o(t){Q(l),n=!1},d(t){l&&l.d(t),t&&u(e)}}}function ae(t,e,n){var r,l;const s=P();var a,o;a=ut,o=s,I().$$.context.set(a,o);let{config:c}=e,{data:i=null}=e,u=function(t={}){const e=Object.assign({addToCart:!1,addToCartLabel:"Add To Cart",charStarRatingEmpty:"",charStarRatingFull:"",charStarRatingHalf:"",displayCallToAction:!1,hasCarousel:!0,maxProductDisplayCount:1,productOnly:!1,showNumericRating:!1,showStarRatingHalves:!0,showStarRatings:!1,showTotalReviewCount:!0,starRatingRoundDirection:ct,starReviewTypeLabel:"reviews"},t);return e.maxProductDisplayCount<1&&(e.maxProductDisplayCount=1),e}(null==c?void 0:c.display),d=null!==(r=null==c?void 0:c.redirect)&&void 0!==r?r:{},f=pt.bind(null,d.url,d.queryParam),h=ht.bind(null,u.classPrefix);const p=lt(null!==(l=null==c?void 0:c.api)&&void 0!==l?l:{}),g=lt(Boolean(null==u?void 0:u.productOnly));let m=i,v=null;var _;return _=()=>{(L(),q).then((()=>{const t=function(t,e,n,r=null){let l=!1;return st([t,e],(([t,e],s)=>{if(!l&&(l=!0,null!=r))return;const a=t.productSearchTerm,o="/widget/v1/api/"+(e?"reviews":"articles");n("EE-ProductsSearchRequest",a);let{url:c}=t;"string"!=typeof c&&(c=""),c=c.replace(/\/$/,"");const i=a?`?keyword=${encodeURIComponent(a)}`:"";fetch(`${c}${o}${i}`).then((t=>t.json())).then((t=>{s(t.data),n(it,t.data)})).catch((t=>{const e=new Error(t);s(e),n(it,e)}))}),r)}(p,g,s,i);v=t.subscribe((t=>{n(3,m=t)}))}))},I().$$.on_mount.push(_),function(t){I().$$.on_destroy.push(t)}((()=>{null!=v&&v()})),t.$$set=t=>{"config"in t&&n(4,c=t.config),"data"in t&&n(5,i=t.data)},[u,f,h,m,c,i,function(t){const e=u;n(0,u=Object.assign({},u,t)),n(0,u.productOnly=Boolean(u.productOnly),u),u.classPrefix!==e.classPrefix&&n(2,h=ht.bind(null,u.classPrefix)),u.productOnly!==e.productOnly&&g.set(u.productOnly)},function(t){d=Object.assign({},d,t),n(1,f=pt.bind(null,d.url,d.queryParam))},function(t){p.update((e=>Object.assign(Object.assign({},e),{productSearchTerm:t})))}]}return class extends nt{constructor(t){super(),et(this,t,ae,se,a,{config:4,data:5,setDisplayConfig:6,setRedirectConfig:7,setProductSearchTerm:8})}get config(){return this.$$.ctx[4]}set config(t){this.$set({config:t}),B()}get data(){return this.$$.ctx[5]}set data(t){this.$set({data:t}),B()}get setDisplayConfig(){return this.$$.ctx[6]}get setRedirectConfig(){return this.$$.ctx[7]}get setProductSearchTerm(){return this.$$.ctx[8]}}}));