"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[730],{84041:(e,t,a)=>{a.r(t),a.d(t,{default:()=>p});var n=a(50959),r=a(35869),i=a(75802),c=a(11317),s=a(85648),o=a(91643),l=a(44059),d=a(87350),u=a(20069),k=a(8570),f=a(1740),g=a(11527);const h=n.memo((function(){const e=(0,i.s0)(),t=(0,i.TH)(),a=(0,n.useContext)(f.ZF),h=(0,k.g)(),{trackId:p=""}=(0,i.UO)(),{isAnonymous:m}=(0,r.v9)(d.Gg),b=new URLSearchParams(t.search).get("context")||"",U=(0,c.tn)(p).toURI(),y=(0,l.QN)({uri:U},{gcTime:30*u.y}),C=(0,n.useCallback)(((t,a)=>{const n=h.getState(),r=(0,c.EC)(a)?.toURLPath(!0),i=`${r}?highlight=${U}`;m?e(i):(n&&!n.isPaused||t>-1&&h.play({uri:a},{featureIdentifier:"track",referrerIdentifier:"deeplink"},{skipTo:{index:t}}),e(i,{replace:!0}))}),[e,m,h,U]),T=(0,n.useCallback)((()=>{if(!y.loading&&y.data?.trackUnion&&"Track"===y.data.trackUnion.__typename){const e=(y.data.trackUnion.albumOfTrack?.tracks?.items??[]).findIndex((e=>e.track.uri===U));e>=0&&C(e,y.data.trackUnion.albumOfTrack?.uri||"")}}),[C,y,U]);return(0,n.useEffect)((()=>{const e=(0,c.nK)(b);b&&e?a.getContents(b).then((e=>{const t=e.items.findIndex((e=>e?.uri===U));t<0?T():C(t,b)})):T()}),[b,T,C,a,U]),y.loading||y.error||"Track"!==y.data?.trackUnion?.__typename?(0,g.jsx)(o.h,{hasError:!y.loading,errorMessage:s.ag.get("track-page.error")}):null})),p=h}}]); //# sourceMappingURL=xpui-routes-track.js.map