solorice/config/spicetify/Extracted/Raw/xpui/xpui-routes-blend.js

2 lines
14 KiB
JavaScript
Executable File

"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[42],{34788:(e,t,n)=>{n.d(t,{O:()=>p});var i=n(52542),r=n(13534),l=n(11854),o=n(23967),a=n(47795),s=n(60455),d=n(63836),c=n(86070),u=(0,i.A)((0,i.A)((0,i.A)({},a.E.MEDIUM,"titleMedium"),a.E.LARGE,"titleMedium"),a.E.XLARGE,"headlineMedium"),v=(0,i.A)((0,i.A)({},a.E.LARGE,"bodyMedium"),a.E.XLARGE,"bodyMediumBold"),b=(0,i.A)((0,i.A)({},a.E.LARGE,"bodySmall"),a.E.XLARGE,"bodySmall"),p=function(e){var t=e.title,n=e.subtitle,i=e.body,a=e.footnote,p=e.buttonText,h=e.callToActionClicked,m=(0,s.y)(),x=m&&u[m]||"titleSmall",f=m&&v[m]||"bodySmall",g=m&&b[m]||"marginal";return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(r.E,{as:"h1",variant:x,semanticColor:"textBase",className:d.A.title,children:t}),(0,c.jsx)(r.E,{as:"h2",variant:f,semanticColor:"textSubdued",className:d.A.subtitle,children:n}),i,h&&(0,c.jsx)(l.$,{className:d.A.button,colorSet:"invertedLight",onClick:h,"data-testid":o.OL,children:p}),a&&(0,c.jsx)(r.E,{as:"p",variant:g,semanticColor:"textSubdued",className:d.A.note,children:a})]})}},64289:(e,t,n)=>{n.d(t,{d:()=>A});var i=n(52542),r=(n(47994),n(97500)),l=n.n(r),o=n(92107),a=n(67924),s=n(45625),d=n(34788),c=n(23967);const u="gJmoZouW_m4rUBRFHmu7",v="r4j9hiYJ8q0SQpEsgvSh";var b=n(86070);const p=function(e){return(0,b.jsx)("div",{className:u,children:(0,b.jsx)("div",{className:v,children:(0,b.jsx)("svg",{width:e.iconSize,height:e.iconSize,fill:"currentColor",viewBox:"0 0 64 64",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("path",{d:"M33 31.998v-23h-2v23H8v2h23v23h2v-23h23v-2z"})})})})};var h=n(47795),m=n(60455),x=n(63836),f={name:"",username:"",image_url:null,hash:""},g=(0,i.A)((0,i.A)((0,i.A)({},h.E.MEDIUM,164),h.E.LARGE,164),h.E.XLARGE,270),E=function(e,t){return(0,b.jsx)(a.e,{label:o.Ru.get("web-player.blend.invite.button-title"),images:[],width:e,userIconSize:"xxlarge",customPlaceholder:(0,b.jsx)(p,{iconSize:t}),piled:!0})},A=function(e){var t,n,i,r,u=e.invitation,v=e.callToActionClicked,p=e.breakpointEltRef,h=!(null===(t=u.members)||void 0===t||!t.length),A=h&&(null===(n=u.members)||void 0===n?void 0:n[0])||u.recipient||f,j=h&&u.recipient||null,y=(0,m.y)(),w=y&&g[y]||128,O=Math.round(.475*w);return(0,b.jsxs)("div",{className:l()(x.A.container,x.A.TwoUsers),"data-testid":c.xg,ref:p,children:[(0,b.jsx)(s.Q,{children:o.Ru.get("blend.invite.page-title")}),(0,b.jsxs)("div",{className:x.A.facepile,children:[(0,b.jsx)(a.e,{label:A.name,images:[{url:null!==(i=A.image_url)&&void 0!==i?i:"",width:w,height:w}],width:w,userIconSize:"xxlarge"}),j?(0,b.jsx)(a.e,{label:j.name,images:[{url:null!==(r=j.image_url)&&void 0!==r?r:"",width:w,height:w}],width:w,userIconSize:"xxlarge",piled:!0}):E(w,O)]}),(0,b.jsx)(d.O,{title:u.title,subtitle:u.subtitle,footnote:u.footnote,buttonText:u.button_text,callToActionClicked:v})]})}},6685:(e,t,n)=>{n.d(t,{A:()=>i});n(83234);const i=function(){var e=window.location.href;return window.location.href="".concat("https://accounts.spotify.com/login","?continue=").concat(encodeURIComponent(e)),null}},23967:(e,t,n)=>{n.d(t,{OL:()=>a,VE:()=>i,ev:()=>l,rg:()=>o,xg:()=>r});var i="blend-deleted-container",r="blend-two-user-container",l="blend-multi-user-container",o="blend-full-container",a="blend-cta-button"},5733:(e,t,n)=>{n.d(t,{B6:()=>a,OE:()=>o,YW:()=>l,pd:()=>r});var i=n(82316),r=function(e){return e.PENDING_INVITATION="PENDING_INVITATION",e.READY_TO_JOIN_EMPTY_BLEND="READY_TO_JOIN_EMPTY_BLEND",e.READY_TO_JOIN_ALREADY_CREATED_BLEND="READY_TO_JOIN_ALREADY_CREATED_BLEND",e.MAX_MEMBERS="MAX_MEMBERS",e.ALREADY_JOINED="ALREADY_JOINED",e.DELETED="DELETED",e}({}),l=function(e,t){return e.build().withHost(i.t2).withPath("/v3/view-invitation/".concat(encodeURIComponent(t))).withEndpointIdentifier("v3/view-invitation/{invitationId}").withLocale(e.locale).send()},o=function(e,t){return e.build().withHost(i.t2).withMethod("PUT").withPath("/v2/join/".concat(encodeURIComponent(t))).withEndpointIdentifier("join/{invitationId}").send()},a=function(e){return e.build().withHost(i.t2).withMethod("POST").withPath("/v1/generate").withEndpointIdentifier("v1/generate").send()}},99347:(e,t,n)=>{n.d(t,{G:()=>o});var i=n(52542),r=n(47795),l=n(53406),o=function(){return(0,l.x)((0,i.A)((0,i.A)((0,i.A)((0,i.A)({},r.E.SMALL,536),r.E.MEDIUM,792),r.E.LARGE,1048),r.E.XLARGE,1688))}},96899:(e,t,n)=>{n.d(t,{y:()=>p});var i=n(62822),r=n(93091),l=n.n(r),o=(n(184),n(42486),n(30758)),a=n(93240),s=n(88677),d=n(92107),c=n(5733),u=n(65249),v=n(6963),b=n(1217);function p(e,t){var n=(0,s.d4)(u.Ht).user,r=(0,a.dh)().enqueueSnackbar,p=(0,v.A9)(),h=(0,o.useCallback)((0,i.A)(l().mark((function e(){var t,i,r,o,a;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,c.B6)(p);case 2:if(o=e.sent,null===(t=o.body)||void 0===t?void 0:t.invite){e.next=6;break}throw new Error("unable to generate invite link");case 6:return a=null!=n&&n.display_name?d.Ru.get("blend.invite.body-with-name",n.display_name,null===(i=o.body)||void 0===i?void 0:i.invite):d.Ru.get("blend.invite.body-without-name",null===(r=o.body)||void 0===r?void 0:r.invite),e.abrupt("return",a);case 8:case"end":return e.stop()}}),e)}))),[null==n?void 0:n.display_name,p]);return(0,i.A)(l().mark((function n(){var i;return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,(0,b.l)(h());case 3:r(d.Ru.get("feedback.link-copied")),n.next=9;break;case 6:n.prev=6,n.t0=n.catch(0),r(d.Ru.get("error.generic"));case 9:e&&t&&(i=e.inviteButtonFactory().hitCopyToClipboard(),t.logInteraction(i));case 10:case"end":return n.stop()}}),n,null,[[0,6]])})))}},36720:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});n(7651),n(30456),n(26701),n(37417),n(11737),n(51691),n(702),n(5672),n(43379),n(34192),n(88856),n(51565),n(18316);var i=n(52542),r=n(30758),l=n(88677),o=n(35086),a=n(92107),s=n(45625),d=n(64289),c=n(6685),u=n(5733),v=n(99347),b=n(96899),p=n(65249),h=n(60455),m=n(12574),x=n(12500),f=n(18809),g=n(86070);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){(0,i.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var j={page_type:u.pd.PENDING_INVITATION,get title(){return a.Ru.get("web-player.blend.group-invite.header")},get subtitle(){return a.Ru.get("web-player.blend.duo-invite.description")},get button_text(){return a.Ru.get("web-player.blend.invite.button-title")},footnote:null,members:[],recipient:null,members_title:null,playlist_uri:null};const y=function(){var e,t=(0,m.r)(o.f,{}),n=t.spec,i=t.logger,u=(0,b.y)(n,i),E=(0,v.G)(),y=E.ref,w=E.breakpoint,O=(0,l.d4)(p.Ht).user,_=null!=O&&O.uri?(0,x.v)(null==O?void 0:O.uri):"",R=function(e){return A(A({},j),{},{members:[e],footnote:a.Ru.get("web-player.blend.group-invite.warning")})}({name:(null==O?void 0:O.display_name)||"",username:_,image_url:(null===(e=(0,f.g)(null==O?void 0:O.images))||void 0===e?void 0:e.url)||null,hash:""});return O?(0,g.jsxs)(r.Suspense,{fallback:null,children:[(0,g.jsx)(s.Q,{children:a.Ru.get("web-player.blend.invite.page-title")}),(0,g.jsx)(h.o.Provider,{value:w,children:(0,g.jsx)(d.d,{invitation:R,callToActionClicked:u,breakpointEltRef:y})})]}):(0,g.jsx)(c.A,{})}},7657:(e,t,n)=>{n.r(t),n.d(t,{default:()=>te});var i=n(30758),r=n(88677),l=n(44286),o=(n(7651),n(30456),n(26701),n(37417),n(11737),n(51691),n(702),n(5672),n(43379),n(34192),n(88856),n(51565),n(18316),n(52542)),a=n(99430),s=n(93493),d=n(35086),c=n(80366),u=n(92107),v=n(44206),b=n(88183),p=n(34788),h=n(23967),m=n(63836),x=n(86070),f=function(e){var t=e.invitation,n=e.callToActionClicked,i=e.breakpointEltRef;return(0,x.jsxs)("div",{className:m.A.container,"data-testid":h.rg,ref:i,children:[(0,x.jsx)(b.u,{size:"xxlarge"}),(0,x.jsx)(p.O,{title:t.title,subtitle:t.subtitle,buttonText:t.button_text,footnote:null,callToActionClicked:n})]})},g=n(45625),E=(n(25550),n(47994),n(15342),n(97500)),A=n.n(E),j=n(13534),y=n(67924),w=n(83643),O=n(24804),_=n(93051);const R="HKAYWYmxd5Ie8WSi0a4y",I="i52u_T3b50wraodIaORk",N="xakiNVMlUf6geF67FEgy",k="IRhTesoeIiwswlly0Dvg",T="LNJzE17iskXWmfKAzY4U",D="qzBr7X7cdLUhWdk0r8lL";var L=function(e){var t=e.uri,n=e.imageUrl,i=e.name;return(0,x.jsx)("li",{children:(0,x.jsx)(w.h,{menu:(0,x.jsx)(O.B,{uri:t}),children:(0,x.jsx)(_.N,{to:t,children:(0,x.jsxs)("div",{className:k,children:[(0,x.jsx)(y.e,{images:[{url:n,width:null,height:null}],label:i,width:32,userIconSize:"medium",className:T}),(0,x.jsx)(j.E,{variant:"bodySmallBold",className:"standalone-ellipsis-one-line",semanticColor:"textBase",children:i})]})})})})},P=function(e){var t=e.members,n=e.headingText,i=e.className;return(0,x.jsxs)("div",{className:A()(R,i),children:[(0,x.jsx)("div",{children:(0,x.jsx)(j.E,{as:"h4",variant:"marginalBold",semanticColor:"textSubdued",className:I,children:n})}),(0,x.jsx)("ul",{className:N,children:t&&t.map((function(e){return(0,x.jsx)(L,{imageUrl:e.image_url||"",name:e.name,uri:(0,c.Qj)(e.username).toURI()},e.username)}))}),(0,x.jsx)("div",{className:D})]})},C=function(e){var t=e.invitation,n=e.callToActionClicked,i=e.breakpointEltRef,r=t.members||[],l=(0,x.jsx)("div",{className:m.A.userListContainer,"data-testid":h.ev,children:(0,x.jsx)(P,{className:m.A.userList,headingText:t.members_title,members:r})});return(0,x.jsxs)("div",{className:m.A.container,ref:i,children:[(0,x.jsx)(g.Q,{children:u.Ru.get("blend.join.title")}),(0,x.jsx)(p.O,{title:t.title,subtitle:t.subtitle,footnote:t.footnote,body:l,buttonText:t.button_text,callToActionClicked:n})]})},M=n(64289),S=n(5733),Y=n(99347),B=n(96899),U=n(62822),G=n(93091),z=n.n(G),J=(n(184),n(42486),n(62774)),V=n(6963);var X=n(58114),W=n(60455),q=n(12988),H=n(12574);function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){(0,o.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Q=function(e){var t,n,r,o=e.invitationId,b=(0,l.Zp)(),g=(0,s.NC)(X.CXJ),E=(0,q.Z)(S.YW,[o]),A=E.data,j=E.error,y=E.loading,w=(0,H.r)(d.f,{}),O=w.spec,_=w.logger,R=(0,B.y)(O,_),I=function(e,t,n){var i=(0,J.d)().enqueueSnackbar,r=(0,V.A9)(),o=(0,l.Zp)();return(0,U.A)(z().mark((function l(){var a,s,d;return z().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:return l.prev=0,l.next=3,(0,S.OE)(r,e);case 3:if(a=l.sent,s=(0,c.o_)(null==a?void 0:a.body.playlist_uri).toURLPath(!0)){l.next=7;break}throw new Error("unable to join");case 7:o(s,{replace:!0}),l.next=13;break;case 10:l.prev=10,l.t0=l.catch(0),i(u.Ru.get("error.request-playlist-failure"));case 13:t&&n&&(d=t.joinButtonFactory().hitCreatePlaylist(),n.logInteraction(d));case 14:case"end":return l.stop()}}),l,null,[[0,10]])})))}(o,O,_),N=(0,Y.G)(),k=N.ref,T=N.breakpoint;(0,i.useEffect)((function(){var e;if((null==A||null===(e=A.body)||void 0===e?void 0:e.page_type)===S.pd.ALREADY_JOINED){var t,n=null===(t=(0,c.o_)(null==A?void 0:A.body.playlist_uri))||void 0===t?void 0:t.toURLPath(!0);n&&b(n,{replace:!0})}}),[null==A||null===(t=A.body)||void 0===t?void 0:t.page_type,null==A||null===(n=A.body)||void 0===n?void 0:n.playlist_uri,b]);var D=null===A||!A.body;if(D||y||j)return(0,x.jsx)(v.LoadingPage,{timeoutInMs:1e3,hasError:!!j||!y&&D,errorMessage:u.Ru.get("error.generic")});var L=(null==A||null===(r=A.body.members)||void 0===r?void 0:r.length)||0,P=g===X.YVK.TWO_USER;switch(null==A?void 0:A.body.page_type){case S.pd.DELETED:return(0,x.jsx)(W.o.Provider,{value:T,children:(0,x.jsxs)("div",{className:m.A.container,ref:k,"data-testid":h.VE,children:[(0,x.jsx)(a.x,{size:"xxlarge"}),(0,x.jsx)(p.O,{title:A.body.title,subtitle:A.body.subtitle,buttonText:A.body.button_text,footnote:A.body.footnote,callToActionClicked:R})]})});case S.pd.ALREADY_JOINED:return(0,x.jsx)(v.LoadingPage,{hasError:!1,errorMessage:u.Ru.get("error.request-playlist-failure")});case S.pd.READY_TO_JOIN_EMPTY_BLEND:return(0,x.jsx)(W.o.Provider,{value:T,children:(0,x.jsx)(M.d,{invitation:A.body,breakpointEltRef:k,callToActionClicked:I})});case S.pd.READY_TO_JOIN_ALREADY_CREATED_BLEND:return P&&L>=2?(0,x.jsx)(W.o.Provider,{value:T,children:(0,x.jsx)(f,{invitation:K(K({},A.body),{},{title:u.Ru.get("blend.link-invialid.header"),subtitle:u.Ru.get("blend.link-invalid.subtitle"),button_text:u.Ru.get("blend.invite.button-title")}),callToActionClicked:R,breakpointEltRef:k})}):(0,x.jsx)(W.o.Provider,{value:T,children:(0,x.jsx)(C,{invitation:A.body,callToActionClicked:I,breakpointEltRef:k})});case S.pd.MAX_MEMBERS:return(0,x.jsx)(W.o.Provider,{value:T,children:(0,x.jsx)(f,{invitation:A.body,callToActionClicked:R,breakpointEltRef:k})});case S.pd.PENDING_INVITATION:return(0,x.jsx)(W.o.Provider,{value:T,children:(0,x.jsx)(M.d,{invitation:A.body,callToActionClicked:R,breakpointEltRef:k})});default:return(0,x.jsx)(v.LoadingPage,{timeoutInMs:1e3,hasError:!0,errorMessage:u.Ru.get("error.generic")})}},Z=n(6685),$=n(65249),ee=function(e){var t=e.invitationId;return(0,r.d4)($.Ht).user?(0,x.jsx)(i.Suspense,{fallback:null,children:(0,x.jsx)(Q,{invitationId:t})}):(0,x.jsx)(Z.A,{})};const te=(0,i.memo)((function(){var e=(0,l.g)().invitationId,t=void 0===e?"":e;return(0,x.jsx)(ee,{invitationId:t})}))},63836:(e,t,n)=>{n.d(t,{A:()=>i});const i={xs:"(min-width: 0px)",xsOnly:"(min-width: 0px) and (max-width: 767px)",sm:"(min-width: 768px)",smOnly:"(min-width: 768px) and (max-width: 1023px)",md:"(min-width: 1024px)",mdOnly:"(min-width: 1024px) and (max-width: 1279px)",lg:"(min-width: 1280px)",lgOnly:"(min-width: 1280px) and (max-width: 1919px)",xl:"(min-width: 1920px)",container:"yMoj4jXSudxZ6BkKxV2E",TwoUsers:"IDgUCqAbkRah6OFywv1q",subtitle:"qmKxO5qV4XmVYfpFpaDA",facepile:"nWMdWl40O8K7HQT8Tagc",title:"csRAeNipsu1camQTMiIU",button:"nxFBywAeAI8Zk2fav3Yj",userList:"lxPLQIPb1VSV3VL18Ke3",userListContainer:"BzMKhmywgyIt6IUjcTGW",note:"DSdKNusLgsMX_iicYCU2"}}}]);
//# sourceMappingURL=xpui-routes-blend.js.map