1import{a as C,r as n,b as x,j as t,D as E}from"./index-B0eGCMqj.js";import{E as L}from"./ErrorState-CSo2kor_.js";import{M as F,h as T,a as W}from"./CreatorProfileModals-B4LYAG-Q.js";import{s as w}from"./share-D9A_qngs.js";import"./img-youtube-RsHBXfqI.js";import"./cancel-BCkV1QHJ.js";const P="_page_1rvgn_10",A="_stateMsg_1rvgn_12",$="_pills_1rvgn_21",H="_pill_1rvgn_21",R="_pillActive_1rvgn_33",D="_grid_1rvgn_48",K="_card_1rvgn_59",V="_photo_1rvgn_72",G="_brandMark_1rvgn_77",O="_shareIcon_1rvgn_85",q="_overlay_1rvgn_90",z="_momentBadge_1rvgn_94",J="_badgeLabel_1rvgn_100",Q="_badgeId_1rvgn_101",U="_momentInfo_1rvgn_102",X="_momentText_1rvgn_106",Y="_momentName_1rvgn_107",Z="_momentHandle_1rvgn_108",ee="_creatorBadge_1rvgn_109",te="_shareBtn_1rvgn_118",ae="_loadMoreWrap_1rvgn_136",ne="_loadMoreBtn_1rvgn_137",a={page:P,stateMsg:A,pills:$,pill:H,pillActive:R,grid:D,card:K,photo:V,brandMark:G,shareIcon:O,overlay:q,momentBadge:z,badgeLabel:J,badgeId:Q,momentInfo:U,momentText:X,momentName:Y,momentHandle:Z,creatorBadge:ee,shareBtn:te,loadMoreWrap:ae,loadMoreBtn:ne},se=[{key:"all",label:"All"},{key:"fan",label:"Fan Moments"},{key:"creator",label:"Creator Moments"}],c=20;function me(){const _=C(),[s,i]=n.useState(null),[r,v]=n.useState("all"),[b,g]=n.useState(null),[l,h]=n.useState(null),[j,y]=n.useState(0),[k,p]=n.useState(1),[u,d]=n.useState(!1),[m,f]=n.useState(!1);n.useEffect(()=>{i(null),h(null),p(1),d(!1),x("creatorProfile").getCapturedMoments({filter_type:r,page:1,limit:c}).then(e=>{const o=e.data.moments??[];i(o),d(o.length<c)}).catch(e=>h(e instanceof Error?e:new Error(e?.message??"Failed to load moments")))},[r,j]);const N=()=>y(e=>e+1),B=()=>{if(m||u||s===null)return;const e=k+1;f(!0),x("creatorProfile").getCapturedMoments({filter_type:r,page:e,limit:c}).then(o=>{const M=o.data.moments??[];i(S=>[...S??[],...M]),p(e),M.length<c&&d(!0)}).catch(()=>_.error("Couldnât load more moments. Please try again.")).finally(()=>f(!1))},I=e=>w({title:"My Fancall Moment",text:e.ticket_id?`My Fancall Moment ${e.ticket_id}`:"My Fancall Moment",url:e.share_url??(e.ticket_id?`https://fancall.in/moment/${e.ticket_id}`:"https://fancall.in")},_);return t.jsxs(E,{role:"creator",title:"Captured Moments",backTo:"/creator/profile",children:[t.jsxs("div",{className:a.page,children:[t.jsx("div",{className:a.pills,role:"tablist","aria-label":"Moment filters",children:se.map(e=>t.jsx("button",{type:"button",role:"tab","aria-selected":r===e.key,className:`${a.pill} ${r===e.key?a.pillActive:""}`,onClick:()=>v(e.key),children:e.label},e.key))}),l?t.jsx(L,{onRetry:N,title:"Couldnât load your moments"}):null,!l&&s===null?t.jsx("p",{className:a.stateMsg,children:"Loadingâ¦"}):null,!l&&s!==null&&s.length===0?t.jsx("p",{className:a.stateMsg,children:"No moments yet."}):null,t.jsx("div",{className:a.grid,hidden:!!l||!s?.length,children:!l&&s?.map(e=>t.jsxs("div",{className:a.card,children:[t.jsxs("div",{className:a.photo,children:[t.jsx(F,{media_url:e.media_url,tint:e.tint,alt:`Fancall moment #${e.id}`}),t.jsx("button",{type:"button",className:a.shareIcon,"aria-label":"Share moment",onClick:o=>{o.stopPropagation(),I(e)},children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 18 18","aria-hidden":"true",children:[t.jsx("circle",{cx:"4",cy:"9",r:"2.2",fill:"none",stroke:"#fff",strokeWidth:"1.5"}),t.jsx("circle",{cx:"14",cy:"3.6",r:"2.2",fill:"none",stroke:"#fff",strokeWidth:"1.5"}),t.jsx("circle",{cx:"14",cy:"14.4",r:"2.2",fill:"none",stroke:"#fff",strokeWidth:"1.5"}),t.jsx("path",{d:"M6 8l6-3.4M6 10l6 3.4",stroke:"#fff",strokeWidth:"1.5"})]})}),T(e)?null:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:a.brandMark,"aria-hidden":"true",children:"â fancall"}),t.jsxs("div",{className:a.overlay,children:[t.jsxs("span",{className:a.momentBadge,children:[t.jsx("span",{className:a.badgeLabel,children:"My Fancall Moment"}),t.jsxs("span",{className:a.badgeId,children:["#",e.id]})]}),e.fan_name||e.handle||e.creator_name?t.jsxs("div",{className:a.momentInfo,children:[t.jsxs("span",{className:a.momentText,children:[e.fan_name?t.jsx("strong",{className:a.momentName,children:e.fan_name}):null,e.handle?t.jsx("span",{className:a.momentHandle,children:e.handle}):null]}),e.creator_name?t.jsx("span",{className:a.creatorBadge,children:e.creator_name}):null]}):null]})]})]}),t.jsx("button",{type:"button",className:a.shareBtn,onClick:()=>g(e),children:"Share"})]},e.id))}),!l&&s&&s.length>
10&&!u?t.jsx("div",{className:a.loadMoreWrap,children:t.jsx("button",{type:"button",className:a.loadMoreBtn,onClick:B,disabled:m,children:m?"Loadingâ¦":"Load More"})}):null]}),t.jsx(W,{moment:b,onClose:()=>g(null)})]})}export{me 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.