PageSourceSearch

https://songer.co/build/assets/song-details-BeCgFTCY.js

js songer.co collected 2026-10-03 22:10:30 UTC 62,922 bytes, 3 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B2FvSUIR.js","assets/app-CuPgLqcu.js","assets/app-qG4H29Hv.css","assets/use-user-capabilities-DbDw5CED.js","assets/queries-Cp-4ZWCY.js","assets/useQuery-0pAT7wXh.js","assets/toast-notifications-qCIbiVoz.js","assets/use-waveform-audio-D_i6razi.js","assets/volume-x-TTBOFKsK.js","assets/index-hKORkSIz.js","assets/iconBase-C5nPOaFB.js","assets/format-time-D7Oq_XL9.js","assets/circle-alert-BlhGbg3l.js"])))=>i.map(i=>d[i]);
2import{j as e,u as H,J as Te,r as m,f as w,h as F,e as q,b4 as se,M as te,b5 as ne,B as d,A as gs,o as L,ct as hs,S as U,a7 as B,aa as ce,ai as Z,i as Le,ar as fs,as as js,au as _s,a5 as J,cz as Me,cA as Ee,cB as Pe,T as X,a as de,ap as me,cX as xe,D as _e,d as M,_ as Oe,cy as re,ae as vs,p as ue,z as ve,E as be,F as Ce,H as ye,V as Ve,g as bs,av as Cs}from"./app-CuPgLqcu.js";import{g as ys,a as v,n as W,b as oe,u as Fe,T as Ns,A as Ne,E as ks,S as ws,c as Ae,d as Ss,G as zs,e as Ts}from"./slider-BZ4Hr69s.js";import{C as Ls,V as pe,u as Be,S as ke,L as De,a as Re,b as Ie,c as Ue,d as He,e as Ms,f as Ge,g as $e,h as Es,i as Ze,j as Ps,s as Os,F as we,D as Vs}from"./clipboard-D2JB5YjH.js";import{u as Fs}from"./use-paywall-bu2jSy9b.js";import{n as As,D as Bs,E as Ds,F as Rs}from"./queries-Cp-4ZWCY.js";import{a as Is,b as qe}from"./volume-store-CUx00Mq2.js";import{F as Us,h as Hs}from"./free-song-creation-limit-C3u8MQH0.js";import{R as Gs}from"./refresh-cw-BMhqxr5C.js";import{f as $s}from"./index-CKnDe9t9.js";import"./switch-ZLSDSKB5.js";import{A as Zs,u as ie,P as qs,S as Se,a as Ws}from"./archive-song-modal-CHcw06Mc.js";import{I as Ks}from"./input-CrFBzPX3.js";import{u as Xs}from"./use-intercom-store-rHm7AxbL.js";import{s as Q}from"./toast-notifications-qCIbiVoz.js";import{I as Js}from"./image-with-fetch-priority-rRNsjdpe.js";import{C as Qs}from"./check-BlSdAAqI.js";import{L as Ys}from"./lock-unlocked-icon-Btzlmr5V.js";import{a as et}from"./index-hKORkSIz.js";import{f as Y}from"./format-time-D7Oq_XL9.js";import{P as We}from"./pause-icon-Hzu084YU.js";import{P as Ke}from"./play-sm-icon-DK9-z_AE.js";import{a as Xe,V as Je}from"./volume-x-TTBOFKsK.js";import{A as st}from"./arrow-left-Dv1MyEx3.js";import{G as Qe}from"./generation-error-fallback-Btg81HNZ.js";import"./chevron-right-C9OabR3p.js";import"./use-waveform-audio-D_i6razi.js";import"./useQuery-0pAT7wXh.js";import"./use-mobile-C8WWiBSz.js";import"./circle-help-Bu0FBH-H.js";import"./use-user-capabilities-DbDw5CED.js";import"./iconBase-C5nPOaFB.js";import"./stylesList-41WGj4s4.js";import"./use-has-max-features-LVhwHZFx.js";import"./format-BTK4_l6R.js";import"./constructFrom-Ye-8qOwN.js";import"./differenceInCalendarDays-5RM1Y69m.js";import"./getTimezoneOffsetInMilliseconds-ryt7B_sa.js";import"./index-Bo_LXv4J.js";import"./use-funnel-settings-DN_5ME03.js";import"./use-funnel-version-BTz4_777.js";import"./circle-alert-BlhGbg3l.js";const le=t=>e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("path",{d:"M2.66536 5.33106C2.55603 5.32824 2.47663 5.32191 2.40524 5.30771C1.87632 5.2025 1.46286 4.78904 1.35765 4.26012C1.33203 4.13132 1.33203 3.97644 1.33203 3.66667C1.33203 3.3569 1.33203 3.20201 1.35765 3.07321C1.46286 2.54429 1.87632 2.13083 2.40524 2.02562C2.53404 2 2.68893 2 2.9987 2H12.9987C13.3085 2 13.4634 2 13.5922 2.02562C14.1211 2.13083 14.5345 2.54429 14.6397 3.07321C14.6654 3.20201 14.6654 3.3569 14.6654 3.66667C14.6654 3.97644 14.6654 4.13132 14.6397 4.26012C14.5345 4.78904 14.1211 5.2025 13.5922 5.30771C13.5208 5.32191 13.4414 5.32824 13.332 5.33106M6.66536 8.66667H9.33203M2.66536 5.33333H13.332V10.8C13.332 11.9201 13.332 12.4802 13.114 12.908C12.9223 13.2843 12.6163 13.5903 12.24 13.782C11.8122 14 11.2521 14 10.132 14H5.86536C4.74526 14 4.18521 14 3.75738 13.782C3.38106 13.5903 3.0751 13.2843 2.88335 12.908C2.66536 12.4802 2.66536 11.9201 2.66536 10.8V5.33333Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ye=t=>e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e.jsxs("g",{clipPath:"url(#clip0_16396_3220)",children:[e.jsx("path",{d:"M15.6983 10.8037C15.9557 10.8963 16.2321 10.9501 16.5215 10.9501C16.7932 10.9501 17.0538 10.9034 17.2979 10.8212C17.2977 11.3621 17.2964 11.8171 17.2656 12.1933C17.2309 12.6178 17.1564 13.0126 16.9668 13.3847C16.6744 13.9586 16.2077 14.4253 15.6338 14.7177C15.2617 14.9073 14.8669 14.9818 14.4424 15.0165C14.0272 15.0505 13.5161 15.0497 12.8994 15.0497H9.4297L10.3145 15.9345C10.6269 16.2469 10.6269 16.753 
210.3145 17.0654C10.0021 17.3777 9.49602 17.3778 9.18361 17.0654L6.93361 14.8154C6.6212 14.503 6.62122 13.9969 6.93361 13.6845L9.18361 11.4345C9.49603 11.1221 10.002 11.1221 10.3145 11.4345C10.6269 11.7469 10.6269 12.253 10.3145 12.5654L9.4297 13.4501H12.8994C13.5424 13.4501 13.9766 13.4492 14.3115 13.4218C14.6371 13.3952 14.7982 13.3475 14.9072 13.2919C15.1801 13.1529 15.402 12.931 15.541 12.6581C15.5966 12.5491 15.6443 12.388 15.6709 12.0624C15.696 11.7548 15.698 11.3635 15.6983 10.8037ZM7.68361 0.93451C7.99603 0.62209 8.50205 0.62209 8.81447 0.93451L11.0645 3.18451C11.3769 3.49693 11.3769 4.00296 11.0645 4.31537L8.81447 6.56537C8.50205 6.87774 7.99602 6.87775 7.68361 6.56537C7.3712 6.25296 7.37122 5.74693 7.68361 5.43451L8.56837 4.54974H5.09865C4.4557 4.54974 4.02151 4.55071 3.68654 4.57806C3.36091 4.60467 3.19991 4.65239 3.09083 4.70795C2.81801 4.84696 2.59605 5.06891 2.45704 5.34174C2.4015 5.45081 2.35376 5.61185 2.32716 5.93744C2.29981 6.2724 2.29884 6.70663 2.29884 7.34955V11.6249C2.29884 11.9986 2.30086 12.1083 2.31154 12.1894C2.39729 12.8399 2.9091 13.3517 3.55958 13.4374C3.6407 13.4481 3.7503 13.4501 4.12404 13.4501C4.56586 13.4501 4.92384 13.8081 4.92384 14.2499C4.92381 14.6917 4.56584 15.0497 4.12404 15.0497C3.80116 15.0497 3.5619 15.0512 3.3506 15.0234C1.9823 14.8431 0.905941 13.7667 0.725599 12.3984C0.697782 12.1871 0.699232 11.9478 0.699232 11.6249V7.34955C0.699231 6.7329 0.698514 6.22181 0.732435 5.80658C0.767144 5.3821 0.84169 4.98726 1.03126 4.61517C1.32367 4.04129 1.79039 3.57458 2.36427 3.28217C2.73636 3.09258 3.13118 3.01805 3.55568 2.98334C3.97091 2.94941 4.48197 2.95013 5.09865 2.95013H8.56837L7.68361 2.06537C7.3712 1.75296 7.37122 1.24693 7.68361 0.93451Z",fill:"#FCB600"}),e.jsx("path",{d:"M16.4515 1.50021C17.0038 1.50021 17.4515 1.94793 17.4515 2.50021V8.51598C17.4515 9.0319 17.0333 9.45013 16.5174 9.45013C16.0014 9.45013 15.5832 9.0319 15.5832 8.51599V3.49973H15.5228H14.8983C14.3461 3.49973 13.8984 3.05207 13.8984 2.49986C13.8984 1.94755 14.3463 1.49985 14.8986 1.5L15.6739 1.50021H16.4515Z",fill:"#FCB600"})]}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_16396_3220",children:e.jsx("rect",{width:"18",height:"18",fill:"white"})})})]}),es=m.createContext(null),tt=({children:t,song:s,mobileBreakpoint:n})=>{var x,u;const i=(u=(x=H().props)==null?void 0:x.auth)==null?void 0:u.user,r="user_id"in s&&s.user_id===(i==null?void 0:i.id),l=!!(s&&"owner_id"in s&&s.owner_id===(i==null?void 0:i.id)),a=Te(n),c=m.useMemo(()=>({isAuthor:r,isOwner:l,isMobile:a}),[l,r,a]);return e.jsx(es.Provider,{value:c,children:t})},T=()=>{const t=m.useContext(es);if(!t)throw new Error("useSongPlayerState must be used within a SongPlayerStateContextProvider");return t},nt=t=>t?t.split(`
3`).map((s,n)=>{const o=s.trim();return o.startsWith("[")&&o.endsWith("]")?e.jsx("div",{className:"mb-1 font-display text-sm font-bold uppercase leading-none tracking-[1px] text-text-secondary lg:pe-1.5",children:o},n):o?e.jsx("div",{className:"text-md text-text-primary lg:pe-1.5 lg:text-lg",children:s},n):e.jsx("div",{className:"h-8"},n)}):null,ot=({lyrics:t,title:s,variation:n,language:o})=>{const{t:i}=w(),{isAuthor:r}=T(),l=ys(o);return e.jsx("div",{dir:t?l:void 0,id:"lyrics",className:"h-full rounded-2xl px-5 lg:flex lg:flex-1 lg:overflow-hidden lg:border lg:border-border-primary lg:bg-background-secondary lg:pe-1 lg:ps-6 lg:shadow-song-module-inner",children:e.jsxs("div",{className:"song-details-scrollbar-lg h-auto w-full py-6 lg:overflow-y-auto",children:[e.jsx("h2",{className:"mb-2 font-display text-sm font-bold uppercase leading-none tracking-[1px] text-text-secondary lg:hidden",children:"Lyrics"}),e.jsx("span",{className:"line-clamp-1 block font-display text-xl font-medium leading-7 tracking-[1px] text-text-primary lg:pe-1.5",children:s}),r&&e.jsxs("span",{className:"block text-sm text-text-tertiary",children:["Version ",n]}),e.jsx("div",{className:"mt-8",children:t?nt(t):e.jsx("span",{className:"text-sm text-text-quaternary lg:text-md",children:i("details_no_lyrics")})})]})})},ss=()=>{const{t}=w(),{song:s}=v();return e.jsxs("div",{id:"prompt",className:"space-y-2 lg:space-y-2.5 lg:border-b lg:border-border-primary lg:px-6 lg:pb-5 lg:pt-6",children:[e.jsx("h2",{className:"font-display text-sm font-bold uppercase leading-none tracking-[1px] text-text-secondary",children:t("prompt")}),s!=null&&s.prompt?e.jsx("p",{className:"text-text-primary",children:s==null?void 0:s.prompt}):e.jsx("p",{className:"text-text-tertiary",children:t("details_no_prompt")})]})},ts=()=>{const{t}=w(),{song:s}=v(),n=(s==null?void 0:s.extended_from)??(s==null?void 0:s.trimmed_from)??null,o=s!=null&&s.extended_from?t("details_extended"):t("details_trimmed");return n?e.jsxs("div",{className:"border-b border-border-primary py-6 lg:px-6 lg:pb-5 lg:pt-6",children:[e.jsx("h2",{className:"font-display text-sm font-bold mb-2 uppercase tracking-[1px] leading-none text-text-secondary",children:t("details_source")}),e.jsxs("div",{className:"mb-px flex items-center gap-1",children:[e.jsx("span",{className:"text-xs leading-4 text-text-secondary",children:o}),e.jsx(Ls,{className:"size-4 text-text-secondary"})]}),e.jsxs("button",{onClick:()=>{F.visit(`/song/${n.id}`)},className:"flex w-full gap-3 bg-background-tertiary p-2 text-start transition-all duration-200 hover:opacity-80",children:[e.jsx("div",{className:"size-12 flex-none overflow-hidden rounded-md bg-background-quaternary",children:e.jsx("img",{src:n.cover_url??"/images/default-cover.jpg",alt:n.title??"",className:"h-12 w-full object-cover"})}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-1 min-w-0 hyphens-auto break-words text-md text-text-primary",children:n.title}),e.jsx("div",{className:"text-xs capitalize leading-4 text-text-tertiary",children:W(n.styles)||"-"})]})]})]}):null},it=t=>t?t.split(",").map(s=>
3s.trim()).filter(Boolean):[],ns=()=>{var A,G,K;const{t}=w(),{song:s}=v(),o=(G=(A=H().props)==null?void 0:A.auth)==null?void 0:G.user,i=q(),r=se(),l=Fs(),a=te(),c=ne(),x=As(),[u,g]=m.useState(!1),{setGenerationMode:h,setPrompt:p,setGenres:f,setLyrics:_,setLanguage:b,setVocalistGender:y}=Is(),N=((s==null?void 0:s.prompt)??s.prompt??"").trim(),C=s.lyrics??"",k=(K=s==null?void 0:s.styles)!=null&&K.length?s.styles:it(s.genre),j=(s==null?void 0:s.language)??"",P=s==null?void 0:s.vocalist_gender,S=s==null?void 0:s.mode,z=()=>{if(L("ui:song_reuse_request:clicked",{song_id:s.id,mode:S,component:"song_metadata_controls"}),!o){i.onOpenRegister();return}h(hs[S||"auto"]),_(C),p(N),f(W(k).split(", ")),y(P),j&&b(j);try{F.visit("/create")}catch(V){console.error("Navigation error:",V),U(t("something_went_wrong"))}};function O(){c?r.onOpen():a.onOpen()}function D(){if(L("ui:song_regenerate:clicked",{song_id:s.id,mode:S,component:"song_metadata_controls"}),!o){i.onOpenRegister();return}if(S!=="auto"&&S!=="custom"&&S!=="instrumental"&&S!=="wizard")return;const V=R(S);V&&x.mutate(V,{onSuccess:E=>{if(!(E!=null&&E.gen_id)){console.error("No generation ID received");return}l.close(),r.onClose();try{F.visit(`/songs/${E.gen_id}`)}catch(I){console.error("Navigation error:",I),U(t("something_went_wrong"))}},onError:E=>{var I;Hs(E,()=>{g(!0)})||(o&&((I=E==null?void 0:E.response)==null?void 0:I.status)===403&&(c?r.onOpen():a.onOpen()),U(t("something_went_wrong")))}})}function R(V){const E=(s==null?void 0:s.styles)||[],I=(s==null?void 0:s.language)||"",fe=(s==null?void 0:s.prompt)??"",ps=(s==null?void 0:s.lyrics)??"",je=s==null?void 0:s.vocalist_gender;if(V==="auto")return{gen_mode:"auto",prompt:fe,styles:E,language:I,vocalist_gender:je};if(V==="custom"||V==="wizard")return{gen_mode:"custom",lyrics:ps,styles:E,vocalist_gender:je};if(V==="instrumental")return{gen_mode:"instrumental",prompt:fe,styles:E}}return(s==null?void 0:s.extended_from)??(s==null?void 0:s.trimmed_from)??null?null:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2 lg:mt-auto lg:gap-1 lg:border-t lg:border-border-primary lg:px-2.5 lg:py-3 xl:gap-2 xl:p-4",children:[(s==null?void 0:s.mode)!=="wizard"&&e.jsxs(d,{variant:"secondary",className:"px-3 py-2",onClick:z,disabled:x.isPending,children:[e.jsx(Gs,{className:"size-4 min-w-4"}),e.jsx("span",{className:"!mb-0 font-text font-medium",children:t("reuse_request")})]}),e.jsxs(d,{variant:"secondary",className:"px-3 py-2",onClick:D,disabled:x.isPending,isLoading:x.isPending,children:[e.jsx(gs,{className:"size-4 min-w-4"}),e.jsx("span",{className:"!mb-0 font-text font-medium",children:t("details_regenerate")})]})]}),e.jsx(Us,{open:u,onOpenChange:g,onCreateUnlimitedSongs:O})]})},rt=({track:t})=>{const s=B(),n=t.type==="extension"?"Extension":"Trimmed Clip";return e.jsxs(ce,{href:s("song",{song:t.id}),className:"flex items-center gap-3 py-2 transition-all duration-200 hover:no-underline hover:opacity-80 lg:gap-2",children:[e.jsx("div",{className:"size-12 flex-none overflow-hidden rounded-md bg-background-quaternary lg:size-8",children:e.jsx("img",{src:t.cover_url??"/images/default-cover.jpg",alt:t.title??"",className:"size-full object-cover"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-x-1 lg:mb-0.5",children:[e.jsx("span",{className:"text-sm font-medium leading-5 text-text-primary",children:t.title}),t.variation&&e.jsx(pe,{label:n,className:"h-5 w-fit",variation:t.variation})]}),e.jsx("div",{className:"flex gap-0.5 text-xs leading-4 text-text-tertiary lg:text-text-secondary",children:e.jsxs("div",{children:[e.jsx("span",{className:"hidden lg:inline",children:t.created_at?$s(t.created_at,"UTC","dd MMMM yyyy, h:mm a"):""}),e.jsx("span",{className:"mx-1.5 mb-[2.5px] hidden size-1 rounded-full bg-[#C6C6C6] lg:inline-block"}),e.jsx("span",{children:(W(t.styles)||"-").replace(/^./,o=>o.toUpperCase())})]})})]})]})},ee=({isExtended:t,tracks:s})=>{const{t:n}=w();return e.jsxs("div",{className:"border-b border-border-primary py-6 lg:px-6 lg:pb-5",children:[e.jsx("h3",{className:"mb-1 font-display text-sm font-bold uppercase leading-none tracking-[1px] text-text-secondary md:mb-2 lg:mb-1",children:n(t?"extended_tracks":"trimmed_tracks")}),e.jsx("div",{className:"lg:space-y-1",children:s.map(o=>e.jsx(rt,{track:{...o,type:t?"extension":"trim",variation:t?o.variation:1}},o.id))})]})},at=()=>{const{isMobile:t,isAuthor:s}=T(),{song:n}=v(),{is_unlocked:o}=n,i=(n==null?void 0:n.extended_tracks)??[],r=(n==null?void 0:n.trimmed_tracks)??[];return t||!s?null:e.jsxs("div",{className:"flex flex-col rounded-2xl border border-border-primary bg-background-secondary shadow-song-module-inner lg:w-[20rem] lg:overflow-hidden xl:w-[22.5rem]",children:[e.jsxs("div",{className:"song-details-scrollbar-lg flex-1 overflow-y-auto",children:[o&&e.jsx(ts,{}),e.jsx(ss,{}),o&&i.length>0&&e.jsx(ee,{isExtended:!0,tracks:i}),o&&r.length>0&&e.jsx(ee,{isExtended:!1,tracks:r})]}),e.jsx(ns,{})]})},lt=()=>{const{isMobile:t,isAuthor:s}=T(),{song:n}=v(),{is_unlocked:o}=n,i=(n==null?void 0:n.extended_tracks)??[],r=(n==null?void 0:n.trimmed_tracks)??[];return!t||!s?null:e.jsxs("div",{className:"px-5 pt-4",children:[e.jsxs("div",{className:"space-y-4 border-b border-border-primary pb-6",children:[e.jsx(ss,{}),e.jsx(ns,{})]}),o&&e.jsx(ts,{}),o&&i.length>0&&e.jsx(ee,{isExtended:!0,tracks:i}),o&&r.length>0&&e.jsx(ee,{isExtended:!1,tracks:r})]})},os=()=>{const{t}=w(),{song:s}=v(),{openedModal:n,setOpenedModal:o}=oe(),i=Bs(),r=()=>{L("ui:song_archive:confirmed",{song_id:s.id,component:"song_description_action"}),i.mutate(s.id,{onSuccess:x=>
3{if(x.status!=="success"){Q(t("error_archiving_song"),"");return}Le(t("archive_success_message")),o("none"),F.reload()},onError:()=>{Q(t("error_archiving_song"),"")}})},l=`${s.title} (v${s.variation})`,a=()=>{L("ui:song_archive:clicked",{song_id:s.id,component:"song_description_action"}),o("archive_song")},c=()=>{L("ui:song_archive:cancelled",{song_id:s.id,component:"song_description_action"}),o("none")};return e.jsxs(e.Fragment,{children:[e.jsxs(Z,{disabled:i.isPending,loading:i.isPending,onClick:a,className:"hidden lg:flex",children:[e.jsx(le,{}),e.jsx("span",{children:t("archive")})]}),e.jsxs(d,{variant:"ghost",size:"auto",className:"w-10 hover:bg-transparent disabled:opacity-50 lg:hidden",contentClassName:"flex-col gap-y-1 text-text-secondary",disabled:i.isPending,isLoading:i.isPending,onClick:a,children:[e.jsx(le,{className:"size-5"}),e.jsx("span",{className:"text-2xs font-medium text-text-disabled",children:t("archive")})]}),e.jsx(Zs,{isLoading:i.isPending,isOpen:n==="archive_song",onClose:c,songName:l,onSubmit:r})]})},is=()=>{const{t}=w(),s=B(),{isMobile:n}=T(),{song:o}=v(),i=Be({customUrl:s("song",{song:(o==null?void 0:o.id)??""}),customContent:t("i_just_created_this_song"),mediaUrl:(o==null?void 0:o.cover_url)??"",trackingProperties:{song_id:o.id,component:"song_description_share_action"}}),r=async()=>{L("ui:share:platform_clicked",{platform:"copy_link",song_id:o.id,component:"song_description_share_action"}),await Ze(s("song",{song:(o==null?void 0:o.id)??""}))?J.success(t("link_copied_to_clipboard"),{duration:3e3,position:"bottom-center"}):J.error(t("could_not_copy_to_clipboard"),{duration:3e3,position:"bottom-center"})};return e.jsxs(fs,{children:[e.jsx(js,{asChild:!0,children:n?e.jsxs(d,{variant:"ghost",size:"auto",className:"w-10 hover:bg-transparent disabled:opacity-50 lg:hidden",contentClassName:"flex-col gap-y-1 text-text-secondary ",onClick:()=>L("ui:share:clicked",{song_id:o.id,component:"song_description_share_action"}),children:[e.jsx(ke,{className:"size-5"}),e.jsx("span",{className:"text-2xs font-medium text-text-disabled",children:t("share")})]}):e.jsxs(Z,{className:"hidden lg:flex",onClick:()=>L("ui:share:clicked",{song_id:o.id,component:"song_description_share_action"}),children:[e.jsx(ke,{}),e.jsx("span",{children:t("share")})]})}),e.jsx(_s,{align:n?"end":"center",sideOffset:n?4:12,className:"share-popover-content min-w-44 rounded-[1.25rem] border-modal-outline-stroke bg-share-popover-gradient p-1.5",children:e.jsxs("div",{className:"share-popover-content-inner flex flex-col items-stretch gap-y-1 rounded-2xl border border-modal-inner-stroke bg-background-primary p-2",children:[e.jsxs(d,{variant:"ghost",size:"auto",className:"justify-start gap-x-2 rounded-lg p-2",onClick:r,children:[e.jsx(De,{className:"size-5 flex-none"}),e.jsx("span",{className:"pb-0.5 text-sm font-medium leading-none tracking-[0.05rem] text-secondary-foreground",children:t("copy_link")})]}),e.jsxs(d,{variant:"ghost",size:"auto",className:"justify-start gap-x-2 rounded-lg p-2",onClick:i("facebook"),children:[e.jsx(Re,{className:"size-5 flex-none"}),e.jsx("span",{className:"pb-0.5 text-sm font-medium leading-none tracking-[0.05rem] text-secondary-foreground",children:"Facebook"})]}),e.jsxs(d,{variant:"ghost",size:"auto",className:"justify-start gap-x-2 rounded-lg p-2",onClick:i("whatsapp"),children:[e.jsx(Ie,{className:"size-5 flex-none"}),e.jsx("span",{className:"pb-0.5 text-sm font-medium leading-none tracking-[0.05rem] text-secondary-foreground",children:"WhatsApp"})]}),e.jsxs(d,{variant:"ghost",size:"auto",className:"justify-start gap-x-2 rounded-lg p-2",onClick:i("imessage"),children:[e.jsx(Ue,{className:"size-5 flex-none"}),e.jsx("span",{className:"pb-0.5 text-sm font-medium leading-none tracking-[0.05rem] text-secondary-foreground",children:"iMessage"})]}),e.jsxs(d,{variant:"ghost",size:"auto",className:"justify-start gap-x-2 rounded-lg p-2",onClick:i("telegram"),children:[e.jsx(He,{className:"size-5 flex-none"}),e.jsx("span",{className:"pb-0.5 text-sm font-medium leading-none tracking-[0.05rem] text-secondary-foreground",children:"Telegram"})]}),e.jsxs(d,{variant:"ghost",size:"auto",className:"justify-start gap-x-2 rounded-lg p-2",onClick:i("viber"),children:[e.jsx(Ms,{className:"size-5 flex-none"}),e.jsx("span",{className:"pb-0.5 text-sm font-medium leading-none tracking-[0.05rem] text-secondary-foreground",children:"Viber"})]}),e.jsxs(d,{variant:"ghost",size:"auto",className:"justify-start gap-x-2 rounded-lg p-2",onClick:i("x"),children:[e.jsx(Ge,{className:"size-5 flex-none"}),e.jsx("span",{className:"pb-0.5 text-sm font-medium leading-none tracking-[0.05rem] text-secondary-foreground",children:"X"})]}),e.jsxs(d,{variant:"ghost",size:"auto",className:"justify-start gap-x-2 rounded-lg p-2",onClick:i("pinterest"),children:[e.jsx($e,{className:"size-5 flex-none"}),e.jsx("span",{className:"pb-0.5 text-sm font-medium leading-none tracking-[0.05rem] text-secondary-foreground",children:"Pinterest"})]}),e.jsxs(d,{variant:"ghost",size:"auto",className:"justify-start gap-x-2 rounded-lg p-2",onClick:i("email"),children:[e.jsx(Es,{className:"size-5 flex-none"}),e.jsx("span",{className:"pb-0.5 text-sm font-medium leading-none tracking-[0.05rem] text-secondary-foreground",children:"Email"})]})]})})]})},ge=({isOpen:t,onClose:s,songName:n,onSubmit:o,title:i})=>{const{t:r}=w();return e.jsx(Me,{open:t,onOpenChange:s,children:e.jsx(Ee,{hideCloseButton:!0,"aria-describedby":void 0,size:"sm",children:e.jsxs("div",{className:"relative flex h-full w-full flex-col gap-10 overflow-hidden rounded-none border border-modal-inner-stroke bg-modal pt-7 sm:rou
3nded-3xl sm:pt-10",children:[e.jsx(Pe,{className:"px-8.5 text-start sm:text-center",children:i}),e.jsxs("p",{className:"space-y-6 px-8.5 font-inter leading-6 sm:space-y-4 sm:px-10 [&>span]:block",children:[e.jsx("span",{children:r("trim_locked_description_1")}),e.jsx("span",{children:e.jsx(X,{i18nKey:"trim_locked_description_2",values:{songName:n},components:{strong:e.jsx("span",{className:"font-bold"})}})})]}),e.jsxs("div",{className:"mt-auto flex items-center justify-center gap-4 rounded-none bg-modal-secondary px-8.5 py-5 sm:rounded-t-3xl sm:px-10 sm:py-7",children:[e.jsx(d,{onClick:s,variant:"outline",children:r("close")}),e.jsx(d,{onClick:o,variant:"brand",className:"px-3",children:r("trim_locked_submit")})]})]})})})},he=({isOpen:t,onClose:s,onSubmit:n,title:o})=>{const{t:i}=w();return e.jsx(Me,{open:t,onOpenChange:s,children:e.jsx(Ee,{hideCloseButton:!0,"aria-describedby":void 0,size:"sm",children:e.jsxs("div",{className:"relative flex h-full w-full flex-col gap-10 overflow-hidden rounded-none border border-modal-inner-stroke bg-modal pt-7 sm:rounded-3xl sm:pt-10",children:[e.jsx(Pe,{className:"px-8.5 text-start sm:text-center",children:o}),e.jsx("p",{className:"space-y-6 px-8.5 font-inter leading-6 sm:space-y-4 sm:px-10 [&>span]:block",children:Array.from({length:3},(r,l)=>e.jsx("span",{children:i(`trim_nocredits_description_${l+1}`)},l))}),e.jsxs("div",{className:"mt-auto flex items-center justify-center gap-4 roun
3ded-none bg-modal-secondary px-8.5 py-5 sm:rounded-t-3xl sm:px-10 sm:py-7",children:[e.jsx(d,{onClick:s,variant:"outline",children:i("close")}),e.jsx(d,{onClick:n,variant:"brand",className:"px-3",children:i("trim_nocredits_submit")})]})]})})})},ct=m.lazy(()=>Oe(()=>import("./index-B2FvSUIR.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(t=>({default:t.ExportSongModal}))),rs=()=>{var D,R;const[t,s]=m.useState(!1),{t:n}=w(),{song:o,onSongUnlock:i}=v(),{status:r,is_unlocked:l}=o,a=r==="streaming",{isOwner:c,isMobile:x}=T(),{unlockSong:u}=ie(o,i),{openedModal:g,setOpenedModal:h}=oe(),{credits:p}=de(),f=se(),_=H(),b=te(),y=ne(),N=(R=(D=_.props)==null?void 0:D.auth)==null?void 0:R.user,C=q(),k=me(),j=B(),P=()=>{if(y){f.onOpen(),h("none");return}if(k){F.visit(j("subscription-management.show")),h("none");return}b.onOpen(),h("none")},S=()=>{u(),h("none")},z=()=>{if(!(a&&l)&&!(N&&!c)){if(!N&&l){C.onOpenRegister({unlock:"true",songName:o.title}),h("none");return}if(!N&&!l){h("export_locked_song");return}if(p<=0&&!l){h("export_no_credits");return}if(p>0&&!l){h("export_locked_song");return}h("export_song")}},O=t||a&&l||!!N&&!c;return e.jsxs(e.Fragment,{children:[e.jsx(xe,{showStreamingTooltip:a,notStreamingTooltipText:n("export"),showTooltip:a,children:x?e.jsxs(d,{variant:"ghost",size:"auto",className:M("w-10 hover:bg-transparent disabled:opacity-50 lg:hidden",!l&&"opacity-50"),contentClassName:"flex-col gap-y-1 text-text-secondary ",disabled:O,onClick:z,isLoading:t,children:[e.jsx(_e,{className:"size-5"}),e.jsx("span",{className:"text-2xs font-medium text-text-disabled",children:n("export")})]}):e.jsxs(Z,{disabled:O,onClick:z,loading:t,className:M("hidden lg:flex",!l&&"text-text-disabled hover:text-text-disabled"),children:[e.jsx(_e,{}),e.jsx("span",{children:n("export")})]})}),e.jsx(ge,{title:n("export_song"),isOpen:g==="export_locked_song",onClose:()=>h("none"),songName:`${o.title} v${o.variation}`,onSubmit:S}),e.jsx(he,{title:n("export_song"),isOpen:g==="export_no_credits",onClose:()=>h("none"),onSubmit:P}),g==="export_song"&&e.jsx(m.Suspense,{fallback:null,children:e.jsx(ct,{isOpen:!0,onClose:()=>h("none"),setIsLoading:s,song:o})})]})},as=()=>{var V,E;const{t}=w(),{song:s,onSongUnlock:n}=v(),{audio_url:o,is_unlocked:i,status:r}=s,l=r==="streaming",a=r==="pending",c=Ps(s,i),x=Os(s),{isOwner:u,isMobile:g}=T(),{unlockSong:h}=ie(s,n),{openedModal:p,setOpenedModal:f}=oe(),{credits:_,isFetchingCredits:b}=de(),{addGeneration:y}=Fe(),N=H(),C=te(),k=(E=(V=N.props)==null?void 0:V.auth)==null?void 0:E.user,j=q(),P=ne(),S=se(),z=me(),O=B();function D(){if(P){S.onOpen(),f("none");return}if(z){F.visit(O("subscription-management.show")),f("none");return}C.onOpen(),f("none")}function R(I){y(I)}function $(){if(c){if(!k&&i){L("ui:song_trim:clicked",{song_id:s.id,component:"song_description_action",result:"auth_required"}),j.onOpenRegister({unlock:"true",songName:s.title}),f("none");return}if(!k&&!i){L("ui:song_trim:clicked",{song_id:s.id,component:"song_description_action",result:"locked_song"}),f("trim_locked_song");return}if(_<=0&&!i){L("ui:song_trim:clicked",{song_id:s.id,component:"song_description_action",result:"no_credits"}),f("trim_no_credits");return}if(_>0&&!i){L("ui:song_trim:clicked",{song_id:s.id,component:"song_description_action",result:"locked_song"}),f("trim_locked_song");return}L("ui:song_trim:clicked",{song_id:s.id,component:"song_description_action",result:"opened"}),f("trim_song")}}function A(){h(),f("none")}const G=!c||a||b,K=!u&&k?e.jsxs("span",{className:"block py-1",children:[e.jsx("span",{className:"mb-2 block leading-none text-foreground",children:t("cant_trim")}),e.jsx("span",{className:"block text-sm leading-4.5 text-text-secondary",children:t("not_owner")})]}):t("trim");return e.jsxs(e.Fragment,{children:[e.jsx(xe,{showTooltip:G||l,showStreamingTooltip:x,notStreamingTooltipText:K,children:g?e.jsxs(d,{disabled:G,variant:"ghost",size:"auto",className:M("w-10 hover:bg-transparent disabled:opacity-50 lg:hidden",G&&"cursor-default opacity-50",!i&&"opacity-50"),contentClassName:"flex-col gap-y-1 text-text-secondary",onClick:$,isLoading:a,children:[e.jsx(we,{className:"size-5 lg:size-4"}),e.jsx("span",{className:"text-2xs font-medium text-text-disabled",children:t("trim")})]}):e.jsxs(Z,{disabled:G,loading:a,onClick:$,className:M("hidden lg:flex",!i&&"text-text-disabled hover:text-text-disabled"),children:[e.jsx(we,{}),e.jsx("span",{children:t("trim")})]})}),e.jsx(ge,{title:t("trim_locked_title"),isOpen:p==="trim_locked_song",onClose:()=>f("none"),songName:`${s.title} v${s.variation}`,onSubmit:A}),e.jsx(he,{title:t("trim_nocredits_title"),isOpen:p==="trim_no_credits",onClose:()=>f("none"),onSubmit:D}),e.jsx(Ns,{audioUrl:o,isOpen:p==="trim_song",onClose:()=>f("none"),onSuccess:R,song:s})]})},ls=()=>{const{t}=w(),{song:s,onSongUnlock:n}=v(),{status:o,is_unlocked:i,audio_url:r}=s,l=o==="streaming",a=o==="pending",{isMobile:c}=T(),{openedModal:x,setOpenedModal:u}=oe(),{addGeneration:g}=Fe(),{unlockSong:h}=ie(s,n),{credits:p,isFetchingCredits:f}=de(),_=se(),b=te(),y=ne(),N=me(),C=B(),k={id:(s==null?void 0:s.gen_id)??"",prompt:(s==null?void 0:s.prompt)??"",language:(s==null?void 0:s.language)??"en",genres:(s==null?void 0:s.styles)||[],genre:W((s==null?void 0:s.styles)||[]),status:"complete",vocalist_gender:s==null?void 0:s.vocalist_gender,songs:[],lyrics:(s==null?void 0:s.lyrics)??"",title:(s==null?void 0:s.title)??"",created_at:(s==null?void 0:s.created_at)??"",mode:(s==null?void 0:s.mode)??"auto"},j=(k==null?void 0:k.mode)==="trim"||!!(s!=null&&s.trimmed_from),P=s.can_extend_song??!1,S=l&&i||a||f||j||!P;function z(){if(y){_.onOpen(),u("none");return}if(N){F.visit(C("subscription-management.show")),u("none");return}b.onOpen(),u("none")}function O(){if(!(l&&i)){if(j){U(t("extension_cant_extend"),t("extension_cant_extend_trimmed"));return}if(!P){U(t("extension_cant_extend"),t("extension_cant_extend_mureka"));return}if(p<=0&&!i){u("fix_ending_no_credits");return}if(p>0&&!i){u("fix_ending_locked_song");return}u("extend_song")}}function D(){h(),u("none")}function R(A){g(A)}let $=t("extension_tooltip");if(j||!P){let A=t("extension_cant_extend_mureka");j&&(A=t("extension_cant_extend_trimmed")),$=e.jsxs("span",{className:"block py-1",children:[e.jsx("span",{className:"mb-2 block leading-none text-foreground",children:t("extension_cant_extend")}),e.jsx("span",{className:"block text-sm leading-4.5 text-text-secondary",children:A})]})}return e.jsxs(e.Fragment,{children:[e.jsx(xe,{showTooltip:l||j||!P,showStreamingTooltip:l,notStreamingTooltipText:$,children:c?e.jsxs(d,{disabled:S,isLoading:a,variant:"ghost",size:"auto",className:M("w-10 hover:bg-transparent disabled:opacity-50 lg:hidden",l&&i&&"cursor-default opacity-50",(j||!P)&&"cursor-not-allowed opacity-50",!i&&"opacity-50"),contentClassName:"flex-col gap-y-1 text-text-secondary",onClick:O,children:[e.jsx(Ne,{className:"size-5 lg:size-4"}),e.jsx("span",{className:"whitespace-normal text-2xs font-medium text-text-disabled",children:t("extension_tooltip")})]}):e.jsxs(Z,{disabled:S,loading:a,onClick:O,className:M("hidden lg:flex",!i&&"text-text-disabled hover:text-text-disabled"),children:[e.jsx(Ne,{}),e.jsx("span",{children:t("extension_tooltip")})]})}),e.jsx(ks,{generation:k,song:s,isOpen:x==="extend_song",onClose:()=>u("none"),audioUrl:r,onSuccess:R}),e.jsx(ge,{title:t("extension_title"),isOpen:x==="fix_ending_locked_song",onClose:()=>u("none"),songName:`${s.title} v${s.variation}`,onSubmit:D}),e.jsx(he,{title:t("extension_title"),isOpen:x==="fix_ending_no_credits",onClose:()=>u("none"),onSubmit:z})]})},dt=()=>{const{isOwner:t,isMobile:s}=T();return!t||!s?null:e.jsxs("div",{className:"flex w-full items-center justify-between gap-x-1.5",children:[e.jsx(is,{}),e.jsx(ls,{}),e.jsx(as,{}),e.jsx(rs,{}),e.jsx(os,{})]})},cs=(t,s)=>{const n=t?[t,s?`photo ${s}
3`:null].filter(Boolean).join(" "):"";return{alt:n,title:n}},mt=()=>{const{isAuthor:t}=T(),{song:s}=v(),n=cs(s==null?void 0:s.title),o=e.jsx("div",{className:`mx-auto aspect-square max-w-[21.875rem] flex-none overflow-hidden rounded-2xl border border-white/[0.12] backdrop-blur-[100px] duration-200 md:size-[21.875rem] md:max-w-max lg:mx-0 lg:size-72 xl:size-80 dark:shadow-[0_0_18.7px_0_rgba(18,18,19,0.5)] ${t?"cursor-pointer":""}`,children:e.jsx(Js,{fetchpriority:"high",src:(s==null?void 0:s.cover_url)??"/images/default-cover.jpg",alt:n.alt,title:n.title,className:"h-full w-full object-cover object-center"})});return t?e.jsx(Vs,{song:s,children:o}):o},xt=({error:t,inputSize:s,rounded:n,className:o,type:i,onChange:r,triggerFocus:l=!1,...a})=>{const c=m.useRef(null),x=m.useRef(null);return m.useEffect(()=>{c.current&&x.current&&(c.current.style.width=`${x.current.offsetWidth}px`)},[a.value]),m.useEffect(()=>{l&&c.current&&c.current.focus()},[l]),e.jsxs("div",{className:"relative inline-block",children:[e.jsx("span",{ref:x,className:M("invisible absolute whitespace-pre",o),children:a.value??" "}),e.jsx(Ks,{inputSize:s,rounded:n,ref:c,value:a.value,error:t,type:i,onChange:r,...a,className:M("min-w-[50px] max-w-[250px] md:max-w-[180px] lg:max-w-[414px] xl:max-w-[500px]",o)})]})},ut=()=>{const{t}=w(),{isOwner:s}=T(),{song:n}=v(),{mutate:o,isPending:i}=Ds(n.id),[r,l]=m.useState(n.title||""),[a,c]=m.useState(!1);m.useEffect(()=>{l(n.title||"")},[n.title]);const x=()=>{var p;if(r.trim()===""){U(void 0,void 0,t("title_is_required"));return}if(n.title&&n.title.trim()===r.trim()){c(!1);return}if(r.length>re){U(t("title_too_long",{count:re}));return}L("ui:song_title_edit:submitted",{song_id:n.id,component:"song_description_title",changed:((p=n.title)==null?void 0:p.trim())!==r.trim(),title_length:r.trim().length}),o(r,{onSuccess:()=>{c(!1),F.reload()},onError:()=>{U(t("failed_to_rename_song")),l(n.title),c(!1)}})},u=()=>{var p;L("ui:song_title_edit:cancelled",{song_id:n.id,component:"song_description_title",changed:((p=n.title)==null?void 0:p.trim())!==r.trim()}),c(!1),l(n.title)},g=()=>{L("ui:song_title_edit:clicked",{song_id:n.id,component:"song_description_title"}),c(!0)},h=p=>{p.key==="Enter"&&x(),p.key==="Escape"&&u()};return e.jsx("div",{className:M("relative flex items-center gap-x-2.5 md:gap-x-1",a&&"overflow-hidden"),children:a?e.jsxs("div",{className:"relative left-0 top-0 z-10 flex items-center gap-x-2.5",children:[e.jsx(xt,{maxLength:re,inputSize:"auto",rounded:"ghost",value:r,onChange:p=>l(p.target.value),onKeyUp:h,triggerFocus:a,className:"max-w-[calc(100vw-6.25rem)] flex-1 font-display text-[2rem] font-medium leading-10 tracking-[1px] text-foreground-secondary md:max-w-[calc(100vw-6.25rem)] lg:max-w-[246px] lg:pb-0.5 xl:max-w-[286px]"}),e.jsxs("div",{className:"flex gap-x-0.5",children:[e.jsxs(d,{variant:"ghost",size:"icon",className:"size-6 flex-none cursor-pointer rounded-sm",onClick:x,disabled:i,isLoading:i,children:[e.jsx("span",{className:"sr-only",children:t("save_title")}),e.jsx(Qs,{className:"size-4"})]}),e.jsxs(d,{variant:"ghost",size:"icon",className:"size-6 flex-none cursor-pointer rounded-sm",onClick:u,disabled:i,children:[e.jsx("span",{className:"sr-only",children:t("cancel")}),e.jsx(vs,{className:"size-4"})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"overflow-hidden text-ellipsis whitespace-nowrap font-display text-display-title font-medium tracking-[1px] text-foreground-secondary lg:pb-0.5",children:r}),s&&e.jsxs(d,{variant:"ghost",size:"icon",className:"size-6 flex-none cursor-pointer rounded-sm lg:me-1.5",onClick:g,children:[e.jsx("span",{className:"sr-only",children:t("edit_title")}),e.jsx(qs,{className:"size-3"})]})]})})},pt=()=>{const{isOwner:t}=T(),{song:s}=v(),n=!!(s!=null&&s.extended_from),o=!!(s!=null&&s.trimmed_from);return t?n&&(s!=null&&s.extended_from)?e.jsx(Se,{sourceId:s.extended_from.id,mode:"extended",className:"hidden w-fit md:flex",variation:s.variation}):o&&(s!=null&&s.trimmed_from)?e.jsx(Se,{sourceId:s.trimmed_from.id,mode:"trim",className:"hidden w-fit md:flex",variation:s.variation}):e.jsx(pe,{variation:s.variation,className:"h-5 w-fit"}):null},gt=()=>{const{isAuthor:t}=T();return e.jsxs("header",{id:"audio",className:"my-6 space-y-2 lg:mb-0",children:[t&&e.jsx(pt,{}),e.jsx(ut,{})]})},ht=()=>{const{t}=w(),{song:s}=v(),n=B(),o=Be({customUrl:n("song",{song:(s==null?void 0:s.id)??""}),customContent:t("i_just_created_this_song"),mediaUrl:(s==null?void 0:s.cover_url)??"",trackingProperties:{song_id:s.id,component:"song_description_share_buttons"}}),i=async()=>{L("ui:share:platform_clicked",{platform:"copy_link",song_id:s.id,component:"song_description_share_buttons"}),await Ze(n("song",{song:(s==null?void 0:s.id)??""}))?J.success(t("link_copied_to_clipboard"),{duration:3e3,position:"bottom-center"}):J.error(t("could_not_copy_to_clipboard"),{duration:3e3,position:"bottom-center"})};return e.jsxs("div",{className:"flex items-center justify-between lg:mt-6 lg:w-fit lg:flex-wrap lg:justify-start lg:gap-1.5 lg:pe-1 xl:gap-x-2.5",children:[e.jsxs(d,{variant:"popover",size:"auto",onClick:i,contentClassName:"gap-x-2 md:gap-x-1 lg:gap-x-2",children:[e.jsx("div",{className:"flex size-5 items-center justify-center rounded-full bg-background-primary-hover",children:e.jsx(De,{className:"w-3.5"})}),e.jsx("span",{className:"whitespace-normal font-display text-sm font-medium lowercase leading-none tracking-[0.8px] first-letter:uppercase",children:t("copy_link")})]}),e.jsxs(d,{variant:"popover",size:"auto",className:"size-7 flex-none p-1",onClick:o("facebook"),children:[e.jsx("span",{className:"sr-only",children:t("share_on_facebook")}),e.jsx(Re,{className:"size-5 flex-none"})]}),e.jsxs(d,{variant:"popover",size:"auto",className:"size-7 flex-none p-1",onClick:o("whatsapp"),children:[e.jsx("span",{className:"sr-only",children:t("share_on_whatsapp")}),e.jsx(Ie,{className:"size-5 flex-none"})]}),e.jsxs(d,{variant:"popover",size:"auto",className:"size-7 flex-none p-1",onClick:o("imessage"),children:[e.jsx("span",{className:"sr-only",children:t("share_on_imessage")}),e.jsx(Ue,{className:"size-5 flex-none"})]}),e.jsxs(d,{variant:"popover",size:"auto",className:"size-7 flex-none p-1",onClick:o("pinterest"),children:[e.jsx("span",{className:"sr-only",children:t("share_on_pinterest")}),e.jsx($e,{className:"size-5 flex-none"})]}),e.jsxs(d,{variant:"popover",size:"auto",className:"size-7 flex-none p-1",onClick:o("telegram"),children:[e.jsx("span",{className:"sr-only",children:t("share_on_telegram")}),e.jsx(He,{className:"size-5 flex-none"})]}),e.jsxs(d,{variant:"popover",size:"auto",className:"size-7 flex-none p-1",onClick:o("x"),children:[e.jsx("span",{className:"sr-only",children:t("share_on_x")}),e.jsx(Ge,{className:"size-5 flex-none"})]})]})}
3,ft=()=>{const{isOwner:t}=T(),{song:s,onSongUnlock:n}=v(),{is_unlocked:o}=s,{isUnlockSongPending:i,unlockSong:r}=ie(s,n),{t:l}=w(),a=B();return t?o?null:e.jsx("div",{className:"flex w-full justify-center lg:mt-2 lg:justify-start",children:e.jsxs(d,{variant:"primary",size:"xl",className:"w-full px-3 lg:h-10 lg:w-fit",onClick:r,disabled:i,isLoading:i,children:[e.jsx(Ys,{className:"size-4"}),e.jsx("span",{className:"font-bold uppercase tracking-[0.7px] lg:font-medium lg:capitalize lg:tracking-[0.6px]",children:l("unlock_full_song")})]})}):e.jsx("div",{className:"flex w-full justify-center lg:mt-2 lg:justify-start",children:e.jsx(d,{variant:"brand",size:"xl",className:"w-full lg:h-10 lg:w-fit",asChild:!0,children:e.jsxs(ce,{href:a("homepage"),className:"gap-x-2 hover:no-underline lg:gap-x-1.5",children:[e.jsx(et,{className:"size-4"}),e.jsx("span",{className:"mt-px text-balance font-medium capitalize tracking-[0.6px]",children:l("create_your_song")})]})})})},jt=()=>{const{isOwner:t,isMobile:s}=T();return s?null:e.jsxs("div",{className:"mt-auto flex flex-col items-start gap-y-6 px-2 pb-4 pt-8",children:[e.jsx(is,{}),t&&e.jsxs(e.Fragment,{children:[e.jsx(ls,{}),e.jsx(as,{}),e.jsx(rs,{}),e.jsx(os,{})]})]})},_t=()=>e.jsx(ws,{children:e.jsxs("div",{className:"song-details-scrollbar-lg flex flex-col px-5 pb-7 pt-4 lg:w-[20rem] lg:shrink-0 lg:overflow-y-auto lg:px-0 lg:py-0 xl:w-[22.5rem]",children:[e.jsx(mt,{}),e.jsx(gt,{}),e.jsxs("div",{className:"flex flex-1 flex-col gap-y-5 lg:gap-y-0",children:[e.jsx(dt,{}),e.jsx(ft,{}),e.jsx(ht,{}),e.jsx(jt,{})]})]})}),vt=()=>{const{isAuthor:t}=T(),{song:s}=v(),n=s==null?void 0:s.styles,o=cs(s==null?void 0:s.title,1);return e.jsxs("div",{className:"flex flex-1 items-center gap-x-4",children:[e.jsx("div",{className:"size-12.5 flex-none",children:e.jsx("img",{src:(s==null?void 0:s.cover_url)??"/images/default-cover.jpg",alt:o.alt,title:o.title,className:"size-full rounded-sm object-cover"})}),e.jsxs("div",{className:"flex flex-col gap-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"line-clamp-1 block max-w-64 text-lg leading-6 text-text-primary xl:max-w-96",children:(s==null?void 0:s.title)??""}),t&&e.jsx(pe,{variation:s.variation,size:"lg",label:"Version"})]}),e.jsx("p",{className:"line-clamp-2 max-w-72 text-xs leading-5 text-text-secondary first-letter:uppercase xl:max-w-96",children:W(n)??""})]})]})},bt=()=>{const{song:t}=v(),{duration:s,status:n}=t;return n==="pending"||n==="streaming"?e.jsx("div",{className:"flex flex-none items-center gap-x-2",children:e.jsx(ue,{size:"default",className:"size-3.5"})}):e.jsx("div",{className:"flex-none text-sm font-normal leading-none text-text-secondary",children:Y(s)})},ds=t=>m.createElement("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},m.createElement("path",{d:"M28.5116 15.9999C28.5115 12.2937 26.1407 7.97242 22.2642 5.71865C18.749 3.67494 14.101 3.37877 8.97255 6.46214L9.15874 5.52984C9.26702 4.98845 8.91616 4.4613 8.37489 4.35276C7.8335 4.24449 7.30634 4.59534 7.19781 5.13661L6.59615 8.14399C6.45167 8.86618 6.92009 9.56873 7.64232 9.71304L10.6483 10.3137C11.1897 10.422 11.7169 10.0711 11.8254 9.52984C11.9337 8.98846 11.5828 8.46129 11.0416 8.35276L10.0403 8.15224C14.5963 5.42441 18.46 5.82046 21.259 7.44781C24.5491 9.3607 26.5115 13.0396 26.5116 15.9999C26.5116 19.9015 23.9436 23.5735 20.3371 25.2616C16.7988 26.9175 12.2518 26.6593 8.21864 22.6262C7.82813 22.2358 7.19508 22.2358 6.80458 22.6262C6.41408 23.0167 6.41412 23.6497 6.80458 24.0403C11.4379 28.6735 16.8911 29.0832 21.1861 27.0728C25.4128 25.0942 28.5116 20.7649 28.5116 15.9999Z",fill:"currentColor"}),m.createElement("path",{d:"M12.6092 20C12.5292 20 12.4865 19.9573 12.4865 19.872L12.5345 16.6827L12.5079 14.6667C12.1399 15.0187 11.6759 15.2907 11.1159 15.4667C11.0252 15.4933 10.9719 15.4507 10.9719 15.36V14.1493C10.9719 14.0747 11.0039 14.032 11.0732 14.0107C11.8039 13.7493 12.2892 13.28 12.5932 12.6293C12.6252 12.56 12.6679 12.5333 12.7425 12.5333H14.3425C14.4225 12.5333 14.4652 12.576 14.4652 12.656L14.4225 16.416L14.4759 19.872C14.4759 19.9573 14.4332 20 14.3532 20H12.6092Z",fill:"currentColor"}),m.createElement("path",{d:"M17.9744 20.1867C16.2678 20.1867 15.3611 19.3493 15.2224 18.064C15.2118 17.984 15.2598 17.936 15.3398 17.936H17.0091C17.0891 17.936 17.1318 17.9787 17.1424 18.0587C17.2118 18.608 17.5211 18.8267 17.9584 18.8267C18.6304 18.8267 18.9984 18.3947 18.9984 17.4507C18.9984 16.5867 18.7104 16.1013 18.0011 16.1013C17.5424 16.1013 17.2064 16.3093 17.0518 16.7147C17.0251 16.784 16.9824 16.816 16.9131 16.816H15.4784C15.3984 16.816 15.3504 16.768 15.3558 16.6827L15.6544 12.6507C15.6598 12.5707 15.7078 12.5333 15.7824 12.5333H20.4811C20.5611 12.5333 20.6091 12.5813 20.6091 12.656V13.8293C20.6091 13.9093 20.5611 13.9573 20.4811 13.9573H17.3504L17.2331 15.0507C17.6278 14.8213 18.1024 14.7147 18.5984 14.7147C20.0224 14.7147 21.0518 15.776 21.0518 17.3067C21.0518 19.088 19.8038 20.1867 17.9744 20.1867Z",fill:"currentColor"})),ms=t=>m.createElement("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},m.createElement("path",{d:"M5 15.9999C5.00006 12.2937 7.37095 7.97242 11.2474 5.71865C14.7626 3.67494 19.4106 3.37877 24.5391 6.46214L24.3529 5.52984C24.2446 4.98845 24.5954 4.4613 25.1367 4.35276C25.6781 4.24449 26.2053 4.59534 26.3138 5.13661L26.9155 8.14399C27.0599 8.86618 26.5915 9.56873 25.8693 9.71304L22.8633 10.3137C22.3219 10.422 21.7947 10.0711 21.6862 9.52984C21.5779 8.98846 21.9288 8.46129 22.4701 8.35276L23.4714 8.15224C18.9153 5.42441 15.0516 5.82046 12.2526 7.44781C8.96248 9.3607 7.00006 13.0396 7 15.9999C7 19.9015 9.56798 23.5735 13.1745 25.2616C16.7128 26.9175 21.2598 26.6593 25.293 22.6262C25.6835 22.2358 26.3165 22.2358 26.707 22.6262C27.0975 23.0167 27.0975 23.6497 26.707 24.0403C22.0738 28.6735 16.6205 29.0832 12.3255 27.0728C8.09883 25.0942 5 20.7649 5 15.9999Z",fill:"currentColor"}),m.createElement("path",{d:"M13.9413 20C13.8613 20 13.8187 19.9573 13.8187 19.872L13.8667 16.6827L13.84 14.6667C13.472 15.0187 13.008 15.2907 12.448 15.4667C12.3573 15.4933 12.304 15.4507 12.304 15.36V14.1493C12.304 14.0747 12.336 14.032 12.4053 14.0107C13.136 13.7493 13.6213 13.28 13.9253 12.6293C13.9573 12.56 14 12.5333 14.0747 12.5333H15.6747C15.7547 12.5333 15.7973 12.576 15.7973 12.656L15.7547 16.416L15.808 19.872C15.808 19.9573 15.7653 20 15.6853 20H13.9413Z",fill:"currentColor"}),m.createElement("path",{d:"M19.3066 20.1867C17.5999 20.1867 16.6933 19.3493 16.5546 18.064C16.5439 17.984 16.5919 17.936 16.6719 17.936H18.3413C18.4213 17.936 18.4639 17.9787 18.4746 18.0587C18.5439 18.608 18.8533 18.8267 19.2906 18.8267C19.9626 18.8267 20.3306 18.3947 20.3306 17.4507C20.3306 16.5867 20.0426 16.1013 19.3332 16.1013C18.8746 16.1013 18.5386 16.3093 18.3839 16.7147C18.3572 16.784 18.3146 16.816 18.2452 16.816H16.8106C16.7306 16.816 16.6826 16.768 16.6879 16.6827L16.9866 12.6507C16.9919 12.5707 17.0399 12.5333 17.1146 12.5333H21.8133C21.8933 12.5333 21.9413 12.5813 21.9413 12.656V13.8293C21.9413 13.9093 21.8933 13.9573 21.8133 13.9573H18.6826L18.5653 15.0507C18.9599 14.8213 19.4346 14.7147 19.9306 14.7147C21.3546 14.7147 22.3839 15.776 22.3839 17.3067C22.3839 19.088 21.1359 20.1867 19.3066 20.1867Z",fill:"currentColor"})),xs=t=>m.createElement("svg",{viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},m.createElement("path",{d:"M8.25 1.5L10.5 3.75M10.5 3.75L8.25 6M10.5 3.75H5.1C3.83988 3.75 3.20982 3.75 2.72852 3.99524C2.30516 4.21095 1.96095 4.55516 1.74524 4.97852C1.5 5.45982 1.5 6.08988 1.5 7.35V11.625C1.5 11.9733 1.5 12.1475 1.51925 12.2937C1.65217 13.3033 2.44667 14.0978 3.45632 14.2308C3.60253 14.25 3.77668 14.25 4.125 14.25M7.5 14.25H12.9C14.1601 14.25 14.7902 14.25 15.2715 14.0048C15.6948 13.789 16.039 13.4448 16.2548 13.0215C16.5 12.5402 16.5 11.9101 16.5 10.65V6.375C16.5 6.02668 16.5 5.85253 16.4808 5.70632C16.3478 4.69667 15.5533 3.90217 14.5437 3.76925C14.3975 3.75 14.2233 3.75 13.875 3.75M7.5 14.25L9.75 16.5M7.5 14.25L9.75 12",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Ct=()=>{const{currentTime:t,isPlaying:s,playPause:n,skipBy:o,isSeeking:i,seekTime:r}=v(),l=Y(i?r:t);return e.jsxs("div",{className:"flex flex-none flex-col items-center justify-center gap-y-1",children:[e.jsxs("div",{className:"flex whitespace-nowrap text-sm font-normal leading-none text-text-secondary",children:[l," ",e.jsx("span",{className:"mx-1",children:"/"})," ",e.jsx(bt,{})]}),e.jsxs("div",{className:"flex items-center justify-center gap-x-2",children:[e.jsx(d,{variant:"ghost",size:"auto",className:"size-10 rounded-xl text-text-primary focus-visible:shadow-focus-ring-shadow-xs-skeuomorphic focus-visible:ring-0",onClick:()=>o(-15),children:e.jsx(ds,{className:"size-6"})}),e.jsx(d,{variant:"ghost",size:"auto",className:"size-12 rounded-xl text-text-primary focus-visible:shadow-focus-ring-shadow-xs-skeuomorphic focus-visible:ring-0",onClick:n,children:s?e.jsx(We,{className:"size-6"}):e.jsx(Ke,{className:"ms-1 h-7 w-auto"})}),e.jsx(d,{variant:"ghost",size:"auto",className:"size-10 rounded-xl text-text-primary focus-visible:shadow-focus-ring-shadow-xs-skeuomorphic focus-visible:ring-0",onClick:()=>o(15),children:e.jsx(ms,{className:"size-6"})})]})]})},yt=()=>{const{t}=w(),s=qe(p=>p.setVolume),{localVolume:n,localIsMuted:o,setLocalVolume:i,setLocalIsMuted:r,isLooping:l,song:a,toggleLoop:c}=v(),x=()=>{r(!o)},u=p=>{const f=p[0]??0;o&&f>0&&r(!1),i(f)},g=p=>{const f=p[0]??0;o&&f>0&&r(!1),s(f)},h=o?0:n;return e.jsxs("div",{className:"flex flex-1 items-center justify-end gap-x-2",children:[e.jsx(ve,{children:e.jsxs(be,{delayDuration:0,
3children:[e.jsx(Ce,{asChild:!0,children:e.jsxs(d,{variant:"ghost",size:"icon",className:M("flex size-7 flex-none items-center justify-center rounded-md text-text-primary"),onClick:c,disabled:a.status==="streaming",children:[e.jsx("span",{className:"sr-only",children:t("loop_song")}),l?e.jsx(Ye,{className:"size-4.5 flex-none"}):e.jsx(xs,{className:"size-4.5 flex-none"})]})}),e.jsx(ye,{children:e.jsx("p",{children:t(l?"disable_loop":"loop_song")})})]})}),e.jsx(ve,{children:e.jsxs(be,{delayDuration:0,children:[e.jsx(Ce,{asChild:!0,children:e.jsx(d,{variant:"ghost",size:"icon",className:"group size-7 rounded-md duration-100",onClick:()=>x(),children:o?e.jsx(Xe,{className:"size-5 flex-shrink-0 text-text-tertiary"}):e.jsx(Je,{className:"size-5 flex-shrink-0 text-text-primary"})})}),e.jsx(ye,{children:e.jsx("p",{children:t(o?"unmute":"mute")})})]})}),e.jsx(Ve,{value:[h],onValueChange:u,onValueCommit:g,max:1,step:.01,className:"w-24 flex-none"})]})},Nt=()=>{const{song:t,currentTime:s,isSeeking:n,seekTime:o,onSeekChange:i,seekTo:r}=v(),l=t.duration??0,a=n?o:s;return e.jsx(Ae,{trackClassName:"h-1.5 rounded-sm cursor-pointer bg-[#18191D]/15 dark:bg-[#2D2F36] lg:h-2 lg:rounded-none lg:bg-[#2D2F36]",thumbClassName:"focus-visible:ring-offset-0 focus-visible:ring-[0px] lg:hidden bg-player-track-progress border-[#d39801] cursor-pointer size-3 border outline-none",min:0,max:l||1,value:[a],onValueChange:([c])=>i(c),onValueCommit:([c])=>r(c)})};function kt(){const{song:t,currentTime:s,isSeeking:n,seekTime:o,onSeekChange:i,seekTo:r,songPreviewDurationType:l}=v(),a=Number(t.preview_duration)??0,c=n?o:s,x=l==="percentage_90",u=l==="percentage_50";return e.jsxs("div",{tabIndex:0,className:"flex w-full items-center",children:[e.jsx(Ae,{className:M("z-10",x?"flex-[9]":u?"flex-1":"flex-[0.65]"),trackClassName:"h-1.5 rounded-sm lg:h-2 cursor-pointer rounded-e-none bg-[#18191D]/15 lg:rounded-none bg-[#2D2F36]",thumbClassName:"focus-visible:ring-offset-0 bg-player-track-progress border-[#d39801] focus-visible:ring-[0px] size-3 cursor-pointer outline-none lg:hidden",min:0,max:a||1,value:[c],onValueChange:([g])=>i(g),onValueCommit:([g])=>r(g)}),e.jsx("div",{className:"relative flex h-1.5 flex-1 items-center justify-center rounded-e-sm bg-warning-stripes-wide-yellow lg:h-2 lg:rounded-e-none"})]})}const us=({className:t})=>{const{song:s}=v(),{is_unlocked:n}=s;return e.jsx("div",{className:M("relative w-full",t),children:n?e.jsx(Nt,{}):e.jsx(kt,{})})},wt=()=>e.jsxs("div",{dir:"ltr",className:"mt-4 hidden border-t border-border-tetriary bg-background-player shadow-song-module-outer lg:block",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 pt-3",children:[e.jsx(vt,{}),e.jsx(Ct,{}),e.jsx(yt,{})]}),e.jsx(us,{})]}),ae=24,St=({tab:t,isActive:s=!1,onClick:n})=>e.jsx("button",{type:"button",onClick:n,"aria-current":s?"true":void 0,className:M("hover:bg-background-tab-hover flex-1 rounded-lg px-4 py-1.5 text-center text-base font-normal leading-6 transition-colors duration-100 ease-in-out md:flex-none md:px-10",s&&"bg-background-tab-active"),children:t.title}),zt=()=>{var p,f;const{isMobile:t,isOwner:s}=T(),o=(f=(p=H().props)==null?void 0:p.auth)==null?void 0:f.user,i=m.useRef(null),r=m.useRef(!1),l=m.useRef(),a=m.useMemo(()=>[{title:"Audio",href:"#audio"},s?{title:"Prompt",href:"#prompt"}:null,{title:"Lyrics",href:"#lyrics"}].filter(_=>!!_),[s]),[c,x]=m.useState(a),[u,g]=m.useState(a[0].href);m.useEffect(()=>{var N;if(!t){x(a),g(((N=a[0])==null?void 0:N.href)??"#audio");return}const _=a.filter(C=>document.getElementById(C.href.slice(1))),b=_.length>0?_:a,y=b.find(C=>C.href===window.location.hash);x(b),g((y==null?void 0:y.href)??b[0].href)},[t,a]),m.useEffect(()=>{if(!c.length)return;const _=()=>{var C;return(((C=i.current)==null?void 0:C.getBoundingClientRect().bottom)??0)+ae},b=()=>{if(r.current)return;const N=_(),C=c.map(j=>({tab:j,section:document.getElementById(j.href.slice(1))})).filter(j=>!!j.section);if(!C.length)return;let k=C[0].tab.href;C.forEach((j,P)=>{var O;const S=j.section.getBoundingClientRect().top,z=((O=C[P+1])==null?void 0:O.section.getBoundingClientRect().top)??1/0;S<=N&&N<z&&(k=j.tab.href)}),g(j=>j===k?j:k)};b();const y=()=>b();return window.addEventListener("scroll",b,{passive:!0}),window.addEventListener("resize",y),()=>{window.removeEventListener("scroll",b),window.removeEventListener("resize",y)}},[ae,t,c]);const h=_=>{var j;const b=document.getElementById(_.href.slice(1));if(!b)return;const y=16,N=((j=i.current)==null?void 0:j.offsetHeight)??0,C=y+N,k=window.scrollY+b.getBoundingClientRect().top-(C+ae-2);g(_.href),window.history.replaceState(null,"",_.href),r.current=!0,
3clearTimeout(l.current),l.current=setTimeout(()=>{r.current=!1},1e3),window.scrollTo({top:k,behavior:"smooth"})};return!t||!c.length?null:e.jsx("div",{ref:i,className:M("sticky top-4 z-10 px-5 lg:top-0 lg:px-4",!o&&"-mt-4"),children:e.jsx("div",{className:"flex gap-1.5 rounded-xl bg-background-tabs p-1.5 md:mx-auto md:w-fit",children:c.map(_=>e.jsx(St,{tab:_,isActive:u===_.href,onClick:()=>h(_)},_.title))})})},Tt=()=>{const{isLoading:t,isPlaying:s,playPause:n}=v(),{t:o}=w(),i=Ws(t);return e.jsx(d,{variant:"ghost",size:"auto",onClick:n,className:"flex size-12 shrink-0 items-center justify-center rounded-full border border-player-btn-border bg-player-btn-background p-0",children:i?e.jsx(ue,{}):s?e.jsxs(e.Fragment,{children:[e.jsx(We,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:o("pause")})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ke,{className:"ms-1 w-3.5"}),e.jsx("span",{className:"sr-only",children:o("play")})]})})},Lt=()=>{const{isMobile:t}=T(),s=Xs(z=>z.isIntercomActive),{localIsMuted:n,currentTime:o,localVolume:i,setLocalIsMuted:r,setLocalVolume:l,skipBy:a,song:c,isLooping:x,toggleLoop:u,isSeeking:g,seekTime:h}=v(),{is_unlocked:p,status:f,duration:_}=c,b=f==="streaming",{t:y}=w(),N=qe(z=>z.setVolume),C=()=>r(!n),k=z=>{l(z[0])},j=z=>{N(z[0])},P=Y(g?h:o),S=m.useMemo(()=>f==="pending"||b?e.jsx(ue,{className:"size-3.5"}):Y(_),[b,p,_,f,y]);return t?e.jsx("div",{dir:"ltr",className:M("sticky bottom-[calc(1.25rem+env(safe-area-inset-bottom))] z-10 px-5 pt-5 lg:hidden",s&&"pt-15"),children:e.jsxs("div",{className:"flex flex-col items-center gap-y-2 rounded-2xl border border-border-player bg-background-mini-player px-4 py-3",children:[e.jsxs("div",{className:"w-full space-y-1.5",children:[e.jsx(us,{}),e.jsxs("div",{className:"flex w-full items-center justify-between",children:[e.jsx("div",{className:"font-djr-text whitespace-nowrap text-xs font-medium leading-[0.875rem] text-text-placeholder",children:P}),e.jsx("div",{className:"font-djr-text whitespace-nowrap text-xs font-medium leading-[0.875rem] text-text-placeholder",children:S})]})]}),e.jsxs("div",{className:"flex w-full items-center justify-between gap-x-2 md:grid md:grid-cols-3",children:[e.jsx("div",{className:"contents md:flex md:items-center",children:e.jsxs(d,{variant:"ghost",size:"icon",className:M("flex size-7 flex-none items-center justify-center text-text-secondary hover:bg-inherit hover:text-text-secondary"),onClick:u,disabled:b,children:[e.jsx("span",{className:"sr-only",children:y("loop_song")}),x?e.jsx(Ye,{className:"size-4.5 flex-none"}):e.jsx(xs,{className:"size-4.5 flex-none"})]})}),e.jsxs("div",{className:"contents md:flex md:items-center md:justify-center md:gap-x-2",children:[e.jsxs(d,{variant:"ghost",size:"icon",className:"flex size-12 flex-none items-center justify-center hover:bg-inherit hover:text-inherit",onClick:()=>a(-15),children:[e.jsx("span",{className:"sr-only",children:y("back_15_seconds")}),e.jsx(ds,{className:"size-8 flex-none text-text-secondary lg:text-text-primary"})]}),e.jsx(Tt,{}),e.jsxs(d,{variant:"ghost",size:"icon",className:"flex size-12 flex-none items-center justify-center hover:bg-inherit hover:text-inherit",onClick:()=>a(15),children:[e.jsx("span",{className:"sr-only",children:y("forward_15_seconds")}),e.jsx(ms,{className:"size-8 flex-none text-text-secondary lg:text-text-primary"})]})]}),e.jsxs("div",{className:"contents md:flex md:items-center md:justify-end md:gap-x-2",children:[e.jsxs(d,{variant:"ghost",size:"icon",onClick:()=>C(),className:"flex size-7 flex-none items-center justify-center text-text-secondary hover:bg-inherit hover:text-inherit",children:[e.jsx("span",{className:"sr-only",children:y("mute")}),n?e.jsx(Xe,{className:"size-4.5 flex-shrink-0"}):e.jsx(Je,{className:"size-4.5 flex-shrink-0"})]}),e.jsx(Ve,{value:[i],onValueChange:k,onValueCommit:j,max:1,step:.01,className:"hidden w-24 flex-none md:flex"})]})]})]})}):null},Mt="klaviyo",Et=t=>(console.log("🚀 ~ isChromeBrowser ~ userAgent:",t),/Edg|EdgiOS|OPR|Opera|SamsungBrowser|FxiOS|Firefox/i.test(t)?!1:/CriOS|Chrome/i.test(t)),Pt=t=>{var n;return((n=new URLSearchParams(t).get("utm_source"))==null?void 0:n.toLowerCase())===Mt},Ot=({isMobile:t,userAgent:s,search:n,pathname:o,hash:i})=>!t||!n||!Et(s)||!Pt(n)?null:`${o}${i}`,Vt=t=>{m.useEffect(()=>{if(typeof window>"u")return;const s=Ot({isMobile:t,userAgent:window.navigator.userAgent,search:window.location.search,pathname:window.location.pathname,hash:window.location.hash});s&&window.location.replace(s)},[t])},Ft=({song:t})=>{var a,c;const s=B(),{t:n}=w(),{isAuthor:o}=T(),i=Te(640);Vt(i);const l=(c=(a=H().props)==null?void 0:a.auth)==null?void 0:c.user;return e.jsxs("div",{className:M("flex flex-col lg:h-[calc(100vh-4.5rem)] lg:overflow-clip lg:pb-0"),children:[e.jsx("div",{className:"flex h-12 shrink-0 items-center px-5 lg:px-4",children:l&&e.jsx(Z,{asChild:!0,className:"font-normal hover:no-underline",children:e.jsxs(ce,{href:s("user-songs"),children:[e.jsx(st,{}),e.jsx("span",{children:n("all_songs")})]})})}),e.jsx(zt,{}),e.jsxs("div",{className:"flex-1 lg:flex lg:max-h-[calc(100vh-14.375rem)] lg:items-stretch lg:gap-4 lg:px-4",children:[e.jsx(_t,{}),o&&e.jsx(lt,{}),e.jsx(ot,{lyrics:t.lyrics??"",title:t.title,variation:t.variation,language:t.language??""}),o&&e.jsx(at,{})]}),e.jsx(wt,{}),e.jsx(Lt,{})]})},ze=t=>
3({author:{title:t("currently_archived"),subtitle:e.jsx(X,{i18nKey:"track_archived_author_view",components:{br:e.jsx("br",{className:"sm:hidden"})}})},user:{title:t("song_isnt_available"),subtitle:e.jsx(X,{i18nKey:"track_archived_by_author",components:{br:e.jsx("br",{className:"sm:hidden"})}})},guest:{title:t("oops_nothing_to_hear"),subtitle:e.jsx(X,{i18nKey:"track_is_unavailable",components:{br:e.jsx("br",{className:"sm:hidden"})}})}}),At=({songPlayerData:t})=>{var u,g;const s=B(),{isAuthor:n}=T(),i=(g=(u=H().props)==null?void 0:u.auth)==null?void 0:g.user;let r="guest";n?r="author":i?r="user":r="guest";const l=q(),{t:a}=w(),c=Rs(t.id),x=()=>{L("ui:song_unarchive:clicked",{song_id:t.id,component:"archived_song_page"}),c.mutate(t.id,{onSuccess:h=>{if(h.status!=="success"){Q(a("error_unarchiving_song"),"");return}Le(a("unarchive_success_message")),F.reload()},onError:()=>{Q(a("error_unarchiving_song"),"")}})};return e.jsx("div",{className:"flex h-[calc(100vh-4.5rem)] flex-col overflow-clip",children:e.jsx("div",{className:"flex h-full w-full items-center justify-center",children:e.jsxs("div",{className:"relative w-full max-w-[40rem] px-10 py-16 sm:px-16",children:[e.jsx("img",{alt:"",src:"/images/archive_card_gradient_dark_mobile.png",className:"absolute left-1/2 top-0 hidden w-full -translate-x-1/2 dark:block dark:sm:hidden"}),e.jsx("img",{alt:"",src:"/images/archive_card_gradient_dark.png",className:"absolute left-1/2 top-0 hidden w-[96%] -translate-x-1/2 dark:sm:block"}),e.jsx("img",{alt:"",src:"/images/archive_card_gradient_light.png",className:"absolute left-1/2 top-0 block w-[96%] -translate-x-1/2 dark:hidden"}),e.jsx("div",{className:"absolute left-1/2 top-0 h-px w-full max-w-[15rem] -translate-x-1/2 bg-[linear-gradient(90deg,#FFF_0%,#CFCFD3_50%,#FFF_100%)] opacity-80 sm:max-w-[27.375rem] dark:bg-[linear-gradient(90deg,#18191D_0%,#27272A_50%,#18191D_100%)] dark:sm:bg-[linear-gradient(90deg,rgba(255,255,255,0.00)_0%,rgba(255,255,255,0.50)_50%,rgba(255,255,255,0.00)_100%)] dark:sm:mix-blend-screen"}),e.jsxs("div",{className:"relative z-10 flex flex-col items-center justify-center gap-8",children:[e.jsx("div",{className:"flex size-10 items-center justify-center rounded-lg border border-border-secondary bg-background-primary shadow-[0_4px_9px_0_#D6D6DA] dark:border-border-primary dark:shadow-[0_4px_9px_0_#17181D]",children:e.jsx(le,{className:"size-4 text-foreground"})}),e.jsxs("div",{className:"flex flex-col gap-1 text-center",children:[e.jsx("span",{className:"font-display text-xl font-medium leading-7 tracking-[1px] text-text-primary",children:ze(a)[r].title}),e.jsx("span",{className:"text-text-secondary",children:ze(a)[r].subtitle})]}),e.jsxs("div",{className:"flex w-full flex-col gap-2 sm:w-fit sm:flex-row",children:[r==="guest"&&e.jsx(d,{className:"px-3 capitalize",onClick:()=>l.onOpenRegister(),children:a("get_started")}),r==="user"&&e.jsx(d,{onClick:()=>F.visit(s("create.song")),className:"px-3 capitalize",children:a("create_your_song")}),r==="author"&&e.jsxs(e.Fragment,{children:[e.jsx(d,{className:"px-3",variant:"outline",onClick:()=>F.visit(s("user-songs")),children:a("back_to_songs")}),e.jsx(d,{className:"px-3",disabled:c.isPending,isLoading:c.isPending,onClick:x,children:a("unarchive")})]})]})]})]})})})},Bt=m.lazy(()=>Oe(()=>import("./index-B2FvSUIR.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(t=>({default:t.ExportSongModal})));function Dt(){var r;const{song:t}=v(),s=H(),[n,o]=m.useState(!1),i=q(l=>l.onOpenLogin);return m.useEffect(()=>{var p;const l=s.url,a=l.indexOf("?");if(a===-1)return;const c=new URLSearchParams(l.slice(a+1));if(c.get("stems")!=="true")return;c.delete("stems");const x=c.toString(),u=l.slice(0,a),g=x?`${u}?${x}`:u;window.history.replaceState(window.history.state,"",g);const h=(p=s.props.auth)==null?void 0:p.user;if(!h){i();return}h.id===t.user_id&&o(!0)},[i,(r=s.props.auth)==null?void 0:r.user,s.url,t.user_id]),n?e.jsx(m.Suspense,{fallback:null,children:e.jsx(Bt,{isOpen:!0,onClose:()=>o(!1),setIsLoading:()=>{},song:t,openStemsTab:!0})}):null}const Rt=(t,s)=>{const{createChannel:n}=bs(),o=m.useRef(new Set),i=m.useRef(new Map),r=a=>`song.${a}`,l=m.useCallback(a=>{const c=r(a),x=i.current.get(c);x&&x.disconnect();const u=n(c);u.connect({eventName:"SongUpdated",callback:g=>{s(h=>({...h,...g})),(g.status==="complete"||g.status==="error")&&(u.disconnect(),i.current.delete(c),o.current.delete(a))}}),i.current.set(c,u),o.current.add(a)},[n,s]);m.useEffect(()=>{if(!(typeof window>"u"||!window.Echo))return(!o.current.has(t.id)||t.status==="complete"&&!t.audio_url&&!t.audio_streaming_url)&&l(t.id),()=>{i.current.forEach(a=>{a.disconnect()}),i.current.clear()}},[n,l])},It=()=>{const{song:t}=v(),s=t,n={message:"Song unavailable"};if(!s)return e.jsx("div",{className:"py-10",children:e.jsx(Qe,{error:n})});const o=s==null?void 0:s.is_archived;return e.jsx(e.Fragment,{children:o?e.jsx(At,{songPlayerData:s}):e.jsx(Ft,{song:s})})},Ut=({error:t})=>e.jsx(Qe,{error:t}),Mn=({data:t})=>{const s=t.song,[n,o]=m.useState(s);Rt(n,o),m.useEffect(()=>{o(s)},[s]);const i=n,r=m.useMemo(()=>i.gen_id?[Ss(i)]:[],[i]);return e.jsx(e.Fragment,{children:e.jsx(zs,{generations:r,type:"song-generation-block",children:e.jsx(tt,{song:n,mobileBreakpoint:1023,children:e.jsx(Ts,{song:n,children:e.jsxs(Cs,{FallbackComponent:Ut,children:[e.jsx(Dt,{}),e.jsx(It,{})]})})})})})};export{Mn as default};

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.