mirror of
https://github.com/kristoferssolo/solorice.git
synced 2025-10-21 20:10:34 +00:00
2 lines
6.4 KiB
JavaScript
Executable File
2 lines
6.4 KiB
JavaScript
Executable File
"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[5040],{36959:(e,t,r)=>{r.d(t,{o:()=>S});var n=r(52542),a=r(62822),i=r(12341),s=r(93091),c=r.n(s),l=(r(7651),r(30456),r(26701),r(25550),r(47994),r(37417),r(11737),r(51691),r(702),r(5672),r(43379),r(34192),r(88856),r(51565),r(15342),r(18316),r(30758)),d=r(13534),o=r(94842),u=r(12482),v=r(76149),f=r(92107),h=r(96971),p=r(26173),b=r(66475),g=r(70080),_=r(11854),m=r(19276),k=r(93051);const y="c5Ml9BbBuUEHjNkcSwZA";var x=r(86070),w="70px",j=function(e){var t=e.adId,r=e.advertiser,n=e.tagline,a=e.displayImage,i=e.buttonMessage,s=e.cardOnClick,c=e.buttonOnClick,l=e.clickthroughUrl;return(0,x.jsx)(k.N,{to:(0,m.H)(l),className:y,"data-testid":"leavebehind",children:(0,x.jsx)(h.v,{onClick:s,onClickHint:f.Ru.get("ad-formats.learnMore"),layout:"wide",variant:"tinted",id:t,size:"xl",title:(0,x.jsx)(p.d,{weight:"bold",variant:"ballad",lineClamp:1,"data-testid":"leavebehind-advertiser",children:r}),subtitle:(0,x.jsx)(b.j,{as:"div",lineClamp:2,"data-testid":"leavebehind-tagline",children:n}),media:(0,x.jsx)(g.C,{"data-testid":"leavebehind-image",src:a.src,alt:a.alt,imageHeight:w,imageWidth:w,size:"xl"}),trailing:(0,x.jsx)(_.$,{onClick:function(){c&&c()},"data-testid":"leavebehind-button",colorSet:"invertedLight",size:"small","aria-label":f.Ru.get("ad-formats.learnMore"),children:i})})})},O=r(41243),E=r(76672),I=r(40070),A=r(85726);const C="zlUJfROzFEOsEDWL7ucP",q="Fxvq1Fw7XQdGRDvYokRg";function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var S=function(e){var t=e.leavebehinds,r=e.seeAllButton,n=e.surface,s=e.uri,h=(0,A.vh)(),p=(0,I.w)(I.P),b=(0,l.useState)(void 0),g=(0,i.A)(b,2),_=g[0],m=g[1];(0,l.useEffect)((function(){t&&t.length>0&&_!==t[0].requestId&&s&&(t.forEach((function(e,t){var r;e.uri===s&&(null===(r=e.trackingEvents)||void 0===r||r.viewed.forEach(function(){var t=(0,a.A)(c().mark((function t(r){var a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,p(r);case 3:t.next=9;break;case 5:t.prev=5,t.t0=t.catch(0),a=t.t0,h.send((0,u.G)({error_type:"trackingURLFailure",error_message:a.message,http_error_code:422,surface:(0,O.Fh)(n),request_url:r,request_type:"leavebehindAds",lineitem_id:e.lineitemId,ad_content_origin:(0,E.Zl)(n)}));case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e){return t.apply(this,arguments)}}()),h.send((0,v.x)({leavebehind_lineitem_id:e.lineitemId,leavebehind_request_id:e.requestId,event:"event_viewed",event_reason:"viewed_on_".concat((0,O.Fh)(n).toLowerCase()),surface:(0,O.Fh)(n),surface_position:t+1,uri:s})))})),m(t[0].requestId))}),[h,p,t,s,n,_]);var k=function(e){var t=e.eventReason,r=e.lineitemId,i=e.requestId,l=e.trackingEvents,d=e.surfacePosition;!function(e,t){null==t||t.forEach(function(){var t=(0,a.A)(c().mark((function t(r){var a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,p(r);case 3:t.next=9;break;case 5:t.prev=5,t.t0=t.catch(0),a=t.t0,h.send((0,u.G)({error_type:"trackingURLFailure",error_message:a.name,http_error_code:422,surface:(0,O.Fh)(n),request_url:r,request_type:"leavebehindAds",lineitem_id:e,ad_content_origin:(0,E.Zl)(n)}));case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e){return t.apply(this,arguments)}}())}(r,l),h.send((0,v.x)({leavebehind_lineitem_id:r,leavebehind_request_id:i,event:"event_clicked",event_reason:t,surface:(0,O.Fh)(n),surface_position:d,uri:s}))};return(0,x.jsxs)("section",{"data-testid":"leavebehinds-wrapper",children:[(0,x.jsxs)("div",{className:q,children:[(0,x.jsx)(d.E,{as:"h2",semanticColor:"textBase",variant:"titleSmall",paddingBottom:(0,o.po)("tighter"),"data-testid":"leavebehinds-title",children:f.Ru.get("podcast-ads.recent_ads")}),r]}),(0,x.jsx)("div",{className:C,"data-testid":"leavebehinds-list-wrapper",children:t.map((function(e,t){return(0,x.jsx)(j,F(F({},e),{},{buttonOnClick:function(){var r;k({eventReason:"button_clicked",lineitemId:e.lineitemId,trackingEvents:null===(r=e.trackingEvents)||void 0===r?void 0:r.clicked,requestId:e.requestId,surfacePosition:t+1})},cardOnClick:function(){var r;k({eventReason:"card_clicked",lineitemId:e.lineitemId,trackingEvents:null===(r=e.trackingEvents)||void 0===r?void 0:r.clicked,requestId:e.requestId,surfacePosition:t+1})}}),e.adId)}))})]})}},19669:(e,t,r)=>{r.r(t),r.d(t,{SeeAllPlaylistLeavebehinds:()=>o});r(70750);var n=r(30758),a=r(44286),i=r(36959),s=r(41243),c=r(37903),l=r(76672),d=r(86070),o=function(){var e=(0,a.zy)().state,t=e.uri,r=e.playlistName,o=s.ui.MUSIC_SEE_ALL,u=(0,c.A)({surface:o,uri:t,playlistName:r}),v=u.data,f=u.error,h=u.getLeavebehinds;if((0,n.useEffect)((function(){h()}),[]),null==v||!v.leavebehindAds||f)return null;var p=(0,l.iT)(v,t);return(0,d.jsx)("div",{className:"contentSpacing",children:(0,d.jsx)(i.o,{leavebehinds:p.slice(0,l.E9),surface:o,uri:t})})}},37903:(e,t,r)=>{r.d(t,{A:()=>b});var n=r(62822),a=r(12341),i=r(93091),s=r.n(i),c=(r(47994),r(30758)),l=r(12482),d=r(93493),o=r(8214),u=r(41243),v=r(76672),f=r(85726),h=r(58114),p=r(75844);const b=function(e){var t=(0,c.useState)(),r=(0,a.A)(t,2),i=r[0],b=r[1],g=(0,c.useState)(!1),_=(0,a.A)(g,2),m=_[0],k=_[1],y=(0,f.vh)(),x=(0,d.NC)(h.SAn,{loadingValue:!1});return{data:i,error:m,getLeavebehinds:(0,c.useCallback)((0,n.A)(s().mark((function t(){var r,n;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.b6(p.n.getInstance(),(0,u.Fh)(e.surface),e.uri,e.playlistName,x);case 3:r=t.sent,b(r.body),t.next=12;break;case 7:t.prev=7,t.t0=t.catch(0),n=t.t0,y.send((0,l.G)({error_type:"fetchAdsFailure",error_message:n.name,http_error_code:n.status,surface:(0,u.Fh)(e.surface),request_type:"leavebehindAds",ad_content_origin:(0,v.Zl)(e.surface)})),k(!0);case 12:case"end":return t.stop()}}),t,null,[[0,7]])}))),[y,e.playlistName,e.surface,e.uri,x])}}}}]);
|
|
//# sourceMappingURL=xpui-routes-see-all-playlist-leavebehinds.js.map
|