"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[188],{85404:(e,t,a)=>{a.d(t,{K:()=>f});var n=a(67154),r=a.n(n),l=a(6479),o=a.n(l),s=a(67294),c=a.n(s),i=a(94184),d=a.n(i),m=a(99450),u=a(28760);const h="G8b_VGQSxRwZSatAhUTd",p=["children","data-testid","className"];function f(e){let{children:t,"data-testid":a,className:n}=e,l=o()(e,p);return c().createElement("div",{className:d()(h,n),"data-testid":a},c().createElement(m.D,r()({},l,{buttonSize:l.buttonSize||m.D.sm}),c().createElement(u.Dy,{variant:"mestoBold"},t)))}},49188:(e,t,a)=>{a.r(t),a.d(t,{MAX_SPONSORS_TO_DISPLAY_IN_PREVIEW_IF_SOME_ARE_HIDDEN:()=>j,ShowSponsorsPreviewWithData:()=>N,default:()=>A});var n=a(59713),r=a.n(n),l=a(67294),o=a.n(l),s=a(28760),c=a(1486),i=a(27716),d=a(85404),m=a(74820),u=a(65013),h=a(94184),p=a.n(h),f=a(67154),v=a.n(f);const S="GoBUqE90bjUv_7ndH9Fw";function E(e){return o().createElement("span",v()({},e,{className:p()(S,e.className)}))}const g="RnqjezHOt23z2EKd7j_l",w="M33ItRKEoYWPnq4DwL8n",y="KfQ2IK1i8BYSRgl3VYf4",b="Re1JThkswwaLzRdqavcO",O="uvrjZps73BZs41Z_0JcP",_="w2tPVFzE6CB2GFDWFwlE";function P({thereIsOnlyASingleShowSponsor:e,firstShowSponsor:t,showSponsorsDataThatActuallyGetDisplayedInPreview:a,numberOfHiddenSponsors:n}){return o().createElement(s.Dy,{className:p()(w,{[b]:e})},"Sponsored by"," ",e?o().createElement(E,null,t.metadata.advertiser):o().createElement(o().Fragment,null,a.length>2?a.slice(0,-2).flatMap(((e,t)=>[o().createElement(E,{key:`advertiser ${e.metadata.creativeId||e.metadata.creative_id||e.metadata.advertiser} - ${t}`},e.metadata.advertiser),", "])):"",n?o().createElement(o().Fragment,null,o().createElement(E,null,a[a.length-2].metadata.advertiser),","," ",o().createElement(E,null,a[a.length-1].metadata.advertiser)," ","and more"):o().createElement(o().Fragment,null,o().createElement(E,null,a[a.length-2].metadata.advertiser)," ","and"," ",o().createElement(E,null,a[a.length-1].metadata.advertiser)),"."))}var k=a(76);function D(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function I(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?D(Object(a),!0).forEach((function(t){r()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):D(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const j=5;function N(e){var t;const a=I(I({},e),{},{fireTrackingEvent:null!==(t=e.fireTrackingEvent)&&void 0!==t?t:u.I}),{showSponsorsData:n,showId:r}=a,h=(0,m.D)(r),f=(0,l.useMemo)((()=>n.length>6?n.length-j:0),[n]),S=(0,l.useMemo)((()=>n.slice(0,f?j:6)),[n,f]),E=1===S.length,w=S[0],b=(0,i.s4)();(0,l.useEffect)((function(){E&&S.forEach((({trackingEvents:e})=>null==e?void 0:e.viewed.forEach(a.fireTrackingEvent)))}),[E,S,a.fireTrackingEvent]);const D=(0,l.useCallback)((async e=>b.send((0,c.$)(I({uri:a.uri,reason:"Show page",lineitem_id:S.map((e=>e.metadata.lineitemId))},e)))),[a.uri,S,b]);(0,l.useEffect)((function(){D()}),[a.showSponsorsData,D]);const N=function({thereIsOnlyASingleShowSponsor:e,props:t,allShowSponsorsPathname:a,sendPodcastAdCtaCardEventForShowSponsorsPreview:n,firstShowSponsor:r}){return(0,l.useMemo)((()=>{const l=p()(g,{[y]:e}),s={"--max-sponsors-to-display-in-preview":6,"--logo-size":"38px"};return e?e=>o().createElement("a",v()({href:r.metadata.clickthroughUrl,className:l,style:s},e,{onClick:function(t){var a,l,o;null===(a=e.onClick)||void 0===a||a.call(e,t),null===(l=r.trackingEvents)||void 0===l||null===(o=l.clicked)||void 0===o||o.forEach((e=>fetch(e))),n({ui_navigate:[r.clickthrough],navigate_to_external_uri:[!0]})}}),e.children):e=>o().createElement(k.rU,v()({className:l,style:s,to:{pathname:a,state:t}},e,{onClick:function(t){var a;null===(a=e.onClick)||void 0===a||a.call(e,t),n({cta_card_see_all:!0})}}))}),[e,t,a,n,r])}({thereIsOnlyASingleShowSponsor:E,props:a,allShowSponsorsPathname:h,sendPodcastAdCtaCardEventForShowSponsorsPreview:D,firstShowSponsor:w});return o().createElement(N,null,null==S?void 0:S.map(((e,t)=>o().createElement("img",{key:`logo image ${e.metadata.creativeId||e.metadata.creative_id||e.metadata.advertiser} - ${t}`,src:e.metadata.logoImage,alt:e.metadata.advertiser,width:38,height:38,className:O}))),f?o().createElement(s.Dy,{className:_},"+",f):null,o().createElement(P,{thereIsOnlyASingleShowSponsor:E,firstShowSponsor:w,showSponsorsDataThatActuallyGetDisplayedInPreview:S,numberOfHiddenSponsors:f}),E?o().createElement(d.K,null,w.metadata.buttonMessage):null)}const A=N},65013:(e,t,a)=>{a.d(t,{I:()=>n});const n=e=>fetch(e)}}]);
//# sourceMappingURL=188.js.map