!function(){"use strict";function t(t){if(!t)return"Never";const e=t instanceof Date?t:new Date(t);return isNaN(e.getTime())?"Invalid date":e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}window.SunoUtils={escapeHtml:function(t){if(!t)return"";const e=document.createElement("div");return e.textContent=t,e.innerHTML},formatDuration:function(t){if(!t||isNaN(t))return"0:00";const e=Math.floor(t/60),n=Math.floor(t%60);return e>=60?`${Math.floor(e/60)}:${(e%60).toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`:`${e}:${n.toString().padStart(2,"0")}`},formatTime:function(t){return!t||isNaN(t)?"0:00":`${Math.floor(t/60)}:${Math.floor(t%60).toString().padStart(2,"0")}`},formatDate:t,formatHour:function(t){return 0===t?"12am":12===t?"12pm":t<12?`${t}am`:t-12+"pm"},formatRelativeTime:function(e){if(!e)return"";const n=e instanceof Date?e:new Date(e),r=new Date-n,o=Math.floor(r/1e3),a=Math.floor(o/60),i=Math.floor(a/60),u=Math.floor(i/24);return u>30?t(n):u>0?`${u} day${u>1?"s":""} ago`:i>0?`${i} hour${i>1?"s":""} ago`:a>0?`${a} min${a>1?"s":""} ago`:"Just now"},truncateText:function(t,e=50){return!t||t.length<=e?t||"":t.slice(0,e-3)+"..."},debounce:function(t,e=300){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{clearTimeout(n),t(...r)},e)}},deepClone:function t(e){return null===e||"object"!=typeof e?e:Array.isArray(e)?e.map(t):Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)]))}}}();