1import{j as e}from"./vendor-datepicker-mUwVnQp7.js";import{r as s}from"./vendor-carousel-eOiW-ISm.js";import{y as t,u as r,bk as a,c as i,L as n,B as l,U as o,n as c,o as m,p as d,q as u,r as p,s as x,N as h,M as j,C as f,F as g,X as b,bb as v,S as y}from"./index-DJwQ_dWp.js";import{b as N}from"./AppShell-BiIyVwz9.js";import{P as w}from"./PageHeader-CnbobAZm.js";import{S as _}from"./SectionCard-CxICjJse.js";import{S as k,P as S}from"./SecuritySettings-BCvgT6qj.js";import{u as C}from"./vendor-query-ChqQ1kgy.js";import{C as P,a as U,b as T,c as F,d as L}from"./card-C7KdGGZg.js";import{I as M}from"./input-564oIT_C.js";import{L as E}from"./label-BiUZ-4_s.js";import{u as $}from"./vendor-sonner-Bx57qkyD.js";import{L as D}from"./menuIcons-4bvSuG-c.js";import{C as A}from"./circle-check-um4tQLli.js";import{C as q}from"./circle-x-Cgh1pRw1.js";import{C as z}from"./circle-alert-BxsMgE1S.js";import{G as I}from"./globe-DGs_5MD3.js";import{C as R}from"./clock-BmT2uWsA.js";import{b as Y,a as O}from"./vendor-router-D88oCX5H.js";import{R as W,a as B}from"./radio-group-CiX3dpvl.js";import{E as G}from"./eye-off-DJEjM4Ct.js";import{S as V}from"./switch-DJ8rJ9Tz.js";import{S as H,a as K,b as Q,c as X,d as Z}from"./select-3oqYaOge.js";import{o as J}from"./openUrl-D_U4cyhJ.js";import{d as ee}from"./downloadFile-C_E9LLmW.js";import{g as se}from"./useProducts-ByZfTwXb.js";import{B as te}from"./badge-BnG6s2Kl.js";import{T as re}from"./TrackList-DBIOAahd.js";import{D as ae}from"./disc-BZybK9j-.js";import{C as ie}from"./chevron-up-DXVCquW2.js";import{D as ne}from"./download-DL1Gdg3M.js";import{E as le}from"./external-link-ncCUBc5l.js";import{a as oe,v as ce,S as me,P as de,w as ue,p as pe,n as xe,x as he}from"./SocialLinkIcons-PsPo2PXt.js";import{A as je,a as fe,b as ge}from"./avatar-cxleMNtV.js";import{S as be}from"./separator-DcJcGmQi.js";import{S as ve}from"./share-2-CmCeSHX4.js";import{T as ye}from"./textarea-2OxUKEbl.js";import{u as Ne}from"./useR2Upload-B57CZBZ4.js";import{S as we}from"./search-DlSlng9n.js";import{U as _e}from"./upload-D-oR_vwv.js";import{F as ke,E as Se,S as Ce,M as Pe}from"./FinancesTab-CDSCPSuG.js";import{L as Ue,P as Te,R as Fe,T as Le,D as Me}from"./LibraryStorageContent-CH3ZkLZ_.js";import"./vendor-datefns-DKTkwOzo.js";import"./vendor-react-dom-BUeXhaAJ.js";import"./vendor-pdf-B8StZnI9.js";import"./vendor-radix-BwvvbIUE.js";import"./vendor-editor-CNsEXkLA.js";import"./vendor-charts-C09SPE4P.js";import"./vendor-vaul-oOOmFIL-.js";import"./vendor-helmet-B2SYLVK-.js";import"./vendor-supabase-CrWlKdgk.js";import"./vendor-motion-BKiEvAqh.js";import"./sheet-BkBC7AQL.js";import"./AccountShell-CWski-V-.js";import"./sidebar-CA2D1Qa_.js";import"./skeleton-Bjx2OA8B.js";import"./panel-left-5UsFKKU9.js";import"./DashboardHeader-D9ZygL-z.js";import"./profileUrl-BgmvZt5q.js";import"./eye-Dx2xpPK8.js";import"./trending-up-DD8idTQZ.js";import"./folder-open-ht3hd2NS.js";import"./gift-CXB1jOj9.js";import"./lock-CiQvQ4K9.js";import"./shopping-bag-CrWmE0nh.js";import"./message-circle-6p-YIbhq.js";import"./graduation-cap-5gJixMmO.js";import"./library-BVLU8fVp.js";import"./receipt-CNAdROYA.js";import"./triangle-alert-DBQoXaKq.js";import"./trash-2-CiU_V6yF.js";import"./wallet-DhWYGhfo.js";import"./clipboard-list-DrHmTqkr.js";import"./mic-vocal-DRSwaY6a.js";import"./megaphone-DIM_b1OT.js";import"./platform-Dj6Y263k.js";import"./list-music-vVPX4k7E.js";import"./pause-_tQkDiou.js";import"./ellipsis-iZlGvUjs.js";import"./list-plus-DGfxJR6s.js";import"./plus-yh6U7FUK.js";import"./undo-2-B5t1MXRr.js";import"./linkedin-BS1h5VvS.js";import"./youtube-vbivJmP-.js";import"./imageOptimization-Bz8H99hB.js";import"./MusicTab-BdBHp-RU.js";import"./usePaymentAccounts-DwbfGev-.js";import"./getWebAppUrl-6WuuUl1T.js";import"./rich-text-editor-CHUJGP_2.js";import"./underline-CO-c4rxv.js";import"./toggle-Du6FCrD_.js";import"./MediaGallery-OxaBlbOj.js";import"./ellipsis-vertical-B9O4FTeh.js";import"./copy-B-DA6Rji.js";import"./maximize-2-BnHSCHQB.js";import"./pencil-Bnai6EeT.js";import"./file-audio-CzDVQTZE.js";import"./file-video-C_op0EWd.js";import"./list-BE08LWuf.js";import"./link-BAeAgse_.js";import"./tabs-hPs4nKyw.js";import"./vendor-dndkit-XfdMIiVu.js";import"./grip-vertical-BTWgeqQz.js";import"./refresh-cw-CavXJkZ3.js";import"./ProductManager-Doq_QluV.js";import"./ProductFormDialog-bZfNqkHl.js";import"./package-D7-yW9Sl.js";import"./table-CWaGnjSH.js";import"./dollar-sign-C-eMtTWx.js";import"./Events-Bh9lFwap.js";import"./popover-B9D2CEI9.js";import"./calendar-Dc_BAEYC.js";import"./chevron-left-hXyjkEHg.js";
1import"./checkbox-BMpHPW6r.js";import"./useEvents-DG0DdAA-.js";import"./useSharedEvents-BIxfqlQo.js";import"./InvoiceCreateDialog-C2YpKawQ.js";import"./vendor-forms-_Rxj92Mz.js";import"./InvoiceMessagesCard-CuB6q1bm.js";import"./send-D54Zhn3v.js";import"./user-check-p6lVnlBY.js";import"./collapsible-BXmIC204.js";import"./currency-B4kfreHA.js";import"./save-BJEnrkJh.js";import"./trash-BnJ4ZUsY.js";import"./rotate-ccw-T3qAhgRu.js";import"./repeat-DmGiHPdB.js";import"./layout-grid-Bqr6lK5J.js";import"./square-check-big-Bj2IvL7d.js";import"./Finances-DAeySObE.js";import"./useExpenses-CXnOGTcr.js";import"./useBookings-Bbhf6l7O.js";import"./alert-jzC_GmFF.js";import"./file-spreadsheet-BU0sz8O3.js";import"./InvoicesContent-Cgw7Lk2v.js";import"./circle-check-big-D9I_vDKz.js";import"./square-pen-BWlED96f.js";import"./DateRangeFilter-BwC9o1ew.js";import"./DocumentsTab-DcEg5CLz.js";import"./file-upload-GvcxaHN7.js";import"./progress-B6qaUXWZ.js";import"./file-DVJiUN4k.js";import"./file-image-B4ZDP9qa.js";import"./TechSpecsTab-DkjFRdCu.js";import"./StageIcon-9FSL5EBv.js";import"./scroll-area-DQbeyMOe.js";import"./zap-ByuKrDer.js";import"./plug-DLPSWq9O.js";import"./arrow-left-BvskW-Ss.js";import"./rotate-cw-DhzkaQhW.js";import"./unlink-n0gAIq4P.js";import"./drum-Bi-Xgt59.js";import"./toggle-group-DYs_TyXa.js";import"./minimize-2-bd6vUfWR.js";import"./type-hSbEbJDJ.js";import"./table-pU7xibay.js";import"./sparkles-gpVFxivF.js";import"./arrow-right-xGIMToAv.js";import"./paperclip-DlXMF67J.js";import"./user-plus-Kk5CulMx.js";import"./useUserFiles-DEUkMi6r.js";import"./StorageConfigTab-W24WWdSg.js";import"./cloud-CY9E3-QZ.js";import"./arrow-right-left-CeV_uadL.js";import"./shield-check-w0fT4MxV.js";function Ee(){const{profile:h,updateProfile:j,refreshProfile:f}=r(),g=Y(),b=C(),v=a(),[y,N]=s.useState(""),[w,_]=s.useState(!1),[k,S]=s.useState(!1),[O,W]=s.useState(""),[B,G]=s.useState(""),[V,H]=s.useState(!1),K=h?.username||"",{result:Q,checking:X}=function(e,r){const[a,i]=s.useState(null),[n,l]=s.useState(!1),o=s.useRef();return s.useEffect(()=>{i(null);const s=e.toLowerCase().trim();return!s||s.length<3?(l(!1),void(s.length>0&&s.length<3&&i({available:!1,error:"Username must be at least 3 characters"}))):s===r?(i({available:!0,message:"This is your current username"}),void l(!1)):/^[a-z0-9_-]+$/.test(s)?/^[-_]|[-_]$/.test(s)?(i({available:!1,error:"Cannot start or end with a hyphen or underscore"}),void l(!1)):/[-_]{2,}/.test(s)?(i({available:!1,error:"No consecutive hyphens or underscores"}),void l(!1)):(l(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(async()=>{try{const{data:e,error:r}=await t.functions.invoke("check-username",{body:{username:s}});i(r?{available:!1,error:"Unable to check availability"}:e)}catch{i({available:!1,error:"Unable to check availability"})}finally{l(!1)}},400),()=>{o.current&&clearTimeout(o.current)}):(i({available:!1,error:"Only letters, numbers, hyphens, and underscores allowed"}),void l(!1))},[e,r]),{result:a,checking:n}}(y,K);s.useEffect(()=>{h&&(N(h.username||""),G(h.display_name||""))},[h]);const Z=h?.username_change_count??0,J=s.useMemo(()=>{const e=h?.last_username_change;if((h?.username_change_count??0)<2)return{canChange:!0,daysRemaining:0};if(!e)return{canChange:!0,daysRemaining:0};const s=Math.floor((Date.now()-new Date(e).getTime())/864e5);return{canChange:s>=30,daysRemaining:Math.max(0,30-s)}}
1,[h]),ee=h?.first_name||"",se=h?.last_name||"";return e.jsxs(e.Fragment,{children:[e.jsxs(P,{children:[e.jsxs(U,{children:[e.jsxs(T,{className:"flex items-center gap-2",children:[e.jsx(D,{className:"h-5 w-5"}),"Profile URL"]}),e.jsx(F,{children:"Your unique address on World Music Method."})]}),e.jsx(L,{className:"space-y-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-1 sm:gap-0 flex-1 min-w-0",children:[e.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground sm:bg-muted sm:px-3 sm:py-2 sm:rounded-l-md sm:border sm:border-r-0 sm:border-input whitespace-nowrap font-mono",children:"worldmusicmethod.com/"}),e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsx(M,{value:y,onChange:e=>N(e.target.value.toLowerCase().replace(/[^a-z0-9_-]/g,"")),placeholder:"yourname",className:i("pr-9 min-w-0 w-full sm:rounded-l-none",!0===Q?.available&&y!==K&&"border-green-500 focus-visible:ring-green-500",!1===Q?.available&&"border-destructive focus-visible:ring-destructive"),maxLength:30,disabled:!J.canChange}),e.jsxs("div",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:[X&&e.jsx(n,{className:"h-4 w-4 animate-spin text-muted-foreground"}),!X&&!0===Q?.available&&y!==K&&e.jsx(A,{className:"h-4 w-4 text-green-500"}),!X&&!1===Q?.available&&e.jsx(q,{className:"h-4 w-4 text-destructive"})]})]})]}),e.jsx(l,{onClick:()=>{const e=y.trim();e?(W(e),S(!0)):$.error("Username cannot be empty")},disabled:w||y===K||!J.canChange||X||!1===Q?.available||!y.trim()||y.trim().length<3,size:"sm",variant:"outline",className:"w-full sm:w-auto shrink-0",children:w?"Saving...":"Set"})]}),!X&&Q?.error&&e.jsxs("p",{className:"text-xs text-destructive flex items-center gap-1.5",children:[e.jsx(z,{className:"h-3 w-3"})," ",Q.error]}),!X&&Q?.available&&y!==K&&e.jsxs("p",{className:"text-xs text-green-600 dark:text-green-400 flex items-center gap-1.5",children:[e.jsx(A,{className:"h-3 w-3"})," Username is available!"]}),!X&&Q?.message&&y===K&&e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[e.jsx(A,{className:"h-3 w-3"})," ",Q.message]}),K&&e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[e.jsx(I,{className:"h-3 w-3"}),"Your profile URL:"," ",e.jsxs("span",{className:"font-mono font-medium text-foreground",children:["worldmusicmethod.com/",K]})]}),!J.canChange&&e.jsxs("p",{className:"text-xs text-amber-600 dark:text-amber-400 flex items-center gap-1.5",children:[e.jsx(R,{className:"h-3 w-3"})," Username can be changed again in ",J.daysRemaining," days"]}),J.canChange&&1===Z&&K&&e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[e.jsx(z,{className:"h-3 w-3"})," You have one free retry to change your username. After that, a 30-day cooldown applies."]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"3-30 characters. Letters, numbers, hyphens, underscores only. Changing your username creates a redirect from your old URL."})]})})]}),e.jsxs(P,{children:[e.jsxs(U,{children:[e.jsxs(T,{className:"flex items-center gap-2",children:[e.jsx(o,{className:"h-5 w-5"}),"Display Name"]}),e.jsx(F,{children:"This is the name shown on your profile and in the community. It can be your real name, stage name, or band name."})]}),e.jsxs(L,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(E,{children:"Display Name"}),e.jsx(M,{value:B,onChange:e=>G(e.target.value),placeholder:`${ee} ${se}`.trim()||"Your display name",maxLength:60}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Leave blank to use your first and last name (",`${ee} ${se}`.trim()||"set in Personal Info",")."]})]}),e.jsx(l,{onClick:async()=>{H(!0);const{error:e}=await j({display_name:B||null});e?$.error("Failed to save: "+e.message):($.success("Display name saved"),b.invalidateQueries({queryKey:["profile"]}),b.invalidateQueries({queryKey:["user-profile"]}),b.invalidateQueries({queryKey:["extended-profile"]}),await f()),H(!1)},disabled:V,children:V?"Saving...":"Save"})]})]}),e.jsx(c,{open:k,onOpenChange:S,children:e.jsxs(m,{className:"max-w-md",children:[e.jsxs(d,{children:[e.jsx(u,{children:"Confirm Username Change"}),e.jsx(p,{children:0===Z?`You're about to set your username to "${O}". You'll get one free retry to change it again. After that, you won't be able to change it for 30 days.`:1===Z?`You're about to change your username to "${O}". This is your last free change. After this, you won't be able to change it again for 30 days.`:`You're about to change your username to "${O}". You won't be able to change it again for 30 days.`})]}),e.jsxs(x,{children:[e.jsx(l,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),e.jsx(l,{onClick:async()=>{S(!1),_(!0);try{const e=await v.mutateAsync(O);if(e.success){const s=e.username||O;$.success(e.message||"Username updated"),g(`/${s}`,{replace:!0})}else $.error(e.error||"Failed to change username")}catch(e){$.error(e instanceof Error?e.message:"Failed to change username")}_(!1)},disabled:w,children:w?"Saving...":"Confirm"})]})]})})]})}function $e(){const{profile:t,updateProfile:a}=r(),[i,n]=s.useState("private"),[o,c]=s.useState(!1);return s.useEffect(()=>{t&&n(t.visibility||"private")},[t]),e.jsxs(P,{className:"border-primary/20",children:[e.jsxs(U,{children:[e.jsxs(T,{className:"flex items-center gap-2",children:["public"===i?e.jsx(I,{className:"h-5 w-5 text-green-500"}):"members"===i?e.jsx(h,{className:"h-5 w-5 text-blue-500"}):e.jsx(G,{className:"h-5 w-5 text-muted-foreground"}),"Profile Visibility"]}),e.jsx(F,{children:"Control who can see your profile and where it appears"})]}),e.jsxs(L,{className:"space-y-4",children:[e.jsxs(W,{value:i,onValueChange:e=>n(e),className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start space-x-3 p-3 rounded-lg border border-green-500/30 bg-green-500/5 hover:bg-green-500/10 transition-colors",children:[e.jsx(B,{value:"public",id:"visibility-public",className:"mt-1"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs(E,{htmlFor:"visibility-public",className:"flex items-center gap-2 cursor-pointer font-medium text-green-600 dark:text-green-400",children:[e.jsx(I,{className:"h-4 w-4"})," Public"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Everyone can see your profile. You'll appear in the community members page."})]})]}),e.jsxs("div",{className:"flex items-start space-x-3 p-3 rounded-lg border hover:bg-muted/50 transition-colors",children:[e.jsx(B,{value:"members",id:"visibility-members",className:"mt-1"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs(E,{htmlFor:"visibility-members",className:"flex items-center gap-2 cursor-pointer font-medium",children:[e.jsx(h,{className:"h-4 w-4"})," Members Only"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Only logged-in community members can see your profile. You won't appear in public member listings."})]})]}),e.jsxs("div",{className:"flex items-start space-x-3 p-3 rounded-lg border hover:bg-muted/50 transition-colors",children:[e.jsx(B,{value:"private",id:"visibility-private",className:"mt-1"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs(E,{htmlFor:"visibility-private",className:"flex items-center gap-2 cursor-pointer font-medium",children:[e.jsx(G,{className:"h-4 w-4"})," Private"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Your profile is hidden. You cannot post or comment in the community."})]})]})]}),"private"===i&&e.jsx("div",{className:"p-3 rounded-lg bg-amber-500/10 border border-amber-500/30",children:e.jsx("p",{className:"text-sm text-amber-600 dar
1k:text-amber-400",children:'â ï¸ With a private profile, you cannot post or comment in the community. Change to "Members Only" or "Public" to participate.'})}),e.jsxs("div",{className:"p-3 rounded-lg bg-muted border text-sm text-muted-foreground",children:[e.jsx("strong",{children:"Search engines:"})," Only Public profiles are indexed by Google and other search engines. Members Only and Private profiles are hidden from search results."]}),e.jsx(l,{onClick:async()=>{c(!0);const{error:e}=await a({visibility:i,is_public:"public"===i});e?$.error("Failed to save: "+e.message):$.success("Visibility updated"),c(!1)},disabled:o,children:o?"Saving...":"Save Visibility"})]})]})}const De=[{key:"email_reminders",label:"Event Reminders",desc:"Receive reminders for upcoming events"},{key:"email_invoices",label:"Invoice Updates",desc:"Get notified about invoice status changes"},{key:"email_friend_requests",label:"Friend Requests",desc:"Notifications when someone sends a friend request"},{key:"email_comments",label:"Comments",desc:"Notifications when someone comments on your posts"},{key:"email_mentions",label:"Mentions",desc:"Notifications when someone mentions you"}],Ae=[{key:"push_events",label:"Event Updates",desc:"Real-time updates for your events"},{key:"push_messages",label:"Messages",desc:"New messages from other users"}],qe={email_reminders:!0,email_invoices:!0,email_friend_requests:!1,email_comments:!1,email_mentions:!1,push_events:!0,push_messages:!0};function ze(){const{profile:t,updateProfile:a}=r(),[i,n]=s.useState(qe),[o,c]=s.useState("community");s.useEffect(()=>{t&&(n({email_reminders:t.notification_email_reminders??!0,email_invoices:t.notification_email_invoices??!0,email_friend_requests:t.notification_email_friend_requests??!1,email_comments:t.notification_email_comments??!1,email_mentions:t.notification_email_mentions??!1,push_events:t.notification_push_events??!0,push_messages:t.notification_push_messages??!0}),c(t.message_privacy||"community"))},[t]);const m=(e,s)=>n(t=>({...t,[e]:s}));return e.jsxs(P,{children:[e.jsxs(U,{children:[e.jsx(T,{children:"Notification Preferences"}),e.jsx(F,{children:"Choose how you want to be notified"})]}),e.jsxs(L,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-medium",children:"Email Notifications"}),e.jsx("div",{className:"space-y-3",children:De.map(({key:s,label:t,desc:r})=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(E,{children:t}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),e.jsx(V,{checked:i[s],onCheckedChange:e=>m(s,e)})]},s))})]}),e.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[e.jsx("h3",{className:"font-medium",children:"Push Notifications"}),e.jsx("div",{className:"space-y-3",children:Ae.map(({key:s,label:t,desc:r})=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(E,{children:t}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),e.jsx(V,{checked:i[s],onCheckedChange:e=>m(s,e)})]},s))})]}),e.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[e.jsx("h3",{className:"font-medium",children:"Message Privacy"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(E,{children:"Who can send you messages?"}),e.jsxs(H,{value:o,onValueChange:c,children:[e.jsx(K,{children:e.jsx(Q,{})}),e.jsxs(X,{children:[e.jsx(Z,{value:"community",children:"Anyone in the community"}),e.jsx(Z,{value:"friends",children:"Friends only"})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"friends"===o?"Only people you are friends with can message you":"Anyone in the community can send you messages"})]})]}),e.jsx(l,{onClick:async()=>{const{error:e}=await a({message_privacy:o,notification_email_reminders:i.email_reminders,notification_email_invoices:i.email_invoices,notification_email_friend_requests:i.email_friend_requests,notification_email_comments:i.email_comments,notification_email_mentions:i.email_mentions,notification_push_events:i.push_events,notification_push_messages:i.push_messages});e?$.error("Failed to save: "+e.message):$.success("Notification preferences saved")},children:"Save Preferences"})]})]})}function Ie(){const{user:a}=r(),{data:i=[],isLoading:l}=se(),[o,c]=s.useState(null);return l?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(n,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):i.length?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Music Purchases"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Albums and tracks you've bought"})]}),e.jsxs(te,{variant:"secondary",children:[i.length," album",1!==i.length?"s":""]})]}),e.jsx("div",{className:"space-y-3",children:i.map(s=>{const r=s.album;return r?e.jsx(Re,{album:r,isDownloading:o===r.id,onDownload:()=>(async e=>{if(a){c(e);try{const{data:{session:s}}=await t.auth.getSession();if(!s)throw new Error("Not authenticated");const r="https://bfwvjhrokucqjcbeufwk.supabase.co",a=await fetch(`${r}/functions/v1/generate-album-zip`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s.access_token}`},body:JSON.stringify({albumId:e})});if(!a.ok){const e=await a.json().catch(()=>({}));throw new Error(e.error||`Server error: ${a.status}`)}const n=await a.blob();
1if(!n||0===n.size)throw new Error("Download failed â empty file received");const l=i.find(s=>s.album?.id===e),o=(l?.album?.title||"album").replace(/[^a-zA-Z0-9\s\-]/g,"").trim();await ee(n,`${o}.zip`)}catch(s){$.error(s.message||"Failed to download album")}finally{c(null)}}})(r.id)},s.id):null})})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx(j,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-semibold",children:"Your music library is empty"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Purchase albums from artists on the platform to listen here."})]})}function Re({album:r,isDownloading:a,onDownload:o}){const[c,m]=s.useState(!1),[d,u]=s.useState([]),[p,x]=s.useState(null);s.useEffect(()=>{c&&t.from("product_bonus_files").select("id, file_url, file_name, mime_type").eq("album_id",r.id).order("sort_order").then(({data:e})=>{e&&u(e)})},[c,r.id]);const h=(r.tracks||[]).sort((e,s)=>(e.position??0)-(s.position??0)).map(e=>{const s=e.track;return s?{id:s.id,title:s.title,artist_id:s.artist_id,artist_name:s.artist_name||r.artist_name||r.seller?.full_name||void 0,album_name:r.title,media_type:s.media_type||"audio",content_type:s.content_type||"song",audio_url:s.audio_url,cover_image_url:s.cover_image_url||r.cover_image_url,duration_seconds:s.duration_seconds,release_date:s.release_date,genre:s.genre||r.genre,country:s.country,description:s.description,is_published:!0,play_count:s.play_count||0,podcast_id:null,episode_number:null,created_at:s.created_at,artist:s.artist}:null}).filter(Boolean);return e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"overflow-hidden",children:e.jsx(L,{className:"p-0",children:e.jsxs("div",{className:i("flex flex-col",c&&"sm:flex-row"),children:[e.jsxs("button",{type:"button",onClick:()=>m(!c),className:i("flex items-center gap-4 p-4 text-left w-full hover:bg-muted/50 transition-colors focus:outline-none",c&&"sm:w-1/3 sm:flex-none sm:border-r border-border/50"),children:[e.jsx("div",{className:"w-14 h-14 rounded-md overflow-hidden flex-shrink-0 bg-muted",children:r.cover_image_url?e.jsx("img",{src:r.cover_image_url,alt:r.title,className:"w-full h-full object-cover"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx(ae,{className:"h-6 w-6 text-muted-foreground/30"})})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-semibold truncate",children:r.title}),e.jsxs("p",{className:"text-sm text-muted-foreground truncate",children:[r.artist_name||r.seller?.full_name||"Unknown Artist",r.release_year?` · ${r.release_year}`:""]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.length," track",1!==h.length?"s":""]})]}),c?e.jsx(ie,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}):e.jsx(f,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"})]})})]}),c&&e.jsxs("div",{className:"flex-1 p-4 border-t sm:border-t-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("p",{className:"text-sm font-medium",children:"Album Tracks"}),e.jsxs(l,{size:"sm",variant:"outline",className:"gap-1.5",disabled:a,onClick:e=>{e.stopPropagation(),o()},children:[a?e.jsx(n,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ne,{className:"h-3.5 w-3.5"}),"Download ZIP"]})]}),e.jsx("div",{className:"max-h-80 overflow-y-auto",children:h.length>0?e.jsx(re,{tracks:h,variant:"compact"}):e.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No tracks found in this album."})}),d.length>0&&e.jsxs("div",{className:"mt-4 pt-3 border-t border-border/50",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"Bonus Files"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:d.map((s,t)=>{const r=s.mime_type?.startsWith("image/")||/\.(jpg|jpeg|png|gif|webp|svg)$/i.test(s.file_url);return"application/pdf"===s.mime_type||s.file_url.toLowerCase().endsWith(".pdf"),e.jsx("button",{type:"button",onClick:()=>x(t),className:"relative w-20 h-20 rounded-lg border border-border overflow-hidden bg-muted hover:border-primary/50 transition-colors flex items-center justify-center group",title:s.file_name,children:r?e.jsx("img",{src:s.file_url,alt:s.file_name,className:"w-full h-full object-cover"}):e.jsxs("div",{className:"flex flex-col items-center gap-1 p-1",children:[e.jsx(g,{className:"h-6 w-6 text-muted-foreground"}),e.jsx("span",{className:"text-[9px] text-muted-foreground truncate max-w-full",children:s.file_name})]})},s.id)})})]})]})]})})}),null!==p&&d.length>0&&e.jsx("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>x(null),children:e.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-xl max-w-2xl w-full max-h-[90vh] flex flex-col overflow-hidden",onClick:e=>e.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:d[p]?.file_name}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[p+1," / ",d.length]}),e.jsx(l,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>x(null),children:e.jsx(b,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center p-6 min-h-0 overflow-auto",children:(()=>{const s=d[p];return s.mime_type?.startsWith("image/")||/\.(jpg|jpeg|png|gif|webp|svg)$/i.test(s.file_url)?e.jsx("img",{src:s.file_url,alt:s.file_name,className:"max-w-full max-h-[60vh] object-contain rounded"}):e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx(g,{className:"h-16 w-16 text-muted-foreground"}),e.jsx("p",{className:"text-sm font-medium",children:s.file_name}),e.jsxs(l,{variant:"outline",size:"sm",onClick:()=>J(s.file_url),children:[e.jsx(le,{className:"h-4 w-4 mr-2"})," Open file"]})]})})()}),d.length>1&&e.jsxs("div",{className:"flex items-center justify-between p-3 border-t border-border",children:[e.jsx(l,{variant:"ghost",size:"sm",disabled:0===p,onClick:()=>x(e=>null!==e?Math.max(0,e-1):0),children:"â Previous"}),e.jsx(l,{variant:"ghost",size:"sm",disabled:p===d.length-1,onClick:()=>x(e=>null!==e?Math.min(d.length-1,e+1):0),children:"Next â"})]})]})})]})}function Ye({socialLinks:t}){const[a,i]=s.useState({}),[n,o]=s.useState(["","",""]),[c,m]=s.useState(!1),d=oe(),{profile:u}=r();s.useEffect(()=>{const e={};for(const s of ce){const r=t?.[s.key]||"";e[s.key]=r.startsWith(s.baseUrl)?r.slice(s.baseUrl.length):r}i(e)},[t]),s.useEffect(()=>{o([t?.website_1||"",t?.website_2||"",t?.website_3||""])},[t]);const p=async()=>{const e={};for(const s of ce){const t=a[s.key]?.trim();t&&(e[s.key]=s.baseUrl+t)}for(let s=0;s<3;s++){const t=n[s]?.trim();t&&(e[`website_${s+1}`]=t)}m(!0);try{await d.mutateAsync({social_links:e})}finally{m(!1)}},x=(()=>{for(const e of ce){const s=a[e.key]?.trim()||"",r=t?.[e.key]||"";if(s!==(r.startsWith(e.baseUrl)?r.slice(e.baseUrl.length):r))return!0}for(let e=0;e<3;e++)if((n[e]?.trim()||"")!==(t?.[`website_${e+1}`]||""))return!0;return!1})(),h=s=>{const t=ue(s.key);return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(E,{className:"flex items-center gap-2 text-sm",children:[e.jsx(t,{className:"h-4 w-4 text-muted-foreground"}),s.label]}),e.jsxs("div",{className:"flex",children:[e.jsx("span",{className:"inline-flex items-center rounded-l-md border border-r-0 border-input bg-muted px-2 text-xs text-muted-foreground select-all whitespace-nowrap",children:s.baseUrl}),e.jsx(M,{value:a[s.key]||"",onChange:e=>i(t=>({...t,[s.key]:e.target.value})),className:"rounded-l-none h-9 text-sm",placeholder:"username"})]})]},s.key)},j=(()=>{const e={};for(const s of ce){const t=a[s.key]?.trim();t&&(e[s.key]=s.baseUrl+t)}for(let s=0;s<3;s++){const t=n[s]?.trim();t&&(e[`website_${s+1}`]=t)}return e})(),f=u?.full_name||u?.username||"Your name",g=u?.tagline||"",b=f.split(" ").map(e=>
1e[0]).filter(Boolean).slice(0,2).join("").toUpperCase(),y=Object.keys(j).length>0,N=v(u);return e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsx("div",{className:"lg:col-span-2 order-2 lg:order-1",children:e.jsxs(P,{children:[e.jsxs(U,{children:[e.jsxs(T,{className:"flex items-center gap-2",children:[e.jsx(ve,{className:"h-5 w-5"}),"Social Links"]}),e.jsx(F,{children:"Add links to your social media profiles"})]}),e.jsxs(L,{className:"space-y-5 pt-0",children:[e.jsx(l,{onClick:p,disabled:c||!x,children:c?"Saving...":"Save Social Links"}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground",children:"Social Media"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:ce.filter(e=>"social"===e.group).map(h)})]}),e.jsx(be,{}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground",children:"Music Platforms"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:ce.filter(e=>"music"===e.group).map(h)})]}),e.jsx(be,{}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground",children:"External Links"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Add up to 3 links to your website or other pages."}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[0,1,2].map(s=>e.jsxs("div",{className:"space-y-1",children:[e.jsxs(E,{className:"flex items-center gap-2 text-sm",children:[e.jsx(le,{className:"h-4 w-4 text-muted-foreground"}),"Website ",s+1]}),e.jsx(M,{value:n[s]||"",onChange:e=>{const t=[...n];t[s]=e.target.value,o(t)},placeholder:"https://yourwebsite.com",className:"h-9 text-sm"})]},s))})]}),e.jsx(l,{onClick:p,disabled:c||!x,className:"mt-2",children:c?"Saving...":"Save Social Links"})]})]})}),e.jsx("div",{className:"lg:col-span-1 order-1 lg:order-2",children:e.jsxs("div",{className:"lg:sticky lg:top-6 space-y-2",children:[e.jsx(E,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Live preview"}),e.jsx("div",{style:N,children:e.jsx(P,{className:"profile-font-scope border-[3px] border-primary/20 shadow-md",children:e.jsxs(L,{className:"p-5 flex flex-col items-center text-center space-y-3",children:[e.jsxs(je,{className:"h-20 w-20",children:[e.jsx(fe,{src:u?.avatar_url||void 0,alt:f}),e.jsx(ge,{className:"text-lg",children:b||"?"})]}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("h3",{className:"font-semibold text-base leading-tight",children:f}),g&&e.jsx("p",{className:"text-xs text-muted-foreground",children:g})]}),y?e.jsxs("div",{className:"flex flex-col items-center gap-2 w-full",children:[e.jsx(me,{links:j,className:"justify-center"}),e.jsx(de,{links:j,className:"items-center w-full max-w-full"})]}):e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Your social icons and links will appear here as you type."})]})})}),e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"This is how your links will appear on your public profile card."})]})})]})}function Oe({ogTitle:t,ogDescription:r,ogImageUrl:a,displayName:o,tagline:c,bio:m,coverImageUrl:d,username:u}){const p=pe(),[x,h]=s.useState(t||""),[j,f]=s.useState(r||""),[g,v]=s.useState(a||""),[y,N]=s.useState(!1),{uploadFile:w,isUploading:_}=Ne(),k=s.useRef(null);s.useEffect(()=>{h(t||""),f(r||""),v(a||"")},[t,r,a]);const S=x||`${o}${c?`: ${c}`:""} | World Music Method`,C=j||m?.slice(0,160)||"",D=g||d||"",A=`worldmusicmethod.com/${u||""}`,q=x!==(t||"")||j!==(r||"")||g!==(a||"");return e.jsxs(P,{children:[e.jsxs(U,{children:[e.jsxs(T,{className:"flex items-center gap-2",children:[e.jsx(we,{className:"h-5 w-5"}),"Search & Social Sharing"]}),e.jsx(F,{children:"Control how your profile appears in Google search results and when shared on social media."})]}),e.jsx(L,{className:"pt-0",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 items-start",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(E,{children:"Title"}),e.jsxs("span",{className:i("text-xs",x.length>60?"text-destructive":"text-muted-foreground"),children:[x.length,"/60"]})]}),""===x&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground bg-muted/50 rounded px-2 py-1",children:[e.jsx(z,{className:"h-3 w-3 shrink-0"}),"Using your profile name as default. Type here to customise"]}),e.jsx(M,{value:x,onChange:e=>h(e.target.value.slice(0,60)),placeholder:`${o}${c?`: ${c}`:""}`,maxLength:60}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This is the title shown in Google search results and social media previews. Currently pulled from your profile name and tagline. Type here to override."})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(E,{children:"Description"}),e.jsxs("span",{className:i("text-xs",j.length>160?"text-destructive":"text-muted-foreground"),children:[j.length,"/160"]})]}),""===j&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground bg-muted/50 rounded px-2 py-1",children:[e.jsx(z,{className:"h-3 w-3 shrink-0"}),"Using your bio as default. Type here to customise"]}),e.jsx(ye,{value:j,onChange:e=>f(e.target.value.slice(0,160)),placeholder:m?.slice(0,160)||"A short description of your profile...",maxLength:160,rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The summary shown under your title in Google and social previews. Currently pulled from your profile bio. Type here to override."})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(E,{children:"Share Image"}),e.jsxs("div",{className:"relative w-full max-w-xs aspect-[1200/630] rounded-lg border-2 border-dashed border-border bg-muted/30 flex items-center justify-center cursor-pointer overflow-hidden",onClick:()=>k.current?.click(),children:[g?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:g,alt:"OG preview",className:"w-full h-full object-cover"}),e.jsx(l,{type:"button",variant:"destructive",size:"icon",className:"absolute top-2 right-2 h-7 w-7",onClick:e=>{e.stopPropagation(),v("")},children:e.jsx(b,{className:"h-3.5 w-3.5"})})]}):e.jsxs("div",{className:"flex flex-col items-center gap-1 text-muted-foreground",children:[e.jsx(_e,{className:"h-6 w-6"}),e.jsx("span",{className:"text-xs",children:"Upload image"})]}),_&&e.jsx("div",{className:"absolute inset-0 bg-background/70 flex items-center justify-center",children:e.jsx(n,{className:"h-6 w-6 animate-spin"})})]}),e.jsx("input",{ref:k,type:"file",accept:"image/*",className:"hidden",onChange:async e=>{const s=e.target.files?.[0];if(!s)return;const t=await w(s,{bucket:"user",folder:"og-images",imageOptimization:"media"});t?.url&&v(t.url)}}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"1200 x 630px recommended. Falls back to your cover photo if empty."})]}),e.jsx(l,{onClick:async()=>{N(!0);try{await p.mutateAsync({og_title:x||null,og_description:j||null,og_image_url:g||null}),$.success("Settings saved")}catch(e){console.error("Failed to save search settings:",e),$.error("We couldn't save your changes. Please try again or refresh the page.")}finally{N(!1)}},disabled:y||!q,children:y?"Saving...":"Save"})]}),e.jsxs("div",{className:"space-y-1.5 lg:sticky lg:top-4",children:[e.jsx(E,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Preview"}),e.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 overflow-hidden max-w-sm",children:[D&&e.jsx("div",{className:"aspect-[1200/630] bg-muted",children:e.jsx("img",{src:D,alt:"",className:"w-full h-full object-cover"})}),e.jsxs("div",{className:"p-3 space-y-1",children:[e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A}),e.jsx("p",{className:"font-semibold text-sm line-clamp-1",children:S}),C&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:C})]})]})]})]})})]})}const We={identity:{title:"Identity",subtitle:"Username, display name and bio"},"social-links":{title:"Social Links",subtitle:"Connect your social profiles"},seo:{title:"Search Settings",subtitle:"How your profile appears in search engines"},appearance:{title:"Brand Settings",subtitle:"Fonts, colours and look"},visibility:{title:"Profile Visibility",subtitle:"Who can see your profile and content"},"personal-info":{title:"Personal Info",subtitle:"Name, email and basic details"},"my-music":{title:"Music Purchases",subtitle:"Albums and tracks you've bought"},security:{title:"Password & Security",subtitle:"Login, password and sessions"},notifications:{title:"Notifications",subtitle:"Email and in-app preferences"},music:{title:"Music",subtitle:"Manage your tracks, albums and audio"},shop:{title:"Shop",subtitle:"Products, pricing and storefront"},events:{title:"Events",subtitle:"Gigs, sessions and bookings"},finances:{title:"Finances",subtitle:"Invoices, expenses and reporting"},documents:{title:"Documents",subtitle:"Files, contracts and paperwork"},"tech-spec":{title:"Tech Spec",subtitle:"Stage plots and technical requirements"}
1,repertoire:{title:"Repertoire",subtitle:"Your repertoire library"},projects:{title:"Projects",subtitle:"Bands, ensembles and collaborations"},library:{title:"Library & Storage",subtitle:"Your media library and storage"}};function Be(){const{user:t,profile:a,loading:i}=r(),{data:n}=xe(),l=Y(),[o]=O(),c=o.get("section")||"identity",m=We[c]?c:"identity";if(s.useEffect(()=>{i||t||l("/auth")},[t,i,l]),i)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx("div",{className:"animate-spin h-8 w-8 border-4 border-primary border-t-transparent rounded-full"})});const d=We[m],u=(()=>{switch(m){case"identity":return e.jsx(_,{children:e.jsx(Ee,{})});case"social-links":return e.jsx(_,{children:e.jsx(Ye,{socialLinks:a?.social_links||{}})});case"seo":return e.jsx(_,{children:e.jsx(Oe,{ogTitle:n?.og_title||"",ogDescription:n?.og_description||"",ogImageUrl:n?.og_image_url||"",displayName:a?.full_name||"",tagline:a?.tagline||"",bio:a?.bio||"",coverImageUrl:a?.cover_image_url||"",username:a?.username||""})});case"appearance":return e.jsx(_,{children:e.jsx(he,{})});case"visibility":return e.jsx(_,{children:e.jsx($e,{})});case"personal-info":return e.jsx(_,{children:e.jsx(S,{})});case"my-music":return e.jsx(_,{children:e.jsx(Ie,{})});case"security":return e.jsx(_,{children:e.jsx(k,{})});case"notifications":return e.jsx(_,{children:e.jsx(ze,{})});case"music":return e.jsx(_,{children:e.jsx(Pe,{})});case"shop":return e.jsx(_,{children:e.jsx(Ce,{})});case"events":return e.jsx(_,{children:e.jsx(Se,{})});case"finances":return e.jsx(_,{children:e.jsx(ke,{})});case"documents":return e.jsx(_,{children:e.jsx(Me,{})});case"tech-spec":return e.jsx(_,{children:e.jsx(Le,{})});case"repertoire":return e.jsx(_,{children:e.jsx(Fe,{})});case"projects":return e.jsx(_,{children:e.jsx(Te,{})});case"library":return e.jsx(_,{children:e.jsx(Ue,{})});default:return null}})();return e.jsxs(N,{children:[e.jsx(y,{title:"My Account",noindex:!0}),e.jsxs("div",{className:"p-6 lg:p-8 space-y-8",children:[e.jsx(w,{title:d.title,subtitle:d.subtitle}),u]})]})}export{Be as default}; 2//# sourceMappingURL=ArtuAccount-BrcbaWxI.js.map
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.