1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9687],{19687:(e,r,t)=>{t.r(r),t.d(r,{default:()=>v});var n=t(10940),a=t(96626),u=t.n(a),l=t(62544),c=t(57489);let i=function(e,r,t){if(!c.Bd)return[r,c.lQ,c.lQ];if(!e)throw Error("useLocalStorage key may not be falsy");var n=t?t.raw?function(e){return e}:t.deserializer:JSON.parse,a=(0,l.useRef)(function(e){try{var a=t?t.raw?String:t.serializer:JSON.stringify,u=localStorage.getItem(e);if(null!==u)return n(u);return r&&localStorage.setItem(e,a(r)),r}catch(e){return r}}),u=(0,l.useState)(function(){return a.current(e)}),i=u[0],o=u[1];(0,l.useLayoutEffect)(function(){return o(a.current(e))},[e]);var s=(0,l.useCallback)(function(r){try{var a="function"==typeof r?r(i):r;if(void 0===a)return;var u=void 0;u=t?t.raw?"string"==typeof a?a:JSON.stringify(a):t.serializer?t.serializer(a):JSON.stringify(a):JSON.stringify(a),localStorage.setItem(e,u),o(n(u))}catch(e){}},[e,o]);return[i,s,(0,l.useCallback)(function(){try{localStorage.removeItem(e),o(void 0)}catch(e){}},[e,o])]},o=u()(()=>t.e(6005).then(t.bind(t,16005)),{loadableGenerated:{webpack:()=>[16005]}}),s=u()(()=>Promise.all([t.e(1622),t.e(2923),t.e(7920),t.e(7911),t.e(4259)]).then(t.bind(t,4259)),{loadableGenerated:{webpack:()=>[4259]}}),d=u()(()=>Promise.all([t.e(7920),t.e(7911),t.e(7577)]).then(t.bind(t,47577)),{loadableGenerated:{webpack:()=>[47577]}});function v(e){var r,t;let{data:a}=e,u=null==a?void 0:a.tracks,[c,v]=i("trackIndex",0),[f,g]=(0,l.useState)(null!=c?c:0),[y,k]=(0,l.useState)(0),[p,b]=(0,l.useState)(!1),[,h]=i("track",u[f]),{duration:S}=u[f]||{},m=null==(r=u[f])?void 0:r.audioUrl,x=(0,l.useRef)(void 0),E=(0,l.useRef)(!1),T=(0,l.useRef)("undefined"!=typeof Audio?new Audio(m):void 0),w=(0,l.useCallback)(()=>{f<u.length-1?(c&&v(c+1),g(f+1),c&&h(u[c+1])):(v(0),g(0),h(u[0]))},[f,u,c,h,v]),I=(0,l.useCallback)(()=>{clearInterval(x.current),x.current&&(x.current=setInterval(()=>{var e,r;(null==(e=T.current)?void 0:e.ended)?w():k(null==(r=T.current)?void 0:r.currentTime)},1e3))},[w]);return(0,l.useLayoutEffect)(()=>{var e,r;p?(null==(e=T.current)||e.play(),I()):null==(r=T.current)||r.pause()},[p,I]),(0,l.useLayoutEffect)(()=>{var e,r,t;null==(e=T.current)||e.pause(),T.current=new Audio(m),k(null==(r=T.current)?void 0:r.currentTime),E.current?(null==(t=T.current)||t.play(),b(!0),I()):E.current=!0},[m,I,f]),(0,l.useEffect)(()=>()=>{var e;null==(e=T.current)||e.pause(),clearInterval(x.current)},[]),(0,n.jsx)("section",{children:(0,n.jsxs)("div",{className:"mb-10",children:[(0,n.jsx)(o,{data:a}),(0,n.jsx)(s,{data:u,isPlaying:p,setIsPlaying:b,currentTrack:u[f],goToTrack:e=>{v(e),g(e),h(u[e])},progress:y,exclusiveStreamTextColorOverride:null==a||null==(t=a.exclusiveStreamTextColorOverride)?void 0:t.hex}),(0,n.jsx)(d,{currentTrack:u[f],data:a,audioRef:T,isPlaying:p,toPrevTrack:()=>{f-1<0?(v(u.length-1),g(u.length-1),h(u[u.length-1])):(v(f-1),g(f-1),c&&h(u[c-1]))},toNextTrack:w,setIsPlaying:b,trackProgress:y,onScrub:e=>{var r;clearInterval(x.current),T.current&&(T.current.currentTime=e),k(null==(r=T.current)?void 0:r.currentTime)},onScrubEnd:()=>{p||b(!0),I()},duration:S})]})})}},57489:(e,r,t)=>{t.d(r,{AU:()=>u,Bd:()=>l,lQ:()=>n,on:()=>a});var n=function(){};function a(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];e&&e.addEventListener&&e.addEventListener.apply(e,r)}function u(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];e&&e.removeEventListener&&e.removeEventListener.apply(e,r)}var l=!0}}]);
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.