1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[453],{6654:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return s}});let r=l(12115);function s(e,t){let l=(0,r.useRef)(null),s=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=l.current;e&&(l.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(l.current=a(e,r)),t&&(s.current=a(t,r))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let l=e(t);return"function"==typeof l?l:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9992:(e,t,l)=>{Promise.resolve().then(l.bind(l,23270))},23270:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>n});var r=l(95155),s=l(12115),a=l(66766),i=l(26086);let n=()=>{var e,t;let[l,n]=(0,s.useState)(null),[o,c]=(0,s.useState)([]),[u,d]=(0,s.use
1State)(null),[f,m]=(0,s.useState)(3),[h,x]=(0,s.useState)(!1),g=(0,s.useRef)(null),p=(0,s.useRef)(null),[w,j]=(0,s.useState)(!1),y=e=>e.replace(/^0/,"");(0,s.useEffect)(()=>{let e=async()=>{try{let e=await fetch("/api/now-playing");if(!e.ok)throw Error("Failed to fetch Now Playing data");let t=await e.json();t.Title&&t.Artist?(n(t),x(!0),t.Title!==u&&(d(t.Title),v(t.Title))):(n(null),x(!0))}catch(e){console.error("Error fetching Now Playing data:",e),n(null),x(!0)}};e();let t=setInterval(e,15e3);return()=>clearInterval(t)},[u]);let v=async e=>{try{let t=await fetch("/api/track-history");if(!t.ok)throw Error("Failed to fetch track history");let l=await t.json();if(Array.isArray(l)){let t=[...l].reverse().filter(t=>t.Title!==e);c(t)}else console.error("Track history data is not an array:",l)}catch(e){console.error("Error fetching track history:",e)}};if((0,s.useEffect)(()=>{v()},[]),!h)return null;let b={backgroundColor:(null===(e=i.RI)||void 0===e?void 0:e.color)||"#ffffff",backgroundImage:(null===(t=i.RI)||void 0===t?void 0:t.image)?"url(".concat(i.RI.image,")"):"none",backgroundPosition:"center"};return(0,r.jsx)("div",{className:"flex flex-col items-center justify-center min-h-screen p-4",style:b,children:(0,r.jsxs)("div",{className:"bg-white bg-opacity-90 backdrop-blur-sm shadow-xl rounded-xl px-5 py-6 md:p-6 w-full max-w-3xl flex flex-col items-center",children:[(0,r.jsxs)("div",{className:"flex flex-col md:flex-row items-center justify-center gap-6 mb-6 w-full max-w-lg",children:[(0,r.jsx)(a.default,{src:(null==l?void 0:l.iTunesArtwork_100)||i.qP||"/images/default-track-album.jpg",alt:"Album Art",width:200,height:200,className:"rounded-lg shadow-md"}),(0,r.jsxs)("div",{className:"flex-grow flex flex-col items-center justify-center",children:[i.l3&&(0,r.jsx)("div",{className:"w-[100px] h-[100px] flex items-center justify-center mb-2",children:(0,r.jsx)(a.default,{src:i.l3,alt:"Player Logo",width:50,height:50,className:"object-contain"})}),(0,r.jsxs)("div",{className:"w-full max-w-xs flex flex-col items-center space-y-2",children:[(0,r.jsx)("audio",{ref:p,src:"https://rhema-radio.streamguys1.com/rhema-lifefm.aac",preload:"metadata"}),(0,r.jsx)("button",{onClick:()=>{p.current&&(w?p.current.pause():p.current.play(),j(!w))},className:"p-4 rounded-full shadow-md hover:scale-110 transition-transform duration-150 cursor-pointer",style:{backgroundColor:i.eq},children:w?(0,r.jsxs)("div",{className:"relative flex items-center justify-center",children:[(0,r.jsx)("span",{className:"absolute inline-flex h-12 w-12 rounded-full bg-white",style:{animation:"softPulse 2s ease-in-out infinite"}}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 text-white relative z-10",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})})]}):(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 text-white",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M8 5v14l11-7z"})})})]})]})]}),(0,r.jsxs)("div",{className:"text-center mb-6",children:[(0,r.jsx)("h2",{className:"text-xl font-bold",style:{color:i.eq},children:l?l.Title:"No song playing"}),(0,r.jsx)("p",{className:"text-sm",style:{color:i.oD},children:l?l.Artist:"Tracks on the way!"})]}),(0,r.jsxs)("div",{className:"w-full max-w-lg",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Recently Played:"}),(0,r.jsx)("div",{ref:g,className:"p-2 rounded-lg overflow-y-scroll pr-4 scrollbar-hide",style:{height:"250px"},children:(0,r.jsx)("ul",{className:"space-y-2",children:o.slice(0,f).map((e,t)=>(0,r.jsxs)("li",{className:"flex items-center justify-between space-x-4 p-2 bg-gray-200 rounded-lg",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsx)(a.default,{src:e.iTunesArtwork_100||i.qP||"/images/default-track-album.jpg",alt:e.Title,width:60,height:60,className:"rounded-md"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm md:text-base font-semibold",children:e.Title}),(0,r.jsx)("p",{className:"text-sm text-gray-600",children:e.Artist})]})]}),(0,r.jsxs)("div",{className:"flex flex-col items-end",children:[(0,r.jsx)("p",{className:"text-xs",style:{color:i.eq},children:"Played"}),(0,r.jsx)("p",{className:"text-sm text-gray-500",children:y(e.StartTimeLocal_Formatted)})]})]},t))})}),f<o.length&&(0,r.jsx)("div",{className:"flex justify-center mt-4",children:(0,r.jsx)("button",{onClick:()=>{m(e=>e+2),setTimeout(()=>{g.current&&g.current.scrollTo({top:g.current.scrollHeight,behavior:"smooth"})},100)},style:{backgroundColor:i.eq},className:"text-white text-2xl p-4 flex items-center justify-center rounded-full hover:opacity-80 hover:scale-110 active:scale-100 transition-all duration-200 shadow-lg w-14 h-14 cursor-pointer","aria-label":"Show more previous tracks",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 48 24",strokeWidth:6,stroke:"currentColor",className:"w-12 h-8",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M42 6L24 18 6 6"})})})})]})]})})}},26086:e=>{"use strict";e.exports=JSON.parse('{"l3":"/images/LifeFMLogo_med-Red.png","eq":"#bf1026","oD":"#3b3c3e","qP":"/images/default-track-album.jpg","RI":{"image":"/images/Lifefm_White.png","color":"#f1f1f1"}}')},66766:(e,t,l)=>{"use strict";l.d(t,{default:()=>s.a});var r=l(71469),s=l.n(r)},71469:(e,t,l)=>{"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var l in t)Object.defineProperty(e,l,{enumerable:!0,get:t[l]})}(t,{default:function(){return o},getImageProps:function(){return n}});let r=l(88229),s=l(38883),a=l(33063),i=r._(l(51193));function n(e){let{props:t}=(0,s.getImgProps)(e,{defaultLoader:i.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,l]of Object.entries(t))void 0===l&&delete t[e];return{props:t}}let o=a.Image}},e=>{var t=t=>e(e.s=t);e.O(0,[3063,8441,1684,7358],()=>t(9992)),_N_E=e.O()}]);
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.