function A(e){return typeof e=="function"}function m(e){return e!==null&&typeof e=="object"}function Z(e){return Object.prototype.toString.call(e)==="[object Date]"}function K(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function O(e,t,r){let n,o,i,l,s,p,c,u;for(n=0,o=t.length;n<o;++n)if(i=t[n],!(!m(i)&&!A(i))){l=[];for(c in i)Object.prototype.hasOwnProperty.call(i,c)&&l.push(c);for(s=0,p=l.length;s<p;s++)c=l[s],u=i[c],r&&m(u)?Z(u)?e[c]=new Date(u.valueOf()):K(u)?e[c]=new RegExp(u):(m(e[c])||(e[c]=Array.isArray(u)?[]:{}),O(e[c],[u],!0)):e[c]=u}return e}function y(e){return O(e,Array.prototype.slice.call(arguments,1),!1)}function w(e){return typeof e=="string"}function k(e){try{new URL(e)}catch{return!1}return!0}function h(e){return w(e)?e.toLowerCase():e}function x(e){let t=document.createElement("a");return t.href=e,t}var S=/^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,D=/^<\/\s*([\w:-]+)[^>]*>/,Q=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,V=/^</,ee=/^<\//,te=/<!--(.*?)-->/g,G=/<!DOCTYPE([^>]*?)>/i,re=/<!\[CDATA\[(.*?)\]\]>/g,ne=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ie=/([^#-~| |!])/g;function f(e,t){let r={},n=e.split(","),o;for(o=0;o<n.length;o++)r[t?h(n[o]):n[o]]=!0;return r}var q=f("area,br,col,hr,img,wbr"),F=f("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),L=f("rp,rt"),M=y({},L,F),U=y({},F,f("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")),W=y({},L,f("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),oe=f("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan,use"),I=f("script,style"),R=y({},q,U,W,M,oe),C=f("background,cite,href,longdesc,src,usemap,xlink:href"),se=f("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width,aria-label,role,data-syndi-id"),ae=f("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),le=y({},C,ae,se),E;function T(e){return e?(E||(E=document.createElement("pre")),E.innerHTML=e.replace(/</g,"&lt;"),E.textContent):""}function ce(e,t){typeof e!="string"&&(e==null?e="":e=Object.prototype.toString.call(e));let r,n,o,i=[],l=e,s;i.last=function(){return i[i.length-1]};function p(u,a){let d=0,g;if(a=h(a),a)for(d=i.length-1;d>=0&&i[d]!==a;d--);if(d>=0){for(g=i.length-1;g>=d;g--)t.end&&t.end(i[g]);i.length=d}}function c(u,a,d,g){if(a=h(a),U[a])for(;i.last()&&W[i.last()];)p("",i.last());M[a]&&i.last()===a&&p("",a),g=q[a]||!!g,g||i.push(a);let _={};d.replace(Q,function(fe,B,Y,N,J){let j=Y||N||J||"";_[B]=T(j)}),t.start&&t.start(a,_,g)}for(;e;){if(s="",n=!0,!i.last()||!I[i.last()]?(e.indexOf("<!--")===0?(r=e.indexOf("--",4),r>=0&&e.lastIndexOf("-->",r)===r&&(t.comment&&t.comment(e.substring(4,r)),e=e.substring(r+3),n=!1)):G.test(e)?(o=e.match(G),o&&(e=e.replace(o[0],""),n=!1)):ee.test(e)?(o=e.match(D),o&&(e=e.substring(o[0].length),o[0].replace(D,p),n=!1)):V.test(e)&&(o=e.match(S),o?(o[4]&&(e=e.substring(o[0].length),o[0].replace(S,c)),n=!1):(s+="<",e=e.substring(1))),n&&(r=e.indexOf("<"),s+=r<0?e:e.substring(0,r),e=r<0?"":e.substring(r),t.chars&&t.chars(T(s)))):(e=e.replace(new RegExp("([\\W\\w]*)<\\s*\\/\\s*"+i.last()+"[^>]*>","i"),function(u,a){return a=a.replace(te,"$1").replace(re,"$1"),t.chars&&t.chars(T(a)),""}),p("",i.last())),e===l)throw new Error("The sanitizer was unable to parse the following block of html: "+e);l=e}p()}function z(e){return e.replace(/&/g,"&amp;").replace(ne,function(t){let r=t.charCodeAt(0),n=t.charCodeAt(1);return"&#"+((r-55296)*1024+(n-56320)+65536)+";"}).replace(ie,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function pe(e,t){let r=!1;return{start:function(n,o,i){n=h(n),!r&&I[n]&&(r=n),!r&&R[n]===!0&&(e.push("<"),e.push(n),Object.keys(o).forEach(function(l){let s=o[l],p=h(l),c=n==="img"&&p==="src"||p==="background";le[p]===!0&&(C[p]!==!0||t(s,c))&&(e.push(" "),e.push(l),e.push('="'),e.push(z(s)),e.push('"'))}),e.push(i?"/>":">"))},end:function(n){n=h(n),!r&&R[n]===!0&&(e.push("</"),e.push(n),e.push(">")),n===r&&(r=!1)},chars:function(n){r||(k(n)?e.push(n):e.push(z(n)))}}}function ue(e,t=[]){if(e.indexOf("#")===0)return e;let r=x(e);if(r.hostname===window.location.hostname)return e;let n=["a.sellpoint.net","qa.syndigo.cloud","uat.syndigo.cloud","content.syndigo.com","syndi.webcollage.net"];for(let i of n)if(r.hostname===i)return r.pathname.indexOf("preview.html")>-1?`unsafe-preview:${i}:${e}`:e;return!!t.find(function(i){return X(i)===X(r.hostname)})?e:`unsafe-default:${e}`}function X(e){e.startsWith("https://")?e=e.replace("https://",""):e.startsWith("http://")&&(e=e.replace("http://",""));let{hostname:t}=x(`https://${e}`);return t.startsWith("www.")&&(t=t.replace("www.","")),t}function H(e,t){let r=[];return ce(t,pe(r,function(n){return!/^unsafe/.test(ue(n,e.domainAllowList))})),r.join("")}async function v(e){return new Promise(function(t){setTimeout(t,e)})}async function b({conditions:e,timeout:t,retryDelay:r}){let n=Date.now();t=t||2e4,r=r||100;do{if(e())return!0;await v(r)}while(Date.now()-n<=t);return!1}function $(e,t,r){let n=document.querySelector(r.selector);if(!n)return;r.parentStyle&&n.setAttribute("style",r.parentStyle);let o="syndi_powerpage";if(r.html){let s=r.html.replace("sp_inline_product",o).replace(/\sid=/g," data-syndi-id=");s=H(e,s),s=s.replace(/ data-syndi-id=/g," id="),n.insertAdjacentHTML(r.position,s);return}let i=document.createElement("div");i.id=o,t.style&&i.setAttribute("style",t.style),r.style&&i.setAttribute("style",r.style+i.getAttribute("style")),n.insertAdjacentElement(r.position,i)}async function P({framework:e,siteConfig:t}){try{t.rules=JSON.parse(t.rules)}catch{t.rules=[]}t.rules.push({selector:"#wc-power-page:not(script)",position:"beforeend"}),window.Webcollage&&window.Webcollage.powerPageTargetSelector&&window.Webcollage.powerPageTargetSelector!=="#wc-power-page"&&t.rules.push({selector:window.Webcollage.powerPageTargetSelector,position:"beforeend"}),t.rules.push({selector:"#sp_inline_product",position:"beforeend"}),t.rules.unshift({selector:"#sp_inline",position:"beforeend"}),t.rules.unshift({selector:"#SP_ACPage",position:"beforeend"}),t.rules.push({selector:"#syndi_inline",position:"beforeend"});let r=[];await b({conditions:function(){return r=t.rules.filter(o=>o.pagetype&&e.pagetype&&o.pagetype!==e.pagetype||o.pageid&&e.pageid&&o.pageid!==e.pageid?!1:!!document.querySelector(o.selector)),r.length>0}});let n=r[0];return n&&($(e,t,n),e.mediator.subscribe("anchor","reset",async()=>{let o="syndi_powerpage",i=document.querySelector(".syndi_powerpage.syndigo-shadowed-powerpage");i&&i.shadowRoot&&(i.shadowRoot.innerHTML="");let l=document.querySelector(`#${o}`);l?l.innerHTML="":(i&&i.parentNode.removeChild(i),await b({conditions:()=>!!document.querySelector(n.selector),timeout:e.timeout,retryDelay:50}),$(e,t,n))})),!!n}window.SYNDI.registerModule({type:"site/anchor/inline",moduleclass:function(e){return{init:function(){let t=e.moduleParameters["site/anchor/inline"]||{rules:"[ ]",style:""};P({framework:e,siteConfig:t})}}}});
