1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9165],{99165:(e,t,r)=>{r.r(t),r.d(t,{default:()=>A});var s=r(37876),l=r(14232),n=r(10841),a=r.n(n);r(45747);var i=r(45947),c=r.n(i),d=r(4186),x=r(94759),m=r(29573);function o({playingTrack:e,waveSurferRef:t,className:r="",...l}){let n=(0,m.QP)("px-0 ml-1 mr-1 flex flex-row text-neutral-500 text-[33px] md:text-[41px] truncate",r);return(0,s.jsxs)("div",{className:n,children:[(0,s.jsx)("div",{className:"md:-mt-2 "+(l.getPrevTrack()?" text-neutral-300 hover:text-neutral-100 cursor-pointer":""),onClick:e=>{l.playPrevTrack()},children:(0,s.jsx)(x.f,{children:(0,s.jsx)(d.wM5,{className:"inline "})})}),(0,s.jsx)(x.f,{children:t.current?.isPlaying()&&e?.id?(0,s.jsx)("div",{className:"md:-mt-2 text-white",onClick:e=>{console.log("Sending Pause"),t.current.pause()},children:(0,s.jsx)(d.u3P,{className:`inline cursor-pointer ${e?" text-itemtitle hover:text-white":" text-neutral-500 "}`})}):(0,s.jsx)("div",{className:" md:-mt-2 "+(e?" text-itemtitle hover:text-white":" "),onClick:t=>{l.playTrack(e)},children:(0,s.jsx)(d._xj,{className:"inline cursor-pointer"})})}),(0,s.jsx)("div",{className:"md:-mt-2 "+(l.getNextTrack()?" text-neutral-300 hover:text-neutral-100 cursor-pointer ":""),onClick:e=>{l.playNextTrack()},children:(0,s.jsx)(x.f,{children:(0,s.jsx)(d.ivF,{className:"inline "})})})]})}function u({...e}){return(0,s.jsx)("div",{className:"w-[50px] text-left relative select-none",children:(0,s.jsxs)(x.f,{children:[(0,s.jsx)(d.$Pi,{className:"ml-0 text-2xl cursor-pointer inline"+(e.playList?.length>1?" text-neutral-300 hover:text-white ":" text-neutral-500 "),onClick:e.togglePlayList}),(0,s.jsx)("div",{className:`${e.playList?.length>1?" bg-brand ":" bg-neutral-800 "} min-w-[16px] cursor-pointer text-xxs mr-1.5 md:mr-1 font-semibold text-neutral-950 rounded-full absolute top-0 right-0 h-[18px] px-[5px] pt-[2px]`,onClick:e.togglePlayList,children:e.playList?.length>1?e.playList?.length:""})]})})}var h=r(48230),p=r.n(h),f=r(20621),v=r(71134),j=r(1515),w=r(95333);function N({playingTrack:e,formattedDuration:t,formattedTotalDuration:r,...l}){return(0,s.jsx)(s.Fragment,{children:e?(0,s.jsxs)("div",{className:"flex flex-row min-w-0 max-w-full",children:[(0,s.jsx)("div",{className:"flex-shrink-0 p-[4px] pl-1 md:p-[8px]",children:(0,s.jsx)("img",{className:"w-[44px] h-[44px] md:w-[54px] md:h-[54px]",src:(0,v.Zn)(e.source_image_url)||e.image_display_url})}),(0,s.jsxs)("div",{className:"text-xs pt-1 md:mt-1 pl-1 md:pl-2 min-w-0 flex-1 overflow-hidden",children:[(0,s.jsx)(p(),{href:`/track/${e.id}`,className:"font-semibold text-sm text-neutral-100 block truncate",children:e._full_title}),(0,s.jsxs)("div",{className:"flex flex-row min-w-0",children:[(0,s.jsx)("div",{className:"hidden md:block mt-1.5 mr-2 bg-brand/20 rounded h-fit shrink-0",children:(0,s.jsx)(w.A,{text:"F",buttonClassName:"text-sm",sellerId:e?.seller_id,sellerName:e?.seller_name,...l,style:{maxWidth:"20px",minWidth:"20px",maxHeight:"20px",minHeight:"20px"}})}),(0,s.jsxs)("div",{className:"mt-[2px] min-w-0 flex-1 overflow-hidden",children:[(0,s.jsx)(f.A,{className:"truncate",item:e}),(0,s.jsx)(j.A,{className:"mt-[2px] text-xxs truncate",labels:e.label_json})]})]})]})]}):(0,s.jsx)("div",{children:"No track Loaded"})})}var g=r(13281);function b({volume:e,setVolume:t,width:r=20,height:l=7,thumbColour:n="#ddd"}){return(0,s.jsx)(g.Ay,{sx:{"& .MuiSlider-rail":{width:"4px",color:"#fff"},"& .MuiSlider-track":{width:"4px",color:"#bbb"},'& input[type="range"]':{WebkitAppearance:"slider-vertical"},"& .MuiSlider-thumb":{borderRadius:"2px",width:r+"px",height:l+"px",color:n}},orientation:"vertical",size:"small",value:e,onChange:e=>t(e.target.value)})}var k=r(73507);r(30738);var y=r(22728),_=r(75426),T=r(45880),C=r(25905),E=r(23531),P=r(33294),S=r(43031);function A({playing:e,playingTrack:t,setIsPlaying:r,...n}){let{minimalMode:i,setMinimalMode:m}=n,[h,j]=(0,l.useState)(0),[w,g]=(0,l.useState)(0),[L,D]=(0,l.useState)(!1);function R(e){0==e||e>0&&e<1/0?g(e):g(void 0)}let $=(0,l.useRef)(1/0),M=(0,l.useRef)(0),F=(0,l.useRef)(0),H=(0,l.useRef)(!1),[I,O]=(0,l.useState)(100),[W,Q]=(0,l.useState)(50),[V,B]=(0,l.useState)(1);function Y(e){Q(e),B(.5+(100-e)/100)}let Z=t?._bpm?Math.floor(V*t?._bpm):"-",[q,z]=(0,l.useState)(!1),G=a().duration(h||0,"seconds"),K=h?h>3600?G.format("hh:mm:ss",{trim:!1}):G.format("mm:ss",{trim:!1}):"--:--",X=a().duration(w||0,"seconds"),J=w?w>3600?X.format("hh:mm:ss",{trim:!1}):X.format("mm:ss",{trim:!1}):"--:--",U=(0,l.useRef)();(0,l.useEffect)(()=>{U.current||(U.current=c().create({container:"#waveform",backend:"MediaElement",hide
1Scrollbar:!0,height:35,waveColor:"rgba(60, 60, 60, 1)",progressColor:T.tD,responsive:!0,dragToSeek:!0}),window.wavesurfer=U);let e=()=>{if(!U.current?.setHeight)return;let e=window.matchMedia("(min-width: 768px)").matches;U.current.setHeight(e?35:30)};e();let t=window.matchMedia("(min-width: 768px)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},[]),(0,l.useEffect)(()=>{n.playingTab===n.tabId||(console.log("Playing in other tab, pausing.",n.playingTab,n.tabId),U.current.pause())},[n.playingTab]),(0,l.useEffect)(()=>{let e=F.current+M.current,r=1e3*(0,S.W)().audio.listen30Seconds;!H.current&&e>r&&(console.log("SHOWING INTEREST..",e,t.id,H.current),(0,y.kO)(_.hr.PLAY_30,_.Qn.TRACK,t.id,{duration:30}),H.current=!0)},[F.current,M.current]),(0,l.useEffect)(()=>(function(){if(!U.current)return void console.log("No wavesurfer yet, Can't establishing Event Handlers",U.current);function e(){return document?.activeElement?.tagName?.toLowerCase()==="body"}function s(r){let s=r.which||r.keyCode;32===s&&(console.log("PRESSED SPACEBAR : focus:",document.activeElement?.tagName),e()&&(r.preventDefault(),U.current.isPlaying()?U.current.pause():(n.setPlayingTab(n.tabId),n.stopOtherTabsAndPlay(t)))),37===s&&e()&&(r.preventDefault(),U.current.skipBackward(5)),39===s&&e()&&(r.preventDefault(),U.current.skipForward(5)),38===s&&e()&&(r.preventDefault(),n.playPrevTrack()),40===s&&e()&&(r.preventDefault(),n.playNextTrack()),81===s&&e()&&(r.preventDefault(),n.togglePlayList())}return U.current.on("waveform-ready",()=>{z(!1)}),U.current.on("ready",()=>{R(U.current.getDuration())}),U.current.on("audioprocess",e=>{let t=U.current.getDuration(),r=U.current?.getCurrentTime();r&&j(r),t&&t!=w&&R(t),M.current=Math.max(Date.now()-$.current,0)}),U.current.on("play",()=>{console.log("ON PLAY WaveSurfer playing",U.current.getDuration()),R(U.current.getDuration()),r(!0),$.current=Date.now(),F.current=F.current+M.current,M.current=0}),U.current.on("pause",()=>{r(!1)}),U.current.on("finish",()=>{n.playNextTrack()}),window.addEventListener("keydown",s),()=>{U.current.unAll(),window.removeEventListener("keydown",s)}})(),[t?.id,n.playList,n.showPlayList]),(0,l.useEffect)(()=>{Y(50),H.current=!1,$.current=1/0,M.current=0,F.current=0},[t?.id]),(0,l.useEffect)(()=>{U.current.setVolume(I/100)},[I]),(0,l.useEffect)(()=>{U.current.setPlaybackRate(V)},[W]);let ee=(0,P.j)(),et=(0,v.f4)(ee.brand);return(0,s.jsx)("div",{className:"",children:(0,s.jsxs)("div",{className:`w-full grid grid-cols-[auto_minmax(0,1fr)_auto] ${i?"grid-rows-1":"grid-rows-[auto_30px]"} md:flex md:flex-row md:items-stretch pb-0.5 md:pb-0`,children:[!i&&t&&(0,s.jsx)("div",{className:"md:hidden col-start-1 row-start-1 flex-shrink-0 p-[4px] pl-1 pb-0",children:(0,s.jsx)("img",{className:"w-[44px] h-[44px]",src:(0,v.Zn)(t.source_image_url)||t.image_display_url,alt:""})}),(0,s.jsx)("div",{className:`md:hidden col-start-1 ${i?"row-start-1":"row-start-2"} flex-shrink-0 p-[4px] pl-1 flex items-center justify-center cursor-pointer`,onClick:()=>m(!i),children:(0,s.jsx)(x.f,{children:i?(0,s.jsx)(d.Xbk,{className:"w-[44px] h-7",preserveAspectRatio:"none"}):(0,s.jsx)(d.j1Q,{className:"w-[44px] h-7",preserveAspectRatio:"none"})})}),(0,s.jsx)("div",{className:"hidden md:block h-[70px] ml-4 mr-4 flex flex-row min-w-0 max-w-[300px] shrink-0 overflow-hidden",children:(0,s.jsx)(N,{playingTrack:t,formattedDuration:K,formattedTotalDuration:J,...n})}),(0,s.jsx)("div",{className:"pr-2 hidden md:block text-white shrink-0",children:(0,s.jsxs)("div",{className:"flex flex-row h-full ",children:[(0,s.jsx)("div",{className:"w-[40px] py-1",children:50!=W?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"text-right",children:(0,s.jsx)(k.A,{title:"Reset",children:(0,s.jsx)("div",{children:(0,s.jsx)(d.omt,{className:" cursor-pointer inline",onClick:()=>void Y(50)})})})}),(0,s.jsx)("div",{children:(0,s.jsxs)("span",{className:"text-xxs",children:[Z,(0,s.jsx)("span",{className:"text-neutral-400",children:"bpm"})]})})]}):""}),(0,s.jsx)("div",{className:"py-3",children:(0,s.jsx)(k.A,{title:"Pitch fader",children:(0,s.jsx)("div",{className:"h-full",children:(0,s.jsx)(b,{volume:W,setVolume:Y})})})})]})}),(0,s.jsx)("div",{className:`md:hidden col-start-2 row-start-1 min-w-0 px-1 pt-1 ${i?"flex items-center pt-0":""}`,children:i?(0,s.jsx)("div",{className:"text-xs truncate font-semibold text-itemtitle",children:t?._full_title}):t?(0,s.jsxs)("div",{className:"text-xs truncate leading-tight",children:[(0,s.jsx)("span",{className:"font-semibold text-sm text-neutral-100",children:(0,s.jsx)(p(),{href:`/track/${t.id}`,children:t._full_title})}),(0,s.jsx)("div",{className:"mt-0.5 truncate",children:(0,s.jsx)(f.A,{item:t})})]}):null}),(0,s.jsxs)("div",{className:`relative col-start-2 row-start-2 md:col-auto md:row-auto h-[30px] md:h-[80px] w-full md:flex-1 md:min-w-[280px] py-0 md:py-[5px] flex-grow flex flex-row place-content-center items-center md:items-stretch overflow-hidden md:overflow-visible -mt-1.5 md:mt-0 ${i?"hidden md:flex":""}`,children:[(0,s.jsx)("div",{id:"waveform",className:"block flex-grow min-w-0 md:scale-y-150 h-[30px] md:h-auto overflow-hidden md:overflow-visible md:mt-5 md:ml-2"}),(0,s.jsxs)("div",{className:"hidden md:grid md:ml-2 shrink-0 whitespace-nowrap text-sm place-content-center",children:[(0,s.jsxs)("div",{className:"h-fit md:text-base poppins font-medium whitespace-nowrap",children:[(0,s.jsx)("span",{className:"text-neutral-200 ",children:K})," ",(0,s.jsxs)("span",{className:"text-xs md:text-sm text-neutral-400",children:["/ ",J]}
1)]}),(0,s.jsxs)("div",{className:"hidden md:block h-fit text-xs text-center ",children:[(0,s.jsx)(C.y,{bpm:t?._bpm})," ",(0,s.jsx)("span",{className:"ml-1",children:t?._scale})]})]})]}),(0,s.jsxs)("div",{className:"relative py-3 px-3 hidden md:flex text-neutral-100 place-items-center shrink-0",children:[(0,s.jsx)("div",{className:"cursor-pointer text-neutral-300",onClick:()=>D(!L),children:0==I?(0,s.jsx)(d.FFb,{className:"text-3xl text-neutral-500"}):I>50?(0,s.jsx)(d.guq,{className:"text-3xl "}):(0,s.jsx)(d.ahh,{className:"text-3xl "})}),L?(0,s.jsx)("div",{className:"absolute bottom-[60px] -left-0.5 bg-black border-neutral-500/80 border-[1px] px-2 py-4 rounded h-[140px]",children:(0,s.jsx)(b,{volume:I,setVolume:O,width:14,height:14,thumbColour:et})}):""]}),(0,s.jsx)("div",{className:"hidden md:flex place-items-center shrink-0",children:(0,s.jsx)(o,{playingTrack:t,waveSurferRef:U,...n})}),(0,s.jsx)("div",{className:"hidden md:flex place-items-center md:mx-3 shrink-0",children:t?(0,s.jsx)(E.O8,{item:t}):null}),(0,s.jsx)("div",{className:"hidden md:flex place-items-center ml-1 mr-3 shrink-0",children:(0,s.jsx)(u,{playingTrack:t,...n})}),(0,s.jsxs)("div",{className:`md:hidden -mt-1 col-start-3 row-start-1 ${i?"":"row-span-2"} flex flex-col justify-center gap-1 w-[120px] shrink-0 `,children:[!i&&(0,s.jsxs)("div",{className:"flex flex-row w-full gap-2 items-center justify-center min-h-[36px]",children:[(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsx)(E.O8,{item:t,className:"w-fit py-1.5"})}),(0,s.jsx)("div",{className:"shrink-0 flex items-center",children:(0,s.jsx)(u,{playingTrack:t,...n})})]}),(0,s.jsx)("div",{className:"flex justify-center w-full -mt-2 ",children:(0,s.jsx)(o,{playingTrack:t,waveSurferRef:U,className:i?"text-3xl mx-0 justify-center":"text-[28px] mx-0 justify-center",...n})})]})]})})}}}]);
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.