1import{A as t,T as e,s as i,i as s,x as o}from"./chunk.lit-element-726bced0.js"; 2/** 3 * @license 4 * Copyright 2017 Google LLC 5 * SPDX-License-Identifier: BSD-3-Clause 6 */const n=2;class r{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}} 7/** 8 * @license 9 * Copyright 2017 Google LLC 10 * SPDX-License-Identifier: BSD-3-Clause 11 */class a extends r{constructor(e){if(super(e),this.et=t,e.type!==n)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(i){if(i===t||null==i)return this.ft=void 0,this.et=i;if(i===e)return i;if("string"!=typeof i)throw Error(this.constructor.directiveName+"() called with a non-string value");if(i===this.et)return this.ft;this.et=i;const s=[i];return s.raw=s,this.ft={_$litType$:this.constructor.resultType,strings:s,values:[]}}}a.directiveName="unsafeHTML",a.resultType=1;const d=(t=>(...e)=>({_$litDirective$:t,values:e}))(a);class l extends i{static properties={jsonUrl:{type:String,attribute:"json-url"},activeIndex:{type:Number,attribute:!1},items:{type:Array,attribute:!1},minHeight:{type:Number,attribute:!1},minHeightPx:{type:String,attribute:!1},timeout:{type:Number,attribute:!1},quoteContainer:{type:Element,attribute:!1}};static styles=s`img,picture{max-width:100%;height:auto;aspect-ratio:attr(width)/attr(height)}.pressLogoBlocks{display:grid;max-width:1000px;margin:auto;box-sizing:border-box;grid-template-columns:repeat(3,1fr);gap:clamp(16px,4vw,40px);align-items:center;justify-content:center;justify-items:center}.pressLogoBlocks>*{max-width:130px;height:100%}@media screen and (max-width:559px){.pressLogoBlocks>:nth-child(4){display:none}}@media screen and (max-width:767px){.pressLogoBlocks>:nth-child(5){display:none}}@media screen and (min-width:560px){.pressLogoBlocks{grid-template-columns:repeat(4,1fr)}}@media screen and (min-width:768px){.pressLogoBlocks{grid-template-columns:repeat(5,1fr)}}:host{display:block;min-height:100px;padding:30px 20px 50px 20px;background-color:#e8e7df}@media screen and (min-width:560px){:host{padding:30px}}@media screen and (min-width:800px){:host{padding:24px 40px 30px 40px}}.brandList__bd{border-top:1px solid #c1c1c1}.brandList__quote{display:flex;width:100%;padding:0 clamp(0,6vw,80px);margin:0 auto;box-sizing:border-box;align-items:center}.brandList__quote__item{max-width:640px;margin:0 auto;padding:20px;font-size:clamp(16px,2vw + 8px,28px);text-align:center;line-height:1.4;font-family:'Proxima Nova';font-weight:400}.brandList__quote__item blockquote,.brandList__quote__item p{margin:0;padding:0}.brandList__quote__item blockquote div:before,.brandList__quote__item blockquote div>p:first-child:before{content:'\u201C'}.brandList__quote__item blockquote div:after,.brandList__quote__item blockquote div>p:last-child:after{content:'\u201D'}.brandList__quote__item blockquote div:has(>p):after,.brandList__quote__item blockquote div:has(>p):before{content:none}.brandList__quote__item a{color:#333;text-decoration:underline}.brandList__quote__item--md{font-size:clamp(12px,1.5vw + 4px,20px)}.brandList__quote__item--lg{font-size:clamp(12px,1.2vw + 4px,18px)}.brandList__quote__item--xl{font-size:clamp(12px,.8vw + 6px,16px)}.testimonialLogo{display:flex;flex-flow:column wrap;background-color:transparent;justify-content:center;position:relative;height:100%;border:0;margin:0 auto;padding:30px 0 10px 0;opacity:.35}button.testimonialLogo{cursor:pointer;outline:0}.testimonialLogo:focus-visible{outline:2px solid currentColor;outline-offset:2px}.testimonialLogo--isActive{opacity:1}.testimonialLogo--isActive:after{content:'';position:absolute;top:-1px;left:0;width:100%;border-top:2px solid #e23535}.isVisuallyHidden{width:1px;height:1px;margin:-1px;padding:0;border:0;position:absolute;clip:rect(0 0 0 0);overflow:hidden}`;constructor(){super(),this.activeIndex=0,this.items=[],this._onClickLogo=this._onClickLogo.bind(this)}connectedCallback(){super.connectedCallback(),this.getItems(),this._boundOnResize=this._onResize.bind(this),window.addEventListener("resize",this._boundOnResize)}disconnectedCallback(){super.disconnectedCallback(),this._boundOnResize&&(window.removeEventListener("resize",this._boundOnResize),this._boundOnResize=null)}firstUpdated(){this.quoteContainer=this.renderRoot.querySelector("#quoteContainer")}createBrandListItems(t){const e=new Set,i=[];return t.forEach((t=>{e.has(t.logoAssetId)||(this.jsonUrl||!0===t.featured)&&(i.push(t),e.add(t.logoAssetId))})),this.shuffle(i)}shuffle(t){let e=t.length;for(;0!==e;){const i=Math.floor(Math.random()*e);e--,[t[e],t[i]]=[t[i],t[e]]}return t}async getItems(){const t=this.jsonUrl||window.global_brand_logos_json_url;if(t)try{const e=await fetch(t);if(!e.ok)return;const i=await e.json(),s=this.createBrandListItems(i.items);this.items=s.slice(0,5),this.selectTab(1===this.items.length?0:1).measureHeight()}catch(t){}}
11renderLogo(t){return"image/png"===t.logo.contentType?o`<img src="${t.logo.url}?fm=webp&fit=fill&q=75&w=${t.logo.width}" alt="${t.brandName}" width="${t.logo.width}" height="${t.logo.height}" loading="lazy">`:o`<img src="${t.logo.url}?fit=fill&q=75&w=${t.logo.width}" alt="${t.brandName}" width="${t.logo.width}" height="${t.logo.height}" loading="lazy">`}renderQuote(t){return t.longQuote?o`<blockquote><div>${d(t.longQuote)}</div><footer class="isVisuallyHidden">- ${t.quoteAuthor}</footer></blockquote>`:o`<div><a href="${t.articleLink}">${t.articleTitle}</a></div>`}getQuoteClass(t,e){const i=[],s=t.longQuote||t.articleTitle||"";return s.length>400?i.push("brandList__quote__item--xl"):s.length>200?i.push("brandList__quote__item--lg"):s.length>100&&i.push("brandList__quote__item--md"),e!==this.activeIndex&&i.push("isVisuallyHidden"),i.join(" ")}renderQuotes(){return this.items.map(((t,e)=>o`<div class="brandList__quote__item ${this.getQuoteClass(t,e)}" tabindex="0" role="tabpanel" id="brandListTab-${e}-tab" aria-labelledby="brandListTab-${e}">${this.renderQuote(t)}</div>`))}renderLogos(){if(0!==this.items.length)return this.items.map(((t,e)=>o`<div><button class="testimonialLogo ${e===this.activeIndex?"testimonialLogo--isActive":""}" role="tab" id="brandListTab-${e}" aria-controls="brandListTab-${e}-tab" aria-selected="${e===this.activeIndex}" tabindex="-1" data-index="${e}" @click="${this._onClickLogo}">${this.renderLogo(t)}</button></div>`))}selectTab(t){return this.activeIndex=t,this}render(){return o`<div class="brandList__quote" id="quoteContainer" style="min-height:${this.minHeightPx}">${this.renderQuotes()}</div><div class="brandList__bd"><div role="tablist" aria-label="Testimonials" class="pressLogoBlocks">${this.renderLogos()}</div></div>`}async measureHeight(){const t=this.activeIndex;if(this.minHeight=0,this.minHeightPx="0px",await new Promise((t=>{setTimeout(t,10)})),this.quoteContainer){for(let t=0;t<this.items.length;t++)this.selectTab(t),this.minHeight=Math.max(this.quoteContainer.offsetHeight,this.minHeight),await new Promise((t=>{setTimeout(t,10)}));this.minHeightPx=`${this.minHeight+20}px`,this.selectTab(t)}}_onResize(){clearTimeout(this.timeout),this.timeout=setTimeout((()=>{this.measureHeight()}),200)}_onClickLogo(t){const e=Number(t.currentTarget.dataset.index);this.selectTab(e);const i=this.items[e];i&&_gtag("event","press_engagement",{press_brand:i.brandName,press_source:this.jsonUrl?"pdp":"homepage"})}}customElements.define("press-logos",l);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.